{"version":3,"file":"pdf-viewer-min.js","mappings":";;;;;;AAAA;AACA,EAAE,KAA4D;AAC9D,EAAE,CAC4D;AAC9D,CAAC,qBAAqB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,cAAc;AAC3B,aAAa,QAAQ;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,SAAS;AACtB,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,SAAS;AACtB,cAAc,mBAAmB;AACjC;AACA;AACA;AACA;AACA,0BAA0B,mBAAmB;AAC7C;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,aAAa,WAAW;AACxB,aAAa,MAAM;AACnB,cAAc,SAAS;AACvB;AACA;AACA,oBAAoB,qBAAqB;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,iBAAiB;AAC9B,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,4BAA4B;AACzC,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,kEAAkE;AAClE;;AAEA;AACA;AACA;AACA;AACA;AACA,sBAAsB,kBAAkB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB,cAAc,SAAS;AACvB;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,0BAA0B,kBAAkB;;AAE5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA,aAAa,oBAAoB;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,4CAA4C;AACtE,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,oCAAoC,WAAW;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA,4CAA4C,6BAA6B;;AAEzE;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,gCAAgC;AAChC;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,iCAAiC;AACrD;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR,uBAAuB;AACvB,sBAAsB,qBAAqB;AAC3C;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,oBAAoB;AAC1D;;AAEA;AACA,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,6BAA6B,yBAAyB;AACtD;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,+BAA+B;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,yBAAyB,kCAAkC;AAC3D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA,aAAa,SAAS;AACtB,cAAc,SAAS;AACvB;AACA;AACA;AACA,2BAA2B,kCAAkC;AAC7D;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,8CAA8C;;AAE9C,+DAA+D;;AAE/D;AACA;AACA,wBAAwB,SAAS;;AAEjC,0CAA0C,WAAW;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,4BAA4B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL;;AAEA;AACA,aAAa,qBAAqB;AAClC,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,qBAAqB;AAClC;AACA;AACA;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,WAAW;;AAE5C,8BAA8B,SAAS;AACvC;AACA;AACA;AACA;AACA,yDAAyD;;AAEzD;AACA;AACA,0EAA0E;AAC1E;AACA;AACA;;AAEA;AACA,qBAAqB;;AAErB;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,CAAC;;;;;;;;ACj2BD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI,IAAyD;AAC7D;AACA,MAAM,EAKqD;AAC3D,CAAC;AACD,yBAAyB;AACzB;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,yBAAyB,IAAI;AAC7B;AACA;;AAEA;AACA;AACA,4BAA4B,IAAI;AAChC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,IAAI;AAC9B;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,kBAAkB,YAAY;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,YAAY;AAC9B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,kBAAkB,YAAY;AAC9B;AACA;;AAEA;AACA;;AAEA,kBAAkB,YAAY;AAC9B;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe,cAAc,EAAE,cAAc,EAAE,cAAc;AAC7D;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,QAAQ;AACR,oCAAoC,GAAG;AACvC;AACA;AACA;;AAEA;;AAEA,mCAAmC,QAAQ;AAC3C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA,gBAAgB,MAAM;AACtB,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,mCAAmC,QAAQ;AAC3C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oCAAoC,QAAQ;AAC5C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,yDAAyD,GAAG;AAC5D;AACA,UAAU;AACV;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,qBAAqB,gCAAgC;AACrD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,IAAI,IAAI;AACR;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa;AACb;AACA;;AAEA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;;AAEA,4BAA4B;AAC5B;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,mDAAmD,QAAQ;AAC3D;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA,SAAS;AACT;AACA;AACA;;AAEA,4FAA4F;AAC5F;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,UAAc;AACzC;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sCAAsC,IAAI,GAAG;AAC7C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mDAAmD;;AAEnD;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,aAAa;AACb,YAAY;AACZ;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,wBAAwB,6BAA6B;AACrD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP,KAAK;AACL,gFAAgF,eAAe;AAC/F,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+BAA+B,UAAc;AAC7C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gEAAgE,OAAO;AACvE;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,wEAAwE,eAAe;AACvF;;AAEA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,gBAAgB,GAAG,6DAA6D;AACnG;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,0DAA0D,cAAc;AACxE;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;;AAEA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;;AAEA;AACA,4DAA4D,KAAK;AACjE;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;;AAEA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,qDAAqD,KAAK;AAC1D;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,8CAA8C,iBAAiB;AAC/D;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,mEAAmE,MAAM;AACzE;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uDAAuD;AACvD;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,uGAAuG,oBAAoB;AAC3H;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,qBAAqB,IAAI,GAAG,oBAAoB;AAChD;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,4BAA4B,QAAQ;AACpC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,6BAA6B,aAAa;AAC1C,4BAA4B,aAAa;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA,6BAA6B,aAAa;AAC1C,4BAA4B,aAAa;AACzC;;AAEA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B,0BAA0B;AACxD,+BAA+B,4BAA4B;AAC3D;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,cAAc,6BAA6B,EAAE,WAAW;AACxD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sDAAsD,KAAK;AAC3D;;AAEA;AACA;;AAEA;AACA;AACA,wDAAwD,KAAK;AAC7D;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,2BAA2B,EAAE,SAAS;AAC3D;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iDAAiD,WAAW;AAC5D;;AAEA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oDAAoD,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,2BAA2B,EAAE,mBAAmB,EAAE;AAC7K;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gDAAgD,MAAM;AACtD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,wCAAwC,mCAAmC,WAAW,IAAI;AAC1F,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,aAAa,EAAE,SAAS;AAC3C;AACA,sDAAsD,IAAI;AAC1D,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,mCAAmC,MAAM;AACzC,oCAAoC,OAAO;AAC3C;;AAEA;AACA,uCAAuC,OAAO,EAAE,OAAO;AACvD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,yCAAyC,QAAQ;AACjD;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,gDAAgD,WAAW;;AAE3D;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA,WAAW;;AAEX,kDAAkD,sBAAsB,MAAM,GAAG;AACjF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC,wBAAwB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kCAAkC,WAAW,EAAE,sBAAsB;AACrE;AACA;AACA;AACA;AACA;AACA;;AAEA,kDAAkD,QAAQ;AAC1D;AACA;;AAEA;AACA;AACA;;AAEA;AACA,0CAA0C,SAAS,WAAW,EAAE;AAChE,gCAAgC,eAAe,eAAe,EAAE,MAAM,KAAK;AAC3E;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,kEAAkE;AAClE,MAAM;AACN;AACA;AACA;;AAEA;AACA,+BAA+B,6BAA6B;AAC5D;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,eAAe,SAAS,WAAW,EAAE;AACjE;;AAEA;AACA,0BAA0B,eAAe,gBAAgB,EAAE,MAAM,KAAK;AACtE,MAAM;AACN,gCAAgC,6BAA6B;;AAE7D;AACA,sCAAsC,6BAA6B,IAAI;AACvE;;AAEA,0BAA0B,eAAe,4BAA4B,EAAE,EAAE,IAAI,MAAM,KAAK;AACxF;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA,OAAO;;AAEP,iEAAiE,GAAG;AACpE;AACA;;AAEA;AACA;;AAEA;AACA;AACA,oDAAoD;AACpD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,cAAc,WAAW;AACzB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,cAAc,YAAY;AAC1B;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB,WAAW;AAC3B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,cAAc,WAAW;AACzB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,cAAc,sBAAsB;AACpC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;;AAER;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,gBAAgB,iBAAiB;AACjC;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,UAAU;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA,gBAAgB,gBAAgB;AAChC;AACA;;AAEA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;;AAEA;;AAEA,iCAAiC,IAAI;AACrC;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB,aAAa;AACrC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ,uCAAuC,aAAa;AACpD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA,0CAA0C,QAAQ;AAClD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,YAAY;AAC9B;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,YAAY;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,YAAY;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA,oBAAoB,cAAc;AAClC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,EAAE;;AAE3E;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,wCAAwC,QAAQ;AAChD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,6CAA6C,YAAY;AACzD;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA,yBAAyB,KAAK,KAAK,qBAAqB;AACxD;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA,uBAAuB,QAAQ,EAAE,MAAM,EAAE,gBAAgB,KAAK,SAAS;AACvE;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAgB,kBAAkB;AAClC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,gBAAgB,kBAAkB;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,4CAA4C,qBAAqB;AACjE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,2CAA2C,QAAQ;AACnD;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2CAA2C,QAAQ;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR,kEAAkE,YAAY;AAC9E;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,WAAW;AAChC;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,UAAU;AAChC;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,UAAU;AAC5B;;AAEA,wBAAwB,UAAU;AAClC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,kCAAkC,QAAQ;AAC1C;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yCAAyC,QAAQ;AACjD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,sCAAsC,MAAM;AAC5C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,+DAA+D,UAAU;AACzE;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN,oDAAoD,YAAY;AAChE;;AAEA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,YAAY;AAC9B,6CAA6C,cAAc;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,oBAAoB,oBAAoB;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,qDAAqD,WAAW;AAChE;;AAEA;;AAEA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,uDAAuD,YAAY;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,gEAAgE,WAAW;AAC3E;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;;AAEP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,oBAAoB,YAAY;AAChC;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR,6DAA6D,QAAQ;AACrE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,iEAAiE,GAAG;AACpE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,iEAAiE,GAAG;AACpE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,iEAAiE,GAAG;AACpE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,iEAAiE,GAAG;AACpE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yDAAyD,aAAa;AACtE;AACA;;AAEA,0CAA0C,WAAW;AACrD;AACA;;AAEA;AACA;AACA,2DAA2D,GAAG;AAC9D;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;AACA;AACA,eAAe,mBAAO,CAAC,GAAI;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA,mBAAmB,mBAAO,CAAC,GAAQ;;AAEnC;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,8CAA8C,KAAK;AACnD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,sCAAsC,QAAQ;AAC9C;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC,QAAQ;AACjD;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,MAAM;AACN,6BAA6B,eAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,8BAA8B,WAAW,EAAE,uCAAuC;AAClF;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wCAAwC,QAAQ;AAChD;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,WAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;AAEN;AACA,2BAA2B,aAAa;AACxC,0BAA0B,6CAA6C;AACvE,MAAM;AACN,0BAA0B,aAAa;AACvC,2BAA2B,6CAA6C;AACxE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gBAAgB,mBAAmB;AACnC;AACA;;AAEA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,mCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC,WAAW;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA,uCAAuC,uBAAuB;AAC9D;AACA;;AAEA;AACA,+BAA+B,iBAAiB,mCAAmC,eAAe;AAClG;AACA,QAAQ;AACR,+BAA+B,MAAM,mCAAmC,OAAO;AAC/E;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA,8BAA8B,sCAAsC;AACpE,6BAA6B,uCAAuC;AACpE;AACA;AACA,MAAM;;AAEN;AACA,iCAAiC,wBAAwB;AACzD,kCAAkC,0BAA0B;AAC5D,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA,+BAA+B,aAAa;AAC5C,gCAAgC,cAAc;AAC9C;AACA;;AAEA;AACA;AACA;AACA,0EAA0E,SAAS;AACnF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,yEAAyE,GAAG;;AAE5E;AACA,yEAAyE,GAAG;AAC5E;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA,MAAM;AACN;;AAEA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;;AAEA;AACA;AACA;;AAEA,uEAAuE,GAAG;;AAE1E;AACA;AACA,UAAU;AACV,yEAAyE,GAAG;AAC5E;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA,6BAA6B,iBAAiB;AAC9C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,UAAU;;AAEV;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,aAAa;;AAEb;AACA;AACA;AACA,gBAAgB;AAChB;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf,aAAa;;AAEb;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;;AAEA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,YAAY;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,8CAA8C,UAAU;AACxD;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;;AAEA;AACA,OAAO;;AAEP;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;;AAEA;AACA,OAAO;;AAEP;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,yCAAyC;AACzC,OAAO;AACP;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb,WAAW;;AAEX;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,WAAW;;AAEX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,WAAW;;AAEX;AACA;AACA;AACA,cAAc;;AAEd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,WAAW;;AAEX;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb,WAAW;;AAEX;AACA;AACA;;AAEA;;AAEA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;;AAEP;AACA,MAAM;AACN;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA,MAAM;;AAEN;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,6CAA6C,mBAAmB;AAChE;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wCAAwC;AAC3E,kCAAkC,wCAAwC;AAC1E;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,wCAAwC,MAAM,IAAI,MAAM;AACxD;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA,MAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,uCAAuC,QAAQ;AAC/C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,EAAE,GAAG,EAAE;AAC9B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,2BAA2B,gCAAgC,EAAE,GAAG;AAChE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;;AAEV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,gEAAgE,GAAG;;AAEnE;AACA;AACA;;AAEA;AACA;AACA,QAAQ;;AAER;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe,EAAE,EAAE,EAAE,EAAE,EAAE;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE,EAAE,EAAE,EAAE,EAAE;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,MAAM;AACN;;AAEA;AACA,2BAA2B,gBAAgB,GAAG,OAAO;AACrD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA,kCAAkC,wCAAwC;AAC1E;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,gCAAgC,wCAAwC;AACxE;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB,kBAAkB,KAAK,WAAW;AAClD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC,QAAQ;AAC9C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sCAAsC,QAAQ;AAC9C;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA,0BAA0B,KAAK;AAC/B,yBAAyB,IAAI;AAC7B,8BAA8B,WAAW;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,WAAW;AAC7B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC,QAAQ;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gBAAgB,QAAQ;AACxB;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB,QAAQ;AACxB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;;AAEA,gBAAgB,QAAQ;AACxB;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,gBAAgB,QAAQ;AACxB;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,sBAAsB,4DAA4D;AAClF;AACA;;AAEA,sBAAsB,sEAAsE;AAC5F;AACA;;AAEA,kBAAkB,oCAAoC;AACtD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,gBAAgB;AACrB;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,+FAA+F;;AAE/F;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,wCAAwC,SAAS;AACjD;AACA;AACA;AACA;;AAEA;;AAEA;AACA,kDAAkD,YAAY;AAC9D;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;;AAER;AACA,sCAAsC,kCAAkC,KAAK,WAAW;AACxF;AACA;AACA;;AAEA;AACA;AACA,QAAQ;;AAER;AACA;;AAEA;AACA;AACA;;AAEA,8BAA8B,MAAM;AACpC;AACA;;AAEA;AACA,4BAA4B,wBAAwB,OAAO,UAAU;AACrE;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,SAAS;AACT;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gDAAgD,QAAQ;AACxD;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,6BAA6B,oBAAoB;AACjD,0CAA0C,qBAAqB;AAC/D,UAAU;AACV;AACA;;AAEA;AACA,6BAA6B,uCAAuC;AACpE,UAAU;AACV;AACA;;AAEA;AACA,6BAA6B,uBAAuB;AACpD,UAAU;AACV;AACA;;AAEA;AACA,6BAA6B,sCAAsC;AACnE,0CAA0C,uCAAuC;AACjF,UAAU;AACV;AACA;;AAEA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,yBAAyB,aAAa;;AAEtC,sCAAsC,QAAQ;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oBAAoB,SAAS;AAC7B;;AAEA,sBAAsB,OAAO;AAC7B;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,0BAA0B,SAAS;AACnC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0BAA0B,SAAS;AACnC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA,uBAAuB,sCAA2B;AAClD;AACA,SAAS;;AAET;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,YAAY;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wBAAwB,YAAY;AACpC;;AAEA,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,wBAAwB,UAAU,EAAE,SAAS;AAC7C;;AAEA;AACA;AACA,yBAAyB,MAAM;AAC/B;AACA,MAAM;AACN;AACA,4BAA4B,UAAU,EAAE,SAAS;AACjD;AACA;;AAEA,qBAAqB,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,OAAO,SAAS;AAC/F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2CAA2C,QAAQ;AACnD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;;AAEA,2CAA2C,QAAQ;AACnD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sDAAsD,GAAG;AACzD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,qBAAqB;AAC9E;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,qBAAqB;AAC9E;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;;AAEV;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA,yDAAyD,qBAAqB;;AAE9E;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,8DAA8D,gBAAgB,QAAQ,eAAe;AACrG;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,iDAAiD,gBAAgB,mBAAmB,EAAE,iBAAiB,IAAI,IAAI;AAC/G;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,eAAe;;AAEhD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,IAAI;AAC9C,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,eAAe;AACrD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2DAA2D,QAAQ;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB,UAAU;;AAEnC;AACA;AACA;;AAEA;AACA;;AAEA;AACA,8CAA8C,QAAQ;AACtD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gCAAgC,YAAY;AAC5C;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,sCAAsC,OAAO;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,qBAAqB,uCAAuC;AAC5D;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oEAAoE,IAAI;AACxE;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,0DAA0D,OAAO;AACjE;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,eAAe,EAAE,gBAAgB;;AAExF;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,8BAA8B,YAAY;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,eAAe;AAC/D;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA,WAAW,mBAAO,CAAC,GAAI;;AAEvB,aAAa,mBAAO,CAAC,CAAM;;AAE3B,cAAc,mBAAO,CAAC,GAAO;;AAE7B,YAAY,mBAAO,CAAC,GAAK;;AAEzB;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gCAAgC,UAAU;AAC1C;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oEAAoE,UAAU;AAC9E;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,uCAAuC,MAAM,GAAG,QAAQ;;AAExD;AACA;AACA,oEAAoE,UAAU;AAC9E;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,gEAAgE,KAAK;AACrE;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,8EAA8E,OAAO,0BAA0B,IAAI;AACnH;;AAEA;AACA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6BAA6B,qDAAqD,OAAO;AACzF;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,oBAAoB,oBAAoB;AACxC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,kBAAkB;AACxC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C,EAAE;AAC7C;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,QAAQ;;AAER;AACA,KAAK;AACL;;AAEA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,6CAA6C,WAAW,GAAG,aAAa;AACxE;AACA,MAAM;AACN;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,2CAA2C,MAAM,GAAG,QAAQ;;AAE5D;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA,KAAK;AACL,IAAI;AACJ;AACA;AACA,MAAM;;AAEN;AACA;AACA,MAAM;;AAEN;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA,CAAC;;AAED;AACA,UAAU;AACV;AACA,CAAC;AACD;;;;;;;AC5zmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI,IAAyD;AAC7D;AACA,MAAM,EAK6D;AACnE,CAAC;AACD,yBAAyB;AACzB;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;;AAEA;AACA;AACA,EAAE;AACF,aAAa,mBAAO,CAAC,GAAiB;AACtC;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,kBAAkB,YAAY;AAC9B,qBAAqB,aAAa,KAAK,YAAY;AACnD,6BAA6B,UAAU,MAAM,SAAS;AACtD,6BAA6B,UAAU,MAAM,SAAS;AACtD,sCAAsC,MAAM,IAAI,MAAM;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,QAAQ,IAAI,WAAW,OAAO,GAAG,aAAa;AACnG,0DAA0D,QAAQ,IAAI,WAAW,OAAO,GAAG,MAAM,IAAI,aAAa;AAClH;AACA;AACA,6BAA6B,UAAU;AACvC;AACA;AACA;AACA,yBAAyB,MAAM;AAC/B,4BAA4B,MAAM;AAClC,0CAA0C,MAAM;AAChD;AACA;AACA,8BAA8B,UAAU,KAAK,QAAQ;AACrD,gCAAgC,UAAU,KAAK,QAAQ;AACvD,8CAA8C,QAAQ;AACtD,gDAAgD,QAAQ;AACxD;AACA,iCAAiC,UAAU,UAAU,OAAO;AAC5D,6BAA6B,SAAS;AACtC,yBAAyB,OAAO;AAChC,uBAAuB,MAAM;AAC7B,uBAAuB,MAAM;AAC7B;AACA;AACA;AACA;AACA;AACA,yBAAyB,OAAO;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC,mCAAmC;AACnE;;AAEA;AACA,sCAAsC,mCAAmC;AACzE;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,yBAAyB,EAAE,aAAa,EAAE;AAC1C,0CAA0C,cAAc;AACxD,GAAG;AACH;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE,IAAI;AACN;AACA;AACA;;AAEA;;AAEA;AACA;AACA,IAAI;AACJ;AACA,8BAA8B,eAAe;;AAE7C;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,mEAAmE,QAAQ,kDAAkD,QAAQ;AACrI,SAAS;AACT;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN,+DAA+D,QAAQ,yDAAyD,QAAQ;AACxI;AACA;;AAEA;AACA,+DAA+D,WAAW,+CAA+C,QAAQ;AACjI;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA,wDAAwD,aAAa,qDAAqD,KAAK;AAC/H;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,iDAAiD,IAAI;AACrD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,UAAU;AACV;AACA;AACA;AACA,aAAa;AACb,YAAY;AACZ;AACA;AACA,aAAa;AACb,YAAY;AACZ;AACA;AACA,cAAc;AACd;AACA;AACA,eAAe;AACf;AACA,YAAY;AACZ,sDAAsD,QAAQ;AAC9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA;;AAEA,gDAAgD,eAAe;AAC/D;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA,0CAA0C,YAAY,QAAQ,YAAY,GAAG,YAAY;AACzF;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0CAA0C,YAAY,QAAQ,YAAY,GAAG,YAAY;AACzF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,gBAAgB;AACpC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0BAA0B,QAAQ;AAClC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,qDAAqD,cAAc;AACnE;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,0DAA0D,eAAe;AACzE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA,KAAK,sBAAsB;AAC3B;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,0CAA0C,kBAAkB,uCAAuC,cAAc;AACjH;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,2CAA2C,IAAI;AAC/C;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C,IAAI;AAC9C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK,UAAU;;AAEf;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;;AAEP;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;;AAEA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA,UAAU;AACV,0DAA0D,KAAK;AAC/D;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,8BAA8B,uBAAuB;AACrD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW;AACX,gDAAgD,SAAS;;AAEzD;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;;AAEA,6CAA6C,QAAQ;AACrD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,uCAAuC,MAAM;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA,4CAA4C,WAAW;AACvD;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,8CAA8C,kBAAkB;AAChE;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,WAAW;;AAE5C;AACA,gCAAgC,qBAAqB,GAAG,QAAQ,GAAG,OAAO;AAC1E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA,uCAAuC,WAAW;AAClD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,sCAAsC,WAAW;AACjD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA,6CAA6C,QAAQ;AACrD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,+DAA+D,QAAQ;AACvE;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,8CAA8C,KAAK;AACnD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,8CAA8C,KAAK;AACnD;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA,2CAA2C,QAAQ;AACnD;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,qDAAqD,SAAS;AAC9D;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd,4DAA4D,QAAQ;AACpE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,qEAAqE,OAAO;AAC5E;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wDAAwD,KAAK;AAC7D;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN,gDAAgD,GAAG;AACnD;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN,sDAAsD,GAAG;AACzD;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN,yCAAyC,GAAG;AAC5C;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC,QAAQ;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uCAAuC,iBAAiB,aAAa,OAAO,IAAI,OAAO;;AAEvF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,+CAA+C,gBAAgB,kBAAkB,MAAM,mBAAmB,OAAO,IAAI,OAAO;AAC5H;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;;AAEf;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP,KAAK;AACL;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qFAAqF,QAAQ;AAC7F;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;;AAEzC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0DAA0D,KAAK;AAC/D;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,+CAA+C,MAAM,EAAE,GAAG;AAC1D;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,gBAAgB;AACpC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,6CAA6C,QAAQ;AACrD;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA,wCAAwC,OAAO;AAC/C,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA,yCAAyC,QAAQ;AACjD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4BAA4B,WAAW;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA,qBAAqB,QAAQ;AAC7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,QAAQ;AACR;;AAEA,yDAAyD,SAAS;AAClE;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;;AAEA,yCAAyC,QAAQ;AACjD;AACA;;AAEA,kDAAkD,UAAU;AAC5D;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,sDAAsD,IAAI;AAC1D;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR,6CAA6C,GAAG;AAChD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,gDAAgD,QAAQ;AACxD;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,wCAAwC;AACxC;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,mKAAmK,MAAM,eAAe,MAAM;AAC9L;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA,oBAAoB,eAAe;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,qBAAqB,sCAAsC;AAC3D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,oBAAoB,EAAE,aAAa,EAAE;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,8BAA8B,cAAc;AAC5C;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,oBAAoB,+BAA+B;AACnD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oBAAoB,kBAAkB;AACtC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,gBAAgB,aAAa;AAC7B,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,EAAE;AACjC,yCAAyC,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE;AAChF,8CAA8C,EAAE,KAAK,EAAE;AACvD,8CAA8C,EAAE,OAAO,EAAE;AACzD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,wBAAwB,QAAQ,QAAQ,EAAE;;AAE1C;AACA;AACA,MAAM;AACN,0EAA0E,6BAA6B;AACvG;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,QAAQ;AAC9B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sBAAsB,SAAS;AAC/B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,iBAAiB;AACvC;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,wBAAwB,GAAG;AAC3B;;AAEA;AACA,sBAAsB,GAAG;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,GAAG,IAAI,EAAE;AAC3B;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB,MAAM,MAAM,yBAAyB,QAAQ,EAAE;AAClE;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA,qBAAqB,UAAU;AAC/B,SAAS;AACT;AACA;;AAEA,sBAAsB,qBAAqB,EAAE,yBAAyB;AACtE;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,uDAAuD,QAAQ;AAC/D;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT,+DAA+D,MAAM;AACrE;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,cAAc;AACpC;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA,sBAAsB,aAAa;AACnC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN,sCAAsC,iBAAiB;AACvD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA,8CAA8C,UAAU;AACxD;AACA,MAAM;AACN,8CAA8C,aAAa;AAC3D;AACA,MAAM;AACN;AACA,gDAAgD,WAAW;AAC3D;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C,WAAW;AACxD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,WAAW;AAC/B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA,oBAAoB,QAAQ,GAAG,iBAAiB;AAChD;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,yCAAyC,QAAQ;AACjD;AACA;AACA;AACA;;AAEA;AACA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN,yDAAyD,eAAe;AACxE;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,mBAAmB;AACnB;AACA;AACA,OAAO;;AAEP;AACA;AACA,OAAO;AACP,MAAM;AACN,yDAAyD,eAAe;AACxE;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW;;AAEX;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kEAAkE,UAAU;;AAE5E;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,sBAAsB;AAC7B;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;;AAEN;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;;;;AAIA;AACA;AACA,CAAC;AACD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,CAAC;;AAED;AACA,UAAU;AACV;AACA,CAAC;AACD;;;;;;;ACpkSA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,WAAW,SAAS;AACpB;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;;AAEA;AACA,aAAa,QAAQ;AACrB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;;AAEA;AACA;AACA,WAAW,6BAA6B;AACxC,aAAa;AACb;AACA,6BAA6B,wBAAwB;AACrD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,QAAQ;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,cAAc,aAAa;AAC3B,cAAc,OAAO;AACrB;AACA;AACA,cAAc,SAAS;AACvB;AACA;AACA,cAAc,SAAS;AACvB;AACA,cAAc,SAAS;AACvB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,aAAa,QAAQ,GAAG,uBAAuB,yBAAyB,GAAG;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC,cAAc;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,GAAG;AACH;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mDAAmD,cAAc;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAe;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,QAAQ,cAAc,YAAY;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;;AA4CE;;;;;ACn3BF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUuB;AAC2B;;AAElD;;AAEA;AACA,aAAa,QAAQ;AACrB,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,kBAAkB;AAChC;AACA,cAAc,mBAAmB;AACjC;AACA,cAAc,mBAAmB;AACjC;AACA,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC;AACA,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC;AACA,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC;AACA;;AAEA;AACA;;AAEA;AACA,YAAY,gBAAgB;AAC5B,YAAY,UAAU;AACtB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,sDAAsD;AAC3D,KAAK,8CAA8C;AACnD,KAAK,8CAA8C;AACnD,KAAK,gDAAgD;AACrD,KAAK,4CAA4C;AACjD,KAAK,kDAAkD;AACvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C,mBAAmB,aAAa;AAChC;AACA;;AAEA;AACA,2CAA2C,cAAc;AACzD;;AAEA;AACA,UAAU,sCAAsC;AAChD;;AAEA;AACA,eAAe,mCAAmC;AAClD,mBAAmB,oBAAoB;AACvC;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,KAAK;AACL,IAAI;AACJ;AACA,kBAAkB,wBAAwB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,IAAI;AACJ;;AAEA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,kBAAkB,wBAAwB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,kCAAkC,oBAAoB;AACtD;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,MAAM,MAAM,6BAAyB,4BAA4B;AACjE;AACA,WAAW,iCAA6B;AACxC;AACA;AACA,KAAK;AACL;AACA,WAAW,4BAAwB;AACnC;AACA;AACA,KAAK;AACL;;AAEA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,MAAM,6BAAyB,EAAE;AACxC;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU,2DAA2D;AACrE;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,gCAAgC,YAAY;AAC5C;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B,wBAAwB;AACpD;AACA;AACA,KAAK;AACL,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA,wCAAwC,SAAS;AACjD,uCAAuC,SAAS;;AAEhD;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA,UAAU,aAAa;AACvB,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU,cAAc;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gBAAgB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wCAAwC,cAAc;AACtD,gBAAgB,gBAAgB,EAAE,iBAAiB;;AAEnD;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG,oBAAoB;AACvB;AACA,OAAO,SAAS;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEmB;;;ACvanB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;;AAE2C;;;AClH3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,+CAA+C;AAC7D,cAAc,kCAAkC;AAChD,cAAc,wCAAwC;;AAEgB;AACf;AACvD,QAAQ,0BAA0B,EAAE,mBAAO,CAAC,GAAY;;AAExD;AACA;AACA;AACA;AACA;AACA;;AAEA,0BAA0B;AAC1B,qCAAqC;AACrC,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kCAAkC,GAAG;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+BAA+B,EAAE;AACjC;AACA,YAAY,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE;AACnD,8CAA8C,EAAE,KAAK,EAAE;AACvD,8CAA8C,EAAE,OAAO,EAAE;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ,QAAQ;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,sBAAsB,QAAQ,QAAQ,EAAE;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,sBAAsB;AACtB,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,SAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS,qBAAqB;AAC9B;AACA;AACA;;AAEA,SAAS,qBAAqB;AAC9B;AACA;AACA;;AAEA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,cAAc,iBAAiB;AAC/B,cAAc,UAAU;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,0BAA0B;AACtC;AACA,eAAe,uBAAuB;AACtC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU,OAAO;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,4BAA4B;AAC5B,KAAK;AACL;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,+BAA+B;;AAE/B;AACA;AACA;AACA;AACA,EAAE,cAAc;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,gBAAgB,YAAY,gBAAgB;AACnD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,gBAAgB,WAAW,gBAAgB;AAClD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,UAAU,kBAAkB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,GAAG;AACxB;AACA;AACA;AACA,mBAAmB,GAAG;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG,IAAI,EAAE;AACxB;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM,MAAM,yBAAyB,QAAQ,EAAE;AAC9D;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAU,0CAA0C;AACpD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,UAAU;AAC3B,MAAM;AACN;AACA;AACA;;AAEA,oBAAoB,qBAAqB,EAAE,yBAAyB;AACpE;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,qDAAqD,QAAQ;AAC7D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,+CAA+C,MAAM;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,2BAA2B;;AAE3B,mBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B,GAAG;AACH;;AAEA;AACA,UAAU,oBAAoB;AAC9B;AACA;AACA;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEwC;;;AC5/BxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEqD;;AAErD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,8BAA8B;AAChD;AACA;AACA,IAAI;AACJ;AACA,kBAAkB,2BAA2B;AAC7C;AACA;AACA,IAAI;AACJ;AACA,kBAAkB,qBAAqB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,kBAAkB,oCAAoC;AACtD;AACA;AACA,IAAI;AACJ;AACA,kBAAkB,gCAAgC;AAClD;AACA;AACA,IAAI;AACJ;AACA,kBAAkB,8BAA8B;AAChD;AACA;AACA,IAAI;AACJ;AACA,kBAAkB,+BAA+B;AACjD;AACA;AACA,IAAI;AACJ;AACA,kBAAkB,4BAA4B;AAC9C;AACA;AACA,IAAI;AACJ;AACA,kBAAkB,iCAAiC;AACnD;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA,QAAQ,eAAe;AACvB;AACA,QAAQ,iBAAiB;AACzB;AACA;AACA,QAAQ,mBAAmB;AAC3B;AACA;AACA;AACA,QAAQ,iBAAiB;AACzB;AACA,qBAAqB,4BAA4B;AACjD;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;AACA,cAAc,mBAAmB;AACjC;AACA;AACA,kBAAkB,yBAAyB;AAC3C;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;;AAEA,sBAAsB,yBAAyB,IAAI;AACnD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gBAAgB;AACzD;AACA;AACA;AACA,mBAAmB,kCAAkC;AACrD;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,2CAA2C,cAAc;AACzD;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB,qBAAqB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEsB;;;ACtQtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,YAAY,mBAAmB;AAC/B,YAAY,SAAS;AACrB;AACA,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,+BAA+B,eAAe;;AAE9C;AACA;AACA;AACA;AACA;AACA,0BAA0B,mBAAO,CAAC,GAAyC;AAC3E;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA,YAAY,mBAAmB;AAC/B,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY,mBAAmB;AAC/B,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY,mBAAmB;AAC/B,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAE0B;;;ACrH1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B;AAC3B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;;AAEF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,SAAS;AACtB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;;AAEF;AACA,aAAa,QAAQ;AACrB;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,KAAK;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEuD;;;AC1ZvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,YAAY,SAAS;AACrB,YAAY,UAAU;AACtB,YAAY,mBAAmB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEqB;;;AC5KrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAE6C;AACS;;AAEtD;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,cAAc,gBAAgB;AAC9B,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,oBAAoB,YAAY;AAC9C;AACA;;AAEA;AACA;AACA,YAAY,uBAAuB;AACnC;AACA,eAAe,2DAA2D;AAC1E;AACA;;AAEA;AACA;;AAEA,sBAAsB,SAAS;AAC/B;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,WAAW,QAAQ,sBAAsB,WAAW;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,QAAQ;AACpB,yDAAyD,WAAW;AACpE;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,SAAS,gCAAgC;AACzC;;AAEA;AACA;AACA;AACA;AACA,SAAS,4BAA4B;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEsC;;;AChJtC,iBAAiB,mBAAO,CAAC,GAAY;AAmBd;AACgB;AACsB;AACd;AACO;AACI;;AAES;;AAEnE,oBAAoB,mBAAO,CAAC,GAA8B;;AAE1D,qDAAqD;AACrD,0CAA0C;AAC1C,0CAA0C;;AAE1C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAM,uBAAmB;AACzB,MAAM,aAAS;AACf,MAAM,aAAS;;AAEf;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA,UAAU,YAAY;AACtB;AACA;AACA;;AAEA,4BAA4B,cAAc;;AAE1C;AACA;AACA,uBAAuB,cAAc;AACrC,oBAAoB,cAAc;AAClC,0BAA0B,cAAc;AACxC,GAAG;AACH;;AAEA,6BAA6B,iBAAiB;AAC9C;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,cAAc;AAChC;AACA,GAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,sBAAsB,UAAU;AAChC;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,cAAc;AAC1C;AACA;AACA,qBAAqB,eAAe;AACpC,GAAG;;AAEH,qBAAqB,OAAO;;AAE5B;AACA;AACA;;AAEA;AACA,sCAAsC,mBAAmB;AACzD;AACA,MAAM,mBAAmB;AACzB,MAAM,eAAe;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,UAAU,4DAA4D;AACtE;;AAEA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,yCAAyC;;AAEzC;AACA;AACA,UAAU,6BAA6B,GAAG,uBAAuB;AACjE,OAAO,+BAA+B,IAAI;AAC1C;AACA,aAAa;AACb,gBAAgB,eAAe;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,UAAU;AACjB;AACA,KAAK;AACL;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB,wCAAwC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH,6CAA6C,cAAc;AAC3D,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW;AACX;AACA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,eAAe;AACjC;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,yCAAyC;;AAEnD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;AACF;AACA;AACA,cAAc,SAAS;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,SAAS;AAChC,KAAK;AACL;AACA,IAAI;AACJ;AACA,EAAE;;AAEF;AACA;AACA,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,UAAU,UAAU,OAAO;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO,2BAA2B;AAClC,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uBAAuB;AAC/B,gBAAgB,OAAO;AACvB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS,yBAAyB;AAClC,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,2BAA2B;AACpC,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA,UAAU,yBAAyB;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,UAAU,yBAAyB;;AAEnC;AACA;AACA;AACA;AACA;AACA,oBAAoB,6BAA6B;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iCAAiC,gBAAgB;AACjD;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,sCAAsC,gBAAgB;AACtD;AACA;AACA,qCAAqC,gBAAgB;AACrD;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA,qDAAqD,gBAAgB;AACrE;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,UAAU,yBAAyB;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,UAAU,eAAe;;AAEzB;AACA;AACA;AACA;AACA,wDAAwD,gBAAgB;AACxE;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,UAAU,QAAQ;AAClB;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,gCAAgC;AAChC,IAAI;AACJ;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA,0BAA0B,cAAc;AACxC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,IAAI;AACJ;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,0BAA0B,uBAAmB;AAC7C;AACA,uBAAuB,aAAS;AAChC,IAAI,6BAA6B,aAAS;AAC1C;AACA,EAAE;;AAEF;AACA;AACA;AACA,0BAA0B,uBAAmB;AAC7C;AACA,uBAAuB,aAAS;AAChC,IAAI,6BAA6B,aAAS;AAC1C;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,qCAAqC,mBAAmB;AACxD,EAAE;AACF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,IAAI,gDAAgD,IAAI;AACxD;AACA;AACA,OAAO,eAAe;AACtB;AACA;AACA;AACA;AACA,OAAO,iBAAiB;AACxB;AACA;AACA,OAAO,iBAAiB;AACxB;AACA;AACA;AACA;AACA,YAAY,eAAe;AAC3B,iBAAiB,eAAe;;AAEhC;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sCAAsC,mBAAmB;AACzD;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,iCAAiC,mBAAmB;AACpD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,mCAAmC,UAAU;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA,iDAAiD,wBAAwB;AACzE;AACA;;AAEA;AACA,SAAS,yBAAyB;;AAElC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAAsB;AAC/B;AACA;AACA,gBAAgB,gBAAgB;AAChC,6BAA6B,cAAc;;AAE3C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iCAAiC,uBAAuB;AACxD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,2CAA2C,cAAc;AACzD;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA,SAAS,iDAAiD;AAC1D;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0DAA0D,IAAI;AAC9D;AACA;AACA;AACA,gBAAgB,4BAA4B;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS,sBAAsB;AAC/B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,sCAAsC,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,yBAAyB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK,iBAAiB;AACtB;AACA;AACA;AACA,mDAAmD,eAAe;AAClE;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,mBAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEgC;;;ACj+DoB;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,CAAC,wBAAwB;AACzB;;AAEA","sources":["webpack://pdfembedder-premium-secure/./node_modules/dialog-polyfill/dist/dialog-polyfill.js","webpack://pdfembedder-premium-secure/./node_modules/pdfjs-dist/build/pdf.js","webpack://pdfembedder-premium-secure/./node_modules/pdfjs-dist/web/pdf_viewer.js","webpack://pdfembedder-premium-secure/ignored|/var/www/sites-work/dev.wp-pdf.localhost/public_html/wp-content/plugins/PDFEmbedder-premium-secure/node_modules/pdfjs-dist/build|canvas","webpack://pdfembedder-premium-secure/ignored|/var/www/sites-work/dev.wp-pdf.localhost/public_html/wp-content/plugins/PDFEmbedder-premium-secure/node_modules/pdfjs-dist/build|fs","webpack://pdfembedder-premium-secure/ignored|/var/www/sites-work/dev.wp-pdf.localhost/public_html/wp-content/plugins/PDFEmbedder-premium-secure/node_modules/pdfjs-dist/build|http","webpack://pdfembedder-premium-secure/ignored|/var/www/sites-work/dev.wp-pdf.localhost/public_html/wp-content/plugins/PDFEmbedder-premium-secure/node_modules/pdfjs-dist/build|https","webpack://pdfembedder-premium-secure/ignored|/var/www/sites-work/dev.wp-pdf.localhost/public_html/wp-content/plugins/PDFEmbedder-premium-secure/node_modules/pdfjs-dist/build|url","webpack://pdfembedder-premium-secure/ignored|/var/www/sites-work/dev.wp-pdf.localhost/public_html/wp-content/plugins/PDFEmbedder-premium-secure/node_modules/pdfjs-dist/build|zlib","webpack://pdfembedder-premium-secure/webpack/bootstrap","webpack://pdfembedder-premium-secure/./assets/js/viewer/ui_utils.js","webpack://pdfembedder-premium-secure/./assets/js/viewer/toolbar.js","webpack://pdfembedder-premium-secure/./assets/js/viewer/pdf_find_utils.js","webpack://pdfembedder-premium-secure/./assets/js/viewer/pdf_find_controller.js","webpack://pdfembedder-premium-secure/./assets/js/viewer/pdf_find_bar.js","webpack://pdfembedder-premium-secure/./assets/js/viewer/overlay_manager.js","webpack://pdfembedder-premium-secure/./assets/js/viewer/app_options.js","webpack://pdfembedder-premium-secure/./assets/js/viewer/grab_to_pan.js","webpack://pdfembedder-premium-secure/./assets/js/viewer/pdf_cursor_tools.js","webpack://pdfembedder-premium-secure/./assets/js/viewer/app.js","webpack://pdfembedder-premium-secure/./assets/js/pdf-js-viewer.js"],"sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.dialogPolyfill = factory());\n}(this, function () { 'use strict';\n\n // nb. This is for IE10 and lower _only_.\n var supportCustomEvent = window.CustomEvent;\n if (!supportCustomEvent || typeof supportCustomEvent === 'object') {\n supportCustomEvent = function CustomEvent(event, x) {\n x = x || {};\n var ev = document.createEvent('CustomEvent');\n ev.initCustomEvent(event, !!x.bubbles, !!x.cancelable, x.detail || null);\n return ev;\n };\n supportCustomEvent.prototype = window.Event.prototype;\n }\n\n /**\n * Dispatches the passed event to both an \"on<type>\" handler as well as via the\n * normal dispatch operation. Does not bubble.\n *\n * @param {!EventTarget} target\n * @param {!Event} event\n * @return {boolean}\n */\n function safeDispatchEvent(target, event) {\n var check = 'on' + event.type.toLowerCase();\n if (typeof target[check] === 'function') {\n target[check](event);\n }\n return target.dispatchEvent(event);\n }\n\n /**\n * @param {Element} el to check for stacking context\n * @return {boolean} whether this el or its parents creates a stacking context\n */\n function createsStackingContext(el) {\n while (el && el !== document.body) {\n var s = window.getComputedStyle(el);\n var invalid = function(k, ok) {\n return !(s[k] === undefined || s[k] === ok);\n };\n\n if (s.opacity < 1 ||\n invalid('zIndex', 'auto') ||\n invalid('transform', 'none') ||\n invalid('mixBlendMode', 'normal') ||\n invalid('filter', 'none') ||\n invalid('perspective', 'none') ||\n s['isolation'] === 'isolate' ||\n s.position === 'fixed' ||\n s.webkitOverflowScrolling === 'touch') {\n return true;\n }\n el = el.parentElement;\n }\n return false;\n }\n\n /**\n * Finds the nearest <dialog> from the passed element.\n *\n * @param {Element} el to search from\n * @return {HTMLDialogElement} dialog found\n */\n function findNearestDialog(el) {\n while (el) {\n if (el.localName === 'dialog') {\n return /** @type {HTMLDialogElement} */ (el);\n }\n if (el.parentElement) {\n el = el.parentElement;\n } else if (el.parentNode) {\n el = el.parentNode.host;\n } else {\n el = null;\n }\n }\n return null;\n }\n\n /**\n * Blur the specified element, as long as it's not the HTML body element.\n * This works around an IE9/10 bug - blurring the body causes Windows to\n * blur the whole application.\n *\n * @param {Element} el to blur\n */\n function safeBlur(el) {\n // Find the actual focused element when the active element is inside a shadow root\n while (el && el.shadowRoot && el.shadowRoot.activeElement) {\n el = el.shadowRoot.activeElement;\n }\n\n if (el && el.blur && el !== document.body) {\n el.blur();\n }\n }\n\n /**\n * @param {!NodeList} nodeList to search\n * @param {Node} node to find\n * @return {boolean} whether node is inside nodeList\n */\n function inNodeList(nodeList, node) {\n for (var i = 0; i < nodeList.length; ++i) {\n if (nodeList[i] === node) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * @param {HTMLFormElement} el to check\n * @return {boolean} whether this form has method=\"dialog\"\n */\n function isFormMethodDialog(el) {\n if (!el || !el.hasAttribute('method')) {\n return false;\n }\n return el.getAttribute('method').toLowerCase() === 'dialog';\n }\n\n /**\n * @param {!DocumentFragment|!Element} hostElement\n * @return {?Element}\n */\n function findFocusableElementWithin(hostElement) {\n // Note that this is 'any focusable area'. This list is probably not exhaustive, but the\n // alternative involves stepping through and trying to focus everything.\n var opts = ['button', 'input', 'keygen', 'select', 'textarea'];\n var query = opts.map(function(el) {\n return el + ':not([disabled])';\n });\n // TODO(samthor): tabindex values that are not numeric are not focusable.\n query.push('[tabindex]:not([disabled]):not([tabindex=\"\"])'); // tabindex != \"\", not disabled\n var target = hostElement.querySelector(query.join(', '));\n\n if (!target && 'attachShadow' in Element.prototype) {\n // If we haven't found a focusable target, see if the host element contains an element\n // which has a shadowRoot.\n // Recursively search for the first focusable item in shadow roots.\n var elems = hostElement.querySelectorAll('*');\n for (var i = 0; i < elems.length; i++) {\n if (elems[i].tagName && elems[i].shadowRoot) {\n target = findFocusableElementWithin(elems[i].shadowRoot);\n if (target) {\n break;\n }\n }\n }\n }\n return target;\n }\n\n /**\n * Determines if an element is attached to the DOM.\n * @param {Element} element to check\n * @return {boolean} whether the element is in DOM\n */\n function isConnected(element) {\n return element.isConnected || document.body.contains(element);\n }\n\n /**\n * @param {!Event} event\n * @return {?Element}\n */\n function findFormSubmitter(event) {\n if (event.submitter) {\n return event.submitter;\n }\n\n var form = event.target;\n if (!(form instanceof HTMLFormElement)) {\n return null;\n }\n\n var submitter = dialogPolyfill.formSubmitter;\n if (!submitter) {\n var target = event.target;\n var root = ('getRootNode' in target && target.getRootNode() || document);\n submitter = root.activeElement;\n }\n\n if (!submitter || submitter.form !== form) {\n return null;\n }\n return submitter;\n }\n\n /**\n * @param {!Event} event\n */\n function maybeHandleSubmit(event) {\n if (event.defaultPrevented) {\n return;\n }\n var form = /** @type {!HTMLFormElement} */ (event.target);\n\n // We'd have a value if we clicked on an imagemap.\n var value = dialogPolyfill.imagemapUseValue;\n var submitter = findFormSubmitter(event);\n if (value === null && submitter) {\n value = submitter.value;\n }\n\n // There should always be a dialog as this handler is added specifically on them, but check just\n // in case.\n var dialog = findNearestDialog(form);\n if (!dialog) {\n return;\n }\n\n // Prefer formmethod on the button.\n var formmethod = submitter && submitter.getAttribute('formmethod') || form.getAttribute('method');\n if (formmethod !== 'dialog') {\n return;\n }\n event.preventDefault();\n\n if (value != null) {\n // nb. we explicitly check against null/undefined\n dialog.close(value);\n } else {\n dialog.close();\n }\n }\n\n /**\n * @param {!HTMLDialogElement} dialog to upgrade\n * @constructor\n */\n function dialogPolyfillInfo(dialog) {\n this.dialog_ = dialog;\n this.replacedStyleTop_ = false;\n this.openAsModal_ = false;\n\n // Set a11y role. Browsers that support dialog implicitly know this already.\n if (!dialog.hasAttribute('role')) {\n dialog.setAttribute('role', 'dialog');\n }\n\n dialog.show = this.show.bind(this);\n dialog.showModal = this.showModal.bind(this);\n dialog.close = this.close.bind(this);\n\n dialog.addEventListener('submit', maybeHandleSubmit, false);\n\n if (!('returnValue' in dialog)) {\n dialog.returnValue = '';\n }\n\n if ('MutationObserver' in window) {\n var mo = new MutationObserver(this.maybeHideModal.bind(this));\n mo.observe(dialog, {attributes: true, attributeFilter: ['open']});\n } else {\n // IE10 and below support. Note that DOMNodeRemoved etc fire _before_ removal. They also\n // seem to fire even if the element was removed as part of a parent removal. Use the removed\n // events to force downgrade (useful if removed/immediately added).\n var removed = false;\n var cb = function() {\n removed ? this.downgradeModal() : this.maybeHideModal();\n removed = false;\n }.bind(this);\n var timeout;\n var delayModel = function(ev) {\n if (ev.target !== dialog) { return; } // not for a child element\n var cand = 'DOMNodeRemoved';\n removed |= (ev.type.substr(0, cand.length) === cand);\n window.clearTimeout(timeout);\n timeout = window.setTimeout(cb, 0);\n };\n ['DOMAttrModified', 'DOMNodeRemoved', 'DOMNodeRemovedFromDocument'].forEach(function(name) {\n dialog.addEventListener(name, delayModel);\n });\n }\n // Note that the DOM is observed inside DialogManager while any dialog\n // is being displayed as a modal, to catch modal removal from the DOM.\n\n Object.defineProperty(dialog, 'open', {\n set: this.setOpen.bind(this),\n get: dialog.hasAttribute.bind(dialog, 'open')\n });\n\n this.backdrop_ = document.createElement('div');\n this.backdrop_.className = 'backdrop';\n this.backdrop_.addEventListener('mouseup' , this.backdropMouseEvent_.bind(this));\n this.backdrop_.addEventListener('mousedown', this.backdropMouseEvent_.bind(this));\n this.backdrop_.addEventListener('click' , this.backdropMouseEvent_.bind(this));\n }\n\n dialogPolyfillInfo.prototype = /** @type {HTMLDialogElement.prototype} */ ({\n\n get dialog() {\n return this.dialog_;\n },\n\n /**\n * Maybe remove this dialog from the modal top layer. This is called when\n * a modal dialog may no longer be tenable, e.g., when the dialog is no\n * longer open or is no longer part of the DOM.\n */\n maybeHideModal: function() {\n if (this.dialog_.hasAttribute('open') && isConnected(this.dialog_)) { return; }\n this.downgradeModal();\n },\n\n /**\n * Remove this dialog from the modal top layer, leaving it as a non-modal.\n */\n downgradeModal: function() {\n if (!this.openAsModal_) { return; }\n this.openAsModal_ = false;\n this.dialog_.style.zIndex = '';\n\n // This won't match the native <dialog> exactly because if the user set top on a centered\n // polyfill dialog, that top gets thrown away when the dialog is closed. Not sure it's\n // possible to polyfill this perfectly.\n if (this.replacedStyleTop_) {\n this.dialog_.style.top = '';\n this.replacedStyleTop_ = false;\n }\n\n // Clear the backdrop and remove from the manager.\n this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_);\n dialogPolyfill.dm.removeDialog(this);\n },\n\n /**\n * @param {boolean} value whether to open or close this dialog\n */\n setOpen: function(value) {\n if (value) {\n this.dialog_.hasAttribute('open') || this.dialog_.setAttribute('open', '');\n } else {\n this.dialog_.removeAttribute('open');\n this.maybeHideModal(); // nb. redundant with MutationObserver\n }\n },\n\n /**\n * Handles mouse events ('mouseup', 'mousedown', 'click') on the fake .backdrop element, redirecting them as if\n * they were on the dialog itself.\n *\n * @param {!Event} e to redirect\n */\n backdropMouseEvent_: function(e) {\n if (!this.dialog_.hasAttribute('tabindex')) {\n // Clicking on the backdrop should move the implicit cursor, even if dialog cannot be\n // focused. Create a fake thing to focus on. If the backdrop was _before_ the dialog, this\n // would not be needed - clicks would move the implicit cursor there.\n var fake = document.createElement('div');\n this.dialog_.insertBefore(fake, this.dialog_.firstChild);\n fake.tabIndex = -1;\n fake.focus();\n this.dialog_.removeChild(fake);\n } else {\n this.dialog_.focus();\n }\n\n var redirectedEvent = document.createEvent('MouseEvents');\n redirectedEvent.initMouseEvent(e.type, e.bubbles, e.cancelable, window,\n e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey,\n e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);\n this.dialog_.dispatchEvent(redirectedEvent);\n e.stopPropagation();\n },\n\n /**\n * Focuses on the first focusable element within the dialog. This will always blur the current\n * focus, even if nothing within the dialog is found.\n */\n focus_: function() {\n // Find element with `autofocus` attribute, or fall back to the first form/tabindex control.\n var target = this.dialog_.querySelector('[autofocus]:not([disabled])');\n if (!target && this.dialog_.tabIndex >= 0) {\n target = this.dialog_;\n }\n if (!target) {\n target = findFocusableElementWithin(this.dialog_);\n }\n safeBlur(document.activeElement);\n target && target.focus();\n },\n\n /**\n * Sets the zIndex for the backdrop and dialog.\n *\n * @param {number} dialogZ\n * @param {number} backdropZ\n */\n updateZIndex: function(dialogZ, backdropZ) {\n if (dialogZ < backdropZ) {\n throw new Error('dialogZ should never be < backdropZ');\n }\n this.dialog_.style.zIndex = dialogZ;\n this.backdrop_.style.zIndex = backdropZ;\n },\n\n /**\n * Shows the dialog. If the dialog is already open, this does nothing.\n */\n show: function() {\n if (!this.dialog_.open) {\n this.setOpen(true);\n this.focus_();\n }\n },\n\n /**\n * Show this dialog modally.\n */\n showModal: function() {\n if (this.dialog_.hasAttribute('open')) {\n throw new Error('Failed to execute \\'showModal\\' on dialog: The element is already open, and therefore cannot be opened modally.');\n }\n if (!isConnected(this.dialog_)) {\n throw new Error('Failed to execute \\'showModal\\' on dialog: The element is not in a Document.');\n }\n if (!dialogPolyfill.dm.pushDialog(this)) {\n throw new Error('Failed to execute \\'showModal\\' on dialog: There are too many open modal dialogs.');\n }\n\n if (createsStackingContext(this.dialog_.parentElement)) {\n console.warn('A dialog is being shown inside a stacking context. ' +\n 'This may cause it to be unusable. For more information, see this link: ' +\n 'https://github.com/GoogleChrome/dialog-polyfill/#stacking-context');\n }\n\n this.setOpen(true);\n this.openAsModal_ = true;\n\n // Optionally center vertically, relative to the current viewport.\n if (dialogPolyfill.needsCentering(this.dialog_)) {\n dialogPolyfill.reposition(this.dialog_);\n this.replacedStyleTop_ = true;\n } else {\n this.replacedStyleTop_ = false;\n }\n\n // Insert backdrop.\n this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling);\n\n // Focus on whatever inside the dialog.\n this.focus_();\n },\n\n /**\n * Closes this HTMLDialogElement. This is optional vs clearing the open\n * attribute, however this fires a 'close' event.\n *\n * @param {string=} opt_returnValue to use as the returnValue\n */\n close: function(opt_returnValue) {\n if (!this.dialog_.hasAttribute('open')) {\n throw new Error('Failed to execute \\'close\\' on dialog: The element does not have an \\'open\\' attribute, and therefore cannot be closed.');\n }\n this.setOpen(false);\n\n // Leave returnValue untouched in case it was set directly on the element\n if (opt_returnValue !== undefined) {\n this.dialog_.returnValue = opt_returnValue;\n }\n\n // Triggering \"close\" event for any attached listeners on the <dialog>.\n var closeEvent = new supportCustomEvent('close', {\n bubbles: false,\n cancelable: false\n });\n safeDispatchEvent(this.dialog_, closeEvent);\n }\n\n });\n\n var dialogPolyfill = {};\n\n dialogPolyfill.reposition = function(element) {\n var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;\n var topValue = scrollTop + (window.innerHeight - element.offsetHeight) / 2;\n element.style.top = Math.max(scrollTop, topValue) + 'px';\n };\n\n dialogPolyfill.isInlinePositionSetByStylesheet = function(element) {\n for (var i = 0; i < document.styleSheets.length; ++i) {\n var styleSheet = document.styleSheets[i];\n var cssRules = null;\n // Some browsers throw on cssRules.\n try {\n cssRules = styleSheet.cssRules;\n } catch (e) {}\n if (!cssRules) { continue; }\n for (var j = 0; j < cssRules.length; ++j) {\n var rule = cssRules[j];\n var selectedNodes = null;\n // Ignore errors on invalid selector texts.\n try {\n selectedNodes = document.querySelectorAll(rule.selectorText);\n } catch(e) {}\n if (!selectedNodes || !inNodeList(selectedNodes, element)) {\n continue;\n }\n var cssTop = rule.style.getPropertyValue('top');\n var cssBottom = rule.style.getPropertyValue('bottom');\n if ((cssTop && cssTop !== 'auto') || (cssBottom && cssBottom !== 'auto')) {\n return true;\n }\n }\n }\n return false;\n };\n\n dialogPolyfill.needsCentering = function(dialog) {\n var computedStyle = window.getComputedStyle(dialog);\n if (computedStyle.position !== 'absolute') {\n return false;\n }\n\n // We must determine whether the top/bottom specified value is non-auto. In\n // WebKit/Blink, checking computedStyle.top == 'auto' is sufficient, but\n // Firefox returns the used value. So we do this crazy thing instead: check\n // the inline style and then go through CSS rules.\n if ((dialog.style.top !== 'auto' && dialog.style.top !== '') ||\n (dialog.style.bottom !== 'auto' && dialog.style.bottom !== '')) {\n return false;\n }\n return !dialogPolyfill.isInlinePositionSetByStylesheet(dialog);\n };\n\n /**\n * @param {!Element} element to force upgrade\n */\n dialogPolyfill.forceRegisterDialog = function(element) {\n if (window.HTMLDialogElement || element.showModal) {\n console.warn('This browser already supports <dialog>, the polyfill ' +\n 'may not work correctly', element);\n }\n if (element.localName !== 'dialog') {\n throw new Error('Failed to register dialog: The element is not a dialog.');\n }\n new dialogPolyfillInfo(/** @type {!HTMLDialogElement} */ (element));\n };\n\n /**\n * @param {!Element} element to upgrade, if necessary\n */\n dialogPolyfill.registerDialog = function(element) {\n if (!element.showModal) {\n dialogPolyfill.forceRegisterDialog(element);\n }\n };\n\n /**\n * @constructor\n */\n dialogPolyfill.DialogManager = function() {\n /** @type {!Array<!dialogPolyfillInfo>} */\n this.pendingDialogStack = [];\n\n var checkDOM = this.checkDOM_.bind(this);\n\n // The overlay is used to simulate how a modal dialog blocks the document.\n // The blocking dialog is positioned on top of the overlay, and the rest of\n // the dialogs on the pending dialog stack are positioned below it. In the\n // actual implementation, the modal dialog stacking is controlled by the\n // top layer, where z-index has no effect.\n this.overlay = document.createElement('div');\n this.overlay.className = '_dialog_overlay';\n this.overlay.addEventListener('click', function(e) {\n this.forwardTab_ = undefined;\n e.stopPropagation();\n checkDOM([]); // sanity-check DOM\n }.bind(this));\n\n this.handleKey_ = this.handleKey_.bind(this);\n this.handleFocus_ = this.handleFocus_.bind(this);\n\n this.zIndexLow_ = 100000;\n this.zIndexHigh_ = 100000 + 150;\n\n this.forwardTab_ = undefined;\n\n if ('MutationObserver' in window) {\n this.mo_ = new MutationObserver(function(records) {\n var removed = [];\n records.forEach(function(rec) {\n for (var i = 0, c; c = rec.removedNodes[i]; ++i) {\n if (!(c instanceof Element)) {\n continue;\n } else if (c.localName === 'dialog') {\n removed.push(c);\n }\n removed = removed.concat(c.querySelectorAll('dialog'));\n }\n });\n removed.length && checkDOM(removed);\n });\n }\n };\n\n /**\n * Called on the first modal dialog being shown. Adds the overlay and related\n * handlers.\n */\n dialogPolyfill.DialogManager.prototype.blockDocument = function() {\n document.documentElement.addEventListener('focus', this.handleFocus_, true);\n document.addEventListener('keydown', this.handleKey_);\n this.mo_ && this.mo_.observe(document, {childList: true, subtree: true});\n };\n\n /**\n * Called on the first modal dialog being removed, i.e., when no more modal\n * dialogs are visible.\n */\n dialogPolyfill.DialogManager.prototype.unblockDocument = function() {\n document.documentElement.removeEventListener('focus', this.handleFocus_, true);\n document.removeEventListener('keydown', this.handleKey_);\n this.mo_ && this.mo_.disconnect();\n };\n\n /**\n * Updates the stacking of all known dialogs.\n */\n dialogPolyfill.DialogManager.prototype.updateStacking = function() {\n var zIndex = this.zIndexHigh_;\n\n for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n dpi.updateZIndex(--zIndex, --zIndex);\n if (i === 0) {\n this.overlay.style.zIndex = --zIndex;\n }\n }\n\n // Make the overlay a sibling of the dialog itself.\n var last = this.pendingDialogStack[0];\n if (last) {\n var p = last.dialog.parentNode || document.body;\n p.appendChild(this.overlay);\n } else if (this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n };\n\n /**\n * @param {Element} candidate to check if contained or is the top-most modal dialog\n * @return {boolean} whether candidate is contained in top dialog\n */\n dialogPolyfill.DialogManager.prototype.containedByTopDialog_ = function(candidate) {\n while (candidate = findNearestDialog(candidate)) {\n for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n if (dpi.dialog === candidate) {\n return i === 0; // only valid if top-most\n }\n }\n candidate = candidate.parentElement;\n }\n return false;\n };\n\n dialogPolyfill.DialogManager.prototype.handleFocus_ = function(event) {\n var target = event.composedPath ? event.composedPath()[0] : event.target;\n\n if (this.containedByTopDialog_(target)) { return; }\n\n if (document.activeElement === document.documentElement) { return; }\n\n event.preventDefault();\n event.stopPropagation();\n safeBlur(/** @type {Element} */ (target));\n\n if (this.forwardTab_ === undefined) { return; } // move focus only from a tab key\n\n var dpi = this.pendingDialogStack[0];\n var dialog = dpi.dialog;\n var position = dialog.compareDocumentPosition(target);\n if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n if (this.forwardTab_) {\n // forward\n dpi.focus_();\n } else if (target !== document.documentElement) {\n // backwards if we're not already focused on <html>\n document.documentElement.focus();\n }\n }\n\n return false;\n };\n\n dialogPolyfill.DialogManager.prototype.handleKey_ = function(event) {\n this.forwardTab_ = undefined;\n if (event.keyCode === 27) {\n event.preventDefault();\n event.stopPropagation();\n var cancelEvent = new supportCustomEvent('cancel', {\n bubbles: false,\n cancelable: true\n });\n var dpi = this.pendingDialogStack[0];\n if (dpi && safeDispatchEvent(dpi.dialog, cancelEvent)) {\n dpi.dialog.close();\n }\n } else if (event.keyCode === 9) {\n this.forwardTab_ = !event.shiftKey;\n }\n };\n\n /**\n * Finds and downgrades any known modal dialogs that are no longer displayed. Dialogs that are\n * removed and immediately readded don't stay modal, they become normal.\n *\n * @param {!Array<!HTMLDialogElement>} removed that have definitely been removed\n */\n dialogPolyfill.DialogManager.prototype.checkDOM_ = function(removed) {\n // This operates on a clone because it may cause it to change. Each change also calls\n // updateStacking, which only actually needs to happen once. But who removes many modal dialogs\n // at a time?!\n var clone = this.pendingDialogStack.slice();\n clone.forEach(function(dpi) {\n if (removed.indexOf(dpi.dialog) !== -1) {\n dpi.downgradeModal();\n } else {\n dpi.maybeHideModal();\n }\n });\n };\n\n /**\n * @param {!dialogPolyfillInfo} dpi\n * @return {boolean} whether the dialog was allowed\n */\n dialogPolyfill.DialogManager.prototype.pushDialog = function(dpi) {\n var allowed = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1;\n if (this.pendingDialogStack.length >= allowed) {\n return false;\n }\n if (this.pendingDialogStack.unshift(dpi) === 1) {\n this.blockDocument();\n }\n this.updateStacking();\n return true;\n };\n\n /**\n * @param {!dialogPolyfillInfo} dpi\n */\n dialogPolyfill.DialogManager.prototype.removeDialog = function(dpi) {\n var index = this.pendingDialogStack.indexOf(dpi);\n if (index === -1) { return; }\n\n this.pendingDialogStack.splice(index, 1);\n if (this.pendingDialogStack.length === 0) {\n this.unblockDocument();\n }\n this.updateStacking();\n };\n\n dialogPolyfill.dm = new dialogPolyfill.DialogManager();\n dialogPolyfill.formSubmitter = null;\n dialogPolyfill.imagemapUseValue = null;\n\n /**\n * Installs global handlers, such as click listers and native method overrides. These are needed\n * even if a no dialog is registered, as they deal with <form method=\"dialog\">.\n */\n if (window.HTMLDialogElement === undefined) {\n\n /**\n * If HTMLFormElement translates method=\"DIALOG\" into 'get', then replace the descriptor with\n * one that returns the correct value.\n */\n var testForm = document.createElement('form');\n testForm.setAttribute('method', 'dialog');\n if (testForm.method !== 'dialog') {\n var methodDescriptor = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, 'method');\n if (methodDescriptor) {\n // nb. Some older iOS and older PhantomJS fail to return the descriptor. Don't do anything\n // and don't bother to update the element.\n var realGet = methodDescriptor.get;\n methodDescriptor.get = function() {\n if (isFormMethodDialog(this)) {\n return 'dialog';\n }\n return realGet.call(this);\n };\n var realSet = methodDescriptor.set;\n /** @this {HTMLElement} */\n methodDescriptor.set = function(v) {\n if (typeof v === 'string' && v.toLowerCase() === 'dialog') {\n return this.setAttribute('method', v);\n }\n return realSet.call(this, v);\n };\n Object.defineProperty(HTMLFormElement.prototype, 'method', methodDescriptor);\n }\n }\n\n /**\n * Global 'click' handler, to capture the <input type=\"submit\"> or <button> element which has\n * submitted a <form method=\"dialog\">. Needed as Safari and others don't report this inside\n * document.activeElement.\n */\n document.addEventListener('click', function(ev) {\n dialogPolyfill.formSubmitter = null;\n dialogPolyfill.imagemapUseValue = null;\n if (ev.defaultPrevented) { return; } // e.g. a submit which prevents default submission\n\n var target = /** @type {Element} */ (ev.target);\n if ('composedPath' in ev) {\n var path = ev.composedPath();\n target = path.shift() || target;\n }\n if (!target || !isFormMethodDialog(target.form)) { return; }\n\n var valid = (target.type === 'submit' && ['button', 'input'].indexOf(target.localName) > -1);\n if (!valid) {\n if (!(target.localName === 'input' && target.type === 'image')) { return; }\n // this is a <input type=\"image\">, which can submit forms\n dialogPolyfill.imagemapUseValue = ev.offsetX + ',' + ev.offsetY;\n }\n\n var dialog = findNearestDialog(target);\n if (!dialog) { return; }\n\n dialogPolyfill.formSubmitter = target;\n\n }, false);\n\n /**\n * Global 'submit' handler. This handles submits of `method=\"dialog\"` which are invalid, i.e.,\n * outside a dialog. They get prevented.\n */\n document.addEventListener('submit', function(ev) {\n var form = ev.target;\n var dialog = findNearestDialog(form);\n if (dialog) {\n return; // ignore, handle there\n }\n\n var submitter = findFormSubmitter(ev);\n var formmethod = submitter && submitter.getAttribute('formmethod') || form.getAttribute('method');\n if (formmethod === 'dialog') {\n ev.preventDefault();\n }\n });\n\n /**\n * Replace the native HTMLFormElement.submit() method, as it won't fire the\n * submit event and give us a chance to respond.\n */\n var nativeFormSubmit = HTMLFormElement.prototype.submit;\n var replacementFormSubmit = function () {\n if (!isFormMethodDialog(this)) {\n return nativeFormSubmit.call(this);\n }\n var dialog = findNearestDialog(this);\n dialog && dialog.close();\n };\n HTMLFormElement.prototype.submit = replacementFormSubmit;\n }\n\n return dialogPolyfill;\n\n}));\n","/**\n * @licstart The following is the entire license notice for the\n * JavaScript code in this page\n *\n * Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @licend The above is the entire license notice for the\n * JavaScript code in this page\n */\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"pdfjs-dist/build/pdf\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pdfjs-dist/build/pdf\"] = factory();\n\telse\n\t\troot[\"pdfjs-dist/build/pdf\"] = root.pdfjsLib = factory();\n})(globalThis, () => {\nreturn /******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\n/******/ \tvar __webpack_modules__ = ([\n/* 0 */,\n/* 1 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.VerbosityLevel = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.UNSUPPORTED_FEATURES = exports.TextRenderingMode = exports.StreamType = exports.RenderingIntentFlag = exports.PermissionFlag = exports.PasswordResponses = exports.PasswordException = exports.PageActionEventType = exports.OPS = exports.MissingPDFException = exports.LINE_FACTOR = exports.LINE_DESCENT_FACTOR = exports.InvalidPDFException = exports.ImageKind = exports.IDENTITY_MATRIX = exports.FormatError = exports.FontType = exports.FeatureTest = exports.FONT_IDENTITY_MATRIX = exports.DocumentActionEventType = exports.CMapCompressionType = exports.BaseException = exports.AnnotationType = exports.AnnotationStateModelType = exports.AnnotationReviewState = exports.AnnotationReplyType = exports.AnnotationMode = exports.AnnotationMarkedState = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationEditorType = exports.AnnotationEditorPrefix = exports.AnnotationEditorParamsType = exports.AnnotationBorderStyleType = exports.AnnotationActionEventType = exports.AbortException = void 0;\nexports.arrayByteLength = arrayByteLength;\nexports.arraysToBytes = arraysToBytes;\nexports.assert = assert;\nexports.bytesToString = bytesToString;\nexports.createPromiseCapability = createPromiseCapability;\nexports.createValidAbsoluteUrl = createValidAbsoluteUrl;\nexports.escapeString = escapeString;\nexports.getModificationDate = getModificationDate;\nexports.getVerbosityLevel = getVerbosityLevel;\nexports.info = info;\nexports.isArrayBuffer = isArrayBuffer;\nexports.isArrayEqual = isArrayEqual;\nexports.isAscii = isAscii;\nexports.objectFromMap = objectFromMap;\nexports.objectSize = objectSize;\nexports.setVerbosityLevel = setVerbosityLevel;\nexports.shadow = shadow;\nexports.string32 = string32;\nexports.stringToBytes = stringToBytes;\nexports.stringToPDFString = stringToPDFString;\nexports.stringToUTF16BEString = stringToUTF16BEString;\nexports.stringToUTF8String = stringToUTF8String;\nexports.unreachable = unreachable;\nexports.utf8StringToString = utf8StringToString;\nexports.warn = warn;\n\n__w_pdfjs_require__(2);\n\nconst IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];\nexports.IDENTITY_MATRIX = IDENTITY_MATRIX;\nconst FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];\nexports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX;\nconst LINE_FACTOR = 1.35;\nexports.LINE_FACTOR = LINE_FACTOR;\nconst LINE_DESCENT_FACTOR = 0.35;\nexports.LINE_DESCENT_FACTOR = LINE_DESCENT_FACTOR;\nconst RenderingIntentFlag = {\n ANY: 0x01,\n DISPLAY: 0x02,\n PRINT: 0x04,\n ANNOTATIONS_FORMS: 0x10,\n ANNOTATIONS_STORAGE: 0x20,\n ANNOTATIONS_DISABLE: 0x40,\n OPLIST: 0x100\n};\nexports.RenderingIntentFlag = RenderingIntentFlag;\nconst AnnotationMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_FORMS: 2,\n ENABLE_STORAGE: 3\n};\nexports.AnnotationMode = AnnotationMode;\nconst AnnotationEditorPrefix = \"pdfjs_internal_editor_\";\nexports.AnnotationEditorPrefix = AnnotationEditorPrefix;\nconst AnnotationEditorType = {\n DISABLE: -1,\n NONE: 0,\n FREETEXT: 3,\n INK: 15\n};\nexports.AnnotationEditorType = AnnotationEditorType;\nconst AnnotationEditorParamsType = {\n FREETEXT_SIZE: 1,\n FREETEXT_COLOR: 2,\n FREETEXT_OPACITY: 3,\n INK_COLOR: 11,\n INK_THICKNESS: 12,\n INK_OPACITY: 13\n};\nexports.AnnotationEditorParamsType = AnnotationEditorParamsType;\nconst PermissionFlag = {\n PRINT: 0x04,\n MODIFY_CONTENTS: 0x08,\n COPY: 0x10,\n MODIFY_ANNOTATIONS: 0x20,\n FILL_INTERACTIVE_FORMS: 0x100,\n COPY_FOR_ACCESSIBILITY: 0x200,\n ASSEMBLE: 0x400,\n PRINT_HIGH_QUALITY: 0x800\n};\nexports.PermissionFlag = PermissionFlag;\nconst TextRenderingMode = {\n FILL: 0,\n STROKE: 1,\n FILL_STROKE: 2,\n INVISIBLE: 3,\n FILL_ADD_TO_PATH: 4,\n STROKE_ADD_TO_PATH: 5,\n FILL_STROKE_ADD_TO_PATH: 6,\n ADD_TO_PATH: 7,\n FILL_STROKE_MASK: 3,\n ADD_TO_PATH_FLAG: 4\n};\nexports.TextRenderingMode = TextRenderingMode;\nconst ImageKind = {\n GRAYSCALE_1BPP: 1,\n RGB_24BPP: 2,\n RGBA_32BPP: 3\n};\nexports.ImageKind = ImageKind;\nconst AnnotationType = {\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n REDACT: 26\n};\nexports.AnnotationType = AnnotationType;\nconst AnnotationStateModelType = {\n MARKED: \"Marked\",\n REVIEW: \"Review\"\n};\nexports.AnnotationStateModelType = AnnotationStateModelType;\nconst AnnotationMarkedState = {\n MARKED: \"Marked\",\n UNMARKED: \"Unmarked\"\n};\nexports.AnnotationMarkedState = AnnotationMarkedState;\nconst AnnotationReviewState = {\n ACCEPTED: \"Accepted\",\n REJECTED: \"Rejected\",\n CANCELLED: \"Cancelled\",\n COMPLETED: \"Completed\",\n NONE: \"None\"\n};\nexports.AnnotationReviewState = AnnotationReviewState;\nconst AnnotationReplyType = {\n GROUP: \"Group\",\n REPLY: \"R\"\n};\nexports.AnnotationReplyType = AnnotationReplyType;\nconst AnnotationFlag = {\n INVISIBLE: 0x01,\n HIDDEN: 0x02,\n PRINT: 0x04,\n NOZOOM: 0x08,\n NOROTATE: 0x10,\n NOVIEW: 0x20,\n READONLY: 0x40,\n LOCKED: 0x80,\n TOGGLENOVIEW: 0x100,\n LOCKEDCONTENTS: 0x200\n};\nexports.AnnotationFlag = AnnotationFlag;\nconst AnnotationFieldFlag = {\n READONLY: 0x0000001,\n REQUIRED: 0x0000002,\n NOEXPORT: 0x0000004,\n MULTILINE: 0x0001000,\n PASSWORD: 0x0002000,\n NOTOGGLETOOFF: 0x0004000,\n RADIO: 0x0008000,\n PUSHBUTTON: 0x0010000,\n COMBO: 0x0020000,\n EDIT: 0x0040000,\n SORT: 0x0080000,\n FILESELECT: 0x0100000,\n MULTISELECT: 0x0200000,\n DONOTSPELLCHECK: 0x0400000,\n DONOTSCROLL: 0x0800000,\n COMB: 0x1000000,\n RICHTEXT: 0x2000000,\n RADIOSINUNISON: 0x2000000,\n COMMITONSELCHANGE: 0x4000000\n};\nexports.AnnotationFieldFlag = AnnotationFieldFlag;\nconst AnnotationBorderStyleType = {\n SOLID: 1,\n DASHED: 2,\n BEVELED: 3,\n INSET: 4,\n UNDERLINE: 5\n};\nexports.AnnotationBorderStyleType = AnnotationBorderStyleType;\nconst AnnotationActionEventType = {\n E: \"Mouse Enter\",\n X: \"Mouse Exit\",\n D: \"Mouse Down\",\n U: \"Mouse Up\",\n Fo: \"Focus\",\n Bl: \"Blur\",\n PO: \"PageOpen\",\n PC: \"PageClose\",\n PV: \"PageVisible\",\n PI: \"PageInvisible\",\n K: \"Keystroke\",\n F: \"Format\",\n V: \"Validate\",\n C: \"Calculate\"\n};\nexports.AnnotationActionEventType = AnnotationActionEventType;\nconst DocumentActionEventType = {\n WC: \"WillClose\",\n WS: \"WillSave\",\n DS: \"DidSave\",\n WP: \"WillPrint\",\n DP: \"DidPrint\"\n};\nexports.DocumentActionEventType = DocumentActionEventType;\nconst PageActionEventType = {\n O: \"PageOpen\",\n C: \"PageClose\"\n};\nexports.PageActionEventType = PageActionEventType;\nconst StreamType = {\n UNKNOWN: \"UNKNOWN\",\n FLATE: \"FLATE\",\n LZW: \"LZW\",\n DCT: \"DCT\",\n JPX: \"JPX\",\n JBIG: \"JBIG\",\n A85: \"A85\",\n AHX: \"AHX\",\n CCF: \"CCF\",\n RLX: \"RLX\"\n};\nexports.StreamType = StreamType;\nconst FontType = {\n UNKNOWN: \"UNKNOWN\",\n TYPE1: \"TYPE1\",\n TYPE1STANDARD: \"TYPE1STANDARD\",\n TYPE1C: \"TYPE1C\",\n CIDFONTTYPE0: \"CIDFONTTYPE0\",\n CIDFONTTYPE0C: \"CIDFONTTYPE0C\",\n TRUETYPE: \"TRUETYPE\",\n CIDFONTTYPE2: \"CIDFONTTYPE2\",\n TYPE3: \"TYPE3\",\n OPENTYPE: \"OPENTYPE\",\n TYPE0: \"TYPE0\",\n MMTYPE1: \"MMTYPE1\"\n};\nexports.FontType = FontType;\nconst VerbosityLevel = {\n ERRORS: 0,\n WARNINGS: 1,\n INFOS: 5\n};\nexports.VerbosityLevel = VerbosityLevel;\nconst CMapCompressionType = {\n NONE: 0,\n BINARY: 1,\n STREAM: 2\n};\nexports.CMapCompressionType = CMapCompressionType;\nconst OPS = {\n dependency: 1,\n setLineWidth: 2,\n setLineCap: 3,\n setLineJoin: 4,\n setMiterLimit: 5,\n setDash: 6,\n setRenderingIntent: 7,\n setFlatness: 8,\n setGState: 9,\n save: 10,\n restore: 11,\n transform: 12,\n moveTo: 13,\n lineTo: 14,\n curveTo: 15,\n curveTo2: 16,\n curveTo3: 17,\n closePath: 18,\n rectangle: 19,\n stroke: 20,\n closeStroke: 21,\n fill: 22,\n eoFill: 23,\n fillStroke: 24,\n eoFillStroke: 25,\n closeFillStroke: 26,\n closeEOFillStroke: 27,\n endPath: 28,\n clip: 29,\n eoClip: 30,\n beginText: 31,\n endText: 32,\n setCharSpacing: 33,\n setWordSpacing: 34,\n setHScale: 35,\n setLeading: 36,\n setFont: 37,\n setTextRenderingMode: 38,\n setTextRise: 39,\n moveText: 40,\n setLeadingMoveText: 41,\n setTextMatrix: 42,\n nextLine: 43,\n showText: 44,\n showSpacedText: 45,\n nextLineShowText: 46,\n nextLineSetSpacingShowText: 47,\n setCharWidth: 48,\n setCharWidthAndBounds: 49,\n setStrokeColorSpace: 50,\n setFillColorSpace: 51,\n setStrokeColor: 52,\n setStrokeColorN: 53,\n setFillColor: 54,\n setFillColorN: 55,\n setStrokeGray: 56,\n setFillGray: 57,\n setStrokeRGBColor: 58,\n setFillRGBColor: 59,\n setStrokeCMYKColor: 60,\n setFillCMYKColor: 61,\n shadingFill: 62,\n beginInlineImage: 63,\n beginImageData: 64,\n endInlineImage: 65,\n paintXObject: 66,\n markPoint: 67,\n markPointProps: 68,\n beginMarkedContent: 69,\n beginMarkedContentProps: 70,\n endMarkedContent: 71,\n beginCompat: 72,\n endCompat: 73,\n paintFormXObjectBegin: 74,\n paintFormXObjectEnd: 75,\n beginGroup: 76,\n endGroup: 77,\n beginAnnotations: 78,\n endAnnotations: 79,\n beginAnnotation: 80,\n endAnnotation: 81,\n paintJpegXObject: 82,\n paintImageMaskXObject: 83,\n paintImageMaskXObjectGroup: 84,\n paintImageXObject: 85,\n paintInlineImageXObject: 86,\n paintInlineImageXObjectGroup: 87,\n paintImageXObjectRepeat: 88,\n paintImageMaskXObjectRepeat: 89,\n paintSolidColorImageMask: 90,\n constructPath: 91\n};\nexports.OPS = OPS;\nconst UNSUPPORTED_FEATURES = {\n unknown: \"unknown\",\n forms: \"forms\",\n javaScript: \"javaScript\",\n signatures: \"signatures\",\n smask: \"smask\",\n shadingPattern: \"shadingPattern\",\n font: \"font\",\n errorTilingPattern: \"errorTilingPattern\",\n errorExtGState: \"errorExtGState\",\n errorXObject: \"errorXObject\",\n errorFontLoadType3: \"errorFontLoadType3\",\n errorFontState: \"errorFontState\",\n errorFontMissing: \"errorFontMissing\",\n errorFontTranslate: \"errorFontTranslate\",\n errorColorSpace: \"errorColorSpace\",\n errorOperatorList: \"errorOperatorList\",\n errorFontToUnicode: \"errorFontToUnicode\",\n errorFontLoadNative: \"errorFontLoadNative\",\n errorFontBuildPath: \"errorFontBuildPath\",\n errorFontGetPath: \"errorFontGetPath\",\n errorMarkedContent: \"errorMarkedContent\",\n errorContentSubStream: \"errorContentSubStream\"\n};\nexports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES;\nconst PasswordResponses = {\n NEED_PASSWORD: 1,\n INCORRECT_PASSWORD: 2\n};\nexports.PasswordResponses = PasswordResponses;\nlet verbosity = VerbosityLevel.WARNINGS;\n\nfunction setVerbosityLevel(level) {\n if (Number.isInteger(level)) {\n verbosity = level;\n }\n}\n\nfunction getVerbosityLevel() {\n return verbosity;\n}\n\nfunction info(msg) {\n if (verbosity >= VerbosityLevel.INFOS) {\n console.log(`Info: ${msg}`);\n }\n}\n\nfunction warn(msg) {\n if (verbosity >= VerbosityLevel.WARNINGS) {\n console.log(`Warning: ${msg}`);\n }\n}\n\nfunction unreachable(msg) {\n throw new Error(msg);\n}\n\nfunction assert(cond, msg) {\n if (!cond) {\n unreachable(msg);\n }\n}\n\nfunction _isValidProtocol(url) {\n if (!url) {\n return false;\n }\n\n switch (url.protocol) {\n case \"http:\":\n case \"https:\":\n case \"ftp:\":\n case \"mailto:\":\n case \"tel:\":\n return true;\n\n default:\n return false;\n }\n}\n\nfunction createValidAbsoluteUrl(url, baseUrl = null, options = null) {\n if (!url) {\n return null;\n }\n\n try {\n if (options && typeof url === \"string\") {\n if (options.addDefaultProtocol && url.startsWith(\"www.\")) {\n const dots = url.match(/\\./g);\n\n if (dots && dots.length >= 2) {\n url = `http://${url}`;\n }\n }\n\n if (options.tryConvertEncoding) {\n try {\n url = stringToUTF8String(url);\n } catch (ex) {}\n }\n }\n\n const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);\n\n if (_isValidProtocol(absoluteUrl)) {\n return absoluteUrl;\n }\n } catch (ex) {}\n\n return null;\n}\n\nfunction shadow(obj, prop, value) {\n Object.defineProperty(obj, prop, {\n value,\n enumerable: true,\n configurable: true,\n writable: false\n });\n return value;\n}\n\nconst BaseException = function BaseExceptionClosure() {\n function BaseException(message, name) {\n if (this.constructor === BaseException) {\n unreachable(\"Cannot initialize BaseException.\");\n }\n\n this.message = message;\n this.name = name;\n }\n\n BaseException.prototype = new Error();\n BaseException.constructor = BaseException;\n return BaseException;\n}();\n\nexports.BaseException = BaseException;\n\nclass PasswordException extends BaseException {\n constructor(msg, code) {\n super(msg, \"PasswordException\");\n this.code = code;\n }\n\n}\n\nexports.PasswordException = PasswordException;\n\nclass UnknownErrorException extends BaseException {\n constructor(msg, details) {\n super(msg, \"UnknownErrorException\");\n this.details = details;\n }\n\n}\n\nexports.UnknownErrorException = UnknownErrorException;\n\nclass InvalidPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"InvalidPDFException\");\n }\n\n}\n\nexports.InvalidPDFException = InvalidPDFException;\n\nclass MissingPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"MissingPDFException\");\n }\n\n}\n\nexports.MissingPDFException = MissingPDFException;\n\nclass UnexpectedResponseException extends BaseException {\n constructor(msg, status) {\n super(msg, \"UnexpectedResponseException\");\n this.status = status;\n }\n\n}\n\nexports.UnexpectedResponseException = UnexpectedResponseException;\n\nclass FormatError extends BaseException {\n constructor(msg) {\n super(msg, \"FormatError\");\n }\n\n}\n\nexports.FormatError = FormatError;\n\nclass AbortException extends BaseException {\n constructor(msg) {\n super(msg, \"AbortException\");\n }\n\n}\n\nexports.AbortException = AbortException;\n\nfunction bytesToString(bytes) {\n if (typeof bytes !== \"object\" || bytes === null || bytes.length === undefined) {\n unreachable(\"Invalid argument for bytesToString\");\n }\n\n const length = bytes.length;\n const MAX_ARGUMENT_COUNT = 8192;\n\n if (length < MAX_ARGUMENT_COUNT) {\n return String.fromCharCode.apply(null, bytes);\n }\n\n const strBuf = [];\n\n for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {\n const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);\n const chunk = bytes.subarray(i, chunkEnd);\n strBuf.push(String.fromCharCode.apply(null, chunk));\n }\n\n return strBuf.join(\"\");\n}\n\nfunction stringToBytes(str) {\n if (typeof str !== \"string\") {\n unreachable(\"Invalid argument for stringToBytes\");\n }\n\n const length = str.length;\n const bytes = new Uint8Array(length);\n\n for (let i = 0; i < length; ++i) {\n bytes[i] = str.charCodeAt(i) & 0xff;\n }\n\n return bytes;\n}\n\nfunction arrayByteLength(arr) {\n if (arr.length !== undefined) {\n return arr.length;\n }\n\n if (arr.byteLength !== undefined) {\n return arr.byteLength;\n }\n\n unreachable(\"Invalid argument for arrayByteLength\");\n}\n\nfunction arraysToBytes(arr) {\n const length = arr.length;\n\n if (length === 1 && arr[0] instanceof Uint8Array) {\n return arr[0];\n }\n\n let resultLength = 0;\n\n for (let i = 0; i < length; i++) {\n resultLength += arrayByteLength(arr[i]);\n }\n\n let pos = 0;\n const data = new Uint8Array(resultLength);\n\n for (let i = 0; i < length; i++) {\n let item = arr[i];\n\n if (!(item instanceof Uint8Array)) {\n if (typeof item === \"string\") {\n item = stringToBytes(item);\n } else {\n item = new Uint8Array(item);\n }\n }\n\n const itemLength = item.byteLength;\n data.set(item, pos);\n pos += itemLength;\n }\n\n return data;\n}\n\nfunction string32(value) {\n return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff);\n}\n\nfunction objectSize(obj) {\n return Object.keys(obj).length;\n}\n\nfunction objectFromMap(map) {\n const obj = Object.create(null);\n\n for (const [key, value] of map) {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction isLittleEndian() {\n const buffer8 = new Uint8Array(4);\n buffer8[0] = 1;\n const view32 = new Uint32Array(buffer8.buffer, 0, 1);\n return view32[0] === 1;\n}\n\nfunction isEvalSupported() {\n try {\n new Function(\"\");\n return true;\n } catch (e) {\n return false;\n }\n}\n\nclass FeatureTest {\n static get isLittleEndian() {\n return shadow(this, \"isLittleEndian\", isLittleEndian());\n }\n\n static get isEvalSupported() {\n return shadow(this, \"isEvalSupported\", isEvalSupported());\n }\n\n static get isOffscreenCanvasSupported() {\n return shadow(this, \"isOffscreenCanvasSupported\", typeof OffscreenCanvas !== \"undefined\");\n }\n\n}\n\nexports.FeatureTest = FeatureTest;\nconst hexNumbers = [...Array(256).keys()].map(n => n.toString(16).padStart(2, \"0\"));\n\nclass Util {\n static makeHexColor(r, g, b) {\n return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;\n }\n\n static scaleMinMax(transform, minMax) {\n let temp;\n\n if (transform[0]) {\n if (transform[0] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n }\n\n minMax[0] *= transform[0];\n minMax[1] *= transform[0];\n\n if (transform[3] < 0) {\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n }\n\n minMax[2] *= transform[3];\n minMax[3] *= transform[3];\n } else {\n temp = minMax[0];\n minMax[0] = minMax[2];\n minMax[2] = temp;\n temp = minMax[1];\n minMax[1] = minMax[3];\n minMax[3] = temp;\n\n if (transform[1] < 0) {\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n }\n\n minMax[2] *= transform[1];\n minMax[3] *= transform[1];\n\n if (transform[2] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n }\n\n minMax[0] *= transform[2];\n minMax[1] *= transform[2];\n }\n\n minMax[0] += transform[4];\n minMax[1] += transform[4];\n minMax[2] += transform[5];\n minMax[3] += transform[5];\n }\n\n static transform(m1, m2) {\n return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]];\n }\n\n static applyTransform(p, m) {\n const xt = p[0] * m[0] + p[1] * m[2] + m[4];\n const yt = p[0] * m[1] + p[1] * m[3] + m[5];\n return [xt, yt];\n }\n\n static applyInverseTransform(p, m) {\n const d = m[0] * m[3] - m[1] * m[2];\n const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;\n const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;\n return [xt, yt];\n }\n\n static getAxialAlignedBoundingBox(r, m) {\n const p1 = Util.applyTransform(r, m);\n const p2 = Util.applyTransform(r.slice(2, 4), m);\n const p3 = Util.applyTransform([r[0], r[3]], m);\n const p4 = Util.applyTransform([r[2], r[1]], m);\n return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])];\n }\n\n static inverseTransform(m) {\n const d = m[0] * m[3] - m[1] * m[2];\n return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d];\n }\n\n static apply3dTransform(m, v) {\n return [m[0] * v[0] + m[1] * v[1] + m[2] * v[2], m[3] * v[0] + m[4] * v[1] + m[5] * v[2], m[6] * v[0] + m[7] * v[1] + m[8] * v[2]];\n }\n\n static singularValueDecompose2dScale(m) {\n const transpose = [m[0], m[2], m[1], m[3]];\n const a = m[0] * transpose[0] + m[1] * transpose[2];\n const b = m[0] * transpose[1] + m[1] * transpose[3];\n const c = m[2] * transpose[0] + m[3] * transpose[2];\n const d = m[2] * transpose[1] + m[3] * transpose[3];\n const first = (a + d) / 2;\n const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2;\n const sx = first + second || 1;\n const sy = first - second || 1;\n return [Math.sqrt(sx), Math.sqrt(sy)];\n }\n\n static normalizeRect(rect) {\n const r = rect.slice(0);\n\n if (rect[0] > rect[2]) {\n r[0] = rect[2];\n r[2] = rect[0];\n }\n\n if (rect[1] > rect[3]) {\n r[1] = rect[3];\n r[3] = rect[1];\n }\n\n return r;\n }\n\n static intersect(rect1, rect2) {\n const xLow = Math.max(Math.min(rect1[0], rect1[2]), Math.min(rect2[0], rect2[2]));\n const xHigh = Math.min(Math.max(rect1[0], rect1[2]), Math.max(rect2[0], rect2[2]));\n\n if (xLow > xHigh) {\n return null;\n }\n\n const yLow = Math.max(Math.min(rect1[1], rect1[3]), Math.min(rect2[1], rect2[3]));\n const yHigh = Math.min(Math.max(rect1[1], rect1[3]), Math.max(rect2[1], rect2[3]));\n\n if (yLow > yHigh) {\n return null;\n }\n\n return [xLow, yLow, xHigh, yHigh];\n }\n\n static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3) {\n const tvalues = [],\n bounds = [[], []];\n let a, b, c, t, t1, t2, b2ac, sqrtb2ac;\n\n for (let i = 0; i < 2; ++i) {\n if (i === 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n } else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) < 1e-12) {\n continue;\n }\n\n t = -c / b;\n\n if (0 < t && t < 1) {\n tvalues.push(t);\n }\n\n continue;\n }\n\n b2ac = b * b - 4 * c * a;\n sqrtb2ac = Math.sqrt(b2ac);\n\n if (b2ac < 0) {\n continue;\n }\n\n t1 = (-b + sqrtb2ac) / (2 * a);\n\n if (0 < t1 && t1 < 1) {\n tvalues.push(t1);\n }\n\n t2 = (-b - sqrtb2ac) / (2 * a);\n\n if (0 < t2 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n\n let j = tvalues.length,\n mt;\n const jlen = j;\n\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3;\n bounds[1][j] = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3;\n }\n\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n return [Math.min(...bounds[0]), Math.min(...bounds[1]), Math.max(...bounds[0]), Math.max(...bounds[1])];\n }\n\n}\n\nexports.Util = Util;\nconst PDFStringTranslateTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8, 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d, 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac];\n\nfunction stringToPDFString(str) {\n if (str[0] >= \"\\xEF\") {\n let encoding;\n\n if (str[0] === \"\\xFE\" && str[1] === \"\\xFF\") {\n encoding = \"utf-16be\";\n } else if (str[0] === \"\\xFF\" && str[1] === \"\\xFE\") {\n encoding = \"utf-16le\";\n } else if (str[0] === \"\\xEF\" && str[1] === \"\\xBB\" && str[2] === \"\\xBF\") {\n encoding = \"utf-8\";\n }\n\n if (encoding) {\n try {\n const decoder = new TextDecoder(encoding, {\n fatal: true\n });\n const buffer = stringToBytes(str);\n return decoder.decode(buffer);\n } catch (ex) {\n warn(`stringToPDFString: \"${ex}\".`);\n }\n }\n }\n\n const strBuf = [];\n\n for (let i = 0, ii = str.length; i < ii; i++) {\n const code = PDFStringTranslateTable[str.charCodeAt(i)];\n strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));\n }\n\n return strBuf.join(\"\");\n}\n\nfunction escapeString(str) {\n return str.replace(/([()\\\\\\n\\r])/g, match => {\n if (match === \"\\n\") {\n return \"\\\\n\";\n } else if (match === \"\\r\") {\n return \"\\\\r\";\n }\n\n return `\\\\${match}`;\n });\n}\n\nfunction isAscii(str) {\n return /^[\\x00-\\x7F]*$/.test(str);\n}\n\nfunction stringToUTF16BEString(str) {\n const buf = [\"\\xFE\\xFF\"];\n\n for (let i = 0, ii = str.length; i < ii; i++) {\n const char = str.charCodeAt(i);\n buf.push(String.fromCharCode(char >> 8 & 0xff), String.fromCharCode(char & 0xff));\n }\n\n return buf.join(\"\");\n}\n\nfunction stringToUTF8String(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n return unescape(encodeURIComponent(str));\n}\n\nfunction isArrayBuffer(v) {\n return typeof v === \"object\" && v !== null && v.byteLength !== undefined;\n}\n\nfunction isArrayEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n\n for (let i = 0, ii = arr1.length; i < ii; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction getModificationDate(date = new Date()) {\n const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, \"0\"), date.getUTCDate().toString().padStart(2, \"0\"), date.getUTCHours().toString().padStart(2, \"0\"), date.getUTCMinutes().toString().padStart(2, \"0\"), date.getUTCSeconds().toString().padStart(2, \"0\")];\n return buffer.join(\"\");\n}\n\nfunction createPromiseCapability() {\n const capability = Object.create(null);\n let isSettled = false;\n Object.defineProperty(capability, \"settled\", {\n get() {\n return isSettled;\n }\n\n });\n capability.promise = new Promise(function (resolve, reject) {\n capability.resolve = function (data) {\n isSettled = true;\n resolve(data);\n };\n\n capability.reject = function (reason) {\n isSettled = true;\n reject(reason);\n };\n });\n return capability;\n}\n\n/***/ }),\n/* 2 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => {\n\n\n\nvar _is_node = __w_pdfjs_require__(3);\n\n;\n\n/***/ }),\n/* 3 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.isNodeJS = void 0;\nconst isNodeJS = typeof process === \"object\" && process + \"\" === \"[object process]\" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== \"browser\");\nexports.isNodeJS = isNodeJS;\n\n/***/ }),\n/* 4 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.build = exports.RenderTask = exports.PDFWorkerUtil = exports.PDFWorker = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFDocumentLoadingTask = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.DefaultStandardFontDataFactory = exports.DefaultCanvasFactory = exports.DefaultCMapReaderFactory = void 0;\nexports.getDocument = getDocument;\nexports.setPDFNetworkStreamFactory = setPDFNetworkStreamFactory;\nexports.version = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _annotation_storage = __w_pdfjs_require__(5);\n\nvar _display_utils = __w_pdfjs_require__(8);\n\nvar _font_loader = __w_pdfjs_require__(11);\n\nvar _canvas = __w_pdfjs_require__(12);\n\nvar _worker_options = __w_pdfjs_require__(15);\n\nvar _is_node = __w_pdfjs_require__(3);\n\nvar _message_handler = __w_pdfjs_require__(16);\n\nvar _metadata = __w_pdfjs_require__(17);\n\nvar _optional_content_config = __w_pdfjs_require__(18);\n\nvar _transport_stream = __w_pdfjs_require__(19);\n\nvar _xfa_text = __w_pdfjs_require__(20);\n\nconst DEFAULT_RANGE_CHUNK_SIZE = 65536;\nconst RENDERING_CANCELLED_TIMEOUT = 100;\nlet DefaultCanvasFactory = _display_utils.DOMCanvasFactory;\nexports.DefaultCanvasFactory = DefaultCanvasFactory;\nlet DefaultCMapReaderFactory = _display_utils.DOMCMapReaderFactory;\nexports.DefaultCMapReaderFactory = DefaultCMapReaderFactory;\nlet DefaultStandardFontDataFactory = _display_utils.DOMStandardFontDataFactory;\nexports.DefaultStandardFontDataFactory = DefaultStandardFontDataFactory;\n\nif (_is_node.isNodeJS) {\n const {\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeStandardFontDataFactory\n } = __w_pdfjs_require__(21);\n\n exports.DefaultCanvasFactory = DefaultCanvasFactory = NodeCanvasFactory;\n exports.DefaultCMapReaderFactory = DefaultCMapReaderFactory = NodeCMapReaderFactory;\n exports.DefaultStandardFontDataFactory = DefaultStandardFontDataFactory = NodeStandardFontDataFactory;\n}\n\nlet createPDFNetworkStream;\n\nfunction setPDFNetworkStreamFactory(pdfNetworkStreamFactory) {\n createPDFNetworkStream = pdfNetworkStreamFactory;\n}\n\nfunction getDocument(src) {\n const task = new PDFDocumentLoadingTask();\n let source;\n\n if (typeof src === \"string\" || src instanceof URL) {\n source = {\n url: src\n };\n } else if ((0, _util.isArrayBuffer)(src)) {\n source = {\n data: src\n };\n } else if (src instanceof PDFDataRangeTransport) {\n source = {\n range: src\n };\n } else {\n if (typeof src !== \"object\") {\n throw new Error(\"Invalid parameter in getDocument, \" + \"need either string, URL, TypedArray, or parameter object.\");\n }\n\n if (!src.url && !src.data && !src.range) {\n throw new Error(\"Invalid parameter object: need either .data, .range or .url\");\n }\n\n source = src;\n }\n\n const params = Object.create(null);\n let rangeTransport = null,\n worker = null;\n\n for (const key in source) {\n const value = source[key];\n\n switch (key) {\n case \"url\":\n if (typeof window !== \"undefined\") {\n try {\n params[key] = new URL(value, window.location).href;\n continue;\n } catch (ex) {\n (0, _util.warn)(`Cannot create valid URL: \"${ex}\".`);\n }\n } else if (typeof value === \"string\" || value instanceof URL) {\n params[key] = value.toString();\n continue;\n }\n\n throw new Error(\"Invalid PDF url data: \" + \"either string or URL-object is expected in the url property.\");\n\n case \"range\":\n rangeTransport = value;\n continue;\n\n case \"worker\":\n worker = value;\n continue;\n\n case \"data\":\n if (_is_node.isNodeJS && typeof Buffer !== \"undefined\" && value instanceof Buffer) {\n params[key] = new Uint8Array(value);\n } else if (value instanceof Uint8Array) {\n break;\n } else if (typeof value === \"string\") {\n params[key] = (0, _util.stringToBytes)(value);\n } else if (typeof value === \"object\" && value !== null && !isNaN(value.length)) {\n params[key] = new Uint8Array(value);\n } else if ((0, _util.isArrayBuffer)(value)) {\n params[key] = new Uint8Array(value);\n } else {\n throw new Error(\"Invalid PDF binary data: either TypedArray, \" + \"string, or array-like object is expected in the data property.\");\n }\n\n continue;\n }\n\n params[key] = value;\n }\n\n params.CMapReaderFactory = params.CMapReaderFactory || DefaultCMapReaderFactory;\n params.StandardFontDataFactory = params.StandardFontDataFactory || DefaultStandardFontDataFactory;\n params.ignoreErrors = params.stopAtErrors !== true;\n params.fontExtraProperties = params.fontExtraProperties === true;\n params.pdfBug = params.pdfBug === true;\n params.enableXfa = params.enableXfa === true;\n\n if (!Number.isInteger(params.rangeChunkSize) || params.rangeChunkSize < 1) {\n params.rangeChunkSize = DEFAULT_RANGE_CHUNK_SIZE;\n }\n\n if (typeof params.docBaseUrl !== \"string\" || (0, _display_utils.isDataScheme)(params.docBaseUrl)) {\n params.docBaseUrl = null;\n }\n\n if (!Number.isInteger(params.maxImageSize) || params.maxImageSize < -1) {\n params.maxImageSize = -1;\n }\n\n if (typeof params.cMapUrl !== \"string\") {\n params.cMapUrl = null;\n }\n\n if (typeof params.standardFontDataUrl !== \"string\") {\n params.standardFontDataUrl = null;\n }\n\n if (typeof params.useWorkerFetch !== \"boolean\") {\n params.useWorkerFetch = params.CMapReaderFactory === _display_utils.DOMCMapReaderFactory && params.StandardFontDataFactory === _display_utils.DOMStandardFontDataFactory;\n }\n\n if (typeof params.isEvalSupported !== \"boolean\") {\n params.isEvalSupported = true;\n }\n\n if (typeof params.disableFontFace !== \"boolean\") {\n params.disableFontFace = _is_node.isNodeJS;\n }\n\n if (typeof params.useSystemFonts !== \"boolean\") {\n params.useSystemFonts = !_is_node.isNodeJS && !params.disableFontFace;\n }\n\n if (typeof params.ownerDocument !== \"object\" || params.ownerDocument === null) {\n params.ownerDocument = globalThis.document;\n }\n\n if (typeof params.disableRange !== \"boolean\") {\n params.disableRange = false;\n }\n\n if (typeof params.disableStream !== \"boolean\") {\n params.disableStream = false;\n }\n\n if (typeof params.disableAutoFetch !== \"boolean\") {\n params.disableAutoFetch = false;\n }\n\n (0, _util.setVerbosityLevel)(params.verbosity);\n\n if (!worker) {\n const workerParams = {\n verbosity: params.verbosity,\n port: _worker_options.GlobalWorkerOptions.workerPort\n };\n worker = workerParams.port ? PDFWorker.fromPort(workerParams) : new PDFWorker(workerParams);\n task._worker = worker;\n }\n\n const docId = task.docId;\n worker.promise.then(function () {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n const workerIdPromise = _fetchDocument(worker, params, rangeTransport, docId);\n\n const networkStreamPromise = new Promise(function (resolve) {\n let networkStream;\n\n if (rangeTransport) {\n networkStream = new _transport_stream.PDFDataTransportStream({\n length: params.length,\n initialData: params.initialData,\n progressiveDone: params.progressiveDone,\n contentDispositionFilename: params.contentDispositionFilename,\n disableRange: params.disableRange,\n disableStream: params.disableStream\n }, rangeTransport);\n } else if (!params.data) {\n networkStream = createPDFNetworkStream({\n url: params.url,\n length: params.length,\n httpHeaders: params.httpHeaders,\n withCredentials: params.withCredentials,\n rangeChunkSize: params.rangeChunkSize,\n disableRange: params.disableRange,\n disableStream: params.disableStream\n });\n }\n\n resolve(networkStream);\n });\n return Promise.all([workerIdPromise, networkStreamPromise]).then(function ([workerId, networkStream]) {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n const messageHandler = new _message_handler.MessageHandler(docId, workerId, worker.port);\n const transport = new WorkerTransport(messageHandler, task, networkStream, params);\n task._transport = transport;\n messageHandler.send(\"Ready\", null);\n });\n }).catch(task._capability.reject);\n return task;\n}\n\nasync function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n\n if (pdfDataRangeTransport) {\n source.length = pdfDataRangeTransport.length;\n source.initialData = pdfDataRangeTransport.initialData;\n source.progressiveDone = pdfDataRangeTransport.progressiveDone;\n source.contentDispositionFilename = pdfDataRangeTransport.contentDispositionFilename;\n }\n\n const workerId = await worker.messageHandler.sendWithPromise(\"GetDocRequest\", {\n docId,\n apiVersion: '2.16.105',\n source: {\n data: source.data,\n url: source.url,\n password: source.password,\n disableAutoFetch: source.disableAutoFetch,\n rangeChunkSize: source.rangeChunkSize,\n length: source.length\n },\n maxImageSize: source.maxImageSize,\n disableFontFace: source.disableFontFace,\n docBaseUrl: source.docBaseUrl,\n ignoreErrors: source.ignoreErrors,\n isEvalSupported: source.isEvalSupported,\n fontExtraProperties: source.fontExtraProperties,\n enableXfa: source.enableXfa,\n useSystemFonts: source.useSystemFonts,\n cMapUrl: source.useWorkerFetch ? source.cMapUrl : null,\n standardFontDataUrl: source.useWorkerFetch ? source.standardFontDataUrl : null\n });\n\n if (source.data) {\n source.data = null;\n }\n\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n\n return workerId;\n}\n\nclass PDFDocumentLoadingTask {\n static #docId = 0;\n\n constructor() {\n this._capability = (0, _util.createPromiseCapability)();\n this._transport = null;\n this._worker = null;\n this.docId = `d${PDFDocumentLoadingTask.#docId++}`;\n this.destroyed = false;\n this.onPassword = null;\n this.onProgress = null;\n this.onUnsupportedFeature = null;\n }\n\n get promise() {\n return this._capability.promise;\n }\n\n async destroy() {\n this.destroyed = true;\n await this._transport?.destroy();\n this._transport = null;\n\n if (this._worker) {\n this._worker.destroy();\n\n this._worker = null;\n }\n }\n\n}\n\nexports.PDFDocumentLoadingTask = PDFDocumentLoadingTask;\n\nclass PDFDataRangeTransport {\n constructor(length, initialData, progressiveDone = false, contentDispositionFilename = null) {\n this.length = length;\n this.initialData = initialData;\n this.progressiveDone = progressiveDone;\n this.contentDispositionFilename = contentDispositionFilename;\n this._rangeListeners = [];\n this._progressListeners = [];\n this._progressiveReadListeners = [];\n this._progressiveDoneListeners = [];\n this._readyCapability = (0, _util.createPromiseCapability)();\n }\n\n addRangeListener(listener) {\n this._rangeListeners.push(listener);\n }\n\n addProgressListener(listener) {\n this._progressListeners.push(listener);\n }\n\n addProgressiveReadListener(listener) {\n this._progressiveReadListeners.push(listener);\n }\n\n addProgressiveDoneListener(listener) {\n this._progressiveDoneListeners.push(listener);\n }\n\n onDataRange(begin, chunk) {\n for (const listener of this._rangeListeners) {\n listener(begin, chunk);\n }\n }\n\n onDataProgress(loaded, total) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressListeners) {\n listener(loaded, total);\n }\n });\n }\n\n onDataProgressiveRead(chunk) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveReadListeners) {\n listener(chunk);\n }\n });\n }\n\n onDataProgressiveDone() {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveDoneListeners) {\n listener();\n }\n });\n }\n\n transportReady() {\n this._readyCapability.resolve();\n }\n\n requestDataRange(begin, end) {\n (0, _util.unreachable)(\"Abstract method PDFDataRangeTransport.requestDataRange\");\n }\n\n abort() {}\n\n}\n\nexports.PDFDataRangeTransport = PDFDataRangeTransport;\n\nclass PDFDocumentProxy {\n constructor(pdfInfo, transport) {\n this._pdfInfo = pdfInfo;\n this._transport = transport;\n Object.defineProperty(this, \"fingerprint\", {\n get() {\n (0, _display_utils.deprecated)(\"`PDFDocumentProxy.fingerprint`, \" + \"please use `PDFDocumentProxy.fingerprints` instead.\");\n return this.fingerprints[0];\n }\n\n });\n Object.defineProperty(this, \"getStats\", {\n value: async () => {\n (0, _display_utils.deprecated)(\"`PDFDocumentProxy.getStats`, \" + \"please use the `PDFDocumentProxy.stats`-getter instead.\");\n return this.stats || {\n streamTypes: {},\n fontTypes: {}\n };\n }\n });\n }\n\n get annotationStorage() {\n return this._transport.annotationStorage;\n }\n\n get numPages() {\n return this._pdfInfo.numPages;\n }\n\n get fingerprints() {\n return this._pdfInfo.fingerprints;\n }\n\n get stats() {\n return this._transport.stats;\n }\n\n get isPureXfa() {\n return !!this._transport._htmlForXfa;\n }\n\n get allXfaHtml() {\n return this._transport._htmlForXfa;\n }\n\n getPage(pageNumber) {\n return this._transport.getPage(pageNumber);\n }\n\n getPageIndex(ref) {\n return this._transport.getPageIndex(ref);\n }\n\n getDestinations() {\n return this._transport.getDestinations();\n }\n\n getDestination(id) {\n return this._transport.getDestination(id);\n }\n\n getPageLabels() {\n return this._transport.getPageLabels();\n }\n\n getPageLayout() {\n return this._transport.getPageLayout();\n }\n\n getPageMode() {\n return this._transport.getPageMode();\n }\n\n getViewerPreferences() {\n return this._transport.getViewerPreferences();\n }\n\n getOpenAction() {\n return this._transport.getOpenAction();\n }\n\n getAttachments() {\n return this._transport.getAttachments();\n }\n\n getJavaScript() {\n return this._transport.getJavaScript();\n }\n\n getJSActions() {\n return this._transport.getDocJSActions();\n }\n\n getOutline() {\n return this._transport.getOutline();\n }\n\n getOptionalContentConfig() {\n return this._transport.getOptionalContentConfig();\n }\n\n getPermissions() {\n return this._transport.getPermissions();\n }\n\n getMetadata() {\n return this._transport.getMetadata();\n }\n\n getMarkInfo() {\n return this._transport.getMarkInfo();\n }\n\n getData() {\n return this._transport.getData();\n }\n\n getDownloadInfo() {\n return this._transport.downloadInfoCapability.promise;\n }\n\n cleanup(keepLoadedFonts = false) {\n return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa);\n }\n\n destroy() {\n return this.loadingTask.destroy();\n }\n\n get loadingParams() {\n return this._transport.loadingParams;\n }\n\n get loadingTask() {\n return this._transport.loadingTask;\n }\n\n saveDocument() {\n if (this._transport.annotationStorage.size <= 0) {\n (0, _display_utils.deprecated)(\"saveDocument called while `annotationStorage` is empty, \" + \"please use the getData-method instead.\");\n }\n\n return this._transport.saveDocument();\n }\n\n getFieldObjects() {\n return this._transport.getFieldObjects();\n }\n\n hasJSActions() {\n return this._transport.hasJSActions();\n }\n\n getCalculationOrderIds() {\n return this._transport.getCalculationOrderIds();\n }\n\n}\n\nexports.PDFDocumentProxy = PDFDocumentProxy;\n\nclass PDFPageProxy {\n constructor(pageIndex, pageInfo, transport, ownerDocument, pdfBug = false) {\n this._pageIndex = pageIndex;\n this._pageInfo = pageInfo;\n this._ownerDocument = ownerDocument;\n this._transport = transport;\n this._stats = pdfBug ? new _display_utils.StatTimer() : null;\n this._pdfBug = pdfBug;\n this.commonObjs = transport.commonObjs;\n this.objs = new PDFObjects();\n this._bitmaps = new Set();\n this.cleanupAfterRender = false;\n this.pendingCleanup = false;\n this._intentStates = new Map();\n this._annotationPromises = new Map();\n this.destroyed = false;\n }\n\n get pageNumber() {\n return this._pageIndex + 1;\n }\n\n get rotate() {\n return this._pageInfo.rotate;\n }\n\n get ref() {\n return this._pageInfo.ref;\n }\n\n get userUnit() {\n return this._pageInfo.userUnit;\n }\n\n get view() {\n return this._pageInfo.view;\n }\n\n getViewport({\n scale,\n rotation = this.rotate,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false\n } = {}) {\n return new _display_utils.PageViewport({\n viewBox: this.view,\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip\n });\n }\n\n getAnnotations({\n intent = \"display\"\n } = {}) {\n const intentArgs = this._transport.getRenderingIntent(intent);\n\n let promise = this._annotationPromises.get(intentArgs.cacheKey);\n\n if (!promise) {\n promise = this._transport.getAnnotations(this._pageIndex, intentArgs.renderingIntent);\n\n this._annotationPromises.set(intentArgs.cacheKey, promise);\n\n promise = promise.then(annotations => {\n for (const annotation of annotations) {\n if (annotation.titleObj !== undefined) {\n Object.defineProperty(annotation, \"title\", {\n get() {\n (0, _display_utils.deprecated)(\"`title`-property on annotation, please use `titleObj` instead.\");\n return annotation.titleObj.str;\n }\n\n });\n }\n\n if (annotation.contentsObj !== undefined) {\n Object.defineProperty(annotation, \"contents\", {\n get() {\n (0, _display_utils.deprecated)(\"`contents`-property on annotation, please use `contentsObj` instead.\");\n return annotation.contentsObj.str;\n }\n\n });\n }\n }\n\n return annotations;\n });\n }\n\n return promise;\n }\n\n getJSActions() {\n return this._jsActionsPromise ||= this._transport.getPageJSActions(this._pageIndex);\n }\n\n async getXfa() {\n return this._transport._htmlForXfa?.children[this._pageIndex] || null;\n }\n\n render({\n canvasContext,\n viewport,\n intent = \"display\",\n annotationMode = _util.AnnotationMode.ENABLE,\n transform = null,\n imageLayer = null,\n canvasFactory = null,\n background = null,\n optionalContentConfigPromise = null,\n annotationCanvasMap = null,\n pageColors = null,\n printAnnotationStorage = null\n }) {\n if (arguments[0]?.renderInteractiveForms !== undefined) {\n (0, _display_utils.deprecated)(\"render no longer accepts the `renderInteractiveForms`-option, \" + \"please use the `annotationMode`-option instead.\");\n\n if (arguments[0].renderInteractiveForms === true && annotationMode === _util.AnnotationMode.ENABLE) {\n annotationMode = _util.AnnotationMode.ENABLE_FORMS;\n }\n }\n\n if (arguments[0]?.includeAnnotationStorage !== undefined) {\n (0, _display_utils.deprecated)(\"render no longer accepts the `includeAnnotationStorage`-option, \" + \"please use the `annotationMode`-option instead.\");\n\n if (arguments[0].includeAnnotationStorage === true && annotationMode === _util.AnnotationMode.ENABLE) {\n annotationMode = _util.AnnotationMode.ENABLE_STORAGE;\n }\n }\n\n if (this._stats) {\n this._stats.time(\"Overall\");\n }\n\n const intentArgs = this._transport.getRenderingIntent(intent, annotationMode, printAnnotationStorage);\n\n this.pendingCleanup = false;\n\n if (!optionalContentConfigPromise) {\n optionalContentConfigPromise = this._transport.getOptionalContentConfig();\n }\n\n let intentState = this._intentStates.get(intentArgs.cacheKey);\n\n if (!intentState) {\n intentState = Object.create(null);\n\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n const canvasFactoryInstance = canvasFactory || new DefaultCanvasFactory({\n ownerDocument: this._ownerDocument\n });\n const intentPrint = !!(intentArgs.renderingIntent & _util.RenderingIntentFlag.PRINT);\n\n if (!intentState.displayReadyCapability) {\n intentState.displayReadyCapability = (0, _util.createPromiseCapability)();\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null\n };\n\n if (this._stats) {\n this._stats.time(\"Page Request\");\n }\n\n this._pumpOperatorList(intentArgs);\n }\n\n const complete = error => {\n intentState.renderTasks.delete(internalRenderTask);\n\n if (this.cleanupAfterRender || intentPrint) {\n this.pendingCleanup = true;\n }\n\n this._tryCleanup();\n\n if (error) {\n internalRenderTask.capability.reject(error);\n\n this._abortOperatorList({\n intentState,\n reason: error instanceof Error ? error : new Error(error)\n });\n } else {\n internalRenderTask.capability.resolve();\n }\n\n if (this._stats) {\n this._stats.timeEnd(\"Rendering\");\n\n this._stats.timeEnd(\"Overall\");\n }\n };\n\n const internalRenderTask = new InternalRenderTask({\n callback: complete,\n params: {\n canvasContext,\n viewport,\n transform,\n imageLayer,\n background\n },\n objs: this.objs,\n commonObjs: this.commonObjs,\n annotationCanvasMap,\n operatorList: intentState.operatorList,\n pageIndex: this._pageIndex,\n canvasFactory: canvasFactoryInstance,\n useRequestAnimationFrame: !intentPrint,\n pdfBug: this._pdfBug,\n pageColors\n });\n (intentState.renderTasks ||= new Set()).add(internalRenderTask);\n const renderTask = internalRenderTask.task;\n Promise.all([intentState.displayReadyCapability.promise, optionalContentConfigPromise]).then(([transparency, optionalContentConfig]) => {\n if (this.pendingCleanup) {\n complete();\n return;\n }\n\n if (this._stats) {\n this._stats.time(\"Rendering\");\n }\n\n internalRenderTask.initializeGraphics({\n transparency,\n optionalContentConfig\n });\n internalRenderTask.operatorListChanged();\n }).catch(complete);\n return renderTask;\n }\n\n getOperatorList({\n intent = \"display\",\n annotationMode = _util.AnnotationMode.ENABLE,\n printAnnotationStorage = null\n } = {}) {\n function operatorListChanged() {\n if (intentState.operatorList.lastChunk) {\n intentState.opListReadCapability.resolve(intentState.operatorList);\n intentState.renderTasks.delete(opListTask);\n }\n }\n\n const intentArgs = this._transport.getRenderingIntent(intent, annotationMode, printAnnotationStorage, true);\n\n let intentState = this._intentStates.get(intentArgs.cacheKey);\n\n if (!intentState) {\n intentState = Object.create(null);\n\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n\n let opListTask;\n\n if (!intentState.opListReadCapability) {\n opListTask = Object.create(null);\n opListTask.operatorListChanged = operatorListChanged;\n intentState.opListReadCapability = (0, _util.createPromiseCapability)();\n (intentState.renderTasks ||= new Set()).add(opListTask);\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null\n };\n\n if (this._stats) {\n this._stats.time(\"Page Request\");\n }\n\n this._pumpOperatorList(intentArgs);\n }\n\n return intentState.opListReadCapability.promise;\n }\n\n streamTextContent({\n disableCombineTextItems = false,\n includeMarkedContent = false\n } = {}) {\n const TEXT_CONTENT_CHUNK_SIZE = 100;\n return this._transport.messageHandler.sendWithStream(\"GetTextContent\", {\n pageIndex: this._pageIndex,\n combineTextItems: disableCombineTextItems !== true,\n includeMarkedContent: includeMarkedContent === true\n }, {\n highWaterMark: TEXT_CONTENT_CHUNK_SIZE,\n\n size(textContent) {\n return textContent.items.length;\n }\n\n });\n }\n\n getTextContent(params = {}) {\n if (this._transport._htmlForXfa) {\n return this.getXfa().then(xfa => {\n return _xfa_text.XfaText.textContent(xfa);\n });\n }\n\n const readableStream = this.streamTextContent(params);\n return new Promise(function (resolve, reject) {\n function pump() {\n reader.read().then(function ({\n value,\n done\n }) {\n if (done) {\n resolve(textContent);\n return;\n }\n\n Object.assign(textContent.styles, value.styles);\n textContent.items.push(...value.items);\n pump();\n }, reject);\n }\n\n const reader = readableStream.getReader();\n const textContent = {\n items: [],\n styles: Object.create(null)\n };\n pump();\n });\n }\n\n getStructTree() {\n return this._structTreePromise ||= this._transport.getStructTree(this._pageIndex);\n }\n\n _destroy() {\n this.destroyed = true;\n const waitOn = [];\n\n for (const intentState of this._intentStates.values()) {\n this._abortOperatorList({\n intentState,\n reason: new Error(\"Page was destroyed.\"),\n force: true\n });\n\n if (intentState.opListReadCapability) {\n continue;\n }\n\n for (const internalRenderTask of intentState.renderTasks) {\n waitOn.push(internalRenderTask.completed);\n internalRenderTask.cancel();\n }\n }\n\n this.objs.clear();\n\n for (const bitmap of this._bitmaps) {\n bitmap.close();\n }\n\n this._bitmaps.clear();\n\n this._annotationPromises.clear();\n\n this._jsActionsPromise = null;\n this._structTreePromise = null;\n this.pendingCleanup = false;\n return Promise.all(waitOn);\n }\n\n cleanup(resetStats = false) {\n this.pendingCleanup = true;\n return this._tryCleanup(resetStats);\n }\n\n _tryCleanup(resetStats = false) {\n if (!this.pendingCleanup) {\n return false;\n }\n\n for (const {\n renderTasks,\n operatorList\n } of this._intentStates.values()) {\n if (renderTasks.size > 0 || !operatorList.lastChunk) {\n return false;\n }\n }\n\n this._intentStates.clear();\n\n this.objs.clear();\n\n this._annotationPromises.clear();\n\n this._jsActionsPromise = null;\n this._structTreePromise = null;\n\n if (resetStats && this._stats) {\n this._stats = new _display_utils.StatTimer();\n }\n\n for (const bitmap of this._bitmaps) {\n bitmap.close();\n }\n\n this._bitmaps.clear();\n\n this.pendingCleanup = false;\n return true;\n }\n\n _startRenderPage(transparency, cacheKey) {\n const intentState = this._intentStates.get(cacheKey);\n\n if (!intentState) {\n return;\n }\n\n if (this._stats) {\n this._stats.timeEnd(\"Page Request\");\n }\n\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.resolve(transparency);\n }\n }\n\n _renderPageChunk(operatorListChunk, intentState) {\n for (let i = 0, ii = operatorListChunk.length; i < ii; i++) {\n intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]);\n intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]);\n }\n\n intentState.operatorList.lastChunk = operatorListChunk.lastChunk;\n intentState.operatorList.separateAnnots = operatorListChunk.separateAnnots;\n\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n\n if (operatorListChunk.lastChunk) {\n this._tryCleanup();\n }\n }\n\n _pumpOperatorList({\n renderingIntent,\n cacheKey,\n annotationStorageMap\n }) {\n const readableStream = this._transport.messageHandler.sendWithStream(\"GetOperatorList\", {\n pageIndex: this._pageIndex,\n intent: renderingIntent,\n cacheKey,\n annotationStorage: annotationStorageMap\n });\n\n const reader = readableStream.getReader();\n\n const intentState = this._intentStates.get(cacheKey);\n\n intentState.streamReader = reader;\n\n const pump = () => {\n reader.read().then(({\n value,\n done\n }) => {\n if (done) {\n intentState.streamReader = null;\n return;\n }\n\n if (this._transport.destroyed) {\n return;\n }\n\n this._renderPageChunk(value, intentState);\n\n pump();\n }, reason => {\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return;\n }\n\n if (intentState.operatorList) {\n intentState.operatorList.lastChunk = true;\n\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n\n this._tryCleanup();\n }\n\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.reject(reason);\n } else if (intentState.opListReadCapability) {\n intentState.opListReadCapability.reject(reason);\n } else {\n throw reason;\n }\n });\n };\n\n pump();\n }\n\n _abortOperatorList({\n intentState,\n reason,\n force = false\n }) {\n if (!intentState.streamReader) {\n return;\n }\n\n if (!force) {\n if (intentState.renderTasks.size > 0) {\n return;\n }\n\n if (reason instanceof _display_utils.RenderingCancelledException) {\n intentState.streamReaderCancelTimeout = setTimeout(() => {\n this._abortOperatorList({\n intentState,\n reason,\n force: true\n });\n\n intentState.streamReaderCancelTimeout = null;\n }, RENDERING_CANCELLED_TIMEOUT);\n return;\n }\n }\n\n intentState.streamReader.cancel(new _util.AbortException(reason.message)).catch(() => {});\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return;\n }\n\n for (const [curCacheKey, curIntentState] of this._intentStates) {\n if (curIntentState === intentState) {\n this._intentStates.delete(curCacheKey);\n\n break;\n }\n }\n\n this.cleanup();\n }\n\n get stats() {\n return this._stats;\n }\n\n}\n\nexports.PDFPageProxy = PDFPageProxy;\n\nclass LoopbackPort {\n constructor() {\n this._listeners = [];\n this._deferred = Promise.resolve();\n }\n\n postMessage(obj, transfers) {\n const event = {\n data: structuredClone(obj, transfers)\n };\n\n this._deferred.then(() => {\n for (const listener of this._listeners) {\n listener.call(this, event);\n }\n });\n }\n\n addEventListener(name, listener) {\n this._listeners.push(listener);\n }\n\n removeEventListener(name, listener) {\n const i = this._listeners.indexOf(listener);\n\n this._listeners.splice(i, 1);\n }\n\n terminate() {\n this._listeners.length = 0;\n }\n\n}\n\nexports.LoopbackPort = LoopbackPort;\nconst PDFWorkerUtil = {\n isWorkerDisabled: false,\n fallbackWorkerSrc: null,\n fakeWorkerId: 0\n};\nexports.PDFWorkerUtil = PDFWorkerUtil;\n{\n if (_is_node.isNodeJS && typeof require === \"function\") {\n PDFWorkerUtil.isWorkerDisabled = true;\n PDFWorkerUtil.fallbackWorkerSrc = \"./pdf.worker.js\";\n } else if (typeof document === \"object\") {\n const pdfjsFilePath = document?.currentScript?.src;\n\n if (pdfjsFilePath) {\n PDFWorkerUtil.fallbackWorkerSrc = pdfjsFilePath.replace(/(\\.(?:min\\.)?js)(\\?.*)?$/i, \".worker$1$2\");\n }\n }\n\n PDFWorkerUtil.isSameOrigin = function (baseUrl, otherUrl) {\n let base;\n\n try {\n base = new URL(baseUrl);\n\n if (!base.origin || base.origin === \"null\") {\n return false;\n }\n } catch (e) {\n return false;\n }\n\n const other = new URL(otherUrl, base);\n return base.origin === other.origin;\n };\n\n PDFWorkerUtil.createCDNWrapper = function (url) {\n const wrapper = `importScripts(\"${url}\");`;\n return URL.createObjectURL(new Blob([wrapper]));\n };\n}\n\nclass PDFWorker {\n static #workerPorts = new WeakMap();\n\n constructor({\n name = null,\n port = null,\n verbosity = (0, _util.getVerbosityLevel)()\n } = {}) {\n if (port && PDFWorker.#workerPorts.has(port)) {\n throw new Error(\"Cannot use more than one PDFWorker per port.\");\n }\n\n this.name = name;\n this.destroyed = false;\n this.verbosity = verbosity;\n this._readyCapability = (0, _util.createPromiseCapability)();\n this._port = null;\n this._webWorker = null;\n this._messageHandler = null;\n\n if (port) {\n PDFWorker.#workerPorts.set(port, this);\n\n this._initializeFromPort(port);\n\n return;\n }\n\n this._initialize();\n }\n\n get promise() {\n return this._readyCapability.promise;\n }\n\n get port() {\n return this._port;\n }\n\n get messageHandler() {\n return this._messageHandler;\n }\n\n _initializeFromPort(port) {\n this._port = port;\n this._messageHandler = new _message_handler.MessageHandler(\"main\", \"worker\", port);\n\n this._messageHandler.on(\"ready\", function () {});\n\n this._readyCapability.resolve();\n }\n\n _initialize() {\n if (!PDFWorkerUtil.isWorkerDisabled && !PDFWorker._mainThreadWorkerMessageHandler) {\n let {\n workerSrc\n } = PDFWorker;\n\n try {\n if (!PDFWorkerUtil.isSameOrigin(window.location.href, workerSrc)) {\n workerSrc = PDFWorkerUtil.createCDNWrapper(new URL(workerSrc, window.location).href);\n }\n\n const worker = new Worker(workerSrc);\n const messageHandler = new _message_handler.MessageHandler(\"main\", \"worker\", worker);\n\n const terminateEarly = () => {\n worker.removeEventListener(\"error\", onWorkerError);\n messageHandler.destroy();\n worker.terminate();\n\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n } else {\n this._setupFakeWorker();\n }\n };\n\n const onWorkerError = () => {\n if (!this._webWorker) {\n terminateEarly();\n }\n };\n\n worker.addEventListener(\"error\", onWorkerError);\n messageHandler.on(\"test\", data => {\n worker.removeEventListener(\"error\", onWorkerError);\n\n if (this.destroyed) {\n terminateEarly();\n return;\n }\n\n if (data) {\n this._messageHandler = messageHandler;\n this._port = worker;\n this._webWorker = worker;\n\n this._readyCapability.resolve();\n\n messageHandler.send(\"configure\", {\n verbosity: this.verbosity\n });\n } else {\n this._setupFakeWorker();\n\n messageHandler.destroy();\n worker.terminate();\n }\n });\n messageHandler.on(\"ready\", data => {\n worker.removeEventListener(\"error\", onWorkerError);\n\n if (this.destroyed) {\n terminateEarly();\n return;\n }\n\n try {\n sendTest();\n } catch (e) {\n this._setupFakeWorker();\n }\n });\n\n const sendTest = () => {\n const testObj = new Uint8Array();\n messageHandler.send(\"test\", testObj, [testObj.buffer]);\n };\n\n sendTest();\n return;\n } catch (e) {\n (0, _util.info)(\"The worker has been disabled.\");\n }\n }\n\n this._setupFakeWorker();\n }\n\n _setupFakeWorker() {\n if (!PDFWorkerUtil.isWorkerDisabled) {\n (0, _util.warn)(\"Setting up fake worker.\");\n PDFWorkerUtil.isWorkerDisabled = true;\n }\n\n PDFWorker._setupFakeWorkerGlobal.then(WorkerMessageHandler => {\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n\n return;\n }\n\n const port = new LoopbackPort();\n this._port = port;\n const id = `fake${PDFWorkerUtil.fakeWorkerId++}`;\n const workerHandler = new _message_handler.MessageHandler(id + \"_worker\", id, port);\n WorkerMessageHandler.setup(workerHandler, port);\n const messageHandler = new _message_handler.MessageHandler(id, id + \"_worker\", port);\n this._messageHandler = messageHandler;\n\n this._readyCapability.resolve();\n\n messageHandler.send(\"configure\", {\n verbosity: this.verbosity\n });\n }).catch(reason => {\n this._readyCapability.reject(new Error(`Setting up fake worker failed: \"${reason.message}\".`));\n });\n }\n\n destroy() {\n this.destroyed = true;\n\n if (this._webWorker) {\n this._webWorker.terminate();\n\n this._webWorker = null;\n }\n\n PDFWorker.#workerPorts.delete(this._port);\n this._port = null;\n\n if (this._messageHandler) {\n this._messageHandler.destroy();\n\n this._messageHandler = null;\n }\n }\n\n static fromPort(params) {\n if (!params?.port) {\n throw new Error(\"PDFWorker.fromPort - invalid method signature.\");\n }\n\n if (this.#workerPorts.has(params.port)) {\n return this.#workerPorts.get(params.port);\n }\n\n return new PDFWorker(params);\n }\n\n static get workerSrc() {\n if (_worker_options.GlobalWorkerOptions.workerSrc) {\n return _worker_options.GlobalWorkerOptions.workerSrc;\n }\n\n if (PDFWorkerUtil.fallbackWorkerSrc !== null) {\n if (!_is_node.isNodeJS) {\n (0, _display_utils.deprecated)('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n\n return PDFWorkerUtil.fallbackWorkerSrc;\n }\n\n throw new Error('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n\n static get _mainThreadWorkerMessageHandler() {\n try {\n return globalThis.pdfjsWorker?.WorkerMessageHandler || null;\n } catch (ex) {\n return null;\n }\n }\n\n static get _setupFakeWorkerGlobal() {\n const loader = async () => {\n const mainWorkerMessageHandler = this._mainThreadWorkerMessageHandler;\n\n if (mainWorkerMessageHandler) {\n return mainWorkerMessageHandler;\n }\n\n if (_is_node.isNodeJS && typeof require === \"function\") {\n const worker = eval(\"require\")(this.workerSrc);\n return worker.WorkerMessageHandler;\n }\n\n await (0, _display_utils.loadScript)(this.workerSrc);\n return window.pdfjsWorker.WorkerMessageHandler;\n };\n\n return (0, _util.shadow)(this, \"_setupFakeWorkerGlobal\", loader());\n }\n\n}\n\nexports.PDFWorker = PDFWorker;\n{\n PDFWorker.getWorkerSrc = function () {\n (0, _display_utils.deprecated)(\"`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead.\");\n return this.workerSrc;\n };\n}\n\nclass WorkerTransport {\n #docStats = null;\n #pageCache = new Map();\n #pagePromises = new Map();\n #metadataPromise = null;\n\n constructor(messageHandler, loadingTask, networkStream, params) {\n this.messageHandler = messageHandler;\n this.loadingTask = loadingTask;\n this.commonObjs = new PDFObjects();\n this.fontLoader = new _font_loader.FontLoader({\n docId: loadingTask.docId,\n onUnsupportedFeature: this._onUnsupportedFeature.bind(this),\n ownerDocument: params.ownerDocument,\n styleElement: params.styleElement\n });\n this._params = params;\n\n if (!params.useWorkerFetch) {\n this.CMapReaderFactory = new params.CMapReaderFactory({\n baseUrl: params.cMapUrl,\n isCompressed: params.cMapPacked\n });\n this.StandardFontDataFactory = new params.StandardFontDataFactory({\n baseUrl: params.standardFontDataUrl\n });\n }\n\n this.destroyed = false;\n this.destroyCapability = null;\n this._passwordCapability = null;\n this._networkStream = networkStream;\n this._fullReader = null;\n this._lastProgress = null;\n this.downloadInfoCapability = (0, _util.createPromiseCapability)();\n this.setupMessageHandler();\n }\n\n get annotationStorage() {\n return (0, _util.shadow)(this, \"annotationStorage\", new _annotation_storage.AnnotationStorage());\n }\n\n get stats() {\n return this.#docStats;\n }\n\n getRenderingIntent(intent, annotationMode = _util.AnnotationMode.ENABLE, printAnnotationStorage = null, isOpList = false) {\n let renderingIntent = _util.RenderingIntentFlag.DISPLAY;\n let annotationMap = null;\n\n switch (intent) {\n case \"any\":\n renderingIntent = _util.RenderingIntentFlag.ANY;\n break;\n\n case \"display\":\n break;\n\n case \"print\":\n renderingIntent = _util.RenderingIntentFlag.PRINT;\n break;\n\n default:\n (0, _util.warn)(`getRenderingIntent - invalid intent: ${intent}`);\n }\n\n switch (annotationMode) {\n case _util.AnnotationMode.DISABLE:\n renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_DISABLE;\n break;\n\n case _util.AnnotationMode.ENABLE:\n break;\n\n case _util.AnnotationMode.ENABLE_FORMS:\n renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_FORMS;\n break;\n\n case _util.AnnotationMode.ENABLE_STORAGE:\n renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_STORAGE;\n const annotationStorage = renderingIntent & _util.RenderingIntentFlag.PRINT && printAnnotationStorage instanceof _annotation_storage.PrintAnnotationStorage ? printAnnotationStorage : this.annotationStorage;\n annotationMap = annotationStorage.serializable;\n break;\n\n default:\n (0, _util.warn)(`getRenderingIntent - invalid annotationMode: ${annotationMode}`);\n }\n\n if (isOpList) {\n renderingIntent += _util.RenderingIntentFlag.OPLIST;\n }\n\n return {\n renderingIntent,\n cacheKey: `${renderingIntent}_${_annotation_storage.AnnotationStorage.getHash(annotationMap)}`,\n annotationStorageMap: annotationMap\n };\n }\n\n destroy() {\n if (this.destroyCapability) {\n return this.destroyCapability.promise;\n }\n\n this.destroyed = true;\n this.destroyCapability = (0, _util.createPromiseCapability)();\n\n if (this._passwordCapability) {\n this._passwordCapability.reject(new Error(\"Worker was destroyed during onPassword callback\"));\n }\n\n const waitOn = [];\n\n for (const page of this.#pageCache.values()) {\n waitOn.push(page._destroy());\n }\n\n this.#pageCache.clear();\n this.#pagePromises.clear();\n\n if (this.hasOwnProperty(\"annotationStorage\")) {\n this.annotationStorage.resetModified();\n }\n\n const terminated = this.messageHandler.sendWithPromise(\"Terminate\", null);\n waitOn.push(terminated);\n Promise.all(waitOn).then(() => {\n this.commonObjs.clear();\n this.fontLoader.clear();\n this.#metadataPromise = null;\n this._getFieldObjectsPromise = null;\n this._hasJSActionsPromise = null;\n\n if (this._networkStream) {\n this._networkStream.cancelAllRequests(new _util.AbortException(\"Worker was terminated.\"));\n }\n\n if (this.messageHandler) {\n this.messageHandler.destroy();\n this.messageHandler = null;\n }\n\n this.destroyCapability.resolve();\n }, this.destroyCapability.reject);\n return this.destroyCapability.promise;\n }\n\n setupMessageHandler() {\n const {\n messageHandler,\n loadingTask\n } = this;\n messageHandler.on(\"GetReader\", (data, sink) => {\n (0, _util.assert)(this._networkStream, \"GetReader - no `IPDFStream` instance available.\");\n this._fullReader = this._networkStream.getFullReader();\n\n this._fullReader.onProgress = evt => {\n this._lastProgress = {\n loaded: evt.loaded,\n total: evt.total\n };\n };\n\n sink.onPull = () => {\n this._fullReader.read().then(function ({\n value,\n done\n }) {\n if (done) {\n sink.close();\n return;\n }\n\n (0, _util.assert)((0, _util.isArrayBuffer)(value), \"GetReader - expected an ArrayBuffer.\");\n sink.enqueue(new Uint8Array(value), 1, [value]);\n }).catch(reason => {\n sink.error(reason);\n });\n };\n\n sink.onCancel = reason => {\n this._fullReader.cancel(reason);\n\n sink.ready.catch(readyReason => {\n if (this.destroyed) {\n return;\n }\n\n throw readyReason;\n });\n };\n });\n messageHandler.on(\"ReaderHeadersReady\", data => {\n const headersCapability = (0, _util.createPromiseCapability)();\n const fullReader = this._fullReader;\n fullReader.headersReady.then(() => {\n if (!fullReader.isStreamingSupported || !fullReader.isRangeSupported) {\n if (this._lastProgress) {\n loadingTask.onProgress?.(this._lastProgress);\n }\n\n fullReader.onProgress = evt => {\n loadingTask.onProgress?.({\n loaded: evt.loaded,\n total: evt.total\n });\n };\n }\n\n headersCapability.resolve({\n isStreamingSupported: fullReader.isStreamingSupported,\n isRangeSupported: fullReader.isRangeSupported,\n contentLength: fullReader.contentLength\n });\n }, headersCapability.reject);\n return headersCapability.promise;\n });\n messageHandler.on(\"GetRangeReader\", (data, sink) => {\n (0, _util.assert)(this._networkStream, \"GetRangeReader - no `IPDFStream` instance available.\");\n\n const rangeReader = this._networkStream.getRangeReader(data.begin, data.end);\n\n if (!rangeReader) {\n sink.close();\n return;\n }\n\n sink.onPull = () => {\n rangeReader.read().then(function ({\n value,\n done\n }) {\n if (done) {\n sink.close();\n return;\n }\n\n (0, _util.assert)((0, _util.isArrayBuffer)(value), \"GetRangeReader - expected an ArrayBuffer.\");\n sink.enqueue(new Uint8Array(value), 1, [value]);\n }).catch(reason => {\n sink.error(reason);\n });\n };\n\n sink.onCancel = reason => {\n rangeReader.cancel(reason);\n sink.ready.catch(readyReason => {\n if (this.destroyed) {\n return;\n }\n\n throw readyReason;\n });\n };\n });\n messageHandler.on(\"GetDoc\", ({\n pdfInfo\n }) => {\n this._numPages = pdfInfo.numPages;\n this._htmlForXfa = pdfInfo.htmlForXfa;\n delete pdfInfo.htmlForXfa;\n\n loadingTask._capability.resolve(new PDFDocumentProxy(pdfInfo, this));\n });\n messageHandler.on(\"DocException\", function (ex) {\n let reason;\n\n switch (ex.name) {\n case \"PasswordException\":\n reason = new _util.PasswordException(ex.message, ex.code);\n break;\n\n case \"InvalidPDFException\":\n reason = new _util.InvalidPDFException(ex.message);\n break;\n\n case \"MissingPDFException\":\n reason = new _util.MissingPDFException(ex.message);\n break;\n\n case \"UnexpectedResponseException\":\n reason = new _util.UnexpectedResponseException(ex.message, ex.status);\n break;\n\n case \"UnknownErrorException\":\n reason = new _util.UnknownErrorException(ex.message, ex.details);\n break;\n\n default:\n (0, _util.unreachable)(\"DocException - expected a valid Error.\");\n }\n\n loadingTask._capability.reject(reason);\n });\n messageHandler.on(\"PasswordRequest\", exception => {\n this._passwordCapability = (0, _util.createPromiseCapability)();\n\n if (loadingTask.onPassword) {\n const updatePassword = password => {\n if (password instanceof Error) {\n this._passwordCapability.reject(password);\n } else {\n this._passwordCapability.resolve({\n password\n });\n }\n };\n\n try {\n loadingTask.onPassword(updatePassword, exception.code);\n } catch (ex) {\n this._passwordCapability.reject(ex);\n }\n } else {\n this._passwordCapability.reject(new _util.PasswordException(exception.message, exception.code));\n }\n\n return this._passwordCapability.promise;\n });\n messageHandler.on(\"DataLoaded\", data => {\n loadingTask.onProgress?.({\n loaded: data.length,\n total: data.length\n });\n this.downloadInfoCapability.resolve(data);\n });\n messageHandler.on(\"StartRenderPage\", data => {\n if (this.destroyed) {\n return;\n }\n\n const page = this.#pageCache.get(data.pageIndex);\n\n page._startRenderPage(data.transparency, data.cacheKey);\n });\n messageHandler.on(\"commonobj\", ([id, type, exportedData]) => {\n if (this.destroyed) {\n return;\n }\n\n if (this.commonObjs.has(id)) {\n return;\n }\n\n switch (type) {\n case \"Font\":\n const params = this._params;\n\n if (\"error\" in exportedData) {\n const exportedError = exportedData.error;\n (0, _util.warn)(`Error during font loading: ${exportedError}`);\n this.commonObjs.resolve(id, exportedError);\n break;\n }\n\n let fontRegistry = null;\n\n if (params.pdfBug && globalThis.FontInspector?.enabled) {\n fontRegistry = {\n registerFont(font, url) {\n globalThis.FontInspector.fontAdded(font, url);\n }\n\n };\n }\n\n const font = new _font_loader.FontFaceObject(exportedData, {\n isEvalSupported: params.isEvalSupported,\n disableFontFace: params.disableFontFace,\n ignoreErrors: params.ignoreErrors,\n onUnsupportedFeature: this._onUnsupportedFeature.bind(this),\n fontRegistry\n });\n this.fontLoader.bind(font).catch(reason => {\n return messageHandler.sendWithPromise(\"FontFallback\", {\n id\n });\n }).finally(() => {\n if (!params.fontExtraProperties && font.data) {\n font.data = null;\n }\n\n this.commonObjs.resolve(id, font);\n });\n break;\n\n case \"FontPath\":\n case \"Image\":\n this.commonObjs.resolve(id, exportedData);\n break;\n\n default:\n throw new Error(`Got unknown common object type ${type}`);\n }\n });\n messageHandler.on(\"obj\", ([id, pageIndex, type, imageData]) => {\n if (this.destroyed) {\n return;\n }\n\n const pageProxy = this.#pageCache.get(pageIndex);\n\n if (pageProxy.objs.has(id)) {\n return;\n }\n\n switch (type) {\n case \"Image\":\n pageProxy.objs.resolve(id, imageData);\n const MAX_IMAGE_SIZE_TO_STORE = 8000000;\n\n if (imageData) {\n let length;\n\n if (imageData.bitmap) {\n const {\n bitmap,\n width,\n height\n } = imageData;\n length = width * height * 4;\n\n pageProxy._bitmaps.add(bitmap);\n } else {\n length = imageData.data?.length || 0;\n }\n\n if (length > MAX_IMAGE_SIZE_TO_STORE) {\n pageProxy.cleanupAfterRender = true;\n }\n }\n\n break;\n\n case \"Pattern\":\n pageProxy.objs.resolve(id, imageData);\n break;\n\n default:\n throw new Error(`Got unknown object type ${type}`);\n }\n });\n messageHandler.on(\"DocProgress\", data => {\n if (this.destroyed) {\n return;\n }\n\n loadingTask.onProgress?.({\n loaded: data.loaded,\n total: data.total\n });\n });\n messageHandler.on(\"DocStats\", data => {\n if (this.destroyed) {\n return;\n }\n\n this.#docStats = Object.freeze({\n streamTypes: Object.freeze(data.streamTypes),\n fontTypes: Object.freeze(data.fontTypes)\n });\n });\n messageHandler.on(\"UnsupportedFeature\", this._onUnsupportedFeature.bind(this));\n messageHandler.on(\"FetchBuiltInCMap\", data => {\n if (this.destroyed) {\n return Promise.reject(new Error(\"Worker was destroyed.\"));\n }\n\n if (!this.CMapReaderFactory) {\n return Promise.reject(new Error(\"CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.\"));\n }\n\n return this.CMapReaderFactory.fetch(data);\n });\n messageHandler.on(\"FetchStandardFontData\", data => {\n if (this.destroyed) {\n return Promise.reject(new Error(\"Worker was destroyed.\"));\n }\n\n if (!this.StandardFontDataFactory) {\n return Promise.reject(new Error(\"StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.\"));\n }\n\n return this.StandardFontDataFactory.fetch(data);\n });\n }\n\n _onUnsupportedFeature({\n featureId\n }) {\n if (this.destroyed) {\n return;\n }\n\n this.loadingTask.onUnsupportedFeature?.(featureId);\n }\n\n getData() {\n return this.messageHandler.sendWithPromise(\"GetData\", null);\n }\n\n getPage(pageNumber) {\n if (!Number.isInteger(pageNumber) || pageNumber <= 0 || pageNumber > this._numPages) {\n return Promise.reject(new Error(\"Invalid page request.\"));\n }\n\n const pageIndex = pageNumber - 1,\n cachedPromise = this.#pagePromises.get(pageIndex);\n\n if (cachedPromise) {\n return cachedPromise;\n }\n\n const promise = this.messageHandler.sendWithPromise(\"GetPage\", {\n pageIndex\n }).then(pageInfo => {\n if (this.destroyed) {\n throw new Error(\"Transport destroyed\");\n }\n\n const page = new PDFPageProxy(pageIndex, pageInfo, this, this._params.ownerDocument, this._params.pdfBug);\n this.#pageCache.set(pageIndex, page);\n return page;\n });\n this.#pagePromises.set(pageIndex, promise);\n return promise;\n }\n\n getPageIndex(ref) {\n if (typeof ref !== \"object\" || ref === null || !Number.isInteger(ref.num) || ref.num < 0 || !Number.isInteger(ref.gen) || ref.gen < 0) {\n return Promise.reject(new Error(\"Invalid pageIndex request.\"));\n }\n\n return this.messageHandler.sendWithPromise(\"GetPageIndex\", {\n num: ref.num,\n gen: ref.gen\n });\n }\n\n getAnnotations(pageIndex, intent) {\n return this.messageHandler.sendWithPromise(\"GetAnnotations\", {\n pageIndex,\n intent\n });\n }\n\n saveDocument() {\n return this.messageHandler.sendWithPromise(\"SaveDocument\", {\n isPureXfa: !!this._htmlForXfa,\n numPages: this._numPages,\n annotationStorage: this.annotationStorage.serializable,\n filename: this._fullReader?.filename ?? null\n }).finally(() => {\n this.annotationStorage.resetModified();\n });\n }\n\n getFieldObjects() {\n return this._getFieldObjectsPromise ||= this.messageHandler.sendWithPromise(\"GetFieldObjects\", null);\n }\n\n hasJSActions() {\n return this._hasJSActionsPromise ||= this.messageHandler.sendWithPromise(\"HasJSActions\", null);\n }\n\n getCalculationOrderIds() {\n return this.messageHandler.sendWithPromise(\"GetCalculationOrderIds\", null);\n }\n\n getDestinations() {\n return this.messageHandler.sendWithPromise(\"GetDestinations\", null);\n }\n\n getDestination(id) {\n if (typeof id !== \"string\") {\n return Promise.reject(new Error(\"Invalid destination request.\"));\n }\n\n return this.messageHandler.sendWithPromise(\"GetDestination\", {\n id\n });\n }\n\n getPageLabels() {\n return this.messageHandler.sendWithPromise(\"GetPageLabels\", null);\n }\n\n getPageLayout() {\n return this.messageHandler.sendWithPromise(\"GetPageLayout\", null);\n }\n\n getPageMode() {\n return this.messageHandler.sendWithPromise(\"GetPageMode\", null);\n }\n\n getViewerPreferences() {\n return this.messageHandler.sendWithPromise(\"GetViewerPreferences\", null);\n }\n\n getOpenAction() {\n return this.messageHandler.sendWithPromise(\"GetOpenAction\", null);\n }\n\n getAttachments() {\n return this.messageHandler.sendWithPromise(\"GetAttachments\", null);\n }\n\n getJavaScript() {\n return this.messageHandler.sendWithPromise(\"GetJavaScript\", null);\n }\n\n getDocJSActions() {\n return this.messageHandler.sendWithPromise(\"GetDocJSActions\", null);\n }\n\n getPageJSActions(pageIndex) {\n return this.messageHandler.sendWithPromise(\"GetPageJSActions\", {\n pageIndex\n });\n }\n\n getStructTree(pageIndex) {\n return this.messageHandler.sendWithPromise(\"GetStructTree\", {\n pageIndex\n });\n }\n\n getOutline() {\n return this.messageHandler.sendWithPromise(\"GetOutline\", null);\n }\n\n getOptionalContentConfig() {\n return this.messageHandler.sendWithPromise(\"GetOptionalContentConfig\", null).then(results => {\n return new _optional_content_config.OptionalContentConfig(results);\n });\n }\n\n getPermissions() {\n return this.messageHandler.sendWithPromise(\"GetPermissions\", null);\n }\n\n getMetadata() {\n return this.#metadataPromise ||= this.messageHandler.sendWithPromise(\"GetMetadata\", null).then(results => {\n return {\n info: results[0],\n metadata: results[1] ? new _metadata.Metadata(results[1]) : null,\n contentDispositionFilename: this._fullReader?.filename ?? null,\n contentLength: this._fullReader?.contentLength ?? null\n };\n });\n }\n\n getMarkInfo() {\n return this.messageHandler.sendWithPromise(\"GetMarkInfo\", null);\n }\n\n async startCleanup(keepLoadedFonts = false) {\n await this.messageHandler.sendWithPromise(\"Cleanup\", null);\n\n if (this.destroyed) {\n return;\n }\n\n for (const page of this.#pageCache.values()) {\n const cleanupSuccessful = page.cleanup();\n\n if (!cleanupSuccessful) {\n throw new Error(`startCleanup: Page ${page.pageNumber} is currently rendering.`);\n }\n }\n\n this.commonObjs.clear();\n\n if (!keepLoadedFonts) {\n this.fontLoader.clear();\n }\n\n this.#metadataPromise = null;\n this._getFieldObjectsPromise = null;\n this._hasJSActionsPromise = null;\n }\n\n get loadingParams() {\n const params = this._params;\n return (0, _util.shadow)(this, \"loadingParams\", {\n disableAutoFetch: params.disableAutoFetch,\n enableXfa: params.enableXfa\n });\n }\n\n}\n\nclass PDFObjects {\n #objs = Object.create(null);\n\n #ensureObj(objId) {\n const obj = this.#objs[objId];\n\n if (obj) {\n return obj;\n }\n\n return this.#objs[objId] = {\n capability: (0, _util.createPromiseCapability)(),\n data: null\n };\n }\n\n get(objId, callback = null) {\n if (callback) {\n const obj = this.#ensureObj(objId);\n obj.capability.promise.then(() => callback(obj.data));\n return null;\n }\n\n const obj = this.#objs[objId];\n\n if (!obj?.capability.settled) {\n throw new Error(`Requesting object that isn't resolved yet ${objId}.`);\n }\n\n return obj.data;\n }\n\n has(objId) {\n const obj = this.#objs[objId];\n return obj?.capability.settled || false;\n }\n\n resolve(objId, data = null) {\n const obj = this.#ensureObj(objId);\n obj.data = data;\n obj.capability.resolve();\n }\n\n clear() {\n this.#objs = Object.create(null);\n }\n\n}\n\nclass RenderTask {\n #internalRenderTask = null;\n\n constructor(internalRenderTask) {\n this.#internalRenderTask = internalRenderTask;\n this.onContinue = null;\n }\n\n get promise() {\n return this.#internalRenderTask.capability.promise;\n }\n\n cancel() {\n this.#internalRenderTask.cancel();\n }\n\n get separateAnnots() {\n const {\n separateAnnots\n } = this.#internalRenderTask.operatorList;\n\n if (!separateAnnots) {\n return false;\n }\n\n const {\n annotationCanvasMap\n } = this.#internalRenderTask;\n return separateAnnots.form || separateAnnots.canvas && annotationCanvasMap?.size > 0;\n }\n\n}\n\nexports.RenderTask = RenderTask;\n\nclass InternalRenderTask {\n static #canvasInUse = new WeakSet();\n\n constructor({\n callback,\n params,\n objs,\n commonObjs,\n annotationCanvasMap,\n operatorList,\n pageIndex,\n canvasFactory,\n useRequestAnimationFrame = false,\n pdfBug = false,\n pageColors = null\n }) {\n this.callback = callback;\n this.params = params;\n this.objs = objs;\n this.commonObjs = commonObjs;\n this.annotationCanvasMap = annotationCanvasMap;\n this.operatorListIdx = null;\n this.operatorList = operatorList;\n this._pageIndex = pageIndex;\n this.canvasFactory = canvasFactory;\n this._pdfBug = pdfBug;\n this.pageColors = pageColors;\n this.running = false;\n this.graphicsReadyCallback = null;\n this.graphicsReady = false;\n this._useRequestAnimationFrame = useRequestAnimationFrame === true && typeof window !== \"undefined\";\n this.cancelled = false;\n this.capability = (0, _util.createPromiseCapability)();\n this.task = new RenderTask(this);\n this._cancelBound = this.cancel.bind(this);\n this._continueBound = this._continue.bind(this);\n this._scheduleNextBound = this._scheduleNext.bind(this);\n this._nextBound = this._next.bind(this);\n this._canvas = params.canvasContext.canvas;\n }\n\n get completed() {\n return this.capability.promise.catch(function () {});\n }\n\n initializeGraphics({\n transparency = false,\n optionalContentConfig\n }) {\n if (this.cancelled) {\n return;\n }\n\n if (this._canvas) {\n if (InternalRenderTask.#canvasInUse.has(this._canvas)) {\n throw new Error(\"Cannot use the same canvas during multiple render() operations. \" + \"Use different canvas or ensure previous operations were \" + \"cancelled or completed.\");\n }\n\n InternalRenderTask.#canvasInUse.add(this._canvas);\n }\n\n if (this._pdfBug && globalThis.StepperManager?.enabled) {\n this.stepper = globalThis.StepperManager.create(this._pageIndex);\n this.stepper.init(this.operatorList);\n this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint();\n }\n\n const {\n canvasContext,\n viewport,\n transform,\n imageLayer,\n background\n } = this.params;\n this.gfx = new _canvas.CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, imageLayer, optionalContentConfig, this.annotationCanvasMap, this.pageColors);\n this.gfx.beginDrawing({\n transform,\n viewport,\n transparency,\n background\n });\n this.operatorListIdx = 0;\n this.graphicsReady = true;\n\n if (this.graphicsReadyCallback) {\n this.graphicsReadyCallback();\n }\n }\n\n cancel(error = null) {\n this.running = false;\n this.cancelled = true;\n\n if (this.gfx) {\n this.gfx.endDrawing();\n }\n\n if (this._canvas) {\n InternalRenderTask.#canvasInUse.delete(this._canvas);\n }\n\n this.callback(error || new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex + 1}`, \"canvas\"));\n }\n\n operatorListChanged() {\n if (!this.graphicsReady) {\n if (!this.graphicsReadyCallback) {\n this.graphicsReadyCallback = this._continueBound;\n }\n\n return;\n }\n\n if (this.stepper) {\n this.stepper.updateOperatorList(this.operatorList);\n }\n\n if (this.running) {\n return;\n }\n\n this._continue();\n }\n\n _continue() {\n this.running = true;\n\n if (this.cancelled) {\n return;\n }\n\n if (this.task.onContinue) {\n this.task.onContinue(this._scheduleNextBound);\n } else {\n this._scheduleNext();\n }\n }\n\n _scheduleNext() {\n if (this._useRequestAnimationFrame) {\n window.requestAnimationFrame(() => {\n this._nextBound().catch(this._cancelBound);\n });\n } else {\n Promise.resolve().then(this._nextBound).catch(this._cancelBound);\n }\n }\n\n async _next() {\n if (this.cancelled) {\n return;\n }\n\n this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper);\n\n if (this.operatorListIdx === this.operatorList.argsArray.length) {\n this.running = false;\n\n if (this.operatorList.lastChunk) {\n this.gfx.endDrawing();\n\n if (this._canvas) {\n InternalRenderTask.#canvasInUse.delete(this._canvas);\n }\n\n this.callback();\n }\n }\n }\n\n}\n\nconst version = '2.16.105';\nexports.version = version;\nconst build = '172ccdbe5';\nexports.build = build;\n\n/***/ }),\n/* 5 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PrintAnnotationStorage = exports.AnnotationStorage = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _editor = __w_pdfjs_require__(6);\n\nvar _murmurhash = __w_pdfjs_require__(10);\n\nclass AnnotationStorage {\n constructor() {\n this._storage = new Map();\n this._modified = false;\n this.onSetModified = null;\n this.onResetModified = null;\n this.onAnnotationEditor = null;\n }\n\n getValue(key, defaultValue) {\n const value = this._storage.get(key);\n\n if (value === undefined) {\n return defaultValue;\n }\n\n return Object.assign(defaultValue, value);\n }\n\n getRawValue(key) {\n return this._storage.get(key);\n }\n\n remove(key) {\n this._storage.delete(key);\n\n if (this._storage.size === 0) {\n this.resetModified();\n }\n\n if (typeof this.onAnnotationEditor === \"function\") {\n for (const value of this._storage.values()) {\n if (value instanceof _editor.AnnotationEditor) {\n return;\n }\n }\n\n this.onAnnotationEditor(null);\n }\n }\n\n setValue(key, value) {\n const obj = this._storage.get(key);\n\n let modified = false;\n\n if (obj !== undefined) {\n for (const [entry, val] of Object.entries(value)) {\n if (obj[entry] !== val) {\n modified = true;\n obj[entry] = val;\n }\n }\n } else {\n modified = true;\n\n this._storage.set(key, value);\n }\n\n if (modified) {\n this.#setModified();\n }\n\n if (value instanceof _editor.AnnotationEditor && typeof this.onAnnotationEditor === \"function\") {\n this.onAnnotationEditor(value.constructor._type);\n }\n }\n\n has(key) {\n return this._storage.has(key);\n }\n\n getAll() {\n return this._storage.size > 0 ? (0, _util.objectFromMap)(this._storage) : null;\n }\n\n get size() {\n return this._storage.size;\n }\n\n #setModified() {\n if (!this._modified) {\n this._modified = true;\n\n if (typeof this.onSetModified === \"function\") {\n this.onSetModified();\n }\n }\n }\n\n resetModified() {\n if (this._modified) {\n this._modified = false;\n\n if (typeof this.onResetModified === \"function\") {\n this.onResetModified();\n }\n }\n }\n\n get print() {\n return new PrintAnnotationStorage(this);\n }\n\n get serializable() {\n if (this._storage.size === 0) {\n return null;\n }\n\n const clone = new Map();\n\n for (const [key, val] of this._storage) {\n const serialized = val instanceof _editor.AnnotationEditor ? val.serialize() : val;\n\n if (serialized) {\n clone.set(key, serialized);\n }\n }\n\n return clone;\n }\n\n static getHash(map) {\n if (!map) {\n return \"\";\n }\n\n const hash = new _murmurhash.MurmurHash3_64();\n\n for (const [key, val] of map) {\n hash.update(`${key}:${JSON.stringify(val)}`);\n }\n\n return hash.hexdigest();\n }\n\n}\n\nexports.AnnotationStorage = AnnotationStorage;\n\nclass PrintAnnotationStorage extends AnnotationStorage {\n #serializable = null;\n\n constructor(parent) {\n super();\n this.#serializable = structuredClone(parent.serializable);\n }\n\n get print() {\n (0, _util.unreachable)(\"Should not call PrintAnnotationStorage.print\");\n }\n\n get serializable() {\n return this.#serializable;\n }\n\n}\n\nexports.PrintAnnotationStorage = PrintAnnotationStorage;\n\n/***/ }),\n/* 6 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.AnnotationEditor = void 0;\n\nvar _tools = __w_pdfjs_require__(7);\n\nvar _util = __w_pdfjs_require__(1);\n\nclass AnnotationEditor {\n #boundFocusin = this.focusin.bind(this);\n #boundFocusout = this.focusout.bind(this);\n #hasBeenSelected = false;\n #isEditing = false;\n #isInEditMode = false;\n #zIndex = AnnotationEditor._zIndex++;\n static _colorManager = new _tools.ColorManager();\n static _zIndex = 1;\n\n constructor(parameters) {\n if (this.constructor === AnnotationEditor) {\n (0, _util.unreachable)(\"Cannot initialize AnnotationEditor.\");\n }\n\n this.parent = parameters.parent;\n this.id = parameters.id;\n this.width = this.height = null;\n this.pageIndex = parameters.parent.pageIndex;\n this.name = parameters.name;\n this.div = null;\n const [width, height] = this.parent.viewportBaseDimensions;\n this.x = parameters.x / width;\n this.y = parameters.y / height;\n this.rotation = this.parent.viewport.rotation;\n this.isAttachedToDOM = false;\n }\n\n static get _defaultLineColor() {\n return (0, _util.shadow)(this, \"_defaultLineColor\", this._colorManager.getHexCode(\"CanvasText\"));\n }\n\n setInBackground() {\n this.div.style.zIndex = 0;\n }\n\n setInForeground() {\n this.div.style.zIndex = this.#zIndex;\n }\n\n focusin(event) {\n if (!this.#hasBeenSelected) {\n this.parent.setSelected(this);\n } else {\n this.#hasBeenSelected = false;\n }\n }\n\n focusout(event) {\n if (!this.isAttachedToDOM) {\n return;\n }\n\n const target = event.relatedTarget;\n\n if (target?.closest(`#${this.id}`)) {\n return;\n }\n\n event.preventDefault();\n\n if (!this.parent.isMultipleSelection) {\n this.commitOrRemove();\n }\n }\n\n commitOrRemove() {\n if (this.isEmpty()) {\n this.remove();\n } else {\n this.commit();\n }\n }\n\n commit() {\n this.parent.addToAnnotationStorage(this);\n }\n\n dragstart(event) {\n const rect = this.parent.div.getBoundingClientRect();\n this.startX = event.clientX - rect.x;\n this.startY = event.clientY - rect.y;\n event.dataTransfer.setData(\"text/plain\", this.id);\n event.dataTransfer.effectAllowed = \"move\";\n }\n\n setAt(x, y, tx, ty) {\n const [width, height] = this.parent.viewportBaseDimensions;\n [tx, ty] = this.screenToPageTranslation(tx, ty);\n this.x = (x + tx) / width;\n this.y = (y + ty) / height;\n this.div.style.left = `${100 * this.x}%`;\n this.div.style.top = `${100 * this.y}%`;\n }\n\n translate(x, y) {\n const [width, height] = this.parent.viewportBaseDimensions;\n [x, y] = this.screenToPageTranslation(x, y);\n this.x += x / width;\n this.y += y / height;\n this.div.style.left = `${100 * this.x}%`;\n this.div.style.top = `${100 * this.y}%`;\n }\n\n screenToPageTranslation(x, y) {\n const {\n rotation\n } = this.parent.viewport;\n\n switch (rotation) {\n case 90:\n return [y, -x];\n\n case 180:\n return [-x, -y];\n\n case 270:\n return [-y, x];\n\n default:\n return [x, y];\n }\n }\n\n setDims(width, height) {\n const [parentWidth, parentHeight] = this.parent.viewportBaseDimensions;\n this.div.style.width = `${100 * width / parentWidth}%`;\n this.div.style.height = `${100 * height / parentHeight}%`;\n }\n\n getInitialTranslation() {\n return [0, 0];\n }\n\n render() {\n this.div = document.createElement(\"div\");\n this.div.setAttribute(\"data-editor-rotation\", (360 - this.rotation) % 360);\n this.div.className = this.name;\n this.div.setAttribute(\"id\", this.id);\n this.div.setAttribute(\"tabIndex\", 0);\n this.setInForeground();\n this.div.addEventListener(\"focusin\", this.#boundFocusin);\n this.div.addEventListener(\"focusout\", this.#boundFocusout);\n const [tx, ty] = this.getInitialTranslation();\n this.translate(tx, ty);\n (0, _tools.bindEvents)(this, this.div, [\"dragstart\", \"pointerdown\"]);\n return this.div;\n }\n\n pointerdown(event) {\n const isMac = _tools.KeyboardManager.platform.isMac;\n\n if (event.button !== 0 || event.ctrlKey && isMac) {\n event.preventDefault();\n return;\n }\n\n if (event.ctrlKey && !isMac || event.shiftKey || event.metaKey && isMac) {\n this.parent.toggleSelected(this);\n } else {\n this.parent.setSelected(this);\n }\n\n this.#hasBeenSelected = true;\n }\n\n getRect(tx, ty) {\n const [parentWidth, parentHeight] = this.parent.viewportBaseDimensions;\n const [pageWidth, pageHeight] = this.parent.pageDimensions;\n const shiftX = pageWidth * tx / parentWidth;\n const shiftY = pageHeight * ty / parentHeight;\n const x = this.x * pageWidth;\n const y = this.y * pageHeight;\n const width = this.width * pageWidth;\n const height = this.height * pageHeight;\n\n switch (this.rotation) {\n case 0:\n return [x + shiftX, pageHeight - y - shiftY - height, x + shiftX + width, pageHeight - y - shiftY];\n\n case 90:\n return [x + shiftY, pageHeight - y + shiftX, x + shiftY + height, pageHeight - y + shiftX + width];\n\n case 180:\n return [x - shiftX - width, pageHeight - y + shiftY, x - shiftX, pageHeight - y + shiftY + height];\n\n case 270:\n return [x - shiftY - height, pageHeight - y - shiftX - width, x - shiftY, pageHeight - y - shiftX];\n\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n getRectInCurrentCoords(rect, pageHeight) {\n const [x1, y1, x2, y2] = rect;\n const width = x2 - x1;\n const height = y2 - y1;\n\n switch (this.rotation) {\n case 0:\n return [x1, pageHeight - y2, width, height];\n\n case 90:\n return [x1, pageHeight - y1, height, width];\n\n case 180:\n return [x2, pageHeight - y1, width, height];\n\n case 270:\n return [x2, pageHeight - y2, height, width];\n\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n onceAdded() {}\n\n isEmpty() {\n return false;\n }\n\n enableEditMode() {\n this.#isInEditMode = true;\n }\n\n disableEditMode() {\n this.#isInEditMode = false;\n }\n\n isInEditMode() {\n return this.#isInEditMode;\n }\n\n shouldGetKeyboardEvents() {\n return false;\n }\n\n needsToBeRebuilt() {\n return this.div && !this.isAttachedToDOM;\n }\n\n rebuild() {\n this.div?.addEventListener(\"focusin\", this.#boundFocusin);\n }\n\n serialize() {\n (0, _util.unreachable)(\"An editor must be serializable\");\n }\n\n static deserialize(data, parent) {\n const editor = new this.prototype.constructor({\n parent,\n id: parent.getNextId()\n });\n editor.rotation = data.rotation;\n const [pageWidth, pageHeight] = parent.pageDimensions;\n const [x, y, width, height] = editor.getRectInCurrentCoords(data.rect, pageHeight);\n editor.x = x / pageWidth;\n editor.y = y / pageHeight;\n editor.width = width / pageWidth;\n editor.height = height / pageHeight;\n return editor;\n }\n\n remove() {\n this.div.removeEventListener(\"focusin\", this.#boundFocusin);\n this.div.removeEventListener(\"focusout\", this.#boundFocusout);\n\n if (!this.isEmpty()) {\n this.commit();\n }\n\n this.parent.remove(this);\n }\n\n select() {\n this.div?.classList.add(\"selectedEditor\");\n }\n\n unselect() {\n this.div?.classList.remove(\"selectedEditor\");\n }\n\n updateParams(type, value) {}\n\n disableEditing() {}\n\n enableEditing() {}\n\n get propertiesToUpdate() {\n return {};\n }\n\n get contentDiv() {\n return this.div;\n }\n\n get isEditing() {\n return this.#isEditing;\n }\n\n set isEditing(value) {\n this.#isEditing = value;\n\n if (value) {\n this.parent.setSelected(this);\n this.parent.setActiveEditor(this);\n } else {\n this.parent.setActiveEditor(null);\n }\n }\n\n}\n\nexports.AnnotationEditor = AnnotationEditor;\n\n/***/ }),\n/* 7 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.KeyboardManager = exports.CommandManager = exports.ColorManager = exports.AnnotationEditorUIManager = void 0;\nexports.bindEvents = bindEvents;\nexports.opacityToHex = opacityToHex;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _display_utils = __w_pdfjs_require__(8);\n\nfunction bindEvents(obj, element, names) {\n for (const name of names) {\n element.addEventListener(name, obj[name].bind(obj));\n }\n}\n\nfunction opacityToHex(opacity) {\n return Math.round(Math.min(255, Math.max(1, 255 * opacity))).toString(16).padStart(2, \"0\");\n}\n\nclass IdManager {\n #id = 0;\n\n getId() {\n return `${_util.AnnotationEditorPrefix}${this.#id++}`;\n }\n\n}\n\nclass CommandManager {\n #commands = [];\n #locked = false;\n #maxSize;\n #position = -1;\n\n constructor(maxSize = 128) {\n this.#maxSize = maxSize;\n }\n\n add({\n cmd,\n undo,\n mustExec,\n type = NaN,\n overwriteIfSameType = false,\n keepUndo = false\n }) {\n if (mustExec) {\n cmd();\n }\n\n if (this.#locked) {\n return;\n }\n\n const save = {\n cmd,\n undo,\n type\n };\n\n if (this.#position === -1) {\n if (this.#commands.length > 0) {\n this.#commands.length = 0;\n }\n\n this.#position = 0;\n this.#commands.push(save);\n return;\n }\n\n if (overwriteIfSameType && this.#commands[this.#position].type === type) {\n if (keepUndo) {\n save.undo = this.#commands[this.#position].undo;\n }\n\n this.#commands[this.#position] = save;\n return;\n }\n\n const next = this.#position + 1;\n\n if (next === this.#maxSize) {\n this.#commands.splice(0, 1);\n } else {\n this.#position = next;\n\n if (next < this.#commands.length) {\n this.#commands.splice(next);\n }\n }\n\n this.#commands.push(save);\n }\n\n undo() {\n if (this.#position === -1) {\n return;\n }\n\n this.#locked = true;\n this.#commands[this.#position].undo();\n this.#locked = false;\n this.#position -= 1;\n }\n\n redo() {\n if (this.#position < this.#commands.length - 1) {\n this.#position += 1;\n this.#locked = true;\n this.#commands[this.#position].cmd();\n this.#locked = false;\n }\n }\n\n hasSomethingToUndo() {\n return this.#position !== -1;\n }\n\n hasSomethingToRedo() {\n return this.#position < this.#commands.length - 1;\n }\n\n destroy() {\n this.#commands = null;\n }\n\n}\n\nexports.CommandManager = CommandManager;\n\nclass KeyboardManager {\n constructor(callbacks) {\n this.buffer = [];\n this.callbacks = new Map();\n this.allKeys = new Set();\n const isMac = KeyboardManager.platform.isMac;\n\n for (const [keys, callback] of callbacks) {\n for (const key of keys) {\n const isMacKey = key.startsWith(\"mac+\");\n\n if (isMac && isMacKey) {\n this.callbacks.set(key.slice(4), callback);\n this.allKeys.add(key.split(\"+\").at(-1));\n } else if (!isMac && !isMacKey) {\n this.callbacks.set(key, callback);\n this.allKeys.add(key.split(\"+\").at(-1));\n }\n }\n }\n }\n\n static get platform() {\n const platform = typeof navigator !== \"undefined\" ? navigator.platform : \"\";\n return (0, _util.shadow)(this, \"platform\", {\n isWin: platform.includes(\"Win\"),\n isMac: platform.includes(\"Mac\")\n });\n }\n\n #serialize(event) {\n if (event.altKey) {\n this.buffer.push(\"alt\");\n }\n\n if (event.ctrlKey) {\n this.buffer.push(\"ctrl\");\n }\n\n if (event.metaKey) {\n this.buffer.push(\"meta\");\n }\n\n if (event.shiftKey) {\n this.buffer.push(\"shift\");\n }\n\n this.buffer.push(event.key);\n const str = this.buffer.join(\"+\");\n this.buffer.length = 0;\n return str;\n }\n\n exec(self, event) {\n if (!this.allKeys.has(event.key)) {\n return;\n }\n\n const callback = this.callbacks.get(this.#serialize(event));\n\n if (!callback) {\n return;\n }\n\n callback.bind(self)();\n event.stopPropagation();\n event.preventDefault();\n }\n\n}\n\nexports.KeyboardManager = KeyboardManager;\n\nclass ClipboardManager {\n #elements = null;\n\n copy(element) {\n if (!element) {\n return;\n }\n\n if (Array.isArray(element)) {\n this.#elements = element.map(el => el.serialize());\n } else {\n this.#elements = [element.serialize()];\n }\n\n this.#elements = this.#elements.filter(el => !!el);\n\n if (this.#elements.length === 0) {\n this.#elements = null;\n }\n }\n\n paste() {\n return this.#elements;\n }\n\n isEmpty() {\n return this.#elements === null;\n }\n\n destroy() {\n this.#elements = null;\n }\n\n}\n\nclass ColorManager {\n static _colorsMapping = new Map([[\"CanvasText\", [0, 0, 0]], [\"Canvas\", [255, 255, 255]]]);\n\n get _colors() {\n const colors = new Map([[\"CanvasText\", null], [\"Canvas\", null]]);\n (0, _display_utils.getColorValues)(colors);\n return (0, _util.shadow)(this, \"_colors\", colors);\n }\n\n convert(color) {\n const rgb = (0, _display_utils.getRGB)(color);\n\n if (!window.matchMedia(\"(forced-colors: active)\").matches) {\n return rgb;\n }\n\n for (const [name, RGB] of this._colors) {\n if (RGB.every((x, i) => x === rgb[i])) {\n return ColorManager._colorsMapping.get(name);\n }\n }\n\n return rgb;\n }\n\n getHexCode(name) {\n const rgb = this._colors.get(name);\n\n if (!rgb) {\n return name;\n }\n\n return _util.Util.makeHexColor(...rgb);\n }\n\n}\n\nexports.ColorManager = ColorManager;\n\nclass AnnotationEditorUIManager {\n #activeEditor = null;\n #allEditors = new Map();\n #allLayers = new Map();\n #clipboardManager = new ClipboardManager();\n #commandManager = new CommandManager();\n #currentPageIndex = 0;\n #editorTypes = null;\n #eventBus = null;\n #idManager = new IdManager();\n #isEnabled = false;\n #mode = _util.AnnotationEditorType.NONE;\n #selectedEditors = new Set();\n #boundKeydown = this.keydown.bind(this);\n #boundOnEditingAction = this.onEditingAction.bind(this);\n #boundOnPageChanging = this.onPageChanging.bind(this);\n #previousStates = {\n isEditing: false,\n isEmpty: true,\n hasEmptyClipboard: true,\n hasSomethingToUndo: false,\n hasSomethingToRedo: false,\n hasSelectedEditor: false\n };\n #container = null;\n static _keyboardManager = new KeyboardManager([[[\"ctrl+a\", \"mac+meta+a\"], AnnotationEditorUIManager.prototype.selectAll], [[\"ctrl+c\", \"mac+meta+c\"], AnnotationEditorUIManager.prototype.copy], [[\"ctrl+v\", \"mac+meta+v\"], AnnotationEditorUIManager.prototype.paste], [[\"ctrl+x\", \"mac+meta+x\"], AnnotationEditorUIManager.prototype.cut], [[\"ctrl+z\", \"mac+meta+z\"], AnnotationEditorUIManager.prototype.undo], [[\"ctrl+y\", \"ctrl+shift+Z\", \"mac+meta+shift+Z\"], AnnotationEditorUIManager.prototype.redo], [[\"Backspace\", \"alt+Backspace\", \"ctrl+Backspace\", \"shift+Backspace\", \"mac+Backspace\", \"mac+alt+Backspace\", \"mac+ctrl+Backspace\", \"Delete\", \"ctrl+Delete\", \"shift+Delete\"], AnnotationEditorUIManager.prototype.delete], [[\"Escape\", \"mac+Escape\"], AnnotationEditorUIManager.prototype.unselectAll]]);\n\n constructor(container, eventBus) {\n this.#container = container;\n this.#eventBus = eventBus;\n\n this.#eventBus._on(\"editingaction\", this.#boundOnEditingAction);\n\n this.#eventBus._on(\"pagechanging\", this.#boundOnPageChanging);\n }\n\n destroy() {\n this.#removeKeyboardManager();\n\n this.#eventBus._off(\"editingaction\", this.#boundOnEditingAction);\n\n this.#eventBus._off(\"pagechanging\", this.#boundOnPageChanging);\n\n for (const layer of this.#allLayers.values()) {\n layer.destroy();\n }\n\n this.#allLayers.clear();\n this.#allEditors.clear();\n this.#activeEditor = null;\n this.#selectedEditors.clear();\n this.#clipboardManager.destroy();\n this.#commandManager.destroy();\n }\n\n onPageChanging({\n pageNumber\n }) {\n this.#currentPageIndex = pageNumber - 1;\n }\n\n focusMainContainer() {\n this.#container.focus();\n }\n\n #addKeyboardManager() {\n this.#container.addEventListener(\"keydown\", this.#boundKeydown);\n }\n\n #removeKeyboardManager() {\n this.#container.removeEventListener(\"keydown\", this.#boundKeydown);\n }\n\n keydown(event) {\n if (!this.getActive()?.shouldGetKeyboardEvents()) {\n AnnotationEditorUIManager._keyboardManager.exec(this, event);\n }\n }\n\n onEditingAction(details) {\n if ([\"undo\", \"redo\", \"cut\", \"copy\", \"paste\", \"delete\", \"selectAll\"].includes(details.name)) {\n this[details.name]();\n }\n }\n\n #dispatchUpdateStates(details) {\n const hasChanged = Object.entries(details).some(([key, value]) => this.#previousStates[key] !== value);\n\n if (hasChanged) {\n this.#eventBus.dispatch(\"annotationeditorstateschanged\", {\n source: this,\n details: Object.assign(this.#previousStates, details)\n });\n }\n }\n\n #dispatchUpdateUI(details) {\n this.#eventBus.dispatch(\"annotationeditorparamschanged\", {\n source: this,\n details\n });\n }\n\n setEditingState(isEditing) {\n if (isEditing) {\n this.#addKeyboardManager();\n this.#dispatchUpdateStates({\n isEditing: this.#mode !== _util.AnnotationEditorType.NONE,\n isEmpty: this.#isEmpty(),\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n hasSelectedEditor: false,\n hasEmptyClipboard: this.#clipboardManager.isEmpty()\n });\n } else {\n this.#removeKeyboardManager();\n this.#dispatchUpdateStates({\n isEditing: false\n });\n }\n }\n\n registerEditorTypes(types) {\n this.#editorTypes = types;\n\n for (const editorType of this.#editorTypes) {\n this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);\n }\n }\n\n getId() {\n return this.#idManager.getId();\n }\n\n addLayer(layer) {\n this.#allLayers.set(layer.pageIndex, layer);\n\n if (this.#isEnabled) {\n layer.enable();\n } else {\n layer.disable();\n }\n }\n\n removeLayer(layer) {\n this.#allLayers.delete(layer.pageIndex);\n }\n\n updateMode(mode) {\n this.#mode = mode;\n\n if (mode === _util.AnnotationEditorType.NONE) {\n this.setEditingState(false);\n this.#disableAll();\n } else {\n this.setEditingState(true);\n this.#enableAll();\n\n for (const layer of this.#allLayers.values()) {\n layer.updateMode(mode);\n }\n }\n }\n\n updateToolbar(mode) {\n if (mode === this.#mode) {\n return;\n }\n\n this.#eventBus.dispatch(\"switchannotationeditormode\", {\n source: this,\n mode\n });\n }\n\n updateParams(type, value) {\n for (const editor of this.#selectedEditors) {\n editor.updateParams(type, value);\n }\n\n for (const editorType of this.#editorTypes) {\n editorType.updateDefaultParams(type, value);\n }\n }\n\n #enableAll() {\n if (!this.#isEnabled) {\n this.#isEnabled = true;\n\n for (const layer of this.#allLayers.values()) {\n layer.enable();\n }\n }\n }\n\n #disableAll() {\n this.unselectAll();\n\n if (this.#isEnabled) {\n this.#isEnabled = false;\n\n for (const layer of this.#allLayers.values()) {\n layer.disable();\n }\n }\n }\n\n getEditors(pageIndex) {\n const editors = [];\n\n for (const editor of this.#allEditors.values()) {\n if (editor.pageIndex === pageIndex) {\n editors.push(editor);\n }\n }\n\n return editors;\n }\n\n getEditor(id) {\n return this.#allEditors.get(id);\n }\n\n addEditor(editor) {\n this.#allEditors.set(editor.id, editor);\n }\n\n removeEditor(editor) {\n this.#allEditors.delete(editor.id);\n this.unselect(editor);\n }\n\n #addEditorToLayer(editor) {\n const layer = this.#allLayers.get(editor.pageIndex);\n\n if (layer) {\n layer.addOrRebuild(editor);\n } else {\n this.addEditor(editor);\n }\n }\n\n setActiveEditor(editor) {\n if (this.#activeEditor === editor) {\n return;\n }\n\n this.#activeEditor = editor;\n\n if (editor) {\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n }\n }\n\n toggleSelected(editor) {\n if (this.#selectedEditors.has(editor)) {\n this.#selectedEditors.delete(editor);\n editor.unselect();\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection\n });\n return;\n }\n\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true\n });\n }\n\n setSelected(editor) {\n for (const ed of this.#selectedEditors) {\n if (ed !== editor) {\n ed.unselect();\n }\n }\n\n this.#selectedEditors.clear();\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true\n });\n }\n\n isSelected(editor) {\n return this.#selectedEditors.has(editor);\n }\n\n unselect(editor) {\n editor.unselect();\n this.#selectedEditors.delete(editor);\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection\n });\n }\n\n get hasSelection() {\n return this.#selectedEditors.size !== 0;\n }\n\n undo() {\n this.#commandManager.undo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: true,\n isEmpty: this.#isEmpty()\n });\n }\n\n redo() {\n this.#commandManager.redo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n isEmpty: this.#isEmpty()\n });\n }\n\n addCommands(params) {\n this.#commandManager.add(params);\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: false,\n isEmpty: this.#isEmpty()\n });\n }\n\n #isEmpty() {\n if (this.#allEditors.size === 0) {\n return true;\n }\n\n if (this.#allEditors.size === 1) {\n for (const editor of this.#allEditors.values()) {\n return editor.isEmpty();\n }\n }\n\n return false;\n }\n\n delete() {\n if (this.#activeEditor) {\n this.#activeEditor.commitOrRemove();\n }\n\n if (!this.hasSelection) {\n return;\n }\n\n const editors = [...this.#selectedEditors];\n\n const cmd = () => {\n for (const editor of editors) {\n editor.remove();\n }\n };\n\n const undo = () => {\n for (const editor of editors) {\n this.#addEditorToLayer(editor);\n }\n };\n\n this.addCommands({\n cmd,\n undo,\n mustExec: true\n });\n }\n\n copy() {\n if (this.#activeEditor) {\n this.#activeEditor.commitOrRemove();\n }\n\n if (this.hasSelection) {\n const editors = [];\n\n for (const editor of this.#selectedEditors) {\n if (!editor.isEmpty()) {\n editors.push(editor);\n }\n }\n\n if (editors.length === 0) {\n return;\n }\n\n this.#clipboardManager.copy(editors);\n this.#dispatchUpdateStates({\n hasEmptyClipboard: false\n });\n }\n }\n\n cut() {\n this.copy();\n this.delete();\n }\n\n paste() {\n if (this.#clipboardManager.isEmpty()) {\n return;\n }\n\n this.unselectAll();\n const layer = this.#allLayers.get(this.#currentPageIndex);\n const newEditors = this.#clipboardManager.paste().map(data => layer.deserialize(data));\n\n const cmd = () => {\n for (const editor of newEditors) {\n this.#addEditorToLayer(editor);\n }\n\n this.#selectEditors(newEditors);\n };\n\n const undo = () => {\n for (const editor of newEditors) {\n editor.remove();\n }\n };\n\n this.addCommands({\n cmd,\n undo,\n mustExec: true\n });\n }\n\n #selectEditors(editors) {\n this.#selectedEditors.clear();\n\n for (const editor of editors) {\n if (editor.isEmpty()) {\n continue;\n }\n\n this.#selectedEditors.add(editor);\n editor.select();\n }\n\n this.#dispatchUpdateStates({\n hasSelectedEditor: true\n });\n }\n\n selectAll() {\n for (const editor of this.#selectedEditors) {\n editor.commit();\n }\n\n this.#selectEditors(this.#allEditors.values());\n }\n\n unselectAll() {\n if (this.#activeEditor) {\n this.#activeEditor.commitOrRemove();\n return;\n }\n\n if (this.#selectEditors.size === 0) {\n return;\n }\n\n for (const editor of this.#selectedEditors) {\n editor.unselect();\n }\n\n this.#selectedEditors.clear();\n this.#dispatchUpdateStates({\n hasSelectedEditor: false\n });\n }\n\n isActive(editor) {\n return this.#activeEditor === editor;\n }\n\n getActive() {\n return this.#activeEditor;\n }\n\n getMode() {\n return this.#mode;\n }\n\n}\n\nexports.AnnotationEditorUIManager = AnnotationEditorUIManager;\n\n/***/ }),\n/* 8 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.StatTimer = exports.RenderingCancelledException = exports.PixelsPerInch = exports.PageViewport = exports.PDFDateString = exports.DOMStandardFontDataFactory = exports.DOMSVGFactory = exports.DOMCanvasFactory = exports.DOMCMapReaderFactory = exports.AnnotationPrefix = void 0;\nexports.deprecated = deprecated;\nexports.getColorValues = getColorValues;\nexports.getCurrentTransform = getCurrentTransform;\nexports.getCurrentTransformInverse = getCurrentTransformInverse;\nexports.getFilenameFromUrl = getFilenameFromUrl;\nexports.getPdfFilenameFromUrl = getPdfFilenameFromUrl;\nexports.getRGB = getRGB;\nexports.getXfaPageViewport = getXfaPageViewport;\nexports.isDataScheme = isDataScheme;\nexports.isPdfFile = isPdfFile;\nexports.isValidFetchUrl = isValidFetchUrl;\nexports.loadScript = loadScript;\n\nvar _base_factory = __w_pdfjs_require__(9);\n\nvar _util = __w_pdfjs_require__(1);\n\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\nconst AnnotationPrefix = \"pdfjs_internal_id_\";\nexports.AnnotationPrefix = AnnotationPrefix;\n\nclass PixelsPerInch {\n static CSS = 96.0;\n static PDF = 72.0;\n static PDF_TO_CSS_UNITS = this.CSS / this.PDF;\n}\n\nexports.PixelsPerInch = PixelsPerInch;\n\nclass DOMCanvasFactory extends _base_factory.BaseCanvasFactory {\n constructor({\n ownerDocument = globalThis.document\n } = {}) {\n super();\n this._document = ownerDocument;\n }\n\n _createCanvas(width, height) {\n const canvas = this._document.createElement(\"canvas\");\n\n canvas.width = width;\n canvas.height = height;\n return canvas;\n }\n\n}\n\nexports.DOMCanvasFactory = DOMCanvasFactory;\n\nasync function fetchData(url, asTypedArray = false) {\n if (isValidFetchUrl(url, document.baseURI)) {\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n\n return asTypedArray ? new Uint8Array(await response.arrayBuffer()) : (0, _util.stringToBytes)(await response.text());\n }\n\n return new Promise((resolve, reject) => {\n const request = new XMLHttpRequest();\n request.open(\"GET\", url, true);\n\n if (asTypedArray) {\n request.responseType = \"arraybuffer\";\n }\n\n request.onreadystatechange = () => {\n if (request.readyState !== XMLHttpRequest.DONE) {\n return;\n }\n\n if (request.status === 200 || request.status === 0) {\n let data;\n\n if (asTypedArray && request.response) {\n data = new Uint8Array(request.response);\n } else if (!asTypedArray && request.responseText) {\n data = (0, _util.stringToBytes)(request.responseText);\n }\n\n if (data) {\n resolve(data);\n return;\n }\n }\n\n reject(new Error(request.statusText));\n };\n\n request.send(null);\n });\n}\n\nclass DOMCMapReaderFactory extends _base_factory.BaseCMapReaderFactory {\n _fetchData(url, compressionType) {\n return fetchData(url, this.isCompressed).then(data => {\n return {\n cMapData: data,\n compressionType\n };\n });\n }\n\n}\n\nexports.DOMCMapReaderFactory = DOMCMapReaderFactory;\n\nclass DOMStandardFontDataFactory extends _base_factory.BaseStandardFontDataFactory {\n _fetchData(url) {\n return fetchData(url, true);\n }\n\n}\n\nexports.DOMStandardFontDataFactory = DOMStandardFontDataFactory;\n\nclass DOMSVGFactory extends _base_factory.BaseSVGFactory {\n _createSVG(type) {\n return document.createElementNS(SVG_NS, type);\n }\n\n}\n\nexports.DOMSVGFactory = DOMSVGFactory;\n\nclass PageViewport {\n constructor({\n viewBox,\n scale,\n rotation,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false\n }) {\n this.viewBox = viewBox;\n this.scale = scale;\n this.rotation = rotation;\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n const centerX = (viewBox[2] + viewBox[0]) / 2;\n const centerY = (viewBox[3] + viewBox[1]) / 2;\n let rotateA, rotateB, rotateC, rotateD;\n rotation %= 360;\n\n if (rotation < 0) {\n rotation += 360;\n }\n\n switch (rotation) {\n case 180:\n rotateA = -1;\n rotateB = 0;\n rotateC = 0;\n rotateD = 1;\n break;\n\n case 90:\n rotateA = 0;\n rotateB = 1;\n rotateC = 1;\n rotateD = 0;\n break;\n\n case 270:\n rotateA = 0;\n rotateB = -1;\n rotateC = -1;\n rotateD = 0;\n break;\n\n case 0:\n rotateA = 1;\n rotateB = 0;\n rotateC = 0;\n rotateD = -1;\n break;\n\n default:\n throw new Error(\"PageViewport: Invalid rotation, must be a multiple of 90 degrees.\");\n }\n\n if (dontFlip) {\n rotateC = -rotateC;\n rotateD = -rotateD;\n }\n\n let offsetCanvasX, offsetCanvasY;\n let width, height;\n\n if (rotateA === 0) {\n offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY;\n width = Math.abs(viewBox[3] - viewBox[1]) * scale;\n height = Math.abs(viewBox[2] - viewBox[0]) * scale;\n } else {\n offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY;\n width = Math.abs(viewBox[2] - viewBox[0]) * scale;\n height = Math.abs(viewBox[3] - viewBox[1]) * scale;\n }\n\n this.transform = [rotateA * scale, rotateB * scale, rotateC * scale, rotateD * scale, offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY];\n this.width = width;\n this.height = height;\n }\n\n clone({\n scale = this.scale,\n rotation = this.rotation,\n offsetX = this.offsetX,\n offsetY = this.offsetY,\n dontFlip = false\n } = {}) {\n return new PageViewport({\n viewBox: this.viewBox.slice(),\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip\n });\n }\n\n convertToViewportPoint(x, y) {\n return _util.Util.applyTransform([x, y], this.transform);\n }\n\n convertToViewportRectangle(rect) {\n const topLeft = _util.Util.applyTransform([rect[0], rect[1]], this.transform);\n\n const bottomRight = _util.Util.applyTransform([rect[2], rect[3]], this.transform);\n\n return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]];\n }\n\n convertToPdfPoint(x, y) {\n return _util.Util.applyInverseTransform([x, y], this.transform);\n }\n\n}\n\nexports.PageViewport = PageViewport;\n\nclass RenderingCancelledException extends _util.BaseException {\n constructor(msg, type) {\n super(msg, \"RenderingCancelledException\");\n this.type = type;\n }\n\n}\n\nexports.RenderingCancelledException = RenderingCancelledException;\n\nfunction isDataScheme(url) {\n const ii = url.length;\n let i = 0;\n\n while (i < ii && url[i].trim() === \"\") {\n i++;\n }\n\n return url.substring(i, i + 5).toLowerCase() === \"data:\";\n}\n\nfunction isPdfFile(filename) {\n return typeof filename === \"string\" && /\\.pdf$/i.test(filename);\n}\n\nfunction getFilenameFromUrl(url) {\n const anchor = url.indexOf(\"#\");\n const query = url.indexOf(\"?\");\n const end = Math.min(anchor > 0 ? anchor : url.length, query > 0 ? query : url.length);\n return url.substring(url.lastIndexOf(\"/\", end) + 1, end);\n}\n\nfunction getPdfFilenameFromUrl(url, defaultFilename = \"document.pdf\") {\n if (typeof url !== \"string\") {\n return defaultFilename;\n }\n\n if (isDataScheme(url)) {\n (0, _util.warn)('getPdfFilenameFromUrl: ignore \"data:\"-URL for performance reasons.');\n return defaultFilename;\n }\n\n const reURI = /^(?:(?:[^:]+:)?\\/\\/[^/]+)?([^?#]*)(\\?[^#]*)?(#.*)?$/;\n const reFilename = /[^/?#=]+\\.pdf\\b(?!.*\\.pdf\\b)/i;\n const splitURI = reURI.exec(url);\n let suggestedFilename = reFilename.exec(splitURI[1]) || reFilename.exec(splitURI[2]) || reFilename.exec(splitURI[3]);\n\n if (suggestedFilename) {\n suggestedFilename = suggestedFilename[0];\n\n if (suggestedFilename.includes(\"%\")) {\n try {\n suggestedFilename = reFilename.exec(decodeURIComponent(suggestedFilename))[0];\n } catch (ex) {}\n }\n }\n\n return suggestedFilename || defaultFilename;\n}\n\nclass StatTimer {\n constructor() {\n this.started = Object.create(null);\n this.times = [];\n }\n\n time(name) {\n if (name in this.started) {\n (0, _util.warn)(`Timer is already running for ${name}`);\n }\n\n this.started[name] = Date.now();\n }\n\n timeEnd(name) {\n if (!(name in this.started)) {\n (0, _util.warn)(`Timer has not been started for ${name}`);\n }\n\n this.times.push({\n name,\n start: this.started[name],\n end: Date.now()\n });\n delete this.started[name];\n }\n\n toString() {\n const outBuf = [];\n let longest = 0;\n\n for (const time of this.times) {\n const name = time.name;\n\n if (name.length > longest) {\n longest = name.length;\n }\n }\n\n for (const time of this.times) {\n const duration = time.end - time.start;\n outBuf.push(`${time.name.padEnd(longest)} ${duration}ms\\n`);\n }\n\n return outBuf.join(\"\");\n }\n\n}\n\nexports.StatTimer = StatTimer;\n\nfunction isValidFetchUrl(url, baseUrl) {\n try {\n const {\n protocol\n } = baseUrl ? new URL(url, baseUrl) : new URL(url);\n return protocol === \"http:\" || protocol === \"https:\";\n } catch (ex) {\n return false;\n }\n}\n\nfunction loadScript(src, removeScriptElement = false) {\n return new Promise((resolve, reject) => {\n const script = document.createElement(\"script\");\n script.src = src;\n\n script.onload = function (evt) {\n if (removeScriptElement) {\n script.remove();\n }\n\n resolve(evt);\n };\n\n script.onerror = function () {\n reject(new Error(`Cannot load script at: ${script.src}`));\n };\n\n (document.head || document.documentElement).append(script);\n });\n}\n\nfunction deprecated(details) {\n console.log(\"Deprecated API usage: \" + details);\n}\n\nlet pdfDateStringRegex;\n\nclass PDFDateString {\n static toDateObject(input) {\n if (!input || typeof input !== \"string\") {\n return null;\n }\n\n if (!pdfDateStringRegex) {\n pdfDateStringRegex = new RegExp(\"^D:\" + \"(\\\\d{4})\" + \"(\\\\d{2})?\" + \"(\\\\d{2})?\" + \"(\\\\d{2})?\" + \"(\\\\d{2})?\" + \"(\\\\d{2})?\" + \"([Z|+|-])?\" + \"(\\\\d{2})?\" + \"'?\" + \"(\\\\d{2})?\" + \"'?\");\n }\n\n const matches = pdfDateStringRegex.exec(input);\n\n if (!matches) {\n return null;\n }\n\n const year = parseInt(matches[1], 10);\n let month = parseInt(matches[2], 10);\n month = month >= 1 && month <= 12 ? month - 1 : 0;\n let day = parseInt(matches[3], 10);\n day = day >= 1 && day <= 31 ? day : 1;\n let hour = parseInt(matches[4], 10);\n hour = hour >= 0 && hour <= 23 ? hour : 0;\n let minute = parseInt(matches[5], 10);\n minute = minute >= 0 && minute <= 59 ? minute : 0;\n let second = parseInt(matches[6], 10);\n second = second >= 0 && second <= 59 ? second : 0;\n const universalTimeRelation = matches[7] || \"Z\";\n let offsetHour = parseInt(matches[8], 10);\n offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0;\n let offsetMinute = parseInt(matches[9], 10) || 0;\n offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0;\n\n if (universalTimeRelation === \"-\") {\n hour += offsetHour;\n minute += offsetMinute;\n } else if (universalTimeRelation === \"+\") {\n hour -= offsetHour;\n minute -= offsetMinute;\n }\n\n return new Date(Date.UTC(year, month, day, hour, minute, second));\n }\n\n}\n\nexports.PDFDateString = PDFDateString;\n\nfunction getXfaPageViewport(xfaPage, {\n scale = 1,\n rotation = 0\n}) {\n const {\n width,\n height\n } = xfaPage.attributes.style;\n const viewBox = [0, 0, parseInt(width), parseInt(height)];\n return new PageViewport({\n viewBox,\n scale,\n rotation\n });\n}\n\nfunction getRGB(color) {\n if (color.startsWith(\"#\")) {\n const colorRGB = parseInt(color.slice(1), 16);\n return [(colorRGB & 0xff0000) >> 16, (colorRGB & 0x00ff00) >> 8, colorRGB & 0x0000ff];\n }\n\n if (color.startsWith(\"rgb(\")) {\n return color.slice(4, -1).split(\",\").map(x => parseInt(x));\n }\n\n if (color.startsWith(\"rgba(\")) {\n return color.slice(5, -1).split(\",\").map(x => parseInt(x)).slice(0, 3);\n }\n\n (0, _util.warn)(`Not a valid color format: \"${color}\"`);\n return [0, 0, 0];\n}\n\nfunction getColorValues(colors) {\n const span = document.createElement(\"span\");\n span.style.visibility = \"hidden\";\n document.body.append(span);\n\n for (const name of colors.keys()) {\n span.style.color = name;\n const computedColor = window.getComputedStyle(span).color;\n colors.set(name, getRGB(computedColor));\n }\n\n span.remove();\n}\n\nfunction getCurrentTransform(ctx) {\n const {\n a,\n b,\n c,\n d,\n e,\n f\n } = ctx.getTransform();\n return [a, b, c, d, e, f];\n}\n\nfunction getCurrentTransformInverse(ctx) {\n const {\n a,\n b,\n c,\n d,\n e,\n f\n } = ctx.getTransform().invertSelf();\n return [a, b, c, d, e, f];\n}\n\n/***/ }),\n/* 9 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.BaseStandardFontDataFactory = exports.BaseSVGFactory = exports.BaseCanvasFactory = exports.BaseCMapReaderFactory = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nclass BaseCanvasFactory {\n constructor() {\n if (this.constructor === BaseCanvasFactory) {\n (0, _util.unreachable)(\"Cannot initialize BaseCanvasFactory.\");\n }\n }\n\n create(width, height) {\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n\n const canvas = this._createCanvas(width, height);\n\n return {\n canvas,\n context: canvas.getContext(\"2d\")\n };\n }\n\n reset(canvasAndContext, width, height) {\n if (!canvasAndContext.canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n\n canvasAndContext.canvas.width = width;\n canvasAndContext.canvas.height = height;\n }\n\n destroy(canvasAndContext) {\n if (!canvasAndContext.canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n\n canvasAndContext.canvas.width = 0;\n canvasAndContext.canvas.height = 0;\n canvasAndContext.canvas = null;\n canvasAndContext.context = null;\n }\n\n _createCanvas(width, height) {\n (0, _util.unreachable)(\"Abstract method `_createCanvas` called.\");\n }\n\n}\n\nexports.BaseCanvasFactory = BaseCanvasFactory;\n\nclass BaseCMapReaderFactory {\n constructor({\n baseUrl = null,\n isCompressed = false\n }) {\n if (this.constructor === BaseCMapReaderFactory) {\n (0, _util.unreachable)(\"Cannot initialize BaseCMapReaderFactory.\");\n }\n\n this.baseUrl = baseUrl;\n this.isCompressed = isCompressed;\n }\n\n async fetch({\n name\n }) {\n if (!this.baseUrl) {\n throw new Error('The CMap \"baseUrl\" parameter must be specified, ensure that ' + 'the \"cMapUrl\" and \"cMapPacked\" API parameters are provided.');\n }\n\n if (!name) {\n throw new Error(\"CMap name must be specified.\");\n }\n\n const url = this.baseUrl + name + (this.isCompressed ? \".bcmap\" : \"\");\n const compressionType = this.isCompressed ? _util.CMapCompressionType.BINARY : _util.CMapCompressionType.NONE;\n return this._fetchData(url, compressionType).catch(reason => {\n throw new Error(`Unable to load ${this.isCompressed ? \"binary \" : \"\"}CMap at: ${url}`);\n });\n }\n\n _fetchData(url, compressionType) {\n (0, _util.unreachable)(\"Abstract method `_fetchData` called.\");\n }\n\n}\n\nexports.BaseCMapReaderFactory = BaseCMapReaderFactory;\n\nclass BaseStandardFontDataFactory {\n constructor({\n baseUrl = null\n }) {\n if (this.constructor === BaseStandardFontDataFactory) {\n (0, _util.unreachable)(\"Cannot initialize BaseStandardFontDataFactory.\");\n }\n\n this.baseUrl = baseUrl;\n }\n\n async fetch({\n filename\n }) {\n if (!this.baseUrl) {\n throw new Error('The standard font \"baseUrl\" parameter must be specified, ensure that ' + 'the \"standardFontDataUrl\" API parameter is provided.');\n }\n\n if (!filename) {\n throw new Error(\"Font filename must be specified.\");\n }\n\n const url = `${this.baseUrl}${filename}`;\n return this._fetchData(url).catch(reason => {\n throw new Error(`Unable to load font data at: ${url}`);\n });\n }\n\n _fetchData(url) {\n (0, _util.unreachable)(\"Abstract method `_fetchData` called.\");\n }\n\n}\n\nexports.BaseStandardFontDataFactory = BaseStandardFontDataFactory;\n\nclass BaseSVGFactory {\n constructor() {\n if (this.constructor === BaseSVGFactory) {\n (0, _util.unreachable)(\"Cannot initialize BaseSVGFactory.\");\n }\n }\n\n create(width, height, skipDimensions = false) {\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid SVG dimensions\");\n }\n\n const svg = this._createSVG(\"svg:svg\");\n\n svg.setAttribute(\"version\", \"1.1\");\n\n if (!skipDimensions) {\n svg.setAttribute(\"width\", `${width}px`);\n svg.setAttribute(\"height\", `${height}px`);\n }\n\n svg.setAttribute(\"preserveAspectRatio\", \"none\");\n svg.setAttribute(\"viewBox\", `0 0 ${width} ${height}`);\n return svg;\n }\n\n createElement(type) {\n if (typeof type !== \"string\") {\n throw new Error(\"Invalid SVG element type\");\n }\n\n return this._createSVG(type);\n }\n\n _createSVG(type) {\n (0, _util.unreachable)(\"Abstract method `_createSVG` called.\");\n }\n\n}\n\nexports.BaseSVGFactory = BaseSVGFactory;\n\n/***/ }),\n/* 10 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.MurmurHash3_64 = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nconst SEED = 0xc3d2e1f0;\nconst MASK_HIGH = 0xffff0000;\nconst MASK_LOW = 0xffff;\n\nclass MurmurHash3_64 {\n constructor(seed) {\n this.h1 = seed ? seed & 0xffffffff : SEED;\n this.h2 = seed ? seed & 0xffffffff : SEED;\n }\n\n update(input) {\n let data, length;\n\n if (typeof input === \"string\") {\n data = new Uint8Array(input.length * 2);\n length = 0;\n\n for (let i = 0, ii = input.length; i < ii; i++) {\n const code = input.charCodeAt(i);\n\n if (code <= 0xff) {\n data[length++] = code;\n } else {\n data[length++] = code >>> 8;\n data[length++] = code & 0xff;\n }\n }\n } else if ((0, _util.isArrayBuffer)(input)) {\n data = input.slice();\n length = data.byteLength;\n } else {\n throw new Error(\"Wrong data format in MurmurHash3_64_update. \" + \"Input must be a string or array.\");\n }\n\n const blockCounts = length >> 2;\n const tailLength = length - blockCounts * 4;\n const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts);\n let k1 = 0,\n k2 = 0;\n let h1 = this.h1,\n h2 = this.h2;\n const C1 = 0xcc9e2d51,\n C2 = 0x1b873593;\n const C1_LOW = C1 & MASK_LOW,\n C2_LOW = C2 & MASK_LOW;\n\n for (let i = 0; i < blockCounts; i++) {\n if (i & 1) {\n k1 = dataUint32[i];\n k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW;\n k1 = k1 << 15 | k1 >>> 17;\n k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW;\n h1 ^= k1;\n h1 = h1 << 13 | h1 >>> 19;\n h1 = h1 * 5 + 0xe6546b64;\n } else {\n k2 = dataUint32[i];\n k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW;\n k2 = k2 << 15 | k2 >>> 17;\n k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW;\n h2 ^= k2;\n h2 = h2 << 13 | h2 >>> 19;\n h2 = h2 * 5 + 0xe6546b64;\n }\n }\n\n k1 = 0;\n\n switch (tailLength) {\n case 3:\n k1 ^= data[blockCounts * 4 + 2] << 16;\n\n case 2:\n k1 ^= data[blockCounts * 4 + 1] << 8;\n\n case 1:\n k1 ^= data[blockCounts * 4];\n k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW;\n k1 = k1 << 15 | k1 >>> 17;\n k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW;\n\n if (blockCounts & 1) {\n h1 ^= k1;\n } else {\n h2 ^= k1;\n }\n\n }\n\n this.h1 = h1;\n this.h2 = h2;\n }\n\n hexdigest() {\n let h1 = this.h1,\n h2 = this.h2;\n h1 ^= h2 >>> 1;\n h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW;\n h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16;\n h1 ^= h2 >>> 1;\n h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW;\n h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16;\n h1 ^= h2 >>> 1;\n const hex1 = (h1 >>> 0).toString(16),\n hex2 = (h2 >>> 0).toString(16);\n return hex1.padStart(8, \"0\") + hex2.padStart(8, \"0\");\n }\n\n}\n\nexports.MurmurHash3_64 = MurmurHash3_64;\n\n/***/ }),\n/* 11 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.FontLoader = exports.FontFaceObject = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nclass BaseFontLoader {\n constructor({\n docId,\n onUnsupportedFeature,\n ownerDocument = globalThis.document,\n styleElement = null\n }) {\n if (this.constructor === BaseFontLoader) {\n (0, _util.unreachable)(\"Cannot initialize BaseFontLoader.\");\n }\n\n this.docId = docId;\n this._onUnsupportedFeature = onUnsupportedFeature;\n this._document = ownerDocument;\n this.nativeFontFaces = [];\n this.styleElement = null;\n }\n\n addNativeFontFace(nativeFontFace) {\n this.nativeFontFaces.push(nativeFontFace);\n\n this._document.fonts.add(nativeFontFace);\n }\n\n insertRule(rule) {\n let styleElement = this.styleElement;\n\n if (!styleElement) {\n styleElement = this.styleElement = this._document.createElement(\"style\");\n styleElement.id = `PDFJS_FONT_STYLE_TAG_${this.docId}`;\n\n this._document.documentElement.getElementsByTagName(\"head\")[0].append(styleElement);\n }\n\n const styleSheet = styleElement.sheet;\n styleSheet.insertRule(rule, styleSheet.cssRules.length);\n }\n\n clear() {\n for (const nativeFontFace of this.nativeFontFaces) {\n this._document.fonts.delete(nativeFontFace);\n }\n\n this.nativeFontFaces.length = 0;\n\n if (this.styleElement) {\n this.styleElement.remove();\n this.styleElement = null;\n }\n }\n\n async bind(font) {\n if (font.attached || font.missingFile) {\n return;\n }\n\n font.attached = true;\n\n if (this.isFontLoadingAPISupported) {\n const nativeFontFace = font.createNativeFontFace();\n\n if (nativeFontFace) {\n this.addNativeFontFace(nativeFontFace);\n\n try {\n await nativeFontFace.loaded;\n } catch (ex) {\n this._onUnsupportedFeature({\n featureId: _util.UNSUPPORTED_FEATURES.errorFontLoadNative\n });\n\n (0, _util.warn)(`Failed to load font '${nativeFontFace.family}': '${ex}'.`);\n font.disableFontFace = true;\n throw ex;\n }\n }\n\n return;\n }\n\n const rule = font.createFontFaceRule();\n\n if (rule) {\n this.insertRule(rule);\n\n if (this.isSyncFontLoadingSupported) {\n return;\n }\n\n await new Promise(resolve => {\n const request = this._queueLoadingCallback(resolve);\n\n this._prepareFontLoadEvent([rule], [font], request);\n });\n }\n }\n\n _queueLoadingCallback(callback) {\n (0, _util.unreachable)(\"Abstract method `_queueLoadingCallback`.\");\n }\n\n get isFontLoadingAPISupported() {\n const hasFonts = !!this._document?.fonts;\n return (0, _util.shadow)(this, \"isFontLoadingAPISupported\", hasFonts);\n }\n\n get isSyncFontLoadingSupported() {\n (0, _util.unreachable)(\"Abstract method `isSyncFontLoadingSupported`.\");\n }\n\n get _loadTestFont() {\n (0, _util.unreachable)(\"Abstract method `_loadTestFont`.\");\n }\n\n _prepareFontLoadEvent(rules, fontsToLoad, request) {\n (0, _util.unreachable)(\"Abstract method `_prepareFontLoadEvent`.\");\n }\n\n}\n\nlet FontLoader;\nexports.FontLoader = FontLoader;\n{\n exports.FontLoader = FontLoader = class GenericFontLoader extends BaseFontLoader {\n constructor(params) {\n super(params);\n this.loadingContext = {\n requests: [],\n nextRequestId: 0\n };\n this.loadTestFontId = 0;\n }\n\n get isSyncFontLoadingSupported() {\n let supported = false;\n\n if (typeof navigator === \"undefined\") {\n supported = true;\n } else {\n const m = /Mozilla\\/5.0.*?rv:(\\d+).*? Gecko/.exec(navigator.userAgent);\n\n if (m?.[1] >= 14) {\n supported = true;\n }\n }\n\n return (0, _util.shadow)(this, \"isSyncFontLoadingSupported\", supported);\n }\n\n _queueLoadingCallback(callback) {\n function completeRequest() {\n (0, _util.assert)(!request.done, \"completeRequest() cannot be called twice.\");\n request.done = true;\n\n while (context.requests.length > 0 && context.requests[0].done) {\n const otherRequest = context.requests.shift();\n setTimeout(otherRequest.callback, 0);\n }\n }\n\n const context = this.loadingContext;\n const request = {\n id: `pdfjs-font-loading-${context.nextRequestId++}`,\n done: false,\n complete: completeRequest,\n callback\n };\n context.requests.push(request);\n return request;\n }\n\n get _loadTestFont() {\n const getLoadTestFont = function () {\n return atob(\"T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA\" + \"FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA\" + \"ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA\" + \"AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1\" + \"AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD\" + \"6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACM\" + \"AooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4D\" + \"IP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAA\" + \"AAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUA\" + \"AQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgAB\" + \"AAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABY\" + \"AAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAA\" + \"AC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" + \"AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" + \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" + \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" + \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" + \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAA\" + \"AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC\" + \"AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3\" + \"Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj\" + \"FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==\");\n };\n\n return (0, _util.shadow)(this, \"_loadTestFont\", getLoadTestFont());\n }\n\n _prepareFontLoadEvent(rules, fonts, request) {\n function int32(data, offset) {\n return data.charCodeAt(offset) << 24 | data.charCodeAt(offset + 1) << 16 | data.charCodeAt(offset + 2) << 8 | data.charCodeAt(offset + 3) & 0xff;\n }\n\n function spliceString(s, offset, remove, insert) {\n const chunk1 = s.substring(0, offset);\n const chunk2 = s.substring(offset + remove);\n return chunk1 + insert + chunk2;\n }\n\n let i, ii;\n\n const canvas = this._document.createElement(\"canvas\");\n\n canvas.width = 1;\n canvas.height = 1;\n const ctx = canvas.getContext(\"2d\");\n let called = 0;\n\n function isFontReady(name, callback) {\n called++;\n\n if (called > 30) {\n (0, _util.warn)(\"Load test font never loaded.\");\n callback();\n return;\n }\n\n ctx.font = \"30px \" + name;\n ctx.fillText(\".\", 0, 20);\n const imageData = ctx.getImageData(0, 0, 1, 1);\n\n if (imageData.data[3] > 0) {\n callback();\n return;\n }\n\n setTimeout(isFontReady.bind(null, name, callback));\n }\n\n const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`;\n let data = this._loadTestFont;\n const COMMENT_OFFSET = 976;\n data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, loadTestFontId);\n const CFF_CHECKSUM_OFFSET = 16;\n const XXXX_VALUE = 0x58585858;\n let checksum = int32(data, CFF_CHECKSUM_OFFSET);\n\n for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) {\n checksum = checksum - XXXX_VALUE + int32(loadTestFontId, i) | 0;\n }\n\n if (i < loadTestFontId.length) {\n checksum = checksum - XXXX_VALUE + int32(loadTestFontId + \"XXX\", i) | 0;\n }\n\n data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, (0, _util.string32)(checksum));\n const url = `url(data:font/opentype;base64,${btoa(data)});`;\n const rule = `@font-face {font-family:\"${loadTestFontId}\";src:${url}}`;\n this.insertRule(rule);\n const names = [];\n\n for (const font of fonts) {\n names.push(font.loadedName);\n }\n\n names.push(loadTestFontId);\n\n const div = this._document.createElement(\"div\");\n\n div.style.visibility = \"hidden\";\n div.style.width = div.style.height = \"10px\";\n div.style.position = \"absolute\";\n div.style.top = div.style.left = \"0px\";\n\n for (const name of names) {\n const span = this._document.createElement(\"span\");\n\n span.textContent = \"Hi\";\n span.style.fontFamily = name;\n div.append(span);\n }\n\n this._document.body.append(div);\n\n isFontReady(loadTestFontId, () => {\n div.remove();\n request.complete();\n });\n }\n\n };\n}\n\nclass FontFaceObject {\n constructor(translatedData, {\n isEvalSupported = true,\n disableFontFace = false,\n ignoreErrors = false,\n onUnsupportedFeature,\n fontRegistry = null\n }) {\n this.compiledGlyphs = Object.create(null);\n\n for (const i in translatedData) {\n this[i] = translatedData[i];\n }\n\n this.isEvalSupported = isEvalSupported !== false;\n this.disableFontFace = disableFontFace === true;\n this.ignoreErrors = ignoreErrors === true;\n this._onUnsupportedFeature = onUnsupportedFeature;\n this.fontRegistry = fontRegistry;\n }\n\n createNativeFontFace() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n\n let nativeFontFace;\n\n if (!this.cssFontInfo) {\n nativeFontFace = new FontFace(this.loadedName, this.data, {});\n } else {\n const css = {\n weight: this.cssFontInfo.fontWeight\n };\n\n if (this.cssFontInfo.italicAngle) {\n css.style = `oblique ${this.cssFontInfo.italicAngle}deg`;\n }\n\n nativeFontFace = new FontFace(this.cssFontInfo.fontFamily, this.data, css);\n }\n\n if (this.fontRegistry) {\n this.fontRegistry.registerFont(this);\n }\n\n return nativeFontFace;\n }\n\n createFontFaceRule() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n\n const data = (0, _util.bytesToString)(this.data);\n const url = `url(data:${this.mimetype};base64,${btoa(data)});`;\n let rule;\n\n if (!this.cssFontInfo) {\n rule = `@font-face {font-family:\"${this.loadedName}\";src:${url}}`;\n } else {\n let css = `font-weight: ${this.cssFontInfo.fontWeight};`;\n\n if (this.cssFontInfo.italicAngle) {\n css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`;\n }\n\n rule = `@font-face {font-family:\"${this.cssFontInfo.fontFamily}\";${css}src:${url}}`;\n }\n\n if (this.fontRegistry) {\n this.fontRegistry.registerFont(this, url);\n }\n\n return rule;\n }\n\n getPathGenerator(objs, character) {\n if (this.compiledGlyphs[character] !== undefined) {\n return this.compiledGlyphs[character];\n }\n\n let cmds;\n\n try {\n cmds = objs.get(this.loadedName + \"_path_\" + character);\n } catch (ex) {\n if (!this.ignoreErrors) {\n throw ex;\n }\n\n this._onUnsupportedFeature({\n featureId: _util.UNSUPPORTED_FEATURES.errorFontGetPath\n });\n\n (0, _util.warn)(`getPathGenerator - ignoring character: \"${ex}\".`);\n return this.compiledGlyphs[character] = function (c, size) {};\n }\n\n if (this.isEvalSupported && _util.FeatureTest.isEvalSupported) {\n const jsBuf = [];\n\n for (const current of cmds) {\n const args = current.args !== undefined ? current.args.join(\",\") : \"\";\n jsBuf.push(\"c.\", current.cmd, \"(\", args, \");\\n\");\n }\n\n return this.compiledGlyphs[character] = new Function(\"c\", \"size\", jsBuf.join(\"\"));\n }\n\n return this.compiledGlyphs[character] = function (c, size) {\n for (const current of cmds) {\n if (current.cmd === \"scale\") {\n current.args = [size, -size];\n }\n\n c[current.cmd].apply(c, current.args);\n }\n };\n }\n\n}\n\nexports.FontFaceObject = FontFaceObject;\n\n/***/ }),\n/* 12 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.CanvasGraphics = void 0;\n\nvar _display_utils = __w_pdfjs_require__(8);\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _pattern_helper = __w_pdfjs_require__(13);\n\nvar _image_utils = __w_pdfjs_require__(14);\n\nvar _is_node = __w_pdfjs_require__(3);\n\nconst MIN_FONT_SIZE = 16;\nconst MAX_FONT_SIZE = 100;\nconst MAX_GROUP_SIZE = 4096;\nconst EXECUTION_TIME = 15;\nconst EXECUTION_STEPS = 10;\nconst MAX_SIZE_TO_COMPILE = _is_node.isNodeJS && typeof Path2D === \"undefined\" ? -1 : 1000;\nconst FULL_CHUNK_HEIGHT = 16;\n\nfunction mirrorContextOperations(ctx, destCtx) {\n if (ctx._removeMirroring) {\n throw new Error(\"Context is already forwarding operations.\");\n }\n\n ctx.__originalSave = ctx.save;\n ctx.__originalRestore = ctx.restore;\n ctx.__originalRotate = ctx.rotate;\n ctx.__originalScale = ctx.scale;\n ctx.__originalTranslate = ctx.translate;\n ctx.__originalTransform = ctx.transform;\n ctx.__originalSetTransform = ctx.setTransform;\n ctx.__originalResetTransform = ctx.resetTransform;\n ctx.__originalClip = ctx.clip;\n ctx.__originalMoveTo = ctx.moveTo;\n ctx.__originalLineTo = ctx.lineTo;\n ctx.__originalBezierCurveTo = ctx.bezierCurveTo;\n ctx.__originalRect = ctx.rect;\n ctx.__originalClosePath = ctx.closePath;\n ctx.__originalBeginPath = ctx.beginPath;\n\n ctx._removeMirroring = () => {\n ctx.save = ctx.__originalSave;\n ctx.restore = ctx.__originalRestore;\n ctx.rotate = ctx.__originalRotate;\n ctx.scale = ctx.__originalScale;\n ctx.translate = ctx.__originalTranslate;\n ctx.transform = ctx.__originalTransform;\n ctx.setTransform = ctx.__originalSetTransform;\n ctx.resetTransform = ctx.__originalResetTransform;\n ctx.clip = ctx.__originalClip;\n ctx.moveTo = ctx.__originalMoveTo;\n ctx.lineTo = ctx.__originalLineTo;\n ctx.bezierCurveTo = ctx.__originalBezierCurveTo;\n ctx.rect = ctx.__originalRect;\n ctx.closePath = ctx.__originalClosePath;\n ctx.beginPath = ctx.__originalBeginPath;\n delete ctx._removeMirroring;\n };\n\n ctx.save = function ctxSave() {\n destCtx.save();\n\n this.__originalSave();\n };\n\n ctx.restore = function ctxRestore() {\n destCtx.restore();\n\n this.__originalRestore();\n };\n\n ctx.translate = function ctxTranslate(x, y) {\n destCtx.translate(x, y);\n\n this.__originalTranslate(x, y);\n };\n\n ctx.scale = function ctxScale(x, y) {\n destCtx.scale(x, y);\n\n this.__originalScale(x, y);\n };\n\n ctx.transform = function ctxTransform(a, b, c, d, e, f) {\n destCtx.transform(a, b, c, d, e, f);\n\n this.__originalTransform(a, b, c, d, e, f);\n };\n\n ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) {\n destCtx.setTransform(a, b, c, d, e, f);\n\n this.__originalSetTransform(a, b, c, d, e, f);\n };\n\n ctx.resetTransform = function ctxResetTransform() {\n destCtx.resetTransform();\n\n this.__originalResetTransform();\n };\n\n ctx.rotate = function ctxRotate(angle) {\n destCtx.rotate(angle);\n\n this.__originalRotate(angle);\n };\n\n ctx.clip = function ctxRotate(rule) {\n destCtx.clip(rule);\n\n this.__originalClip(rule);\n };\n\n ctx.moveTo = function (x, y) {\n destCtx.moveTo(x, y);\n\n this.__originalMoveTo(x, y);\n };\n\n ctx.lineTo = function (x, y) {\n destCtx.lineTo(x, y);\n\n this.__originalLineTo(x, y);\n };\n\n ctx.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) {\n destCtx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n\n this.__originalBezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n };\n\n ctx.rect = function (x, y, width, height) {\n destCtx.rect(x, y, width, height);\n\n this.__originalRect(x, y, width, height);\n };\n\n ctx.closePath = function () {\n destCtx.closePath();\n\n this.__originalClosePath();\n };\n\n ctx.beginPath = function () {\n destCtx.beginPath();\n\n this.__originalBeginPath();\n };\n}\n\nclass CachedCanvases {\n constructor(canvasFactory) {\n this.canvasFactory = canvasFactory;\n this.cache = Object.create(null);\n }\n\n getCanvas(id, width, height) {\n let canvasEntry;\n\n if (this.cache[id] !== undefined) {\n canvasEntry = this.cache[id];\n this.canvasFactory.reset(canvasEntry, width, height);\n } else {\n canvasEntry = this.canvasFactory.create(width, height);\n this.cache[id] = canvasEntry;\n }\n\n return canvasEntry;\n }\n\n delete(id) {\n delete this.cache[id];\n }\n\n clear() {\n for (const id in this.cache) {\n const canvasEntry = this.cache[id];\n this.canvasFactory.destroy(canvasEntry);\n delete this.cache[id];\n }\n }\n\n}\n\nfunction drawImageAtIntegerCoords(ctx, srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH) {\n const [a, b, c, d, tx, ty] = (0, _display_utils.getCurrentTransform)(ctx);\n\n if (b === 0 && c === 0) {\n const tlX = destX * a + tx;\n const rTlX = Math.round(tlX);\n const tlY = destY * d + ty;\n const rTlY = Math.round(tlY);\n const brX = (destX + destW) * a + tx;\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destY + destH) * d + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight);\n ctx.setTransform(a, b, c, d, tx, ty);\n return [rWidth, rHeight];\n }\n\n if (a === 0 && d === 0) {\n const tlX = destY * c + tx;\n const rTlX = Math.round(tlX);\n const tlY = destX * b + ty;\n const rTlY = Math.round(tlY);\n const brX = (destY + destH) * c + tx;\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destX + destW) * b + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth);\n ctx.setTransform(a, b, c, d, tx, ty);\n return [rHeight, rWidth];\n }\n\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH);\n const scaleX = Math.hypot(a, b);\n const scaleY = Math.hypot(c, d);\n return [scaleX * destW, scaleY * destH];\n}\n\nfunction compileType3Glyph(imgData) {\n const {\n width,\n height\n } = imgData;\n\n if (width > MAX_SIZE_TO_COMPILE || height > MAX_SIZE_TO_COMPILE) {\n return null;\n }\n\n const POINT_TO_PROCESS_LIMIT = 1000;\n const POINT_TYPES = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]);\n const width1 = width + 1;\n let points = new Uint8Array(width1 * (height + 1));\n let i, j, j0;\n const lineSize = width + 7 & ~7;\n let data = new Uint8Array(lineSize * height),\n pos = 0;\n\n for (const elem of imgData.data) {\n let mask = 128;\n\n while (mask > 0) {\n data[pos++] = elem & mask ? 0 : 255;\n mask >>= 1;\n }\n }\n\n let count = 0;\n pos = 0;\n\n if (data[pos] !== 0) {\n points[0] = 1;\n ++count;\n }\n\n for (j = 1; j < width; j++) {\n if (data[pos] !== data[pos + 1]) {\n points[j] = data[pos] ? 2 : 1;\n ++count;\n }\n\n pos++;\n }\n\n if (data[pos] !== 0) {\n points[j] = 2;\n ++count;\n }\n\n for (i = 1; i < height; i++) {\n pos = i * lineSize;\n j0 = i * width1;\n\n if (data[pos - lineSize] !== data[pos]) {\n points[j0] = data[pos] ? 1 : 8;\n ++count;\n }\n\n let sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0);\n\n for (j = 1; j < width; j++) {\n sum = (sum >> 2) + (data[pos + 1] ? 4 : 0) + (data[pos - lineSize + 1] ? 8 : 0);\n\n if (POINT_TYPES[sum]) {\n points[j0 + j] = POINT_TYPES[sum];\n ++count;\n }\n\n pos++;\n }\n\n if (data[pos - lineSize] !== data[pos]) {\n points[j0 + j] = data[pos] ? 2 : 4;\n ++count;\n }\n\n if (count > POINT_TO_PROCESS_LIMIT) {\n return null;\n }\n }\n\n pos = lineSize * (height - 1);\n j0 = i * width1;\n\n if (data[pos] !== 0) {\n points[j0] = 8;\n ++count;\n }\n\n for (j = 1; j < width; j++) {\n if (data[pos] !== data[pos + 1]) {\n points[j0 + j] = data[pos] ? 4 : 8;\n ++count;\n }\n\n pos++;\n }\n\n if (data[pos] !== 0) {\n points[j0 + j] = 4;\n ++count;\n }\n\n if (count > POINT_TO_PROCESS_LIMIT) {\n return null;\n }\n\n const steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]);\n const path = new Path2D();\n\n for (i = 0; count && i <= height; i++) {\n let p = i * width1;\n const end = p + width;\n\n while (p < end && !points[p]) {\n p++;\n }\n\n if (p === end) {\n continue;\n }\n\n path.moveTo(p % width1, i);\n const p0 = p;\n let type = points[p];\n\n do {\n const step = steps[type];\n\n do {\n p += step;\n } while (!points[p]);\n\n const pp = points[p];\n\n if (pp !== 5 && pp !== 10) {\n type = pp;\n points[p] = 0;\n } else {\n type = pp & 0x33 * type >> 4;\n points[p] &= type >> 2 | type << 2;\n }\n\n path.lineTo(p % width1, p / width1 | 0);\n\n if (!points[p]) {\n --count;\n }\n } while (p0 !== p);\n\n --i;\n }\n\n data = null;\n points = null;\n\n const drawOutline = function (c) {\n c.save();\n c.scale(1 / width, -1 / height);\n c.translate(0, -height);\n c.fill(path);\n c.beginPath();\n c.restore();\n };\n\n return drawOutline;\n}\n\nclass CanvasExtraState {\n constructor(width, height) {\n this.alphaIsShape = false;\n this.fontSize = 0;\n this.fontSizeScale = 1;\n this.textMatrix = _util.IDENTITY_MATRIX;\n this.textMatrixScale = 1;\n this.fontMatrix = _util.FONT_IDENTITY_MATRIX;\n this.leading = 0;\n this.x = 0;\n this.y = 0;\n this.lineX = 0;\n this.lineY = 0;\n this.charSpacing = 0;\n this.wordSpacing = 0;\n this.textHScale = 1;\n this.textRenderingMode = _util.TextRenderingMode.FILL;\n this.textRise = 0;\n this.fillColor = \"#000000\";\n this.strokeColor = \"#000000\";\n this.patternFill = false;\n this.fillAlpha = 1;\n this.strokeAlpha = 1;\n this.lineWidth = 1;\n this.activeSMask = null;\n this.transferMaps = null;\n this.startNewPathAndClipBox([0, 0, width, height]);\n }\n\n clone() {\n const clone = Object.create(this);\n clone.clipBox = this.clipBox.slice();\n return clone;\n }\n\n setCurrentPoint(x, y) {\n this.x = x;\n this.y = y;\n }\n\n updatePathMinMax(transform, x, y) {\n [x, y] = _util.Util.applyTransform([x, y], transform);\n this.minX = Math.min(this.minX, x);\n this.minY = Math.min(this.minY, y);\n this.maxX = Math.max(this.maxX, x);\n this.maxY = Math.max(this.maxY, y);\n }\n\n updateRectMinMax(transform, rect) {\n const p1 = _util.Util.applyTransform(rect, transform);\n\n const p2 = _util.Util.applyTransform(rect.slice(2), transform);\n\n this.minX = Math.min(this.minX, p1[0], p2[0]);\n this.minY = Math.min(this.minY, p1[1], p2[1]);\n this.maxX = Math.max(this.maxX, p1[0], p2[0]);\n this.maxY = Math.max(this.maxY, p1[1], p2[1]);\n }\n\n updateScalingPathMinMax(transform, minMax) {\n _util.Util.scaleMinMax(transform, minMax);\n\n this.minX = Math.min(this.minX, minMax[0]);\n this.maxX = Math.max(this.maxX, minMax[1]);\n this.minY = Math.min(this.minY, minMax[2]);\n this.maxY = Math.max(this.maxY, minMax[3]);\n }\n\n updateCurvePathMinMax(transform, x0, y0, x1, y1, x2, y2, x3, y3, minMax) {\n const box = _util.Util.bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3);\n\n if (minMax) {\n minMax[0] = Math.min(minMax[0], box[0], box[2]);\n minMax[1] = Math.max(minMax[1], box[0], box[2]);\n minMax[2] = Math.min(minMax[2], box[1], box[3]);\n minMax[3] = Math.max(minMax[3], box[1], box[3]);\n return;\n }\n\n this.updateRectMinMax(transform, box);\n }\n\n getPathBoundingBox(pathType = _pattern_helper.PathType.FILL, transform = null) {\n const box = [this.minX, this.minY, this.maxX, this.maxY];\n\n if (pathType === _pattern_helper.PathType.STROKE) {\n if (!transform) {\n (0, _util.unreachable)(\"Stroke bounding box must include transform.\");\n }\n\n const scale = _util.Util.singularValueDecompose2dScale(transform);\n\n const xStrokePad = scale[0] * this.lineWidth / 2;\n const yStrokePad = scale[1] * this.lineWidth / 2;\n box[0] -= xStrokePad;\n box[1] -= yStrokePad;\n box[2] += xStrokePad;\n box[3] += yStrokePad;\n }\n\n return box;\n }\n\n updateClipFromPath() {\n const intersect = _util.Util.intersect(this.clipBox, this.getPathBoundingBox());\n\n this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]);\n }\n\n isEmptyClip() {\n return this.minX === Infinity;\n }\n\n startNewPathAndClipBox(box) {\n this.clipBox = box;\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = 0;\n this.maxY = 0;\n }\n\n getClippedPathBoundingBox(pathType = _pattern_helper.PathType.FILL, transform = null) {\n return _util.Util.intersect(this.clipBox, this.getPathBoundingBox(pathType, transform));\n }\n\n}\n\nfunction putBinaryImageData(ctx, imgData, transferMaps = null) {\n if (typeof ImageData !== \"undefined\" && imgData instanceof ImageData) {\n ctx.putImageData(imgData, 0, 0);\n return;\n }\n\n const height = imgData.height,\n width = imgData.width;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0,\n destPos;\n const src = imgData.data;\n const dest = chunkImgData.data;\n let i, j, thisChunkHeight, elemsInThisChunk;\n let transferMapRed, transferMapGreen, transferMapBlue, transferMapGray;\n\n if (transferMaps) {\n switch (transferMaps.length) {\n case 1:\n transferMapRed = transferMaps[0];\n transferMapGreen = transferMaps[0];\n transferMapBlue = transferMaps[0];\n transferMapGray = transferMaps[0];\n break;\n\n case 4:\n transferMapRed = transferMaps[0];\n transferMapGreen = transferMaps[1];\n transferMapBlue = transferMaps[2];\n transferMapGray = transferMaps[3];\n break;\n }\n }\n\n if (imgData.kind === _util.ImageKind.GRAYSCALE_1BPP) {\n const srcLength = src.byteLength;\n const dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2);\n const dest32DataLength = dest32.length;\n const fullSrcDiff = width + 7 >> 3;\n let white = 0xffffffff;\n let black = _util.FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n\n if (transferMapGray) {\n if (transferMapGray[0] === 0xff && transferMapGray[0xff] === 0) {\n [white, black] = [black, white];\n }\n }\n\n for (i = 0; i < totalChunks; i++) {\n thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n destPos = 0;\n\n for (j = 0; j < thisChunkHeight; j++) {\n const srcDiff = srcLength - srcPos;\n let k = 0;\n const kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7;\n const kEndUnrolled = kEnd & ~7;\n let mask = 0;\n let srcByte = 0;\n\n for (; k < kEndUnrolled; k += 8) {\n srcByte = src[srcPos++];\n dest32[destPos++] = srcByte & 128 ? white : black;\n dest32[destPos++] = srcByte & 64 ? white : black;\n dest32[destPos++] = srcByte & 32 ? white : black;\n dest32[destPos++] = srcByte & 16 ? white : black;\n dest32[destPos++] = srcByte & 8 ? white : black;\n dest32[destPos++] = srcByte & 4 ? white : black;\n dest32[destPos++] = srcByte & 2 ? white : black;\n dest32[destPos++] = srcByte & 1 ? white : black;\n }\n\n for (; k < kEnd; k++) {\n if (mask === 0) {\n srcByte = src[srcPos++];\n mask = 128;\n }\n\n dest32[destPos++] = srcByte & mask ? white : black;\n mask >>= 1;\n }\n }\n\n while (destPos < dest32DataLength) {\n dest32[destPos++] = 0;\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else if (imgData.kind === _util.ImageKind.RGBA_32BPP) {\n const hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue);\n j = 0;\n elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4;\n\n for (i = 0; i < fullChunks; i++) {\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n srcPos += elemsInThisChunk;\n\n if (hasTransferMaps) {\n for (let k = 0; k < elemsInThisChunk; k += 4) {\n if (transferMapRed) {\n dest[k + 0] = transferMapRed[dest[k + 0]];\n }\n\n if (transferMapGreen) {\n dest[k + 1] = transferMapGreen[dest[k + 1]];\n }\n\n if (transferMapBlue) {\n dest[k + 2] = transferMapBlue[dest[k + 2]];\n }\n }\n }\n\n ctx.putImageData(chunkImgData, 0, j);\n j += FULL_CHUNK_HEIGHT;\n }\n\n if (i < totalChunks) {\n elemsInThisChunk = width * partialChunkHeight * 4;\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n\n if (hasTransferMaps) {\n for (let k = 0; k < elemsInThisChunk; k += 4) {\n if (transferMapRed) {\n dest[k + 0] = transferMapRed[dest[k + 0]];\n }\n\n if (transferMapGreen) {\n dest[k + 1] = transferMapGreen[dest[k + 1]];\n }\n\n if (transferMapBlue) {\n dest[k + 2] = transferMapBlue[dest[k + 2]];\n }\n }\n }\n\n ctx.putImageData(chunkImgData, 0, j);\n }\n } else if (imgData.kind === _util.ImageKind.RGB_24BPP) {\n const hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue);\n thisChunkHeight = FULL_CHUNK_HEIGHT;\n elemsInThisChunk = width * thisChunkHeight;\n\n for (i = 0; i < totalChunks; i++) {\n if (i >= fullChunks) {\n thisChunkHeight = partialChunkHeight;\n elemsInThisChunk = width * thisChunkHeight;\n }\n\n destPos = 0;\n\n for (j = elemsInThisChunk; j--;) {\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = 255;\n }\n\n if (hasTransferMaps) {\n for (let k = 0; k < destPos; k += 4) {\n if (transferMapRed) {\n dest[k + 0] = transferMapRed[dest[k + 0]];\n }\n\n if (transferMapGreen) {\n dest[k + 1] = transferMapGreen[dest[k + 1]];\n }\n\n if (transferMapBlue) {\n dest[k + 2] = transferMapBlue[dest[k + 2]];\n }\n }\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else {\n throw new Error(`bad image kind: ${imgData.kind}`);\n }\n}\n\nfunction putBinaryImageMask(ctx, imgData) {\n if (imgData.bitmap) {\n ctx.drawImage(imgData.bitmap, 0, 0);\n return;\n }\n\n const height = imgData.height,\n width = imgData.width;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0;\n const src = imgData.data;\n const dest = chunkImgData.data;\n\n for (let i = 0; i < totalChunks; i++) {\n const thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n ({\n srcPos\n } = (0, _image_utils.applyMaskImageData)({\n src,\n srcPos,\n dest,\n width,\n height: thisChunkHeight\n }));\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n}\n\nfunction copyCtxState(sourceCtx, destCtx) {\n const properties = [\"strokeStyle\", \"fillStyle\", \"fillRule\", \"globalAlpha\", \"lineWidth\", \"lineCap\", \"lineJoin\", \"miterLimit\", \"globalCompositeOperation\", \"font\"];\n\n for (let i = 0, ii = properties.length; i < ii; i++) {\n const property = properties[i];\n\n if (sourceCtx[property] !== undefined) {\n destCtx[property] = sourceCtx[property];\n }\n }\n\n if (sourceCtx.setLineDash !== undefined) {\n destCtx.setLineDash(sourceCtx.getLineDash());\n destCtx.lineDashOffset = sourceCtx.lineDashOffset;\n }\n}\n\nfunction resetCtxToDefault(ctx, foregroundColor) {\n ctx.strokeStyle = ctx.fillStyle = foregroundColor || \"#000000\";\n ctx.fillRule = \"nonzero\";\n ctx.globalAlpha = 1;\n ctx.lineWidth = 1;\n ctx.lineCap = \"butt\";\n ctx.lineJoin = \"miter\";\n ctx.miterLimit = 10;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.font = \"10px sans-serif\";\n\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash([]);\n ctx.lineDashOffset = 0;\n }\n}\n\nfunction composeSMaskBackdrop(bytes, r0, g0, b0) {\n const length = bytes.length;\n\n for (let i = 3; i < length; i += 4) {\n const alpha = bytes[i];\n\n if (alpha === 0) {\n bytes[i - 3] = r0;\n bytes[i - 2] = g0;\n bytes[i - 1] = b0;\n } else if (alpha < 255) {\n const alpha_ = 255 - alpha;\n bytes[i - 3] = bytes[i - 3] * alpha + r0 * alpha_ >> 8;\n bytes[i - 2] = bytes[i - 2] * alpha + g0 * alpha_ >> 8;\n bytes[i - 1] = bytes[i - 1] * alpha + b0 * alpha_ >> 8;\n }\n }\n}\n\nfunction composeSMaskAlpha(maskData, layerData, transferMap) {\n const length = maskData.length;\n const scale = 1 / 255;\n\n for (let i = 3; i < length; i += 4) {\n const alpha = transferMap ? transferMap[maskData[i]] : maskData[i];\n layerData[i] = layerData[i] * alpha * scale | 0;\n }\n}\n\nfunction composeSMaskLuminosity(maskData, layerData, transferMap) {\n const length = maskData.length;\n\n for (let i = 3; i < length; i += 4) {\n const y = maskData[i - 3] * 77 + maskData[i - 2] * 152 + maskData[i - 1] * 28;\n layerData[i] = transferMap ? layerData[i] * transferMap[y >> 8] >> 8 : layerData[i] * y >> 16;\n }\n}\n\nfunction genericComposeSMask(maskCtx, layerCtx, width, height, subtype, backdrop, transferMap, layerOffsetX, layerOffsetY, maskOffsetX, maskOffsetY) {\n const hasBackdrop = !!backdrop;\n const r0 = hasBackdrop ? backdrop[0] : 0;\n const g0 = hasBackdrop ? backdrop[1] : 0;\n const b0 = hasBackdrop ? backdrop[2] : 0;\n let composeFn;\n\n if (subtype === \"Luminosity\") {\n composeFn = composeSMaskLuminosity;\n } else {\n composeFn = composeSMaskAlpha;\n }\n\n const PIXELS_TO_PROCESS = 1048576;\n const chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width));\n\n for (let row = 0; row < height; row += chunkSize) {\n const chunkHeight = Math.min(chunkSize, height - row);\n const maskData = maskCtx.getImageData(layerOffsetX - maskOffsetX, row + (layerOffsetY - maskOffsetY), width, chunkHeight);\n const layerData = layerCtx.getImageData(layerOffsetX, row + layerOffsetY, width, chunkHeight);\n\n if (hasBackdrop) {\n composeSMaskBackdrop(maskData.data, r0, g0, b0);\n }\n\n composeFn(maskData.data, layerData.data, transferMap);\n layerCtx.putImageData(layerData, layerOffsetX, row + layerOffsetY);\n }\n}\n\nfunction composeSMask(ctx, smask, layerCtx, layerBox) {\n const layerOffsetX = layerBox[0];\n const layerOffsetY = layerBox[1];\n const layerWidth = layerBox[2] - layerOffsetX;\n const layerHeight = layerBox[3] - layerOffsetY;\n\n if (layerWidth === 0 || layerHeight === 0) {\n return;\n }\n\n genericComposeSMask(smask.context, layerCtx, layerWidth, layerHeight, smask.subtype, smask.backdrop, smask.transferMap, layerOffsetX, layerOffsetY, smask.offsetX, smask.offsetY);\n ctx.save();\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(layerCtx.canvas, 0, 0);\n ctx.restore();\n}\n\nfunction getImageSmoothingEnabled(transform, interpolate) {\n const scale = _util.Util.singularValueDecompose2dScale(transform);\n\n scale[0] = Math.fround(scale[0]);\n scale[1] = Math.fround(scale[1]);\n const actualScale = Math.fround((globalThis.devicePixelRatio || 1) * _display_utils.PixelsPerInch.PDF_TO_CSS_UNITS);\n\n if (interpolate !== undefined) {\n return interpolate;\n } else if (scale[0] <= actualScale || scale[1] <= actualScale) {\n return true;\n }\n\n return false;\n}\n\nconst LINE_CAP_STYLES = [\"butt\", \"round\", \"square\"];\nconst LINE_JOIN_STYLES = [\"miter\", \"round\", \"bevel\"];\nconst NORMAL_CLIP = {};\nconst EO_CLIP = {};\n\nclass CanvasGraphics {\n constructor(canvasCtx, commonObjs, objs, canvasFactory, imageLayer, optionalContentConfig, annotationCanvasMap, pageColors) {\n this.ctx = canvasCtx;\n this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height);\n this.stateStack = [];\n this.pendingClip = null;\n this.pendingEOFill = false;\n this.res = null;\n this.xobjs = null;\n this.commonObjs = commonObjs;\n this.objs = objs;\n this.canvasFactory = canvasFactory;\n this.imageLayer = imageLayer;\n this.groupStack = [];\n this.processingType3 = null;\n this.baseTransform = null;\n this.baseTransformStack = [];\n this.groupLevel = 0;\n this.smaskStack = [];\n this.smaskCounter = 0;\n this.tempSMask = null;\n this.suspendedCtx = null;\n this.contentVisible = true;\n this.markedContentStack = [];\n this.optionalContentConfig = optionalContentConfig;\n this.cachedCanvases = new CachedCanvases(this.canvasFactory);\n this.cachedPatterns = new Map();\n this.annotationCanvasMap = annotationCanvasMap;\n this.viewportScale = 1;\n this.outputScaleX = 1;\n this.outputScaleY = 1;\n this.backgroundColor = pageColors?.background || null;\n this.foregroundColor = pageColors?.foreground || null;\n this._cachedScaleForStroking = null;\n this._cachedGetSinglePixelWidth = null;\n this._cachedBitmapsMap = new Map();\n }\n\n getObject(data, fallback = null) {\n if (typeof data === \"string\") {\n return data.startsWith(\"g_\") ? this.commonObjs.get(data) : this.objs.get(data);\n }\n\n return fallback;\n }\n\n beginDrawing({\n transform,\n viewport,\n transparency = false,\n background = null\n }) {\n const width = this.ctx.canvas.width;\n const height = this.ctx.canvas.height;\n const defaultBackgroundColor = background || \"#ffffff\";\n this.ctx.save();\n\n if (this.foregroundColor && this.backgroundColor) {\n this.ctx.fillStyle = this.foregroundColor;\n const fg = this.foregroundColor = this.ctx.fillStyle;\n this.ctx.fillStyle = this.backgroundColor;\n const bg = this.backgroundColor = this.ctx.fillStyle;\n let isValidDefaultBg = true;\n let defaultBg = defaultBackgroundColor;\n this.ctx.fillStyle = defaultBackgroundColor;\n defaultBg = this.ctx.fillStyle;\n isValidDefaultBg = typeof defaultBg === \"string\" && /^#[0-9A-Fa-f]{6}$/.test(defaultBg);\n\n if (fg === \"#000000\" && bg === \"#ffffff\" || fg === bg || !isValidDefaultBg) {\n this.foregroundColor = this.backgroundColor = null;\n } else {\n const [rB, gB, bB] = (0, _display_utils.getRGB)(defaultBg);\n\n const newComp = x => {\n x /= 255;\n return x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;\n };\n\n const lumB = Math.round(0.2126 * newComp(rB) + 0.7152 * newComp(gB) + 0.0722 * newComp(bB));\n\n this.selectColor = (r, g, b) => {\n const lumC = 0.2126 * newComp(r) + 0.7152 * newComp(g) + 0.0722 * newComp(b);\n return Math.round(lumC) === lumB ? bg : fg;\n };\n }\n }\n\n this.ctx.fillStyle = this.backgroundColor || defaultBackgroundColor;\n this.ctx.fillRect(0, 0, width, height);\n this.ctx.restore();\n\n if (transparency) {\n const transparentCanvas = this.cachedCanvases.getCanvas(\"transparent\", width, height);\n this.compositeCtx = this.ctx;\n this.transparentCanvas = transparentCanvas.canvas;\n this.ctx = transparentCanvas.context;\n this.ctx.save();\n this.ctx.transform(...(0, _display_utils.getCurrentTransform)(this.compositeCtx));\n }\n\n this.ctx.save();\n resetCtxToDefault(this.ctx, this.foregroundColor);\n\n if (transform) {\n this.ctx.transform(...transform);\n this.outputScaleX = transform[0];\n this.outputScaleY = transform[0];\n }\n\n this.ctx.transform(...viewport.transform);\n this.viewportScale = viewport.scale;\n this.baseTransform = (0, _display_utils.getCurrentTransform)(this.ctx);\n\n if (this.imageLayer) {\n (0, _display_utils.deprecated)(\"The `imageLayer` functionality will be removed in the future.\");\n this.imageLayer.beginLayout();\n }\n }\n\n executeOperatorList(operatorList, executionStartIdx, continueCallback, stepper) {\n const argsArray = operatorList.argsArray;\n const fnArray = operatorList.fnArray;\n let i = executionStartIdx || 0;\n const argsArrayLen = argsArray.length;\n\n if (argsArrayLen === i) {\n return i;\n }\n\n const chunkOperations = argsArrayLen - i > EXECUTION_STEPS && typeof continueCallback === \"function\";\n const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0;\n let steps = 0;\n const commonObjs = this.commonObjs;\n const objs = this.objs;\n let fnId;\n\n while (true) {\n if (stepper !== undefined && i === stepper.nextBreakPoint) {\n stepper.breakIt(i, continueCallback);\n return i;\n }\n\n fnId = fnArray[i];\n\n if (fnId !== _util.OPS.dependency) {\n this[fnId].apply(this, argsArray[i]);\n } else {\n for (const depObjId of argsArray[i]) {\n const objsPool = depObjId.startsWith(\"g_\") ? commonObjs : objs;\n\n if (!objsPool.has(depObjId)) {\n objsPool.get(depObjId, continueCallback);\n return i;\n }\n }\n }\n\n i++;\n\n if (i === argsArrayLen) {\n return i;\n }\n\n if (chunkOperations && ++steps > EXECUTION_STEPS) {\n if (Date.now() > endTime) {\n continueCallback();\n return i;\n }\n\n steps = 0;\n }\n }\n }\n\n #restoreInitialState() {\n while (this.stateStack.length || this.inSMaskMode) {\n this.restore();\n }\n\n this.ctx.restore();\n\n if (this.transparentCanvas) {\n this.ctx = this.compositeCtx;\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.ctx.drawImage(this.transparentCanvas, 0, 0);\n this.ctx.restore();\n this.transparentCanvas = null;\n }\n }\n\n endDrawing() {\n this.#restoreInitialState();\n this.cachedCanvases.clear();\n this.cachedPatterns.clear();\n\n for (const cache of this._cachedBitmapsMap.values()) {\n for (const canvas of cache.values()) {\n if (typeof HTMLCanvasElement !== \"undefined\" && canvas instanceof HTMLCanvasElement) {\n canvas.width = canvas.height = 0;\n }\n }\n\n cache.clear();\n }\n\n this._cachedBitmapsMap.clear();\n\n if (this.imageLayer) {\n this.imageLayer.endLayout();\n }\n }\n\n _scaleImage(img, inverseTransform) {\n const width = img.width;\n const height = img.height;\n let widthScale = Math.max(Math.hypot(inverseTransform[0], inverseTransform[1]), 1);\n let heightScale = Math.max(Math.hypot(inverseTransform[2], inverseTransform[3]), 1);\n let paintWidth = width,\n paintHeight = height;\n let tmpCanvasId = \"prescale1\";\n let tmpCanvas, tmpCtx;\n\n while (widthScale > 2 && paintWidth > 1 || heightScale > 2 && paintHeight > 1) {\n let newWidth = paintWidth,\n newHeight = paintHeight;\n\n if (widthScale > 2 && paintWidth > 1) {\n newWidth = Math.ceil(paintWidth / 2);\n widthScale /= paintWidth / newWidth;\n }\n\n if (heightScale > 2 && paintHeight > 1) {\n newHeight = Math.ceil(paintHeight / 2);\n heightScale /= paintHeight / newHeight;\n }\n\n tmpCanvas = this.cachedCanvases.getCanvas(tmpCanvasId, newWidth, newHeight);\n tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, newWidth, newHeight);\n tmpCtx.drawImage(img, 0, 0, paintWidth, paintHeight, 0, 0, newWidth, newHeight);\n img = tmpCanvas.canvas;\n paintWidth = newWidth;\n paintHeight = newHeight;\n tmpCanvasId = tmpCanvasId === \"prescale1\" ? \"prescale2\" : \"prescale1\";\n }\n\n return {\n img,\n paintWidth,\n paintHeight\n };\n }\n\n _createMaskCanvas(img) {\n const ctx = this.ctx;\n const {\n width,\n height\n } = img;\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n const currentTransform = (0, _display_utils.getCurrentTransform)(ctx);\n let cache, cacheKey, scaled, maskCanvas;\n\n if ((img.bitmap || img.data) && img.count > 1) {\n const mainKey = img.bitmap || img.data.buffer;\n const withoutTranslation = currentTransform.slice(0, 4);\n cacheKey = JSON.stringify(isPatternFill ? withoutTranslation : [withoutTranslation, fillColor]);\n cache = this._cachedBitmapsMap.get(mainKey);\n\n if (!cache) {\n cache = new Map();\n\n this._cachedBitmapsMap.set(mainKey, cache);\n }\n\n const cachedImage = cache.get(cacheKey);\n\n if (cachedImage && !isPatternFill) {\n const offsetX = Math.round(Math.min(currentTransform[0], currentTransform[2]) + currentTransform[4]);\n const offsetY = Math.round(Math.min(currentTransform[1], currentTransform[3]) + currentTransform[5]);\n return {\n canvas: cachedImage,\n offsetX,\n offsetY\n };\n }\n\n scaled = cachedImage;\n }\n\n if (!scaled) {\n maskCanvas = this.cachedCanvases.getCanvas(\"maskCanvas\", width, height);\n putBinaryImageMask(maskCanvas.context, img);\n }\n\n let maskToCanvas = _util.Util.transform(currentTransform, [1 / width, 0, 0, -1 / height, 0, 0]);\n\n maskToCanvas = _util.Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]);\n\n const cord1 = _util.Util.applyTransform([0, 0], maskToCanvas);\n\n const cord2 = _util.Util.applyTransform([width, height], maskToCanvas);\n\n const rect = _util.Util.normalizeRect([cord1[0], cord1[1], cord2[0], cord2[1]]);\n\n const drawnWidth = Math.round(rect[2] - rect[0]) || 1;\n const drawnHeight = Math.round(rect[3] - rect[1]) || 1;\n const fillCanvas = this.cachedCanvases.getCanvas(\"fillCanvas\", drawnWidth, drawnHeight);\n const fillCtx = fillCanvas.context;\n const offsetX = Math.min(cord1[0], cord2[0]);\n const offsetY = Math.min(cord1[1], cord2[1]);\n fillCtx.translate(-offsetX, -offsetY);\n fillCtx.transform(...maskToCanvas);\n\n if (!scaled) {\n scaled = this._scaleImage(maskCanvas.canvas, (0, _display_utils.getCurrentTransformInverse)(fillCtx));\n scaled = scaled.img;\n\n if (cache && isPatternFill) {\n cache.set(cacheKey, scaled);\n }\n }\n\n fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled((0, _display_utils.getCurrentTransform)(fillCtx), img.interpolate);\n drawImageAtIntegerCoords(fillCtx, scaled, 0, 0, scaled.width, scaled.height, 0, 0, width, height);\n fillCtx.globalCompositeOperation = \"source-in\";\n\n const inverse = _util.Util.transform((0, _display_utils.getCurrentTransformInverse)(fillCtx), [1, 0, 0, 1, -offsetX, -offsetY]);\n\n fillCtx.fillStyle = isPatternFill ? fillColor.getPattern(ctx, this, inverse, _pattern_helper.PathType.FILL) : fillColor;\n fillCtx.fillRect(0, 0, width, height);\n\n if (cache && !isPatternFill) {\n this.cachedCanvases.delete(\"fillCanvas\");\n cache.set(cacheKey, fillCanvas.canvas);\n }\n\n return {\n canvas: fillCanvas.canvas,\n offsetX: Math.round(offsetX),\n offsetY: Math.round(offsetY)\n };\n }\n\n setLineWidth(width) {\n if (width !== this.current.lineWidth) {\n this._cachedScaleForStroking = null;\n }\n\n this.current.lineWidth = width;\n this.ctx.lineWidth = width;\n }\n\n setLineCap(style) {\n this.ctx.lineCap = LINE_CAP_STYLES[style];\n }\n\n setLineJoin(style) {\n this.ctx.lineJoin = LINE_JOIN_STYLES[style];\n }\n\n setMiterLimit(limit) {\n this.ctx.miterLimit = limit;\n }\n\n setDash(dashArray, dashPhase) {\n const ctx = this.ctx;\n\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash(dashArray);\n ctx.lineDashOffset = dashPhase;\n }\n }\n\n setRenderingIntent(intent) {}\n\n setFlatness(flatness) {}\n\n setGState(states) {\n for (let i = 0, ii = states.length; i < ii; i++) {\n const state = states[i];\n const key = state[0];\n const value = state[1];\n\n switch (key) {\n case \"LW\":\n this.setLineWidth(value);\n break;\n\n case \"LC\":\n this.setLineCap(value);\n break;\n\n case \"LJ\":\n this.setLineJoin(value);\n break;\n\n case \"ML\":\n this.setMiterLimit(value);\n break;\n\n case \"D\":\n this.setDash(value[0], value[1]);\n break;\n\n case \"RI\":\n this.setRenderingIntent(value);\n break;\n\n case \"FL\":\n this.setFlatness(value);\n break;\n\n case \"Font\":\n this.setFont(value[0], value[1]);\n break;\n\n case \"CA\":\n this.current.strokeAlpha = state[1];\n break;\n\n case \"ca\":\n this.current.fillAlpha = state[1];\n this.ctx.globalAlpha = state[1];\n break;\n\n case \"BM\":\n this.ctx.globalCompositeOperation = value;\n break;\n\n case \"SMask\":\n this.current.activeSMask = value ? this.tempSMask : null;\n this.tempSMask = null;\n this.checkSMaskState();\n break;\n\n case \"TR\":\n this.current.transferMaps = value;\n }\n }\n }\n\n get inSMaskMode() {\n return !!this.suspendedCtx;\n }\n\n checkSMaskState() {\n const inSMaskMode = this.inSMaskMode;\n\n if (this.current.activeSMask && !inSMaskMode) {\n this.beginSMaskMode();\n } else if (!this.current.activeSMask && inSMaskMode) {\n this.endSMaskMode();\n }\n }\n\n beginSMaskMode() {\n if (this.inSMaskMode) {\n throw new Error(\"beginSMaskMode called while already in smask mode\");\n }\n\n const drawnWidth = this.ctx.canvas.width;\n const drawnHeight = this.ctx.canvas.height;\n const cacheId = \"smaskGroupAt\" + this.groupLevel;\n const scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight);\n this.suspendedCtx = this.ctx;\n this.ctx = scratchCanvas.context;\n const ctx = this.ctx;\n ctx.setTransform(...(0, _display_utils.getCurrentTransform)(this.suspendedCtx));\n copyCtxState(this.suspendedCtx, ctx);\n mirrorContextOperations(ctx, this.suspendedCtx);\n this.setGState([[\"BM\", \"source-over\"], [\"ca\", 1], [\"CA\", 1]]);\n }\n\n endSMaskMode() {\n if (!this.inSMaskMode) {\n throw new Error(\"endSMaskMode called while not in smask mode\");\n }\n\n this.ctx._removeMirroring();\n\n copyCtxState(this.ctx, this.suspendedCtx);\n this.ctx = this.suspendedCtx;\n this.suspendedCtx = null;\n }\n\n compose(dirtyBox) {\n if (!this.current.activeSMask) {\n return;\n }\n\n if (!dirtyBox) {\n dirtyBox = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];\n } else {\n dirtyBox[0] = Math.floor(dirtyBox[0]);\n dirtyBox[1] = Math.floor(dirtyBox[1]);\n dirtyBox[2] = Math.ceil(dirtyBox[2]);\n dirtyBox[3] = Math.ceil(dirtyBox[3]);\n }\n\n const smask = this.current.activeSMask;\n const suspendedCtx = this.suspendedCtx;\n composeSMask(suspendedCtx, smask, this.ctx, dirtyBox);\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);\n this.ctx.restore();\n }\n\n save() {\n if (this.inSMaskMode) {\n copyCtxState(this.ctx, this.suspendedCtx);\n this.suspendedCtx.save();\n } else {\n this.ctx.save();\n }\n\n const old = this.current;\n this.stateStack.push(old);\n this.current = old.clone();\n }\n\n restore() {\n if (this.stateStack.length === 0 && this.inSMaskMode) {\n this.endSMaskMode();\n }\n\n if (this.stateStack.length !== 0) {\n this.current = this.stateStack.pop();\n\n if (this.inSMaskMode) {\n this.suspendedCtx.restore();\n copyCtxState(this.suspendedCtx, this.ctx);\n } else {\n this.ctx.restore();\n }\n\n this.checkSMaskState();\n this.pendingClip = null;\n this._cachedScaleForStroking = null;\n this._cachedGetSinglePixelWidth = null;\n }\n }\n\n transform(a, b, c, d, e, f) {\n this.ctx.transform(a, b, c, d, e, f);\n this._cachedScaleForStroking = null;\n this._cachedGetSinglePixelWidth = null;\n }\n\n constructPath(ops, args, minMax) {\n const ctx = this.ctx;\n const current = this.current;\n let x = current.x,\n y = current.y;\n let startX, startY;\n const currentTransform = (0, _display_utils.getCurrentTransform)(ctx);\n const isScalingMatrix = currentTransform[0] === 0 && currentTransform[3] === 0 || currentTransform[1] === 0 && currentTransform[2] === 0;\n const minMaxForBezier = isScalingMatrix ? minMax.slice(0) : null;\n\n for (let i = 0, j = 0, ii = ops.length; i < ii; i++) {\n switch (ops[i] | 0) {\n case _util.OPS.rectangle:\n x = args[j++];\n y = args[j++];\n const width = args[j++];\n const height = args[j++];\n const xw = x + width;\n const yh = y + height;\n ctx.moveTo(x, y);\n\n if (width === 0 || height === 0) {\n ctx.lineTo(xw, yh);\n } else {\n ctx.lineTo(xw, y);\n ctx.lineTo(xw, yh);\n ctx.lineTo(x, yh);\n }\n\n if (!isScalingMatrix) {\n current.updateRectMinMax(currentTransform, [x, y, xw, yh]);\n }\n\n ctx.closePath();\n break;\n\n case _util.OPS.moveTo:\n x = args[j++];\n y = args[j++];\n ctx.moveTo(x, y);\n\n if (!isScalingMatrix) {\n current.updatePathMinMax(currentTransform, x, y);\n }\n\n break;\n\n case _util.OPS.lineTo:\n x = args[j++];\n y = args[j++];\n ctx.lineTo(x, y);\n\n if (!isScalingMatrix) {\n current.updatePathMinMax(currentTransform, x, y);\n }\n\n break;\n\n case _util.OPS.curveTo:\n startX = x;\n startY = y;\n x = args[j + 4];\n y = args[j + 5];\n ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], x, y);\n current.updateCurvePathMinMax(currentTransform, startX, startY, args[j], args[j + 1], args[j + 2], args[j + 3], x, y, minMaxForBezier);\n j += 6;\n break;\n\n case _util.OPS.curveTo2:\n startX = x;\n startY = y;\n ctx.bezierCurveTo(x, y, args[j], args[j + 1], args[j + 2], args[j + 3]);\n current.updateCurvePathMinMax(currentTransform, startX, startY, x, y, args[j], args[j + 1], args[j + 2], args[j + 3], minMaxForBezier);\n x = args[j + 2];\n y = args[j + 3];\n j += 4;\n break;\n\n case _util.OPS.curveTo3:\n startX = x;\n startY = y;\n x = args[j + 2];\n y = args[j + 3];\n ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y);\n current.updateCurvePathMinMax(currentTransform, startX, startY, args[j], args[j + 1], x, y, x, y, minMaxForBezier);\n j += 4;\n break;\n\n case _util.OPS.closePath:\n ctx.closePath();\n break;\n }\n }\n\n if (isScalingMatrix) {\n current.updateScalingPathMinMax(currentTransform, minMaxForBezier);\n }\n\n current.setCurrentPoint(x, y);\n }\n\n closePath() {\n this.ctx.closePath();\n }\n\n stroke(consumePath) {\n consumePath = typeof consumePath !== \"undefined\" ? consumePath : true;\n const ctx = this.ctx;\n const strokeColor = this.current.strokeColor;\n ctx.globalAlpha = this.current.strokeAlpha;\n\n if (this.contentVisible) {\n if (typeof strokeColor === \"object\" && strokeColor?.getPattern) {\n ctx.save();\n ctx.strokeStyle = strokeColor.getPattern(ctx, this, (0, _display_utils.getCurrentTransformInverse)(ctx), _pattern_helper.PathType.STROKE);\n this.rescaleAndStroke(false);\n ctx.restore();\n } else {\n this.rescaleAndStroke(true);\n }\n }\n\n if (consumePath) {\n this.consumePath(this.current.getClippedPathBoundingBox());\n }\n\n ctx.globalAlpha = this.current.fillAlpha;\n }\n\n closeStroke() {\n this.closePath();\n this.stroke();\n }\n\n fill(consumePath) {\n consumePath = typeof consumePath !== \"undefined\" ? consumePath : true;\n const ctx = this.ctx;\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n let needRestore = false;\n\n if (isPatternFill) {\n ctx.save();\n ctx.fillStyle = fillColor.getPattern(ctx, this, (0, _display_utils.getCurrentTransformInverse)(ctx), _pattern_helper.PathType.FILL);\n needRestore = true;\n }\n\n const intersect = this.current.getClippedPathBoundingBox();\n\n if (this.contentVisible && intersect !== null) {\n if (this.pendingEOFill) {\n ctx.fill(\"evenodd\");\n this.pendingEOFill = false;\n } else {\n ctx.fill();\n }\n }\n\n if (needRestore) {\n ctx.restore();\n }\n\n if (consumePath) {\n this.consumePath(intersect);\n }\n }\n\n eoFill() {\n this.pendingEOFill = true;\n this.fill();\n }\n\n fillStroke() {\n this.fill(false);\n this.stroke(false);\n this.consumePath();\n }\n\n eoFillStroke() {\n this.pendingEOFill = true;\n this.fillStroke();\n }\n\n closeFillStroke() {\n this.closePath();\n this.fillStroke();\n }\n\n closeEOFillStroke() {\n this.pendingEOFill = true;\n this.closePath();\n this.fillStroke();\n }\n\n endPath() {\n this.consumePath();\n }\n\n clip() {\n this.pendingClip = NORMAL_CLIP;\n }\n\n eoClip() {\n this.pendingClip = EO_CLIP;\n }\n\n beginText() {\n this.current.textMatrix = _util.IDENTITY_MATRIX;\n this.current.textMatrixScale = 1;\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n }\n\n endText() {\n const paths = this.pendingTextPaths;\n const ctx = this.ctx;\n\n if (paths === undefined) {\n ctx.beginPath();\n return;\n }\n\n ctx.save();\n ctx.beginPath();\n\n for (const path of paths) {\n ctx.setTransform(...path.transform);\n ctx.translate(path.x, path.y);\n path.addToPath(ctx, path.fontSize);\n }\n\n ctx.restore();\n ctx.clip();\n ctx.beginPath();\n delete this.pendingTextPaths;\n }\n\n setCharSpacing(spacing) {\n this.current.charSpacing = spacing;\n }\n\n setWordSpacing(spacing) {\n this.current.wordSpacing = spacing;\n }\n\n setHScale(scale) {\n this.current.textHScale = scale / 100;\n }\n\n setLeading(leading) {\n this.current.leading = -leading;\n }\n\n setFont(fontRefName, size) {\n const fontObj = this.commonObjs.get(fontRefName);\n const current = this.current;\n\n if (!fontObj) {\n throw new Error(`Can't find font for ${fontRefName}`);\n }\n\n current.fontMatrix = fontObj.fontMatrix || _util.FONT_IDENTITY_MATRIX;\n\n if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) {\n (0, _util.warn)(\"Invalid font matrix for font \" + fontRefName);\n }\n\n if (size < 0) {\n size = -size;\n current.fontDirection = -1;\n } else {\n current.fontDirection = 1;\n }\n\n this.current.font = fontObj;\n this.current.fontSize = size;\n\n if (fontObj.isType3Font) {\n return;\n }\n\n const name = fontObj.loadedName || \"sans-serif\";\n let bold = \"normal\";\n\n if (fontObj.black) {\n bold = \"900\";\n } else if (fontObj.bold) {\n bold = \"bold\";\n }\n\n const italic = fontObj.italic ? \"italic\" : \"normal\";\n const typeface = `\"${name}\", ${fontObj.fallbackName}`;\n let browserFontSize = size;\n\n if (size < MIN_FONT_SIZE) {\n browserFontSize = MIN_FONT_SIZE;\n } else if (size > MAX_FONT_SIZE) {\n browserFontSize = MAX_FONT_SIZE;\n }\n\n this.current.fontSizeScale = size / browserFontSize;\n this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`;\n }\n\n setTextRenderingMode(mode) {\n this.current.textRenderingMode = mode;\n }\n\n setTextRise(rise) {\n this.current.textRise = rise;\n }\n\n moveText(x, y) {\n this.current.x = this.current.lineX += x;\n this.current.y = this.current.lineY += y;\n }\n\n setLeadingMoveText(x, y) {\n this.setLeading(-y);\n this.moveText(x, y);\n }\n\n setTextMatrix(a, b, c, d, e, f) {\n this.current.textMatrix = [a, b, c, d, e, f];\n this.current.textMatrixScale = Math.hypot(a, b);\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n }\n\n nextLine() {\n this.moveText(0, this.current.leading);\n }\n\n paintChar(character, x, y, patternTransform) {\n const ctx = this.ctx;\n const current = this.current;\n const font = current.font;\n const textRenderingMode = current.textRenderingMode;\n const fontSize = current.fontSize / current.fontSizeScale;\n const fillStrokeMode = textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK;\n const isAddToPathSet = !!(textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG);\n const patternFill = current.patternFill && !font.missingFile;\n let addToPath;\n\n if (font.disableFontFace || isAddToPathSet || patternFill) {\n addToPath = font.getPathGenerator(this.commonObjs, character);\n }\n\n if (font.disableFontFace || patternFill) {\n ctx.save();\n ctx.translate(x, y);\n ctx.beginPath();\n addToPath(ctx, fontSize);\n\n if (patternTransform) {\n ctx.setTransform(...patternTransform);\n }\n\n if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n ctx.fill();\n }\n\n if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n ctx.stroke();\n }\n\n ctx.restore();\n } else {\n if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n ctx.fillText(character, x, y);\n }\n\n if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n ctx.strokeText(character, x, y);\n }\n }\n\n if (isAddToPathSet) {\n const paths = this.pendingTextPaths || (this.pendingTextPaths = []);\n paths.push({\n transform: (0, _display_utils.getCurrentTransform)(ctx),\n x,\n y,\n fontSize,\n addToPath\n });\n }\n }\n\n get isFontSubpixelAAEnabled() {\n const {\n context: ctx\n } = this.cachedCanvases.getCanvas(\"isFontSubpixelAAEnabled\", 10, 10);\n ctx.scale(1.5, 1);\n ctx.fillText(\"I\", 0, 10);\n const data = ctx.getImageData(0, 0, 10, 10).data;\n let enabled = false;\n\n for (let i = 3; i < data.length; i += 4) {\n if (data[i] > 0 && data[i] < 255) {\n enabled = true;\n break;\n }\n }\n\n return (0, _util.shadow)(this, \"isFontSubpixelAAEnabled\", enabled);\n }\n\n showText(glyphs) {\n const current = this.current;\n const font = current.font;\n\n if (font.isType3Font) {\n return this.showType3Text(glyphs);\n }\n\n const fontSize = current.fontSize;\n\n if (fontSize === 0) {\n return undefined;\n }\n\n const ctx = this.ctx;\n const fontSizeScale = current.fontSizeScale;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const fontDirection = current.fontDirection;\n const textHScale = current.textHScale * fontDirection;\n const glyphsLength = glyphs.length;\n const vertical = font.vertical;\n const spacingDir = vertical ? 1 : -1;\n const defaultVMetrics = font.defaultVMetrics;\n const widthAdvanceScale = fontSize * current.fontMatrix[0];\n const simpleFillText = current.textRenderingMode === _util.TextRenderingMode.FILL && !font.disableFontFace && !current.patternFill;\n ctx.save();\n ctx.transform(...current.textMatrix);\n ctx.translate(current.x, current.y + current.textRise);\n\n if (fontDirection > 0) {\n ctx.scale(textHScale, -1);\n } else {\n ctx.scale(textHScale, 1);\n }\n\n let patternTransform;\n\n if (current.patternFill) {\n ctx.save();\n const pattern = current.fillColor.getPattern(ctx, this, (0, _display_utils.getCurrentTransformInverse)(ctx), _pattern_helper.PathType.FILL);\n patternTransform = (0, _display_utils.getCurrentTransform)(ctx);\n ctx.restore();\n ctx.fillStyle = pattern;\n }\n\n let lineWidth = current.lineWidth;\n const scale = current.textMatrixScale;\n\n if (scale === 0 || lineWidth === 0) {\n const fillStrokeMode = current.textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK;\n\n if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n lineWidth = this.getSinglePixelWidth();\n }\n } else {\n lineWidth /= scale;\n }\n\n if (fontSizeScale !== 1.0) {\n ctx.scale(fontSizeScale, fontSizeScale);\n lineWidth /= fontSizeScale;\n }\n\n ctx.lineWidth = lineWidth;\n let x = 0,\n i;\n\n for (i = 0; i < glyphsLength; ++i) {\n const glyph = glyphs[i];\n\n if (typeof glyph === \"number\") {\n x += spacingDir * glyph * fontSize / 1000;\n continue;\n }\n\n let restoreNeeded = false;\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const character = glyph.fontChar;\n const accent = glyph.accent;\n let scaledX, scaledY;\n let width = glyph.width;\n\n if (vertical) {\n const vmetric = glyph.vmetric || defaultVMetrics;\n const vx = -(glyph.vmetric ? vmetric[1] : width * 0.5) * widthAdvanceScale;\n const vy = vmetric[2] * widthAdvanceScale;\n width = vmetric ? -vmetric[0] : width;\n scaledX = vx / fontSizeScale;\n scaledY = (x + vy) / fontSizeScale;\n } else {\n scaledX = x / fontSizeScale;\n scaledY = 0;\n }\n\n if (font.remeasure && width > 0) {\n const measuredWidth = ctx.measureText(character).width * 1000 / fontSize * fontSizeScale;\n\n if (width < measuredWidth && this.isFontSubpixelAAEnabled) {\n const characterScaleX = width / measuredWidth;\n restoreNeeded = true;\n ctx.save();\n ctx.scale(characterScaleX, 1);\n scaledX /= characterScaleX;\n } else if (width !== measuredWidth) {\n scaledX += (width - measuredWidth) / 2000 * fontSize / fontSizeScale;\n }\n }\n\n if (this.contentVisible && (glyph.isInFont || font.missingFile)) {\n if (simpleFillText && !accent) {\n ctx.fillText(character, scaledX, scaledY);\n } else {\n this.paintChar(character, scaledX, scaledY, patternTransform);\n\n if (accent) {\n const scaledAccentX = scaledX + fontSize * accent.offset.x / fontSizeScale;\n const scaledAccentY = scaledY - fontSize * accent.offset.y / fontSizeScale;\n this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY, patternTransform);\n }\n }\n }\n\n let charWidth;\n\n if (vertical) {\n charWidth = width * widthAdvanceScale - spacing * fontDirection;\n } else {\n charWidth = width * widthAdvanceScale + spacing * fontDirection;\n }\n\n x += charWidth;\n\n if (restoreNeeded) {\n ctx.restore();\n }\n }\n\n if (vertical) {\n current.y -= x;\n } else {\n current.x += x * textHScale;\n }\n\n ctx.restore();\n this.compose();\n return undefined;\n }\n\n showType3Text(glyphs) {\n const ctx = this.ctx;\n const current = this.current;\n const font = current.font;\n const fontSize = current.fontSize;\n const fontDirection = current.fontDirection;\n const spacingDir = font.vertical ? 1 : -1;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const textHScale = current.textHScale * fontDirection;\n const fontMatrix = current.fontMatrix || _util.FONT_IDENTITY_MATRIX;\n const glyphsLength = glyphs.length;\n const isTextInvisible = current.textRenderingMode === _util.TextRenderingMode.INVISIBLE;\n let i, glyph, width, spacingLength;\n\n if (isTextInvisible || fontSize === 0) {\n return;\n }\n\n this._cachedScaleForStroking = null;\n this._cachedGetSinglePixelWidth = null;\n ctx.save();\n ctx.transform(...current.textMatrix);\n ctx.translate(current.x, current.y);\n ctx.scale(textHScale, fontDirection);\n\n for (i = 0; i < glyphsLength; ++i) {\n glyph = glyphs[i];\n\n if (typeof glyph === \"number\") {\n spacingLength = spacingDir * glyph * fontSize / 1000;\n this.ctx.translate(spacingLength, 0);\n current.x += spacingLength * textHScale;\n continue;\n }\n\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const operatorList = font.charProcOperatorList[glyph.operatorListId];\n\n if (!operatorList) {\n (0, _util.warn)(`Type3 character \"${glyph.operatorListId}\" is not available.`);\n continue;\n }\n\n if (this.contentVisible) {\n this.processingType3 = glyph;\n this.save();\n ctx.scale(fontSize, fontSize);\n ctx.transform(...fontMatrix);\n this.executeOperatorList(operatorList);\n this.restore();\n }\n\n const transformed = _util.Util.applyTransform([glyph.width, 0], fontMatrix);\n\n width = transformed[0] * fontSize + spacing;\n ctx.translate(width, 0);\n current.x += width * textHScale;\n }\n\n ctx.restore();\n this.processingType3 = null;\n }\n\n setCharWidth(xWidth, yWidth) {}\n\n setCharWidthAndBounds(xWidth, yWidth, llx, lly, urx, ury) {\n this.ctx.rect(llx, lly, urx - llx, ury - lly);\n this.ctx.clip();\n this.endPath();\n }\n\n getColorN_Pattern(IR) {\n let pattern;\n\n if (IR[0] === \"TilingPattern\") {\n const color = IR[1];\n const baseTransform = this.baseTransform || (0, _display_utils.getCurrentTransform)(this.ctx);\n const canvasGraphicsFactory = {\n createCanvasGraphics: ctx => {\n return new CanvasGraphics(ctx, this.commonObjs, this.objs, this.canvasFactory);\n }\n };\n pattern = new _pattern_helper.TilingPattern(IR, color, this.ctx, canvasGraphicsFactory, baseTransform);\n } else {\n pattern = this._getPattern(IR[1], IR[2]);\n }\n\n return pattern;\n }\n\n setStrokeColorN() {\n this.current.strokeColor = this.getColorN_Pattern(arguments);\n }\n\n setFillColorN() {\n this.current.fillColor = this.getColorN_Pattern(arguments);\n this.current.patternFill = true;\n }\n\n setStrokeRGBColor(r, g, b) {\n const color = this.selectColor?.(r, g, b) || _util.Util.makeHexColor(r, g, b);\n\n this.ctx.strokeStyle = color;\n this.current.strokeColor = color;\n }\n\n setFillRGBColor(r, g, b) {\n const color = this.selectColor?.(r, g, b) || _util.Util.makeHexColor(r, g, b);\n\n this.ctx.fillStyle = color;\n this.current.fillColor = color;\n this.current.patternFill = false;\n }\n\n _getPattern(objId, matrix = null) {\n let pattern;\n\n if (this.cachedPatterns.has(objId)) {\n pattern = this.cachedPatterns.get(objId);\n } else {\n pattern = (0, _pattern_helper.getShadingPattern)(this.objs.get(objId));\n this.cachedPatterns.set(objId, pattern);\n }\n\n if (matrix) {\n pattern.matrix = matrix;\n }\n\n return pattern;\n }\n\n shadingFill(objId) {\n if (!this.contentVisible) {\n return;\n }\n\n const ctx = this.ctx;\n this.save();\n\n const pattern = this._getPattern(objId);\n\n ctx.fillStyle = pattern.getPattern(ctx, this, (0, _display_utils.getCurrentTransformInverse)(ctx), _pattern_helper.PathType.SHADING);\n const inv = (0, _display_utils.getCurrentTransformInverse)(ctx);\n\n if (inv) {\n const canvas = ctx.canvas;\n const width = canvas.width;\n const height = canvas.height;\n\n const bl = _util.Util.applyTransform([0, 0], inv);\n\n const br = _util.Util.applyTransform([0, height], inv);\n\n const ul = _util.Util.applyTransform([width, 0], inv);\n\n const ur = _util.Util.applyTransform([width, height], inv);\n\n const x0 = Math.min(bl[0], br[0], ul[0], ur[0]);\n const y0 = Math.min(bl[1], br[1], ul[1], ur[1]);\n const x1 = Math.max(bl[0], br[0], ul[0], ur[0]);\n const y1 = Math.max(bl[1], br[1], ul[1], ur[1]);\n this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0);\n } else {\n this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);\n }\n\n this.compose(this.current.getClippedPathBoundingBox());\n this.restore();\n }\n\n beginInlineImage() {\n (0, _util.unreachable)(\"Should not call beginInlineImage\");\n }\n\n beginImageData() {\n (0, _util.unreachable)(\"Should not call beginImageData\");\n }\n\n paintFormXObjectBegin(matrix, bbox) {\n if (!this.contentVisible) {\n return;\n }\n\n this.save();\n this.baseTransformStack.push(this.baseTransform);\n\n if (Array.isArray(matrix) && matrix.length === 6) {\n this.transform(...matrix);\n }\n\n this.baseTransform = (0, _display_utils.getCurrentTransform)(this.ctx);\n\n if (bbox) {\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n this.ctx.rect(bbox[0], bbox[1], width, height);\n this.current.updateRectMinMax((0, _display_utils.getCurrentTransform)(this.ctx), bbox);\n this.clip();\n this.endPath();\n }\n }\n\n paintFormXObjectEnd() {\n if (!this.contentVisible) {\n return;\n }\n\n this.restore();\n this.baseTransform = this.baseTransformStack.pop();\n }\n\n beginGroup(group) {\n if (!this.contentVisible) {\n return;\n }\n\n this.save();\n\n if (this.inSMaskMode) {\n this.endSMaskMode();\n this.current.activeSMask = null;\n }\n\n const currentCtx = this.ctx;\n\n if (!group.isolated) {\n (0, _util.info)(\"TODO: Support non-isolated groups.\");\n }\n\n if (group.knockout) {\n (0, _util.warn)(\"Knockout groups not supported.\");\n }\n\n const currentTransform = (0, _display_utils.getCurrentTransform)(currentCtx);\n\n if (group.matrix) {\n currentCtx.transform(...group.matrix);\n }\n\n if (!group.bbox) {\n throw new Error(\"Bounding box is required.\");\n }\n\n let bounds = _util.Util.getAxialAlignedBoundingBox(group.bbox, (0, _display_utils.getCurrentTransform)(currentCtx));\n\n const canvasBounds = [0, 0, currentCtx.canvas.width, currentCtx.canvas.height];\n bounds = _util.Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0];\n const offsetX = Math.floor(bounds[0]);\n const offsetY = Math.floor(bounds[1]);\n let drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1);\n let drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1);\n let scaleX = 1,\n scaleY = 1;\n\n if (drawnWidth > MAX_GROUP_SIZE) {\n scaleX = drawnWidth / MAX_GROUP_SIZE;\n drawnWidth = MAX_GROUP_SIZE;\n }\n\n if (drawnHeight > MAX_GROUP_SIZE) {\n scaleY = drawnHeight / MAX_GROUP_SIZE;\n drawnHeight = MAX_GROUP_SIZE;\n }\n\n this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]);\n let cacheId = \"groupAt\" + this.groupLevel;\n\n if (group.smask) {\n cacheId += \"_smask_\" + this.smaskCounter++ % 2;\n }\n\n const scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight);\n const groupCtx = scratchCanvas.context;\n groupCtx.scale(1 / scaleX, 1 / scaleY);\n groupCtx.translate(-offsetX, -offsetY);\n groupCtx.transform(...currentTransform);\n\n if (group.smask) {\n this.smaskStack.push({\n canvas: scratchCanvas.canvas,\n context: groupCtx,\n offsetX,\n offsetY,\n scaleX,\n scaleY,\n subtype: group.smask.subtype,\n backdrop: group.smask.backdrop,\n transferMap: group.smask.transferMap || null,\n startTransformInverse: null\n });\n } else {\n currentCtx.setTransform(1, 0, 0, 1, 0, 0);\n currentCtx.translate(offsetX, offsetY);\n currentCtx.scale(scaleX, scaleY);\n currentCtx.save();\n }\n\n copyCtxState(currentCtx, groupCtx);\n this.ctx = groupCtx;\n this.setGState([[\"BM\", \"source-over\"], [\"ca\", 1], [\"CA\", 1]]);\n this.groupStack.push(currentCtx);\n this.groupLevel++;\n }\n\n endGroup(group) {\n if (!this.contentVisible) {\n return;\n }\n\n this.groupLevel--;\n const groupCtx = this.ctx;\n const ctx = this.groupStack.pop();\n this.ctx = ctx;\n this.ctx.imageSmoothingEnabled = false;\n\n if (group.smask) {\n this.tempSMask = this.smaskStack.pop();\n this.restore();\n } else {\n this.ctx.restore();\n const currentMtx = (0, _display_utils.getCurrentTransform)(this.ctx);\n this.restore();\n this.ctx.save();\n this.ctx.setTransform(...currentMtx);\n\n const dirtyBox = _util.Util.getAxialAlignedBoundingBox([0, 0, groupCtx.canvas.width, groupCtx.canvas.height], currentMtx);\n\n this.ctx.drawImage(groupCtx.canvas, 0, 0);\n this.ctx.restore();\n this.compose(dirtyBox);\n }\n }\n\n beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) {\n this.#restoreInitialState();\n resetCtxToDefault(this.ctx, this.foregroundColor);\n this.ctx.save();\n this.save();\n\n if (this.baseTransform) {\n this.ctx.setTransform(...this.baseTransform);\n }\n\n if (Array.isArray(rect) && rect.length === 4) {\n const width = rect[2] - rect[0];\n const height = rect[3] - rect[1];\n\n if (hasOwnCanvas && this.annotationCanvasMap) {\n transform = transform.slice();\n transform[4] -= rect[0];\n transform[5] -= rect[1];\n rect = rect.slice();\n rect[0] = rect[1] = 0;\n rect[2] = width;\n rect[3] = height;\n\n const [scaleX, scaleY] = _util.Util.singularValueDecompose2dScale((0, _display_utils.getCurrentTransform)(this.ctx));\n\n const {\n viewportScale\n } = this;\n const canvasWidth = Math.ceil(width * this.outputScaleX * viewportScale);\n const canvasHeight = Math.ceil(height * this.outputScaleY * viewportScale);\n this.annotationCanvas = this.canvasFactory.create(canvasWidth, canvasHeight);\n const {\n canvas,\n context\n } = this.annotationCanvas;\n this.annotationCanvasMap.set(id, canvas);\n this.annotationCanvas.savedCtx = this.ctx;\n this.ctx = context;\n this.ctx.setTransform(scaleX, 0, 0, -scaleY, 0, height * scaleY);\n resetCtxToDefault(this.ctx, this.foregroundColor);\n } else {\n resetCtxToDefault(this.ctx, this.foregroundColor);\n this.ctx.rect(rect[0], rect[1], width, height);\n this.ctx.clip();\n this.endPath();\n }\n }\n\n this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height);\n this.transform(...transform);\n this.transform(...matrix);\n }\n\n endAnnotation() {\n if (this.annotationCanvas) {\n this.ctx = this.annotationCanvas.savedCtx;\n delete this.annotationCanvas.savedCtx;\n delete this.annotationCanvas;\n }\n }\n\n paintImageMaskXObject(img) {\n if (!this.contentVisible) {\n return;\n }\n\n const count = img.count;\n img = this.getObject(img.data, img);\n img.count = count;\n const ctx = this.ctx;\n const glyph = this.processingType3;\n\n if (glyph) {\n if (glyph.compiled === undefined) {\n glyph.compiled = compileType3Glyph(img);\n }\n\n if (glyph.compiled) {\n glyph.compiled(ctx);\n return;\n }\n }\n\n const mask = this._createMaskCanvas(img);\n\n const maskCanvas = mask.canvas;\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY);\n ctx.restore();\n this.compose();\n }\n\n paintImageMaskXObjectRepeat(img, scaleX, skewX = 0, skewY = 0, scaleY, positions) {\n if (!this.contentVisible) {\n return;\n }\n\n img = this.getObject(img.data, img);\n const ctx = this.ctx;\n ctx.save();\n const currentTransform = (0, _display_utils.getCurrentTransform)(ctx);\n ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0);\n\n const mask = this._createMaskCanvas(img);\n\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n\n for (let i = 0, ii = positions.length; i < ii; i += 2) {\n const trans = _util.Util.transform(currentTransform, [scaleX, skewX, skewY, scaleY, positions[i], positions[i + 1]]);\n\n const [x, y] = _util.Util.applyTransform([0, 0], trans);\n\n ctx.drawImage(mask.canvas, x, y);\n }\n\n ctx.restore();\n this.compose();\n }\n\n paintImageMaskXObjectGroup(images) {\n if (!this.contentVisible) {\n return;\n }\n\n const ctx = this.ctx;\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n\n for (const image of images) {\n const {\n data,\n width,\n height,\n transform\n } = image;\n const maskCanvas = this.cachedCanvases.getCanvas(\"maskCanvas\", width, height);\n const maskCtx = maskCanvas.context;\n maskCtx.save();\n const img = this.getObject(data, image);\n putBinaryImageMask(maskCtx, img);\n maskCtx.globalCompositeOperation = \"source-in\";\n maskCtx.fillStyle = isPatternFill ? fillColor.getPattern(maskCtx, this, (0, _display_utils.getCurrentTransformInverse)(ctx), _pattern_helper.PathType.FILL) : fillColor;\n maskCtx.fillRect(0, 0, width, height);\n maskCtx.restore();\n ctx.save();\n ctx.transform(...transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(ctx, maskCanvas.canvas, 0, 0, width, height, 0, -1, 1, 1);\n ctx.restore();\n }\n\n this.compose();\n }\n\n paintImageXObject(objId) {\n if (!this.contentVisible) {\n return;\n }\n\n const imgData = this.getObject(objId);\n\n if (!imgData) {\n (0, _util.warn)(\"Dependent image isn't ready yet\");\n return;\n }\n\n this.paintInlineImageXObject(imgData);\n }\n\n paintImageXObjectRepeat(objId, scaleX, scaleY, positions) {\n if (!this.contentVisible) {\n return;\n }\n\n const imgData = this.getObject(objId);\n\n if (!imgData) {\n (0, _util.warn)(\"Dependent image isn't ready yet\");\n return;\n }\n\n const width = imgData.width;\n const height = imgData.height;\n const map = [];\n\n for (let i = 0, ii = positions.length; i < ii; i += 2) {\n map.push({\n transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]],\n x: 0,\n y: 0,\n w: width,\n h: height\n });\n }\n\n this.paintInlineImageXObjectGroup(imgData, map);\n }\n\n paintInlineImageXObject(imgData) {\n if (!this.contentVisible) {\n return;\n }\n\n const width = imgData.width;\n const height = imgData.height;\n const ctx = this.ctx;\n this.save();\n ctx.scale(1 / width, -1 / height);\n let imgToPaint;\n\n if (typeof HTMLElement === \"function\" && imgData instanceof HTMLElement || !imgData.data) {\n imgToPaint = imgData;\n } else {\n const tmpCanvas = this.cachedCanvases.getCanvas(\"inlineImage\", width, height);\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData, this.current.transferMaps);\n imgToPaint = tmpCanvas.canvas;\n }\n\n const scaled = this._scaleImage(imgToPaint, (0, _display_utils.getCurrentTransformInverse)(ctx));\n\n ctx.imageSmoothingEnabled = getImageSmoothingEnabled((0, _display_utils.getCurrentTransform)(ctx), imgData.interpolate);\n const [rWidth, rHeight] = drawImageAtIntegerCoords(ctx, scaled.img, 0, 0, scaled.paintWidth, scaled.paintHeight, 0, -height, width, height);\n\n if (this.imageLayer) {\n const [left, top] = _util.Util.applyTransform([0, -height], (0, _display_utils.getCurrentTransform)(this.ctx));\n\n this.imageLayer.appendImage({\n imgData,\n left,\n top,\n width: rWidth,\n height: rHeight\n });\n }\n\n this.compose();\n this.restore();\n }\n\n paintInlineImageXObjectGroup(imgData, map) {\n if (!this.contentVisible) {\n return;\n }\n\n const ctx = this.ctx;\n const w = imgData.width;\n const h = imgData.height;\n const tmpCanvas = this.cachedCanvases.getCanvas(\"inlineImage\", w, h);\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData, this.current.transferMaps);\n\n for (const entry of map) {\n ctx.save();\n ctx.transform(...entry.transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(ctx, tmpCanvas.canvas, entry.x, entry.y, entry.w, entry.h, 0, -1, 1, 1);\n\n if (this.imageLayer) {\n const [left, top] = _util.Util.applyTransform([entry.x, entry.y], (0, _display_utils.getCurrentTransform)(this.ctx));\n\n this.imageLayer.appendImage({\n imgData,\n left,\n top,\n width: w,\n height: h\n });\n }\n\n ctx.restore();\n }\n\n this.compose();\n }\n\n paintSolidColorImageMask() {\n if (!this.contentVisible) {\n return;\n }\n\n this.ctx.fillRect(0, 0, 1, 1);\n this.compose();\n }\n\n markPoint(tag) {}\n\n markPointProps(tag, properties) {}\n\n beginMarkedContent(tag) {\n this.markedContentStack.push({\n visible: true\n });\n }\n\n beginMarkedContentProps(tag, properties) {\n if (tag === \"OC\") {\n this.markedContentStack.push({\n visible: this.optionalContentConfig.isVisible(properties)\n });\n } else {\n this.markedContentStack.push({\n visible: true\n });\n }\n\n this.contentVisible = this.isContentVisible();\n }\n\n endMarkedContent() {\n this.markedContentStack.pop();\n this.contentVisible = this.isContentVisible();\n }\n\n beginCompat() {}\n\n endCompat() {}\n\n consumePath(clipBox) {\n const isEmpty = this.current.isEmptyClip();\n\n if (this.pendingClip) {\n this.current.updateClipFromPath();\n }\n\n if (!this.pendingClip) {\n this.compose(clipBox);\n }\n\n const ctx = this.ctx;\n\n if (this.pendingClip) {\n if (!isEmpty) {\n if (this.pendingClip === EO_CLIP) {\n ctx.clip(\"evenodd\");\n } else {\n ctx.clip();\n }\n }\n\n this.pendingClip = null;\n }\n\n this.current.startNewPathAndClipBox(this.current.clipBox);\n ctx.beginPath();\n }\n\n getSinglePixelWidth() {\n if (!this._cachedGetSinglePixelWidth) {\n const m = (0, _display_utils.getCurrentTransform)(this.ctx);\n\n if (m[1] === 0 && m[2] === 0) {\n this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(m[0]), Math.abs(m[3]));\n } else {\n const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]);\n const normX = Math.hypot(m[0], m[2]);\n const normY = Math.hypot(m[1], m[3]);\n this._cachedGetSinglePixelWidth = Math.max(normX, normY) / absDet;\n }\n }\n\n return this._cachedGetSinglePixelWidth;\n }\n\n getScaleForStroking() {\n if (!this._cachedScaleForStroking) {\n const {\n lineWidth\n } = this.current;\n const m = (0, _display_utils.getCurrentTransform)(this.ctx);\n let scaleX, scaleY;\n\n if (m[1] === 0 && m[2] === 0) {\n const normX = Math.abs(m[0]);\n const normY = Math.abs(m[3]);\n\n if (lineWidth === 0) {\n scaleX = 1 / normX;\n scaleY = 1 / normY;\n } else {\n const scaledXLineWidth = normX * lineWidth;\n const scaledYLineWidth = normY * lineWidth;\n scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1;\n scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1;\n }\n } else {\n const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]);\n const normX = Math.hypot(m[0], m[1]);\n const normY = Math.hypot(m[2], m[3]);\n\n if (lineWidth === 0) {\n scaleX = normY / absDet;\n scaleY = normX / absDet;\n } else {\n const baseArea = lineWidth * absDet;\n scaleX = normY > baseArea ? normY / baseArea : 1;\n scaleY = normX > baseArea ? normX / baseArea : 1;\n }\n }\n\n this._cachedScaleForStroking = [scaleX, scaleY];\n }\n\n return this._cachedScaleForStroking;\n }\n\n rescaleAndStroke(saveRestore) {\n const {\n ctx\n } = this;\n const {\n lineWidth\n } = this.current;\n const [scaleX, scaleY] = this.getScaleForStroking();\n ctx.lineWidth = lineWidth || 1;\n\n if (scaleX === 1 && scaleY === 1) {\n ctx.stroke();\n return;\n }\n\n let savedMatrix, savedDashes, savedDashOffset;\n\n if (saveRestore) {\n savedMatrix = (0, _display_utils.getCurrentTransform)(ctx);\n savedDashes = ctx.getLineDash().slice();\n savedDashOffset = ctx.lineDashOffset;\n }\n\n ctx.scale(scaleX, scaleY);\n const scale = Math.max(scaleX, scaleY);\n ctx.setLineDash(ctx.getLineDash().map(x => x / scale));\n ctx.lineDashOffset /= scale;\n ctx.stroke();\n\n if (saveRestore) {\n ctx.setTransform(...savedMatrix);\n ctx.setLineDash(savedDashes);\n ctx.lineDashOffset = savedDashOffset;\n }\n }\n\n isContentVisible() {\n for (let i = this.markedContentStack.length - 1; i >= 0; i--) {\n if (!this.markedContentStack[i].visible) {\n return false;\n }\n }\n\n return true;\n }\n\n}\n\nexports.CanvasGraphics = CanvasGraphics;\n\nfor (const op in _util.OPS) {\n if (CanvasGraphics.prototype[op] !== undefined) {\n CanvasGraphics.prototype[_util.OPS[op]] = CanvasGraphics.prototype[op];\n }\n}\n\n/***/ }),\n/* 13 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.TilingPattern = exports.PathType = void 0;\nexports.getShadingPattern = getShadingPattern;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _display_utils = __w_pdfjs_require__(8);\n\nvar _is_node = __w_pdfjs_require__(3);\n\nconst PathType = {\n FILL: \"Fill\",\n STROKE: \"Stroke\",\n SHADING: \"Shading\"\n};\nexports.PathType = PathType;\n\nfunction applyBoundingBox(ctx, bbox) {\n if (!bbox || _is_node.isNodeJS) {\n return;\n }\n\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n const region = new Path2D();\n region.rect(bbox[0], bbox[1], width, height);\n ctx.clip(region);\n}\n\nclass BaseShadingPattern {\n constructor() {\n if (this.constructor === BaseShadingPattern) {\n (0, _util.unreachable)(\"Cannot initialize BaseShadingPattern.\");\n }\n }\n\n getPattern() {\n (0, _util.unreachable)(\"Abstract method `getPattern` called.\");\n }\n\n}\n\nclass RadialAxialShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._type = IR[1];\n this._bbox = IR[2];\n this._colorStops = IR[3];\n this._p0 = IR[4];\n this._p1 = IR[5];\n this._r0 = IR[6];\n this._r1 = IR[7];\n this.matrix = null;\n }\n\n _createGradient(ctx) {\n let grad;\n\n if (this._type === \"axial\") {\n grad = ctx.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]);\n } else if (this._type === \"radial\") {\n grad = ctx.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1);\n }\n\n for (const colorStop of this._colorStops) {\n grad.addColorStop(colorStop[0], colorStop[1]);\n }\n\n return grad;\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n let pattern;\n\n if (pathType === PathType.STROKE || pathType === PathType.FILL) {\n const ownerBBox = owner.current.getClippedPathBoundingBox(pathType, (0, _display_utils.getCurrentTransform)(ctx)) || [0, 0, 0, 0];\n const width = Math.ceil(ownerBBox[2] - ownerBBox[0]) || 1;\n const height = Math.ceil(ownerBBox[3] - ownerBBox[1]) || 1;\n const tmpCanvas = owner.cachedCanvases.getCanvas(\"pattern\", width, height, true);\n const tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n tmpCtx.beginPath();\n tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n tmpCtx.translate(-ownerBBox[0], -ownerBBox[1]);\n inverse = _util.Util.transform(inverse, [1, 0, 0, 1, ownerBBox[0], ownerBBox[1]]);\n tmpCtx.transform(...owner.baseTransform);\n\n if (this.matrix) {\n tmpCtx.transform(...this.matrix);\n }\n\n applyBoundingBox(tmpCtx, this._bbox);\n tmpCtx.fillStyle = this._createGradient(tmpCtx);\n tmpCtx.fill();\n pattern = ctx.createPattern(tmpCanvas.canvas, \"no-repeat\");\n const domMatrix = new DOMMatrix(inverse);\n\n try {\n pattern.setTransform(domMatrix);\n } catch (ex) {\n (0, _util.warn)(`RadialAxialShadingPattern.getPattern: \"${ex?.message}\".`);\n }\n } else {\n applyBoundingBox(ctx, this._bbox);\n pattern = this._createGradient(ctx);\n }\n\n return pattern;\n }\n\n}\n\nfunction drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {\n const coords = context.coords,\n colors = context.colors;\n const bytes = data.data,\n rowSize = data.width * 4;\n let tmp;\n\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n\n if (coords[p2 + 1] > coords[p3 + 1]) {\n tmp = p2;\n p2 = p3;\n p3 = tmp;\n tmp = c2;\n c2 = c3;\n c3 = tmp;\n }\n\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n\n const x1 = (coords[p1] + context.offsetX) * context.scaleX;\n const y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY;\n const x2 = (coords[p2] + context.offsetX) * context.scaleX;\n const y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY;\n const x3 = (coords[p3] + context.offsetX) * context.scaleX;\n const y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY;\n\n if (y1 >= y3) {\n return;\n }\n\n const c1r = colors[c1],\n c1g = colors[c1 + 1],\n c1b = colors[c1 + 2];\n const c2r = colors[c2],\n c2g = colors[c2 + 1],\n c2b = colors[c2 + 2];\n const c3r = colors[c3],\n c3g = colors[c3 + 1],\n c3b = colors[c3 + 2];\n const minY = Math.round(y1),\n maxY = Math.round(y3);\n let xa, car, cag, cab;\n let xb, cbr, cbg, cbb;\n\n for (let y = minY; y <= maxY; y++) {\n if (y < y2) {\n let k;\n\n if (y < y1) {\n k = 0;\n } else {\n k = (y1 - y) / (y1 - y2);\n }\n\n xa = x1 - (x1 - x2) * k;\n car = c1r - (c1r - c2r) * k;\n cag = c1g - (c1g - c2g) * k;\n cab = c1b - (c1b - c2b) * k;\n } else {\n let k;\n\n if (y > y3) {\n k = 1;\n } else if (y2 === y3) {\n k = 0;\n } else {\n k = (y2 - y) / (y2 - y3);\n }\n\n xa = x2 - (x2 - x3) * k;\n car = c2r - (c2r - c3r) * k;\n cag = c2g - (c2g - c3g) * k;\n cab = c2b - (c2b - c3b) * k;\n }\n\n let k;\n\n if (y < y1) {\n k = 0;\n } else if (y > y3) {\n k = 1;\n } else {\n k = (y1 - y) / (y1 - y3);\n }\n\n xb = x1 - (x1 - x3) * k;\n cbr = c1r - (c1r - c3r) * k;\n cbg = c1g - (c1g - c3g) * k;\n cbb = c1b - (c1b - c3b) * k;\n const x1_ = Math.round(Math.min(xa, xb));\n const x2_ = Math.round(Math.max(xa, xb));\n let j = rowSize * y + x1_ * 4;\n\n for (let x = x1_; x <= x2_; x++) {\n k = (xa - x) / (xa - xb);\n\n if (k < 0) {\n k = 0;\n } else if (k > 1) {\n k = 1;\n }\n\n bytes[j++] = car - (car - cbr) * k | 0;\n bytes[j++] = cag - (cag - cbg) * k | 0;\n bytes[j++] = cab - (cab - cbb) * k | 0;\n bytes[j++] = 255;\n }\n }\n}\n\nfunction drawFigure(data, figure, context) {\n const ps = figure.coords;\n const cs = figure.colors;\n let i, ii;\n\n switch (figure.type) {\n case \"lattice\":\n const verticesPerRow = figure.verticesPerRow;\n const rows = Math.floor(ps.length / verticesPerRow) - 1;\n const cols = verticesPerRow - 1;\n\n for (i = 0; i < rows; i++) {\n let q = i * verticesPerRow;\n\n for (let j = 0; j < cols; j++, q++) {\n drawTriangle(data, context, ps[q], ps[q + 1], ps[q + verticesPerRow], cs[q], cs[q + 1], cs[q + verticesPerRow]);\n drawTriangle(data, context, ps[q + verticesPerRow + 1], ps[q + 1], ps[q + verticesPerRow], cs[q + verticesPerRow + 1], cs[q + 1], cs[q + verticesPerRow]);\n }\n }\n\n break;\n\n case \"triangles\":\n for (i = 0, ii = ps.length; i < ii; i += 3) {\n drawTriangle(data, context, ps[i], ps[i + 1], ps[i + 2], cs[i], cs[i + 1], cs[i + 2]);\n }\n\n break;\n\n default:\n throw new Error(\"illegal figure\");\n }\n}\n\nclass MeshShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._coords = IR[2];\n this._colors = IR[3];\n this._figures = IR[4];\n this._bounds = IR[5];\n this._bbox = IR[7];\n this._background = IR[8];\n this.matrix = null;\n }\n\n _createMeshCanvas(combinedScale, backgroundColor, cachedCanvases) {\n const EXPECTED_SCALE = 1.1;\n const MAX_PATTERN_SIZE = 3000;\n const BORDER_SIZE = 2;\n const offsetX = Math.floor(this._bounds[0]);\n const offsetY = Math.floor(this._bounds[1]);\n const boundsWidth = Math.ceil(this._bounds[2]) - offsetX;\n const boundsHeight = Math.ceil(this._bounds[3]) - offsetY;\n const width = Math.min(Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)), MAX_PATTERN_SIZE);\n const height = Math.min(Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)), MAX_PATTERN_SIZE);\n const scaleX = boundsWidth / width;\n const scaleY = boundsHeight / height;\n const context = {\n coords: this._coords,\n colors: this._colors,\n offsetX: -offsetX,\n offsetY: -offsetY,\n scaleX: 1 / scaleX,\n scaleY: 1 / scaleY\n };\n const paddedWidth = width + BORDER_SIZE * 2;\n const paddedHeight = height + BORDER_SIZE * 2;\n const tmpCanvas = cachedCanvases.getCanvas(\"mesh\", paddedWidth, paddedHeight, false);\n const tmpCtx = tmpCanvas.context;\n const data = tmpCtx.createImageData(width, height);\n\n if (backgroundColor) {\n const bytes = data.data;\n\n for (let i = 0, ii = bytes.length; i < ii; i += 4) {\n bytes[i] = backgroundColor[0];\n bytes[i + 1] = backgroundColor[1];\n bytes[i + 2] = backgroundColor[2];\n bytes[i + 3] = 255;\n }\n }\n\n for (const figure of this._figures) {\n drawFigure(data, figure, context);\n }\n\n tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE);\n const canvas = tmpCanvas.canvas;\n return {\n canvas,\n offsetX: offsetX - BORDER_SIZE * scaleX,\n offsetY: offsetY - BORDER_SIZE * scaleY,\n scaleX,\n scaleY\n };\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n applyBoundingBox(ctx, this._bbox);\n let scale;\n\n if (pathType === PathType.SHADING) {\n scale = _util.Util.singularValueDecompose2dScale((0, _display_utils.getCurrentTransform)(ctx));\n } else {\n scale = _util.Util.singularValueDecompose2dScale(owner.baseTransform);\n\n if (this.matrix) {\n const matrixScale = _util.Util.singularValueDecompose2dScale(this.matrix);\n\n scale = [scale[0] * matrixScale[0], scale[1] * matrixScale[1]];\n }\n }\n\n const temporaryPatternCanvas = this._createMeshCanvas(scale, pathType === PathType.SHADING ? null : this._background, owner.cachedCanvases);\n\n if (pathType !== PathType.SHADING) {\n ctx.setTransform(...owner.baseTransform);\n\n if (this.matrix) {\n ctx.transform(...this.matrix);\n }\n }\n\n ctx.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY);\n ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY);\n return ctx.createPattern(temporaryPatternCanvas.canvas, \"no-repeat\");\n }\n\n}\n\nclass DummyShadingPattern extends BaseShadingPattern {\n getPattern() {\n return \"hotpink\";\n }\n\n}\n\nfunction getShadingPattern(IR) {\n switch (IR[0]) {\n case \"RadialAxial\":\n return new RadialAxialShadingPattern(IR);\n\n case \"Mesh\":\n return new MeshShadingPattern(IR);\n\n case \"Dummy\":\n return new DummyShadingPattern();\n }\n\n throw new Error(`Unknown IR type: ${IR[0]}`);\n}\n\nconst PaintType = {\n COLORED: 1,\n UNCOLORED: 2\n};\n\nclass TilingPattern {\n static get MAX_PATTERN_SIZE() {\n return (0, _util.shadow)(this, \"MAX_PATTERN_SIZE\", 3000);\n }\n\n constructor(IR, color, ctx, canvasGraphicsFactory, baseTransform) {\n this.operatorList = IR[2];\n this.matrix = IR[3] || [1, 0, 0, 1, 0, 0];\n this.bbox = IR[4];\n this.xstep = IR[5];\n this.ystep = IR[6];\n this.paintType = IR[7];\n this.tilingType = IR[8];\n this.color = color;\n this.ctx = ctx;\n this.canvasGraphicsFactory = canvasGraphicsFactory;\n this.baseTransform = baseTransform;\n }\n\n createPatternCanvas(owner) {\n const operatorList = this.operatorList;\n const bbox = this.bbox;\n const xstep = this.xstep;\n const ystep = this.ystep;\n const paintType = this.paintType;\n const tilingType = this.tilingType;\n const color = this.color;\n const canvasGraphicsFactory = this.canvasGraphicsFactory;\n (0, _util.info)(\"TilingType: \" + tilingType);\n const x0 = bbox[0],\n y0 = bbox[1],\n x1 = bbox[2],\n y1 = bbox[3];\n\n const matrixScale = _util.Util.singularValueDecompose2dScale(this.matrix);\n\n const curMatrixScale = _util.Util.singularValueDecompose2dScale(this.baseTransform);\n\n const combinedScale = [matrixScale[0] * curMatrixScale[0], matrixScale[1] * curMatrixScale[1]];\n const dimx = this.getSizeAndScale(xstep, this.ctx.canvas.width, combinedScale[0]);\n const dimy = this.getSizeAndScale(ystep, this.ctx.canvas.height, combinedScale[1]);\n const tmpCanvas = owner.cachedCanvases.getCanvas(\"pattern\", dimx.size, dimy.size, true);\n const tmpCtx = tmpCanvas.context;\n const graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx);\n graphics.groupLevel = owner.groupLevel;\n this.setFillAndStrokeStyleToContext(graphics, paintType, color);\n let adjustedX0 = x0;\n let adjustedY0 = y0;\n let adjustedX1 = x1;\n let adjustedY1 = y1;\n\n if (x0 < 0) {\n adjustedX0 = 0;\n adjustedX1 += Math.abs(x0);\n }\n\n if (y0 < 0) {\n adjustedY0 = 0;\n adjustedY1 += Math.abs(y0);\n }\n\n tmpCtx.translate(-(dimx.scale * adjustedX0), -(dimy.scale * adjustedY0));\n graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0);\n tmpCtx.save();\n this.clipBbox(graphics, adjustedX0, adjustedY0, adjustedX1, adjustedY1);\n graphics.baseTransform = (0, _display_utils.getCurrentTransform)(graphics.ctx);\n graphics.executeOperatorList(operatorList);\n graphics.endDrawing();\n return {\n canvas: tmpCanvas.canvas,\n scaleX: dimx.scale,\n scaleY: dimy.scale,\n offsetX: adjustedX0,\n offsetY: adjustedY0\n };\n }\n\n getSizeAndScale(step, realOutputSize, scale) {\n step = Math.abs(step);\n const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize);\n let size = Math.ceil(step * scale);\n\n if (size >= maxSize) {\n size = maxSize;\n } else {\n scale = size / step;\n }\n\n return {\n scale,\n size\n };\n }\n\n clipBbox(graphics, x0, y0, x1, y1) {\n const bboxWidth = x1 - x0;\n const bboxHeight = y1 - y0;\n graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight);\n graphics.current.updateRectMinMax((0, _display_utils.getCurrentTransform)(graphics.ctx), [x0, y0, x1, y1]);\n graphics.clip();\n graphics.endPath();\n }\n\n setFillAndStrokeStyleToContext(graphics, paintType, color) {\n const context = graphics.ctx,\n current = graphics.current;\n\n switch (paintType) {\n case PaintType.COLORED:\n const ctx = this.ctx;\n context.fillStyle = ctx.fillStyle;\n context.strokeStyle = ctx.strokeStyle;\n current.fillColor = ctx.fillStyle;\n current.strokeColor = ctx.strokeStyle;\n break;\n\n case PaintType.UNCOLORED:\n const cssColor = _util.Util.makeHexColor(color[0], color[1], color[2]);\n\n context.fillStyle = cssColor;\n context.strokeStyle = cssColor;\n current.fillColor = cssColor;\n current.strokeColor = cssColor;\n break;\n\n default:\n throw new _util.FormatError(`Unsupported paint type: ${paintType}`);\n }\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n let matrix = inverse;\n\n if (pathType !== PathType.SHADING) {\n matrix = _util.Util.transform(matrix, owner.baseTransform);\n\n if (this.matrix) {\n matrix = _util.Util.transform(matrix, this.matrix);\n }\n }\n\n const temporaryPatternCanvas = this.createPatternCanvas(owner);\n let domMatrix = new DOMMatrix(matrix);\n domMatrix = domMatrix.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY);\n domMatrix = domMatrix.scale(1 / temporaryPatternCanvas.scaleX, 1 / temporaryPatternCanvas.scaleY);\n const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, \"repeat\");\n\n try {\n pattern.setTransform(domMatrix);\n } catch (ex) {\n (0, _util.warn)(`TilingPattern.getPattern: \"${ex?.message}\".`);\n }\n\n return pattern;\n }\n\n}\n\nexports.TilingPattern = TilingPattern;\n\n/***/ }),\n/* 14 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.applyMaskImageData = applyMaskImageData;\n\nvar _util = __w_pdfjs_require__(1);\n\nfunction applyMaskImageData({\n src,\n srcPos = 0,\n dest,\n destPos = 0,\n width,\n height,\n inverseDecode = false\n}) {\n const opaque = _util.FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n const [zeroMapping, oneMapping] = !inverseDecode ? [opaque, 0] : [0, opaque];\n const widthInSource = width >> 3;\n const widthRemainder = width & 7;\n const srcLength = src.length;\n dest = new Uint32Array(dest.buffer);\n\n for (let i = 0; i < height; i++) {\n for (const max = srcPos + widthInSource; srcPos < max; srcPos++) {\n const elem = srcPos < srcLength ? src[srcPos] : 255;\n dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping;\n }\n\n if (widthRemainder === 0) {\n continue;\n }\n\n const elem = srcPos < srcLength ? src[srcPos++] : 255;\n\n for (let j = 0; j < widthRemainder; j++) {\n dest[destPos++] = elem & 1 << 7 - j ? oneMapping : zeroMapping;\n }\n }\n\n return {\n srcPos,\n destPos\n };\n}\n\n/***/ }),\n/* 15 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.GlobalWorkerOptions = void 0;\nconst GlobalWorkerOptions = Object.create(null);\nexports.GlobalWorkerOptions = GlobalWorkerOptions;\nGlobalWorkerOptions.workerPort = GlobalWorkerOptions.workerPort === undefined ? null : GlobalWorkerOptions.workerPort;\nGlobalWorkerOptions.workerSrc = GlobalWorkerOptions.workerSrc === undefined ? \"\" : GlobalWorkerOptions.workerSrc;\n\n/***/ }),\n/* 16 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.MessageHandler = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nconst CallbackKind = {\n UNKNOWN: 0,\n DATA: 1,\n ERROR: 2\n};\nconst StreamKind = {\n UNKNOWN: 0,\n CANCEL: 1,\n CANCEL_COMPLETE: 2,\n CLOSE: 3,\n ENQUEUE: 4,\n ERROR: 5,\n PULL: 6,\n PULL_COMPLETE: 7,\n START_COMPLETE: 8\n};\n\nfunction wrapReason(reason) {\n if (!(reason instanceof Error || typeof reason === \"object\" && reason !== null)) {\n (0, _util.unreachable)('wrapReason: Expected \"reason\" to be a (possibly cloned) Error.');\n }\n\n switch (reason.name) {\n case \"AbortException\":\n return new _util.AbortException(reason.message);\n\n case \"MissingPDFException\":\n return new _util.MissingPDFException(reason.message);\n\n case \"PasswordException\":\n return new _util.PasswordException(reason.message, reason.code);\n\n case \"UnexpectedResponseException\":\n return new _util.UnexpectedResponseException(reason.message, reason.status);\n\n case \"UnknownErrorException\":\n return new _util.UnknownErrorException(reason.message, reason.details);\n\n default:\n return new _util.UnknownErrorException(reason.message, reason.toString());\n }\n}\n\nclass MessageHandler {\n constructor(sourceName, targetName, comObj) {\n this.sourceName = sourceName;\n this.targetName = targetName;\n this.comObj = comObj;\n this.callbackId = 1;\n this.streamId = 1;\n this.streamSinks = Object.create(null);\n this.streamControllers = Object.create(null);\n this.callbackCapabilities = Object.create(null);\n this.actionHandler = Object.create(null);\n\n this._onComObjOnMessage = event => {\n const data = event.data;\n\n if (data.targetName !== this.sourceName) {\n return;\n }\n\n if (data.stream) {\n this._processStreamMessage(data);\n\n return;\n }\n\n if (data.callback) {\n const callbackId = data.callbackId;\n const capability = this.callbackCapabilities[callbackId];\n\n if (!capability) {\n throw new Error(`Cannot resolve callback ${callbackId}`);\n }\n\n delete this.callbackCapabilities[callbackId];\n\n if (data.callback === CallbackKind.DATA) {\n capability.resolve(data.data);\n } else if (data.callback === CallbackKind.ERROR) {\n capability.reject(wrapReason(data.reason));\n } else {\n throw new Error(\"Unexpected callback case\");\n }\n\n return;\n }\n\n const action = this.actionHandler[data.action];\n\n if (!action) {\n throw new Error(`Unknown action from worker: ${data.action}`);\n }\n\n if (data.callbackId) {\n const cbSourceName = this.sourceName;\n const cbTargetName = data.sourceName;\n new Promise(function (resolve) {\n resolve(action(data.data));\n }).then(function (result) {\n comObj.postMessage({\n sourceName: cbSourceName,\n targetName: cbTargetName,\n callback: CallbackKind.DATA,\n callbackId: data.callbackId,\n data: result\n });\n }, function (reason) {\n comObj.postMessage({\n sourceName: cbSourceName,\n targetName: cbTargetName,\n callback: CallbackKind.ERROR,\n callbackId: data.callbackId,\n reason: wrapReason(reason)\n });\n });\n return;\n }\n\n if (data.streamId) {\n this._createStreamSink(data);\n\n return;\n }\n\n action(data.data);\n };\n\n comObj.addEventListener(\"message\", this._onComObjOnMessage);\n }\n\n on(actionName, handler) {\n const ah = this.actionHandler;\n\n if (ah[actionName]) {\n throw new Error(`There is already an actionName called \"${actionName}\"`);\n }\n\n ah[actionName] = handler;\n }\n\n send(actionName, data, transfers) {\n this.comObj.postMessage({\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n data\n }, transfers);\n }\n\n sendWithPromise(actionName, data, transfers) {\n const callbackId = this.callbackId++;\n const capability = (0, _util.createPromiseCapability)();\n this.callbackCapabilities[callbackId] = capability;\n\n try {\n this.comObj.postMessage({\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n callbackId,\n data\n }, transfers);\n } catch (ex) {\n capability.reject(ex);\n }\n\n return capability.promise;\n }\n\n sendWithStream(actionName, data, queueingStrategy, transfers) {\n const streamId = this.streamId++,\n sourceName = this.sourceName,\n targetName = this.targetName,\n comObj = this.comObj;\n return new ReadableStream({\n start: controller => {\n const startCapability = (0, _util.createPromiseCapability)();\n this.streamControllers[streamId] = {\n controller,\n startCall: startCapability,\n pullCall: null,\n cancelCall: null,\n isClosed: false\n };\n comObj.postMessage({\n sourceName,\n targetName,\n action: actionName,\n streamId,\n data,\n desiredSize: controller.desiredSize\n }, transfers);\n return startCapability.promise;\n },\n pull: controller => {\n const pullCapability = (0, _util.createPromiseCapability)();\n this.streamControllers[streamId].pullCall = pullCapability;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL,\n streamId,\n desiredSize: controller.desiredSize\n });\n return pullCapability.promise;\n },\n cancel: reason => {\n (0, _util.assert)(reason instanceof Error, \"cancel must have a valid reason\");\n const cancelCapability = (0, _util.createPromiseCapability)();\n this.streamControllers[streamId].cancelCall = cancelCapability;\n this.streamControllers[streamId].isClosed = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL,\n streamId,\n reason: wrapReason(reason)\n });\n return cancelCapability.promise;\n }\n }, queueingStrategy);\n }\n\n _createStreamSink(data) {\n const streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n const self = this,\n action = this.actionHandler[data.action];\n const streamSink = {\n enqueue(chunk, size = 1, transfers) {\n if (this.isCancelled) {\n return;\n }\n\n const lastDesiredSize = this.desiredSize;\n this.desiredSize -= size;\n\n if (lastDesiredSize > 0 && this.desiredSize <= 0) {\n this.sinkCapability = (0, _util.createPromiseCapability)();\n this.ready = this.sinkCapability.promise;\n }\n\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.ENQUEUE,\n streamId,\n chunk\n }, transfers);\n },\n\n close() {\n if (this.isCancelled) {\n return;\n }\n\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CLOSE,\n streamId\n });\n delete self.streamSinks[streamId];\n },\n\n error(reason) {\n (0, _util.assert)(reason instanceof Error, \"error must have a valid reason\");\n\n if (this.isCancelled) {\n return;\n }\n\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.ERROR,\n streamId,\n reason: wrapReason(reason)\n });\n },\n\n sinkCapability: (0, _util.createPromiseCapability)(),\n onPull: null,\n onCancel: null,\n isCancelled: false,\n desiredSize: data.desiredSize,\n ready: null\n };\n streamSink.sinkCapability.resolve();\n streamSink.ready = streamSink.sinkCapability.promise;\n this.streamSinks[streamId] = streamSink;\n new Promise(function (resolve) {\n resolve(action(data.data, streamSink));\n }).then(function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n success: true\n });\n }, function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n reason: wrapReason(reason)\n });\n });\n }\n\n _processStreamMessage(data) {\n const streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n const streamController = this.streamControllers[streamId],\n streamSink = this.streamSinks[streamId];\n\n switch (data.stream) {\n case StreamKind.START_COMPLETE:\n if (data.success) {\n streamController.startCall.resolve();\n } else {\n streamController.startCall.reject(wrapReason(data.reason));\n }\n\n break;\n\n case StreamKind.PULL_COMPLETE:\n if (data.success) {\n streamController.pullCall.resolve();\n } else {\n streamController.pullCall.reject(wrapReason(data.reason));\n }\n\n break;\n\n case StreamKind.PULL:\n if (!streamSink) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n success: true\n });\n break;\n }\n\n if (streamSink.desiredSize <= 0 && data.desiredSize > 0) {\n streamSink.sinkCapability.resolve();\n }\n\n streamSink.desiredSize = data.desiredSize;\n new Promise(function (resolve) {\n resolve(streamSink.onPull && streamSink.onPull());\n }).then(function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n success: true\n });\n }, function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n reason: wrapReason(reason)\n });\n });\n break;\n\n case StreamKind.ENQUEUE:\n (0, _util.assert)(streamController, \"enqueue should have stream controller\");\n\n if (streamController.isClosed) {\n break;\n }\n\n streamController.controller.enqueue(data.chunk);\n break;\n\n case StreamKind.CLOSE:\n (0, _util.assert)(streamController, \"close should have stream controller\");\n\n if (streamController.isClosed) {\n break;\n }\n\n streamController.isClosed = true;\n streamController.controller.close();\n\n this._deleteStreamController(streamController, streamId);\n\n break;\n\n case StreamKind.ERROR:\n (0, _util.assert)(streamController, \"error should have stream controller\");\n streamController.controller.error(wrapReason(data.reason));\n\n this._deleteStreamController(streamController, streamId);\n\n break;\n\n case StreamKind.CANCEL_COMPLETE:\n if (data.success) {\n streamController.cancelCall.resolve();\n } else {\n streamController.cancelCall.reject(wrapReason(data.reason));\n }\n\n this._deleteStreamController(streamController, streamId);\n\n break;\n\n case StreamKind.CANCEL:\n if (!streamSink) {\n break;\n }\n\n new Promise(function (resolve) {\n resolve(streamSink.onCancel && streamSink.onCancel(wrapReason(data.reason)));\n }).then(function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId,\n success: true\n });\n }, function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId,\n reason: wrapReason(reason)\n });\n });\n streamSink.sinkCapability.reject(wrapReason(data.reason));\n streamSink.isCancelled = true;\n delete this.streamSinks[streamId];\n break;\n\n default:\n throw new Error(\"Unexpected stream case\");\n }\n }\n\n async _deleteStreamController(streamController, streamId) {\n await Promise.allSettled([streamController.startCall && streamController.startCall.promise, streamController.pullCall && streamController.pullCall.promise, streamController.cancelCall && streamController.cancelCall.promise]);\n delete this.streamControllers[streamId];\n }\n\n destroy() {\n this.comObj.removeEventListener(\"message\", this._onComObjOnMessage);\n }\n\n}\n\nexports.MessageHandler = MessageHandler;\n\n/***/ }),\n/* 17 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.Metadata = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nclass Metadata {\n #metadataMap;\n #data;\n\n constructor({\n parsedData,\n rawData\n }) {\n this.#metadataMap = parsedData;\n this.#data = rawData;\n }\n\n getRaw() {\n return this.#data;\n }\n\n get(name) {\n return this.#metadataMap.get(name) ?? null;\n }\n\n getAll() {\n return (0, _util.objectFromMap)(this.#metadataMap);\n }\n\n has(name) {\n return this.#metadataMap.has(name);\n }\n\n}\n\nexports.Metadata = Metadata;\n\n/***/ }),\n/* 18 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.OptionalContentConfig = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nconst INTERNAL = Symbol(\"INTERNAL\");\n\nclass OptionalContentGroup {\n #visible = true;\n\n constructor(name, intent) {\n this.name = name;\n this.intent = intent;\n }\n\n get visible() {\n return this.#visible;\n }\n\n _setVisible(internal, visible) {\n if (internal !== INTERNAL) {\n (0, _util.unreachable)(\"Internal method `_setVisible` called.\");\n }\n\n this.#visible = visible;\n }\n\n}\n\nclass OptionalContentConfig {\n #cachedHasInitialVisibility = true;\n #groups = new Map();\n #initialVisibility = null;\n #order = null;\n\n constructor(data) {\n this.name = null;\n this.creator = null;\n\n if (data === null) {\n return;\n }\n\n this.name = data.name;\n this.creator = data.creator;\n this.#order = data.order;\n\n for (const group of data.groups) {\n this.#groups.set(group.id, new OptionalContentGroup(group.name, group.intent));\n }\n\n if (data.baseState === \"OFF\") {\n for (const group of this.#groups.values()) {\n group._setVisible(INTERNAL, false);\n }\n }\n\n for (const on of data.on) {\n this.#groups.get(on)._setVisible(INTERNAL, true);\n }\n\n for (const off of data.off) {\n this.#groups.get(off)._setVisible(INTERNAL, false);\n }\n\n this.#initialVisibility = new Map();\n\n for (const [id, group] of this.#groups) {\n this.#initialVisibility.set(id, group.visible);\n }\n }\n\n #evaluateVisibilityExpression(array) {\n const length = array.length;\n\n if (length < 2) {\n return true;\n }\n\n const operator = array[0];\n\n for (let i = 1; i < length; i++) {\n const element = array[i];\n let state;\n\n if (Array.isArray(element)) {\n state = this.#evaluateVisibilityExpression(element);\n } else if (this.#groups.has(element)) {\n state = this.#groups.get(element).visible;\n } else {\n (0, _util.warn)(`Optional content group not found: ${element}`);\n return true;\n }\n\n switch (operator) {\n case \"And\":\n if (!state) {\n return false;\n }\n\n break;\n\n case \"Or\":\n if (state) {\n return true;\n }\n\n break;\n\n case \"Not\":\n return !state;\n\n default:\n return true;\n }\n }\n\n return operator === \"And\";\n }\n\n isVisible(group) {\n if (this.#groups.size === 0) {\n return true;\n }\n\n if (!group) {\n (0, _util.warn)(\"Optional content group not defined.\");\n return true;\n }\n\n if (group.type === \"OCG\") {\n if (!this.#groups.has(group.id)) {\n (0, _util.warn)(`Optional content group not found: ${group.id}`);\n return true;\n }\n\n return this.#groups.get(group.id).visible;\n } else if (group.type === \"OCMD\") {\n if (group.expression) {\n return this.#evaluateVisibilityExpression(group.expression);\n }\n\n if (!group.policy || group.policy === \"AnyOn\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n (0, _util.warn)(`Optional content group not found: ${id}`);\n return true;\n }\n\n if (this.#groups.get(id).visible) {\n return true;\n }\n }\n\n return false;\n } else if (group.policy === \"AllOn\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n (0, _util.warn)(`Optional content group not found: ${id}`);\n return true;\n }\n\n if (!this.#groups.get(id).visible) {\n return false;\n }\n }\n\n return true;\n } else if (group.policy === \"AnyOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n (0, _util.warn)(`Optional content group not found: ${id}`);\n return true;\n }\n\n if (!this.#groups.get(id).visible) {\n return true;\n }\n }\n\n return false;\n } else if (group.policy === \"AllOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n (0, _util.warn)(`Optional content group not found: ${id}`);\n return true;\n }\n\n if (this.#groups.get(id).visible) {\n return false;\n }\n }\n\n return true;\n }\n\n (0, _util.warn)(`Unknown optional content policy ${group.policy}.`);\n return true;\n }\n\n (0, _util.warn)(`Unknown group type ${group.type}.`);\n return true;\n }\n\n setVisibility(id, visible = true) {\n if (!this.#groups.has(id)) {\n (0, _util.warn)(`Optional content group not found: ${id}`);\n return;\n }\n\n this.#groups.get(id)._setVisible(INTERNAL, !!visible);\n\n this.#cachedHasInitialVisibility = null;\n }\n\n get hasInitialVisibility() {\n if (this.#cachedHasInitialVisibility !== null) {\n return this.#cachedHasInitialVisibility;\n }\n\n for (const [id, group] of this.#groups) {\n const visible = this.#initialVisibility.get(id);\n\n if (group.visible !== visible) {\n return this.#cachedHasInitialVisibility = false;\n }\n }\n\n return this.#cachedHasInitialVisibility = true;\n }\n\n getOrder() {\n if (!this.#groups.size) {\n return null;\n }\n\n if (this.#order) {\n return this.#order.slice();\n }\n\n return [...this.#groups.keys()];\n }\n\n getGroups() {\n return this.#groups.size > 0 ? (0, _util.objectFromMap)(this.#groups) : null;\n }\n\n getGroup(id) {\n return this.#groups.get(id) || null;\n }\n\n}\n\nexports.OptionalContentConfig = OptionalContentConfig;\n\n/***/ }),\n/* 19 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFDataTransportStream = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _display_utils = __w_pdfjs_require__(8);\n\nclass PDFDataTransportStream {\n constructor(params, pdfDataRangeTransport) {\n (0, _util.assert)(pdfDataRangeTransport, 'PDFDataTransportStream - missing required \"pdfDataRangeTransport\" argument.');\n this._queuedChunks = [];\n this._progressiveDone = params.progressiveDone || false;\n this._contentDispositionFilename = params.contentDispositionFilename || null;\n const initialData = params.initialData;\n\n if (initialData?.length > 0) {\n const buffer = new Uint8Array(initialData).buffer;\n\n this._queuedChunks.push(buffer);\n }\n\n this._pdfDataRangeTransport = pdfDataRangeTransport;\n this._isStreamingSupported = !params.disableStream;\n this._isRangeSupported = !params.disableRange;\n this._contentLength = params.length;\n this._fullRequestReader = null;\n this._rangeReaders = [];\n\n this._pdfDataRangeTransport.addRangeListener((begin, chunk) => {\n this._onReceiveData({\n begin,\n chunk\n });\n });\n\n this._pdfDataRangeTransport.addProgressListener((loaded, total) => {\n this._onProgress({\n loaded,\n total\n });\n });\n\n this._pdfDataRangeTransport.addProgressiveReadListener(chunk => {\n this._onReceiveData({\n chunk\n });\n });\n\n this._pdfDataRangeTransport.addProgressiveDoneListener(() => {\n this._onProgressiveDone();\n });\n\n this._pdfDataRangeTransport.transportReady();\n }\n\n _onReceiveData(args) {\n const buffer = new Uint8Array(args.chunk).buffer;\n\n if (args.begin === undefined) {\n if (this._fullRequestReader) {\n this._fullRequestReader._enqueue(buffer);\n } else {\n this._queuedChunks.push(buffer);\n }\n } else {\n const found = this._rangeReaders.some(function (rangeReader) {\n if (rangeReader._begin !== args.begin) {\n return false;\n }\n\n rangeReader._enqueue(buffer);\n\n return true;\n });\n\n (0, _util.assert)(found, \"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.\");\n }\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n _onProgress(evt) {\n if (evt.total === undefined) {\n const firstReader = this._rangeReaders[0];\n\n if (firstReader?.onProgress) {\n firstReader.onProgress({\n loaded: evt.loaded\n });\n }\n } else {\n const fullReader = this._fullRequestReader;\n\n if (fullReader?.onProgress) {\n fullReader.onProgress({\n loaded: evt.loaded,\n total: evt.total\n });\n }\n }\n }\n\n _onProgressiveDone() {\n if (this._fullRequestReader) {\n this._fullRequestReader.progressiveDone();\n }\n\n this._progressiveDone = true;\n }\n\n _removeRangeReader(reader) {\n const i = this._rangeReaders.indexOf(reader);\n\n if (i >= 0) {\n this._rangeReaders.splice(i, 1);\n }\n }\n\n getFullReader() {\n (0, _util.assert)(!this._fullRequestReader, \"PDFDataTransportStream.getFullReader can only be called once.\");\n const queuedChunks = this._queuedChunks;\n this._queuedChunks = null;\n return new PDFDataTransportStreamReader(this, queuedChunks, this._progressiveDone, this._contentDispositionFilename);\n }\n\n getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n\n const reader = new PDFDataTransportStreamRangeReader(this, begin, end);\n\n this._pdfDataRangeTransport.requestDataRange(begin, end);\n\n this._rangeReaders.push(reader);\n\n return reader;\n }\n\n cancelAllRequests(reason) {\n if (this._fullRequestReader) {\n this._fullRequestReader.cancel(reason);\n }\n\n for (const reader of this._rangeReaders.slice(0)) {\n reader.cancel(reason);\n }\n\n this._pdfDataRangeTransport.abort();\n }\n\n}\n\nexports.PDFDataTransportStream = PDFDataTransportStream;\n\nclass PDFDataTransportStreamReader {\n constructor(stream, queuedChunks, progressiveDone = false, contentDispositionFilename = null) {\n this._stream = stream;\n this._done = progressiveDone || false;\n this._filename = (0, _display_utils.isPdfFile)(contentDispositionFilename) ? contentDispositionFilename : null;\n this._queuedChunks = queuedChunks || [];\n this._loaded = 0;\n\n for (const chunk of this._queuedChunks) {\n this._loaded += chunk.byteLength;\n }\n\n this._requests = [];\n this._headersReady = Promise.resolve();\n stream._fullRequestReader = this;\n this.onProgress = null;\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return;\n }\n\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n\n requestCapability.resolve({\n value: chunk,\n done: false\n });\n } else {\n this._queuedChunks.push(chunk);\n }\n\n this._loaded += chunk.byteLength;\n }\n\n get headersReady() {\n return this._headersReady;\n }\n\n get filename() {\n return this._filename;\n }\n\n get isRangeSupported() {\n return this._stream._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._stream._isStreamingSupported;\n }\n\n get contentLength() {\n return this._stream._contentLength;\n }\n\n async read() {\n if (this._queuedChunks.length > 0) {\n const chunk = this._queuedChunks.shift();\n\n return {\n value: chunk,\n done: false\n };\n }\n\n if (this._done) {\n return {\n value: undefined,\n done: true\n };\n }\n\n const requestCapability = (0, _util.createPromiseCapability)();\n\n this._requests.push(requestCapability);\n\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n\n for (const requestCapability of this._requests) {\n requestCapability.resolve({\n value: undefined,\n done: true\n });\n }\n\n this._requests.length = 0;\n }\n\n progressiveDone() {\n if (this._done) {\n return;\n }\n\n this._done = true;\n }\n\n}\n\nclass PDFDataTransportStreamRangeReader {\n constructor(stream, begin, end) {\n this._stream = stream;\n this._begin = begin;\n this._end = end;\n this._queuedChunk = null;\n this._requests = [];\n this._done = false;\n this.onProgress = null;\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return;\n }\n\n if (this._requests.length === 0) {\n this._queuedChunk = chunk;\n } else {\n const requestsCapability = this._requests.shift();\n\n requestsCapability.resolve({\n value: chunk,\n done: false\n });\n\n for (const requestCapability of this._requests) {\n requestCapability.resolve({\n value: undefined,\n done: true\n });\n }\n\n this._requests.length = 0;\n }\n\n this._done = true;\n\n this._stream._removeRangeReader(this);\n }\n\n get isStreamingSupported() {\n return false;\n }\n\n async read() {\n if (this._queuedChunk) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return {\n value: chunk,\n done: false\n };\n }\n\n if (this._done) {\n return {\n value: undefined,\n done: true\n };\n }\n\n const requestCapability = (0, _util.createPromiseCapability)();\n\n this._requests.push(requestCapability);\n\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n\n for (const requestCapability of this._requests) {\n requestCapability.resolve({\n value: undefined,\n done: true\n });\n }\n\n this._requests.length = 0;\n\n this._stream._removeRangeReader(this);\n }\n\n}\n\n/***/ }),\n/* 20 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.XfaText = void 0;\n\nclass XfaText {\n static textContent(xfa) {\n const items = [];\n const output = {\n items,\n styles: Object.create(null)\n };\n\n function walk(node) {\n if (!node) {\n return;\n }\n\n let str = null;\n const name = node.name;\n\n if (name === \"#text\") {\n str = node.value;\n } else if (!XfaText.shouldBuildText(name)) {\n return;\n } else if (node?.attributes?.textContent) {\n str = node.attributes.textContent;\n } else if (node.value) {\n str = node.value;\n }\n\n if (str !== null) {\n items.push({\n str\n });\n }\n\n if (!node.children) {\n return;\n }\n\n for (const child of node.children) {\n walk(child);\n }\n }\n\n walk(xfa);\n return output;\n }\n\n static shouldBuildText(name) {\n return !(name === \"textarea\" || name === \"input\" || name === \"option\" || name === \"select\");\n }\n\n}\n\nexports.XfaText = XfaText;\n\n/***/ }),\n/* 21 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.NodeStandardFontDataFactory = exports.NodeCanvasFactory = exports.NodeCMapReaderFactory = void 0;\n\nvar _base_factory = __w_pdfjs_require__(9);\n\n;\n\nconst fetchData = function (url) {\n return new Promise((resolve, reject) => {\n const fs = require(\"fs\");\n\n fs.readFile(url, (error, data) => {\n if (error || !data) {\n reject(new Error(error));\n return;\n }\n\n resolve(new Uint8Array(data));\n });\n });\n};\n\nclass NodeCanvasFactory extends _base_factory.BaseCanvasFactory {\n _createCanvas(width, height) {\n const Canvas = require(\"canvas\");\n\n return Canvas.createCanvas(width, height);\n }\n\n}\n\nexports.NodeCanvasFactory = NodeCanvasFactory;\n\nclass NodeCMapReaderFactory extends _base_factory.BaseCMapReaderFactory {\n _fetchData(url, compressionType) {\n return fetchData(url).then(data => {\n return {\n cMapData: data,\n compressionType\n };\n });\n }\n\n}\n\nexports.NodeCMapReaderFactory = NodeCMapReaderFactory;\n\nclass NodeStandardFontDataFactory extends _base_factory.BaseStandardFontDataFactory {\n _fetchData(url) {\n return fetchData(url);\n }\n\n}\n\nexports.NodeStandardFontDataFactory = NodeStandardFontDataFactory;\n\n/***/ }),\n/* 22 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.AnnotationEditorLayer = void 0;\n\nvar _tools = __w_pdfjs_require__(7);\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _freetext = __w_pdfjs_require__(23);\n\nvar _ink = __w_pdfjs_require__(24);\n\nclass AnnotationEditorLayer {\n #accessibilityManager;\n #allowClick = false;\n #boundPointerup = this.pointerup.bind(this);\n #boundPointerdown = this.pointerdown.bind(this);\n #editors = new Map();\n #hadPointerDown = false;\n #isCleaningUp = false;\n #uiManager;\n static _initialized = false;\n\n constructor(options) {\n if (!AnnotationEditorLayer._initialized) {\n AnnotationEditorLayer._initialized = true;\n\n _freetext.FreeTextEditor.initialize(options.l10n);\n\n _ink.InkEditor.initialize(options.l10n);\n\n options.uiManager.registerEditorTypes([_freetext.FreeTextEditor, _ink.InkEditor]);\n }\n\n this.#uiManager = options.uiManager;\n this.annotationStorage = options.annotationStorage;\n this.pageIndex = options.pageIndex;\n this.div = options.div;\n this.#accessibilityManager = options.accessibilityManager;\n this.#uiManager.addLayer(this);\n }\n\n updateToolbar(mode) {\n this.#uiManager.updateToolbar(mode);\n }\n\n updateMode(mode = this.#uiManager.getMode()) {\n this.#cleanup();\n\n if (mode === _util.AnnotationEditorType.INK) {\n this.addInkEditorIfNeeded(false);\n this.disableClick();\n } else {\n this.enableClick();\n }\n\n this.#uiManager.unselectAll();\n }\n\n addInkEditorIfNeeded(isCommitting) {\n if (!isCommitting && this.#uiManager.getMode() !== _util.AnnotationEditorType.INK) {\n return;\n }\n\n if (!isCommitting) {\n for (const editor of this.#editors.values()) {\n if (editor.isEmpty()) {\n editor.setInBackground();\n return;\n }\n }\n }\n\n const editor = this.#createAndAddNewEditor({\n offsetX: 0,\n offsetY: 0\n });\n editor.setInBackground();\n }\n\n setEditingState(isEditing) {\n this.#uiManager.setEditingState(isEditing);\n }\n\n addCommands(params) {\n this.#uiManager.addCommands(params);\n }\n\n enable() {\n this.div.style.pointerEvents = \"auto\";\n\n for (const editor of this.#editors.values()) {\n editor.enableEditing();\n }\n }\n\n disable() {\n this.div.style.pointerEvents = \"none\";\n\n for (const editor of this.#editors.values()) {\n editor.disableEditing();\n }\n }\n\n setActiveEditor(editor) {\n const currentActive = this.#uiManager.getActive();\n\n if (currentActive === editor) {\n return;\n }\n\n this.#uiManager.setActiveEditor(editor);\n }\n\n enableClick() {\n this.div.addEventListener(\"pointerdown\", this.#boundPointerdown);\n this.div.addEventListener(\"pointerup\", this.#boundPointerup);\n }\n\n disableClick() {\n this.div.removeEventListener(\"pointerdown\", this.#boundPointerdown);\n this.div.removeEventListener(\"pointerup\", this.#boundPointerup);\n }\n\n attach(editor) {\n this.#editors.set(editor.id, editor);\n }\n\n detach(editor) {\n this.#editors.delete(editor.id);\n this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv);\n }\n\n remove(editor) {\n this.#uiManager.removeEditor(editor);\n this.detach(editor);\n this.annotationStorage.remove(editor.id);\n editor.div.style.display = \"none\";\n setTimeout(() => {\n editor.div.style.display = \"\";\n editor.div.remove();\n editor.isAttachedToDOM = false;\n\n if (document.activeElement === document.body) {\n this.#uiManager.focusMainContainer();\n }\n }, 0);\n\n if (!this.#isCleaningUp) {\n this.addInkEditorIfNeeded(false);\n }\n }\n\n #changeParent(editor) {\n if (editor.parent === this) {\n return;\n }\n\n this.attach(editor);\n editor.pageIndex = this.pageIndex;\n editor.parent?.detach(editor);\n editor.parent = this;\n\n if (editor.div && editor.isAttachedToDOM) {\n editor.div.remove();\n this.div.append(editor.div);\n }\n }\n\n add(editor) {\n this.#changeParent(editor);\n this.#uiManager.addEditor(editor);\n this.attach(editor);\n\n if (!editor.isAttachedToDOM) {\n const div = editor.render();\n this.div.append(div);\n editor.isAttachedToDOM = true;\n }\n\n this.moveEditorInDOM(editor);\n editor.onceAdded();\n this.addToAnnotationStorage(editor);\n }\n\n moveEditorInDOM(editor) {\n this.#accessibilityManager?.moveElementInDOM(this.div, editor.div, editor.contentDiv, true);\n }\n\n addToAnnotationStorage(editor) {\n if (!editor.isEmpty() && !this.annotationStorage.has(editor.id)) {\n this.annotationStorage.setValue(editor.id, editor);\n }\n }\n\n addOrRebuild(editor) {\n if (editor.needsToBeRebuilt()) {\n editor.rebuild();\n } else {\n this.add(editor);\n }\n }\n\n addANewEditor(editor) {\n const cmd = () => {\n this.addOrRebuild(editor);\n };\n\n const undo = () => {\n editor.remove();\n };\n\n this.addCommands({\n cmd,\n undo,\n mustExec: true\n });\n }\n\n addUndoableEditor(editor) {\n const cmd = () => {\n this.addOrRebuild(editor);\n };\n\n const undo = () => {\n editor.remove();\n };\n\n this.addCommands({\n cmd,\n undo,\n mustExec: false\n });\n }\n\n getNextId() {\n return this.#uiManager.getId();\n }\n\n #createNewEditor(params) {\n switch (this.#uiManager.getMode()) {\n case _util.AnnotationEditorType.FREETEXT:\n return new _freetext.FreeTextEditor(params);\n\n case _util.AnnotationEditorType.INK:\n return new _ink.InkEditor(params);\n }\n\n return null;\n }\n\n deserialize(data) {\n switch (data.annotationType) {\n case _util.AnnotationEditorType.FREETEXT:\n return _freetext.FreeTextEditor.deserialize(data, this);\n\n case _util.AnnotationEditorType.INK:\n return _ink.InkEditor.deserialize(data, this);\n }\n\n return null;\n }\n\n #createAndAddNewEditor(event) {\n const id = this.getNextId();\n const editor = this.#createNewEditor({\n parent: this,\n id,\n x: event.offsetX,\n y: event.offsetY\n });\n\n if (editor) {\n this.add(editor);\n }\n\n return editor;\n }\n\n setSelected(editor) {\n this.#uiManager.setSelected(editor);\n }\n\n toggleSelected(editor) {\n this.#uiManager.toggleSelected(editor);\n }\n\n isSelected(editor) {\n return this.#uiManager.isSelected(editor);\n }\n\n unselect(editor) {\n this.#uiManager.unselect(editor);\n }\n\n pointerup(event) {\n const isMac = _tools.KeyboardManager.platform.isMac;\n\n if (event.button !== 0 || event.ctrlKey && isMac) {\n return;\n }\n\n if (event.target !== this.div) {\n return;\n }\n\n if (!this.#hadPointerDown) {\n return;\n }\n\n this.#hadPointerDown = false;\n\n if (!this.#allowClick) {\n this.#allowClick = true;\n return;\n }\n\n this.#createAndAddNewEditor(event);\n }\n\n pointerdown(event) {\n const isMac = _tools.KeyboardManager.platform.isMac;\n\n if (event.button !== 0 || event.ctrlKey && isMac) {\n return;\n }\n\n if (event.target !== this.div) {\n return;\n }\n\n this.#hadPointerDown = true;\n const editor = this.#uiManager.getActive();\n this.#allowClick = !editor || editor.isEmpty();\n }\n\n drop(event) {\n const id = event.dataTransfer.getData(\"text/plain\");\n const editor = this.#uiManager.getEditor(id);\n\n if (!editor) {\n return;\n }\n\n event.preventDefault();\n event.dataTransfer.dropEffect = \"move\";\n this.#changeParent(editor);\n const rect = this.div.getBoundingClientRect();\n const endX = event.clientX - rect.x;\n const endY = event.clientY - rect.y;\n editor.translate(endX - editor.startX, endY - editor.startY);\n this.moveEditorInDOM(editor);\n editor.div.focus();\n }\n\n dragover(event) {\n event.preventDefault();\n }\n\n destroy() {\n if (this.#uiManager.getActive()?.parent === this) {\n this.#uiManager.setActiveEditor(null);\n }\n\n for (const editor of this.#editors.values()) {\n this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv);\n editor.isAttachedToDOM = false;\n editor.div.remove();\n editor.parent = null;\n }\n\n this.div = null;\n this.#editors.clear();\n this.#uiManager.removeLayer(this);\n }\n\n #cleanup() {\n this.#isCleaningUp = true;\n\n for (const editor of this.#editors.values()) {\n if (editor.isEmpty()) {\n editor.remove();\n }\n }\n\n this.#isCleaningUp = false;\n }\n\n render(parameters) {\n this.viewport = parameters.viewport;\n (0, _tools.bindEvents)(this, this.div, [\"dragover\", \"drop\"]);\n this.setDimensions();\n\n for (const editor of this.#uiManager.getEditors(this.pageIndex)) {\n this.add(editor);\n }\n\n this.updateMode();\n }\n\n update(parameters) {\n this.viewport = parameters.viewport;\n this.setDimensions();\n this.updateMode();\n }\n\n get scaleFactor() {\n return this.viewport.scale;\n }\n\n get pageDimensions() {\n const [pageLLx, pageLLy, pageURx, pageURy] = this.viewport.viewBox;\n const width = pageURx - pageLLx;\n const height = pageURy - pageLLy;\n return [width, height];\n }\n\n get viewportBaseDimensions() {\n const {\n width,\n height,\n rotation\n } = this.viewport;\n return rotation % 180 === 0 ? [width, height] : [height, width];\n }\n\n setDimensions() {\n const {\n width,\n height,\n rotation\n } = this.viewport;\n const flipOrientation = rotation % 180 !== 0,\n widthStr = Math.floor(width) + \"px\",\n heightStr = Math.floor(height) + \"px\";\n this.div.style.width = flipOrientation ? heightStr : widthStr;\n this.div.style.height = flipOrientation ? widthStr : heightStr;\n this.div.setAttribute(\"data-main-rotation\", rotation);\n }\n\n}\n\nexports.AnnotationEditorLayer = AnnotationEditorLayer;\n\n/***/ }),\n/* 23 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.FreeTextEditor = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _tools = __w_pdfjs_require__(7);\n\nvar _editor = __w_pdfjs_require__(6);\n\nclass FreeTextEditor extends _editor.AnnotationEditor {\n #boundEditorDivBlur = this.editorDivBlur.bind(this);\n #boundEditorDivFocus = this.editorDivFocus.bind(this);\n #boundEditorDivKeydown = this.editorDivKeydown.bind(this);\n #color;\n #content = \"\";\n #hasAlreadyBeenCommitted = false;\n #fontSize;\n static _freeTextDefaultContent = \"\";\n static _l10nPromise;\n static _internalPadding = 0;\n static _defaultColor = null;\n static _defaultFontSize = 10;\n static _keyboardManager = new _tools.KeyboardManager([[[\"ctrl+Enter\", \"mac+meta+Enter\", \"Escape\", \"mac+Escape\"], FreeTextEditor.prototype.commitOrRemove]]);\n static _type = \"freetext\";\n\n constructor(params) {\n super({ ...params,\n name: \"freeTextEditor\"\n });\n this.#color = params.color || FreeTextEditor._defaultColor || _editor.AnnotationEditor._defaultLineColor;\n this.#fontSize = params.fontSize || FreeTextEditor._defaultFontSize;\n }\n\n static initialize(l10n) {\n this._l10nPromise = new Map([\"free_text_default_content\", \"editor_free_text_aria_label\"].map(str => [str, l10n.get(str)]));\n const style = getComputedStyle(document.documentElement);\n this._internalPadding = parseFloat(style.getPropertyValue(\"--freetext-padding\"));\n }\n\n static updateDefaultParams(type, value) {\n switch (type) {\n case _util.AnnotationEditorParamsType.FREETEXT_SIZE:\n FreeTextEditor._defaultFontSize = value;\n break;\n\n case _util.AnnotationEditorParamsType.FREETEXT_COLOR:\n FreeTextEditor._defaultColor = value;\n break;\n }\n }\n\n updateParams(type, value) {\n switch (type) {\n case _util.AnnotationEditorParamsType.FREETEXT_SIZE:\n this.#updateFontSize(value);\n break;\n\n case _util.AnnotationEditorParamsType.FREETEXT_COLOR:\n this.#updateColor(value);\n break;\n }\n }\n\n static get defaultPropertiesToUpdate() {\n return [[_util.AnnotationEditorParamsType.FREETEXT_SIZE, FreeTextEditor._defaultFontSize], [_util.AnnotationEditorParamsType.FREETEXT_COLOR, FreeTextEditor._defaultColor || _editor.AnnotationEditor._defaultLineColor]];\n }\n\n get propertiesToUpdate() {\n return [[_util.AnnotationEditorParamsType.FREETEXT_SIZE, this.#fontSize], [_util.AnnotationEditorParamsType.FREETEXT_COLOR, this.#color]];\n }\n\n #updateFontSize(fontSize) {\n const setFontsize = size => {\n this.editorDiv.style.fontSize = `calc(${size}px * var(--scale-factor))`;\n this.translate(0, -(size - this.#fontSize) * this.parent.scaleFactor);\n this.#fontSize = size;\n this.#setEditorDimensions();\n };\n\n const savedFontsize = this.#fontSize;\n this.parent.addCommands({\n cmd: () => {\n setFontsize(fontSize);\n },\n undo: () => {\n setFontsize(savedFontsize);\n },\n mustExec: true,\n type: _util.AnnotationEditorParamsType.FREETEXT_SIZE,\n overwriteIfSameType: true,\n keepUndo: true\n });\n }\n\n #updateColor(color) {\n const savedColor = this.#color;\n this.parent.addCommands({\n cmd: () => {\n this.#color = color;\n this.editorDiv.style.color = color;\n },\n undo: () => {\n this.#color = savedColor;\n this.editorDiv.style.color = savedColor;\n },\n mustExec: true,\n type: _util.AnnotationEditorParamsType.FREETEXT_COLOR,\n overwriteIfSameType: true,\n keepUndo: true\n });\n }\n\n getInitialTranslation() {\n return [-FreeTextEditor._internalPadding * this.parent.scaleFactor, -(FreeTextEditor._internalPadding + this.#fontSize) * this.parent.scaleFactor];\n }\n\n rebuild() {\n super.rebuild();\n\n if (this.div === null) {\n return;\n }\n\n if (!this.isAttachedToDOM) {\n this.parent.add(this);\n }\n }\n\n enableEditMode() {\n if (this.isInEditMode()) {\n return;\n }\n\n this.parent.setEditingState(false);\n this.parent.updateToolbar(_util.AnnotationEditorType.FREETEXT);\n super.enableEditMode();\n this.enableEditing();\n this.overlayDiv.classList.remove(\"enabled\");\n this.editorDiv.contentEditable = true;\n this.div.draggable = false;\n this.editorDiv.addEventListener(\"keydown\", this.#boundEditorDivKeydown);\n this.editorDiv.addEventListener(\"focus\", this.#boundEditorDivFocus);\n this.editorDiv.addEventListener(\"blur\", this.#boundEditorDivBlur);\n }\n\n disableEditMode() {\n if (!this.isInEditMode()) {\n return;\n }\n\n this.parent.setEditingState(true);\n super.disableEditMode();\n this.disableEditing();\n this.overlayDiv.classList.add(\"enabled\");\n this.editorDiv.contentEditable = false;\n this.div.draggable = true;\n this.editorDiv.removeEventListener(\"keydown\", this.#boundEditorDivKeydown);\n this.editorDiv.removeEventListener(\"focus\", this.#boundEditorDivFocus);\n this.editorDiv.removeEventListener(\"blur\", this.#boundEditorDivBlur);\n this.div.focus();\n this.isEditing = false;\n }\n\n focusin(event) {\n super.focusin(event);\n\n if (event.target !== this.editorDiv) {\n this.editorDiv.focus();\n }\n }\n\n onceAdded() {\n if (this.width) {\n return;\n }\n\n this.enableEditMode();\n this.editorDiv.focus();\n }\n\n isEmpty() {\n return !this.editorDiv || this.editorDiv.innerText.trim() === \"\";\n }\n\n remove() {\n this.isEditing = false;\n this.parent.setEditingState(true);\n super.remove();\n }\n\n #extractText() {\n const divs = this.editorDiv.getElementsByTagName(\"div\");\n\n if (divs.length === 0) {\n return this.editorDiv.innerText;\n }\n\n const buffer = [];\n\n for (let i = 0, ii = divs.length; i < ii; i++) {\n const div = divs[i];\n const first = div.firstChild;\n\n if (first?.nodeName === \"#text\") {\n buffer.push(first.data);\n } else {\n buffer.push(\"\");\n }\n }\n\n return buffer.join(\"\\n\");\n }\n\n #setEditorDimensions() {\n const [parentWidth, parentHeight] = this.parent.viewportBaseDimensions;\n const rect = this.div.getBoundingClientRect();\n this.width = rect.width / parentWidth;\n this.height = rect.height / parentHeight;\n }\n\n commit() {\n super.commit();\n\n if (!this.#hasAlreadyBeenCommitted) {\n this.#hasAlreadyBeenCommitted = true;\n this.parent.addUndoableEditor(this);\n }\n\n this.disableEditMode();\n this.#content = this.#extractText().trimEnd();\n this.#setEditorDimensions();\n }\n\n shouldGetKeyboardEvents() {\n return this.isInEditMode();\n }\n\n dblclick(event) {\n this.enableEditMode();\n this.editorDiv.focus();\n }\n\n keydown(event) {\n if (event.target === this.div && event.key === \"Enter\") {\n this.enableEditMode();\n this.editorDiv.focus();\n }\n }\n\n editorDivKeydown(event) {\n FreeTextEditor._keyboardManager.exec(this, event);\n }\n\n editorDivFocus(event) {\n this.isEditing = true;\n }\n\n editorDivBlur(event) {\n this.isEditing = false;\n }\n\n disableEditing() {\n this.editorDiv.setAttribute(\"role\", \"comment\");\n this.editorDiv.removeAttribute(\"aria-multiline\");\n }\n\n enableEditing() {\n this.editorDiv.setAttribute(\"role\", \"textbox\");\n this.editorDiv.setAttribute(\"aria-multiline\", true);\n }\n\n render() {\n if (this.div) {\n return this.div;\n }\n\n let baseX, baseY;\n\n if (this.width) {\n baseX = this.x;\n baseY = this.y;\n }\n\n super.render();\n this.editorDiv = document.createElement(\"div\");\n this.editorDiv.className = \"internal\";\n this.editorDiv.setAttribute(\"id\", `${this.id}-editor`);\n this.enableEditing();\n\n FreeTextEditor._l10nPromise.get(\"editor_free_text_aria_label\").then(msg => this.editorDiv?.setAttribute(\"aria-label\", msg));\n\n FreeTextEditor._l10nPromise.get(\"free_text_default_content\").then(msg => this.editorDiv?.setAttribute(\"default-content\", msg));\n\n this.editorDiv.contentEditable = true;\n const {\n style\n } = this.editorDiv;\n style.fontSize = `calc(${this.#fontSize}px * var(--scale-factor))`;\n style.color = this.#color;\n this.div.append(this.editorDiv);\n this.overlayDiv = document.createElement(\"div\");\n this.overlayDiv.classList.add(\"overlay\", \"enabled\");\n this.div.append(this.overlayDiv);\n (0, _tools.bindEvents)(this, this.div, [\"dblclick\", \"keydown\"]);\n\n if (this.width) {\n const [parentWidth, parentHeight] = this.parent.viewportBaseDimensions;\n this.setAt(baseX * parentWidth, baseY * parentHeight, this.width * parentWidth, this.height * parentHeight);\n\n for (const line of this.#content.split(\"\\n\")) {\n const div = document.createElement(\"div\");\n div.append(line ? document.createTextNode(line) : document.createElement(\"br\"));\n this.editorDiv.append(div);\n }\n\n this.div.draggable = true;\n this.editorDiv.contentEditable = false;\n } else {\n this.div.draggable = false;\n this.editorDiv.contentEditable = true;\n }\n\n return this.div;\n }\n\n get contentDiv() {\n return this.editorDiv;\n }\n\n static deserialize(data, parent) {\n const editor = super.deserialize(data, parent);\n editor.#fontSize = data.fontSize;\n editor.#color = _util.Util.makeHexColor(...data.color);\n editor.#content = data.value;\n return editor;\n }\n\n serialize() {\n if (this.isEmpty()) {\n return null;\n }\n\n const padding = FreeTextEditor._internalPadding * this.parent.scaleFactor;\n const rect = this.getRect(padding, padding);\n\n const color = _editor.AnnotationEditor._colorManager.convert(getComputedStyle(this.editorDiv).color);\n\n return {\n annotationType: _util.AnnotationEditorType.FREETEXT,\n color,\n fontSize: this.#fontSize,\n value: this.#content,\n pageIndex: this.parent.pageIndex,\n rect,\n rotation: this.rotation\n };\n }\n\n}\n\nexports.FreeTextEditor = FreeTextEditor;\n\n/***/ }),\n/* 24 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.InkEditor = void 0;\nObject.defineProperty(exports, \"fitCurve\", ({\n enumerable: true,\n get: function () {\n return _pdfjsFitCurve.fitCurve;\n }\n}));\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _editor = __w_pdfjs_require__(6);\n\nvar _pdfjsFitCurve = __w_pdfjs_require__(25);\n\nvar _tools = __w_pdfjs_require__(7);\n\nconst RESIZER_SIZE = 16;\n\nclass InkEditor extends _editor.AnnotationEditor {\n #aspectRatio = 0;\n #baseHeight = 0;\n #baseWidth = 0;\n #boundCanvasPointermove = this.canvasPointermove.bind(this);\n #boundCanvasPointerleave = this.canvasPointerleave.bind(this);\n #boundCanvasPointerup = this.canvasPointerup.bind(this);\n #boundCanvasPointerdown = this.canvasPointerdown.bind(this);\n #disableEditing = false;\n #isCanvasInitialized = false;\n #lastPoint = null;\n #observer = null;\n #realWidth = 0;\n #realHeight = 0;\n #requestFrameCallback = null;\n static _defaultColor = null;\n static _defaultOpacity = 1;\n static _defaultThickness = 1;\n static _l10nPromise;\n static _type = \"ink\";\n\n constructor(params) {\n super({ ...params,\n name: \"inkEditor\"\n });\n this.color = params.color || null;\n this.thickness = params.thickness || null;\n this.opacity = params.opacity || null;\n this.paths = [];\n this.bezierPath2D = [];\n this.currentPath = [];\n this.scaleFactor = 1;\n this.translationX = this.translationY = 0;\n this.x = 0;\n this.y = 0;\n }\n\n static initialize(l10n) {\n this._l10nPromise = new Map([\"editor_ink_canvas_aria_label\", \"editor_ink_aria_label\"].map(str => [str, l10n.get(str)]));\n }\n\n static updateDefaultParams(type, value) {\n switch (type) {\n case _util.AnnotationEditorParamsType.INK_THICKNESS:\n InkEditor._defaultThickness = value;\n break;\n\n case _util.AnnotationEditorParamsType.INK_COLOR:\n InkEditor._defaultColor = value;\n break;\n\n case _util.AnnotationEditorParamsType.INK_OPACITY:\n InkEditor._defaultOpacity = value / 100;\n break;\n }\n }\n\n updateParams(type, value) {\n switch (type) {\n case _util.AnnotationEditorParamsType.INK_THICKNESS:\n this.#updateThickness(value);\n break;\n\n case _util.AnnotationEditorParamsType.INK_COLOR:\n this.#updateColor(value);\n break;\n\n case _util.AnnotationEditorParamsType.INK_OPACITY:\n this.#updateOpacity(value);\n break;\n }\n }\n\n static get defaultPropertiesToUpdate() {\n return [[_util.AnnotationEditorParamsType.INK_THICKNESS, InkEditor._defaultThickness], [_util.AnnotationEditorParamsType.INK_COLOR, InkEditor._defaultColor || _editor.AnnotationEditor._defaultLineColor], [_util.AnnotationEditorParamsType.INK_OPACITY, Math.round(InkEditor._defaultOpacity * 100)]];\n }\n\n get propertiesToUpdate() {\n return [[_util.AnnotationEditorParamsType.INK_THICKNESS, this.thickness || InkEditor._defaultThickness], [_util.AnnotationEditorParamsType.INK_COLOR, this.color || InkEditor._defaultColor || _editor.AnnotationEditor._defaultLineColor], [_util.AnnotationEditorParamsType.INK_OPACITY, Math.round(100 * (this.opacity ?? InkEditor._defaultOpacity))]];\n }\n\n #updateThickness(thickness) {\n const savedThickness = this.thickness;\n this.parent.addCommands({\n cmd: () => {\n this.thickness = thickness;\n this.#fitToContent();\n },\n undo: () => {\n this.thickness = savedThickness;\n this.#fitToContent();\n },\n mustExec: true,\n type: _util.AnnotationEditorParamsType.INK_THICKNESS,\n overwriteIfSameType: true,\n keepUndo: true\n });\n }\n\n #updateColor(color) {\n const savedColor = this.color;\n this.parent.addCommands({\n cmd: () => {\n this.color = color;\n this.#redraw();\n },\n undo: () => {\n this.color = savedColor;\n this.#redraw();\n },\n mustExec: true,\n type: _util.AnnotationEditorParamsType.INK_COLOR,\n overwriteIfSameType: true,\n keepUndo: true\n });\n }\n\n #updateOpacity(opacity) {\n opacity /= 100;\n const savedOpacity = this.opacity;\n this.parent.addCommands({\n cmd: () => {\n this.opacity = opacity;\n this.#redraw();\n },\n undo: () => {\n this.opacity = savedOpacity;\n this.#redraw();\n },\n mustExec: true,\n type: _util.AnnotationEditorParamsType.INK_OPACITY,\n overwriteIfSameType: true,\n keepUndo: true\n });\n }\n\n rebuild() {\n super.rebuild();\n\n if (this.div === null) {\n return;\n }\n\n if (!this.canvas) {\n this.#createCanvas();\n this.#createObserver();\n }\n\n if (!this.isAttachedToDOM) {\n this.parent.add(this);\n this.#setCanvasDims();\n }\n\n this.#fitToContent();\n }\n\n remove() {\n if (this.canvas === null) {\n return;\n }\n\n if (!this.isEmpty()) {\n this.commit();\n }\n\n this.canvas.width = this.canvas.height = 0;\n this.canvas.remove();\n this.canvas = null;\n this.#observer.disconnect();\n this.#observer = null;\n super.remove();\n }\n\n enableEditMode() {\n if (this.#disableEditing || this.canvas === null) {\n return;\n }\n\n super.enableEditMode();\n this.div.draggable = false;\n this.canvas.addEventListener(\"pointerdown\", this.#boundCanvasPointerdown);\n this.canvas.addEventListener(\"pointerup\", this.#boundCanvasPointerup);\n }\n\n disableEditMode() {\n if (!this.isInEditMode() || this.canvas === null) {\n return;\n }\n\n super.disableEditMode();\n this.div.draggable = !this.isEmpty();\n this.div.classList.remove(\"editing\");\n this.canvas.removeEventListener(\"pointerdown\", this.#boundCanvasPointerdown);\n this.canvas.removeEventListener(\"pointerup\", this.#boundCanvasPointerup);\n }\n\n onceAdded() {\n this.div.draggable = !this.isEmpty();\n }\n\n isEmpty() {\n return this.paths.length === 0 || this.paths.length === 1 && this.paths[0].length === 0;\n }\n\n #getInitialBBox() {\n const {\n width,\n height,\n rotation\n } = this.parent.viewport;\n\n switch (rotation) {\n case 90:\n return [0, width, width, height];\n\n case 180:\n return [width, height, width, height];\n\n case 270:\n return [height, 0, width, height];\n\n default:\n return [0, 0, width, height];\n }\n }\n\n #setStroke() {\n this.ctx.lineWidth = this.thickness * this.parent.scaleFactor / this.scaleFactor;\n this.ctx.lineCap = \"round\";\n this.ctx.lineJoin = \"round\";\n this.ctx.miterLimit = 10;\n this.ctx.strokeStyle = `${this.color}${(0, _tools.opacityToHex)(this.opacity)}`;\n }\n\n #startDrawing(x, y) {\n this.isEditing = true;\n\n if (!this.#isCanvasInitialized) {\n this.#isCanvasInitialized = true;\n this.#setCanvasDims();\n this.thickness ||= InkEditor._defaultThickness;\n this.color ||= InkEditor._defaultColor || _editor.AnnotationEditor._defaultLineColor;\n this.opacity ??= InkEditor._defaultOpacity;\n }\n\n this.currentPath.push([x, y]);\n this.#lastPoint = null;\n this.#setStroke();\n this.ctx.beginPath();\n this.ctx.moveTo(x, y);\n\n this.#requestFrameCallback = () => {\n if (!this.#requestFrameCallback) {\n return;\n }\n\n if (this.#lastPoint) {\n if (this.isEmpty()) {\n this.ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n } else {\n this.#redraw();\n }\n\n this.ctx.lineTo(...this.#lastPoint);\n this.#lastPoint = null;\n this.ctx.stroke();\n }\n\n window.requestAnimationFrame(this.#requestFrameCallback);\n };\n\n window.requestAnimationFrame(this.#requestFrameCallback);\n }\n\n #draw(x, y) {\n const [lastX, lastY] = this.currentPath.at(-1);\n\n if (x === lastX && y === lastY) {\n return;\n }\n\n this.currentPath.push([x, y]);\n this.#lastPoint = [x, y];\n }\n\n #stopDrawing(x, y) {\n this.ctx.closePath();\n this.#requestFrameCallback = null;\n x = Math.min(Math.max(x, 0), this.canvas.width);\n y = Math.min(Math.max(y, 0), this.canvas.height);\n const [lastX, lastY] = this.currentPath.at(-1);\n\n if (x !== lastX || y !== lastY) {\n this.currentPath.push([x, y]);\n }\n\n let bezier;\n\n if (this.currentPath.length !== 1) {\n bezier = (0, _pdfjsFitCurve.fitCurve)(this.currentPath, 30, null);\n } else {\n const xy = [x, y];\n bezier = [[xy, xy.slice(), xy.slice(), xy]];\n }\n\n const path2D = InkEditor.#buildPath2D(bezier);\n this.currentPath.length = 0;\n\n const cmd = () => {\n this.paths.push(bezier);\n this.bezierPath2D.push(path2D);\n this.rebuild();\n };\n\n const undo = () => {\n this.paths.pop();\n this.bezierPath2D.pop();\n\n if (this.paths.length === 0) {\n this.remove();\n } else {\n if (!this.canvas) {\n this.#createCanvas();\n this.#createObserver();\n }\n\n this.#fitToContent();\n }\n };\n\n this.parent.addCommands({\n cmd,\n undo,\n mustExec: true\n });\n }\n\n #redraw() {\n if (this.isEmpty()) {\n this.#updateTransform();\n return;\n }\n\n this.#setStroke();\n const {\n canvas,\n ctx\n } = this;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n this.#updateTransform();\n\n for (const path of this.bezierPath2D) {\n ctx.stroke(path);\n }\n }\n\n commit() {\n if (this.#disableEditing) {\n return;\n }\n\n super.commit();\n this.isEditing = false;\n this.disableEditMode();\n this.setInForeground();\n this.#disableEditing = true;\n this.div.classList.add(\"disabled\");\n this.#fitToContent(true);\n this.parent.addInkEditorIfNeeded(true);\n this.parent.moveEditorInDOM(this);\n this.div.focus();\n }\n\n focusin(event) {\n super.focusin(event);\n this.enableEditMode();\n }\n\n canvasPointerdown(event) {\n if (event.button !== 0 || !this.isInEditMode() || this.#disableEditing) {\n return;\n }\n\n this.setInForeground();\n\n if (event.type !== \"mouse\") {\n this.div.focus();\n }\n\n event.stopPropagation();\n this.canvas.addEventListener(\"pointerleave\", this.#boundCanvasPointerleave);\n this.canvas.addEventListener(\"pointermove\", this.#boundCanvasPointermove);\n this.#startDrawing(event.offsetX, event.offsetY);\n }\n\n canvasPointermove(event) {\n event.stopPropagation();\n this.#draw(event.offsetX, event.offsetY);\n }\n\n canvasPointerup(event) {\n if (event.button !== 0) {\n return;\n }\n\n if (this.isInEditMode() && this.currentPath.length !== 0) {\n event.stopPropagation();\n this.#endDrawing(event);\n this.setInBackground();\n }\n }\n\n canvasPointerleave(event) {\n this.#endDrawing(event);\n this.setInBackground();\n }\n\n #endDrawing(event) {\n this.#stopDrawing(event.offsetX, event.offsetY);\n this.canvas.removeEventListener(\"pointerleave\", this.#boundCanvasPointerleave);\n this.canvas.removeEventListener(\"pointermove\", this.#boundCanvasPointermove);\n this.parent.addToAnnotationStorage(this);\n }\n\n #createCanvas() {\n this.canvas = document.createElement(\"canvas\");\n this.canvas.width = this.canvas.height = 0;\n this.canvas.className = \"inkEditorCanvas\";\n\n InkEditor._l10nPromise.get(\"editor_ink_canvas_aria_label\").then(msg => this.canvas?.setAttribute(\"aria-label\", msg));\n\n this.div.append(this.canvas);\n this.ctx = this.canvas.getContext(\"2d\");\n }\n\n #createObserver() {\n this.#observer = new ResizeObserver(entries => {\n const rect = entries[0].contentRect;\n\n if (rect.width && rect.height) {\n this.setDimensions(rect.width, rect.height);\n }\n });\n this.#observer.observe(this.div);\n }\n\n render() {\n if (this.div) {\n return this.div;\n }\n\n let baseX, baseY;\n\n if (this.width) {\n baseX = this.x;\n baseY = this.y;\n }\n\n super.render();\n\n InkEditor._l10nPromise.get(\"editor_ink_aria_label\").then(msg => this.div?.setAttribute(\"aria-label\", msg));\n\n const [x, y, w, h] = this.#getInitialBBox();\n this.setAt(x, y, 0, 0);\n this.setDims(w, h);\n this.#createCanvas();\n\n if (this.width) {\n const [parentWidth, parentHeight] = this.parent.viewportBaseDimensions;\n this.setAt(baseX * parentWidth, baseY * parentHeight, this.width * parentWidth, this.height * parentHeight);\n this.#isCanvasInitialized = true;\n this.#setCanvasDims();\n this.setDims(this.width * parentWidth, this.height * parentHeight);\n this.#redraw();\n this.#setMinDims();\n this.div.classList.add(\"disabled\");\n } else {\n this.div.classList.add(\"editing\");\n this.enableEditMode();\n }\n\n this.#createObserver();\n return this.div;\n }\n\n #setCanvasDims() {\n if (!this.#isCanvasInitialized) {\n return;\n }\n\n const [parentWidth, parentHeight] = this.parent.viewportBaseDimensions;\n this.canvas.width = Math.ceil(this.width * parentWidth);\n this.canvas.height = Math.ceil(this.height * parentHeight);\n this.#updateTransform();\n }\n\n setDimensions(width, height) {\n const roundedWidth = Math.round(width);\n const roundedHeight = Math.round(height);\n\n if (this.#realWidth === roundedWidth && this.#realHeight === roundedHeight) {\n return;\n }\n\n this.#realWidth = roundedWidth;\n this.#realHeight = roundedHeight;\n this.canvas.style.visibility = \"hidden\";\n\n if (this.#aspectRatio && Math.abs(this.#aspectRatio - width / height) > 1e-2) {\n height = Math.ceil(width / this.#aspectRatio);\n this.setDims(width, height);\n }\n\n const [parentWidth, parentHeight] = this.parent.viewportBaseDimensions;\n this.width = width / parentWidth;\n this.height = height / parentHeight;\n\n if (this.#disableEditing) {\n this.#setScaleFactor(width, height);\n }\n\n this.#setCanvasDims();\n this.#redraw();\n this.canvas.style.visibility = \"visible\";\n }\n\n #setScaleFactor(width, height) {\n const padding = this.#getPadding();\n const scaleFactorW = (width - padding) / this.#baseWidth;\n const scaleFactorH = (height - padding) / this.#baseHeight;\n this.scaleFactor = Math.min(scaleFactorW, scaleFactorH);\n }\n\n #updateTransform() {\n const padding = this.#getPadding() / 2;\n this.ctx.setTransform(this.scaleFactor, 0, 0, this.scaleFactor, this.translationX * this.scaleFactor + padding, this.translationY * this.scaleFactor + padding);\n }\n\n static #buildPath2D(bezier) {\n const path2D = new Path2D();\n\n for (let i = 0, ii = bezier.length; i < ii; i++) {\n const [first, control1, control2, second] = bezier[i];\n\n if (i === 0) {\n path2D.moveTo(...first);\n }\n\n path2D.bezierCurveTo(control1[0], control1[1], control2[0], control2[1], second[0], second[1]);\n }\n\n return path2D;\n }\n\n #serializePaths(s, tx, ty, h) {\n const NUMBER_OF_POINTS_ON_BEZIER_CURVE = 4;\n const paths = [];\n const padding = this.thickness / 2;\n let buffer, points;\n\n for (const bezier of this.paths) {\n buffer = [];\n points = [];\n\n for (let i = 0, ii = bezier.length; i < ii; i++) {\n const [first, control1, control2, second] = bezier[i];\n const p10 = s * (first[0] + tx) + padding;\n const p11 = h - s * (first[1] + ty) - padding;\n const p20 = s * (control1[0] + tx) + padding;\n const p21 = h - s * (control1[1] + ty) - padding;\n const p30 = s * (control2[0] + tx) + padding;\n const p31 = h - s * (control2[1] + ty) - padding;\n const p40 = s * (second[0] + tx) + padding;\n const p41 = h - s * (second[1] + ty) - padding;\n\n if (i === 0) {\n buffer.push(p10, p11);\n points.push(p10, p11);\n }\n\n buffer.push(p20, p21, p30, p31, p40, p41);\n this.#extractPointsOnBezier(p10, p11, p20, p21, p30, p31, p40, p41, NUMBER_OF_POINTS_ON_BEZIER_CURVE, points);\n }\n\n paths.push({\n bezier: buffer,\n points\n });\n }\n\n return paths;\n }\n\n #extractPointsOnBezier(p10, p11, p20, p21, p30, p31, p40, p41, n, points) {\n if (this.#isAlmostFlat(p10, p11, p20, p21, p30, p31, p40, p41)) {\n points.push(p40, p41);\n return;\n }\n\n for (let i = 1; i < n - 1; i++) {\n const t = i / n;\n const mt = 1 - t;\n let q10 = t * p10 + mt * p20;\n let q11 = t * p11 + mt * p21;\n let q20 = t * p20 + mt * p30;\n let q21 = t * p21 + mt * p31;\n const q30 = t * p30 + mt * p40;\n const q31 = t * p31 + mt * p41;\n q10 = t * q10 + mt * q20;\n q11 = t * q11 + mt * q21;\n q20 = t * q20 + mt * q30;\n q21 = t * q21 + mt * q31;\n q10 = t * q10 + mt * q20;\n q11 = t * q11 + mt * q21;\n points.push(q10, q11);\n }\n\n points.push(p40, p41);\n }\n\n #isAlmostFlat(p10, p11, p20, p21, p30, p31, p40, p41) {\n const tol = 10;\n const ax = (3 * p20 - 2 * p10 - p40) ** 2;\n const ay = (3 * p21 - 2 * p11 - p41) ** 2;\n const bx = (3 * p30 - p10 - 2 * p40) ** 2;\n const by = (3 * p31 - p11 - 2 * p41) ** 2;\n return Math.max(ax, bx) + Math.max(ay, by) <= tol;\n }\n\n #getBbox() {\n let xMin = Infinity;\n let xMax = -Infinity;\n let yMin = Infinity;\n let yMax = -Infinity;\n\n for (const path of this.paths) {\n for (const [first, control1, control2, second] of path) {\n const bbox = _util.Util.bezierBoundingBox(...first, ...control1, ...control2, ...second);\n\n xMin = Math.min(xMin, bbox[0]);\n yMin = Math.min(yMin, bbox[1]);\n xMax = Math.max(xMax, bbox[2]);\n yMax = Math.max(yMax, bbox[3]);\n }\n }\n\n return [xMin, yMin, xMax, yMax];\n }\n\n #getPadding() {\n return this.#disableEditing ? Math.ceil(this.thickness * this.parent.scaleFactor) : 0;\n }\n\n #fitToContent(firstTime = false) {\n if (this.isEmpty()) {\n return;\n }\n\n if (!this.#disableEditing) {\n this.#redraw();\n return;\n }\n\n const bbox = this.#getBbox();\n const padding = this.#getPadding();\n this.#baseWidth = Math.max(RESIZER_SIZE, bbox[2] - bbox[0]);\n this.#baseHeight = Math.max(RESIZER_SIZE, bbox[3] - bbox[1]);\n const width = Math.ceil(padding + this.#baseWidth * this.scaleFactor);\n const height = Math.ceil(padding + this.#baseHeight * this.scaleFactor);\n const [parentWidth, parentHeight] = this.parent.viewportBaseDimensions;\n this.width = width / parentWidth;\n this.height = height / parentHeight;\n this.#aspectRatio = width / height;\n this.#setMinDims();\n const prevTranslationX = this.translationX;\n const prevTranslationY = this.translationY;\n this.translationX = -bbox[0];\n this.translationY = -bbox[1];\n this.#setCanvasDims();\n this.#redraw();\n this.#realWidth = width;\n this.#realHeight = height;\n this.setDims(width, height);\n const unscaledPadding = firstTime ? padding / this.scaleFactor / 2 : 0;\n this.translate(prevTranslationX - this.translationX - unscaledPadding, prevTranslationY - this.translationY - unscaledPadding);\n }\n\n #setMinDims() {\n const {\n style\n } = this.div;\n\n if (this.#aspectRatio >= 1) {\n style.minHeight = `${RESIZER_SIZE}px`;\n style.minWidth = `${Math.round(this.#aspectRatio * RESIZER_SIZE)}px`;\n } else {\n style.minWidth = `${RESIZER_SIZE}px`;\n style.minHeight = `${Math.round(RESIZER_SIZE / this.#aspectRatio)}px`;\n }\n }\n\n static deserialize(data, parent) {\n const editor = super.deserialize(data, parent);\n editor.thickness = data.thickness;\n editor.color = _util.Util.makeHexColor(...data.color);\n editor.opacity = data.opacity;\n const [pageWidth, pageHeight] = parent.pageDimensions;\n const width = editor.width * pageWidth;\n const height = editor.height * pageHeight;\n const scaleFactor = parent.scaleFactor;\n const padding = data.thickness / 2;\n editor.#aspectRatio = width / height;\n editor.#disableEditing = true;\n editor.#realWidth = Math.round(width);\n editor.#realHeight = Math.round(height);\n\n for (const {\n bezier\n } of data.paths) {\n const path = [];\n editor.paths.push(path);\n let p0 = scaleFactor * (bezier[0] - padding);\n let p1 = scaleFactor * (height - bezier[1] - padding);\n\n for (let i = 2, ii = bezier.length; i < ii; i += 6) {\n const p10 = scaleFactor * (bezier[i] - padding);\n const p11 = scaleFactor * (height - bezier[i + 1] - padding);\n const p20 = scaleFactor * (bezier[i + 2] - padding);\n const p21 = scaleFactor * (height - bezier[i + 3] - padding);\n const p30 = scaleFactor * (bezier[i + 4] - padding);\n const p31 = scaleFactor * (height - bezier[i + 5] - padding);\n path.push([[p0, p1], [p10, p11], [p20, p21], [p30, p31]]);\n p0 = p30;\n p1 = p31;\n }\n\n const path2D = this.#buildPath2D(path);\n editor.bezierPath2D.push(path2D);\n }\n\n const bbox = editor.#getBbox();\n editor.#baseWidth = Math.max(RESIZER_SIZE, bbox[2] - bbox[0]);\n editor.#baseHeight = Math.max(RESIZER_SIZE, bbox[3] - bbox[1]);\n editor.#setScaleFactor(width, height);\n return editor;\n }\n\n serialize() {\n if (this.isEmpty()) {\n return null;\n }\n\n const rect = this.getRect(0, 0);\n const height = this.rotation % 180 === 0 ? rect[3] - rect[1] : rect[2] - rect[0];\n\n const color = _editor.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);\n\n return {\n annotationType: _util.AnnotationEditorType.INK,\n color,\n thickness: this.thickness,\n opacity: this.opacity,\n paths: this.#serializePaths(this.scaleFactor / this.parent.scaleFactor, this.translationX, this.translationY, height),\n pageIndex: this.parent.pageIndex,\n rect,\n rotation: this.rotation\n };\n }\n\n}\n\nexports.InkEditor = InkEditor;\n\n/***/ }),\n/* 25 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.fitCurve = void 0;\n\nconst fitCurve = __w_pdfjs_require__(26);\n\nexports.fitCurve = fitCurve;\n\n/***/ }),\n/* 26 */\n/***/ ((module) => {\n\n\n\nfunction fitCurve(points, maxError, progressCallback) {\n if (!Array.isArray(points)) {\n throw new TypeError(\"First argument should be an array\");\n }\n\n points.forEach(point => {\n if (!Array.isArray(point) || point.some(item => typeof item !== 'number') || point.length !== points[0].length) {\n throw Error(\"Each point should be an array of numbers. Each point should have the same amount of numbers.\");\n }\n });\n points = points.filter((point, i) => i === 0 || !point.every((val, j) => val === points[i - 1][j]));\n\n if (points.length < 2) {\n return [];\n }\n\n const len = points.length;\n const leftTangent = createTangent(points[1], points[0]);\n const rightTangent = createTangent(points[len - 2], points[len - 1]);\n return fitCubic(points, leftTangent, rightTangent, maxError, progressCallback);\n}\n\nfunction fitCubic(points, leftTangent, rightTangent, error, progressCallback) {\n const MaxIterations = 20;\n var bezCurve, u, uPrime, maxError, prevErr, splitPoint, prevSplit, centerVector, toCenterTangent, fromCenterTangent, beziers, dist, i;\n\n if (points.length === 2) {\n dist = maths.vectorLen(maths.subtract(points[0], points[1])) / 3.0;\n bezCurve = [points[0], maths.addArrays(points[0], maths.mulItems(leftTangent, dist)), maths.addArrays(points[1], maths.mulItems(rightTangent, dist)), points[1]];\n return [bezCurve];\n }\n\n u = chordLengthParameterize(points);\n [bezCurve, maxError, splitPoint] = generateAndReport(points, u, u, leftTangent, rightTangent, progressCallback);\n\n if (maxError === 0 || maxError < error) {\n return [bezCurve];\n }\n\n if (maxError < error * error) {\n uPrime = u;\n prevErr = maxError;\n prevSplit = splitPoint;\n\n for (i = 0; i < MaxIterations; i++) {\n uPrime = reparameterize(bezCurve, points, uPrime);\n [bezCurve, maxError, splitPoint] = generateAndReport(points, u, uPrime, leftTangent, rightTangent, progressCallback);\n\n if (maxError < error) {\n return [bezCurve];\n } else if (splitPoint === prevSplit) {\n let errChange = maxError / prevErr;\n\n if (errChange > .9999 && errChange < 1.0001) {\n break;\n }\n }\n\n prevErr = maxError;\n prevSplit = splitPoint;\n }\n }\n\n beziers = [];\n centerVector = maths.subtract(points[splitPoint - 1], points[splitPoint + 1]);\n\n if (centerVector.every(val => val === 0)) {\n centerVector = maths.subtract(points[splitPoint - 1], points[splitPoint]);\n [centerVector[0], centerVector[1]] = [-centerVector[1], centerVector[0]];\n }\n\n toCenterTangent = maths.normalize(centerVector);\n fromCenterTangent = maths.mulItems(toCenterTangent, -1);\n beziers = beziers.concat(fitCubic(points.slice(0, splitPoint + 1), leftTangent, toCenterTangent, error, progressCallback));\n beziers = beziers.concat(fitCubic(points.slice(splitPoint), fromCenterTangent, rightTangent, error, progressCallback));\n return beziers;\n}\n\n;\n\nfunction generateAndReport(points, paramsOrig, paramsPrime, leftTangent, rightTangent, progressCallback) {\n var bezCurve, maxError, splitPoint;\n bezCurve = generateBezier(points, paramsPrime, leftTangent, rightTangent, progressCallback);\n [maxError, splitPoint] = computeMaxError(points, bezCurve, paramsOrig);\n\n if (progressCallback) {\n progressCallback({\n bez: bezCurve,\n points: points,\n params: paramsOrig,\n maxErr: maxError,\n maxPoint: splitPoint\n });\n }\n\n return [bezCurve, maxError, splitPoint];\n}\n\nfunction generateBezier(points, parameters, leftTangent, rightTangent) {\n var bezCurve,\n A,\n a,\n C,\n X,\n det_C0_C1,\n det_C0_X,\n det_X_C1,\n alpha_l,\n alpha_r,\n epsilon,\n segLength,\n i,\n len,\n tmp,\n u,\n ux,\n firstPoint = points[0],\n lastPoint = points[points.length - 1];\n bezCurve = [firstPoint, null, null, lastPoint];\n A = maths.zeros_Xx2x2(parameters.length);\n\n for (i = 0, len = parameters.length; i < len; i++) {\n u = parameters[i];\n ux = 1 - u;\n a = A[i];\n a[0] = maths.mulItems(leftTangent, 3 * u * (ux * ux));\n a[1] = maths.mulItems(rightTangent, 3 * ux * (u * u));\n }\n\n C = [[0, 0], [0, 0]];\n X = [0, 0];\n\n for (i = 0, len = points.length; i < len; i++) {\n u = parameters[i];\n a = A[i];\n C[0][0] += maths.dot(a[0], a[0]);\n C[0][1] += maths.dot(a[0], a[1]);\n C[1][0] += maths.dot(a[0], a[1]);\n C[1][1] += maths.dot(a[1], a[1]);\n tmp = maths.subtract(points[i], bezier.q([firstPoint, firstPoint, lastPoint, lastPoint], u));\n X[0] += maths.dot(a[0], tmp);\n X[1] += maths.dot(a[1], tmp);\n }\n\n det_C0_C1 = C[0][0] * C[1][1] - C[1][0] * C[0][1];\n det_C0_X = C[0][0] * X[1] - C[1][0] * X[0];\n det_X_C1 = X[0] * C[1][1] - X[1] * C[0][1];\n alpha_l = det_C0_C1 === 0 ? 0 : det_X_C1 / det_C0_C1;\n alpha_r = det_C0_C1 === 0 ? 0 : det_C0_X / det_C0_C1;\n segLength = maths.vectorLen(maths.subtract(firstPoint, lastPoint));\n epsilon = 1.0e-6 * segLength;\n\n if (alpha_l < epsilon || alpha_r < epsilon) {\n bezCurve[1] = maths.addArrays(firstPoint, maths.mulItems(leftTangent, segLength / 3.0));\n bezCurve[2] = maths.addArrays(lastPoint, maths.mulItems(rightTangent, segLength / 3.0));\n } else {\n bezCurve[1] = maths.addArrays(firstPoint, maths.mulItems(leftTangent, alpha_l));\n bezCurve[2] = maths.addArrays(lastPoint, maths.mulItems(rightTangent, alpha_r));\n }\n\n return bezCurve;\n}\n\n;\n\nfunction reparameterize(bezier, points, parameters) {\n return parameters.map((p, i) => newtonRaphsonRootFind(bezier, points[i], p));\n}\n\n;\n\nfunction newtonRaphsonRootFind(bez, point, u) {\n var d = maths.subtract(bezier.q(bez, u), point),\n qprime = bezier.qprime(bez, u),\n numerator = maths.mulMatrix(d, qprime),\n denominator = maths.sum(maths.squareItems(qprime)) + 2 * maths.mulMatrix(d, bezier.qprimeprime(bez, u));\n\n if (denominator === 0) {\n return u;\n } else {\n return u - numerator / denominator;\n }\n}\n\n;\n\nfunction chordLengthParameterize(points) {\n var u = [],\n currU,\n prevU,\n prevP;\n points.forEach((p, i) => {\n currU = i ? prevU + maths.vectorLen(maths.subtract(p, prevP)) : 0;\n u.push(currU);\n prevU = currU;\n prevP = p;\n });\n u = u.map(x => x / prevU);\n return u;\n}\n\n;\n\nfunction computeMaxError(points, bez, parameters) {\n var dist, maxDist, splitPoint, v, i, count, point, t;\n maxDist = 0;\n splitPoint = Math.floor(points.length / 2);\n const t_distMap = mapTtoRelativeDistances(bez, 10);\n\n for (i = 0, count = points.length; i < count; i++) {\n point = points[i];\n t = find_t(bez, parameters[i], t_distMap, 10);\n v = maths.subtract(bezier.q(bez, t), point);\n dist = v[0] * v[0] + v[1] * v[1];\n\n if (dist > maxDist) {\n maxDist = dist;\n splitPoint = i;\n }\n }\n\n return [maxDist, splitPoint];\n}\n\n;\n\nvar mapTtoRelativeDistances = function (bez, B_parts) {\n var B_t_curr;\n var B_t_dist = [0];\n var B_t_prev = bez[0];\n var sumLen = 0;\n\n for (var i = 1; i <= B_parts; i++) {\n B_t_curr = bezier.q(bez, i / B_parts);\n sumLen += maths.vectorLen(maths.subtract(B_t_curr, B_t_prev));\n B_t_dist.push(sumLen);\n B_t_prev = B_t_curr;\n }\n\n B_t_dist = B_t_dist.map(x => x / sumLen);\n return B_t_dist;\n};\n\nfunction find_t(bez, param, t_distMap, B_parts) {\n if (param < 0) {\n return 0;\n }\n\n if (param > 1) {\n return 1;\n }\n\n var lenMax, lenMin, tMax, tMin, t;\n\n for (var i = 1; i <= B_parts; i++) {\n if (param <= t_distMap[i]) {\n tMin = (i - 1) / B_parts;\n tMax = i / B_parts;\n lenMin = t_distMap[i - 1];\n lenMax = t_distMap[i];\n t = (param - lenMin) / (lenMax - lenMin) * (tMax - tMin) + tMin;\n break;\n }\n }\n\n return t;\n}\n\nfunction createTangent(pointA, pointB) {\n return maths.normalize(maths.subtract(pointA, pointB));\n}\n\nclass maths {\n static zeros_Xx2x2(x) {\n var zs = [];\n\n while (x--) {\n zs.push([0, 0]);\n }\n\n return zs;\n }\n\n static mulItems(items, multiplier) {\n return items.map(x => x * multiplier);\n }\n\n static mulMatrix(m1, m2) {\n return m1.reduce((sum, x1, i) => sum + x1 * m2[i], 0);\n }\n\n static subtract(arr1, arr2) {\n return arr1.map((x1, i) => x1 - arr2[i]);\n }\n\n static addArrays(arr1, arr2) {\n return arr1.map((x1, i) => x1 + arr2[i]);\n }\n\n static addItems(items, addition) {\n return items.map(x => x + addition);\n }\n\n static sum(items) {\n return items.reduce((sum, x) => sum + x);\n }\n\n static dot(m1, m2) {\n return maths.mulMatrix(m1, m2);\n }\n\n static vectorLen(v) {\n return Math.hypot(...v);\n }\n\n static divItems(items, divisor) {\n return items.map(x => x / divisor);\n }\n\n static squareItems(items) {\n return items.map(x => x * x);\n }\n\n static normalize(v) {\n return this.divItems(v, this.vectorLen(v));\n }\n\n}\n\nclass bezier {\n static q(ctrlPoly, t) {\n var tx = 1.0 - t;\n var pA = maths.mulItems(ctrlPoly[0], tx * tx * tx),\n pB = maths.mulItems(ctrlPoly[1], 3 * tx * tx * t),\n pC = maths.mulItems(ctrlPoly[2], 3 * tx * t * t),\n pD = maths.mulItems(ctrlPoly[3], t * t * t);\n return maths.addArrays(maths.addArrays(pA, pB), maths.addArrays(pC, pD));\n }\n\n static qprime(ctrlPoly, t) {\n var tx = 1.0 - t;\n var pA = maths.mulItems(maths.subtract(ctrlPoly[1], ctrlPoly[0]), 3 * tx * tx),\n pB = maths.mulItems(maths.subtract(ctrlPoly[2], ctrlPoly[1]), 6 * tx * t),\n pC = maths.mulItems(maths.subtract(ctrlPoly[3], ctrlPoly[2]), 3 * t * t);\n return maths.addArrays(maths.addArrays(pA, pB), pC);\n }\n\n static qprimeprime(ctrlPoly, t) {\n return maths.addArrays(maths.mulItems(maths.addArrays(maths.subtract(ctrlPoly[2], maths.mulItems(ctrlPoly[1], 2)), ctrlPoly[0]), 6 * (1.0 - t)), maths.mulItems(maths.addArrays(maths.subtract(ctrlPoly[3], maths.mulItems(ctrlPoly[2], 2)), ctrlPoly[1]), 6 * t));\n }\n\n}\n\nmodule.exports = fitCurve;\nmodule.exports.fitCubic = fitCubic;\nmodule.exports.createTangent = createTangent;\n\n/***/ }),\n/* 27 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.AnnotationLayer = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _display_utils = __w_pdfjs_require__(8);\n\nvar _annotation_storage = __w_pdfjs_require__(5);\n\nvar _scripting_utils = __w_pdfjs_require__(28);\n\nvar _xfa_layer = __w_pdfjs_require__(29);\n\nconst DEFAULT_TAB_INDEX = 1000;\nconst DEFAULT_FONT_SIZE = 9;\nconst GetElementsByNameSet = new WeakSet();\n\nfunction getRectDims(rect) {\n return {\n width: rect[2] - rect[0],\n height: rect[3] - rect[1]\n };\n}\n\nclass AnnotationElementFactory {\n static create(parameters) {\n const subtype = parameters.data.annotationType;\n\n switch (subtype) {\n case _util.AnnotationType.LINK:\n return new LinkAnnotationElement(parameters);\n\n case _util.AnnotationType.TEXT:\n return new TextAnnotationElement(parameters);\n\n case _util.AnnotationType.WIDGET:\n const fieldType = parameters.data.fieldType;\n\n switch (fieldType) {\n case \"Tx\":\n return new TextWidgetAnnotationElement(parameters);\n\n case \"Btn\":\n if (parameters.data.radioButton) {\n return new RadioButtonWidgetAnnotationElement(parameters);\n } else if (parameters.data.checkBox) {\n return new CheckboxWidgetAnnotationElement(parameters);\n }\n\n return new PushButtonWidgetAnnotationElement(parameters);\n\n case \"Ch\":\n return new ChoiceWidgetAnnotationElement(parameters);\n }\n\n return new WidgetAnnotationElement(parameters);\n\n case _util.AnnotationType.POPUP:\n return new PopupAnnotationElement(parameters);\n\n case _util.AnnotationType.FREETEXT:\n return new FreeTextAnnotationElement(parameters);\n\n case _util.AnnotationType.LINE:\n return new LineAnnotationElement(parameters);\n\n case _util.AnnotationType.SQUARE:\n return new SquareAnnotationElement(parameters);\n\n case _util.AnnotationType.CIRCLE:\n return new CircleAnnotationElement(parameters);\n\n case _util.AnnotationType.POLYLINE:\n return new PolylineAnnotationElement(parameters);\n\n case _util.AnnotationType.CARET:\n return new CaretAnnotationElement(parameters);\n\n case _util.AnnotationType.INK:\n return new InkAnnotationElement(parameters);\n\n case _util.AnnotationType.POLYGON:\n return new PolygonAnnotationElement(parameters);\n\n case _util.AnnotationType.HIGHLIGHT:\n return new HighlightAnnotationElement(parameters);\n\n case _util.AnnotationType.UNDERLINE:\n return new UnderlineAnnotationElement(parameters);\n\n case _util.AnnotationType.SQUIGGLY:\n return new SquigglyAnnotationElement(parameters);\n\n case _util.AnnotationType.STRIKEOUT:\n return new StrikeOutAnnotationElement(parameters);\n\n case _util.AnnotationType.STAMP:\n return new StampAnnotationElement(parameters);\n\n case _util.AnnotationType.FILEATTACHMENT:\n return new FileAttachmentAnnotationElement(parameters);\n\n default:\n return new AnnotationElement(parameters);\n }\n }\n\n}\n\nclass AnnotationElement {\n constructor(parameters, {\n isRenderable = false,\n ignoreBorder = false,\n createQuadrilaterals = false\n } = {}) {\n this.isRenderable = isRenderable;\n this.data = parameters.data;\n this.layer = parameters.layer;\n this.page = parameters.page;\n this.viewport = parameters.viewport;\n this.linkService = parameters.linkService;\n this.downloadManager = parameters.downloadManager;\n this.imageResourcesPath = parameters.imageResourcesPath;\n this.renderForms = parameters.renderForms;\n this.svgFactory = parameters.svgFactory;\n this.annotationStorage = parameters.annotationStorage;\n this.enableScripting = parameters.enableScripting;\n this.hasJSActions = parameters.hasJSActions;\n this._fieldObjects = parameters.fieldObjects;\n this._mouseState = parameters.mouseState;\n\n if (isRenderable) {\n this.container = this._createContainer(ignoreBorder);\n }\n\n if (createQuadrilaterals) {\n this.quadrilaterals = this._createQuadrilaterals(ignoreBorder);\n }\n }\n\n _createContainer(ignoreBorder = false) {\n const data = this.data,\n page = this.page,\n viewport = this.viewport;\n const container = document.createElement(\"section\");\n const {\n width,\n height\n } = getRectDims(data.rect);\n const [pageLLx, pageLLy, pageURx, pageURy] = viewport.viewBox;\n const pageWidth = pageURx - pageLLx;\n const pageHeight = pageURy - pageLLy;\n container.setAttribute(\"data-annotation-id\", data.id);\n\n const rect = _util.Util.normalizeRect([data.rect[0], page.view[3] - data.rect[1] + page.view[1], data.rect[2], page.view[3] - data.rect[3] + page.view[1]]);\n\n if (!ignoreBorder && data.borderStyle.width > 0) {\n container.style.borderWidth = `${data.borderStyle.width}px`;\n const horizontalRadius = data.borderStyle.horizontalCornerRadius;\n const verticalRadius = data.borderStyle.verticalCornerRadius;\n\n if (horizontalRadius > 0 || verticalRadius > 0) {\n const radius = `calc(${horizontalRadius}px * var(--scale-factor)) / calc(${verticalRadius}px * var(--scale-factor))`;\n container.style.borderRadius = radius;\n } else if (this instanceof RadioButtonWidgetAnnotationElement) {\n const radius = `calc(${width}px * var(--scale-factor)) / calc(${height}px * var(--scale-factor))`;\n container.style.borderRadius = radius;\n }\n\n switch (data.borderStyle.style) {\n case _util.AnnotationBorderStyleType.SOLID:\n container.style.borderStyle = \"solid\";\n break;\n\n case _util.AnnotationBorderStyleType.DASHED:\n container.style.borderStyle = \"dashed\";\n break;\n\n case _util.AnnotationBorderStyleType.BEVELED:\n (0, _util.warn)(\"Unimplemented border style: beveled\");\n break;\n\n case _util.AnnotationBorderStyleType.INSET:\n (0, _util.warn)(\"Unimplemented border style: inset\");\n break;\n\n case _util.AnnotationBorderStyleType.UNDERLINE:\n container.style.borderBottomStyle = \"solid\";\n break;\n\n default:\n break;\n }\n\n const borderColor = data.borderColor || null;\n\n if (borderColor) {\n container.style.borderColor = _util.Util.makeHexColor(borderColor[0] | 0, borderColor[1] | 0, borderColor[2] | 0);\n } else {\n container.style.borderWidth = 0;\n }\n }\n\n container.style.left = `${100 * (rect[0] - pageLLx) / pageWidth}%`;\n container.style.top = `${100 * (rect[1] - pageLLy) / pageHeight}%`;\n const {\n rotation\n } = data;\n\n if (data.hasOwnCanvas || rotation === 0) {\n container.style.width = `${100 * width / pageWidth}%`;\n container.style.height = `${100 * height / pageHeight}%`;\n } else {\n this.setRotation(rotation, container);\n }\n\n return container;\n }\n\n setRotation(angle, container = this.container) {\n const [pageLLx, pageLLy, pageURx, pageURy] = this.viewport.viewBox;\n const pageWidth = pageURx - pageLLx;\n const pageHeight = pageURy - pageLLy;\n const {\n width,\n height\n } = getRectDims(this.data.rect);\n let elementWidth, elementHeight;\n\n if (angle % 180 === 0) {\n elementWidth = 100 * width / pageWidth;\n elementHeight = 100 * height / pageHeight;\n } else {\n elementWidth = 100 * height / pageWidth;\n elementHeight = 100 * width / pageHeight;\n }\n\n container.style.width = `${elementWidth}%`;\n container.style.height = `${elementHeight}%`;\n container.setAttribute(\"data-main-rotation\", (360 - angle) % 360);\n }\n\n get _commonActions() {\n const setColor = (jsName, styleName, event) => {\n const color = event.detail[jsName];\n event.target.style[styleName] = _scripting_utils.ColorConverters[`${color[0]}_HTML`](color.slice(1));\n };\n\n return (0, _util.shadow)(this, \"_commonActions\", {\n display: event => {\n const hidden = event.detail.display % 2 === 1;\n this.container.style.visibility = hidden ? \"hidden\" : \"visible\";\n this.annotationStorage.setValue(this.data.id, {\n hidden,\n print: event.detail.display === 0 || event.detail.display === 3\n });\n },\n print: event => {\n this.annotationStorage.setValue(this.data.id, {\n print: event.detail.print\n });\n },\n hidden: event => {\n this.container.style.visibility = event.detail.hidden ? \"hidden\" : \"visible\";\n this.annotationStorage.setValue(this.data.id, {\n hidden: event.detail.hidden\n });\n },\n focus: event => {\n setTimeout(() => event.target.focus({\n preventScroll: false\n }), 0);\n },\n userName: event => {\n event.target.title = event.detail.userName;\n },\n readonly: event => {\n if (event.detail.readonly) {\n event.target.setAttribute(\"readonly\", \"\");\n } else {\n event.target.removeAttribute(\"readonly\");\n }\n },\n required: event => {\n this._setRequired(event.target, event.detail.required);\n },\n bgColor: event => {\n setColor(\"bgColor\", \"backgroundColor\", event);\n },\n fillColor: event => {\n setColor(\"fillColor\", \"backgroundColor\", event);\n },\n fgColor: event => {\n setColor(\"fgColor\", \"color\", event);\n },\n textColor: event => {\n setColor(\"textColor\", \"color\", event);\n },\n borderColor: event => {\n setColor(\"borderColor\", \"borderColor\", event);\n },\n strokeColor: event => {\n setColor(\"strokeColor\", \"borderColor\", event);\n },\n rotation: event => {\n const angle = event.detail.rotation;\n this.setRotation(angle);\n this.annotationStorage.setValue(this.data.id, {\n rotation: angle\n });\n }\n });\n }\n\n _dispatchEventFromSandbox(actions, jsEvent) {\n const commonActions = this._commonActions;\n\n for (const name of Object.keys(jsEvent.detail)) {\n const action = actions[name] || commonActions[name];\n\n if (action) {\n action(jsEvent);\n }\n }\n }\n\n _setDefaultPropertiesFromJS(element) {\n if (!this.enableScripting) {\n return;\n }\n\n const storedData = this.annotationStorage.getRawValue(this.data.id);\n\n if (!storedData) {\n return;\n }\n\n const commonActions = this._commonActions;\n\n for (const [actionName, detail] of Object.entries(storedData)) {\n const action = commonActions[actionName];\n\n if (action) {\n const eventProxy = {\n detail: {\n [actionName]: detail\n },\n target: element\n };\n action(eventProxy);\n delete storedData[actionName];\n }\n }\n }\n\n _createQuadrilaterals(ignoreBorder = false) {\n if (!this.data.quadPoints) {\n return null;\n }\n\n const quadrilaterals = [];\n const savedRect = this.data.rect;\n\n for (const quadPoint of this.data.quadPoints) {\n this.data.rect = [quadPoint[2].x, quadPoint[2].y, quadPoint[1].x, quadPoint[1].y];\n quadrilaterals.push(this._createContainer(ignoreBorder));\n }\n\n this.data.rect = savedRect;\n return quadrilaterals;\n }\n\n _createPopup(trigger, data) {\n let container = this.container;\n\n if (this.quadrilaterals) {\n trigger = trigger || this.quadrilaterals;\n container = this.quadrilaterals[0];\n }\n\n if (!trigger) {\n trigger = document.createElement(\"div\");\n trigger.className = \"popupTriggerArea\";\n container.append(trigger);\n }\n\n const popupElement = new PopupElement({\n container,\n trigger,\n color: data.color,\n titleObj: data.titleObj,\n modificationDate: data.modificationDate,\n contentsObj: data.contentsObj,\n richText: data.richText,\n hideWrapper: true\n });\n const popup = popupElement.render();\n popup.style.left = \"100%\";\n container.append(popup);\n }\n\n _renderQuadrilaterals(className) {\n for (const quadrilateral of this.quadrilaterals) {\n quadrilateral.className = className;\n }\n\n return this.quadrilaterals;\n }\n\n render() {\n (0, _util.unreachable)(\"Abstract method `AnnotationElement.render` called\");\n }\n\n _getElementsByName(name, skipId = null) {\n const fields = [];\n\n if (this._fieldObjects) {\n const fieldObj = this._fieldObjects[name];\n\n if (fieldObj) {\n for (const {\n page,\n id,\n exportValues\n } of fieldObj) {\n if (page === -1) {\n continue;\n }\n\n if (id === skipId) {\n continue;\n }\n\n const exportValue = typeof exportValues === \"string\" ? exportValues : null;\n const domElement = document.querySelector(`[data-element-id=\"${id}\"]`);\n\n if (domElement && !GetElementsByNameSet.has(domElement)) {\n (0, _util.warn)(`_getElementsByName - element not allowed: ${id}`);\n continue;\n }\n\n fields.push({\n id,\n exportValue,\n domElement\n });\n }\n }\n\n return fields;\n }\n\n for (const domElement of document.getElementsByName(name)) {\n const {\n id,\n exportValue\n } = domElement;\n\n if (id === skipId) {\n continue;\n }\n\n if (!GetElementsByNameSet.has(domElement)) {\n continue;\n }\n\n fields.push({\n id,\n exportValue,\n domElement\n });\n }\n\n return fields;\n }\n\n static get platform() {\n const platform = typeof navigator !== \"undefined\" ? navigator.platform : \"\";\n return (0, _util.shadow)(this, \"platform\", {\n isWin: platform.includes(\"Win\"),\n isMac: platform.includes(\"Mac\")\n });\n }\n\n}\n\nclass LinkAnnotationElement extends AnnotationElement {\n constructor(parameters, options = null) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: !!options?.ignoreBorder,\n createQuadrilaterals: true\n });\n this.isTooltipOnly = parameters.data.isTooltipOnly;\n }\n\n render() {\n const {\n data,\n linkService\n } = this;\n const link = document.createElement(\"a\");\n link.setAttribute(\"data-element-id\", data.id);\n let isBound = false;\n\n if (data.url) {\n linkService.addLinkAttributes(link, data.url, data.newWindow);\n isBound = true;\n } else if (data.action) {\n this._bindNamedAction(link, data.action);\n\n isBound = true;\n } else if (data.dest) {\n this._bindLink(link, data.dest);\n\n isBound = true;\n } else {\n if (data.actions && (data.actions.Action || data.actions[\"Mouse Up\"] || data.actions[\"Mouse Down\"]) && this.enableScripting && this.hasJSActions) {\n this._bindJSAction(link, data);\n\n isBound = true;\n }\n\n if (data.resetForm) {\n this._bindResetFormAction(link, data.resetForm);\n\n isBound = true;\n } else if (this.isTooltipOnly && !isBound) {\n this._bindLink(link, \"\");\n\n isBound = true;\n }\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"linkAnnotation\").map((quadrilateral, index) => {\n const linkElement = index === 0 ? link : link.cloneNode();\n quadrilateral.append(linkElement);\n return quadrilateral;\n });\n }\n\n this.container.className = \"linkAnnotation\";\n\n if (isBound) {\n this.container.append(link);\n }\n\n return this.container;\n }\n\n _bindLink(link, destination) {\n link.href = this.linkService.getDestinationHash(destination);\n\n link.onclick = () => {\n if (destination) {\n this.linkService.goToDestination(destination);\n }\n\n return false;\n };\n\n if (destination || destination === \"\") {\n link.className = \"internalLink\";\n }\n }\n\n _bindNamedAction(link, action) {\n link.href = this.linkService.getAnchorUrl(\"\");\n\n link.onclick = () => {\n this.linkService.executeNamedAction(action);\n return false;\n };\n\n link.className = \"internalLink\";\n }\n\n _bindJSAction(link, data) {\n link.href = this.linkService.getAnchorUrl(\"\");\n const map = new Map([[\"Action\", \"onclick\"], [\"Mouse Up\", \"onmouseup\"], [\"Mouse Down\", \"onmousedown\"]]);\n\n for (const name of Object.keys(data.actions)) {\n const jsName = map.get(name);\n\n if (!jsName) {\n continue;\n }\n\n link[jsName] = () => {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: data.id,\n name\n }\n });\n return false;\n };\n }\n\n if (!link.onclick) {\n link.onclick = () => false;\n }\n\n link.className = \"internalLink\";\n }\n\n _bindResetFormAction(link, resetForm) {\n const otherClickAction = link.onclick;\n\n if (!otherClickAction) {\n link.href = this.linkService.getAnchorUrl(\"\");\n }\n\n link.className = \"internalLink\";\n\n if (!this._fieldObjects) {\n (0, _util.warn)(`_bindResetFormAction - \"resetForm\" action not supported, ` + \"ensure that the `fieldObjects` parameter is provided.\");\n\n if (!otherClickAction) {\n link.onclick = () => false;\n }\n\n return;\n }\n\n link.onclick = () => {\n if (otherClickAction) {\n otherClickAction();\n }\n\n const {\n fields: resetFormFields,\n refs: resetFormRefs,\n include\n } = resetForm;\n const allFields = [];\n\n if (resetFormFields.length !== 0 || resetFormRefs.length !== 0) {\n const fieldIds = new Set(resetFormRefs);\n\n for (const fieldName of resetFormFields) {\n const fields = this._fieldObjects[fieldName] || [];\n\n for (const {\n id\n } of fields) {\n fieldIds.add(id);\n }\n }\n\n for (const fields of Object.values(this._fieldObjects)) {\n for (const field of fields) {\n if (fieldIds.has(field.id) === include) {\n allFields.push(field);\n }\n }\n }\n } else {\n for (const fields of Object.values(this._fieldObjects)) {\n allFields.push(...fields);\n }\n }\n\n const storage = this.annotationStorage;\n const allIds = [];\n\n for (const field of allFields) {\n const {\n id\n } = field;\n allIds.push(id);\n\n switch (field.type) {\n case \"text\":\n {\n const value = field.defaultValue || \"\";\n storage.setValue(id, {\n value\n });\n break;\n }\n\n case \"checkbox\":\n case \"radiobutton\":\n {\n const value = field.defaultValue === field.exportValues;\n storage.setValue(id, {\n value\n });\n break;\n }\n\n case \"combobox\":\n case \"listbox\":\n {\n const value = field.defaultValue || \"\";\n storage.setValue(id, {\n value\n });\n break;\n }\n\n default:\n continue;\n }\n\n const domElement = document.querySelector(`[data-element-id=\"${id}\"]`);\n\n if (!domElement) {\n continue;\n } else if (!GetElementsByNameSet.has(domElement)) {\n (0, _util.warn)(`_bindResetFormAction - element not allowed: ${id}`);\n continue;\n }\n\n domElement.dispatchEvent(new Event(\"resetform\"));\n }\n\n if (this.enableScripting) {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: \"app\",\n ids: allIds,\n name: \"ResetForm\"\n }\n });\n }\n\n return false;\n };\n }\n\n}\n\nclass TextAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable\n });\n }\n\n render() {\n this.container.className = \"textAnnotation\";\n const image = document.createElement(\"img\");\n image.src = this.imageResourcesPath + \"annotation-\" + this.data.name.toLowerCase() + \".svg\";\n image.alt = \"[{{type}} Annotation]\";\n image.dataset.l10nId = \"text_annotation_type\";\n image.dataset.l10nArgs = JSON.stringify({\n type: this.data.name\n });\n\n if (!this.data.hasPopup) {\n this._createPopup(image, this.data);\n }\n\n this.container.append(image);\n return this.container;\n }\n\n}\n\nclass WidgetAnnotationElement extends AnnotationElement {\n render() {\n if (this.data.alternativeText) {\n this.container.title = this.data.alternativeText;\n }\n\n return this.container;\n }\n\n _getKeyModifier(event) {\n const {\n isWin,\n isMac\n } = AnnotationElement.platform;\n return isWin && event.ctrlKey || isMac && event.metaKey;\n }\n\n _setEventListener(element, baseName, eventName, valueGetter) {\n if (baseName.includes(\"mouse\")) {\n element.addEventListener(baseName, event => {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: this.data.id,\n name: eventName,\n value: valueGetter(event),\n shift: event.shiftKey,\n modifier: this._getKeyModifier(event)\n }\n });\n });\n } else {\n element.addEventListener(baseName, event => {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: this.data.id,\n name: eventName,\n value: valueGetter(event)\n }\n });\n });\n }\n }\n\n _setEventListeners(element, names, getter) {\n for (const [baseName, eventName] of names) {\n if (eventName === \"Action\" || this.data.actions?.[eventName]) {\n this._setEventListener(element, baseName, eventName, getter);\n }\n }\n }\n\n _setBackgroundColor(element) {\n const color = this.data.backgroundColor || null;\n element.style.backgroundColor = color === null ? \"transparent\" : _util.Util.makeHexColor(color[0], color[1], color[2]);\n }\n\n _setTextStyle(element) {\n const TEXT_ALIGNMENT = [\"left\", \"center\", \"right\"];\n const {\n fontColor\n } = this.data.defaultAppearanceData;\n const fontSize = this.data.defaultAppearanceData.fontSize || DEFAULT_FONT_SIZE;\n const style = element.style;\n let computedFontSize;\n\n if (this.data.multiLine) {\n const height = Math.abs(this.data.rect[3] - this.data.rect[1]);\n const numberOfLines = Math.round(height / (_util.LINE_FACTOR * fontSize)) || 1;\n const lineHeight = height / numberOfLines;\n computedFontSize = Math.min(fontSize, Math.round(lineHeight / _util.LINE_FACTOR));\n } else {\n const height = Math.abs(this.data.rect[3] - this.data.rect[1]);\n computedFontSize = Math.min(fontSize, Math.round(height / _util.LINE_FACTOR));\n }\n\n style.fontSize = `calc(${computedFontSize}px * var(--scale-factor))`;\n style.color = _util.Util.makeHexColor(fontColor[0], fontColor[1], fontColor[2]);\n\n if (this.data.textAlignment !== null) {\n style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment];\n }\n }\n\n _setRequired(element, isRequired) {\n if (isRequired) {\n element.setAttribute(\"required\", true);\n } else {\n element.removeAttribute(\"required\");\n }\n\n element.setAttribute(\"aria-required\", isRequired);\n }\n\n}\n\nclass TextWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n const isRenderable = parameters.renderForms || !parameters.data.hasAppearance && !!parameters.data.fieldValue;\n super(parameters, {\n isRenderable\n });\n }\n\n setPropertyOnSiblings(base, key, value, keyInStorage) {\n const storage = this.annotationStorage;\n\n for (const element of this._getElementsByName(base.name, base.id)) {\n if (element.domElement) {\n element.domElement[key] = value;\n }\n\n storage.setValue(element.id, {\n [keyInStorage]: value\n });\n }\n }\n\n render() {\n const storage = this.annotationStorage;\n const id = this.data.id;\n this.container.className = \"textWidgetAnnotation\";\n let element = null;\n\n if (this.renderForms) {\n const storedData = storage.getValue(id, {\n value: this.data.fieldValue\n });\n let textContent = storedData.formattedValue || storedData.value || \"\";\n const maxLen = storage.getValue(id, {\n charLimit: this.data.maxLen\n }).charLimit;\n\n if (maxLen && textContent.length > maxLen) {\n textContent = textContent.slice(0, maxLen);\n }\n\n const elementData = {\n userValue: textContent,\n formattedValue: null,\n valueOnFocus: \"\"\n };\n\n if (this.data.multiLine) {\n element = document.createElement(\"textarea\");\n element.textContent = textContent;\n\n if (this.data.doNotScroll) {\n element.style.overflowY = \"hidden\";\n }\n } else {\n element = document.createElement(\"input\");\n element.type = \"text\";\n element.setAttribute(\"value\", textContent);\n\n if (this.data.doNotScroll) {\n element.style.overflowX = \"hidden\";\n }\n }\n\n GetElementsByNameSet.add(element);\n element.setAttribute(\"data-element-id\", id);\n element.disabled = this.data.readOnly;\n element.name = this.data.fieldName;\n element.tabIndex = DEFAULT_TAB_INDEX;\n\n this._setRequired(element, this.data.required);\n\n if (maxLen) {\n element.maxLength = maxLen;\n }\n\n element.addEventListener(\"input\", event => {\n storage.setValue(id, {\n value: event.target.value\n });\n this.setPropertyOnSiblings(element, \"value\", event.target.value, \"value\");\n });\n element.addEventListener(\"resetform\", event => {\n const defaultValue = this.data.defaultFieldValue ?? \"\";\n element.value = elementData.userValue = defaultValue;\n elementData.formattedValue = null;\n });\n\n let blurListener = event => {\n const {\n formattedValue\n } = elementData;\n\n if (formattedValue !== null && formattedValue !== undefined) {\n event.target.value = formattedValue;\n }\n\n event.target.scrollLeft = 0;\n };\n\n if (this.enableScripting && this.hasJSActions) {\n element.addEventListener(\"focus\", event => {\n if (elementData.userValue) {\n event.target.value = elementData.userValue;\n }\n\n elementData.valueOnFocus = event.target.value;\n });\n element.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value(event) {\n elementData.userValue = event.detail.value ?? \"\";\n storage.setValue(id, {\n value: elementData.userValue.toString()\n });\n event.target.value = elementData.userValue;\n },\n\n formattedValue(event) {\n const {\n formattedValue\n } = event.detail;\n elementData.formattedValue = formattedValue;\n\n if (formattedValue !== null && formattedValue !== undefined && event.target !== document.activeElement) {\n event.target.value = formattedValue;\n }\n\n storage.setValue(id, {\n formattedValue\n });\n },\n\n selRange(event) {\n event.target.setSelectionRange(...event.detail.selRange);\n },\n\n charLimit: event => {\n const {\n charLimit\n } = event.detail;\n const {\n target\n } = event;\n\n if (charLimit === 0) {\n target.removeAttribute(\"maxLength\");\n return;\n }\n\n target.setAttribute(\"maxLength\", charLimit);\n let value = elementData.userValue;\n\n if (!value || value.length <= charLimit) {\n return;\n }\n\n value = value.slice(0, charLimit);\n target.value = elementData.userValue = value;\n storage.setValue(id, {\n value\n });\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n willCommit: true,\n commitKey: 1,\n selStart: target.selectionStart,\n selEnd: target.selectionEnd\n }\n });\n }\n };\n\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n element.addEventListener(\"keydown\", event => {\n let commitKey = -1;\n\n if (event.key === \"Escape\") {\n commitKey = 0;\n } else if (event.key === \"Enter\") {\n commitKey = 2;\n } else if (event.key === \"Tab\") {\n commitKey = 3;\n }\n\n if (commitKey === -1) {\n return;\n }\n\n const {\n value\n } = event.target;\n\n if (elementData.valueOnFocus === value) {\n return;\n }\n\n elementData.userValue = value;\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n willCommit: true,\n commitKey,\n selStart: event.target.selectionStart,\n selEnd: event.target.selectionEnd\n }\n });\n });\n const _blurListener = blurListener;\n blurListener = null;\n element.addEventListener(\"blur\", event => {\n const {\n value\n } = event.target;\n elementData.userValue = value;\n\n if (this._mouseState.isDown && elementData.valueOnFocus !== value) {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n willCommit: true,\n commitKey: 1,\n selStart: event.target.selectionStart,\n selEnd: event.target.selectionEnd\n }\n });\n }\n\n _blurListener(event);\n });\n\n if (this.data.actions?.Keystroke) {\n element.addEventListener(\"beforeinput\", event => {\n const {\n data,\n target\n } = event;\n const {\n value,\n selectionStart,\n selectionEnd\n } = target;\n let selStart = selectionStart,\n selEnd = selectionEnd;\n\n switch (event.inputType) {\n case \"deleteWordBackward\":\n {\n const match = value.substring(0, selectionStart).match(/\\w*[^\\w]*$/);\n\n if (match) {\n selStart -= match[0].length;\n }\n\n break;\n }\n\n case \"deleteWordForward\":\n {\n const match = value.substring(selectionStart).match(/^[^\\w]*\\w*/);\n\n if (match) {\n selEnd += match[0].length;\n }\n\n break;\n }\n\n case \"deleteContentBackward\":\n if (selectionStart === selectionEnd) {\n selStart -= 1;\n }\n\n break;\n\n case \"deleteContentForward\":\n if (selectionStart === selectionEnd) {\n selEnd += 1;\n }\n\n break;\n }\n\n event.preventDefault();\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n change: data || \"\",\n willCommit: false,\n selStart,\n selEnd\n }\n });\n });\n }\n\n this._setEventListeners(element, [[\"focus\", \"Focus\"], [\"blur\", \"Blur\"], [\"mousedown\", \"Mouse Down\"], [\"mouseenter\", \"Mouse Enter\"], [\"mouseleave\", \"Mouse Exit\"], [\"mouseup\", \"Mouse Up\"]], event => event.target.value);\n }\n\n if (blurListener) {\n element.addEventListener(\"blur\", blurListener);\n }\n\n if (this.data.comb) {\n const fieldWidth = this.data.rect[2] - this.data.rect[0];\n const combWidth = fieldWidth / maxLen;\n element.classList.add(\"comb\");\n element.style.letterSpacing = `calc(${combWidth}px * var(--scale-factor) - 1ch)`;\n }\n } else {\n element = document.createElement(\"div\");\n element.textContent = this.data.fieldValue;\n element.style.verticalAlign = \"middle\";\n element.style.display = \"table-cell\";\n }\n\n this._setTextStyle(element);\n\n this._setBackgroundColor(element);\n\n this._setDefaultPropertiesFromJS(element);\n\n this.container.append(element);\n return this.container;\n }\n\n}\n\nclass CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: parameters.renderForms\n });\n }\n\n render() {\n const storage = this.annotationStorage;\n const data = this.data;\n const id = data.id;\n let value = storage.getValue(id, {\n value: data.exportValue === data.fieldValue\n }).value;\n\n if (typeof value === \"string\") {\n value = value !== \"Off\";\n storage.setValue(id, {\n value\n });\n }\n\n this.container.className = \"buttonWidgetAnnotation checkBox\";\n const element = document.createElement(\"input\");\n GetElementsByNameSet.add(element);\n element.setAttribute(\"data-element-id\", id);\n element.disabled = data.readOnly;\n\n this._setRequired(element, this.data.required);\n\n element.type = \"checkbox\";\n element.name = data.fieldName;\n\n if (value) {\n element.setAttribute(\"checked\", true);\n }\n\n element.setAttribute(\"exportValue\", data.exportValue);\n element.tabIndex = DEFAULT_TAB_INDEX;\n element.addEventListener(\"change\", event => {\n const {\n name,\n checked\n } = event.target;\n\n for (const checkbox of this._getElementsByName(name, id)) {\n const curChecked = checked && checkbox.exportValue === data.exportValue;\n\n if (checkbox.domElement) {\n checkbox.domElement.checked = curChecked;\n }\n\n storage.setValue(checkbox.id, {\n value: curChecked\n });\n }\n\n storage.setValue(id, {\n value: checked\n });\n });\n element.addEventListener(\"resetform\", event => {\n const defaultValue = data.defaultFieldValue || \"Off\";\n event.target.checked = defaultValue === data.exportValue;\n });\n\n if (this.enableScripting && this.hasJSActions) {\n element.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value(event) {\n event.target.checked = event.detail.value !== \"Off\";\n storage.setValue(id, {\n value: event.target.checked\n });\n }\n\n };\n\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n this._setEventListeners(element, [[\"change\", \"Validate\"], [\"change\", \"Action\"], [\"focus\", \"Focus\"], [\"blur\", \"Blur\"], [\"mousedown\", \"Mouse Down\"], [\"mouseenter\", \"Mouse Enter\"], [\"mouseleave\", \"Mouse Exit\"], [\"mouseup\", \"Mouse Up\"]], event => event.target.checked);\n }\n\n this._setBackgroundColor(element);\n\n this._setDefaultPropertiesFromJS(element);\n\n this.container.append(element);\n return this.container;\n }\n\n}\n\nclass RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: parameters.renderForms\n });\n }\n\n render() {\n this.container.className = \"buttonWidgetAnnotation radioButton\";\n const storage = this.annotationStorage;\n const data = this.data;\n const id = data.id;\n let value = storage.getValue(id, {\n value: data.fieldValue === data.buttonValue\n }).value;\n\n if (typeof value === \"string\") {\n value = value !== data.buttonValue;\n storage.setValue(id, {\n value\n });\n }\n\n const element = document.createElement(\"input\");\n GetElementsByNameSet.add(element);\n element.setAttribute(\"data-element-id\", id);\n element.disabled = data.readOnly;\n\n this._setRequired(element, this.data.required);\n\n element.type = \"radio\";\n element.name = data.fieldName;\n\n if (value) {\n element.setAttribute(\"checked\", true);\n }\n\n element.tabIndex = DEFAULT_TAB_INDEX;\n element.addEventListener(\"change\", event => {\n const {\n name,\n checked\n } = event.target;\n\n for (const radio of this._getElementsByName(name, id)) {\n storage.setValue(radio.id, {\n value: false\n });\n }\n\n storage.setValue(id, {\n value: checked\n });\n });\n element.addEventListener(\"resetform\", event => {\n const defaultValue = data.defaultFieldValue;\n event.target.checked = defaultValue !== null && defaultValue !== undefined && defaultValue === data.buttonValue;\n });\n\n if (this.enableScripting && this.hasJSActions) {\n const pdfButtonValue = data.buttonValue;\n element.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value: event => {\n const checked = pdfButtonValue === event.detail.value;\n\n for (const radio of this._getElementsByName(event.target.name)) {\n const curChecked = checked && radio.id === id;\n\n if (radio.domElement) {\n radio.domElement.checked = curChecked;\n }\n\n storage.setValue(radio.id, {\n value: curChecked\n });\n }\n }\n };\n\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n this._setEventListeners(element, [[\"change\", \"Validate\"], [\"change\", \"Action\"], [\"focus\", \"Focus\"], [\"blur\", \"Blur\"], [\"mousedown\", \"Mouse Down\"], [\"mouseenter\", \"Mouse Enter\"], [\"mouseleave\", \"Mouse Exit\"], [\"mouseup\", \"Mouse Up\"]], event => event.target.checked);\n }\n\n this._setBackgroundColor(element);\n\n this._setDefaultPropertiesFromJS(element);\n\n this.container.append(element);\n return this.container;\n }\n\n}\n\nclass PushButtonWidgetAnnotationElement extends LinkAnnotationElement {\n constructor(parameters) {\n super(parameters, {\n ignoreBorder: parameters.data.hasAppearance\n });\n }\n\n render() {\n const container = super.render();\n container.className = \"buttonWidgetAnnotation pushButton\";\n\n if (this.data.alternativeText) {\n container.title = this.data.alternativeText;\n }\n\n const linkElement = container.lastChild;\n\n if (this.enableScripting && this.hasJSActions && linkElement) {\n this._setDefaultPropertiesFromJS(linkElement);\n\n linkElement.addEventListener(\"updatefromsandbox\", jsEvent => {\n this._dispatchEventFromSandbox({}, jsEvent);\n });\n }\n\n return container;\n }\n\n}\n\nclass ChoiceWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: parameters.renderForms\n });\n }\n\n render() {\n this.container.className = \"choiceWidgetAnnotation\";\n const storage = this.annotationStorage;\n const id = this.data.id;\n const storedData = storage.getValue(id, {\n value: this.data.fieldValue\n });\n const selectElement = document.createElement(\"select\");\n GetElementsByNameSet.add(selectElement);\n selectElement.setAttribute(\"data-element-id\", id);\n selectElement.disabled = this.data.readOnly;\n\n this._setRequired(selectElement, this.data.required);\n\n selectElement.name = this.data.fieldName;\n selectElement.tabIndex = DEFAULT_TAB_INDEX;\n let addAnEmptyEntry = this.data.combo && this.data.options.length > 0;\n\n if (!this.data.combo) {\n selectElement.size = this.data.options.length;\n\n if (this.data.multiSelect) {\n selectElement.multiple = true;\n }\n }\n\n selectElement.addEventListener(\"resetform\", event => {\n const defaultValue = this.data.defaultFieldValue;\n\n for (const option of selectElement.options) {\n option.selected = option.value === defaultValue;\n }\n });\n\n for (const option of this.data.options) {\n const optionElement = document.createElement(\"option\");\n optionElement.textContent = option.displayValue;\n optionElement.value = option.exportValue;\n\n if (storedData.value.includes(option.exportValue)) {\n optionElement.setAttribute(\"selected\", true);\n addAnEmptyEntry = false;\n }\n\n selectElement.append(optionElement);\n }\n\n let removeEmptyEntry = null;\n\n if (addAnEmptyEntry) {\n const noneOptionElement = document.createElement(\"option\");\n noneOptionElement.value = \" \";\n noneOptionElement.setAttribute(\"hidden\", true);\n noneOptionElement.setAttribute(\"selected\", true);\n selectElement.prepend(noneOptionElement);\n\n removeEmptyEntry = () => {\n noneOptionElement.remove();\n selectElement.removeEventListener(\"input\", removeEmptyEntry);\n removeEmptyEntry = null;\n };\n\n selectElement.addEventListener(\"input\", removeEmptyEntry);\n }\n\n const getValue = (event, isExport) => {\n const name = isExport ? \"value\" : \"textContent\";\n const options = event.target.options;\n\n if (!event.target.multiple) {\n return options.selectedIndex === -1 ? null : options[options.selectedIndex][name];\n }\n\n return Array.prototype.filter.call(options, option => option.selected).map(option => option[name]);\n };\n\n const getItems = event => {\n const options = event.target.options;\n return Array.prototype.map.call(options, option => {\n return {\n displayValue: option.textContent,\n exportValue: option.value\n };\n });\n };\n\n if (this.enableScripting && this.hasJSActions) {\n selectElement.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value(event) {\n removeEmptyEntry?.();\n const value = event.detail.value;\n const values = new Set(Array.isArray(value) ? value : [value]);\n\n for (const option of selectElement.options) {\n option.selected = values.has(option.value);\n }\n\n storage.setValue(id, {\n value: getValue(event, true)\n });\n },\n\n multipleSelection(event) {\n selectElement.multiple = true;\n },\n\n remove(event) {\n const options = selectElement.options;\n const index = event.detail.remove;\n options[index].selected = false;\n selectElement.remove(index);\n\n if (options.length > 0) {\n const i = Array.prototype.findIndex.call(options, option => option.selected);\n\n if (i === -1) {\n options[0].selected = true;\n }\n }\n\n storage.setValue(id, {\n value: getValue(event, true),\n items: getItems(event)\n });\n },\n\n clear(event) {\n while (selectElement.length !== 0) {\n selectElement.remove(0);\n }\n\n storage.setValue(id, {\n value: null,\n items: []\n });\n },\n\n insert(event) {\n const {\n index,\n displayValue,\n exportValue\n } = event.detail.insert;\n const selectChild = selectElement.children[index];\n const optionElement = document.createElement(\"option\");\n optionElement.textContent = displayValue;\n optionElement.value = exportValue;\n\n if (selectChild) {\n selectChild.before(optionElement);\n } else {\n selectElement.append(optionElement);\n }\n\n storage.setValue(id, {\n value: getValue(event, true),\n items: getItems(event)\n });\n },\n\n items(event) {\n const {\n items\n } = event.detail;\n\n while (selectElement.length !== 0) {\n selectElement.remove(0);\n }\n\n for (const item of items) {\n const {\n displayValue,\n exportValue\n } = item;\n const optionElement = document.createElement(\"option\");\n optionElement.textContent = displayValue;\n optionElement.value = exportValue;\n selectElement.append(optionElement);\n }\n\n if (selectElement.options.length > 0) {\n selectElement.options[0].selected = true;\n }\n\n storage.setValue(id, {\n value: getValue(event, true),\n items: getItems(event)\n });\n },\n\n indices(event) {\n const indices = new Set(event.detail.indices);\n\n for (const option of event.target.options) {\n option.selected = indices.has(option.index);\n }\n\n storage.setValue(id, {\n value: getValue(event, true)\n });\n },\n\n editable(event) {\n event.target.disabled = !event.detail.editable;\n }\n\n };\n\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n selectElement.addEventListener(\"input\", event => {\n const exportValue = getValue(event, true);\n const value = getValue(event, false);\n storage.setValue(id, {\n value: exportValue\n });\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n changeEx: exportValue,\n willCommit: true,\n commitKey: 1,\n keyDown: false\n }\n });\n });\n\n this._setEventListeners(selectElement, [[\"focus\", \"Focus\"], [\"blur\", \"Blur\"], [\"mousedown\", \"Mouse Down\"], [\"mouseenter\", \"Mouse Enter\"], [\"mouseleave\", \"Mouse Exit\"], [\"mouseup\", \"Mouse Up\"], [\"input\", \"Action\"]], event => event.target.checked);\n } else {\n selectElement.addEventListener(\"input\", function (event) {\n storage.setValue(id, {\n value: getValue(event, true)\n });\n });\n }\n\n if (this.data.combo) {\n this._setTextStyle(selectElement);\n } else {}\n\n this._setBackgroundColor(selectElement);\n\n this._setDefaultPropertiesFromJS(selectElement);\n\n this.container.append(selectElement);\n return this.container;\n }\n\n}\n\nclass PopupAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable\n });\n }\n\n render() {\n const IGNORE_TYPES = [\"Line\", \"Square\", \"Circle\", \"PolyLine\", \"Polygon\", \"Ink\"];\n this.container.className = \"popupAnnotation\";\n\n if (IGNORE_TYPES.includes(this.data.parentType)) {\n return this.container;\n }\n\n const selector = `[data-annotation-id=\"${this.data.parentId}\"]`;\n const parentElements = this.layer.querySelectorAll(selector);\n\n if (parentElements.length === 0) {\n return this.container;\n }\n\n const popup = new PopupElement({\n container: this.container,\n trigger: Array.from(parentElements),\n color: this.data.color,\n titleObj: this.data.titleObj,\n modificationDate: this.data.modificationDate,\n contentsObj: this.data.contentsObj,\n richText: this.data.richText\n });\n const page = this.page;\n\n const rect = _util.Util.normalizeRect([this.data.parentRect[0], page.view[3] - this.data.parentRect[1] + page.view[1], this.data.parentRect[2], page.view[3] - this.data.parentRect[3] + page.view[1]]);\n\n const popupLeft = rect[0] + this.data.parentRect[2] - this.data.parentRect[0];\n const popupTop = rect[1];\n const [pageLLx, pageLLy, pageURx, pageURy] = this.viewport.viewBox;\n const pageWidth = pageURx - pageLLx;\n const pageHeight = pageURy - pageLLy;\n this.container.style.left = `${100 * (popupLeft - pageLLx) / pageWidth}%`;\n this.container.style.top = `${100 * (popupTop - pageLLy) / pageHeight}%`;\n this.container.append(popup.render());\n return this.container;\n }\n\n}\n\nclass PopupElement {\n constructor(parameters) {\n this.container = parameters.container;\n this.trigger = parameters.trigger;\n this.color = parameters.color;\n this.titleObj = parameters.titleObj;\n this.modificationDate = parameters.modificationDate;\n this.contentsObj = parameters.contentsObj;\n this.richText = parameters.richText;\n this.hideWrapper = parameters.hideWrapper || false;\n this.pinned = false;\n }\n\n render() {\n const BACKGROUND_ENLIGHT = 0.7;\n const wrapper = document.createElement(\"div\");\n wrapper.className = \"popupWrapper\";\n this.hideElement = this.hideWrapper ? wrapper : this.container;\n this.hideElement.hidden = true;\n const popup = document.createElement(\"div\");\n popup.className = \"popup\";\n const color = this.color;\n\n if (color) {\n const r = BACKGROUND_ENLIGHT * (255 - color[0]) + color[0];\n const g = BACKGROUND_ENLIGHT * (255 - color[1]) + color[1];\n const b = BACKGROUND_ENLIGHT * (255 - color[2]) + color[2];\n popup.style.backgroundColor = _util.Util.makeHexColor(r | 0, g | 0, b | 0);\n }\n\n const title = document.createElement(\"h1\");\n title.dir = this.titleObj.dir;\n title.textContent = this.titleObj.str;\n popup.append(title);\n\n const dateObject = _display_utils.PDFDateString.toDateObject(this.modificationDate);\n\n if (dateObject) {\n const modificationDate = document.createElement(\"span\");\n modificationDate.className = \"popupDate\";\n modificationDate.textContent = \"{{date}}, {{time}}\";\n modificationDate.dataset.l10nId = \"annotation_date_string\";\n modificationDate.dataset.l10nArgs = JSON.stringify({\n date: dateObject.toLocaleDateString(),\n time: dateObject.toLocaleTimeString()\n });\n popup.append(modificationDate);\n }\n\n if (this.richText?.str && (!this.contentsObj?.str || this.contentsObj.str === this.richText.str)) {\n _xfa_layer.XfaLayer.render({\n xfaHtml: this.richText.html,\n intent: \"richText\",\n div: popup\n });\n\n popup.lastChild.className = \"richText popupContent\";\n } else {\n const contents = this._formatContents(this.contentsObj);\n\n popup.append(contents);\n }\n\n if (!Array.isArray(this.trigger)) {\n this.trigger = [this.trigger];\n }\n\n for (const element of this.trigger) {\n element.addEventListener(\"click\", this._toggle.bind(this));\n element.addEventListener(\"mouseover\", this._show.bind(this, false));\n element.addEventListener(\"mouseout\", this._hide.bind(this, false));\n }\n\n popup.addEventListener(\"click\", this._hide.bind(this, true));\n wrapper.append(popup);\n return wrapper;\n }\n\n _formatContents({\n str,\n dir\n }) {\n const p = document.createElement(\"p\");\n p.className = \"popupContent\";\n p.dir = dir;\n const lines = str.split(/(?:\\r\\n?|\\n)/);\n\n for (let i = 0, ii = lines.length; i < ii; ++i) {\n const line = lines[i];\n p.append(document.createTextNode(line));\n\n if (i < ii - 1) {\n p.append(document.createElement(\"br\"));\n }\n }\n\n return p;\n }\n\n _toggle() {\n if (this.pinned) {\n this._hide(true);\n } else {\n this._show(true);\n }\n }\n\n _show(pin = false) {\n if (pin) {\n this.pinned = true;\n }\n\n if (this.hideElement.hidden) {\n this.hideElement.hidden = false;\n this.container.style.zIndex = parseInt(this.container.style.zIndex) + 1000;\n }\n }\n\n _hide(unpin = true) {\n if (unpin) {\n this.pinned = false;\n }\n\n if (!this.hideElement.hidden && !this.pinned) {\n this.hideElement.hidden = true;\n this.container.style.zIndex = parseInt(this.container.style.zIndex) - 1000;\n }\n }\n\n}\n\nclass FreeTextAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable,\n ignoreBorder: true\n });\n this.textContent = parameters.data.textContent;\n }\n\n render() {\n this.container.className = \"freeTextAnnotation\";\n\n if (this.textContent) {\n const content = document.createElement(\"div\");\n content.className = \"annotationTextContent\";\n content.setAttribute(\"role\", \"comment\");\n\n for (const line of this.textContent) {\n const lineSpan = document.createElement(\"span\");\n lineSpan.textContent = line;\n content.append(lineSpan);\n }\n\n this.container.append(content);\n }\n\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n return this.container;\n }\n\n}\n\nclass LineAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable,\n ignoreBorder: true\n });\n }\n\n render() {\n this.container.className = \"lineAnnotation\";\n const data = this.data;\n const {\n width,\n height\n } = getRectDims(data.rect);\n const svg = this.svgFactory.create(width, height, true);\n const line = this.svgFactory.createElement(\"svg:line\");\n line.setAttribute(\"x1\", data.rect[2] - data.lineCoordinates[0]);\n line.setAttribute(\"y1\", data.rect[3] - data.lineCoordinates[1]);\n line.setAttribute(\"x2\", data.rect[2] - data.lineCoordinates[2]);\n line.setAttribute(\"y2\", data.rect[3] - data.lineCoordinates[3]);\n line.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n line.setAttribute(\"stroke\", \"transparent\");\n line.setAttribute(\"fill\", \"transparent\");\n svg.append(line);\n this.container.append(svg);\n\n this._createPopup(line, data);\n\n return this.container;\n }\n\n}\n\nclass SquareAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable,\n ignoreBorder: true\n });\n }\n\n render() {\n this.container.className = \"squareAnnotation\";\n const data = this.data;\n const {\n width,\n height\n } = getRectDims(data.rect);\n const svg = this.svgFactory.create(width, height, true);\n const borderWidth = data.borderStyle.width;\n const square = this.svgFactory.createElement(\"svg:rect\");\n square.setAttribute(\"x\", borderWidth / 2);\n square.setAttribute(\"y\", borderWidth / 2);\n square.setAttribute(\"width\", width - borderWidth);\n square.setAttribute(\"height\", height - borderWidth);\n square.setAttribute(\"stroke-width\", borderWidth || 1);\n square.setAttribute(\"stroke\", \"transparent\");\n square.setAttribute(\"fill\", \"transparent\");\n svg.append(square);\n this.container.append(svg);\n\n this._createPopup(square, data);\n\n return this.container;\n }\n\n}\n\nclass CircleAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable,\n ignoreBorder: true\n });\n }\n\n render() {\n this.container.className = \"circleAnnotation\";\n const data = this.data;\n const {\n width,\n height\n } = getRectDims(data.rect);\n const svg = this.svgFactory.create(width, height, true);\n const borderWidth = data.borderStyle.width;\n const circle = this.svgFactory.createElement(\"svg:ellipse\");\n circle.setAttribute(\"cx\", width / 2);\n circle.setAttribute(\"cy\", height / 2);\n circle.setAttribute(\"rx\", width / 2 - borderWidth / 2);\n circle.setAttribute(\"ry\", height / 2 - borderWidth / 2);\n circle.setAttribute(\"stroke-width\", borderWidth || 1);\n circle.setAttribute(\"stroke\", \"transparent\");\n circle.setAttribute(\"fill\", \"transparent\");\n svg.append(circle);\n this.container.append(svg);\n\n this._createPopup(circle, data);\n\n return this.container;\n }\n\n}\n\nclass PolylineAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable,\n ignoreBorder: true\n });\n this.containerClassName = \"polylineAnnotation\";\n this.svgElementName = \"svg:polyline\";\n }\n\n render() {\n this.container.className = this.containerClassName;\n const data = this.data;\n const {\n width,\n height\n } = getRectDims(data.rect);\n const svg = this.svgFactory.create(width, height, true);\n let points = [];\n\n for (const coordinate of data.vertices) {\n const x = coordinate.x - data.rect[0];\n const y = data.rect[3] - coordinate.y;\n points.push(x + \",\" + y);\n }\n\n points = points.join(\" \");\n const polyline = this.svgFactory.createElement(this.svgElementName);\n polyline.setAttribute(\"points\", points);\n polyline.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n polyline.setAttribute(\"stroke\", \"transparent\");\n polyline.setAttribute(\"fill\", \"transparent\");\n svg.append(polyline);\n this.container.append(svg);\n\n this._createPopup(polyline, data);\n\n return this.container;\n }\n\n}\n\nclass PolygonAnnotationElement extends PolylineAnnotationElement {\n constructor(parameters) {\n super(parameters);\n this.containerClassName = \"polygonAnnotation\";\n this.svgElementName = \"svg:polygon\";\n }\n\n}\n\nclass CaretAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable,\n ignoreBorder: true\n });\n }\n\n render() {\n this.container.className = \"caretAnnotation\";\n\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n return this.container;\n }\n\n}\n\nclass InkAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable,\n ignoreBorder: true\n });\n this.containerClassName = \"inkAnnotation\";\n this.svgElementName = \"svg:polyline\";\n }\n\n render() {\n this.container.className = this.containerClassName;\n const data = this.data;\n const {\n width,\n height\n } = getRectDims(data.rect);\n const svg = this.svgFactory.create(width, height, true);\n\n for (const inkList of data.inkLists) {\n let points = [];\n\n for (const coordinate of inkList) {\n const x = coordinate.x - data.rect[0];\n const y = data.rect[3] - coordinate.y;\n points.push(`${x},${y}`);\n }\n\n points = points.join(\" \");\n const polyline = this.svgFactory.createElement(this.svgElementName);\n polyline.setAttribute(\"points\", points);\n polyline.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n polyline.setAttribute(\"stroke\", \"transparent\");\n polyline.setAttribute(\"fill\", \"transparent\");\n\n this._createPopup(polyline, data);\n\n svg.append(polyline);\n }\n\n this.container.append(svg);\n return this.container;\n }\n\n}\n\nclass HighlightAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable,\n ignoreBorder: true,\n createQuadrilaterals: true\n });\n }\n\n render() {\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"highlightAnnotation\");\n }\n\n this.container.className = \"highlightAnnotation\";\n return this.container;\n }\n\n}\n\nclass UnderlineAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable,\n ignoreBorder: true,\n createQuadrilaterals: true\n });\n }\n\n render() {\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"underlineAnnotation\");\n }\n\n this.container.className = \"underlineAnnotation\";\n return this.container;\n }\n\n}\n\nclass SquigglyAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable,\n ignoreBorder: true,\n createQuadrilaterals: true\n });\n }\n\n render() {\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"squigglyAnnotation\");\n }\n\n this.container.className = \"squigglyAnnotation\";\n return this.container;\n }\n\n}\n\nclass StrikeOutAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable,\n ignoreBorder: true,\n createQuadrilaterals: true\n });\n }\n\n render() {\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n if (this.quadrilaterals) {\n return this._renderQuadrilaterals(\"strikeoutAnnotation\");\n }\n\n this.container.className = \"strikeoutAnnotation\";\n return this.container;\n }\n\n}\n\nclass StampAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str);\n super(parameters, {\n isRenderable,\n ignoreBorder: true\n });\n }\n\n render() {\n this.container.className = \"stampAnnotation\";\n\n if (!this.data.hasPopup) {\n this._createPopup(null, this.data);\n }\n\n return this.container;\n }\n\n}\n\nclass FileAttachmentAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: true\n });\n const {\n filename,\n content\n } = this.data.file;\n this.filename = (0, _display_utils.getFilenameFromUrl)(filename);\n this.content = content;\n this.linkService.eventBus?.dispatch(\"fileattachmentannotation\", {\n source: this,\n filename,\n content\n });\n }\n\n render() {\n this.container.className = \"fileAttachmentAnnotation\";\n const trigger = document.createElement(\"div\");\n trigger.className = \"popupTriggerArea\";\n trigger.addEventListener(\"dblclick\", this._download.bind(this));\n\n if (!this.data.hasPopup && (this.data.titleObj?.str || this.data.contentsObj?.str || this.data.richText)) {\n this._createPopup(trigger, this.data);\n }\n\n this.container.append(trigger);\n return this.container;\n }\n\n _download() {\n this.downloadManager?.openOrDownloadData(this.container, this.content, this.filename);\n }\n\n}\n\nclass AnnotationLayer {\n static #appendElement(element, id, div, accessibilityManager) {\n const contentElement = element.firstChild || element;\n contentElement.id = `${_display_utils.AnnotationPrefix}${id}`;\n div.append(element);\n accessibilityManager?.moveElementInDOM(div, element, contentElement, false);\n }\n\n static render(parameters) {\n const {\n annotations,\n div,\n viewport,\n accessibilityManager\n } = parameters;\n this.#setDimensions(div, viewport);\n let zIndex = 0;\n\n for (const data of annotations) {\n if (data.annotationType !== _util.AnnotationType.POPUP) {\n const {\n width,\n height\n } = getRectDims(data.rect);\n\n if (width <= 0 || height <= 0) {\n continue;\n }\n }\n\n const element = AnnotationElementFactory.create({\n data,\n layer: div,\n page: parameters.page,\n viewport,\n linkService: parameters.linkService,\n downloadManager: parameters.downloadManager,\n imageResourcesPath: parameters.imageResourcesPath || \"\",\n renderForms: parameters.renderForms !== false,\n svgFactory: new _display_utils.DOMSVGFactory(),\n annotationStorage: parameters.annotationStorage || new _annotation_storage.AnnotationStorage(),\n enableScripting: parameters.enableScripting,\n hasJSActions: parameters.hasJSActions,\n fieldObjects: parameters.fieldObjects,\n mouseState: parameters.mouseState || {\n isDown: false\n }\n });\n\n if (element.isRenderable) {\n const rendered = element.render();\n\n if (data.hidden) {\n rendered.style.visibility = \"hidden\";\n }\n\n if (Array.isArray(rendered)) {\n for (const renderedElement of rendered) {\n renderedElement.style.zIndex = zIndex++;\n AnnotationLayer.#appendElement(renderedElement, data.id, div, accessibilityManager);\n }\n } else {\n rendered.style.zIndex = zIndex++;\n\n if (element instanceof PopupAnnotationElement) {\n div.prepend(rendered);\n } else {\n AnnotationLayer.#appendElement(rendered, data.id, div, accessibilityManager);\n }\n }\n }\n }\n\n this.#setAnnotationCanvasMap(div, parameters.annotationCanvasMap);\n }\n\n static update(parameters) {\n const {\n annotationCanvasMap,\n div,\n viewport\n } = parameters;\n this.#setDimensions(div, viewport);\n this.#setAnnotationCanvasMap(div, annotationCanvasMap);\n div.hidden = false;\n }\n\n static #setDimensions(div, {\n width,\n height,\n rotation\n }) {\n const {\n style\n } = div;\n const flipOrientation = rotation % 180 !== 0,\n widthStr = Math.floor(width) + \"px\",\n heightStr = Math.floor(height) + \"px\";\n style.width = flipOrientation ? heightStr : widthStr;\n style.height = flipOrientation ? widthStr : heightStr;\n div.setAttribute(\"data-main-rotation\", rotation);\n }\n\n static #setAnnotationCanvasMap(div, annotationCanvasMap) {\n if (!annotationCanvasMap) {\n return;\n }\n\n for (const [id, canvas] of annotationCanvasMap) {\n const element = div.querySelector(`[data-annotation-id=\"${id}\"]`);\n\n if (!element) {\n continue;\n }\n\n const {\n firstChild\n } = element;\n\n if (!firstChild) {\n element.append(canvas);\n } else if (firstChild.nodeName === \"CANVAS\") {\n firstChild.replaceWith(canvas);\n } else {\n firstChild.before(canvas);\n }\n }\n\n annotationCanvasMap.clear();\n }\n\n}\n\nexports.AnnotationLayer = AnnotationLayer;\n\n/***/ }),\n/* 28 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.ColorConverters = void 0;\n\nfunction makeColorComp(n) {\n return Math.floor(Math.max(0, Math.min(1, n)) * 255).toString(16).padStart(2, \"0\");\n}\n\nclass ColorConverters {\n static CMYK_G([c, y, m, k]) {\n return [\"G\", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)];\n }\n\n static G_CMYK([g]) {\n return [\"CMYK\", 0, 0, 0, 1 - g];\n }\n\n static G_RGB([g]) {\n return [\"RGB\", g, g, g];\n }\n\n static G_HTML([g]) {\n const G = makeColorComp(g);\n return `#${G}${G}${G}`;\n }\n\n static RGB_G([r, g, b]) {\n return [\"G\", 0.3 * r + 0.59 * g + 0.11 * b];\n }\n\n static RGB_HTML([r, g, b]) {\n const R = makeColorComp(r);\n const G = makeColorComp(g);\n const B = makeColorComp(b);\n return `#${R}${G}${B}`;\n }\n\n static T_HTML() {\n return \"#00000000\";\n }\n\n static CMYK_RGB([c, y, m, k]) {\n return [\"RGB\", 1 - Math.min(1, c + k), 1 - Math.min(1, m + k), 1 - Math.min(1, y + k)];\n }\n\n static CMYK_HTML(components) {\n const rgb = this.CMYK_RGB(components).slice(1);\n return this.RGB_HTML(rgb);\n }\n\n static RGB_CMYK([r, g, b]) {\n const c = 1 - r;\n const m = 1 - g;\n const y = 1 - b;\n const k = Math.min(c, m, y);\n return [\"CMYK\", c, m, y, k];\n }\n\n}\n\nexports.ColorConverters = ColorConverters;\n\n/***/ }),\n/* 29 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.XfaLayer = void 0;\n\nvar _xfa_text = __w_pdfjs_require__(20);\n\nclass XfaLayer {\n static setupStorage(html, id, element, storage, intent) {\n const storedData = storage.getValue(id, {\n value: null\n });\n\n switch (element.name) {\n case \"textarea\":\n if (storedData.value !== null) {\n html.textContent = storedData.value;\n }\n\n if (intent === \"print\") {\n break;\n }\n\n html.addEventListener(\"input\", event => {\n storage.setValue(id, {\n value: event.target.value\n });\n });\n break;\n\n case \"input\":\n if (element.attributes.type === \"radio\" || element.attributes.type === \"checkbox\") {\n if (storedData.value === element.attributes.xfaOn) {\n html.setAttribute(\"checked\", true);\n } else if (storedData.value === element.attributes.xfaOff) {\n html.removeAttribute(\"checked\");\n }\n\n if (intent === \"print\") {\n break;\n }\n\n html.addEventListener(\"change\", event => {\n storage.setValue(id, {\n value: event.target.checked ? event.target.getAttribute(\"xfaOn\") : event.target.getAttribute(\"xfaOff\")\n });\n });\n } else {\n if (storedData.value !== null) {\n html.setAttribute(\"value\", storedData.value);\n }\n\n if (intent === \"print\") {\n break;\n }\n\n html.addEventListener(\"input\", event => {\n storage.setValue(id, {\n value: event.target.value\n });\n });\n }\n\n break;\n\n case \"select\":\n if (storedData.value !== null) {\n for (const option of element.children) {\n if (option.attributes.value === storedData.value) {\n option.attributes.selected = true;\n }\n }\n }\n\n html.addEventListener(\"input\", event => {\n const options = event.target.options;\n const value = options.selectedIndex === -1 ? \"\" : options[options.selectedIndex].value;\n storage.setValue(id, {\n value\n });\n });\n break;\n }\n }\n\n static setAttributes({\n html,\n element,\n storage = null,\n intent,\n linkService\n }) {\n const {\n attributes\n } = element;\n const isHTMLAnchorElement = html instanceof HTMLAnchorElement;\n\n if (attributes.type === \"radio\") {\n attributes.name = `${attributes.name}-${intent}`;\n }\n\n for (const [key, value] of Object.entries(attributes)) {\n if (value === null || value === undefined) {\n continue;\n }\n\n switch (key) {\n case \"class\":\n if (value.length) {\n html.setAttribute(key, value.join(\" \"));\n }\n\n break;\n\n case \"dataId\":\n break;\n\n case \"id\":\n html.setAttribute(\"data-element-id\", value);\n break;\n\n case \"style\":\n Object.assign(html.style, value);\n break;\n\n case \"textContent\":\n html.textContent = value;\n break;\n\n default:\n if (!isHTMLAnchorElement || key !== \"href\" && key !== \"newWindow\") {\n html.setAttribute(key, value);\n }\n\n }\n }\n\n if (isHTMLAnchorElement) {\n linkService.addLinkAttributes(html, attributes.href, attributes.newWindow);\n }\n\n if (storage && attributes.dataId) {\n this.setupStorage(html, attributes.dataId, element, storage);\n }\n }\n\n static render(parameters) {\n const storage = parameters.annotationStorage;\n const linkService = parameters.linkService;\n const root = parameters.xfaHtml;\n const intent = parameters.intent || \"display\";\n const rootHtml = document.createElement(root.name);\n\n if (root.attributes) {\n this.setAttributes({\n html: rootHtml,\n element: root,\n intent,\n linkService\n });\n }\n\n const stack = [[root, -1, rootHtml]];\n const rootDiv = parameters.div;\n rootDiv.append(rootHtml);\n\n if (parameters.viewport) {\n const transform = `matrix(${parameters.viewport.transform.join(\",\")})`;\n rootDiv.style.transform = transform;\n }\n\n if (intent !== \"richText\") {\n rootDiv.setAttribute(\"class\", \"xfaLayer xfaFont\");\n }\n\n const textDivs = [];\n\n while (stack.length > 0) {\n const [parent, i, html] = stack.at(-1);\n\n if (i + 1 === parent.children.length) {\n stack.pop();\n continue;\n }\n\n const child = parent.children[++stack.at(-1)[1]];\n\n if (child === null) {\n continue;\n }\n\n const {\n name\n } = child;\n\n if (name === \"#text\") {\n const node = document.createTextNode(child.value);\n textDivs.push(node);\n html.append(node);\n continue;\n }\n\n let childHtml;\n\n if (child?.attributes?.xmlns) {\n childHtml = document.createElementNS(child.attributes.xmlns, name);\n } else {\n childHtml = document.createElement(name);\n }\n\n html.append(childHtml);\n\n if (child.attributes) {\n this.setAttributes({\n html: childHtml,\n element: child,\n storage,\n intent,\n linkService\n });\n }\n\n if (child.children && child.children.length > 0) {\n stack.push([child, -1, childHtml]);\n } else if (child.value) {\n const node = document.createTextNode(child.value);\n\n if (_xfa_text.XfaText.shouldBuildText(name)) {\n textDivs.push(node);\n }\n\n childHtml.append(node);\n }\n }\n\n for (const el of rootDiv.querySelectorAll(\".xfaNonInteractive input, .xfaNonInteractive textarea\")) {\n el.setAttribute(\"readOnly\", true);\n }\n\n return {\n textDivs\n };\n }\n\n static update(parameters) {\n const transform = `matrix(${parameters.viewport.transform.join(\",\")})`;\n parameters.div.style.transform = transform;\n parameters.div.hidden = false;\n }\n\n}\n\nexports.XfaLayer = XfaLayer;\n\n/***/ }),\n/* 30 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.TextLayerRenderTask = void 0;\nexports.renderTextLayer = renderTextLayer;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _display_utils = __w_pdfjs_require__(8);\n\nconst MAX_TEXT_DIVS_TO_RENDER = 100000;\nconst DEFAULT_FONT_SIZE = 30;\nconst DEFAULT_FONT_ASCENT = 0.8;\nconst ascentCache = new Map();\nconst AllWhitespaceRegexp = /^\\s+$/g;\n\nfunction getAscent(fontFamily, ctx) {\n const cachedAscent = ascentCache.get(fontFamily);\n\n if (cachedAscent) {\n return cachedAscent;\n }\n\n ctx.save();\n ctx.font = `${DEFAULT_FONT_SIZE}px ${fontFamily}`;\n const metrics = ctx.measureText(\"\");\n let ascent = metrics.fontBoundingBoxAscent;\n let descent = Math.abs(metrics.fontBoundingBoxDescent);\n\n if (ascent) {\n ctx.restore();\n const ratio = ascent / (ascent + descent);\n ascentCache.set(fontFamily, ratio);\n return ratio;\n }\n\n ctx.strokeStyle = \"red\";\n ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n ctx.strokeText(\"g\", 0, 0);\n let pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data;\n descent = 0;\n\n for (let i = pixels.length - 1 - 3; i >= 0; i -= 4) {\n if (pixels[i] > 0) {\n descent = Math.ceil(i / 4 / DEFAULT_FONT_SIZE);\n break;\n }\n }\n\n ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n ctx.strokeText(\"A\", 0, DEFAULT_FONT_SIZE);\n pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data;\n ascent = 0;\n\n for (let i = 0, ii = pixels.length; i < ii; i += 4) {\n if (pixels[i] > 0) {\n ascent = DEFAULT_FONT_SIZE - Math.floor(i / 4 / DEFAULT_FONT_SIZE);\n break;\n }\n }\n\n ctx.restore();\n\n if (ascent) {\n const ratio = ascent / (ascent + descent);\n ascentCache.set(fontFamily, ratio);\n return ratio;\n }\n\n ascentCache.set(fontFamily, DEFAULT_FONT_ASCENT);\n return DEFAULT_FONT_ASCENT;\n}\n\nfunction appendText(task, geom, styles, ctx) {\n const textDiv = document.createElement(\"span\");\n const textDivProperties = task._enhanceTextSelection ? {\n angle: 0,\n canvasWidth: 0,\n hasText: geom.str !== \"\",\n hasEOL: geom.hasEOL,\n originalTransform: null,\n paddingBottom: 0,\n paddingLeft: 0,\n paddingRight: 0,\n paddingTop: 0,\n scale: 1,\n fontSize: 0\n } : {\n angle: 0,\n canvasWidth: 0,\n hasText: geom.str !== \"\",\n hasEOL: geom.hasEOL,\n fontSize: 0\n };\n\n task._textDivs.push(textDiv);\n\n const tx = _util.Util.transform(task._viewport.transform, geom.transform);\n\n let angle = Math.atan2(tx[1], tx[0]);\n const style = styles[geom.fontName];\n\n if (style.vertical) {\n angle += Math.PI / 2;\n }\n\n const fontHeight = Math.hypot(tx[2], tx[3]);\n const fontAscent = fontHeight * getAscent(style.fontFamily, ctx);\n let left, top;\n\n if (angle === 0) {\n left = tx[4];\n top = tx[5] - fontAscent;\n } else {\n left = tx[4] + fontAscent * Math.sin(angle);\n top = tx[5] - fontAscent * Math.cos(angle);\n }\n\n textDiv.style.left = `${left}px`;\n textDiv.style.top = `${top}px`;\n textDiv.style.fontSize = `${fontHeight}px`;\n textDiv.style.fontFamily = style.fontFamily;\n textDivProperties.fontSize = fontHeight;\n textDiv.setAttribute(\"role\", \"presentation\");\n textDiv.textContent = geom.str;\n textDiv.dir = geom.dir;\n\n if (task._fontInspectorEnabled) {\n textDiv.dataset.fontName = geom.fontName;\n }\n\n if (angle !== 0) {\n textDivProperties.angle = angle * (180 / Math.PI);\n }\n\n let shouldScaleText = false;\n\n if (geom.str.length > 1 || task._enhanceTextSelection && AllWhitespaceRegexp.test(geom.str)) {\n shouldScaleText = true;\n } else if (geom.str !== \" \" && geom.transform[0] !== geom.transform[3]) {\n const absScaleX = Math.abs(geom.transform[0]),\n absScaleY = Math.abs(geom.transform[3]);\n\n if (absScaleX !== absScaleY && Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5) {\n shouldScaleText = true;\n }\n }\n\n if (shouldScaleText) {\n if (style.vertical) {\n textDivProperties.canvasWidth = geom.height * task._viewport.scale;\n } else {\n textDivProperties.canvasWidth = geom.width * task._viewport.scale;\n }\n }\n\n task._textDivProperties.set(textDiv, textDivProperties);\n\n if (task._textContentStream) {\n task._layoutText(textDiv);\n }\n\n if (task._enhanceTextSelection && textDivProperties.hasText) {\n let angleCos = 1,\n angleSin = 0;\n\n if (angle !== 0) {\n angleCos = Math.cos(angle);\n angleSin = Math.sin(angle);\n }\n\n const divWidth = (style.vertical ? geom.height : geom.width) * task._viewport.scale;\n const divHeight = fontHeight;\n let m, b;\n\n if (angle !== 0) {\n m = [angleCos, angleSin, -angleSin, angleCos, left, top];\n b = _util.Util.getAxialAlignedBoundingBox([0, 0, divWidth, divHeight], m);\n } else {\n b = [left, top, left + divWidth, top + divHeight];\n }\n\n task._bounds.push({\n left: b[0],\n top: b[1],\n right: b[2],\n bottom: b[3],\n div: textDiv,\n size: [divWidth, divHeight],\n m\n });\n }\n}\n\nfunction render(task) {\n if (task._canceled) {\n return;\n }\n\n const textDivs = task._textDivs;\n const capability = task._capability;\n const textDivsLength = textDivs.length;\n\n if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) {\n task._renderingDone = true;\n capability.resolve();\n return;\n }\n\n if (!task._textContentStream) {\n for (let i = 0; i < textDivsLength; i++) {\n task._layoutText(textDivs[i]);\n }\n }\n\n task._renderingDone = true;\n capability.resolve();\n}\n\nfunction findPositiveMin(ts, offset, count) {\n let result = 0;\n\n for (let i = 0; i < count; i++) {\n const t = ts[offset++];\n\n if (t > 0) {\n result = result ? Math.min(t, result) : t;\n }\n }\n\n return result;\n}\n\nfunction expand(task) {\n const bounds = task._bounds;\n const viewport = task._viewport;\n const expanded = expandBounds(viewport.width, viewport.height, bounds);\n\n for (let i = 0; i < expanded.length; i++) {\n const div = bounds[i].div;\n\n const divProperties = task._textDivProperties.get(div);\n\n if (divProperties.angle === 0) {\n divProperties.paddingLeft = bounds[i].left - expanded[i].left;\n divProperties.paddingTop = bounds[i].top - expanded[i].top;\n divProperties.paddingRight = expanded[i].right - bounds[i].right;\n divProperties.paddingBottom = expanded[i].bottom - bounds[i].bottom;\n\n task._textDivProperties.set(div, divProperties);\n\n continue;\n }\n\n const e = expanded[i],\n b = bounds[i];\n const m = b.m,\n c = m[0],\n s = m[1];\n const points = [[0, 0], [0, b.size[1]], [b.size[0], 0], b.size];\n const ts = new Float64Array(64);\n\n for (let j = 0, jj = points.length; j < jj; j++) {\n const t = _util.Util.applyTransform(points[j], m);\n\n ts[j + 0] = c && (e.left - t[0]) / c;\n ts[j + 4] = s && (e.top - t[1]) / s;\n ts[j + 8] = c && (e.right - t[0]) / c;\n ts[j + 12] = s && (e.bottom - t[1]) / s;\n ts[j + 16] = s && (e.left - t[0]) / -s;\n ts[j + 20] = c && (e.top - t[1]) / c;\n ts[j + 24] = s && (e.right - t[0]) / -s;\n ts[j + 28] = c && (e.bottom - t[1]) / c;\n ts[j + 32] = c && (e.left - t[0]) / -c;\n ts[j + 36] = s && (e.top - t[1]) / -s;\n ts[j + 40] = c && (e.right - t[0]) / -c;\n ts[j + 44] = s && (e.bottom - t[1]) / -s;\n ts[j + 48] = s && (e.left - t[0]) / s;\n ts[j + 52] = c && (e.top - t[1]) / -c;\n ts[j + 56] = s && (e.right - t[0]) / s;\n ts[j + 60] = c && (e.bottom - t[1]) / -c;\n }\n\n const boxScale = 1 + Math.min(Math.abs(c), Math.abs(s));\n divProperties.paddingLeft = findPositiveMin(ts, 32, 16) / boxScale;\n divProperties.paddingTop = findPositiveMin(ts, 48, 16) / boxScale;\n divProperties.paddingRight = findPositiveMin(ts, 0, 16) / boxScale;\n divProperties.paddingBottom = findPositiveMin(ts, 16, 16) / boxScale;\n\n task._textDivProperties.set(div, divProperties);\n }\n}\n\nfunction expandBounds(width, height, boxes) {\n const bounds = boxes.map(function (box, i) {\n return {\n x1: box.left,\n y1: box.top,\n x2: box.right,\n y2: box.bottom,\n index: i,\n x1New: undefined,\n x2New: undefined\n };\n });\n expandBoundsLTR(width, bounds);\n const expanded = new Array(boxes.length);\n\n for (const b of bounds) {\n const i = b.index;\n expanded[i] = {\n left: b.x1New,\n top: 0,\n right: b.x2New,\n bottom: 0\n };\n }\n\n boxes.map(function (box, i) {\n const e = expanded[i],\n b = bounds[i];\n b.x1 = box.top;\n b.y1 = width - e.right;\n b.x2 = box.bottom;\n b.y2 = width - e.left;\n b.index = i;\n b.x1New = undefined;\n b.x2New = undefined;\n });\n expandBoundsLTR(height, bounds);\n\n for (const b of bounds) {\n const i = b.index;\n expanded[i].top = b.x1New;\n expanded[i].bottom = b.x2New;\n }\n\n return expanded;\n}\n\nfunction expandBoundsLTR(width, bounds) {\n bounds.sort(function (a, b) {\n return a.x1 - b.x1 || a.index - b.index;\n });\n const fakeBoundary = {\n x1: -Infinity,\n y1: -Infinity,\n x2: 0,\n y2: Infinity,\n index: -1,\n x1New: 0,\n x2New: 0\n };\n const horizon = [{\n start: -Infinity,\n end: Infinity,\n boundary: fakeBoundary\n }];\n\n for (const boundary of bounds) {\n let i = 0;\n\n while (i < horizon.length && horizon[i].end <= boundary.y1) {\n i++;\n }\n\n let j = horizon.length - 1;\n\n while (j >= 0 && horizon[j].start >= boundary.y2) {\n j--;\n }\n\n let horizonPart, affectedBoundary;\n let q,\n k,\n maxXNew = -Infinity;\n\n for (q = i; q <= j; q++) {\n horizonPart = horizon[q];\n affectedBoundary = horizonPart.boundary;\n let xNew;\n\n if (affectedBoundary.x2 > boundary.x1) {\n xNew = affectedBoundary.index > boundary.index ? affectedBoundary.x1New : boundary.x1;\n } else if (affectedBoundary.x2New === undefined) {\n xNew = (affectedBoundary.x2 + boundary.x1) / 2;\n } else {\n xNew = affectedBoundary.x2New;\n }\n\n if (xNew > maxXNew) {\n maxXNew = xNew;\n }\n }\n\n boundary.x1New = maxXNew;\n\n for (q = i; q <= j; q++) {\n horizonPart = horizon[q];\n affectedBoundary = horizonPart.boundary;\n\n if (affectedBoundary.x2New === undefined) {\n if (affectedBoundary.x2 > boundary.x1) {\n if (affectedBoundary.index > boundary.index) {\n affectedBoundary.x2New = affectedBoundary.x2;\n }\n } else {\n affectedBoundary.x2New = maxXNew;\n }\n } else if (affectedBoundary.x2New > maxXNew) {\n affectedBoundary.x2New = Math.max(maxXNew, affectedBoundary.x2);\n }\n }\n\n const changedHorizon = [];\n let lastBoundary = null;\n\n for (q = i; q <= j; q++) {\n horizonPart = horizon[q];\n affectedBoundary = horizonPart.boundary;\n const useBoundary = affectedBoundary.x2 > boundary.x2 ? affectedBoundary : boundary;\n\n if (lastBoundary === useBoundary) {\n changedHorizon.at(-1).end = horizonPart.end;\n } else {\n changedHorizon.push({\n start: horizonPart.start,\n end: horizonPart.end,\n boundary: useBoundary\n });\n lastBoundary = useBoundary;\n }\n }\n\n if (horizon[i].start < boundary.y1) {\n changedHorizon[0].start = boundary.y1;\n changedHorizon.unshift({\n start: horizon[i].start,\n end: boundary.y1,\n boundary: horizon[i].boundary\n });\n }\n\n if (boundary.y2 < horizon[j].end) {\n changedHorizon.at(-1).end = boundary.y2;\n changedHorizon.push({\n start: boundary.y2,\n end: horizon[j].end,\n boundary: horizon[j].boundary\n });\n }\n\n for (q = i; q <= j; q++) {\n horizonPart = horizon[q];\n affectedBoundary = horizonPart.boundary;\n\n if (affectedBoundary.x2New !== undefined) {\n continue;\n }\n\n let used = false;\n\n for (k = i - 1; !used && k >= 0 && horizon[k].start >= affectedBoundary.y1; k--) {\n used = horizon[k].boundary === affectedBoundary;\n }\n\n for (k = j + 1; !used && k < horizon.length && horizon[k].end <= affectedBoundary.y2; k++) {\n used = horizon[k].boundary === affectedBoundary;\n }\n\n for (k = 0; !used && k < changedHorizon.length; k++) {\n used = changedHorizon[k].boundary === affectedBoundary;\n }\n\n if (!used) {\n affectedBoundary.x2New = maxXNew;\n }\n }\n\n Array.prototype.splice.apply(horizon, [i, j - i + 1, ...changedHorizon]);\n }\n\n for (const horizonPart of horizon) {\n const affectedBoundary = horizonPart.boundary;\n\n if (affectedBoundary.x2New === undefined) {\n affectedBoundary.x2New = Math.max(width, affectedBoundary.x2);\n }\n }\n}\n\nclass TextLayerRenderTask {\n constructor({\n textContent,\n textContentStream,\n container,\n viewport,\n textDivs,\n textContentItemsStr,\n enhanceTextSelection\n }) {\n if (enhanceTextSelection) {\n (0, _display_utils.deprecated)(\"The `enhanceTextSelection` functionality will be removed in the future.\");\n }\n\n this._textContent = textContent;\n this._textContentStream = textContentStream;\n this._container = container;\n this._document = container.ownerDocument;\n this._viewport = viewport;\n this._textDivs = textDivs || [];\n this._textContentItemsStr = textContentItemsStr || [];\n this._enhanceTextSelection = !!enhanceTextSelection;\n this._fontInspectorEnabled = !!globalThis.FontInspector?.enabled;\n this._reader = null;\n this._layoutTextLastFontSize = null;\n this._layoutTextLastFontFamily = null;\n this._layoutTextCtx = null;\n this._textDivProperties = new WeakMap();\n this._renderingDone = false;\n this._canceled = false;\n this._capability = (0, _util.createPromiseCapability)();\n this._renderTimer = null;\n this._bounds = [];\n this._devicePixelRatio = globalThis.devicePixelRatio || 1;\n\n this._capability.promise.finally(() => {\n if (!this._enhanceTextSelection) {\n this._textDivProperties = null;\n }\n\n if (this._layoutTextCtx) {\n this._layoutTextCtx.canvas.width = 0;\n this._layoutTextCtx.canvas.height = 0;\n this._layoutTextCtx = null;\n }\n }).catch(() => {});\n }\n\n get promise() {\n return this._capability.promise;\n }\n\n cancel() {\n this._canceled = true;\n\n if (this._reader) {\n this._reader.cancel(new _util.AbortException(\"TextLayer task cancelled.\")).catch(() => {});\n\n this._reader = null;\n }\n\n if (this._renderTimer !== null) {\n clearTimeout(this._renderTimer);\n this._renderTimer = null;\n }\n\n this._capability.reject(new Error(\"TextLayer task cancelled.\"));\n }\n\n _processItems(items, styleCache) {\n for (let i = 0, len = items.length; i < len; i++) {\n if (items[i].str === undefined) {\n if (items[i].type === \"beginMarkedContentProps\" || items[i].type === \"beginMarkedContent\") {\n const parent = this._container;\n this._container = document.createElement(\"span\");\n\n this._container.classList.add(\"markedContent\");\n\n if (items[i].id !== null) {\n this._container.setAttribute(\"id\", `${items[i].id}`);\n }\n\n parent.append(this._container);\n } else if (items[i].type === \"endMarkedContent\") {\n this._container = this._container.parentNode;\n }\n\n continue;\n }\n\n this._textContentItemsStr.push(items[i].str);\n\n appendText(this, items[i], styleCache, this._layoutTextCtx);\n }\n }\n\n _layoutText(textDiv) {\n const textDivProperties = this._textDivProperties.get(textDiv);\n\n let transform = \"\";\n\n if (textDivProperties.canvasWidth !== 0 && textDivProperties.hasText) {\n const {\n fontFamily\n } = textDiv.style;\n const {\n fontSize\n } = textDivProperties;\n\n if (fontSize !== this._layoutTextLastFontSize || fontFamily !== this._layoutTextLastFontFamily) {\n this._layoutTextCtx.font = `${fontSize * this._devicePixelRatio}px ${fontFamily}`;\n this._layoutTextLastFontSize = fontSize;\n this._layoutTextLastFontFamily = fontFamily;\n }\n\n const {\n width\n } = this._layoutTextCtx.measureText(textDiv.textContent);\n\n if (width > 0) {\n const scale = this._devicePixelRatio * textDivProperties.canvasWidth / width;\n\n if (this._enhanceTextSelection) {\n textDivProperties.scale = scale;\n }\n\n transform = `scaleX(${scale})`;\n }\n }\n\n if (textDivProperties.angle !== 0) {\n transform = `rotate(${textDivProperties.angle}deg) ${transform}`;\n }\n\n if (transform.length > 0) {\n if (this._enhanceTextSelection) {\n textDivProperties.originalTransform = transform;\n }\n\n textDiv.style.transform = transform;\n }\n\n if (textDivProperties.hasText) {\n this._container.append(textDiv);\n }\n\n if (textDivProperties.hasEOL) {\n const br = document.createElement(\"br\");\n br.setAttribute(\"role\", \"presentation\");\n\n this._container.append(br);\n }\n }\n\n _render(timeout = 0) {\n const capability = (0, _util.createPromiseCapability)();\n let styleCache = Object.create(null);\n\n const canvas = this._document.createElement(\"canvas\");\n\n canvas.height = canvas.width = DEFAULT_FONT_SIZE;\n this._layoutTextCtx = canvas.getContext(\"2d\", {\n alpha: false\n });\n\n if (this._textContent) {\n const textItems = this._textContent.items;\n const textStyles = this._textContent.styles;\n\n this._processItems(textItems, textStyles);\n\n capability.resolve();\n } else if (this._textContentStream) {\n const pump = () => {\n this._reader.read().then(({\n value,\n done\n }) => {\n if (done) {\n capability.resolve();\n return;\n }\n\n Object.assign(styleCache, value.styles);\n\n this._processItems(value.items, styleCache);\n\n pump();\n }, capability.reject);\n };\n\n this._reader = this._textContentStream.getReader();\n pump();\n } else {\n throw new Error('Neither \"textContent\" nor \"textContentStream\" parameters specified.');\n }\n\n capability.promise.then(() => {\n styleCache = null;\n\n if (!timeout) {\n render(this);\n } else {\n this._renderTimer = setTimeout(() => {\n render(this);\n this._renderTimer = null;\n }, timeout);\n }\n }, this._capability.reject);\n }\n\n expandTextDivs(expandDivs = false) {\n if (!this._enhanceTextSelection || !this._renderingDone) {\n return;\n }\n\n if (this._bounds !== null) {\n expand(this);\n this._bounds = null;\n }\n\n const transformBuf = [],\n paddingBuf = [];\n\n for (let i = 0, ii = this._textDivs.length; i < ii; i++) {\n const div = this._textDivs[i];\n\n const divProps = this._textDivProperties.get(div);\n\n if (!divProps.hasText) {\n continue;\n }\n\n if (expandDivs) {\n transformBuf.length = 0;\n paddingBuf.length = 0;\n\n if (divProps.originalTransform) {\n transformBuf.push(divProps.originalTransform);\n }\n\n if (divProps.paddingTop > 0) {\n paddingBuf.push(`${divProps.paddingTop}px`);\n transformBuf.push(`translateY(${-divProps.paddingTop}px)`);\n } else {\n paddingBuf.push(0);\n }\n\n if (divProps.paddingRight > 0) {\n paddingBuf.push(`${divProps.paddingRight / divProps.scale}px`);\n } else {\n paddingBuf.push(0);\n }\n\n if (divProps.paddingBottom > 0) {\n paddingBuf.push(`${divProps.paddingBottom}px`);\n } else {\n paddingBuf.push(0);\n }\n\n if (divProps.paddingLeft > 0) {\n paddingBuf.push(`${divProps.paddingLeft / divProps.scale}px`);\n transformBuf.push(`translateX(${-divProps.paddingLeft / divProps.scale}px)`);\n } else {\n paddingBuf.push(0);\n }\n\n div.style.padding = paddingBuf.join(\" \");\n\n if (transformBuf.length) {\n div.style.transform = transformBuf.join(\" \");\n }\n } else {\n div.style.padding = null;\n div.style.transform = divProps.originalTransform;\n }\n }\n }\n\n}\n\nexports.TextLayerRenderTask = TextLayerRenderTask;\n\nfunction renderTextLayer(renderParameters) {\n const task = new TextLayerRenderTask({\n textContent: renderParameters.textContent,\n textContentStream: renderParameters.textContentStream,\n container: renderParameters.container,\n viewport: renderParameters.viewport,\n textDivs: renderParameters.textDivs,\n textContentItemsStr: renderParameters.textContentItemsStr,\n enhanceTextSelection: renderParameters.enhanceTextSelection\n });\n\n task._render(renderParameters.timeout);\n\n return task;\n}\n\n/***/ }),\n/* 31 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.SVGGraphics = void 0;\n\nvar _display_utils = __w_pdfjs_require__(8);\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _is_node = __w_pdfjs_require__(3);\n\nlet SVGGraphics = class {\n constructor() {\n (0, _util.unreachable)(\"Not implemented: SVGGraphics\");\n }\n\n};\nexports.SVGGraphics = SVGGraphics;\n{\n const SVG_DEFAULTS = {\n fontStyle: \"normal\",\n fontWeight: \"normal\",\n fillColor: \"#000000\"\n };\n const XML_NS = \"http://www.w3.org/XML/1998/namespace\";\n const XLINK_NS = \"http://www.w3.org/1999/xlink\";\n const LINE_CAP_STYLES = [\"butt\", \"round\", \"square\"];\n const LINE_JOIN_STYLES = [\"miter\", \"round\", \"bevel\"];\n\n const createObjectURL = function (data, contentType = \"\", forceDataSchema = false) {\n if (URL.createObjectURL && typeof Blob !== \"undefined\" && !forceDataSchema) {\n return URL.createObjectURL(new Blob([data], {\n type: contentType\n }));\n }\n\n const digits = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n let buffer = `data:${contentType};base64,`;\n\n for (let i = 0, ii = data.length; i < ii; i += 3) {\n const b1 = data[i] & 0xff;\n const b2 = data[i + 1] & 0xff;\n const b3 = data[i + 2] & 0xff;\n const d1 = b1 >> 2,\n d2 = (b1 & 3) << 4 | b2 >> 4;\n const d3 = i + 1 < ii ? (b2 & 0xf) << 2 | b3 >> 6 : 64;\n const d4 = i + 2 < ii ? b3 & 0x3f : 64;\n buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4];\n }\n\n return buffer;\n };\n\n const convertImgDataToPng = function () {\n const PNG_HEADER = new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);\n const CHUNK_WRAPPER_SIZE = 12;\n const crcTable = new Int32Array(256);\n\n for (let i = 0; i < 256; i++) {\n let c = i;\n\n for (let h = 0; h < 8; h++) {\n if (c & 1) {\n c = 0xedb88320 ^ c >> 1 & 0x7fffffff;\n } else {\n c = c >> 1 & 0x7fffffff;\n }\n }\n\n crcTable[i] = c;\n }\n\n function crc32(data, start, end) {\n let crc = -1;\n\n for (let i = start; i < end; i++) {\n const a = (crc ^ data[i]) & 0xff;\n const b = crcTable[a];\n crc = crc >>> 8 ^ b;\n }\n\n return crc ^ -1;\n }\n\n function writePngChunk(type, body, data, offset) {\n let p = offset;\n const len = body.length;\n data[p] = len >> 24 & 0xff;\n data[p + 1] = len >> 16 & 0xff;\n data[p + 2] = len >> 8 & 0xff;\n data[p + 3] = len & 0xff;\n p += 4;\n data[p] = type.charCodeAt(0) & 0xff;\n data[p + 1] = type.charCodeAt(1) & 0xff;\n data[p + 2] = type.charCodeAt(2) & 0xff;\n data[p + 3] = type.charCodeAt(3) & 0xff;\n p += 4;\n data.set(body, p);\n p += body.length;\n const crc = crc32(data, offset + 4, p);\n data[p] = crc >> 24 & 0xff;\n data[p + 1] = crc >> 16 & 0xff;\n data[p + 2] = crc >> 8 & 0xff;\n data[p + 3] = crc & 0xff;\n }\n\n function adler32(data, start, end) {\n let a = 1;\n let b = 0;\n\n for (let i = start; i < end; ++i) {\n a = (a + (data[i] & 0xff)) % 65521;\n b = (b + a) % 65521;\n }\n\n return b << 16 | a;\n }\n\n function deflateSync(literals) {\n if (!_is_node.isNodeJS) {\n return deflateSyncUncompressed(literals);\n }\n\n try {\n let input;\n\n if (parseInt(process.versions.node) >= 8) {\n input = literals;\n } else {\n input = Buffer.from(literals);\n }\n\n const output = require(\"zlib\").deflateSync(input, {\n level: 9\n });\n\n return output instanceof Uint8Array ? output : new Uint8Array(output);\n } catch (e) {\n (0, _util.warn)(\"Not compressing PNG because zlib.deflateSync is unavailable: \" + e);\n }\n\n return deflateSyncUncompressed(literals);\n }\n\n function deflateSyncUncompressed(literals) {\n let len = literals.length;\n const maxBlockLength = 0xffff;\n const deflateBlocks = Math.ceil(len / maxBlockLength);\n const idat = new Uint8Array(2 + len + deflateBlocks * 5 + 4);\n let pi = 0;\n idat[pi++] = 0x78;\n idat[pi++] = 0x9c;\n let pos = 0;\n\n while (len > maxBlockLength) {\n idat[pi++] = 0x00;\n idat[pi++] = 0xff;\n idat[pi++] = 0xff;\n idat[pi++] = 0x00;\n idat[pi++] = 0x00;\n idat.set(literals.subarray(pos, pos + maxBlockLength), pi);\n pi += maxBlockLength;\n pos += maxBlockLength;\n len -= maxBlockLength;\n }\n\n idat[pi++] = 0x01;\n idat[pi++] = len & 0xff;\n idat[pi++] = len >> 8 & 0xff;\n idat[pi++] = ~len & 0xffff & 0xff;\n idat[pi++] = (~len & 0xffff) >> 8 & 0xff;\n idat.set(literals.subarray(pos), pi);\n pi += literals.length - pos;\n const adler = adler32(literals, 0, literals.length);\n idat[pi++] = adler >> 24 & 0xff;\n idat[pi++] = adler >> 16 & 0xff;\n idat[pi++] = adler >> 8 & 0xff;\n idat[pi++] = adler & 0xff;\n return idat;\n }\n\n function encode(imgData, kind, forceDataSchema, isMask) {\n const width = imgData.width;\n const height = imgData.height;\n let bitDepth, colorType, lineSize;\n const bytes = imgData.data;\n\n switch (kind) {\n case _util.ImageKind.GRAYSCALE_1BPP:\n colorType = 0;\n bitDepth = 1;\n lineSize = width + 7 >> 3;\n break;\n\n case _util.ImageKind.RGB_24BPP:\n colorType = 2;\n bitDepth = 8;\n lineSize = width * 3;\n break;\n\n case _util.ImageKind.RGBA_32BPP:\n colorType = 6;\n bitDepth = 8;\n lineSize = width * 4;\n break;\n\n default:\n throw new Error(\"invalid format\");\n }\n\n const literals = new Uint8Array((1 + lineSize) * height);\n let offsetLiterals = 0,\n offsetBytes = 0;\n\n for (let y = 0; y < height; ++y) {\n literals[offsetLiterals++] = 0;\n literals.set(bytes.subarray(offsetBytes, offsetBytes + lineSize), offsetLiterals);\n offsetBytes += lineSize;\n offsetLiterals += lineSize;\n }\n\n if (kind === _util.ImageKind.GRAYSCALE_1BPP && isMask) {\n offsetLiterals = 0;\n\n for (let y = 0; y < height; y++) {\n offsetLiterals++;\n\n for (let i = 0; i < lineSize; i++) {\n literals[offsetLiterals++] ^= 0xff;\n }\n }\n }\n\n const ihdr = new Uint8Array([width >> 24 & 0xff, width >> 16 & 0xff, width >> 8 & 0xff, width & 0xff, height >> 24 & 0xff, height >> 16 & 0xff, height >> 8 & 0xff, height & 0xff, bitDepth, colorType, 0x00, 0x00, 0x00]);\n const idat = deflateSync(literals);\n const pngLength = PNG_HEADER.length + CHUNK_WRAPPER_SIZE * 3 + ihdr.length + idat.length;\n const data = new Uint8Array(pngLength);\n let offset = 0;\n data.set(PNG_HEADER, offset);\n offset += PNG_HEADER.length;\n writePngChunk(\"IHDR\", ihdr, data, offset);\n offset += CHUNK_WRAPPER_SIZE + ihdr.length;\n writePngChunk(\"IDATA\", idat, data, offset);\n offset += CHUNK_WRAPPER_SIZE + idat.length;\n writePngChunk(\"IEND\", new Uint8Array(0), data, offset);\n return createObjectURL(data, \"image/png\", forceDataSchema);\n }\n\n return function convertImgDataToPng(imgData, forceDataSchema, isMask) {\n const kind = imgData.kind === undefined ? _util.ImageKind.GRAYSCALE_1BPP : imgData.kind;\n return encode(imgData, kind, forceDataSchema, isMask);\n };\n }();\n\n class SVGExtraState {\n constructor() {\n this.fontSizeScale = 1;\n this.fontWeight = SVG_DEFAULTS.fontWeight;\n this.fontSize = 0;\n this.textMatrix = _util.IDENTITY_MATRIX;\n this.fontMatrix = _util.FONT_IDENTITY_MATRIX;\n this.leading = 0;\n this.textRenderingMode = _util.TextRenderingMode.FILL;\n this.textMatrixScale = 1;\n this.x = 0;\n this.y = 0;\n this.lineX = 0;\n this.lineY = 0;\n this.charSpacing = 0;\n this.wordSpacing = 0;\n this.textHScale = 1;\n this.textRise = 0;\n this.fillColor = SVG_DEFAULTS.fillColor;\n this.strokeColor = \"#000000\";\n this.fillAlpha = 1;\n this.strokeAlpha = 1;\n this.lineWidth = 1;\n this.lineJoin = \"\";\n this.lineCap = \"\";\n this.miterLimit = 0;\n this.dashArray = [];\n this.dashPhase = 0;\n this.dependencies = [];\n this.activeClipUrl = null;\n this.clipGroup = null;\n this.maskId = \"\";\n }\n\n clone() {\n return Object.create(this);\n }\n\n setCurrentPoint(x, y) {\n this.x = x;\n this.y = y;\n }\n\n }\n\n function opListToTree(opList) {\n let opTree = [];\n const tmp = [];\n\n for (const opListElement of opList) {\n if (opListElement.fn === \"save\") {\n opTree.push({\n fnId: 92,\n fn: \"group\",\n items: []\n });\n tmp.push(opTree);\n opTree = opTree.at(-1).items;\n continue;\n }\n\n if (opListElement.fn === \"restore\") {\n opTree = tmp.pop();\n } else {\n opTree.push(opListElement);\n }\n }\n\n return opTree;\n }\n\n function pf(value) {\n if (Number.isInteger(value)) {\n return value.toString();\n }\n\n const s = value.toFixed(10);\n let i = s.length - 1;\n\n if (s[i] !== \"0\") {\n return s;\n }\n\n do {\n i--;\n } while (s[i] === \"0\");\n\n return s.substring(0, s[i] === \".\" ? i : i + 1);\n }\n\n function pm(m) {\n if (m[4] === 0 && m[5] === 0) {\n if (m[1] === 0 && m[2] === 0) {\n if (m[0] === 1 && m[3] === 1) {\n return \"\";\n }\n\n return `scale(${pf(m[0])} ${pf(m[3])})`;\n }\n\n if (m[0] === m[3] && m[1] === -m[2]) {\n const a = Math.acos(m[0]) * 180 / Math.PI;\n return `rotate(${pf(a)})`;\n }\n } else {\n if (m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1) {\n return `translate(${pf(m[4])} ${pf(m[5])})`;\n }\n }\n\n return `matrix(${pf(m[0])} ${pf(m[1])} ${pf(m[2])} ${pf(m[3])} ${pf(m[4])} ` + `${pf(m[5])})`;\n }\n\n let clipCount = 0;\n let maskCount = 0;\n let shadingCount = 0;\n exports.SVGGraphics = SVGGraphics = class {\n constructor(commonObjs, objs, forceDataSchema = false) {\n (0, _display_utils.deprecated)(\"The SVG back-end is no longer maintained and *may* be removed in the future.\");\n this.svgFactory = new _display_utils.DOMSVGFactory();\n this.current = new SVGExtraState();\n this.transformMatrix = _util.IDENTITY_MATRIX;\n this.transformStack = [];\n this.extraStack = [];\n this.commonObjs = commonObjs;\n this.objs = objs;\n this.pendingClip = null;\n this.pendingEOFill = false;\n this.embedFonts = false;\n this.embeddedFonts = Object.create(null);\n this.cssStyle = null;\n this.forceDataSchema = !!forceDataSchema;\n this._operatorIdMapping = [];\n\n for (const op in _util.OPS) {\n this._operatorIdMapping[_util.OPS[op]] = op;\n }\n }\n\n save() {\n this.transformStack.push(this.transformMatrix);\n const old = this.current;\n this.extraStack.push(old);\n this.current = old.clone();\n }\n\n restore() {\n this.transformMatrix = this.transformStack.pop();\n this.current = this.extraStack.pop();\n this.pendingClip = null;\n this.tgrp = null;\n }\n\n group(items) {\n this.save();\n this.executeOpTree(items);\n this.restore();\n }\n\n loadDependencies(operatorList) {\n const fnArray = operatorList.fnArray;\n const argsArray = operatorList.argsArray;\n\n for (let i = 0, ii = fnArray.length; i < ii; i++) {\n if (fnArray[i] !== _util.OPS.dependency) {\n continue;\n }\n\n for (const obj of argsArray[i]) {\n const objsPool = obj.startsWith(\"g_\") ? this.commonObjs : this.objs;\n const promise = new Promise(resolve => {\n objsPool.get(obj, resolve);\n });\n this.current.dependencies.push(promise);\n }\n }\n\n return Promise.all(this.current.dependencies);\n }\n\n transform(a, b, c, d, e, f) {\n const transformMatrix = [a, b, c, d, e, f];\n this.transformMatrix = _util.Util.transform(this.transformMatrix, transformMatrix);\n this.tgrp = null;\n }\n\n getSVG(operatorList, viewport) {\n this.viewport = viewport;\n\n const svgElement = this._initialize(viewport);\n\n return this.loadDependencies(operatorList).then(() => {\n this.transformMatrix = _util.IDENTITY_MATRIX;\n this.executeOpTree(this.convertOpList(operatorList));\n return svgElement;\n });\n }\n\n convertOpList(operatorList) {\n const operatorIdMapping = this._operatorIdMapping;\n const argsArray = operatorList.argsArray;\n const fnArray = operatorList.fnArray;\n const opList = [];\n\n for (let i = 0, ii = fnArray.length; i < ii; i++) {\n const fnId = fnArray[i];\n opList.push({\n fnId,\n fn: operatorIdMapping[fnId],\n args: argsArray[i]\n });\n }\n\n return opListToTree(opList);\n }\n\n executeOpTree(opTree) {\n for (const opTreeElement of opTree) {\n const fn = opTreeElement.fn;\n const fnId = opTreeElement.fnId;\n const args = opTreeElement.args;\n\n switch (fnId | 0) {\n case _util.OPS.beginText:\n this.beginText();\n break;\n\n case _util.OPS.dependency:\n break;\n\n case _util.OPS.setLeading:\n this.setLeading(args);\n break;\n\n case _util.OPS.setLeadingMoveText:\n this.setLeadingMoveText(args[0], args[1]);\n break;\n\n case _util.OPS.setFont:\n this.setFont(args);\n break;\n\n case _util.OPS.showText:\n this.showText(args[0]);\n break;\n\n case _util.OPS.showSpacedText:\n this.showText(args[0]);\n break;\n\n case _util.OPS.endText:\n this.endText();\n break;\n\n case _util.OPS.moveText:\n this.moveText(args[0], args[1]);\n break;\n\n case _util.OPS.setCharSpacing:\n this.setCharSpacing(args[0]);\n break;\n\n case _util.OPS.setWordSpacing:\n this.setWordSpacing(args[0]);\n break;\n\n case _util.OPS.setHScale:\n this.setHScale(args[0]);\n break;\n\n case _util.OPS.setTextMatrix:\n this.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]);\n break;\n\n case _util.OPS.setTextRise:\n this.setTextRise(args[0]);\n break;\n\n case _util.OPS.setTextRenderingMode:\n this.setTextRenderingMode(args[0]);\n break;\n\n case _util.OPS.setLineWidth:\n this.setLineWidth(args[0]);\n break;\n\n case _util.OPS.setLineJoin:\n this.setLineJoin(args[0]);\n break;\n\n case _util.OPS.setLineCap:\n this.setLineCap(args[0]);\n break;\n\n case _util.OPS.setMiterLimit:\n this.setMiterLimit(args[0]);\n break;\n\n case _util.OPS.setFillRGBColor:\n this.setFillRGBColor(args[0], args[1], args[2]);\n break;\n\n case _util.OPS.setStrokeRGBColor:\n this.setStrokeRGBColor(args[0], args[1], args[2]);\n break;\n\n case _util.OPS.setStrokeColorN:\n this.setStrokeColorN(args);\n break;\n\n case _util.OPS.setFillColorN:\n this.setFillColorN(args);\n break;\n\n case _util.OPS.shadingFill:\n this.shadingFill(args[0]);\n break;\n\n case _util.OPS.setDash:\n this.setDash(args[0], args[1]);\n break;\n\n case _util.OPS.setRenderingIntent:\n this.setRenderingIntent(args[0]);\n break;\n\n case _util.OPS.setFlatness:\n this.setFlatness(args[0]);\n break;\n\n case _util.OPS.setGState:\n this.setGState(args[0]);\n break;\n\n case _util.OPS.fill:\n this.fill();\n break;\n\n case _util.OPS.eoFill:\n this.eoFill();\n break;\n\n case _util.OPS.stroke:\n this.stroke();\n break;\n\n case _util.OPS.fillStroke:\n this.fillStroke();\n break;\n\n case _util.OPS.eoFillStroke:\n this.eoFillStroke();\n break;\n\n case _util.OPS.clip:\n this.clip(\"nonzero\");\n break;\n\n case _util.OPS.eoClip:\n this.clip(\"evenodd\");\n break;\n\n case _util.OPS.paintSolidColorImageMask:\n this.paintSolidColorImageMask();\n break;\n\n case _util.OPS.paintImageXObject:\n this.paintImageXObject(args[0]);\n break;\n\n case _util.OPS.paintInlineImageXObject:\n this.paintInlineImageXObject(args[0]);\n break;\n\n case _util.OPS.paintImageMaskXObject:\n this.paintImageMaskXObject(args[0]);\n break;\n\n case _util.OPS.paintFormXObjectBegin:\n this.paintFormXObjectBegin(args[0], args[1]);\n break;\n\n case _util.OPS.paintFormXObjectEnd:\n this.paintFormXObjectEnd();\n break;\n\n case _util.OPS.closePath:\n this.closePath();\n break;\n\n case _util.OPS.closeStroke:\n this.closeStroke();\n break;\n\n case _util.OPS.closeFillStroke:\n this.closeFillStroke();\n break;\n\n case _util.OPS.closeEOFillStroke:\n this.closeEOFillStroke();\n break;\n\n case _util.OPS.nextLine:\n this.nextLine();\n break;\n\n case _util.OPS.transform:\n this.transform(args[0], args[1], args[2], args[3], args[4], args[5]);\n break;\n\n case _util.OPS.constructPath:\n this.constructPath(args[0], args[1]);\n break;\n\n case _util.OPS.endPath:\n this.endPath();\n break;\n\n case 92:\n this.group(opTreeElement.items);\n break;\n\n default:\n (0, _util.warn)(`Unimplemented operator ${fn}`);\n break;\n }\n }\n }\n\n setWordSpacing(wordSpacing) {\n this.current.wordSpacing = wordSpacing;\n }\n\n setCharSpacing(charSpacing) {\n this.current.charSpacing = charSpacing;\n }\n\n nextLine() {\n this.moveText(0, this.current.leading);\n }\n\n setTextMatrix(a, b, c, d, e, f) {\n const current = this.current;\n current.textMatrix = current.lineMatrix = [a, b, c, d, e, f];\n current.textMatrixScale = Math.hypot(a, b);\n current.x = current.lineX = 0;\n current.y = current.lineY = 0;\n current.xcoords = [];\n current.ycoords = [];\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.tspan.setAttributeNS(null, \"font-family\", current.fontFamily);\n current.tspan.setAttributeNS(null, \"font-size\", `${pf(current.fontSize)}px`);\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n current.txtElement = this.svgFactory.createElement(\"svg:text\");\n current.txtElement.append(current.tspan);\n }\n\n beginText() {\n const current = this.current;\n current.x = current.lineX = 0;\n current.y = current.lineY = 0;\n current.textMatrix = _util.IDENTITY_MATRIX;\n current.lineMatrix = _util.IDENTITY_MATRIX;\n current.textMatrixScale = 1;\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.txtElement = this.svgFactory.createElement(\"svg:text\");\n current.txtgrp = this.svgFactory.createElement(\"svg:g\");\n current.xcoords = [];\n current.ycoords = [];\n }\n\n moveText(x, y) {\n const current = this.current;\n current.x = current.lineX += x;\n current.y = current.lineY += y;\n current.xcoords = [];\n current.ycoords = [];\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.tspan.setAttributeNS(null, \"font-family\", current.fontFamily);\n current.tspan.setAttributeNS(null, \"font-size\", `${pf(current.fontSize)}px`);\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n }\n\n showText(glyphs) {\n const current = this.current;\n const font = current.font;\n const fontSize = current.fontSize;\n\n if (fontSize === 0) {\n return;\n }\n\n const fontSizeScale = current.fontSizeScale;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const fontDirection = current.fontDirection;\n const textHScale = current.textHScale * fontDirection;\n const vertical = font.vertical;\n const spacingDir = vertical ? 1 : -1;\n const defaultVMetrics = font.defaultVMetrics;\n const widthAdvanceScale = fontSize * current.fontMatrix[0];\n let x = 0;\n\n for (const glyph of glyphs) {\n if (glyph === null) {\n x += fontDirection * wordSpacing;\n continue;\n } else if (typeof glyph === \"number\") {\n x += spacingDir * glyph * fontSize / 1000;\n continue;\n }\n\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const character = glyph.fontChar;\n let scaledX, scaledY;\n let width = glyph.width;\n\n if (vertical) {\n let vx;\n const vmetric = glyph.vmetric || defaultVMetrics;\n vx = glyph.vmetric ? vmetric[1] : width * 0.5;\n vx = -vx * widthAdvanceScale;\n const vy = vmetric[2] * widthAdvanceScale;\n width = vmetric ? -vmetric[0] : width;\n scaledX = vx / fontSizeScale;\n scaledY = (x + vy) / fontSizeScale;\n } else {\n scaledX = x / fontSizeScale;\n scaledY = 0;\n }\n\n if (glyph.isInFont || font.missingFile) {\n current.xcoords.push(current.x + scaledX);\n\n if (vertical) {\n current.ycoords.push(-current.y + scaledY);\n }\n\n current.tspan.textContent += character;\n } else {}\n\n let charWidth;\n\n if (vertical) {\n charWidth = width * widthAdvanceScale - spacing * fontDirection;\n } else {\n charWidth = width * widthAdvanceScale + spacing * fontDirection;\n }\n\n x += charWidth;\n }\n\n current.tspan.setAttributeNS(null, \"x\", current.xcoords.map(pf).join(\" \"));\n\n if (vertical) {\n current.tspan.setAttributeNS(null, \"y\", current.ycoords.map(pf).join(\" \"));\n } else {\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n }\n\n if (vertical) {\n current.y -= x;\n } else {\n current.x += x * textHScale;\n }\n\n current.tspan.setAttributeNS(null, \"font-family\", current.fontFamily);\n current.tspan.setAttributeNS(null, \"font-size\", `${pf(current.fontSize)}px`);\n\n if (current.fontStyle !== SVG_DEFAULTS.fontStyle) {\n current.tspan.setAttributeNS(null, \"font-style\", current.fontStyle);\n }\n\n if (current.fontWeight !== SVG_DEFAULTS.fontWeight) {\n current.tspan.setAttributeNS(null, \"font-weight\", current.fontWeight);\n }\n\n const fillStrokeMode = current.textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK;\n\n if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n if (current.fillColor !== SVG_DEFAULTS.fillColor) {\n current.tspan.setAttributeNS(null, \"fill\", current.fillColor);\n }\n\n if (current.fillAlpha < 1) {\n current.tspan.setAttributeNS(null, \"fill-opacity\", current.fillAlpha);\n }\n } else if (current.textRenderingMode === _util.TextRenderingMode.ADD_TO_PATH) {\n current.tspan.setAttributeNS(null, \"fill\", \"transparent\");\n } else {\n current.tspan.setAttributeNS(null, \"fill\", \"none\");\n }\n\n if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {\n const lineWidthScale = 1 / (current.textMatrixScale || 1);\n\n this._setStrokeAttributes(current.tspan, lineWidthScale);\n }\n\n let textMatrix = current.textMatrix;\n\n if (current.textRise !== 0) {\n textMatrix = textMatrix.slice();\n textMatrix[5] += current.textRise;\n }\n\n current.txtElement.setAttributeNS(null, \"transform\", `${pm(textMatrix)} scale(${pf(textHScale)}, -1)`);\n current.txtElement.setAttributeNS(XML_NS, \"xml:space\", \"preserve\");\n current.txtElement.append(current.tspan);\n current.txtgrp.append(current.txtElement);\n\n this._ensureTransformGroup().append(current.txtElement);\n }\n\n setLeadingMoveText(x, y) {\n this.setLeading(-y);\n this.moveText(x, y);\n }\n\n addFontStyle(fontObj) {\n if (!fontObj.data) {\n throw new Error(\"addFontStyle: No font data available, \" + 'ensure that the \"fontExtraProperties\" API parameter is set.');\n }\n\n if (!this.cssStyle) {\n this.cssStyle = this.svgFactory.createElement(\"svg:style\");\n this.cssStyle.setAttributeNS(null, \"type\", \"text/css\");\n this.defs.append(this.cssStyle);\n }\n\n const url = createObjectURL(fontObj.data, fontObj.mimetype, this.forceDataSchema);\n this.cssStyle.textContent += `@font-face { font-family: \"${fontObj.loadedName}\";` + ` src: url(${url}); }\\n`;\n }\n\n setFont(details) {\n const current = this.current;\n const fontObj = this.commonObjs.get(details[0]);\n let size = details[1];\n current.font = fontObj;\n\n if (this.embedFonts && !fontObj.missingFile && !this.embeddedFonts[fontObj.loadedName]) {\n this.addFontStyle(fontObj);\n this.embeddedFonts[fontObj.loadedName] = fontObj;\n }\n\n current.fontMatrix = fontObj.fontMatrix || _util.FONT_IDENTITY_MATRIX;\n let bold = \"normal\";\n\n if (fontObj.black) {\n bold = \"900\";\n } else if (fontObj.bold) {\n bold = \"bold\";\n }\n\n const italic = fontObj.italic ? \"italic\" : \"normal\";\n\n if (size < 0) {\n size = -size;\n current.fontDirection = -1;\n } else {\n current.fontDirection = 1;\n }\n\n current.fontSize = size;\n current.fontFamily = fontObj.loadedName;\n current.fontWeight = bold;\n current.fontStyle = italic;\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n current.xcoords = [];\n current.ycoords = [];\n }\n\n endText() {\n const current = this.current;\n\n if (current.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG && current.txtElement?.hasChildNodes()) {\n current.element = current.txtElement;\n this.clip(\"nonzero\");\n this.endPath();\n }\n }\n\n setLineWidth(width) {\n if (width > 0) {\n this.current.lineWidth = width;\n }\n }\n\n setLineCap(style) {\n this.current.lineCap = LINE_CAP_STYLES[style];\n }\n\n setLineJoin(style) {\n this.current.lineJoin = LINE_JOIN_STYLES[style];\n }\n\n setMiterLimit(limit) {\n this.current.miterLimit = limit;\n }\n\n setStrokeAlpha(strokeAlpha) {\n this.current.strokeAlpha = strokeAlpha;\n }\n\n setStrokeRGBColor(r, g, b) {\n this.current.strokeColor = _util.Util.makeHexColor(r, g, b);\n }\n\n setFillAlpha(fillAlpha) {\n this.current.fillAlpha = fillAlpha;\n }\n\n setFillRGBColor(r, g, b) {\n this.current.fillColor = _util.Util.makeHexColor(r, g, b);\n this.current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n this.current.xcoords = [];\n this.current.ycoords = [];\n }\n\n setStrokeColorN(args) {\n this.current.strokeColor = this._makeColorN_Pattern(args);\n }\n\n setFillColorN(args) {\n this.current.fillColor = this._makeColorN_Pattern(args);\n }\n\n shadingFill(args) {\n const width = this.viewport.width;\n const height = this.viewport.height;\n\n const inv = _util.Util.inverseTransform(this.transformMatrix);\n\n const bl = _util.Util.applyTransform([0, 0], inv);\n\n const br = _util.Util.applyTransform([0, height], inv);\n\n const ul = _util.Util.applyTransform([width, 0], inv);\n\n const ur = _util.Util.applyTransform([width, height], inv);\n\n const x0 = Math.min(bl[0], br[0], ul[0], ur[0]);\n const y0 = Math.min(bl[1], br[1], ul[1], ur[1]);\n const x1 = Math.max(bl[0], br[0], ul[0], ur[0]);\n const y1 = Math.max(bl[1], br[1], ul[1], ur[1]);\n const rect = this.svgFactory.createElement(\"svg:rect\");\n rect.setAttributeNS(null, \"x\", x0);\n rect.setAttributeNS(null, \"y\", y0);\n rect.setAttributeNS(null, \"width\", x1 - x0);\n rect.setAttributeNS(null, \"height\", y1 - y0);\n rect.setAttributeNS(null, \"fill\", this._makeShadingPattern(args));\n\n if (this.current.fillAlpha < 1) {\n rect.setAttributeNS(null, \"fill-opacity\", this.current.fillAlpha);\n }\n\n this._ensureTransformGroup().append(rect);\n }\n\n _makeColorN_Pattern(args) {\n if (args[0] === \"TilingPattern\") {\n return this._makeTilingPattern(args);\n }\n\n return this._makeShadingPattern(args);\n }\n\n _makeTilingPattern(args) {\n const color = args[1];\n const operatorList = args[2];\n const matrix = args[3] || _util.IDENTITY_MATRIX;\n const [x0, y0, x1, y1] = args[4];\n const xstep = args[5];\n const ystep = args[6];\n const paintType = args[7];\n const tilingId = `shading${shadingCount++}`;\n\n const [tx0, ty0, tx1, ty1] = _util.Util.normalizeRect([..._util.Util.applyTransform([x0, y0], matrix), ..._util.Util.applyTransform([x1, y1], matrix)]);\n\n const [xscale, yscale] = _util.Util.singularValueDecompose2dScale(matrix);\n\n const txstep = xstep * xscale;\n const tystep = ystep * yscale;\n const tiling = this.svgFactory.createElement(\"svg:pattern\");\n tiling.setAttributeNS(null, \"id\", tilingId);\n tiling.setAttributeNS(null, \"patternUnits\", \"userSpaceOnUse\");\n tiling.setAttributeNS(null, \"width\", txstep);\n tiling.setAttributeNS(null, \"height\", tystep);\n tiling.setAttributeNS(null, \"x\", `${tx0}`);\n tiling.setAttributeNS(null, \"y\", `${ty0}`);\n const svg = this.svg;\n const transformMatrix = this.transformMatrix;\n const fillColor = this.current.fillColor;\n const strokeColor = this.current.strokeColor;\n const bbox = this.svgFactory.create(tx1 - tx0, ty1 - ty0);\n this.svg = bbox;\n this.transformMatrix = matrix;\n\n if (paintType === 2) {\n const cssColor = _util.Util.makeHexColor(...color);\n\n this.current.fillColor = cssColor;\n this.current.strokeColor = cssColor;\n }\n\n this.executeOpTree(this.convertOpList(operatorList));\n this.svg = svg;\n this.transformMatrix = transformMatrix;\n this.current.fillColor = fillColor;\n this.current.strokeColor = strokeColor;\n tiling.append(bbox.childNodes[0]);\n this.defs.append(tiling);\n return `url(#${tilingId})`;\n }\n\n _makeShadingPattern(args) {\n if (typeof args === \"string\") {\n args = this.objs.get(args);\n }\n\n switch (args[0]) {\n case \"RadialAxial\":\n const shadingId = `shading${shadingCount++}`;\n const colorStops = args[3];\n let gradient;\n\n switch (args[1]) {\n case \"axial\":\n const point0 = args[4];\n const point1 = args[5];\n gradient = this.svgFactory.createElement(\"svg:linearGradient\");\n gradient.setAttributeNS(null, \"id\", shadingId);\n gradient.setAttributeNS(null, \"gradientUnits\", \"userSpaceOnUse\");\n gradient.setAttributeNS(null, \"x1\", point0[0]);\n gradient.setAttributeNS(null, \"y1\", point0[1]);\n gradient.setAttributeNS(null, \"x2\", point1[0]);\n gradient.setAttributeNS(null, \"y2\", point1[1]);\n break;\n\n case \"radial\":\n const focalPoint = args[4];\n const circlePoint = args[5];\n const focalRadius = args[6];\n const circleRadius = args[7];\n gradient = this.svgFactory.createElement(\"svg:radialGradient\");\n gradient.setAttributeNS(null, \"id\", shadingId);\n gradient.setAttributeNS(null, \"gradientUnits\", \"userSpaceOnUse\");\n gradient.setAttributeNS(null, \"cx\", circlePoint[0]);\n gradient.setAttributeNS(null, \"cy\", circlePoint[1]);\n gradient.setAttributeNS(null, \"r\", circleRadius);\n gradient.setAttributeNS(null, \"fx\", focalPoint[0]);\n gradient.setAttributeNS(null, \"fy\", focalPoint[1]);\n gradient.setAttributeNS(null, \"fr\", focalRadius);\n break;\n\n default:\n throw new Error(`Unknown RadialAxial type: ${args[1]}`);\n }\n\n for (const colorStop of colorStops) {\n const stop = this.svgFactory.createElement(\"svg:stop\");\n stop.setAttributeNS(null, \"offset\", colorStop[0]);\n stop.setAttributeNS(null, \"stop-color\", colorStop[1]);\n gradient.append(stop);\n }\n\n this.defs.append(gradient);\n return `url(#${shadingId})`;\n\n case \"Mesh\":\n (0, _util.warn)(\"Unimplemented pattern Mesh\");\n return null;\n\n case \"Dummy\":\n return \"hotpink\";\n\n default:\n throw new Error(`Unknown IR type: ${args[0]}`);\n }\n }\n\n setDash(dashArray, dashPhase) {\n this.current.dashArray = dashArray;\n this.current.dashPhase = dashPhase;\n }\n\n constructPath(ops, args) {\n const current = this.current;\n let x = current.x,\n y = current.y;\n let d = [];\n let j = 0;\n\n for (const op of ops) {\n switch (op | 0) {\n case _util.OPS.rectangle:\n x = args[j++];\n y = args[j++];\n const width = args[j++];\n const height = args[j++];\n const xw = x + width;\n const yh = y + height;\n d.push(\"M\", pf(x), pf(y), \"L\", pf(xw), pf(y), \"L\", pf(xw), pf(yh), \"L\", pf(x), pf(yh), \"Z\");\n break;\n\n case _util.OPS.moveTo:\n x = args[j++];\n y = args[j++];\n d.push(\"M\", pf(x), pf(y));\n break;\n\n case _util.OPS.lineTo:\n x = args[j++];\n y = args[j++];\n d.push(\"L\", pf(x), pf(y));\n break;\n\n case _util.OPS.curveTo:\n x = args[j + 4];\n y = args[j + 5];\n d.push(\"C\", pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), pf(args[j + 3]), pf(x), pf(y));\n j += 6;\n break;\n\n case _util.OPS.curveTo2:\n d.push(\"C\", pf(x), pf(y), pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), pf(args[j + 3]));\n x = args[j + 2];\n y = args[j + 3];\n j += 4;\n break;\n\n case _util.OPS.curveTo3:\n x = args[j + 2];\n y = args[j + 3];\n d.push(\"C\", pf(args[j]), pf(args[j + 1]), pf(x), pf(y), pf(x), pf(y));\n j += 4;\n break;\n\n case _util.OPS.closePath:\n d.push(\"Z\");\n break;\n }\n }\n\n d = d.join(\" \");\n\n if (current.path && ops.length > 0 && ops[0] !== _util.OPS.rectangle && ops[0] !== _util.OPS.moveTo) {\n d = current.path.getAttributeNS(null, \"d\") + d;\n } else {\n current.path = this.svgFactory.createElement(\"svg:path\");\n\n this._ensureTransformGroup().append(current.path);\n }\n\n current.path.setAttributeNS(null, \"d\", d);\n current.path.setAttributeNS(null, \"fill\", \"none\");\n current.element = current.path;\n current.setCurrentPoint(x, y);\n }\n\n endPath() {\n const current = this.current;\n current.path = null;\n\n if (!this.pendingClip) {\n return;\n }\n\n if (!current.element) {\n this.pendingClip = null;\n return;\n }\n\n const clipId = `clippath${clipCount++}`;\n const clipPath = this.svgFactory.createElement(\"svg:clipPath\");\n clipPath.setAttributeNS(null, \"id\", clipId);\n clipPath.setAttributeNS(null, \"transform\", pm(this.transformMatrix));\n const clipElement = current.element.cloneNode(true);\n\n if (this.pendingClip === \"evenodd\") {\n clipElement.setAttributeNS(null, \"clip-rule\", \"evenodd\");\n } else {\n clipElement.setAttributeNS(null, \"clip-rule\", \"nonzero\");\n }\n\n this.pendingClip = null;\n clipPath.append(clipElement);\n this.defs.append(clipPath);\n\n if (current.activeClipUrl) {\n current.clipGroup = null;\n\n for (const prev of this.extraStack) {\n prev.clipGroup = null;\n }\n\n clipPath.setAttributeNS(null, \"clip-path\", current.activeClipUrl);\n }\n\n current.activeClipUrl = `url(#${clipId})`;\n this.tgrp = null;\n }\n\n clip(type) {\n this.pendingClip = type;\n }\n\n closePath() {\n const current = this.current;\n\n if (current.path) {\n const d = `${current.path.getAttributeNS(null, \"d\")}Z`;\n current.path.setAttributeNS(null, \"d\", d);\n }\n }\n\n setLeading(leading) {\n this.current.leading = -leading;\n }\n\n setTextRise(textRise) {\n this.current.textRise = textRise;\n }\n\n setTextRenderingMode(textRenderingMode) {\n this.current.textRenderingMode = textRenderingMode;\n }\n\n setHScale(scale) {\n this.current.textHScale = scale / 100;\n }\n\n setRenderingIntent(intent) {}\n\n setFlatness(flatness) {}\n\n setGState(states) {\n for (const [key, value] of states) {\n switch (key) {\n case \"LW\":\n this.setLineWidth(value);\n break;\n\n case \"LC\":\n this.setLineCap(value);\n break;\n\n case \"LJ\":\n this.setLineJoin(value);\n break;\n\n case \"ML\":\n this.setMiterLimit(value);\n break;\n\n case \"D\":\n this.setDash(value[0], value[1]);\n break;\n\n case \"RI\":\n this.setRenderingIntent(value);\n break;\n\n case \"FL\":\n this.setFlatness(value);\n break;\n\n case \"Font\":\n this.setFont(value);\n break;\n\n case \"CA\":\n this.setStrokeAlpha(value);\n break;\n\n case \"ca\":\n this.setFillAlpha(value);\n break;\n\n default:\n (0, _util.warn)(`Unimplemented graphic state operator ${key}`);\n break;\n }\n }\n }\n\n fill() {\n const current = this.current;\n\n if (current.element) {\n current.element.setAttributeNS(null, \"fill\", current.fillColor);\n current.element.setAttributeNS(null, \"fill-opacity\", current.fillAlpha);\n this.endPath();\n }\n }\n\n stroke() {\n const current = this.current;\n\n if (current.element) {\n this._setStrokeAttributes(current.element);\n\n current.element.setAttributeNS(null, \"fill\", \"none\");\n this.endPath();\n }\n }\n\n _setStrokeAttributes(element, lineWidthScale = 1) {\n const current = this.current;\n let dashArray = current.dashArray;\n\n if (lineWidthScale !== 1 && dashArray.length > 0) {\n dashArray = dashArray.map(function (value) {\n return lineWidthScale * value;\n });\n }\n\n element.setAttributeNS(null, \"stroke\", current.strokeColor);\n element.setAttributeNS(null, \"stroke-opacity\", current.strokeAlpha);\n element.setAttributeNS(null, \"stroke-miterlimit\", pf(current.miterLimit));\n element.setAttributeNS(null, \"stroke-linecap\", current.lineCap);\n element.setAttributeNS(null, \"stroke-linejoin\", current.lineJoin);\n element.setAttributeNS(null, \"stroke-width\", pf(lineWidthScale * current.lineWidth) + \"px\");\n element.setAttributeNS(null, \"stroke-dasharray\", dashArray.map(pf).join(\" \"));\n element.setAttributeNS(null, \"stroke-dashoffset\", pf(lineWidthScale * current.dashPhase) + \"px\");\n }\n\n eoFill() {\n if (this.current.element) {\n this.current.element.setAttributeNS(null, \"fill-rule\", \"evenodd\");\n }\n\n this.fill();\n }\n\n fillStroke() {\n this.stroke();\n this.fill();\n }\n\n eoFillStroke() {\n if (this.current.element) {\n this.current.element.setAttributeNS(null, \"fill-rule\", \"evenodd\");\n }\n\n this.fillStroke();\n }\n\n closeStroke() {\n this.closePath();\n this.stroke();\n }\n\n closeFillStroke() {\n this.closePath();\n this.fillStroke();\n }\n\n closeEOFillStroke() {\n this.closePath();\n this.eoFillStroke();\n }\n\n paintSolidColorImageMask() {\n const rect = this.svgFactory.createElement(\"svg:rect\");\n rect.setAttributeNS(null, \"x\", \"0\");\n rect.setAttributeNS(null, \"y\", \"0\");\n rect.setAttributeNS(null, \"width\", \"1px\");\n rect.setAttributeNS(null, \"height\", \"1px\");\n rect.setAttributeNS(null, \"fill\", this.current.fillColor);\n\n this._ensureTransformGroup().append(rect);\n }\n\n paintImageXObject(objId) {\n const imgData = objId.startsWith(\"g_\") ? this.commonObjs.get(objId) : this.objs.get(objId);\n\n if (!imgData) {\n (0, _util.warn)(`Dependent image with object ID ${objId} is not ready yet`);\n return;\n }\n\n this.paintInlineImageXObject(imgData);\n }\n\n paintInlineImageXObject(imgData, mask) {\n const width = imgData.width;\n const height = imgData.height;\n const imgSrc = convertImgDataToPng(imgData, this.forceDataSchema, !!mask);\n const cliprect = this.svgFactory.createElement(\"svg:rect\");\n cliprect.setAttributeNS(null, \"x\", \"0\");\n cliprect.setAttributeNS(null, \"y\", \"0\");\n cliprect.setAttributeNS(null, \"width\", pf(width));\n cliprect.setAttributeNS(null, \"height\", pf(height));\n this.current.element = cliprect;\n this.clip(\"nonzero\");\n const imgEl = this.svgFactory.createElement(\"svg:image\");\n imgEl.setAttributeNS(XLINK_NS, \"xlink:href\", imgSrc);\n imgEl.setAttributeNS(null, \"x\", \"0\");\n imgEl.setAttributeNS(null, \"y\", pf(-height));\n imgEl.setAttributeNS(null, \"width\", pf(width) + \"px\");\n imgEl.setAttributeNS(null, \"height\", pf(height) + \"px\");\n imgEl.setAttributeNS(null, \"transform\", `scale(${pf(1 / width)} ${pf(-1 / height)})`);\n\n if (mask) {\n mask.append(imgEl);\n } else {\n this._ensureTransformGroup().append(imgEl);\n }\n }\n\n paintImageMaskXObject(imgData) {\n const current = this.current;\n const width = imgData.width;\n const height = imgData.height;\n const fillColor = current.fillColor;\n current.maskId = `mask${maskCount++}`;\n const mask = this.svgFactory.createElement(\"svg:mask\");\n mask.setAttributeNS(null, \"id\", current.maskId);\n const rect = this.svgFactory.createElement(\"svg:rect\");\n rect.setAttributeNS(null, \"x\", \"0\");\n rect.setAttributeNS(null, \"y\", \"0\");\n rect.setAttributeNS(null, \"width\", pf(width));\n rect.setAttributeNS(null, \"height\", pf(height));\n rect.setAttributeNS(null, \"fill\", fillColor);\n rect.setAttributeNS(null, \"mask\", `url(#${current.maskId})`);\n this.defs.append(mask);\n\n this._ensureTransformGroup().append(rect);\n\n this.paintInlineImageXObject(imgData, mask);\n }\n\n paintFormXObjectBegin(matrix, bbox) {\n if (Array.isArray(matrix) && matrix.length === 6) {\n this.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\n }\n\n if (bbox) {\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n const cliprect = this.svgFactory.createElement(\"svg:rect\");\n cliprect.setAttributeNS(null, \"x\", bbox[0]);\n cliprect.setAttributeNS(null, \"y\", bbox[1]);\n cliprect.setAttributeNS(null, \"width\", pf(width));\n cliprect.setAttributeNS(null, \"height\", pf(height));\n this.current.element = cliprect;\n this.clip(\"nonzero\");\n this.endPath();\n }\n }\n\n paintFormXObjectEnd() {}\n\n _initialize(viewport) {\n const svg = this.svgFactory.create(viewport.width, viewport.height);\n const definitions = this.svgFactory.createElement(\"svg:defs\");\n svg.append(definitions);\n this.defs = definitions;\n const rootGroup = this.svgFactory.createElement(\"svg:g\");\n rootGroup.setAttributeNS(null, \"transform\", pm(viewport.transform));\n svg.append(rootGroup);\n this.svg = rootGroup;\n return svg;\n }\n\n _ensureClipGroup() {\n if (!this.current.clipGroup) {\n const clipGroup = this.svgFactory.createElement(\"svg:g\");\n clipGroup.setAttributeNS(null, \"clip-path\", this.current.activeClipUrl);\n this.svg.append(clipGroup);\n this.current.clipGroup = clipGroup;\n }\n\n return this.current.clipGroup;\n }\n\n _ensureTransformGroup() {\n if (!this.tgrp) {\n this.tgrp = this.svgFactory.createElement(\"svg:g\");\n this.tgrp.setAttributeNS(null, \"transform\", pm(this.transformMatrix));\n\n if (this.current.activeClipUrl) {\n this._ensureClipGroup().append(this.tgrp);\n } else {\n this.svg.append(this.tgrp);\n }\n }\n\n return this.tgrp;\n }\n\n };\n}\n\n/***/ }),\n/* 32 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFNodeStream = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _network_utils = __w_pdfjs_require__(33);\n\n;\n\nconst fs = require(\"fs\");\n\nconst http = require(\"http\");\n\nconst https = require(\"https\");\n\nconst url = require(\"url\");\n\nconst fileUriRegex = /^file:\\/\\/\\/[a-zA-Z]:\\//;\n\nfunction parseUrl(sourceUrl) {\n const parsedUrl = url.parse(sourceUrl);\n\n if (parsedUrl.protocol === \"file:\" || parsedUrl.host) {\n return parsedUrl;\n }\n\n if (/^[a-z]:[/\\\\]/i.test(sourceUrl)) {\n return url.parse(`file:///${sourceUrl}`);\n }\n\n if (!parsedUrl.host) {\n parsedUrl.protocol = \"file:\";\n }\n\n return parsedUrl;\n}\n\nclass PDFNodeStream {\n constructor(source) {\n this.source = source;\n this.url = parseUrl(source.url);\n this.isHttp = this.url.protocol === \"http:\" || this.url.protocol === \"https:\";\n this.isFsUrl = this.url.protocol === \"file:\";\n this.httpHeaders = this.isHttp && source.httpHeaders || {};\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n getFullReader() {\n (0, _util.assert)(!this._fullRequestReader, \"PDFNodeStream.getFullReader can only be called once.\");\n this._fullRequestReader = this.isFsUrl ? new PDFNodeStreamFsFullReader(this) : new PDFNodeStreamFullReader(this);\n return this._fullRequestReader;\n }\n\n getRangeReader(start, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n\n const rangeReader = this.isFsUrl ? new PDFNodeStreamFsRangeReader(this, start, end) : new PDFNodeStreamRangeReader(this, start, end);\n\n this._rangeRequestReaders.push(rangeReader);\n\n return rangeReader;\n }\n\n cancelAllRequests(reason) {\n if (this._fullRequestReader) {\n this._fullRequestReader.cancel(reason);\n }\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n\n}\n\nexports.PDFNodeStream = PDFNodeStream;\n\nclass BaseFullReader {\n constructor(stream) {\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n const source = stream.source;\n this._contentLength = source.length;\n this._loaded = 0;\n this._filename = null;\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n this._readableStream = null;\n this._readCapability = (0, _util.createPromiseCapability)();\n this._headersCapability = (0, _util.createPromiseCapability)();\n }\n\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n get filename() {\n return this._filename;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n\n if (this._done) {\n return {\n value: undefined,\n done: true\n };\n }\n\n if (this._storedError) {\n throw this._storedError;\n }\n\n const chunk = this._readableStream.read();\n\n if (chunk === null) {\n this._readCapability = (0, _util.createPromiseCapability)();\n return this.read();\n }\n\n this._loaded += chunk.length;\n\n if (this.onProgress) {\n this.onProgress({\n loaded: this._loaded,\n total: this._contentLength\n });\n }\n\n const buffer = new Uint8Array(chunk).buffer;\n return {\n value: buffer,\n done: false\n };\n }\n\n cancel(reason) {\n if (!this._readableStream) {\n this._error(reason);\n\n return;\n }\n\n this._readableStream.destroy(reason);\n }\n\n _error(reason) {\n this._storedError = reason;\n\n this._readCapability.resolve();\n }\n\n _setReadableStream(readableStream) {\n this._readableStream = readableStream;\n readableStream.on(\"readable\", () => {\n this._readCapability.resolve();\n });\n readableStream.on(\"end\", () => {\n readableStream.destroy();\n this._done = true;\n\n this._readCapability.resolve();\n });\n readableStream.on(\"error\", reason => {\n this._error(reason);\n });\n\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this._error(new _util.AbortException(\"streaming is disabled\"));\n }\n\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n\n}\n\nclass BaseRangeReader {\n constructor(stream) {\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n this._loaded = 0;\n this._readableStream = null;\n this._readCapability = (0, _util.createPromiseCapability)();\n const source = stream.source;\n this._isStreamingSupported = !source.disableStream;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n\n if (this._done) {\n return {\n value: undefined,\n done: true\n };\n }\n\n if (this._storedError) {\n throw this._storedError;\n }\n\n const chunk = this._readableStream.read();\n\n if (chunk === null) {\n this._readCapability = (0, _util.createPromiseCapability)();\n return this.read();\n }\n\n this._loaded += chunk.length;\n\n if (this.onProgress) {\n this.onProgress({\n loaded: this._loaded\n });\n }\n\n const buffer = new Uint8Array(chunk).buffer;\n return {\n value: buffer,\n done: false\n };\n }\n\n cancel(reason) {\n if (!this._readableStream) {\n this._error(reason);\n\n return;\n }\n\n this._readableStream.destroy(reason);\n }\n\n _error(reason) {\n this._storedError = reason;\n\n this._readCapability.resolve();\n }\n\n _setReadableStream(readableStream) {\n this._readableStream = readableStream;\n readableStream.on(\"readable\", () => {\n this._readCapability.resolve();\n });\n readableStream.on(\"end\", () => {\n readableStream.destroy();\n this._done = true;\n\n this._readCapability.resolve();\n });\n readableStream.on(\"error\", reason => {\n this._error(reason);\n });\n\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n\n}\n\nfunction createRequestOptions(parsedUrl, headers) {\n return {\n protocol: parsedUrl.protocol,\n auth: parsedUrl.auth,\n host: parsedUrl.hostname,\n port: parsedUrl.port,\n path: parsedUrl.path,\n method: \"GET\",\n headers\n };\n}\n\nclass PDFNodeStreamFullReader extends BaseFullReader {\n constructor(stream) {\n super(stream);\n\n const handleResponse = response => {\n if (response.statusCode === 404) {\n const error = new _util.MissingPDFException(`Missing PDF \"${this._url}\".`);\n this._storedError = error;\n\n this._headersCapability.reject(error);\n\n return;\n }\n\n this._headersCapability.resolve();\n\n this._setReadableStream(response);\n\n const getResponseHeader = name => {\n return this._readableStream.headers[name.toLowerCase()];\n };\n\n const {\n allowRangeRequests,\n suggestedLength\n } = (0, _network_utils.validateRangeRequestCapabilities)({\n getResponseHeader,\n isHttp: stream.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange\n });\n this._isRangeSupported = allowRangeRequests;\n this._contentLength = suggestedLength || this._contentLength;\n this._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader);\n };\n\n this._request = null;\n\n if (this._url.protocol === \"http:\") {\n this._request = http.request(createRequestOptions(this._url, stream.httpHeaders), handleResponse);\n } else {\n this._request = https.request(createRequestOptions(this._url, stream.httpHeaders), handleResponse);\n }\n\n this._request.on(\"error\", reason => {\n this._storedError = reason;\n\n this._headersCapability.reject(reason);\n });\n\n this._request.end();\n }\n\n}\n\nclass PDFNodeStreamRangeReader extends BaseRangeReader {\n constructor(stream, start, end) {\n super(stream);\n this._httpHeaders = {};\n\n for (const property in stream.httpHeaders) {\n const value = stream.httpHeaders[property];\n\n if (typeof value === \"undefined\") {\n continue;\n }\n\n this._httpHeaders[property] = value;\n }\n\n this._httpHeaders.Range = `bytes=${start}-${end - 1}`;\n\n const handleResponse = response => {\n if (response.statusCode === 404) {\n const error = new _util.MissingPDFException(`Missing PDF \"${this._url}\".`);\n this._storedError = error;\n return;\n }\n\n this._setReadableStream(response);\n };\n\n this._request = null;\n\n if (this._url.protocol === \"http:\") {\n this._request = http.request(createRequestOptions(this._url, this._httpHeaders), handleResponse);\n } else {\n this._request = https.request(createRequestOptions(this._url, this._httpHeaders), handleResponse);\n }\n\n this._request.on(\"error\", reason => {\n this._storedError = reason;\n });\n\n this._request.end();\n }\n\n}\n\nclass PDFNodeStreamFsFullReader extends BaseFullReader {\n constructor(stream) {\n super(stream);\n let path = decodeURIComponent(this._url.path);\n\n if (fileUriRegex.test(this._url.href)) {\n path = path.replace(/^\\//, \"\");\n }\n\n fs.lstat(path, (error, stat) => {\n if (error) {\n if (error.code === \"ENOENT\") {\n error = new _util.MissingPDFException(`Missing PDF \"${path}\".`);\n }\n\n this._storedError = error;\n\n this._headersCapability.reject(error);\n\n return;\n }\n\n this._contentLength = stat.size;\n\n this._setReadableStream(fs.createReadStream(path));\n\n this._headersCapability.resolve();\n });\n }\n\n}\n\nclass PDFNodeStreamFsRangeReader extends BaseRangeReader {\n constructor(stream, start, end) {\n super(stream);\n let path = decodeURIComponent(this._url.path);\n\n if (fileUriRegex.test(this._url.href)) {\n path = path.replace(/^\\//, \"\");\n }\n\n this._setReadableStream(fs.createReadStream(path, {\n start,\n end: end - 1\n }));\n }\n\n}\n\n/***/ }),\n/* 33 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.createResponseStatusError = createResponseStatusError;\nexports.extractFilenameFromHeader = extractFilenameFromHeader;\nexports.validateRangeRequestCapabilities = validateRangeRequestCapabilities;\nexports.validateResponseStatus = validateResponseStatus;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _content_disposition = __w_pdfjs_require__(34);\n\nvar _display_utils = __w_pdfjs_require__(8);\n\nfunction validateRangeRequestCapabilities({\n getResponseHeader,\n isHttp,\n rangeChunkSize,\n disableRange\n}) {\n const returnValues = {\n allowRangeRequests: false,\n suggestedLength: undefined\n };\n const length = parseInt(getResponseHeader(\"Content-Length\"), 10);\n\n if (!Number.isInteger(length)) {\n return returnValues;\n }\n\n returnValues.suggestedLength = length;\n\n if (length <= 2 * rangeChunkSize) {\n return returnValues;\n }\n\n if (disableRange || !isHttp) {\n return returnValues;\n }\n\n if (getResponseHeader(\"Accept-Ranges\") !== \"bytes\") {\n return returnValues;\n }\n\n const contentEncoding = getResponseHeader(\"Content-Encoding\") || \"identity\";\n\n if (contentEncoding !== \"identity\") {\n return returnValues;\n }\n\n returnValues.allowRangeRequests = true;\n return returnValues;\n}\n\nfunction extractFilenameFromHeader(getResponseHeader) {\n const contentDisposition = getResponseHeader(\"Content-Disposition\");\n\n if (contentDisposition) {\n let filename = (0, _content_disposition.getFilenameFromContentDispositionHeader)(contentDisposition);\n\n if (filename.includes(\"%\")) {\n try {\n filename = decodeURIComponent(filename);\n } catch (ex) {}\n }\n\n if ((0, _display_utils.isPdfFile)(filename)) {\n return filename;\n }\n }\n\n return null;\n}\n\nfunction createResponseStatusError(status, url) {\n if (status === 404 || status === 0 && url.startsWith(\"file:\")) {\n return new _util.MissingPDFException('Missing PDF \"' + url + '\".');\n }\n\n return new _util.UnexpectedResponseException(`Unexpected server response (${status}) while retrieving PDF \"${url}\".`, status);\n}\n\nfunction validateResponseStatus(status) {\n return status === 200 || status === 206;\n}\n\n/***/ }),\n/* 34 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.getFilenameFromContentDispositionHeader = getFilenameFromContentDispositionHeader;\n\nvar _util = __w_pdfjs_require__(1);\n\nfunction getFilenameFromContentDispositionHeader(contentDisposition) {\n let needsEncodingFixup = true;\n let tmp = toParamRegExp(\"filename\\\\*\", \"i\").exec(contentDisposition);\n\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = unescape(filename);\n filename = rfc5987decode(filename);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n tmp = rfc2231getparam(contentDisposition);\n\n if (tmp) {\n const filename = rfc2047decode(tmp);\n return fixupEncoding(filename);\n }\n\n tmp = toParamRegExp(\"filename\", \"i\").exec(contentDisposition);\n\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n function toParamRegExp(attributePattern, flags) {\n return new RegExp(\"(?:^|;)\\\\s*\" + attributePattern + \"\\\\s*=\\\\s*\" + \"(\" + '[^\";\\\\s][^;\\\\s]*' + \"|\" + '\"(?:[^\"\\\\\\\\]|\\\\\\\\\"?)+\"?' + \")\", flags);\n }\n\n function textdecode(encoding, value) {\n if (encoding) {\n if (!/^[\\x00-\\xFF]+$/.test(value)) {\n return value;\n }\n\n try {\n const decoder = new TextDecoder(encoding, {\n fatal: true\n });\n const buffer = (0, _util.stringToBytes)(value);\n value = decoder.decode(buffer);\n needsEncodingFixup = false;\n } catch (e) {}\n }\n\n return value;\n }\n\n function fixupEncoding(value) {\n if (needsEncodingFixup && /[\\x80-\\xff]/.test(value)) {\n value = textdecode(\"utf-8\", value);\n\n if (needsEncodingFixup) {\n value = textdecode(\"iso-8859-1\", value);\n }\n }\n\n return value;\n }\n\n function rfc2231getparam(contentDispositionStr) {\n const matches = [];\n let match;\n const iter = toParamRegExp(\"filename\\\\*((?!0\\\\d)\\\\d+)(\\\\*?)\", \"ig\");\n\n while ((match = iter.exec(contentDispositionStr)) !== null) {\n let [, n, quot, part] = match;\n n = parseInt(n, 10);\n\n if (n in matches) {\n if (n === 0) {\n break;\n }\n\n continue;\n }\n\n matches[n] = [quot, part];\n }\n\n const parts = [];\n\n for (let n = 0; n < matches.length; ++n) {\n if (!(n in matches)) {\n break;\n }\n\n let [quot, part] = matches[n];\n part = rfc2616unquote(part);\n\n if (quot) {\n part = unescape(part);\n\n if (n === 0) {\n part = rfc5987decode(part);\n }\n }\n\n parts.push(part);\n }\n\n return parts.join(\"\");\n }\n\n function rfc2616unquote(value) {\n if (value.startsWith('\"')) {\n const parts = value.slice(1).split('\\\\\"');\n\n for (let i = 0; i < parts.length; ++i) {\n const quotindex = parts[i].indexOf('\"');\n\n if (quotindex !== -1) {\n parts[i] = parts[i].slice(0, quotindex);\n parts.length = i + 1;\n }\n\n parts[i] = parts[i].replace(/\\\\(.)/g, \"$1\");\n }\n\n value = parts.join('\"');\n }\n\n return value;\n }\n\n function rfc5987decode(extvalue) {\n const encodingend = extvalue.indexOf(\"'\");\n\n if (encodingend === -1) {\n return extvalue;\n }\n\n const encoding = extvalue.slice(0, encodingend);\n const langvalue = extvalue.slice(encodingend + 1);\n const value = langvalue.replace(/^[^']*'/, \"\");\n return textdecode(encoding, value);\n }\n\n function rfc2047decode(value) {\n if (!value.startsWith(\"=?\") || /[\\x00-\\x19\\x80-\\xff]/.test(value)) {\n return value;\n }\n\n return value.replace(/=\\?([\\w-]*)\\?([QqBb])\\?((?:[^?]|\\?(?!=))*)\\?=/g, function (matches, charset, encoding, text) {\n if (encoding === \"q\" || encoding === \"Q\") {\n text = text.replace(/_/g, \" \");\n text = text.replace(/=([0-9a-fA-F]{2})/g, function (match, hex) {\n return String.fromCharCode(parseInt(hex, 16));\n });\n return textdecode(charset, text);\n }\n\n try {\n text = atob(text);\n } catch (e) {}\n\n return textdecode(charset, text);\n });\n }\n\n return \"\";\n}\n\n/***/ }),\n/* 35 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFNetworkStream = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _network_utils = __w_pdfjs_require__(33);\n\n;\nconst OK_RESPONSE = 200;\nconst PARTIAL_CONTENT_RESPONSE = 206;\n\nfunction getArrayBuffer(xhr) {\n const data = xhr.response;\n\n if (typeof data !== \"string\") {\n return data;\n }\n\n const array = (0, _util.stringToBytes)(data);\n return array.buffer;\n}\n\nclass NetworkManager {\n constructor(url, args = {}) {\n this.url = url;\n this.isHttp = /^https?:/i.test(url);\n this.httpHeaders = this.isHttp && args.httpHeaders || Object.create(null);\n this.withCredentials = args.withCredentials || false;\n\n this.getXhr = args.getXhr || function NetworkManager_getXhr() {\n return new XMLHttpRequest();\n };\n\n this.currXhrId = 0;\n this.pendingRequests = Object.create(null);\n }\n\n requestRange(begin, end, listeners) {\n const args = {\n begin,\n end\n };\n\n for (const prop in listeners) {\n args[prop] = listeners[prop];\n }\n\n return this.request(args);\n }\n\n requestFull(listeners) {\n return this.request(listeners);\n }\n\n request(args) {\n const xhr = this.getXhr();\n const xhrId = this.currXhrId++;\n const pendingRequest = this.pendingRequests[xhrId] = {\n xhr\n };\n xhr.open(\"GET\", this.url);\n xhr.withCredentials = this.withCredentials;\n\n for (const property in this.httpHeaders) {\n const value = this.httpHeaders[property];\n\n if (typeof value === \"undefined\") {\n continue;\n }\n\n xhr.setRequestHeader(property, value);\n }\n\n if (this.isHttp && \"begin\" in args && \"end\" in args) {\n xhr.setRequestHeader(\"Range\", `bytes=${args.begin}-${args.end - 1}`);\n pendingRequest.expectedStatus = PARTIAL_CONTENT_RESPONSE;\n } else {\n pendingRequest.expectedStatus = OK_RESPONSE;\n }\n\n xhr.responseType = \"arraybuffer\";\n\n if (args.onError) {\n xhr.onerror = function (evt) {\n args.onError(xhr.status);\n };\n }\n\n xhr.onreadystatechange = this.onStateChange.bind(this, xhrId);\n xhr.onprogress = this.onProgress.bind(this, xhrId);\n pendingRequest.onHeadersReceived = args.onHeadersReceived;\n pendingRequest.onDone = args.onDone;\n pendingRequest.onError = args.onError;\n pendingRequest.onProgress = args.onProgress;\n xhr.send(null);\n return xhrId;\n }\n\n onProgress(xhrId, evt) {\n const pendingRequest = this.pendingRequests[xhrId];\n\n if (!pendingRequest) {\n return;\n }\n\n pendingRequest.onProgress?.(evt);\n }\n\n onStateChange(xhrId, evt) {\n const pendingRequest = this.pendingRequests[xhrId];\n\n if (!pendingRequest) {\n return;\n }\n\n const xhr = pendingRequest.xhr;\n\n if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) {\n pendingRequest.onHeadersReceived();\n delete pendingRequest.onHeadersReceived;\n }\n\n if (xhr.readyState !== 4) {\n return;\n }\n\n if (!(xhrId in this.pendingRequests)) {\n return;\n }\n\n delete this.pendingRequests[xhrId];\n\n if (xhr.status === 0 && this.isHttp) {\n pendingRequest.onError?.(xhr.status);\n return;\n }\n\n const xhrStatus = xhr.status || OK_RESPONSE;\n const ok_response_on_range_request = xhrStatus === OK_RESPONSE && pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE;\n\n if (!ok_response_on_range_request && xhrStatus !== pendingRequest.expectedStatus) {\n pendingRequest.onError?.(xhr.status);\n return;\n }\n\n const chunk = getArrayBuffer(xhr);\n\n if (xhrStatus === PARTIAL_CONTENT_RESPONSE) {\n const rangeHeader = xhr.getResponseHeader(\"Content-Range\");\n const matches = /bytes (\\d+)-(\\d+)\\/(\\d+)/.exec(rangeHeader);\n pendingRequest.onDone({\n begin: parseInt(matches[1], 10),\n chunk\n });\n } else if (chunk) {\n pendingRequest.onDone({\n begin: 0,\n chunk\n });\n } else {\n pendingRequest.onError?.(xhr.status);\n }\n }\n\n getRequestXhr(xhrId) {\n return this.pendingRequests[xhrId].xhr;\n }\n\n isPendingRequest(xhrId) {\n return xhrId in this.pendingRequests;\n }\n\n abortRequest(xhrId) {\n const xhr = this.pendingRequests[xhrId].xhr;\n delete this.pendingRequests[xhrId];\n xhr.abort();\n }\n\n}\n\nclass PDFNetworkStream {\n constructor(source) {\n this._source = source;\n this._manager = new NetworkManager(source.url, {\n httpHeaders: source.httpHeaders,\n withCredentials: source.withCredentials\n });\n this._rangeChunkSize = source.rangeChunkSize;\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n _onRangeRequestReaderClosed(reader) {\n const i = this._rangeRequestReaders.indexOf(reader);\n\n if (i >= 0) {\n this._rangeRequestReaders.splice(i, 1);\n }\n }\n\n getFullReader() {\n (0, _util.assert)(!this._fullRequestReader, \"PDFNetworkStream.getFullReader can only be called once.\");\n this._fullRequestReader = new PDFNetworkStreamFullRequestReader(this._manager, this._source);\n return this._fullRequestReader;\n }\n\n getRangeReader(begin, end) {\n const reader = new PDFNetworkStreamRangeRequestReader(this._manager, begin, end);\n reader.onClosed = this._onRangeRequestReaderClosed.bind(this);\n\n this._rangeRequestReaders.push(reader);\n\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n\n}\n\nexports.PDFNetworkStream = PDFNetworkStream;\n\nclass PDFNetworkStreamFullRequestReader {\n constructor(manager, source) {\n this._manager = manager;\n const args = {\n onHeadersReceived: this._onHeadersReceived.bind(this),\n onDone: this._onDone.bind(this),\n onError: this._onError.bind(this),\n onProgress: this._onProgress.bind(this)\n };\n this._url = source.url;\n this._fullRequestId = manager.requestFull(args);\n this._headersReceivedCapability = (0, _util.createPromiseCapability)();\n this._disableRange = source.disableRange || false;\n this._contentLength = source.length;\n this._rangeChunkSize = source.rangeChunkSize;\n\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = false;\n this._isRangeSupported = false;\n this._cachedChunks = [];\n this._requests = [];\n this._done = false;\n this._storedError = undefined;\n this._filename = null;\n this.onProgress = null;\n }\n\n _onHeadersReceived() {\n const fullRequestXhrId = this._fullRequestId;\n\n const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId);\n\n const getResponseHeader = name => {\n return fullRequestXhr.getResponseHeader(name);\n };\n\n const {\n allowRangeRequests,\n suggestedLength\n } = (0, _network_utils.validateRangeRequestCapabilities)({\n getResponseHeader,\n isHttp: this._manager.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange\n });\n\n if (allowRangeRequests) {\n this._isRangeSupported = true;\n }\n\n this._contentLength = suggestedLength || this._contentLength;\n this._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader);\n\n if (this._isRangeSupported) {\n this._manager.abortRequest(fullRequestXhrId);\n }\n\n this._headersReceivedCapability.resolve();\n }\n\n _onDone(data) {\n if (data) {\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n\n requestCapability.resolve({\n value: data.chunk,\n done: false\n });\n } else {\n this._cachedChunks.push(data.chunk);\n }\n }\n\n this._done = true;\n\n if (this._cachedChunks.length > 0) {\n return;\n }\n\n for (const requestCapability of this._requests) {\n requestCapability.resolve({\n value: undefined,\n done: true\n });\n }\n\n this._requests.length = 0;\n }\n\n _onError(status) {\n this._storedError = (0, _network_utils.createResponseStatusError)(status, this._url);\n\n this._headersReceivedCapability.reject(this._storedError);\n\n for (const requestCapability of this._requests) {\n requestCapability.reject(this._storedError);\n }\n\n this._requests.length = 0;\n this._cachedChunks.length = 0;\n }\n\n _onProgress(evt) {\n this.onProgress?.({\n loaded: evt.loaded,\n total: evt.lengthComputable ? evt.total : this._contentLength\n });\n }\n\n get filename() {\n return this._filename;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get headersReady() {\n return this._headersReceivedCapability.promise;\n }\n\n async read() {\n if (this._storedError) {\n throw this._storedError;\n }\n\n if (this._cachedChunks.length > 0) {\n const chunk = this._cachedChunks.shift();\n\n return {\n value: chunk,\n done: false\n };\n }\n\n if (this._done) {\n return {\n value: undefined,\n done: true\n };\n }\n\n const requestCapability = (0, _util.createPromiseCapability)();\n\n this._requests.push(requestCapability);\n\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n\n this._headersReceivedCapability.reject(reason);\n\n for (const requestCapability of this._requests) {\n requestCapability.resolve({\n value: undefined,\n done: true\n });\n }\n\n this._requests.length = 0;\n\n if (this._manager.isPendingRequest(this._fullRequestId)) {\n this._manager.abortRequest(this._fullRequestId);\n }\n\n this._fullRequestReader = null;\n }\n\n}\n\nclass PDFNetworkStreamRangeRequestReader {\n constructor(manager, begin, end) {\n this._manager = manager;\n const args = {\n onDone: this._onDone.bind(this),\n onError: this._onError.bind(this),\n onProgress: this._onProgress.bind(this)\n };\n this._url = manager.url;\n this._requestId = manager.requestRange(begin, end, args);\n this._requests = [];\n this._queuedChunk = null;\n this._done = false;\n this._storedError = undefined;\n this.onProgress = null;\n this.onClosed = null;\n }\n\n _close() {\n this.onClosed?.(this);\n }\n\n _onDone(data) {\n const chunk = data.chunk;\n\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n\n requestCapability.resolve({\n value: chunk,\n done: false\n });\n } else {\n this._queuedChunk = chunk;\n }\n\n this._done = true;\n\n for (const requestCapability of this._requests) {\n requestCapability.resolve({\n value: undefined,\n done: true\n });\n }\n\n this._requests.length = 0;\n\n this._close();\n }\n\n _onError(status) {\n this._storedError = (0, _network_utils.createResponseStatusError)(status, this._url);\n\n for (const requestCapability of this._requests) {\n requestCapability.reject(this._storedError);\n }\n\n this._requests.length = 0;\n this._queuedChunk = null;\n }\n\n _onProgress(evt) {\n if (!this.isStreamingSupported) {\n this.onProgress?.({\n loaded: evt.loaded\n });\n }\n }\n\n get isStreamingSupported() {\n return false;\n }\n\n async read() {\n if (this._storedError) {\n throw this._storedError;\n }\n\n if (this._queuedChunk !== null) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return {\n value: chunk,\n done: false\n };\n }\n\n if (this._done) {\n return {\n value: undefined,\n done: true\n };\n }\n\n const requestCapability = (0, _util.createPromiseCapability)();\n\n this._requests.push(requestCapability);\n\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n\n for (const requestCapability of this._requests) {\n requestCapability.resolve({\n value: undefined,\n done: true\n });\n }\n\n this._requests.length = 0;\n\n if (this._manager.isPendingRequest(this._requestId)) {\n this._manager.abortRequest(this._requestId);\n }\n\n this._close();\n }\n\n}\n\n/***/ }),\n/* 36 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFFetchStream = void 0;\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _network_utils = __w_pdfjs_require__(33);\n\n;\n\nfunction createFetchOptions(headers, withCredentials, abortController) {\n return {\n method: \"GET\",\n headers,\n signal: abortController.signal,\n mode: \"cors\",\n credentials: withCredentials ? \"include\" : \"same-origin\",\n redirect: \"follow\"\n };\n}\n\nfunction createHeaders(httpHeaders) {\n const headers = new Headers();\n\n for (const property in httpHeaders) {\n const value = httpHeaders[property];\n\n if (typeof value === \"undefined\") {\n continue;\n }\n\n headers.append(property, value);\n }\n\n return headers;\n}\n\nclass PDFFetchStream {\n constructor(source) {\n this.source = source;\n this.isHttp = /^https?:/i.test(source.url);\n this.httpHeaders = this.isHttp && source.httpHeaders || {};\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n getFullReader() {\n (0, _util.assert)(!this._fullRequestReader, \"PDFFetchStream.getFullReader can only be called once.\");\n this._fullRequestReader = new PDFFetchStreamReader(this);\n return this._fullRequestReader;\n }\n\n getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n\n const reader = new PDFFetchStreamRangeReader(this, begin, end);\n\n this._rangeRequestReaders.push(reader);\n\n return reader;\n }\n\n cancelAllRequests(reason) {\n if (this._fullRequestReader) {\n this._fullRequestReader.cancel(reason);\n }\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n\n}\n\nexports.PDFFetchStream = PDFFetchStream;\n\nclass PDFFetchStreamReader {\n constructor(stream) {\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n this._filename = null;\n const source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._contentLength = source.length;\n this._headersCapability = (0, _util.createPromiseCapability)();\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._abortController = new AbortController();\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n this._headers = createHeaders(this._stream.httpHeaders);\n const url = source.url;\n fetch(url, createFetchOptions(this._headers, this._withCredentials, this._abortController)).then(response => {\n if (!(0, _network_utils.validateResponseStatus)(response.status)) {\n throw (0, _network_utils.createResponseStatusError)(response.status, url);\n }\n\n this._reader = response.body.getReader();\n\n this._headersCapability.resolve();\n\n const getResponseHeader = name => {\n return response.headers.get(name);\n };\n\n const {\n allowRangeRequests,\n suggestedLength\n } = (0, _network_utils.validateRangeRequestCapabilities)({\n getResponseHeader,\n isHttp: this._stream.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange\n });\n this._isRangeSupported = allowRangeRequests;\n this._contentLength = suggestedLength || this._contentLength;\n this._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader);\n\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this.cancel(new _util.AbortException(\"Streaming is disabled.\"));\n }\n }).catch(this._headersCapability.reject);\n this.onProgress = null;\n }\n\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n get filename() {\n return this._filename;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._headersCapability.promise;\n const {\n value,\n done\n } = await this._reader.read();\n\n if (done) {\n return {\n value,\n done\n };\n }\n\n this._loaded += value.byteLength;\n\n if (this.onProgress) {\n this.onProgress({\n loaded: this._loaded,\n total: this._contentLength\n });\n }\n\n const buffer = new Uint8Array(value).buffer;\n return {\n value: buffer,\n done: false\n };\n }\n\n cancel(reason) {\n if (this._reader) {\n this._reader.cancel(reason);\n }\n\n this._abortController.abort();\n }\n\n}\n\nclass PDFFetchStreamRangeReader {\n constructor(stream, begin, end) {\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n const source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._readCapability = (0, _util.createPromiseCapability)();\n this._isStreamingSupported = !source.disableStream;\n this._abortController = new AbortController();\n this._headers = createHeaders(this._stream.httpHeaders);\n\n this._headers.append(\"Range\", `bytes=${begin}-${end - 1}`);\n\n const url = source.url;\n fetch(url, createFetchOptions(this._headers, this._withCredentials, this._abortController)).then(response => {\n if (!(0, _network_utils.validateResponseStatus)(response.status)) {\n throw (0, _network_utils.createResponseStatusError)(response.status, url);\n }\n\n this._readCapability.resolve();\n\n this._reader = response.body.getReader();\n }).catch(this._readCapability.reject);\n this.onProgress = null;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n const {\n value,\n done\n } = await this._reader.read();\n\n if (done) {\n return {\n value,\n done\n };\n }\n\n this._loaded += value.byteLength;\n\n if (this.onProgress) {\n this.onProgress({\n loaded: this._loaded\n });\n }\n\n const buffer = new Uint8Array(value).buffer;\n return {\n value: buffer,\n done: false\n };\n }\n\n cancel(reason) {\n if (this._reader) {\n this._reader.cancel(reason);\n }\n\n this._abortController.abort();\n }\n\n}\n\n/***/ })\n/******/ \t]);\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __w_pdfjs_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __w_pdfjs_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\nvar __webpack_exports__ = {};\n// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.\n(() => {\nvar exports = __webpack_exports__;\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"AnnotationEditorLayer\", ({\n enumerable: true,\n get: function () {\n return _annotation_editor_layer.AnnotationEditorLayer;\n }\n}));\nObject.defineProperty(exports, \"AnnotationEditorParamsType\", ({\n enumerable: true,\n get: function () {\n return _util.AnnotationEditorParamsType;\n }\n}));\nObject.defineProperty(exports, \"AnnotationEditorType\", ({\n enumerable: true,\n get: function () {\n return _util.AnnotationEditorType;\n }\n}));\nObject.defineProperty(exports, \"AnnotationEditorUIManager\", ({\n enumerable: true,\n get: function () {\n return _tools.AnnotationEditorUIManager;\n }\n}));\nObject.defineProperty(exports, \"AnnotationLayer\", ({\n enumerable: true,\n get: function () {\n return _annotation_layer.AnnotationLayer;\n }\n}));\nObject.defineProperty(exports, \"AnnotationMode\", ({\n enumerable: true,\n get: function () {\n return _util.AnnotationMode;\n }\n}));\nObject.defineProperty(exports, \"CMapCompressionType\", ({\n enumerable: true,\n get: function () {\n return _util.CMapCompressionType;\n }\n}));\nObject.defineProperty(exports, \"GlobalWorkerOptions\", ({\n enumerable: true,\n get: function () {\n return _worker_options.GlobalWorkerOptions;\n }\n}));\nObject.defineProperty(exports, \"InvalidPDFException\", ({\n enumerable: true,\n get: function () {\n return _util.InvalidPDFException;\n }\n}));\nObject.defineProperty(exports, \"LoopbackPort\", ({\n enumerable: true,\n get: function () {\n return _api.LoopbackPort;\n }\n}));\nObject.defineProperty(exports, \"MissingPDFException\", ({\n enumerable: true,\n get: function () {\n return _util.MissingPDFException;\n }\n}));\nObject.defineProperty(exports, \"OPS\", ({\n enumerable: true,\n get: function () {\n return _util.OPS;\n }\n}));\nObject.defineProperty(exports, \"PDFDataRangeTransport\", ({\n enumerable: true,\n get: function () {\n return _api.PDFDataRangeTransport;\n }\n}));\nObject.defineProperty(exports, \"PDFDateString\", ({\n enumerable: true,\n get: function () {\n return _display_utils.PDFDateString;\n }\n}));\nObject.defineProperty(exports, \"PDFWorker\", ({\n enumerable: true,\n get: function () {\n return _api.PDFWorker;\n }\n}));\nObject.defineProperty(exports, \"PasswordResponses\", ({\n enumerable: true,\n get: function () {\n return _util.PasswordResponses;\n }\n}));\nObject.defineProperty(exports, \"PermissionFlag\", ({\n enumerable: true,\n get: function () {\n return _util.PermissionFlag;\n }\n}));\nObject.defineProperty(exports, \"PixelsPerInch\", ({\n enumerable: true,\n get: function () {\n return _display_utils.PixelsPerInch;\n }\n}));\nObject.defineProperty(exports, \"RenderingCancelledException\", ({\n enumerable: true,\n get: function () {\n return _display_utils.RenderingCancelledException;\n }\n}));\nObject.defineProperty(exports, \"SVGGraphics\", ({\n enumerable: true,\n get: function () {\n return _svg.SVGGraphics;\n }\n}));\nObject.defineProperty(exports, \"UNSUPPORTED_FEATURES\", ({\n enumerable: true,\n get: function () {\n return _util.UNSUPPORTED_FEATURES;\n }\n}));\nObject.defineProperty(exports, \"UnexpectedResponseException\", ({\n enumerable: true,\n get: function () {\n return _util.UnexpectedResponseException;\n }\n}));\nObject.defineProperty(exports, \"Util\", ({\n enumerable: true,\n get: function () {\n return _util.Util;\n }\n}));\nObject.defineProperty(exports, \"VerbosityLevel\", ({\n enumerable: true,\n get: function () {\n return _util.VerbosityLevel;\n }\n}));\nObject.defineProperty(exports, \"XfaLayer\", ({\n enumerable: true,\n get: function () {\n return _xfa_layer.XfaLayer;\n }\n}));\nObject.defineProperty(exports, \"build\", ({\n enumerable: true,\n get: function () {\n return _api.build;\n }\n}));\nObject.defineProperty(exports, \"createPromiseCapability\", ({\n enumerable: true,\n get: function () {\n return _util.createPromiseCapability;\n }\n}));\nObject.defineProperty(exports, \"createValidAbsoluteUrl\", ({\n enumerable: true,\n get: function () {\n return _util.createValidAbsoluteUrl;\n }\n}));\nObject.defineProperty(exports, \"getDocument\", ({\n enumerable: true,\n get: function () {\n return _api.getDocument;\n }\n}));\nObject.defineProperty(exports, \"getFilenameFromUrl\", ({\n enumerable: true,\n get: function () {\n return _display_utils.getFilenameFromUrl;\n }\n}));\nObject.defineProperty(exports, \"getPdfFilenameFromUrl\", ({\n enumerable: true,\n get: function () {\n return _display_utils.getPdfFilenameFromUrl;\n }\n}));\nObject.defineProperty(exports, \"getXfaPageViewport\", ({\n enumerable: true,\n get: function () {\n return _display_utils.getXfaPageViewport;\n }\n}));\nObject.defineProperty(exports, \"isPdfFile\", ({\n enumerable: true,\n get: function () {\n return _display_utils.isPdfFile;\n }\n}));\nObject.defineProperty(exports, \"loadScript\", ({\n enumerable: true,\n get: function () {\n return _display_utils.loadScript;\n }\n}));\nObject.defineProperty(exports, \"renderTextLayer\", ({\n enumerable: true,\n get: function () {\n return _text_layer.renderTextLayer;\n }\n}));\nObject.defineProperty(exports, \"shadow\", ({\n enumerable: true,\n get: function () {\n return _util.shadow;\n }\n}));\nObject.defineProperty(exports, \"version\", ({\n enumerable: true,\n get: function () {\n return _api.version;\n }\n}));\n\nvar _util = __w_pdfjs_require__(1);\n\nvar _api = __w_pdfjs_require__(4);\n\nvar _display_utils = __w_pdfjs_require__(8);\n\nvar _annotation_editor_layer = __w_pdfjs_require__(22);\n\nvar _tools = __w_pdfjs_require__(7);\n\nvar _annotation_layer = __w_pdfjs_require__(27);\n\nvar _worker_options = __w_pdfjs_require__(15);\n\nvar _is_node = __w_pdfjs_require__(3);\n\nvar _text_layer = __w_pdfjs_require__(30);\n\nvar _svg = __w_pdfjs_require__(31);\n\nvar _xfa_layer = __w_pdfjs_require__(29);\n\nconst pdfjsVersion = '2.16.105';\nconst pdfjsBuild = '172ccdbe5';\n{\n if (_is_node.isNodeJS) {\n const {\n PDFNodeStream\n } = __w_pdfjs_require__(32);\n\n (0, _api.setPDFNetworkStreamFactory)(params => {\n return new PDFNodeStream(params);\n });\n } else {\n const {\n PDFNetworkStream\n } = __w_pdfjs_require__(35);\n\n const {\n PDFFetchStream\n } = __w_pdfjs_require__(36);\n\n (0, _api.setPDFNetworkStreamFactory)(params => {\n if ((0, _display_utils.isValidFetchUrl)(params.url)) {\n return new PDFFetchStream(params);\n }\n\n return new PDFNetworkStream(params);\n });\n }\n}\n})();\n\n/******/ \treturn __webpack_exports__;\n/******/ })()\n;\n});\n//# sourceMappingURL=pdf.js.map","/**\n * @licstart The following is the entire license notice for the\n * JavaScript code in this page\n *\n * Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @licend The above is the entire license notice for the\n * JavaScript code in this page\n */\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"pdfjs-dist/web/pdf_viewer\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pdfjs-dist/web/pdf_viewer\"] = factory();\n\telse\n\t\troot[\"pdfjs-dist/web/pdf_viewer\"] = root.pdfjsViewer = factory();\n})(globalThis, () => {\nreturn /******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\n/******/ \tvar __webpack_modules__ = ([\n/* 0 */,\n/* 1 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.DefaultXfaLayerFactory = exports.DefaultTextLayerFactory = exports.DefaultStructTreeLayerFactory = exports.DefaultAnnotationLayerFactory = exports.DefaultAnnotationEditorLayerFactory = void 0;\n\nvar _annotation_editor_layer_builder = __w_pdfjs_require__(2);\n\nvar _annotation_layer_builder = __w_pdfjs_require__(5);\n\nvar _l10n_utils = __w_pdfjs_require__(4);\n\nvar _pdf_link_service = __w_pdfjs_require__(6);\n\nvar _struct_tree_layer_builder = __w_pdfjs_require__(8);\n\nvar _text_layer_builder = __w_pdfjs_require__(9);\n\nvar _xfa_layer_builder = __w_pdfjs_require__(10);\n\nclass DefaultAnnotationLayerFactory {\n createAnnotationLayerBuilder({\n pageDiv,\n pdfPage,\n annotationStorage = null,\n imageResourcesPath = \"\",\n renderForms = true,\n l10n = _l10n_utils.NullL10n,\n enableScripting = false,\n hasJSActionsPromise = null,\n mouseState = null,\n fieldObjectsPromise = null,\n annotationCanvasMap = null,\n accessibilityManager = null\n }) {\n return new _annotation_layer_builder.AnnotationLayerBuilder({\n pageDiv,\n pdfPage,\n imageResourcesPath,\n renderForms,\n linkService: new _pdf_link_service.SimpleLinkService(),\n l10n,\n annotationStorage,\n enableScripting,\n hasJSActionsPromise,\n fieldObjectsPromise,\n mouseState,\n annotationCanvasMap,\n accessibilityManager\n });\n }\n\n}\n\nexports.DefaultAnnotationLayerFactory = DefaultAnnotationLayerFactory;\n\nclass DefaultAnnotationEditorLayerFactory {\n createAnnotationEditorLayerBuilder({\n uiManager = null,\n pageDiv,\n pdfPage,\n accessibilityManager = null,\n l10n,\n annotationStorage = null\n }) {\n return new _annotation_editor_layer_builder.AnnotationEditorLayerBuilder({\n uiManager,\n pageDiv,\n pdfPage,\n accessibilityManager,\n l10n,\n annotationStorage\n });\n }\n\n}\n\nexports.DefaultAnnotationEditorLayerFactory = DefaultAnnotationEditorLayerFactory;\n\nclass DefaultStructTreeLayerFactory {\n createStructTreeLayerBuilder({\n pdfPage\n }) {\n return new _struct_tree_layer_builder.StructTreeLayerBuilder({\n pdfPage\n });\n }\n\n}\n\nexports.DefaultStructTreeLayerFactory = DefaultStructTreeLayerFactory;\n\nclass DefaultTextLayerFactory {\n createTextLayerBuilder({\n textLayerDiv,\n pageIndex,\n viewport,\n enhanceTextSelection = false,\n eventBus,\n highlighter,\n accessibilityManager = null\n }) {\n return new _text_layer_builder.TextLayerBuilder({\n textLayerDiv,\n pageIndex,\n viewport,\n enhanceTextSelection,\n eventBus,\n highlighter,\n accessibilityManager\n });\n }\n\n}\n\nexports.DefaultTextLayerFactory = DefaultTextLayerFactory;\n\nclass DefaultXfaLayerFactory {\n createXfaLayerBuilder({\n pageDiv,\n pdfPage,\n annotationStorage = null\n }) {\n return new _xfa_layer_builder.XfaLayerBuilder({\n pageDiv,\n pdfPage,\n annotationStorage,\n linkService: new _pdf_link_service.SimpleLinkService()\n });\n }\n\n}\n\nexports.DefaultXfaLayerFactory = DefaultXfaLayerFactory;\n\n/***/ }),\n/* 2 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.AnnotationEditorLayerBuilder = void 0;\n\nvar _pdfjsLib = __w_pdfjs_require__(3);\n\nvar _l10n_utils = __w_pdfjs_require__(4);\n\nclass AnnotationEditorLayerBuilder {\n #uiManager;\n\n constructor(options) {\n this.pageDiv = options.pageDiv;\n this.pdfPage = options.pdfPage;\n this.annotationStorage = options.annotationStorage || null;\n this.accessibilityManager = options.accessibilityManager;\n this.l10n = options.l10n || _l10n_utils.NullL10n;\n this.annotationEditorLayer = null;\n this.div = null;\n this._cancelled = false;\n this.#uiManager = options.uiManager;\n }\n\n async render(viewport, intent = \"display\") {\n if (intent !== \"display\") {\n return;\n }\n\n if (this._cancelled) {\n return;\n }\n\n const clonedViewport = viewport.clone({\n dontFlip: true\n });\n\n if (this.div) {\n this.annotationEditorLayer.update({\n viewport: clonedViewport\n });\n this.show();\n return;\n }\n\n this.div = document.createElement(\"div\");\n this.div.className = \"annotationEditorLayer\";\n this.div.tabIndex = 0;\n this.pageDiv.append(this.div);\n this.annotationEditorLayer = new _pdfjsLib.AnnotationEditorLayer({\n uiManager: this.#uiManager,\n div: this.div,\n annotationStorage: this.annotationStorage,\n accessibilityManager: this.accessibilityManager,\n pageIndex: this.pdfPage._pageIndex,\n l10n: this.l10n,\n viewport: clonedViewport\n });\n const parameters = {\n viewport: clonedViewport,\n div: this.div,\n annotations: null,\n intent\n };\n this.annotationEditorLayer.render(parameters);\n }\n\n cancel() {\n this._cancelled = true;\n this.destroy();\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n\n this.div.hidden = true;\n }\n\n show() {\n if (!this.div) {\n return;\n }\n\n this.div.hidden = false;\n }\n\n destroy() {\n if (!this.div) {\n return;\n }\n\n this.pageDiv = null;\n this.annotationEditorLayer.destroy();\n this.div.remove();\n }\n\n}\n\nexports.AnnotationEditorLayerBuilder = AnnotationEditorLayerBuilder;\n\n/***/ }),\n/* 3 */\n/***/ ((module) => {\n\n\n\nlet pdfjsLib;\n\nif (typeof window !== \"undefined\" && window[\"pdfjs-dist/build/pdf\"]) {\n pdfjsLib = window[\"pdfjs-dist/build/pdf\"];\n} else {\n pdfjsLib = require(\"../build/pdf.js\");\n}\n\nmodule.exports = pdfjsLib;\n\n/***/ }),\n/* 4 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.NullL10n = void 0;\nexports.fixupLangCode = fixupLangCode;\nexports.getL10nFallback = getL10nFallback;\nconst DEFAULT_L10N_STRINGS = {\n of_pages: \"of {{pagesCount}}\",\n page_of_pages: \"({{pageNumber}} of {{pagesCount}})\",\n document_properties_kb: \"{{size_kb}} KB ({{size_b}} bytes)\",\n document_properties_mb: \"{{size_mb}} MB ({{size_b}} bytes)\",\n document_properties_date_string: \"{{date}}, {{time}}\",\n document_properties_page_size_unit_inches: \"in\",\n document_properties_page_size_unit_millimeters: \"mm\",\n document_properties_page_size_orientation_portrait: \"portrait\",\n document_properties_page_size_orientation_landscape: \"landscape\",\n document_properties_page_size_name_a3: \"A3\",\n document_properties_page_size_name_a4: \"A4\",\n document_properties_page_size_name_letter: \"Letter\",\n document_properties_page_size_name_legal: \"Legal\",\n document_properties_page_size_dimension_string: \"{{width}} × {{height}} {{unit}} ({{orientation}})\",\n document_properties_page_size_dimension_name_string: \"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})\",\n document_properties_linearized_yes: \"Yes\",\n document_properties_linearized_no: \"No\",\n print_progress_percent: \"{{progress}}%\",\n \"toggle_sidebar.title\": \"Toggle Sidebar\",\n \"toggle_sidebar_notification2.title\": \"Toggle Sidebar (document contains outline/attachments/layers)\",\n additional_layers: \"Additional Layers\",\n page_landmark: \"Page {{page}}\",\n thumb_page_title: \"Page {{page}}\",\n thumb_page_canvas: \"Thumbnail of Page {{page}}\",\n find_reached_top: \"Reached top of document, continued from bottom\",\n find_reached_bottom: \"Reached end of document, continued from top\",\n \"find_match_count[one]\": \"{{current}} of {{total}} match\",\n \"find_match_count[other]\": \"{{current}} of {{total}} matches\",\n \"find_match_count_limit[one]\": \"More than {{limit}} match\",\n \"find_match_count_limit[other]\": \"More than {{limit}} matches\",\n find_not_found: \"Phrase not found\",\n error_version_info: \"PDF.js v{{version}} (build: {{build}})\",\n error_message: \"Message: {{message}}\",\n error_stack: \"Stack: {{stack}}\",\n error_file: \"File: {{file}}\",\n error_line: \"Line: {{line}}\",\n rendering_error: \"An error occurred while rendering the page.\",\n page_scale_width: \"Page Width\",\n page_scale_fit: \"Page Fit\",\n page_scale_auto: \"Automatic Zoom\",\n page_scale_actual: \"Actual Size\",\n page_scale_percent: \"{{scale}}%\",\n loading: \"Loading…\",\n loading_error: \"An error occurred while loading the PDF.\",\n invalid_file_error: \"Invalid or corrupted PDF file.\",\n missing_file_error: \"Missing PDF file.\",\n unexpected_response_error: \"Unexpected server response.\",\n printing_not_supported: \"Warning: Printing is not fully supported by this browser.\",\n printing_not_ready: \"Warning: The PDF is not fully loaded for printing.\",\n web_fonts_disabled: \"Web fonts are disabled: unable to use embedded PDF fonts.\",\n free_text_default_content: \"Enter text…\",\n editor_free_text_aria_label: \"FreeText Editor\",\n editor_ink_aria_label: \"Ink Editor\",\n editor_ink_canvas_aria_label: \"User-created image\"\n};\n\nfunction getL10nFallback(key, args) {\n switch (key) {\n case \"find_match_count\":\n key = `find_match_count[${args.total === 1 ? \"one\" : \"other\"}]`;\n break;\n\n case \"find_match_count_limit\":\n key = `find_match_count_limit[${args.limit === 1 ? \"one\" : \"other\"}]`;\n break;\n }\n\n return DEFAULT_L10N_STRINGS[key] || \"\";\n}\n\nconst PARTIAL_LANG_CODES = {\n en: \"en-US\",\n es: \"es-ES\",\n fy: \"fy-NL\",\n ga: \"ga-IE\",\n gu: \"gu-IN\",\n hi: \"hi-IN\",\n hy: \"hy-AM\",\n nb: \"nb-NO\",\n ne: \"ne-NP\",\n nn: \"nn-NO\",\n pa: \"pa-IN\",\n pt: \"pt-PT\",\n sv: \"sv-SE\",\n zh: \"zh-CN\"\n};\n\nfunction fixupLangCode(langCode) {\n return PARTIAL_LANG_CODES[langCode?.toLowerCase()] || langCode;\n}\n\nfunction formatL10nValue(text, args) {\n if (!args) {\n return text;\n }\n\n return text.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (all, name) => {\n return name in args ? args[name] : \"{{\" + name + \"}}\";\n });\n}\n\nconst NullL10n = {\n async getLanguage() {\n return \"en-us\";\n },\n\n async getDirection() {\n return \"ltr\";\n },\n\n async get(key, args = null, fallback = getL10nFallback(key, args)) {\n return formatL10nValue(fallback, args);\n },\n\n async translate(element) {}\n\n};\nexports.NullL10n = NullL10n;\n\n/***/ }),\n/* 5 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.AnnotationLayerBuilder = void 0;\n\nvar _pdfjsLib = __w_pdfjs_require__(3);\n\nvar _l10n_utils = __w_pdfjs_require__(4);\n\nclass AnnotationLayerBuilder {\n constructor({\n pageDiv,\n pdfPage,\n linkService,\n downloadManager,\n annotationStorage = null,\n imageResourcesPath = \"\",\n renderForms = true,\n l10n = _l10n_utils.NullL10n,\n enableScripting = false,\n hasJSActionsPromise = null,\n fieldObjectsPromise = null,\n mouseState = null,\n annotationCanvasMap = null,\n accessibilityManager = null\n }) {\n this.pageDiv = pageDiv;\n this.pdfPage = pdfPage;\n this.linkService = linkService;\n this.downloadManager = downloadManager;\n this.imageResourcesPath = imageResourcesPath;\n this.renderForms = renderForms;\n this.l10n = l10n;\n this.annotationStorage = annotationStorage;\n this.enableScripting = enableScripting;\n this._hasJSActionsPromise = hasJSActionsPromise;\n this._fieldObjectsPromise = fieldObjectsPromise;\n this._mouseState = mouseState;\n this._annotationCanvasMap = annotationCanvasMap;\n this._accessibilityManager = accessibilityManager;\n this.div = null;\n this._cancelled = false;\n }\n\n async render(viewport, intent = \"display\") {\n const [annotations, hasJSActions = false, fieldObjects = null] = await Promise.all([this.pdfPage.getAnnotations({\n intent\n }), this._hasJSActionsPromise, this._fieldObjectsPromise]);\n\n if (this._cancelled || annotations.length === 0) {\n return;\n }\n\n const parameters = {\n viewport: viewport.clone({\n dontFlip: true\n }),\n div: this.div,\n annotations,\n page: this.pdfPage,\n imageResourcesPath: this.imageResourcesPath,\n renderForms: this.renderForms,\n linkService: this.linkService,\n downloadManager: this.downloadManager,\n annotationStorage: this.annotationStorage,\n enableScripting: this.enableScripting,\n hasJSActions,\n fieldObjects,\n mouseState: this._mouseState,\n annotationCanvasMap: this._annotationCanvasMap,\n accessibilityManager: this._accessibilityManager\n };\n\n if (this.div) {\n _pdfjsLib.AnnotationLayer.update(parameters);\n } else {\n this.div = document.createElement(\"div\");\n this.div.className = \"annotationLayer\";\n this.pageDiv.append(this.div);\n parameters.div = this.div;\n\n _pdfjsLib.AnnotationLayer.render(parameters);\n\n this.l10n.translate(this.div);\n }\n }\n\n cancel() {\n this._cancelled = true;\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n\n this.div.hidden = true;\n }\n\n}\n\nexports.AnnotationLayerBuilder = AnnotationLayerBuilder;\n\n/***/ }),\n/* 6 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.SimpleLinkService = exports.PDFLinkService = exports.LinkTarget = void 0;\n\nvar _ui_utils = __w_pdfjs_require__(7);\n\nconst DEFAULT_LINK_REL = \"noopener noreferrer nofollow\";\nconst LinkTarget = {\n NONE: 0,\n SELF: 1,\n BLANK: 2,\n PARENT: 3,\n TOP: 4\n};\nexports.LinkTarget = LinkTarget;\n\nfunction addLinkAttributes(link, {\n url,\n target,\n rel,\n enabled = true\n} = {}) {\n if (!url || typeof url !== \"string\") {\n throw new Error('A valid \"url\" parameter must provided.');\n }\n\n const urlNullRemoved = (0, _ui_utils.removeNullCharacters)(url);\n\n if (enabled) {\n link.href = link.title = urlNullRemoved;\n } else {\n link.href = \"\";\n link.title = `Disabled: ${urlNullRemoved}`;\n\n link.onclick = () => {\n return false;\n };\n }\n\n let targetStr = \"\";\n\n switch (target) {\n case LinkTarget.NONE:\n break;\n\n case LinkTarget.SELF:\n targetStr = \"_self\";\n break;\n\n case LinkTarget.BLANK:\n targetStr = \"_blank\";\n break;\n\n case LinkTarget.PARENT:\n targetStr = \"_parent\";\n break;\n\n case LinkTarget.TOP:\n targetStr = \"_top\";\n break;\n }\n\n link.target = targetStr;\n link.rel = typeof rel === \"string\" ? rel : DEFAULT_LINK_REL;\n}\n\nclass PDFLinkService {\n #pagesRefCache = new Map();\n\n constructor({\n eventBus,\n externalLinkTarget = null,\n externalLinkRel = null,\n ignoreDestinationZoom = false\n } = {}) {\n this.eventBus = eventBus;\n this.externalLinkTarget = externalLinkTarget;\n this.externalLinkRel = externalLinkRel;\n this.externalLinkEnabled = true;\n this._ignoreDestinationZoom = ignoreDestinationZoom;\n this.baseUrl = null;\n this.pdfDocument = null;\n this.pdfViewer = null;\n this.pdfHistory = null;\n }\n\n setDocument(pdfDocument, baseUrl = null) {\n this.baseUrl = baseUrl;\n this.pdfDocument = pdfDocument;\n this.#pagesRefCache.clear();\n }\n\n setViewer(pdfViewer) {\n this.pdfViewer = pdfViewer;\n }\n\n setHistory(pdfHistory) {\n this.pdfHistory = pdfHistory;\n }\n\n get pagesCount() {\n return this.pdfDocument ? this.pdfDocument.numPages : 0;\n }\n\n get page() {\n return this.pdfViewer.currentPageNumber;\n }\n\n set page(value) {\n this.pdfViewer.currentPageNumber = value;\n }\n\n get rotation() {\n return this.pdfViewer.pagesRotation;\n }\n\n set rotation(value) {\n this.pdfViewer.pagesRotation = value;\n }\n\n #goToDestinationHelper(rawDest, namedDest = null, explicitDest) {\n const destRef = explicitDest[0];\n let pageNumber;\n\n if (typeof destRef === \"object\" && destRef !== null) {\n pageNumber = this._cachedPageNumber(destRef);\n\n if (!pageNumber) {\n this.pdfDocument.getPageIndex(destRef).then(pageIndex => {\n this.cachePageRef(pageIndex + 1, destRef);\n this.#goToDestinationHelper(rawDest, namedDest, explicitDest);\n }).catch(() => {\n console.error(`PDFLinkService.#goToDestinationHelper: \"${destRef}\" is not ` + `a valid page reference, for dest=\"${rawDest}\".`);\n });\n return;\n }\n } else if (Number.isInteger(destRef)) {\n pageNumber = destRef + 1;\n } else {\n console.error(`PDFLinkService.#goToDestinationHelper: \"${destRef}\" is not ` + `a valid destination reference, for dest=\"${rawDest}\".`);\n return;\n }\n\n if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) {\n console.error(`PDFLinkService.#goToDestinationHelper: \"${pageNumber}\" is not ` + `a valid page number, for dest=\"${rawDest}\".`);\n return;\n }\n\n if (this.pdfHistory) {\n this.pdfHistory.pushCurrentPosition();\n this.pdfHistory.push({\n namedDest,\n explicitDest,\n pageNumber\n });\n }\n\n this.pdfViewer.scrollPageIntoView({\n pageNumber,\n destArray: explicitDest,\n ignoreDestinationZoom: this._ignoreDestinationZoom\n });\n }\n\n async goToDestination(dest) {\n if (!this.pdfDocument) {\n return;\n }\n\n let namedDest, explicitDest;\n\n if (typeof dest === \"string\") {\n namedDest = dest;\n explicitDest = await this.pdfDocument.getDestination(dest);\n } else {\n namedDest = null;\n explicitDest = await dest;\n }\n\n if (!Array.isArray(explicitDest)) {\n console.error(`PDFLinkService.goToDestination: \"${explicitDest}\" is not ` + `a valid destination array, for dest=\"${dest}\".`);\n return;\n }\n\n this.#goToDestinationHelper(dest, namedDest, explicitDest);\n }\n\n goToPage(val) {\n if (!this.pdfDocument) {\n return;\n }\n\n const pageNumber = typeof val === \"string\" && this.pdfViewer.pageLabelToPageNumber(val) || val | 0;\n\n if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {\n console.error(`PDFLinkService.goToPage: \"${val}\" is not a valid page.`);\n return;\n }\n\n if (this.pdfHistory) {\n this.pdfHistory.pushCurrentPosition();\n this.pdfHistory.pushPage(pageNumber);\n }\n\n this.pdfViewer.scrollPageIntoView({\n pageNumber\n });\n }\n\n addLinkAttributes(link, url, newWindow = false) {\n addLinkAttributes(link, {\n url,\n target: newWindow ? LinkTarget.BLANK : this.externalLinkTarget,\n rel: this.externalLinkRel,\n enabled: this.externalLinkEnabled\n });\n }\n\n getDestinationHash(dest) {\n if (typeof dest === \"string\") {\n if (dest.length > 0) {\n return this.getAnchorUrl(\"#\" + escape(dest));\n }\n } else if (Array.isArray(dest)) {\n const str = JSON.stringify(dest);\n\n if (str.length > 0) {\n return this.getAnchorUrl(\"#\" + escape(str));\n }\n }\n\n return this.getAnchorUrl(\"\");\n }\n\n getAnchorUrl(anchor) {\n return (this.baseUrl || \"\") + anchor;\n }\n\n setHash(hash) {\n if (!this.pdfDocument) {\n return;\n }\n\n let pageNumber, dest;\n\n if (hash.includes(\"=\")) {\n const params = (0, _ui_utils.parseQueryString)(hash);\n\n if (params.has(\"search\")) {\n this.eventBus.dispatch(\"findfromurlhash\", {\n source: this,\n query: params.get(\"search\").replace(/\"/g, \"\"),\n phraseSearch: params.get(\"phrase\") === \"true\"\n });\n }\n\n if (params.has(\"page\")) {\n pageNumber = params.get(\"page\") | 0 || 1;\n }\n\n if (params.has(\"zoom\")) {\n const zoomArgs = params.get(\"zoom\").split(\",\");\n const zoomArg = zoomArgs[0];\n const zoomArgNumber = parseFloat(zoomArg);\n\n if (!zoomArg.includes(\"Fit\")) {\n dest = [null, {\n name: \"XYZ\"\n }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null, zoomArgs.length > 2 ? zoomArgs[2] | 0 : null, zoomArgNumber ? zoomArgNumber / 100 : zoomArg];\n } else {\n if (zoomArg === \"Fit\" || zoomArg === \"FitB\") {\n dest = [null, {\n name: zoomArg\n }];\n } else if (zoomArg === \"FitH\" || zoomArg === \"FitBH\" || zoomArg === \"FitV\" || zoomArg === \"FitBV\") {\n dest = [null, {\n name: zoomArg\n }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null];\n } else if (zoomArg === \"FitR\") {\n if (zoomArgs.length !== 5) {\n console.error('PDFLinkService.setHash: Not enough parameters for \"FitR\".');\n } else {\n dest = [null, {\n name: zoomArg\n }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];\n }\n } else {\n console.error(`PDFLinkService.setHash: \"${zoomArg}\" is not a valid zoom value.`);\n }\n }\n }\n\n if (dest) {\n this.pdfViewer.scrollPageIntoView({\n pageNumber: pageNumber || this.page,\n destArray: dest,\n allowNegativeOffset: true\n });\n } else if (pageNumber) {\n this.page = pageNumber;\n }\n\n if (params.has(\"pagemode\")) {\n this.eventBus.dispatch(\"pagemode\", {\n source: this,\n mode: params.get(\"pagemode\")\n });\n }\n\n if (params.has(\"nameddest\")) {\n this.goToDestination(params.get(\"nameddest\"));\n }\n } else {\n dest = unescape(hash);\n\n try {\n dest = JSON.parse(dest);\n\n if (!Array.isArray(dest)) {\n dest = dest.toString();\n }\n } catch (ex) {}\n\n if (typeof dest === \"string\" || PDFLinkService.#isValidExplicitDestination(dest)) {\n this.goToDestination(dest);\n return;\n }\n\n console.error(`PDFLinkService.setHash: \"${unescape(hash)}\" is not a valid destination.`);\n }\n }\n\n executeNamedAction(action) {\n switch (action) {\n case \"GoBack\":\n this.pdfHistory?.back();\n break;\n\n case \"GoForward\":\n this.pdfHistory?.forward();\n break;\n\n case \"NextPage\":\n this.pdfViewer.nextPage();\n break;\n\n case \"PrevPage\":\n this.pdfViewer.previousPage();\n break;\n\n case \"LastPage\":\n this.page = this.pagesCount;\n break;\n\n case \"FirstPage\":\n this.page = 1;\n break;\n\n default:\n break;\n }\n\n this.eventBus.dispatch(\"namedaction\", {\n source: this,\n action\n });\n }\n\n cachePageRef(pageNum, pageRef) {\n if (!pageRef) {\n return;\n }\n\n const refStr = pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`;\n this.#pagesRefCache.set(refStr, pageNum);\n }\n\n _cachedPageNumber(pageRef) {\n if (!pageRef) {\n return null;\n }\n\n const refStr = pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`;\n return this.#pagesRefCache.get(refStr) || null;\n }\n\n isPageVisible(pageNumber) {\n return this.pdfViewer.isPageVisible(pageNumber);\n }\n\n isPageCached(pageNumber) {\n return this.pdfViewer.isPageCached(pageNumber);\n }\n\n static #isValidExplicitDestination(dest) {\n if (!Array.isArray(dest)) {\n return false;\n }\n\n const destLength = dest.length;\n\n if (destLength < 2) {\n return false;\n }\n\n const page = dest[0];\n\n if (!(typeof page === \"object\" && Number.isInteger(page.num) && Number.isInteger(page.gen)) && !(Number.isInteger(page) && page >= 0)) {\n return false;\n }\n\n const zoom = dest[1];\n\n if (!(typeof zoom === \"object\" && typeof zoom.name === \"string\")) {\n return false;\n }\n\n let allowNull = true;\n\n switch (zoom.name) {\n case \"XYZ\":\n if (destLength !== 5) {\n return false;\n }\n\n break;\n\n case \"Fit\":\n case \"FitB\":\n return destLength === 2;\n\n case \"FitH\":\n case \"FitBH\":\n case \"FitV\":\n case \"FitBV\":\n if (destLength !== 3) {\n return false;\n }\n\n break;\n\n case \"FitR\":\n if (destLength !== 6) {\n return false;\n }\n\n allowNull = false;\n break;\n\n default:\n return false;\n }\n\n for (let i = 2; i < destLength; i++) {\n const param = dest[i];\n\n if (!(typeof param === \"number\" || allowNull && param === null)) {\n return false;\n }\n }\n\n return true;\n }\n\n}\n\nexports.PDFLinkService = PDFLinkService;\n\nclass SimpleLinkService {\n constructor() {\n this.externalLinkEnabled = true;\n }\n\n get pagesCount() {\n return 0;\n }\n\n get page() {\n return 0;\n }\n\n set page(value) {}\n\n get rotation() {\n return 0;\n }\n\n set rotation(value) {}\n\n async goToDestination(dest) {}\n\n goToPage(val) {}\n\n addLinkAttributes(link, url, newWindow = false) {\n addLinkAttributes(link, {\n url,\n enabled: this.externalLinkEnabled\n });\n }\n\n getDestinationHash(dest) {\n return \"#\";\n }\n\n getAnchorUrl(hash) {\n return \"#\";\n }\n\n setHash(hash) {}\n\n executeNamedAction(action) {}\n\n cachePageRef(pageNum, pageRef) {}\n\n isPageVisible(pageNumber) {\n return true;\n }\n\n isPageCached(pageNumber) {\n return true;\n }\n\n}\n\nexports.SimpleLinkService = SimpleLinkService;\n\n/***/ }),\n/* 7 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.animationStarted = exports.VERTICAL_PADDING = exports.UNKNOWN_SCALE = exports.TextLayerMode = exports.SpreadMode = exports.SidebarView = exports.ScrollMode = exports.SCROLLBAR_PADDING = exports.RenderingStates = exports.RendererType = exports.ProgressBar = exports.PresentationModeState = exports.OutputScale = exports.MIN_SCALE = exports.MAX_SCALE = exports.MAX_AUTO_SCALE = exports.DEFAULT_SCALE_VALUE = exports.DEFAULT_SCALE_DELTA = exports.DEFAULT_SCALE = exports.AutoPrintRegExp = void 0;\nexports.apiPageLayoutToViewerModes = apiPageLayoutToViewerModes;\nexports.apiPageModeToSidebarView = apiPageModeToSidebarView;\nexports.approximateFraction = approximateFraction;\nexports.backtrackBeforeAllVisibleElements = backtrackBeforeAllVisibleElements;\nexports.binarySearchFirstItem = binarySearchFirstItem;\nexports.docStyle = void 0;\nexports.getActiveOrFocusedElement = getActiveOrFocusedElement;\nexports.getPageSizeInches = getPageSizeInches;\nexports.getVisibleElements = getVisibleElements;\nexports.isPortraitOrientation = isPortraitOrientation;\nexports.isValidRotation = isValidRotation;\nexports.isValidScrollMode = isValidScrollMode;\nexports.isValidSpreadMode = isValidSpreadMode;\nexports.noContextMenuHandler = noContextMenuHandler;\nexports.normalizeWheelEventDelta = normalizeWheelEventDelta;\nexports.normalizeWheelEventDirection = normalizeWheelEventDirection;\nexports.parseQueryString = parseQueryString;\nexports.removeNullCharacters = removeNullCharacters;\nexports.roundToDivide = roundToDivide;\nexports.scrollIntoView = scrollIntoView;\nexports.watchScroll = watchScroll;\nconst DEFAULT_SCALE_VALUE = \"auto\";\nexports.DEFAULT_SCALE_VALUE = DEFAULT_SCALE_VALUE;\nconst DEFAULT_SCALE = 1.0;\nexports.DEFAULT_SCALE = DEFAULT_SCALE;\nconst DEFAULT_SCALE_DELTA = 1.1;\nexports.DEFAULT_SCALE_DELTA = DEFAULT_SCALE_DELTA;\nconst MIN_SCALE = 0.1;\nexports.MIN_SCALE = MIN_SCALE;\nconst MAX_SCALE = 10.0;\nexports.MAX_SCALE = MAX_SCALE;\nconst UNKNOWN_SCALE = 0;\nexports.UNKNOWN_SCALE = UNKNOWN_SCALE;\nconst MAX_AUTO_SCALE = 1.25;\nexports.MAX_AUTO_SCALE = MAX_AUTO_SCALE;\nconst SCROLLBAR_PADDING = 40;\nexports.SCROLLBAR_PADDING = SCROLLBAR_PADDING;\nconst VERTICAL_PADDING = 5;\nexports.VERTICAL_PADDING = VERTICAL_PADDING;\nconst RenderingStates = {\n INITIAL: 0,\n RUNNING: 1,\n PAUSED: 2,\n FINISHED: 3\n};\nexports.RenderingStates = RenderingStates;\nconst PresentationModeState = {\n UNKNOWN: 0,\n NORMAL: 1,\n CHANGING: 2,\n FULLSCREEN: 3\n};\nexports.PresentationModeState = PresentationModeState;\nconst SidebarView = {\n UNKNOWN: -1,\n NONE: 0,\n THUMBS: 1,\n OUTLINE: 2,\n ATTACHMENTS: 3,\n LAYERS: 4\n};\nexports.SidebarView = SidebarView;\nconst RendererType = {\n CANVAS: \"canvas\",\n SVG: \"svg\"\n};\nexports.RendererType = RendererType;\nconst TextLayerMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_ENHANCE: 2\n};\nexports.TextLayerMode = TextLayerMode;\nconst ScrollMode = {\n UNKNOWN: -1,\n VERTICAL: 0,\n HORIZONTAL: 1,\n WRAPPED: 2,\n PAGE: 3\n};\nexports.ScrollMode = ScrollMode;\nconst SpreadMode = {\n UNKNOWN: -1,\n NONE: 0,\n ODD: 1,\n EVEN: 2\n};\nexports.SpreadMode = SpreadMode;\nconst AutoPrintRegExp = /\\bprint\\s*\\(/;\nexports.AutoPrintRegExp = AutoPrintRegExp;\n\nclass OutputScale {\n constructor() {\n const pixelRatio = window.devicePixelRatio || 1;\n this.sx = pixelRatio;\n this.sy = pixelRatio;\n }\n\n get scaled() {\n return this.sx !== 1 || this.sy !== 1;\n }\n\n}\n\nexports.OutputScale = OutputScale;\n\nfunction scrollIntoView(element, spot, scrollMatches = false) {\n let parent = element.offsetParent;\n\n if (!parent) {\n console.error(\"offsetParent is not set -- cannot scroll\");\n return;\n }\n\n let offsetY = element.offsetTop + element.clientTop;\n let offsetX = element.offsetLeft + element.clientLeft;\n\n while (parent.clientHeight === parent.scrollHeight && parent.clientWidth === parent.scrollWidth || scrollMatches && (parent.classList.contains(\"markedContent\") || getComputedStyle(parent).overflow === \"hidden\")) {\n offsetY += parent.offsetTop;\n offsetX += parent.offsetLeft;\n parent = parent.offsetParent;\n\n if (!parent) {\n return;\n }\n }\n\n if (spot) {\n if (spot.top !== undefined) {\n offsetY += spot.top;\n }\n\n if (spot.left !== undefined) {\n offsetX += spot.left;\n parent.scrollLeft = offsetX;\n }\n }\n\n parent.scrollTop = offsetY;\n}\n\nfunction watchScroll(viewAreaElement, callback) {\n const debounceScroll = function (evt) {\n if (rAF) {\n return;\n }\n\n rAF = window.requestAnimationFrame(function viewAreaElementScrolled() {\n rAF = null;\n const currentX = viewAreaElement.scrollLeft;\n const lastX = state.lastX;\n\n if (currentX !== lastX) {\n state.right = currentX > lastX;\n }\n\n state.lastX = currentX;\n const currentY = viewAreaElement.scrollTop;\n const lastY = state.lastY;\n\n if (currentY !== lastY) {\n state.down = currentY > lastY;\n }\n\n state.lastY = currentY;\n callback(state);\n });\n };\n\n const state = {\n right: true,\n down: true,\n lastX: viewAreaElement.scrollLeft,\n lastY: viewAreaElement.scrollTop,\n _eventHandler: debounceScroll\n };\n let rAF = null;\n viewAreaElement.addEventListener(\"scroll\", debounceScroll, true);\n return state;\n}\n\nfunction parseQueryString(query) {\n const params = new Map();\n\n for (const [key, value] of new URLSearchParams(query)) {\n params.set(key.toLowerCase(), value);\n }\n\n return params;\n}\n\nconst NullCharactersRegExp = /\\x00/g;\nconst InvisibleCharactersRegExp = /[\\x01-\\x1F]/g;\n\nfunction removeNullCharacters(str, replaceInvisible = false) {\n if (typeof str !== \"string\") {\n console.error(`The argument must be a string.`);\n return str;\n }\n\n if (replaceInvisible) {\n str = str.replace(InvisibleCharactersRegExp, \" \");\n }\n\n return str.replace(NullCharactersRegExp, \"\");\n}\n\nfunction binarySearchFirstItem(items, condition, start = 0) {\n let minIndex = start;\n let maxIndex = items.length - 1;\n\n if (maxIndex < 0 || !condition(items[maxIndex])) {\n return items.length;\n }\n\n if (condition(items[minIndex])) {\n return minIndex;\n }\n\n while (minIndex < maxIndex) {\n const currentIndex = minIndex + maxIndex >> 1;\n const currentItem = items[currentIndex];\n\n if (condition(currentItem)) {\n maxIndex = currentIndex;\n } else {\n minIndex = currentIndex + 1;\n }\n }\n\n return minIndex;\n}\n\nfunction approximateFraction(x) {\n if (Math.floor(x) === x) {\n return [x, 1];\n }\n\n const xinv = 1 / x;\n const limit = 8;\n\n if (xinv > limit) {\n return [1, limit];\n } else if (Math.floor(xinv) === xinv) {\n return [1, xinv];\n }\n\n const x_ = x > 1 ? xinv : x;\n let a = 0,\n b = 1,\n c = 1,\n d = 1;\n\n while (true) {\n const p = a + c,\n q = b + d;\n\n if (q > limit) {\n break;\n }\n\n if (x_ <= p / q) {\n c = p;\n d = q;\n } else {\n a = p;\n b = q;\n }\n }\n\n let result;\n\n if (x_ - a / b < c / d - x_) {\n result = x_ === x ? [a, b] : [b, a];\n } else {\n result = x_ === x ? [c, d] : [d, c];\n }\n\n return result;\n}\n\nfunction roundToDivide(x, div) {\n const r = x % div;\n return r === 0 ? x : Math.round(x - r + div);\n}\n\nfunction getPageSizeInches({\n view,\n userUnit,\n rotate\n}) {\n const [x1, y1, x2, y2] = view;\n const changeOrientation = rotate % 180 !== 0;\n const width = (x2 - x1) / 72 * userUnit;\n const height = (y2 - y1) / 72 * userUnit;\n return {\n width: changeOrientation ? height : width,\n height: changeOrientation ? width : height\n };\n}\n\nfunction backtrackBeforeAllVisibleElements(index, views, top) {\n if (index < 2) {\n return index;\n }\n\n let elt = views[index].div;\n let pageTop = elt.offsetTop + elt.clientTop;\n\n if (pageTop >= top) {\n elt = views[index - 1].div;\n pageTop = elt.offsetTop + elt.clientTop;\n }\n\n for (let i = index - 2; i >= 0; --i) {\n elt = views[i].div;\n\n if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) {\n break;\n }\n\n index = i;\n }\n\n return index;\n}\n\nfunction getVisibleElements({\n scrollEl,\n views,\n sortByVisibility = false,\n horizontal = false,\n rtl = false\n}) {\n const top = scrollEl.scrollTop,\n bottom = top + scrollEl.clientHeight;\n const left = scrollEl.scrollLeft,\n right = left + scrollEl.clientWidth;\n\n function isElementBottomAfterViewTop(view) {\n const element = view.div;\n const elementBottom = element.offsetTop + element.clientTop + element.clientHeight;\n return elementBottom > top;\n }\n\n function isElementNextAfterViewHorizontally(view) {\n const element = view.div;\n const elementLeft = element.offsetLeft + element.clientLeft;\n const elementRight = elementLeft + element.clientWidth;\n return rtl ? elementLeft < right : elementRight > left;\n }\n\n const visible = [],\n ids = new Set(),\n numViews = views.length;\n let firstVisibleElementInd = binarySearchFirstItem(views, horizontal ? isElementNextAfterViewHorizontally : isElementBottomAfterViewTop);\n\n if (firstVisibleElementInd > 0 && firstVisibleElementInd < numViews && !horizontal) {\n firstVisibleElementInd = backtrackBeforeAllVisibleElements(firstVisibleElementInd, views, top);\n }\n\n let lastEdge = horizontal ? right : -1;\n\n for (let i = firstVisibleElementInd; i < numViews; i++) {\n const view = views[i],\n element = view.div;\n const currentWidth = element.offsetLeft + element.clientLeft;\n const currentHeight = element.offsetTop + element.clientTop;\n const viewWidth = element.clientWidth,\n viewHeight = element.clientHeight;\n const viewRight = currentWidth + viewWidth;\n const viewBottom = currentHeight + viewHeight;\n\n if (lastEdge === -1) {\n if (viewBottom >= bottom) {\n lastEdge = viewBottom;\n }\n } else if ((horizontal ? currentWidth : currentHeight) > lastEdge) {\n break;\n }\n\n if (viewBottom <= top || currentHeight >= bottom || viewRight <= left || currentWidth >= right) {\n continue;\n }\n\n const hiddenHeight = Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom);\n const hiddenWidth = Math.max(0, left - currentWidth) + Math.max(0, viewRight - right);\n const fractionHeight = (viewHeight - hiddenHeight) / viewHeight,\n fractionWidth = (viewWidth - hiddenWidth) / viewWidth;\n const percent = fractionHeight * fractionWidth * 100 | 0;\n visible.push({\n id: view.id,\n x: currentWidth,\n y: currentHeight,\n view,\n percent,\n widthPercent: fractionWidth * 100 | 0\n });\n ids.add(view.id);\n }\n\n const first = visible[0],\n last = visible.at(-1);\n\n if (sortByVisibility) {\n visible.sort(function (a, b) {\n const pc = a.percent - b.percent;\n\n if (Math.abs(pc) > 0.001) {\n return -pc;\n }\n\n return a.id - b.id;\n });\n }\n\n return {\n first,\n last,\n views: visible,\n ids\n };\n}\n\nfunction noContextMenuHandler(evt) {\n evt.preventDefault();\n}\n\nfunction normalizeWheelEventDirection(evt) {\n let delta = Math.hypot(evt.deltaX, evt.deltaY);\n const angle = Math.atan2(evt.deltaY, evt.deltaX);\n\n if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) {\n delta = -delta;\n }\n\n return delta;\n}\n\nfunction normalizeWheelEventDelta(evt) {\n let delta = normalizeWheelEventDirection(evt);\n const MOUSE_DOM_DELTA_PIXEL_MODE = 0;\n const MOUSE_DOM_DELTA_LINE_MODE = 1;\n const MOUSE_PIXELS_PER_LINE = 30;\n const MOUSE_LINES_PER_PAGE = 30;\n\n if (evt.deltaMode === MOUSE_DOM_DELTA_PIXEL_MODE) {\n delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE;\n } else if (evt.deltaMode === MOUSE_DOM_DELTA_LINE_MODE) {\n delta /= MOUSE_LINES_PER_PAGE;\n }\n\n return delta;\n}\n\nfunction isValidRotation(angle) {\n return Number.isInteger(angle) && angle % 90 === 0;\n}\n\nfunction isValidScrollMode(mode) {\n return Number.isInteger(mode) && Object.values(ScrollMode).includes(mode) && mode !== ScrollMode.UNKNOWN;\n}\n\nfunction isValidSpreadMode(mode) {\n return Number.isInteger(mode) && Object.values(SpreadMode).includes(mode) && mode !== SpreadMode.UNKNOWN;\n}\n\nfunction isPortraitOrientation(size) {\n return size.width <= size.height;\n}\n\nconst animationStarted = new Promise(function (resolve) {\n window.requestAnimationFrame(resolve);\n});\nexports.animationStarted = animationStarted;\nconst docStyle = document.documentElement.style;\nexports.docStyle = docStyle;\n\nfunction clamp(v, min, max) {\n return Math.min(Math.max(v, min), max);\n}\n\nclass ProgressBar {\n #classList = null;\n #percent = 0;\n #visible = true;\n\n constructor(id) {\n if (arguments.length > 1) {\n throw new Error(\"ProgressBar no longer accepts any additional options, \" + \"please use CSS rules to modify its appearance instead.\");\n }\n\n const bar = document.getElementById(id);\n this.#classList = bar.classList;\n }\n\n get percent() {\n return this.#percent;\n }\n\n set percent(val) {\n this.#percent = clamp(val, 0, 100);\n\n if (isNaN(val)) {\n this.#classList.add(\"indeterminate\");\n return;\n }\n\n this.#classList.remove(\"indeterminate\");\n docStyle.setProperty(\"--progressBar-percent\", `${this.#percent}%`);\n }\n\n setWidth(viewer) {\n if (!viewer) {\n return;\n }\n\n const container = viewer.parentNode;\n const scrollbarWidth = container.offsetWidth - viewer.offsetWidth;\n\n if (scrollbarWidth > 0) {\n docStyle.setProperty(\"--progressBar-end-offset\", `${scrollbarWidth}px`);\n }\n }\n\n hide() {\n if (!this.#visible) {\n return;\n }\n\n this.#visible = false;\n this.#classList.add(\"hidden\");\n }\n\n show() {\n if (this.#visible) {\n return;\n }\n\n this.#visible = true;\n this.#classList.remove(\"hidden\");\n }\n\n}\n\nexports.ProgressBar = ProgressBar;\n\nfunction getActiveOrFocusedElement() {\n let curRoot = document;\n let curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(\":focus\");\n\n while (curActiveOrFocused?.shadowRoot) {\n curRoot = curActiveOrFocused.shadowRoot;\n curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(\":focus\");\n }\n\n return curActiveOrFocused;\n}\n\nfunction apiPageLayoutToViewerModes(layout) {\n let scrollMode = ScrollMode.VERTICAL,\n spreadMode = SpreadMode.NONE;\n\n switch (layout) {\n case \"SinglePage\":\n scrollMode = ScrollMode.PAGE;\n break;\n\n case \"OneColumn\":\n break;\n\n case \"TwoPageLeft\":\n scrollMode = ScrollMode.PAGE;\n\n case \"TwoColumnLeft\":\n spreadMode = SpreadMode.ODD;\n break;\n\n case \"TwoPageRight\":\n scrollMode = ScrollMode.PAGE;\n\n case \"TwoColumnRight\":\n spreadMode = SpreadMode.EVEN;\n break;\n }\n\n return {\n scrollMode,\n spreadMode\n };\n}\n\nfunction apiPageModeToSidebarView(mode) {\n switch (mode) {\n case \"UseNone\":\n return SidebarView.NONE;\n\n case \"UseThumbs\":\n return SidebarView.THUMBS;\n\n case \"UseOutlines\":\n return SidebarView.OUTLINE;\n\n case \"UseAttachments\":\n return SidebarView.ATTACHMENTS;\n\n case \"UseOC\":\n return SidebarView.LAYERS;\n }\n\n return SidebarView.NONE;\n}\n\n/***/ }),\n/* 8 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.StructTreeLayerBuilder = void 0;\nconst PDF_ROLE_TO_HTML_ROLE = {\n Document: null,\n DocumentFragment: null,\n Part: \"group\",\n Sect: \"group\",\n Div: \"group\",\n Aside: \"note\",\n NonStruct: \"none\",\n P: null,\n H: \"heading\",\n Title: null,\n FENote: \"note\",\n Sub: \"group\",\n Lbl: null,\n Span: null,\n Em: null,\n Strong: null,\n Link: \"link\",\n Annot: \"note\",\n Form: \"form\",\n Ruby: null,\n RB: null,\n RT: null,\n RP: null,\n Warichu: null,\n WT: null,\n WP: null,\n L: \"list\",\n LI: \"listitem\",\n LBody: null,\n Table: \"table\",\n TR: \"row\",\n TH: \"columnheader\",\n TD: \"cell\",\n THead: \"columnheader\",\n TBody: null,\n TFoot: null,\n Caption: null,\n Figure: \"figure\",\n Formula: null,\n Artifact: null\n};\nconst HEADING_PATTERN = /^H(\\d+)$/;\n\nclass StructTreeLayerBuilder {\n constructor({\n pdfPage\n }) {\n this.pdfPage = pdfPage;\n }\n\n render(structTree) {\n return this._walk(structTree);\n }\n\n _setAttributes(structElement, htmlElement) {\n if (structElement.alt !== undefined) {\n htmlElement.setAttribute(\"aria-label\", structElement.alt);\n }\n\n if (structElement.id !== undefined) {\n htmlElement.setAttribute(\"aria-owns\", structElement.id);\n }\n\n if (structElement.lang !== undefined) {\n htmlElement.setAttribute(\"lang\", structElement.lang);\n }\n }\n\n _walk(node) {\n if (!node) {\n return null;\n }\n\n const element = document.createElement(\"span\");\n\n if (\"role\" in node) {\n const {\n role\n } = node;\n const match = role.match(HEADING_PATTERN);\n\n if (match) {\n element.setAttribute(\"role\", \"heading\");\n element.setAttribute(\"aria-level\", match[1]);\n } else if (PDF_ROLE_TO_HTML_ROLE[role]) {\n element.setAttribute(\"role\", PDF_ROLE_TO_HTML_ROLE[role]);\n }\n }\n\n this._setAttributes(node, element);\n\n if (node.children) {\n if (node.children.length === 1 && \"id\" in node.children[0]) {\n this._setAttributes(node.children[0], element);\n } else {\n for (const kid of node.children) {\n element.append(this._walk(kid));\n }\n }\n }\n\n return element;\n }\n\n}\n\nexports.StructTreeLayerBuilder = StructTreeLayerBuilder;\n\n/***/ }),\n/* 9 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.TextLayerBuilder = void 0;\n\nvar _pdfjsLib = __w_pdfjs_require__(3);\n\nconst EXPAND_DIVS_TIMEOUT = 300;\n\nclass TextLayerBuilder {\n constructor({\n textLayerDiv,\n eventBus,\n pageIndex,\n viewport,\n highlighter = null,\n enhanceTextSelection = false,\n accessibilityManager = null\n }) {\n this.textLayerDiv = textLayerDiv;\n this.eventBus = eventBus;\n this.textContent = null;\n this.textContentItemsStr = [];\n this.textContentStream = null;\n this.renderingDone = false;\n this.pageNumber = pageIndex + 1;\n this.viewport = viewport;\n this.textDivs = [];\n this.textLayerRenderTask = null;\n this.highlighter = highlighter;\n this.enhanceTextSelection = enhanceTextSelection;\n this.accessibilityManager = accessibilityManager;\n\n this._bindMouse();\n }\n\n _finishRendering() {\n this.renderingDone = true;\n\n if (!this.enhanceTextSelection) {\n const endOfContent = document.createElement(\"div\");\n endOfContent.className = \"endOfContent\";\n this.textLayerDiv.append(endOfContent);\n }\n\n this.eventBus.dispatch(\"textlayerrendered\", {\n source: this,\n pageNumber: this.pageNumber,\n numTextDivs: this.textDivs.length\n });\n }\n\n render(timeout = 0) {\n if (!(this.textContent || this.textContentStream) || this.renderingDone) {\n return;\n }\n\n this.cancel();\n this.textDivs.length = 0;\n this.highlighter?.setTextMapping(this.textDivs, this.textContentItemsStr);\n this.accessibilityManager?.setTextMapping(this.textDivs);\n const textLayerFrag = document.createDocumentFragment();\n this.textLayerRenderTask = (0, _pdfjsLib.renderTextLayer)({\n textContent: this.textContent,\n textContentStream: this.textContentStream,\n container: textLayerFrag,\n viewport: this.viewport,\n textDivs: this.textDivs,\n textContentItemsStr: this.textContentItemsStr,\n timeout,\n enhanceTextSelection: this.enhanceTextSelection\n });\n this.textLayerRenderTask.promise.then(() => {\n this.textLayerDiv.append(textLayerFrag);\n\n this._finishRendering();\n\n this.highlighter?.enable();\n this.accessibilityManager?.enable();\n }, function (reason) {});\n }\n\n cancel() {\n if (this.textLayerRenderTask) {\n this.textLayerRenderTask.cancel();\n this.textLayerRenderTask = null;\n }\n\n this.highlighter?.disable();\n this.accessibilityManager?.disable();\n }\n\n setTextContentStream(readableStream) {\n this.cancel();\n this.textContentStream = readableStream;\n }\n\n setTextContent(textContent) {\n this.cancel();\n this.textContent = textContent;\n }\n\n _bindMouse() {\n const div = this.textLayerDiv;\n let expandDivsTimer = null;\n div.addEventListener(\"mousedown\", evt => {\n if (this.enhanceTextSelection && this.textLayerRenderTask) {\n this.textLayerRenderTask.expandTextDivs(true);\n\n if (expandDivsTimer) {\n clearTimeout(expandDivsTimer);\n expandDivsTimer = null;\n }\n\n return;\n }\n\n const end = div.querySelector(\".endOfContent\");\n\n if (!end) {\n return;\n }\n\n let adjustTop = evt.target !== div;\n adjustTop = adjustTop && window.getComputedStyle(end).getPropertyValue(\"-moz-user-select\") !== \"none\";\n\n if (adjustTop) {\n const divBounds = div.getBoundingClientRect();\n const r = Math.max(0, (evt.pageY - divBounds.top) / divBounds.height);\n end.style.top = (r * 100).toFixed(2) + \"%\";\n }\n\n end.classList.add(\"active\");\n });\n div.addEventListener(\"mouseup\", () => {\n if (this.enhanceTextSelection && this.textLayerRenderTask) {\n expandDivsTimer = setTimeout(() => {\n if (this.textLayerRenderTask) {\n this.textLayerRenderTask.expandTextDivs(false);\n }\n\n expandDivsTimer = null;\n }, EXPAND_DIVS_TIMEOUT);\n return;\n }\n\n const end = div.querySelector(\".endOfContent\");\n\n if (!end) {\n return;\n }\n\n end.style.top = \"\";\n end.classList.remove(\"active\");\n });\n }\n\n}\n\nexports.TextLayerBuilder = TextLayerBuilder;\n\n/***/ }),\n/* 10 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.XfaLayerBuilder = void 0;\n\nvar _pdfjsLib = __w_pdfjs_require__(3);\n\nclass XfaLayerBuilder {\n constructor({\n pageDiv,\n pdfPage,\n annotationStorage = null,\n linkService,\n xfaHtml = null\n }) {\n this.pageDiv = pageDiv;\n this.pdfPage = pdfPage;\n this.annotationStorage = annotationStorage;\n this.linkService = linkService;\n this.xfaHtml = xfaHtml;\n this.div = null;\n this._cancelled = false;\n }\n\n render(viewport, intent = \"display\") {\n if (intent === \"print\") {\n const parameters = {\n viewport: viewport.clone({\n dontFlip: true\n }),\n div: this.div,\n xfaHtml: this.xfaHtml,\n annotationStorage: this.annotationStorage,\n linkService: this.linkService,\n intent\n };\n const div = document.createElement(\"div\");\n this.pageDiv.append(div);\n parameters.div = div;\n\n const result = _pdfjsLib.XfaLayer.render(parameters);\n\n return Promise.resolve(result);\n }\n\n return this.pdfPage.getXfa().then(xfaHtml => {\n if (this._cancelled || !xfaHtml) {\n return {\n textDivs: []\n };\n }\n\n const parameters = {\n viewport: viewport.clone({\n dontFlip: true\n }),\n div: this.div,\n xfaHtml,\n annotationStorage: this.annotationStorage,\n linkService: this.linkService,\n intent\n };\n\n if (this.div) {\n return _pdfjsLib.XfaLayer.update(parameters);\n }\n\n this.div = document.createElement(\"div\");\n this.pageDiv.append(this.div);\n parameters.div = this.div;\n return _pdfjsLib.XfaLayer.render(parameters);\n }).catch(error => {\n console.error(error);\n });\n }\n\n cancel() {\n this._cancelled = true;\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n\n this.div.hidden = true;\n }\n\n}\n\nexports.XfaLayerBuilder = XfaLayerBuilder;\n\n/***/ }),\n/* 11 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFViewer = exports.PDFSinglePageViewer = void 0;\n\nvar _ui_utils = __w_pdfjs_require__(7);\n\nvar _base_viewer = __w_pdfjs_require__(12);\n\nclass PDFViewer extends _base_viewer.BaseViewer {}\n\nexports.PDFViewer = PDFViewer;\n\nclass PDFSinglePageViewer extends _base_viewer.BaseViewer {\n _resetView() {\n super._resetView();\n\n this._scrollMode = _ui_utils.ScrollMode.PAGE;\n this._spreadMode = _ui_utils.SpreadMode.NONE;\n }\n\n set scrollMode(mode) {}\n\n _updateScrollMode() {}\n\n set spreadMode(mode) {}\n\n _updateSpreadMode() {}\n\n}\n\nexports.PDFSinglePageViewer = PDFSinglePageViewer;\n\n/***/ }),\n/* 12 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PagesCountLimit = exports.PDFPageViewBuffer = exports.BaseViewer = void 0;\n\nvar _pdfjsLib = __w_pdfjs_require__(3);\n\nvar _ui_utils = __w_pdfjs_require__(7);\n\nvar _annotation_editor_layer_builder = __w_pdfjs_require__(2);\n\nvar _annotation_layer_builder = __w_pdfjs_require__(5);\n\nvar _l10n_utils = __w_pdfjs_require__(4);\n\nvar _pdf_page_view = __w_pdfjs_require__(13);\n\nvar _pdf_rendering_queue = __w_pdfjs_require__(16);\n\nvar _pdf_link_service = __w_pdfjs_require__(6);\n\nvar _struct_tree_layer_builder = __w_pdfjs_require__(8);\n\nvar _text_highlighter = __w_pdfjs_require__(17);\n\nvar _text_layer_builder = __w_pdfjs_require__(9);\n\nvar _xfa_layer_builder = __w_pdfjs_require__(10);\n\nconst DEFAULT_CACHE_SIZE = 10;\nconst ENABLE_PERMISSIONS_CLASS = \"enablePermissions\";\nconst PagesCountLimit = {\n FORCE_SCROLL_MODE_PAGE: 15000,\n FORCE_LAZY_PAGE_INIT: 7500,\n PAUSE_EAGER_PAGE_INIT: 250\n};\nexports.PagesCountLimit = PagesCountLimit;\n\nfunction isValidAnnotationEditorMode(mode) {\n return Object.values(_pdfjsLib.AnnotationEditorType).includes(mode) && mode !== _pdfjsLib.AnnotationEditorType.DISABLE;\n}\n\nclass PDFPageViewBuffer {\n #buf = new Set();\n #size = 0;\n\n constructor(size) {\n this.#size = size;\n }\n\n push(view) {\n const buf = this.#buf;\n\n if (buf.has(view)) {\n buf.delete(view);\n }\n\n buf.add(view);\n\n if (buf.size > this.#size) {\n this.#destroyFirstView();\n }\n }\n\n resize(newSize, idsToKeep = null) {\n this.#size = newSize;\n const buf = this.#buf;\n\n if (idsToKeep) {\n const ii = buf.size;\n let i = 1;\n\n for (const view of buf) {\n if (idsToKeep.has(view.id)) {\n buf.delete(view);\n buf.add(view);\n }\n\n if (++i > ii) {\n break;\n }\n }\n }\n\n while (buf.size > this.#size) {\n this.#destroyFirstView();\n }\n }\n\n has(view) {\n return this.#buf.has(view);\n }\n\n [Symbol.iterator]() {\n return this.#buf.keys();\n }\n\n #destroyFirstView() {\n const firstView = this.#buf.keys().next().value;\n firstView?.destroy();\n this.#buf.delete(firstView);\n }\n\n}\n\nexports.PDFPageViewBuffer = PDFPageViewBuffer;\n\nclass BaseViewer {\n #buffer = null;\n #annotationEditorMode = _pdfjsLib.AnnotationEditorType.DISABLE;\n #annotationEditorUIManager = null;\n #annotationMode = _pdfjsLib.AnnotationMode.ENABLE_FORMS;\n #enablePermissions = false;\n #previousContainerHeight = 0;\n #scrollModePageState = null;\n #onVisibilityChange = null;\n\n constructor(options) {\n if (this.constructor === BaseViewer) {\n throw new Error(\"Cannot initialize BaseViewer.\");\n }\n\n const viewerVersion = '2.16.105';\n\n if (_pdfjsLib.version !== viewerVersion) {\n throw new Error(`The API version \"${_pdfjsLib.version}\" does not match the Viewer version \"${viewerVersion}\".`);\n }\n\n this.container = options.container;\n this.viewer = options.viewer || options.container.firstElementChild;\n\n if (!(this.container?.tagName.toUpperCase() === \"DIV\" && this.viewer?.tagName.toUpperCase() === \"DIV\")) {\n throw new Error(\"Invalid `container` and/or `viewer` option.\");\n }\n\n if (this.container.offsetParent && getComputedStyle(this.container).position !== \"absolute\") {\n throw new Error(\"The `container` must be absolutely positioned.\");\n }\n\n this.eventBus = options.eventBus;\n this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService();\n this.downloadManager = options.downloadManager || null;\n this.findController = options.findController || null;\n this._scriptingManager = options.scriptingManager || null;\n this.removePageBorders = options.removePageBorders || false;\n this.textLayerMode = options.textLayerMode ?? _ui_utils.TextLayerMode.ENABLE;\n this.#annotationMode = options.annotationMode ?? _pdfjsLib.AnnotationMode.ENABLE_FORMS;\n this.#annotationEditorMode = options.annotationEditorMode ?? _pdfjsLib.AnnotationEditorType.DISABLE;\n this.imageResourcesPath = options.imageResourcesPath || \"\";\n this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;\n this.renderer = options.renderer || _ui_utils.RendererType.CANVAS;\n this.useOnlyCssZoom = options.useOnlyCssZoom || false;\n this.maxCanvasPixels = options.maxCanvasPixels;\n this.l10n = options.l10n || _l10n_utils.NullL10n;\n this.#enablePermissions = options.enablePermissions || false;\n this.pageColors = options.pageColors || null;\n\n if (this.pageColors && !(CSS.supports(\"color\", this.pageColors.background) && CSS.supports(\"color\", this.pageColors.foreground))) {\n if (this.pageColors.background || this.pageColors.foreground) {\n console.warn(\"BaseViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used.\");\n }\n\n this.pageColors = null;\n }\n\n this.defaultRenderingQueue = !options.renderingQueue;\n\n if (this.defaultRenderingQueue) {\n this.renderingQueue = new _pdf_rendering_queue.PDFRenderingQueue();\n this.renderingQueue.setViewer(this);\n } else {\n this.renderingQueue = options.renderingQueue;\n }\n\n this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdate.bind(this));\n this.presentationModeState = _ui_utils.PresentationModeState.UNKNOWN;\n this._onBeforeDraw = this._onAfterDraw = null;\n\n this._resetView();\n\n if (this.removePageBorders) {\n this.viewer.classList.add(\"removePageBorders\");\n }\n\n this.updateContainerHeightCss();\n }\n\n get pagesCount() {\n return this._pages.length;\n }\n\n getPageView(index) {\n return this._pages[index];\n }\n\n get pageViewsReady() {\n if (!this._pagesCapability.settled) {\n return false;\n }\n\n return this._pages.every(function (pageView) {\n return pageView?.pdfPage;\n });\n }\n\n get renderForms() {\n return this.#annotationMode === _pdfjsLib.AnnotationMode.ENABLE_FORMS;\n }\n\n get enableScripting() {\n return !!this._scriptingManager;\n }\n\n get currentPageNumber() {\n return this._currentPageNumber;\n }\n\n set currentPageNumber(val) {\n if (!Number.isInteger(val)) {\n throw new Error(\"Invalid page number.\");\n }\n\n if (!this.pdfDocument) {\n return;\n }\n\n if (!this._setCurrentPageNumber(val, true)) {\n console.error(`currentPageNumber: \"${val}\" is not a valid page.`);\n }\n }\n\n _setCurrentPageNumber(val, resetCurrentPageView = false) {\n if (this._currentPageNumber === val) {\n if (resetCurrentPageView) {\n this.#resetCurrentPageView();\n }\n\n return true;\n }\n\n if (!(0 < val && val <= this.pagesCount)) {\n return false;\n }\n\n const previous = this._currentPageNumber;\n this._currentPageNumber = val;\n this.eventBus.dispatch(\"pagechanging\", {\n source: this,\n pageNumber: val,\n pageLabel: this._pageLabels?.[val - 1] ?? null,\n previous\n });\n\n if (resetCurrentPageView) {\n this.#resetCurrentPageView();\n }\n\n return true;\n }\n\n get currentPageLabel() {\n return this._pageLabels?.[this._currentPageNumber - 1] ?? null;\n }\n\n set currentPageLabel(val) {\n if (!this.pdfDocument) {\n return;\n }\n\n let page = val | 0;\n\n if (this._pageLabels) {\n const i = this._pageLabels.indexOf(val);\n\n if (i >= 0) {\n page = i + 1;\n }\n }\n\n if (!this._setCurrentPageNumber(page, true)) {\n console.error(`currentPageLabel: \"${val}\" is not a valid page.`);\n }\n }\n\n get currentScale() {\n return this._currentScale !== _ui_utils.UNKNOWN_SCALE ? this._currentScale : _ui_utils.DEFAULT_SCALE;\n }\n\n set currentScale(val) {\n if (isNaN(val)) {\n throw new Error(\"Invalid numeric scale.\");\n }\n\n if (!this.pdfDocument) {\n return;\n }\n\n this._setScale(val, false);\n }\n\n get currentScaleValue() {\n return this._currentScaleValue;\n }\n\n set currentScaleValue(val) {\n if (!this.pdfDocument) {\n return;\n }\n\n this._setScale(val, false);\n }\n\n get pagesRotation() {\n return this._pagesRotation;\n }\n\n set pagesRotation(rotation) {\n if (!(0, _ui_utils.isValidRotation)(rotation)) {\n throw new Error(\"Invalid pages rotation angle.\");\n }\n\n if (!this.pdfDocument) {\n return;\n }\n\n rotation %= 360;\n\n if (rotation < 0) {\n rotation += 360;\n }\n\n if (this._pagesRotation === rotation) {\n return;\n }\n\n this._pagesRotation = rotation;\n const pageNumber = this._currentPageNumber;\n const updateArgs = {\n rotation\n };\n\n for (const pageView of this._pages) {\n pageView.update(updateArgs);\n }\n\n if (this._currentScaleValue) {\n this._setScale(this._currentScaleValue, true);\n }\n\n this.eventBus.dispatch(\"rotationchanging\", {\n source: this,\n pagesRotation: rotation,\n pageNumber\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n }\n\n get firstPagePromise() {\n return this.pdfDocument ? this._firstPageCapability.promise : null;\n }\n\n get onePageRendered() {\n return this.pdfDocument ? this._onePageRenderedCapability.promise : null;\n }\n\n get pagesPromise() {\n return this.pdfDocument ? this._pagesCapability.promise : null;\n }\n\n #initializePermissions(permissions) {\n const params = {\n annotationEditorMode: this.#annotationEditorMode,\n annotationMode: this.#annotationMode,\n textLayerMode: this.textLayerMode\n };\n\n if (!permissions) {\n return params;\n }\n\n if (!permissions.includes(_pdfjsLib.PermissionFlag.COPY)) {\n this.viewer.classList.add(ENABLE_PERMISSIONS_CLASS);\n }\n\n if (!permissions.includes(_pdfjsLib.PermissionFlag.MODIFY_CONTENTS)) {\n params.annotationEditorMode = _pdfjsLib.AnnotationEditorType.DISABLE;\n }\n\n if (!permissions.includes(_pdfjsLib.PermissionFlag.MODIFY_ANNOTATIONS) && !permissions.includes(_pdfjsLib.PermissionFlag.FILL_INTERACTIVE_FORMS) && this.#annotationMode === _pdfjsLib.AnnotationMode.ENABLE_FORMS) {\n params.annotationMode = _pdfjsLib.AnnotationMode.ENABLE;\n }\n\n return params;\n }\n\n #onePageRenderedOrForceFetch() {\n if (document.visibilityState === \"hidden\" || !this.container.offsetParent || this._getVisiblePages().views.length === 0) {\n return Promise.resolve();\n }\n\n const visibilityChangePromise = new Promise(resolve => {\n this.#onVisibilityChange = () => {\n if (document.visibilityState !== \"hidden\") {\n return;\n }\n\n resolve();\n document.removeEventListener(\"visibilitychange\", this.#onVisibilityChange);\n this.#onVisibilityChange = null;\n };\n\n document.addEventListener(\"visibilitychange\", this.#onVisibilityChange);\n });\n return Promise.race([this._onePageRenderedCapability.promise, visibilityChangePromise]);\n }\n\n setDocument(pdfDocument) {\n if (this.pdfDocument) {\n this.eventBus.dispatch(\"pagesdestroy\", {\n source: this\n });\n\n this._cancelRendering();\n\n this._resetView();\n\n if (this.findController) {\n this.findController.setDocument(null);\n }\n\n if (this._scriptingManager) {\n this._scriptingManager.setDocument(null);\n }\n\n if (this.#annotationEditorUIManager) {\n this.#annotationEditorUIManager.destroy();\n this.#annotationEditorUIManager = null;\n }\n }\n\n this.pdfDocument = pdfDocument;\n\n if (!pdfDocument) {\n return;\n }\n\n const isPureXfa = pdfDocument.isPureXfa;\n const pagesCount = pdfDocument.numPages;\n const firstPagePromise = pdfDocument.getPage(1);\n const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();\n const permissionsPromise = this.#enablePermissions ? pdfDocument.getPermissions() : Promise.resolve();\n\n if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {\n console.warn(\"Forcing PAGE-scrolling for performance reasons, given the length of the document.\");\n const mode = this._scrollMode = _ui_utils.ScrollMode.PAGE;\n this.eventBus.dispatch(\"scrollmodechanged\", {\n source: this,\n mode\n });\n }\n\n this._pagesCapability.promise.then(() => {\n this.eventBus.dispatch(\"pagesloaded\", {\n source: this,\n pagesCount\n });\n }, () => {});\n\n this._onBeforeDraw = evt => {\n const pageView = this._pages[evt.pageNumber - 1];\n\n if (!pageView) {\n return;\n }\n\n this.#buffer.push(pageView);\n };\n\n this.eventBus._on(\"pagerender\", this._onBeforeDraw);\n\n this._onAfterDraw = evt => {\n if (evt.cssTransform || this._onePageRenderedCapability.settled) {\n return;\n }\n\n this._onePageRenderedCapability.resolve({\n timestamp: evt.timestamp\n });\n\n this.eventBus._off(\"pagerendered\", this._onAfterDraw);\n\n this._onAfterDraw = null;\n\n if (this.#onVisibilityChange) {\n document.removeEventListener(\"visibilitychange\", this.#onVisibilityChange);\n this.#onVisibilityChange = null;\n }\n };\n\n this.eventBus._on(\"pagerendered\", this._onAfterDraw);\n\n Promise.all([firstPagePromise, permissionsPromise]).then(([firstPdfPage, permissions]) => {\n if (pdfDocument !== this.pdfDocument) {\n return;\n }\n\n this._firstPageCapability.resolve(firstPdfPage);\n\n this._optionalContentConfigPromise = optionalContentConfigPromise;\n const {\n annotationEditorMode,\n annotationMode,\n textLayerMode\n } = this.#initializePermissions(permissions);\n\n if (annotationEditorMode !== _pdfjsLib.AnnotationEditorType.DISABLE) {\n const mode = annotationEditorMode;\n\n if (isPureXfa) {\n console.warn(\"Warning: XFA-editing is not implemented.\");\n } else if (isValidAnnotationEditorMode(mode)) {\n this.#annotationEditorUIManager = new _pdfjsLib.AnnotationEditorUIManager(this.container, this.eventBus);\n\n if (mode !== _pdfjsLib.AnnotationEditorType.NONE) {\n this.#annotationEditorUIManager.updateMode(mode);\n }\n } else {\n console.error(`Invalid AnnotationEditor mode: ${mode}`);\n }\n }\n\n const viewerElement = this._scrollMode === _ui_utils.ScrollMode.PAGE ? null : this.viewer;\n const scale = this.currentScale;\n const viewport = firstPdfPage.getViewport({\n scale: scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS\n });\n const textLayerFactory = textLayerMode !== _ui_utils.TextLayerMode.DISABLE && !isPureXfa ? this : null;\n const annotationLayerFactory = annotationMode !== _pdfjsLib.AnnotationMode.DISABLE ? this : null;\n const xfaLayerFactory = isPureXfa ? this : null;\n const annotationEditorLayerFactory = this.#annotationEditorUIManager ? this : null;\n\n for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {\n const pageView = new _pdf_page_view.PDFPageView({\n container: viewerElement,\n eventBus: this.eventBus,\n id: pageNum,\n scale,\n defaultViewport: viewport.clone(),\n optionalContentConfigPromise,\n renderingQueue: this.renderingQueue,\n textLayerFactory,\n textLayerMode,\n annotationLayerFactory,\n annotationMode,\n xfaLayerFactory,\n annotationEditorLayerFactory,\n textHighlighterFactory: this,\n structTreeLayerFactory: this,\n imageResourcesPath: this.imageResourcesPath,\n renderer: this.renderer,\n useOnlyCssZoom: this.useOnlyCssZoom,\n maxCanvasPixels: this.maxCanvasPixels,\n pageColors: this.pageColors,\n l10n: this.l10n\n });\n\n this._pages.push(pageView);\n }\n\n const firstPageView = this._pages[0];\n\n if (firstPageView) {\n firstPageView.setPdfPage(firstPdfPage);\n this.linkService.cachePageRef(1, firstPdfPage.ref);\n }\n\n if (this._scrollMode === _ui_utils.ScrollMode.PAGE) {\n this.#ensurePageViewVisible();\n } else if (this._spreadMode !== _ui_utils.SpreadMode.NONE) {\n this._updateSpreadMode();\n }\n\n this.#onePageRenderedOrForceFetch().then(async () => {\n if (this.findController) {\n this.findController.setDocument(pdfDocument);\n }\n\n if (this._scriptingManager) {\n this._scriptingManager.setDocument(pdfDocument);\n }\n\n if (this.#annotationEditorUIManager) {\n this.eventBus.dispatch(\"annotationeditormodechanged\", {\n source: this,\n mode: this.#annotationEditorMode\n });\n }\n\n if (pdfDocument.loadingParams.disableAutoFetch || pagesCount > PagesCountLimit.FORCE_LAZY_PAGE_INIT) {\n this._pagesCapability.resolve();\n\n return;\n }\n\n let getPagesLeft = pagesCount - 1;\n\n if (getPagesLeft <= 0) {\n this._pagesCapability.resolve();\n\n return;\n }\n\n for (let pageNum = 2; pageNum <= pagesCount; ++pageNum) {\n const promise = pdfDocument.getPage(pageNum).then(pdfPage => {\n const pageView = this._pages[pageNum - 1];\n\n if (!pageView.pdfPage) {\n pageView.setPdfPage(pdfPage);\n }\n\n this.linkService.cachePageRef(pageNum, pdfPage.ref);\n\n if (--getPagesLeft === 0) {\n this._pagesCapability.resolve();\n }\n }, reason => {\n console.error(`Unable to get page ${pageNum} to initialize viewer`, reason);\n\n if (--getPagesLeft === 0) {\n this._pagesCapability.resolve();\n }\n });\n\n if (pageNum % PagesCountLimit.PAUSE_EAGER_PAGE_INIT === 0) {\n await promise;\n }\n }\n });\n this.eventBus.dispatch(\"pagesinit\", {\n source: this\n });\n pdfDocument.getMetadata().then(({\n info\n }) => {\n if (pdfDocument !== this.pdfDocument) {\n return;\n }\n\n if (info.Language) {\n this.viewer.lang = info.Language;\n }\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n }).catch(reason => {\n console.error(\"Unable to initialize viewer\", reason);\n\n this._pagesCapability.reject(reason);\n });\n }\n\n setPageLabels(labels) {\n if (!this.pdfDocument) {\n return;\n }\n\n if (!labels) {\n this._pageLabels = null;\n } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) {\n this._pageLabels = null;\n console.error(`setPageLabels: Invalid page labels.`);\n } else {\n this._pageLabels = labels;\n }\n\n for (let i = 0, ii = this._pages.length; i < ii; i++) {\n this._pages[i].setPageLabel(this._pageLabels?.[i] ?? null);\n }\n }\n\n _resetView() {\n this._pages = [];\n this._currentPageNumber = 1;\n this._currentScale = _ui_utils.UNKNOWN_SCALE;\n this._currentScaleValue = null;\n this._pageLabels = null;\n this.#buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);\n this._location = null;\n this._pagesRotation = 0;\n this._optionalContentConfigPromise = null;\n this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)();\n this._onePageRenderedCapability = (0, _pdfjsLib.createPromiseCapability)();\n this._pagesCapability = (0, _pdfjsLib.createPromiseCapability)();\n this._scrollMode = _ui_utils.ScrollMode.VERTICAL;\n this._previousScrollMode = _ui_utils.ScrollMode.UNKNOWN;\n this._spreadMode = _ui_utils.SpreadMode.NONE;\n this.#scrollModePageState = {\n previousPageNumber: 1,\n scrollDown: true,\n pages: []\n };\n\n if (this._onBeforeDraw) {\n this.eventBus._off(\"pagerender\", this._onBeforeDraw);\n\n this._onBeforeDraw = null;\n }\n\n if (this._onAfterDraw) {\n this.eventBus._off(\"pagerendered\", this._onAfterDraw);\n\n this._onAfterDraw = null;\n }\n\n if (this.#onVisibilityChange) {\n document.removeEventListener(\"visibilitychange\", this.#onVisibilityChange);\n this.#onVisibilityChange = null;\n }\n\n this.viewer.textContent = \"\";\n\n this._updateScrollMode();\n\n this.viewer.removeAttribute(\"lang\");\n this.viewer.classList.remove(ENABLE_PERMISSIONS_CLASS);\n }\n\n #ensurePageViewVisible() {\n if (this._scrollMode !== _ui_utils.ScrollMode.PAGE) {\n throw new Error(\"#ensurePageViewVisible: Invalid scrollMode value.\");\n }\n\n const pageNumber = this._currentPageNumber,\n state = this.#scrollModePageState,\n viewer = this.viewer;\n viewer.textContent = \"\";\n state.pages.length = 0;\n\n if (this._spreadMode === _ui_utils.SpreadMode.NONE && !this.isInPresentationMode) {\n const pageView = this._pages[pageNumber - 1];\n viewer.append(pageView.div);\n state.pages.push(pageView);\n } else {\n const pageIndexSet = new Set(),\n parity = this._spreadMode - 1;\n\n if (parity === -1) {\n pageIndexSet.add(pageNumber - 1);\n } else if (pageNumber % 2 !== parity) {\n pageIndexSet.add(pageNumber - 1);\n pageIndexSet.add(pageNumber);\n } else {\n pageIndexSet.add(pageNumber - 2);\n pageIndexSet.add(pageNumber - 1);\n }\n\n const spread = document.createElement(\"div\");\n spread.className = \"spread\";\n\n if (this.isInPresentationMode) {\n const dummyPage = document.createElement(\"div\");\n dummyPage.className = \"dummyPage\";\n spread.append(dummyPage);\n }\n\n for (const i of pageIndexSet) {\n const pageView = this._pages[i];\n\n if (!pageView) {\n continue;\n }\n\n spread.append(pageView.div);\n state.pages.push(pageView);\n }\n\n viewer.append(spread);\n }\n\n state.scrollDown = pageNumber >= state.previousPageNumber;\n state.previousPageNumber = pageNumber;\n }\n\n _scrollUpdate() {\n if (this.pagesCount === 0) {\n return;\n }\n\n this.update();\n }\n\n #scrollIntoView(pageView, pageSpot = null) {\n const {\n div,\n id\n } = pageView;\n\n if (this._scrollMode === _ui_utils.ScrollMode.PAGE) {\n this._setCurrentPageNumber(id);\n\n this.#ensurePageViewVisible();\n this.update();\n }\n\n if (!pageSpot && !this.isInPresentationMode) {\n const left = div.offsetLeft + div.clientLeft,\n right = left + div.clientWidth;\n const {\n scrollLeft,\n clientWidth\n } = this.container;\n\n if (this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL || left < scrollLeft || right > scrollLeft + clientWidth) {\n pageSpot = {\n left: 0,\n top: 0\n };\n }\n }\n\n (0, _ui_utils.scrollIntoView)(div, pageSpot);\n }\n\n #isSameScale(newScale) {\n return newScale === this._currentScale || Math.abs(newScale - this._currentScale) < 1e-15;\n }\n\n _setScaleUpdatePages(newScale, newValue, noScroll = false, preset = false) {\n this._currentScaleValue = newValue.toString();\n\n if (this.#isSameScale(newScale)) {\n if (preset) {\n this.eventBus.dispatch(\"scalechanging\", {\n source: this,\n scale: newScale,\n presetValue: newValue\n });\n }\n\n return;\n }\n\n _ui_utils.docStyle.setProperty(\"--scale-factor\", newScale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS);\n\n const updateArgs = {\n scale: newScale\n };\n\n for (const pageView of this._pages) {\n pageView.update(updateArgs);\n }\n\n this._currentScale = newScale;\n\n if (!noScroll) {\n let page = this._currentPageNumber,\n dest;\n\n if (this._location && !(this.isInPresentationMode || this.isChangingPresentationMode)) {\n page = this._location.pageNumber;\n dest = [null, {\n name: \"XYZ\"\n }, this._location.left, this._location.top, null];\n }\n\n this.scrollPageIntoView({\n pageNumber: page,\n destArray: dest,\n allowNegativeOffset: true\n });\n }\n\n this.eventBus.dispatch(\"scalechanging\", {\n source: this,\n scale: newScale,\n presetValue: preset ? newValue : undefined\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n\n this.updateContainerHeightCss();\n }\n\n get _pageWidthScaleFactor() {\n if (this._spreadMode !== _ui_utils.SpreadMode.NONE && this._scrollMode !== _ui_utils.ScrollMode.HORIZONTAL) {\n return 2;\n }\n\n return 1;\n }\n\n _setScale(value, noScroll = false) {\n let scale = parseFloat(value);\n\n if (scale > 0) {\n this._setScaleUpdatePages(scale, value, noScroll, false);\n } else {\n const currentPage = this._pages[this._currentPageNumber - 1];\n\n if (!currentPage) {\n return;\n }\n\n let hPadding = _ui_utils.SCROLLBAR_PADDING,\n vPadding = _ui_utils.VERTICAL_PADDING;\n\n if (this.isInPresentationMode) {\n hPadding = vPadding = 4;\n } else if (this.removePageBorders) {\n hPadding = vPadding = 0;\n } else if (this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL) {\n [hPadding, vPadding] = [vPadding, hPadding];\n }\n\n const pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale / this._pageWidthScaleFactor;\n const pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale;\n\n switch (value) {\n case \"page-actual\":\n scale = 1;\n break;\n\n case \"page-width\":\n scale = pageWidthScale;\n break;\n\n case \"page-height\":\n scale = pageHeightScale;\n break;\n\n case \"page-fit\":\n scale = Math.min(pageWidthScale, pageHeightScale);\n break;\n\n case \"auto\":\n const horizontalScale = (0, _ui_utils.isPortraitOrientation)(currentPage) ? pageWidthScale : Math.min(pageHeightScale, pageWidthScale);\n scale = Math.min(_ui_utils.MAX_AUTO_SCALE, horizontalScale);\n break;\n\n default:\n console.error(`_setScale: \"${value}\" is an unknown zoom value.`);\n return;\n }\n\n this._setScaleUpdatePages(scale, value, noScroll, true);\n }\n }\n\n #resetCurrentPageView() {\n const pageView = this._pages[this._currentPageNumber - 1];\n\n if (this.isInPresentationMode) {\n this._setScale(this._currentScaleValue, true);\n }\n\n this.#scrollIntoView(pageView);\n }\n\n pageLabelToPageNumber(label) {\n if (!this._pageLabels) {\n return null;\n }\n\n const i = this._pageLabels.indexOf(label);\n\n if (i < 0) {\n return null;\n }\n\n return i + 1;\n }\n\n scrollPageIntoView({\n pageNumber,\n destArray = null,\n allowNegativeOffset = false,\n ignoreDestinationZoom = false\n }) {\n if (!this.pdfDocument) {\n return;\n }\n\n const pageView = Number.isInteger(pageNumber) && this._pages[pageNumber - 1];\n\n if (!pageView) {\n console.error(`scrollPageIntoView: \"${pageNumber}\" is not a valid pageNumber parameter.`);\n return;\n }\n\n if (this.isInPresentationMode || !destArray) {\n this._setCurrentPageNumber(pageNumber, true);\n\n return;\n }\n\n let x = 0,\n y = 0;\n let width = 0,\n height = 0,\n widthScale,\n heightScale;\n const changeOrientation = pageView.rotation % 180 !== 0;\n const pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS;\n const pageHeight = (changeOrientation ? pageView.width : pageView.height) / pageView.scale / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS;\n let scale = 0;\n\n switch (destArray[1].name) {\n case \"XYZ\":\n x = destArray[2];\n y = destArray[3];\n scale = destArray[4];\n x = x !== null ? x : 0;\n y = y !== null ? y : pageHeight;\n break;\n\n case \"Fit\":\n case \"FitB\":\n scale = \"page-fit\";\n break;\n\n case \"FitH\":\n case \"FitBH\":\n y = destArray[2];\n scale = \"page-width\";\n\n if (y === null && this._location) {\n x = this._location.left;\n y = this._location.top;\n } else if (typeof y !== \"number\" || y < 0) {\n y = pageHeight;\n }\n\n break;\n\n case \"FitV\":\n case \"FitBV\":\n x = destArray[2];\n width = pageWidth;\n height = pageHeight;\n scale = \"page-height\";\n break;\n\n case \"FitR\":\n x = destArray[2];\n y = destArray[3];\n width = destArray[4] - x;\n height = destArray[5] - y;\n const hPadding = this.removePageBorders ? 0 : _ui_utils.SCROLLBAR_PADDING;\n const vPadding = this.removePageBorders ? 0 : _ui_utils.VERTICAL_PADDING;\n widthScale = (this.container.clientWidth - hPadding) / width / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS;\n heightScale = (this.container.clientHeight - vPadding) / height / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS;\n scale = Math.min(Math.abs(widthScale), Math.abs(heightScale));\n break;\n\n default:\n console.error(`scrollPageIntoView: \"${destArray[1].name}\" is not a valid destination type.`);\n return;\n }\n\n if (!ignoreDestinationZoom) {\n if (scale && scale !== this._currentScale) {\n this.currentScaleValue = scale;\n } else if (this._currentScale === _ui_utils.UNKNOWN_SCALE) {\n this.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;\n }\n }\n\n if (scale === \"page-fit\" && !destArray[4]) {\n this.#scrollIntoView(pageView);\n return;\n }\n\n const boundingRect = [pageView.viewport.convertToViewportPoint(x, y), pageView.viewport.convertToViewportPoint(x + width, y + height)];\n let left = Math.min(boundingRect[0][0], boundingRect[1][0]);\n let top = Math.min(boundingRect[0][1], boundingRect[1][1]);\n\n if (!allowNegativeOffset) {\n left = Math.max(left, 0);\n top = Math.max(top, 0);\n }\n\n this.#scrollIntoView(pageView, {\n left,\n top\n });\n }\n\n _updateLocation(firstPage) {\n const currentScale = this._currentScale;\n const currentScaleValue = this._currentScaleValue;\n const normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue;\n const pageNumber = firstPage.id;\n const currentPageView = this._pages[pageNumber - 1];\n const container = this.container;\n const topLeft = currentPageView.getPagePoint(container.scrollLeft - firstPage.x, container.scrollTop - firstPage.y);\n const intLeft = Math.round(topLeft[0]);\n const intTop = Math.round(topLeft[1]);\n let pdfOpenParams = `#page=${pageNumber}`;\n\n if (!this.isInPresentationMode) {\n pdfOpenParams += `&zoom=${normalizedScaleValue},${intLeft},${intTop}`;\n }\n\n this._location = {\n pageNumber,\n scale: normalizedScaleValue,\n top: intTop,\n left: intLeft,\n rotation: this._pagesRotation,\n pdfOpenParams\n };\n }\n\n update() {\n const visible = this._getVisiblePages();\n\n const visiblePages = visible.views,\n numVisiblePages = visiblePages.length;\n\n if (numVisiblePages === 0) {\n return;\n }\n\n const newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1);\n this.#buffer.resize(newCacheSize, visible.ids);\n this.renderingQueue.renderHighestPriority(visible);\n const isSimpleLayout = this._spreadMode === _ui_utils.SpreadMode.NONE && (this._scrollMode === _ui_utils.ScrollMode.PAGE || this._scrollMode === _ui_utils.ScrollMode.VERTICAL);\n const currentId = this._currentPageNumber;\n let stillFullyVisible = false;\n\n for (const page of visiblePages) {\n if (page.percent < 100) {\n break;\n }\n\n if (page.id === currentId && isSimpleLayout) {\n stillFullyVisible = true;\n break;\n }\n }\n\n this._setCurrentPageNumber(stillFullyVisible ? currentId : visiblePages[0].id);\n\n this._updateLocation(visible.first);\n\n this.eventBus.dispatch(\"updateviewarea\", {\n source: this,\n location: this._location\n });\n }\n\n containsElement(element) {\n return this.container.contains(element);\n }\n\n focus() {\n this.container.focus();\n }\n\n get _isContainerRtl() {\n return getComputedStyle(this.container).direction === \"rtl\";\n }\n\n get isInPresentationMode() {\n return this.presentationModeState === _ui_utils.PresentationModeState.FULLSCREEN;\n }\n\n get isChangingPresentationMode() {\n return this.presentationModeState === _ui_utils.PresentationModeState.CHANGING;\n }\n\n get isHorizontalScrollbarEnabled() {\n return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth;\n }\n\n get isVerticalScrollbarEnabled() {\n return this.isInPresentationMode ? false : this.container.scrollHeight > this.container.clientHeight;\n }\n\n _getVisiblePages() {\n const views = this._scrollMode === _ui_utils.ScrollMode.PAGE ? this.#scrollModePageState.pages : this._pages,\n horizontal = this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL,\n rtl = horizontal && this._isContainerRtl;\n return (0, _ui_utils.getVisibleElements)({\n scrollEl: this.container,\n views,\n sortByVisibility: true,\n horizontal,\n rtl\n });\n }\n\n isPageVisible(pageNumber) {\n if (!this.pdfDocument) {\n return false;\n }\n\n if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {\n console.error(`isPageVisible: \"${pageNumber}\" is not a valid page.`);\n return false;\n }\n\n return this._getVisiblePages().ids.has(pageNumber);\n }\n\n isPageCached(pageNumber) {\n if (!this.pdfDocument) {\n return false;\n }\n\n if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {\n console.error(`isPageCached: \"${pageNumber}\" is not a valid page.`);\n return false;\n }\n\n const pageView = this._pages[pageNumber - 1];\n return this.#buffer.has(pageView);\n }\n\n cleanup() {\n for (const pageView of this._pages) {\n if (pageView.renderingState !== _ui_utils.RenderingStates.FINISHED) {\n pageView.reset();\n }\n }\n }\n\n _cancelRendering() {\n for (const pageView of this._pages) {\n pageView.cancelRendering();\n }\n }\n\n async #ensurePdfPageLoaded(pageView) {\n if (pageView.pdfPage) {\n return pageView.pdfPage;\n }\n\n try {\n const pdfPage = await this.pdfDocument.getPage(pageView.id);\n\n if (!pageView.pdfPage) {\n pageView.setPdfPage(pdfPage);\n }\n\n if (!this.linkService._cachedPageNumber?.(pdfPage.ref)) {\n this.linkService.cachePageRef(pageView.id, pdfPage.ref);\n }\n\n return pdfPage;\n } catch (reason) {\n console.error(\"Unable to get page for page view\", reason);\n return null;\n }\n }\n\n #getScrollAhead(visible) {\n if (visible.first?.id === 1) {\n return true;\n } else if (visible.last?.id === this.pagesCount) {\n return false;\n }\n\n switch (this._scrollMode) {\n case _ui_utils.ScrollMode.PAGE:\n return this.#scrollModePageState.scrollDown;\n\n case _ui_utils.ScrollMode.HORIZONTAL:\n return this.scroll.right;\n }\n\n return this.scroll.down;\n }\n\n #toggleLoadingIconSpinner(visibleIds) {\n for (const id of visibleIds) {\n const pageView = this._pages[id - 1];\n pageView?.toggleLoadingIconSpinner(true);\n }\n\n for (const pageView of this.#buffer) {\n if (visibleIds.has(pageView.id)) {\n continue;\n }\n\n pageView.toggleLoadingIconSpinner(false);\n }\n }\n\n forceRendering(currentlyVisiblePages) {\n const visiblePages = currentlyVisiblePages || this._getVisiblePages();\n\n const scrollAhead = this.#getScrollAhead(visiblePages);\n const preRenderExtra = this._spreadMode !== _ui_utils.SpreadMode.NONE && this._scrollMode !== _ui_utils.ScrollMode.HORIZONTAL;\n const pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, scrollAhead, preRenderExtra);\n this.#toggleLoadingIconSpinner(visiblePages.ids);\n\n if (pageView) {\n this.#ensurePdfPageLoaded(pageView).then(() => {\n this.renderingQueue.renderView(pageView);\n });\n return true;\n }\n\n return false;\n }\n\n createTextLayerBuilder({\n textLayerDiv,\n pageIndex,\n viewport,\n enhanceTextSelection = false,\n eventBus,\n highlighter,\n accessibilityManager = null\n }) {\n return new _text_layer_builder.TextLayerBuilder({\n textLayerDiv,\n eventBus,\n pageIndex,\n viewport,\n enhanceTextSelection: this.isInPresentationMode ? false : enhanceTextSelection,\n highlighter,\n accessibilityManager\n });\n }\n\n createTextHighlighter({\n pageIndex,\n eventBus\n }) {\n return new _text_highlighter.TextHighlighter({\n eventBus,\n pageIndex,\n findController: this.isInPresentationMode ? null : this.findController\n });\n }\n\n createAnnotationLayerBuilder({\n pageDiv,\n pdfPage,\n annotationStorage = this.pdfDocument?.annotationStorage,\n imageResourcesPath = \"\",\n renderForms = true,\n l10n = _l10n_utils.NullL10n,\n enableScripting = this.enableScripting,\n hasJSActionsPromise = this.pdfDocument?.hasJSActions(),\n mouseState = this._scriptingManager?.mouseState,\n fieldObjectsPromise = this.pdfDocument?.getFieldObjects(),\n annotationCanvasMap = null,\n accessibilityManager = null\n }) {\n return new _annotation_layer_builder.AnnotationLayerBuilder({\n pageDiv,\n pdfPage,\n annotationStorage,\n imageResourcesPath,\n renderForms,\n linkService: this.linkService,\n downloadManager: this.downloadManager,\n l10n,\n enableScripting,\n hasJSActionsPromise,\n mouseState,\n fieldObjectsPromise,\n annotationCanvasMap,\n accessibilityManager\n });\n }\n\n createAnnotationEditorLayerBuilder({\n uiManager = this.#annotationEditorUIManager,\n pageDiv,\n pdfPage,\n accessibilityManager = null,\n l10n,\n annotationStorage = this.pdfDocument?.annotationStorage\n }) {\n return new _annotation_editor_layer_builder.AnnotationEditorLayerBuilder({\n uiManager,\n pageDiv,\n pdfPage,\n annotationStorage,\n accessibilityManager,\n l10n\n });\n }\n\n createXfaLayerBuilder({\n pageDiv,\n pdfPage,\n annotationStorage = this.pdfDocument?.annotationStorage\n }) {\n return new _xfa_layer_builder.XfaLayerBuilder({\n pageDiv,\n pdfPage,\n annotationStorage,\n linkService: this.linkService\n });\n }\n\n createStructTreeLayerBuilder({\n pdfPage\n }) {\n return new _struct_tree_layer_builder.StructTreeLayerBuilder({\n pdfPage\n });\n }\n\n get hasEqualPageSizes() {\n const firstPageView = this._pages[0];\n\n for (let i = 1, ii = this._pages.length; i < ii; ++i) {\n const pageView = this._pages[i];\n\n if (pageView.width !== firstPageView.width || pageView.height !== firstPageView.height) {\n return false;\n }\n }\n\n return true;\n }\n\n getPagesOverview() {\n return this._pages.map(pageView => {\n const viewport = pageView.pdfPage.getViewport({\n scale: 1\n });\n\n if (!this.enablePrintAutoRotate || (0, _ui_utils.isPortraitOrientation)(viewport)) {\n return {\n width: viewport.width,\n height: viewport.height,\n rotation: viewport.rotation\n };\n }\n\n return {\n width: viewport.height,\n height: viewport.width,\n rotation: (viewport.rotation - 90) % 360\n };\n });\n }\n\n get optionalContentConfigPromise() {\n if (!this.pdfDocument) {\n return Promise.resolve(null);\n }\n\n if (!this._optionalContentConfigPromise) {\n console.error(\"optionalContentConfigPromise: Not initialized yet.\");\n return this.pdfDocument.getOptionalContentConfig();\n }\n\n return this._optionalContentConfigPromise;\n }\n\n set optionalContentConfigPromise(promise) {\n if (!(promise instanceof Promise)) {\n throw new Error(`Invalid optionalContentConfigPromise: ${promise}`);\n }\n\n if (!this.pdfDocument) {\n return;\n }\n\n if (!this._optionalContentConfigPromise) {\n return;\n }\n\n this._optionalContentConfigPromise = promise;\n const updateArgs = {\n optionalContentConfigPromise: promise\n };\n\n for (const pageView of this._pages) {\n pageView.update(updateArgs);\n }\n\n this.update();\n this.eventBus.dispatch(\"optionalcontentconfigchanged\", {\n source: this,\n promise\n });\n }\n\n get scrollMode() {\n return this._scrollMode;\n }\n\n set scrollMode(mode) {\n if (this._scrollMode === mode) {\n return;\n }\n\n if (!(0, _ui_utils.isValidScrollMode)(mode)) {\n throw new Error(`Invalid scroll mode: ${mode}`);\n }\n\n if (this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {\n return;\n }\n\n this._previousScrollMode = this._scrollMode;\n this._scrollMode = mode;\n this.eventBus.dispatch(\"scrollmodechanged\", {\n source: this,\n mode\n });\n\n this._updateScrollMode(this._currentPageNumber);\n }\n\n _updateScrollMode(pageNumber = null) {\n const scrollMode = this._scrollMode,\n viewer = this.viewer;\n viewer.classList.toggle(\"scrollHorizontal\", scrollMode === _ui_utils.ScrollMode.HORIZONTAL);\n viewer.classList.toggle(\"scrollWrapped\", scrollMode === _ui_utils.ScrollMode.WRAPPED);\n\n if (!this.pdfDocument || !pageNumber) {\n return;\n }\n\n if (scrollMode === _ui_utils.ScrollMode.PAGE) {\n this.#ensurePageViewVisible();\n } else if (this._previousScrollMode === _ui_utils.ScrollMode.PAGE) {\n this._updateSpreadMode();\n }\n\n if (this._currentScaleValue && isNaN(this._currentScaleValue)) {\n this._setScale(this._currentScaleValue, true);\n }\n\n this._setCurrentPageNumber(pageNumber, true);\n\n this.update();\n }\n\n get spreadMode() {\n return this._spreadMode;\n }\n\n set spreadMode(mode) {\n if (this._spreadMode === mode) {\n return;\n }\n\n if (!(0, _ui_utils.isValidSpreadMode)(mode)) {\n throw new Error(`Invalid spread mode: ${mode}`);\n }\n\n this._spreadMode = mode;\n this.eventBus.dispatch(\"spreadmodechanged\", {\n source: this,\n mode\n });\n\n this._updateSpreadMode(this._currentPageNumber);\n }\n\n _updateSpreadMode(pageNumber = null) {\n if (!this.pdfDocument) {\n return;\n }\n\n const viewer = this.viewer,\n pages = this._pages;\n\n if (this._scrollMode === _ui_utils.ScrollMode.PAGE) {\n this.#ensurePageViewVisible();\n } else {\n viewer.textContent = \"\";\n\n if (this._spreadMode === _ui_utils.SpreadMode.NONE) {\n for (const pageView of this._pages) {\n viewer.append(pageView.div);\n }\n } else {\n const parity = this._spreadMode - 1;\n let spread = null;\n\n for (let i = 0, ii = pages.length; i < ii; ++i) {\n if (spread === null) {\n spread = document.createElement(\"div\");\n spread.className = \"spread\";\n viewer.append(spread);\n } else if (i % 2 === parity) {\n spread = spread.cloneNode(false);\n viewer.append(spread);\n }\n\n spread.append(pages[i].div);\n }\n }\n }\n\n if (!pageNumber) {\n return;\n }\n\n if (this._currentScaleValue && isNaN(this._currentScaleValue)) {\n this._setScale(this._currentScaleValue, true);\n }\n\n this._setCurrentPageNumber(pageNumber, true);\n\n this.update();\n }\n\n _getPageAdvance(currentPageNumber, previous = false) {\n switch (this._scrollMode) {\n case _ui_utils.ScrollMode.WRAPPED:\n {\n const {\n views\n } = this._getVisiblePages(),\n pageLayout = new Map();\n\n for (const {\n id,\n y,\n percent,\n widthPercent\n } of views) {\n if (percent === 0 || widthPercent < 100) {\n continue;\n }\n\n let yArray = pageLayout.get(y);\n\n if (!yArray) {\n pageLayout.set(y, yArray ||= []);\n }\n\n yArray.push(id);\n }\n\n for (const yArray of pageLayout.values()) {\n const currentIndex = yArray.indexOf(currentPageNumber);\n\n if (currentIndex === -1) {\n continue;\n }\n\n const numPages = yArray.length;\n\n if (numPages === 1) {\n break;\n }\n\n if (previous) {\n for (let i = currentIndex - 1, ii = 0; i >= ii; i--) {\n const currentId = yArray[i],\n expectedId = yArray[i + 1] - 1;\n\n if (currentId < expectedId) {\n return currentPageNumber - expectedId;\n }\n }\n } else {\n for (let i = currentIndex + 1, ii = numPages; i < ii; i++) {\n const currentId = yArray[i],\n expectedId = yArray[i - 1] + 1;\n\n if (currentId > expectedId) {\n return expectedId - currentPageNumber;\n }\n }\n }\n\n if (previous) {\n const firstId = yArray[0];\n\n if (firstId < currentPageNumber) {\n return currentPageNumber - firstId + 1;\n }\n } else {\n const lastId = yArray[numPages - 1];\n\n if (lastId > currentPageNumber) {\n return lastId - currentPageNumber + 1;\n }\n }\n\n break;\n }\n\n break;\n }\n\n case _ui_utils.ScrollMode.HORIZONTAL:\n {\n break;\n }\n\n case _ui_utils.ScrollMode.PAGE:\n case _ui_utils.ScrollMode.VERTICAL:\n {\n if (this._spreadMode === _ui_utils.SpreadMode.NONE) {\n break;\n }\n\n const parity = this._spreadMode - 1;\n\n if (previous && currentPageNumber % 2 !== parity) {\n break;\n } else if (!previous && currentPageNumber % 2 === parity) {\n break;\n }\n\n const {\n views\n } = this._getVisiblePages(),\n expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1;\n\n for (const {\n id,\n percent,\n widthPercent\n } of views) {\n if (id !== expectedId) {\n continue;\n }\n\n if (percent > 0 && widthPercent === 100) {\n return 2;\n }\n\n break;\n }\n\n break;\n }\n }\n\n return 1;\n }\n\n nextPage() {\n const currentPageNumber = this._currentPageNumber,\n pagesCount = this.pagesCount;\n\n if (currentPageNumber >= pagesCount) {\n return false;\n }\n\n const advance = this._getPageAdvance(currentPageNumber, false) || 1;\n this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount);\n return true;\n }\n\n previousPage() {\n const currentPageNumber = this._currentPageNumber;\n\n if (currentPageNumber <= 1) {\n return false;\n }\n\n const advance = this._getPageAdvance(currentPageNumber, true) || 1;\n this.currentPageNumber = Math.max(currentPageNumber - advance, 1);\n return true;\n }\n\n increaseScale(steps = 1) {\n let newScale = this._currentScale;\n\n do {\n newScale = (newScale * _ui_utils.DEFAULT_SCALE_DELTA).toFixed(2);\n newScale = Math.ceil(newScale * 10) / 10;\n newScale = Math.min(_ui_utils.MAX_SCALE, newScale);\n } while (--steps > 0 && newScale < _ui_utils.MAX_SCALE);\n\n this.currentScaleValue = newScale;\n }\n\n decreaseScale(steps = 1) {\n let newScale = this._currentScale;\n\n do {\n newScale = (newScale / _ui_utils.DEFAULT_SCALE_DELTA).toFixed(2);\n newScale = Math.floor(newScale * 10) / 10;\n newScale = Math.max(_ui_utils.MIN_SCALE, newScale);\n } while (--steps > 0 && newScale > _ui_utils.MIN_SCALE);\n\n this.currentScaleValue = newScale;\n }\n\n updateContainerHeightCss() {\n const height = this.container.clientHeight;\n\n if (height !== this.#previousContainerHeight) {\n this.#previousContainerHeight = height;\n\n _ui_utils.docStyle.setProperty(\"--viewer-container-height\", `${height}px`);\n }\n }\n\n get annotationEditorMode() {\n return this.#annotationEditorUIManager ? this.#annotationEditorMode : _pdfjsLib.AnnotationEditorType.DISABLE;\n }\n\n set annotationEditorMode(mode) {\n if (!this.#annotationEditorUIManager) {\n throw new Error(`The AnnotationEditor is not enabled.`);\n }\n\n if (this.#annotationEditorMode === mode) {\n return;\n }\n\n if (!isValidAnnotationEditorMode(mode)) {\n throw new Error(`Invalid AnnotationEditor mode: ${mode}`);\n }\n\n if (!this.pdfDocument) {\n return;\n }\n\n this.#annotationEditorMode = mode;\n this.eventBus.dispatch(\"annotationeditormodechanged\", {\n source: this,\n mode\n });\n this.#annotationEditorUIManager.updateMode(mode);\n }\n\n set annotationEditorParams({\n type,\n value\n }) {\n if (!this.#annotationEditorUIManager) {\n throw new Error(`The AnnotationEditor is not enabled.`);\n }\n\n this.#annotationEditorUIManager.updateParams(type, value);\n }\n\n refresh() {\n if (!this.pdfDocument) {\n return;\n }\n\n const updateArgs = {};\n\n for (const pageView of this._pages) {\n pageView.update(updateArgs);\n }\n\n this.update();\n }\n\n}\n\nexports.BaseViewer = BaseViewer;\n\n/***/ }),\n/* 13 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFPageView = void 0;\n\nvar _pdfjsLib = __w_pdfjs_require__(3);\n\nvar _ui_utils = __w_pdfjs_require__(7);\n\nvar _app_options = __w_pdfjs_require__(14);\n\nvar _l10n_utils = __w_pdfjs_require__(4);\n\nvar _text_accessibility = __w_pdfjs_require__(15);\n\nconst MAX_CANVAS_PIXELS = _app_options.compatibilityParams.maxCanvasPixels || 16777216;\n\nclass PDFPageView {\n #annotationMode = _pdfjsLib.AnnotationMode.ENABLE_FORMS;\n #useThumbnailCanvas = {\n initialOptionalContent: true,\n regularAnnotations: true\n };\n\n constructor(options) {\n const container = options.container;\n const defaultViewport = options.defaultViewport;\n this.id = options.id;\n this.renderingId = \"page\" + this.id;\n this.pdfPage = null;\n this.pageLabel = null;\n this.rotation = 0;\n this.scale = options.scale || _ui_utils.DEFAULT_SCALE;\n this.viewport = defaultViewport;\n this.pdfPageRotate = defaultViewport.rotation;\n this._optionalContentConfigPromise = options.optionalContentConfigPromise || null;\n this.hasRestrictedScaling = false;\n this.textLayerMode = options.textLayerMode ?? _ui_utils.TextLayerMode.ENABLE;\n this.#annotationMode = options.annotationMode ?? _pdfjsLib.AnnotationMode.ENABLE_FORMS;\n this.imageResourcesPath = options.imageResourcesPath || \"\";\n this.useOnlyCssZoom = options.useOnlyCssZoom || false;\n this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS;\n this.pageColors = options.pageColors || null;\n this.eventBus = options.eventBus;\n this.renderingQueue = options.renderingQueue;\n this.textLayerFactory = options.textLayerFactory;\n this.annotationLayerFactory = options.annotationLayerFactory;\n this.annotationEditorLayerFactory = options.annotationEditorLayerFactory;\n this.xfaLayerFactory = options.xfaLayerFactory;\n this.textHighlighter = options.textHighlighterFactory?.createTextHighlighter({\n pageIndex: this.id - 1,\n eventBus: this.eventBus\n });\n this.structTreeLayerFactory = options.structTreeLayerFactory;\n this.renderer = options.renderer || _ui_utils.RendererType.CANVAS;\n this.l10n = options.l10n || _l10n_utils.NullL10n;\n this.paintTask = null;\n this.paintedViewportMap = new WeakMap();\n this.renderingState = _ui_utils.RenderingStates.INITIAL;\n this.resume = null;\n this._renderError = null;\n this._isStandalone = !this.renderingQueue?.hasViewer();\n this._annotationCanvasMap = null;\n this.annotationLayer = null;\n this.annotationEditorLayer = null;\n this.textLayer = null;\n this.zoomLayer = null;\n this.xfaLayer = null;\n this.structTreeLayer = null;\n const div = document.createElement(\"div\");\n div.className = \"page\";\n div.style.width = Math.floor(this.viewport.width) + \"px\";\n div.style.height = Math.floor(this.viewport.height) + \"px\";\n div.setAttribute(\"data-page-number\", this.id);\n div.setAttribute(\"role\", \"region\");\n this.l10n.get(\"page_landmark\", {\n page: this.id\n }).then(msg => {\n div.setAttribute(\"aria-label\", msg);\n });\n this.div = div;\n container?.append(div);\n\n if (this._isStandalone) {\n const {\n optionalContentConfigPromise\n } = options;\n\n if (optionalContentConfigPromise) {\n optionalContentConfigPromise.then(optionalContentConfig => {\n if (optionalContentConfigPromise !== this._optionalContentConfigPromise) {\n return;\n }\n\n this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility;\n });\n }\n }\n }\n\n setPdfPage(pdfPage) {\n this.pdfPage = pdfPage;\n this.pdfPageRotate = pdfPage.rotate;\n const totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = pdfPage.getViewport({\n scale: this.scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: totalRotation\n });\n this.reset();\n }\n\n destroy() {\n this.reset();\n\n if (this.pdfPage) {\n this.pdfPage.cleanup();\n }\n }\n\n async _renderAnnotationLayer() {\n let error = null;\n\n try {\n await this.annotationLayer.render(this.viewport, \"display\");\n } catch (ex) {\n console.error(`_renderAnnotationLayer: \"${ex}\".`);\n error = ex;\n } finally {\n this.eventBus.dispatch(\"annotationlayerrendered\", {\n source: this,\n pageNumber: this.id,\n error\n });\n }\n }\n\n async _renderAnnotationEditorLayer() {\n let error = null;\n\n try {\n await this.annotationEditorLayer.render(this.viewport, \"display\");\n } catch (ex) {\n console.error(`_renderAnnotationEditorLayer: \"${ex}\".`);\n error = ex;\n } finally {\n this.eventBus.dispatch(\"annotationeditorlayerrendered\", {\n source: this,\n pageNumber: this.id,\n error\n });\n }\n }\n\n async _renderXfaLayer() {\n let error = null;\n\n try {\n const result = await this.xfaLayer.render(this.viewport, \"display\");\n\n if (this.textHighlighter) {\n this._buildXfaTextContentItems(result.textDivs);\n }\n } catch (ex) {\n console.error(`_renderXfaLayer: \"${ex}\".`);\n error = ex;\n } finally {\n this.eventBus.dispatch(\"xfalayerrendered\", {\n source: this,\n pageNumber: this.id,\n error\n });\n }\n }\n\n async _buildXfaTextContentItems(textDivs) {\n const text = await this.pdfPage.getTextContent();\n const items = [];\n\n for (const item of text.items) {\n items.push(item.str);\n }\n\n this.textHighlighter.setTextMapping(textDivs, items);\n this.textHighlighter.enable();\n }\n\n _resetZoomLayer(removeFromDOM = false) {\n if (!this.zoomLayer) {\n return;\n }\n\n const zoomLayerCanvas = this.zoomLayer.firstChild;\n this.paintedViewportMap.delete(zoomLayerCanvas);\n zoomLayerCanvas.width = 0;\n zoomLayerCanvas.height = 0;\n\n if (removeFromDOM) {\n this.zoomLayer.remove();\n }\n\n this.zoomLayer = null;\n }\n\n reset({\n keepZoomLayer = false,\n keepAnnotationLayer = false,\n keepAnnotationEditorLayer = false,\n keepXfaLayer = false\n } = {}) {\n this.cancelRendering({\n keepAnnotationLayer,\n keepAnnotationEditorLayer,\n keepXfaLayer\n });\n this.renderingState = _ui_utils.RenderingStates.INITIAL;\n const div = this.div;\n div.style.width = Math.floor(this.viewport.width) + \"px\";\n div.style.height = Math.floor(this.viewport.height) + \"px\";\n const childNodes = div.childNodes,\n zoomLayerNode = keepZoomLayer && this.zoomLayer || null,\n annotationLayerNode = keepAnnotationLayer && this.annotationLayer?.div || null,\n annotationEditorLayerNode = keepAnnotationEditorLayer && this.annotationEditorLayer?.div || null,\n xfaLayerNode = keepXfaLayer && this.xfaLayer?.div || null;\n\n for (let i = childNodes.length - 1; i >= 0; i--) {\n const node = childNodes[i];\n\n switch (node) {\n case zoomLayerNode:\n case annotationLayerNode:\n case annotationEditorLayerNode:\n case xfaLayerNode:\n continue;\n }\n\n node.remove();\n }\n\n div.removeAttribute(\"data-loaded\");\n\n if (annotationLayerNode) {\n this.annotationLayer.hide();\n }\n\n if (annotationEditorLayerNode) {\n this.annotationEditorLayer.hide();\n } else {\n this.annotationEditorLayer?.destroy();\n }\n\n if (xfaLayerNode) {\n this.xfaLayer.hide();\n }\n\n if (!zoomLayerNode) {\n if (this.canvas) {\n this.paintedViewportMap.delete(this.canvas);\n this.canvas.width = 0;\n this.canvas.height = 0;\n delete this.canvas;\n }\n\n this._resetZoomLayer();\n }\n\n if (this.svg) {\n this.paintedViewportMap.delete(this.svg);\n delete this.svg;\n }\n\n this.loadingIconDiv = document.createElement(\"div\");\n this.loadingIconDiv.className = \"loadingIcon notVisible\";\n\n if (this._isStandalone) {\n this.toggleLoadingIconSpinner(true);\n }\n\n this.loadingIconDiv.setAttribute(\"role\", \"img\");\n this.l10n.get(\"loading\").then(msg => {\n this.loadingIconDiv?.setAttribute(\"aria-label\", msg);\n });\n div.append(this.loadingIconDiv);\n }\n\n update({\n scale = 0,\n rotation = null,\n optionalContentConfigPromise = null\n }) {\n this.scale = scale || this.scale;\n\n if (typeof rotation === \"number\") {\n this.rotation = rotation;\n }\n\n if (optionalContentConfigPromise instanceof Promise) {\n this._optionalContentConfigPromise = optionalContentConfigPromise;\n optionalContentConfigPromise.then(optionalContentConfig => {\n if (optionalContentConfigPromise !== this._optionalContentConfigPromise) {\n return;\n }\n\n this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility;\n });\n }\n\n const totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = this.viewport.clone({\n scale: this.scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: totalRotation\n });\n\n if (this._isStandalone) {\n _ui_utils.docStyle.setProperty(\"--scale-factor\", this.viewport.scale);\n }\n\n if (this.svg) {\n this.cssTransform({\n target: this.svg,\n redrawAnnotationLayer: true,\n redrawAnnotationEditorLayer: true,\n redrawXfaLayer: true\n });\n this.eventBus.dispatch(\"pagerendered\", {\n source: this,\n pageNumber: this.id,\n cssTransform: true,\n timestamp: performance.now(),\n error: this._renderError\n });\n return;\n }\n\n let isScalingRestricted = false;\n\n if (this.canvas && this.maxCanvasPixels > 0) {\n const outputScale = this.outputScale;\n\n if ((Math.floor(this.viewport.width) * outputScale.sx | 0) * (Math.floor(this.viewport.height) * outputScale.sy | 0) > this.maxCanvasPixels) {\n isScalingRestricted = true;\n }\n }\n\n if (this.canvas) {\n if (this.useOnlyCssZoom || this.hasRestrictedScaling && isScalingRestricted) {\n this.cssTransform({\n target: this.canvas,\n redrawAnnotationLayer: true,\n redrawAnnotationEditorLayer: true,\n redrawXfaLayer: true\n });\n this.eventBus.dispatch(\"pagerendered\", {\n source: this,\n pageNumber: this.id,\n cssTransform: true,\n timestamp: performance.now(),\n error: this._renderError\n });\n return;\n }\n\n if (!this.zoomLayer && !this.canvas.hidden) {\n this.zoomLayer = this.canvas.parentNode;\n this.zoomLayer.style.position = \"absolute\";\n }\n }\n\n if (this.zoomLayer) {\n this.cssTransform({\n target: this.zoomLayer.firstChild\n });\n }\n\n this.reset({\n keepZoomLayer: true,\n keepAnnotationLayer: true,\n keepAnnotationEditorLayer: true,\n keepXfaLayer: true\n });\n }\n\n cancelRendering({\n keepAnnotationLayer = false,\n keepAnnotationEditorLayer = false,\n keepXfaLayer = false\n } = {}) {\n if (this.paintTask) {\n this.paintTask.cancel();\n this.paintTask = null;\n }\n\n this.resume = null;\n\n if (this.textLayer) {\n this.textLayer.cancel();\n this.textLayer = null;\n }\n\n if (this.annotationLayer && (!keepAnnotationLayer || !this.annotationLayer.div)) {\n this.annotationLayer.cancel();\n this.annotationLayer = null;\n this._annotationCanvasMap = null;\n }\n\n if (this.annotationEditorLayer && (!keepAnnotationEditorLayer || !this.annotationEditorLayer.div)) {\n this.annotationEditorLayer.cancel();\n this.annotationEditorLayer = null;\n }\n\n if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) {\n this.xfaLayer.cancel();\n this.xfaLayer = null;\n this.textHighlighter?.disable();\n }\n\n if (this._onTextLayerRendered) {\n this.eventBus._off(\"textlayerrendered\", this._onTextLayerRendered);\n\n this._onTextLayerRendered = null;\n }\n }\n\n cssTransform({\n target,\n redrawAnnotationLayer = false,\n redrawAnnotationEditorLayer = false,\n redrawXfaLayer = false\n }) {\n const width = this.viewport.width;\n const height = this.viewport.height;\n const div = this.div;\n target.style.width = target.parentNode.style.width = div.style.width = Math.floor(width) + \"px\";\n target.style.height = target.parentNode.style.height = div.style.height = Math.floor(height) + \"px\";\n const relativeRotation = this.viewport.rotation - this.paintedViewportMap.get(target).rotation;\n const absRotation = Math.abs(relativeRotation);\n let scaleX = 1,\n scaleY = 1;\n\n if (absRotation === 90 || absRotation === 270) {\n scaleX = height / width;\n scaleY = width / height;\n }\n\n target.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX}, ${scaleY})`;\n\n if (this.textLayer) {\n const textLayerViewport = this.textLayer.viewport;\n const textRelativeRotation = this.viewport.rotation - textLayerViewport.rotation;\n const textAbsRotation = Math.abs(textRelativeRotation);\n let scale = width / textLayerViewport.width;\n\n if (textAbsRotation === 90 || textAbsRotation === 270) {\n scale = width / textLayerViewport.height;\n }\n\n const textLayerDiv = this.textLayer.textLayerDiv;\n let transX, transY;\n\n switch (textAbsRotation) {\n case 0:\n transX = transY = 0;\n break;\n\n case 90:\n transX = 0;\n transY = \"-\" + textLayerDiv.style.height;\n break;\n\n case 180:\n transX = \"-\" + textLayerDiv.style.width;\n transY = \"-\" + textLayerDiv.style.height;\n break;\n\n case 270:\n transX = \"-\" + textLayerDiv.style.width;\n transY = 0;\n break;\n\n default:\n console.error(\"Bad rotation value.\");\n break;\n }\n\n textLayerDiv.style.transform = `rotate(${textAbsRotation}deg) ` + `scale(${scale}) ` + `translate(${transX}, ${transY})`;\n textLayerDiv.style.transformOrigin = \"0% 0%\";\n }\n\n if (redrawAnnotationLayer && this.annotationLayer) {\n this._renderAnnotationLayer();\n }\n\n if (redrawAnnotationEditorLayer && this.annotationEditorLayer) {\n this._renderAnnotationEditorLayer();\n }\n\n if (redrawXfaLayer && this.xfaLayer) {\n this._renderXfaLayer();\n }\n }\n\n get width() {\n return this.viewport.width;\n }\n\n get height() {\n return this.viewport.height;\n }\n\n getPagePoint(x, y) {\n return this.viewport.convertToPdfPoint(x, y);\n }\n\n toggleLoadingIconSpinner(viewVisible = false) {\n this.loadingIconDiv?.classList.toggle(\"notVisible\", !viewVisible);\n }\n\n draw() {\n if (this.renderingState !== _ui_utils.RenderingStates.INITIAL) {\n console.error(\"Must be in new state before drawing\");\n this.reset();\n }\n\n const {\n div,\n pdfPage\n } = this;\n\n if (!pdfPage) {\n this.renderingState = _ui_utils.RenderingStates.FINISHED;\n\n if (this.loadingIconDiv) {\n this.loadingIconDiv.remove();\n delete this.loadingIconDiv;\n }\n\n return Promise.reject(new Error(\"pdfPage is not loaded\"));\n }\n\n this.renderingState = _ui_utils.RenderingStates.RUNNING;\n const canvasWrapper = document.createElement(\"div\");\n canvasWrapper.style.width = div.style.width;\n canvasWrapper.style.height = div.style.height;\n canvasWrapper.classList.add(\"canvasWrapper\");\n const lastDivBeforeTextDiv = this.annotationLayer?.div || this.annotationEditorLayer?.div;\n\n if (lastDivBeforeTextDiv) {\n lastDivBeforeTextDiv.before(canvasWrapper);\n } else {\n div.append(canvasWrapper);\n }\n\n let textLayer = null;\n\n if (this.textLayerMode !== _ui_utils.TextLayerMode.DISABLE && this.textLayerFactory) {\n this._accessibilityManager ||= new _text_accessibility.TextAccessibilityManager();\n const textLayerDiv = document.createElement(\"div\");\n textLayerDiv.className = \"textLayer\";\n textLayerDiv.style.width = canvasWrapper.style.width;\n textLayerDiv.style.height = canvasWrapper.style.height;\n\n if (lastDivBeforeTextDiv) {\n lastDivBeforeTextDiv.before(textLayerDiv);\n } else {\n div.append(textLayerDiv);\n }\n\n textLayer = this.textLayerFactory.createTextLayerBuilder({\n textLayerDiv,\n pageIndex: this.id - 1,\n viewport: this.viewport,\n enhanceTextSelection: this.textLayerMode === _ui_utils.TextLayerMode.ENABLE_ENHANCE,\n eventBus: this.eventBus,\n highlighter: this.textHighlighter,\n accessibilityManager: this._accessibilityManager\n });\n }\n\n this.textLayer = textLayer;\n\n if (this.#annotationMode !== _pdfjsLib.AnnotationMode.DISABLE && this.annotationLayerFactory) {\n this._annotationCanvasMap ||= new Map();\n this.annotationLayer ||= this.annotationLayerFactory.createAnnotationLayerBuilder({\n pageDiv: div,\n pdfPage,\n imageResourcesPath: this.imageResourcesPath,\n renderForms: this.#annotationMode === _pdfjsLib.AnnotationMode.ENABLE_FORMS,\n l10n: this.l10n,\n annotationCanvasMap: this._annotationCanvasMap,\n accessibilityManager: this._accessibilityManager\n });\n }\n\n if (this.xfaLayer?.div) {\n div.append(this.xfaLayer.div);\n }\n\n let renderContinueCallback = null;\n\n if (this.renderingQueue) {\n renderContinueCallback = cont => {\n if (!this.renderingQueue.isHighestPriority(this)) {\n this.renderingState = _ui_utils.RenderingStates.PAUSED;\n\n this.resume = () => {\n this.renderingState = _ui_utils.RenderingStates.RUNNING;\n cont();\n };\n\n return;\n }\n\n cont();\n };\n }\n\n const finishPaintTask = async (error = null) => {\n if (paintTask === this.paintTask) {\n this.paintTask = null;\n }\n\n if (error instanceof _pdfjsLib.RenderingCancelledException) {\n this._renderError = null;\n return;\n }\n\n this._renderError = error;\n this.renderingState = _ui_utils.RenderingStates.FINISHED;\n\n if (this.loadingIconDiv) {\n this.loadingIconDiv.remove();\n delete this.loadingIconDiv;\n }\n\n this._resetZoomLayer(true);\n\n this.#useThumbnailCanvas.regularAnnotations = !paintTask.separateAnnots;\n this.eventBus.dispatch(\"pagerendered\", {\n source: this,\n pageNumber: this.id,\n cssTransform: false,\n timestamp: performance.now(),\n error: this._renderError\n });\n\n if (error) {\n throw error;\n }\n };\n\n const paintTask = this.renderer === _ui_utils.RendererType.SVG ? this.paintOnSvg(canvasWrapper) : this.paintOnCanvas(canvasWrapper);\n paintTask.onRenderContinue = renderContinueCallback;\n this.paintTask = paintTask;\n const resultPromise = paintTask.promise.then(() => {\n return finishPaintTask(null).then(() => {\n if (textLayer) {\n const readableStream = pdfPage.streamTextContent({\n includeMarkedContent: true\n });\n textLayer.setTextContentStream(readableStream);\n textLayer.render();\n }\n\n if (this.annotationLayer) {\n this._renderAnnotationLayer().then(() => {\n if (this.annotationEditorLayerFactory) {\n this.annotationEditorLayer ||= this.annotationEditorLayerFactory.createAnnotationEditorLayerBuilder({\n pageDiv: div,\n pdfPage,\n l10n: this.l10n,\n accessibilityManager: this._accessibilityManager\n });\n\n this._renderAnnotationEditorLayer();\n }\n });\n }\n });\n }, function (reason) {\n return finishPaintTask(reason);\n });\n\n if (this.xfaLayerFactory) {\n this.xfaLayer ||= this.xfaLayerFactory.createXfaLayerBuilder({\n pageDiv: div,\n pdfPage\n });\n\n this._renderXfaLayer();\n }\n\n if (this.structTreeLayerFactory && this.textLayer && this.canvas) {\n this._onTextLayerRendered = event => {\n if (event.pageNumber !== this.id) {\n return;\n }\n\n this.eventBus._off(\"textlayerrendered\", this._onTextLayerRendered);\n\n this._onTextLayerRendered = null;\n\n if (!this.canvas) {\n return;\n }\n\n this.pdfPage.getStructTree().then(tree => {\n if (!tree) {\n return;\n }\n\n if (!this.canvas) {\n return;\n }\n\n const treeDom = this.structTreeLayer.render(tree);\n treeDom.classList.add(\"structTree\");\n this.canvas.append(treeDom);\n });\n };\n\n this.eventBus._on(\"textlayerrendered\", this._onTextLayerRendered);\n\n this.structTreeLayer = this.structTreeLayerFactory.createStructTreeLayerBuilder({\n pdfPage\n });\n }\n\n div.setAttribute(\"data-loaded\", true);\n this.eventBus.dispatch(\"pagerender\", {\n source: this,\n pageNumber: this.id\n });\n return resultPromise;\n }\n\n paintOnCanvas(canvasWrapper) {\n const renderCapability = (0, _pdfjsLib.createPromiseCapability)();\n const result = {\n promise: renderCapability.promise,\n\n onRenderContinue(cont) {\n cont();\n },\n\n cancel() {\n renderTask.cancel();\n },\n\n get separateAnnots() {\n return renderTask.separateAnnots;\n }\n\n };\n const viewport = this.viewport;\n const canvas = document.createElement(\"canvas\");\n canvas.setAttribute(\"role\", \"presentation\");\n canvas.hidden = true;\n let isCanvasHidden = true;\n\n const showCanvas = function () {\n if (isCanvasHidden) {\n canvas.hidden = false;\n isCanvasHidden = false;\n }\n };\n\n canvasWrapper.append(canvas);\n this.canvas = canvas;\n const ctx = canvas.getContext(\"2d\", {\n alpha: false\n });\n const outputScale = this.outputScale = new _ui_utils.OutputScale();\n\n if (this.useOnlyCssZoom) {\n const actualSizeViewport = viewport.clone({\n scale: _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS\n });\n outputScale.sx *= actualSizeViewport.width / viewport.width;\n outputScale.sy *= actualSizeViewport.height / viewport.height;\n }\n\n if (this.maxCanvasPixels > 0) {\n const pixelsInViewport = viewport.width * viewport.height;\n const maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport);\n\n if (outputScale.sx > maxScale || outputScale.sy > maxScale) {\n outputScale.sx = maxScale;\n outputScale.sy = maxScale;\n this.hasRestrictedScaling = true;\n } else {\n this.hasRestrictedScaling = false;\n }\n }\n\n const sfx = (0, _ui_utils.approximateFraction)(outputScale.sx);\n const sfy = (0, _ui_utils.approximateFraction)(outputScale.sy);\n canvas.width = (0, _ui_utils.roundToDivide)(viewport.width * outputScale.sx, sfx[0]);\n canvas.height = (0, _ui_utils.roundToDivide)(viewport.height * outputScale.sy, sfy[0]);\n canvas.style.width = (0, _ui_utils.roundToDivide)(viewport.width, sfx[1]) + \"px\";\n canvas.style.height = (0, _ui_utils.roundToDivide)(viewport.height, sfy[1]) + \"px\";\n this.paintedViewportMap.set(canvas, viewport);\n const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null;\n const renderContext = {\n canvasContext: ctx,\n transform,\n viewport: this.viewport,\n annotationMode: this.#annotationMode,\n optionalContentConfigPromise: this._optionalContentConfigPromise,\n annotationCanvasMap: this._annotationCanvasMap,\n pageColors: this.pageColors\n };\n const renderTask = this.pdfPage.render(renderContext);\n\n renderTask.onContinue = function (cont) {\n showCanvas();\n\n if (result.onRenderContinue) {\n result.onRenderContinue(cont);\n } else {\n cont();\n }\n };\n\n renderTask.promise.then(function () {\n showCanvas();\n renderCapability.resolve();\n }, function (error) {\n showCanvas();\n renderCapability.reject(error);\n });\n return result;\n }\n\n paintOnSvg(wrapper) {\n let cancelled = false;\n\n const ensureNotCancelled = () => {\n if (cancelled) {\n throw new _pdfjsLib.RenderingCancelledException(`Rendering cancelled, page ${this.id}`, \"svg\");\n }\n };\n\n const pdfPage = this.pdfPage;\n const actualSizeViewport = this.viewport.clone({\n scale: _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS\n });\n const promise = pdfPage.getOperatorList({\n annotationMode: this.#annotationMode\n }).then(opList => {\n ensureNotCancelled();\n const svgGfx = new _pdfjsLib.SVGGraphics(pdfPage.commonObjs, pdfPage.objs);\n return svgGfx.getSVG(opList, actualSizeViewport).then(svg => {\n ensureNotCancelled();\n this.svg = svg;\n this.paintedViewportMap.set(svg, actualSizeViewport);\n svg.style.width = wrapper.style.width;\n svg.style.height = wrapper.style.height;\n this.renderingState = _ui_utils.RenderingStates.FINISHED;\n wrapper.append(svg);\n });\n });\n return {\n promise,\n\n onRenderContinue(cont) {\n cont();\n },\n\n cancel() {\n cancelled = true;\n },\n\n get separateAnnots() {\n return false;\n }\n\n };\n }\n\n setPageLabel(label) {\n this.pageLabel = typeof label === \"string\" ? label : null;\n\n if (this.pageLabel !== null) {\n this.div.setAttribute(\"data-page-label\", this.pageLabel);\n } else {\n this.div.removeAttribute(\"data-page-label\");\n }\n }\n\n get thumbnailCanvas() {\n const {\n initialOptionalContent,\n regularAnnotations\n } = this.#useThumbnailCanvas;\n return initialOptionalContent && regularAnnotations ? this.canvas : null;\n }\n\n}\n\nexports.PDFPageView = PDFPageView;\n\n/***/ }),\n/* 14 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.compatibilityParams = exports.OptionKind = exports.AppOptions = void 0;\nconst compatibilityParams = Object.create(null);\nexports.compatibilityParams = compatibilityParams;\n{\n const userAgent = navigator.userAgent || \"\";\n const platform = navigator.platform || \"\";\n const maxTouchPoints = navigator.maxTouchPoints || 1;\n const isAndroid = /Android/.test(userAgent);\n const isIOS = /\\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === \"MacIntel\" && maxTouchPoints > 1;\n\n (function checkCanvasSizeLimitation() {\n if (isIOS || isAndroid) {\n compatibilityParams.maxCanvasPixels = 5242880;\n }\n })();\n}\nconst OptionKind = {\n VIEWER: 0x02,\n API: 0x04,\n WORKER: 0x08,\n PREFERENCE: 0x80\n};\nexports.OptionKind = OptionKind;\nconst defaultOptions = {\n annotationEditorMode: {\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n annotationMode: {\n value: 2,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n cursorToolOnLoad: {\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n defaultZoomValue: {\n value: \"\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n disableHistory: {\n value: false,\n kind: OptionKind.VIEWER\n },\n disablePageLabels: {\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n enablePermissions: {\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n enablePrintAutoRotate: {\n value: true,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n enableScripting: {\n value: true,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n externalLinkRel: {\n value: \"noopener noreferrer nofollow\",\n kind: OptionKind.VIEWER\n },\n externalLinkTarget: {\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n historyUpdateUrl: {\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n ignoreDestinationZoom: {\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n imageResourcesPath: {\n value: \"./images/\",\n kind: OptionKind.VIEWER\n },\n maxCanvasPixels: {\n value: 16777216,\n kind: OptionKind.VIEWER\n },\n forcePageColors: {\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n pageColorsBackground: {\n value: \"Canvas\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n pageColorsForeground: {\n value: \"CanvasText\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n pdfBugEnabled: {\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n printResolution: {\n value: 150,\n kind: OptionKind.VIEWER\n },\n sidebarViewOnLoad: {\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n scrollModeOnLoad: {\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n spreadModeOnLoad: {\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n textLayerMode: {\n value: 1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n useOnlyCssZoom: {\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n viewerCssTheme: {\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n viewOnLoad: {\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n },\n cMapPacked: {\n value: true,\n kind: OptionKind.API\n },\n cMapUrl: {\n value: \"../web/cmaps/\",\n kind: OptionKind.API\n },\n disableAutoFetch: {\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE\n },\n disableFontFace: {\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE\n },\n disableRange: {\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE\n },\n disableStream: {\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE\n },\n docBaseUrl: {\n value: \"\",\n kind: OptionKind.API\n },\n enableXfa: {\n value: true,\n kind: OptionKind.API + OptionKind.PREFERENCE\n },\n fontExtraProperties: {\n value: false,\n kind: OptionKind.API\n },\n isEvalSupported: {\n value: true,\n kind: OptionKind.API\n },\n maxImageSize: {\n value: -1,\n kind: OptionKind.API\n },\n pdfBug: {\n value: false,\n kind: OptionKind.API\n },\n standardFontDataUrl: {\n value: \"../web/standard_fonts/\",\n kind: OptionKind.API\n },\n verbosity: {\n value: 1,\n kind: OptionKind.API\n },\n workerPort: {\n value: null,\n kind: OptionKind.WORKER\n },\n workerSrc: {\n value: \"../build/pdf.worker.js\",\n kind: OptionKind.WORKER\n }\n};\n{\n defaultOptions.defaultUrl = {\n value: \"compressed.tracemonkey-pldi-09.pdf\",\n kind: OptionKind.VIEWER\n };\n defaultOptions.disablePreferences = {\n value: false,\n kind: OptionKind.VIEWER\n };\n defaultOptions.locale = {\n value: navigator.language || \"en-US\",\n kind: OptionKind.VIEWER\n };\n defaultOptions.renderer = {\n value: \"canvas\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE\n };\n defaultOptions.sandboxBundleSrc = {\n value: \"../build/pdf.sandbox.js\",\n kind: OptionKind.VIEWER\n };\n}\nconst userOptions = Object.create(null);\n\nclass AppOptions {\n constructor() {\n throw new Error(\"Cannot initialize AppOptions.\");\n }\n\n static get(name) {\n const userOption = userOptions[name];\n\n if (userOption !== undefined) {\n return userOption;\n }\n\n const defaultOption = defaultOptions[name];\n\n if (defaultOption !== undefined) {\n return compatibilityParams[name] ?? defaultOption.value;\n }\n\n return undefined;\n }\n\n static getAll(kind = null) {\n const options = Object.create(null);\n\n for (const name in defaultOptions) {\n const defaultOption = defaultOptions[name];\n\n if (kind) {\n if ((kind & defaultOption.kind) === 0) {\n continue;\n }\n\n if (kind === OptionKind.PREFERENCE) {\n const value = defaultOption.value,\n valueType = typeof value;\n\n if (valueType === \"boolean\" || valueType === \"string\" || valueType === \"number\" && Number.isInteger(value)) {\n options[name] = value;\n continue;\n }\n\n throw new Error(`Invalid type for preference: ${name}`);\n }\n }\n\n const userOption = userOptions[name];\n options[name] = userOption !== undefined ? userOption : compatibilityParams[name] ?? defaultOption.value;\n }\n\n return options;\n }\n\n static set(name, value) {\n userOptions[name] = value;\n }\n\n static setAll(options) {\n for (const name in options) {\n userOptions[name] = options[name];\n }\n }\n\n static remove(name) {\n delete userOptions[name];\n }\n\n static _hasUserOptions() {\n return Object.keys(userOptions).length > 0;\n }\n\n}\n\nexports.AppOptions = AppOptions;\n\n/***/ }),\n/* 15 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.TextAccessibilityManager = void 0;\n\nvar _ui_utils = __w_pdfjs_require__(7);\n\nclass TextAccessibilityManager {\n #enabled = false;\n #textChildren = null;\n #textNodes = new Map();\n #waitingElements = new Map();\n\n setTextMapping(textDivs) {\n this.#textChildren = textDivs;\n }\n\n static #compareElementPositions(e1, e2) {\n const rect1 = e1.getBoundingClientRect();\n const rect2 = e2.getBoundingClientRect();\n\n if (rect1.width === 0 && rect1.height === 0) {\n return +1;\n }\n\n if (rect2.width === 0 && rect2.height === 0) {\n return -1;\n }\n\n const top1 = rect1.y;\n const bot1 = rect1.y + rect1.height;\n const mid1 = rect1.y + rect1.height / 2;\n const top2 = rect2.y;\n const bot2 = rect2.y + rect2.height;\n const mid2 = rect2.y + rect2.height / 2;\n\n if (mid1 <= top2 && mid2 >= bot1) {\n return -1;\n }\n\n if (mid2 <= top1 && mid1 >= bot2) {\n return +1;\n }\n\n const centerX1 = rect1.x + rect1.width / 2;\n const centerX2 = rect2.x + rect2.width / 2;\n return centerX1 - centerX2;\n }\n\n enable() {\n if (this.#enabled) {\n throw new Error(\"TextAccessibilityManager is already enabled.\");\n }\n\n if (!this.#textChildren) {\n throw new Error(\"Text divs and strings have not been set.\");\n }\n\n this.#enabled = true;\n this.#textChildren = this.#textChildren.slice();\n this.#textChildren.sort(TextAccessibilityManager.#compareElementPositions);\n\n if (this.#textNodes.size > 0) {\n const textChildren = this.#textChildren;\n\n for (const [id, nodeIndex] of this.#textNodes) {\n const element = document.getElementById(id);\n\n if (!element) {\n this.#textNodes.delete(id);\n continue;\n }\n\n this.#addIdToAriaOwns(id, textChildren[nodeIndex]);\n }\n }\n\n for (const [element, isRemovable] of this.#waitingElements) {\n this.addPointerInTextLayer(element, isRemovable);\n }\n\n this.#waitingElements.clear();\n }\n\n disable() {\n if (!this.#enabled) {\n return;\n }\n\n this.#waitingElements.clear();\n this.#textChildren = null;\n this.#enabled = false;\n }\n\n removePointerInTextLayer(element) {\n if (!this.#enabled) {\n this.#waitingElements.delete(element);\n return;\n }\n\n const children = this.#textChildren;\n\n if (!children || children.length === 0) {\n return;\n }\n\n const {\n id\n } = element;\n const nodeIndex = this.#textNodes.get(id);\n\n if (nodeIndex === undefined) {\n return;\n }\n\n const node = children[nodeIndex];\n this.#textNodes.delete(id);\n let owns = node.getAttribute(\"aria-owns\");\n\n if (owns?.includes(id)) {\n owns = owns.split(\" \").filter(x => x !== id).join(\" \");\n\n if (owns) {\n node.setAttribute(\"aria-owns\", owns);\n } else {\n node.removeAttribute(\"aria-owns\");\n node.setAttribute(\"role\", \"presentation\");\n }\n }\n }\n\n #addIdToAriaOwns(id, node) {\n const owns = node.getAttribute(\"aria-owns\");\n\n if (!owns?.includes(id)) {\n node.setAttribute(\"aria-owns\", owns ? `${owns} ${id}` : id);\n }\n\n node.removeAttribute(\"role\");\n }\n\n addPointerInTextLayer(element, isRemovable) {\n const {\n id\n } = element;\n\n if (!id) {\n return;\n }\n\n if (!this.#enabled) {\n this.#waitingElements.set(element, isRemovable);\n return;\n }\n\n if (isRemovable) {\n this.removePointerInTextLayer(element);\n }\n\n const children = this.#textChildren;\n\n if (!children || children.length === 0) {\n return;\n }\n\n const index = (0, _ui_utils.binarySearchFirstItem)(children, node => TextAccessibilityManager.#compareElementPositions(element, node) < 0);\n const nodeIndex = Math.max(0, index - 1);\n this.#addIdToAriaOwns(id, children[nodeIndex]);\n this.#textNodes.set(id, nodeIndex);\n }\n\n moveElementInDOM(container, element, contentElement, isRemovable) {\n this.addPointerInTextLayer(contentElement, isRemovable);\n\n if (!container.hasChildNodes()) {\n container.append(element);\n return;\n }\n\n const children = Array.from(container.childNodes).filter(node => node !== element);\n\n if (children.length === 0) {\n return;\n }\n\n const elementToCompare = contentElement || element;\n const index = (0, _ui_utils.binarySearchFirstItem)(children, node => TextAccessibilityManager.#compareElementPositions(elementToCompare, node) < 0);\n\n if (index === 0) {\n children[0].before(element);\n } else {\n children[index - 1].after(element);\n }\n }\n\n}\n\nexports.TextAccessibilityManager = TextAccessibilityManager;\n\n/***/ }),\n/* 16 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFRenderingQueue = void 0;\n\nvar _pdfjsLib = __w_pdfjs_require__(3);\n\nvar _ui_utils = __w_pdfjs_require__(7);\n\nconst CLEANUP_TIMEOUT = 30000;\n\nclass PDFRenderingQueue {\n constructor() {\n this.pdfViewer = null;\n this.pdfThumbnailViewer = null;\n this.onIdle = null;\n this.highestPriorityPage = null;\n this.idleTimeout = null;\n this.printing = false;\n this.isThumbnailViewEnabled = false;\n }\n\n setViewer(pdfViewer) {\n this.pdfViewer = pdfViewer;\n }\n\n setThumbnailViewer(pdfThumbnailViewer) {\n this.pdfThumbnailViewer = pdfThumbnailViewer;\n }\n\n isHighestPriority(view) {\n return this.highestPriorityPage === view.renderingId;\n }\n\n hasViewer() {\n return !!this.pdfViewer;\n }\n\n renderHighestPriority(currentlyVisiblePages) {\n if (this.idleTimeout) {\n clearTimeout(this.idleTimeout);\n this.idleTimeout = null;\n }\n\n if (this.pdfViewer.forceRendering(currentlyVisiblePages)) {\n return;\n }\n\n if (this.isThumbnailViewEnabled && this.pdfThumbnailViewer?.forceRendering()) {\n return;\n }\n\n if (this.printing) {\n return;\n }\n\n if (this.onIdle) {\n this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT);\n }\n }\n\n getHighestPriority(visible, views, scrolledDown, preRenderExtra = false) {\n const visibleViews = visible.views,\n numVisible = visibleViews.length;\n\n if (numVisible === 0) {\n return null;\n }\n\n for (let i = 0; i < numVisible; i++) {\n const view = visibleViews[i].view;\n\n if (!this.isViewFinished(view)) {\n return view;\n }\n }\n\n const firstId = visible.first.id,\n lastId = visible.last.id;\n\n if (lastId - firstId + 1 > numVisible) {\n const visibleIds = visible.ids;\n\n for (let i = 1, ii = lastId - firstId; i < ii; i++) {\n const holeId = scrolledDown ? firstId + i : lastId - i;\n\n if (visibleIds.has(holeId)) {\n continue;\n }\n\n const holeView = views[holeId - 1];\n\n if (!this.isViewFinished(holeView)) {\n return holeView;\n }\n }\n }\n\n let preRenderIndex = scrolledDown ? lastId : firstId - 2;\n let preRenderView = views[preRenderIndex];\n\n if (preRenderView && !this.isViewFinished(preRenderView)) {\n return preRenderView;\n }\n\n if (preRenderExtra) {\n preRenderIndex += scrolledDown ? 1 : -1;\n preRenderView = views[preRenderIndex];\n\n if (preRenderView && !this.isViewFinished(preRenderView)) {\n return preRenderView;\n }\n }\n\n return null;\n }\n\n isViewFinished(view) {\n return view.renderingState === _ui_utils.RenderingStates.FINISHED;\n }\n\n renderView(view) {\n switch (view.renderingState) {\n case _ui_utils.RenderingStates.FINISHED:\n return false;\n\n case _ui_utils.RenderingStates.PAUSED:\n this.highestPriorityPage = view.renderingId;\n view.resume();\n break;\n\n case _ui_utils.RenderingStates.RUNNING:\n this.highestPriorityPage = view.renderingId;\n break;\n\n case _ui_utils.RenderingStates.INITIAL:\n this.highestPriorityPage = view.renderingId;\n view.draw().finally(() => {\n this.renderHighestPriority();\n }).catch(reason => {\n if (reason instanceof _pdfjsLib.RenderingCancelledException) {\n return;\n }\n\n console.error(`renderView: \"${reason}\"`);\n });\n break;\n }\n\n return true;\n }\n\n}\n\nexports.PDFRenderingQueue = PDFRenderingQueue;\n\n/***/ }),\n/* 17 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.TextHighlighter = void 0;\n\nclass TextHighlighter {\n constructor({\n findController,\n eventBus,\n pageIndex\n }) {\n this.findController = findController;\n this.matches = [];\n this.eventBus = eventBus;\n this.pageIdx = pageIndex;\n this._onUpdateTextLayerMatches = null;\n this.textDivs = null;\n this.textContentItemsStr = null;\n this.enabled = false;\n }\n\n setTextMapping(divs, texts) {\n this.textDivs = divs;\n this.textContentItemsStr = texts;\n }\n\n enable() {\n if (!this.textDivs || !this.textContentItemsStr) {\n throw new Error(\"Text divs and strings have not been set.\");\n }\n\n if (this.enabled) {\n throw new Error(\"TextHighlighter is already enabled.\");\n }\n\n this.enabled = true;\n\n if (!this._onUpdateTextLayerMatches) {\n this._onUpdateTextLayerMatches = evt => {\n if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) {\n this._updateMatches();\n }\n };\n\n this.eventBus._on(\"updatetextlayermatches\", this._onUpdateTextLayerMatches);\n }\n\n this._updateMatches();\n }\n\n disable() {\n if (!this.enabled) {\n return;\n }\n\n this.enabled = false;\n\n if (this._onUpdateTextLayerMatches) {\n this.eventBus._off(\"updatetextlayermatches\", this._onUpdateTextLayerMatches);\n\n this._onUpdateTextLayerMatches = null;\n }\n }\n\n _convertMatches(matches, matchesLength) {\n if (!matches) {\n return [];\n }\n\n const {\n textContentItemsStr\n } = this;\n let i = 0,\n iIndex = 0;\n const end = textContentItemsStr.length - 1;\n const result = [];\n\n for (let m = 0, mm = matches.length; m < mm; m++) {\n let matchIdx = matches[m];\n\n while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) {\n iIndex += textContentItemsStr[i].length;\n i++;\n }\n\n if (i === textContentItemsStr.length) {\n console.error(\"Could not find a matching mapping\");\n }\n\n const match = {\n begin: {\n divIdx: i,\n offset: matchIdx - iIndex\n }\n };\n matchIdx += matchesLength[m];\n\n while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) {\n iIndex += textContentItemsStr[i].length;\n i++;\n }\n\n match.end = {\n divIdx: i,\n offset: matchIdx - iIndex\n };\n result.push(match);\n }\n\n return result;\n }\n\n _renderMatches(matches) {\n if (matches.length === 0) {\n return;\n }\n\n const {\n findController,\n pageIdx\n } = this;\n const {\n textContentItemsStr,\n textDivs\n } = this;\n const isSelectedPage = pageIdx === findController.selected.pageIdx;\n const selectedMatchIdx = findController.selected.matchIdx;\n const highlightAll = findController.state.highlightAll;\n let prevEnd = null;\n const infinity = {\n divIdx: -1,\n offset: undefined\n };\n\n function beginText(begin, className) {\n const divIdx = begin.divIdx;\n textDivs[divIdx].textContent = \"\";\n return appendTextToDiv(divIdx, 0, begin.offset, className);\n }\n\n function appendTextToDiv(divIdx, fromOffset, toOffset, className) {\n let div = textDivs[divIdx];\n\n if (div.nodeType === Node.TEXT_NODE) {\n const span = document.createElement(\"span\");\n div.before(span);\n span.append(div);\n textDivs[divIdx] = span;\n div = span;\n }\n\n const content = textContentItemsStr[divIdx].substring(fromOffset, toOffset);\n const node = document.createTextNode(content);\n\n if (className) {\n const span = document.createElement(\"span\");\n span.className = `${className} appended`;\n span.append(node);\n div.append(span);\n return className.includes(\"selected\") ? span.offsetLeft : 0;\n }\n\n div.append(node);\n return 0;\n }\n\n let i0 = selectedMatchIdx,\n i1 = i0 + 1;\n\n if (highlightAll) {\n i0 = 0;\n i1 = matches.length;\n } else if (!isSelectedPage) {\n return;\n }\n\n for (let i = i0; i < i1; i++) {\n const match = matches[i];\n const begin = match.begin;\n const end = match.end;\n const isSelected = isSelectedPage && i === selectedMatchIdx;\n const highlightSuffix = isSelected ? \" selected\" : \"\";\n let selectedLeft = 0;\n\n if (!prevEnd || begin.divIdx !== prevEnd.divIdx) {\n if (prevEnd !== null) {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);\n }\n\n beginText(begin);\n } else {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset);\n }\n\n if (begin.divIdx === end.divIdx) {\n selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, end.offset, \"highlight\" + highlightSuffix);\n } else {\n selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, \"highlight begin\" + highlightSuffix);\n\n for (let n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) {\n textDivs[n0].className = \"highlight middle\" + highlightSuffix;\n }\n\n beginText(end, \"highlight end\" + highlightSuffix);\n }\n\n prevEnd = end;\n\n if (isSelected) {\n findController.scrollMatchIntoView({\n element: textDivs[begin.divIdx],\n selectedLeft,\n pageIndex: pageIdx,\n matchIndex: selectedMatchIdx\n });\n }\n }\n\n if (prevEnd) {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);\n }\n }\n\n _updateMatches() {\n if (!this.enabled) {\n return;\n }\n\n const {\n findController,\n matches,\n pageIdx\n } = this;\n const {\n textContentItemsStr,\n textDivs\n } = this;\n let clearedUntilDivIdx = -1;\n\n for (let i = 0, ii = matches.length; i < ii; i++) {\n const match = matches[i];\n const begin = Math.max(clearedUntilDivIdx, match.begin.divIdx);\n\n for (let n = begin, end = match.end.divIdx; n <= end; n++) {\n const div = textDivs[n];\n div.textContent = textContentItemsStr[n];\n div.className = \"\";\n }\n\n clearedUntilDivIdx = match.end.divIdx + 1;\n }\n\n if (!findController?.highlightMatches) {\n return;\n }\n\n const pageMatches = findController.pageMatches[pageIdx] || null;\n const pageMatchesLength = findController.pageMatchesLength[pageIdx] || null;\n this.matches = this._convertMatches(pageMatches, pageMatchesLength);\n\n this._renderMatches(this.matches);\n }\n\n}\n\nexports.TextHighlighter = TextHighlighter;\n\n/***/ }),\n/* 18 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.DownloadManager = void 0;\n\nvar _pdfjsLib = __w_pdfjs_require__(3);\n\n;\n\nfunction download(blobUrl, filename) {\n const a = document.createElement(\"a\");\n\n if (!a.click) {\n throw new Error('DownloadManager: \"a.click()\" is not supported.');\n }\n\n a.href = blobUrl;\n a.target = \"_parent\";\n\n if (\"download\" in a) {\n a.download = filename;\n }\n\n (document.body || document.documentElement).append(a);\n a.click();\n a.remove();\n}\n\nclass DownloadManager {\n constructor() {\n this._openBlobUrls = new WeakMap();\n }\n\n downloadUrl(url, filename) {\n if (!(0, _pdfjsLib.createValidAbsoluteUrl)(url, \"http://example.com\")) {\n console.error(`downloadUrl - not a valid URL: ${url}`);\n return;\n }\n\n download(url + \"#pdfjs.action=download\", filename);\n }\n\n downloadData(data, filename, contentType) {\n const blobUrl = URL.createObjectURL(new Blob([data], {\n type: contentType\n }));\n download(blobUrl, filename);\n }\n\n openOrDownloadData(element, data, filename) {\n const isPdfData = (0, _pdfjsLib.isPdfFile)(filename);\n const contentType = isPdfData ? \"application/pdf\" : \"\";\n\n if (isPdfData) {\n let blobUrl = this._openBlobUrls.get(element);\n\n if (!blobUrl) {\n blobUrl = URL.createObjectURL(new Blob([data], {\n type: contentType\n }));\n\n this._openBlobUrls.set(element, blobUrl);\n }\n\n let viewerUrl;\n viewerUrl = \"?file=\" + encodeURIComponent(blobUrl + \"#\" + filename);\n\n try {\n window.open(viewerUrl);\n return true;\n } catch (ex) {\n console.error(`openOrDownloadData: ${ex}`);\n URL.revokeObjectURL(blobUrl);\n\n this._openBlobUrls.delete(element);\n }\n }\n\n this.downloadData(data, filename, contentType);\n return false;\n }\n\n download(blob, url, filename) {\n const blobUrl = URL.createObjectURL(blob);\n download(blobUrl, filename);\n }\n\n}\n\nexports.DownloadManager = DownloadManager;\n\n/***/ }),\n/* 19 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.WaitOnType = exports.EventBus = exports.AutomationEventBus = void 0;\nexports.waitOnEventOrTimeout = waitOnEventOrTimeout;\nconst WaitOnType = {\n EVENT: \"event\",\n TIMEOUT: \"timeout\"\n};\nexports.WaitOnType = WaitOnType;\n\nfunction waitOnEventOrTimeout({\n target,\n name,\n delay = 0\n}) {\n return new Promise(function (resolve, reject) {\n if (typeof target !== \"object\" || !(name && typeof name === \"string\") || !(Number.isInteger(delay) && delay >= 0)) {\n throw new Error(\"waitOnEventOrTimeout - invalid parameters.\");\n }\n\n function handler(type) {\n if (target instanceof EventBus) {\n target._off(name, eventHandler);\n } else {\n target.removeEventListener(name, eventHandler);\n }\n\n if (timeout) {\n clearTimeout(timeout);\n }\n\n resolve(type);\n }\n\n const eventHandler = handler.bind(null, WaitOnType.EVENT);\n\n if (target instanceof EventBus) {\n target._on(name, eventHandler);\n } else {\n target.addEventListener(name, eventHandler);\n }\n\n const timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT);\n const timeout = setTimeout(timeoutHandler, delay);\n });\n}\n\nclass EventBus {\n constructor() {\n this._listeners = Object.create(null);\n }\n\n on(eventName, listener, options = null) {\n this._on(eventName, listener, {\n external: true,\n once: options?.once\n });\n }\n\n off(eventName, listener, options = null) {\n this._off(eventName, listener, {\n external: true,\n once: options?.once\n });\n }\n\n dispatch(eventName, data) {\n const eventListeners = this._listeners[eventName];\n\n if (!eventListeners || eventListeners.length === 0) {\n return;\n }\n\n let externalListeners;\n\n for (const {\n listener,\n external,\n once\n } of eventListeners.slice(0)) {\n if (once) {\n this._off(eventName, listener);\n }\n\n if (external) {\n (externalListeners ||= []).push(listener);\n continue;\n }\n\n listener(data);\n }\n\n if (externalListeners) {\n for (const listener of externalListeners) {\n listener(data);\n }\n\n externalListeners = null;\n }\n }\n\n _on(eventName, listener, options = null) {\n const eventListeners = this._listeners[eventName] ||= [];\n eventListeners.push({\n listener,\n external: options?.external === true,\n once: options?.once === true\n });\n }\n\n _off(eventName, listener, options = null) {\n const eventListeners = this._listeners[eventName];\n\n if (!eventListeners) {\n return;\n }\n\n for (let i = 0, ii = eventListeners.length; i < ii; i++) {\n if (eventListeners[i].listener === listener) {\n eventListeners.splice(i, 1);\n return;\n }\n }\n }\n\n}\n\nexports.EventBus = EventBus;\n\nclass AutomationEventBus extends EventBus {\n dispatch(eventName, data) {\n throw new Error(\"Not implemented: AutomationEventBus.dispatch\");\n }\n\n}\n\nexports.AutomationEventBus = AutomationEventBus;\n\n/***/ }),\n/* 20 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.GenericL10n = void 0;\n\n__w_pdfjs_require__(21);\n\nvar _l10n_utils = __w_pdfjs_require__(4);\n\nconst webL10n = document.webL10n;\n\nclass GenericL10n {\n constructor(lang) {\n this._lang = lang;\n this._ready = new Promise((resolve, reject) => {\n webL10n.setLanguage((0, _l10n_utils.fixupLangCode)(lang), () => {\n resolve(webL10n);\n });\n });\n }\n\n async getLanguage() {\n const l10n = await this._ready;\n return l10n.getLanguage();\n }\n\n async getDirection() {\n const l10n = await this._ready;\n return l10n.getDirection();\n }\n\n async get(key, args = null, fallback = (0, _l10n_utils.getL10nFallback)(key, args)) {\n const l10n = await this._ready;\n return l10n.get(key, args, fallback);\n }\n\n async translate(element) {\n const l10n = await this._ready;\n return l10n.translate(element);\n }\n\n}\n\nexports.GenericL10n = GenericL10n;\n\n/***/ }),\n/* 21 */\n/***/ (() => {\n\n\n\ndocument.webL10n = function (window, document, undefined) {\n var gL10nData = {};\n var gTextData = '';\n var gTextProp = 'textContent';\n var gLanguage = '';\n var gMacros = {};\n var gReadyState = 'loading';\n var gAsyncResourceLoading = true;\n\n function getL10nResourceLinks() {\n return document.querySelectorAll('link[type=\"application/l10n\"]');\n }\n\n function getL10nDictionary() {\n var script = document.querySelector('script[type=\"application/l10n\"]');\n return script ? JSON.parse(script.innerHTML) : null;\n }\n\n function getTranslatableChildren(element) {\n return element ? element.querySelectorAll('*[data-l10n-id]') : [];\n }\n\n function getL10nAttributes(element) {\n if (!element) return {};\n var l10nId = element.getAttribute('data-l10n-id');\n var l10nArgs = element.getAttribute('data-l10n-args');\n var args = {};\n\n if (l10nArgs) {\n try {\n args = JSON.parse(l10nArgs);\n } catch (e) {\n console.warn('could not parse arguments for #' + l10nId);\n }\n }\n\n return {\n id: l10nId,\n args: args\n };\n }\n\n function xhrLoadText(url, onSuccess, onFailure) {\n onSuccess = onSuccess || function _onSuccess(data) {};\n\n onFailure = onFailure || function _onFailure() {};\n\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, gAsyncResourceLoading);\n\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType('text/plain; charset=utf-8');\n }\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4) {\n if (xhr.status == 200 || xhr.status === 0) {\n onSuccess(xhr.responseText);\n } else {\n onFailure();\n }\n }\n };\n\n xhr.onerror = onFailure;\n xhr.ontimeout = onFailure;\n\n try {\n xhr.send(null);\n } catch (e) {\n onFailure();\n }\n }\n\n function parseResource(href, lang, successCallback, failureCallback) {\n var baseURL = href.replace(/[^\\/]*$/, '') || './';\n\n function evalString(text) {\n if (text.lastIndexOf('\\\\') < 0) return text;\n return text.replace(/\\\\\\\\/g, '\\\\').replace(/\\\\n/g, '\\n').replace(/\\\\r/g, '\\r').replace(/\\\\t/g, '\\t').replace(/\\\\b/g, '\\b').replace(/\\\\f/g, '\\f').replace(/\\\\{/g, '{').replace(/\\\\}/g, '}').replace(/\\\\\"/g, '\"').replace(/\\\\'/g, \"'\");\n }\n\n function parseProperties(text, parsedPropertiesCallback) {\n var dictionary = {};\n var reBlank = /^\\s*|\\s*$/;\n var reComment = /^\\s*#|^\\s*$/;\n var reSection = /^\\s*\\[(.*)\\]\\s*$/;\n var reImport = /^\\s*@import\\s+url\\((.*)\\)\\s*$/i;\n var reSplit = /^([^=\\s]*)\\s*=\\s*(.+)$/;\n\n function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) {\n var entries = rawText.replace(reBlank, '').split(/[\\r\\n]+/);\n var currentLang = '*';\n var genericLang = lang.split('-', 1)[0];\n var skipLang = false;\n var match = '';\n\n function nextEntry() {\n while (true) {\n if (!entries.length) {\n parsedRawLinesCallback();\n return;\n }\n\n var line = entries.shift();\n if (reComment.test(line)) continue;\n\n if (extendedSyntax) {\n match = reSection.exec(line);\n\n if (match) {\n currentLang = match[1].toLowerCase();\n skipLang = currentLang !== '*' && currentLang !== lang && currentLang !== genericLang;\n continue;\n } else if (skipLang) {\n continue;\n }\n\n match = reImport.exec(line);\n\n if (match) {\n loadImport(baseURL + match[1], nextEntry);\n return;\n }\n }\n\n var tmp = line.match(reSplit);\n\n if (tmp && tmp.length == 3) {\n dictionary[tmp[1]] = evalString(tmp[2]);\n }\n }\n }\n\n nextEntry();\n }\n\n function loadImport(url, callback) {\n xhrLoadText(url, function (content) {\n parseRawLines(content, false, callback);\n }, function () {\n console.warn(url + ' not found.');\n callback();\n });\n }\n\n parseRawLines(text, true, function () {\n parsedPropertiesCallback(dictionary);\n });\n }\n\n xhrLoadText(href, function (response) {\n gTextData += response;\n parseProperties(response, function (data) {\n for (var key in data) {\n var id,\n prop,\n index = key.lastIndexOf('.');\n\n if (index > 0) {\n id = key.substring(0, index);\n prop = key.substring(index + 1);\n } else {\n id = key;\n prop = gTextProp;\n }\n\n if (!gL10nData[id]) {\n gL10nData[id] = {};\n }\n\n gL10nData[id][prop] = data[key];\n }\n\n if (successCallback) {\n successCallback();\n }\n });\n }, failureCallback);\n }\n\n function loadLocale(lang, callback) {\n if (lang) {\n lang = lang.toLowerCase();\n }\n\n callback = callback || function _callback() {};\n\n clear();\n gLanguage = lang;\n var langLinks = getL10nResourceLinks();\n var langCount = langLinks.length;\n\n if (langCount === 0) {\n var dict = getL10nDictionary();\n\n if (dict && dict.locales && dict.default_locale) {\n console.log('using the embedded JSON directory, early way out');\n gL10nData = dict.locales[lang];\n\n if (!gL10nData) {\n var defaultLocale = dict.default_locale.toLowerCase();\n\n for (var anyCaseLang in dict.locales) {\n anyCaseLang = anyCaseLang.toLowerCase();\n\n if (anyCaseLang === lang) {\n gL10nData = dict.locales[lang];\n break;\n } else if (anyCaseLang === defaultLocale) {\n gL10nData = dict.locales[defaultLocale];\n }\n }\n }\n\n callback();\n } else {\n console.log('no resource to load, early way out');\n }\n\n gReadyState = 'complete';\n return;\n }\n\n var onResourceLoaded = null;\n var gResourceCount = 0;\n\n onResourceLoaded = function () {\n gResourceCount++;\n\n if (gResourceCount >= langCount) {\n callback();\n gReadyState = 'complete';\n }\n };\n\n function L10nResourceLink(link) {\n var href = link.href;\n\n this.load = function (lang, callback) {\n parseResource(href, lang, callback, function () {\n console.warn(href + ' not found.');\n console.warn('\"' + lang + '\" resource not found');\n gLanguage = '';\n callback();\n });\n };\n }\n\n for (var i = 0; i < langCount; i++) {\n var resource = new L10nResourceLink(langLinks[i]);\n resource.load(lang, onResourceLoaded);\n }\n }\n\n function clear() {\n gL10nData = {};\n gTextData = '';\n gLanguage = '';\n }\n\n function getPluralRules(lang) {\n var locales2rules = {\n 'af': 3,\n 'ak': 4,\n 'am': 4,\n 'ar': 1,\n 'asa': 3,\n 'az': 0,\n 'be': 11,\n 'bem': 3,\n 'bez': 3,\n 'bg': 3,\n 'bh': 4,\n 'bm': 0,\n 'bn': 3,\n 'bo': 0,\n 'br': 20,\n 'brx': 3,\n 'bs': 11,\n 'ca': 3,\n 'cgg': 3,\n 'chr': 3,\n 'cs': 12,\n 'cy': 17,\n 'da': 3,\n 'de': 3,\n 'dv': 3,\n 'dz': 0,\n 'ee': 3,\n 'el': 3,\n 'en': 3,\n 'eo': 3,\n 'es': 3,\n 'et': 3,\n 'eu': 3,\n 'fa': 0,\n 'ff': 5,\n 'fi': 3,\n 'fil': 4,\n 'fo': 3,\n 'fr': 5,\n 'fur': 3,\n 'fy': 3,\n 'ga': 8,\n 'gd': 24,\n 'gl': 3,\n 'gsw': 3,\n 'gu': 3,\n 'guw': 4,\n 'gv': 23,\n 'ha': 3,\n 'haw': 3,\n 'he': 2,\n 'hi': 4,\n 'hr': 11,\n 'hu': 0,\n 'id': 0,\n 'ig': 0,\n 'ii': 0,\n 'is': 3,\n 'it': 3,\n 'iu': 7,\n 'ja': 0,\n 'jmc': 3,\n 'jv': 0,\n 'ka': 0,\n 'kab': 5,\n 'kaj': 3,\n 'kcg': 3,\n 'kde': 0,\n 'kea': 0,\n 'kk': 3,\n 'kl': 3,\n 'km': 0,\n 'kn': 0,\n 'ko': 0,\n 'ksb': 3,\n 'ksh': 21,\n 'ku': 3,\n 'kw': 7,\n 'lag': 18,\n 'lb': 3,\n 'lg': 3,\n 'ln': 4,\n 'lo': 0,\n 'lt': 10,\n 'lv': 6,\n 'mas': 3,\n 'mg': 4,\n 'mk': 16,\n 'ml': 3,\n 'mn': 3,\n 'mo': 9,\n 'mr': 3,\n 'ms': 0,\n 'mt': 15,\n 'my': 0,\n 'nah': 3,\n 'naq': 7,\n 'nb': 3,\n 'nd': 3,\n 'ne': 3,\n 'nl': 3,\n 'nn': 3,\n 'no': 3,\n 'nr': 3,\n 'nso': 4,\n 'ny': 3,\n 'nyn': 3,\n 'om': 3,\n 'or': 3,\n 'pa': 3,\n 'pap': 3,\n 'pl': 13,\n 'ps': 3,\n 'pt': 3,\n 'rm': 3,\n 'ro': 9,\n 'rof': 3,\n 'ru': 11,\n 'rwk': 3,\n 'sah': 0,\n 'saq': 3,\n 'se': 7,\n 'seh': 3,\n 'ses': 0,\n 'sg': 0,\n 'sh': 11,\n 'shi': 19,\n 'sk': 12,\n 'sl': 14,\n 'sma': 7,\n 'smi': 7,\n 'smj': 7,\n 'smn': 7,\n 'sms': 7,\n 'sn': 3,\n 'so': 3,\n 'sq': 3,\n 'sr': 11,\n 'ss': 3,\n 'ssy': 3,\n 'st': 3,\n 'sv': 3,\n 'sw': 3,\n 'syr': 3,\n 'ta': 3,\n 'te': 3,\n 'teo': 3,\n 'th': 0,\n 'ti': 4,\n 'tig': 3,\n 'tk': 3,\n 'tl': 4,\n 'tn': 3,\n 'to': 0,\n 'tr': 0,\n 'ts': 3,\n 'tzm': 22,\n 'uk': 11,\n 'ur': 3,\n 've': 3,\n 'vi': 0,\n 'vun': 3,\n 'wa': 4,\n 'wae': 3,\n 'wo': 0,\n 'xh': 3,\n 'xog': 3,\n 'yo': 0,\n 'zh': 0,\n 'zu': 3\n };\n\n function isIn(n, list) {\n return list.indexOf(n) !== -1;\n }\n\n function isBetween(n, start, end) {\n return start <= n && n <= end;\n }\n\n var pluralRules = {\n '0': function (n) {\n return 'other';\n },\n '1': function (n) {\n if (isBetween(n % 100, 3, 10)) return 'few';\n if (n === 0) return 'zero';\n if (isBetween(n % 100, 11, 99)) return 'many';\n if (n == 2) return 'two';\n if (n == 1) return 'one';\n return 'other';\n },\n '2': function (n) {\n if (n !== 0 && n % 10 === 0) return 'many';\n if (n == 2) return 'two';\n if (n == 1) return 'one';\n return 'other';\n },\n '3': function (n) {\n if (n == 1) return 'one';\n return 'other';\n },\n '4': function (n) {\n if (isBetween(n, 0, 1)) return 'one';\n return 'other';\n },\n '5': function (n) {\n if (isBetween(n, 0, 2) && n != 2) return 'one';\n return 'other';\n },\n '6': function (n) {\n if (n === 0) return 'zero';\n if (n % 10 == 1 && n % 100 != 11) return 'one';\n return 'other';\n },\n '7': function (n) {\n if (n == 2) return 'two';\n if (n == 1) return 'one';\n return 'other';\n },\n '8': function (n) {\n if (isBetween(n, 3, 6)) return 'few';\n if (isBetween(n, 7, 10)) return 'many';\n if (n == 2) return 'two';\n if (n == 1) return 'one';\n return 'other';\n },\n '9': function (n) {\n if (n === 0 || n != 1 && isBetween(n % 100, 1, 19)) return 'few';\n if (n == 1) return 'one';\n return 'other';\n },\n '10': function (n) {\n if (isBetween(n % 10, 2, 9) && !isBetween(n % 100, 11, 19)) return 'few';\n if (n % 10 == 1 && !isBetween(n % 100, 11, 19)) return 'one';\n return 'other';\n },\n '11': function (n) {\n if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few';\n if (n % 10 === 0 || isBetween(n % 10, 5, 9) || isBetween(n % 100, 11, 14)) return 'many';\n if (n % 10 == 1 && n % 100 != 11) return 'one';\n return 'other';\n },\n '12': function (n) {\n if (isBetween(n, 2, 4)) return 'few';\n if (n == 1) return 'one';\n return 'other';\n },\n '13': function (n) {\n if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few';\n if (n != 1 && isBetween(n % 10, 0, 1) || isBetween(n % 10, 5, 9) || isBetween(n % 100, 12, 14)) return 'many';\n if (n == 1) return 'one';\n return 'other';\n },\n '14': function (n) {\n if (isBetween(n % 100, 3, 4)) return 'few';\n if (n % 100 == 2) return 'two';\n if (n % 100 == 1) return 'one';\n return 'other';\n },\n '15': function (n) {\n if (n === 0 || isBetween(n % 100, 2, 10)) return 'few';\n if (isBetween(n % 100, 11, 19)) return 'many';\n if (n == 1) return 'one';\n return 'other';\n },\n '16': function (n) {\n if (n % 10 == 1 && n != 11) return 'one';\n return 'other';\n },\n '17': function (n) {\n if (n == 3) return 'few';\n if (n === 0) return 'zero';\n if (n == 6) return 'many';\n if (n == 2) return 'two';\n if (n == 1) return 'one';\n return 'other';\n },\n '18': function (n) {\n if (n === 0) return 'zero';\n if (isBetween(n, 0, 2) && n !== 0 && n != 2) return 'one';\n return 'other';\n },\n '19': function (n) {\n if (isBetween(n, 2, 10)) return 'few';\n if (isBetween(n, 0, 1)) return 'one';\n return 'other';\n },\n '20': function (n) {\n if ((isBetween(n % 10, 3, 4) || n % 10 == 9) && !(isBetween(n % 100, 10, 19) || isBetween(n % 100, 70, 79) || isBetween(n % 100, 90, 99))) return 'few';\n if (n % 1000000 === 0 && n !== 0) return 'many';\n if (n % 10 == 2 && !isIn(n % 100, [12, 72, 92])) return 'two';\n if (n % 10 == 1 && !isIn(n % 100, [11, 71, 91])) return 'one';\n return 'other';\n },\n '21': function (n) {\n if (n === 0) return 'zero';\n if (n == 1) return 'one';\n return 'other';\n },\n '22': function (n) {\n if (isBetween(n, 0, 1) || isBetween(n, 11, 99)) return 'one';\n return 'other';\n },\n '23': function (n) {\n if (isBetween(n % 10, 1, 2) || n % 20 === 0) return 'one';\n return 'other';\n },\n '24': function (n) {\n if (isBetween(n, 3, 10) || isBetween(n, 13, 19)) return 'few';\n if (isIn(n, [2, 12])) return 'two';\n if (isIn(n, [1, 11])) return 'one';\n return 'other';\n }\n };\n var index = locales2rules[lang.replace(/-.*$/, '')];\n\n if (!(index in pluralRules)) {\n console.warn('plural form unknown for [' + lang + ']');\n return function () {\n return 'other';\n };\n }\n\n return pluralRules[index];\n }\n\n gMacros.plural = function (str, param, key, prop) {\n var n = parseFloat(param);\n if (isNaN(n)) return str;\n if (prop != gTextProp) return str;\n\n if (!gMacros._pluralRules) {\n gMacros._pluralRules = getPluralRules(gLanguage);\n }\n\n var index = '[' + gMacros._pluralRules(n) + ']';\n\n if (n === 0 && key + '[zero]' in gL10nData) {\n str = gL10nData[key + '[zero]'][prop];\n } else if (n == 1 && key + '[one]' in gL10nData) {\n str = gL10nData[key + '[one]'][prop];\n } else if (n == 2 && key + '[two]' in gL10nData) {\n str = gL10nData[key + '[two]'][prop];\n } else if (key + index in gL10nData) {\n str = gL10nData[key + index][prop];\n } else if (key + '[other]' in gL10nData) {\n str = gL10nData[key + '[other]'][prop];\n }\n\n return str;\n };\n\n function getL10nData(key, args, fallback) {\n var data = gL10nData[key];\n\n if (!data) {\n console.warn('#' + key + ' is undefined.');\n\n if (!fallback) {\n return null;\n }\n\n data = fallback;\n }\n\n var rv = {};\n\n for (var prop in data) {\n var str = data[prop];\n str = substIndexes(str, args, key, prop);\n str = substArguments(str, args, key);\n rv[prop] = str;\n }\n\n return rv;\n }\n\n function substIndexes(str, args, key, prop) {\n var reIndex = /\\{\\[\\s*([a-zA-Z]+)\\(([a-zA-Z]+)\\)\\s*\\]\\}/;\n var reMatch = reIndex.exec(str);\n if (!reMatch || !reMatch.length) return str;\n var macroName = reMatch[1];\n var paramName = reMatch[2];\n var param;\n\n if (args && paramName in args) {\n param = args[paramName];\n } else if (paramName in gL10nData) {\n param = gL10nData[paramName];\n }\n\n if (macroName in gMacros) {\n var macro = gMacros[macroName];\n str = macro(str, param, key, prop);\n }\n\n return str;\n }\n\n function substArguments(str, args, key) {\n var reArgs = /\\{\\{\\s*(.+?)\\s*\\}\\}/g;\n return str.replace(reArgs, function (matched_text, arg) {\n if (args && arg in args) {\n return args[arg];\n }\n\n if (arg in gL10nData) {\n return gL10nData[arg];\n }\n\n console.log('argument {{' + arg + '}} for #' + key + ' is undefined.');\n return matched_text;\n });\n }\n\n function translateElement(element) {\n var l10n = getL10nAttributes(element);\n if (!l10n.id) return;\n var data = getL10nData(l10n.id, l10n.args);\n\n if (!data) {\n console.warn('#' + l10n.id + ' is undefined.');\n return;\n }\n\n if (data[gTextProp]) {\n if (getChildElementCount(element) === 0) {\n element[gTextProp] = data[gTextProp];\n } else {\n var children = element.childNodes;\n var found = false;\n\n for (var i = 0, l = children.length; i < l; i++) {\n if (children[i].nodeType === 3 && /\\S/.test(children[i].nodeValue)) {\n if (found) {\n children[i].nodeValue = '';\n } else {\n children[i].nodeValue = data[gTextProp];\n found = true;\n }\n }\n }\n\n if (!found) {\n var textNode = document.createTextNode(data[gTextProp]);\n element.prepend(textNode);\n }\n }\n\n delete data[gTextProp];\n }\n\n for (var k in data) {\n element[k] = data[k];\n }\n }\n\n function getChildElementCount(element) {\n if (element.children) {\n return element.children.length;\n }\n\n if (typeof element.childElementCount !== 'undefined') {\n return element.childElementCount;\n }\n\n var count = 0;\n\n for (var i = 0; i < element.childNodes.length; i++) {\n count += element.nodeType === 1 ? 1 : 0;\n }\n\n return count;\n }\n\n function translateFragment(element) {\n element = element || document.documentElement;\n var children = getTranslatableChildren(element);\n var elementCount = children.length;\n\n for (var i = 0; i < elementCount; i++) {\n translateElement(children[i]);\n }\n\n translateElement(element);\n }\n\n return {\n get: function (key, args, fallbackString) {\n var index = key.lastIndexOf('.');\n var prop = gTextProp;\n\n if (index > 0) {\n prop = key.substring(index + 1);\n key = key.substring(0, index);\n }\n\n var fallback;\n\n if (fallbackString) {\n fallback = {};\n fallback[prop] = fallbackString;\n }\n\n var data = getL10nData(key, args, fallback);\n\n if (data && prop in data) {\n return data[prop];\n }\n\n return '{{' + key + '}}';\n },\n getData: function () {\n return gL10nData;\n },\n getText: function () {\n return gTextData;\n },\n getLanguage: function () {\n return gLanguage;\n },\n setLanguage: function (lang, callback) {\n loadLocale(lang, function () {\n if (callback) callback();\n });\n },\n getDirection: function () {\n var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];\n var shortCode = gLanguage.split('-', 1)[0];\n return rtlList.indexOf(shortCode) >= 0 ? 'rtl' : 'ltr';\n },\n translate: translateFragment,\n getReadyState: function () {\n return gReadyState;\n },\n ready: function (callback) {\n if (!callback) {\n return;\n } else if (gReadyState == 'complete' || gReadyState == 'interactive') {\n window.setTimeout(function () {\n callback();\n });\n } else if (document.addEventListener) {\n document.addEventListener('localized', function once() {\n document.removeEventListener('localized', once);\n callback();\n });\n }\n }\n };\n}(window, document);\n\n/***/ }),\n/* 22 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFFindController = exports.FindState = void 0;\n\nvar _ui_utils = __w_pdfjs_require__(7);\n\nvar _pdfjsLib = __w_pdfjs_require__(3);\n\nvar _pdf_find_utils = __w_pdfjs_require__(23);\n\nconst FindState = {\n FOUND: 0,\n NOT_FOUND: 1,\n WRAPPED: 2,\n PENDING: 3\n};\nexports.FindState = FindState;\nconst FIND_TIMEOUT = 250;\nconst MATCH_SCROLL_OFFSET_TOP = -50;\nconst MATCH_SCROLL_OFFSET_LEFT = -400;\nconst CHARACTERS_TO_NORMALIZE = {\n \"\\u2010\": \"-\",\n \"\\u2018\": \"'\",\n \"\\u2019\": \"'\",\n \"\\u201A\": \"'\",\n \"\\u201B\": \"'\",\n \"\\u201C\": '\"',\n \"\\u201D\": '\"',\n \"\\u201E\": '\"',\n \"\\u201F\": '\"',\n \"\\u00BC\": \"1/4\",\n \"\\u00BD\": \"1/2\",\n \"\\u00BE\": \"3/4\"\n};\nconst DIACRITICS_EXCEPTION = new Set([0x3099, 0x309a, 0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b, 0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714, 0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f, 0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed, 0x0c56, 0x0f71, 0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80, 0x0f74]);\nconst DIACRITICS_EXCEPTION_STR = [...DIACRITICS_EXCEPTION.values()].map(x => String.fromCharCode(x)).join(\"\");\nconst DIACRITICS_REG_EXP = /\\p{M}+/gu;\nconst SPECIAL_CHARS_REG_EXP = /([.*+?^${}()|[\\]\\\\])|(\\p{P})|(\\s+)|(\\p{M})|(\\p{L})/gu;\nconst NOT_DIACRITIC_FROM_END_REG_EXP = /([^\\p{M}])\\p{M}*$/u;\nconst NOT_DIACRITIC_FROM_START_REG_EXP = /^\\p{M}*([^\\p{M}])/u;\nconst SYLLABLES_REG_EXP = /[\\uAC00-\\uD7AF\\uFA6C\\uFACF-\\uFAD1\\uFAD5-\\uFAD7]+/g;\nconst SYLLABLES_LENGTHS = new Map();\nconst FIRST_CHAR_SYLLABLES_REG_EXP = \"[\\\\u1100-\\\\u1112\\\\ud7a4-\\\\ud7af\\\\ud84a\\\\ud84c\\\\ud850\\\\ud854\\\\ud857\\\\ud85f]\";\nlet noSyllablesRegExp = null;\nlet withSyllablesRegExp = null;\n\nfunction normalize(text) {\n const syllablePositions = [];\n let m;\n\n while ((m = SYLLABLES_REG_EXP.exec(text)) !== null) {\n let {\n index\n } = m;\n\n for (const char of m[0]) {\n let len = SYLLABLES_LENGTHS.get(char);\n\n if (!len) {\n len = char.normalize(\"NFD\").length;\n SYLLABLES_LENGTHS.set(char, len);\n }\n\n syllablePositions.push([len, index++]);\n }\n }\n\n let normalizationRegex;\n\n if (syllablePositions.length === 0 && noSyllablesRegExp) {\n normalizationRegex = noSyllablesRegExp;\n } else if (syllablePositions.length > 0 && withSyllablesRegExp) {\n normalizationRegex = withSyllablesRegExp;\n } else {\n const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join(\"\");\n const regexp = `([${replace}])|(\\\\p{M}+(?:-\\\\n)?)|(\\\\S-\\\\n)|(\\\\n)`;\n\n if (syllablePositions.length === 0) {\n normalizationRegex = noSyllablesRegExp = new RegExp(regexp + \"|(\\\\u0000)\", \"gum\");\n } else {\n normalizationRegex = withSyllablesRegExp = new RegExp(regexp + `|(${FIRST_CHAR_SYLLABLES_REG_EXP})`, \"gum\");\n }\n }\n\n const rawDiacriticsPositions = [];\n\n while ((m = DIACRITICS_REG_EXP.exec(text)) !== null) {\n rawDiacriticsPositions.push([m[0].length, m.index]);\n }\n\n let normalized = text.normalize(\"NFD\");\n const positions = [[0, 0]];\n let rawDiacriticsIndex = 0;\n let syllableIndex = 0;\n let shift = 0;\n let shiftOrigin = 0;\n let eol = 0;\n let hasDiacritics = false;\n normalized = normalized.replace(normalizationRegex, (match, p1, p2, p3, p4, p5, i) => {\n i -= shiftOrigin;\n\n if (p1) {\n const replacement = CHARACTERS_TO_NORMALIZE[match];\n const jj = replacement.length;\n\n for (let j = 1; j < jj; j++) {\n positions.push([i - shift + j, shift - j]);\n }\n\n shift -= jj - 1;\n return replacement;\n }\n\n if (p2) {\n const hasTrailingDashEOL = p2.endsWith(\"\\n\");\n const len = hasTrailingDashEOL ? p2.length - 2 : p2.length;\n hasDiacritics = true;\n let jj = len;\n\n if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) {\n jj -= rawDiacriticsPositions[rawDiacriticsIndex][0];\n ++rawDiacriticsIndex;\n }\n\n for (let j = 1; j <= jj; j++) {\n positions.push([i - 1 - shift + j, shift - j]);\n }\n\n shift -= jj;\n shiftOrigin += jj;\n\n if (hasTrailingDashEOL) {\n i += len - 1;\n positions.push([i - shift + 1, 1 + shift]);\n shift += 1;\n shiftOrigin += 1;\n eol += 1;\n return p2.slice(0, len);\n }\n\n return p2;\n }\n\n if (p3) {\n positions.push([i - shift + 1, 1 + shift]);\n shift += 1;\n shiftOrigin += 1;\n eol += 1;\n return p3.charAt(0);\n }\n\n if (p4) {\n positions.push([i - shift + 1, shift - 1]);\n shift -= 1;\n shiftOrigin += 1;\n eol += 1;\n return \" \";\n }\n\n if (i + eol === syllablePositions[syllableIndex]?.[1]) {\n const newCharLen = syllablePositions[syllableIndex][0] - 1;\n ++syllableIndex;\n\n for (let j = 1; j <= newCharLen; j++) {\n positions.push([i - (shift - j), shift - j]);\n }\n\n shift -= newCharLen;\n shiftOrigin += newCharLen;\n }\n\n return p5;\n });\n positions.push([normalized.length, shift]);\n return [normalized, positions, hasDiacritics];\n}\n\nfunction getOriginalIndex(diffs, pos, len) {\n if (!diffs) {\n return [pos, len];\n }\n\n const start = pos;\n const end = pos + len;\n let i = (0, _ui_utils.binarySearchFirstItem)(diffs, x => x[0] >= start);\n\n if (diffs[i][0] > start) {\n --i;\n }\n\n let j = (0, _ui_utils.binarySearchFirstItem)(diffs, x => x[0] >= end, i);\n\n if (diffs[j][0] > end) {\n --j;\n }\n\n return [start + diffs[i][1], len + diffs[j][1] - diffs[i][1]];\n}\n\nclass PDFFindController {\n constructor({\n linkService,\n eventBus\n }) {\n this._linkService = linkService;\n this._eventBus = eventBus;\n this.#reset();\n\n eventBus._on(\"find\", this.#onFind.bind(this));\n\n eventBus._on(\"findbarclose\", this.#onFindBarClose.bind(this));\n }\n\n get highlightMatches() {\n return this._highlightMatches;\n }\n\n get pageMatches() {\n return this._pageMatches;\n }\n\n get pageMatchesLength() {\n return this._pageMatchesLength;\n }\n\n get selected() {\n return this._selected;\n }\n\n get state() {\n return this._state;\n }\n\n setDocument(pdfDocument) {\n if (this._pdfDocument) {\n this.#reset();\n }\n\n if (!pdfDocument) {\n return;\n }\n\n this._pdfDocument = pdfDocument;\n\n this._firstPageCapability.resolve();\n }\n\n #onFind(state) {\n if (!state) {\n return;\n }\n\n const pdfDocument = this._pdfDocument;\n const {\n type\n } = state;\n\n if (this._state === null || this.#shouldDirtyMatch(state)) {\n this._dirtyMatch = true;\n }\n\n this._state = state;\n\n if (type !== \"highlightallchange\") {\n this.#updateUIState(FindState.PENDING);\n }\n\n this._firstPageCapability.promise.then(() => {\n if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) {\n return;\n }\n\n this.#extractText();\n const findbarClosed = !this._highlightMatches;\n const pendingTimeout = !!this._findTimeout;\n\n if (this._findTimeout) {\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n }\n\n if (!type) {\n this._findTimeout = setTimeout(() => {\n this.#nextMatch();\n this._findTimeout = null;\n }, FIND_TIMEOUT);\n } else if (this._dirtyMatch) {\n this.#nextMatch();\n } else if (type === \"again\") {\n this.#nextMatch();\n\n if (findbarClosed && this._state.highlightAll) {\n this.#updateAllPages();\n }\n } else if (type === \"highlightallchange\") {\n if (pendingTimeout) {\n this.#nextMatch();\n } else {\n this._highlightMatches = true;\n }\n\n this.#updateAllPages();\n } else {\n this.#nextMatch();\n }\n });\n }\n\n scrollMatchIntoView({\n element = null,\n selectedLeft = 0,\n pageIndex = -1,\n matchIndex = -1\n }) {\n if (!this._scrollMatches || !element) {\n return;\n } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) {\n return;\n } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) {\n return;\n }\n\n this._scrollMatches = false;\n const spot = {\n top: MATCH_SCROLL_OFFSET_TOP,\n left: selectedLeft + MATCH_SCROLL_OFFSET_LEFT\n };\n (0, _ui_utils.scrollIntoView)(element, spot, true);\n }\n\n #reset() {\n this._highlightMatches = false;\n this._scrollMatches = false;\n this._pdfDocument = null;\n this._pageMatches = [];\n this._pageMatchesLength = [];\n this._state = null;\n this._selected = {\n pageIdx: -1,\n matchIdx: -1\n };\n this._offset = {\n pageIdx: null,\n matchIdx: null,\n wrapped: false\n };\n this._extractTextPromises = [];\n this._pageContents = [];\n this._pageDiffs = [];\n this._hasDiacritics = [];\n this._matchesCountTotal = 0;\n this._pagesToSearch = null;\n this._pendingFindMatches = new Set();\n this._resumePageIdx = null;\n this._dirtyMatch = false;\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)();\n }\n\n get #query() {\n if (this._state.query !== this._rawQuery) {\n this._rawQuery = this._state.query;\n [this._normalizedQuery] = normalize(this._state.query);\n }\n\n return this._normalizedQuery;\n }\n\n #shouldDirtyMatch(state) {\n if (state.query !== this._state.query) {\n return true;\n }\n\n switch (state.type) {\n case \"again\":\n const pageNumber = this._selected.pageIdx + 1;\n const linkService = this._linkService;\n\n if (pageNumber >= 1 && pageNumber <= linkService.pagesCount && pageNumber !== linkService.page && !linkService.isPageVisible(pageNumber)) {\n return true;\n }\n\n return false;\n\n case \"highlightallchange\":\n return false;\n }\n\n return true;\n }\n\n #isEntireWord(content, startIdx, length) {\n let match = content.slice(0, startIdx).match(NOT_DIACRITIC_FROM_END_REG_EXP);\n\n if (match) {\n const first = content.charCodeAt(startIdx);\n const limit = match[1].charCodeAt(0);\n\n if ((0, _pdf_find_utils.getCharacterType)(first) === (0, _pdf_find_utils.getCharacterType)(limit)) {\n return false;\n }\n }\n\n match = content.slice(startIdx + length).match(NOT_DIACRITIC_FROM_START_REG_EXP);\n\n if (match) {\n const last = content.charCodeAt(startIdx + length - 1);\n const limit = match[1].charCodeAt(0);\n\n if ((0, _pdf_find_utils.getCharacterType)(last) === (0, _pdf_find_utils.getCharacterType)(limit)) {\n return false;\n }\n }\n\n return true;\n }\n\n #calculateRegExpMatch(query, entireWord, pageIndex, pageContent) {\n const matches = [],\n matchesLength = [];\n const diffs = this._pageDiffs[pageIndex];\n let match;\n\n while ((match = query.exec(pageContent)) !== null) {\n if (entireWord && !this.#isEntireWord(pageContent, match.index, match[0].length)) {\n continue;\n }\n\n const [matchPos, matchLen] = getOriginalIndex(diffs, match.index, match[0].length);\n\n if (matchLen) {\n matches.push(matchPos);\n matchesLength.push(matchLen);\n }\n }\n\n this._pageMatches[pageIndex] = matches;\n this._pageMatchesLength[pageIndex] = matchesLength;\n }\n\n #convertToRegExpString(query, hasDiacritics) {\n const {\n matchDiacritics\n } = this._state;\n let isUnicode = false;\n query = query.replace(SPECIAL_CHARS_REG_EXP, (match, p1, p2, p3, p4, p5) => {\n if (p1) {\n return `[ ]*\\\\${p1}[ ]*`;\n }\n\n if (p2) {\n return `[ ]*${p2}[ ]*`;\n }\n\n if (p3) {\n return \"[ ]+\";\n }\n\n if (matchDiacritics) {\n return p4 || p5;\n }\n\n if (p4) {\n return DIACRITICS_EXCEPTION.has(p4.charCodeAt(0)) ? p4 : \"\";\n }\n\n if (hasDiacritics) {\n isUnicode = true;\n return `${p5}\\\\p{M}*`;\n }\n\n return p5;\n });\n const trailingSpaces = \"[ ]*\";\n\n if (query.endsWith(trailingSpaces)) {\n query = query.slice(0, query.length - trailingSpaces.length);\n }\n\n if (matchDiacritics) {\n if (hasDiacritics) {\n isUnicode = true;\n query = `${query}(?=[${DIACRITICS_EXCEPTION_STR}]|[^\\\\p{M}]|$)`;\n }\n }\n\n return [isUnicode, query];\n }\n\n #calculateMatch(pageIndex) {\n let query = this.#query;\n\n if (query.length === 0) {\n return;\n }\n\n const {\n caseSensitive,\n entireWord,\n phraseSearch\n } = this._state;\n const pageContent = this._pageContents[pageIndex];\n const hasDiacritics = this._hasDiacritics[pageIndex];\n let isUnicode = false;\n\n if (phraseSearch) {\n [isUnicode, query] = this.#convertToRegExpString(query, hasDiacritics);\n } else {\n const match = query.match(/\\S+/g);\n\n if (match) {\n query = match.sort().reverse().map(q => {\n const [isUnicodePart, queryPart] = this.#convertToRegExpString(q, hasDiacritics);\n isUnicode ||= isUnicodePart;\n return `(${queryPart})`;\n }).join(\"|\");\n }\n }\n\n const flags = `g${isUnicode ? \"u\" : \"\"}${caseSensitive ? \"\" : \"i\"}`;\n query = new RegExp(query, flags);\n this.#calculateRegExpMatch(query, entireWord, pageIndex, pageContent);\n\n if (this._state.highlightAll) {\n this.#updatePage(pageIndex);\n }\n\n if (this._resumePageIdx === pageIndex) {\n this._resumePageIdx = null;\n this.#nextPageMatch();\n }\n\n const pageMatchesCount = this._pageMatches[pageIndex].length;\n\n if (pageMatchesCount > 0) {\n this._matchesCountTotal += pageMatchesCount;\n this.#updateUIResultsCount();\n }\n }\n\n #extractText() {\n if (this._extractTextPromises.length > 0) {\n return;\n }\n\n let promise = Promise.resolve();\n\n for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {\n const extractTextCapability = (0, _pdfjsLib.createPromiseCapability)();\n this._extractTextPromises[i] = extractTextCapability.promise;\n promise = promise.then(() => {\n return this._pdfDocument.getPage(i + 1).then(pdfPage => {\n return pdfPage.getTextContent();\n }).then(textContent => {\n const strBuf = [];\n\n for (const textItem of textContent.items) {\n strBuf.push(textItem.str);\n\n if (textItem.hasEOL) {\n strBuf.push(\"\\n\");\n }\n }\n\n [this._pageContents[i], this._pageDiffs[i], this._hasDiacritics[i]] = normalize(strBuf.join(\"\"));\n extractTextCapability.resolve();\n }, reason => {\n console.error(`Unable to get text content for page ${i + 1}`, reason);\n this._pageContents[i] = \"\";\n this._pageDiffs[i] = null;\n this._hasDiacritics[i] = false;\n extractTextCapability.resolve();\n });\n });\n }\n }\n\n #updatePage(index) {\n if (this._scrollMatches && this._selected.pageIdx === index) {\n this._linkService.page = index + 1;\n }\n\n this._eventBus.dispatch(\"updatetextlayermatches\", {\n source: this,\n pageIndex: index\n });\n }\n\n #updateAllPages() {\n this._eventBus.dispatch(\"updatetextlayermatches\", {\n source: this,\n pageIndex: -1\n });\n }\n\n #nextMatch() {\n const previous = this._state.findPrevious;\n const currentPageIndex = this._linkService.page - 1;\n const numPages = this._linkService.pagesCount;\n this._highlightMatches = true;\n\n if (this._dirtyMatch) {\n this._dirtyMatch = false;\n this._selected.pageIdx = this._selected.matchIdx = -1;\n this._offset.pageIdx = currentPageIndex;\n this._offset.matchIdx = null;\n this._offset.wrapped = false;\n this._resumePageIdx = null;\n this._pageMatches.length = 0;\n this._pageMatchesLength.length = 0;\n this._matchesCountTotal = 0;\n this.#updateAllPages();\n\n for (let i = 0; i < numPages; i++) {\n if (this._pendingFindMatches.has(i)) {\n continue;\n }\n\n this._pendingFindMatches.add(i);\n\n this._extractTextPromises[i].then(() => {\n this._pendingFindMatches.delete(i);\n\n this.#calculateMatch(i);\n });\n }\n }\n\n if (this.#query === \"\") {\n this.#updateUIState(FindState.FOUND);\n return;\n }\n\n if (this._resumePageIdx) {\n return;\n }\n\n const offset = this._offset;\n this._pagesToSearch = numPages;\n\n if (offset.matchIdx !== null) {\n const numPageMatches = this._pageMatches[offset.pageIdx].length;\n\n if (!previous && offset.matchIdx + 1 < numPageMatches || previous && offset.matchIdx > 0) {\n offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1;\n this.#updateMatch(true);\n return;\n }\n\n this.#advanceOffsetPage(previous);\n }\n\n this.#nextPageMatch();\n }\n\n #matchesReady(matches) {\n const offset = this._offset;\n const numMatches = matches.length;\n const previous = this._state.findPrevious;\n\n if (numMatches) {\n offset.matchIdx = previous ? numMatches - 1 : 0;\n this.#updateMatch(true);\n return true;\n }\n\n this.#advanceOffsetPage(previous);\n\n if (offset.wrapped) {\n offset.matchIdx = null;\n\n if (this._pagesToSearch < 0) {\n this.#updateMatch(false);\n return true;\n }\n }\n\n return false;\n }\n\n #nextPageMatch() {\n if (this._resumePageIdx !== null) {\n console.error(\"There can only be one pending page.\");\n }\n\n let matches = null;\n\n do {\n const pageIdx = this._offset.pageIdx;\n matches = this._pageMatches[pageIdx];\n\n if (!matches) {\n this._resumePageIdx = pageIdx;\n break;\n }\n } while (!this.#matchesReady(matches));\n }\n\n #advanceOffsetPage(previous) {\n const offset = this._offset;\n const numPages = this._linkService.pagesCount;\n offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1;\n offset.matchIdx = null;\n this._pagesToSearch--;\n\n if (offset.pageIdx >= numPages || offset.pageIdx < 0) {\n offset.pageIdx = previous ? numPages - 1 : 0;\n offset.wrapped = true;\n }\n }\n\n #updateMatch(found = false) {\n let state = FindState.NOT_FOUND;\n const wrapped = this._offset.wrapped;\n this._offset.wrapped = false;\n\n if (found) {\n const previousPage = this._selected.pageIdx;\n this._selected.pageIdx = this._offset.pageIdx;\n this._selected.matchIdx = this._offset.matchIdx;\n state = wrapped ? FindState.WRAPPED : FindState.FOUND;\n\n if (previousPage !== -1 && previousPage !== this._selected.pageIdx) {\n this.#updatePage(previousPage);\n }\n }\n\n this.#updateUIState(state, this._state.findPrevious);\n\n if (this._selected.pageIdx !== -1) {\n this._scrollMatches = true;\n this.#updatePage(this._selected.pageIdx);\n }\n }\n\n #onFindBarClose(evt) {\n const pdfDocument = this._pdfDocument;\n\n this._firstPageCapability.promise.then(() => {\n if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) {\n return;\n }\n\n if (this._findTimeout) {\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n }\n\n if (this._resumePageIdx) {\n this._resumePageIdx = null;\n this._dirtyMatch = true;\n }\n\n this.#updateUIState(FindState.FOUND);\n this._highlightMatches = false;\n this.#updateAllPages();\n });\n }\n\n #requestMatchesCount() {\n const {\n pageIdx,\n matchIdx\n } = this._selected;\n let current = 0,\n total = this._matchesCountTotal;\n\n if (matchIdx !== -1) {\n for (let i = 0; i < pageIdx; i++) {\n current += this._pageMatches[i]?.length || 0;\n }\n\n current += matchIdx + 1;\n }\n\n if (current < 1 || current > total) {\n current = total = 0;\n }\n\n return {\n current,\n total\n };\n }\n\n #updateUIResultsCount() {\n this._eventBus.dispatch(\"updatefindmatchescount\", {\n source: this,\n matchesCount: this.#requestMatchesCount()\n });\n }\n\n #updateUIState(state, previous = false) {\n this._eventBus.dispatch(\"updatefindcontrolstate\", {\n source: this,\n state,\n previous,\n matchesCount: this.#requestMatchesCount(),\n rawQuery: this._state?.query ?? null\n });\n }\n\n}\n\nexports.PDFFindController = PDFFindController;\n\n/***/ }),\n/* 23 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.CharacterType = void 0;\nexports.getCharacterType = getCharacterType;\nconst CharacterType = {\n SPACE: 0,\n ALPHA_LETTER: 1,\n PUNCT: 2,\n HAN_LETTER: 3,\n KATAKANA_LETTER: 4,\n HIRAGANA_LETTER: 5,\n HALFWIDTH_KATAKANA_LETTER: 6,\n THAI_LETTER: 7\n};\nexports.CharacterType = CharacterType;\n\nfunction isAlphabeticalScript(charCode) {\n return charCode < 0x2e80;\n}\n\nfunction isAscii(charCode) {\n return (charCode & 0xff80) === 0;\n}\n\nfunction isAsciiAlpha(charCode) {\n return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a;\n}\n\nfunction isAsciiDigit(charCode) {\n return charCode >= 0x30 && charCode <= 0x39;\n}\n\nfunction isAsciiSpace(charCode) {\n return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a;\n}\n\nfunction isHan(charCode) {\n return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff;\n}\n\nfunction isKatakana(charCode) {\n return charCode >= 0x30a0 && charCode <= 0x30ff;\n}\n\nfunction isHiragana(charCode) {\n return charCode >= 0x3040 && charCode <= 0x309f;\n}\n\nfunction isHalfwidthKatakana(charCode) {\n return charCode >= 0xff60 && charCode <= 0xff9f;\n}\n\nfunction isThai(charCode) {\n return (charCode & 0xff80) === 0x0e00;\n}\n\nfunction getCharacterType(charCode) {\n if (isAlphabeticalScript(charCode)) {\n if (isAscii(charCode)) {\n if (isAsciiSpace(charCode)) {\n return CharacterType.SPACE;\n } else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) {\n return CharacterType.ALPHA_LETTER;\n }\n\n return CharacterType.PUNCT;\n } else if (isThai(charCode)) {\n return CharacterType.THAI_LETTER;\n } else if (charCode === 0xa0) {\n return CharacterType.SPACE;\n }\n\n return CharacterType.ALPHA_LETTER;\n }\n\n if (isHan(charCode)) {\n return CharacterType.HAN_LETTER;\n } else if (isKatakana(charCode)) {\n return CharacterType.KATAKANA_LETTER;\n } else if (isHiragana(charCode)) {\n return CharacterType.HIRAGANA_LETTER;\n } else if (isHalfwidthKatakana(charCode)) {\n return CharacterType.HALFWIDTH_KATAKANA_LETTER;\n }\n\n return CharacterType.ALPHA_LETTER;\n}\n\n/***/ }),\n/* 24 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFHistory = void 0;\nexports.isDestArraysEqual = isDestArraysEqual;\nexports.isDestHashesEqual = isDestHashesEqual;\n\nvar _ui_utils = __w_pdfjs_require__(7);\n\nvar _event_utils = __w_pdfjs_require__(19);\n\nconst HASH_CHANGE_TIMEOUT = 1000;\nconst POSITION_UPDATED_THRESHOLD = 50;\nconst UPDATE_VIEWAREA_TIMEOUT = 1000;\n\nfunction getCurrentHash() {\n return document.location.hash;\n}\n\nclass PDFHistory {\n constructor({\n linkService,\n eventBus\n }) {\n this.linkService = linkService;\n this.eventBus = eventBus;\n this._initialized = false;\n this._fingerprint = \"\";\n this.reset();\n this._boundEvents = null;\n\n this.eventBus._on(\"pagesinit\", () => {\n this._isPagesLoaded = false;\n\n this.eventBus._on(\"pagesloaded\", evt => {\n this._isPagesLoaded = !!evt.pagesCount;\n }, {\n once: true\n });\n });\n }\n\n initialize({\n fingerprint,\n resetHistory = false,\n updateUrl = false\n }) {\n if (!fingerprint || typeof fingerprint !== \"string\") {\n console.error('PDFHistory.initialize: The \"fingerprint\" must be a non-empty string.');\n return;\n }\n\n if (this._initialized) {\n this.reset();\n }\n\n const reInitialized = this._fingerprint !== \"\" && this._fingerprint !== fingerprint;\n this._fingerprint = fingerprint;\n this._updateUrl = updateUrl === true;\n this._initialized = true;\n\n this._bindEvents();\n\n const state = window.history.state;\n this._popStateInProgress = false;\n this._blockHashChange = 0;\n this._currentHash = getCurrentHash();\n this._numPositionUpdates = 0;\n this._uid = this._maxUid = 0;\n this._destination = null;\n this._position = null;\n\n if (!this._isValidState(state, true) || resetHistory) {\n const {\n hash,\n page,\n rotation\n } = this._parseCurrentHash(true);\n\n if (!hash || reInitialized || resetHistory) {\n this._pushOrReplaceState(null, true);\n\n return;\n }\n\n this._pushOrReplaceState({\n hash,\n page,\n rotation\n }, true);\n\n return;\n }\n\n const destination = state.destination;\n\n this._updateInternalState(destination, state.uid, true);\n\n if (destination.rotation !== undefined) {\n this._initialRotation = destination.rotation;\n }\n\n if (destination.dest) {\n this._initialBookmark = JSON.stringify(destination.dest);\n this._destination.page = null;\n } else if (destination.hash) {\n this._initialBookmark = destination.hash;\n } else if (destination.page) {\n this._initialBookmark = `page=${destination.page}`;\n }\n }\n\n reset() {\n if (this._initialized) {\n this._pageHide();\n\n this._initialized = false;\n\n this._unbindEvents();\n }\n\n if (this._updateViewareaTimeout) {\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n\n this._initialBookmark = null;\n this._initialRotation = null;\n }\n\n push({\n namedDest = null,\n explicitDest,\n pageNumber\n }) {\n if (!this._initialized) {\n return;\n }\n\n if (namedDest && typeof namedDest !== \"string\") {\n console.error(\"PDFHistory.push: \" + `\"${namedDest}\" is not a valid namedDest parameter.`);\n return;\n } else if (!Array.isArray(explicitDest)) {\n console.error(\"PDFHistory.push: \" + `\"${explicitDest}\" is not a valid explicitDest parameter.`);\n return;\n } else if (!this._isValidPage(pageNumber)) {\n if (pageNumber !== null || this._destination) {\n console.error(\"PDFHistory.push: \" + `\"${pageNumber}\" is not a valid pageNumber parameter.`);\n return;\n }\n }\n\n const hash = namedDest || JSON.stringify(explicitDest);\n\n if (!hash) {\n return;\n }\n\n let forceReplace = false;\n\n if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) {\n if (this._destination.page) {\n return;\n }\n\n forceReplace = true;\n }\n\n if (this._popStateInProgress && !forceReplace) {\n return;\n }\n\n this._pushOrReplaceState({\n dest: explicitDest,\n hash,\n page: pageNumber,\n rotation: this.linkService.rotation\n }, forceReplace);\n\n if (!this._popStateInProgress) {\n this._popStateInProgress = true;\n Promise.resolve().then(() => {\n this._popStateInProgress = false;\n });\n }\n }\n\n pushPage(pageNumber) {\n if (!this._initialized) {\n return;\n }\n\n if (!this._isValidPage(pageNumber)) {\n console.error(`PDFHistory.pushPage: \"${pageNumber}\" is not a valid page number.`);\n return;\n }\n\n if (this._destination?.page === pageNumber) {\n return;\n }\n\n if (this._popStateInProgress) {\n return;\n }\n\n this._pushOrReplaceState({\n dest: null,\n hash: `page=${pageNumber}`,\n page: pageNumber,\n rotation: this.linkService.rotation\n });\n\n if (!this._popStateInProgress) {\n this._popStateInProgress = true;\n Promise.resolve().then(() => {\n this._popStateInProgress = false;\n });\n }\n }\n\n pushCurrentPosition() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n\n this._tryPushCurrentPosition();\n }\n\n back() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n\n const state = window.history.state;\n\n if (this._isValidState(state) && state.uid > 0) {\n window.history.back();\n }\n }\n\n forward() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n\n const state = window.history.state;\n\n if (this._isValidState(state) && state.uid < this._maxUid) {\n window.history.forward();\n }\n }\n\n get popStateInProgress() {\n return this._initialized && (this._popStateInProgress || this._blockHashChange > 0);\n }\n\n get initialBookmark() {\n return this._initialized ? this._initialBookmark : null;\n }\n\n get initialRotation() {\n return this._initialized ? this._initialRotation : null;\n }\n\n _pushOrReplaceState(destination, forceReplace = false) {\n const shouldReplace = forceReplace || !this._destination;\n const newState = {\n fingerprint: this._fingerprint,\n uid: shouldReplace ? this._uid : this._uid + 1,\n destination\n };\n\n this._updateInternalState(destination, newState.uid);\n\n let newUrl;\n\n if (this._updateUrl && destination?.hash) {\n const baseUrl = document.location.href.split(\"#\")[0];\n\n if (!baseUrl.startsWith(\"file://\")) {\n newUrl = `${baseUrl}#${destination.hash}`;\n }\n }\n\n if (shouldReplace) {\n window.history.replaceState(newState, \"\", newUrl);\n } else {\n window.history.pushState(newState, \"\", newUrl);\n }\n }\n\n _tryPushCurrentPosition(temporary = false) {\n if (!this._position) {\n return;\n }\n\n let position = this._position;\n\n if (temporary) {\n position = Object.assign(Object.create(null), this._position);\n position.temporary = true;\n }\n\n if (!this._destination) {\n this._pushOrReplaceState(position);\n\n return;\n }\n\n if (this._destination.temporary) {\n this._pushOrReplaceState(position, true);\n\n return;\n }\n\n if (this._destination.hash === position.hash) {\n return;\n }\n\n if (!this._destination.page && (POSITION_UPDATED_THRESHOLD <= 0 || this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)) {\n return;\n }\n\n let forceReplace = false;\n\n if (this._destination.page >= position.first && this._destination.page <= position.page) {\n if (this._destination.dest !== undefined || !this._destination.first) {\n return;\n }\n\n forceReplace = true;\n }\n\n this._pushOrReplaceState(position, forceReplace);\n }\n\n _isValidPage(val) {\n return Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount;\n }\n\n _isValidState(state, checkReload = false) {\n if (!state) {\n return false;\n }\n\n if (state.fingerprint !== this._fingerprint) {\n if (checkReload) {\n if (typeof state.fingerprint !== \"string\" || state.fingerprint.length !== this._fingerprint.length) {\n return false;\n }\n\n const [perfEntry] = performance.getEntriesByType(\"navigation\");\n\n if (perfEntry?.type !== \"reload\") {\n return false;\n }\n } else {\n return false;\n }\n }\n\n if (!Number.isInteger(state.uid) || state.uid < 0) {\n return false;\n }\n\n if (state.destination === null || typeof state.destination !== \"object\") {\n return false;\n }\n\n return true;\n }\n\n _updateInternalState(destination, uid, removeTemporary = false) {\n if (this._updateViewareaTimeout) {\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n\n if (removeTemporary && destination?.temporary) {\n delete destination.temporary;\n }\n\n this._destination = destination;\n this._uid = uid;\n this._maxUid = Math.max(this._maxUid, uid);\n this._numPositionUpdates = 0;\n }\n\n _parseCurrentHash(checkNameddest = false) {\n const hash = unescape(getCurrentHash()).substring(1);\n const params = (0, _ui_utils.parseQueryString)(hash);\n const nameddest = params.get(\"nameddest\") || \"\";\n let page = params.get(\"page\") | 0;\n\n if (!this._isValidPage(page) || checkNameddest && nameddest.length > 0) {\n page = null;\n }\n\n return {\n hash,\n page,\n rotation: this.linkService.rotation\n };\n }\n\n _updateViewarea({\n location\n }) {\n if (this._updateViewareaTimeout) {\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n\n this._position = {\n hash: location.pdfOpenParams.substring(1),\n page: this.linkService.page,\n first: location.pageNumber,\n rotation: location.rotation\n };\n\n if (this._popStateInProgress) {\n return;\n }\n\n if (POSITION_UPDATED_THRESHOLD > 0 && this._isPagesLoaded && this._destination && !this._destination.page) {\n this._numPositionUpdates++;\n }\n\n if (UPDATE_VIEWAREA_TIMEOUT > 0) {\n this._updateViewareaTimeout = setTimeout(() => {\n if (!this._popStateInProgress) {\n this._tryPushCurrentPosition(true);\n }\n\n this._updateViewareaTimeout = null;\n }, UPDATE_VIEWAREA_TIMEOUT);\n }\n }\n\n _popState({\n state\n }) {\n const newHash = getCurrentHash(),\n hashChanged = this._currentHash !== newHash;\n this._currentHash = newHash;\n\n if (!state) {\n this._uid++;\n\n const {\n hash,\n page,\n rotation\n } = this._parseCurrentHash();\n\n this._pushOrReplaceState({\n hash,\n page,\n rotation\n }, true);\n\n return;\n }\n\n if (!this._isValidState(state)) {\n return;\n }\n\n this._popStateInProgress = true;\n\n if (hashChanged) {\n this._blockHashChange++;\n (0, _event_utils.waitOnEventOrTimeout)({\n target: window,\n name: \"hashchange\",\n delay: HASH_CHANGE_TIMEOUT\n }).then(() => {\n this._blockHashChange--;\n });\n }\n\n const destination = state.destination;\n\n this._updateInternalState(destination, state.uid, true);\n\n if ((0, _ui_utils.isValidRotation)(destination.rotation)) {\n this.linkService.rotation = destination.rotation;\n }\n\n if (destination.dest) {\n this.linkService.goToDestination(destination.dest);\n } else if (destination.hash) {\n this.linkService.setHash(destination.hash);\n } else if (destination.page) {\n this.linkService.page = destination.page;\n }\n\n Promise.resolve().then(() => {\n this._popStateInProgress = false;\n });\n }\n\n _pageHide() {\n if (!this._destination || this._destination.temporary) {\n this._tryPushCurrentPosition();\n }\n }\n\n _bindEvents() {\n if (this._boundEvents) {\n return;\n }\n\n this._boundEvents = {\n updateViewarea: this._updateViewarea.bind(this),\n popState: this._popState.bind(this),\n pageHide: this._pageHide.bind(this)\n };\n\n this.eventBus._on(\"updateviewarea\", this._boundEvents.updateViewarea);\n\n window.addEventListener(\"popstate\", this._boundEvents.popState);\n window.addEventListener(\"pagehide\", this._boundEvents.pageHide);\n }\n\n _unbindEvents() {\n if (!this._boundEvents) {\n return;\n }\n\n this.eventBus._off(\"updateviewarea\", this._boundEvents.updateViewarea);\n\n window.removeEventListener(\"popstate\", this._boundEvents.popState);\n window.removeEventListener(\"pagehide\", this._boundEvents.pageHide);\n this._boundEvents = null;\n }\n\n}\n\nexports.PDFHistory = PDFHistory;\n\nfunction isDestHashesEqual(destHash, pushHash) {\n if (typeof destHash !== \"string\" || typeof pushHash !== \"string\") {\n return false;\n }\n\n if (destHash === pushHash) {\n return true;\n }\n\n const nameddest = (0, _ui_utils.parseQueryString)(destHash).get(\"nameddest\");\n\n if (nameddest === pushHash) {\n return true;\n }\n\n return false;\n}\n\nfunction isDestArraysEqual(firstDest, secondDest) {\n function isEntryEqual(first, second) {\n if (typeof first !== typeof second) {\n return false;\n }\n\n if (Array.isArray(first) || Array.isArray(second)) {\n return false;\n }\n\n if (first !== null && typeof first === \"object\" && second !== null) {\n if (Object.keys(first).length !== Object.keys(second).length) {\n return false;\n }\n\n for (const key in first) {\n if (!isEntryEqual(first[key], second[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return first === second || Number.isNaN(first) && Number.isNaN(second);\n }\n\n if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) {\n return false;\n }\n\n if (firstDest.length !== secondDest.length) {\n return false;\n }\n\n for (let i = 0, ii = firstDest.length; i < ii; i++) {\n if (!isEntryEqual(firstDest[i], secondDest[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/***/ }),\n/* 25 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.PDFScriptingManager = void 0;\n\nvar _ui_utils = __w_pdfjs_require__(7);\n\nvar _pdfjsLib = __w_pdfjs_require__(3);\n\nclass PDFScriptingManager {\n constructor({\n eventBus,\n sandboxBundleSrc = null,\n scriptingFactory = null,\n docPropertiesLookup = null\n }) {\n this._pdfDocument = null;\n this._pdfViewer = null;\n this._closeCapability = null;\n this._destroyCapability = null;\n this._scripting = null;\n this._mouseState = Object.create(null);\n this._ready = false;\n this._eventBus = eventBus;\n this._sandboxBundleSrc = sandboxBundleSrc;\n this._scriptingFactory = scriptingFactory;\n this._docPropertiesLookup = docPropertiesLookup;\n\n if (!this._scriptingFactory) {\n window.addEventListener(\"updatefromsandbox\", event => {\n this._eventBus.dispatch(\"updatefromsandbox\", {\n source: window,\n detail: event.detail\n });\n });\n }\n }\n\n setViewer(pdfViewer) {\n this._pdfViewer = pdfViewer;\n }\n\n async setDocument(pdfDocument) {\n if (this._pdfDocument) {\n await this._destroyScripting();\n }\n\n this._pdfDocument = pdfDocument;\n\n if (!pdfDocument) {\n return;\n }\n\n const [objects, calculationOrder, docActions] = await Promise.all([pdfDocument.getFieldObjects(), pdfDocument.getCalculationOrderIds(), pdfDocument.getJSActions()]);\n\n if (!objects && !docActions) {\n await this._destroyScripting();\n return;\n }\n\n if (pdfDocument !== this._pdfDocument) {\n return;\n }\n\n try {\n this._scripting = this._createScripting();\n } catch (error) {\n console.error(`PDFScriptingManager.setDocument: \"${error?.message}\".`);\n await this._destroyScripting();\n return;\n }\n\n this._internalEvents.set(\"updatefromsandbox\", event => {\n if (event?.source !== window) {\n return;\n }\n\n this._updateFromSandbox(event.detail);\n });\n\n this._internalEvents.set(\"dispatcheventinsandbox\", event => {\n this._scripting?.dispatchEventInSandbox(event.detail);\n });\n\n this._internalEvents.set(\"pagechanging\", ({\n pageNumber,\n previous\n }) => {\n if (pageNumber === previous) {\n return;\n }\n\n this._dispatchPageClose(previous);\n\n this._dispatchPageOpen(pageNumber);\n });\n\n this._internalEvents.set(\"pagerendered\", ({\n pageNumber\n }) => {\n if (!this._pageOpenPending.has(pageNumber)) {\n return;\n }\n\n if (pageNumber !== this._pdfViewer.currentPageNumber) {\n return;\n }\n\n this._dispatchPageOpen(pageNumber);\n });\n\n this._internalEvents.set(\"pagesdestroy\", async event => {\n await this._dispatchPageClose(this._pdfViewer.currentPageNumber);\n await this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"WillClose\"\n });\n this._closeCapability?.resolve();\n });\n\n this._domEvents.set(\"mousedown\", event => {\n this._mouseState.isDown = true;\n });\n\n this._domEvents.set(\"mouseup\", event => {\n this._mouseState.isDown = false;\n });\n\n for (const [name, listener] of this._internalEvents) {\n this._eventBus._on(name, listener);\n }\n\n for (const [name, listener] of this._domEvents) {\n window.addEventListener(name, listener, true);\n }\n\n try {\n const docProperties = await this._getDocProperties();\n\n if (pdfDocument !== this._pdfDocument) {\n return;\n }\n\n await this._scripting.createSandbox({\n objects,\n calculationOrder,\n appInfo: {\n platform: navigator.platform,\n language: navigator.language\n },\n docInfo: { ...docProperties,\n actions: docActions\n }\n });\n\n this._eventBus.dispatch(\"sandboxcreated\", {\n source: this\n });\n } catch (error) {\n console.error(`PDFScriptingManager.setDocument: \"${error?.message}\".`);\n await this._destroyScripting();\n return;\n }\n\n await this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"Open\"\n });\n await this._dispatchPageOpen(this._pdfViewer.currentPageNumber, true);\n Promise.resolve().then(() => {\n if (pdfDocument === this._pdfDocument) {\n this._ready = true;\n }\n });\n }\n\n async dispatchWillSave(detail) {\n return this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"WillSave\"\n });\n }\n\n async dispatchDidSave(detail) {\n return this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"DidSave\"\n });\n }\n\n async dispatchWillPrint(detail) {\n return this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"WillPrint\"\n });\n }\n\n async dispatchDidPrint(detail) {\n return this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"DidPrint\"\n });\n }\n\n get mouseState() {\n return this._mouseState;\n }\n\n get destroyPromise() {\n return this._destroyCapability?.promise || null;\n }\n\n get ready() {\n return this._ready;\n }\n\n get _internalEvents() {\n return (0, _pdfjsLib.shadow)(this, \"_internalEvents\", new Map());\n }\n\n get _domEvents() {\n return (0, _pdfjsLib.shadow)(this, \"_domEvents\", new Map());\n }\n\n get _pageOpenPending() {\n return (0, _pdfjsLib.shadow)(this, \"_pageOpenPending\", new Set());\n }\n\n get _visitedPages() {\n return (0, _pdfjsLib.shadow)(this, \"_visitedPages\", new Map());\n }\n\n async _updateFromSandbox(detail) {\n const isInPresentationMode = this._pdfViewer.isInPresentationMode || this._pdfViewer.isChangingPresentationMode;\n const {\n id,\n siblings,\n command,\n value\n } = detail;\n\n if (!id) {\n switch (command) {\n case \"clear\":\n console.clear();\n break;\n\n case \"error\":\n console.error(value);\n break;\n\n case \"layout\":\n if (isInPresentationMode) {\n return;\n }\n\n const modes = (0, _ui_utils.apiPageLayoutToViewerModes)(value);\n this._pdfViewer.spreadMode = modes.spreadMode;\n break;\n\n case \"page-num\":\n this._pdfViewer.currentPageNumber = value + 1;\n break;\n\n case \"print\":\n await this._pdfViewer.pagesPromise;\n\n this._eventBus.dispatch(\"print\", {\n source: this\n });\n\n break;\n\n case \"println\":\n console.log(value);\n break;\n\n case \"zoom\":\n if (isInPresentationMode) {\n return;\n }\n\n this._pdfViewer.currentScaleValue = value;\n break;\n\n case \"SaveAs\":\n this._eventBus.dispatch(\"download\", {\n source: this\n });\n\n break;\n\n case \"FirstPage\":\n this._pdfViewer.currentPageNumber = 1;\n break;\n\n case \"LastPage\":\n this._pdfViewer.currentPageNumber = this._pdfViewer.pagesCount;\n break;\n\n case \"NextPage\":\n this._pdfViewer.nextPage();\n\n break;\n\n case \"PrevPage\":\n this._pdfViewer.previousPage();\n\n break;\n\n case \"ZoomViewIn\":\n if (isInPresentationMode) {\n return;\n }\n\n this._pdfViewer.increaseScale();\n\n break;\n\n case \"ZoomViewOut\":\n if (isInPresentationMode) {\n return;\n }\n\n this._pdfViewer.decreaseScale();\n\n break;\n }\n\n return;\n }\n\n if (isInPresentationMode) {\n if (detail.focus) {\n return;\n }\n }\n\n delete detail.id;\n delete detail.siblings;\n const ids = siblings ? [id, ...siblings] : [id];\n\n for (const elementId of ids) {\n const element = document.querySelector(`[data-element-id=\"${elementId}\"]`);\n\n if (element) {\n element.dispatchEvent(new CustomEvent(\"updatefromsandbox\", {\n detail\n }));\n } else {\n this._pdfDocument?.annotationStorage.setValue(elementId, detail);\n }\n }\n }\n\n async _dispatchPageOpen(pageNumber, initialize = false) {\n const pdfDocument = this._pdfDocument,\n visitedPages = this._visitedPages;\n\n if (initialize) {\n this._closeCapability = (0, _pdfjsLib.createPromiseCapability)();\n }\n\n if (!this._closeCapability) {\n return;\n }\n\n const pageView = this._pdfViewer.getPageView(pageNumber - 1);\n\n if (pageView?.renderingState !== _ui_utils.RenderingStates.FINISHED) {\n this._pageOpenPending.add(pageNumber);\n\n return;\n }\n\n this._pageOpenPending.delete(pageNumber);\n\n const actionsPromise = (async () => {\n const actions = await (!visitedPages.has(pageNumber) ? pageView.pdfPage?.getJSActions() : null);\n\n if (pdfDocument !== this._pdfDocument) {\n return;\n }\n\n await this._scripting?.dispatchEventInSandbox({\n id: \"page\",\n name: \"PageOpen\",\n pageNumber,\n actions\n });\n })();\n\n visitedPages.set(pageNumber, actionsPromise);\n }\n\n async _dispatchPageClose(pageNumber) {\n const pdfDocument = this._pdfDocument,\n visitedPages = this._visitedPages;\n\n if (!this._closeCapability) {\n return;\n }\n\n if (this._pageOpenPending.has(pageNumber)) {\n return;\n }\n\n const actionsPromise = visitedPages.get(pageNumber);\n\n if (!actionsPromise) {\n return;\n }\n\n visitedPages.set(pageNumber, null);\n await actionsPromise;\n\n if (pdfDocument !== this._pdfDocument) {\n return;\n }\n\n await this._scripting?.dispatchEventInSandbox({\n id: \"page\",\n name: \"PageClose\",\n pageNumber\n });\n }\n\n async _getDocProperties() {\n if (this._docPropertiesLookup) {\n return this._docPropertiesLookup(this._pdfDocument);\n }\n\n const {\n docPropertiesLookup\n } = __w_pdfjs_require__(26);\n\n return docPropertiesLookup(this._pdfDocument);\n }\n\n _createScripting() {\n this._destroyCapability = (0, _pdfjsLib.createPromiseCapability)();\n\n if (this._scripting) {\n throw new Error(\"_createScripting: Scripting already exists.\");\n }\n\n if (this._scriptingFactory) {\n return this._scriptingFactory.createScripting({\n sandboxBundleSrc: this._sandboxBundleSrc\n });\n }\n\n const {\n GenericScripting\n } = __w_pdfjs_require__(26);\n\n return new GenericScripting(this._sandboxBundleSrc);\n }\n\n async _destroyScripting() {\n if (!this._scripting) {\n this._pdfDocument = null;\n this._destroyCapability?.resolve();\n return;\n }\n\n if (this._closeCapability) {\n await Promise.race([this._closeCapability.promise, new Promise(resolve => {\n setTimeout(resolve, 1000);\n })]).catch(reason => {});\n this._closeCapability = null;\n }\n\n this._pdfDocument = null;\n\n try {\n await this._scripting.destroySandbox();\n } catch (ex) {}\n\n for (const [name, listener] of this._internalEvents) {\n this._eventBus._off(name, listener);\n }\n\n this._internalEvents.clear();\n\n for (const [name, listener] of this._domEvents) {\n window.removeEventListener(name, listener, true);\n }\n\n this._domEvents.clear();\n\n this._pageOpenPending.clear();\n\n this._visitedPages.clear();\n\n this._scripting = null;\n delete this._mouseState.isDown;\n this._ready = false;\n this._destroyCapability?.resolve();\n }\n\n}\n\nexports.PDFScriptingManager = PDFScriptingManager;\n\n/***/ }),\n/* 26 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.GenericScripting = void 0;\nexports.docPropertiesLookup = docPropertiesLookup;\n\nvar _pdfjsLib = __w_pdfjs_require__(3);\n\nasync function docPropertiesLookup(pdfDocument) {\n const url = \"\",\n baseUrl = url.split(\"#\")[0];\n let {\n info,\n metadata,\n contentDispositionFilename,\n contentLength\n } = await pdfDocument.getMetadata();\n\n if (!contentLength) {\n const {\n length\n } = await pdfDocument.getDownloadInfo();\n contentLength = length;\n }\n\n return { ...info,\n baseURL: baseUrl,\n filesize: contentLength,\n filename: contentDispositionFilename || (0, _pdfjsLib.getPdfFilenameFromUrl)(url),\n metadata: metadata?.getRaw(),\n authors: metadata?.get(\"dc:creator\"),\n numPages: pdfDocument.numPages,\n URL: url\n };\n}\n\nclass GenericScripting {\n constructor(sandboxBundleSrc) {\n this._ready = (0, _pdfjsLib.loadScript)(sandboxBundleSrc, true).then(() => {\n return window.pdfjsSandbox.QuickJSSandbox();\n });\n }\n\n async createSandbox(data) {\n const sandbox = await this._ready;\n sandbox.create(data);\n }\n\n async dispatchEventInSandbox(event) {\n const sandbox = await this._ready;\n setTimeout(() => sandbox.dispatchEvent(event), 0);\n }\n\n async destroySandbox() {\n const sandbox = await this._ready;\n sandbox.nukeSandbox();\n }\n\n}\n\nexports.GenericScripting = GenericScripting;\n\n/***/ })\n/******/ \t]);\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __w_pdfjs_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __w_pdfjs_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\nvar __webpack_exports__ = {};\n// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.\n(() => {\nvar exports = __webpack_exports__;\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"AnnotationLayerBuilder\", ({\n enumerable: true,\n get: function () {\n return _annotation_layer_builder.AnnotationLayerBuilder;\n }\n}));\nObject.defineProperty(exports, \"DefaultAnnotationLayerFactory\", ({\n enumerable: true,\n get: function () {\n return _default_factory.DefaultAnnotationLayerFactory;\n }\n}));\nObject.defineProperty(exports, \"DefaultStructTreeLayerFactory\", ({\n enumerable: true,\n get: function () {\n return _default_factory.DefaultStructTreeLayerFactory;\n }\n}));\nObject.defineProperty(exports, \"DefaultTextLayerFactory\", ({\n enumerable: true,\n get: function () {\n return _default_factory.DefaultTextLayerFactory;\n }\n}));\nObject.defineProperty(exports, \"DefaultXfaLayerFactory\", ({\n enumerable: true,\n get: function () {\n return _default_factory.DefaultXfaLayerFactory;\n }\n}));\nObject.defineProperty(exports, \"DownloadManager\", ({\n enumerable: true,\n get: function () {\n return _download_manager.DownloadManager;\n }\n}));\nObject.defineProperty(exports, \"EventBus\", ({\n enumerable: true,\n get: function () {\n return _event_utils.EventBus;\n }\n}));\nObject.defineProperty(exports, \"GenericL10n\", ({\n enumerable: true,\n get: function () {\n return _genericl10n.GenericL10n;\n }\n}));\nObject.defineProperty(exports, \"LinkTarget\", ({\n enumerable: true,\n get: function () {\n return _pdf_link_service.LinkTarget;\n }\n}));\nObject.defineProperty(exports, \"NullL10n\", ({\n enumerable: true,\n get: function () {\n return _l10n_utils.NullL10n;\n }\n}));\nObject.defineProperty(exports, \"PDFFindController\", ({\n enumerable: true,\n get: function () {\n return _pdf_find_controller.PDFFindController;\n }\n}));\nObject.defineProperty(exports, \"PDFHistory\", ({\n enumerable: true,\n get: function () {\n return _pdf_history.PDFHistory;\n }\n}));\nObject.defineProperty(exports, \"PDFLinkService\", ({\n enumerable: true,\n get: function () {\n return _pdf_link_service.PDFLinkService;\n }\n}));\nObject.defineProperty(exports, \"PDFPageView\", ({\n enumerable: true,\n get: function () {\n return _pdf_page_view.PDFPageView;\n }\n}));\nObject.defineProperty(exports, \"PDFScriptingManager\", ({\n enumerable: true,\n get: function () {\n return _pdf_scripting_manager.PDFScriptingManager;\n }\n}));\nObject.defineProperty(exports, \"PDFSinglePageViewer\", ({\n enumerable: true,\n get: function () {\n return _pdf_viewer.PDFSinglePageViewer;\n }\n}));\nObject.defineProperty(exports, \"PDFViewer\", ({\n enumerable: true,\n get: function () {\n return _pdf_viewer.PDFViewer;\n }\n}));\nObject.defineProperty(exports, \"ProgressBar\", ({\n enumerable: true,\n get: function () {\n return _ui_utils.ProgressBar;\n }\n}));\nObject.defineProperty(exports, \"RenderingStates\", ({\n enumerable: true,\n get: function () {\n return _ui_utils.RenderingStates;\n }\n}));\nObject.defineProperty(exports, \"ScrollMode\", ({\n enumerable: true,\n get: function () {\n return _ui_utils.ScrollMode;\n }\n}));\nObject.defineProperty(exports, \"SimpleLinkService\", ({\n enumerable: true,\n get: function () {\n return _pdf_link_service.SimpleLinkService;\n }\n}));\nObject.defineProperty(exports, \"SpreadMode\", ({\n enumerable: true,\n get: function () {\n return _ui_utils.SpreadMode;\n }\n}));\nObject.defineProperty(exports, \"StructTreeLayerBuilder\", ({\n enumerable: true,\n get: function () {\n return _struct_tree_layer_builder.StructTreeLayerBuilder;\n }\n}));\nObject.defineProperty(exports, \"TextLayerBuilder\", ({\n enumerable: true,\n get: function () {\n return _text_layer_builder.TextLayerBuilder;\n }\n}));\nObject.defineProperty(exports, \"XfaLayerBuilder\", ({\n enumerable: true,\n get: function () {\n return _xfa_layer_builder.XfaLayerBuilder;\n }\n}));\nObject.defineProperty(exports, \"parseQueryString\", ({\n enumerable: true,\n get: function () {\n return _ui_utils.parseQueryString;\n }\n}));\n\nvar _default_factory = __w_pdfjs_require__(1);\n\nvar _pdf_link_service = __w_pdfjs_require__(6);\n\nvar _ui_utils = __w_pdfjs_require__(7);\n\nvar _pdf_viewer = __w_pdfjs_require__(11);\n\nvar _annotation_layer_builder = __w_pdfjs_require__(5);\n\nvar _download_manager = __w_pdfjs_require__(18);\n\nvar _event_utils = __w_pdfjs_require__(19);\n\nvar _genericl10n = __w_pdfjs_require__(20);\n\nvar _l10n_utils = __w_pdfjs_require__(4);\n\nvar _pdf_find_controller = __w_pdfjs_require__(22);\n\nvar _pdf_history = __w_pdfjs_require__(24);\n\nvar _pdf_page_view = __w_pdfjs_require__(13);\n\nvar _pdf_scripting_manager = __w_pdfjs_require__(25);\n\nvar _struct_tree_layer_builder = __w_pdfjs_require__(8);\n\nvar _text_layer_builder = __w_pdfjs_require__(9);\n\nvar _xfa_layer_builder = __w_pdfjs_require__(10);\n\nconst pdfjsVersion = '2.16.105';\nconst pdfjsBuild = '172ccdbe5';\n})();\n\n/******/ \treturn __webpack_exports__;\n/******/ })()\n;\n});\n//# sourceMappingURL=pdf_viewer.js.map","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst DEFAULT_SCALE_VALUE = 'page-fit';\nconst DEFAULT_SCALE = 1.0;\nconst DEFAULT_SCALE_DELTA = 1.1;\nconst MIN_SCALE = 0.1;\nconst MAX_SCALE = 10.0;\nconst UNKNOWN_SCALE = 0;\nconst MAX_AUTO_SCALE = 1.25;\nconst SCROLLBAR_PADDING = 40;\nconst VERTICAL_PADDING = 5;\n\nconst RenderingStates = {\n\tINITIAL: 0,\n\tRUNNING: 1,\n\tPAUSED: 2,\n\tFINISHED: 3,\n};\n\nconst PresentationModeState = {\n\tUNKNOWN: 0,\n\tNORMAL: 1,\n\tCHANGING: 2,\n\tFULLSCREEN: 3,\n};\n\nconst SidebarView = {\n\tUNKNOWN: -1,\n\tNONE: 0,\n\tTHUMBS: 1, // Default value.\n\tOUTLINE: 2,\n\tATTACHMENTS: 3,\n\tLAYERS: 4,\n};\n\nconst RendererType =\n\ttypeof PDFJSDev === 'undefined' || PDFJSDev.test('!PRODUCTION || GENERIC')\n\t\t? {\n\t\t\t\tCANVAS: 'canvas',\n\t\t\t\tSVG: 'svg',\n\t\t }\n\t\t: null;\n\nconst TextLayerMode = {\n\tDISABLE: 0,\n\tENABLE: 1,\n\tENABLE_ENHANCE: 2,\n};\n\nconst ScrollMode = {\n\tUNKNOWN: -1,\n\tVERTICAL: 0, // Default value.\n\tHORIZONTAL: 1,\n\tWRAPPED: 2,\n\tPAGE: 3,\n};\n\nconst SpreadMode = {\n\tUNKNOWN: -1,\n\tNONE: 0, // Default value.\n\tODD: 1,\n\tEVEN: 2,\n};\n\n// Used by `PDFViewerApplication`, and by the API unit-tests.\nconst AutoPrintRegExp = /\\bprint\\s*\\(/;\n\n/**\n * Scale factors for the canvas, necessary with HiDPI displays.\n */\nclass OutputScale {\n\tconstructor() {\n\t\tconst pixelRatio = window.devicePixelRatio || 1;\n\n\t\t/**\n\t\t * @type {number} Horizontal scale.\n\t\t */\n\t\tthis.sx = pixelRatio;\n\n\t\t/**\n\t\t * @type {number} Vertical scale.\n\t\t */\n\t\tthis.sy = pixelRatio;\n\t}\n\n\t/**\n\t * @type {boolean} Returns `true` when scaling is required, `false` otherwise.\n\t */\n\tget scaled() {\n\t\treturn this.sx !== 1 || this.sy !== 1;\n\t}\n}\n\n/**\n * Scrolls specified element into view of its parent.\n * @param {Object} element - The element to be visible.\n * @param {Object} spot - An object with optional top and left properties,\n * specifying the offset from the top left edge.\n * @param {boolean} [scrollMatches] - When scrolling search results into view,\n * ignore elements that either: Contains marked content identifiers,\n * or have the CSS-rule `overflow: hidden;` set. The default value is `false`.\n */\nfunction scrollIntoView(element, spot, scrollMatches = false) {\n\t// Assuming offsetParent is available (it's not available when viewer is in\n\t// hidden iframe or object). We have to scroll: if the offsetParent is not set\n\t// producing the error. See also animationStarted.\n\tlet parent = element.offsetParent;\n\tif (!parent) {\n\t\tconsole.error('offsetParent is not set -- cannot scroll');\n\t\treturn;\n\t}\n\tlet offsetY = element.offsetTop + element.clientTop;\n\tlet offsetX = element.offsetLeft + element.clientLeft;\n\twhile (\n\t\t(parent.clientHeight === parent.scrollHeight &&\n\t\t\tparent.clientWidth === parent.scrollWidth) ||\n\t\t(scrollMatches &&\n\t\t\t(parent.classList.contains('markedContent') ||\n\t\t\t\tgetComputedStyle(parent).overflow === 'hidden'))\n\t) {\n\t\toffsetY += parent.offsetTop;\n\t\toffsetX += parent.offsetLeft;\n\n\t\tparent = parent.offsetParent;\n\t\tif (!parent) {\n\t\t\treturn; // no need to scroll\n\t\t}\n\t}\n\tif (spot) {\n\t\tif (spot.top !== undefined) {\n\t\t\toffsetY += spot.top;\n\t\t}\n\t\tif (spot.left !== undefined) {\n\t\t\toffsetX += spot.left;\n\t\t\tparent.scrollLeft = offsetX;\n\t\t}\n\t}\n\tparent.scrollTop = offsetY;\n}\n\n/**\n * Helper function to start monitoring the scroll event and converting them into\n * PDF.js friendly one: with scroll debounce and scroll direction.\n */\nfunction watchScroll(viewAreaElement, callback) {\n\tconst debounceScroll = function (evt) {\n\t\tif (rAF) {\n\t\t\treturn;\n\t\t}\n\t\t// schedule an invocation of scroll for next animation frame.\n\t\trAF = window.requestAnimationFrame(function viewAreaElementScrolled() {\n\t\t\trAF = null;\n\n\t\t\tconst currentX = viewAreaElement.scrollLeft;\n\t\t\tconst lastX = state.lastX;\n\t\t\tif (currentX !== lastX) {\n\t\t\t\tstate.right = currentX > lastX;\n\t\t\t}\n\t\t\tstate.lastX = currentX;\n\t\t\tconst currentY = viewAreaElement.scrollTop;\n\t\t\tconst lastY = state.lastY;\n\t\t\tif (currentY !== lastY) {\n\t\t\t\tstate.down = currentY > lastY;\n\t\t\t}\n\t\t\tstate.lastY = currentY;\n\t\t\tcallback(state);\n\t\t});\n\t};\n\n\tconst state = {\n\t\tright: true,\n\t\tdown: true,\n\t\tlastX: viewAreaElement.scrollLeft,\n\t\tlastY: viewAreaElement.scrollTop,\n\t\t_eventHandler: debounceScroll,\n\t};\n\n\tlet rAF = null;\n\tviewAreaElement.addEventListener('scroll', debounceScroll, true);\n\treturn state;\n}\n\n/**\n * Helper function to parse query string (e.g. ?param1=value¶m2=...).\n * @param {string}\n * @returns {Map}\n */\nfunction parseQueryString(query) {\n\tconst params = new Map();\n\tfor (const [key, value] of new URLSearchParams(query)) {\n\t\tparams.set(key.toLowerCase(), value);\n\t}\n\treturn params;\n}\n\nconst NullCharactersRegExp = /\\x00/g;\nconst InvisibleCharactersRegExp = /[\\x01-\\x1F]/g;\n\n/**\n * @param {string} str\n * @param {boolean} [replaceInvisible]\n */\nfunction removeNullCharacters(str, replaceInvisible = false) {\n\tif (typeof str !== 'string') {\n\t\tconsole.error(`The argument must be a string.`);\n\t\treturn str;\n\t}\n\tif (replaceInvisible) {\n\t\tstr = str.replace(InvisibleCharactersRegExp, ' ');\n\t}\n\treturn str.replace(NullCharactersRegExp, '');\n}\n\n/**\n * Use binary search to find the index of the first item in a given array which\n * passes a given condition. The items are expected to be sorted in the sense\n * that if the condition is true for one item in the array, then it is also true\n * for all following items.\n *\n * @returns {number} Index of the first array element to pass the test,\n * or |items.length| if no such element exists.\n */\nfunction binarySearchFirstItem(items, condition, start = 0) {\n\tlet minIndex = start;\n\tlet maxIndex = items.length - 1;\n\n\tif (maxIndex < 0 || !condition(items[maxIndex])) {\n\t\treturn items.length;\n\t}\n\tif (condition(items[minIndex])) {\n\t\treturn minIndex;\n\t}\n\n\twhile (minIndex < maxIndex) {\n\t\tconst currentIndex = (minIndex + maxIndex) >> 1;\n\t\tconst currentItem = items[currentIndex];\n\t\tif (condition(currentItem)) {\n\t\t\tmaxIndex = currentIndex;\n\t\t} else {\n\t\t\tminIndex = currentIndex + 1;\n\t\t}\n\t}\n\treturn minIndex; /* === maxIndex */\n}\n\n/**\n * Approximates float number as a fraction using Farey sequence (max order\n * of 8).\n * @param {number} x - Positive float number.\n * @returns {Array} Estimated fraction: the first array item is a numerator,\n * the second one is a denominator.\n */\nfunction approximateFraction(x) {\n\t// Fast paths for int numbers or their inversions.\n\tif (Math.floor(x) === x) {\n\t\treturn [x, 1];\n\t}\n\tconst xinv = 1 / x;\n\tconst limit = 8;\n\tif (xinv > limit) {\n\t\treturn [1, limit];\n\t} else if (Math.floor(xinv) === xinv) {\n\t\treturn [1, xinv];\n\t}\n\n\tconst x_ = x > 1 ? xinv : x;\n\t// a/b and c/d are neighbours in Farey sequence.\n\tlet a = 0,\n\t\tb = 1,\n\t\tc = 1,\n\t\td = 1;\n\t// Limiting search to order 8.\n\twhile (true) {\n\t\t// Generating next term in sequence (order of q).\n\t\tconst p = a + c,\n\t\t\tq = b + d;\n\t\tif (q > limit) {\n\t\t\tbreak;\n\t\t}\n\t\tif (x_ <= p / q) {\n\t\t\tc = p;\n\t\t\td = q;\n\t\t} else {\n\t\t\ta = p;\n\t\t\tb = q;\n\t\t}\n\t}\n\tlet result;\n\t// Select closest of the neighbours to x.\n\tif (x_ - a / b < c / d - x_) {\n\t\tresult = x_ === x ? [a, b] : [b, a];\n\t} else {\n\t\tresult = x_ === x ? [c, d] : [d, c];\n\t}\n\treturn result;\n}\n\nfunction roundToDivide(x, div) {\n\tconst r = x % div;\n\treturn r === 0 ? x : Math.round(x - r + div);\n}\n\n/**\n * @typedef {Object} GetPageSizeInchesParameters\n * @property {number[]} view\n * @property {number} userUnit\n * @property {number} rotate\n */\n\n/**\n * @typedef {Object} PageSize\n * @property {number} width - In inches.\n * @property {number} height - In inches.\n */\n\n/**\n * Gets the size of the specified page, converted from PDF units to inches.\n * @param {GetPageSizeInchesParameters} params\n * @returns {PageSize}\n */\nfunction getPageSizeInches({ view, userUnit, rotate }) {\n\tconst [x1, y1, x2, y2] = view;\n\t// We need to take the page rotation into account as well.\n\tconst changeOrientation = rotate % 180 !== 0;\n\n\tconst width = ((x2 - x1) / 72) * userUnit;\n\tconst height = ((y2 - y1) / 72) * userUnit;\n\n\treturn {\n\t\twidth: changeOrientation ? height : width,\n\t\theight: changeOrientation ? width : height,\n\t};\n}\n\n/**\n * Helper function for getVisibleElements.\n *\n * @param {number} index - initial guess at the first visible element\n * @param {Array} views - array of pages, into which `index` is an index\n * @param {number} top - the top of the scroll pane\n * @returns {number} less than or equal to `index` that is definitely at or\n * before the first visible element in `views`, but not by too much. (Usually,\n * this will be the first element in the first partially visible row in\n * `views`, although sometimes it goes back one row further.)\n */\nfunction backtrackBeforeAllVisibleElements(index, views, top) {\n\t// binarySearchFirstItem's assumption is that the input is ordered, with only\n\t// one index where the conditions flips from false to true: [false ...,\n\t// true...]. With vertical scrolling and spreads, it is possible to have\n\t// [false ..., true, false, true ...]. With wrapped scrolling we can have a\n\t// similar sequence, with many more mixed true and false in the middle.\n\t//\n\t// So there is no guarantee that the binary search yields the index of the\n\t// first visible element. It could have been any of the other visible elements\n\t// that were preceded by a hidden element.\n\n\t// Of course, if either this element or the previous (hidden) element is also\n\t// the first element, there's nothing to worry about.\n\tif (index < 2) {\n\t\treturn index;\n\t}\n\n\t// That aside, the possible cases are represented below.\n\t//\n\t// **** = fully hidden\n\t// A*B* = mix of partially visible and/or hidden pages\n\t// CDEF = fully visible\n\t//\n\t// (1) Binary search could have returned A, in which case we can stop.\n\t// (2) Binary search could also have returned B, in which case we need to\n\t// check the whole row.\n\t// (3) Binary search could also have returned C, in which case we need to\n\t// check the whole previous row.\n\t//\n\t// There's one other possibility:\n\t//\n\t// **** = fully hidden\n\t// ABCD = mix of fully and/or partially visible pages\n\t//\n\t// (4) Binary search could only have returned A.\n\n\t// Initially assume that we need to find the beginning of the current row\n\t// (case 1, 2, or 4), which means finding a page that is above the current\n\t// page's top. If the found page is partially visible, we're definitely not in\n\t// case 3, and this assumption is correct.\n\tlet elt = views[index].div;\n\tlet pageTop = elt.offsetTop + elt.clientTop;\n\n\tif (pageTop >= top) {\n\t\t// The found page is fully visible, so we're actually either in case 3 or 4,\n\t\t// and unfortunately we can't tell the difference between them without\n\t\t// scanning the entire previous row, so we just conservatively assume that\n\t\t// we do need to backtrack to that row. In both cases, the previous page is\n\t\t// in the previous row, so use its top instead.\n\t\telt = views[index - 1].div;\n\t\tpageTop = elt.offsetTop + elt.clientTop;\n\t}\n\n\t// Now we backtrack to the first page that still has its bottom below\n\t// `pageTop`, which is the top of a page in the first visible row (unless\n\t// we're in case 4, in which case it's the row before that).\n\t// `index` is found by binary search, so the page at `index - 1` is\n\t// invisible and we can start looking for potentially visible pages from\n\t// `index - 2`. (However, if this loop terminates on its first iteration,\n\t// which is the case when pages are stacked vertically, `index` should remain\n\t// unchanged, so we use a distinct loop variable.)\n\tfor (let i = index - 2; i >= 0; --i) {\n\t\telt = views[i].div;\n\t\tif (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) {\n\t\t\t// We have reached the previous row, so stop now.\n\t\t\t// This loop is expected to terminate relatively quickly because the\n\t\t\t// number of pages per row is expected to be small.\n\t\t\tbreak;\n\t\t}\n\t\tindex = i;\n\t}\n\treturn index;\n}\n\n/**\n * @typedef {Object} GetVisibleElementsParameters\n * @property {HTMLElement} scrollEl - A container that can possibly scroll.\n * @property {Array} views - Objects with a `div` property that contains an\n * HTMLElement, which should all be descendants of `scrollEl` satisfying the\n * relevant layout assumptions.\n * @property {boolean} sortByVisibility - If `true`, the returned elements are\n * sorted in descending order of the percent of their padding box that is\n * visible. The default value is `false`.\n * @property {boolean} horizontal - If `true`, the elements are assumed to be\n * laid out horizontally instead of vertically. The default value is `false`.\n * @property {boolean} rtl - If `true`, the `scrollEl` container is assumed to\n * be in right-to-left mode. The default value is `false`.\n */\n\n/**\n * Generic helper to find out what elements are visible within a scroll pane.\n *\n * Well, pretty generic. There are some assumptions placed on the elements\n * referenced by `views`:\n * - If `horizontal`, no left of any earlier element is to the right of the\n * left of any later element.\n * - Otherwise, `views` can be split into contiguous rows where, within a row,\n * no top of any element is below the bottom of any other element, and\n * between rows, no bottom of any element in an earlier row is below the\n * top of any element in a later row.\n *\n * (Here, top, left, etc. all refer to the padding edge of the element in\n * question. For pages, that ends up being equivalent to the bounding box of the\n * rendering canvas. Earlier and later refer to index in `views`, not page\n * layout.)\n *\n * @param {GetVisibleElementsParameters}\n * @returns {Object} `{ first, last, views: [{ id, x, y, view, percent }] }`\n */\nfunction getVisibleElements({\n\tscrollEl,\n\tviews,\n\tsortByVisibility = false,\n\thorizontal = false,\n\trtl = false,\n}) {\n\tconst top = scrollEl.scrollTop,\n\t\tbottom = top + scrollEl.clientHeight;\n\tconst left = scrollEl.scrollLeft,\n\t\tright = left + scrollEl.clientWidth;\n\n\t// Throughout this \"generic\" function, comments will assume we're working with\n\t// PDF document pages, which is the most important and complex case. In this\n\t// case, the visible elements we're actually interested is the page canvas,\n\t// which is contained in a wrapper which adds no padding/border/margin, which\n\t// is itself contained in `view.div` which adds no padding (but does add a\n\t// border). So, as specified in this function's doc comment, this function\n\t// does all of its work on the padding edge of the provided views, starting at\n\t// offsetLeft/Top (which includes margin) and adding clientLeft/Top (which is\n\t// the border). Adding clientWidth/Height gets us the bottom-right corner of\n\t// the padding edge.\n\tfunction isElementBottomAfterViewTop(view) {\n\t\tconst element = view.div;\n\t\tconst elementBottom =\n\t\t\telement.offsetTop + element.clientTop + element.clientHeight;\n\t\treturn elementBottom > top;\n\t}\n\tfunction isElementNextAfterViewHorizontally(view) {\n\t\tconst element = view.div;\n\t\tconst elementLeft = element.offsetLeft + element.clientLeft;\n\t\tconst elementRight = elementLeft + element.clientWidth;\n\t\treturn rtl ? elementLeft < right : elementRight > left;\n\t}\n\n\tconst visible = [],\n\t\tids = new Set(),\n\t\tnumViews = views.length;\n\tlet firstVisibleElementInd = binarySearchFirstItem(\n\t\tviews,\n\t\thorizontal\n\t\t\t? isElementNextAfterViewHorizontally\n\t\t\t: isElementBottomAfterViewTop,\n\t);\n\n\t// Please note the return value of the `binarySearchFirstItem` function when\n\t// no valid element is found (hence the `firstVisibleElementInd` check below).\n\tif (\n\t\tfirstVisibleElementInd > 0 &&\n\t\tfirstVisibleElementInd < numViews &&\n\t\t!horizontal\n\t) {\n\t\t// In wrapped scrolling (or vertical scrolling with spreads), with some page\n\t\t// sizes, isElementBottomAfterViewTop doesn't satisfy the binary search\n\t\t// condition: there can be pages with bottoms above the view top between\n\t\t// pages with bottoms below. This function detects and corrects that error;\n\t\t// see it for more comments.\n\t\tfirstVisibleElementInd = backtrackBeforeAllVisibleElements(\n\t\t\tfirstVisibleElementInd,\n\t\t\tviews,\n\t\t\ttop,\n\t\t);\n\t}\n\n\t// lastEdge acts as a cutoff for us to stop looping, because we know all\n\t// subsequent pages will be hidden.\n\t//\n\t// When using wrapped scrolling or vertical scrolling with spreads, we can't\n\t// simply stop the first time we reach a page below the bottom of the view;\n\t// the tops of subsequent pages on the same row could still be visible. In\n\t// horizontal scrolling, we don't have that issue, so we can stop as soon as\n\t// we pass `right`, without needing the code below that handles the -1 case.\n\tlet lastEdge = horizontal ? right : -1;\n\n\tfor (let i = firstVisibleElementInd; i < numViews; i++) {\n\t\tconst view = views[i],\n\t\t\telement = view.div;\n\t\tconst currentWidth = element.offsetLeft + element.clientLeft;\n\t\tconst currentHeight = element.offsetTop + element.clientTop;\n\t\tconst viewWidth = element.clientWidth,\n\t\t\tviewHeight = element.clientHeight;\n\t\tconst viewRight = currentWidth + viewWidth;\n\t\tconst viewBottom = currentHeight + viewHeight;\n\n\t\tif (lastEdge === -1) {\n\t\t\t// As commented above, this is only needed in non-horizontal cases.\n\t\t\t// Setting lastEdge to the bottom of the first page that is partially\n\t\t\t// visible ensures that the next page fully below lastEdge is on the\n\t\t\t// next row, which has to be fully hidden along with all subsequent rows.\n\t\t\tif (viewBottom >= bottom) {\n\t\t\t\tlastEdge = viewBottom;\n\t\t\t}\n\t\t} else if ((horizontal ? currentWidth : currentHeight) > lastEdge) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (\n\t\t\tviewBottom <= top ||\n\t\t\tcurrentHeight >= bottom ||\n\t\t\tviewRight <= left ||\n\t\t\tcurrentWidth >= right\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst hiddenHeight =\n\t\t\tMath.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom);\n\t\tconst hiddenWidth =\n\t\t\tMath.max(0, left - currentWidth) + Math.max(0, viewRight - right);\n\n\t\tconst fractionHeight = (viewHeight - hiddenHeight) / viewHeight,\n\t\t\tfractionWidth = (viewWidth - hiddenWidth) / viewWidth;\n\t\tconst percent = (fractionHeight * fractionWidth * 100) | 0;\n\n\t\tvisible.push({\n\t\t\tid: view.id,\n\t\t\tx: currentWidth,\n\t\t\ty: currentHeight,\n\t\t\tview,\n\t\t\tpercent,\n\t\t\twidthPercent: (fractionWidth * 100) | 0,\n\t\t});\n\t\tids.add(view.id);\n\t}\n\n\tconst first = visible[0],\n\t\tlast = visible.at(-1);\n\n\tif (sortByVisibility) {\n\t\tvisible.sort(function (a, b) {\n\t\t\tconst pc = a.percent - b.percent;\n\t\t\tif (Math.abs(pc) > 0.001) {\n\t\t\t\treturn -pc;\n\t\t\t}\n\t\t\treturn a.id - b.id; // ensure stability\n\t\t});\n\t}\n\treturn { first, last, views: visible, ids };\n}\n\n/**\n * Event handler to suppress context menu.\n */\nfunction noContextMenuHandler(evt) {\n\tevt.preventDefault();\n}\n\nfunction normalizeWheelEventDirection(evt) {\n\tlet delta = Math.hypot(evt.deltaX, evt.deltaY);\n\tconst angle = Math.atan2(evt.deltaY, evt.deltaX);\n\tif (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) {\n\t\t// All that is left-up oriented has to change the sign.\n\t\tdelta = -delta;\n\t}\n\treturn delta;\n}\n\nfunction normalizeWheelEventDelta(evt) {\n\tlet delta = normalizeWheelEventDirection(evt);\n\n\tconst MOUSE_DOM_DELTA_PIXEL_MODE = 0;\n\tconst MOUSE_DOM_DELTA_LINE_MODE = 1;\n\tconst MOUSE_PIXELS_PER_LINE = 30;\n\tconst MOUSE_LINES_PER_PAGE = 30;\n\n\t// Converts delta to per-page units\n\tif (evt.deltaMode === MOUSE_DOM_DELTA_PIXEL_MODE) {\n\t\tdelta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE;\n\t} else if (evt.deltaMode === MOUSE_DOM_DELTA_LINE_MODE) {\n\t\tdelta /= MOUSE_LINES_PER_PAGE;\n\t}\n\treturn delta;\n}\n\nfunction isValidRotation(angle) {\n\treturn Number.isInteger(angle) && angle % 90 === 0;\n}\n\nfunction isValidScrollMode(mode) {\n\treturn (\n\t\tNumber.isInteger(mode) &&\n\t\tObject.values(ScrollMode).includes(mode) &&\n\t\tmode !== ScrollMode.UNKNOWN\n\t);\n}\n\nfunction isValidSpreadMode(mode) {\n\treturn (\n\t\tNumber.isInteger(mode) &&\n\t\tObject.values(SpreadMode).includes(mode) &&\n\t\tmode !== SpreadMode.UNKNOWN\n\t);\n}\n\nfunction isPortraitOrientation(size) {\n\treturn size.width <= size.height;\n}\n\n/**\n * Promise that is resolved when DOM window becomes visible.\n */\nconst animationStarted = new Promise(function (resolve) {\n\tif (\n\t\ttypeof PDFJSDev !== 'undefined' &&\n\t\tPDFJSDev.test('LIB') &&\n\t\ttypeof window === 'undefined'\n\t) {\n\t\t// Prevent \"ReferenceError: window is not defined\" errors when running the\n\t\t// unit-tests in Node.js environments.\n\t\tsetTimeout(resolve, 20);\n\t\treturn;\n\t}\n\twindow.requestAnimationFrame(resolve);\n});\n\nconst docStyle =\n\ttypeof PDFJSDev !== 'undefined' &&\n\tPDFJSDev.test('LIB') &&\n\ttypeof document === 'undefined'\n\t\t? null\n\t\t: document.documentElement.style;\n\nfunction clamp(v, min, max) {\n\treturn Math.min(Math.max(v, min), max);\n}\n\nclass ProgressBar {\n\t#classList = null;\n\n\t#percent = 0;\n\n\t#visible = true;\n\n\tconstructor(id) {\n\t\tif (\n\t\t\t(typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) &&\n\t\t\targuments.length > 1\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t'ProgressBar no longer accepts any additional options, ' +\n\t\t\t\t\t'please use CSS rules to modify its appearance instead.',\n\t\t\t);\n\t\t}\n\t\tconst bar = document.getElementById(id);\n\t\tthis.#classList = bar.classList;\n\t}\n\n\tget percent() {\n\t\treturn this.#percent;\n\t}\n\n\tset percent(val) {\n\t\tthis.#percent = clamp(val, 0, 100);\n\n\t\tif (isNaN(val)) {\n\t\t\tthis.#classList.add('indeterminate');\n\t\t\treturn;\n\t\t}\n\t\tthis.#classList.remove('indeterminate');\n\n\t\tdocStyle.setProperty('--progressBar-percent', `${this.#percent}%`);\n\t}\n\n\tsetWidth(viewer) {\n\t\tif (!viewer) {\n\t\t\treturn;\n\t\t}\n\t\tconst container = viewer.parentNode;\n\t\tconst scrollbarWidth = container.offsetWidth - viewer.offsetWidth;\n\t\tif (scrollbarWidth > 0) {\n\t\t\tdocStyle.setProperty(\n\t\t\t\t'--progressBar-end-offset',\n\t\t\t\t`${scrollbarWidth}px`,\n\t\t\t);\n\t\t}\n\t}\n\n\thide() {\n\t\tif (!this.#visible) {\n\t\t\treturn;\n\t\t}\n\t\tthis.#visible = false;\n\t\tthis.#classList.add('hidden');\n\t}\n\n\tshow() {\n\t\tif (this.#visible) {\n\t\t\treturn;\n\t\t}\n\t\tthis.#visible = true;\n\t\tthis.#classList.remove('hidden');\n\t}\n}\n\n/**\n * Get the active or focused element in current DOM.\n *\n * Recursively search for the truly active or focused element in case there are\n * shadow DOMs.\n *\n * @returns {Element} the truly active or focused element.\n */\nfunction getActiveOrFocusedElement() {\n\tlet curRoot = document;\n\tlet curActiveOrFocused =\n\t\tcurRoot.activeElement || curRoot.querySelector(':focus');\n\n\twhile (curActiveOrFocused?.shadowRoot) {\n\t\tcurRoot = curActiveOrFocused.shadowRoot;\n\t\tcurActiveOrFocused =\n\t\t\tcurRoot.activeElement || curRoot.querySelector(':focus');\n\t}\n\n\treturn curActiveOrFocused;\n}\n\n/**\n * Converts API PageLayout values to the format used by `BaseViewer`.\n * NOTE: This is supported to the extent that the viewer implements the\n * necessary Scroll/Spread modes (since SinglePage, TwoPageLeft,\n * and TwoPageRight all suggests using non-continuous scrolling).\n * @param {string} mode - The API PageLayout value.\n * @returns {Object}\n */\nfunction apiPageLayoutToViewerModes(layout) {\n\tlet scrollMode = ScrollMode.VERTICAL,\n\t\tspreadMode = SpreadMode.NONE;\n\n\tswitch (layout) {\n\t\tcase 'SinglePage':\n\t\t\tscrollMode = ScrollMode.PAGE;\n\t\t\tbreak;\n\t\tcase 'OneColumn':\n\t\t\tbreak;\n\t\tcase 'TwoPageLeft':\n\t\t\tscrollMode = ScrollMode.PAGE;\n\t\t/* falls through */\n\t\tcase 'TwoColumnLeft':\n\t\t\tspreadMode = SpreadMode.ODD;\n\t\t\tbreak;\n\t\tcase 'TwoPageRight':\n\t\t\tscrollMode = ScrollMode.PAGE;\n\t\t/* falls through */\n\t\tcase 'TwoColumnRight':\n\t\t\tspreadMode = SpreadMode.EVEN;\n\t\t\tbreak;\n\t}\n\treturn { scrollMode, spreadMode };\n}\n\n/**\n * Converts API PageMode values to the format used by `PDFSidebar`.\n * NOTE: There's also a \"FullScreen\" parameter which is not possible to support,\n * since the Fullscreen API used in browsers requires that entering\n * fullscreen mode only occurs as a result of a user-initiated event.\n * @param {string} mode - The API PageMode value.\n * @returns {number} A value from {SidebarView}.\n */\nfunction apiPageModeToSidebarView(mode) {\n\tswitch (mode) {\n\t\tcase 'UseNone':\n\t\t\treturn SidebarView.NONE;\n\t\tcase 'UseThumbs':\n\t\t\treturn SidebarView.THUMBS;\n\t\tcase 'UseOutlines':\n\t\t\treturn SidebarView.OUTLINE;\n\t\tcase 'UseAttachments':\n\t\t\treturn SidebarView.ATTACHMENTS;\n\t\tcase 'UseOC':\n\t\t\treturn SidebarView.LAYERS;\n\t}\n\treturn SidebarView.NONE; // Default value.\n}\n\nexport {\n\tanimationStarted,\n\tapiPageLayoutToViewerModes,\n\tapiPageModeToSidebarView,\n\tapproximateFraction,\n\tAutoPrintRegExp,\n\tbacktrackBeforeAllVisibleElements, // only exported for testing\n\tbinarySearchFirstItem,\n\tDEFAULT_SCALE,\n\tDEFAULT_SCALE_DELTA,\n\tDEFAULT_SCALE_VALUE,\n\tdocStyle,\n\tgetActiveOrFocusedElement,\n\tgetPageSizeInches,\n\tgetVisibleElements,\n\tisPortraitOrientation,\n\tisValidRotation,\n\tisValidScrollMode,\n\tisValidSpreadMode,\n\tMAX_AUTO_SCALE,\n\tMAX_SCALE,\n\tMIN_SCALE,\n\tnoContextMenuHandler,\n\tnormalizeWheelEventDelta,\n\tnormalizeWheelEventDirection,\n\tOutputScale,\n\tparseQueryString,\n\tPresentationModeState,\n\tProgressBar,\n\tremoveNullCharacters,\n\tRendererType,\n\tRenderingStates,\n\troundToDivide,\n\tSCROLLBAR_PADDING,\n\tscrollIntoView,\n\tScrollMode,\n\tSidebarView,\n\tSpreadMode,\n\tTextLayerMode,\n\tUNKNOWN_SCALE,\n\tVERTICAL_PADDING,\n\twatchScroll,\n};\n","/* Copyright 2016 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n\tanimationStarted,\n\tDEFAULT_SCALE,\n\tDEFAULT_SCALE_VALUE,\n\tdocStyle,\n\tMAX_SCALE,\n\tMIN_SCALE,\n\tnoContextMenuHandler,\n} from './ui_utils.js';\nimport { AnnotationEditorType } from 'pdfjs-dist';\n\nconst PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading';\n\n/**\n * @typedef {Object} ToolbarOptions\n * @property {HTMLDivElement} container - Container for the secondary toolbar.\n * @property {HTMLSpanElement} numPages - Label that contains number of pages.\n * @property {HTMLInputElement} pageNumber - Control for display and user input\n * of the current page number.\n * @property {HTMLSelectElement} scaleSelect - Scale selection control.\n * Its width is adjusted, when necessary, on UI localization.\n * @property {HTMLOptionElement} customScaleOption - The item used to display\n * a non-predefined scale.\n * @property {HTMLButtonElement} previous - Button to go to the previous page.\n * @property {HTMLButtonElement} next - Button to go to the next page.\n * @property {HTMLButtonElement} zoomIn - Button to zoom in the pages.\n * @property {HTMLButtonElement} zoomOut - Button to zoom out the pages.\n * @property {HTMLButtonElement} viewFind - Button to open find bar.\n * @property {HTMLButtonElement} openFile - Button to open a new document.\n * @property {HTMLButtonElement} presentationModeButton - Button to switch to\n * presentation mode.\n * @property {HTMLButtonElement} editorNoneButton - Button to disable editing.\n * @property {HTMLButtonElement} editorFreeTextButton - Button to switch to\n * FreeText editing.\n * @property {HTMLButtonElement} download - Button to download the document.\n * @property {HTMLAnchorElement} viewBookmark - Button to obtain a bookmark link\n * to the current location in the document.\n */\n\nclass Toolbar {\n\t#wasLocalized = false;\n\n\t/**\n\t * @param {ToolbarOptions} options\n\t * @param {EventBus} eventBus\n\t * @param {IL10n} l10n - Localization service.\n\t */\n\tconstructor(options, eventBus, l10n) {\n\t\tthis.toolbar = options.container;\n\t\tthis.eventBus = eventBus;\n\t\tthis.l10n = l10n;\n\t\tthis.buttons = [\n\t\t\t{ element: options.previous, eventName: 'previouspage' },\n\t\t\t{ element: options.next, eventName: 'nextpage' },\n\t\t\t{ element: options.zoomIn, eventName: 'zoomin' },\n\t\t\t{ element: options.zoomOut, eventName: 'zoomout' },\n\t\t\t{ element: options.print, eventName: 'print' },\n\t\t\t{ element: options.download, eventName: 'download' },\n\t\t];\n\n\t\tthis.items = {\n\t\t\tnumPages: options.numPages,\n\t\t\tpageNumber: options.pageNumber,\n\t\t\tscaleSelect: options.scaleSelect,\n\t\t\tcustomScaleOption: options.customScaleOption,\n\t\t\tprevious: options.previous,\n\t\t\tnext: options.next,\n\t\t\tzoomIn: options.zoomIn,\n\t\t\tzoomOut: options.zoomOut,\n\t\t\tfullscreen: options.fullscreen,\n\t\t};\n\n\t\t// Bind the event listeners for click and various other actions.\n\t\tthis.#bindListeners(options);\n\n\t\tthis.reset();\n\t}\n\n\tsetPageNumber(pageNumber, pageLabel) {\n\t\tthis.pageNumber = pageNumber;\n\t\tthis.pageLabel = pageLabel;\n\t\tthis.#updateUIState(false);\n\t}\n\n\tsetPagesCount(pagesCount, hasPageLabels) {\n\t\tthis.pagesCount = pagesCount;\n\t\tthis.hasPageLabels = hasPageLabels;\n\t\tthis.#updateUIState(true);\n\t}\n\n\tsetPageScale(pageScaleValue, pageScale) {\n\t\tthis.pageScaleValue = (pageScaleValue || pageScale).toString();\n\t\tthis.pageScale = pageScale;\n\t\tthis.#updateUIState(false);\n\t}\n\n\treset() {\n\t\tthis.pageNumber = 0;\n\t\tthis.pageLabel = null;\n\t\tthis.hasPageLabels = false;\n\t\tthis.pagesCount = 0;\n\t\tthis.pageScaleValue = DEFAULT_SCALE_VALUE;\n\t\tthis.pageScale = DEFAULT_SCALE;\n\t\tthis.#updateUIState(true);\n\t\tthis.updateLoadingIndicatorState();\n\n\t\t// Reset the Editor buttons too, since they're document specific.\n\t\tthis.eventBus.dispatch('toolbarreset', { source: this });\n\t}\n\n\t#bindListeners(options) {\n\t\tconst { pageNumber, scaleSelect, fullscreen } = this.items;\n\t\tconst self = this;\n\n\t\t// The buttons within the toolbar.\n\t\tfor (const { element, eventName, eventDetails } of this.buttons) {\n\t\t\tfor (let i = 0; i < element.length; i++) {\n\t\t\t\telement[i].addEventListener('click', (evt) => {\n\t\t\t\t\tif (eventName !== null) {\n\t\t\t\t\t\tconst details = { source: this };\n\t\t\t\t\t\tif (eventDetails) {\n\t\t\t\t\t\t\tfor (const property in eventDetails) {\n\t\t\t\t\t\t\t\tdetails[property] = eventDetails[property];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.eventBus.dispatch(eventName, details);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < pageNumber.length; i++) {\n\t\t\tpageNumber[i].addEventListener('click', function () {\n\t\t\t\tthis.select();\n\t\t\t});\n\t\t\tpageNumber[i].addEventListener('change', function () {\n\t\t\t\tself.eventBus.dispatch('pagenumberchanged', {\n\t\t\t\t\tsource: self,\n\t\t\t\t\tvalue: this.value,\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\tfor (let i = 0; i < scaleSelect.length; i++) {\n\t\t\tscaleSelect[i].addEventListener('change', function () {\n\t\t\t\tif (this.value === 'custom') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tself.eventBus.dispatch('scalechanged', {\n\t\t\t\t\tsource: self,\n\t\t\t\t\tvalue: this.value,\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tfor (let i = 0; i < fullscreen.length; i++) {\n\t\t\tfullscreen[i].addEventListener('click', function (evt) {\n\t\t\t\tconst target = evt.target;\n\t\t\t\tlet pdf_target_id = target.getAttribute('data-pdf-id');\n\t\t\t\tlet frame = window.parent.document.querySelector(\n\t\t\t\t\t'#wppdf-emb-iframe-' + pdf_target_id,\n\t\t\t\t);\n\n\t\t\t\tlet container = window.parent.document.querySelector(\n\t\t\t\t\t'#wppdfemb-frame-container-' + pdf_target_id,\n\t\t\t\t);\n\n\t\t\t\tif (frame.classList.contains('wppdf-fullscreen')) {\n\t\t\t\t\tcontainer.append(frame);\n\t\t\t\t\tframe.classList.remove('wppdf-fullscreen');\n\t\t\t\t} else {\n\t\t\t\t\tframe.classList.add('wppdf-fullscreen');\n\t\t\t\t\tparent.document.body.append(frame);\n\t\t\t\t}\n\t\t\t});\n\t\t\tlet deboune;\n\t\t\twindow.parent.document.addEventListener('keyup', function (e) {\n\t\t\t\tswitch (e.keyCode) {\n\t\t\t\t\tcase 27: // Escape\n\t\t\t\t\t\tlet pdf_target_id =\n\t\t\t\t\t\t\tfullscreen[i].getAttribute('data-pdf-id');\n\n\t\t\t\t\t\tlet frame = window.parent.document.getElementById(\n\t\t\t\t\t\t\t'wppdf-emb-iframe-' + pdf_target_id,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tlet container = window.parent.document.querySelector(\n\t\t\t\t\t\t\t'#wppdfemb-frame-container-' + pdf_target_id,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (frame.classList.contains('wppdf-fullscreen')) {\n\t\t\t\t\t\t\tframe.classList.remove('wppdf-fullscreen');\n\t\t\t\t\t\t\tcontainer.appendChild(frame);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t\tdocument.addEventListener('keyup', function (e) {\n\t\t\t\tswitch (e.keyCode) {\n\t\t\t\t\tcase 27: // Escape\n\t\t\t\t\t\tlet pdf_target_id =\n\t\t\t\t\t\t\tfullscreen[i].getAttribute('data-pdf-id');\n\n\t\t\t\t\t\tlet frame = window.parent.document.getElementById(\n\t\t\t\t\t\t\t'wppdf-emb-iframe-' + pdf_target_id,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tlet container = window.parent.document.querySelector(\n\t\t\t\t\t\t\t'#wppdfemb-frame-container-' + pdf_target_id,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (frame.classList.contains('wppdf-fullscreen')) {\n\t\t\t\t\t\t\tframe.classList.remove('wppdf-fullscreen');\n\t\t\t\t\t\t\tcontainer.appendChild(frame);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t// Here we depend on browsers dispatching the \"click\" event *after* the\n\t\t// \"change\" event, when the <select>-element changes.\n\t\tfor (let i = 0; i < scaleSelect.length; i++) {\n\t\t\tscaleSelect[i].addEventListener('click', function (evt) {\n\t\t\t\tconst target = evt.target;\n\t\t\t\t// Remove focus when an <option>-element was *clicked*, to improve the UX\n\t\t\t\t// for mouse users (fixes bug 1300525 and issue 4923).\n\t\t\t\tif (\n\t\t\t\t\tthis.value === self.pageScaleValue &&\n\t\t\t\t\ttarget.tagName.toUpperCase() === 'OPTION'\n\t\t\t\t) {\n\t\t\t\t\tthis.blur();\n\t\t\t\t}\n\t\t\t});\n\t\t\t// Suppress context menus for some controls.\n\t\t\tscaleSelect[i].oncontextmenu = noContextMenuHandler;\n\t\t}\n\n\t\tthis.eventBus._on('localized', () => {\n\t\t\tthis.#wasLocalized = true;\n\t\t\tthis.#adjustScaleWidth();\n\t\t\tthis.#updateUIState(true);\n\t\t});\n\t}\n\n\t#bindEditorToolsListener({\n\t\teditorNoneButton,\n\t\teditorFreeTextButton,\n\t\teditorFreeTextParamsToolbar,\n\t\teditorInkButton,\n\t\teditorInkParamsToolbar,\n\t}) {\n\t\tconst editorModeChanged = (evt, disableButtons = false) => {\n\t\t\tconst editorButtons = [\n\t\t\t\t{ mode: AnnotationEditorType.NONE, button: editorNoneButton },\n\t\t\t\t{\n\t\t\t\t\tmode: AnnotationEditorType.FREETEXT,\n\t\t\t\t\tbutton: editorFreeTextButton,\n\t\t\t\t\ttoolbar: editorFreeTextParamsToolbar,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmode: AnnotationEditorType.INK,\n\t\t\t\t\tbutton: editorInkButton,\n\t\t\t\t\ttoolbar: editorInkParamsToolbar,\n\t\t\t\t},\n\t\t\t];\n\n\t\t\tfor (const { mode, button, toolbar } of editorButtons) {\n\t\t\t\tconst checked = mode === evt.mode;\n\t\t\t\tbutton.classList.toggle('toggled', checked);\n\t\t\t\tbutton.setAttribute('aria-checked', checked);\n\t\t\t\tbutton.disabled = disableButtons;\n\t\t\t\tif (toolbar) {\n\t\t\t\t\ttoolbar.classList.toggle('hidden', !checked);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis.eventBus._on('annotationeditormodechanged', editorModeChanged);\n\n\t\tthis.eventBus._on('toolbarreset', (evt) => {\n\t\t\tif (evt.source === this) {\n\t\t\t\teditorModeChanged(\n\t\t\t\t\t{ mode: AnnotationEditorType.NONE },\n\t\t\t\t\t/* disableButtons = */ true,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t}\n\n\t#updateUIState(resetNumPages = false) {\n\t\tif (!this.#wasLocalized) {\n\t\t\t// Don't update the UI state until we localize the toolbar.\n\t\t\treturn;\n\t\t}\n\t\tconst { pageNumber, pagesCount, pageScaleValue, pageScale, items } =\n\t\t\tthis;\n\n\t\tif (resetNumPages) {\n\t\t\tif (this.hasPageLabels) {\n\t\t\t\titems.pageNumber.type = 'text';\n\t\t\t} else {\n\t\t\t\titems.pageNumber.type = 'number';\n\t\t\t\tthis.l10n.get('of_pages', { pagesCount }).then((msg) => {\n\t\t\t\t\titems.numPages.textContent = msg;\n\t\t\t\t});\n\t\t\t}\n\t\t\titems.pageNumber.max = pagesCount;\n\t\t}\n\n\t\tif (this.hasPageLabels) {\n\t\t\titems.pageNumber.value = this.pageLabel;\n\t\t\tthis.l10n\n\t\t\t\t.get('page_of_pages', { pageNumber, pagesCount })\n\t\t\t\t.then((msg) => {\n\t\t\t\t\titems.numPages.textContent = msg;\n\t\t\t\t});\n\t\t} else {\n\t\t\titems.pageNumber.value = pageNumber;\n\t\t}\n\n\t\titems.previous.disabled = pageNumber <= 1;\n\t\titems.next.disabled = pageNumber >= pagesCount;\n\n\t\titems.zoomOut.disabled = pageScale <= MIN_SCALE;\n\t\titems.zoomIn.disabled = pageScale >= MAX_SCALE;\n\n\t\tthis.l10n\n\t\t\t.get('page_scale_percent', {\n\t\t\t\tscale: Math.round(pageScale * 10000) / 100,\n\t\t\t})\n\t\t\t.then((msg) => {\n\t\t\t\tlet predefinedValueFound = false;\n\t\t\t\tfor (const option of items.scaleSelect.options) {\n\t\t\t\t\tif (option.value !== pageScaleValue) {\n\t\t\t\t\t\toption.selected = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\toption.selected = true;\n\t\t\t\t\tpredefinedValueFound = true;\n\t\t\t\t}\n\t\t\t\tif (!predefinedValueFound) {\n\t\t\t\t\titems.customScaleOption.textContent = msg;\n\t\t\t\t\titems.customScaleOption.selected = true;\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tupdateLoadingIndicatorState(loading = false) {\n\t\tconst { pageNumber } = this.items;\n\t\tfor (let i = 0; i < pageNumber.length; i++) {\n\t\t\tlet pageNumberID = document.getElementById(pageNumber[i].id);\n\t\t\tpageNumberID.classList.toggle(\n\t\t\t\tPAGE_NUMBER_LOADING_INDICATOR,\n\t\t\t\tloading,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Increase the width of the zoom dropdown DOM element if, and only if, it's\n\t * too narrow to fit the *longest* of the localized strings.\n\t */\n\tasync #adjustScaleWidth() {\n\t\tconst { items, l10n } = this;\n\n\t\tconst predefinedValuesPromise = Promise.all([\n\t\t\tl10n.get('page_scale_auto'),\n\t\t\tl10n.get('page_scale_actual'),\n\t\t\tl10n.get('page_scale_fit'),\n\t\t\tl10n.get('page_scale_width'),\n\t\t]);\n\t\tawait animationStarted;\n\n\t\tconst style = getComputedStyle(items.scaleSelect),\n\t\t\tscaleSelectContainerWidth = parseInt(\n\t\t\t\tstyle.getPropertyValue('--scale-select-container-width'),\n\t\t\t\t10,\n\t\t\t),\n\t\t\tscaleSelectOverflow = parseInt(\n\t\t\t\tstyle.getPropertyValue('--scale-select-overflow'),\n\t\t\t\t10,\n\t\t\t);\n\n\t\t// The temporary canvas is used to measure text length in the DOM.\n\t\tconst canvas = document.createElement('canvas');\n\t\tconst ctx = canvas.getContext('2d', { alpha: false });\n\t\tctx.font = `${style.fontSize} ${style.fontFamily}`;\n\n\t\tlet maxWidth = 0;\n\t\tfor (const predefinedValue of await predefinedValuesPromise) {\n\t\t\tconst { width } = ctx.measureText(predefinedValue);\n\t\t\tif (width > maxWidth) {\n\t\t\t\tmaxWidth = width;\n\t\t\t}\n\t\t}\n\t\tmaxWidth += 2 * scaleSelectOverflow;\n\n\t\tif (maxWidth > scaleSelectContainerWidth) {\n\t\t\tdocStyle.setProperty(\n\t\t\t\t'--scale-select-container-width',\n\t\t\t\t`${maxWidth}px`,\n\t\t\t);\n\t\t}\n\t\t// Zeroing the width and height cause Firefox to release graphics resources\n\t\t// immediately, which can greatly reduce memory consumption.\n\t\tcanvas.width = 0;\n\t\tcanvas.height = 0;\n\t}\n}\n\nexport { Toolbar };\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst CharacterType = {\n\tSPACE: 0,\n\tALPHA_LETTER: 1,\n\tPUNCT: 2,\n\tHAN_LETTER: 3,\n\tKATAKANA_LETTER: 4,\n\tHIRAGANA_LETTER: 5,\n\tHALFWIDTH_KATAKANA_LETTER: 6,\n\tTHAI_LETTER: 7,\n};\n\nfunction isAlphabeticalScript(charCode) {\n\treturn charCode < 0x2e80;\n}\n\nfunction isAscii(charCode) {\n\treturn (charCode & 0xff80) === 0;\n}\n\nfunction isAsciiAlpha(charCode) {\n\treturn (\n\t\t(charCode >= /* a = */ 0x61 && charCode <= /* z = */ 0x7a) ||\n\t\t(charCode >= /* A = */ 0x41 && charCode <= /* Z = */ 0x5a)\n\t);\n}\n\nfunction isAsciiDigit(charCode) {\n\treturn charCode >= /* 0 = */ 0x30 && charCode <= /* 9 = */ 0x39;\n}\n\nfunction isAsciiSpace(charCode) {\n\treturn (\n\t\tcharCode === /* SPACE = */ 0x20 ||\n\t\tcharCode === /* TAB = */ 0x09 ||\n\t\tcharCode === /* CR = */ 0x0d ||\n\t\tcharCode === /* LF = */ 0x0a\n\t);\n}\n\nfunction isHan(charCode) {\n\treturn (\n\t\t(charCode >= 0x3400 && charCode <= 0x9fff) ||\n\t\t(charCode >= 0xf900 && charCode <= 0xfaff)\n\t);\n}\n\nfunction isKatakana(charCode) {\n\treturn charCode >= 0x30a0 && charCode <= 0x30ff;\n}\n\nfunction isHiragana(charCode) {\n\treturn charCode >= 0x3040 && charCode <= 0x309f;\n}\n\nfunction isHalfwidthKatakana(charCode) {\n\treturn charCode >= 0xff60 && charCode <= 0xff9f;\n}\n\nfunction isThai(charCode) {\n\treturn (charCode & 0xff80) === 0x0e00;\n}\n\n/**\n * This function is based on the word-break detection implemented in:\n * https://hg.mozilla.org/mozilla-central/file/tip/intl/lwbrk/WordBreaker.cpp\n */\nfunction getCharacterType(charCode) {\n\tif (isAlphabeticalScript(charCode)) {\n\t\tif (isAscii(charCode)) {\n\t\t\tif (isAsciiSpace(charCode)) {\n\t\t\t\treturn CharacterType.SPACE;\n\t\t\t} else if (\n\t\t\t\tisAsciiAlpha(charCode) ||\n\t\t\t\tisAsciiDigit(charCode) ||\n\t\t\t\tcharCode === /* UNDERSCORE = */ 0x5f\n\t\t\t) {\n\t\t\t\treturn CharacterType.ALPHA_LETTER;\n\t\t\t}\n\t\t\treturn CharacterType.PUNCT;\n\t\t} else if (isThai(charCode)) {\n\t\t\treturn CharacterType.THAI_LETTER;\n\t\t} else if (charCode === /* NBSP = */ 0xa0) {\n\t\t\treturn CharacterType.SPACE;\n\t\t}\n\t\treturn CharacterType.ALPHA_LETTER;\n\t}\n\n\tif (isHan(charCode)) {\n\t\treturn CharacterType.HAN_LETTER;\n\t} else if (isKatakana(charCode)) {\n\t\treturn CharacterType.KATAKANA_LETTER;\n\t} else if (isHiragana(charCode)) {\n\t\treturn CharacterType.HIRAGANA_LETTER;\n\t} else if (isHalfwidthKatakana(charCode)) {\n\t\treturn CharacterType.HALFWIDTH_KATAKANA_LETTER;\n\t}\n\treturn CharacterType.ALPHA_LETTER;\n}\n\nexport { CharacterType, getCharacterType };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../src/display/api\").PDFDocumentProxy} PDFDocumentProxy */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { binarySearchFirstItem, scrollIntoView } from './ui_utils.js';\nimport { getCharacterType } from './pdf_find_utils.js';\nconst { createPromiseCapability } = require('pdfjs-dist');\n\nconst FindState = {\n\tFOUND: 0,\n\tNOT_FOUND: 1,\n\tWRAPPED: 2,\n\tPENDING: 3,\n};\n\nconst FIND_TIMEOUT = 250; // ms\nconst MATCH_SCROLL_OFFSET_TOP = -50; // px\nconst MATCH_SCROLL_OFFSET_LEFT = -400; // px\n\nconst CHARACTERS_TO_NORMALIZE = {\n\t'\\u2010': '-', // Hyphen\n\t'\\u2018': \"'\", // Left single quotation mark\n\t'\\u2019': \"'\", // Right single quotation mark\n\t'\\u201A': \"'\", // Single low-9 quotation mark\n\t'\\u201B': \"'\", // Single high-reversed-9 quotation mark\n\t'\\u201C': '\"', // Left double quotation mark\n\t'\\u201D': '\"', // Right double quotation mark\n\t'\\u201E': '\"', // Double low-9 quotation mark\n\t'\\u201F': '\"', // Double high-reversed-9 quotation mark\n\t'\\u00BC': '1/4', // Vulgar fraction one quarter\n\t'\\u00BD': '1/2', // Vulgar fraction one half\n\t'\\u00BE': '3/4', // Vulgar fraction three quarters\n};\n\n// These diacritics aren't considered as combining diacritics\n// when searching in a document:\n// https://searchfox.org/mozilla-central/source/intl/unicharutil/util/is_combining_diacritic.py.\n// The combining class definitions can be found:\n// https://www.unicode.org/reports/tr44/#Canonical_Combining_Class_Values\n// Category 0 corresponds to [^\\p{Mn}].\nconst DIACRITICS_EXCEPTION = new Set([\n\t// UNICODE_COMBINING_CLASS_KANA_VOICING\n\t// https://www.compart.com/fr/unicode/combining/8\n\t0x3099, 0x309a,\n\t// UNICODE_COMBINING_CLASS_VIRAMA (under 0xFFFF)\n\t// https://www.compart.com/fr/unicode/combining/9\n\t0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b,\n\t0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714,\n\t0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f,\n\t0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed,\n\t// 91\n\t// https://www.compart.com/fr/unicode/combining/91\n\t0x0c56,\n\t// 129\n\t// https://www.compart.com/fr/unicode/combining/129\n\t0x0f71,\n\t// 130\n\t// https://www.compart.com/fr/unicode/combining/130\n\t0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80,\n\t// 132\n\t// https://www.compart.com/fr/unicode/combining/132\n\t0x0f74,\n]);\nconst DIACRITICS_EXCEPTION_STR = [...DIACRITICS_EXCEPTION.values()]\n\t.map((x) => String.fromCharCode(x))\n\t.join('');\n\nconst DIACRITICS_REG_EXP = /\\p{M}+/gu;\nconst SPECIAL_CHARS_REG_EXP =\n\t/([.*+?^${}()|[\\]\\\\])|(\\p{P})|(\\s+)|(\\p{M})|(\\p{L})/gu;\nconst NOT_DIACRITIC_FROM_END_REG_EXP = /([^\\p{M}])\\p{M}*$/u;\nconst NOT_DIACRITIC_FROM_START_REG_EXP = /^\\p{M}*([^\\p{M}])/u;\n\n// The range [AC00-D7AF] corresponds to the Hangul syllables.\n// The few other chars are some CJK Compatibility Ideographs.\nconst SYLLABLES_REG_EXP = /[\\uAC00-\\uD7AF\\uFA6C\\uFACF-\\uFAD1\\uFAD5-\\uFAD7]+/g;\nconst SYLLABLES_LENGTHS = new Map();\n// When decomposed (in using NFD) the above syllables will start\n// with one of the chars in this regexp.\nconst FIRST_CHAR_SYLLABLES_REG_EXP =\n\t'[\\\\u1100-\\\\u1112\\\\ud7a4-\\\\ud7af\\\\ud84a\\\\ud84c\\\\ud850\\\\ud854\\\\ud857\\\\ud85f]';\n\nlet noSyllablesRegExp = null;\nlet withSyllablesRegExp = null;\n\nfunction normalize(text) {\n\t// The diacritics in the text or in the query can be composed or not.\n\t// So we use a decomposed text using NFD (and the same for the query)\n\t// in order to be sure that diacritics are in the same order.\n\n\t// Collect syllables length and positions.\n\tconst syllablePositions = [];\n\tlet m;\n\twhile ((m = SYLLABLES_REG_EXP.exec(text)) !== null) {\n\t\tlet { index } = m;\n\t\tfor (const char of m[0]) {\n\t\t\tlet len = SYLLABLES_LENGTHS.get(char);\n\t\t\tif (!len) {\n\t\t\t\tlen = char.normalize('NFD').length;\n\t\t\t\tSYLLABLES_LENGTHS.set(char, len);\n\t\t\t}\n\t\t\tsyllablePositions.push([len, index++]);\n\t\t}\n\t}\n\n\tlet normalizationRegex;\n\tif (syllablePositions.length === 0 && noSyllablesRegExp) {\n\t\tnormalizationRegex = noSyllablesRegExp;\n\t} else if (syllablePositions.length > 0 && withSyllablesRegExp) {\n\t\tnormalizationRegex = withSyllablesRegExp;\n\t} else {\n\t\t// Compile the regular expression for text normalization once.\n\t\tconst replace = Object.keys(CHARACTERS_TO_NORMALIZE).join('');\n\t\tconst regexp = `([${replace}])|(\\\\p{M}+(?:-\\\\n)?)|(\\\\S-\\\\n)|(\\\\n)`;\n\n\t\tif (syllablePositions.length === 0) {\n\t\t\t// Most of the syllables belong to Hangul so there are no need\n\t\t\t// to search for them in a non-Hangul document.\n\t\t\t// We use the \\0 in order to have the same number of groups.\n\t\t\tnormalizationRegex = noSyllablesRegExp = new RegExp(\n\t\t\t\tregexp + '|(\\\\u0000)',\n\t\t\t\t'gum',\n\t\t\t);\n\t\t} else {\n\t\t\tnormalizationRegex = withSyllablesRegExp = new RegExp(\n\t\t\t\tregexp + `|(${FIRST_CHAR_SYLLABLES_REG_EXP})`,\n\t\t\t\t'gum',\n\t\t\t);\n\t\t}\n\t}\n\n\t// The goal of this function is to normalize the string and\n\t// be able to get from an index in the new string the\n\t// corresponding index in the old string.\n\t// For example if we have: abCd12ef456gh where C is replaced by ccc\n\t// and numbers replaced by nothing (it's the case for diacritics), then\n\t// we'll obtain the normalized string: abcccdefgh.\n\t// So here the reverse map is: [0,1,2,2,2,3,6,7,11,12].\n\n\t// The goal is to obtain the array: [[0, 0], [3, -1], [4, -2],\n\t// [6, 0], [8, 3]].\n\t// which can be used like this:\n\t// - let say that i is the index in new string and j the index\n\t// the old string.\n\t// - if i is in [0; 3[ then j = i + 0\n\t// - if i is in [3; 4[ then j = i - 1\n\t// - if i is in [4; 6[ then j = i - 2\n\t// ...\n\t// Thanks to a binary search it's easy to know where is i and what's the\n\t// shift.\n\t// Let say that the last entry in the array is [x, s] and we have a\n\t// substitution at index y (old string) which will replace o chars by n chars.\n\t// Firstly, if o === n, then no need to add a new entry: the shift is\n\t// the same.\n\t// Secondly, if o < n, then we push the n - o elements:\n\t// [y - (s - 1), s - 1], [y - (s - 2), s - 2], ...\n\t// Thirdly, if o > n, then we push the element: [y - (s - n), o + s - n]\n\n\t// Collect diacritics length and positions.\n\tconst rawDiacriticsPositions = [];\n\twhile ((m = DIACRITICS_REG_EXP.exec(text)) !== null) {\n\t\trawDiacriticsPositions.push([m[0].length, m.index]);\n\t}\n\n\tlet normalized = text.normalize('NFD');\n\tconst positions = [[0, 0]];\n\tlet rawDiacriticsIndex = 0;\n\tlet syllableIndex = 0;\n\tlet shift = 0;\n\tlet shiftOrigin = 0;\n\tlet eol = 0;\n\tlet hasDiacritics = false;\n\n\tnormalized = normalized.replace(\n\t\tnormalizationRegex,\n\t\t(match, p1, p2, p3, p4, p5, i) => {\n\t\t\ti -= shiftOrigin;\n\t\t\tif (p1) {\n\t\t\t\t// Maybe fractions or quotations mark...\n\t\t\t\tconst replacement = CHARACTERS_TO_NORMALIZE[match];\n\t\t\t\tconst jj = replacement.length;\n\t\t\t\tfor (let j = 1; j < jj; j++) {\n\t\t\t\t\tpositions.push([i - shift + j, shift - j]);\n\t\t\t\t}\n\t\t\t\tshift -= jj - 1;\n\t\t\t\treturn replacement;\n\t\t\t}\n\n\t\t\tif (p2) {\n\t\t\t\tconst hasTrailingDashEOL = p2.endsWith('\\n');\n\t\t\t\tconst len = hasTrailingDashEOL ? p2.length - 2 : p2.length;\n\n\t\t\t\t// Diacritics.\n\t\t\t\thasDiacritics = true;\n\t\t\t\tlet jj = len;\n\t\t\t\tif (\n\t\t\t\t\ti + eol ===\n\t\t\t\t\trawDiacriticsPositions[rawDiacriticsIndex]?.[1]\n\t\t\t\t) {\n\t\t\t\t\tjj -= rawDiacriticsPositions[rawDiacriticsIndex][0];\n\t\t\t\t\t++rawDiacriticsIndex;\n\t\t\t\t}\n\n\t\t\t\tfor (let j = 1; j <= jj; j++) {\n\t\t\t\t\t// i is the position of the first diacritic\n\t\t\t\t\t// so (i - 1) is the position for the letter before.\n\t\t\t\t\tpositions.push([i - 1 - shift + j, shift - j]);\n\t\t\t\t}\n\t\t\t\tshift -= jj;\n\t\t\t\tshiftOrigin += jj;\n\n\t\t\t\tif (hasTrailingDashEOL) {\n\t\t\t\t\t// Diacritics are followed by a -\\n.\n\t\t\t\t\t// See comments in `if (p3)` block.\n\t\t\t\t\ti += len - 1;\n\t\t\t\t\tpositions.push([i - shift + 1, 1 + shift]);\n\t\t\t\t\tshift += 1;\n\t\t\t\t\tshiftOrigin += 1;\n\t\t\t\t\teol += 1;\n\t\t\t\t\treturn p2.slice(0, len);\n\t\t\t\t}\n\n\t\t\t\treturn p2;\n\t\t\t}\n\n\t\t\tif (p3) {\n\t\t\t\t// \"X-\\n\" is removed because an hyphen at the end of a line\n\t\t\t\t// with not a space before is likely here to mark a break\n\t\t\t\t// in a word.\n\t\t\t\t// The \\n isn't in the original text so here y = i, n = 1 and o = 2.\n\t\t\t\tpositions.push([i - shift + 1, 1 + shift]);\n\t\t\t\tshift += 1;\n\t\t\t\tshiftOrigin += 1;\n\t\t\t\teol += 1;\n\t\t\t\treturn p3.charAt(0);\n\t\t\t}\n\n\t\t\tif (p4) {\n\t\t\t\t// eol is replaced by space: \"foo\\nbar\" is likely equivalent to\n\t\t\t\t// \"foo bar\".\n\t\t\t\tpositions.push([i - shift + 1, shift - 1]);\n\t\t\t\tshift -= 1;\n\t\t\t\tshiftOrigin += 1;\n\t\t\t\teol += 1;\n\t\t\t\treturn ' ';\n\t\t\t}\n\n\t\t\t// p5\n\t\t\tif (i + eol === syllablePositions[syllableIndex]?.[1]) {\n\t\t\t\t// A syllable (1 char) is replaced with several chars (n) so\n\t\t\t\t// newCharsLen = n - 1.\n\t\t\t\tconst newCharLen = syllablePositions[syllableIndex][0] - 1;\n\t\t\t\t++syllableIndex;\n\t\t\t\tfor (let j = 1; j <= newCharLen; j++) {\n\t\t\t\t\tpositions.push([i - (shift - j), shift - j]);\n\t\t\t\t}\n\t\t\t\tshift -= newCharLen;\n\t\t\t\tshiftOrigin += newCharLen;\n\t\t\t}\n\t\t\treturn p5;\n\t\t},\n\t);\n\n\tpositions.push([normalized.length, shift]);\n\n\treturn [normalized, positions, hasDiacritics];\n}\n\n// Determine the original, non-normalized, match index such that highlighting of\n// search results is correct in the `textLayer` for strings containing e.g. \"½\"\n// characters; essentially \"inverting\" the result of the `normalize` function.\nfunction getOriginalIndex(diffs, pos, len) {\n\tif (!diffs) {\n\t\treturn [pos, len];\n\t}\n\n\tconst start = pos;\n\tconst end = pos + len;\n\tlet i = binarySearchFirstItem(diffs, (x) => x[0] >= start);\n\tif (diffs[i][0] > start) {\n\t\t--i;\n\t}\n\n\tlet j = binarySearchFirstItem(diffs, (x) => x[0] >= end, i);\n\tif (diffs[j][0] > end) {\n\t\t--j;\n\t}\n\n\treturn [start + diffs[i][1], len + diffs[j][1] - diffs[i][1]];\n}\n\n/**\n * @typedef {Object} PDFFindControllerOptions\n * @property {IPDFLinkService} linkService - The navigation/linking service.\n * @property {EventBus} eventBus - The application event bus.\n */\n\n/**\n * Provides search functionality to find a given string in a PDF document.\n */\nclass PDFFindController {\n\t/**\n\t * @param {PDFFindControllerOptions} options\n\t */\n\tconstructor({ linkService, eventBus }) {\n\t\tthis._linkService = linkService;\n\t\tthis._eventBus = eventBus;\n\n\t\tthis.#reset();\n\t\teventBus._on('find', this.#onFind.bind(this));\n\t\teventBus._on('findbarclose', this.#onFindBarClose.bind(this));\n\t}\n\n\tget highlightMatches() {\n\t\treturn this._highlightMatches;\n\t}\n\n\tget pageMatches() {\n\t\treturn this._pageMatches;\n\t}\n\n\tget pageMatchesLength() {\n\t\treturn this._pageMatchesLength;\n\t}\n\n\tget selected() {\n\t\treturn this._selected;\n\t}\n\n\tget state() {\n\t\treturn this._state;\n\t}\n\n\t/**\n\t * Set a reference to the PDF document in order to search it.\n\t * Note that searching is not possible if this method is not called.\n\t *\n\t * @param {PDFDocumentProxy} pdfDocument - The PDF document to search.\n\t */\n\tsetDocument(pdfDocument) {\n\t\tif (this._pdfDocument) {\n\t\t\tthis.#reset();\n\t\t}\n\t\tif (!pdfDocument) {\n\t\t\treturn;\n\t\t}\n\t\tthis._pdfDocument = pdfDocument;\n\t\tthis._firstPageCapability.resolve();\n\t}\n\n\t#onFind(state) {\n\t\tif (!state) {\n\t\t\treturn;\n\t\t}\n\t\tconst pdfDocument = this._pdfDocument;\n\t\tconst { type } = state;\n\n\t\tif (this._state === null || this.#shouldDirtyMatch(state)) {\n\t\t\tthis._dirtyMatch = true;\n\t\t}\n\t\tthis._state = state;\n\t\tif (type !== 'highlightallchange') {\n\t\t\tthis.#updateUIState(FindState.PENDING);\n\t\t}\n\n\t\tthis._firstPageCapability.promise.then(() => {\n\t\t\t// If the document was closed before searching began, or if the search\n\t\t\t// operation was relevant for a previously opened document, do nothing.\n\t\t\tif (\n\t\t\t\t!this._pdfDocument ||\n\t\t\t\t(pdfDocument && this._pdfDocument !== pdfDocument)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.#extractText();\n\n\t\t\tconst findbarClosed = !this._highlightMatches;\n\t\t\tconst pendingTimeout = !!this._findTimeout;\n\n\t\t\tif (this._findTimeout) {\n\t\t\t\tclearTimeout(this._findTimeout);\n\t\t\t\tthis._findTimeout = null;\n\t\t\t}\n\t\t\tif (!type) {\n\t\t\t\t// Trigger the find action with a small delay to avoid starting the\n\t\t\t\t// search when the user is still typing (saving resources).\n\t\t\t\tthis._findTimeout = setTimeout(() => {\n\t\t\t\t\tthis.#nextMatch();\n\t\t\t\t\tthis._findTimeout = null;\n\t\t\t\t}, FIND_TIMEOUT);\n\t\t\t} else if (this._dirtyMatch) {\n\t\t\t\t// Immediately trigger searching for non-'find' operations, when the\n\t\t\t\t// current state needs to be reset and matches re-calculated.\n\t\t\t\tthis.#nextMatch();\n\t\t\t} else if (type === 'again') {\n\t\t\t\tthis.#nextMatch();\n\n\t\t\t\t// When the findbar was previously closed, and `highlightAll` is set,\n\t\t\t\t// ensure that the matches on all active pages are highlighted again.\n\t\t\t\tif (findbarClosed && this._state.highlightAll) {\n\t\t\t\t\tthis.#updateAllPages();\n\t\t\t\t}\n\t\t\t} else if (type === 'highlightallchange') {\n\t\t\t\t// If there was a pending search operation, synchronously trigger a new\n\t\t\t\t// search *first* to ensure that the correct matches are highlighted.\n\t\t\t\tif (pendingTimeout) {\n\t\t\t\t\tthis.#nextMatch();\n\t\t\t\t} else {\n\t\t\t\t\tthis._highlightMatches = true;\n\t\t\t\t}\n\t\t\t\tthis.#updateAllPages(); // Update the highlighting on all active pages.\n\t\t\t} else {\n\t\t\t\tthis.#nextMatch();\n\t\t\t}\n\t\t});\n\t}\n\n\tscrollMatchIntoView({\n\t\telement = null,\n\t\tselectedLeft = 0,\n\t\tpageIndex = -1,\n\t\tmatchIndex = -1,\n\t}) {\n\t\tif (!this._scrollMatches || !element) {\n\t\t\treturn;\n\t\t} else if (\n\t\t\tmatchIndex === -1 ||\n\t\t\tmatchIndex !== this._selected.matchIdx\n\t\t) {\n\t\t\treturn;\n\t\t} else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) {\n\t\t\treturn;\n\t\t}\n\t\tthis._scrollMatches = false; // Ensure that scrolling only happens once.\n\n\t\tconst spot = {\n\t\t\ttop: MATCH_SCROLL_OFFSET_TOP,\n\t\t\tleft: selectedLeft + MATCH_SCROLL_OFFSET_LEFT,\n\t\t};\n\t\tscrollIntoView(element, spot, /* scrollMatches = */ true);\n\t}\n\n\t#reset() {\n\t\tthis._highlightMatches = false;\n\t\tthis._scrollMatches = false;\n\t\tthis._pdfDocument = null;\n\t\tthis._pageMatches = [];\n\t\tthis._pageMatchesLength = [];\n\t\tthis._state = null;\n\t\t// Currently selected match.\n\t\tthis._selected = {\n\t\t\tpageIdx: -1,\n\t\t\tmatchIdx: -1,\n\t\t};\n\t\t// Where the find algorithm currently is in the document.\n\t\tthis._offset = {\n\t\t\tpageIdx: null,\n\t\t\tmatchIdx: null,\n\t\t\twrapped: false,\n\t\t};\n\t\tthis._extractTextPromises = [];\n\t\tthis._pageContents = []; // Stores the normalized text for each page.\n\t\tthis._pageDiffs = [];\n\t\tthis._hasDiacritics = [];\n\t\tthis._matchesCountTotal = 0;\n\t\tthis._pagesToSearch = null;\n\t\tthis._pendingFindMatches = new Set();\n\t\tthis._resumePageIdx = null;\n\t\tthis._dirtyMatch = false;\n\t\tclearTimeout(this._findTimeout);\n\t\tthis._findTimeout = null;\n\n\t\tthis._firstPageCapability = createPromiseCapability();\n\t}\n\n\t/**\n\t * @type {string} The (current) normalized search query.\n\t */\n\tget #query() {\n\t\tif (this._state.query !== this._rawQuery) {\n\t\t\tthis._rawQuery = this._state.query;\n\t\t\t[this._normalizedQuery] = normalize(this._state.query);\n\t\t}\n\t\treturn this._normalizedQuery;\n\t}\n\n\t#shouldDirtyMatch(state) {\n\t\t// When the search query changes, regardless of the actual search command\n\t\t// used, always re-calculate matches to avoid errors (fixes bug 1030622).\n\t\tif (state.query !== this._state.query) {\n\t\t\treturn true;\n\t\t}\n\t\tswitch (state.type) {\n\t\t\tcase 'again':\n\t\t\t\tconst pageNumber = this._selected.pageIdx + 1;\n\t\t\t\tconst linkService = this._linkService;\n\t\t\t\t// Only treat a 'findagain' event as a new search operation when it's\n\t\t\t\t// *absolutely* certain that the currently selected match is no longer\n\t\t\t\t// visible, e.g. as a result of the user scrolling in the document.\n\t\t\t\t//\n\t\t\t\t// NOTE: If only a simple `this._linkService.page` check was used here,\n\t\t\t\t// there's a risk that consecutive 'findagain' operations could \"skip\"\n\t\t\t\t// over matches at the top/bottom of pages thus making them completely\n\t\t\t\t// inaccessible when there's multiple pages visible in the viewer.\n\t\t\t\tif (\n\t\t\t\t\tpageNumber >= 1 &&\n\t\t\t\t\tpageNumber <= linkService.pagesCount &&\n\t\t\t\t\tpageNumber !== linkService.page &&\n\t\t\t\t\t!linkService.isPageVisible(pageNumber)\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\tcase 'highlightallchange':\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Determine if the search query constitutes a \"whole word\", by comparing the\n\t * first/last character type with the preceding/following character type.\n\t */\n\t#isEntireWord(content, startIdx, length) {\n\t\tlet match = content\n\t\t\t.slice(0, startIdx)\n\t\t\t.match(NOT_DIACRITIC_FROM_END_REG_EXP);\n\t\tif (match) {\n\t\t\tconst first = content.charCodeAt(startIdx);\n\t\t\tconst limit = match[1].charCodeAt(0);\n\t\t\tif (getCharacterType(first) === getCharacterType(limit)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tmatch = content\n\t\t\t.slice(startIdx + length)\n\t\t\t.match(NOT_DIACRITIC_FROM_START_REG_EXP);\n\t\tif (match) {\n\t\t\tconst last = content.charCodeAt(startIdx + length - 1);\n\t\t\tconst limit = match[1].charCodeAt(0);\n\t\t\tif (getCharacterType(last) === getCharacterType(limit)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t#calculateRegExpMatch(query, entireWord, pageIndex, pageContent) {\n\t\tconst matches = [],\n\t\t\tmatchesLength = [];\n\n\t\tconst diffs = this._pageDiffs[pageIndex];\n\t\tlet match;\n\t\twhile ((match = query.exec(pageContent)) !== null) {\n\t\t\tif (\n\t\t\t\tentireWord &&\n\t\t\t\t!this.#isEntireWord(pageContent, match.index, match[0].length)\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst [matchPos, matchLen] = getOriginalIndex(\n\t\t\t\tdiffs,\n\t\t\t\tmatch.index,\n\t\t\t\tmatch[0].length,\n\t\t\t);\n\n\t\t\tif (matchLen) {\n\t\t\t\tmatches.push(matchPos);\n\t\t\t\tmatchesLength.push(matchLen);\n\t\t\t}\n\t\t}\n\t\tthis._pageMatches[pageIndex] = matches;\n\t\tthis._pageMatchesLength[pageIndex] = matchesLength;\n\t}\n\n\t#convertToRegExpString(query, hasDiacritics) {\n\t\tconst { matchDiacritics } = this._state;\n\t\tlet isUnicode = false;\n\t\tquery = query.replace(\n\t\t\tSPECIAL_CHARS_REG_EXP,\n\t\t\t(\n\t\t\t\tmatch,\n\t\t\t\tp1 /* to escape */,\n\t\t\t\tp2 /* punctuation */,\n\t\t\t\tp3 /* whitespaces */,\n\t\t\t\tp4 /* diacritics */,\n\t\t\t\tp5 /* letters */,\n\t\t\t) => {\n\t\t\t\t// We don't need to use a \\s for whitespaces since all the different\n\t\t\t\t// kind of whitespaces are replaced by a single \" \".\n\n\t\t\t\tif (p1) {\n\t\t\t\t\t// Escape characters like *+?... to not interfer with regexp syntax.\n\t\t\t\t\treturn `[ ]*\\\\${p1}[ ]*`;\n\t\t\t\t}\n\t\t\t\tif (p2) {\n\t\t\t\t\t// Allow whitespaces around punctuation signs.\n\t\t\t\t\treturn `[ ]*${p2}[ ]*`;\n\t\t\t\t}\n\t\t\t\tif (p3) {\n\t\t\t\t\t// Replace spaces by \\s+ to be sure to match any spaces.\n\t\t\t\t\treturn '[ ]+';\n\t\t\t\t}\n\t\t\t\tif (matchDiacritics) {\n\t\t\t\t\treturn p4 || p5;\n\t\t\t\t}\n\n\t\t\t\tif (p4) {\n\t\t\t\t\t// Diacritics are removed with few exceptions.\n\t\t\t\t\treturn DIACRITICS_EXCEPTION.has(p4.charCodeAt(0)) ? p4 : '';\n\t\t\t\t}\n\n\t\t\t\t// A letter has been matched and it can be followed by any diacritics\n\t\t\t\t// in normalized text.\n\t\t\t\tif (hasDiacritics) {\n\t\t\t\t\tisUnicode = true;\n\t\t\t\t\treturn `${p5}\\\\p{M}*`;\n\t\t\t\t}\n\t\t\t\treturn p5;\n\t\t\t},\n\t\t);\n\n\t\tconst trailingSpaces = '[ ]*';\n\t\tif (query.endsWith(trailingSpaces)) {\n\t\t\t// The [ ]* has been added in order to help to match \"foo . bar\" but\n\t\t\t// it doesn't make sense to match some whitespaces after the dot\n\t\t\t// when it's the last character.\n\t\t\tquery = query.slice(0, query.length - trailingSpaces.length);\n\t\t}\n\n\t\tif (matchDiacritics) {\n\t\t\t// aX must not match aXY.\n\t\t\tif (hasDiacritics) {\n\t\t\t\tisUnicode = true;\n\t\t\t\tquery = `${query}(?=[${DIACRITICS_EXCEPTION_STR}]|[^\\\\p{M}]|$)`;\n\t\t\t}\n\t\t}\n\n\t\treturn [isUnicode, query];\n\t}\n\n\t#calculateMatch(pageIndex) {\n\t\tlet query = this.#query;\n\t\tif (query.length === 0) {\n\t\t\t// Do nothing: the matches should be wiped out already.\n\t\t\treturn;\n\t\t}\n\n\t\tconst { caseSensitive, entireWord, phraseSearch } = this._state;\n\t\tconst pageContent = this._pageContents[pageIndex];\n\t\tconst hasDiacritics = this._hasDiacritics[pageIndex];\n\n\t\tlet isUnicode = false;\n\t\tif (phraseSearch) {\n\t\t\t[isUnicode, query] = this.#convertToRegExpString(\n\t\t\t\tquery,\n\t\t\t\thasDiacritics,\n\t\t\t);\n\t\t} else {\n\t\t\t// Words are sorted in reverse order to be sure that \"foobar\" is matched\n\t\t\t// before \"foo\" in case the query is \"foobar foo\".\n\t\t\tconst match = query.match(/\\S+/g);\n\t\t\tif (match) {\n\t\t\t\tquery = match\n\t\t\t\t\t.sort()\n\t\t\t\t\t.reverse()\n\t\t\t\t\t.map((q) => {\n\t\t\t\t\t\tconst [isUnicodePart, queryPart] =\n\t\t\t\t\t\t\tthis.#convertToRegExpString(q, hasDiacritics);\n\t\t\t\t\t\tisUnicode ||= isUnicodePart;\n\t\t\t\t\t\treturn `(${queryPart})`;\n\t\t\t\t\t})\n\t\t\t\t\t.join('|');\n\t\t\t}\n\t\t}\n\n\t\tconst flags = `g${isUnicode ? 'u' : ''}${caseSensitive ? '' : 'i'}`;\n\t\tquery = new RegExp(query, flags);\n\n\t\tthis.#calculateRegExpMatch(query, entireWord, pageIndex, pageContent);\n\n\t\t// When `highlightAll` is set, ensure that the matches on previously\n\t\t// rendered (and still active) pages are correctly highlighted.\n\t\tif (this._state.highlightAll) {\n\t\t\tthis.#updatePage(pageIndex);\n\t\t}\n\t\tif (this._resumePageIdx === pageIndex) {\n\t\t\tthis._resumePageIdx = null;\n\t\t\tthis.#nextPageMatch();\n\t\t}\n\n\t\t// Update the match count.\n\t\tconst pageMatchesCount = this._pageMatches[pageIndex].length;\n\t\tif (pageMatchesCount > 0) {\n\t\t\tthis._matchesCountTotal += pageMatchesCount;\n\t\t\tthis.#updateUIResultsCount();\n\t\t}\n\t}\n\n\t#extractText() {\n\t\t// Perform text extraction once if this method is called multiple times.\n\t\tif (this._extractTextPromises.length > 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet promise = Promise.resolve();\n\t\tfor (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {\n\t\t\tconst extractTextCapability = createPromiseCapability();\n\t\t\tthis._extractTextPromises[i] = extractTextCapability.promise;\n\n\t\t\tpromise = promise.then(() => {\n\t\t\t\treturn this._pdfDocument\n\t\t\t\t\t.getPage(i + 1)\n\t\t\t\t\t.then((pdfPage) => {\n\t\t\t\t\t\treturn pdfPage.getTextContent();\n\t\t\t\t\t})\n\t\t\t\t\t.then(\n\t\t\t\t\t\t(textContent) => {\n\t\t\t\t\t\t\tconst strBuf = [];\n\n\t\t\t\t\t\t\tfor (const textItem of textContent.items) {\n\t\t\t\t\t\t\t\tstrBuf.push(textItem.str);\n\t\t\t\t\t\t\t\tif (textItem.hasEOL) {\n\t\t\t\t\t\t\t\t\tstrBuf.push('\\n');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Store the normalized page content (text items) as one string.\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\tthis._pageContents[i],\n\t\t\t\t\t\t\t\tthis._pageDiffs[i],\n\t\t\t\t\t\t\t\tthis._hasDiacritics[i],\n\t\t\t\t\t\t\t] = normalize(strBuf.join(''));\n\t\t\t\t\t\t\textractTextCapability.resolve();\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(reason) => {\n\t\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\t`Unable to get text content for page ${i + 1}`,\n\t\t\t\t\t\t\t\treason,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// Page error -- assuming no text content.\n\t\t\t\t\t\t\tthis._pageContents[i] = '';\n\t\t\t\t\t\t\tthis._pageDiffs[i] = null;\n\t\t\t\t\t\t\tthis._hasDiacritics[i] = false;\n\t\t\t\t\t\t\textractTextCapability.resolve();\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t});\n\t\t}\n\t}\n\n\t#updatePage(index) {\n\t\tif (this._scrollMatches && this._selected.pageIdx === index) {\n\t\t\t// If the page is selected, scroll the page into view, which triggers\n\t\t\t// rendering the page, which adds the text layer. Once the text layer\n\t\t\t// is built, it will attempt to scroll the selected match into view.\n\t\t\tthis._linkService.page = index + 1;\n\t\t}\n\n\t\tthis._eventBus.dispatch('updatetextlayermatches', {\n\t\t\tsource: this,\n\t\t\tpageIndex: index,\n\t\t});\n\t}\n\n\t#updateAllPages() {\n\t\tthis._eventBus.dispatch('updatetextlayermatches', {\n\t\t\tsource: this,\n\t\t\tpageIndex: -1,\n\t\t});\n\t}\n\n\t#nextMatch() {\n\t\tconst previous = this._state.findPrevious;\n\t\tconst currentPageIndex = this._linkService.page - 1;\n\t\tconst numPages = this._linkService.pagesCount;\n\n\t\tthis._highlightMatches = true;\n\n\t\tif (this._dirtyMatch) {\n\t\t\t// Need to recalculate the matches, reset everything.\n\t\t\tthis._dirtyMatch = false;\n\t\t\tthis._selected.pageIdx = this._selected.matchIdx = -1;\n\t\t\tthis._offset.pageIdx = currentPageIndex;\n\t\t\tthis._offset.matchIdx = null;\n\t\t\tthis._offset.wrapped = false;\n\t\t\tthis._resumePageIdx = null;\n\t\t\tthis._pageMatches.length = 0;\n\t\t\tthis._pageMatchesLength.length = 0;\n\t\t\tthis._matchesCountTotal = 0;\n\n\t\t\tthis.#updateAllPages(); // Wipe out any previously highlighted matches.\n\n\t\t\tfor (let i = 0; i < numPages; i++) {\n\t\t\t\t// Start finding the matches as soon as the text is extracted.\n\t\t\t\tif (this._pendingFindMatches.has(i)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis._pendingFindMatches.add(i);\n\t\t\t\tthis._extractTextPromises[i].then(() => {\n\t\t\t\t\tthis._pendingFindMatches.delete(i);\n\t\t\t\t\tthis.#calculateMatch(i);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// If there's no query there's no point in searching.\n\t\tif (this.#query === '') {\n\t\t\tthis.#updateUIState(FindState.FOUND);\n\t\t\treturn;\n\t\t}\n\t\t// If we're waiting on a page, we return since we can't do anything else.\n\t\tif (this._resumePageIdx) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst offset = this._offset;\n\t\t// Keep track of how many pages we should maximally iterate through.\n\t\tthis._pagesToSearch = numPages;\n\t\t// If there's already a `matchIdx` that means we are iterating through a\n\t\t// page's matches.\n\t\tif (offset.matchIdx !== null) {\n\t\t\tconst numPageMatches = this._pageMatches[offset.pageIdx].length;\n\t\t\tif (\n\t\t\t\t(!previous && offset.matchIdx + 1 < numPageMatches) ||\n\t\t\t\t(previous && offset.matchIdx > 0)\n\t\t\t) {\n\t\t\t\t// The simple case; we just have advance the matchIdx to select\n\t\t\t\t// the next match on the page.\n\t\t\t\toffset.matchIdx = previous\n\t\t\t\t\t? offset.matchIdx - 1\n\t\t\t\t\t: offset.matchIdx + 1;\n\t\t\t\tthis.#updateMatch(/* found = */ true);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// We went beyond the current page's matches, so we advance to\n\t\t\t// the next page.\n\t\t\tthis.#advanceOffsetPage(previous);\n\t\t}\n\t\t// Start searching through the page.\n\t\tthis.#nextPageMatch();\n\t}\n\n\t#matchesReady(matches) {\n\t\tconst offset = this._offset;\n\t\tconst numMatches = matches.length;\n\t\tconst previous = this._state.findPrevious;\n\n\t\tif (numMatches) {\n\t\t\t// There were matches for the page, so initialize `matchIdx`.\n\t\t\toffset.matchIdx = previous ? numMatches - 1 : 0;\n\t\t\tthis.#updateMatch(/* found = */ true);\n\t\t\treturn true;\n\t\t}\n\t\t// No matches, so attempt to search the next page.\n\t\tthis.#advanceOffsetPage(previous);\n\t\tif (offset.wrapped) {\n\t\t\toffset.matchIdx = null;\n\t\t\tif (this._pagesToSearch < 0) {\n\t\t\t\t// No point in wrapping again, there were no matches.\n\t\t\t\tthis.#updateMatch(/* found = */ false);\n\t\t\t\t// While matches were not found, searching for a page\n\t\t\t\t// with matches should nevertheless halt.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t// Matches were not found (and searching is not done).\n\t\treturn false;\n\t}\n\n\t#nextPageMatch() {\n\t\tif (this._resumePageIdx !== null) {\n\t\t\tconsole.error('There can only be one pending page.');\n\t\t}\n\n\t\tlet matches = null;\n\t\tdo {\n\t\t\tconst pageIdx = this._offset.pageIdx;\n\t\t\tmatches = this._pageMatches[pageIdx];\n\t\t\tif (!matches) {\n\t\t\t\t// The matches don't exist yet for processing by `_matchesReady`,\n\t\t\t\t// so set a resume point for when they do exist.\n\t\t\t\tthis._resumePageIdx = pageIdx;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!this.#matchesReady(matches));\n\t}\n\n\t#advanceOffsetPage(previous) {\n\t\tconst offset = this._offset;\n\t\tconst numPages = this._linkService.pagesCount;\n\t\toffset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1;\n\t\toffset.matchIdx = null;\n\n\t\tthis._pagesToSearch--;\n\n\t\tif (offset.pageIdx >= numPages || offset.pageIdx < 0) {\n\t\t\toffset.pageIdx = previous ? numPages - 1 : 0;\n\t\t\toffset.wrapped = true;\n\t\t}\n\t}\n\n\t#updateMatch(found = false) {\n\t\tlet state = FindState.NOT_FOUND;\n\t\tconst wrapped = this._offset.wrapped;\n\t\tthis._offset.wrapped = false;\n\n\t\tif (found) {\n\t\t\tconst previousPage = this._selected.pageIdx;\n\t\t\tthis._selected.pageIdx = this._offset.pageIdx;\n\t\t\tthis._selected.matchIdx = this._offset.matchIdx;\n\t\t\tstate = wrapped ? FindState.WRAPPED : FindState.FOUND;\n\n\t\t\t// Update the currently selected page to wipe out any selected matches.\n\t\t\tif (\n\t\t\t\tpreviousPage !== -1 &&\n\t\t\t\tpreviousPage !== this._selected.pageIdx\n\t\t\t) {\n\t\t\t\tthis.#updatePage(previousPage);\n\t\t\t}\n\t\t}\n\n\t\tthis.#updateUIState(state, this._state.findPrevious);\n\t\tif (this._selected.pageIdx !== -1) {\n\t\t\t// Ensure that the match will be scrolled into view.\n\t\t\tthis._scrollMatches = true;\n\n\t\t\tthis.#updatePage(this._selected.pageIdx);\n\t\t}\n\t}\n\n\t#onFindBarClose(evt) {\n\t\tconst pdfDocument = this._pdfDocument;\n\t\t// Since searching is asynchronous, ensure that the removal of highlighted\n\t\t// matches (from the UI) is async too such that the 'updatetextlayermatches'\n\t\t// events will always be dispatched in the expected order.\n\t\tthis._firstPageCapability.promise.then(() => {\n\t\t\t// Only update the UI if the document is open, and is the current one.\n\t\t\tif (\n\t\t\t\t!this._pdfDocument ||\n\t\t\t\t(pdfDocument && this._pdfDocument !== pdfDocument)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Ensure that a pending, not yet started, search operation is aborted.\n\t\t\tif (this._findTimeout) {\n\t\t\t\tclearTimeout(this._findTimeout);\n\t\t\t\tthis._findTimeout = null;\n\t\t\t}\n\t\t\t// Abort any long running searches, to avoid a match being scrolled into\n\t\t\t// view *after* the findbar has been closed. In this case `this._offset`\n\t\t\t// will most likely differ from `this._selected`, hence we also ensure\n\t\t\t// that any new search operation will always start with a clean slate.\n\t\t\tif (this._resumePageIdx) {\n\t\t\t\tthis._resumePageIdx = null;\n\t\t\t\tthis._dirtyMatch = true;\n\t\t\t}\n\t\t\t// Avoid the UI being in a pending state when the findbar is re-opened.\n\t\t\tthis.#updateUIState(FindState.FOUND);\n\n\t\t\tthis._highlightMatches = false;\n\t\t\tthis.#updateAllPages(); // Wipe out any previously highlighted matches.\n\t\t});\n\t}\n\n\t#requestMatchesCount() {\n\t\tconst { pageIdx, matchIdx } = this._selected;\n\t\tlet current = 0,\n\t\t\ttotal = this._matchesCountTotal;\n\t\tif (matchIdx !== -1) {\n\t\t\tfor (let i = 0; i < pageIdx; i++) {\n\t\t\t\tcurrent += this._pageMatches[i]?.length || 0;\n\t\t\t}\n\t\t\tcurrent += matchIdx + 1;\n\t\t}\n\t\t// When searching starts, this method may be called before the `pageMatches`\n\t\t// have been counted (in `_calculateMatch`). Ensure that the UI won't show\n\t\t// temporarily broken state when the active find result doesn't make sense.\n\t\tif (current < 1 || current > total) {\n\t\t\tcurrent = total = 0;\n\t\t}\n\t\treturn { current, total };\n\t}\n\n\t#updateUIResultsCount() {\n\t\tthis._eventBus.dispatch('updatefindmatchescount', {\n\t\t\tsource: this,\n\t\t\tmatchesCount: this.#requestMatchesCount(),\n\t\t});\n\t}\n\n\t#updateUIState(state, previous = false) {\n\t\tthis._eventBus.dispatch('updatefindcontrolstate', {\n\t\t\tsource: this,\n\t\t\tstate,\n\t\t\tprevious,\n\t\t\tmatchesCount: this.#requestMatchesCount(),\n\t\t\trawQuery: this._state?.query ?? null,\n\t\t});\n\t}\n}\n\nexport { FindState, PDFFindController };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FindState } from './pdf_find_controller.js';\n\nconst MATCHES_COUNT_LIMIT = 1000;\n\n/**\n * Creates a \"search bar\" given a set of DOM elements that act as controls\n * for searching or for setting search preferences in the UI. This object\n * also sets up the appropriate events for the controls. Actual searching\n * is done by PDFFindController.\n */\nclass PDFFindBar {\n\tconstructor(options, eventBus, l10n) {\n\t\tthis.opened = false;\n\n\t\tthis.bar = options.bar;\n\t\tthis.toggleButton = options.toggleButton;\n\t\tthis.findField = options.findField;\n\t\tthis.highlightAll = options.highlightAllCheckbox;\n\t\tthis.caseSensitive = options.caseSensitiveCheckbox;\n\t\tthis.matchDiacritics = options.matchDiacriticsCheckbox;\n\t\tthis.entireWord = options.entireWordCheckbox;\n\t\tthis.findMsg = options.findMsg;\n\t\tthis.findResultsCount = options.findResultsCount;\n\t\tthis.findPreviousButton = options.findPreviousButton;\n\t\tthis.findNextButton = options.findNextButton;\n\t\tthis.eventBus = eventBus;\n\t\tthis.l10n = l10n;\n\n\t\t// Add event listeners to the DOM elements\n\t\tfor (let i = 0; i < this.toggleButton.length; i++) {\n\t\t\tthis.toggleButton[i].addEventListener('click', () => {\n\t\t\t\tthis.toggle(i);\n\t\t\t});\n\t\t}\n\t\tfor (let i = 0; i < this.findField.length; i++) {\n\t\t\tthis.findField[i].addEventListener('input', () => {\n\t\t\t\tthis.dispatchEvent([i], '');\n\t\t\t});\n\t\t}\n\t\tfor (let i = 0; i < this.bar.length; i++) {\n\t\t\twindow.parent.document.addEventListener('keydown', (e) => {\n\t\t\t\tswitch (e.keyCode) {\n\t\t\t\t\tcase 27: // Escape\n\t\t\t\t\t\tthis.close(i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t\tdocument.addEventListener('keydown', (e) => {\n\t\t\t\tswitch (e.keyCode) {\n\t\t\t\t\tcase 13: // Enter\n\t\t\t\t\t\tif (e.target === this.findField[i]) {\n\t\t\t\t\t\t\tthis.dispatchEvent([i], 'again', e.shiftKey);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 27: // Escape\n\t\t\t\t\t\tthis.close(i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tfor (let i = 0; i < this.findPreviousButton.length; i++) {\n\t\t\tthis.findPreviousButton[i].addEventListener('click', () => {\n\t\t\t\tthis.dispatchEvent([i], 'again', true);\n\t\t\t});\n\t\t}\n\t\tfor (let i = 0; i < this.findNextButton.length; i++) {\n\t\t\tthis.findNextButton[i].addEventListener('click', () => {\n\t\t\t\tthis.dispatchEvent([i], 'again', false);\n\t\t\t});\n\t\t}\n\t\tfor (let i = 0; i < this.highlightAll.length; i++) {\n\t\t\tthis.highlightAll[i].addEventListener('click', () => {\n\t\t\t\tthis.dispatchEvent([i], 'highlightallchange');\n\t\t\t});\n\t\t}\n\t\tfor (let i = 0; i < this.caseSensitive.length; i++) {\n\t\t\tthis.caseSensitive[i].addEventListener('click', () => {\n\t\t\t\tthis.dispatchEvent([i], 'casesensitivitychange');\n\t\t\t});\n\t\t}\n\t\tfor (let i = 0; i < this.entireWord.length; i++) {\n\t\t\tthis.entireWord[i].addEventListener('click', () => {\n\t\t\t\tthis.dispatchEvent([i], 'entirewordchange');\n\t\t\t});\n\t\t}\n\t\tfor (let i = 0; i < this.matchDiacritics.length; i++) {\n\t\t\tthis.matchDiacritics[i].addEventListener('click', () => {\n\t\t\t\tthis.dispatchEvent([i], 'diacriticmatchingchange');\n\t\t\t});\n\t\t}\n\t\tthis.eventBus._on('resize', this.#adjustWidth.bind(this));\n\t}\n\n\treset() {\n\t\tthis.updateUIState();\n\t}\n\n\tdispatchEvent(index, type, findPrev = false) {\n\t\tthis.eventBus.dispatch('find', {\n\t\t\tsource: this,\n\t\t\ttype,\n\t\t\tquery: this.findField[index].value,\n\t\t\tphraseSearch: true,\n\t\t\tcaseSensitive: this.caseSensitive[index].checked,\n\t\t\tentireWord: this.entireWord[index].checked,\n\t\t\thighlightAll: this.highlightAll[index].checked,\n\t\t\tfindPrevious: findPrev[index],\n\t\t\tmatchDiacritics: this.matchDiacritics[index].checked,\n\t\t});\n\t}\n\n\tupdateUIState(state, previous, matchesCount) {\n\t\tlet findMsg = Promise.resolve('');\n\t\tlet status = '';\n\n\t\tswitch (state) {\n\t\t\tcase FindState.FOUND:\n\t\t\t\tbreak;\n\t\t\tcase FindState.PENDING:\n\t\t\t\tstatus = 'pending';\n\t\t\t\tbreak;\n\t\t\tcase FindState.NOT_FOUND:\n\t\t\t\tfindMsg = this.l10n.get('find_not_found');\n\t\t\t\tstatus = 'notFound';\n\t\t\t\tbreak;\n\t\t\tcase FindState.WRAPPED:\n\t\t\t\tfindMsg = this.l10n.get(\n\t\t\t\t\t`find_reached_${previous ? 'top' : 'bottom'}`,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t\tfor (let i = 0; i < this.findField.length; i++) {\n\t\t\tthis.findField[i].setAttribute('data-status', status);\n\t\t\tthis.findField[i].setAttribute(\n\t\t\t\t'aria-invalid',\n\t\t\t\tstate === FindState.NOT_FOUND,\n\t\t\t);\n\t\t}\n\t\tfor (let i = 0; i < this.findMsg.length; i++) {\n\t\t\tfindMsg.then((msg) => {\n\t\t\t\tthis.findMsg[i].textContent = msg;\n\t\t\t\tthis.#adjustWidth();\n\t\t\t});\n\n\t\t\tthis.updateResultsCount(matchesCount);\n\t\t}\n\t}\n\n\tupdateResultsCount({ current = 0, total = 0 } = {}) {\n\t\tconst limit = MATCHES_COUNT_LIMIT;\n\t\tlet matchCountMsg = Promise.resolve('');\n\n\t\tif (total > 0) {\n\t\t\tif (total > limit) {\n\t\t\t\tlet key = 'find_match_count_limit';\n\n\t\t\t\tif (\n\t\t\t\t\ttypeof PDFJSDev !== 'undefined' &&\n\t\t\t\t\tPDFJSDev.test('MOZCENTRAL')\n\t\t\t\t) {\n\t\t\t\t\t// TODO: Remove this hard-coded `[other]` form once plural support has\n\t\t\t\t\t// been implemented in the mozilla-central specific `l10n.js` file.\n\t\t\t\t\tkey += '[other]';\n\t\t\t\t}\n\t\t\t\tmatchCountMsg = this.l10n.get(key, { limit });\n\t\t\t} else {\n\t\t\t\tlet key = 'find_match_count';\n\n\t\t\t\tif (\n\t\t\t\t\ttypeof PDFJSDev !== 'undefined' &&\n\t\t\t\t\tPDFJSDev.test('MOZCENTRAL')\n\t\t\t\t) {\n\t\t\t\t\t// TODO: Remove this hard-coded `[other]` form once plural support has\n\t\t\t\t\t// been implemented in the mozilla-central specific `l10n.js` file.\n\t\t\t\t\tkey += '[other]';\n\t\t\t\t}\n\t\t\t\tmatchCountMsg = this.l10n.get(key, { current, total });\n\t\t\t}\n\t\t}\n\t\tmatchCountMsg.then((msg) => {\n\t\t\tfor (let i = 0; i < this.findResultsCount.length; i++) {\n\t\t\t\tthis.findResultsCount[i].textContent = msg;\n\t\t\t}\n\t\t\t// Since `updateResultsCount` may be called from `PDFFindController`,\n\t\t\t// ensure that the width of the findbar is always updated correctly.\n\t\t\tthis.#adjustWidth();\n\t\t});\n\t}\n\n\topen(i) {\n\t\tif (!this.opened) {\n\t\t\tthis.opened = true;\n\t\t\tthis.toggleButton[i].classList.add('toggled');\n\t\t\tthis.toggleButton[i].setAttribute('aria-expanded', 'true');\n\t\t\tthis.bar[i].classList.remove('hidden');\n\t\t\tthis.findField[i].select();\n\t\t\tthis.findField[i].focus();\n\t\t}\n\n\t\tthis.#adjustWidth();\n\t}\n\n\tclose(i) {\n\t\tif (!this.opened) {\n\t\t\treturn;\n\t\t}\n\t\tthis.opened = false;\n\t\tthis.toggleButton[i].classList.remove('toggled');\n\t\tthis.toggleButton[i].setAttribute('aria-expanded', 'false');\n\t\tthis.bar[i].classList.add('hidden');\n\n\t\tthis.eventBus.dispatch('findbarclose', { source: this });\n\t}\n\n\ttoggle(i) {\n\t\tif (this.opened) {\n\t\t\tthis.close(i);\n\t\t} else {\n\t\t\tthis.open(i);\n\t\t}\n\t}\n\n\t#adjustWidth() {\n\t\tif (!this.opened) {\n\t\t\treturn;\n\t\t}\n\t\tfor (let i = 0; i < this.bar.length; i++) {\n\t\t\t// The find bar has an absolute position and thus the browser extends\n\t\t\t// its width to the maximum possible width once the find bar does not fit\n\t\t\t// entirely within the window anymore (and its elements are automatically\n\t\t\t// wrapped). Here we detect and fix that.\n\t\t\tthis.bar[i].classList.remove('wrapContainers');\n\n\t\t\tconst findbarHeight = this.bar[i].clientHeight;\n\t\t\tconst inputContainerHeight =\n\t\t\t\tthis.bar[i].firstElementChild.clientHeight;\n\n\t\t\tif (findbarHeight > inputContainerHeight) {\n\t\t\t\t// The findbar is taller than the input container, which means that\n\t\t\t\t// the browser wrapped some of the elements. For a consistent look,\n\t\t\t\t// wrap all of them to adjust the width of the find bar.\n\t\t\t\tthis.bar[i].classList.add('wrapContainers');\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport { PDFFindBar };\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nclass OverlayManager {\n\t#overlays = new WeakMap();\n\n\t#active = null;\n\n\tget active() {\n\t\treturn this.#active;\n\t}\n\n\t/**\n\t * @param {HTMLDialogElement} dialog - The overlay's DOM element.\n\t * @param {boolean} [canForceClose] - Indicates if opening the overlay closes\n\t * an active overlay. The default is `false`.\n\t * @returns {Promise} A promise that is resolved when the overlay has been\n\t * registered.\n\t */\n\tasync register(dialog, canForceClose = false) {\n\t\tif (typeof dialog !== 'object') {\n\t\t\tthrow new Error('Not enough parameters.');\n\t\t} else if (this.#overlays.has(dialog)) {\n\t\t\tthrow new Error('The overlay is already registered.');\n\t\t}\n\t\tthis.#overlays.set(dialog, { canForceClose });\n\n\t\tif (\n\t\t\ttypeof PDFJSDev !== 'undefined' &&\n\t\t\tPDFJSDev.test('GENERIC && !SKIP_BABEL') &&\n\t\t\t!dialog.showModal\n\t\t) {\n\t\t\tconst dialogPolyfill = require('dialog-polyfill/dist/dialog-polyfill.js');\n\t\t\tdialogPolyfill.registerDialog(dialog);\n\n\t\t\tif (!this._dialogPolyfillCSS) {\n\t\t\t\tthis._dialogPolyfillCSS = true;\n\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = PDFJSDev.eval('DIALOG_POLYFILL_CSS');\n\n\t\t\t\tdocument.head.prepend(style);\n\t\t\t}\n\t\t}\n\n\t\tdialog.addEventListener('cancel', (evt) => {\n\t\t\tthis.#active = null;\n\t\t});\n\t}\n\n\t/**\n\t * @param {HTMLDialogElement} dialog - The overlay's DOM element.\n\t * @returns {Promise} A promise that is resolved when the overlay has been\n\t * unregistered.\n\t */\n\tasync unregister(dialog) {\n\t\tif (!this.#overlays.has(dialog)) {\n\t\t\tthrow new Error('The overlay does not exist.');\n\t\t} else if (this.#active === dialog) {\n\t\t\tthrow new Error(\n\t\t\t\t'The overlay cannot be removed while it is active.',\n\t\t\t);\n\t\t}\n\t\tthis.#overlays.delete(dialog);\n\t}\n\n\t/**\n\t * @param {HTMLDialogElement} dialog - The overlay's DOM element.\n\t * @returns {Promise} A promise that is resolved when the overlay has been\n\t * opened.\n\t */\n\tasync open(dialog) {\n\t\tif (!this.#overlays.has(dialog)) {\n\t\t\tthrow new Error('The overlay does not exist.');\n\t\t} else if (this.#active) {\n\t\t\tif (this.#active === dialog) {\n\t\t\t\tthrow new Error('The overlay is already active.');\n\t\t\t} else if (this.#overlays.get(dialog).canForceClose) {\n\t\t\t\tawait this.close();\n\t\t\t} else {\n\t\t\t\tthrow new Error('Another overlay is currently active.');\n\t\t\t}\n\t\t}\n\t\tthis.#active = dialog;\n\t\tdialog.showModal();\n\t}\n\n\t/**\n\t * @param {HTMLDialogElement} dialog - The overlay's DOM element.\n\t * @returns {Promise} A promise that is resolved when the overlay has been\n\t * closed.\n\t */\n\tasync close(dialog = this.#active) {\n\t\tif (!this.#overlays.has(dialog)) {\n\t\t\tthrow new Error('The overlay does not exist.');\n\t\t} else if (!this.#active) {\n\t\t\tthrow new Error('The overlay is currently not active.');\n\t\t} else if (this.#active !== dialog) {\n\t\t\tthrow new Error('Another overlay is currently active.');\n\t\t}\n\t\tdialog.close();\n\t\tthis.#active = null;\n\t}\n}\n\nexport { OverlayManager };\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst compatibilityParams = Object.create(null);\nif (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {\n\tif (\n\t\ttypeof PDFJSDev !== 'undefined' &&\n\t\tPDFJSDev.test('LIB') &&\n\t\ttypeof navigator === 'undefined'\n\t) {\n\t\tglobalThis.navigator = Object.create(null);\n\t}\n\tconst userAgent = navigator.userAgent || '';\n\tconst platform = navigator.platform || '';\n\tconst maxTouchPoints = navigator.maxTouchPoints || 1;\n\n\tconst isAndroid = /Android/.test(userAgent);\n\tconst isIOS =\n\t\t/\\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) ||\n\t\t(platform === 'MacIntel' && maxTouchPoints > 1);\n\n\t// Limit canvas size to 5 mega-pixels on mobile.\n\t// Support: Android, iOS\n\t(function checkCanvasSizeLimitation() {\n\t\tif (isIOS || isAndroid) {\n\t\t\tcompatibilityParams.maxCanvasPixels = 5242880;\n\t\t}\n\t})();\n}\n\nconst OptionKind = {\n\tVIEWER: 0x02,\n\tAPI: 0x04,\n\tWORKER: 0x08,\n\tPREFERENCE: 0x80,\n};\n\n/**\n * NOTE: These options are used to generate the `default_preferences.json` file,\n * see `OptionKind.PREFERENCE`, hence the values below must use only\n * primitive types and cannot rely on any imported types.\n */\nconst defaultOptions = {\n\tannotationEditorMode: {\n\t\t/** @type {boolean} */\n\t\tvalue:\n\t\t\ttypeof PDFJSDev === 'undefined' ||\n\t\t\tPDFJSDev.test('!PRODUCTION || TESTING')\n\t\t\t\t? 0\n\t\t\t\t: -1,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tannotationMode: {\n\t\t/** @type {number} */\n\t\tvalue: 2,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tcursorToolOnLoad: {\n\t\t/** @type {number} */\n\t\tvalue: 1,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tdefaultZoomValue: {\n\t\t/** @type {string} */\n\t\tvalue: '',\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tdisableHistory: {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.VIEWER,\n\t},\n\tdisablePageLabels: {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tenablePermissions: {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tenablePrintAutoRotate: {\n\t\t/** @type {boolean} */\n\t\tvalue: true,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tenableScripting: {\n\t\t/** @type {boolean} */\n\t\tvalue: typeof PDFJSDev === 'undefined' || !PDFJSDev.test('CHROME'),\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\texternalLinkRel: {\n\t\t/** @type {string} */\n\t\tvalue: 'noopener noreferrer nofollow',\n\t\tkind: OptionKind.VIEWER,\n\t},\n\texternalLinkTarget: {\n\t\t/** @type {number} */\n\t\tvalue: 2,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\thistoryUpdateUrl: {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tignoreDestinationZoom: {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\timageResourcesPath: {\n\t\t/** @type {string} */\n\t\tvalue: './images/',\n\t\tkind: OptionKind.VIEWER,\n\t},\n\tmaxCanvasPixels: {\n\t\t/** @type {number} */\n\t\tvalue: 16777216,\n\t\tkind: OptionKind.VIEWER,\n\t},\n\tforcePageColors: {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tpageColorsBackground: {\n\t\t/** @type {string} */\n\t\tvalue: 'Canvas',\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tpageColorsForeground: {\n\t\t/** @type {string} */\n\t\tvalue: 'CanvasText',\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tpdfBugEnabled: {\n\t\t/** @type {boolean} */\n\t\tvalue: typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION'),\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tprintResolution: {\n\t\t/** @type {number} */\n\t\tvalue: 150,\n\t\tkind: OptionKind.VIEWER,\n\t},\n\tsidebarViewOnLoad: {\n\t\t/** @type {number} */\n\t\tvalue: -1,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tscrollModeOnLoad: {\n\t\t/** @type {number} */\n\t\tvalue: -1,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tspreadModeOnLoad: {\n\t\t/** @type {number} */\n\t\tvalue: -1,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\ttextLayerMode: {\n\t\t/** @type {number} */\n\t\tvalue: 1,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tuseOnlyCssZoom: {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tviewerCssTheme: {\n\t\t/** @type {number} */\n\t\tvalue:\n\t\t\ttypeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME') ? 2 : 0,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\tviewOnLoad: {\n\t\t/** @type {boolean} */\n\t\tvalue: 0,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t},\n\n\tcMapPacked: {\n\t\t/** @type {boolean} */\n\t\tvalue: true,\n\t\tkind: OptionKind.API,\n\t},\n\tcMapUrl: {\n\t\t/** @type {string} */\n\t\tvalue:\n\t\t\ttypeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')\n\t\t\t\t? '../external/bcmaps/'\n\t\t\t\t: '../web/cmaps/',\n\t\tkind: OptionKind.API,\n\t},\n\tdisableAutoFetch: {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.API + OptionKind.PREFERENCE,\n\t},\n\tdisableFontFace: {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.API + OptionKind.PREFERENCE,\n\t},\n\tdisableRange: {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.API + OptionKind.PREFERENCE,\n\t},\n\tdisableStream: {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.API + OptionKind.PREFERENCE,\n\t},\n\tdocBaseUrl: {\n\t\t/** @type {string} */\n\t\tvalue: '',\n\t\tkind: OptionKind.API,\n\t},\n\tenableXfa: {\n\t\t/** @type {boolean} */\n\t\tvalue: true,\n\t\tkind: OptionKind.API + OptionKind.PREFERENCE,\n\t},\n\tfontExtraProperties: {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.API,\n\t},\n\tisEvalSupported: {\n\t\t/** @type {boolean} */\n\t\tvalue: true,\n\t\tkind: OptionKind.API,\n\t},\n\tmaxImageSize: {\n\t\t/** @type {number} */\n\t\tvalue: -1,\n\t\tkind: OptionKind.API,\n\t},\n\tpdfBug: {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.API,\n\t},\n\tstandardFontDataUrl: {\n\t\t/** @type {string} */\n\t\tvalue:\n\t\t\ttypeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')\n\t\t\t\t? '../external/standard_fonts/'\n\t\t\t\t: '../web/standard_fonts/',\n\t\tkind: OptionKind.API,\n\t},\n\tverbosity: {\n\t\t/** @type {number} */\n\t\tvalue: 1,\n\t\tkind: OptionKind.API,\n\t},\n\n\tworkerPort: {\n\t\t/** @type {Object} */\n\t\tvalue: null,\n\t\tkind: OptionKind.WORKER,\n\t},\n\tworkerSrc: {\n\t\t/** @type {string} */\n\t\tvalue:\n\t\t\ttypeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')\n\t\t\t\t? '../src/worker_loader.js'\n\t\t\t\t: '../build/pdf.worker.js',\n\t\tkind: OptionKind.WORKER,\n\t},\n};\nif (\n\ttypeof PDFJSDev === 'undefined' ||\n\tPDFJSDev.test('!PRODUCTION || GENERIC')\n) {\n\tdefaultOptions.defaultUrl = {\n\t\t/** @type {string} */\n\t\tvalue: 'compressed.tracemonkey-pldi-09.pdf',\n\t\tkind: OptionKind.VIEWER,\n\t};\n\tdefaultOptions.disablePreferences = {\n\t\t/** @type {boolean} */\n\t\tvalue: typeof PDFJSDev !== 'undefined' && PDFJSDev.test('TESTING'),\n\t\tkind: OptionKind.VIEWER,\n\t};\n\tdefaultOptions.locale = {\n\t\t/** @type {string} */\n\t\tvalue: navigator.language || 'en-US',\n\t\tkind: OptionKind.VIEWER,\n\t};\n\tdefaultOptions.renderer = {\n\t\t/** @type {string} */\n\t\tvalue: 'canvas',\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t};\n\tdefaultOptions.sandboxBundleSrc = {\n\t\t/** @type {string} */\n\t\tvalue:\n\t\t\ttypeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')\n\t\t\t\t? '../build/dev-sandbox/pdf.sandbox.js'\n\t\t\t\t: '../build/pdf.sandbox.js',\n\t\tkind: OptionKind.VIEWER,\n\t};\n} else if (PDFJSDev.test('CHROME')) {\n\tdefaultOptions.defaultUrl = {\n\t\t/** @type {string} */\n\t\tvalue: '',\n\t\tkind: OptionKind.VIEWER,\n\t};\n\tdefaultOptions.disableTelemetry = {\n\t\t/** @type {boolean} */\n\t\tvalue: false,\n\t\tkind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n\t};\n\tdefaultOptions.sandboxBundleSrc = {\n\t\t/** @type {string} */\n\t\tvalue: '../build/pdf.sandbox.js',\n\t\tkind: OptionKind.VIEWER,\n\t};\n}\n\nconst userOptions = Object.create(null);\n\nclass AppOptions {\n\tconstructor() {\n\t\tthrow new Error('Cannot initialize AppOptions.');\n\t}\n\n\tstatic get(name) {\n\t\tconst userOption = userOptions[name];\n\t\tif (userOption !== undefined) {\n\t\t\treturn userOption;\n\t\t}\n\t\tconst defaultOption = defaultOptions[name];\n\t\tif (defaultOption !== undefined) {\n\t\t\treturn compatibilityParams[name] ?? defaultOption.value;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tstatic getAll(kind = null) {\n\t\tconst options = Object.create(null);\n\t\tfor (const name in defaultOptions) {\n\t\t\tconst defaultOption = defaultOptions[name];\n\t\t\tif (kind) {\n\t\t\t\tif ((kind & defaultOption.kind) === 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (kind === OptionKind.PREFERENCE) {\n\t\t\t\t\tconst value = defaultOption.value,\n\t\t\t\t\t\tvalueType = typeof value;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tvalueType === 'boolean' ||\n\t\t\t\t\t\tvalueType === 'string' ||\n\t\t\t\t\t\t(valueType === 'number' && Number.isInteger(value))\n\t\t\t\t\t) {\n\t\t\t\t\t\toptions[name] = value;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tthrow new Error(`Invalid type for preference: ${name}`);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst userOption = userOptions[name];\n\t\t\toptions[name] =\n\t\t\t\tuserOption !== undefined\n\t\t\t\t\t? userOption\n\t\t\t\t\t: compatibilityParams[name] ?? defaultOption.value;\n\t\t}\n\t\treturn options;\n\t}\n\n\tstatic set(name, value) {\n\t\tuserOptions[name] = value;\n\t}\n\n\tstatic setAll(options) {\n\t\tfor (const name in options) {\n\t\t\tuserOptions[name] = options[name];\n\t\t}\n\t}\n\n\tstatic remove(name) {\n\t\tdelete userOptions[name];\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tstatic _hasUserOptions() {\n\t\treturn Object.keys(userOptions).length > 0;\n\t}\n}\n\nexport { AppOptions, compatibilityParams, OptionKind };\n","/* Copyright 2013 Rob Wu <rob@robwu.nl>\n * https://github.com/Rob--W/grab-to-pan.js\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Class name of element which can be grabbed.\nconst CSS_CLASS_GRAB = 'grab-to-pan-grab';\n\nclass GrabToPan {\n\t/**\n\t * Construct a GrabToPan instance for a given HTML element.\n\t * @param {Element} options.element\n\t * @param {function} [options.ignoreTarget] - See `ignoreTarget(node)`.\n\t * @param {function(boolean)} [options.onActiveChanged] - Called when\n\t * grab-to-pan is (de)activated. The first argument is a boolean that\n\t * shows whether grab-to-pan is activated.\n\t */\n\tconstructor(options) {\n\t\tthis.element = options.element;\n\t\tthis.document = options.element.ownerDocument;\n\t\tif (typeof options.ignoreTarget === 'function') {\n\t\t\tthis.ignoreTarget = options.ignoreTarget;\n\t\t}\n\t\tthis.onActiveChanged = options.onActiveChanged;\n\n\t\t// Bind the contexts to ensure that `this` always points to\n\t\t// the GrabToPan instance.\n\t\tthis.activate = this.activate.bind(this);\n\t\tthis.deactivate = this.deactivate.bind(this);\n\t\tthis.toggle = this.toggle.bind(this);\n\t\tthis._onMouseDown = this.#onMouseDown.bind(this);\n\t\tthis._onMouseMove = this.#onMouseMove.bind(this);\n\t\tthis._endPan = this.#endPan.bind(this);\n\n\t\t// This overlay will be inserted in the document when the mouse moves during\n\t\t// a grab operation, to ensure that the cursor has the desired appearance.\n\t\tconst overlay = (this.overlay = document.createElement('div'));\n\t\toverlay.className = 'grab-to-pan-grabbing';\n\t}\n\n\t/**\n\t * Bind a mousedown event to the element to enable grab-detection.\n\t */\n\tactivate() {\n\t\tif (!this.active) {\n\t\t\tthis.active = true;\n\t\t\tthis.element.addEventListener('mousedown', this._onMouseDown, true);\n\t\t\tthis.element.classList.add(CSS_CLASS_GRAB);\n\n\t\t\tthis.onActiveChanged?.(true);\n\t\t}\n\t}\n\n\t/**\n\t * Removes all events. Any pending pan session is immediately stopped.\n\t */\n\tdeactivate() {\n\t\tif (this.active) {\n\t\t\tthis.active = false;\n\t\t\tthis.element.removeEventListener(\n\t\t\t\t'mousedown',\n\t\t\t\tthis._onMouseDown,\n\t\t\t\ttrue,\n\t\t\t);\n\t\t\tthis._endPan();\n\t\t\tthis.element.classList.remove(CSS_CLASS_GRAB);\n\n\t\t\tthis.onActiveChanged?.(false);\n\t\t}\n\t}\n\n\ttoggle() {\n\t\tif (this.active) {\n\t\t\tthis.deactivate();\n\t\t} else {\n\t\t\tthis.activate();\n\t\t}\n\t}\n\n\t/**\n\t * Whether to not pan if the target element is clicked.\n\t * Override this method to change the default behaviour.\n\t *\n\t * @param {Element} node - The target of the event.\n\t * @returns {boolean} Whether to not react to the click event.\n\t */\n\tignoreTarget(node) {\n\t\t// Check whether the clicked element is, a child of, an input element/link.\n\t\treturn node.matches(\n\t\t\t'a[href], a[href] *, input, textarea, button, button *, select, option',\n\t\t);\n\t}\n\n\t#onMouseDown(event) {\n\t\tif (event.button !== 0 || this.ignoreTarget(event.target)) {\n\t\t\treturn;\n\t\t}\n\t\tif (event.originalTarget) {\n\t\t\ttry {\n\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\tevent.originalTarget.tagName;\n\t\t\t} catch (e) {\n\t\t\t\t// Mozilla-specific: element is a scrollbar (XUL element)\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthis.scrollLeftStart = this.element.scrollLeft;\n\t\tthis.scrollTopStart = this.element.scrollTop;\n\t\tthis.clientXStart = event.clientX;\n\t\tthis.clientYStart = event.clientY;\n\t\tthis.document.addEventListener('mousemove', this._onMouseMove, true);\n\t\tthis.document.addEventListener('mouseup', this._endPan, true);\n\t\t// When a scroll event occurs before a mousemove, assume that the user\n\t\t// dragged a scrollbar (necessary for Opera Presto, Safari and IE)\n\t\t// (not needed for Chrome/Firefox)\n\t\tthis.element.addEventListener('scroll', this._endPan, true);\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tconst focusedElement = document.activeElement;\n\t\tif (focusedElement && !focusedElement.contains(event.target)) {\n\t\t\tfocusedElement.blur();\n\t\t}\n\t}\n\n\t#onMouseMove(event) {\n\t\tthis.element.removeEventListener('scroll', this._endPan, true);\n\t\tif (!(event.buttons & 1)) {\n\t\t\t// The left mouse button is released.\n\t\t\tthis._endPan();\n\t\t\treturn;\n\t\t}\n\t\tconst xDiff = event.clientX - this.clientXStart;\n\t\tconst yDiff = event.clientY - this.clientYStart;\n\t\tconst scrollTop = this.scrollTopStart - yDiff;\n\t\tconst scrollLeft = this.scrollLeftStart - xDiff;\n\t\tif (this.element.scrollTo) {\n\t\t\tthis.element.scrollTo({\n\t\t\t\ttop: scrollTop,\n\t\t\t\tleft: scrollLeft,\n\t\t\t\tbehavior: 'instant',\n\t\t\t});\n\t\t} else {\n\t\t\tthis.element.scrollTop = scrollTop;\n\t\t\tthis.element.scrollLeft = scrollLeft;\n\t\t}\n\t\tif (!this.overlay.parentNode) {\n\t\t\tdocument.body.append(this.overlay);\n\t\t}\n\t}\n\n\t#endPan() {\n\t\tthis.element.removeEventListener('scroll', this._endPan, true);\n\t\tthis.document.removeEventListener('mousemove', this._onMouseMove, true);\n\t\tthis.document.removeEventListener('mouseup', this._endPan, true);\n\t\t// Note: ChildNode.remove doesn't throw if the parentNode is undefined.\n\t\tthis.overlay.remove();\n\t}\n}\n\nexport { GrabToPan };\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { GrabToPan } from './grab_to_pan.js';\nimport { PresentationModeState } from './ui_utils.js';\n\nconst CursorTool = {\n\tSELECT: 0, // The default value.\n\tHAND: 1,\n\tZOOM: 2,\n};\n\n/**\n * @typedef {Object} PDFCursorToolsOptions\n * @property {HTMLDivElement} container - The document container.\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} [cursorToolOnLoad] - The cursor tool that will be enabled\n * on load; the constants from {CursorTool} should be used. The default value\n * is `CursorTool.SELECT`.\n */\n\nclass PDFCursorTools {\n\t/**\n\t * @param {PDFCursorToolsOptions} options\n\t */\n\tconstructor({ container, eventBus, cursorToolOnLoad = CursorTool.SELECT }) {\n\t\tthis.container = container;\n\t\tthis.eventBus = eventBus;\n\n\t\tthis.active = CursorTool.SELECT;\n\t\tthis.activeBeforePresentationMode = null;\n\n\t\tthis.handTool = new GrabToPan({\n\t\t\telement: this.container,\n\t\t});\n\n\t\tthis.#addEventListeners();\n\n\t\t// Defer the initial `switchTool` call, to give other viewer components\n\t\t// time to initialize *and* register 'cursortoolchanged' event listeners.\n\t\tPromise.resolve().then(() => {\n\t\t\tthis.switchTool(cursorToolOnLoad);\n\t\t});\n\t}\n\n\t/**\n\t * @type {number} One of the values in {CursorTool}.\n\t */\n\tget activeTool() {\n\t\treturn this.active;\n\t}\n\n\t/**\n\t * NOTE: This method is ignored while Presentation Mode is active.\n\t * @param {number} tool - The cursor mode that should be switched to,\n\t * must be one of the values in {CursorTool}.\n\t */\n\tswitchTool(tool) {\n\t\tif (this.activeBeforePresentationMode !== null) {\n\t\t\treturn; // Cursor tools cannot be used in Presentation Mode.\n\t\t}\n\t\tif (tool === this.active) {\n\t\t\treturn; // The requested tool is already active.\n\t\t}\n\n\t\tconst disableActiveTool = () => {\n\t\t\tswitch (this.active) {\n\t\t\t\tcase CursorTool.SELECT:\n\t\t\t\t\tbreak;\n\t\t\t\tcase CursorTool.HAND:\n\t\t\t\t\tthis.handTool.deactivate();\n\t\t\t\t\tbreak;\n\t\t\t\tcase CursorTool.ZOOM:\n\t\t\t\t/* falls through */\n\t\t\t}\n\t\t};\n\n\t\t// Enable the new cursor tool.\n\t\tswitch (tool) {\n\t\t\tcase CursorTool.SELECT:\n\t\t\t\tdisableActiveTool();\n\t\t\t\tbreak;\n\t\t\tcase CursorTool.HAND:\n\t\t\t\tdisableActiveTool();\n\t\t\t\tthis.handTool.activate();\n\t\t\t\tbreak;\n\t\t\tcase CursorTool.ZOOM:\n\t\t\t/* falls through */\n\t\t\tdefault:\n\t\t\t\tconsole.error(`switchTool: \"${tool}\" is an unsupported value.`);\n\t\t\t\treturn;\n\t\t}\n\t\t// Update the active tool *after* it has been validated above,\n\t\t// in order to prevent setting it to an invalid state.\n\t\tthis.active = tool;\n\n\t\tthis.#dispatchEvent();\n\t}\n\n\t#dispatchEvent() {\n\t\tthis.eventBus.dispatch('cursortoolchanged', {\n\t\t\tsource: this,\n\t\t\ttool: this.active,\n\t\t});\n\t}\n\n\t#addEventListeners() {\n\t\tthis.eventBus._on('switchcursortool', (evt) => {\n\t\t\tthis.switchTool(evt.tool);\n\t\t});\n\n\t\tthis.eventBus._on('presentationmodechanged', (evt) => {\n\t\t\tswitch (evt.state) {\n\t\t\t\tcase PresentationModeState.FULLSCREEN: {\n\t\t\t\t\tconst previouslyActive = this.active;\n\n\t\t\t\t\tthis.switchTool(CursorTool.SELECT);\n\t\t\t\t\tthis.activeBeforePresentationMode = previouslyActive;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase PresentationModeState.NORMAL: {\n\t\t\t\t\tconst previouslyActive = this.activeBeforePresentationMode;\n\n\t\t\t\t\tthis.activeBeforePresentationMode = null;\n\t\t\t\t\tthis.switchTool(previouslyActive);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport { CursorTool, PDFCursorTools };\n","const pdfjsLib = require('pdfjs-dist');\nimport {\n\tanimationStarted,\n\tapiPageLayoutToViewerModes,\n\tAutoPrintRegExp,\n\tDEFAULT_SCALE_VALUE,\n\tgetActiveOrFocusedElement,\n\tisValidRotation,\n\tisValidScrollMode,\n\tisValidSpreadMode,\n\tnoContextMenuHandler,\n\tnormalizeWheelEventDirection,\n\tparseQueryString,\n\tProgressBar,\n\tRendererType,\n\tRenderingStates,\n\tScrollMode,\n\tSpreadMode,\n\tTextLayerMode,\n} from './ui_utils.js';\nimport { Toolbar } from './toolbar.js';\nimport { PDFFindController } from './pdf_find_controller.js';\nimport { PDFFindBar } from './pdf_find_bar.js';\nimport { OverlayManager } from './overlay_manager.js';\nimport { AppOptions, OptionKind } from './app_options.js';\n\nimport { CursorTool, PDFCursorTools } from './pdf_cursor_tools.js';\n\nconst pdfjsViewer = require('pdfjs-dist/web/pdf_viewer.js');\n\nconst DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000; // ms\nconst FORCE_PAGES_LOADED_TIMEOUT = 10000; // ms\nconst WHEEL_ZOOM_DISABLED_TIMEOUT = 1000; // ms\n\nconst ViewOnLoad = {\n\tUNKNOWN: -1,\n\tPREVIOUS: 0, // Default value.\n\tINITIAL: 1,\n};\n\nconst ViewerCssTheme = {\n\tAUTOMATIC: 0, // Default value.\n\tLIGHT: 1,\n\tDARK: 2,\n};\n\n// Keep these in sync with mozilla-central's Histograms.json.\nconst KNOWN_VERSIONS = [\n\t'1.0',\n\t'1.1',\n\t'1.2',\n\t'1.3',\n\t'1.4',\n\t'1.5',\n\t'1.6',\n\t'1.7',\n\t'1.8',\n\t'1.9',\n\t'2.0',\n\t'2.1',\n\t'2.2',\n\t'2.3',\n];\n// Keep these in sync with mozilla-central's Histograms.json.\nconst KNOWN_GENERATORS = [\n\t'acrobat distiller',\n\t'acrobat pdfwriter',\n\t'adobe livecycle',\n\t'adobe pdf library',\n\t'adobe photoshop',\n\t'ghostscript',\n\t'tcpdf',\n\t'cairo',\n\t'dvipdfm',\n\t'dvips',\n\t'pdftex',\n\t'pdfkit',\n\t'itext',\n\t'prince',\n\t'quarkxpress',\n\t'mac os x',\n\t'microsoft',\n\t'openoffice',\n\t'oracle',\n\t'luradocument',\n\t'pdf-xchange',\n\t'antenna house',\n\t'aspose.cells',\n\t'fpdf',\n];\npdfjsLib.GlobalWorkerOptions.workerSrc = pdfemb_trans.worker_src;\nconst USE_ONLY_CSS_ZOOM = true;\n\nconst DEFAULT_SCALE_DELTA = 1.1;\nconst MIN_SCALE = 0.25;\nconst MAX_SCALE = 10.0;\n\nclass DefaultExternalServices {\n\tconstructor() {\n\t\tthrow new Error('Cannot initialize DefaultExternalServices.');\n\t}\n\n\tstatic updateFindControlState(data) {}\n\n\tstatic updateFindMatchesCount(data) {}\n\n\tstatic initPassiveLoading(callbacks) {}\n\n\tstatic reportTelemetry(data) {}\n\n\tstatic createDownloadManager(options) {\n\t\tthrow new Error('Not implemented: createDownloadManager');\n\t}\n\n\tstatic createPreferences() {\n\t\tthrow new Error('Not implemented: createPreferences');\n\t}\n\n\tstatic createL10n(options) {\n\t\tthrow new Error('Not implemented: createL10n');\n\t}\n\n\tstatic createScripting(options) {\n\t\tthrow new Error('Not implemented: createScripting');\n\t}\n\n\tstatic get supportsIntegratedFind() {\n\t\treturn shadow(this, 'supportsIntegratedFind', false);\n\t}\n\n\tstatic get supportsDocumentFonts() {\n\t\treturn shadow(this, 'supportsDocumentFonts', true);\n\t}\n\n\tstatic get supportedMouseWheelZoomModifierKeys() {\n\t\treturn shadow(this, 'supportedMouseWheelZoomModifierKeys', {\n\t\t\tctrlKey: true,\n\t\t\tmetaKey: true,\n\t\t});\n\t}\n\n\tstatic get isInAutomation() {\n\t\treturn shadow(this, 'isInAutomation', false);\n\t}\n\n\tstatic updateEditorStates(data) {\n\t\tthrow new Error('Not implemented: updateEditorStates');\n\t}\n}\nconst PDFViewerApplication = {\n\tinitialBookmark: document.location.hash.substring(1),\n\tappConfig: null,\n\tpdfLoadingTask: null,\n\tpdfDocument: null,\n\tpdfViewer: null,\n\tpdfHistory: null,\n\tpdfLinkService: null,\n\teventBus: null,\n\tdownloadManager: null,\n\tstore: null,\n\t/** @type {Toolbar} */\n\ttoolbar: null,\n\t_boundEvents: Object.create(null),\n\t/** @type {SecondaryToolbar} */\n\tsecondaryToolbar: null,\n\turl: '',\n\tbaseUrl: '',\n\t_downloadUrl: '',\n\texternalServices: DefaultExternalServices,\n\tisInitialViewSet: false,\n\tdownloadComplete: false,\n\tasync initalize(appConfig) {\n\t\tthis.appConfig = appConfig;\n\t\tawait this.intializeWebView();\n\n\t\tthis.bindEvents();\n\t\tthis.bindWindowEvents();\n\t},\n\tasync intializeWebView() {\n\t\tconst { appConfig } = this;\n\t\tlet self = this;\n\t\tconst eventBus = new pdfjsViewer.EventBus();\n\t\tthis.eventBus = eventBus;\n\n\t\tthis.overlayManager = new OverlayManager();\n\n\t\tconst linkService = new pdfjsViewer.PDFLinkService({\n\t\t\teventBus,\n\t\t\texternalLinkTarget: AppOptions.get('externalLinkTarget'),\n\t\t\texternalLinkRel: AppOptions.get('externalLinkRel'),\n\t\t\tignoreDestinationZoom: AppOptions.get('ignoreDestinationZoom'),\n\t\t});\n\t\tthis.pdfLinkService = linkService;\n\n\t\tconst findController = new PDFFindController({\n\t\t\tlinkService: linkService,\n\t\t\teventBus,\n\t\t});\n\t\tthis.findController = findController;\n\t\tthis.l10n = pdfjsViewer.NullL10n;\n\n\t\tconst container = document.getElementById('viewerContainer');\n\t\tconst pdfViewer = new pdfjsViewer.PDFViewer({\n\t\t\tcontainer,\n\t\t\teventBus,\n\t\t\tlinkService,\n\t\t\tfindController,\n\t\t\tl10n: this.l10n,\n\t\t\tuseOnlyCssZoom: USE_ONLY_CSS_ZOOM,\n\t\t\ttextLayerMode: AppOptions.get('textLayerMode'),\n\t\t\t_currentScaleValue: 'page-fit',\n\t\t});\n\n\t\tthis.pdfViewer = pdfViewer;\n\n\t\tlinkService.setViewer(pdfViewer);\n\n\t\tthis.pdfHistory = new pdfjsViewer.PDFHistory({\n\t\t\teventBus,\n\t\t\tlinkService,\n\t\t});\n\t\tlinkService.setHistory(this.pdfHistory);\n\n\t\tif (!this.supportsIntegratedFind) {\n\t\t\tthis.findBar = new PDFFindBar(\n\t\t\t\tappConfig.findBar,\n\t\t\t\teventBus,\n\t\t\t\tthis.l10n,\n\t\t\t);\n\t\t}\n\n\t\tthis.pdfCursorTools = new PDFCursorTools({\n\t\t\tcontainer,\n\t\t\teventBus,\n\t\t\tcursorToolOnLoad: CursorTool.HAND,\n\t\t});\n\n\t\tthis.toolbar = new Toolbar(appConfig.toolbar, eventBus, false);\n\n\t\t//Set the user settings.\n\t\teventBus.on('pagesinit', function () {\n\t\t\tlet toolbarBottom = document.getElementById('toolbar-bottom');\n\n\t\t\t//Set the PDF SCALE\n\t\t\tself.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE;\n\t\t\tself.pdfViewer.scrollMode = pdfemb_trans.continousscroll\n\t\t\t\t? ScrollMode.VERTICAL\n\t\t\t\t: ScrollMode.PAGE;\n\t\t\t//Number of pages\n\t\t\tdocument.getElementById('numPages').innerHTML = self.pagesCount;\n\t\t\tif (typeof toolbarBottom != 'undefined' && toolbarBottom != null) {\n\t\t\t\tdocument.getElementById('numPages-bottom').innerHTML =\n\t\t\t\t\tself.pagesCount;\n\t\t\t}\n\t\t});\n\t\teventBus.on(\n\t\t\t'pagechanging',\n\t\t\tfunction (evt) {\n\t\t\t\tconst page = evt.pageNumber;\n\t\t\t\tconst numPages = self.pagesCount;\n\t\t\t\tlet toolbarBottom = document.getElementById('toolbar-bottom');\n\t\t\t\tdocument.getElementById('pageNumber').value = page;\n\t\t\t\tdocument.getElementById('numPages').innerHTML = numPages;\n\t\t\t\tdocument.getElementById('previous').disabled = page <= 1;\n\t\t\t\tdocument.getElementById('next').disabled = page >= numPages;\n\n\t\t\t\tpage >= numPages;\n\n\t\t\t\tdocument.getElementById('previous').disabled = page <= 1;\n\t\t\t\tdocument.getElementById('next').disabled = page >= numPages;\n\n\t\t\t\tif (\n\t\t\t\t\ttypeof toolbarBottom != 'undefined' &&\n\t\t\t\t\ttoolbarBottom != null\n\t\t\t\t) {\n\t\t\t\t\tdocument.getElementById('previous-bottom').disabled =\n\t\t\t\t\t\tpage <= 1;\n\t\t\t\t\tdocument.getElementById('next-bottom').disabled =\n\t\t\t\t\t\tdocument.getElementById('pageNumber-bottom').value =\n\t\t\t\t\t\t\tpage;\n\t\t\t\t\tdocument.getElementById('numPages-bottom').innerHTML =\n\t\t\t\t\t\tnumPages;\n\t\t\t\t\tdocument.getElementById('previous-bottom').disabled =\n\t\t\t\t\t\tpage <= 1;\n\t\t\t\t\tdocument.getElementById('next-bottom').disabled =\n\t\t\t\t\t\tpage >= numPages;\n\t\t\t\t}\n\t\t\t},\n\t\t\ttrue,\n\t\t);\n\t},\n\t/**\n\t * @private\n\t */\n\tasync _initializeMetadata(pdfDocument) {\n\t\tconst { info, metadata, contentDispositionFilename, contentLength } =\n\t\t\tawait pdfDocument.getMetadata();\n\n\t\tif (pdfDocument !== this.pdfDocument) {\n\t\t\treturn; // The document was closed while the metadata resolved.\n\t\t}\n\t\tthis.documentInfo = info;\n\t\tthis.metadata = metadata;\n\t\tthis._contentDispositionFilename ??= contentDispositionFilename;\n\t\tthis._contentLength ??= contentLength; // See `getDownloadInfo`-call above.\n\n\t\t// Provides some basic debug information\n\t\tconsole.log(\n\t\t\t`PDF ${pdfDocument.fingerprints[0]} [${info.PDFFormatVersion} ` +\n\t\t\t\t`${(info.Producer || '-').trim()} / ${(\n\t\t\t\t\tinfo.Creator || '-'\n\t\t\t\t).trim()}] ` +\n\t\t\t\t`(PDF.js: ${version || '-'})`,\n\t\t);\n\t\tlet pdfTitle = info.Title;\n\n\t\tconst metadataTitle = metadata?.get('dc:title');\n\t\tif (metadataTitle) {\n\t\t\t// Ghostscript can produce invalid 'dc:title' Metadata entries:\n\t\t\t// - The title may be \"Untitled\" (fixes bug 1031612).\n\t\t\t// - The title may contain incorrectly encoded characters, which thus\n\t\t\t// looks broken, hence we ignore the Metadata entry when it contains\n\t\t\t// characters from the Specials Unicode block (fixes bug 1605526).\n\t\t\tif (\n\t\t\t\tmetadataTitle !== 'Untitled' &&\n\t\t\t\t!/[\\uFFF0-\\uFFFF]/g.test(metadataTitle)\n\t\t\t) {\n\t\t\t\tpdfTitle = metadataTitle;\n\t\t\t}\n\t\t}\n\t\tif (pdfTitle) {\n\t\t\tthis.setTitle(\n\t\t\t\t`${pdfTitle} - ${\n\t\t\t\t\tthis._contentDispositionFilename || this._title\n\t\t\t\t}`,\n\t\t\t);\n\t\t} else if (this._contentDispositionFilename) {\n\t\t\tthis.setTitle(this._contentDispositionFilename);\n\t\t}\n\n\t\tif (\n\t\t\tinfo.IsXFAPresent &&\n\t\t\t!info.IsAcroFormPresent &&\n\t\t\t!pdfDocument.isPureXfa\n\t\t) {\n\t\t\tif (pdfDocument.loadingParams.enableXfa) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'Warning: XFA Foreground documents are not supported',\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconsole.warn('Warning: XFA support is not enabled');\n\t\t\t}\n\t\t\tthis.fallback(UNSUPPORTED_FEATURES.forms);\n\t\t} else if (\n\t\t\t(info.IsAcroFormPresent || info.IsXFAPresent) &&\n\t\t\t!this.pdfViewer.renderForms\n\t\t) {\n\t\t\tconsole.warn('Warning: Interactive form support is not enabled');\n\t\t\tthis.fallback(UNSUPPORTED_FEATURES.forms);\n\t\t}\n\n\t\tif (info.IsSignaturesPresent) {\n\t\t\tconsole.warn(\n\t\t\t\t'Warning: Digital signatures validation is not supported',\n\t\t\t);\n\t\t\tthis.fallback(UNSUPPORTED_FEATURES.signatures);\n\t\t}\n\n\t\t// Telemetry labels must be C++ variable friendly.\n\t\tlet versionId = 'other';\n\t\tif (KNOWN_VERSIONS.includes(info.PDFFormatVersion)) {\n\t\t\tversionId = `v${info.PDFFormatVersion.replace('.', '_')}`;\n\t\t}\n\t\tlet generatorId = 'other';\n\t\tif (info.Producer) {\n\t\t\tconst producer = info.Producer.toLowerCase();\n\t\t\tKNOWN_GENERATORS.some(function (generator) {\n\t\t\t\tif (!producer.includes(generator)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tgeneratorId = generator.replace(/[ .-]/g, '_');\n\t\t\t\treturn true;\n\t\t\t});\n\t\t}\n\t\tlet formType = null;\n\t\tif (info.IsXFAPresent) {\n\t\t\tformType = 'xfa';\n\t\t} else if (info.IsAcroFormPresent) {\n\t\t\tformType = 'acroform';\n\t\t}\n\t\tthis.externalServices.reportTelemetry({\n\t\t\ttype: 'documentInfo',\n\t\t\tversion: versionId,\n\t\t\tgenerator: generatorId,\n\t\t\tformType,\n\t\t});\n\n\t\tthis.eventBus.dispatch('metadataloaded', { source: this });\n\t},\n\n\t/**\n\t * @private\n\t */\n\tasync _initializePageLabels(pdfDocument) {\n\t\tconst labels = await pdfDocument.getPageLabels();\n\n\t\tif (pdfDocument !== this.pdfDocument) {\n\t\t\treturn; // The document was closed while the page labels resolved.\n\t\t}\n\t\tif (!labels || AppOptions.get('disablePageLabels')) {\n\t\t\treturn;\n\t\t}\n\t\tconst numLabels = labels.length;\n\t\t// Ignore page labels that correspond to standard page numbering,\n\t\t// or page labels that are all empty.\n\t\tlet standardLabels = 0,\n\t\t\temptyLabels = 0;\n\t\tfor (let i = 0; i < numLabels; i++) {\n\t\t\tconst label = labels[i];\n\t\t\tif (label === (i + 1).toString()) {\n\t\t\t\tstandardLabels++;\n\t\t\t} else if (label === '') {\n\t\t\t\temptyLabels++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (standardLabels >= numLabels || emptyLabels >= numLabels) {\n\t\t\treturn;\n\t\t}\n\t\tconst { pdfViewer, pdfThumbnailViewer, toolbar } = this;\n\n\t\tpdfViewer.setPageLabels(labels);\n\t\tpdfThumbnailViewer.setPageLabels(labels);\n\n\t\t// Changing toolbar page display to use labels and we need to set\n\t\t// the label of the current page.\n\t\ttoolbar.setPagesCount(numLabels, true);\n\t\ttoolbar.setPageNumber(\n\t\t\tpdfViewer.currentPageNumber,\n\t\t\tpdfViewer.currentPageLabel,\n\t\t);\n\t},\n\n\trun(config) {\n\t\tthis.initalize(config).then(WebViewInitialized);\n\t},\n\t/**\n\t * Opens PDF document specified by URL.\n\t * @returns {Promise} - Returns the promise, which is resolved when document\n\t * is opened.\n\t */\n\tasync open(file, args) {\n\t\tconst self = this;\n\n\t\tif (this.pdfLoadingTask) {\n\t\t\t// We need to destroy already opened document.\n\t\t\tawait this.close();\n\t\t}\n\n\t\tconst parameters = Object.create(null);\n\t\tif (typeof file === 'string') {\n\t\t\t// URL\n\t\t\tthis.setTitleUsingUrl(file, /* downloadUrl = */ file);\n\t\t\tparameters.url = file;\n\t\t} else if (file && 'byteLength' in file) {\n\t\t\t// ArrayBuffer\n\t\t\tparameters.data = file;\n\t\t} else if (file.url && file.originalUrl) {\n\t\t\tthis.setTitleUsingUrl(\n\t\t\t\tfile.originalUrl,\n\t\t\t\t/* downloadUrl = */ file.url,\n\t\t\t);\n\t\t\tparameters.url = file.url;\n\t\t}\n\n\t\t// Finally, update the API parameters with the arguments (if they exist).\n\t\tif (args) {\n\t\t\tfor (const key in args) {\n\t\t\t\tparameters[key] = args[key];\n\t\t\t}\n\t\t}\n\t\tlet url = parameters.url;\n\t\tif (parameters.secure) {\n\t\t\tthis._downloadUrl = parameters.download_url;\n\t\t} else {\n\t\t\tthis._downloadUrl = url;\n\t\t}\n\t\tthis._docFilename = parameters.file;\n\t\tparameters.cMapPacked = true;\n\t\tparameters.cMapUrl = pdfemb_trans.cmap_url;\n\n\t\t// Loading document.\n\t\tconst loadingTask = pdfjsLib.getDocument(parameters);\n\n\t\tthis.pdfLoadingTask = loadingTask;\n\t\tloadingTask.onPassword = (updateCallback, reason) => {\n\t\t\tthis.pdfLinkService.externalLinkEnabled = false;\n\t\t\tthis.passwordPrompt.setUpdateCallback(updateCallback, reason);\n\t\t\tthis.passwordPrompt.open();\n\t\t};\n\t\tloadingTask.onProgress = function (progressData) {\n\t\t\tself.progress(progressData.loaded / progressData.total);\n\t\t};\n\n\t\treturn loadingTask.promise.then(\n\t\t\tfunction (pdfDocument) {\n\t\t\t\t// Document loaded, specifying document for the viewer.\n\t\t\t\tself.pdfDocument = pdfDocument;\n\t\t\t\tself.pdfViewer.setDocument(pdfDocument);\n\t\t\t\tself.pdfLinkService.setDocument(pdfDocument);\n\t\t\t\tself.pdfHistory.initialize({\n\t\t\t\t\tfingerprint: pdfDocument.fingerprints[0],\n\t\t\t\t});\n\t\t\t\twebViewerZoomReset();\n\t\t\t\tself.loadingBar.hide();\n\t\t\t\tself.setTitleUsingMetadata(pdfDocument);\n\t\t\t\tself._initializePageLabels(pdfDocument);\n\t\t\t},\n\t\t\tfunction (exception) {\n\t\t\t\tconst message = exception && exception.message;\n\t\t\t\tconst l10n = self.l10n;\n\t\t\t\tlet loadingErrorMessage;\n\n\t\t\t\tif (exception instanceof pdfjsLib.InvalidPDFException) {\n\t\t\t\t\t// change error message also for other builds\n\t\t\t\t\tloadingErrorMessage = l10n.get(\n\t\t\t\t\t\t'invalid_file_error',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t'Invalid or corrupted PDF file.',\n\t\t\t\t\t);\n\t\t\t\t} else if (exception instanceof pdfjsLib.MissingPDFException) {\n\t\t\t\t\t// special message for missing PDFs\n\t\t\t\t\tloadingErrorMessage = l10n.get(\n\t\t\t\t\t\t'missing_file_error',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t'Missing PDF file.',\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\texception instanceof pdfjsLib.UnexpectedResponseException\n\t\t\t\t) {\n\t\t\t\t\tloadingErrorMessage = l10n.get(\n\t\t\t\t\t\t'unexpected_response_error',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t'Unexpected server response.',\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tloadingErrorMessage = l10n.get(\n\t\t\t\t\t\t'loading_error',\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t'An error occurred while loading the PDF.',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tloadingErrorMessage.then(function (msg) {\n\t\t\t\t\tself.error(msg, { message });\n\t\t\t\t});\n\t\t\t\tself.loadingBar.hide();\n\t\t\t},\n\t\t);\n\t},\n\n\t/**\n\t * Closes opened PDF document.\n\t * @returns {Promise} - Returns the promise, which is resolved when all\n\t * destruction is completed.\n\t */\n\tclose() {\n\t\tconst errorWrapper = document.getElementById('errorWrapper');\n\t\terrorWrapper.hidden = true;\n\n\t\tif (!this.pdfLoadingTask) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tconst promise = this.pdfLoadingTask.destroy();\n\t\tthis.pdfLoadingTask = null;\n\n\t\tif (this.pdfDocument) {\n\t\t\tthis.pdfDocument = null;\n\n\t\t\tthis.pdfViewer.setDocument(null);\n\t\t\tthis.pdfLinkService.setDocument(null, null);\n\n\t\t\tif (this.pdfHistory) {\n\t\t\t\tthis.pdfHistory.reset();\n\t\t\t}\n\t\t}\n\n\t\treturn promise;\n\t},\n\n\tget loadingBar() {\n\t\tconst bar = new pdfjsViewer.ProgressBar('loadingBar');\n\n\t\treturn pdfjsLib.shadow(this, 'loadingBar', bar);\n\t},\n\n\tsetTitleUsingUrl: function pdfViewSetTitleUsingUrl(url) {\n\t\tthis.url = url;\n\t\tlet title = pdfjsLib.getFilenameFromUrl(url) || url;\n\t\ttry {\n\t\t\ttitle = decodeURIComponent(title);\n\t\t} catch (e) {\n\t\t\t// decodeURIComponent may throw URIError,\n\t\t\t// fall back to using the unprocessed url in that case\n\t\t}\n\t\tthis.setTitle(title);\n\t},\n\n\tsetTitleUsingMetadata(pdfDocument) {\n\t\tconst self = this;\n\t\tpdfDocument.getMetadata().then(function (data) {\n\t\t\tconst info = data.info,\n\t\t\t\tmetadata = data.metadata;\n\t\t\tself.documentInfo = info;\n\t\t\tself.metadata = metadata;\n\n\t\t\tlet pdfTitle;\n\t\t\tif (metadata && metadata.has('dc:title')) {\n\t\t\t\tconst title = metadata.get('dc:title');\n\t\t\t\t// Ghostscript sometimes returns 'Untitled', so prevent setting the\n\t\t\t\t// title to 'Untitled.\n\t\t\t\tif (title !== 'Untitled') {\n\t\t\t\t\tpdfTitle = title;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!pdfTitle && info && info.Title) {\n\t\t\t\tpdfTitle = info.Title;\n\t\t\t}\n\n\t\t\tif (pdfTitle) {\n\t\t\t\tself.setTitle(pdfTitle + ' - ' + document.title);\n\t\t\t}\n\t\t});\n\t},\n\n\tsetTitle: function pdfViewSetTitle(title) {\n\t\tdocument.title = title;\n\t},\n\n\terror: function pdfViewError(message, moreInfo) {\n\t\tconst l10n = this.l10n;\n\t\tconst moreInfoText = [\n\t\t\tl10n.get(\n\t\t\t\t'error_version_info',\n\t\t\t\t{\n\t\t\t\t\tversion: pdfjsLib.version || '?',\n\t\t\t\t\tbuild: pdfjsLib.build || '?',\n\t\t\t\t},\n\t\t\t\t'PDF.js v{{version}} (build: {{build}})',\n\t\t\t),\n\t\t];\n\n\t\tif (moreInfo) {\n\t\t\tmoreInfoText.push(\n\t\t\t\tl10n.get(\n\t\t\t\t\t'error_message',\n\t\t\t\t\t{ message: moreInfo.message },\n\t\t\t\t\t'Message: {{message}}',\n\t\t\t\t),\n\t\t\t);\n\t\t\tif (moreInfo.stack) {\n\t\t\t\tmoreInfoText.push(\n\t\t\t\t\tl10n.get(\n\t\t\t\t\t\t'error_stack',\n\t\t\t\t\t\t{ stack: moreInfo.stack },\n\t\t\t\t\t\t'Stack: {{stack}}',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tif (moreInfo.filename) {\n\t\t\t\t\tmoreInfoText.push(\n\t\t\t\t\t\tl10n.get(\n\t\t\t\t\t\t\t'error_file',\n\t\t\t\t\t\t\t{ file: moreInfo.filename },\n\t\t\t\t\t\t\t'File: {{file}}',\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (moreInfo.lineNumber) {\n\t\t\t\t\tmoreInfoText.push(\n\t\t\t\t\t\tl10n.get(\n\t\t\t\t\t\t\t'error_line',\n\t\t\t\t\t\t\t{ line: moreInfo.lineNumber },\n\t\t\t\t\t\t\t'Line: {{line}}',\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst errorWrapper = document.getElementById('errorWrapper');\n\t\terrorWrapper.hidden = false;\n\n\t\tconst errorMessage = document.getElementById('errorMessage');\n\t\terrorMessage.textContent = message;\n\n\t\tconst closeButton = document.getElementById('errorClose');\n\t\tcloseButton.onclick = function () {\n\t\t\terrorWrapper.hidden = true;\n\t\t};\n\n\t\tconst errorMoreInfo = document.getElementById('errorMoreInfo');\n\t\tconst moreInfoButton = document.getElementById('errorShowMore');\n\t\tconst lessInfoButton = document.getElementById('errorShowLess');\n\t\tmoreInfoButton.onclick = function () {\n\t\t\terrorMoreInfo.hidden = false;\n\t\t\tmoreInfoButton.hidden = true;\n\t\t\tlessInfoButton.hidden = false;\n\t\t\terrorMoreInfo.style.height = errorMoreInfo.scrollHeight + 'px';\n\t\t};\n\t\tlessInfoButton.onclick = function () {\n\t\t\terrorMoreInfo.hidden = true;\n\t\t\tmoreInfoButton.hidden = false;\n\t\t\tlessInfoButton.hidden = true;\n\t\t};\n\t\tmoreInfoButton.hidden = false;\n\t\tlessInfoButton.hidden = true;\n\t\tPromise.all(moreInfoText).then(function (parts) {\n\t\t\terrorMoreInfo.value = parts.join('\\n');\n\t\t});\n\t},\n\tprogress: function pdfViewProgress(level) {\n\t\tconst percent = Math.round(level * 100);\n\t\t// Updating the bar if value increases.\n\t\tif (percent > this.loadingBar.percent || isNaN(percent)) {\n\t\t\tthis.loadingBar.percent = percent;\n\t\t}\n\t},\n\n\tget pagesCount() {\n\t\treturn this.pdfDocument.numPages;\n\t},\n\n\tget page() {\n\t\treturn this.pdfViewer.currentPageNumber;\n\t},\n\n\tset page(val) {\n\t\tthis.pdfViewer.currentPageNumber = val;\n\t},\n\n\tbindEvents() {\n\t\tconst { eventBus, _boundEvents } = this;\n\n\t\t_boundEvents.beforePrint = this.beforePrint.bind(this);\n\t\t_boundEvents.afterPrint = this.afterPrint.bind(this);\n\t\teventBus._on('resize', webViewerResize);\n\t\teventBus._on('hashchange', webViewerHashchange);\n\t\teventBus._on('beforeprint', _boundEvents.beforePrint);\n\t\teventBus._on('afterprint', _boundEvents.afterPrint);\n\t\teventBus._on('pagerendered', webViewerPageRendered);\n\t\teventBus._on('updateviewarea', webViewerUpdateViewarea);\n\t\teventBus._on('pagechanging', webViewerPageChanging);\n\t\teventBus._on('scalechanging', webViewerScaleChanging);\n\t\teventBus._on('rotationchanging', webViewerRotationChanging);\n\t\teventBus._on('namedaction', webViewerNamedAction);\n\t\teventBus._on(\n\t\t\t'presentationmodechanged',\n\t\t\twebViewerPresentationModeChanged,\n\t\t);\n\t\teventBus._on('presentationmode', webViewerPresentationMode);\n\t\teventBus._on(\n\t\t\t'switchannotationeditormode',\n\t\t\twebViewerSwitchAnnotationEditorMode,\n\t\t);\n\t\teventBus._on(\n\t\t\t'switchannotationeditorparams',\n\t\t\twebViewerSwitchAnnotationEditorParams,\n\t\t);\n\t\teventBus._on('print', webViewerPrint);\n\t\teventBus._on('download', webViewerDownload);\n\t\teventBus._on('fullscreen', webViewerFullscreen);\n\t\teventBus._on('firstpage', webViewerFirstPage);\n\t\teventBus._on('lastpage', webViewerLastPage);\n\t\teventBus._on('nextpage', webViewerNextPage);\n\t\teventBus._on('previouspage', webViewerPreviousPage);\n\t\teventBus._on('zoomin', webViewerZoomIn);\n\t\teventBus._on('zoomout', webViewerZoomOut);\n\t\teventBus._on('zoomreset', webViewerZoomReset);\n\t\teventBus._on('pagenumberchanged', webViewerPageNumberChanged);\n\t\teventBus._on('scalechanged', webViewerScaleChanged);\n\t\teventBus._on('rotatecw', webViewerRotateCw);\n\t\teventBus._on('rotateccw', webViewerRotateCcw);\n\t\teventBus._on('optionalcontentconfig', webViewerOptionalContentConfig);\n\t\teventBus._on('switchscrollmode', webViewerSwitchScrollMode);\n\t\teventBus._on('scrollmodechanged', webViewerScrollModeChanged);\n\t\teventBus._on('spreadmodechanged', webViewerSpreadModeChanged);\n\t\teventBus._on('documentproperties', webViewerDocumentProperties);\n\t\teventBus._on('findfromurlhash', webViewerFindFromUrlHash);\n\t\teventBus._on('updatefindmatchescount', webViewerUpdateFindMatchesCount);\n\t\teventBus._on('updatefindcontrolstate', webViewerUpdateFindControlState);\n\t},\n\tbindWindowEvents() {\n\t\tconst { eventBus, _boundEvents } = this;\n\n\t\tfunction addWindowResolutionChange(evt = null) {\n\t\t\tif (evt) {\n\t\t\t\twebViewerResolutionChange(evt);\n\t\t\t}\n\t\t\tconst mediaQueryList = window.matchMedia(\n\t\t\t\t`(resolution: ${window.devicePixelRatio || 1}dppx)`,\n\t\t\t);\n\t\t\tmediaQueryList.addEventListener(\n\t\t\t\t'change',\n\t\t\t\taddWindowResolutionChange,\n\t\t\t\t{\n\t\t\t\t\tonce: true,\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\ttypeof PDFJSDev !== 'undefined' &&\n\t\t\t\tPDFJSDev.test('MOZCENTRAL')\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t_boundEvents.removeWindowResolutionChange ||= function () {\n\t\t\t\tmediaQueryList.removeEventListener(\n\t\t\t\t\t'change',\n\t\t\t\t\taddWindowResolutionChange,\n\t\t\t\t);\n\t\t\t\t_boundEvents.removeWindowResolutionChange = null;\n\t\t\t};\n\t\t}\n\t\taddWindowResolutionChange();\n\n\t\t_boundEvents.windowResize = () => {\n\t\t\teventBus.dispatch('resize', { source: window });\n\t\t};\n\t\t_boundEvents.windowHashChange = () => {\n\t\t\teventBus.dispatch('hashchange', {\n\t\t\t\tsource: window,\n\t\t\t\thash: document.location.hash.substring(1),\n\t\t\t});\n\t\t};\n\t\t_boundEvents.windowBeforePrint = () => {\n\t\t\teventBus.dispatch('beforeprint', { source: window });\n\t\t};\n\t\t_boundEvents.windowAfterPrint = () => {\n\t\t\teventBus.dispatch('afterprint', { source: window });\n\t\t};\n\t\t_boundEvents.windowUpdateFromSandbox = (event) => {\n\t\t\teventBus.dispatch('updatefromsandbox', {\n\t\t\t\tsource: window,\n\t\t\t\tdetail: event.detail,\n\t\t\t});\n\t\t};\n\n\t\twindow.addEventListener('visibilitychange', webViewerVisibilityChange);\n\t\twindow.addEventListener('wheel', webViewerWheel, { passive: false });\n\t\twindow.addEventListener('touchstart', webViewerTouchStart, {\n\t\t\tpassive: false,\n\t\t});\n\t\twindow.addEventListener('keydown', webViewerKeyDown);\n\t\twindow.addEventListener('resize', _boundEvents.windowResize);\n\t\twindow.addEventListener('hashchange', _boundEvents.windowHashChange);\n\t\twindow.addEventListener('beforeprint', _boundEvents.windowBeforePrint);\n\t\twindow.addEventListener('afterprint', _boundEvents.windowAfterPrint);\n\t\twindow.addEventListener(\n\t\t\t'updatefromsandbox',\n\t\t\t_boundEvents.windowUpdateFromSandbox,\n\t\t);\n\t},\n\tunbindEvents() {\n\t\tif (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('MOZCENTRAL')) {\n\t\t\tthrow new Error('Not implemented: unbindEvents');\n\t\t}\n\t\tconst { eventBus, _boundEvents } = this;\n\n\t\teventBus._off('resize', webViewerResize);\n\t\teventBus._off('hashchange', webViewerHashchange);\n\t\teventBus._off('beforeprint', _boundEvents.beforePrint);\n\t\teventBus._off('afterprint', _boundEvents.afterPrint);\n\t\teventBus._off('pagerendered', webViewerPageRendered);\n\t\teventBus._off('updateviewarea', webViewerUpdateViewarea);\n\t\teventBus._off('pagechanging', webViewerPageChanging);\n\t\teventBus._off('scalechanging', webViewerScaleChanging);\n\t\teventBus._off('rotationchanging', webViewerRotationChanging);\n\t\teventBus._off('namedaction', webViewerNamedAction);\n\t\teventBus._off(\n\t\t\t'presentationmodechanged',\n\t\t\twebViewerPresentationModeChanged,\n\t\t);\n\t\teventBus._off('presentationmode', webViewerPresentationMode);\n\t\teventBus._off('print', webViewerPrint);\n\t\teventBus._off('download', webViewerDownload);\n\t\teventBus._off('fullscreen', webViewerFullscreen);\n\t\teventBus._off('firstpage', webViewerFirstPage);\n\t\teventBus._off('lastpage', webViewerLastPage);\n\t\teventBus._off('nextpage', webViewerNextPage);\n\t\teventBus._off('previouspage', webViewerPreviousPage);\n\t\teventBus._off('zoomin', webViewerZoomIn);\n\t\teventBus._off('zoomout', webViewerZoomOut);\n\t\teventBus._off('zoomreset', webViewerZoomReset);\n\t\teventBus._off('pagenumberchanged', webViewerPageNumberChanged);\n\t\teventBus._off('scalechanged', webViewerScaleChanged);\n\t\teventBus._off('rotatecw', webViewerRotateCw);\n\t\teventBus._off('rotateccw', webViewerRotateCcw);\n\t\teventBus._off('optionalcontentconfig', webViewerOptionalContentConfig);\n\t\teventBus._off('switchscrollmode', webViewerSwitchScrollMode);\n\t\teventBus._off('scrollmodechanged', webViewerScrollModeChanged);\n\t\teventBus._off('switchspreadmode', webViewerSwitchSpreadMode);\n\t\teventBus._off('spreadmodechanged', webViewerSpreadModeChanged);\n\t\teventBus._off('documentproperties', webViewerDocumentProperties);\n\t\teventBus._off('findfromurlhash', webViewerFindFromUrlHash);\n\t\teventBus._off(\n\t\t\t'updatefindmatchescount',\n\t\t\twebViewerUpdateFindMatchesCount,\n\t\t);\n\t\teventBus._off(\n\t\t\t'updatefindcontrolstate',\n\t\t\twebViewerUpdateFindControlState,\n\t\t);\n\n\t\tif (_boundEvents.reportPageStatsPDFBug) {\n\t\t\teventBus._off('pagerendered', _boundEvents.reportPageStatsPDFBug);\n\t\t\teventBus._off('pagechanging', _boundEvents.reportPageStatsPDFBug);\n\n\t\t\t_boundEvents.reportPageStatsPDFBug = null;\n\t\t}\n\t\tif (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {\n\t\t\teventBus._off('fileinputchange', webViewerFileInputChange);\n\t\t\teventBus._off('openfile', webViewerOpenFile);\n\t\t}\n\n\t\t_boundEvents.beforePrint = null;\n\t\t_boundEvents.afterPrint = null;\n\t},\n\tunbindWindowEvents() {\n\t\tif (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('MOZCENTRAL')) {\n\t\t\tthrow new Error('Not implemented: unbindWindowEvents');\n\t\t}\n\t\tconst { _boundEvents } = this;\n\n\t\twindow.removeEventListener(\n\t\t\t'visibilitychange',\n\t\t\twebViewerVisibilityChange,\n\t\t);\n\t\twindow.removeEventListener('wheel', webViewerWheel, { passive: false });\n\t\twindow.removeEventListener('touchstart', webViewerTouchStart, {\n\t\t\tpassive: false,\n\t\t});\n\t\twindow.removeEventListener('keydown', webViewerKeyDown);\n\t\twindow.removeEventListener('resize', _boundEvents.windowResize);\n\t\twindow.removeEventListener('hashchange', _boundEvents.windowHashChange);\n\t\twindow.removeEventListener(\n\t\t\t'beforeprint',\n\t\t\t_boundEvents.windowBeforePrint,\n\t\t);\n\t\twindow.removeEventListener('afterprint', _boundEvents.windowAfterPrint);\n\t\twindow.removeEventListener(\n\t\t\t'updatefromsandbox',\n\t\t\t_boundEvents.windowUpdateFromSandbox,\n\t\t);\n\n\t\t_boundEvents.removeWindowResolutionChange?.();\n\t\t_boundEvents.windowResize = null;\n\t\t_boundEvents.windowHashChange = null;\n\t\t_boundEvents.windowBeforePrint = null;\n\t\t_boundEvents.windowAfterPrint = null;\n\t\t_boundEvents.windowUpdateFromSandbox = null;\n\t},\n\n\t/**\n\t * @ignore\n\t */\n\t_reportDocumentStatsTelemetry() {\n\t\tconst { stats } = this.pdfDocument;\n\t\tif (stats !== this._docStats) {\n\t\t\tthis._docStats = stats;\n\n\t\t\tthis.externalServices.reportTelemetry({\n\t\t\t\ttype: 'documentStats',\n\t\t\t\tstats,\n\t\t\t});\n\t\t}\n\t},\n\tbeforePrint() {\n\t\tthis._printAnnotationStoragePromise = this.pdfScriptingManager\n\t\t\t.dispatchWillPrint()\n\t\t\t.catch(() => {\n\t\t\t\t/* Avoid breaking printing; ignoring errors. */\n\t\t\t})\n\t\t\t.then(() => {\n\t\t\t\treturn this.pdfDocument?.annotationStorage.print;\n\t\t\t});\n\n\t\tif (this.printService) {\n\t\t\t// There is no way to suppress beforePrint/afterPrint events,\n\t\t\t// but PDFPrintService may generate double events -- this will ignore\n\t\t\t// the second event that will be coming from native window.print().\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.supportsPrinting) {\n\t\t\tthis.l10n.get('printing_not_supported').then((msg) => {\n\t\t\t\tthis._otherError(msg);\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// The beforePrint is a sync method and we need to know layout before\n\t\t// returning from this method. Ensure that we can get sizes of the pages.\n\t\tif (!this.pdfViewer.pageViewsReady) {\n\t\t\tthis.l10n.get('printing_not_ready').then((msg) => {\n\t\t\t\t// eslint-disable-next-line no-alert\n\t\t\t\twindow.alert(msg);\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tconst pagesOverview = this.pdfViewer.getPagesOverview();\n\t\tconst printContainer = this.appConfig.printContainer;\n\t\tconst printResolution = AppOptions.get('printResolution');\n\t\tconst optionalContentConfigPromise =\n\t\t\tthis.pdfViewer.optionalContentConfigPromise;\n\n\t\tconst printService = PDFPrintServiceFactory.instance.createPrintService(\n\t\t\tthis.pdfDocument,\n\t\t\tpagesOverview,\n\t\t\tprintContainer,\n\t\t\tprintResolution,\n\t\t\toptionalContentConfigPromise,\n\t\t\tthis._printAnnotationStoragePromise,\n\t\t\tthis.l10n,\n\t\t);\n\t\tthis.printService = printService;\n\t\tthis.forceRendering();\n\n\t\tprintService.layout();\n\n\t\tthis.externalServices.reportTelemetry({\n\t\t\ttype: 'print',\n\t\t});\n\n\t\tif (this.pdfDocument?.annotationStorage.hasAnnotationEditors) {\n\t\t\tthis.externalServices.reportTelemetry({\n\t\t\t\ttype: 'editing',\n\t\t\t\tdata: {\n\t\t\t\t\ttype: 'print',\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t},\n\t/**\n\t * @private\n\t */\n\t_ensureDownloadComplete() {\n\t\tif (this.pdfDocument && this.downloadComplete) {\n\t\t\treturn;\n\t\t}\n\t\tthrow new Error('PDF document not downloaded.');\n\t},\n\tgoFullscreen() {},\n\tasync download() {\n\t\tconst url = this._downloadUrl,\n\t\t\tfilename = new URL(url).pathname.split('/').pop();\n\n\t\tlet link = document.createElement('a');\n\t\tlink.href = url;\n\t\tlink.download = filename;\n\t\tlink.dispatchEvent(new MouseEvent('click'));\n\t},\n\n\tafterPrint() {\n\t\tif (this._printAnnotationStoragePromise) {\n\t\t\tthis._printAnnotationStoragePromise.then(() => {\n\t\t\t\tthis.pdfScriptingManager.dispatchDidPrint();\n\t\t\t});\n\t\t\tthis._printAnnotationStoragePromise = null;\n\t\t}\n\n\t\tif (this.printService) {\n\t\t\tthis.printService.destroy();\n\t\t\tthis.printService = null;\n\n\t\t\tthis.pdfDocument?.annotationStorage.resetModified();\n\t\t}\n\t\tthis.forceRendering();\n\t},\n\n\tzoomIn: function pdfViewZoomIn(ticks) {\n\t\tlet newScale = this.pdfViewer.currentScale;\n\t\tdo {\n\t\t\tnewScale = (newScale * DEFAULT_SCALE_DELTA).toFixed(2);\n\t\t\tnewScale = Math.ceil(newScale * 10) / 10;\n\t\t\tnewScale = Math.min(MAX_SCALE, newScale);\n\t\t} while (--ticks && newScale < MAX_SCALE);\n\t\tthis.pdfViewer.currentScaleValue = newScale;\n\t},\n\n\tzoomOut: function pdfViewZoomOut(ticks) {\n\t\tlet newScale = this.pdfViewer.currentScale;\n\t\tdo {\n\t\t\tnewScale = (newScale / DEFAULT_SCALE_DELTA).toFixed(2);\n\t\t\tnewScale = Math.floor(newScale * 10) / 10;\n\t\t\tnewScale = Math.max(MIN_SCALE, newScale);\n\t\t} while (--ticks && newScale > MIN_SCALE);\n\t\tthis.pdfViewer.currentScaleValue = newScale;\n\t},\n\tzoomReset() {\n\t\tif (this.pdfViewer.isInPresentationMode) {\n\t\t\treturn;\n\t\t}\n\t\tthis.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE;\n\t},\n\tget pagesCount() {\n\t\treturn this.pdfDocument ? this.pdfDocument.numPages : 0;\n\t},\n\n\tget page() {\n\t\treturn this.pdfViewer.currentPageNumber;\n\t},\n\n\tset page(val) {\n\t\tthis.pdfViewer.currentPageNumber = val;\n\t},\n\n\tsetInitialView(\n\t\tstoredHash,\n\t\t{ rotation, sidebarView, scrollMode, spreadMode } = {},\n\t) {\n\t\tconst setRotation = (angle) => {\n\t\t\tif (isValidRotation(angle)) {\n\t\t\t\tthis.pdfViewer.pagesRotation = angle;\n\t\t\t}\n\t\t};\n\t\tconst setViewerModes = (scroll, spread) => {\n\t\t\tif (isValidScrollMode(scroll)) {\n\t\t\t\tthis.pdfViewer.scrollMode = scroll;\n\t\t\t}\n\t\t\tif (isValidSpreadMode(spread)) {\n\t\t\t\tthis.pdfViewer.spreadMode = spread;\n\t\t\t}\n\t\t};\n\t\tthis.isInitialViewSet = true;\n\t\terror_log(ScrollMode.PAGE);\n\t\tsetViewerModes(ScrollMode.PAGE, spreadMode);\n\n\t\tif (this.initialBookmark) {\n\t\t\tsetRotation(this.initialRotation);\n\t\t\tdelete this.initialRotation;\n\n\t\t\tthis.pdfLinkService.setHash(this.initialBookmark);\n\t\t\tthis.initialBookmark = null;\n\t\t} else if (storedHash) {\n\t\t\tsetRotation(rotation);\n\n\t\t\tthis.pdfLinkService.setHash(storedHash);\n\t\t}\n\n\t\t// Ensure that the correct page number is displayed in the UI,\n\t\t// even if the active page didn't change during document load.\n\t\tthis.toolbar.setPageNumber(\n\t\t\tthis.pdfViewer.currentPageNumber,\n\t\t\tthis.pdfViewer.currentPageLabel,\n\t\t);\n\n\t\tif (!this.pdfViewer.currentScaleValue) {\n\t\t\t// Scale was not initialized: invalid bookmark or scale was not specified.\n\t\t\t// Setting the default one.\n\t\t\tthis.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE;\n\t\t}\n\t},\n};\nfunction webViewerHashchange(evt) {\n\tconst hash = evt.hash;\n\tif (!hash) {\n\t\treturn;\n\t}\n\tif (!PDFViewerApplication.isInitialViewSet) {\n\t\tPDFViewerApplication.initialBookmark = hash;\n\t} else if (!PDFViewerApplication.pdfHistory?.popStateInProgress) {\n\t\tPDFViewerApplication.pdfLinkService.setHash(hash);\n\t}\n}\nfunction webViewerPageRendered({ pageNumber, error }) {\n\t// If the page is still visible when it has finished rendering,\n\t// ensure that the page number input loading indicator is hidden.\n\tif (pageNumber === PDFViewerApplication.page) {\n\t\tPDFViewerApplication.toolbar.updateLoadingIndicatorState(false);\n\t}\n\n\tif (error) {\n\t\tPDFViewerApplication.l10n.get('rendering_error').then((msg) => {\n\t\t\tPDFViewerApplication._otherError(msg, error);\n\t\t});\n\t}\n\n\t// It is a good time to report stream and font types.\n\tPDFViewerApplication._reportDocumentStatsTelemetry();\n}\nfunction webViewerUpdateViewarea({ location }) {\n\tif (PDFViewerApplication.isInitialViewSet) {\n\t\t// Only update the storage when the document has been loaded *and* rendered.\n\t\tPDFViewerApplication.store\n\t\t\t?.setMultiple({\n\t\t\t\tpage: location.pageNumber,\n\t\t\t\tzoom: location.scale,\n\t\t\t\tscrollLeft: location.left,\n\t\t\t\tscrollTop: location.top,\n\t\t\t\trotation: location.rotation,\n\t\t\t})\n\t\t\t.catch(() => {\n\t\t\t\t// Unable to write to storage.\n\t\t\t});\n\t}\n\n\t// Show/hide the loading indicator in the page number input element.\n\tconst currentPage = PDFViewerApplication.pdfViewer.getPageView(\n\t\t/* index = */ PDFViewerApplication.page - 1,\n\t);\n\tconst loading = currentPage?.renderingState !== RenderingStates.FINISHED;\n\tPDFViewerApplication.toolbar.updateLoadingIndicatorState(loading);\n}\n\nfunction webViewerResize() {\n\tconst { pdfDocument, pdfViewer } = PDFViewerApplication;\n\n\tpdfViewer.updateContainerHeightCss();\n\n\tif (!pdfDocument) {\n\t\treturn;\n\t}\n\tconst currentScaleValue = pdfViewer.currentScaleValue;\n\tif (\n\t\tcurrentScaleValue === 'auto' ||\n\t\tcurrentScaleValue === 'page-fit' ||\n\t\tcurrentScaleValue === 'page-width'\n\t) {\n\t\t// Note: the scale is constant for 'page-actual'.\n\t\tpdfViewer.currentScaleValue = currentScaleValue;\n\t}\n\tpdfViewer.update();\n}\nconst WebViewInitialized = () => {\n\tconst { appConfig, eventBus } = PDFViewerApplication;\n\tlet file;\n\tconst queryString = document.location.search.substring(1);\n\tconst params = parseQueryString(queryString);\n\tfile = params.get('url') ?? AppOptions.get('defaultUrl');\n\n\tif (file.search('/?pdfemb-serveurl=') == -1) {\n\t\tPDFViewerApplication.open(file);\n\t} else {\n\t\tdocument.oncontextmenu = function () {\n\t\t\treturn false;\n\t\t};\n\t\tpdfembGetPDF(file);\n\t}\n};\n\nfunction webViewerScaleChanging(evt) {\n\tPDFViewerApplication.toolbar.setPageScale(evt.presetValue, evt.scale);\n\n\tPDFViewerApplication.pdfViewer.update();\n}\n\nfunction webViewerRotationChanging(evt) {\n\tPDFViewerApplication.pdfThumbnailViewer.pagesRotation = evt.pagesRotation;\n\n\tPDFViewerApplication.forceRendering();\n\t// Ensure that the active page doesn't change during rotation.\n\tPDFViewerApplication.pdfViewer.currentPageNumber = evt.pageNumber;\n}\n\nfunction webViewerPageChanging({ pageNumber, pageLabel }) {\n\tPDFViewerApplication.toolbar.setPageNumber(pageNumber, pageLabel);\n}\n\nfunction webViewerResolutionChange(evt) {\n\tPDFViewerApplication.pdfViewer.refresh();\n}\nfunction webViewerPresentationModeChanged(evt) {\n\tPDFViewerApplication.pdfViewer.presentationModeState = evt.state;\n}\nfunction webViewerSwitchAnnotationEditorMode(evt) {\n\tPDFViewerApplication.pdfViewer.annotationEditorMode = evt.mode;\n}\nfunction webViewerPrint() {\n\tPDFViewerApplication.triggerPrinting();\n}\nfunction webViewerFullscreen() {\n\tPDFViewerApplication.goFullscreen();\n}\nfunction webViewerDownload() {\n\tPDFViewerApplication.download();\n}\nfunction webViewerFirstPage() {\n\tif (PDFViewerApplication.pdfDocument) {\n\t\tPDFViewerApplication.page = 1;\n\t}\n}\nfunction webViewerLastPage() {\n\tif (PDFViewerApplication.pdfDocument) {\n\t\tPDFViewerApplication.page = PDFViewerApplication.pagesCount;\n\t}\n}\nfunction webViewerSwitchAnnotationEditorParams(evt) {\n\tPDFViewerApplication.pdfViewer.annotationEditorParams = evt;\n}\nfunction webViewerNextPage() {\n\tPDFViewerApplication.pdfViewer.nextPage();\n}\nfunction webViewerPreviousPage() {\n\tPDFViewerApplication.pdfViewer.previousPage();\n}\nfunction webViewerZoomIn() {\n\tPDFViewerApplication.zoomIn();\n}\nfunction webViewerZoomOut() {\n\tPDFViewerApplication.zoomOut();\n}\nfunction webViewerZoomReset() {\n\tPDFViewerApplication.zoomReset();\n}\nfunction webViewerNamedAction(evt) {\n\t// Processing a couple of named actions that might be useful, see also\n\t// `PDFLinkService.executeNamedAction`.\n\tswitch (evt.action) {\n\t\tcase 'GoToPage':\n\t\t\tPDFViewerApplication.appConfig.toolbar.pageNumber.select();\n\t\t\tbreak;\n\n\t\tcase 'Find':\n\t\t\tif (!PDFViewerApplication.supportsIntegratedFind) {\n\t\t\t\tPDFViewerApplication.findBar.toggle();\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'Print':\n\t\t\tPDFViewerApplication.triggerPrinting();\n\t\t\tbreak;\n\n\t\tcase 'SaveAs':\n\t\t\tPDFViewerApplication.downloadOrSave();\n\t\t\tbreak;\n\t}\n}\nfunction webViewerPresentationMode() {\n\tPDFViewerApplication.requestPresentationMode();\n}\n\nlet zoomDisabledTimeout = null;\nfunction setZoomDisabledTimeout() {\n\tif (zoomDisabledTimeout) {\n\t\tclearTimeout(zoomDisabledTimeout);\n\t}\n\tzoomDisabledTimeout = setTimeout(function () {\n\t\tzoomDisabledTimeout = null;\n\t}, WHEEL_ZOOM_DISABLED_TIMEOUT);\n}\n\nfunction webViewerPageNumberChanged(evt) {\n\tconst pdfViewer = PDFViewerApplication.pdfViewer;\n\t// Note that for `<input type=\"number\">` HTML elements, an empty string will\n\t// be returned for non-number inputs; hence we simply do nothing in that case.\n\tif (evt.value !== '') {\n\t\tPDFViewerApplication.pdfLinkService.goToPage(evt.value);\n\t}\n\n\t// Ensure that the page number input displays the correct value, even if the\n\t// value entered by the user was invalid (e.g. a floating point number).\n\tif (\n\t\tevt.value !== pdfViewer.currentPageNumber.toString() &&\n\t\tevt.value !== pdfViewer.currentPageLabel\n\t) {\n\t\tPDFViewerApplication.toolbar.setPageNumber(\n\t\t\tpdfViewer.currentPageNumber,\n\t\t\tpdfViewer.currentPageLabel,\n\t\t);\n\t}\n}\nfunction webViewerScrollModeChanged(evt) {\n\tif (PDFViewerApplication.isInitialViewSet) {\n\t\t// Only update the storage when the document has been loaded *and* rendered.\n\t\tPDFViewerApplication.store?.set('scrollMode', evt.mode).catch(() => {\n\t\t\t// Unable to write to storage.\n\t\t});\n\t}\n}\nfunction webViewerUpdateFindMatchesCount({ matchesCount }) {\n\tif (PDFViewerApplication.supportsIntegratedFind) {\n\t\tPDFViewerApplication.externalServices.updateFindMatchesCount(\n\t\t\tmatchesCount,\n\t\t);\n\t} else {\n\t\tPDFViewerApplication.findBar.updateResultsCount(matchesCount);\n\t}\n}\n\nfunction webViewerWheel(evt) {\n\tconst { pdfViewer, supportedMouseWheelZoomModifierKeys } =\n\t\tPDFViewerApplication;\n\n\tif (pdfViewer.isInPresentationMode) {\n\t\treturn;\n\t}\n\n\tif (\n\t\t(evt.ctrlKey && supportedMouseWheelZoomModifierKeys.ctrlKey) ||\n\t\t(evt.metaKey && supportedMouseWheelZoomModifierKeys.metaKey)\n\t) {\n\t\t// Only zoom the pages, not the entire viewer.\n\t\tevt.preventDefault();\n\t\t// NOTE: this check must be placed *after* preventDefault.\n\t\tif (zoomDisabledTimeout || document.visibilityState === 'hidden') {\n\t\t\treturn;\n\t\t}\n\n\t\t// It is important that we query deltaMode before delta{X,Y}, so that\n\t\t// Firefox doesn't switch to DOM_DELTA_PIXEL mode for compat with other\n\t\t// browsers, see https://bugzilla.mozilla.org/show_bug.cgi?id=1392460.\n\t\tconst deltaMode = evt.deltaMode;\n\t\tconst delta = normalizeWheelEventDirection(evt);\n\t\tconst previousScale = pdfViewer.currentScale;\n\n\t\tlet ticks = 0;\n\t\tif (\n\t\t\tdeltaMode === WheelEvent.DOM_DELTA_LINE ||\n\t\t\tdeltaMode === WheelEvent.DOM_DELTA_PAGE\n\t\t) {\n\t\t\t// For line-based devices, use one tick per event, because different\n\t\t\t// OSs have different defaults for the number lines. But we generally\n\t\t\t// want one \"clicky\" roll of the wheel (which produces one event) to\n\t\t\t// adjust the zoom by one step.\n\t\t\tif (Math.abs(delta) >= 1) {\n\t\t\t\tticks = Math.sign(delta);\n\t\t\t} else {\n\t\t\t\t// If we're getting fractional lines (I can't think of a scenario\n\t\t\t\t// this might actually happen), be safe and use the accumulator.\n\t\t\t\tticks = PDFViewerApplication.accumulateWheelTicks(delta);\n\t\t\t}\n\t\t} else {\n\t\t\t// pixel-based devices\n\t\t\tconst PIXELS_PER_LINE_SCALE = 30;\n\t\t\tticks = PDFViewerApplication.accumulateWheelTicks(\n\t\t\t\tdelta / PIXELS_PER_LINE_SCALE,\n\t\t\t);\n\t\t}\n\n\t\tif (ticks < 0) {\n\t\t\tPDFViewerApplication.zoomOut(-ticks);\n\t\t} else if (ticks > 0) {\n\t\t\tPDFViewerApplication.zoomIn(ticks);\n\t\t}\n\n\t\tconst currentScale = pdfViewer.currentScale;\n\t\tif (previousScale !== currentScale) {\n\t\t\t// After scaling the page via zoomIn/zoomOut, the position of the upper-\n\t\t\t// left corner is restored. When the mouse wheel is used, the position\n\t\t\t// under the cursor should be restored instead.\n\t\t\tconst scaleCorrectionFactor = currentScale / previousScale - 1;\n\t\t\tconst rect = pdfViewer.container.getBoundingClientRect();\n\t\t\tconst dx = evt.clientX - rect.left;\n\t\t\tconst dy = evt.clientY - rect.top;\n\t\t\tpdfViewer.container.scrollLeft += dx * scaleCorrectionFactor;\n\t\t\tpdfViewer.container.scrollTop += dy * scaleCorrectionFactor;\n\t\t}\n\t} else {\n\t\tsetZoomDisabledTimeout();\n\t}\n}\n\nfunction webViewerTouchStart(evt) {\n\tif (evt.touches.length > 1) {\n\t\t// Disable touch-based zooming, because the entire UI bits gets zoomed and\n\t\t// that doesn't look great. If we do want to have a good touch-based\n\t\t// zooming experience, we need to implement smooth zoom capability (probably\n\t\t// using a CSS transform for faster visual response, followed by async\n\t\t// re-rendering at the final zoom level) and do gesture detection on the\n\t\t// touchmove events to drive it. Or if we want to settle for a less good\n\t\t// experience we can make the touchmove events drive the existing step-zoom\n\t\t// behaviour that the ctrl+mousewheel path takes.\n\t\tevt.preventDefault();\n\t}\n}\n\nfunction webViewerKeyDown(evt) {\n\tif (PDFViewerApplication.overlayManager.active) {\n\t\treturn;\n\t}\n\tconst { eventBus, pdfViewer } = PDFViewerApplication;\n\tconst isViewerInPresentationMode = pdfViewer.isInPresentationMode;\n\n\tlet handled = false,\n\t\tensureViewerFocused = false;\n\tconst cmd =\n\t\t(evt.ctrlKey ? 1 : 0) |\n\t\t(evt.altKey ? 2 : 0) |\n\t\t(evt.shiftKey ? 4 : 0) |\n\t\t(evt.metaKey ? 8 : 0);\n\n\t// First, handle the key bindings that are independent whether an input\n\t// control is selected or not.\n\tif (cmd === 1 || cmd === 8 || cmd === 5 || cmd === 12) {\n\t\t// either CTRL or META key with optional SHIFT.\n\t\tswitch (evt.keyCode) {\n\t\t\tcase 70: // f\n\t\t\t\tif (\n\t\t\t\t\t!PDFViewerApplication.supportsIntegratedFind &&\n\t\t\t\t\t!evt.shiftKey\n\t\t\t\t) {\n\t\t\t\t\tPDFViewerApplication.findBar.open();\n\t\t\t\t\thandled = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 71: // g\n\t\t\t\tif (!PDFViewerApplication.supportsIntegratedFind) {\n\t\t\t\t\tconst { state } = PDFViewerApplication.findController;\n\t\t\t\t\tif (state) {\n\t\t\t\t\t\tconst eventState = Object.assign(\n\t\t\t\t\t\t\tObject.create(null),\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsource: window,\n\t\t\t\t\t\t\t\ttype: 'again',\n\t\t\t\t\t\t\t\tfindPrevious: cmd === 5 || cmd === 12,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t\teventBus.dispatch('find', eventState);\n\t\t\t\t\t}\n\t\t\t\t\thandled = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 61: // FF/Mac '='\n\t\t\tcase 107: // FF '+' and '='\n\t\t\tcase 187: // Chrome '+'\n\t\t\tcase 171: // FF with German keyboard\n\t\t\t\tif (!isViewerInPresentationMode) {\n\t\t\t\t\tPDFViewerApplication.zoomIn();\n\t\t\t\t}\n\t\t\t\thandled = true;\n\t\t\t\tbreak;\n\t\t\tcase 173: // FF/Mac '-'\n\t\t\tcase 109: // FF '-'\n\t\t\tcase 189: // Chrome '-'\n\t\t\t\tif (!isViewerInPresentationMode) {\n\t\t\t\t\tPDFViewerApplication.zoomOut();\n\t\t\t\t}\n\t\t\t\thandled = true;\n\t\t\t\tbreak;\n\t\t\tcase 48: // '0'\n\t\t\tcase 96: // '0' on Numpad of Swedish keyboard\n\t\t\t\tif (!isViewerInPresentationMode) {\n\t\t\t\t\t// keeping it unhandled (to restore page zoom to 100%)\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t// ... and resetting the scale after browser adjusts its scale\n\t\t\t\t\t\tPDFViewerApplication.zoomReset();\n\t\t\t\t\t});\n\t\t\t\t\thandled = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 38: // up arrow\n\t\t\t\tif (\n\t\t\t\t\tisViewerInPresentationMode ||\n\t\t\t\t\tPDFViewerApplication.page > 1\n\t\t\t\t) {\n\t\t\t\t\tPDFViewerApplication.page = 1;\n\t\t\t\t\thandled = true;\n\t\t\t\t\tensureViewerFocused = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 40: // down arrow\n\t\t\t\tif (\n\t\t\t\t\tisViewerInPresentationMode ||\n\t\t\t\t\tPDFViewerApplication.page < PDFViewerApplication.pagesCount\n\t\t\t\t) {\n\t\t\t\t\tPDFViewerApplication.page = PDFViewerApplication.pagesCount;\n\t\t\t\t\thandled = true;\n\t\t\t\t\tensureViewerFocused = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC || CHROME')) {\n\t\t// CTRL or META without shift\n\t\tif (cmd === 1 || cmd === 8) {\n\t\t\tswitch (evt.keyCode) {\n\t\t\t\tcase 83: // s\n\t\t\t\t\teventBus.dispatch('download', { source: window });\n\t\t\t\t\thandled = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 79: // o\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof PDFJSDev === 'undefined' ||\n\t\t\t\t\t\tPDFJSDev.test('GENERIC')\n\t\t\t\t\t) {\n\t\t\t\t\t\teventBus.dispatch('openfile', { source: window });\n\t\t\t\t\t\thandled = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// CTRL+ALT or Option+Command\n\tif (cmd === 3 || cmd === 10) {\n\t\tswitch (evt.keyCode) {\n\t\t\tcase 80: // p\n\t\t\t\tPDFViewerApplication.requestPresentationMode();\n\t\t\t\thandled = true;\n\t\t\t\tbreak;\n\t\t\tcase 71: // g\n\t\t\t\t// focuses input#pageNumber field\n\t\t\t\tPDFViewerApplication.appConfig.toolbar.pageNumber.select();\n\t\t\t\thandled = true;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (handled) {\n\t\tif (ensureViewerFocused && !isViewerInPresentationMode) {\n\t\t\tpdfViewer.focus();\n\t\t}\n\t\tevt.preventDefault();\n\t\treturn;\n\t}\n\n\t// Some shortcuts should not get handled if a control/input element\n\t// is selected.\n\tconst curElement = getActiveOrFocusedElement();\n\tconst curElementTagName = curElement?.tagName.toUpperCase();\n\tif (\n\t\tcurElementTagName === 'INPUT' ||\n\t\tcurElementTagName === 'TEXTAREA' ||\n\t\tcurElementTagName === 'SELECT' ||\n\t\tcurElement?.isContentEditable\n\t) {\n\t\t// Make sure that the secondary toolbar is closed when Escape is pressed.\n\t\tif (evt.keyCode !== /* Esc = */ 27) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// No control key pressed at all.\n\tif (cmd === 0) {\n\t\tlet turnPage = 0,\n\t\t\tturnOnlyIfPageFit = false;\n\t\tswitch (evt.keyCode) {\n\t\t\tcase 38: // up arrow\n\t\t\tcase 33: // pg up\n\t\t\t\t// vertical scrolling using arrow/pg keys\n\t\t\t\tif (pdfViewer.isVerticalScrollbarEnabled) {\n\t\t\t\t\tturnOnlyIfPageFit = true;\n\t\t\t\t}\n\t\t\t\tturnPage = -1;\n\t\t\t\tbreak;\n\t\t\tcase 8: // backspace\n\t\t\t\tif (!isViewerInPresentationMode) {\n\t\t\t\t\tturnOnlyIfPageFit = true;\n\t\t\t\t}\n\t\t\t\tturnPage = -1;\n\t\t\t\tbreak;\n\t\t\tcase 37: // left arrow\n\t\t\t\t// horizontal scrolling using arrow keys\n\t\t\t\tif (pdfViewer.isHorizontalScrollbarEnabled) {\n\t\t\t\t\tturnOnlyIfPageFit = true;\n\t\t\t\t}\n\t\t\t/* falls through */\n\t\t\tcase 75: // 'k'\n\t\t\tcase 80: // 'p'\n\t\t\t\tturnPage = -1;\n\t\t\t\tbreak;\n\t\t\tcase 27: // esc key\n\t\t\t\tif (\n\t\t\t\t\t!PDFViewerApplication.supportsIntegratedFind &&\n\t\t\t\t\tPDFViewerApplication.findBar.opened\n\t\t\t\t) {\n\t\t\t\t\tPDFViewerApplication.findBar.close();\n\t\t\t\t\thandled = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 40: // down arrow\n\t\t\tcase 34: // pg down\n\t\t\t\t// vertical scrolling using arrow/pg keys\n\t\t\t\tif (pdfViewer.isVerticalScrollbarEnabled) {\n\t\t\t\t\tturnOnlyIfPageFit = true;\n\t\t\t\t}\n\t\t\t\tturnPage = 1;\n\t\t\t\tbreak;\n\t\t\tcase 13: // enter key\n\t\t\tcase 32: // spacebar\n\t\t\t\tif (!isViewerInPresentationMode) {\n\t\t\t\t\tturnOnlyIfPageFit = true;\n\t\t\t\t}\n\t\t\t\tturnPage = 1;\n\t\t\t\tbreak;\n\t\t\tcase 39: // right arrow\n\t\t\t\t// horizontal scrolling using arrow keys\n\t\t\t\tif (pdfViewer.isHorizontalScrollbarEnabled) {\n\t\t\t\t\tturnOnlyIfPageFit = true;\n\t\t\t\t}\n\t\t\t/* falls through */\n\t\t\tcase 74: // 'j'\n\t\t\tcase 78: // 'n'\n\t\t\t\tturnPage = 1;\n\t\t\t\tbreak;\n\n\t\t\tcase 36: // home\n\t\t\t\tif (\n\t\t\t\t\tisViewerInPresentationMode ||\n\t\t\t\t\tPDFViewerApplication.page > 1\n\t\t\t\t) {\n\t\t\t\t\tPDFViewerApplication.page = 1;\n\t\t\t\t\thandled = true;\n\t\t\t\t\tensureViewerFocused = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 35: // end\n\t\t\t\tif (\n\t\t\t\t\tisViewerInPresentationMode ||\n\t\t\t\t\tPDFViewerApplication.page < PDFViewerApplication.pagesCount\n\t\t\t\t) {\n\t\t\t\t\tPDFViewerApplication.page = PDFViewerApplication.pagesCount;\n\t\t\t\t\thandled = true;\n\t\t\t\t\tensureViewerFocused = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 83: // 's'\n\t\t\t\tPDFViewerApplication.pdfCursorTools.switchTool(\n\t\t\t\t\tCursorTool.SELECT,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 72: // 'h'\n\t\t\t\tPDFViewerApplication.pdfCursorTools.switchTool(CursorTool.HAND);\n\t\t\t\tbreak;\n\n\t\t\tcase 82: // 'r'\n\t\t\t\tPDFViewerApplication.rotatePages(90);\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (\n\t\t\tturnPage !== 0 &&\n\t\t\t(!turnOnlyIfPageFit || pdfViewer.currentScaleValue === 'page-fit')\n\t\t) {\n\t\t\tif (turnPage > 0) {\n\t\t\t\tpdfViewer.nextPage();\n\t\t\t} else {\n\t\t\t\tpdfViewer.previousPage();\n\t\t\t}\n\t\t\thandled = true;\n\t\t}\n\t}\n\n\t// shift-key\n\tif (cmd === 4) {\n\t\tswitch (evt.keyCode) {\n\t\t\tcase 13: // enter key\n\t\t\tcase 32: // spacebar\n\t\t\t\tif (\n\t\t\t\t\t!isViewerInPresentationMode &&\n\t\t\t\t\tpdfViewer.currentScaleValue !== 'page-fit'\n\t\t\t\t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tpdfViewer.previousPage();\n\n\t\t\t\thandled = true;\n\t\t\t\tbreak;\n\n\t\t\tcase 82: // 'r'\n\t\t\t\tPDFViewerApplication.rotatePages(-90);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!handled && !isViewerInPresentationMode) {\n\t\t// 33=Page Up 34=Page Down 35=End 36=Home\n\t\t// 37=Left 38=Up 39=Right 40=Down\n\t\t// 32=Spacebar\n\t\tif (\n\t\t\t(evt.keyCode >= 33 && evt.keyCode <= 40) ||\n\t\t\t(evt.keyCode === 32 && curElementTagName !== 'BUTTON')\n\t\t) {\n\t\t\tensureViewerFocused = true;\n\t\t}\n\t}\n\n\tif (ensureViewerFocused && !pdfViewer.containsElement(curElement)) {\n\t\t// The page container is not focused, but a page navigation key has been\n\t\t// pressed. Change the focus to the viewer container to make sure that\n\t\t// navigation by keyboard works as expected.\n\t\tpdfViewer.focus();\n\t}\n\n\tif (handled) {\n\t\tevt.preventDefault();\n\t}\n}\n\nfunction webViewerUpdateFindControlState({\n\tstate,\n\tprevious,\n\tmatchesCount,\n\trawQuery,\n}) {\n\tif (PDFViewerApplication.supportsIntegratedFind) {\n\t\tPDFViewerApplication.externalServices.updateFindControlState({\n\t\t\tresult: state,\n\t\t\tfindPrevious: previous,\n\t\t\tmatchesCount,\n\t\t\trawQuery,\n\t\t});\n\t} else {\n\t\tPDFViewerApplication.findBar.updateUIState(\n\t\t\tstate,\n\t\t\tprevious,\n\t\t\tmatchesCount,\n\t\t);\n\t}\n}\n\nfunction webViewerFindFromUrlHash(evt) {\n\tPDFViewerApplication.eventBus.dispatch('find', {\n\t\tsource: evt.source,\n\t\ttype: '',\n\t\tquery: evt.query,\n\t\tphraseSearch: evt.phraseSearch,\n\t\tcaseSensitive: false,\n\t\tentireWord: false,\n\t\thighlightAll: true,\n\t\tfindPrevious: false,\n\t\tmatchDiacritics: true,\n\t});\n}\nfunction webViewerSpreadModeChanged(evt) {\n\tif (PDFViewerApplication.isInitialViewSet) {\n\t\t// Only update the storage when the document has been loaded *and* rendered.\n\t\tPDFViewerApplication.store?.set('spreadMode', evt.mode).catch(() => {\n\t\t\t// Unable to write to storage.\n\t\t});\n\t}\n}\nfunction webViewerScaleChanged(evt) {\n\tPDFViewerApplication.pdfViewer.currentScaleValue = evt.value;\n}\nfunction webViewerRotateCw() {\n\tPDFViewerApplication.rotatePages(90);\n}\nfunction webViewerRotateCcw() {\n\tPDFViewerApplication.rotatePages(-90);\n}\nfunction webViewerOptionalContentConfig(evt) {\n\tPDFViewerApplication.pdfViewer.optionalContentConfigPromise = evt.promise;\n}\nfunction webViewerSwitchScrollMode(evt) {\n\tPDFViewerApplication.pdfViewer.scrollMode = evt.mode;\n}\nfunction webViewerSwitchSpreadMode(evt) {\n\tPDFViewerApplication.pdfViewer.spreadMode = evt.mode;\n}\nfunction webViewerDocumentProperties() {\n\tPDFViewerApplication.pdfDocumentProperties.open();\n}\nfunction webViewerVisibilityChange(evt) {\n\tif (document.visibilityState === 'visible') {\n\t\t// Ignore mouse wheel zooming during tab switches (bug 1503412).\n\t\tsetZoomDisabledTimeout();\n\t}\n}\nwindow.PDFViewerApplication = PDFViewerApplication;\n\nfunction pdfembGetPDF(url, callback) {\n\t// Get PDF directly\n\tif (url.search('/?pdfemb-serveurl=') == -1) {\n\t\treturn false;\n\t}\n\tlet download_url = url;\n\tpdfembAddAjaxBufferTransport();\n\tjQuery\n\t\t.ajax({\n\t\t\tdataType: 'arraybuffer',\n\t\t\ttype: 'POST',\n\t\t\turl: url,\n\t\t})\n\t\t.done(function (blob) {\n\t\t\tlet uia = new Uint8Array(blob);\n\n\t\t\tlet args = {\n\t\t\t\tsecure: true,\n\t\t\t\tdownload_url: window.location.origin + download_url,\n\t\t\t};\n\t\t\tPDFViewerApplication.open(uia, args);\n\t\t})\n\t\t.fail(function (jqXHR, textStatus, errorThrown) {\n\t\t\treturn false;\n\t\t});\n}\n\nfunction pdfembAddAjaxBufferTransport() {\n\tlet pdfembAddAjaxBufferTransport_added = false;\n\n\tif (pdfembAddAjaxBufferTransport_added) {\n\t\treturn;\n\t}\n\tpdfembAddAjaxBufferTransport_added = true;\n\n\t// http://www.artandlogic.com/blog/2013/11/jquery-ajax-blobs-and-array-buffers/\n\t/**\n\t * Register ajax transports for blob send/recieve and array buffer send/receive via XMLHttpRequest Level 2\n\t * within the comfortable framework of the jquery ajax request, with full support for promises.\n\t *\n\t * Notice the +* in the dataType string? The + indicates we want this transport to be prepended to the list\n\t * of potential transports (so it gets first dibs if the request passes the conditions within to provide the\n\t * ajax transport, preventing the standard transport from hogging the request), and the * indicates that\n\t * potentially any request with any dataType might want to use the transports provided herein.\n\t *\n\t * Remember to specify 'processData:false' in the ajax options when attempting to send a blob or arraybuffer -\n\t * otherwise jquery will try (and fail) to convert the blob or buffer into a query string.\n\t */\n\tjQuery.ajaxTransport('+*', function (options, originalOptions, jqXHR) {\n\t\t// Test for the conditions that mean we can/want to send/receive blobs or arraybuffers - we need XMLHttpRequest\n\t\t// level 2 (so feature-detect against window.FormData), feature detect against window.Blob or window.ArrayBuffer,\n\t\t// and then check to see if the dataType is blob/arraybuffer or the data itself is a Blob/ArrayBuffer\n\t\tif (\n\t\t\twindow.FormData &&\n\t\t\t((options.dataType &&\n\t\t\t\t(options.dataType == 'blob' ||\n\t\t\t\t\toptions.dataType == 'arraybuffer')) ||\n\t\t\t\t(options.data &&\n\t\t\t\t\t((window.Blob && options.data instanceof Blob) ||\n\t\t\t\t\t\t(window.ArrayBuffer &&\n\t\t\t\t\t\t\toptions.data instanceof ArrayBuffer))))\n\t\t) {\n\t\t\treturn {\n\t\t\t\t/**\n\t\t\t\t * Return a transport capable of sending and/or receiving blobs - in this case, we instantiate\n\t\t\t\t * a new XMLHttpRequest and use it to actually perform the request, and funnel the result back\n\t\t\t\t * into the jquery complete callback (such as the success function, done blocks, etc.)\n\t\t\t\t *\n\t\t\t\t * @param headers\n\t\t\t\t * @param completeCallback\n\t\t\t\t */\n\t\t\t\tsend: function (headers, completeCallback) {\n\t\t\t\t\tvar xhr = new XMLHttpRequest(),\n\t\t\t\t\t\turl = options.url || window.location.href,\n\t\t\t\t\t\ttype = options.type || 'GET',\n\t\t\t\t\t\tdataType = options.dataType || 'text',\n\t\t\t\t\t\tdata = options.data || null,\n\t\t\t\t\t\tasync = options.async || true;\n\n\t\t\t\t\txhr.addEventListener('load', function () {\n\t\t\t\t\t\tvar res = {};\n\n\t\t\t\t\t\tres[dataType] = xhr.response;\n\t\t\t\t\t\tcompleteCallback(\n\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\txhr.statusText,\n\t\t\t\t\t\t\tres,\n\t\t\t\t\t\t\txhr.getAllResponseHeaders(),\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\n\t\t\t\t\txhr.open(type, url, async);\n\t\t\t\t\txhr.responseType = dataType;\n\t\t\t\t\txhr.send(data);\n\t\t\t\t},\n\t\t\t\tabort: function () {\n\t\t\t\t\tjqXHR.abort();\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t});\n}\n\nfunction pdfemb_rc4ab(key, ab) {\n\tvar s = [],\n\t\tj = 0,\n\t\tx,\n\t\tres = '',\n\t\tinput,\n\t\toutput;\n\tvar dv = new DataView(ab);\n\n\t// Check for Unicode BOM and skip it\n\tvar starty = 0;\n\tif (\n\t\tdv.getUint8(0) == 0xef &&\n\t\tdv.getUint8(1) == 0xbb &&\n\t\tdv.getUint8(2) == 0xbf\n\t) {\n\t\tstarty = 3;\n\t}\n\n\t// Decrypt\n\tfor (var i = 0; i < 256; i++) {\n\t\ts[i] = i;\n\t}\n\tfor (i = 0; i < 256; i++) {\n\t\tj = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n\t\tx = s[i];\n\t\ts[i] = s[j];\n\t\ts[j] = x;\n\t}\n\ti = 0;\n\tj = 0;\n\tfor (var y = starty; y < ab.byteLength; y++) {\n\t\ti = (i + 1) % 256;\n\t\tj = (j + s[i]) % 256;\n\t\tx = s[i];\n\t\ts[i] = s[j];\n\t\ts[j] = x;\n\t\tinput = dv.getUint8(y);\n\t\toutput = input ^ s[(s[i] + s[j]) % 256];\n\t\tdv.setUint8(y, output);\n\t}\n}\n\nexport { PDFViewerApplication };\n","import { PDFViewerApplication } from './viewer/app';\n\nconst getViewerConfiguration = () => {\n\treturn {\n\t\tappContainer: document.body,\n\t\tmainContainer: document.getElementById('viewerContainer'),\n\t\tviewerContainer: document.getElementById('viewer'),\n\t\ttoolbar: {\n\t\t\tcontainer: document.getElementById('toolbarViewer'),\n\t\t\tnumPages: document.getElementsByClassName('numPages'),\n\t\t\tpageNumber: document.getElementsByClassName('pageNumber'),\n\t\t\tscaleSelect: document.getElementsByClassName('scaleSelect'),\n\t\t\tcustomScaleOption: document.getElementById('customScaleOption'),\n\t\t\tprevious: document.getElementsByClassName('previousButton'),\n\t\t\tnext: document.getElementsByClassName('nextButton'),\n\t\t\tzoomIn: document.getElementsByClassName('zoomIn'),\n\t\t\tzoomOut: document.getElementsByClassName('zoomOut'),\n\t\t\tviewFind: document.getElementsByClassName('viewFind-test'),\n\t\t\tprint: document.getElementById('print'),\n\t\t\tdownload: document.getElementsByClassName('download'),\n\t\t\tfullscreen: document.getElementsByClassName(\n\t\t\t\t'wppdf-fullscreen-button',\n\t\t\t),\n\t\t},\n\t\tfindBar: {\n\t\t\tbar: document.getElementsByClassName('findbar'),\n\t\t\ttoggleButton: document.getElementsByClassName('viewFind'),\n\t\t\tfindField: document.getElementsByClassName('findInput'),\n\t\t\thighlightAllCheckbox:\n\t\t\t\tdocument.getElementsByClassName('findHighlightAll'),\n\t\t\tcaseSensitiveCheckbox:\n\t\t\t\tdocument.getElementsByClassName('findMatchCase'),\n\t\t\tmatchDiacriticsCheckbox: document.getElementsByClassName(\n\t\t\t\t'findMatchDiacritics',\n\t\t\t),\n\t\t\tentireWordCheckbox:\n\t\t\t\tdocument.getElementsByClassName('findEntireWord'),\n\t\t\tfindMsg: document.getElementsByClassName('findMsg'),\n\t\t\tfindResultsCount:\n\t\t\t\tdocument.getElementsByClassName('findResultsCount'),\n\t\t\tfindPreviousButton: document.getElementsByClassName('findPrevious'),\n\t\t\tfindNextButton: document.getElementsByClassName('findNext'),\n\t\t},\n\t};\n};\nconst WebViewLoad = () => {\n\tconst config = getViewerConfiguration();\n\tPDFViewerApplication.run(config);\n};\n\ndocument.addEventListener('DOMContentLoaded', WebViewLoad, true);\n"],"names":[],"sourceRoot":""}