asma-doc-viewer 1.0.22 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/asmaDocViewer.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`:root{--react-pdf-annotation-layer: 1;--annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");--input-focus-border-color: Highlight;--input-focus-outline: 1px solid Canvas;--input-unfocused-border-color: transparent;--input-disabled-border-color: transparent;--input-hover-border-color: black;--link-outline: none}@media screen and (forced-colors: active){:root{--input-focus-border-color: CanvasText;--input-unfocused-border-color: ActiveText;--input-disabled-border-color: GrayText;--input-hover-border-color: Highlight;--link-outline: 1.5px solid LinkText}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid selectedItem}.annotationLayer .linkAnnotation:hover{-webkit-backdrop-filter:invert(100%);backdrop-filter:invert(100%)}}.annotationLayer{position:absolute;top:0;left:0;pointer-events:none;transform-origin:0 0;z-index:3}.annotationLayer[data-main-rotation="90"] .norotate{transform:rotate(270deg) translate(-100%)}.annotationLayer[data-main-rotation="180"] .norotate{transform:rotate(180deg) translate(-100%,-100%)}.annotationLayer[data-main-rotation="270"] .norotate{transform:rotate(90deg) translateY(-100%)}.annotationLayer canvas{position:absolute;width:100%;height:100%}.annotationLayer section{position:absolute;text-align:initial;pointer-events:auto;box-sizing:border-box;margin:0;transform-origin:0 0}.annotationLayer .linkAnnotation{outline:var(--link-outline)}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a:hover{opacity:.2;background:rgba(255,255,0,1);box-shadow:0 2px 10px #ff0}.annotationLayer .textAnnotation img{position:absolute;cursor:pointer;width:100%;height:100%;top:0;left:0}.annotationLayer .textWidgetAnnotation :is(input,textarea),.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{background-image:var(--annotation-unfocused-field-background);border:2px solid var(--input-unfocused-border-color);box-sizing:border-box;font:calc(9px * var(--scale-factor)) sans-serif;height:100%;margin:0;vertical-align:top;width:100%}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid red}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}.annotationLayer .textWidgetAnnotation textarea{resize:none}.annotationLayer .textWidgetAnnotation :is(input,textarea)[disabled],.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input[disabled]{background:none;border:2px solid var(--input-disabled-border-color);cursor:not-allowed}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:hover{border:2px solid var(--input-hover-border-color)}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation.checkBox input:hover{border-radius:2px}.annotationLayer .textWidgetAnnotation :is(input,textarea):focus,.annotationLayer .choiceWidgetAnnotation select:focus{background:none;border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) :focus{background-image:none;background-color:transparent}.annotationLayer .buttonWidgetAnnotation.checkBox :focus{border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.radioButton :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:CanvasText;content:"";display:block;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{height:80%;left:45%;width:1px}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:30%;top:20%;width:50%}.annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}.annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{-webkit-appearance:none;-moz-appearance:none;appearance:none}.annotationLayer .popupTriggerArea{height:100%;width:100%}.annotationLayer .fileAttachmentAnnotation .popupTriggerArea{position:absolute}.annotationLayer .popupWrapper{position:absolute;font-size:calc(9px * var(--scale-factor));width:100%;min-width:calc(180px * var(--scale-factor));pointer-events:none}.annotationLayer .popup{position:absolute;max-width:calc(180px * var(--scale-factor));background-color:#ff9;box-shadow:0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor)) #888;border-radius:calc(2px * var(--scale-factor));padding:calc(6px * var(--scale-factor));margin-left:calc(5px * var(--scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto}.annotationLayer .popup>*{font-size:calc(9px * var(--scale-factor))}.annotationLayer .popup h1{display:inline-block}.annotationLayer .popupDate{display:inline-block;margin-left:calc(5px * var(--scale-factor))}.annotationLayer .popupContent{border-top:1px solid rgba(51,51,51,1);margin-top:calc(2px * var(--scale-factor));padding-top:calc(2px * var(--scale-factor))}.annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--scale-factor))}.annotationLayer .highlightAnnotation,.annotationLayer .underlineAnnotation,.annotationLayer .squigglyAnnotation,.annotationLayer .strikeoutAnnotation,.annotationLayer .freeTextAnnotation,.annotationLayer .lineAnnotation svg line,.annotationLayer .squareAnnotation svg rect,.annotationLayer .circleAnnotation svg ellipse,.annotationLayer .polylineAnnotation svg polyline,.annotationLayer .polygonAnnotation svg polygon,.annotationLayer .caretAnnotation,.annotationLayer .inkAnnotation svg polyline,.annotationLayer .stampAnnotation,.annotationLayer .fileAttachmentAnnotation{cursor:pointer}.annotationLayer section svg{position:absolute;width:100%;height:100%;top:0;left:0}.annotationLayer .annotationTextContent{position:absolute;width:100%;height:100%;opacity:0;color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.annotationLayer .annotationTextContent span{width:100%;display:inline-block}:root{--react-pdf-text-layer: 1;--highlight-bg-color: rgba(180, 0, 170, 1);--highlight-selected-bg-color: rgba(0, 100, 0, 1)}@media screen and (forced-colors: active){:root{--highlight-bg-color: Highlight;--highlight-selected-bg-color: ButtonText}}[data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[data-main-rotation="270"]{transform:rotate(270deg) translate(-100%)}.textLayer{position:absolute;text-align:initial;inset:0;overflow:hidden;line-height:1;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;z-index:2}.textLayer :is(span,br){color:transparent;position:absolute;white-space:pre;cursor:text;margin:0;transform-origin:0 0}.textLayer span.markedContent{top:0;height:0}.textLayer .highlight{margin:-1px;padding:1px;background-color:var(--highlight-bg-color);border-radius:4px}.textLayer .highlight.appended{position:initial}.textLayer .highlight.begin{border-radius:4px 0 0 4px}.textLayer .highlight.end{border-radius:0 4px 4px 0}.textLayer .highlight.middle{border-radius:0}.textLayer .highlight.selected{background-color:var(--highlight-selected-bg-color)}.textLayer br::-moz-selection{background:transparent}.textLayer br::selection{background:transparent}.textLayer .endOfContent{display:block;position:absolute;inset:100% 0 0;z-index:-1;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.textLayer .endOfContent.active{top:0}.hiddenCanvasElement{position:absolute;top:0;left:0;width:0;height:0;display:none}`)),document.head.appendChild(t)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
|
|
2
|
-
var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n})(e,"symbol"!=typeof i?i+"":i,n),n),i=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},n=(t,e,n)=>(i(t,e,"read from private field"),n?n.call(t):e.get(t)),s=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},r=(t,e,n,s)=>(i(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),a=(t,e,i,s)=>({set _(n){r(t,e,n,i)},get _(){return n(t,e,s)}}),o=(t,e,n)=>(i(t,e,"access private method"),n);import l,{useMemo as h,useRef as c,useDebugValue as d,createElement as u,useContext as p,createContext as f,forwardRef as g,useReducer as m,useEffect as v,useImperativeHandle as
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`@charset "UTF-8";:root{--react-pdf-annotation-layer: 1;--annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");--input-focus-border-color: Highlight;--input-focus-outline: 1px solid Canvas;--input-unfocused-border-color: transparent;--input-disabled-border-color: transparent;--input-hover-border-color: black;--link-outline: none}@media screen and (forced-colors: active){:root{--input-focus-border-color: CanvasText;--input-unfocused-border-color: ActiveText;--input-disabled-border-color: GrayText;--input-hover-border-color: Highlight;--link-outline: 1.5px solid LinkText}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid selectedItem}.annotationLayer .linkAnnotation:hover{-webkit-backdrop-filter:invert(100%);backdrop-filter:invert(100%)}}.annotationLayer{position:absolute;top:0;left:0;pointer-events:none;transform-origin:0 0;z-index:3}.annotationLayer[data-main-rotation="90"] .norotate{transform:rotate(270deg) translate(-100%)}.annotationLayer[data-main-rotation="180"] .norotate{transform:rotate(180deg) translate(-100%,-100%)}.annotationLayer[data-main-rotation="270"] .norotate{transform:rotate(90deg) translateY(-100%)}.annotationLayer canvas{position:absolute;width:100%;height:100%}.annotationLayer section{position:absolute;text-align:initial;pointer-events:auto;box-sizing:border-box;margin:0;transform-origin:0 0}.annotationLayer .linkAnnotation{outline:var(--link-outline)}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a:hover{opacity:.2;background:rgba(255,255,0,1);box-shadow:0 2px 10px #ff0}.annotationLayer .textAnnotation img{position:absolute;cursor:pointer;width:100%;height:100%;top:0;left:0}.annotationLayer .textWidgetAnnotation :is(input,textarea),.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{background-image:var(--annotation-unfocused-field-background);border:2px solid var(--input-unfocused-border-color);box-sizing:border-box;font:calc(9px * var(--scale-factor)) sans-serif;height:100%;margin:0;vertical-align:top;width:100%}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid red}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}.annotationLayer .textWidgetAnnotation textarea{resize:none}.annotationLayer .textWidgetAnnotation :is(input,textarea)[disabled],.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input[disabled]{background:none;border:2px solid var(--input-disabled-border-color);cursor:not-allowed}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:hover{border:2px solid var(--input-hover-border-color)}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation.checkBox input:hover{border-radius:2px}.annotationLayer .textWidgetAnnotation :is(input,textarea):focus,.annotationLayer .choiceWidgetAnnotation select:focus{background:none;border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) :focus{background-image:none;background-color:transparent}.annotationLayer .buttonWidgetAnnotation.checkBox :focus{border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.radioButton :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:CanvasText;content:"";display:block;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{height:80%;left:45%;width:1px}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:30%;top:20%;width:50%}.annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}.annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{-webkit-appearance:none;-moz-appearance:none;appearance:none}.annotationLayer .popupTriggerArea{height:100%;width:100%}.annotationLayer .fileAttachmentAnnotation .popupTriggerArea{position:absolute}.annotationLayer .popupWrapper{position:absolute;font-size:calc(9px * var(--scale-factor));width:100%;min-width:calc(180px * var(--scale-factor));pointer-events:none}.annotationLayer .popup{position:absolute;max-width:calc(180px * var(--scale-factor));background-color:#ff9;box-shadow:0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor)) #888;border-radius:calc(2px * var(--scale-factor));padding:calc(6px * var(--scale-factor));margin-left:calc(5px * var(--scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto}.annotationLayer .popup>*{font-size:calc(9px * var(--scale-factor))}.annotationLayer .popup h1{display:inline-block}.annotationLayer .popupDate{display:inline-block;margin-left:calc(5px * var(--scale-factor))}.annotationLayer .popupContent{border-top:1px solid rgba(51,51,51,1);margin-top:calc(2px * var(--scale-factor));padding-top:calc(2px * var(--scale-factor))}.annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--scale-factor))}.annotationLayer .highlightAnnotation,.annotationLayer .underlineAnnotation,.annotationLayer .squigglyAnnotation,.annotationLayer .strikeoutAnnotation,.annotationLayer .freeTextAnnotation,.annotationLayer .lineAnnotation svg line,.annotationLayer .squareAnnotation svg rect,.annotationLayer .circleAnnotation svg ellipse,.annotationLayer .polylineAnnotation svg polyline,.annotationLayer .polygonAnnotation svg polygon,.annotationLayer .caretAnnotation,.annotationLayer .inkAnnotation svg polyline,.annotationLayer .stampAnnotation,.annotationLayer .fileAttachmentAnnotation{cursor:pointer}.annotationLayer section svg{position:absolute;width:100%;height:100%;top:0;left:0}.annotationLayer .annotationTextContent{position:absolute;width:100%;height:100%;opacity:0;color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.annotationLayer .annotationTextContent span{width:100%;display:inline-block}:root{--react-pdf-text-layer: 1;--highlight-bg-color: rgba(180, 0, 170, 1);--highlight-selected-bg-color: rgba(0, 100, 0, 1)}@media screen and (forced-colors: active){:root{--highlight-bg-color: Highlight;--highlight-selected-bg-color: ButtonText}}[data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[data-main-rotation="270"]{transform:rotate(270deg) translate(-100%)}.textLayer{position:absolute;text-align:initial;inset:0;overflow:hidden;line-height:1;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;z-index:2}.textLayer :is(span,br){color:transparent;position:absolute;white-space:pre;cursor:text;margin:0;transform-origin:0 0}.textLayer span.markedContent{top:0;height:0}.textLayer .highlight{margin:-1px;padding:1px;background-color:var(--highlight-bg-color);border-radius:4px}.textLayer .highlight.appended{position:initial}.textLayer .highlight.begin{border-radius:4px 0 0 4px}.textLayer .highlight.end{border-radius:0 4px 4px 0}.textLayer .highlight.middle{border-radius:0}.textLayer .highlight.selected{background-color:var(--highlight-selected-bg-color)}.textLayer br::-moz-selection{background:transparent}.textLayer br::selection{background:transparent}.textLayer .endOfContent{display:block;position:absolute;inset:100% 0 0;z-index:-1;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.textLayer .endOfContent.active{top:0}.hiddenCanvasElement{position:absolute;top:0;left:0;width:0;height:0;display:none}.printModal{font-family:sans-serif;display:flex;text-align:center;font-weight:300;font-size:30px;left:0;top:0;position:absolute;color:#045fb4;width:100%;height:100%;background-color:#ffffffe6}.printClose{position:absolute;right:10px;top:10px}.printClose:before{content:"×";font-family:Helvetica Neue,sans-serif;font-weight:100;line-height:1px;padding-top:.5em;display:block;font-size:2em;text-indent:1px;overflow:hidden;height:1.25em;width:1.25em;text-align:center;cursor:pointer}.printSpinner{margin-top:3px;margin-left:-40px;position:absolute;display:inline-block;width:25px;height:25px;border:2px solid hsl(209,96%,36%);border-radius:50%;animation:spin .75s infinite linear}.printSpinner:before,.printSpinner:after{left:-2px;top:-2px;display:none;position:absolute;content:"";width:inherit;height:inherit;border:inherit;border-radius:inherit}.printSpinner,.printSpinner:before,.printSpinner:after{display:inline-block;border-color:transparent;border-top-color:#045fb4;animation-duration:1.2s}.printSpinner:before{transform:rotate(120deg)}.printSpinner:after{transform:rotate(240deg)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}`)),document.head.appendChild(t)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
|
|
2
|
+
var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n})(e,"symbol"!=typeof i?i+"":i,n),n),i=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},n=(t,e,n)=>(i(t,e,"read from private field"),n?n.call(t):e.get(t)),s=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},r=(t,e,n,s)=>(i(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),a=(t,e,i,s)=>({set _(n){r(t,e,n,i)},get _(){return n(t,e,s)}}),o=(t,e,n)=>(i(t,e,"access private method"),n);import l,{useMemo as h,useRef as c,useDebugValue as d,createElement as u,useContext as p,createContext as f,forwardRef as g,useReducer as m,useEffect as v,useImperativeHandle as b,useCallback as y,useState as w,useLayoutEffect as A,memo as _}from"react";var x=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function S(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var k,E={exports:{}},C={};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -8,7 +8,7 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/var M,
|
|
11
|
+
*/var M,P={};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.development.js
|
|
@@ -17,7 +17,7 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the MIT license found in the
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
|
-
*/"production"===process.env.NODE_ENV?E.exports=function(){if(k)return C;k=1;var t=l,e=Symbol.for("react.element"),i=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r={key:!0,ref:!0,__self:!0,__source:!0};function a(t,i,a){var o,l={},h=null,c=null;for(o in void 0!==a&&(h=""+a),void 0!==i.key&&(h=""+i.key),void 0!==i.ref&&(c=i.ref),i)n.call(i,o)&&!r.hasOwnProperty(o)&&(l[o]=i[o]);if(t&&t.defaultProps)for(o in i=t.defaultProps)void 0===l[o]&&(l[o]=i[o]);return{$$typeof:e,type:t,key:h,ref:c,props:l,_owner:s.current}}return C.Fragment=i,C.jsx=a,C.jsxs=a,C}():E.exports=(M||(M=1,"production"!==process.env.NODE_ENV&&function(){var t=l,e=Symbol.for("react.element"),i=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),g=Symbol.iterator,m="@@iterator",v=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];!function(t,e,i){var n=v.ReactDebugCurrentFrame,s=n.getStackAddendum();""!==s&&(e+="%s",i=i.concat([s]));var r=i.map((function(t){return String(t)}));r.unshift("Warning: "+e),Function.prototype.apply.call(console[t],console,r)}("error",t,i)}var b,w=!1,A=!1,_=!1,x=!1,S=!1;function k(t){return t.displayName||"Context"}function E(t){if(null==t)return null;if("number"==typeof t.tag&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case n:return"Fragment";case i:return"Portal";case r:return"Profiler";case s:return"StrictMode";case c:return"Suspense";case d:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case o:return k(t)+".Consumer";case a:return k(t._context)+".Provider";case h:return function(t,e,i){var n=t.displayName;if(n)return n;var s=e.displayName||e.name||"";return""!==s?i+"("+s+")":i}(t,t.render,"ForwardRef");case u:var e=t.displayName||null;return null!==e?e:E(t.type)||"Memo";case p:var l=t,f=l._payload,g=l._init;try{return E(g(f))}catch{return null}}return null}b=Symbol.for("react.module.reference");var C,M,P,T,L,I,D,F=Object.assign,N=0;function O(){}O.__reactDisabledLog=!0;var W,j=v.ReactCurrentDispatcher;function B(t,e,i){if(void 0===W)try{throw Error()}catch(t){var n=t.stack.trim().match(/\n( *(at )?)/);W=n&&n[1]||""}return"\n"+W+t}var $,z=!1,H="function"==typeof WeakMap?WeakMap:Map;function U(t,e){if(!t||z)return"";var i,n=$.get(t);if(void 0!==n)return n;z=!0;var s,r=Error.prepareStackTrace;Error.prepareStackTrace=void 0,s=j.current,j.current=null,function(){if(0===N){C=console.log,M=console.info,P=console.warn,T=console.error,L=console.group,I=console.groupCollapsed,D=console.groupEnd;var t={configurable:!0,enumerable:!0,value:O,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}N++}();try{if(e){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(a,[])}catch(t){i=t}Reflect.construct(t,[],a)}else{try{a.call()}catch(t){i=t}t.call(a.prototype)}}else{try{throw Error()}catch(t){i=t}t()}}catch(e){if(e&&i&&"string"==typeof e.stack){for(var o=e.stack.split("\n"),l=i.stack.split("\n"),h=o.length-1,c=l.length-1;h>=1&&c>=0&&o[h]!==l[c];)c--;for(;h>=1&&c>=0;h--,c--)if(o[h]!==l[c]){if(1!==h||1!==c)do{if(h--,--c<0||o[h]!==l[c]){var d="\n"+o[h].replace(" at new "," at ");return t.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",t.displayName)),"function"==typeof t&&$.set(t,d),d}}while(h>=1&&c>=0);break}}}finally{z=!1,j.current=s,function(){if(0==--N){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},t,{value:C}),info:F({},t,{value:M}),warn:F({},t,{value:P}),error:F({},t,{value:T}),group:F({},t,{value:L}),groupCollapsed:F({},t,{value:I}),groupEnd:F({},t,{value:D})})}N<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=r}var u=t?t.displayName||t.name:"",p=u?B(u):"";return"function"==typeof t&&$.set(t,p),p}function V(t,e,i){if(null==t)return"";if("function"==typeof t)return U(t,function(t){var e=t.prototype;return!(!e||!e.isReactComponent)}(t));if("string"==typeof t)return B(t);switch(t){case c:return B("Suspense");case d:return B("SuspenseList")}if("object"==typeof t)switch(t.$$typeof){case h:return function(t,e,i){return U(t,!1)}(t.render);case u:return V(t.type,e,i);case p:var n=t,s=n._payload,r=n._init;try{return V(r(s),e,i)}catch{}}return""}$=new H;var G=Object.prototype.hasOwnProperty,q={},X=v.ReactDebugCurrentFrame;function Y(t){if(t){var e=t._owner,i=V(t.type,t._source,e?e.type:null);X.setExtraStackFrame(i)}else X.setExtraStackFrame(null)}var K=Array.isArray;function J(t){return K(t)}function Q(t){return""+t}function Z(t){if(function(t){try{return Q(t),!1}catch{return!0}}(t))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(t){return"function"==typeof Symbol&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object"}(t)),Q(t)}var tt,et,it,nt=v.ReactCurrentOwner,st={key:!0,ref:!0,__self:!0,__source:!0};it={};var rt=function(t,i,n,s,r,a,o){var l={$$typeof:e,type:t,key:i,ref:n,props:o,_owner:a,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function at(t,e,i,n,s){var r,a={},o=null,l=null;for(r in void 0!==i&&(Z(i),o=""+i),function(t){if(G.call(t,"key")){var e=Object.getOwnPropertyDescriptor(t,"key").get;if(e&&e.isReactWarning)return!1}return void 0!==t.key}(e)&&(Z(e.key),o=""+e.key),function(t){if(G.call(t,"ref")){var e=Object.getOwnPropertyDescriptor(t,"ref").get;if(e&&e.isReactWarning)return!1}return void 0!==t.ref}(e)&&(l=e.ref,function(t,e){if("string"==typeof t.ref&&nt.current&&e&&nt.current.stateNode!==e){var i=E(nt.current.type);it[i]||(y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',E(nt.current.type),t.ref),it[i]=!0)}}(e,s)),e)G.call(e,r)&&!st.hasOwnProperty(r)&&(a[r]=e[r]);if(t&&t.defaultProps){var h=t.defaultProps;for(r in h)void 0===a[r]&&(a[r]=h[r])}if(o||l){var c="function"==typeof t?t.displayName||t.name||"Unknown":t;o&&function(t,e){var i=function(){tt||(tt=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};i.isReactWarning=!0,Object.defineProperty(t,"key",{get:i,configurable:!0})}(a,c),l&&function(t,e){var i=function(){et||(et=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};i.isReactWarning=!0,Object.defineProperty(t,"ref",{get:i,configurable:!0})}(a,c)}return rt(t,o,l,s,n,nt.current,a)}var ot,lt=v.ReactCurrentOwner,ht=v.ReactDebugCurrentFrame;function ct(t){if(t){var e=t._owner,i=V(t.type,t._source,e?e.type:null);ht.setExtraStackFrame(i)}else ht.setExtraStackFrame(null)}function dt(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}function ut(){if(lt.current){var t=E(lt.current.type);if(t)return"\n\nCheck the render method of `"+t+"`."}return""}ot=!1;var pt={};function ft(t,e){if(t._store&&!t._store.validated&&null==t.key){t._store.validated=!0;var i=function(t){var e=ut();if(!e){var i="string"==typeof t?t:t.displayName||t.name;i&&(e="\n\nCheck the top-level render call using <"+i+">.")}return e}(e);if(!pt[i]){pt[i]=!0;var n="";t&&t._owner&&t._owner!==lt.current&&(n=" It was passed a child from "+E(t._owner.type)+"."),ct(t),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,n),ct(null)}}}function gt(t,e){if("object"==typeof t)if(J(t))for(var i=0;i<t.length;i++){var n=t[i];dt(n)&&ft(n,e)}else if(dt(t))t._store&&(t._store.validated=!0);else if(t){var s=function(t){if(null===t||"object"!=typeof t)return null;var e=g&&t[g]||t[m];return"function"==typeof e?e:null}(t);if("function"==typeof s&&s!==t.entries)for(var r,a=s.call(t);!(r=a.next()).done;)dt(r.value)&&ft(r.value,e)}}function mt(t){var e,i=t.type;if(null!=i&&"string"!=typeof i){if("function"==typeof i)e=i.propTypes;else{if("object"!=typeof i||i.$$typeof!==h&&i.$$typeof!==u)return;e=i.propTypes}if(e){var n=E(i);!function(t,e,i,n,s){var r=Function.call.bind(G);for(var a in t)if(r(t,a)){var o=void 0;try{if("function"!=typeof t[a]){var l=Error((n||"React class")+": "+i+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}o=t[a](e,a,n,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(t){o=t}o&&!(o instanceof Error)&&(Y(s),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",i,a,typeof o),Y(null)),o instanceof Error&&!(o.message in q)&&(q[o.message]=!0,Y(s),y("Failed %s type: %s",i,o.message),Y(null))}}(e,t.props,"prop",n,t)}else void 0===i.PropTypes||ot||(ot=!0,y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E(i)||"Unknown"));"function"==typeof i.getDefaultProps&&!i.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vt(t,i,l,g,m,v){var k=function(t){return!!("string"==typeof t||"function"==typeof t||t===n||t===r||S||t===s||t===c||t===d||x||t===f||w||A||_||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===u||t.$$typeof===a||t.$$typeof===o||t.$$typeof===h||t.$$typeof===b||void 0!==t.getModuleId))}(t);if(!k){var C="";(void 0===t||"object"==typeof t&&null!==t&&0===Object.keys(t).length)&&(C+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var M,R=function(t){return void 0!==t?"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".":""}(m);C+=R||ut(),null===t?M="null":J(t)?M="array":void 0!==t&&t.$$typeof===e?(M="<"+(E(t.type)||"Unknown")+" />",C=" Did you accidentally export a JSX literal instead of a component?"):M=typeof t,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",M,C)}var P=at(t,i,l,m,v);if(null==P)return P;if(k){var T=i.children;if(void 0!==T)if(g)if(J(T)){for(var L=0;L<T.length;L++)gt(T[L],t);Object.freeze&&Object.freeze(T)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else gt(T,t)}return t===n?function(t){for(var e=Object.keys(t.props),i=0;i<e.length;i++){var n=e[i];if("children"!==n&&"key"!==n){ct(t),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),ct(null);break}}null!==t.ref&&(ct(t),y("Invalid attribute `ref` supplied to `React.Fragment`."),ct(null))}(P):mt(P),P}var yt=function(t,e,i){return vt(t,e,i,!1)},bt=function(t,e,i){return vt(t,e,i,!0)};R.Fragment=n,R.jsx=yt,R.jsxs=bt}()),R);var P=E.exports,T=function(t){return t&&t.Math===Math&&t},L=T("object"==typeof globalThis&&globalThis)||T("object"==typeof window&&window)||T("object"==typeof self&&self)||T("object"==typeof x&&x)||T("object"==typeof x&&x)||function(){return this}()||Function("return this")(),I={},D=function(t){try{return!!t()}catch{return!0}},F=!D((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),N=!D((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),O=N,W=Function.prototype.call,j=O?W.bind(W):function(){return W.apply(W,arguments)},B={},$={}.propertyIsEnumerable,z=Object.getOwnPropertyDescriptor,H=z&&!$.call({1:2},1);B.f=H?function(t){var e=z(this,t);return!!e&&e.enumerable}:$;var U,V,G=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},q=N,X=Function.prototype,Y=X.call,K=q&&X.bind.bind(Y,Y),J=q?K:function(t){return function(){return Y.apply(t,arguments)}},Q=J,Z=Q({}.toString),tt=Q("".slice),et=D,it=function(t){return tt(Z(t),8,-1)},nt=Object,st=J("".split),rt=et((function(){return!nt("z").propertyIsEnumerable(0)}))?function(t){return"String"===it(t)?st(t,""):nt(t)}:nt,at=function(t){return null==t},ot=at,lt=TypeError,ht=function(t){if(ot(t))throw new lt("Can't call method on "+t);return t},ct=rt,dt=ht,ut=function(t){return ct(dt(t))},pt="object"==typeof document&&document.all,ft=typeof pt>"u"&&void 0!==pt?function(t){return"function"==typeof t||t===pt}:function(t){return"function"==typeof t},gt=ft,mt=function(t){return"object"==typeof t?null!==t:gt(t)},vt=L,yt=ft,bt=function(t,e){return arguments.length<2?function(t){return yt(t)?t:void 0}(vt[t]):vt[t]&&vt[t][e]},wt=J({}.isPrototypeOf),At=L,_t=typeof navigator<"u"&&String(navigator.userAgent)||"",xt=At.process,St=At.Deno,kt=xt&&xt.versions||St&&St.version,Et=kt&&kt.v8;Et&&(V=(U=Et.split("."))[0]>0&&U[0]<4?1:+(U[0]+U[1])),!V&&_t&&((!(U=_t.match(/Edge\/(\d+)/))||U[1]>=74)&&((U=_t.match(/Chrome\/(\d+)/))&&(V=+U[1])));var Ct=V,Mt=D,Rt=L.String,Pt=!!Object.getOwnPropertySymbols&&!Mt((function(){var t=Symbol("symbol detection");return!Rt(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Ct&&Ct<41})),Tt=Pt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Lt=bt,It=ft,Dt=wt,Ft=Object,Nt=Tt?function(t){return"symbol"==typeof t}:function(t){var e=Lt("Symbol");return It(e)&&Dt(e.prototype,Ft(t))},Ot=String,Wt=ft,jt=function(t){try{return Ot(t)}catch{return"Object"}},Bt=TypeError,$t=function(t){if(Wt(t))return t;throw new Bt(jt(t)+" is not a function")},zt=$t,Ht=at,Ut=j,Vt=ft,Gt=mt,qt=TypeError,Xt={exports:{}},Yt=L,Kt=Object.defineProperty,Jt=function(t,e){try{Kt(Yt,t,{value:e,configurable:!0,writable:!0})}catch{Yt[t]=e}return e},Qt=L,Zt=Jt,te="__core-js_shared__",ee=Xt.exports=Qt[te]||Zt(te,{});(ee.versions||(ee.versions=[])).push({version:"3.37.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"});var ie=Xt.exports,ne=ie,se=function(t,e){return ne[t]||(ne[t]=e||{})},re=ht,ae=Object,oe=function(t){return ae(re(t))},le=J({}.hasOwnProperty),he=Object.hasOwn||function(t,e){return le(oe(t),e)},ce=J,de=0,ue=Math.random(),pe=ce(1..toString),fe=function(t){return"Symbol("+(void 0===t?"":t)+")_"+pe(++de+ue,36)},ge=se,me=he,ve=fe,ye=Pt,be=Tt,we=L.Symbol,Ae=ge("wks"),_e=be?we.for||we:we&&we.withoutSetter||ve,xe=j,Se=mt,ke=Nt,Ee=function(t,e){var i=t[e];return Ht(i)?void 0:zt(i)},Ce=function(t,e){var i,n;if("string"===e&&Vt(i=t.toString)&&!Gt(n=Ut(i,t))||Vt(i=t.valueOf)&&!Gt(n=Ut(i,t))||"string"!==e&&Vt(i=t.toString)&&!Gt(n=Ut(i,t)))return n;throw new qt("Can't convert object to primitive value")},Me=TypeError,Re=function(t){return me(Ae,t)||(Ae[t]=ye&&me(we,t)?we[t]:_e("Symbol."+t)),Ae[t]}("toPrimitive"),Pe=function(t,e){if(!Se(t)||ke(t))return t;var i,n=Ee(t,Re);if(n){if(void 0===e&&(e="default"),i=xe(n,t,e),!Se(i)||ke(i))return i;throw new Me("Can't convert object to primitive value")}return void 0===e&&(e="number"),Ce(t,e)},Te=Nt,Le=function(t){var e=Pe(t,"string");return Te(e)?e:e+""},Ie=mt,De=L.document,Fe=Ie(De)&&Ie(De.createElement),Ne=function(t){return Fe?De.createElement(t):{}},Oe=!F&&!D((function(){return 7!==Object.defineProperty(Ne("div"),"a",{get:function(){return 7}}).a})),We=F,je=j,Be=B,$e=G,ze=ut,He=Le,Ue=he,Ve=Oe,Ge=Object.getOwnPropertyDescriptor;I.f=We?Ge:function(t,e){if(t=ze(t),e=He(e),Ve)try{return Ge(t,e)}catch{}if(Ue(t,e))return $e(!je(Be.f,t,e),t[e])};var qe={},Xe=F&&D((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ye=mt,Ke=String,Je=TypeError,Qe=function(t){if(Ye(t))return t;throw new Je(Ke(t)+" is not an object")},Ze=F,ti=Oe,ei=Xe,ii=Qe,ni=Le,si=TypeError,ri=Object.defineProperty,ai=Object.getOwnPropertyDescriptor,oi="enumerable",li="configurable",hi="writable";qe.f=Ze?ei?function(t,e,i){if(ii(t),e=ni(e),ii(i),"function"==typeof t&&"prototype"===e&&"value"in i&&hi in i&&!i[hi]){var n=ai(t,e);n&&n[hi]&&(t[e]=i.value,i={configurable:li in i?i[li]:n[li],enumerable:oi in i?i[oi]:n[oi],writable:!1})}return ri(t,e,i)}:ri:function(t,e,i){if(ii(t),e=ni(e),ii(i),ti)try{return ri(t,e,i)}catch{}if("get"in i||"set"in i)throw new si("Accessors not supported");return"value"in i&&(t[e]=i.value),t};var ci=qe,di=G,ui=F?function(t,e,i){return ci.f(t,e,di(1,i))}:function(t,e,i){return t[e]=i,t},pi={exports:{}},fi=F,gi=he,mi=Function.prototype,vi=fi&&Object.getOwnPropertyDescriptor,yi=gi(mi,"name"),bi={EXISTS:yi,PROPER:yi&&"something"===function(){}.name,CONFIGURABLE:yi&&(!fi||fi&&vi(mi,"name").configurable)},wi=ft,Ai=ie,_i=J(Function.toString);wi(Ai.inspectSource)||(Ai.inspectSource=function(t){return _i(t)});var xi,Si,ki,Ei=Ai.inspectSource,Ci=ft,Mi=L.WeakMap,Ri=Ci(Mi)&&/native code/.test(String(Mi)),Pi=fe,Ti=se("keys"),Li={},Ii=Ri,Di=L,Fi=mt,Ni=ui,Oi=he,Wi=ie,ji=function(t){return Ti[t]||(Ti[t]=Pi(t))},Bi=Li,$i="Object already initialized",zi=Di.TypeError,Hi=Di.WeakMap;if(Ii||Wi.state){var Ui=Wi.state||(Wi.state=new Hi);Ui.get=Ui.get,Ui.has=Ui.has,Ui.set=Ui.set,xi=function(t,e){if(Ui.has(t))throw new zi($i);return e.facade=t,Ui.set(t,e),e},Si=function(t){return Ui.get(t)||{}},ki=function(t){return Ui.has(t)}}else{var Vi=ji("state");Bi[Vi]=!0,xi=function(t,e){if(Oi(t,Vi))throw new zi($i);return e.facade=t,Ni(t,Vi,e),e},Si=function(t){return Oi(t,Vi)?t[Vi]:{}},ki=function(t){return Oi(t,Vi)}}var Gi={set:xi,get:Si,has:ki,enforce:function(t){return ki(t)?Si(t):xi(t,{})},getterFor:function(t){return function(e){var i;if(!Fi(e)||(i=Si(e)).type!==t)throw new zi("Incompatible receiver, "+t+" required");return i}}},qi=J,Xi=D,Yi=ft,Ki=he,Ji=F,Qi=bi.CONFIGURABLE,Zi=Ei,tn=Gi.enforce,en=Gi.get,nn=String,sn=Object.defineProperty,rn=qi("".slice),an=qi("".replace),on=qi([].join),ln=Ji&&!Xi((function(){return 8!==sn((function(){}),"length",{value:8}).length})),hn=String(String).split("String"),cn=pi.exports=function(t,e,i){"Symbol("===rn(nn(e),0,7)&&(e="["+an(nn(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!Ki(t,"name")||Qi&&t.name!==e)&&(Ji?sn(t,"name",{value:e,configurable:!0}):t.name=e),ln&&i&&Ki(i,"arity")&&t.length!==i.arity&&sn(t,"length",{value:i.arity});try{i&&Ki(i,"constructor")&&i.constructor?Ji&&sn(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=tn(t);return Ki(n,"source")||(n.source=on(hn,"string"==typeof e?e:"")),t};Function.prototype.toString=cn((function(){return Yi(this)&&en(this).source||Zi(this)}),"toString");var dn=pi.exports,un=ft,pn=qe,fn=dn,gn=Jt,mn={},vn=Math.ceil,yn=Math.floor,bn=Math.trunc||function(t){var e=+t;return(e>0?yn:vn)(e)},wn=function(t){var e=+t;return e!=e||0===e?0:bn(e)},An=wn,_n=Math.max,xn=Math.min,Sn=wn,kn=Math.min,En=function(t){var e=Sn(t);return e>0?kn(e,9007199254740991):0},Cn=ut,Mn=function(t,e){var i=An(t);return i<0?_n(i+e,0):xn(i,e)},Rn=function(t){return En(t.length)},Pn=function(t){return function(e,i,n){var s=Cn(e),r=Rn(s);if(0===r)return!t&&-1;var a,o=Mn(n,r);if(t&&i!=i){for(;r>o;)if((a=s[o++])!=a)return!0}else for(;r>o;o++)if((t||o in s)&&s[o]===i)return t||o||0;return!t&&-1}},Tn={includes:Pn(!0),indexOf:Pn(!1)},Ln=he,In=ut,Dn=Tn.indexOf,Fn=Li,Nn=J([].push),On=function(t,e){var i,n=In(t),s=0,r=[];for(i in n)!Ln(Fn,i)&&Ln(n,i)&&Nn(r,i);for(;e.length>s;)Ln(n,i=e[s++])&&(~Dn(r,i)||Nn(r,i));return r},Wn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");mn.f=Object.getOwnPropertyNames||function(t){return On(t,Wn)};var jn={};jn.f=Object.getOwnPropertySymbols;var Bn=bt,$n=mn,zn=jn,Hn=Qe,Un=J([].concat),Vn=Bn("Reflect","ownKeys")||function(t){var e=$n.f(Hn(t)),i=zn.f;return i?Un(e,i(t)):e},Gn=he,qn=Vn,Xn=I,Yn=qe,Kn=D,Jn=ft,Qn=/#|\.prototype\./,Zn=function(t,e){var i=es[ts(t)];return i===ns||i!==is&&(Jn(e)?Kn(e):!!e)},ts=Zn.normalize=function(t){return String(t).replace(Qn,".").toLowerCase()},es=Zn.data={},is=Zn.NATIVE="N",ns=Zn.POLYFILL="P",ss=Zn,rs=L,as=I.f,os=ui,ls=function(t,e,i,n){n||(n={});var s=n.enumerable,r=void 0!==n.name?n.name:e;if(un(i)&&fn(i,r,n),n.global)s?t[e]=i:gn(e,i);else{try{n.unsafe?t[e]&&(s=!0):delete t[e]}catch{}s?t[e]=i:pn.f(t,e,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},hs=Jt,cs=function(t,e,i){for(var n=qn(e),s=Yn.f,r=Xn.f,a=0;a<n.length;a++){var o=n[a];!Gn(t,o)&&(!i||!Gn(i,o))&&s(t,o,r(e,o))}},ds=ss,us={},ps=$t,fs=TypeError,gs=function(t){var e,i;this.promise=new t((function(t,n){if(void 0!==e||void 0!==i)throw new fs("Bad Promise constructor");e=t,i=n})),this.resolve=ps(e),this.reject=ps(i)};us.f=function(t){return new gs(t)};var ms=us;(function(t,e){var i,n,s,r,a,o=t.target,l=t.global,h=t.stat;if(i=l?rs:h?rs[o]||hs(o,{}):rs[o]&&rs[o].prototype)for(n in e){if(r=e[n],t.dontCallGetSet?s=(a=as(i,n))&&a.value:s=i[n],!ds(l?n:o+(h?".":"#")+n,t.forced)&&void 0!==s){if(typeof r==typeof s)continue;cs(r,s)}(t.sham||s&&s.sham)&&os(r,"sham",!0),ls(i,n,r,t)}})({target:"Promise",stat:!0},{withResolvers:function(){var t=ms.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var vs=function(){return vs=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},vs.apply(this,arguments)};function ys(t,e,i){if(i||2===arguments.length)for(var n,s=0,r=e.length;s<r;s++)(n||!(s in e))&&(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))}function bs(t){var e=Object.create(null);return function(i){return void 0===e[i]&&(e[i]=t(i)),e[i]}}var ws=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,As=bs((function(t){return ws.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91})),_s="-ms-",xs="-moz-",Ss="-webkit-",ks="comm",Es="rule",Cs="decl",Ms="@import",Rs="@keyframes",Ps="@layer",Ts=Math.abs,Ls=String.fromCharCode,Is=Object.assign;function Ds(t){return t.trim()}function Fs(t,e){return(t=e.exec(t))?t[0]:t}function Ns(t,e,i){return t.replace(e,i)}function Os(t,e,i){return t.indexOf(e,i)}function Ws(t,e){return 0|t.charCodeAt(e)}function js(t,e,i){return t.slice(e,i)}function Bs(t){return t.length}function $s(t){return t.length}function zs(t,e){return e.push(t),t}function Hs(t,e){return t.filter((function(t){return!Fs(t,e)}))}var Us=1,Vs=1,Gs=0,qs=0,Xs=0,Ys="";function Ks(t,e,i,n,s,r,a,o){return{value:t,root:e,parent:i,type:n,props:s,children:r,line:Us,column:Vs,length:a,return:"",siblings:o}}function Js(t,e){return Is(Ks("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function Qs(t){for(;t.root;)t=Js(t.root,{children:[t]});zs(t,t.siblings)}function Zs(){return Xs=qs<Gs?Ws(Ys,qs++):0,Vs++,10===Xs&&(Vs=1,Us++),Xs}function tr(){return Ws(Ys,qs)}function er(){return qs}function ir(t,e){return js(Ys,t,e)}function nr(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function sr(t){return Ds(ir(qs-1,or(91===t?t+2:40===t?t+1:t)))}function rr(t){for(;(Xs=tr())&&Xs<33;)Zs();return nr(t)>2||nr(Xs)>3?"":" "}function ar(t,e){for(;--e&&Zs()&&!(Xs<48||Xs>102||Xs>57&&Xs<65||Xs>70&&Xs<97););return ir(t,er()+(e<6&&32==tr()&&32==Zs()))}function or(t){for(;Zs();)switch(Xs){case t:return qs;case 34:case 39:34!==t&&39!==t&&or(Xs);break;case 40:41===t&&or(t);break;case 92:Zs()}return qs}function lr(t,e){for(;Zs()&&t+Xs!==57&&(t+Xs!==84||47!==tr()););return"/*"+ir(e,qs-1)+"*"+Ls(47===t?t:Zs())}function hr(t){for(;!nr(tr());)Zs();return ir(t,qs)}function cr(t){return function(t){return Ys="",t}(dr("",null,null,null,[""],t=function(t){return Us=Vs=1,Gs=Bs(Ys=t),qs=0,[]}(t),0,[0],t))}function dr(t,e,i,n,s,r,a,o,l){for(var h=0,c=0,d=a,u=0,p=0,f=0,g=1,m=1,v=1,y=0,b="",w=s,A=r,_=n,x=b;m;)switch(f=y,y=Zs()){case 40:if(108!=f&&58==Ws(x,d-1)){-1!=Os(x+=Ns(sr(y),"&","&\f"),"&\f",Ts(h?o[h-1]:0))&&(v=-1);break}case 34:case 39:case 91:x+=sr(y);break;case 9:case 10:case 13:case 32:x+=rr(f);break;case 92:x+=ar(er()-1,7);continue;case 47:switch(tr()){case 42:case 47:zs(pr(lr(Zs(),er()),e,i,l),l);break;default:x+="/"}break;case 123*g:o[h++]=Bs(x)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+c:-1==v&&(x=Ns(x,/\f/g,"")),p>0&&Bs(x)-d&&zs(p>32?fr(x+";",n,i,d-1,l):fr(Ns(x," ","")+";",n,i,d-2,l),l);break;case 59:x+=";";default:if(zs(_=ur(x,e,i,h,c,s,o,b,w=[],A=[],d,r),r),123===y)if(0===c)dr(x,e,_,_,w,r,d,o,A);else switch(99===u&&110===Ws(x,3)?100:u){case 100:case 108:case 109:case 115:dr(t,_,_,n&&zs(ur(t,_,_,0,0,s,o,b,s,w=[],d,A),A),s,A,d,o,n?w:A);break;default:dr(x,_,_,_,[""],A,0,o,A)}}h=c=p=0,g=v=1,b=x="",d=a;break;case 58:d=1+Bs(x),p=f;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==(Xs=qs>0?Ws(Ys,--qs):0,Vs--,10===Xs&&(Vs=1,Us--),Xs))continue;switch(x+=Ls(y),y*g){case 38:v=c>0?1:(x+="\f",-1);break;case 44:o[h++]=(Bs(x)-1)*v,v=1;break;case 64:45===tr()&&(x+=sr(Zs())),u=tr(),c=d=Bs(b=x+=hr(er())),y++;break;case 45:45===f&&2==Bs(x)&&(g=0)}}return r}function ur(t,e,i,n,s,r,a,o,l,h,c,d){for(var u=s-1,p=0===s?r:[""],f=$s(p),g=0,m=0,v=0;g<n;++g)for(var y=0,b=js(t,u+1,u=Ts(m=a[g])),w=t;y<f;++y)(w=Ds(m>0?p[y]+" "+b:Ns(b,/&\f/g,p[y])))&&(l[v++]=w);return Ks(t,e,i,0===s?Es:o,l,h,c,d)}function pr(t,e,i,n){return Ks(t,e,i,ks,Ls(Xs),js(t,2,-2),0,n)}function fr(t,e,i,n,s){return Ks(t,e,i,Cs,js(t,0,n),js(t,n+1,-1),n,s)}function gr(t,e,i){switch(function(t,e){return 45^Ws(t,0)?(((e<<2^Ws(t,0))<<2^Ws(t,1))<<2^Ws(t,2))<<2^Ws(t,3):0}(t,e)){case 5103:return Ss+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ss+t+t;case 4789:return xs+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Ss+t+xs+t+_s+t+t;case 5936:switch(Ws(t,e+11)){case 114:return Ss+t+_s+Ns(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Ss+t+_s+Ns(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Ss+t+_s+Ns(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return Ss+t+_s+t+t;case 6165:return Ss+t+_s+"flex-"+t+t;case 5187:return Ss+t+Ns(t,/(\w+).+(:[^]+)/,Ss+"box-$1$2"+_s+"flex-$1$2")+t;case 5443:return Ss+t+_s+"flex-item-"+Ns(t,/flex-|-self/g,"")+(Fs(t,/flex-|baseline/)?"":_s+"grid-row-"+Ns(t,/flex-|-self/g,""))+t;case 4675:return Ss+t+_s+"flex-line-pack"+Ns(t,/align-content|flex-|-self/g,"")+t;case 5548:return Ss+t+_s+Ns(t,"shrink","negative")+t;case 5292:return Ss+t+_s+Ns(t,"basis","preferred-size")+t;case 6060:return Ss+"box-"+Ns(t,"-grow","")+Ss+t+_s+Ns(t,"grow","positive")+t;case 4554:return Ss+Ns(t,/([^-])(transform)/g,"$1"+Ss+"$2")+t;case 6187:return Ns(Ns(Ns(t,/(zoom-|grab)/,Ss+"$1"),/(image-set)/,Ss+"$1"),t,"")+t;case 5495:case 3959:return Ns(t,/(image-set\([^]*)/,Ss+"$1$`$1");case 4968:return Ns(Ns(t,/(.+:)(flex-)?(.*)/,Ss+"box-pack:$3"+_s+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ss+t+t;case 4200:if(!Fs(t,/flex-|baseline/))return _s+"grid-column-align"+js(t,e)+t;break;case 2592:case 3360:return _s+Ns(t,"template-","")+t;case 4384:case 3616:return i&&i.some((function(t,i){return e=i,Fs(t.props,/grid-\w+-end/)}))?~Os(t+(i=i[e].value),"span",0)?t:_s+Ns(t,"-start","")+t+_s+"grid-row-span:"+(~Os(i,"span",0)?Fs(i,/\d+/):+Fs(i,/\d+/)-+Fs(t,/\d+/))+";":_s+Ns(t,"-start","")+t;case 4896:case 4128:return i&&i.some((function(t){return Fs(t.props,/grid-\w+-start/)}))?t:_s+Ns(Ns(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return Ns(t,/(.+)-inline(.+)/,Ss+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Bs(t)-1-e>6)switch(Ws(t,e+1)){case 109:if(45!==Ws(t,e+4))break;case 102:return Ns(t,/(.+:)(.+)-([^]+)/,"$1"+Ss+"$2-$3$1"+xs+(108==Ws(t,e+3)?"$3":"$2-$3"))+t;case 115:return~Os(t,"stretch",0)?gr(Ns(t,"stretch","fill-available"),e,i)+t:t}break;case 5152:case 5920:return Ns(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(e,i,n,s,r,a,o){return _s+i+":"+n+o+(s?_s+i+"-span:"+(r?a:+a-+n)+o:"")+t}));case 4949:if(121===Ws(t,e+6))return Ns(t,":",":"+Ss)+t;break;case 6444:switch(Ws(t,45===Ws(t,14)?18:11)){case 120:return Ns(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ss+(45===Ws(t,14)?"inline-":"")+"box$3$1"+Ss+"$2$3$1"+_s+"$2box$3")+t;case 100:return Ns(t,":",":"+_s)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Ns(t,"scroll-","scroll-snap-")+t}return t}function mr(t,e){for(var i="",n=0;n<t.length;n++)i+=e(t[n],n,t,e)||"";return i}function vr(t,e,i,n){switch(t.type){case Ps:if(t.children.length)break;case Ms:case Cs:return t.return=t.return||t.value;case ks:return"";case Rs:return t.return=t.value+"{"+mr(t.children,n)+"}";case Es:if(!Bs(t.value=t.props.join(",")))return""}return Bs(i=mr(t.children,n))?t.return=t.value+"{"+i+"}":""}function yr(t,e,i,n){if(t.length>-1&&!t.return)switch(t.type){case Cs:return void(t.return=gr(t.value,t.length,i));case Rs:return mr([Js(t,{value:Ns(t.value,"@","@"+Ss)})],n);case Es:if(t.length)return function(t,e){return t.map(e).join("")}(i=t.props,(function(e){switch(Fs(e,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Qs(Js(t,{props:[Ns(e,/:(read-\w+)/,":"+xs+"$1")]})),Qs(Js(t,{props:[e]})),Is(t,{props:Hs(i,n)});break;case"::placeholder":Qs(Js(t,{props:[Ns(e,/:(plac\w+)/,":"+Ss+"input-$1")]})),Qs(Js(t,{props:[Ns(e,/:(plac\w+)/,":"+xs+"$1")]})),Qs(Js(t,{props:[Ns(e,/:(plac\w+)/,_s+"input-$1")]})),Qs(Js(t,{props:[e]})),Is(t,{props:Hs(i,n)})}return""}))}}var br={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},wr=typeof process<"u"&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Ar="active",_r="data-styled-version",xr="6.1.11",Sr="/*!sc*/\n",kr=typeof window<"u"&&"HTMLElement"in window,Er=!!("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:typeof process<"u"&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),Cr=/invalid hook call/i,Mr=new Set,Rr=Object.freeze([]),Pr=Object.freeze({});var Tr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Lr=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ir=/(^-|-$)/g;function Dr(t){return t.replace(Lr,"-").replace(Ir,"")}var Fr=/(a)(d)/gi,Nr=52,Or=function(t){return String.fromCharCode(t+(t>25?39:97))};function Wr(t){var e,i="";for(e=Math.abs(t);e>Nr;e=e/Nr|0)i=Or(e%Nr)+i;return(Or(e%Nr)+i).replace(Fr,"$1-$2")}var jr,Br=function(t,e){for(var i=e.length;i;)t=33*t^e.charCodeAt(--i);return t},$r=function(t){return Br(5381,t)};function zr(t){return Wr($r(t)>>>0)}function Hr(t){return"production"!==process.env.NODE_ENV&&"string"==typeof t&&t||t.displayName||t.name||"Component"}function Ur(t){return"string"==typeof t&&("production"===process.env.NODE_ENV||t.charAt(0)===t.charAt(0).toLowerCase())}var Vr="function"==typeof Symbol&&Symbol.for,Gr=Vr?Symbol.for("react.memo"):60115,qr=Vr?Symbol.for("react.forward_ref"):60112,Xr={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Yr={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Kr={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Jr=((jr={})[qr]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},jr[Gr]=Kr,jr);function Qr(t){return("type"in(e=t)&&e.type.$$typeof)===Gr?Kr:"$$typeof"in t?Jr[t.$$typeof]:Xr;var e}var Zr=Object.defineProperty,ta=Object.getOwnPropertyNames,ea=Object.getOwnPropertySymbols,ia=Object.getOwnPropertyDescriptor,na=Object.getPrototypeOf,sa=Object.prototype;function ra(t,e,i){if("string"!=typeof e){if(sa){var n=na(e);n&&n!==sa&&ra(t,n,i)}var s=ta(e);ea&&(s=s.concat(ea(e)));for(var r=Qr(t),a=Qr(e),o=0;o<s.length;++o){var l=s[o];if(!(l in Yr||i&&i[l]||a&&l in a||r&&l in r)){var h=ia(e,l);try{Zr(t,l,h)}catch{}}}}return t}function aa(t){return"function"==typeof t}function oa(t){return"object"==typeof t&&"styledComponentId"in t}function la(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function ha(t,e){if(0===t.length)return"";for(var i=t[0],n=1;n<t.length;n++)i+=e?e+t[n]:t[n];return i}function ca(t){return null!==t&&"object"==typeof t&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function da(t,e,i){if(void 0===i&&(i=!1),!i&&!ca(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var n=0;n<e.length;n++)t[n]=da(t[n],e[n]);else if(ca(e))for(var n in e)t[n]=da(t[n],e[n]);return t}function ua(t,e){Object.defineProperty(t,"toString",{value:e})}var pa="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function fa(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=t[0],n=[],s=1,r=t.length;s<r;s+=1)n.push(t[s]);return n.forEach((function(t){i=i.replace(/%[a-z]/,t)})),i}function ga(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):"")):new Error(fa.apply(void 0,ys([pa[t]],e,!1)).trim())}var ma=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return t.prototype.indexOfGroup=function(t){for(var e=0,i=0;i<t;i++)e+=this.groupSizes[i];return e},t.prototype.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var i=this.groupSizes,n=i.length,s=n;t>=s;)if((s<<=1)<0)throw ga(16,"".concat(t));this.groupSizes=new Uint32Array(s),this.groupSizes.set(i),this.length=s;for(var r=n;r<s;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(t+1),o=(r=0,e.length);r<o;r++)this.tag.insertRule(a,e[r])&&(this.groupSizes[t]++,a++)},t.prototype.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],i=this.indexOfGroup(t),n=i+e;this.groupSizes[t]=0;for(var s=i;s<n;s++)this.tag.deleteRule(i)}},t.prototype.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var i=this.groupSizes[t],n=this.indexOfGroup(t),s=n+i,r=n;r<s;r++)e+="".concat(this.tag.getRule(r)).concat(Sr);return e},t}(),va=new Map,ya=new Map,ba=1,wa=function(t){if(va.has(t))return va.get(t);for(;ya.has(ba);)ba++;var e=ba++;if("production"!==process.env.NODE_ENV&&((0|e)<0||e>1073741824))throw ga(16,"".concat(e));return va.set(t,e),ya.set(e,t),e},Aa=function(t,e){ba=e+1,va.set(t,e),ya.set(e,t)},_a="style[".concat(wr,"][").concat(_r,'="').concat(xr,'"]'),xa=new RegExp("^".concat(wr,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Sa=function(t,e,i){for(var n,s=i.split(","),r=0,a=s.length;r<a;r++)(n=s[r])&&t.registerName(e,n)},ka=function(t,e){for(var i,n=(null!==(i=e.textContent)&&void 0!==i?i:"").split(Sr),s=[],r=0,a=n.length;r<a;r++){var o=n[r].trim();if(o){var l=o.match(xa);if(l){var h=0|parseInt(l[1],10),c=l[2];0!==h&&(Aa(c,h),Sa(t,c,l[3]),t.getTag().insertRules(h,s)),s.length=0}else s.push(o)}}};var Ea=function(t){var e,i,n=document.head,s=t||n,r=document.createElement("style"),a=(e=s,(i=Array.from(e.querySelectorAll("style[".concat(wr,"]"))))[i.length-1]),o=void 0!==a?a.nextSibling:null;r.setAttribute(wr,Ar),r.setAttribute(_r,xr);var l=typeof __webpack_nonce__<"u"?__webpack_nonce__:null;return l&&r.setAttribute("nonce",l),s.insertBefore(r,o),r},Ca=function(){function t(t){this.element=Ea(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,i=0,n=e.length;i<n;i++){var s=e[i];if(s.ownerNode===t)return s}throw ga(17)}(this.element),this.length=0}return t.prototype.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch{return!1}},t.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},t.prototype.getRule=function(t){var e=this.sheet.cssRules[t];return e&&e.cssText?e.cssText:""},t}(),Ma=function(){function t(t){this.element=Ea(t),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(t,e){if(t<=this.length&&t>=0){var i=document.createTextNode(e);return this.element.insertBefore(i,this.nodes[t]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},t.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),Ra=function(){function t(t){this.rules=[],this.length=0}return t.prototype.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},t.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},t.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),Pa=kr,Ta={isServer:!kr,useCSSOMInjection:!Er},La=function(){function t(t,e,i){void 0===t&&(t=Pr),void 0===e&&(e={});var n=this;this.options=vs(vs({},Ta),t),this.gs=e,this.names=new Map(i),this.server=!!t.isServer,!this.server&&kr&&Pa&&(Pa=!1,function(t){for(var e=document.querySelectorAll(_a),i=0,n=e.length;i<n;i++){var s=e[i];s&&s.getAttribute(wr)!==Ar&&(ka(t,s),s.parentNode&&s.parentNode.removeChild(s))}}(this)),ua(this,(function(){return function(t){for(var e=t.getTag(),i=e.length,n="",s=function(i){var s,r=(s=i,ya.get(s));if(void 0===r)return"continue";var a=t.names.get(r),o=e.getGroup(i);if(void 0===a||0===o.length)return"continue";var l="".concat(wr,".g").concat(i,'[id="').concat(r,'"]'),h="";void 0!==a&&a.forEach((function(t){t.length>0&&(h+="".concat(t,","))})),n+="".concat(o).concat(l,'{content:"').concat(h,'"}').concat(Sr)},r=0;r<i;r++)s(r);return n}(n)}))}return t.registerId=function(t){return wa(t)},t.prototype.reconstructWithOptions=function(e,i){return void 0===i&&(i=!0),new t(vs(vs({},this.options),e),this.gs,i&&this.names||void 0)},t.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(t=this.options,e=t.useCSSOMInjection,i=t.target,n=t.isServer?new Ra(i):e?new Ca(i):new Ma(i),new ma(n)));var t,e,i,n},t.prototype.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},t.prototype.registerName=function(t,e){if(wa(t),this.names.has(t))this.names.get(t).add(e);else{var i=new Set;i.add(e),this.names.set(t,i)}},t.prototype.insertRules=function(t,e,i){this.registerName(t,e),this.getTag().insertRules(wa(t),i)},t.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},t.prototype.clearRules=function(t){this.getTag().clearGroup(wa(t)),this.clearNames(t)},t.prototype.clearTag=function(){this.tag=void 0},t}(),Ia=/&/g,Da=/^\s*\/\/.*$/gm;function Fa(t,e){return t.map((function(t){return"rule"===t.type&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map((function(t){return"".concat(e," ").concat(t)}))),Array.isArray(t.children)&&"@keyframes"!==t.type&&(t.children=Fa(t.children,e)),t}))}var Na=new La,Oa=function(t){var e,i,n,s=void 0===t?Pr:t,r=s.options,a=void 0===r?Pr:r,o=s.plugins,l=void 0===o?Rr:o,h=function(t,n,s){return s.startsWith(i)&&s.endsWith(i)&&s.replaceAll(i,"").length>0?".".concat(e):t},c=l.slice();c.push((function(t){t.type===Es&&t.value.includes("&")&&(t.props[0]=t.props[0].replace(Ia,i).replace(n,h))})),a.prefix&&c.push(yr),c.push(vr);var d=function(t,s,r,o){void 0===s&&(s=""),void 0===r&&(r=""),void 0===o&&(o="&"),e=o,i=s,n=new RegExp("\\".concat(i,"\\b"),"g");var l=t.replace(Da,""),h=cr(r||s?"".concat(r," ").concat(s," { ").concat(l," }"):l);a.namespace&&(h=Fa(h,a.namespace));var d=[];return mr(h,function(t){var e=$s(t);return function(i,n,s,r){for(var a="",o=0;o<e;o++)a+=t[o](i,n,s,r)||"";return a}}(c.concat(function(t){return function(e){e.root||(e=e.return)&&t(e)}}((function(t){return d.push(t)}))))),d};return d.hash=l.length?l.reduce((function(t,e){return e.name||ga(15),Br(t,e.name)}),5381).toString():"",d}(),Wa=l.createContext({shouldForwardProp:void 0,styleSheet:Na,stylis:Oa});function ja(){return p(Wa)}Wa.Consumer,l.createContext(void 0);var Ba=function(){function t(t,e){var i=this;this.inject=function(t,e){void 0===e&&(e=Oa);var n=i.name+e.hash;t.hasNameForId(i.id,n)||t.insertRules(i.id,n,e(i.rules,n,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=e,ua(this,(function(){throw ga(12,String(i.name))}))}return t.prototype.getName=function(t){return void 0===t&&(t=Oa),this.name+t.hash},t}(),$a=function(t){return t>="A"&&t<="Z"};function za(t){for(var e="",i=0;i<t.length;i++){var n=t[i];if(1===i&&"-"===n&&"-"===t[0])return t;$a(n)?e+="-"+n.toLowerCase():e+=n}return e.startsWith("ms-")?"-"+e:e}var Ha=function(t){return null==t||!1===t||""===t},Ua=function(t){var e,i,n=[];for(var s in t){var r=t[s];t.hasOwnProperty(s)&&!Ha(r)&&(Array.isArray(r)&&r.isCss||aa(r)?n.push("".concat(za(s),":"),r,";"):ca(r)?n.push.apply(n,ys(ys(["".concat(s," {")],Ua(r),!1),["}"],!1)):n.push("".concat(za(s),": ").concat((e=s,null==(i=r)||"boolean"==typeof i||""===i?"":"number"!=typeof i||0===i||e in br||e.startsWith("--")?String(i).trim():"".concat(i,"px")),";")))}return n};function Va(t,e,i,n){if(Ha(t))return[];if(oa(t))return[".".concat(t.styledComponentId)];if(aa(t)){if(!aa(r=t)||r.prototype&&r.prototype.isReactComponent||!e)return[t];var s=t(e);return"production"===process.env.NODE_ENV||"object"!=typeof s||Array.isArray(s)||s instanceof Ba||ca(s)||null===s||console.error("".concat(Hr(t)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),Va(s,e,i,n)}var r;return t instanceof Ba?i?(t.inject(i,n),[t.getName(n)]):[t]:ca(t)?Ua(t):Array.isArray(t)?Array.prototype.concat.apply(Rr,t.map((function(t){return Va(t,e,i,n)}))):[t.toString()]}var Ga=$r(xr),qa=function(){function t(t,e,i){this.rules=t,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===i||i.isStatic)&&function(t){for(var e=0;e<t.length;e+=1){var i=t[e];if(aa(i)&&!oa(i))return!1}return!0}(t),this.componentId=e,this.baseHash=Br(Ga,e),this.baseStyle=i,La.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,i){var n=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,e,i):"";if(this.isStatic&&!i.hash)if(this.staticRulesId&&e.hasNameForId(this.componentId,this.staticRulesId))n=la(n,this.staticRulesId);else{var s=ha(Va(this.rules,t,e,i)),r=Wr(Br(this.baseHash,s)>>>0);if(!e.hasNameForId(this.componentId,r)){var a=i(s,".".concat(r),void 0,this.componentId);e.insertRules(this.componentId,r,a)}n=la(n,r),this.staticRulesId=r}else{for(var o=Br(this.baseHash,i.hash),l="",h=0;h<this.rules.length;h++){var c=this.rules[h];if("string"==typeof c)l+=c,"production"!==process.env.NODE_ENV&&(o=Br(o,c));else if(c){var d=ha(Va(c,t,e,i));o=Br(o,d+h),l+=d}}if(l){var u=Wr(o>>>0);e.hasNameForId(this.componentId,u)||e.insertRules(this.componentId,u,i(l,".".concat(u),void 0,this.componentId)),n=la(n,u)}}return n},t}(),Xa=l.createContext(void 0);function Ya(t){var e=l.useContext(Xa),i=h((function(){return function(t,e){if(!t)throw ga(14);if(aa(t)){var i=t(e);if("production"!==process.env.NODE_ENV&&(null===i||Array.isArray(i)||"object"!=typeof i))throw ga(7);return i}if(Array.isArray(t)||"object"!=typeof t)throw ga(8);return e?vs(vs({},e),t):t}(t.theme,e)}),[t.theme,e]);return t.children?l.createElement(Xa.Provider,{value:i},t.children):null}Xa.Consumer;var Ka={},Ja=new Set;function Qa(t,e,i){var n,s=oa(t),r=t,a=!Ur(t),o=e.attrs,h=void 0===o?Rr:o,p=e.componentId,f=void 0===p?function(t,e){var i="string"!=typeof t?"sc":Dr(t);Ka[i]=(Ka[i]||0)+1;var n="".concat(i,"-").concat(zr(xr+i+Ka[i]));return e?"".concat(e,"-").concat(n):n}(e.displayName,e.parentComponentId):p,g=e.displayName,m=void 0===g?Ur(n=t)?"styled.".concat(n):"Styled(".concat(Hr(n),")"):g,v=e.displayName&&e.componentId?"".concat(Dr(e.displayName),"-").concat(e.componentId):e.componentId||f,y=s&&r.attrs?r.attrs.concat(h).filter(Boolean):h,b=e.shouldForwardProp;if(s&&r.shouldForwardProp){var w=r.shouldForwardProp;if(e.shouldForwardProp){var A=e.shouldForwardProp;b=function(t,e){return w(t,e)&&A(t,e)}}else b=w}var _=new qa(i,v,s?r.componentStyle:void 0);function x(t,e){return function(t,e,i){var n=t.attrs,s=t.componentStyle,r=t.defaultProps,a=t.foldedComponentIds,o=t.styledComponentId,h=t.target,c=l.useContext(Xa),p=ja(),f=t.shouldForwardProp||p.shouldForwardProp;"production"!==process.env.NODE_ENV&&d(o);var g=function(t,e,i){return void 0===i&&(i=Pr),t.theme!==i.theme&&t.theme||e||i.theme}(e,c,r)||Pr,m=function(t,e,i){for(var n,s=vs(vs({},e),{className:void 0,theme:i}),r=0;r<t.length;r+=1){var a=aa(n=t[r])?n(s):n;for(var o in a)s[o]="className"===o?la(s[o],a[o]):"style"===o?vs(vs({},s[o]),a[o]):a[o]}return e.className&&(s.className=la(s.className,e.className)),s}(n,e,g),v=m.as||h,y={};for(var b in m)void 0===m[b]||"$"===b[0]||"as"===b||"theme"===b&&m.theme===g||("forwardedAs"===b?y.as=m.forwardedAs:f&&!f(b,v)||(y[b]=m[b],f||"development"!==process.env.NODE_ENV||As(b)||Ja.has(b)||!Tr.has(v)||(Ja.add(b),console.warn('styled-components: it looks like an unknown prop "'.concat(b,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var w,A,_,x,S=(w=s,A=m,_=ja(),x=w.generateAndInjectStyles(A,_.styleSheet,_.stylis),"production"!==process.env.NODE_ENV&&d(x),x);"production"!==process.env.NODE_ENV&&t.warnTooManyClasses&&t.warnTooManyClasses(S);var k=la(a,o);return S&&(k+=" "+S),m.className&&(k+=" "+m.className),y[Ur(v)&&!Tr.has(v)?"class":"className"]=k,y.ref=i,u(v,y)}(S,t,e)}x.displayName=m;var S=l.forwardRef(x);return S.attrs=y,S.componentStyle=_,S.displayName=m,S.shouldForwardProp=b,S.foldedComponentIds=s?la(r.foldedComponentIds,r.styledComponentId):"",S.styledComponentId=v,S.target=s?r.target:t,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=s?function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=0,s=e;n<s.length;n++)da(t,s[n],!0);return t}({},r.defaultProps,t):t}}),"production"!==process.env.NODE_ENV&&(function(t,e){if("production"!==process.env.NODE_ENV){var i=e?' with the id of "'.concat(e,'"'):"",n="The component ".concat(t).concat(i," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",s=console.error;try{var r=!0;console.error=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];Cr.test(t)?(r=!1,Mr.delete(n)):s.apply(void 0,ys([t],e,!1))},c(),r&&!Mr.has(n)&&(console.warn(n),Mr.add(n))}catch(t){Cr.test(t.message)&&Mr.delete(n)}finally{console.error=s}}}(m,v),S.warnTooManyClasses=function(t,e){var i={},n=!1;return function(s){if(!n&&(i[s]=!0,Object.keys(i).length>=200)){var r=e?' with the id of "'.concat(e,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(t).concat(r,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),n=!0,i={}}}}(m,v)),ua(S,(function(){return".".concat(S.styledComponentId)})),a&&ra(S,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),S}function Za(t,e){for(var i=[t[0]],n=0,s=e.length;n<s;n+=1)i.push(e[n],t[n+1]);return i}var to=function(t){return Object.assign(t,{isCss:!0})};function eo(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(aa(t)||ca(t))return to(Va(Za(Rr,ys([t],e,!0))));var n=t;return 0===e.length&&1===n.length&&"string"==typeof n[0]?Va(n):to(Va(Za(n,e)))}function io(t,e,i){if(void 0===i&&(i=Pr),!e)throw ga(1,e);var n=function(n){for(var s=[],r=1;r<arguments.length;r++)s[r-1]=arguments[r];return t(e,i,eo.apply(void 0,ys([n],s,!1)))};return n.attrs=function(n){return io(t,e,vs(vs({},i),{attrs:Array.prototype.concat(i.attrs,n).filter(Boolean)}))},n.withConfig=function(n){return io(t,e,vs(vs({},i),n))},n}var no=function(t){return io(Qa,t)},so=no;Tr.forEach((function(t){so[t]=no(t)})),"production"!==process.env.NODE_ENV&&typeof navigator<"u"&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var ro="__sc-".concat(wr,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&typeof window<"u"&&(window[ro]||(window[ro]=0),1===window[ro]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[ro]+=1);const ao={en:{documentNavInfo:"Document {{ currentFileNo }} of {{ allFilesCount }}",noRendererMessage:"No renderer for file type: {{{ fileType }}}",downloadButtonLabel:"Download file",brokenFile:"Your file is broken. Please check it on your machine.",msgPluginRecipients:"Recipients",msgPluginSender:"Sender",pdfPluginLoading:"Loading...",pdfPluginPageNumber:"Page {{ currentPage }}/{{ allPagesCount }}"},no:{documentNavInfo:"Dokument {{ currentFileNo }} av {{ allFilesCount }}",noRendererMessage:"Ingen rendering for filtype: {{{ fileType }}}",downloadButtonLabel:"Last ned fil",brokenFile:"Filen din er ødelagt. Vennligst sjekk den på maskinen din.",msgPluginRecipients:"Mottakere",msgPluginSender:"Avsender",pdfPluginLoading:"Lasting...",pdfPluginPageNumber:"Side {{ currentPage }}/{{ allPagesCount }}"},pl:{documentNavInfo:"Dokument {{ currentFileNo }} z {{ allFilesCount }}",noRendererMessage:"Brak funckji renderującej dla: {{{ fileType }}}",downloadButtonLabel:"Pobierz plik",brokenFile:"Twój plik jest uszkodzony. Sprawdź go na swoim komputerze.",msgPluginRecipients:"Odbiorcy",msgPluginSender:"Nadawca",pdfPluginLoading:"Wczytywanie...",pdfPluginPageNumber:"Strona {{ currentPage }}/{{ allPagesCount }}"},es:{documentNavInfo:"Documento {{ currentFileNo }} de {{ allFilesCount }}",noRendererMessage:"No hay procesador para el tipo de archivo: {{{ fileType }}}",downloadButtonLabel:"Descargar archivo",brokenFile:"Tu archivo está roto. Compruébalo en tu máquina.",msgPluginRecipients:"Destinatarios",msgPluginSender:"Remitente",pdfPluginLoading:"Cargando...",pdfPluginPageNumber:"Página {{ currentPage }}/{{ allPagesCount }}"},de:{documentNavInfo:"Dokument {{ currentFileNo }} von {{ allFilesCount }}",noRendererMessage:"Kein Renderer für Dateityp: {{{ fileType }}}",downloadButtonLabel:"Datei herunterladen",brokenFile:"Ihre Datei ist defekt. Bitte überprüfen Sie sie auf Ihrem Rechner.",msgPluginRecipients:"Empfänger",msgPluginSender:"Absender",pdfPluginLoading:"Wird geladen...",pdfPluginPageNumber:"Seite {{ currentPage }}/{{ allPagesCount }}"},it:{documentNavInfo:"Documento {{ currentFileNo }} di {{ allFilesCount }}",noRendererMessage:"Nessun renderer per il tipo di file: {{{ fileType }}}",downloadButtonLabel:"Scarica file",brokenFile:"Il tuo file è danneggiato. Controllalo sul tuo computer.",msgPluginRecipients:"Destinatari",msgPluginSender:"Mittente",pdfPluginLoading:"Caricamento in corso...",pdfPluginPageNumber:"Pagina {{ currentPage }}/{{ allPagesCount }}"},pt:{documentNavInfo:"Documento {{ currentFileNo }} de {{ allFilesCount }}",noRendererMessage:"Nenhum renderizador para o tipo de arquivo: {{{ fileType }}}",downloadButtonLabel:"Baixar arquivo",brokenFile:"Seu arquivo está quebrado. Por favor, verifique-o em sua máquina.",msgPluginRecipients:"Destinatários",msgPluginSender:"Remetente",pdfPluginLoading:"Carregando...",pdfPluginPageNumber:"Página {{ currentPage }}/{{ allPagesCount }}"},fr:{documentNavInfo:"Document {{ currentFileNo }} de {{ allFilesCount }}",noRendererMessage:"Aucun moteur de rendu pour le type de fichier : {{{ fileType }}}",downloadButtonLabel:"Télécharger le fichier",brokenFile:"Votre fichier est cassé. Veuillez le vérifier sur votre machine.",msgPluginRecipients:"Destinataires",msgPluginSender:"Expéditeur",pdfPluginLoading:"Chargement...",pdfPluginPageNumber:"Page {{ currentPage }}/{{ allPagesCount }}"},ar:{documentNavInfo:"مستند {{ currentFileNo }} من {{ allFilesCount }}",noRendererMessage:"{{{ fileType }}} : لا يمكننا عرض هذا النوع من الملفات",downloadButtonLabel:"تحميل الملف",brokenFile:"الملف تالف، يرجى التحقق منه على جهازك الخاص.",msgPluginRecipients:"المستلمين",msgPluginSender:"المرسل",pdfPluginLoading:"تحميل ...",pdfPluginPageNumber:" {{ allPagesCount }} \\ {{ currentPage }} صفحة "},sr:{documentNavInfo:"Dokument {{ currentFileNo }} od {{ allFilesCount }}",noRendererMessage:"Ne postoji pregledač za tip fajla: {{ fileType }}",downloadButtonLabel:"Preuzimanje fajla",brokenFile:"Vaš fajl nije dobar. Molimo Vas da probate da ga otvorite na vašem računaru.",msgPluginRecipients:"Primaoci",msgPluginSender:"Pošiljalac",pdfPluginLoading:"Učitavanje...",pdfPluginPageNumber:"Strana {{ currentPage }}/{{ allPagesCount }}"},sr_cyr:{documentNavInfo:"Документ {{ currentFileNo }} od {{ allFilesCount }}",noRendererMessage:"Не постоји прегледач за тип фајла: {{ fileType }}",downloadButtonLabel:"Преузимање фајла",brokenFile:"Ваш фајл није добар. Молимо Вас да пробате да га отворите на вашем рачунару.",msgPluginRecipients:"Примаоци",msgPluginSender:"Пошиљалац",pdfPluginLoading:"Учитавање...",pdfPluginPageNumber:"Страна {{ currentPage }}/{{ allPagesCount }}"},ja:{documentNavInfo:"ファイル {{ currentFileNo }} / {{ allFilesCount }}",noRendererMessage:"ファイルタイプに対応したレンダラーはありません: {{ fileType }}",downloadButtonLabel:"ダウンロード",brokenFile:"ファイルが壊れています。あなたのマシンでファイルを確認してください。",msgPluginRecipients:"受信者",msgPluginSender:"送信者",pdfPluginLoading:"ローティング中...",pdfPluginPageNumber:"ページ {{ currentPage }}/{{ allPagesCount }}"},ru:{documentNavInfo:"Документ {{ currentFileNo }} из {{ allFilesCount }}",noRendererMessage:"Данный тип файла не поддерживается рендером: {{{ fileType }}}",downloadButtonLabel:"Скачать файл",brokenFile:"Ваш файл сломан. Пожалуйста, проверьте его на своём комьютере.",msgPluginRecipients:"Получатели",msgPluginSender:"Отправитель",pdfPluginLoading:"Загрузка...",pdfPluginPageNumber:"Страница {{ currentPage }}/{{ allPagesCount }}"},se:{documentNavInfo:"Dokument {{ currentFileNo }} av {{ allFilesCount }}",noRendererMessage:"Ingen renderare för filtypen: {{{ fileType }}}",downloadButtonLabel:"Ladda ner",brokenFile:"Filen är trasig. Var vänlig kontrollera den på din maskin.",msgPluginRecipients:"Mottagare",msgPluginSender:"Avsändare",pdfPluginLoading:"Laddar...",pdfPluginPageNumber:"Sida {{ currentPage }}/{{ allPagesCount }}"}},oo=Object.keys(ao),lo="en",ho="SET_ALL_DOCUMENTS",co="SET_DOCUMENT_LOADING",uo="NEXT_DOCUMENT",po="PREVIOUS_DOCUMENT",fo="UPDATE_CURRENT_DOCUMENT",go="SET_RENDERER_RECT",mo="SET_MAIN_CONFIG",vo=t=>({type:co,value:t}),yo=()=>({type:uo}),bo=()=>({type:po}),wo=t=>({type:fo,document:t}),Ao={currentFileNo:0,documents:[],documentLoading:!0,currentDocument:void 0,rendererRect:void 0,config:{},pluginRenderers:[],language:lo},_o=(t=Ao,e)=>{switch(e.type){case ho:{const{documents:i,initialActiveDocument:n}=e;return{...t,documents:i,currentDocument:n||i[0]||void 0,currentFileNo:n&&i.includes(n)?i.indexOf(n):Ao.currentFileNo}}case co:{const{value:i}=e;return{...t,documentLoading:i}}case uo:{if(t.currentFileNo>=t.documents.length-1)return t;const e=t.currentFileNo+1,i=t.documents[e];return t.onDocumentChange&&i&&t.onDocumentChange(i),{...t,currentFileNo:e,currentDocument:t.documents[e],documentLoading:!0}}case po:{if(t.currentFileNo<=0)return t;const e=t.currentFileNo-1,i=t.documents[e];return t.onDocumentChange&&i&&t.onDocumentChange(i),{...t,currentFileNo:t.currentFileNo-1,currentDocument:t.documents[e],documentLoading:!0}}case fo:{const{document:i}=e;return{...t,currentDocument:i,currentFileNo:t.documents.findIndex((t=>t.uri===i.uri))}}case go:{const{rect:i}=e;return{...t,rendererRect:i}}case mo:{const{config:i}=e;return{...t,config:i}}default:return t}},xo=f({state:Ao,dispatch:()=>null}),So=g(((t,e)=>{const{children:i,documents:n,config:s,pluginRenderers:r,prefetchMethod:a,requestHeaders:o,initialActiveDocument:l,language:h,activeDocument:c,onDocumentChange:d}=t,[u,p]=m(_o,{...Ao,documents:n||[],currentDocument:n&&n.length?l||n[0]:void 0,config:s,pluginRenderers:r,prefetchMethod:a,requestHeaders:o,currentFileNo:l?n.findIndex((t=>t===l))??0:0,language:h&&ao[h]?h:lo,activeDocument:c,onDocumentChange:d});return v((()=>{p(((t,e)=>({type:ho,documents:t,initialActiveDocument:e}))(n,l)),s&&p((t=>({type:mo,config:t}))(s))}),[n,s,l]),v((()=>{c&&p(wo(c))}),[c]),y(e,(()=>({prev(){p(bo())},next(){p(yo())}})),[p]),P.jsx(xo.Provider,{value:{state:u,dispatch:p},children:i})})),ko=eo`
|
|
20
|
+
*/"production"===process.env.NODE_ENV?E.exports=function(){if(k)return C;k=1;var t=l,e=Symbol.for("react.element"),i=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r={key:!0,ref:!0,__self:!0,__source:!0};function a(t,i,a){var o,l={},h=null,c=null;for(o in void 0!==a&&(h=""+a),void 0!==i.key&&(h=""+i.key),void 0!==i.ref&&(c=i.ref),i)n.call(i,o)&&!r.hasOwnProperty(o)&&(l[o]=i[o]);if(t&&t.defaultProps)for(o in i=t.defaultProps)void 0===l[o]&&(l[o]=i[o]);return{$$typeof:e,type:t,key:h,ref:c,props:l,_owner:s.current}}return C.Fragment=i,C.jsx=a,C.jsxs=a,C}():E.exports=(M||(M=1,"production"!==process.env.NODE_ENV&&function(){var t=l,e=Symbol.for("react.element"),i=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),g=Symbol.iterator,m="@@iterator",v=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];!function(t,e,i){var n=v.ReactDebugCurrentFrame,s=n.getStackAddendum();""!==s&&(e+="%s",i=i.concat([s]));var r=i.map((function(t){return String(t)}));r.unshift("Warning: "+e),Function.prototype.apply.call(console[t],console,r)}("error",t,i)}var y,w=!1,A=!1,_=!1,x=!1,S=!1;function k(t){return t.displayName||"Context"}function E(t){if(null==t)return null;if("number"==typeof t.tag&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case n:return"Fragment";case i:return"Portal";case r:return"Profiler";case s:return"StrictMode";case c:return"Suspense";case d:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case o:return k(t)+".Consumer";case a:return k(t._context)+".Provider";case h:return function(t,e,i){var n=t.displayName;if(n)return n;var s=e.displayName||e.name||"";return""!==s?i+"("+s+")":i}(t,t.render,"ForwardRef");case u:var e=t.displayName||null;return null!==e?e:E(t.type)||"Memo";case p:var l=t,f=l._payload,g=l._init;try{return E(g(f))}catch{return null}}return null}y=Symbol.for("react.module.reference");var C,M,R,T,L,I,D,F=Object.assign,N=0;function O(){}O.__reactDisabledLog=!0;var W,j=v.ReactCurrentDispatcher;function B(t,e,i){if(void 0===W)try{throw Error()}catch(t){var n=t.stack.trim().match(/\n( *(at )?)/);W=n&&n[1]||""}return"\n"+W+t}var H,z=!1,$="function"==typeof WeakMap?WeakMap:Map;function U(t,e){if(!t||z)return"";var i,n=H.get(t);if(void 0!==n)return n;z=!0;var s,r=Error.prepareStackTrace;Error.prepareStackTrace=void 0,s=j.current,j.current=null,function(){if(0===N){C=console.log,M=console.info,R=console.warn,T=console.error,L=console.group,I=console.groupCollapsed,D=console.groupEnd;var t={configurable:!0,enumerable:!0,value:O,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}N++}();try{if(e){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(a,[])}catch(t){i=t}Reflect.construct(t,[],a)}else{try{a.call()}catch(t){i=t}t.call(a.prototype)}}else{try{throw Error()}catch(t){i=t}t()}}catch(e){if(e&&i&&"string"==typeof e.stack){for(var o=e.stack.split("\n"),l=i.stack.split("\n"),h=o.length-1,c=l.length-1;h>=1&&c>=0&&o[h]!==l[c];)c--;for(;h>=1&&c>=0;h--,c--)if(o[h]!==l[c]){if(1!==h||1!==c)do{if(h--,--c<0||o[h]!==l[c]){var d="\n"+o[h].replace(" at new "," at ");return t.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",t.displayName)),"function"==typeof t&&H.set(t,d),d}}while(h>=1&&c>=0);break}}}finally{z=!1,j.current=s,function(){if(0==--N){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},t,{value:C}),info:F({},t,{value:M}),warn:F({},t,{value:R}),error:F({},t,{value:T}),group:F({},t,{value:L}),groupCollapsed:F({},t,{value:I}),groupEnd:F({},t,{value:D})})}N<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=r}var u=t?t.displayName||t.name:"",p=u?B(u):"";return"function"==typeof t&&H.set(t,p),p}function V(t,e,i){if(null==t)return"";if("function"==typeof t)return U(t,function(t){var e=t.prototype;return!(!e||!e.isReactComponent)}(t));if("string"==typeof t)return B(t);switch(t){case c:return B("Suspense");case d:return B("SuspenseList")}if("object"==typeof t)switch(t.$$typeof){case h:return function(t,e,i){return U(t,!1)}(t.render);case u:return V(t.type,e,i);case p:var n=t,s=n._payload,r=n._init;try{return V(r(s),e,i)}catch{}}return""}H=new $;var G=Object.prototype.hasOwnProperty,q={},X=v.ReactDebugCurrentFrame;function Y(t){if(t){var e=t._owner,i=V(t.type,t._source,e?e.type:null);X.setExtraStackFrame(i)}else X.setExtraStackFrame(null)}var K=Array.isArray;function J(t){return K(t)}function Q(t){return""+t}function Z(t){if(function(t){try{return Q(t),!1}catch{return!0}}(t))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(t){return"function"==typeof Symbol&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object"}(t)),Q(t)}var tt,et,it,nt=v.ReactCurrentOwner,st={key:!0,ref:!0,__self:!0,__source:!0};it={};var rt=function(t,i,n,s,r,a,o){var l={$$typeof:e,type:t,key:i,ref:n,props:o,_owner:a,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function at(t,e,i,n,s){var r,a={},o=null,l=null;for(r in void 0!==i&&(Z(i),o=""+i),function(t){if(G.call(t,"key")){var e=Object.getOwnPropertyDescriptor(t,"key").get;if(e&&e.isReactWarning)return!1}return void 0!==t.key}(e)&&(Z(e.key),o=""+e.key),function(t){if(G.call(t,"ref")){var e=Object.getOwnPropertyDescriptor(t,"ref").get;if(e&&e.isReactWarning)return!1}return void 0!==t.ref}(e)&&(l=e.ref,function(t,e){if("string"==typeof t.ref&&nt.current&&e&&nt.current.stateNode!==e){var i=E(nt.current.type);it[i]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',E(nt.current.type),t.ref),it[i]=!0)}}(e,s)),e)G.call(e,r)&&!st.hasOwnProperty(r)&&(a[r]=e[r]);if(t&&t.defaultProps){var h=t.defaultProps;for(r in h)void 0===a[r]&&(a[r]=h[r])}if(o||l){var c="function"==typeof t?t.displayName||t.name||"Unknown":t;o&&function(t,e){var i=function(){tt||(tt=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};i.isReactWarning=!0,Object.defineProperty(t,"key",{get:i,configurable:!0})}(a,c),l&&function(t,e){var i=function(){et||(et=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};i.isReactWarning=!0,Object.defineProperty(t,"ref",{get:i,configurable:!0})}(a,c)}return rt(t,o,l,s,n,nt.current,a)}var ot,lt=v.ReactCurrentOwner,ht=v.ReactDebugCurrentFrame;function ct(t){if(t){var e=t._owner,i=V(t.type,t._source,e?e.type:null);ht.setExtraStackFrame(i)}else ht.setExtraStackFrame(null)}function dt(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}function ut(){if(lt.current){var t=E(lt.current.type);if(t)return"\n\nCheck the render method of `"+t+"`."}return""}ot=!1;var pt={};function ft(t,e){if(t._store&&!t._store.validated&&null==t.key){t._store.validated=!0;var i=function(t){var e=ut();if(!e){var i="string"==typeof t?t:t.displayName||t.name;i&&(e="\n\nCheck the top-level render call using <"+i+">.")}return e}(e);if(!pt[i]){pt[i]=!0;var n="";t&&t._owner&&t._owner!==lt.current&&(n=" It was passed a child from "+E(t._owner.type)+"."),ct(t),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,n),ct(null)}}}function gt(t,e){if("object"==typeof t)if(J(t))for(var i=0;i<t.length;i++){var n=t[i];dt(n)&&ft(n,e)}else if(dt(t))t._store&&(t._store.validated=!0);else if(t){var s=function(t){if(null===t||"object"!=typeof t)return null;var e=g&&t[g]||t[m];return"function"==typeof e?e:null}(t);if("function"==typeof s&&s!==t.entries)for(var r,a=s.call(t);!(r=a.next()).done;)dt(r.value)&&ft(r.value,e)}}function mt(t){var e,i=t.type;if(null!=i&&"string"!=typeof i){if("function"==typeof i)e=i.propTypes;else{if("object"!=typeof i||i.$$typeof!==h&&i.$$typeof!==u)return;e=i.propTypes}if(e){var n=E(i);!function(t,e,i,n,s){var r=Function.call.bind(G);for(var a in t)if(r(t,a)){var o=void 0;try{if("function"!=typeof t[a]){var l=Error((n||"React class")+": "+i+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}o=t[a](e,a,n,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(t){o=t}o&&!(o instanceof Error)&&(Y(s),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",i,a,typeof o),Y(null)),o instanceof Error&&!(o.message in q)&&(q[o.message]=!0,Y(s),b("Failed %s type: %s",i,o.message),Y(null))}}(e,t.props,"prop",n,t)}else void 0===i.PropTypes||ot||(ot=!0,b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E(i)||"Unknown"));"function"==typeof i.getDefaultProps&&!i.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vt(t,i,l,g,m,v){var k=function(t){return!!("string"==typeof t||"function"==typeof t||t===n||t===r||S||t===s||t===c||t===d||x||t===f||w||A||_||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===u||t.$$typeof===a||t.$$typeof===o||t.$$typeof===h||t.$$typeof===y||void 0!==t.getModuleId))}(t);if(!k){var C="";(void 0===t||"object"==typeof t&&null!==t&&0===Object.keys(t).length)&&(C+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var M,P=function(t){return void 0!==t?"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".":""}(m);C+=P||ut(),null===t?M="null":J(t)?M="array":void 0!==t&&t.$$typeof===e?(M="<"+(E(t.type)||"Unknown")+" />",C=" Did you accidentally export a JSX literal instead of a component?"):M=typeof t,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",M,C)}var R=at(t,i,l,m,v);if(null==R)return R;if(k){var T=i.children;if(void 0!==T)if(g)if(J(T)){for(var L=0;L<T.length;L++)gt(T[L],t);Object.freeze&&Object.freeze(T)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else gt(T,t)}return t===n?function(t){for(var e=Object.keys(t.props),i=0;i<e.length;i++){var n=e[i];if("children"!==n&&"key"!==n){ct(t),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),ct(null);break}}null!==t.ref&&(ct(t),b("Invalid attribute `ref` supplied to `React.Fragment`."),ct(null))}(R):mt(R),R}var bt=function(t,e,i){return vt(t,e,i,!1)},yt=function(t,e,i){return vt(t,e,i,!0)};P.Fragment=n,P.jsx=bt,P.jsxs=yt}()),P);var R=E.exports,T=function(t){return t&&t.Math===Math&&t},L=T("object"==typeof globalThis&&globalThis)||T("object"==typeof window&&window)||T("object"==typeof self&&self)||T("object"==typeof x&&x)||T("object"==typeof x&&x)||function(){return this}()||Function("return this")(),I={},D=function(t){try{return!!t()}catch{return!0}},F=!D((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),N=!D((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),O=N,W=Function.prototype.call,j=O?W.bind(W):function(){return W.apply(W,arguments)},B={},H={}.propertyIsEnumerable,z=Object.getOwnPropertyDescriptor,$=z&&!H.call({1:2},1);B.f=$?function(t){var e=z(this,t);return!!e&&e.enumerable}:H;var U,V,G=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},q=N,X=Function.prototype,Y=X.call,K=q&&X.bind.bind(Y,Y),J=q?K:function(t){return function(){return Y.apply(t,arguments)}},Q=J,Z=Q({}.toString),tt=Q("".slice),et=D,it=function(t){return tt(Z(t),8,-1)},nt=Object,st=J("".split),rt=et((function(){return!nt("z").propertyIsEnumerable(0)}))?function(t){return"String"===it(t)?st(t,""):nt(t)}:nt,at=function(t){return null==t},ot=at,lt=TypeError,ht=function(t){if(ot(t))throw new lt("Can't call method on "+t);return t},ct=rt,dt=ht,ut=function(t){return ct(dt(t))},pt="object"==typeof document&&document.all,ft=typeof pt>"u"&&void 0!==pt?function(t){return"function"==typeof t||t===pt}:function(t){return"function"==typeof t},gt=ft,mt=function(t){return"object"==typeof t?null!==t:gt(t)},vt=L,bt=ft,yt=function(t,e){return arguments.length<2?function(t){return bt(t)?t:void 0}(vt[t]):vt[t]&&vt[t][e]},wt=J({}.isPrototypeOf),At=L,_t=typeof navigator<"u"&&String(navigator.userAgent)||"",xt=At.process,St=At.Deno,kt=xt&&xt.versions||St&&St.version,Et=kt&&kt.v8;Et&&(V=(U=Et.split("."))[0]>0&&U[0]<4?1:+(U[0]+U[1])),!V&&_t&&((!(U=_t.match(/Edge\/(\d+)/))||U[1]>=74)&&((U=_t.match(/Chrome\/(\d+)/))&&(V=+U[1])));var Ct=V,Mt=D,Pt=L.String,Rt=!!Object.getOwnPropertySymbols&&!Mt((function(){var t=Symbol("symbol detection");return!Pt(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Ct&&Ct<41})),Tt=Rt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Lt=yt,It=ft,Dt=wt,Ft=Object,Nt=Tt?function(t){return"symbol"==typeof t}:function(t){var e=Lt("Symbol");return It(e)&&Dt(e.prototype,Ft(t))},Ot=String,Wt=ft,jt=function(t){try{return Ot(t)}catch{return"Object"}},Bt=TypeError,Ht=function(t){if(Wt(t))return t;throw new Bt(jt(t)+" is not a function")},zt=Ht,$t=at,Ut=j,Vt=ft,Gt=mt,qt=TypeError,Xt={exports:{}},Yt=L,Kt=Object.defineProperty,Jt=function(t,e){try{Kt(Yt,t,{value:e,configurable:!0,writable:!0})}catch{Yt[t]=e}return e},Qt=L,Zt=Jt,te="__core-js_shared__",ee=Xt.exports=Qt[te]||Zt(te,{});(ee.versions||(ee.versions=[])).push({version:"3.37.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"});var ie=Xt.exports,ne=ie,se=function(t,e){return ne[t]||(ne[t]=e||{})},re=ht,ae=Object,oe=function(t){return ae(re(t))},le=J({}.hasOwnProperty),he=Object.hasOwn||function(t,e){return le(oe(t),e)},ce=J,de=0,ue=Math.random(),pe=ce(1..toString),fe=function(t){return"Symbol("+(void 0===t?"":t)+")_"+pe(++de+ue,36)},ge=se,me=he,ve=fe,be=Rt,ye=Tt,we=L.Symbol,Ae=ge("wks"),_e=ye?we.for||we:we&&we.withoutSetter||ve,xe=j,Se=mt,ke=Nt,Ee=function(t,e){var i=t[e];return $t(i)?void 0:zt(i)},Ce=function(t,e){var i,n;if("string"===e&&Vt(i=t.toString)&&!Gt(n=Ut(i,t))||Vt(i=t.valueOf)&&!Gt(n=Ut(i,t))||"string"!==e&&Vt(i=t.toString)&&!Gt(n=Ut(i,t)))return n;throw new qt("Can't convert object to primitive value")},Me=TypeError,Pe=function(t){return me(Ae,t)||(Ae[t]=be&&me(we,t)?we[t]:_e("Symbol."+t)),Ae[t]}("toPrimitive"),Re=function(t,e){if(!Se(t)||ke(t))return t;var i,n=Ee(t,Pe);if(n){if(void 0===e&&(e="default"),i=xe(n,t,e),!Se(i)||ke(i))return i;throw new Me("Can't convert object to primitive value")}return void 0===e&&(e="number"),Ce(t,e)},Te=Nt,Le=function(t){var e=Re(t,"string");return Te(e)?e:e+""},Ie=mt,De=L.document,Fe=Ie(De)&&Ie(De.createElement),Ne=function(t){return Fe?De.createElement(t):{}},Oe=!F&&!D((function(){return 7!==Object.defineProperty(Ne("div"),"a",{get:function(){return 7}}).a})),We=F,je=j,Be=B,He=G,ze=ut,$e=Le,Ue=he,Ve=Oe,Ge=Object.getOwnPropertyDescriptor;I.f=We?Ge:function(t,e){if(t=ze(t),e=$e(e),Ve)try{return Ge(t,e)}catch{}if(Ue(t,e))return He(!je(Be.f,t,e),t[e])};var qe={},Xe=F&&D((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ye=mt,Ke=String,Je=TypeError,Qe=function(t){if(Ye(t))return t;throw new Je(Ke(t)+" is not an object")},Ze=F,ti=Oe,ei=Xe,ii=Qe,ni=Le,si=TypeError,ri=Object.defineProperty,ai=Object.getOwnPropertyDescriptor,oi="enumerable",li="configurable",hi="writable";qe.f=Ze?ei?function(t,e,i){if(ii(t),e=ni(e),ii(i),"function"==typeof t&&"prototype"===e&&"value"in i&&hi in i&&!i[hi]){var n=ai(t,e);n&&n[hi]&&(t[e]=i.value,i={configurable:li in i?i[li]:n[li],enumerable:oi in i?i[oi]:n[oi],writable:!1})}return ri(t,e,i)}:ri:function(t,e,i){if(ii(t),e=ni(e),ii(i),ti)try{return ri(t,e,i)}catch{}if("get"in i||"set"in i)throw new si("Accessors not supported");return"value"in i&&(t[e]=i.value),t};var ci=qe,di=G,ui=F?function(t,e,i){return ci.f(t,e,di(1,i))}:function(t,e,i){return t[e]=i,t},pi={exports:{}},fi=F,gi=he,mi=Function.prototype,vi=fi&&Object.getOwnPropertyDescriptor,bi=gi(mi,"name"),yi={EXISTS:bi,PROPER:bi&&"something"===function(){}.name,CONFIGURABLE:bi&&(!fi||fi&&vi(mi,"name").configurable)},wi=ft,Ai=ie,_i=J(Function.toString);wi(Ai.inspectSource)||(Ai.inspectSource=function(t){return _i(t)});var xi,Si,ki,Ei=Ai.inspectSource,Ci=ft,Mi=L.WeakMap,Pi=Ci(Mi)&&/native code/.test(String(Mi)),Ri=fe,Ti=se("keys"),Li={},Ii=Pi,Di=L,Fi=mt,Ni=ui,Oi=he,Wi=ie,ji=function(t){return Ti[t]||(Ti[t]=Ri(t))},Bi=Li,Hi="Object already initialized",zi=Di.TypeError,$i=Di.WeakMap;if(Ii||Wi.state){var Ui=Wi.state||(Wi.state=new $i);Ui.get=Ui.get,Ui.has=Ui.has,Ui.set=Ui.set,xi=function(t,e){if(Ui.has(t))throw new zi(Hi);return e.facade=t,Ui.set(t,e),e},Si=function(t){return Ui.get(t)||{}},ki=function(t){return Ui.has(t)}}else{var Vi=ji("state");Bi[Vi]=!0,xi=function(t,e){if(Oi(t,Vi))throw new zi(Hi);return e.facade=t,Ni(t,Vi,e),e},Si=function(t){return Oi(t,Vi)?t[Vi]:{}},ki=function(t){return Oi(t,Vi)}}var Gi={set:xi,get:Si,has:ki,enforce:function(t){return ki(t)?Si(t):xi(t,{})},getterFor:function(t){return function(e){var i;if(!Fi(e)||(i=Si(e)).type!==t)throw new zi("Incompatible receiver, "+t+" required");return i}}},qi=J,Xi=D,Yi=ft,Ki=he,Ji=F,Qi=yi.CONFIGURABLE,Zi=Ei,tn=Gi.enforce,en=Gi.get,nn=String,sn=Object.defineProperty,rn=qi("".slice),an=qi("".replace),on=qi([].join),ln=Ji&&!Xi((function(){return 8!==sn((function(){}),"length",{value:8}).length})),hn=String(String).split("String"),cn=pi.exports=function(t,e,i){"Symbol("===rn(nn(e),0,7)&&(e="["+an(nn(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!Ki(t,"name")||Qi&&t.name!==e)&&(Ji?sn(t,"name",{value:e,configurable:!0}):t.name=e),ln&&i&&Ki(i,"arity")&&t.length!==i.arity&&sn(t,"length",{value:i.arity});try{i&&Ki(i,"constructor")&&i.constructor?Ji&&sn(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=tn(t);return Ki(n,"source")||(n.source=on(hn,"string"==typeof e?e:"")),t};Function.prototype.toString=cn((function(){return Yi(this)&&en(this).source||Zi(this)}),"toString");var dn=pi.exports,un=ft,pn=qe,fn=dn,gn=Jt,mn={},vn=Math.ceil,bn=Math.floor,yn=Math.trunc||function(t){var e=+t;return(e>0?bn:vn)(e)},wn=function(t){var e=+t;return e!=e||0===e?0:yn(e)},An=wn,_n=Math.max,xn=Math.min,Sn=wn,kn=Math.min,En=function(t){var e=Sn(t);return e>0?kn(e,9007199254740991):0},Cn=ut,Mn=function(t,e){var i=An(t);return i<0?_n(i+e,0):xn(i,e)},Pn=function(t){return En(t.length)},Rn=function(t){return function(e,i,n){var s=Cn(e),r=Pn(s);if(0===r)return!t&&-1;var a,o=Mn(n,r);if(t&&i!=i){for(;r>o;)if((a=s[o++])!=a)return!0}else for(;r>o;o++)if((t||o in s)&&s[o]===i)return t||o||0;return!t&&-1}},Tn={includes:Rn(!0),indexOf:Rn(!1)},Ln=he,In=ut,Dn=Tn.indexOf,Fn=Li,Nn=J([].push),On=function(t,e){var i,n=In(t),s=0,r=[];for(i in n)!Ln(Fn,i)&&Ln(n,i)&&Nn(r,i);for(;e.length>s;)Ln(n,i=e[s++])&&(~Dn(r,i)||Nn(r,i));return r},Wn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");mn.f=Object.getOwnPropertyNames||function(t){return On(t,Wn)};var jn={};jn.f=Object.getOwnPropertySymbols;var Bn=yt,Hn=mn,zn=jn,$n=Qe,Un=J([].concat),Vn=Bn("Reflect","ownKeys")||function(t){var e=Hn.f($n(t)),i=zn.f;return i?Un(e,i(t)):e},Gn=he,qn=Vn,Xn=I,Yn=qe,Kn=D,Jn=ft,Qn=/#|\.prototype\./,Zn=function(t,e){var i=es[ts(t)];return i===ns||i!==is&&(Jn(e)?Kn(e):!!e)},ts=Zn.normalize=function(t){return String(t).replace(Qn,".").toLowerCase()},es=Zn.data={},is=Zn.NATIVE="N",ns=Zn.POLYFILL="P",ss=Zn,rs=L,as=I.f,os=ui,ls=function(t,e,i,n){n||(n={});var s=n.enumerable,r=void 0!==n.name?n.name:e;if(un(i)&&fn(i,r,n),n.global)s?t[e]=i:gn(e,i);else{try{n.unsafe?t[e]&&(s=!0):delete t[e]}catch{}s?t[e]=i:pn.f(t,e,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},hs=Jt,cs=function(t,e,i){for(var n=qn(e),s=Yn.f,r=Xn.f,a=0;a<n.length;a++){var o=n[a];!Gn(t,o)&&(!i||!Gn(i,o))&&s(t,o,r(e,o))}},ds=ss,us={},ps=Ht,fs=TypeError,gs=function(t){var e,i;this.promise=new t((function(t,n){if(void 0!==e||void 0!==i)throw new fs("Bad Promise constructor");e=t,i=n})),this.resolve=ps(e),this.reject=ps(i)};us.f=function(t){return new gs(t)};var ms=us;(function(t,e){var i,n,s,r,a,o=t.target,l=t.global,h=t.stat;if(i=l?rs:h?rs[o]||hs(o,{}):rs[o]&&rs[o].prototype)for(n in e){if(r=e[n],t.dontCallGetSet?s=(a=as(i,n))&&a.value:s=i[n],!ds(l?n:o+(h?".":"#")+n,t.forced)&&void 0!==s){if(typeof r==typeof s)continue;cs(r,s)}(t.sham||s&&s.sham)&&os(r,"sham",!0),ls(i,n,r,t)}})({target:"Promise",stat:!0},{withResolvers:function(){var t=ms.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var vs=function(){return vs=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},vs.apply(this,arguments)};function bs(t,e,i){if(i||2===arguments.length)for(var n,s=0,r=e.length;s<r;s++)(n||!(s in e))&&(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))}function ys(t){var e=Object.create(null);return function(i){return void 0===e[i]&&(e[i]=t(i)),e[i]}}var ws=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,As=ys((function(t){return ws.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91})),_s="-ms-",xs="-moz-",Ss="-webkit-",ks="comm",Es="rule",Cs="decl",Ms="@import",Ps="@keyframes",Rs="@layer",Ts=Math.abs,Ls=String.fromCharCode,Is=Object.assign;function Ds(t){return t.trim()}function Fs(t,e){return(t=e.exec(t))?t[0]:t}function Ns(t,e,i){return t.replace(e,i)}function Os(t,e,i){return t.indexOf(e,i)}function Ws(t,e){return 0|t.charCodeAt(e)}function js(t,e,i){return t.slice(e,i)}function Bs(t){return t.length}function Hs(t){return t.length}function zs(t,e){return e.push(t),t}function $s(t,e){return t.filter((function(t){return!Fs(t,e)}))}var Us=1,Vs=1,Gs=0,qs=0,Xs=0,Ys="";function Ks(t,e,i,n,s,r,a,o){return{value:t,root:e,parent:i,type:n,props:s,children:r,line:Us,column:Vs,length:a,return:"",siblings:o}}function Js(t,e){return Is(Ks("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function Qs(t){for(;t.root;)t=Js(t.root,{children:[t]});zs(t,t.siblings)}function Zs(){return Xs=qs<Gs?Ws(Ys,qs++):0,Vs++,10===Xs&&(Vs=1,Us++),Xs}function tr(){return Ws(Ys,qs)}function er(){return qs}function ir(t,e){return js(Ys,t,e)}function nr(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function sr(t){return Ds(ir(qs-1,or(91===t?t+2:40===t?t+1:t)))}function rr(t){for(;(Xs=tr())&&Xs<33;)Zs();return nr(t)>2||nr(Xs)>3?"":" "}function ar(t,e){for(;--e&&Zs()&&!(Xs<48||Xs>102||Xs>57&&Xs<65||Xs>70&&Xs<97););return ir(t,er()+(e<6&&32==tr()&&32==Zs()))}function or(t){for(;Zs();)switch(Xs){case t:return qs;case 34:case 39:34!==t&&39!==t&&or(Xs);break;case 40:41===t&&or(t);break;case 92:Zs()}return qs}function lr(t,e){for(;Zs()&&t+Xs!==57&&(t+Xs!==84||47!==tr()););return"/*"+ir(e,qs-1)+"*"+Ls(47===t?t:Zs())}function hr(t){for(;!nr(tr());)Zs();return ir(t,qs)}function cr(t){return function(t){return Ys="",t}(dr("",null,null,null,[""],t=function(t){return Us=Vs=1,Gs=Bs(Ys=t),qs=0,[]}(t),0,[0],t))}function dr(t,e,i,n,s,r,a,o,l){for(var h=0,c=0,d=a,u=0,p=0,f=0,g=1,m=1,v=1,b=0,y="",w=s,A=r,_=n,x=y;m;)switch(f=b,b=Zs()){case 40:if(108!=f&&58==Ws(x,d-1)){-1!=Os(x+=Ns(sr(b),"&","&\f"),"&\f",Ts(h?o[h-1]:0))&&(v=-1);break}case 34:case 39:case 91:x+=sr(b);break;case 9:case 10:case 13:case 32:x+=rr(f);break;case 92:x+=ar(er()-1,7);continue;case 47:switch(tr()){case 42:case 47:zs(pr(lr(Zs(),er()),e,i,l),l);break;default:x+="/"}break;case 123*g:o[h++]=Bs(x)*v;case 125*g:case 59:case 0:switch(b){case 0:case 125:m=0;case 59+c:-1==v&&(x=Ns(x,/\f/g,"")),p>0&&Bs(x)-d&&zs(p>32?fr(x+";",n,i,d-1,l):fr(Ns(x," ","")+";",n,i,d-2,l),l);break;case 59:x+=";";default:if(zs(_=ur(x,e,i,h,c,s,o,y,w=[],A=[],d,r),r),123===b)if(0===c)dr(x,e,_,_,w,r,d,o,A);else switch(99===u&&110===Ws(x,3)?100:u){case 100:case 108:case 109:case 115:dr(t,_,_,n&&zs(ur(t,_,_,0,0,s,o,y,s,w=[],d,A),A),s,A,d,o,n?w:A);break;default:dr(x,_,_,_,[""],A,0,o,A)}}h=c=p=0,g=v=1,y=x="",d=a;break;case 58:d=1+Bs(x),p=f;default:if(g<1)if(123==b)--g;else if(125==b&&0==g++&&125==(Xs=qs>0?Ws(Ys,--qs):0,Vs--,10===Xs&&(Vs=1,Us--),Xs))continue;switch(x+=Ls(b),b*g){case 38:v=c>0?1:(x+="\f",-1);break;case 44:o[h++]=(Bs(x)-1)*v,v=1;break;case 64:45===tr()&&(x+=sr(Zs())),u=tr(),c=d=Bs(y=x+=hr(er())),b++;break;case 45:45===f&&2==Bs(x)&&(g=0)}}return r}function ur(t,e,i,n,s,r,a,o,l,h,c,d){for(var u=s-1,p=0===s?r:[""],f=Hs(p),g=0,m=0,v=0;g<n;++g)for(var b=0,y=js(t,u+1,u=Ts(m=a[g])),w=t;b<f;++b)(w=Ds(m>0?p[b]+" "+y:Ns(y,/&\f/g,p[b])))&&(l[v++]=w);return Ks(t,e,i,0===s?Es:o,l,h,c,d)}function pr(t,e,i,n){return Ks(t,e,i,ks,Ls(Xs),js(t,2,-2),0,n)}function fr(t,e,i,n,s){return Ks(t,e,i,Cs,js(t,0,n),js(t,n+1,-1),n,s)}function gr(t,e,i){switch(function(t,e){return 45^Ws(t,0)?(((e<<2^Ws(t,0))<<2^Ws(t,1))<<2^Ws(t,2))<<2^Ws(t,3):0}(t,e)){case 5103:return Ss+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ss+t+t;case 4789:return xs+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Ss+t+xs+t+_s+t+t;case 5936:switch(Ws(t,e+11)){case 114:return Ss+t+_s+Ns(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Ss+t+_s+Ns(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Ss+t+_s+Ns(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return Ss+t+_s+t+t;case 6165:return Ss+t+_s+"flex-"+t+t;case 5187:return Ss+t+Ns(t,/(\w+).+(:[^]+)/,Ss+"box-$1$2"+_s+"flex-$1$2")+t;case 5443:return Ss+t+_s+"flex-item-"+Ns(t,/flex-|-self/g,"")+(Fs(t,/flex-|baseline/)?"":_s+"grid-row-"+Ns(t,/flex-|-self/g,""))+t;case 4675:return Ss+t+_s+"flex-line-pack"+Ns(t,/align-content|flex-|-self/g,"")+t;case 5548:return Ss+t+_s+Ns(t,"shrink","negative")+t;case 5292:return Ss+t+_s+Ns(t,"basis","preferred-size")+t;case 6060:return Ss+"box-"+Ns(t,"-grow","")+Ss+t+_s+Ns(t,"grow","positive")+t;case 4554:return Ss+Ns(t,/([^-])(transform)/g,"$1"+Ss+"$2")+t;case 6187:return Ns(Ns(Ns(t,/(zoom-|grab)/,Ss+"$1"),/(image-set)/,Ss+"$1"),t,"")+t;case 5495:case 3959:return Ns(t,/(image-set\([^]*)/,Ss+"$1$`$1");case 4968:return Ns(Ns(t,/(.+:)(flex-)?(.*)/,Ss+"box-pack:$3"+_s+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ss+t+t;case 4200:if(!Fs(t,/flex-|baseline/))return _s+"grid-column-align"+js(t,e)+t;break;case 2592:case 3360:return _s+Ns(t,"template-","")+t;case 4384:case 3616:return i&&i.some((function(t,i){return e=i,Fs(t.props,/grid-\w+-end/)}))?~Os(t+(i=i[e].value),"span",0)?t:_s+Ns(t,"-start","")+t+_s+"grid-row-span:"+(~Os(i,"span",0)?Fs(i,/\d+/):+Fs(i,/\d+/)-+Fs(t,/\d+/))+";":_s+Ns(t,"-start","")+t;case 4896:case 4128:return i&&i.some((function(t){return Fs(t.props,/grid-\w+-start/)}))?t:_s+Ns(Ns(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return Ns(t,/(.+)-inline(.+)/,Ss+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Bs(t)-1-e>6)switch(Ws(t,e+1)){case 109:if(45!==Ws(t,e+4))break;case 102:return Ns(t,/(.+:)(.+)-([^]+)/,"$1"+Ss+"$2-$3$1"+xs+(108==Ws(t,e+3)?"$3":"$2-$3"))+t;case 115:return~Os(t,"stretch",0)?gr(Ns(t,"stretch","fill-available"),e,i)+t:t}break;case 5152:case 5920:return Ns(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(e,i,n,s,r,a,o){return _s+i+":"+n+o+(s?_s+i+"-span:"+(r?a:+a-+n)+o:"")+t}));case 4949:if(121===Ws(t,e+6))return Ns(t,":",":"+Ss)+t;break;case 6444:switch(Ws(t,45===Ws(t,14)?18:11)){case 120:return Ns(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ss+(45===Ws(t,14)?"inline-":"")+"box$3$1"+Ss+"$2$3$1"+_s+"$2box$3")+t;case 100:return Ns(t,":",":"+_s)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Ns(t,"scroll-","scroll-snap-")+t}return t}function mr(t,e){for(var i="",n=0;n<t.length;n++)i+=e(t[n],n,t,e)||"";return i}function vr(t,e,i,n){switch(t.type){case Rs:if(t.children.length)break;case Ms:case Cs:return t.return=t.return||t.value;case ks:return"";case Ps:return t.return=t.value+"{"+mr(t.children,n)+"}";case Es:if(!Bs(t.value=t.props.join(",")))return""}return Bs(i=mr(t.children,n))?t.return=t.value+"{"+i+"}":""}function br(t,e,i,n){if(t.length>-1&&!t.return)switch(t.type){case Cs:return void(t.return=gr(t.value,t.length,i));case Ps:return mr([Js(t,{value:Ns(t.value,"@","@"+Ss)})],n);case Es:if(t.length)return function(t,e){return t.map(e).join("")}(i=t.props,(function(e){switch(Fs(e,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Qs(Js(t,{props:[Ns(e,/:(read-\w+)/,":"+xs+"$1")]})),Qs(Js(t,{props:[e]})),Is(t,{props:$s(i,n)});break;case"::placeholder":Qs(Js(t,{props:[Ns(e,/:(plac\w+)/,":"+Ss+"input-$1")]})),Qs(Js(t,{props:[Ns(e,/:(plac\w+)/,":"+xs+"$1")]})),Qs(Js(t,{props:[Ns(e,/:(plac\w+)/,_s+"input-$1")]})),Qs(Js(t,{props:[e]})),Is(t,{props:$s(i,n)})}return""}))}}var yr={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},wr=typeof process<"u"&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Ar="active",_r="data-styled-version",xr="6.1.11",Sr="/*!sc*/\n",kr=typeof window<"u"&&"HTMLElement"in window,Er=!!("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:typeof process<"u"&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),Cr=/invalid hook call/i,Mr=new Set,Pr=Object.freeze([]),Rr=Object.freeze({});var Tr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Lr=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ir=/(^-|-$)/g;function Dr(t){return t.replace(Lr,"-").replace(Ir,"")}var Fr=/(a)(d)/gi,Nr=52,Or=function(t){return String.fromCharCode(t+(t>25?39:97))};function Wr(t){var e,i="";for(e=Math.abs(t);e>Nr;e=e/Nr|0)i=Or(e%Nr)+i;return(Or(e%Nr)+i).replace(Fr,"$1-$2")}var jr,Br=function(t,e){for(var i=e.length;i;)t=33*t^e.charCodeAt(--i);return t},Hr=function(t){return Br(5381,t)};function zr(t){return Wr(Hr(t)>>>0)}function $r(t){return"production"!==process.env.NODE_ENV&&"string"==typeof t&&t||t.displayName||t.name||"Component"}function Ur(t){return"string"==typeof t&&("production"===process.env.NODE_ENV||t.charAt(0)===t.charAt(0).toLowerCase())}var Vr="function"==typeof Symbol&&Symbol.for,Gr=Vr?Symbol.for("react.memo"):60115,qr=Vr?Symbol.for("react.forward_ref"):60112,Xr={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Yr={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Kr={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Jr=((jr={})[qr]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},jr[Gr]=Kr,jr);function Qr(t){return("type"in(e=t)&&e.type.$$typeof)===Gr?Kr:"$$typeof"in t?Jr[t.$$typeof]:Xr;var e}var Zr=Object.defineProperty,ta=Object.getOwnPropertyNames,ea=Object.getOwnPropertySymbols,ia=Object.getOwnPropertyDescriptor,na=Object.getPrototypeOf,sa=Object.prototype;function ra(t,e,i){if("string"!=typeof e){if(sa){var n=na(e);n&&n!==sa&&ra(t,n,i)}var s=ta(e);ea&&(s=s.concat(ea(e)));for(var r=Qr(t),a=Qr(e),o=0;o<s.length;++o){var l=s[o];if(!(l in Yr||i&&i[l]||a&&l in a||r&&l in r)){var h=ia(e,l);try{Zr(t,l,h)}catch{}}}}return t}function aa(t){return"function"==typeof t}function oa(t){return"object"==typeof t&&"styledComponentId"in t}function la(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function ha(t,e){if(0===t.length)return"";for(var i=t[0],n=1;n<t.length;n++)i+=e?e+t[n]:t[n];return i}function ca(t){return null!==t&&"object"==typeof t&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function da(t,e,i){if(void 0===i&&(i=!1),!i&&!ca(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var n=0;n<e.length;n++)t[n]=da(t[n],e[n]);else if(ca(e))for(var n in e)t[n]=da(t[n],e[n]);return t}function ua(t,e){Object.defineProperty(t,"toString",{value:e})}var pa="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function fa(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=t[0],n=[],s=1,r=t.length;s<r;s+=1)n.push(t[s]);return n.forEach((function(t){i=i.replace(/%[a-z]/,t)})),i}function ga(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):"")):new Error(fa.apply(void 0,bs([pa[t]],e,!1)).trim())}var ma=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return t.prototype.indexOfGroup=function(t){for(var e=0,i=0;i<t;i++)e+=this.groupSizes[i];return e},t.prototype.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var i=this.groupSizes,n=i.length,s=n;t>=s;)if((s<<=1)<0)throw ga(16,"".concat(t));this.groupSizes=new Uint32Array(s),this.groupSizes.set(i),this.length=s;for(var r=n;r<s;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(t+1),o=(r=0,e.length);r<o;r++)this.tag.insertRule(a,e[r])&&(this.groupSizes[t]++,a++)},t.prototype.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],i=this.indexOfGroup(t),n=i+e;this.groupSizes[t]=0;for(var s=i;s<n;s++)this.tag.deleteRule(i)}},t.prototype.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var i=this.groupSizes[t],n=this.indexOfGroup(t),s=n+i,r=n;r<s;r++)e+="".concat(this.tag.getRule(r)).concat(Sr);return e},t}(),va=new Map,ba=new Map,ya=1,wa=function(t){if(va.has(t))return va.get(t);for(;ba.has(ya);)ya++;var e=ya++;if("production"!==process.env.NODE_ENV&&((0|e)<0||e>1073741824))throw ga(16,"".concat(e));return va.set(t,e),ba.set(e,t),e},Aa=function(t,e){ya=e+1,va.set(t,e),ba.set(e,t)},_a="style[".concat(wr,"][").concat(_r,'="').concat(xr,'"]'),xa=new RegExp("^".concat(wr,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Sa=function(t,e,i){for(var n,s=i.split(","),r=0,a=s.length;r<a;r++)(n=s[r])&&t.registerName(e,n)},ka=function(t,e){for(var i,n=(null!==(i=e.textContent)&&void 0!==i?i:"").split(Sr),s=[],r=0,a=n.length;r<a;r++){var o=n[r].trim();if(o){var l=o.match(xa);if(l){var h=0|parseInt(l[1],10),c=l[2];0!==h&&(Aa(c,h),Sa(t,c,l[3]),t.getTag().insertRules(h,s)),s.length=0}else s.push(o)}}};var Ea=function(t){var e,i,n=document.head,s=t||n,r=document.createElement("style"),a=(e=s,(i=Array.from(e.querySelectorAll("style[".concat(wr,"]"))))[i.length-1]),o=void 0!==a?a.nextSibling:null;r.setAttribute(wr,Ar),r.setAttribute(_r,xr);var l=typeof __webpack_nonce__<"u"?__webpack_nonce__:null;return l&&r.setAttribute("nonce",l),s.insertBefore(r,o),r},Ca=function(){function t(t){this.element=Ea(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,i=0,n=e.length;i<n;i++){var s=e[i];if(s.ownerNode===t)return s}throw ga(17)}(this.element),this.length=0}return t.prototype.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch{return!1}},t.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},t.prototype.getRule=function(t){var e=this.sheet.cssRules[t];return e&&e.cssText?e.cssText:""},t}(),Ma=function(){function t(t){this.element=Ea(t),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(t,e){if(t<=this.length&&t>=0){var i=document.createTextNode(e);return this.element.insertBefore(i,this.nodes[t]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},t.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),Pa=function(){function t(t){this.rules=[],this.length=0}return t.prototype.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},t.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},t.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),Ra=kr,Ta={isServer:!kr,useCSSOMInjection:!Er},La=function(){function t(t,e,i){void 0===t&&(t=Rr),void 0===e&&(e={});var n=this;this.options=vs(vs({},Ta),t),this.gs=e,this.names=new Map(i),this.server=!!t.isServer,!this.server&&kr&&Ra&&(Ra=!1,function(t){for(var e=document.querySelectorAll(_a),i=0,n=e.length;i<n;i++){var s=e[i];s&&s.getAttribute(wr)!==Ar&&(ka(t,s),s.parentNode&&s.parentNode.removeChild(s))}}(this)),ua(this,(function(){return function(t){for(var e=t.getTag(),i=e.length,n="",s=function(i){var s,r=(s=i,ba.get(s));if(void 0===r)return"continue";var a=t.names.get(r),o=e.getGroup(i);if(void 0===a||0===o.length)return"continue";var l="".concat(wr,".g").concat(i,'[id="').concat(r,'"]'),h="";void 0!==a&&a.forEach((function(t){t.length>0&&(h+="".concat(t,","))})),n+="".concat(o).concat(l,'{content:"').concat(h,'"}').concat(Sr)},r=0;r<i;r++)s(r);return n}(n)}))}return t.registerId=function(t){return wa(t)},t.prototype.reconstructWithOptions=function(e,i){return void 0===i&&(i=!0),new t(vs(vs({},this.options),e),this.gs,i&&this.names||void 0)},t.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(t=this.options,e=t.useCSSOMInjection,i=t.target,n=t.isServer?new Pa(i):e?new Ca(i):new Ma(i),new ma(n)));var t,e,i,n},t.prototype.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},t.prototype.registerName=function(t,e){if(wa(t),this.names.has(t))this.names.get(t).add(e);else{var i=new Set;i.add(e),this.names.set(t,i)}},t.prototype.insertRules=function(t,e,i){this.registerName(t,e),this.getTag().insertRules(wa(t),i)},t.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},t.prototype.clearRules=function(t){this.getTag().clearGroup(wa(t)),this.clearNames(t)},t.prototype.clearTag=function(){this.tag=void 0},t}(),Ia=/&/g,Da=/^\s*\/\/.*$/gm;function Fa(t,e){return t.map((function(t){return"rule"===t.type&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map((function(t){return"".concat(e," ").concat(t)}))),Array.isArray(t.children)&&"@keyframes"!==t.type&&(t.children=Fa(t.children,e)),t}))}var Na=new La,Oa=function(t){var e,i,n,s=void 0===t?Rr:t,r=s.options,a=void 0===r?Rr:r,o=s.plugins,l=void 0===o?Pr:o,h=function(t,n,s){return s.startsWith(i)&&s.endsWith(i)&&s.replaceAll(i,"").length>0?".".concat(e):t},c=l.slice();c.push((function(t){t.type===Es&&t.value.includes("&")&&(t.props[0]=t.props[0].replace(Ia,i).replace(n,h))})),a.prefix&&c.push(br),c.push(vr);var d=function(t,s,r,o){void 0===s&&(s=""),void 0===r&&(r=""),void 0===o&&(o="&"),e=o,i=s,n=new RegExp("\\".concat(i,"\\b"),"g");var l=t.replace(Da,""),h=cr(r||s?"".concat(r," ").concat(s," { ").concat(l," }"):l);a.namespace&&(h=Fa(h,a.namespace));var d=[];return mr(h,function(t){var e=Hs(t);return function(i,n,s,r){for(var a="",o=0;o<e;o++)a+=t[o](i,n,s,r)||"";return a}}(c.concat(function(t){return function(e){e.root||(e=e.return)&&t(e)}}((function(t){return d.push(t)}))))),d};return d.hash=l.length?l.reduce((function(t,e){return e.name||ga(15),Br(t,e.name)}),5381).toString():"",d}(),Wa=l.createContext({shouldForwardProp:void 0,styleSheet:Na,stylis:Oa});function ja(){return p(Wa)}Wa.Consumer,l.createContext(void 0);var Ba=function(){function t(t,e){var i=this;this.inject=function(t,e){void 0===e&&(e=Oa);var n=i.name+e.hash;t.hasNameForId(i.id,n)||t.insertRules(i.id,n,e(i.rules,n,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=e,ua(this,(function(){throw ga(12,String(i.name))}))}return t.prototype.getName=function(t){return void 0===t&&(t=Oa),this.name+t.hash},t}(),Ha=function(t){return t>="A"&&t<="Z"};function za(t){for(var e="",i=0;i<t.length;i++){var n=t[i];if(1===i&&"-"===n&&"-"===t[0])return t;Ha(n)?e+="-"+n.toLowerCase():e+=n}return e.startsWith("ms-")?"-"+e:e}var $a=function(t){return null==t||!1===t||""===t},Ua=function(t){var e,i,n=[];for(var s in t){var r=t[s];t.hasOwnProperty(s)&&!$a(r)&&(Array.isArray(r)&&r.isCss||aa(r)?n.push("".concat(za(s),":"),r,";"):ca(r)?n.push.apply(n,bs(bs(["".concat(s," {")],Ua(r),!1),["}"],!1)):n.push("".concat(za(s),": ").concat((e=s,null==(i=r)||"boolean"==typeof i||""===i?"":"number"!=typeof i||0===i||e in yr||e.startsWith("--")?String(i).trim():"".concat(i,"px")),";")))}return n};function Va(t,e,i,n){if($a(t))return[];if(oa(t))return[".".concat(t.styledComponentId)];if(aa(t)){if(!aa(r=t)||r.prototype&&r.prototype.isReactComponent||!e)return[t];var s=t(e);return"production"===process.env.NODE_ENV||"object"!=typeof s||Array.isArray(s)||s instanceof Ba||ca(s)||null===s||console.error("".concat($r(t)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),Va(s,e,i,n)}var r;return t instanceof Ba?i?(t.inject(i,n),[t.getName(n)]):[t]:ca(t)?Ua(t):Array.isArray(t)?Array.prototype.concat.apply(Pr,t.map((function(t){return Va(t,e,i,n)}))):[t.toString()]}var Ga=Hr(xr),qa=function(){function t(t,e,i){this.rules=t,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===i||i.isStatic)&&function(t){for(var e=0;e<t.length;e+=1){var i=t[e];if(aa(i)&&!oa(i))return!1}return!0}(t),this.componentId=e,this.baseHash=Br(Ga,e),this.baseStyle=i,La.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,i){var n=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,e,i):"";if(this.isStatic&&!i.hash)if(this.staticRulesId&&e.hasNameForId(this.componentId,this.staticRulesId))n=la(n,this.staticRulesId);else{var s=ha(Va(this.rules,t,e,i)),r=Wr(Br(this.baseHash,s)>>>0);if(!e.hasNameForId(this.componentId,r)){var a=i(s,".".concat(r),void 0,this.componentId);e.insertRules(this.componentId,r,a)}n=la(n,r),this.staticRulesId=r}else{for(var o=Br(this.baseHash,i.hash),l="",h=0;h<this.rules.length;h++){var c=this.rules[h];if("string"==typeof c)l+=c,"production"!==process.env.NODE_ENV&&(o=Br(o,c));else if(c){var d=ha(Va(c,t,e,i));o=Br(o,d+h),l+=d}}if(l){var u=Wr(o>>>0);e.hasNameForId(this.componentId,u)||e.insertRules(this.componentId,u,i(l,".".concat(u),void 0,this.componentId)),n=la(n,u)}}return n},t}(),Xa=l.createContext(void 0);function Ya(t){var e=l.useContext(Xa),i=h((function(){return function(t,e){if(!t)throw ga(14);if(aa(t)){var i=t(e);if("production"!==process.env.NODE_ENV&&(null===i||Array.isArray(i)||"object"!=typeof i))throw ga(7);return i}if(Array.isArray(t)||"object"!=typeof t)throw ga(8);return e?vs(vs({},e),t):t}(t.theme,e)}),[t.theme,e]);return t.children?l.createElement(Xa.Provider,{value:i},t.children):null}Xa.Consumer;var Ka={},Ja=new Set;function Qa(t,e,i){var n,s=oa(t),r=t,a=!Ur(t),o=e.attrs,h=void 0===o?Pr:o,p=e.componentId,f=void 0===p?function(t,e){var i="string"!=typeof t?"sc":Dr(t);Ka[i]=(Ka[i]||0)+1;var n="".concat(i,"-").concat(zr(xr+i+Ka[i]));return e?"".concat(e,"-").concat(n):n}(e.displayName,e.parentComponentId):p,g=e.displayName,m=void 0===g?Ur(n=t)?"styled.".concat(n):"Styled(".concat($r(n),")"):g,v=e.displayName&&e.componentId?"".concat(Dr(e.displayName),"-").concat(e.componentId):e.componentId||f,b=s&&r.attrs?r.attrs.concat(h).filter(Boolean):h,y=e.shouldForwardProp;if(s&&r.shouldForwardProp){var w=r.shouldForwardProp;if(e.shouldForwardProp){var A=e.shouldForwardProp;y=function(t,e){return w(t,e)&&A(t,e)}}else y=w}var _=new qa(i,v,s?r.componentStyle:void 0);function x(t,e){return function(t,e,i){var n=t.attrs,s=t.componentStyle,r=t.defaultProps,a=t.foldedComponentIds,o=t.styledComponentId,h=t.target,c=l.useContext(Xa),p=ja(),f=t.shouldForwardProp||p.shouldForwardProp;"production"!==process.env.NODE_ENV&&d(o);var g=function(t,e,i){return void 0===i&&(i=Rr),t.theme!==i.theme&&t.theme||e||i.theme}(e,c,r)||Rr,m=function(t,e,i){for(var n,s=vs(vs({},e),{className:void 0,theme:i}),r=0;r<t.length;r+=1){var a=aa(n=t[r])?n(s):n;for(var o in a)s[o]="className"===o?la(s[o],a[o]):"style"===o?vs(vs({},s[o]),a[o]):a[o]}return e.className&&(s.className=la(s.className,e.className)),s}(n,e,g),v=m.as||h,b={};for(var y in m)void 0===m[y]||"$"===y[0]||"as"===y||"theme"===y&&m.theme===g||("forwardedAs"===y?b.as=m.forwardedAs:f&&!f(y,v)||(b[y]=m[y],f||"development"!==process.env.NODE_ENV||As(y)||Ja.has(y)||!Tr.has(v)||(Ja.add(y),console.warn('styled-components: it looks like an unknown prop "'.concat(y,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var w,A,_,x,S=(w=s,A=m,_=ja(),x=w.generateAndInjectStyles(A,_.styleSheet,_.stylis),"production"!==process.env.NODE_ENV&&d(x),x);"production"!==process.env.NODE_ENV&&t.warnTooManyClasses&&t.warnTooManyClasses(S);var k=la(a,o);return S&&(k+=" "+S),m.className&&(k+=" "+m.className),b[Ur(v)&&!Tr.has(v)?"class":"className"]=k,b.ref=i,u(v,b)}(S,t,e)}x.displayName=m;var S=l.forwardRef(x);return S.attrs=b,S.componentStyle=_,S.displayName=m,S.shouldForwardProp=y,S.foldedComponentIds=s?la(r.foldedComponentIds,r.styledComponentId):"",S.styledComponentId=v,S.target=s?r.target:t,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=s?function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=0,s=e;n<s.length;n++)da(t,s[n],!0);return t}({},r.defaultProps,t):t}}),"production"!==process.env.NODE_ENV&&(function(t,e){if("production"!==process.env.NODE_ENV){var i=e?' with the id of "'.concat(e,'"'):"",n="The component ".concat(t).concat(i," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",s=console.error;try{var r=!0;console.error=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];Cr.test(t)?(r=!1,Mr.delete(n)):s.apply(void 0,bs([t],e,!1))},c(),r&&!Mr.has(n)&&(console.warn(n),Mr.add(n))}catch(t){Cr.test(t.message)&&Mr.delete(n)}finally{console.error=s}}}(m,v),S.warnTooManyClasses=function(t,e){var i={},n=!1;return function(s){if(!n&&(i[s]=!0,Object.keys(i).length>=200)){var r=e?' with the id of "'.concat(e,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(t).concat(r,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),n=!0,i={}}}}(m,v)),ua(S,(function(){return".".concat(S.styledComponentId)})),a&&ra(S,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),S}function Za(t,e){for(var i=[t[0]],n=0,s=e.length;n<s;n+=1)i.push(e[n],t[n+1]);return i}var to=function(t){return Object.assign(t,{isCss:!0})};function eo(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(aa(t)||ca(t))return to(Va(Za(Pr,bs([t],e,!0))));var n=t;return 0===e.length&&1===n.length&&"string"==typeof n[0]?Va(n):to(Va(Za(n,e)))}function io(t,e,i){if(void 0===i&&(i=Rr),!e)throw ga(1,e);var n=function(n){for(var s=[],r=1;r<arguments.length;r++)s[r-1]=arguments[r];return t(e,i,eo.apply(void 0,bs([n],s,!1)))};return n.attrs=function(n){return io(t,e,vs(vs({},i),{attrs:Array.prototype.concat(i.attrs,n).filter(Boolean)}))},n.withConfig=function(n){return io(t,e,vs(vs({},i),n))},n}var no=function(t){return io(Qa,t)},so=no;Tr.forEach((function(t){so[t]=no(t)})),"production"!==process.env.NODE_ENV&&typeof navigator<"u"&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var ro="__sc-".concat(wr,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&typeof window<"u"&&(window[ro]||(window[ro]=0),1===window[ro]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[ro]+=1);const ao={en:{documentNavInfo:"Document {{ currentFileNo }} of {{ allFilesCount }}",noRendererMessage:"No renderer for file type: {{{ fileType }}}",downloadButtonLabel:"Download file",brokenFile:"Your file is broken. Please check it on your machine.",msgPluginRecipients:"Recipients",msgPluginSender:"Sender",pdfPluginLoading:"Loading...",pdfPluginPageNumber:"Page {{ currentPage }}/{{ allPagesCount }}"},no:{documentNavInfo:"Dokument {{ currentFileNo }} av {{ allFilesCount }}",noRendererMessage:"Ingen rendering for filtype: {{{ fileType }}}",downloadButtonLabel:"Last ned fil",brokenFile:"Filen din er ødelagt. Vennligst sjekk den på maskinen din.",msgPluginRecipients:"Mottakere",msgPluginSender:"Avsender",pdfPluginLoading:"Lasting...",pdfPluginPageNumber:"Side {{ currentPage }}/{{ allPagesCount }}"},pl:{documentNavInfo:"Dokument {{ currentFileNo }} z {{ allFilesCount }}",noRendererMessage:"Brak funckji renderującej dla: {{{ fileType }}}",downloadButtonLabel:"Pobierz plik",brokenFile:"Twój plik jest uszkodzony. Sprawdź go na swoim komputerze.",msgPluginRecipients:"Odbiorcy",msgPluginSender:"Nadawca",pdfPluginLoading:"Wczytywanie...",pdfPluginPageNumber:"Strona {{ currentPage }}/{{ allPagesCount }}"},es:{documentNavInfo:"Documento {{ currentFileNo }} de {{ allFilesCount }}",noRendererMessage:"No hay procesador para el tipo de archivo: {{{ fileType }}}",downloadButtonLabel:"Descargar archivo",brokenFile:"Tu archivo está roto. Compruébalo en tu máquina.",msgPluginRecipients:"Destinatarios",msgPluginSender:"Remitente",pdfPluginLoading:"Cargando...",pdfPluginPageNumber:"Página {{ currentPage }}/{{ allPagesCount }}"},de:{documentNavInfo:"Dokument {{ currentFileNo }} von {{ allFilesCount }}",noRendererMessage:"Kein Renderer für Dateityp: {{{ fileType }}}",downloadButtonLabel:"Datei herunterladen",brokenFile:"Ihre Datei ist defekt. Bitte überprüfen Sie sie auf Ihrem Rechner.",msgPluginRecipients:"Empfänger",msgPluginSender:"Absender",pdfPluginLoading:"Wird geladen...",pdfPluginPageNumber:"Seite {{ currentPage }}/{{ allPagesCount }}"},it:{documentNavInfo:"Documento {{ currentFileNo }} di {{ allFilesCount }}",noRendererMessage:"Nessun renderer per il tipo di file: {{{ fileType }}}",downloadButtonLabel:"Scarica file",brokenFile:"Il tuo file è danneggiato. Controllalo sul tuo computer.",msgPluginRecipients:"Destinatari",msgPluginSender:"Mittente",pdfPluginLoading:"Caricamento in corso...",pdfPluginPageNumber:"Pagina {{ currentPage }}/{{ allPagesCount }}"},pt:{documentNavInfo:"Documento {{ currentFileNo }} de {{ allFilesCount }}",noRendererMessage:"Nenhum renderizador para o tipo de arquivo: {{{ fileType }}}",downloadButtonLabel:"Baixar arquivo",brokenFile:"Seu arquivo está quebrado. Por favor, verifique-o em sua máquina.",msgPluginRecipients:"Destinatários",msgPluginSender:"Remetente",pdfPluginLoading:"Carregando...",pdfPluginPageNumber:"Página {{ currentPage }}/{{ allPagesCount }}"},fr:{documentNavInfo:"Document {{ currentFileNo }} de {{ allFilesCount }}",noRendererMessage:"Aucun moteur de rendu pour le type de fichier : {{{ fileType }}}",downloadButtonLabel:"Télécharger le fichier",brokenFile:"Votre fichier est cassé. Veuillez le vérifier sur votre machine.",msgPluginRecipients:"Destinataires",msgPluginSender:"Expéditeur",pdfPluginLoading:"Chargement...",pdfPluginPageNumber:"Page {{ currentPage }}/{{ allPagesCount }}"},ar:{documentNavInfo:"مستند {{ currentFileNo }} من {{ allFilesCount }}",noRendererMessage:"{{{ fileType }}} : لا يمكننا عرض هذا النوع من الملفات",downloadButtonLabel:"تحميل الملف",brokenFile:"الملف تالف، يرجى التحقق منه على جهازك الخاص.",msgPluginRecipients:"المستلمين",msgPluginSender:"المرسل",pdfPluginLoading:"تحميل ...",pdfPluginPageNumber:" {{ allPagesCount }} \\ {{ currentPage }} صفحة "},sr:{documentNavInfo:"Dokument {{ currentFileNo }} od {{ allFilesCount }}",noRendererMessage:"Ne postoji pregledač za tip fajla: {{ fileType }}",downloadButtonLabel:"Preuzimanje fajla",brokenFile:"Vaš fajl nije dobar. Molimo Vas da probate da ga otvorite na vašem računaru.",msgPluginRecipients:"Primaoci",msgPluginSender:"Pošiljalac",pdfPluginLoading:"Učitavanje...",pdfPluginPageNumber:"Strana {{ currentPage }}/{{ allPagesCount }}"},sr_cyr:{documentNavInfo:"Документ {{ currentFileNo }} od {{ allFilesCount }}",noRendererMessage:"Не постоји прегледач за тип фајла: {{ fileType }}",downloadButtonLabel:"Преузимање фајла",brokenFile:"Ваш фајл није добар. Молимо Вас да пробате да га отворите на вашем рачунару.",msgPluginRecipients:"Примаоци",msgPluginSender:"Пошиљалац",pdfPluginLoading:"Учитавање...",pdfPluginPageNumber:"Страна {{ currentPage }}/{{ allPagesCount }}"},ja:{documentNavInfo:"ファイル {{ currentFileNo }} / {{ allFilesCount }}",noRendererMessage:"ファイルタイプに対応したレンダラーはありません: {{ fileType }}",downloadButtonLabel:"ダウンロード",brokenFile:"ファイルが壊れています。あなたのマシンでファイルを確認してください。",msgPluginRecipients:"受信者",msgPluginSender:"送信者",pdfPluginLoading:"ローティング中...",pdfPluginPageNumber:"ページ {{ currentPage }}/{{ allPagesCount }}"},ru:{documentNavInfo:"Документ {{ currentFileNo }} из {{ allFilesCount }}",noRendererMessage:"Данный тип файла не поддерживается рендером: {{{ fileType }}}",downloadButtonLabel:"Скачать файл",brokenFile:"Ваш файл сломан. Пожалуйста, проверьте его на своём комьютере.",msgPluginRecipients:"Получатели",msgPluginSender:"Отправитель",pdfPluginLoading:"Загрузка...",pdfPluginPageNumber:"Страница {{ currentPage }}/{{ allPagesCount }}"},se:{documentNavInfo:"Dokument {{ currentFileNo }} av {{ allFilesCount }}",noRendererMessage:"Ingen renderare för filtypen: {{{ fileType }}}",downloadButtonLabel:"Ladda ner",brokenFile:"Filen är trasig. Var vänlig kontrollera den på din maskin.",msgPluginRecipients:"Mottagare",msgPluginSender:"Avsändare",pdfPluginLoading:"Laddar...",pdfPluginPageNumber:"Sida {{ currentPage }}/{{ allPagesCount }}"}},oo=Object.keys(ao),lo="en",ho="SET_ALL_DOCUMENTS",co="SET_DOCUMENT_LOADING",uo="NEXT_DOCUMENT",po="PREVIOUS_DOCUMENT",fo="UPDATE_CURRENT_DOCUMENT",go="SET_RENDERER_RECT",mo="SET_MAIN_CONFIG",vo=t=>({type:co,value:t}),bo=()=>({type:uo}),yo=()=>({type:po}),wo=t=>({type:fo,document:t}),Ao={currentFileNo:0,documents:[],documentLoading:!0,currentDocument:void 0,rendererRect:void 0,config:{},pluginRenderers:[],language:lo},_o=(t=Ao,e)=>{switch(e.type){case ho:{const{documents:i,initialActiveDocument:n}=e;return{...t,documents:i,currentDocument:n||i[0]||void 0,currentFileNo:n&&i.includes(n)?i.indexOf(n):Ao.currentFileNo}}case co:{const{value:i}=e;return{...t,documentLoading:i}}case uo:{if(t.currentFileNo>=t.documents.length-1)return t;const e=t.currentFileNo+1,i=t.documents[e];return t.onDocumentChange&&i&&t.onDocumentChange(i),{...t,currentFileNo:e,currentDocument:t.documents[e],documentLoading:!0}}case po:{if(t.currentFileNo<=0)return t;const e=t.currentFileNo-1,i=t.documents[e];return t.onDocumentChange&&i&&t.onDocumentChange(i),{...t,currentFileNo:t.currentFileNo-1,currentDocument:t.documents[e],documentLoading:!0}}case fo:{const{document:i}=e;return{...t,currentDocument:i,currentFileNo:t.documents.findIndex((t=>t.uri===i.uri))}}case go:{const{rect:i}=e;return{...t,rendererRect:i}}case mo:{const{config:i}=e;return{...t,config:i}}default:return t}},xo=f({state:Ao,dispatch:()=>null}),So=g(((t,e)=>{const{children:i,documents:n,config:s,pluginRenderers:r,prefetchMethod:a,requestHeaders:o,initialActiveDocument:l,language:h,activeDocument:c,onDocumentChange:d}=t,[u,p]=m(_o,{...Ao,documents:n||[],currentDocument:n&&n.length?l||n[0]:void 0,config:s,pluginRenderers:r,prefetchMethod:a,requestHeaders:o,currentFileNo:l?n.findIndex((t=>t===l))??0:0,language:h&&ao[h]?h:lo,activeDocument:c,onDocumentChange:d});return v((()=>{p(((t,e)=>({type:ho,documents:t,initialActiveDocument:e}))(n,l)),s&&p((t=>({type:mo,config:t}))(s))}),[n,s,l]),v((()=>{c&&p(wo(c))}),[c]),b(e,(()=>({prev(){p(yo())},next(){p(bo())}})),[p]),R.jsx(xo.Provider,{value:{state:u,dispatch:p},children:i})})),ko=eo`
|
|
21
21
|
background-color: ${t=>t.theme.primary};
|
|
22
22
|
color: ${t=>t.theme.textPrimary};
|
|
23
23
|
`,Eo=eo`
|
|
@@ -69,13 +69,13 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
69
69
|
height: 30px;
|
|
70
70
|
font-size: 15px;
|
|
71
71
|
}
|
|
72
|
-
`;so(Co)``;const
|
|
72
|
+
`;so(Co)``;const Po=so(Co)`
|
|
73
73
|
${Eo}
|
|
74
|
-
`,
|
|
74
|
+
`,Ro=t=>R.jsx(Lo,{...t}),To=t=>R.jsx(Lo,{...t,reverse:!0}),Lo=({color:t,size:e,reverse:i})=>R.jsx("svg",{width:e||"100%",height:e||"100%",style:{transform:""+(i?"rotate(180deg)":"")},id:"arrow_left",version:"1.1",viewBox:"0 0 32 32",xmlSpace:"preserve",children:R.jsx("path",{clipRule:"evenodd",d:"M31.106,15H3.278l8.325-8.293 c0.391-0.391,0.391-1.024,0-1.414c-0.391-0.391-1.024-0.391-1.414,0l-9.9,9.899c-0.385,0.385-0.385,1.029,0,1.414l9.9,9.9 c0.391,0.391,1.024,0.391,1.414,0c0.391-0.391,0.391-1.024,0-1.414L3.278,17h27.828c0.552,0,1-0.448,1-1 C32.106,15.448,31.658,15,31.106,15z",fill:t||"#aaa",fillRule:"evenodd",id:"Arrow_Back"})}),Io=t=>{const{color:e,size:i}=t;return R.jsx("svg",{width:i||"100%",height:i||"100%",version:"1.1",id:"Icons",viewBox:"0 0 32 32",xmlSpace:"preserve",style:{alignSelf:"center",justifySelf:"center"},children:R.jsxs("g",{children:[R.jsx("path",{fill:e||"#aaa",d:"M16,2c-0.6,0-1,0.4-1,1v5c0,0.6,0.4,1,1,1s1-0.4,1-1V3C17,2.4,16.6,2,16,2z"}),R.jsx("path",{fill:e||"#aaa",d:"M7.5,6.1c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l3.5,3.5c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L7.5,6.1\n\t\tz"}),R.jsx("path",{fill:e||"#aaa",d:"M9,16c0-0.6-0.4-1-1-1H3c-0.6,0-1,0.4-1,1s0.4,1,1,1h5C8.6,17,9,16.6,9,16z"}),R.jsx("path",{fill:e||"#aaa",d:"M9.6,20.9l-3.5,3.5c-0.4,0.4-0.4,1,0,1.4c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3l3.5-3.5c0.4-0.4,0.4-1,0-1.4\n\t\tS10,20.6,9.6,20.9z"}),R.jsx("path",{fill:e||"#aaa",d:"M16,23c-0.6,0-1,0.4-1,1v5c0,0.6,0.4,1,1,1s1-0.4,1-1v-5C17,23.4,16.6,23,16,23z"}),R.jsx("path",{fill:e||"#aaa",d:"M22.4,20.9c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l3.5,3.5c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4\n\t\tL22.4,20.9z"}),R.jsx("path",{fill:e||"#aaa",d:"M29,15h-5c-0.6,0-1,0.4-1,1s0.4,1,1,1h5c0.6,0,1-0.4,1-1S29.6,15,29,15z"}),R.jsx("path",{fill:e||"#aaa",d:"M21.7,11.3c0.3,0,0.5-0.1,0.7-0.3l3.5-3.5c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0l-3.5,3.5c-0.4,0.4-0.4,1,0,1.4\n\t\tC21.1,11.2,21.4,11.3,21.7,11.3z"})]})})};
|
|
75
75
|
/*!
|
|
76
76
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
77
77
|
* http://github.com/janl/mustache.js
|
|
78
|
-
*/var Do=Object.prototype.toString,Fo=Array.isArray||function(t){return"[object Array]"===Do.call(t)};function No(t){return"function"==typeof t}function Oo(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Wo(t,e){return null!=t&&"object"==typeof t&&e in t}function jo(t,e){return null!=t&&"object"!=typeof t&&t.hasOwnProperty&&t.hasOwnProperty(e)}var Bo=RegExp.prototype.test;var
|
|
78
|
+
*/var Do=Object.prototype.toString,Fo=Array.isArray||function(t){return"[object Array]"===Do.call(t)};function No(t){return"function"==typeof t}function Oo(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Wo(t,e){return null!=t&&"object"==typeof t&&e in t}function jo(t,e){return null!=t&&"object"!=typeof t&&t.hasOwnProperty&&t.hasOwnProperty(e)}var Bo=RegExp.prototype.test;var Ho=/\S/;function zo(t){return!function(t,e){return Bo.call(t,e)}(Ho,t)}var $o={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};var Uo=/\s*/,Vo=/\s+/,Go=/\s*=/,qo=/\s*\}/,Xo=/#|\^|\/|>|\{|&|=|!/;function Yo(t){this.string=t,this.tail=t,this.pos=0}function Ko(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function Jo(){this.templateCache={_cache:{},set:function(t,e){this._cache[t]=e},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}Yo.prototype.eos=function(){return""===this.tail},Yo.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var i=e[0];return this.tail=this.tail.substring(i.length),this.pos+=i.length,i},Yo.prototype.scanUntil=function(t){var e,i=this.tail.search(t);switch(i){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,i),this.tail=this.tail.substring(i)}return this.pos+=e.length,e},Ko.prototype.push=function(t){return new Ko(t,this)},Ko.prototype.lookup=function(t){var e,i=this.cache;if(i.hasOwnProperty(t))e=i[t];else{for(var n,s,r,a=this,o=!1;a;){if(t.indexOf(".")>0)for(n=a.view,s=t.split("."),r=0;null!=n&&r<s.length;)r===s.length-1&&(o=Wo(n,s[r])||jo(n,s[r])),n=n[s[r++]];else n=a.view[t],o=Wo(a.view,t);if(o){e=n;break}a=a.parent}i[t]=e}return No(e)&&(e=e.call(this.view)),e},Jo.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()},Jo.prototype.parse=function(t,e){var i=this.templateCache,n=t+":"+(e||Qo.tags).join(":"),s=typeof i<"u",r=s?i.get(n):void 0;return null==r&&(r=function(t,e){if(!t)return[];var i,n,s,r=!1,a=[],o=[],l=[],h=!1,c=!1,d="",u=0;function p(){if(h&&!c)for(;l.length;)delete o[l.pop()];else l=[];h=!1,c=!1}function f(t){if("string"==typeof t&&(t=t.split(Vo,2)),!Fo(t)||2!==t.length)throw new Error("Invalid tags: "+t);i=new RegExp(Oo(t[0])+"\\s*"),n=new RegExp("\\s*"+Oo(t[1])),s=new RegExp("\\s*"+Oo("}"+t[1]))}f(e||Qo.tags);for(var g,m,v,b,y,w,A=new Yo(t);!A.eos();){if(g=A.pos,v=A.scanUntil(i))for(var _=0,x=v.length;_<x;++_)zo(b=v.charAt(_))?(l.push(o.length),d+=b):(c=!0,r=!0,d+=" "),o.push(["text",b,g,g+1]),g+=1,"\n"===b&&(p(),d="",u=0,r=!1);if(!A.scan(i))break;if(h=!0,m=A.scan(Xo)||"name",A.scan(Uo),"="===m?(v=A.scanUntil(Go),A.scan(Go),A.scanUntil(n)):"{"===m?(v=A.scanUntil(s),A.scan(qo),A.scanUntil(n),m="&"):v=A.scanUntil(n),!A.scan(n))throw new Error("Unclosed tag at "+A.pos);if(y=">"==m?[m,v,g,A.pos,d,u,r]:[m,v,g,A.pos],u++,o.push(y),"#"===m||"^"===m)a.push(y);else if("/"===m){if(!(w=a.pop()))throw new Error('Unopened section "'+v+'" at '+g);if(w[1]!==v)throw new Error('Unclosed section "'+w[1]+'" at '+g)}else"name"===m||"{"===m||"&"===m?c=!0:"="===m&&f(v)}if(p(),w=a.pop())throw new Error('Unclosed section "'+w[1]+'" at '+A.pos);return function(t){for(var e,i=[],n=i,s=[],r=0,a=t.length;r<a;++r)switch(e=t[r],e[0]){case"#":case"^":n.push(e),s.push(e),n=e[4]=[];break;case"/":s.pop()[5]=e[2],n=s.length>0?s[s.length-1][4]:i;break;default:n.push(e)}return i}(function(t){for(var e,i,n=[],s=0,r=t.length;s<r;++s)(e=t[s])&&("text"===e[0]&&i&&"text"===i[0]?(i[1]+=e[1],i[3]=e[3]):(n.push(e),i=e));return n}(o))}(t,e),s&&i.set(n,r)),r},Jo.prototype.render=function(t,e,i,n){var s=this.getConfigTags(n),r=this.parse(t,s),a=e instanceof Ko?e:new Ko(e,void 0);return this.renderTokens(r,a,i,t,n)},Jo.prototype.renderTokens=function(t,e,i,n,s){for(var r,a,o,l="",h=0,c=t.length;h<c;++h)o=void 0,"#"===(a=(r=t[h])[0])?o=this.renderSection(r,e,i,n,s):"^"===a?o=this.renderInverted(r,e,i,n,s):">"===a?o=this.renderPartial(r,e,i,s):"&"===a?o=this.unescapedValue(r,e):"name"===a?o=this.escapedValue(r,e,s):"text"===a&&(o=this.rawValue(r)),void 0!==o&&(l+=o);return l},Jo.prototype.renderSection=function(t,e,i,n,s){var r=this,a="",o=e.lookup(t[1]);if(o){if(Fo(o))for(var l=0,h=o.length;l<h;++l)a+=this.renderTokens(t[4],e.push(o[l]),i,n,s);else if("object"==typeof o||"string"==typeof o||"number"==typeof o)a+=this.renderTokens(t[4],e.push(o),i,n,s);else if(No(o)){if("string"!=typeof n)throw new Error("Cannot use higher-order sections without the original template");null!=(o=o.call(e.view,n.slice(t[3],t[5]),(function(t){return r.render(t,e,i,s)})))&&(a+=o)}else a+=this.renderTokens(t[4],e,i,n,s);return a}},Jo.prototype.renderInverted=function(t,e,i,n,s){var r=e.lookup(t[1]);if(!r||Fo(r)&&0===r.length)return this.renderTokens(t[4],e,i,n,s)},Jo.prototype.indentPartial=function(t,e,i){for(var n=e.replace(/[^ \t]/g,""),s=t.split("\n"),r=0;r<s.length;r++)s[r].length&&(r>0||!i)&&(s[r]=n+s[r]);return s.join("\n")},Jo.prototype.renderPartial=function(t,e,i,n){if(i){var s=this.getConfigTags(n),r=No(i)?i(t[1]):i[t[1]];if(null!=r){var a=t[6],o=t[5],l=t[4],h=r;0==o&&l&&(h=this.indentPartial(r,l,a));var c=this.parse(h,s);return this.renderTokens(c,e,i,h,n)}}},Jo.prototype.unescapedValue=function(t,e){var i=e.lookup(t[1]);if(null!=i)return i},Jo.prototype.escapedValue=function(t,e,i){var n=this.getConfigEscape(i)||Qo.escape,s=e.lookup(t[1]);if(null!=s)return"number"==typeof s&&n===Qo.escape?String(s):n(s)},Jo.prototype.rawValue=function(t){return t[1]},Jo.prototype.getConfigTags=function(t){return Fo(t)?t:t&&"object"==typeof t?t.tags:void 0},Jo.prototype.getConfigEscape=function(t){if(t&&"object"==typeof t&&!Fo(t))return t.escape};var Qo={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){Zo.templateCache=t},get templateCache(){return Zo.templateCache}},Zo=new Jo;Qo.clearCache=function(){return Zo.clearCache()},Qo.parse=function(t,e){return Zo.parse(t,e)},Qo.render=function(t,e,i,n){if("string"!=typeof t)throw new TypeError('Invalid template! Template should be a "string" but "'+((Fo(s=t)?"array":typeof s)+'" was given as the first argument for mustache#render(template, view, partials)'));var s;return Zo.render(t,e,i,n)},Qo.escape=function(t){return String(t).replace(/[&<>"'`=\/]/g,(function(t){return $o[t]}))},Qo.Scanner=Yo,Qo.Context=Ko,Qo.Writer=Jo;const tl=()=>{const{state:{language:t}}=p(xo),e=ao[lo];return{t:y(((i,n)=>{const s=ao[t];return s[i]?Qo.render(s[i],n):e[i]?Qo.render(e[i],n):i}),[t,e])}},el=()=>{const{state:{currentDocument:t,currentFileNo:e,documents:i},dispatch:n}=p(xo),{t:s}=tl();if(i.length<=1||!t)return null;let r=t.uri||"";const a=null==r?void 0:r.split("/");return a.length&&(r=a[a.length-1]||""),R.jsxs(il,{id:"doc-nav",children:[R.jsx("p",{id:"doc-nav-info",children:s("documentNavInfo",{currentFileNo:e+1,allFilesCount:i.length})}),R.jsx(nl,{id:"doc-nav-prev",onClick:()=>n(yo()),disabled:0===e,children:R.jsx(Ro,{color:"#fff",size:"60%"})}),R.jsx(sl,{id:"doc-nav-next",onClick:()=>n(bo()),disabled:e>=i.length-1,children:R.jsx(To,{color:"#fff",size:"60%"})})]})},il=so.div`
|
|
79
79
|
min-width: 150px;
|
|
80
80
|
display: flex;
|
|
81
81
|
flex-direction: row;
|
|
@@ -83,7 +83,7 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
83
83
|
justify-content: flex-end;
|
|
84
84
|
margin: 0 10px;
|
|
85
85
|
color: ${t=>t.theme.textPrimary};
|
|
86
|
-
`,nl=so(
|
|
86
|
+
`,nl=so(Po)`
|
|
87
87
|
width: 30px;
|
|
88
88
|
height: 30px;
|
|
89
89
|
margin: 0 5px 0 10px;
|
|
@@ -94,14 +94,14 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
94
94
|
}
|
|
95
95
|
`,sl=so(nl)`
|
|
96
96
|
margin: 0 5px;
|
|
97
|
-
`,rl=(t,e)=>{var i;if(!t)return"";let n="";if(t.fileName)n=t.fileName;else{n=t.uri||"",n=decodeURI(n),e||(n=(null==(i=null==n?void 0:n.split("?"))?void 0:i[0])||"");const s=null==n?void 0:n.split("/");s.length&&(n=s[s.length-1]||"")}return n},al=()=>{var t,e;const{state:{config:i,currentDocument:n}}=p(xo);if(!n||null!=(t=null==i?void 0:i.header)&&t.disableFileName)return null;const s=rl(n,(null==(e=null==i?void 0:i.header)?void 0:e.retainURLParams)||!1);return
|
|
97
|
+
`,rl=(t,e)=>{var i;if(!t)return"";let n="";if(t.fileName)n=t.fileName;else{n=t.uri||"",n=decodeURI(n),e||(n=(null==(i=null==n?void 0:n.split("?"))?void 0:i[0])||"");const s=null==n?void 0:n.split("/");s.length&&(n=s[s.length-1]||"")}return n},al=()=>{var t,e;const{state:{config:i,currentDocument:n}}=p(xo);if(!n||null!=(t=null==i?void 0:i.header)&&t.disableFileName)return null;const s=rl(n,(null==(e=null==i?void 0:i.header)?void 0:e.retainURLParams)||!1);return R.jsx(ol,{id:"file-name","data-testid":"file-name",children:s})},ol=so.div`
|
|
98
98
|
flex: 1;
|
|
99
99
|
text-align: left;
|
|
100
100
|
color: ${t=>t.theme.textPrimary};
|
|
101
101
|
font-weight: bold;
|
|
102
102
|
margin: 0 10px;
|
|
103
103
|
overflow: hidden;
|
|
104
|
-
`,ll=()=>{var t,e,i;const{state:n,dispatch:s}=p(xo),{config:r}=n;if(null!=(t=null==r?void 0:r.header)&&t.disableHeader)return null;return(null==(i=null==(e=null==r?void 0:r.header)?void 0:e.overrideComponent)?void 0:i.call(e,n,(()=>s(
|
|
104
|
+
`,ll=()=>{var t,e,i;const{state:n,dispatch:s}=p(xo),{config:r}=n;if(null!=(t=null==r?void 0:r.header)&&t.disableHeader)return null;return(null==(i=null==(e=null==r?void 0:r.header)?void 0:e.overrideComponent)?void 0:i.call(e,n,(()=>s(yo())),(()=>s(bo()))))||R.jsxs(hl,{id:"header-bar","data-testid":"header-bar",children:[R.jsx(al,{}),R.jsx(el,{})]})},hl=so.div`
|
|
105
105
|
display: flex;
|
|
106
106
|
justify-content: flex-end;
|
|
107
107
|
align-items: center;
|
|
@@ -116,13 +116,13 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
116
116
|
padding: 5px;
|
|
117
117
|
font-size: 10px;
|
|
118
118
|
}
|
|
119
|
-
`,cl=({documentURI:t,signal:e,fileLoaderComplete:i,readerTypeFunction:n,headers:s})=>fetch(t,{signal:e,headers:s}).then((async t=>{const e=await t.blob(),s=new FileReader;switch(s.addEventListener("loadend",(()=>i(s))),n){case"arrayBuffer":s.readAsArrayBuffer(e);break;case"binaryString":s.readAsBinaryString(e);break;case"dataURL":s.readAsDataURL(e);break;case"text":s.readAsText(e)}})).catch((t=>t)),dl=t=>cl({...t,readerTypeFunction:"arrayBuffer"}),ul=t=>cl({...t,readerTypeFunction:"dataURL"}),pl=t=>cl({...t,readerTypeFunction:"text"}),fl=t=>cl({...t,readerTypeFunction:"binaryString"}),gl=ul,ml=()=>{const{state:t,dispatch:e}=p(xo),{currentFileNo:i,currentDocument:n,prefetchMethod:s}=t,{CurrentRenderer:r}=(()=>{const{state:{currentDocument:t,pluginRenderers:e}}=p(xo),[i,n]=w();return v((()=>{if(!t)return;if(!t.fileType)return void n(void 0);const i=[];null==e||e.forEach((e=>{void 0!==t.fileType&&e.fileTypes.indexOf(t.fileType)>=0&&i.push(e)}));const[s]=i.sort(((t,e)=>e.weight-t.weight));n(s&&void 0!==s?()=>s:null)}),[t,e]),{CurrentRenderer:i}})(),a=(null==n?void 0:n.uri)||"";return v((()=>{if(!n||void 0!==n.fileType)return;const i=new AbortController,{signal:r}=i;return fetch(a,{method:s||a.startsWith("blob:")?"GET":"HEAD",signal:r,headers:null==t?void 0:t.requestHeaders}).then((t=>{const i=t.headers.get("content-type"),s=(null==i?void 0:i.split(";"))||[],r=s.length?s[0]:void 0;e(wo({...n,fileType:r||void 0}))})).catch((t=>{if("AbortError"!==(null==t?void 0:t.name))throw t})),()=>{i.abort()}}),[i,a,n]),v((()=>{var i;if(!n||void 0===r)return;const s=new AbortController,{signal:o}=s,l={documentURI:a,signal:o,fileLoaderComplete:t=>{if(!n||!t)return void e(vo(!1));const i={...n};null!==t.result&&(i.fileData=t.result),e(wo(i)),e(vo(!1))},headers:null==t?void 0:t.requestHeaders};return null===r?e(vo(!1)):void 0!==r.fileLoader?null==(i=r.fileLoader)||i.call(r,l):gl(l),()=>{s.abort()}}),[r,i]),{state:t,dispatch:e,CurrentRenderer:r}},vl=({children:t})=>{var e,i;const{state:n}=p(xo),{config:s}=n,[r,a]=w(!1===(null==(e=null==s?void 0:s.loadingRenderer)?void 0:e.showLoadingTimeout));return v((()=>{var t;setTimeout((()=>{a(!0)}),"number"==typeof(null==(t=null==s?void 0:s.loadingRenderer)?void 0:t.showLoadingTimeout)?s.loadingRenderer.showLoadingTimeout:500)}),[null==(i=null==s?void 0:s.loadingRenderer)?void 0:i.showLoadingTimeout]),r?
|
|
119
|
+
`,cl=({documentURI:t,signal:e,fileLoaderComplete:i,readerTypeFunction:n,headers:s})=>fetch(t,{signal:e,headers:s}).then((async t=>{const e=await t.blob(),s=new FileReader;switch(s.addEventListener("loadend",(()=>i(s))),n){case"arrayBuffer":s.readAsArrayBuffer(e);break;case"binaryString":s.readAsBinaryString(e);break;case"dataURL":s.readAsDataURL(e);break;case"text":s.readAsText(e)}})).catch((t=>t)),dl=t=>cl({...t,readerTypeFunction:"arrayBuffer"}),ul=t=>cl({...t,readerTypeFunction:"dataURL"}),pl=t=>cl({...t,readerTypeFunction:"text"}),fl=t=>cl({...t,readerTypeFunction:"binaryString"}),gl=ul,ml=()=>{const{state:t,dispatch:e}=p(xo),{currentFileNo:i,currentDocument:n,prefetchMethod:s}=t,{CurrentRenderer:r}=(()=>{const{state:{currentDocument:t,pluginRenderers:e}}=p(xo),[i,n]=w();return v((()=>{if(!t)return;if(!t.fileType)return void n(void 0);const i=[];null==e||e.forEach((e=>{void 0!==t.fileType&&e.fileTypes.indexOf(t.fileType)>=0&&i.push(e)}));const[s]=i.sort(((t,e)=>e.weight-t.weight));n(s&&void 0!==s?()=>s:null)}),[t,e]),{CurrentRenderer:i}})(),a=(null==n?void 0:n.uri)||"";return v((()=>{if(!n||void 0!==n.fileType)return;const i=new AbortController,{signal:r}=i;return fetch(a,{method:s||a.startsWith("blob:")?"GET":"HEAD",signal:r,headers:null==t?void 0:t.requestHeaders}).then((t=>{const i=t.headers.get("content-type"),s=(null==i?void 0:i.split(";"))||[],r=s.length?s[0]:void 0;e(wo({...n,fileType:r||void 0}))})).catch((t=>{if("AbortError"!==(null==t?void 0:t.name))throw t})),()=>{i.abort()}}),[i,a,n]),v((()=>{var i;if(!n||void 0===r)return;const s=new AbortController,{signal:o}=s,l={documentURI:a,signal:o,fileLoaderComplete:t=>{if(!n||!t)return void e(vo(!1));const i={...n};null!==t.result&&(i.fileData=t.result),e(wo(i)),e(vo(!1))},headers:null==t?void 0:t.requestHeaders};return null===r?e(vo(!1)):void 0!==r.fileLoader?null==(i=r.fileLoader)||i.call(r,l):gl(l),()=>{s.abort()}}),[r,i]),{state:t,dispatch:e,CurrentRenderer:r}},vl=({children:t})=>{var e,i;const{state:n}=p(xo),{config:s}=n,[r,a]=w(!1===(null==(e=null==s?void 0:s.loadingRenderer)?void 0:e.showLoadingTimeout));return v((()=>{var t;setTimeout((()=>{a(!0)}),"number"==typeof(null==(t=null==s?void 0:s.loadingRenderer)?void 0:t.showLoadingTimeout)?s.loadingRenderer.showLoadingTimeout:500)}),[null==(i=null==s?void 0:s.loadingRenderer)?void 0:i.showLoadingTimeout]),r?R.jsx(R.Fragment,{children:t}):null},bl=({documents:t,documentLoading:e,config:i,currentDocument:n,fileName:s,CurrentRenderer:r,state:a,t:o})=>{var l,h;if(t.length){if(e){if(i&&null!=(l=null==i?void 0:i.loadingRenderer)&&l.overrideComponent){const t=i.loadingRenderer.overrideComponent;return R.jsx(vl,{children:R.jsx(t,{document:n,fileName:s})})}return R.jsx(vl,{children:R.jsx(wl,{id:"loading-renderer","data-testid":"loading-renderer",children:R.jsx(_l,{children:R.jsx(Io,{color:"#444",size:40})})})})}if(r)return R.jsx(r,{mainState:a});if(void 0===r)return null;if(i&&null!=(h=null==i?void 0:i.noRenderer)&&h.overrideComponent){const t=i.noRenderer.overrideComponent;return R.jsx(t,{document:n,fileName:s})}return R.jsxs("div",{id:"no-renderer","data-testid":"no-renderer",children:[o("noRendererMessage",{fileType:(null==n?void 0:n.fileType)??""}),R.jsx(xl,{id:"no-renderer-download",href:null==n?void 0:n.uri,download:null==n?void 0:n.uri,children:o("downloadButtonLabel")})]})}return R.jsx("div",{id:"no-documents"})},yl=()=>{var t;const{state:e,dispatch:i,CurrentRenderer:n}=ml(),{documents:s,documentLoading:r,currentDocument:a,config:o}=e,l=(()=>{const[t,e]=w({width:void 0,height:void 0});return v((()=>{function t(){e({width:window.innerWidth,height:window.innerHeight})}return window.addEventListener("resize",t),t(),()=>window.removeEventListener("resize",t)}),[]),t})(),{t:h}=tl(),c=y((t=>{t&&i((t=>({type:go,rect:t}))(null==t?void 0:t.getBoundingClientRect()))}),[l,i]),d=rl(a,(null==(t=null==o?void 0:o.header)?void 0:t.retainURLParams)||!1);return R.jsx("div",{id:"proxy-renderer","data-testid":"proxy-renderer",ref:c,children:R.jsx(bl,{state:e,documents:s,documentLoading:r,config:o,currentDocument:a,fileName:d,CurrentRenderer:n,t:h})})},wl=so.div`
|
|
120
120
|
display: flex;
|
|
121
121
|
flex: 1;
|
|
122
122
|
height: 75px;
|
|
123
123
|
align-items: center;
|
|
124
124
|
justify-content: center;
|
|
125
|
-
`,Al=(function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];"production"!==process.env.NODE_ENV&&typeof navigator<"u"&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var n=ha(eo.apply(void 0,
|
|
125
|
+
`,Al=(function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];"production"!==process.env.NODE_ENV&&typeof navigator<"u"&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var n=ha(eo.apply(void 0,bs([t],e,!1))),s=zr(n);return new Ba(s,n)})`
|
|
126
126
|
from {
|
|
127
127
|
transform: rotate(0deg);
|
|
128
128
|
}
|
|
@@ -142,7 +142,7 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
142
142
|
width: 125px;
|
|
143
143
|
height: 25px;
|
|
144
144
|
}
|
|
145
|
-
`,Sl={primary:"#fff",secondary:"#000",tertiary:"#ffffff99",textPrimary:"#000",textSecondary:"#fff",textTertiary:"#00000044",disableThemeScrollbar:!1},kl=t=>{const{mainState:{currentDocument:e},children:i}=t;return e?
|
|
145
|
+
`,Sl={primary:"#fff",secondary:"#000",tertiary:"#ffffff99",textPrimary:"#000",textSecondary:"#fff",textTertiary:"#00000044",disableThemeScrollbar:!1},kl=t=>{const{mainState:{currentDocument:e},children:i}=t;return e?R.jsx(El,{id:"image-renderer",...t,children:i||R.jsx(Cl,{id:"image-img",src:e.fileData})}):null};kl.fileTypes=[],kl.weight=0;const El=so.div`
|
|
146
146
|
display: flex;
|
|
147
147
|
flex: 1;
|
|
148
148
|
align-items: center;
|
|
@@ -153,7 +153,7 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
153
153
|
`,Cl=so.img`
|
|
154
154
|
max-width: 95%;
|
|
155
155
|
max-height: 95%;
|
|
156
|
-
`,Ml=t=>
|
|
156
|
+
`,Ml=t=>R.jsx(kl,{...t});Ml.fileTypes=["bmp","image/bmp"],Ml.weight=0;const Pl=({mainState:{currentDocument:t}})=>(v((()=>{const e=null==t?void 0:t.fileData;let i="";const n=(null==e?void 0:e.replace(/^data:text\/html;(?:charset=([^;]*);)?base64,/,((t,e)=>(i=e,""))))||"";let s=window.atob(n);if(i){const t=new Uint8Array(s.length);for(let e=0;e<s.length;e++)t[e]=s.charCodeAt(e);s=new TextDecoder(i).decode(t)}const r=document.getElementById("html-body"),a=(null==r?void 0:r.contentWindow)&&r.contentWindow;if(!a)return;const o=a.document;o.open(),o.write(`${s}`),o.close()}),[t]),R.jsx(Rl,{id:"html-renderer",children:R.jsx(Tl,{id:"html-body",sandbox:"allow-same-origin"})}));Pl.fileTypes=["htm","html","text/htm","text/html"],Pl.weight=0,Pl.fileLoader=ul;const Rl=so.div`
|
|
157
157
|
display: flex;
|
|
158
158
|
flex-direction: column;
|
|
159
159
|
width: 100%;
|
|
@@ -163,13 +163,13 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
163
163
|
padding: 15px;
|
|
164
164
|
margin: 20px 0 20px 0;
|
|
165
165
|
border: 1px solid ${t=>t.theme.secondary};
|
|
166
|
-
`,Ll=t=>
|
|
166
|
+
`,Ll=t=>R.jsx(kl,{...t});Ll.fileTypes=["jpg","jpeg","image/jpg","image/jpeg"],Ll.weight=0;const Il=({mainState:{currentDocument:t}})=>t?R.jsx(Fl,{id:"msdoc-renderer",children:R.jsx(Nl,{id:"msdoc-iframe",title:"msdoc-iframe",src:`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(t.uri)}`,frameBorder:"0"})}):null,Dl={odt:["odt","application/vnd.oasis.opendocument.text"],doc:["doc","application/msword"],docx:["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/octet-stream"],xls:["xls","application/vnd.ms-excel"],xlsx:["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],ppt:["ppt","application/vnd.ms-powerpoint"],pptx:["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"]};Il.fileTypes=[...Dl.odt,...Dl.doc,...Dl.docx,...Dl.xls,...Dl.xlsx,...Dl.ppt,...Dl.pptx],Il.weight=0,Il.fileLoader=({fileLoaderComplete:t})=>t();const Fl=so.div`
|
|
167
167
|
width: 100%;
|
|
168
168
|
`,Nl=so.iframe`
|
|
169
169
|
width: 100%;
|
|
170
170
|
height: 100%;
|
|
171
171
|
border: 0;
|
|
172
|
-
`;var Ol={d:(t,e)=>{for(var i in e)Ol.o(e,i)&&!Ol.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Wl=globalThis.pdfjsLib={};Ol.d(Wl,{AbortException:()=>Yh,AnnotationEditorLayer:()=>lE,AnnotationEditorParamsType:()=>Ql,AnnotationEditorType:()=>Jl,AnnotationEditorUIManager:()=>Jp,AnnotationLayer:()=>Gw,AnnotationMode:()=>Kl,CMapCompressionType:()=>Th,ColorPicker:()=>q_,DOMSVGFactory:()=>ad,DrawLayer:()=>wE,FeatureTest:()=>Zh,GlobalWorkerOptions:()=>cm,ImageKind:()=>ah,InvalidPDFException:()=>Vh,MissingPDFException:()=>Gh,OPS:()=>Lh,Outliner:()=>n_,PDFDataRangeTransport:()=>fy,PDFDateString:()=>yd,PDFWorker:()=>Iy,PasswordResponses:()=>Ih,PermissionFlag:()=>Zl,PixelsPerInch:()=>Mc,RenderingCancelledException:()=>ld,TextLayer:()=>ty,UnexpectedResponseException:()=>qh,Util:()=>rc,VerbosityLevel:()=>Ph,XfaLayer:()=>sb,build:()=>tb,createValidAbsoluteUrl:()=>Bh,fetchData:()=>nd,getDocument:()=>hy,getFilenameFromUrl:()=>dd,getPdfFilenameFromUrl:()=>ud,getXfaPageViewport:()=>bd,isDataScheme:()=>hd,isPdfFile:()=>cd,noContextMenu:()=>gd,normalizeUnicode:()=>lc,renderTextLayer:()=>ey,setLayerDimensions:()=>xd,shadow:()=>$h,updateTextLayer:()=>iy,version:()=>Zy});const jl=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),Bl=[1,0,0,1,0,0],$l=[.001,0,0,.001,0,0],zl=1.35,Hl=1,Ul=2,Vl=4,Gl=16,ql=32,Xl=64,Yl=256,Kl={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Jl={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},Ql={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},Zl={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},th=0,eh=1,ih=2,nh=3,sh=3,rh=4,ah={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},oh=1,lh=2,hh=3,ch=4,dh=5,uh=6,ph=7,fh=8,gh=9,mh=10,vh=11,yh=12,bh=13,wh=14,Ah=15,_h=16,xh=17,Sh=20,kh=1,Eh=2,Ch=3,Mh=4,Rh=5,Ph={ERRORS:0,WARNINGS:1,INFOS:5},Th={NONE:0,BINARY:1},Lh={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},Ih={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Dh=Ph.WARNINGS;function Fh(){return Dh}function Nh(t){Dh>=Ph.INFOS&&console.log(`Info: ${t}`)}function Oh(t){Dh>=Ph.WARNINGS&&console.log(`Warning: ${t}`)}function Wh(t){throw new Error(t)}function jh(t,e){t||Wh(e)}function Bh(t,e=null,i=null){if(!t)return null;try{if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);(null==e?void 0:e.length)>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=function(t){return decodeURIComponent(escape(t))}(t)}catch{}}const n=e?new URL(t,e):new URL(t);if(function(t){switch(null==t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch{}return null}function $h(t,e,i,n=!1){return Object.defineProperty(t,e,{value:i,enumerable:!n,configurable:!0,writable:!1}),i}const zh=function(){function t(e,i){this.constructor===t&&Wh("Cannot initialize BaseException."),this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class Hh extends zh{constructor(t,e){super(t,"PasswordException"),this.code=e}}class Uh extends zh{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Vh extends zh{constructor(t){super(t,"InvalidPDFException")}}class Gh extends zh{constructor(t){super(t,"MissingPDFException")}}class qh extends zh{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class Xh extends zh{constructor(t){super(t,"FormatError")}}class Yh extends zh{constructor(t){super(t,"AbortException")}}function Kh(t){("object"!=typeof t||void 0===(null==t?void 0:t.length))&&Wh("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const n=[];for(let s=0;s<e;s+=i){const r=Math.min(s+i,e),a=t.subarray(s,r);n.push(String.fromCharCode.apply(null,a))}return n.join("")}function Jh(t){"string"!=typeof t&&Wh("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let n=0;n<e;++n)i[n]=255&t.charCodeAt(n);return i}function Qh(t){const e=Object.create(null);for(const[i,n]of t)e[i]=n;return e}class Zh{static get isLittleEndian(){return $h(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return $h(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return $h(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&"string"==typeof(null==navigator?void 0:navigator.platform)?$h(this,"platform",{isMac:navigator.platform.includes("Mac")}):$h(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var t,e;return $h(this,"isCSSRoundSupported",null==(e=null==(t=globalThis.CSS)?void 0:t.supports)?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const tc=Array.from(Array(256).keys(),(t=>t.toString(16).padStart(2,"0")));var ec,ic,nc,sc;class rc{static makeHexColor(t,e,i){return`#${tc[t]}${tc[e]}${tc[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){const i=this.applyTransform(t,e),n=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),r=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],n[0],s[0],r[0]),Math.min(i[1],n[1],s[1],r[1]),Math.max(i[0],n[0],s[0],r[0]),Math.max(i[1],n[1],s[1],r[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],n=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],r=t[2]*e[1]+t[3]*e[3],a=(i+r)/2,o=Math.sqrt((i+r)**2-4*(i*r-s*n))/2,l=a+o||1,h=a-o||1;return[Math.sqrt(l),Math.sqrt(h)]}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>n)return null;const s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),r=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>r?null:[i,s,n,r]}static bezierBoundingBox(t,e,i,n,s,r,a,l,h){return h?(h[0]=Math.min(h[0],t,a),h[1]=Math.min(h[1],e,l),h[2]=Math.max(h[2],t,a),h[3]=Math.max(h[3],e,l)):h=[Math.min(t,a),Math.min(e,l),Math.max(t,a),Math.max(e,l)],o(this,nc,sc).call(this,t,i,s,a,e,n,r,l,3*(3*(i-s)-t+a),6*(t-2*i+s),3*(i-t),h),o(this,nc,sc).call(this,t,i,s,a,e,n,r,l,3*(3*(n-r)-e+l),6*(e-2*n+r),3*(n-e),h),h}}ec=new WeakSet,ic=function(t,e,i,n,s,r,a,o,l,h){if(l<=0||l>=1)return;const c=1-l,d=l*l,u=d*l,p=c*(c*(c*t+3*l*e)+3*d*i)+u*n,f=c*(c*(c*s+3*l*r)+3*d*a)+u*o;h[0]=Math.min(h[0],p),h[1]=Math.min(h[1],f),h[2]=Math.max(h[2],p),h[3]=Math.max(h[3],f)},nc=new WeakSet,sc=function(t,e,i,n,s,r,a,l,h,c,d,u){if(Math.abs(h)<1e-12)return void(Math.abs(c)>=1e-12&&o(this,ec,ic).call(this,t,e,i,n,s,r,a,l,-d/c,u));const p=c**2-4*d*h;if(p<0)return;const f=Math.sqrt(p),g=2*h;o(this,ec,ic).call(this,t,e,i,n,s,r,a,l,(-c+f)/g,u),o(this,ec,ic).call(this,t,e,i,n,s,r,a,l,(-c-f)/g,u)},s(rc,ec),s(rc,nc);let ac=null,oc=null;function lc(t){return ac||(ac=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,oc=new Map([["ſt","ſt"]])),t.replaceAll(ac,((t,e,i)=>e?e.normalize("NFKC"):oc.get(i)))}const hc="pdfjs_internal_id_",cc=0,dc=1,uc=2,pc=3,fc=4,gc=5,mc=6,vc=7,yc=8;class bc{constructor(){this.constructor===bc&&Wh("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,n,s){return"none"}destroy(t=!1){}}var wc;const Ac=class{constructor({enableHWA:t=!1}={}){s(this,wc,!1),this.constructor===Ac&&Wh("Cannot initialize BaseCanvasFactory."),r(this,wc,t)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!n(this,wc)})}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){Wh("Abstract method `_createCanvas` called.")}};let _c=Ac;wc=new WeakMap;class xc{constructor({baseUrl:t=null,isCompressed:e=!0}){this.constructor===xc&&Wh("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":""),i=this.isCompressed?Th.BINARY:Th.NONE;return this._fetchData(e,i).catch((t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)}))}_fetchData(t,e){Wh("Abstract method `_fetchData` called.")}}class Sc{constructor({baseUrl:t=null}){this.constructor===Sc&&Wh("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetchData(e).catch((t=>{throw new Error(`Unable to load font data at: ${e}`)}))}_fetchData(t){Wh("Abstract method `_fetchData` called.")}}class kc{constructor(){this.constructor===kc&&Wh("Cannot initialize BaseSVGFactory.")}create(t,e,i=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width",`${t}px`),n.setAttribute("height",`${e}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${t} ${e}`),n}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Wh("Abstract method `_createSVG` called.")}}const Ec="http://www.w3.org/2000/svg",Cc=class{};let Mc=Cc;var Rc,Pc,Tc,Lc,Ic,Dc,Fc,Nc,Oc,Wc,jc,Bc,$c,zc,Hc,Uc,Vc,Gc,qc,Xc,Yc,Kc,Jc,Qc,Zc,td,ed,id;e(Mc,"CSS",96),e(Mc,"PDF",72),e(Mc,"PDF_TO_CSS_UNITS",Cc.CSS/Cc.PDF);Rc=new WeakMap,Pc=new WeakMap,Tc=new WeakMap,Lc=new WeakMap,Ic=new WeakMap,Dc=new WeakMap,Fc=new WeakSet,Nc=function(){return n(this,Rc)||r(this,Rc,new Map)},Oc=new WeakSet,Wc=function(){return n(this,Ic)||r(this,Ic,new Map)},jc=new WeakSet,Bc=function(){if(!n(this,Pc)){const t=n(this,Lc).createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const i=n(this,Lc).createElementNS(Ec,"svg");i.setAttribute("width",0),i.setAttribute("height",0),r(this,Pc,n(this,Lc).createElementNS(Ec,"defs")),t.append(i),i.append(n(this,Pc)),n(this,Lc).body.append(t)}return n(this,Pc)},$c=new WeakSet,zc=function(t){if(1===t.length){const e=t[0],i=new Array(256);for(let t=0;t<256;t++)i[t]=e[t]/255;const n=i.join(",");return[n,n,n]}const[e,i,n]=t,s=new Array(256),r=new Array(256),a=new Array(256);for(let t=0;t<256;t++)s[t]=e[t]/255,r[t]=i[t]/255,a[t]=n[t]/255;return[s.join(","),r.join(","),a.join(",")]},Hc=new WeakSet,Uc=function(t){const e=n(this,Lc).createElementNS(Ec,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)},Vc=new WeakSet,Gc=function(t){const e=n(this,Lc).createElementNS(Ec,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)},qc=new WeakSet,Xc=function(t){const e=n(this,Lc).createElementNS(Ec,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),n(this,jc,Bc).append(e),e},Yc=new WeakSet,Kc=function(t,e,i){const s=n(this,Lc).createElementNS(Ec,e);s.setAttribute("type","discrete"),s.setAttribute("tableValues",i),t.append(s)},Jc=new WeakSet,Qc=function(t,e,i,s){const r=n(this,Lc).createElementNS(Ec,"feComponentTransfer");s.append(r),o(this,Yc,Kc).call(this,r,"feFuncR",t),o(this,Yc,Kc).call(this,r,"feFuncG",e),o(this,Yc,Kc).call(this,r,"feFuncB",i)},Zc=new WeakSet,td=function(t,e){const i=n(this,Lc).createElementNS(Ec,"feComponentTransfer");e.append(i),o(this,Yc,Kc).call(this,i,"feFuncA",t)},ed=new WeakSet,id=function(t){return n(this,jc,Bc).style.color=t,wd(getComputedStyle(n(this,jc,Bc)).getPropertyValue("color"))};async function nd(t,e="text"){if(fd(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise(((i,n)=>{const s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType=e,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(200===s.status||0===s.status){switch(e){case"arraybuffer":case"blob":case"json":return void i(s.response)}return void i(s.responseText)}n(new Error(s.statusText))}},s.send(null)}))}class sd extends xc{_fetchData(t,e){return nd(t,this.isCompressed?"arraybuffer":"text").then((t=>({cMapData:t instanceof ArrayBuffer?new Uint8Array(t):Jh(t),compressionType:e})))}}class rd extends Sc{_fetchData(t){return nd(t,"arraybuffer").then((t=>new Uint8Array(t)))}}class ad extends kc{_createSVG(t){return document.createElementNS(Ec,t)}}class od{constructor({viewBox:t,scale:e,rotation:i,offsetX:n=0,offsetY:s=0,dontFlip:r=!1}){this.viewBox=t,this.scale=e,this.rotation=i,this.offsetX=n,this.offsetY=s;const a=(t[2]+t[0])/2,o=(t[3]+t[1])/2;let l,h,c,d,u,p,f,g;switch((i%=360)<0&&(i+=360),i){case 180:l=-1,h=0,c=0,d=1;break;case 90:l=0,h=1,c=1,d=0;break;case 270:l=0,h=-1,c=-1,d=0;break;case 0:l=1,h=0,c=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}r&&(c=-c,d=-d),0===l?(u=Math.abs(o-t[1])*e+n,p=Math.abs(a-t[0])*e+s,f=(t[3]-t[1])*e,g=(t[2]-t[0])*e):(u=Math.abs(a-t[0])*e+n,p=Math.abs(o-t[1])*e+s,f=(t[2]-t[0])*e,g=(t[3]-t[1])*e),this.transform=[l*e,h*e,c*e,d*e,u-l*e*a-c*e*o,p-h*e*a-d*e*o],this.width=f,this.height=g}get rawDims(){const{viewBox:t}=this;return $h(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}={}){return new od({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){return rc.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=rc.applyTransform([t[0],t[1]],this.transform),i=rc.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return rc.applyInverseTransform([t,e],this.transform)}}class ld extends zh{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}function hd(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function cd(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function dd(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function ud(t,e="document.pdf"){if("string"!=typeof t)return e;if(hd(t))return Oh('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let s=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(s&&(s=s[0],s.includes("%")))try{s=i.exec(decodeURIComponent(s))[0]}catch{}return s||e}class pd{constructor(){e(this,"started",Object.create(null)),e(this,"times",[])}time(t){t in this.started&&Oh(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||Oh(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:t}of this.times)e=Math.max(t.length,e);for(const{name:i,start:n,end:s}of this.times)t.push(`${i.padEnd(e)} ${s-n}ms\n`);return t.join("")}}function fd(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch{return!1}}function gd(t){t.preventDefault()}function md(t){console.log("Deprecated API usage: "+t)}let vd;class yd{static toDateObject(t){if(!t||"string"!=typeof t)return null;vd||(vd=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=vd.exec(t);if(!e)return null;const i=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let r=parseInt(e[4],10);r=r>=0&&r<=23?r:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let c=parseInt(e[9],10)||0;return c=c>=0&&c<=59?c:0,"-"===l?(r+=h,a+=c):"+"===l&&(r-=h,a-=c),new Date(Date.UTC(i,n,s,r,a,o))}}function bd(t,{scale:e=1,rotation:i=0}){const{width:n,height:s}=t.attributes.style,r=[0,0,parseInt(n),parseInt(s)];return new od({viewBox:r,scale:e,rotation:i})}function wd(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map((t=>parseInt(t))):t.startsWith("rgba(")?t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3):(Oh(`Not a valid color format: "${t}"`),[0,0,0])}function Ad(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform();return[e,i,n,s,r,a]}function _d(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform().invertSelf();return[e,i,n,s,r,a]}function xd(t,e,i=!1,n=!0){if(e instanceof od){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:r}=t,a=Zh.isCSSRoundSupported,o=`var(--scale-factor) * ${n}px`,l=`var(--scale-factor) * ${s}px`,h=a?`round(${o}, 1px)`:`calc(${o})`,c=a?`round(${l}, 1px)`:`calc(${l})`;i&&e.rotation%180!=0?(r.width=c,r.height=h):(r.width=h,r.height=c)}n&&t.setAttribute("data-main-rotation",e.rotation)}var Sd,kd,Ed,Cd,Md,Rd,Pd,Td,Ld,Id,Dd,Fd,Nd,Od,Wd,jd;const Bd=class{constructor(t){s(this,Pd),s(this,Ld),s(this,Dd),s(this,Nd),s(this,Wd),s(this,Sd,null),s(this,kd,null),s(this,Ed,void 0),s(this,Cd,null),r(this,Ed,t)}render(){const t=r(this,Sd,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const e=n(this,Ed)._uiManager._signal;t.addEventListener("contextmenu",gd,{signal:e}),t.addEventListener("pointerdown",o(Bd,Md,Rd),{signal:e});const i=r(this,Cd,document.createElement("div"));i.className="buttons",t.append(i);const s=n(this,Ed).toolbarPosition;if(s){const{style:e}=t,i="ltr"===n(this,Ed)._uiManager.direction?1-s[0]:s[0];e.insetInlineEnd=100*i+"%",e.top=`calc(${100*s[1]}% + var(--editor-toolbar-vert-offset))`}return o(this,Nd,Od).call(this),t}hide(){var t;n(this,Sd).classList.add("hidden"),null==(t=n(this,kd))||t.hideDropdown()}show(){n(this,Sd).classList.remove("hidden")}addAltTextButton(t){o(this,Dd,Fd).call(this,t),n(this,Cd).prepend(t,n(this,Wd,jd))}addColorPicker(t){r(this,kd,t);const e=t.renderButton();o(this,Dd,Fd).call(this,e),n(this,Cd).prepend(e,n(this,Wd,jd))}remove(){var t;n(this,Sd).remove(),null==(t=n(this,kd))||t.destroy(),r(this,kd,null)}};let $d=Bd;var zd,Hd,Ud,Vd,Gd,qd,Xd,Yd,Kd,Jd,Qd,Zd,tu,eu,iu;Sd=new WeakMap,kd=new WeakMap,Ed=new WeakMap,Cd=new WeakMap,Md=new WeakSet,Rd=function(t){t.stopPropagation()},Pd=new WeakSet,Td=function(t){n(this,Ed)._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()},Ld=new WeakSet,Id=function(t){n(this,Ed)._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()},Dd=new WeakSet,Fd=function(t){const e=n(this,Ed)._uiManager._signal;t.addEventListener("focusin",o(this,Pd,Td).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",o(this,Ld,Id).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",gd,{signal:e})},Nd=new WeakSet,Od=function(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id",`pdfjs-editor-remove-${n(this,Ed).editorType}-button`),o(this,Dd,Fd).call(this,t),t.addEventListener("click",(t=>{n(this,Ed)._uiManager.delete()}),{signal:n(this,Ed)._uiManager._signal}),n(this,Cd).append(t)},Wd=new WeakSet,jd=function(){const t=document.createElement("div");return t.className="divider",t},s($d,Md);class nu{constructor(t){s(this,Vd),s(this,qd),s(this,Yd),s(this,zd,null),s(this,Hd,null),s(this,Ud,void 0),r(this,Ud,t)}show(t,e,i){const[s,a]=o(this,qd,Xd).call(this,e,i),{style:l}=n(this,Hd)||r(this,Hd,o(this,Vd,Gd).call(this));t.append(n(this,Hd)),l.insetInlineEnd=100*s+"%",l.top=`calc(${100*a}% + var(--editor-toolbar-vert-offset))`}hide(){n(this,Hd).remove()}}function su(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}zd=new WeakMap,Hd=new WeakMap,Ud=new WeakMap,Vd=new WeakSet,Gd=function(){const t=r(this,Hd,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",gd,{signal:n(this,Ud)._signal});const e=r(this,zd,document.createElement("div"));return e.className="buttons",t.append(e),o(this,Yd,Kd).call(this),t},qd=new WeakSet,Xd=function(t,e){let i=0,n=0;for(const s of t){const t=s.y+s.height;if(t<i)continue;const r=s.x+(e?s.width:0);t>i?(n=r,i=t):e?r>n&&(n=r):r<n&&(n=r)}return[e?1-n:n,i]},Yd=new WeakSet,Kd=function(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=n(this,Ud)._signal;t.addEventListener("contextmenu",gd,{signal:i}),t.addEventListener("click",(()=>{n(this,Ud).highlightSelection("floating_button")}),{signal:i}),n(this,zd).append(t)};class ru{constructor(){s(this,Jd,0)}get id(){return"pdfjs_internal_editor_"+a(this,Jd)._++}}Jd=new WeakMap;const au=class{constructor(){s(this,eu),s(this,Qd,function(){if(typeof crypto<"u"&&"function"==typeof(null==crypto?void 0:crypto.randomUUID))return crypto.randomUUID();const t=new Uint8Array(32);if(typeof crypto<"u"&&"function"==typeof(null==crypto?void 0:crypto.getRandomValues))crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(255*Math.random());return Kh(t)}()),s(this,Zd,0),s(this,tu,null)}static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;e.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';return $h(this,"_isSVGFittingCanvas",e.decode().then((()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]))))}async getFromFile(t){const{lastModified:e,name:i,size:n,type:s}=t;return o(this,eu,iu).call(this,`${e}_${i}_${n}_${s}`,t)}async getFromUrl(t){return o(this,eu,iu).call(this,t,t)}async getFromId(t){n(this,tu)||r(this,tu,new Map);const e=n(this,tu).get(t);return e?e.bitmap?(e.refCounter+=1,e):e.file?this.getFromFile(e.file):this.getFromUrl(e.url):null}getSvgUrl(t){const e=n(this,tu).get(t);return null!=e&&e.isSvg?e.svgUrl:null}deleteId(t){n(this,tu)||r(this,tu,new Map);const e=n(this,tu).get(t);e&&(e.refCounter-=1,0===e.refCounter&&(e.bitmap=null))}isValidId(t){return t.startsWith(`image_${n(this,Qd)}_`)}};let ou=au;var lu,hu,cu,du,uu,pu;Qd=new WeakMap,Zd=new WeakMap,tu=new WeakMap,eu=new WeakSet,iu=async function(t,e){n(this,tu)||r(this,tu,new Map);let i=n(this,tu).get(t);if(null===i)return null;if(null!=i&&i.bitmap)return i.refCounter+=1,i;try{let t;if(i||(i={bitmap:null,id:`image_${n(this,Qd)}_${a(this,Zd)._++}`,refCounter:0,isSvg:!1}),"string"==typeof e?(i.url=e,t=await nd(e,"blob")):t=i.file=e,"image/svg+xml"===t.type){const e=au._isSVGFittingCanvas,n=new FileReader,s=new Image,r=new Promise(((t,r)=>{s.onload=()=>{i.bitmap=s,i.isSvg=!0,t()},n.onload=async()=>{const t=i.svgUrl=n.result;s.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t},s.onerror=n.onerror=r}));n.readAsDataURL(t),await r}else i.bitmap=await createImageBitmap(t);i.refCounter=1}catch(t){console.error(t),i=null}return n(this,tu).set(t,i),i&&n(this,tu).set(i.id,i),i};class fu{constructor(t=128){s(this,lu,[]),s(this,hu,!1),s(this,cu,void 0),s(this,du,-1),r(this,cu,t)}add({cmd:t,undo:e,post:i,mustExec:s,type:a=NaN,overwriteIfSameType:o=!1,keepUndo:l=!1}){if(s&&t(),n(this,hu))return;const h={cmd:t,undo:e,post:i,type:a};if(-1===n(this,du))return n(this,lu).length>0&&(n(this,lu).length=0),r(this,du,0),void n(this,lu).push(h);if(o&&n(this,lu)[n(this,du)].type===a)return l&&(h.undo=n(this,lu)[n(this,du)].undo),void(n(this,lu)[n(this,du)]=h);const c=n(this,du)+1;c===n(this,cu)?n(this,lu).splice(0,1):(r(this,du,c),c<n(this,lu).length&&n(this,lu).splice(c)),n(this,lu).push(h)}undo(){if(-1===n(this,du))return;r(this,hu,!0);const{undo:t,post:e}=n(this,lu)[n(this,du)];t(),null==e||e(),r(this,hu,!1),r(this,du,n(this,du)-1)}redo(){if(n(this,du)<n(this,lu).length-1){r(this,du,n(this,du)+1),r(this,hu,!0);const{cmd:t,post:e}=n(this,lu)[n(this,du)];t(),null==e||e(),r(this,hu,!1)}}hasSomethingToUndo(){return-1!==n(this,du)}hasSomethingToRedo(){return n(this,du)<n(this,lu).length-1}destroy(){r(this,lu,null)}}lu=new WeakMap,hu=new WeakMap,cu=new WeakMap,du=new WeakMap;class gu{constructor(t){s(this,uu),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=Zh.platform;for(const[i,n,s={}]of t)for(const t of i){const i=t.startsWith("mac+");e&&i?(this.callbacks.set(t.slice(4),{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1))):!e&&!i&&(this.callbacks.set(t,{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(o(this,uu,pu).call(this,e));if(!i)return;const{callback:n,options:{bubbles:s=!1,args:r=[],checker:a=null}}=i;a&&!a(t,e)||(n.bind(t,...r,e)(),s||(e.stopPropagation(),e.preventDefault()))}}uu=new WeakSet,pu=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e};const mu=class{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,wd(n))}e.remove()}(t),$h(this,"_colors",t)}convert(t){const e=wd(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[t,i]of this._colors)if(i.every(((t,i)=>t===e[i])))return mu._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?rc.makeHexColor(...e):t}};let vu=mu;var yu,bu,wu,Au,_u,xu,Su,ku,Eu,Cu,Mu,Ru,Pu,Tu,Lu,Iu,Du,Fu,Nu,Ou,Wu,ju,Bu,$u,zu,Hu,Uu,Vu,Gu,qu,Xu,Yu,Ku,Ju,Qu,Zu,tp,ep,ip,np,sp,rp,ap,op,lp,hp,cp,dp,up,pp,fp,gp,mp,vp,yp,bp,wp,Ap,_p,xp,Sp,kp,Ep,Cp,Mp,Rp,Pp,Tp,Lp,Ip,Dp,Fp,Np,Op,Wp,jp,Bp,$p,zp,Hp,Up,Vp,Gp,qp,Xp,Yp;e(vu,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));const Kp=class{constructor(t,e,i,a,l,h,c,d,u){s(this,cp),s(this,up),s(this,fp),s(this,mp),s(this,yp),s(this,wp),s(this,_p),s(this,Sp),s(this,Ep),s(this,Mp),s(this,Pp),s(this,Lp),s(this,Dp),s(this,Np),s(this,Wp),s(this,Bp),s(this,zp),s(this,Up),s(this,Gp),s(this,Xp),s(this,yu,new AbortController),s(this,bu,null),s(this,wu,new Map),s(this,Au,new Map),s(this,_u,null),s(this,xu,null),s(this,Su,null),s(this,ku,new fu),s(this,Eu,0),s(this,Cu,new Set),s(this,Mu,null),s(this,Ru,null),s(this,Pu,new Set),s(this,Tu,!1),s(this,Lu,null),s(this,Iu,null),s(this,Du,null),s(this,Fu,!1),s(this,Nu,null),s(this,Ou,new ru),s(this,Wu,!1),s(this,ju,!1),s(this,Bu,null),s(this,$u,null),s(this,zu,null),s(this,Hu,Jl.NONE),s(this,Uu,new Set),s(this,Vu,null),s(this,Gu,null),s(this,qu,null),s(this,Xu,this.blur.bind(this)),s(this,Yu,this.focus.bind(this)),s(this,Ku,this.copy.bind(this)),s(this,Ju,this.cut.bind(this)),s(this,Qu,this.paste.bind(this)),s(this,Zu,this.keydown.bind(this)),s(this,tp,this.keyup.bind(this)),s(this,ep,this.onEditingAction.bind(this)),s(this,ip,this.onPageChanging.bind(this)),s(this,np,this.onScaleChanging.bind(this)),s(this,sp,this.onRotationChanging.bind(this)),s(this,rp,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),s(this,ap,[0,0]),s(this,op,null),s(this,lp,null),s(this,hp,null),this._signal=n(this,yu).signal,r(this,lp,t),r(this,hp,e),r(this,_u,i),this._eventBus=a,this._eventBus._on("editingaction",n(this,ep)),this._eventBus._on("pagechanging",n(this,ip)),this._eventBus._on("scalechanging",n(this,np)),this._eventBus._on("rotationchanging",n(this,sp)),o(this,yp,bp).call(this),o(this,Lp,Ip).call(this),o(this,Sp,kp).call(this),r(this,xu,l.annotationStorage),r(this,Lu,l.filterFactory),r(this,Gu,h),r(this,Du,c||null),r(this,Tu,d),r(this,zu,u||null),this.viewParameters={realScale:Mc.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}static get _keyboardManager(){const t=Kp.prototype,e=t=>n(t,lp).contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),i=(t,{target:e})=>{if(e instanceof HTMLInputElement){const{type:t}=e;return"text"!==t&&"number"!==t}return!0},s=this.TRANSLATE_SMALL,r=this.TRANSLATE_BIG;return $h(this,"_keyboardManager",new gu([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&n(t,lp).contains(e)&&!t.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&n(t,lp).contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:e}]]))}destroy(){var t,e,i;null==(t=n(this,yu))||t.abort(),r(this,yu,null),this._signal=null,this._eventBus._off("editingaction",n(this,ep)),this._eventBus._off("pagechanging",n(this,ip)),this._eventBus._off("scalechanging",n(this,np)),this._eventBus._off("rotationchanging",n(this,sp));for(const t of n(this,Au).values())t.destroy();n(this,Au).clear(),n(this,wu).clear(),n(this,Pu).clear(),r(this,bu,null),n(this,Uu).clear(),n(this,ku).destroy(),null==(e=n(this,_u))||e.destroy(),null==(i=n(this,Nu))||i.hide(),r(this,Nu,null),n(this,Iu)&&(clearTimeout(n(this,Iu)),r(this,Iu,null)),n(this,op)&&(clearTimeout(n(this,op)),r(this,op,null))}async mlGuess(t){var e;return(null==(e=n(this,zu))?void 0:e.guess(t))||null}get hasMLManager(){return!!n(this,zu)}get hcmFilter(){return $h(this,"hcmFilter",n(this,Gu)?n(this,Lu).addHCMFilter(n(this,Gu).foreground,n(this,Gu).background):"none")}get direction(){return $h(this,"direction",getComputedStyle(n(this,lp)).direction)}get highlightColors(){return $h(this,"highlightColors",n(this,Du)?new Map(n(this,Du).split(",").map((t=>t.split("=").map((t=>t.trim()))))):null)}get highlightColorNames(){return $h(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,(t=>t.reverse()))):null)}setMainHighlightColorPicker(t){r(this,$u,t)}editAltText(t){var e;null==(e=n(this,_u))||e.editAltText(this,t)}onPageChanging({pageNumber:t}){r(this,Eu,t-1)}focusMainContainer(){n(this,lp).focus()}findParent(t,e){for(const i of n(this,Au).values()){const{x:n,y:s,width:r,height:a}=i.div.getBoundingClientRect();if(t>=n&&t<=n+r&&e>=s&&e<=s+a)return i}return null}disableUserSelect(t=!1){n(this,hp).classList.toggle("noUserSelect",t)}addShouldRescale(t){n(this,Pu).add(t)}removeShouldRescale(t){n(this,Pu).delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*Mc.PDF_TO_CSS_UNITS;for(const t of n(this,Pu))t.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t=""){const e=document.getSelection();if(!e||e.isCollapsed)return;const{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:a}=e,l=e.toString(),h=o(this,cp,dp).call(this,e).closest(".textLayer"),c=this.getSelectionBoxes(h);if(c){e.empty(),n(this,Hu)===Jl.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:Jl.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const e of n(this,Au).values())if(e.hasTextLayer(h)){e.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:c,anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:a,text:l});break}}}addToAnnotationStorage(t){!t.isEmpty()&&n(this,xu)&&!n(this,xu).has(t.id)&&n(this,xu).setValue(t.id,t)}blur(){if(this.isShiftKeyDown=!1,n(this,Fu)&&(r(this,Fu,!1),o(this,mp,vp).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of n(this,Uu))if(e.div.contains(t)){r(this,Bu,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!n(this,Bu))return;const[t,e]=n(this,Bu);r(this,Bu,null),e.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:this._signal}),e.focus()}addEditListeners(){o(this,Sp,kp).call(this),o(this,Mp,Rp).call(this)}removeEditListeners(){o(this,Ep,Cp).call(this),o(this,Pp,Tp).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of n(this,Ru))if(i.isHandlingMimeForPasting(e))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const e of t.dataTransfer.items)for(const i of n(this,Ru))if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){var e;if(t.preventDefault(),null==(e=n(this,bu))||e.commitOrRemove(),!this.hasSelection)return;const i=[];for(const t of n(this,Uu)){const e=t.serialize(!0);e&&i.push(e)}0!==i.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:e}=t;for(const t of e.items)for(const e of n(this,Ru))if(e.isHandlingMimeForPasting(t.type))return void e.paste(t,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(t){return void Oh(`paste: "${t.message}".`)}if(!Array.isArray(i))return;this.unselectAll();const s=this.currentLayer;try{const t=[];for(const e of i){const i=s.deserialize(e);if(!i)return;t.push(i)}const e=()=>{for(const e of t)o(this,zp,Hp).call(this,e);o(this,Xp,Yp).call(this,t)},n=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:n,mustExec:!0})}catch(t){Oh(`paste: "${t.message}".`)}}keydown(t){!this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!0),n(this,Hu)!==Jl.NONE&&!this.isEditorHandlingKeyboard&&Kp._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,n(this,Fu)&&(r(this,Fu,!1),o(this,mp,vp).call(this,"main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu")}}setEditingState(t){t?(o(this,wp,Ap).call(this),o(this,Mp,Rp).call(this),o(this,Dp,Fp).call(this,{isEditing:n(this,Hu)!==Jl.NONE,isEmpty:o(this,Gp,qp).call(this),hasSomethingToUndo:n(this,ku).hasSomethingToUndo(),hasSomethingToRedo:n(this,ku).hasSomethingToRedo(),hasSelectedEditor:!1})):(o(this,_p,xp).call(this),o(this,Pp,Tp).call(this),o(this,Dp,Fp).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!n(this,Ru)){r(this,Ru,t);for(const t of n(this,Ru))o(this,Np,Op).call(this,t.defaultPropertiesToUpdate)}}getId(){return n(this,Ou).id}get currentLayer(){return n(this,Au).get(n(this,Eu))}getLayer(t){return n(this,Au).get(t)}get currentPageIndex(){return n(this,Eu)}addLayer(t){n(this,Au).set(t.pageIndex,t),n(this,Wu)?t.enable():t.disable()}removeLayer(t){n(this,Au).delete(t.pageIndex)}updateMode(t,e=null,i=!1){if(n(this,Hu)!==t){if(r(this,Hu,t),t===Jl.NONE)return this.setEditingState(!1),void o(this,Bp,$p).call(this);this.setEditingState(!0),o(this,Wp,jp).call(this),this.unselectAll();for(const e of n(this,Au).values())e.updateMode(t);if(!e&&i)return void this.addNewEditorFromKeyboard();if(e)for(const t of n(this,wu).values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==n(this,Hu)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){var i;if(n(this,Ru)){switch(t){case Ql.CREATE:return void this.currentLayer.addNewEditor();case Ql.HIGHLIGHT_DEFAULT_COLOR:null==(i=n(this,$u))||i.updateColor(e);break;case Ql.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(n(this,qu)||r(this,qu,new Map)).set(t,e),this.showAllEditors("highlight",e)}for(const i of n(this,Uu))i.updateParams(t,e);for(const i of n(this,Ru))i.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){var s;for(const i of n(this,wu).values())i.editorType===t&&i.show(e);((null==(s=n(this,qu))?void 0:s.get(Ql.HIGHLIGHT_SHOW_ALL))??!0)!==e&&o(this,Np,Op).call(this,[[Ql.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(n(this,ju)!==t){r(this,ju,t);for(const e of n(this,Au).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}getEditors(t){const e=[];for(const i of n(this,wu).values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return n(this,wu).get(t)}addEditor(t){n(this,wu).set(t.id,t)}removeEditor(t){var e;t.div.contains(document.activeElement)&&(n(this,Iu)&&clearTimeout(n(this,Iu)),r(this,Iu,setTimeout((()=>{this.focusMainContainer(),r(this,Iu,null)}),0))),n(this,wu).delete(t.id),this.unselect(t),(!t.annotationElementId||!n(this,Cu).has(t.annotationElementId))&&(null==(e=n(this,xu))||e.remove(t.id))}addDeletedAnnotationElement(t){n(this,Cu).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return n(this,Cu).has(t)}removeDeletedAnnotationElement(t){n(this,Cu).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){n(this,bu)!==t&&(r(this,bu,t),t&&o(this,Np,Op).call(this,t.propertiesToUpdate))}updateUI(t){n(this,Up,Vp)===t&&o(this,Np,Op).call(this,t.propertiesToUpdate)}toggleSelected(t){if(n(this,Uu).has(t))return n(this,Uu).delete(t),t.unselect(),void o(this,Dp,Fp).call(this,{hasSelectedEditor:this.hasSelection});n(this,Uu).add(t),t.select(),o(this,Np,Op).call(this,t.propertiesToUpdate),o(this,Dp,Fp).call(this,{hasSelectedEditor:!0})}setSelected(t){for(const e of n(this,Uu))e!==t&&e.unselect();n(this,Uu).clear(),n(this,Uu).add(t),t.select(),o(this,Np,Op).call(this,t.propertiesToUpdate),o(this,Dp,Fp).call(this,{hasSelectedEditor:!0})}isSelected(t){return n(this,Uu).has(t)}get firstSelectedEditor(){return n(this,Uu).values().next().value}unselect(t){t.unselect(),n(this,Uu).delete(t),o(this,Dp,Fp).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==n(this,Uu).size}get isEnterHandled(){return 1===n(this,Uu).size&&this.firstSelectedEditor.isEnterHandled}undo(){n(this,ku).undo(),o(this,Dp,Fp).call(this,{hasSomethingToUndo:n(this,ku).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:o(this,Gp,qp).call(this)})}redo(){n(this,ku).redo(),o(this,Dp,Fp).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:n(this,ku).hasSomethingToRedo(),isEmpty:o(this,Gp,qp).call(this)})}addCommands(t){n(this,ku).add(t),o(this,Dp,Fp).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:o(this,Gp,qp).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...n(this,Uu)];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)o(this,zp,Hp).call(this,e)},mustExec:!0})}commitOrRemove(){var t;null==(t=n(this,bu))||t.commitOrRemove()}hasSomethingToControl(){return n(this,bu)||this.hasSelection}selectAll(){for(const t of n(this,Uu))t.commit();o(this,Xp,Yp).call(this,n(this,wu).values())}unselectAll(){if((!n(this,bu)||(n(this,bu).commitOrRemove(),n(this,Hu)===Jl.NONE))&&this.hasSelection){for(const t of n(this,Uu))t.unselect();n(this,Uu).clear(),o(this,Dp,Fp).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;n(this,ap)[0]+=t,n(this,ap)[1]+=e;const[s,a]=n(this,ap),o=[...n(this,Uu)];n(this,op)&&clearTimeout(n(this,op)),r(this,op,setTimeout((()=>{r(this,op,null),n(this,ap)[0]=n(this,ap)[1]=0,this.addCommands({cmd:()=>{for(const t of o)n(this,wu).has(t.id)&&t.translateInPage(s,a)},undo:()=>{for(const t of o)n(this,wu).has(t.id)&&t.translateInPage(-s,-a)},mustExec:!1})}),1e3));for(const i of o)i.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),r(this,Mu,new Map);for(const t of n(this,Uu))n(this,Mu).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!n(this,Mu))return!1;this.disableUserSelect(!1);const t=n(this,Mu);r(this,Mu,null);let e=!1;for(const[{x:i,y:n,pageIndex:s},r]of t)r.newX=i,r.newY=n,r.newPageIndex=s,e||(e=i!==r.savedX||n!==r.savedY||s!==r.savedPageIndex);if(!e)return!1;const i=(t,e,i,s)=>{if(n(this,wu).has(t.id)){const r=n(this,Au).get(s);r?t._setParentAndPosition(r,e,i):(t.pageIndex=s,t.x=e,t.y=i)}};return this.addCommands({cmd:()=>{for(const[e,{newX:n,newY:s,newPageIndex:r}]of t)i(e,n,s,r)},undo:()=>{for(const[e,{savedX:n,savedY:s,savedPageIndex:r}]of t)i(e,n,s,r)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(n(this,Mu))for(const i of n(this,Mu).keys())i.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){var t;return(null==(t=this.getActive())?void 0:t.shouldGetKeyboardEvents())||1===n(this,Uu).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return n(this,bu)===t}getActive(){return n(this,bu)}getMode(){return n(this,Hu)}get imageManager(){return $h(this,"imageManager",new ou)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let i=0,n=e.rangeCount;i<n;i++)if(!t.contains(e.getRangeAt(i).commonAncestorContainer))return null;const{x:i,y:n,width:s,height:r}=t.getBoundingClientRect();let a;switch(t.getAttribute("data-main-rotation")){case"90":a=(t,e,a,o)=>({x:(e-n)/r,y:1-(t+a-i)/s,width:o/r,height:a/s});break;case"180":a=(t,e,a,o)=>({x:1-(t+a-i)/s,y:1-(e+o-n)/r,width:a/s,height:o/r});break;case"270":a=(t,e,a,o)=>({x:1-(e+o-n)/r,y:(t-i)/s,width:o/r,height:a/s});break;default:a=(t,e,a,o)=>({x:(t-i)/s,y:(e-n)/r,width:a/s,height:o/r})}const o=[];for(let t=0,i=e.rangeCount;t<i;t++){const i=e.getRangeAt(t);if(!i.collapsed)for(const{x:t,y:e,width:n,height:s}of i.getClientRects())0===n||0===s||o.push(a(t,e,n,s))}return 0===o.length?null:o}addChangedExistingAnnotation({annotationElementId:t,id:e}){(n(this,Su)||r(this,Su,new Map)).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){var e;null==(e=n(this,Su))||e.delete(t)}renderAnnotationElement(t){var e;const i=null==(e=n(this,Su))?void 0:e.get(t.data.id);if(!i)return;const s=n(this,xu).getRawValue(i);s&&(n(this,Hu)===Jl.NONE&&!s.hasBeenModified||s.renderAnnotationElement(t))}};let Jp=Kp;var Qp,Zp,tf,ef,nf,sf,rf,af,of;yu=new WeakMap,bu=new WeakMap,wu=new WeakMap,Au=new WeakMap,_u=new WeakMap,xu=new WeakMap,Su=new WeakMap,ku=new WeakMap,Eu=new WeakMap,Cu=new WeakMap,Mu=new WeakMap,Ru=new WeakMap,Pu=new WeakMap,Tu=new WeakMap,Lu=new WeakMap,Iu=new WeakMap,Du=new WeakMap,Fu=new WeakMap,Nu=new WeakMap,Ou=new WeakMap,Wu=new WeakMap,ju=new WeakMap,Bu=new WeakMap,$u=new WeakMap,zu=new WeakMap,Hu=new WeakMap,Uu=new WeakMap,Vu=new WeakMap,Gu=new WeakMap,qu=new WeakMap,Xu=new WeakMap,Yu=new WeakMap,Ku=new WeakMap,Ju=new WeakMap,Qu=new WeakMap,Zu=new WeakMap,tp=new WeakMap,ep=new WeakMap,ip=new WeakMap,np=new WeakMap,sp=new WeakMap,rp=new WeakMap,ap=new WeakMap,op=new WeakMap,lp=new WeakMap,hp=new WeakMap,cp=new WeakSet,dp=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},up=new WeakSet,pp=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=o(this,cp,dp).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(n(this,Nu)||r(this,Nu,new nu(this)),n(this,Nu).show(e,i,"ltr"===this.direction))},fp=new WeakSet,gp=function(){var t,e,i;const s=document.getSelection();if(!s||s.isCollapsed)return void(n(this,Vu)&&(null==(t=n(this,Nu))||t.hide(),r(this,Vu,null),o(this,Dp,Fp).call(this,{hasSelectedText:!1})));const{anchorNode:a}=s;if(a!==n(this,Vu))if(o(this,cp,dp).call(this,s).closest(".textLayer")){if(null==(i=n(this,Nu))||i.hide(),r(this,Vu,a),o(this,Dp,Fp).call(this,{hasSelectedText:!0}),(n(this,Hu)===Jl.HIGHLIGHT||n(this,Hu)===Jl.NONE)&&(n(this,Hu)===Jl.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),r(this,Fu,this.isShiftKeyDown),!this.isShiftKeyDown)){const t=this._signal,e=t=>{"pointerup"===t.type&&0!==t.button||(window.removeEventListener("pointerup",e),window.removeEventListener("blur",e),"pointerup"===t.type&&o(this,mp,vp).call(this,"main_toolbar"))};window.addEventListener("pointerup",e,{signal:t}),window.addEventListener("blur",e,{signal:t})}}else n(this,Vu)&&(null==(e=n(this,Nu))||e.hide(),r(this,Vu,null),o(this,Dp,Fp).call(this,{hasSelectedText:!1}))},mp=new WeakSet,vp=function(t=""){n(this,Hu)===Jl.HIGHLIGHT?this.highlightSelection(t):n(this,Tu)&&o(this,up,pp).call(this)},yp=new WeakSet,bp=function(){document.addEventListener("selectionchange",o(this,fp,gp).bind(this),{signal:this._signal})},wp=new WeakSet,Ap=function(){const t=this._signal;window.addEventListener("focus",n(this,Yu),{signal:t}),window.addEventListener("blur",n(this,Xu),{signal:t})},_p=new WeakSet,xp=function(){window.removeEventListener("focus",n(this,Yu)),window.removeEventListener("blur",n(this,Xu))},Sp=new WeakSet,kp=function(){const t=this._signal;window.addEventListener("keydown",n(this,Zu),{signal:t}),window.addEventListener("keyup",n(this,tp),{signal:t})},Ep=new WeakSet,Cp=function(){window.removeEventListener("keydown",n(this,Zu)),window.removeEventListener("keyup",n(this,tp))},Mp=new WeakSet,Rp=function(){const t=this._signal;document.addEventListener("copy",n(this,Ku),{signal:t}),document.addEventListener("cut",n(this,Ju),{signal:t}),document.addEventListener("paste",n(this,Qu),{signal:t})},Pp=new WeakSet,Tp=function(){document.removeEventListener("copy",n(this,Ku)),document.removeEventListener("cut",n(this,Ju)),document.removeEventListener("paste",n(this,Qu))},Lp=new WeakSet,Ip=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},Dp=new WeakSet,Fp=function(t){Object.entries(t).some((([t,e])=>n(this,rp)[t]!==e))&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(n(this,rp),t)}),n(this,Hu)===Jl.HIGHLIGHT&&!1===t.hasSelectedEditor&&o(this,Np,Op).call(this,[[Ql.HIGHLIGHT_FREE,!0]]))},Np=new WeakSet,Op=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},Wp=new WeakSet,jp=function(){if(!n(this,Wu)){r(this,Wu,!0);for(const t of n(this,Au).values())t.enable();for(const t of n(this,wu).values())t.enable()}},Bp=new WeakSet,$p=function(){if(this.unselectAll(),n(this,Wu)){r(this,Wu,!1);for(const t of n(this,Au).values())t.disable();for(const t of n(this,wu).values())t.disable()}},zp=new WeakSet,Hp=function(t){const e=n(this,Au).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},Up=new WeakSet,Vp=function(){let t=null;for(t of n(this,Uu));return t},Gp=new WeakSet,qp=function(){if(0===n(this,wu).size)return!0;if(1===n(this,wu).size)for(const t of n(this,wu).values())return t.isEmpty();return!1},Xp=new WeakSet,Yp=function(t){for(const t of n(this,Uu))t.unselect();n(this,Uu).clear();for(const e of t)e.isEmpty()||(n(this,Uu).add(e),e.select());o(this,Dp,Fp).call(this,{hasSelectedEditor:this.hasSelection})},e(Jp,"TRANSLATE_SMALL",1),e(Jp,"TRANSLATE_BIG",10);const lf=class{constructor(t){s(this,af),s(this,Qp,""),s(this,Zp,!1),s(this,tf,null),s(this,ef,null),s(this,nf,null),s(this,sf,!1),s(this,rf,null),r(this,rf,t)}static initialize(t){lf._l10nPromise||(lf._l10nPromise=t)}async render(){const t=r(this,tf,document.createElement("button"));t.className="altText";const e=await lf._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0";const i=n(this,rf)._uiManager._signal;t.addEventListener("contextmenu",gd,{signal:i}),t.addEventListener("pointerdown",(t=>t.stopPropagation()),{signal:i});const s=t=>{t.preventDefault(),n(this,rf)._uiManager.editAltText(n(this,rf))};return t.addEventListener("click",s,{capture:!0,signal:i}),t.addEventListener("keydown",(e=>{e.target===t&&"Enter"===e.key&&(r(this,sf,!0),s(e))}),{signal:i}),await o(this,af,of).call(this),t}finish(){n(this,tf)&&(n(this,tf).focus({focusVisible:n(this,sf)}),r(this,sf,!1))}isEmpty(){return!n(this,Qp)&&!n(this,Zp)}get data(){return{altText:n(this,Qp),decorative:n(this,Zp)}}set data({altText:t,decorative:e}){n(this,Qp)===t&&n(this,Zp)===e||(r(this,Qp,t),r(this,Zp,e),o(this,af,of).call(this))}toggle(t=!1){n(this,tf)&&(!t&&n(this,nf)&&(clearTimeout(n(this,nf)),r(this,nf,null)),n(this,tf).disabled=!t)}destroy(){var t;null==(t=n(this,tf))||t.remove(),r(this,tf,null),r(this,ef,null)}};let hf=lf;var cf,df,uf,pf,ff,gf,mf,vf,yf,bf,wf,Af,_f,xf,Sf,kf,Ef,Cf,Mf,Rf,Pf,Tf,Lf,If,Df,Ff,Nf,Of,Wf,jf,Bf,$f,zf,Hf,Uf,Vf,Gf,qf,Xf,Yf,Kf,Jf,Qf,Zf,tg,eg,ig,ng,sg,rg;Qp=new WeakMap,Zp=new WeakMap,tf=new WeakMap,ef=new WeakMap,nf=new WeakMap,sf=new WeakMap,rf=new WeakMap,af=new WeakSet,of=async function(){var t;const e=n(this,tf);if(!e)return;if(!n(this,Qp)&&!n(this,Zp))return e.classList.remove("done"),void(null==(t=n(this,ef))||t.remove());e.classList.add("done"),lf._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then((t=>{e.setAttribute("aria-label",t)}));let i=n(this,ef);if(!i){r(this,ef,i=document.createElement("span")),i.className="tooltip",i.setAttribute("role","tooltip");const t=i.id=`alt-text-tooltip-${n(this,rf).id}`;e.setAttribute("aria-describedby",t);const s=100,a=n(this,rf)._uiManager._signal;a.addEventListener("abort",(()=>{clearTimeout(n(this,nf)),r(this,nf,null)}),{once:!0}),e.addEventListener("mouseenter",(()=>{r(this,nf,setTimeout((()=>{r(this,nf,null),n(this,ef).classList.add("show"),n(this,rf)._reportTelemetry({action:"alt_text_tooltip"})}),s))}),{signal:a}),e.addEventListener("mouseleave",(()=>{var t;n(this,nf)&&(clearTimeout(n(this,nf)),r(this,nf,null)),null==(t=n(this,ef))||t.classList.remove("show")}),{signal:a})}i.innerText=n(this,Zp)?await lf._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):n(this,Qp),i.parentNode||e.append(i);const s=n(this,rf).getImageForAltText();null==s||s.setAttribute("aria-describedby",i.id)},e(hf,"_l10nPromise",null);const ag=class{constructor(t){s(this,Lf),s(this,Nf),s(this,Wf),s(this,Bf),s(this,zf),s(this,Uf),s(this,Gf),s(this,Xf),s(this,Kf),s(this,Qf),s(this,tg),s(this,ig),s(this,sg),s(this,cf,null),s(this,df,null),s(this,uf,null),s(this,pf,!1),s(this,ff,!1),s(this,gf,null),s(this,mf,null),s(this,vf,this.focusin.bind(this)),s(this,yf,this.focusout.bind(this)),s(this,bf,null),s(this,wf,""),s(this,Af,!1),s(this,_f,null),s(this,xf,!1),s(this,Sf,!1),s(this,kf,!1),s(this,Ef,null),s(this,Cf,0),s(this,Mf,0),s(this,Rf,null),e(this,"_initialOptions",Object.create(null)),e(this,"_isVisible",!0),e(this,"_uiManager",null),e(this,"_focusEventsAllowed",!0),e(this,"_l10nPromise",null),s(this,Pf,!1),s(this,Tf,ag._zIndex++),this.constructor===ag&&Wh("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:i,rawDims:{pageWidth:n,pageHeight:r,pageX:a,pageY:o}}=this.parent.viewport;this.rotation=i,this.pageRotation=(360+i-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,r],this.pageTranslation=[a,o];const[l,h]=this.parentDimensions;this.x=t.x/l,this.y=t.y/h,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const t=ag.prototype._resizeWithKeyboard,e=Jp.TRANSLATE_SMALL,i=Jp.TRANSLATE_BIG;return $h(this,"_resizerKeyboardManager",new gu([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],ag.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return $h(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new lg({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e,i){if(ag._l10nPromise||(ag._l10nPromise=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map((e=>[e,t.get(e.replaceAll(/([A-Z])/g,(t=>`-${t.toLowerCase()}`)))])))),null!=i&&i.strings)for(const e of i.strings)ag._l10nPromise.set(e,t.get(e));if(-1!==ag._borderLineWidth)return;const n=getComputedStyle(document.documentElement);ag._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Wh("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return n(this,Pf)}set _isDraggable(t){var e;r(this,Pf,t),null==(e=this.div)||e.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=n(this,Tf)}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):o(this,sg,rg).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&(n(this,Af)?r(this,Af,!1):this.parent.setSelected(this))}focusout(t){var e;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const i=t.relatedTarget;null!=i&&i.closest(`#${this.id}`)||(t.preventDefault(),null!=(e=this.parent)&&e.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,n){const[s,r]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(t+i)/s,this.y=(e+n)/r,this.fixAndSetPosition()}translate(t,e){o(this,Lf,If).call(this,this.parentDimensions,t,e)}translateInPage(t,e){n(this,_f)||r(this,_f,[this.x,this.y]),o(this,Lf,If).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){n(this,_f)||r(this,_f,[this.x,this.y]);const[i,s]=this.parentDimensions;if(this.x+=t/i,this.y+=e/s,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this;const[l,h]=this.getBaseTranslation();a+=l,o+=h,this.div.style.left=`${(100*a).toFixed(2)}%`,this.div.style.top=`${(100*o).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!n(this,_f)&&(n(this,_f)[0]!==this.x||n(this,_f)[1]!==this.y)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=ag,n=i/t,s=i/e;switch(this.rotation){case 90:return[-n,s];case 180:return[n,s];case 270:return[n,-s];default:return[-n,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const[e,i]=this.pageDimensions;let{x:n,y:s,width:r,height:a}=this;if(r*=e,a*=i,n*=e,s*=i,this._mustFixPosition)switch(t){case 0:n=Math.max(0,Math.min(e-r,n)),s=Math.max(0,Math.min(i-a,s));break;case 90:n=Math.max(0,Math.min(e-a,n)),s=Math.min(i,Math.max(r,s));break;case 180:n=Math.min(e,Math.max(r,n)),s=Math.min(i,Math.max(a,s));break;case 270:n=Math.min(e,Math.max(a,n)),s=Math.max(0,Math.min(i-r,s))}this.x=n/=e,this.y=s/=i;const[o,l]=this.getBaseTranslation();n+=o,s+=l;const{style:h}=this.div;h.left=`${(100*n).toFixed(2)}%`,h.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(t,e){var i;return o(i=ag,Df,Ff).call(i,t,e,this.parentRotation)}pageTranslationToScreen(t,e){var i;return o(i=ag,Df,Ff).call(i,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this,n=e*t,s=i*t;return Zh.isCSSRoundSupported?[Math.round(n),Math.round(s)]:[n,s]}setDims(t,e){const[i,s]=this.parentDimensions;this.div.style.width=`${(100*t/i).toFixed(2)}%`,n(this,ff)||(this.div.style.height=`${(100*e/s).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,s=i.endsWith("%"),r=!n(this,ff)&&e.endsWith("%");if(s&&r)return;const[a,o]=this.parentDimensions;s||(t.width=`${(100*parseFloat(i)/a).toFixed(2)}%`),!n(this,ff)&&!r&&(t.height=`${(100*parseFloat(e)/o).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}altTextFinish(){var t;null==(t=n(this,uf))||t.finish()}async addEditToolbar(){return n(this,bf)||n(this,Sf)||(r(this,bf,new $d(this)),this.div.append(n(this,bf).render()),n(this,uf)&&n(this,bf).addAltTextButton(await n(this,uf).render())),n(this,bf)}removeEditToolbar(){var t;n(this,bf)&&(n(this,bf).remove(),r(this,bf,null),null==(t=n(this,uf))||t.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){n(this,uf)||(hf.initialize(ag._l10nPromise),r(this,uf,new hf(this)),n(this,cf)&&(n(this,uf).data=n(this,cf),r(this,cf,null)),await this.addEditToolbar())}get altTextData(){var t;return null==(t=n(this,uf))?void 0:t.data}set altTextData(t){n(this,uf)&&(n(this,uf).data=t)}hasAltText(){var t;return!(null!=(t=n(this,uf))&&t.isEmpty())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=n(this,pf)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",n(this,vf),{signal:t}),this.div.addEventListener("focusout",n(this,yf),{signal:t});const[e,i]=this.parentDimensions;this.parentRotation%180!=0&&(this.div.style.maxWidth=`${(100*i/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/i).toFixed(2)}%`);const[s,r]=this.getInitialTranslation();return this.translate(s,r),su(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=Zh.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(r(this,Af,!0),this._isDraggable?o(this,Xf,Yf).call(this,t):o(this,Gf,qf).call(this,t))}moveInDOM(){n(this,Ef)&&clearTimeout(n(this,Ef)),r(this,Ef,setTimeout((()=>{var t;r(this,Ef,null),null==(t=this.parent)||t.moveEditorInDOM(this)}),0))}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition()}getRect(t,e,i=this.rotation){const n=this.parentScale,[s,r]=this.pageDimensions,[a,o]=this.pageTranslation,l=t/n,h=e/n,c=this.x*s,d=this.y*r,u=this.width*s,p=this.height*r;switch(i){case 0:return[c+l+a,r-d-h-p+o,c+l+u+a,r-d-h+o];case 90:return[c+h+a,r-d+l+o,c+h+p+a,r-d+l+u+o];case 180:return[c-l-u+a,r-d+h+o,c-l+a,r-d+h+p+o];case 270:return[c-h-p+a,r-d-l-u+o,c-h+a,r-d-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,s,r]=t,a=s-i,o=r-n;switch(this.rotation){case 0:return[i,e-r,a,o];case 90:return[i,e-n,o,a];case 180:return[s,e-n,a,o];case 270:return[s,e-r,o,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){r(this,Sf,!0)}disableEditMode(){r(this,Sf,!1)}isInEditMode(){return n(this,Sf)}shouldGetKeyboardEvents(){return n(this,kf)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t,e;const i=this._uiManager._signal;null==(t=this.div)||t.addEventListener("focusin",n(this,vf),{signal:i}),null==(e=this.div)||e.addEventListener("focusout",n(this,yf),{signal:i})}rotate(t){}serialize(t=!1,e=null){Wh("An editor must be serializable")}static deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});n.rotation=t.rotation,r(n,cf,t.accessibilityData);const[s,a]=n.pageDimensions,[o,l,h,c]=n.getRectInCurrentCoords(t.rect,a);return n.x=o/s,n.y=l/a,n.width=h/s,n.height=c/a,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.div.removeEventListener("focusin",n(this,vf)),this.div.removeEventListener("focusout",n(this,yf)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),n(this,Ef)&&(clearTimeout(n(this,Ef)),r(this,Ef,null)),o(this,sg,rg).call(this),this.removeEditToolbar(),n(this,Rf)){for(const t of n(this,Rf).values())clearTimeout(t);r(this,Rf,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(o(this,Wf,jf).call(this),n(this,gf).classList.remove("hidden"),su(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),r(this,mf,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=n(this,gf).children;if(!n(this,df)){r(this,df,Array.from(e));const t=o(this,Kf,Jf).bind(this),i=o(this,Qf,Zf).bind(this),s=this._uiManager._signal;for(const e of n(this,df)){const n=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:s}),e.addEventListener("blur",i,{signal:s}),e.addEventListener("focus",o(this,tg,eg).bind(this,n),{signal:s}),ag._l10nPromise.get(`pdfjs-editor-resizer-label-${n}`).then((t=>e.setAttribute("aria-label",t)))}}const i=n(this,df)[0];let s=0;for(const t of e){if(t===i)break;s++}const a=(360-this.rotation+this.parentRotation)%360/90*(n(this,df).length/4);if(a!==s){if(a<s)for(let t=0;t<s-a;t++)n(this,gf).append(n(this,gf).firstChild);else if(a>s)for(let t=0;t<a-s;t++)n(this,gf).firstChild.before(n(this,gf).lastChild);let t=0;for(const i of e){const e=n(this,df)[t++].getAttribute("data-resizer-name");ag._l10nPromise.get(`pdfjs-editor-resizer-label-${e}`).then((t=>i.setAttribute("aria-label",t)))}}o(this,ig,ng).call(this,0),r(this,kf,!0),n(this,gf).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){n(this,kf)&&o(this,Uf,Vf).call(this,n(this,wf),{movementX:t,movementY:e})}_stopResizingWithKeyboard(){o(this,sg,rg).call(this),this.div.focus()}select(){var t,e;this.makeResizable(),null==(t=this.div)||t.classList.add("selectedEditor"),n(this,bf)?null==(e=n(this,bf))||e.show():this.addEditToolbar().then((()=>{var t,e;null!=(t=this.div)&&t.classList.contains("selectedEditor")&&(null==(e=n(this,bf))||e.show())}))}unselect(){var t,e,i,s;null==(t=n(this,gf))||t.classList.add("hidden"),null==(e=this.div)||e.classList.remove("selectedEditor"),null!=(i=this.div)&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),null==(s=n(this,bf))||s.hide()}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return n(this,xf)}set isEditing(t){r(this,xf,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){r(this,ff,!0);const i=t/e,{style:n}=this.div;n.aspectRatio=i,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){n(this,Rf)||r(this,Rf,new Map);const{action:e}=t;let i=n(this,Rf).get(e);return i&&clearTimeout(i),i=setTimeout((()=>{this._reportTelemetry(t),n(this,Rf).delete(e),0===n(this,Rf).size&&r(this,Rf,null)}),ag._telemetryTimeout),void n(this,Rf).set(e,i)}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),r(this,pf,!1)}disable(){this.div&&(this.div.tabIndex=-1),r(this,pf,!0)}renderAnnotationElement(t){let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.before(e)}}else e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){const{firstChild:e}=t.container;"DIV"===e.nodeName&&e.classList.contains("annotationContent")&&e.remove()}};let og=ag;cf=new WeakMap,df=new WeakMap,uf=new WeakMap,pf=new WeakMap,ff=new WeakMap,gf=new WeakMap,mf=new WeakMap,vf=new WeakMap,yf=new WeakMap,bf=new WeakMap,wf=new WeakMap,Af=new WeakMap,_f=new WeakMap,xf=new WeakMap,Sf=new WeakMap,kf=new WeakMap,Ef=new WeakMap,Cf=new WeakMap,Mf=new WeakMap,Rf=new WeakMap,Pf=new WeakMap,Tf=new WeakMap,Lf=new WeakSet,If=function([t,e],i,n){[i,n]=this.screenToPageTranslation(i,n),this.x+=i/t,this.y+=n/e,this.fixAndSetPosition()},Df=new WeakSet,Ff=function(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}},Nf=new WeakSet,Of=function(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}},Wf=new WeakSet,jf=function(){if(n(this,gf))return;r(this,gf,document.createElement("div")),n(this,gf).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const t=document.createElement("div");n(this,gf).append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",o(this,Bf,$f).bind(this,i),{signal:e}),t.addEventListener("contextmenu",gd,{signal:e}),t.tabIndex=-1}this.div.prepend(n(this,gf))},Bf=new WeakSet,$f=function(t,e){var i;e.preventDefault();const{isMac:s}=Zh.platform;if(0!==e.button||e.ctrlKey&&s)return;null==(i=n(this,uf))||i.toggle(!1);const r=o(this,Uf,Vf).bind(this,t),a=this._isDraggable;this._isDraggable=!1;const l=this._uiManager._signal,h={passive:!0,capture:!0,signal:l};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",r,h),window.addEventListener("contextmenu",gd,{signal:l});const c=this.x,d=this.y,u=this.width,p=this.height,f=this.parent.div.style.cursor,g=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const m=()=>{var t;this.parent.togglePointerEvents(!0),null==(t=n(this,uf))||t.toggle(!0),this._isDraggable=a,window.removeEventListener("pointerup",m),window.removeEventListener("blur",m),window.removeEventListener("pointermove",r,h),window.removeEventListener("contextmenu",gd),this.parent.div.style.cursor=f,this.div.style.cursor=g,o(this,zf,Hf).call(this,c,d,u,p)};window.addEventListener("pointerup",m,{signal:l}),window.addEventListener("blur",m,{signal:l})},zf=new WeakSet,Hf=function(t,e,i,n){const s=this.x,r=this.y,a=this.width,o=this.height;s===t&&r===e&&a===i&&o===n||this.addCommands({cmd:()=>{this.width=a,this.height=o,this.x=s,this.y=r;const[t,e]=this.parentDimensions;this.setDims(t*a,e*o),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=n,this.x=t,this.y=e;const[s,r]=this.parentDimensions;this.setDims(s*i,r*n),this.fixAndSetPosition()},mustExec:!0})},Uf=new WeakSet,Vf=function(t,e){const[i,n]=this.parentDimensions,s=this.x,r=this.y,a=this.width,l=this.height,h=ag.MIN_SIZE/i,c=ag.MIN_SIZE/n,d=t=>Math.round(1e4*t)/1e4,u=o(this,Nf,Of).call(this,this.rotation),p=(t,e)=>[u[0]*t+u[2]*e,u[1]*t+u[3]*e],f=o(this,Nf,Of).call(this,360-this.rotation);let g,m,v=!1,y=!1;switch(t){case"topLeft":v=!0,g=(t,e)=>[0,0],m=(t,e)=>[t,e];break;case"topMiddle":g=(t,e)=>[t/2,0],m=(t,e)=>[t/2,e];break;case"topRight":v=!0,g=(t,e)=>[t,0],m=(t,e)=>[0,e];break;case"middleRight":y=!0,g=(t,e)=>[t,e/2],m=(t,e)=>[0,e/2];break;case"bottomRight":v=!0,g=(t,e)=>[t,e],m=(t,e)=>[0,0];break;case"bottomMiddle":g=(t,e)=>[t/2,e],m=(t,e)=>[t/2,0];break;case"bottomLeft":v=!0,g=(t,e)=>[0,e],m=(t,e)=>[t,0];break;case"middleLeft":y=!0,g=(t,e)=>[0,e/2],m=(t,e)=>[t,e/2]}const b=g(a,l),w=m(a,l);let A=p(...w);const _=d(s+A[0]),x=d(r+A[1]);let S=1,k=1,[E,C]=this.screenToPageTranslation(e.movementX,e.movementY);if([E,C]=(M=E/i,R=C/n,[f[0]*M+f[2]*R,f[1]*M+f[3]*R]),v){const t=Math.hypot(a,l);S=k=Math.max(Math.min(Math.hypot(w[0]-b[0]-E,w[1]-b[1]-C)/t,1/a,1/l),h/a,c/l)}else y?S=Math.max(h,Math.min(1,Math.abs(w[0]-b[0]-E)))/a:k=Math.max(c,Math.min(1,Math.abs(w[1]-b[1]-C)))/l;var M,R;const P=d(a*S),T=d(l*k);A=p(...m(P,T));const L=_-A[0],I=x-A[1];this.width=P,this.height=T,this.x=L,this.y=I,this.setDims(i*P,n*T),this.fixAndSetPosition()},Gf=new WeakSet,qf=function(t){const{isMac:e}=Zh.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},Xf=new WeakSet,Yf=function(t){const e=this._uiManager.isSelected(this);let i,s;this._uiManager.setUpDragSession();const a=this._uiManager._signal;e&&(this.div.classList.add("moving"),i={passive:!0,capture:!0,signal:a},r(this,Cf,t.clientX),r(this,Mf,t.clientY),s=t=>{const{clientX:e,clientY:i}=t,[s,a]=this.screenToPageTranslation(e-n(this,Cf),i-n(this,Mf));r(this,Cf,e),r(this,Mf,i),this._uiManager.dragSelectedEditors(s,a)},window.addEventListener("pointermove",s,i));const l=()=>{window.removeEventListener("pointerup",l),window.removeEventListener("blur",l),e&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",s,i)),r(this,Af,!1),this._uiManager.endDragSession()||o(this,Gf,qf).call(this,t)};window.addEventListener("pointerup",l,{signal:a}),window.addEventListener("blur",l,{signal:a})},Kf=new WeakSet,Jf=function(t){ag._resizerKeyboardManager.exec(this,t)},Qf=new WeakSet,Zf=function(t){var e;n(this,kf)&&(null==(e=t.relatedTarget)?void 0:e.parentNode)!==n(this,gf)&&o(this,sg,rg).call(this)},tg=new WeakSet,eg=function(t){r(this,wf,n(this,kf)?t:"")},ig=new WeakSet,ng=function(t){if(n(this,df))for(const e of n(this,df))e.tabIndex=t},sg=new WeakSet,rg=function(){if(r(this,kf,!1),o(this,ig,ng).call(this,-1),n(this,mf)){const{savedX:t,savedY:e,savedWidth:i,savedHeight:s}=n(this,mf);o(this,zf,Hf).call(this,t,e,i,s),r(this,mf,null)}},s(og,Df),e(og,"_borderLineWidth",-1),e(og,"_colorManager",new vu),e(og,"_zIndex",1),e(og,"_telemetryTimeout",1e3);class lg extends og{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const hg=3285377520,cg=4294901760,dg=65535;class ug{constructor(t){this.h1=t?4294967295&t:hg,this.h2=t?4294967295&t:hg}update(t){let e,i;if("string"==typeof t){e=new Uint8Array(2*t.length),i=0;for(let n=0,s=t.length;n<s;n++){const s=t.charCodeAt(n);s<=255?e[i++]=s:(e[i++]=s>>>8,e[i++]=255&s)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice(),i=e.byteLength}const n=i>>2,s=i-4*n,r=new Uint32Array(e.buffer,0,n);let a=0,o=0,l=this.h1,h=this.h2;const c=3432918353,d=461845907,u=c&dg,p=d&dg;for(let t=0;t<n;t++)1&t?(a=r[t],a=a*c&cg|a*u&dg,a=a<<15|a>>>17,a=a*d&cg|a*p&dg,l^=a,l=l<<13|l>>>19,l=5*l+3864292196):(o=r[t],o=o*c&cg|o*u&dg,o=o<<15|o>>>17,o=o*d&cg|o*p&dg,h^=o,h=h<<13|h>>>19,h=5*h+3864292196);switch(a=0,s){case 3:a^=e[4*n+2]<<16;case 2:a^=e[4*n+1]<<8;case 1:a^=e[4*n],a=a*c&cg|a*u&dg,a=a<<15|a>>>17,a=a*d&cg|a*p&dg,1&n?l^=a:h^=a}this.h1=l,this.h2=h}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&cg|36045*t&dg,e=4283543511*e&cg|(2950163797*(e<<16|t>>>16)&cg)>>>16,t^=e>>>1,t=444984403*t&cg|60499*t&dg,e=3301882366*e&cg|(3120437893*(e<<16|t>>>16)&cg)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const pg=Object.freeze({map:null,hash:"",transfer:void 0});var fg,gg,mg,vg,yg,bg;class wg{constructor(){s(this,mg),s(this,fg,!1),s(this,gg,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=n(this,gg).get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return n(this,gg).get(t)}remove(t){if(n(this,gg).delete(t),0===n(this,gg).size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const t of n(this,gg).values())if(t instanceof og)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=n(this,gg).get(t);let s=!1;if(void 0!==i)for(const[t,n]of Object.entries(e))i[t]!==n&&(s=!0,i[t]=n);else s=!0,n(this,gg).set(t,e);s&&o(this,mg,vg).call(this),e instanceof og&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return n(this,gg).has(t)}getAll(){return n(this,gg).size>0?Qh(n(this,gg)):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return n(this,gg).size}resetModified(){n(this,fg)&&(r(this,fg,!1),"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new Ag(this)}get serializable(){if(0===n(this,gg).size)return pg;const t=new Map,e=new ug,i=[],s=Object.create(null);let r=!1;for(const[i,a]of n(this,gg)){const n=a instanceof og?a.serialize(!1,s):a;n&&(t.set(i,n),e.update(`${i}:${JSON.stringify(n)}`),r||(r=!!n.bitmap))}if(r)for(const e of t.values())e.bitmap&&i.push(e.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:pg}get editorStats(){let t=null;const e=new Map;for(const i of n(this,gg).values()){if(!(i instanceof og))continue;const n=i.telemetryFinalData;if(!n)continue;const{type:s}=n;e.has(s)||e.set(s,Object.getPrototypeOf(i).constructor),t||(t=Object.create(null));const r=t[s]||(t[s]=new Map);for(const[t,e]of Object.entries(n)){if("type"===t)continue;let i=r.get(t);i||(i=new Map,r.set(t,i));const n=i.get(e)??0;i.set(e,n+1)}}for(const[i,n]of e)t[i]=n.computeTelemetryFinalData(t[i]);return t}}fg=new WeakMap,gg=new WeakMap,mg=new WeakSet,vg=function(){n(this,fg)||(r(this,fg,!0),"function"==typeof this.onSetModified&&this.onSetModified())};class Ag extends wg{constructor(t){super(),s(this,yg,void 0);const{map:e,hash:i,transfer:n}=t.serializable,a=structuredClone(e,n?{transfer:n}:null);r(this,yg,{map:a,hash:i,transfer:n})}get print(){Wh("Should not call PrintAnnotationStorage.print")}get serializable(){return n(this,yg)}}yg=new WeakMap;class _g{constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){s(this,bg,new Set),this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),n(this,bg).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,_inspectFont:e}){if(t&&!n(this,bg).has(t.loadedName)){if(jh(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:s,style:r}=t,a=new FontFace(i,s,r);this.addNativeFontFace(a);try{await a.load(),n(this,bg).add(i),null==e||e(t)}catch{Oh(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}Wh("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void await this.loadSystemFont(t);if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw Oh(`Failed to load font '${e.family}': '${i}'.`),t.disableFontFace=!0,i}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise((e=>{const i=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,i)}))}}get isFontLoadingAPISupported(){var t;return $h(this,"isFontLoadingAPISupported",!(null==(t=this._document)||!t.fonts))}get isSyncFontLoadingSupported(){let t=!1;return(jl||typeof navigator<"u"&&"string"==typeof(null==navigator?void 0:navigator.userAgent)&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),$h(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(jh(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(i),i}get _loadTestFont(){return $h(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e){function i(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function n(t,e,i,n){return t.substring(0,e)+n+t.substring(e+i)}let s,r;const a=this._document.createElement("canvas");a.width=1,a.height=1;const o=a.getContext("2d");let l=0;const h=`lt${Date.now()}${this.loadTestFontId++}`;let c=this._loadTestFont;c=n(c,976,h.length,h);const d=1482184792;let u=i(c,16);for(s=0,r=h.length-3;s<r;s+=4)u=u-d+i(h,s)|0;var p;s<h.length&&(u=u-d+i(h+"XXX",s)|0),c=n(c,16,4,(p=u,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));const f=`@font-face {font-family:"${h}";src:${`url(data:font/opentype;base64,${btoa(c)});`}}`;this.insertRule(f);const g=this._document.createElement("div");g.style.visibility="hidden",g.style.width=g.style.height="10px",g.style.position="absolute",g.style.top=g.style.left="0px";for(const e of[t.loadedName,h]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=e,g.append(t)}this._document.body.append(g),function t(e,i){if(++l>30)return Oh("Load test font never loaded."),void i();o.font="30px "+e,o.fillText(".",0,20),o.getImageData(0,0,1,1).data[3]>0?i():setTimeout(t.bind(null,e,i))}(h,(()=>{g.remove(),e.complete()}))}}bg=new WeakMap;class xg{constructor(t,{disableFontFace:e=!1,inspectFont:i=null}){this.compiledGlyphs=Object.create(null);for(const e in t)this[e]=t[e];this.disableFontFace=!0===e,this._inspectFont=i}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return null==(t=this._inspectFont)||t.call(this,this),e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e=Kh(this.data),i=`url(data:${this.mimetype};base64,${btoa(e)});`;let n;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${i}}`}else n=`@font-face {font-family:"${this.loadedName}";src:${i}}`;return null==(t=this._inspectFont)||t.call(this,this,i),n}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(t){Oh(`getPathGenerator - ignoring character: "${t}".`)}if(!Array.isArray(i)||0===i.length)return this.compiledGlyphs[e]=function(t,e){};const n=[];for(let t=0,e=i.length;t<e;)switch(i[t++]){case cc:{const[e,s,r,a,o,l]=i.slice(t,t+6);n.push((t=>t.bezierCurveTo(e,s,r,a,o,l))),t+=6}break;case dc:{const[e,s]=i.slice(t,t+2);n.push((t=>t.moveTo(e,s))),t+=2}break;case uc:{const[e,s]=i.slice(t,t+2);n.push((t=>t.lineTo(e,s))),t+=2}break;case pc:{const[e,s,r,a]=i.slice(t,t+4);n.push((t=>t.quadraticCurveTo(e,s,r,a))),t+=4}break;case fc:n.push((t=>t.restore()));break;case gc:n.push((t=>t.save()));break;case mc:jh(2===n.length,"Scale command is only valid at the third position.");break;case vc:{const[e,s,r,a,o,l]=i.slice(t,t+6);n.push((t=>t.transform(e,s,r,a,o,l))),t+=6}break;case yc:{const[e,s]=i.slice(t,t+2);n.push((t=>t.translate(e,s))),t+=2}}return this.compiledGlyphs[e]=function(t,e){n[0](t),n[1](t),t.scale(e,-e);for(let e=2,i=n.length;e<i;e++)n[e](t)}}}if(jl){var Sg=Promise.withResolvers(),kg=null;(async()=>{const t=await import("./__vite-browser-external-afb87ea8.js"),e=await import("./__vite-browser-external-afb87ea8.js"),i=await import("./__vite-browser-external-afb87ea8.js"),n=await import("./__vite-browser-external-afb87ea8.js");return new Map(Object.entries({fs:t,http:e,https:i,url:n,canvas:undefined,path2d:undefined}))})().then((t=>{kg=t,Sg.resolve()}),(t=>{Oh(`loadPackages: ${t}`),kg=new Map,Sg.resolve()}))}class Eg{static get promise(){return Sg.promise}static get(t){return null==kg?void 0:kg.get(t)}}const Cg=function(t){return Eg.get("fs").promises.readFile(t).then((t=>new Uint8Array(t)))};const Mg="Fill",Rg="Stroke",Pg="Shading";function Tg(t,e){if(!e)return;const i=e[2]-e[0],n=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],i,n),t.clip(s)}class Lg{constructor(){this.constructor===Lg&&Wh("Cannot initialize BaseShadingPattern.")}getPattern(){Wh("Abstract method `getPattern` called.")}}class Ig extends Lg{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(t,e,i,n){let s;if(n===Rg||n===Mg){const r=e.current.getClippedPathBoundingBox(n,Ad(t))||[0,0,0,0],a=Math.ceil(r[2]-r[0])||1,o=Math.ceil(r[3]-r[1])||1,l=e.cachedCanvases.getCanvas("pattern",a,o,!0),h=l.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-r[0],-r[1]),i=rc.transform(i,[1,0,0,1,r[0],r[1]]),h.transform(...e.baseTransform),this.matrix&&h.transform(...this.matrix),Tg(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),s=t.createPattern(l.canvas,"no-repeat");const c=new DOMMatrix(i);s.setTransform(c)}else Tg(t,this._bbox),s=this._createGradient(t);return s}}function Dg(t,e,i,n,s,r,a,o){const l=e.coords,h=e.colors,c=t.data,d=4*t.width;let u;l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=a,a=u),l[n+1]>l[s+1]&&(u=n,n=s,s=u,u=a,a=o,o=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=a,a=u);const p=(l[i]+e.offsetX)*e.scaleX,f=(l[i+1]+e.offsetY)*e.scaleY,g=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,v=(l[s]+e.offsetX)*e.scaleX,y=(l[s+1]+e.offsetY)*e.scaleY;if(f>=y)return;const b=h[r],w=h[r+1],A=h[r+2],_=h[a],x=h[a+1],S=h[a+2],k=h[o],E=h[o+1],C=h[o+2],M=Math.round(f),R=Math.round(y);let P,T,L,I,D,F,N,O;for(let t=M;t<=R;t++){if(t<m){const e=t<f?0:(f-t)/(f-m);P=p-(p-g)*e,T=b-(b-_)*e,L=w-(w-x)*e,I=A-(A-S)*e}else{let e;e=t>y?1:m===y?0:(m-t)/(m-y),P=g-(g-v)*e,T=_-(_-k)*e,L=x-(x-E)*e,I=S-(S-C)*e}let e;e=t<f?0:t>y?1:(f-t)/(f-y),D=p-(p-v)*e,F=b-(b-k)*e,N=w-(w-E)*e,O=A-(A-C)*e;const i=Math.round(Math.min(P,D)),n=Math.round(Math.max(P,D));let s=d*t+4*i;for(let t=i;t<=n;t++)e=(P-t)/(P-D),e<0?e=0:e>1&&(e=1),c[s++]=T-(T-F)*e|0,c[s++]=L-(L-N)*e|0,c[s++]=I-(I-O)*e|0,c[s++]=255}}function Fg(t,e,i){const n=e.coords,s=e.colors;let r,a;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,h=o-1;for(r=0;r<l;r++){let e=r*o;for(let r=0;r<h;r++,e++)Dg(t,i,n[e],n[e+1],n[e+o],s[e],s[e+1],s[e+o]),Dg(t,i,n[e+o+1],n[e+1],n[e+o],s[e+o+1],s[e+1],s[e+o])}break;case"triangles":for(r=0,a=n.length;r<a;r+=3)Dg(t,i,n[r],n[r+1],n[r+2],s[r],s[r+1],s[r+2]);break;default:throw new Error("illegal figure")}}class Ng extends Lg{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,i){const n=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),r=Math.ceil(this._bounds[2])-n,a=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(r*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(a*t[1]*1.1)),3e3),h=r/o,c=a/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-s,scaleX:1/h,scaleY:1/c},u=o+4,p=l+4,f=i.getCanvas("mesh",u,p,!1),g=f.context,m=g.createImageData(o,l);if(e){const t=m.data;for(let i=0,n=t.length;i<n;i+=4)t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=255}for(const t of this._figures)Fg(m,t,d);return g.putImageData(m,2,2),{canvas:f.canvas,offsetX:n-2*h,offsetY:s-2*c,scaleX:h,scaleY:c}}getPattern(t,e,i,n){let s;if(Tg(t,this._bbox),n===Pg)s=rc.singularValueDecompose2dScale(Ad(t));else if(s=rc.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=rc.singularValueDecompose2dScale(this.matrix);s=[s[0]*t[0],s[1]*t[1]]}const r=this._createMeshCanvas(s,n===Pg?null:this._background,e.cachedCanvases);return n!==Pg&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(r.offsetX,r.offsetY),t.scale(r.scaleX,r.scaleY),t.createPattern(r.canvas,"no-repeat")}}class Og extends Lg{getPattern(){return"hotpink"}}const Wg=1,jg=2,Bg=class{constructor(t,e,i,n,s){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=i,this.canvasGraphicsFactory=n,this.baseTransform=s}createPatternCanvas(t){const e=this.operatorList,i=this.bbox,n=this.xstep,s=this.ystep,r=this.paintType,a=this.tilingType,o=this.color,l=this.canvasGraphicsFactory;Nh("TilingType: "+a);const h=i[0],c=i[1],d=i[2],u=i[3],p=rc.singularValueDecompose2dScale(this.matrix),f=rc.singularValueDecompose2dScale(this.baseTransform),g=[p[0]*f[0],p[1]*f[1]],m=this.getSizeAndScale(n,this.ctx.canvas.width,g[0]),v=this.getSizeAndScale(s,this.ctx.canvas.height,g[1]),y=t.cachedCanvases.getCanvas("pattern",m.size,v.size,!0),b=y.context,w=l.createCanvasGraphics(b);w.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(w,r,o);let A=h,_=c,x=d,S=u;return h<0&&(A=0,x+=Math.abs(h)),c<0&&(_=0,S+=Math.abs(c)),b.translate(-m.scale*A,-v.scale*_),w.transform(m.scale,0,0,v.scale,0,0),b.save(),this.clipBbox(w,A,_,x,S),w.baseTransform=Ad(w.ctx),w.executeOperatorList(e),w.endDrawing(),{canvas:y.canvas,scaleX:m.scale,scaleY:v.scale,offsetX:A,offsetY:_}}getSizeAndScale(t,e,i){t=Math.abs(t);const n=Math.max(Bg.MAX_PATTERN_SIZE,e);let s=Math.ceil(t*i);return s>=n?s=n:i=s/t,{scale:i,size:s}}clipBbox(t,e,i,n,s){const r=n-e,a=s-i;t.ctx.rect(e,i,r,a),t.current.updateRectMinMax(Ad(t.ctx),[e,i,n,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case Wg:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case jg:const r=rc.makeHexColor(i[0],i[1],i[2]);n.fillStyle=r,n.strokeStyle=r,s.fillColor=r,s.strokeColor=r;break;default:throw new Xh(`Unsupported paint type: ${e}`)}}getPattern(t,e,i,n){let s=i;n!==Pg&&(s=rc.transform(s,e.baseTransform),this.matrix&&(s=rc.transform(s,this.matrix)));const r=this.createPatternCanvas(e);let a=new DOMMatrix(s);a=a.translate(r.offsetX,r.offsetY),a=a.scale(1/r.scaleX,1/r.scaleY);const o=t.createPattern(r.canvas,"repeat");return o.setTransform(a),o}};let $g=Bg;function zg({src:t,srcPos:e=0,dest:i,width:n,height:s,nonBlackColor:r=4294967295,inverseDecode:a=!1}){const o=Zh.isLittleEndian?4278190080:255,[l,h]=a?[r,o]:[o,r],c=n>>3,d=7&n,u=t.length;i=new Uint32Array(i.buffer);let p=0;for(let n=0;n<s;n++){for(const n=e+c;e<n;e++){const n=e<u?t[e]:255;i[p++]=128&n?h:l,i[p++]=64&n?h:l,i[p++]=32&n?h:l,i[p++]=16&n?h:l,i[p++]=8&n?h:l,i[p++]=4&n?h:l,i[p++]=2&n?h:l,i[p++]=1&n?h:l}if(0===d)continue;const n=e<u?t[e++]:255;for(let t=0;t<d;t++)i[p++]=n&1<<7-t?h:l}return{srcPos:e,destPos:p}}e($g,"MAX_PATTERN_SIZE",3e3);const Hg=16;class Ug{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let n;return void 0!==this.cache[t]?(n=this.cache[t],this.canvasFactory.reset(n,e,i)):(n=this.canvasFactory.create(e,i),this.cache[t]=n),n}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function Vg(t,e,i,n,s,r,a,o,l,h){const[c,d,u,p,f,g]=Ad(t);if(0===d&&0===u){const m=a*c+f,v=Math.round(m),y=o*p+g,b=Math.round(y),w=(a+l)*c+f,A=Math.abs(Math.round(w)-v)||1,_=(o+h)*p+g,x=Math.abs(Math.round(_)-b)||1;return t.setTransform(Math.sign(c),0,0,Math.sign(p),v,b),t.drawImage(e,i,n,s,r,0,0,A,x),t.setTransform(c,d,u,p,f,g),[A,x]}if(0===c&&0===p){const m=o*u+f,v=Math.round(m),y=a*d+g,b=Math.round(y),w=(o+h)*u+f,A=Math.abs(Math.round(w)-v)||1,_=(a+l)*d+g,x=Math.abs(Math.round(_)-b)||1;return t.setTransform(0,Math.sign(d),Math.sign(u),0,v,b),t.drawImage(e,i,n,s,r,0,0,x,A),t.setTransform(c,d,u,p,f,g),[x,A]}t.drawImage(e,i,n,s,r,a,o,l,h);return[Math.hypot(c,d)*l,Math.hypot(u,p)*h]}class Gg{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=Bl,this.textMatrixScale=1,this.fontMatrix=$l,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=th,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,i){[e,i]=rc.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){const i=rc.applyTransform(e,t),n=rc.applyTransform(e.slice(2),t),s=rc.applyTransform([e[0],e[3]],t),r=rc.applyTransform([e[2],e[1]],t);this.minX=Math.min(this.minX,i[0],n[0],s[0],r[0]),this.minY=Math.min(this.minY,i[1],n[1],s[1],r[1]),this.maxX=Math.max(this.maxX,i[0],n[0],s[0],r[0]),this.maxY=Math.max(this.maxY,i[1],n[1],s[1],r[1])}updateScalingPathMinMax(t,e){rc.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.minY=Math.min(this.minY,e[1]),this.maxX=Math.max(this.maxX,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,i,n,s,r,a,o,l,h){const c=rc.bezierBoundingBox(e,i,n,s,r,a,o,l,h);h||this.updateRectMinMax(t,c)}getPathBoundingBox(t=Mg,e=null){const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===Rg){e||Wh("Stroke bounding box must include transform.");const t=rc.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,s=t[1]*this.lineWidth/2;i[0]-=n,i[1]-=s,i[2]+=n,i[3]+=s}return i}updateClipFromPath(){const t=rc.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(t=Mg,e=null){return rc.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function qg(t,e){if(typeof ImageData<"u"&&e instanceof ImageData)return void t.putImageData(e,0,0);const i=e.height,n=e.width,s=i%Hg,r=(i-s)/Hg,a=0===s?r:r+1,o=t.createImageData(n,Hg);let l,h=0;const c=e.data,d=o.data;let u,p,f,g;if(e.kind===ah.GRAYSCALE_1BPP){const e=c.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),g=i.length,m=n+7>>3,v=4294967295,y=Zh.isLittleEndian?4278190080:255;for(u=0;u<a;u++){for(f=u<r?Hg:s,l=0,p=0;p<f;p++){const t=e-h;let s=0;const r=t>m?n:8*t-7,a=-8&r;let o=0,d=0;for(;s<a;s+=8)d=c[h++],i[l++]=128&d?v:y,i[l++]=64&d?v:y,i[l++]=32&d?v:y,i[l++]=16&d?v:y,i[l++]=8&d?v:y,i[l++]=4&d?v:y,i[l++]=2&d?v:y,i[l++]=1&d?v:y;for(;s<r;s++)0===o&&(d=c[h++],o=128),i[l++]=d&o?v:y,o>>=1}for(;l<g;)i[l++]=0;t.putImageData(o,0,u*Hg)}}else if(e.kind===ah.RGBA_32BPP){for(p=0,g=n*Hg*4,u=0;u<r;u++)d.set(c.subarray(h,h+g)),h+=g,t.putImageData(o,0,p),p+=Hg;u<a&&(g=n*s*4,d.set(c.subarray(h,h+g)),t.putImageData(o,0,p))}else{if(e.kind!==ah.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);for(f=Hg,g=n*f,u=0;u<a;u++){for(u>=r&&(f=s,g=n*f),l=0,p=g;p--;)d[l++]=c[h++],d[l++]=c[h++],d[l++]=c[h++],d[l++]=255;t.putImageData(o,0,u*Hg)}}}function Xg(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%Hg,r=(i-s)/Hg,a=0===s?r:r+1,o=t.createImageData(n,Hg);let l=0;const h=e.data,c=o.data;for(let e=0;e<a;e++){const i=e<r?Hg:s;({srcPos:l}=zg({src:h,srcPos:l,dest:c,width:n,height:i,nonBlackColor:0})),t.putImageData(o,0,e*Hg)}}function Yg(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of i)void 0!==t[n]&&(e[n]=t[n]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function Kg(t){if(t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0),!jl){const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function Jg(t,e){if(e)return!0;const i=rc.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*Mc.PDF_TO_CSS_UNITS);return i[0]<=n&&i[1]<=n}const Qg=["butt","round","square"],Zg=["miter","round","bevel"],tm={},em={};var im,nm,sm,rm;const am=class{constructor(t,e,i,n,r,{optionalContentConfig:a,markedContentStack:o=null},l,h){s(this,im),s(this,sm),this.ctx=t,this.current=new Gg(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=n,this.filterFactory=r,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,this.cachedCanvases=new Ug(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=h,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,e=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing({transform:t,viewport:e,transparency:i=!1,background:n=null}){const s=this.ctx.canvas.width,r=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=n||"#ffffff",this.ctx.fillRect(0,0,s,r),this.ctx.fillStyle=a,i){const t=this.cachedCanvases.getCanvas("transparent",s,r);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...Ad(this.compositeCtx))}this.ctx.save(),Kg(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=Ad(this.ctx)}executeOperatorList(t,e,i,n){const s=t.argsArray,r=t.fnArray;let a=e||0;const o=s.length;if(o===a)return a;const l=o-a>10&&"function"==typeof i,h=l?Date.now()+15:0;let c=0;const d=this.commonObjs,u=this.objs;let p;for(;;){if(void 0!==n&&a===n.nextBreakPoint)return n.breakIt(a,i),a;if(p=r[a],p!==Lh.dependency)this[p].apply(this,s[a]);else for(const t of s[a]){const e=t.startsWith("g_")?d:u;if(!e.has(t))return e.get(t,i),a}if(a++,a===o)return a;if(l&&++c>10){if(Date.now()>h)return i(),a;c=0}}}endDrawing(){o(this,im,nm).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),o(this,sm,rm).call(this)}_scaleImage(t,e){const i=t.width,n=t.height;let s,r,a=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=i,h=n,c="prescale1";for(;a>2&&l>1||o>2&&h>1;){let e=l,i=h;a>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/e),o>2&&h>1&&(i=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h)/2,o/=h/i),s=this.cachedCanvases.getCanvas(c,e,i),r=s.context,r.clearRect(0,0,e,i),r.drawImage(t,0,0,l,h,0,0,e,i),t=s.canvas,l=e,h=i,c="prescale1"===c?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:h}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,s=this.current.fillColor,r=this.current.patternFill,a=Ad(e);let o,l,h,c;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;l=JSON.stringify(r?a:[a.slice(0,4),s]),o=this._cachedBitmapsMap.get(e),o||(o=new Map,this._cachedBitmapsMap.set(e,o));const i=o.get(l);if(i&&!r){return{canvas:i,offsetX:Math.round(Math.min(a[0],a[2])+a[4]),offsetY:Math.round(Math.min(a[1],a[3])+a[5])}}h=i}h||(c=this.cachedCanvases.getCanvas("maskCanvas",i,n),Xg(c.context,t));let d=rc.transform(a,[1/i,0,0,-1/n,0,0]);d=rc.transform(d,[1,0,0,1,0,-n]);const[u,p,f,g]=rc.getAxialAlignedBoundingBox([0,0,i,n],d),m=Math.round(f-u)||1,v=Math.round(g-p)||1,y=this.cachedCanvases.getCanvas("fillCanvas",m,v),b=y.context,w=u,A=p;b.translate(-w,-A),b.transform(...d),h||(h=this._scaleImage(c.canvas,_d(b)),h=h.img,o&&r&&o.set(l,h)),b.imageSmoothingEnabled=Jg(Ad(b),t.interpolate),Vg(b,h,0,0,h.width,h.height,0,0,i,n),b.globalCompositeOperation="source-in";const _=rc.transform(_d(b),[1,0,0,1,-w,-A]);return b.fillStyle=r?s.getPattern(e,this,_,Mg):s,b.fillRect(0,0,i,n),o&&!r&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,y.canvas)),{canvas:y.canvas,offsetX:Math.round(w),offsetY:Math.round(A)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=Qg[t]}setLineJoin(t){this.ctx.lineJoin=Zg[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx,this.ctx=n.context;const s=this.ctx;s.setTransform(...Ad(this.suspendedCtx)),Yg(this.suspendedCtx,s),function(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,n,s,r,a){e.transform(t,i,n,s,r,a),this.__originalTransform(t,i,n,s,r,a)},t.setTransform=function(t,i,n,s,r,a){e.setTransform(t,i,n,s,r,a),this.__originalSetTransform(t,i,n,s,r,a)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},t.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},t.bezierCurveTo=function(t,i,n,s,r,a){e.bezierCurveTo(t,i,n,s,r,a),this.__originalBezierCurveTo(t,i,n,s,r,a)},t.rect=function(t,i,n,s){e.rect(t,i,n,s),this.__originalRect(t,i,n,s)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Yg(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,e,i,n){const s=n[0],r=n[1],a=n[2]-s,o=n[3]-r;0===a||0===o||(this.genericComposeSMask(e.context,i,a,o,e.subtype,e.backdrop,e.transferMap,s,r,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,e,i,n,s,r,a,o,l,h,c){let d=t.canvas,u=o-h,p=l-c;if(r)if(u<0||p<0||u+i>d.width||p+n>d.height){const t=this.cachedCanvases.getCanvas("maskExtension",i,n),e=t.context;e.drawImage(d,-u,-p),r.some((t=>0!==t))&&(e.globalCompositeOperation="destination-atop",e.fillStyle=rc.makeHexColor(...r),e.fillRect(0,0,i,n),e.globalCompositeOperation="source-over"),d=t.canvas,u=p=0}else if(r.some((t=>0!==t))){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const e=new Path2D;e.rect(u,p,i,n),t.clip(e),t.globalCompositeOperation="destination-atop",t.fillStyle=rc.makeHexColor(...r),t.fillRect(u,p,i,n),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),"Alpha"===s&&a?e.filter=this.filterFactory.addAlphaFilter(a):"Luminosity"===s&&(e.filter=this.filterFactory.addLuminosityFilter(a));const f=new Path2D;f.rect(o,l,i,n),e.clip(f),e.globalCompositeOperation="destination-in",e.drawImage(d,u,p,i,n,o,l,i,n),e.restore()}save(){this.inSMaskMode?(Yg(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),Yg(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,n,s,r){this.ctx.transform(t,e,i,n,s,r),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){const n=this.ctx,s=this.current;let r,a,o=s.x,l=s.y;const h=Ad(n),c=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],d=c?i.slice(0):null;for(let i=0,u=0,p=t.length;i<p;i++)switch(0|t[i]){case Lh.rectangle:o=e[u++],l=e[u++];const t=e[u++],i=e[u++],p=o+t,f=l+i;n.moveTo(o,l),0===t||0===i?n.lineTo(p,f):(n.lineTo(p,l),n.lineTo(p,f),n.lineTo(o,f)),c||s.updateRectMinMax(h,[o,l,p,f]),n.closePath();break;case Lh.moveTo:o=e[u++],l=e[u++],n.moveTo(o,l),c||s.updatePathMinMax(h,o,l);break;case Lh.lineTo:o=e[u++],l=e[u++],n.lineTo(o,l),c||s.updatePathMinMax(h,o,l);break;case Lh.curveTo:r=o,a=l,o=e[u+4],l=e[u+5],n.bezierCurveTo(e[u],e[u+1],e[u+2],e[u+3],o,l),s.updateCurvePathMinMax(h,r,a,e[u],e[u+1],e[u+2],e[u+3],o,l,d),u+=6;break;case Lh.curveTo2:r=o,a=l,n.bezierCurveTo(o,l,e[u],e[u+1],e[u+2],e[u+3]),s.updateCurvePathMinMax(h,r,a,o,l,e[u],e[u+1],e[u+2],e[u+3],d),o=e[u+2],l=e[u+3],u+=4;break;case Lh.curveTo3:r=o,a=l,o=e[u+2],l=e[u+3],n.bezierCurveTo(e[u],e[u+1],o,l,o,l),s.updateCurvePathMinMax(h,r,a,e[u],e[u+1],o,l,o,l,d),u+=4;break;case Lh.closePath:n.closePath()}c&&s.updateScalingPathMinMax(h,d),s.setCurrentPoint(o,l)}closePath(){this.ctx.closePath()}stroke(t=!0){const e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof i&&null!=i&&i.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,_d(e),Rg),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){const e=this.ctx,i=this.current.fillColor;let n=!1;this.current.patternFill&&(e.save(),e.fillStyle=i.getPattern(e,this,_d(e),Mg),n=!0);const s=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==s&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),n&&e.restore(),t&&this.consumePath(s)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=tm}eoClip(){this.pendingClip=em}beginText(){this.current.textMatrix=Bl,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(const i of t)e.setTransform(...i.transform),e.translate(i.x,i.y),i.addToPath(e,i.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){var i;const n=this.commonObjs.get(t),s=this.current;if(!n)throw new Error(`Can't find font for ${t}`);if(s.fontMatrix=n.fontMatrix||$l,(0===s.fontMatrix[0]||0===s.fontMatrix[3])&&Oh("Invalid font matrix for font "+t),e<0?(e=-e,s.fontDirection=-1):s.fontDirection=1,this.current.font=n,this.current.fontSize=e,n.isType3Font)return;const r=n.loadedName||"sans-serif",a=(null==(i=n.systemFontInfo)?void 0:i.css)||`"${r}", ${n.fallbackName}`;let o="normal";n.black?o="900":n.bold&&(o="bold");const l=n.italic?"italic":"normal";let h=e;e<16?h=16:e>100&&(h=100),this.current.fontSizeScale=e/h,this.ctx.font=`${l} ${o} ${h}px ${a}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,n,s,r){this.current.textMatrix=[t,e,i,n,s,r],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,n){const s=this.ctx,r=this.current,a=r.font,o=r.textRenderingMode,l=r.fontSize/r.fontSizeScale,h=o&sh,c=!!(o&rh),d=r.patternFill&&!a.missingFile;let u;(a.disableFontFace||c||d)&&(u=a.getPathGenerator(this.commonObjs,t)),a.disableFontFace||d?(s.save(),s.translate(e,i),s.beginPath(),u(s,l),n&&s.setTransform(...n),(h===th||h===ih)&&s.fill(),(h===eh||h===ih)&&s.stroke(),s.restore()):((h===th||h===ih)&&s.fillText(t,e,i),(h===eh||h===ih)&&s.strokeText(t,e,i)),c&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Ad(s),x:e,y:i,fontSize:l,addToPath:u})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){i=!0;break}return $h(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const s=this.ctx,r=e.fontSizeScale,a=e.charSpacing,o=e.wordSpacing,l=e.fontDirection,h=e.textHScale*l,c=t.length,d=i.vertical,u=d?1:-1,p=i.defaultVMetrics,f=n*e.fontMatrix[0],g=e.textRenderingMode===th&&!i.disableFontFace&&!e.patternFill;let m;if(s.save(),s.transform(...e.textMatrix),s.translate(e.x,e.y+e.textRise),l>0?s.scale(h,-1):s.scale(h,1),e.patternFill){s.save();const t=e.fillColor.getPattern(s,this,_d(s),Mg);m=Ad(s),s.restore(),s.fillStyle=t}let v=e.lineWidth;const y=e.textMatrixScale;if(0===y||0===v){const t=e.textRenderingMode&sh;(t===eh||t===ih)&&(v=this.getSinglePixelWidth())}else v/=y;if(1!==r&&(s.scale(r,r),v/=r),s.lineWidth=v,i.isInvalidPDFjsFont){const i=[];let n=0;for(const e of t)i.push(e.unicode),n+=e.width;return s.fillText(i.join(""),0,0),e.x+=n*f*h,s.restore(),void this.compose()}let b,w=0;for(b=0;b<c;++b){const e=t[b];if("number"==typeof e){w+=u*e*n/1e3;continue}let h=!1;const c=(e.isSpace?o:0)+a,v=e.fontChar,y=e.accent;let A,_,x=e.width;if(d){const t=e.vmetric||p,i=-(e.vmetric?t[1]:.5*x)*f,n=t[2]*f;x=t?-t[0]:x,A=i/r,_=(w+n)/r}else A=w/r,_=0;if(i.remeasure&&x>0){const t=1e3*s.measureText(v).width/n*r;if(x<t&&this.isFontSubpixelAAEnabled){const e=x/t;h=!0,s.save(),s.scale(e,1),A/=e}else x!==t&&(A+=(x-t)/2e3*n/r)}if(this.contentVisible&&(e.isInFont||i.missingFile))if(g&&!y)s.fillText(v,A,_);else if(this.paintChar(v,A,_,m),y){const t=A+n*y.offset.x/r,e=_-n*y.offset.y/r;this.paintChar(y.fontChar,t,e,m)}w+=d?x*f-c*l:x*f+c*l,h&&s.restore()}d?e.y-=w:e.x+=w*h,s.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,n=i.font,s=i.fontSize,r=i.fontDirection,a=n.vertical?1:-1,o=i.charSpacing,l=i.wordSpacing,h=i.textHScale*r,c=i.fontMatrix||$l,d=t.length;let u,p,f,g;if(!(i.textRenderingMode===nh)&&0!==s){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...i.textMatrix),e.translate(i.x,i.y),e.scale(h,r),u=0;u<d;++u){if(p=t[u],"number"==typeof p){g=a*p*s/1e3,this.ctx.translate(g,0),i.x+=g*h;continue}const r=(p.isSpace?l:0)+o,d=n.charProcOperatorList[p.operatorListId];d?(this.contentVisible&&(this.processingType3=p,this.save(),e.scale(s,s),e.transform(...c),this.executeOperatorList(d),this.restore()),f=rc.applyTransform([p.width,0],c)[0]*s+r,e.translate(f,0),i.x+=f*h):Oh(`Type3 character "${p.operatorListId}" is not available.`)}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,n,s,r){this.ctx.rect(i,n,s-i,r-n),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const i=t[1],n=this.baseTransform||Ad(this.ctx),s={createCanvasGraphics:t=>new am(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new $g(t,i,this.ctx,s,n)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,i){const n=rc.makeHexColor(t,e,i);this.ctx.strokeStyle=n,this.current.strokeColor=n}setFillRGBColor(t,e,i){const n=rc.makeHexColor(t,e,i);this.ctx.fillStyle=n,this.current.fillColor=n,this.current.patternFill=!1}_getPattern(t,e=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=function(t){switch(t[0]){case"RadialAxial":return new Ig(t);case"Mesh":return new Ng(t);case"Dummy":return new Og}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t)),this.cachedPatterns.set(t,i)),e&&(i.matrix=e),i}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,_d(e),Pg);const n=_d(e);if(n){const{width:t,height:i}=e.canvas,[s,r,a,o]=rc.getAxialAlignedBoundingBox([0,0,t,i],n);this.ctx.fillRect(s,r,a-s,o-r)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Wh("Should not call beginInlineImage")}beginImageData(){Wh("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=Ad(this.ctx),e)){const t=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],t,i),this.current.updateRectMinMax(Ad(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||Nh("TODO: Support non-isolated groups."),t.knockout&&Oh("Knockout groups not supported.");const i=Ad(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let n=rc.getAxialAlignedBoundingBox(t.bbox,Ad(e));const s=[0,0,e.canvas.width,e.canvas.height];n=rc.intersect(n,s)||[0,0,0,0];const r=Math.floor(n[0]),a=Math.floor(n[1]),o=Math.max(Math.ceil(n[2])-r,1),l=Math.max(Math.ceil(n[3])-a,1);this.current.startNewPathAndClipBox([0,0,o,l]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);const c=this.cachedCanvases.getCanvas(h,o,l),d=c.context;d.translate(-r,-a),d.transform(...i),t.smask?this.smaskStack.push({canvas:c.canvas,context:d,offsetX:r,offsetY:a,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(r,a),e.save()),Yg(e,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=Ad(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const i=rc.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,n,s){if(o(this,im,nm).call(this),Kg(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const n=e[2]-e[0],r=e[3]-e[1];if(s&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=n,e[3]=r;const[s,a]=rc.singularValueDecompose2dScale(Ad(this.ctx)),{viewportScale:o}=this,l=Math.ceil(n*this.outputScaleX*o),h=Math.ceil(r*this.outputScaleY*o);this.annotationCanvas=this.canvasFactory.create(l,h);const{canvas:c,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(t,c),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(s,0,0,-a,0,r*a),Kg(this.ctx)}else Kg(this.ctx),this.ctx.rect(e[0],e[1],n,r),this.ctx.clip(),this.endPath()}this.current=new Gg(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),o(this,sm,rm).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const i=this.ctx,n=this.processingType3;if(n&&(void 0===n.compiled&&(n.compiled=function(t){const{width:e,height:i}=t;if(e>1e3||i>1e3)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let r,a,o,l=new Uint8Array(s*(i+1));const h=e+7&-8;let c=new Uint8Array(h*i),d=0;for(const e of t.data){let t=128;for(;t>0;)c[d++]=e&t?0:255,t>>=1}let u=0;for(d=0,0!==c[d]&&(l[0]=1,++u),a=1;a<e;a++)c[d]!==c[d+1]&&(l[a]=c[d]?2:1,++u),d++;for(0!==c[d]&&(l[a]=2,++u),r=1;r<i;r++){d=r*h,o=r*s,c[d-h]!==c[d]&&(l[o]=c[d]?1:8,++u);let t=(c[d]?4:0)+(c[d-h]?8:0);for(a=1;a<e;a++)t=(t>>2)+(c[d+1]?4:0)+(c[d-h+1]?8:0),n[t]&&(l[o+a]=n[t],++u),d++;if(c[d-h]!==c[d]&&(l[o+a]=c[d]?2:4,++u),u>1e3)return null}for(d=h*(i-1),o=r*s,0!==c[d]&&(l[o]=8,++u),a=1;a<e;a++)c[d]!==c[d+1]&&(l[o+a]=c[d]?4:8,++u),d++;if(0!==c[d]&&(l[o+a]=4,++u),u>1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),f=new Path2D;for(r=0;u&&r<=i;r++){let t=r*s;const i=t+e;for(;t<i&&!l[t];)t++;if(t===i)continue;f.moveTo(t%s,r);const n=t;let a=l[t];do{const e=p[a];do{t+=e}while(!l[t]);const i=l[t];5!==i&&10!==i?(a=i,l[t]=0):(a=i&51*a>>4,l[t]&=a>>2|a<<2),f.lineTo(t%s,t/s|0),l[t]||--u}while(n!==t);--r}return c=null,l=null,function(t){t.save(),t.scale(1/e,-1/i),t.translate(0,-i),t.fill(f),t.beginPath(),t.restore()}}(t)),n.compiled))return void n.compiled(i);const s=this._createMaskCanvas(t),r=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(r,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i=0,n=0,s,r){if(!this.contentVisible)return;t=this.getObject(t.data,t);const a=this.ctx;a.save();const o=Ad(a);a.transform(e,i,n,s,0,0);const l=this._createMaskCanvas(t);a.setTransform(1,0,0,1,l.offsetX-o[4],l.offsetY-o[5]);for(let t=0,h=r.length;t<h;t+=2){const h=rc.transform(o,[e,i,n,s,r[t],r[t+1]]),[c,d]=rc.applyTransform([0,0],h);a.drawImage(l.canvas,c,d)}a.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,n=this.current.patternFill;for(const s of t){const{data:t,width:r,height:a,transform:o}=s,l=this.cachedCanvases.getCanvas("maskCanvas",r,a),h=l.context;h.save();Xg(h,this.getObject(t,s)),h.globalCompositeOperation="source-in",h.fillStyle=n?i.getPattern(h,this,_d(e),Mg):i,h.fillRect(0,0,r,a),h.restore(),e.save(),e.transform(...o),e.scale(1,-1),Vg(e,l.canvas,0,0,r,a,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):Oh("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;const s=this.getObject(t);if(!s)return void Oh("Dependent image isn't ready yet");const r=s.width,a=s.height,o=[];for(let t=0,s=n.length;t<s;t+=2)o.push({transform:[e,0,0,i,n[t],n[t+1]],x:0,y:0,w:r,h:a});this.paintInlineImageXObjectGroup(s,o)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:i,height:n}=t,s=this.cachedCanvases.getCanvas("inlineImage",i,n),r=s.context;return r.filter=this.current.transferMaps,r.drawImage(e,0,0),r.filter="none",s.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,n=this.ctx;if(this.save(),!jl){const{filter:t}=n;"none"!==t&&""!==t&&(n.filter="none")}let s;if(n.scale(1/e,-1/i),t.bitmap)s=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)s=t;else{const n=this.cachedCanvases.getCanvas("inlineImage",e,i).context;qg(n,t),s=this.applyTransferMapsToCanvas(n)}const r=this._scaleImage(s,_d(n));n.imageSmoothingEnabled=Jg(Ad(n),t.interpolate),Vg(n,r.img,0,0,r.paintWidth,r.paintHeight,0,-i,e,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx;let n;if(t.bitmap)n=t.bitmap;else{const e=t.width,i=t.height,s=this.cachedCanvases.getCanvas("inlineImage",e,i).context;qg(s,t),n=this.applyTransferMapsToCanvas(s)}for(const t of e)i.save(),i.transform(...t.transform),i.scale(1,-1),Vg(i,n,t.x,t.y,t.w,t.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(e||(this.pendingClip===em?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Ad(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),n=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,n)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:i,c:n,d:s}=this.ctx.getTransform();let r,a;if(0===i&&0===n){const i=Math.abs(e),n=Math.abs(s);if(i===n)if(0===t)r=a=1/i;else{const e=i*t;r=a=e<1?1/e:1}else if(0===t)r=1/i,a=1/n;else{const e=i*t,s=n*t;r=e<1?1/e:1,a=s<1?1/s:1}}else{const o=Math.abs(e*s-i*n),l=Math.hypot(e,i),h=Math.hypot(n,s);if(0===t)r=h/o,a=l/o;else{const e=t*o;r=h>e?h/e:1,a=l>e?l/e:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:i}=this.current,[n,s]=this.getScaleForStroking();if(e.lineWidth=i||1,1===n&&1===s)return void e.stroke();const r=e.getLineDash();if(t&&e.save(),e.scale(n,s),r.length>0){const t=Math.max(n,s);e.setLineDash(r.map((e=>e/t))),e.lineDashOffset/=t}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};let om=am;im=new WeakSet,nm=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},sm=new WeakSet,rm=function(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}};for(const t in Lh)void 0!==om.prototype[t]&&(om.prototype[Lh[t]]=om.prototype[t]);var lm,hm;class cm{static get workerPort(){return n(this,lm)}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");r(this,lm,t)}static get workerSrc(){return n(this,hm)}static set workerSrc(t){if("string"!=typeof t)throw new Error("Invalid `workerSrc` type.");r(this,hm,t)}}lm=new WeakMap,hm=new WeakMap,s(cm,lm,null),s(cm,hm,"");const dm=1,um=2,pm=1,fm=2,gm=3,mm=4,vm=5,ym=6,bm=7,wm=8;function Am(t){switch(t instanceof Error||"object"==typeof t&&null!==t||Wh('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new Yh(t.message);case"MissingPDFException":return new Gh(t.message);case"PasswordException":return new Hh(t.message,t.code);case"UnexpectedResponseException":return new qh(t.message,t.status);case"UnknownErrorException":return new Uh(t.message,t.details);default:return new Uh(t.message,t.toString())}}var _m,xm,Sm,km,Em,Cm,Mm,Rm;class Pm{constructor(t,e,i){s(this,_m),s(this,Sm),s(this,Em),this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream)return void o(this,Sm,km).call(this,e);if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===dm)i.resolve(e.data);else{if(e.callback!==um)throw new Error("Unexpected callback case");i.reject(Am(e.reason))}return}const n=this.actionHandler[e.action];if(!n)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,s=e.sourceName;new Promise((function(t){t(n(e.data))})).then((function(n){i.postMessage({sourceName:t,targetName:s,callback:dm,callbackId:e.callbackId,data:n})}),(function(n){i.postMessage({sourceName:t,targetName:s,callback:um,callbackId:e.callbackId,reason:Am(n)})}))}else e.streamId?o(this,_m,xm).call(this,e):n(e.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const n=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[n]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},i)}catch(t){s.reject(t)}return s.promise}sendWithStream(t,e,i,n){const s=this.streamId++,r=this.sourceName,a=this.targetName,o=this.comObj;return new ReadableStream({start:i=>{const l=Promise.withResolvers();return this.streamControllers[s]={controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:r,targetName:a,action:t,streamId:s,data:e,desiredSize:i.desiredSize},n),l.promise},pull:t=>{const e=Promise.withResolvers();return this.streamControllers[s].pullCall=e,o.postMessage({sourceName:r,targetName:a,stream:ym,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{jh(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();return this.streamControllers[s].cancelCall=e,this.streamControllers[s].isClosed=!0,o.postMessage({sourceName:r,targetName:a,stream:pm,streamId:s,reason:Am(t)}),e.promise}},i)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}_m=new WeakSet,xm=function(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this,a=this.actionHandler[t.action],o={enqueue(t,r=1,a){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=r,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:n,stream:mm,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:gm,streamId:e}),delete r.streamSinks[e])},error(t){jh(t instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:vm,streamId:e,reason:Am(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,new Promise((function(e){e(a(t.data,o))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:wm,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:wm,streamId:e,reason:Am(t)})}))},Sm=new WeakSet,km=function(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this.streamControllers[e],a=this.streamSinks[e];switch(t.stream){case wm:t.success?r.startCall.resolve():r.startCall.reject(Am(t.reason));break;case bm:t.success?r.pullCall.resolve():r.pullCall.reject(Am(t.reason));break;case ym:if(!a){s.postMessage({sourceName:i,targetName:n,stream:bm,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,new Promise((function(t){var e;t(null==(e=a.onPull)?void 0:e.call(a))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:bm,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:bm,streamId:e,reason:Am(t)})}));break;case mm:if(jh(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case gm:if(jh(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),o(this,Em,Cm).call(this,r,e);break;case vm:jh(r,"error should have stream controller"),r.controller.error(Am(t.reason)),o(this,Em,Cm).call(this,r,e);break;case fm:t.success?r.cancelCall.resolve():r.cancelCall.reject(Am(t.reason)),o(this,Em,Cm).call(this,r,e);break;case pm:if(!a)break;new Promise((function(e){var i;e(null==(i=a.onCancel)?void 0:i.call(a,Am(t.reason)))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:fm,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:fm,streamId:e,reason:Am(t)})})),a.sinkCapability.reject(Am(t.reason)),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},Em=new WeakSet,Cm=async function(t,e){var i,n,s;await Promise.allSettled([null==(i=t.startCall)?void 0:i.promise,null==(n=t.pullCall)?void 0:n.promise,null==(s=t.cancelCall)?void 0:s.promise]),delete this.streamControllers[e]};class Tm{constructor({parsedData:t,rawData:e}){s(this,Mm,void 0),s(this,Rm,void 0),r(this,Mm,t),r(this,Rm,e)}getRaw(){return n(this,Rm)}get(t){return n(this,Mm).get(t)??null}getAll(){return Qh(n(this,Mm))}has(t){return n(this,Mm).has(t)}}Mm=new WeakMap,Rm=new WeakMap;const Lm=Symbol("INTERNAL");var Im,Dm,Fm,Nm,Om,Wm,jm,Bm,$m,zm;class Hm{constructor(t,{name:e,intent:i,usage:n}){s(this,Im,!1),s(this,Dm,!1),s(this,Fm,!1),s(this,Nm,!0),r(this,Im,!!(t&Ul)),r(this,Dm,!!(t&Vl)),this.name=e,this.intent=i,this.usage=n}get visible(){if(n(this,Fm))return n(this,Nm);if(!n(this,Nm))return!1;const{print:t,view:e}=this.usage;return n(this,Im)?"OFF"!==(null==e?void 0:e.viewState):!n(this,Dm)||"OFF"!==(null==t?void 0:t.printState)}_setVisible(t,e,i=!1){t!==Lm&&Wh("Internal method `_setVisible` called."),r(this,Fm,i),r(this,Nm,e)}}Im=new WeakMap,Dm=new WeakMap,Fm=new WeakMap,Nm=new WeakMap;class Um{constructor(t,e=Ul){if(s(this,$m),s(this,Om,null),s(this,Wm,new Map),s(this,jm,null),s(this,Bm,null),this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,r(this,Bm,t.order);for(const i of t.groups)n(this,Wm).set(i.id,new Hm(e,i));if("OFF"===t.baseState)for(const t of n(this,Wm).values())t._setVisible(Lm,!1);for(const e of t.on)n(this,Wm).get(e)._setVisible(Lm,!0);for(const e of t.off)n(this,Wm).get(e)._setVisible(Lm,!1);r(this,jm,this.getHash())}}isVisible(t){if(0===n(this,Wm).size)return!0;if(!t)return Nh("Optional content group not defined."),!0;if("OCG"===t.type)return n(this,Wm).has(t.id)?n(this,Wm).get(t.id).visible:(Oh(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return o(this,$m,zm).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!n(this,Wm).has(e))return Oh(`Optional content group not found: ${e}`),!0;if(n(this,Wm).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!n(this,Wm).has(e))return Oh(`Optional content group not found: ${e}`),!0;if(!n(this,Wm).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!n(this,Wm).has(e))return Oh(`Optional content group not found: ${e}`),!0;if(!n(this,Wm).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!n(this,Wm).has(e))return Oh(`Optional content group not found: ${e}`),!0;if(n(this,Wm).get(e).visible)return!1}return!0}return Oh(`Unknown optional content policy ${t.policy}.`),!0}return Oh(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0){const i=n(this,Wm).get(t);i?(i._setVisible(Lm,!!e,!0),r(this,Om,null)):Oh(`Optional content group not found: ${t}`)}setOCGState({state:t,preserveRB:e}){let i;for(const e of t){switch(e){case"ON":case"OFF":case"Toggle":i=e;continue}const t=n(this,Wm).get(e);if(t)switch(i){case"ON":t._setVisible(Lm,!0);break;case"OFF":t._setVisible(Lm,!1);break;case"Toggle":t._setVisible(Lm,!t.visible)}}r(this,Om,null)}get hasInitialVisibility(){return null===n(this,jm)||this.getHash()===n(this,jm)}getOrder(){return n(this,Wm).size?n(this,Bm)?n(this,Bm).slice():[...n(this,Wm).keys()]:null}getGroups(){return n(this,Wm).size>0?Qh(n(this,Wm)):null}getGroup(t){return n(this,Wm).get(t)||null}getHash(){if(null!==n(this,Om))return n(this,Om);const t=new ug;for(const[e,i]of n(this,Wm))t.update(`${e}:${i.visible}`);return r(this,Om,t.hexdigest())}}Om=new WeakMap,Wm=new WeakMap,jm=new WeakMap,Bm=new WeakMap,$m=new WeakSet,zm=function(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let s=1;s<e;s++){const e=t[s];let r;if(Array.isArray(e))r=o(this,$m,zm).call(this,e);else{if(!n(this,Wm).has(e))return Oh(`Optional content group not found: ${e}`),!0;r=n(this,Wm).get(e).visible}switch(i){case"And":if(!r)return!1;break;case"Or":if(r)return!0;break;case"Not":return!r;default:return!0}}return"And"===i};class Vm{constructor(t,{disableRange:e=!1,disableStream:i=!1}){jh(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:n,initialData:s,progressiveDone:r,contentDispositionFilename:a}=t;if(this._queuedChunks=[],this._progressiveDone=r,this._contentDispositionFilename=a,(null==s?void 0:s.length)>0){const t=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!e,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})})),t.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})})),t.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})})),t.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),t.transportReady()}_onReceiveData({begin:t,chunk:e}){const i=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{jh(this._rangeReaders.some((function(e){return e._begin===t&&(e._enqueue(i),!0)})),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t;return(null==(t=this._fullRequestReader)?void 0:t._loaded)??0}_onProgress(t){var e,i,n,s;void 0===t.total?null==(i=null==(e=this._rangeReaders[0])?void 0:e.onProgress)||i.call(e,{loaded:t.loaded}):null==(s=null==(n=this._fullRequestReader)?void 0:n.onProgress)||s.call(n,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;null==(t=this._fullRequestReader)||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){jh(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Gm(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new qm(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){var e;null==(e=this._fullRequestReader)||e.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}}class Gm{constructor(t,e,i=!1,n=null){this._stream=t,this._done=i||!1,this._filename=cd(n)?n:null,this._queuedChunks=e||[],this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class qm{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Xm({getResponseHeader:t,isHttp:e,rangeChunkSize:i,disableRange:n}){const s={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(t("Content-Length"),10);return!Number.isInteger(r)||(s.suggestedLength=r,r<=2*i)||n||!e||"bytes"!==t("Accept-Ranges")||"identity"!==(t("Content-Encoding")||"identity")||(s.allowRangeRequests=!0),s}function Ym(t){const e=t("Content-Disposition");if(e){let t=function(t){let e=!0,i=n("filename\\*","i").exec(t);if(i){i=i[1];let t=a(i);return t=unescape(t),t=o(t),t=l(t),r(t)}if(i=function(t){const e=[];let i;const s=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=s.exec(t));){let[,t,n,s]=i;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[n,s]}const r=[];for(let t=0;t<e.length&&t in e;++t){let[i,n]=e[t];n=a(n),i&&(n=unescape(n),0===t&&(n=o(n))),r.push(n)}return r.join("")}(t),i)return r(l(i));if(i=n("filename","i").exec(t),i){i=i[1];let t=a(i);return t=l(t),r(t)}function n(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function s(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const n=new TextDecoder(t,{fatal:!0}),s=Jh(i);i=n.decode(s),e=!1}catch{}}return i}function r(t){return e&&/[\x80-\xff]/.test(t)&&(t=s("utf-8",t),e&&(t=s("iso-8859-1",t))),t}function a(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const i=e[t].indexOf('"');-1!==i&&(e[t]=e[t].slice(0,i),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function o(t){const e=t.indexOf("'");return-1===e?t:s(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function l(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,i,n){if("q"===i||"Q"===i)return s(e,n=(n=n.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})));try{n=atob(n)}catch{}return s(e,n)}))}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(cd(t))return t}return null}function Km(t,e){return 404===t||0===t&&e.startsWith("file:")?new Gh('Missing PDF "'+e+'".'):new qh(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function Jm(t){return 200===t||206===t}function Qm(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Zm(t){const e=new Headers;for(const i in t){const n=t[i];void 0!==n&&e.append(i,n)}return e}function tv(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(Oh(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class ev{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return(null==(t=this._fullRequestReader)?void 0:t._loaded)??0}getFullReader(){return jh(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new iv(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new nv(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null==(e=this._fullRequestReader)||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class iv{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._headers=Zm(this._stream.httpHeaders);const i=e.url;fetch(i,Qm(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!Jm(t.status))throw Km(t.status,i);this._reader=t.body.getReader(),this._headersCapability.resolve();const e=e=>t.headers.get(e),{allowRangeRequests:n,suggestedLength:s}=Xm({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=Ym(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Yh("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._headersCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null==(t=this.onProgress)||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:tv(e),done:!1})}cancel(t){var e;null==(e=this._reader)||e.cancel(t),this._abortController.abort()}}class nv{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const n=t.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController,this._headers=Zm(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-${i-1}`);const s=n.url;fetch(s,Qm(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!Jm(t.status))throw Km(t.status,s);this._readCapability.resolve(),this._reader=t.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null==(t=this.onProgress)||t.call(this,{loaded:this._loaded}),{value:tv(e),done:!1})}cancel(t){var e;null==(e=this._reader)||e.cancel(t),this._abortController.abort()}}class sv{constructor(t,e={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,i){const n={begin:t,end:e};for(const t in i)n[t]=i[t];return this.request(n)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const t in this.httpHeaders){const i=this.httpHeaders[t];void 0!==i&&e.setRequestHeader(t,i)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),n.expectedStatus=206):n.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(i){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=t.onHeadersReceived,n.onDone=t.onDone,n.onError=t.onError,n.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){var i;const n=this.pendingRequests[t];n&&(null==(i=n.onProgress)||i.call(n,e))}onStateChange(t,e){var i,n,s;const r=this.pendingRequests[t];if(!r)return;const a=r.xhr;if(a.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),4!==a.readyState||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===a.status&&this.isHttp)return void(null==(i=r.onError)||i.call(r,a.status));const o=a.status||200;if((200!==o||206!==r.expectedStatus)&&o!==r.expectedStatus)return void(null==(n=r.onError)||n.call(r,a.status));const l=function(t){const e=t.response;return"string"!=typeof e?e:Jh(e).buffer}(a);if(206===o){const t=a.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);r.onDone({begin:parseInt(e[1],10),chunk:l})}else l?r.onDone({begin:0,chunk:l}):null==(s=r.onError)||s.call(r,a.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class rv{constructor(t){this._source=t,this._manager=new sv(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return jh(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new av(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new ov(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null==(e=this._fullRequestReader)||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class av{constructor(t,e){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(i),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),i=t=>e.getResponseHeader(t),{allowRangeRequests:n,suggestedLength:s}=Xm({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=Ym(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=Km(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;null==(e=this.onProgress)||e.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class ov{constructor(t,e,i){this._manager=t;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,n),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var t;null==(t=this.onClosed)||t.call(this,this)}_onDone(t){const e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=Km(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||null==(e=this.onProgress)||e.call(this,{loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const lv=/^file:\/\/\/[a-zA-Z]:\//;class hv{constructor(t){this.source=t,this.url=function(t){const e=Eg.get("url"),i=e.parse(t);return"file:"===i.protocol||i.host?i:/^[a-z]:[/\\]/i.test(t)?e.parse(`file:///${t}`):(i.host||(i.protocol="file:"),i)}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return(null==(t=this._fullRequestReader)?void 0:t._loaded)??0}getFullReader(){return jh(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new gv(this):new pv(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new mv(this,t,e):new fv(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null==(e=this._fullRequestReader)||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class cv{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,null==(t=this.onProgress)||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Yh("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class dv{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,null==(t=this.onProgress)||t.call(this,{loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function uv(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class pv extends cv{constructor(t){super(t);const e=e=>{if(404===e.statusCode){const t=new Gh(`Missing PDF "${this._url}".`);return this._storedError=t,void this._headersCapability.reject(t)}this._headersCapability.resolve(),this._setReadableStream(e);const i=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:n,suggestedLength:s}=Xm({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=Ym(i)};if(this._request=null,"http:"===this._url.protocol){const i=Eg.get("http");this._request=i.request(uv(this._url,t.httpHeaders),e)}else{const i=Eg.get("https");this._request=i.request(uv(this._url,t.httpHeaders),e)}this._request.on("error",(t=>{this._storedError=t,this._headersCapability.reject(t)})),this._request.end()}}class fv extends dv{constructor(t,e,i){super(t),this._httpHeaders={};for(const e in t.httpHeaders){const i=t.httpHeaders[e];void 0!==i&&(this._httpHeaders[e]=i)}this._httpHeaders.Range=`bytes=${e}-${i-1}`;const n=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new Gh(`Missing PDF "${this._url}".`);this._storedError=t}};if(this._request=null,"http:"===this._url.protocol){const t=Eg.get("http");this._request=t.request(uv(this._url,this._httpHeaders),n)}else{const t=Eg.get("https");this._request=t.request(uv(this._url,this._httpHeaders),n)}this._request.on("error",(t=>{this._storedError=t})),this._request.end()}}class gv extends cv{constructor(t){super(t);let e=decodeURIComponent(this._url.path);lv.test(this._url.href)&&(e=e.replace(/^\//,""));const i=Eg.get("fs");i.promises.lstat(e).then((t=>{this._contentLength=t.size,this._setReadableStream(i.createReadStream(e)),this._headersCapability.resolve()}),(t=>{"ENOENT"===t.code&&(t=new Gh(`Missing PDF "${e}".`)),this._storedError=t,this._headersCapability.reject(t)}))}}class mv extends dv{constructor(t,e,i){super(t);let n=decodeURIComponent(this._url.path);lv.test(this._url.href)&&(n=n.replace(/^\//,""));const s=Eg.get("fs");this._setReadableStream(s.createReadStream(n,{start:e,end:i-1}))}}const vv=30;var yv,bv,wv,Av,_v,xv,Sv,kv,Ev,Cv,Mv,Rv,Pv,Tv,Lv,Iv,Dv,Fv,Nv,Ov,Wv,jv,Bv,$v,zv,Hv,Uv,Vv,Gv,qv,Xv,Yv,Kv,Jv,Qv,Zv;let ty=(Ov=class{constructor({textContentSource:t,container:e,viewport:i}){var a;if(s(this,zv),s(this,Uv),s(this,Gv),s(this,bv,Promise.withResolvers()),s(this,wv,null),s(this,Av,!1),s(this,_v,!(null==(yv=globalThis.FontInspector)||!yv.enabled)),s(this,xv,null),s(this,Sv,null),s(this,kv,0),s(this,Ev,0),s(this,Cv,null),s(this,Mv,null),s(this,Rv,0),s(this,Pv,0),s(this,Tv,Object.create(null)),s(this,Lv,[]),s(this,Iv,null),s(this,Dv,[]),s(this,Fv,new WeakMap),s(this,Nv,null),t instanceof ReadableStream)r(this,Iv,t);else{if("object"!=typeof t)throw new Error('No "textContentSource" parameter specified.');r(this,Iv,new ReadableStream({start(e){e.enqueue(t),e.close()}}))}r(this,wv,r(this,Mv,e)),r(this,Pv,i.scale*(globalThis.devicePixelRatio||1)),r(this,Rv,i.rotation),r(this,Sv,{prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null});const{pageWidth:l,pageHeight:h,pageX:c,pageY:d}=i.rawDims;r(this,Nv,[1,0,0,-1,-c,d+h]),r(this,Ev,l),r(this,kv,h),o(a=Ov,Kv,Jv).call(a),xd(e,i),n(this,bv).promise.catch((()=>{})).then((()=>{n(Ov,$v).delete(this),r(this,Sv,null),r(this,Tv,null)}))}render(){const t=()=>{n(this,Cv).read().then((({value:e,done:i})=>{i?n(this,bv).resolve():(n(this,xv)??r(this,xv,e.lang),Object.assign(n(this,Tv),e.styles),o(this,zv,Hv).call(this,e.items),t())}),n(this,bv).reject)};return r(this,Cv,n(this,Iv).getReader()),n(Ov,$v).add(this),t(),n(this,bv).promise}update({viewport:t,onBefore:e=null}){var i;const s=t.scale*(globalThis.devicePixelRatio||1),a=t.rotation;if(a!==n(this,Rv)&&(null==e||e(),r(this,Rv,a),xd(n(this,Mv),{rotation:a})),s!==n(this,Pv)){null==e||e(),r(this,Pv,s);const t={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:o(i=Ov,Xv,Yv).call(i,n(this,xv))};for(const e of n(this,Dv))t.properties=n(this,Fv).get(e),t.div=e,o(this,Gv,qv).call(this,t)}}cancel(){var t;const e=new Yh("TextLayer task cancelled.");null==(t=n(this,Cv))||t.cancel(e).catch((()=>{})),r(this,Cv,null),n(this,bv).reject(e)}get textDivs(){return n(this,Dv)}get textContentItemsStr(){return n(this,Lv)}static cleanup(){if(!(n(this,$v).size>0)){n(this,Wv).clear();for(const{canvas:t}of n(this,jv).values())t.remove();n(this,jv).clear()}}},bv=new WeakMap,wv=new WeakMap,Av=new WeakMap,_v=new WeakMap,xv=new WeakMap,Sv=new WeakMap,kv=new WeakMap,Ev=new WeakMap,Cv=new WeakMap,Mv=new WeakMap,Rv=new WeakMap,Pv=new WeakMap,Tv=new WeakMap,Lv=new WeakMap,Iv=new WeakMap,Dv=new WeakMap,Fv=new WeakMap,Nv=new WeakMap,Wv=new WeakMap,jv=new WeakMap,Bv=new WeakMap,$v=new WeakMap,zv=new WeakSet,Hv=function(t){var e,i;if(n(this,Av))return;(i=n(this,Sv)).ctx??(i.ctx=o(e=Ov,Xv,Yv).call(e,n(this,xv)));const s=n(this,Dv),a=n(this,Lv);for(const e of t){if(s.length>1e5)return Oh("Ignoring additional textDivs for performance reasons."),void r(this,Av,!0);if(void 0!==e.str)a.push(e.str),o(this,Uv,Vv).call(this,e);else if("beginMarkedContentProps"===e.type||"beginMarkedContent"===e.type){const t=n(this,wv);r(this,wv,document.createElement("span")),n(this,wv).classList.add("markedContent"),null!==e.id&&n(this,wv).setAttribute("id",`${e.id}`),t.append(n(this,wv))}else"endMarkedContent"===e.type&&r(this,wv,n(this,wv).parentNode)}},Uv=new WeakSet,Vv=function(t){var e;const i=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};n(this,Dv).push(i);const r=rc.transform(n(this,Nv),t.transform);let a=Math.atan2(r[1],r[0]);const l=n(this,Tv)[t.fontName];l.vertical&&(a+=Math.PI/2);const h=n(this,_v)&&l.fontSubstitution||l.fontFamily,c=Math.hypot(r[2],r[3]),d=c*o(e=Ov,Qv,Zv).call(e,h,n(this,xv));let u,p;0===a?(u=r[4],p=r[5]-d):(u=r[4]+d*Math.sin(a),p=r[5]-d*Math.cos(a));const f="calc(var(--scale-factor)*",g=i.style;n(this,wv)===n(this,Mv)?(g.left=`${(100*u/n(this,Ev)).toFixed(2)}%`,g.top=`${(100*p/n(this,kv)).toFixed(2)}%`):(g.left=`${f}${u.toFixed(2)}px)`,g.top=`${f}${p.toFixed(2)}px)`),g.fontSize=`${f}${(n(Ov,Bv)*c).toFixed(2)}px)`,g.fontFamily=h,s.fontSize=c,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,n(this,_v)&&(i.dataset.fontName=l.fontSubstitutionLoadedName||t.fontName),0!==a&&(s.angle=a*(180/Math.PI));let m=!1;if(t.str.length>1)m=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),i=Math.abs(t.transform[3]);e!==i&&Math.max(e,i)/Math.min(e,i)>1.5&&(m=!0)}if(m&&(s.canvasWidth=l.vertical?t.height:t.width),n(this,Fv).set(i,s),n(this,Sv).div=i,n(this,Sv).properties=s,o(this,Gv,qv).call(this,n(this,Sv)),s.hasText&&n(this,wv).append(i),s.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),n(this,wv).append(t)}},Gv=new WeakSet,qv=function(t){const{div:e,properties:i,ctx:s,prevFontSize:r,prevFontFamily:a}=t,{style:o}=e;let l="";if(n(Ov,Bv)>1&&(l=`scale(${1/n(Ov,Bv)})`),0!==i.canvasWidth&&i.hasText){const{fontFamily:h}=o,{canvasWidth:c,fontSize:d}=i;(r!==d||a!==h)&&(s.font=`${d*n(this,Pv)}px ${h}`,t.prevFontSize=d,t.prevFontFamily=h);const{width:u}=s.measureText(e.textContent);u>0&&(l=`scaleX(${c*n(this,Pv)/u}) ${l}`)}0!==i.angle&&(l=`rotate(${i.angle}deg) ${l}`),l.length>0&&(o.transform=l)},Xv=new WeakSet,Yv=function(t=null){let e=n(this,jv).get(t||(t=""));if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),n(this,jv).set(t,e)}return e},Kv=new WeakSet,Jv=function(){if(null!==n(this,Bv))return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),r(this,Bv,t.getBoundingClientRect().height),t.remove()},Qv=new WeakSet,Zv=function(t,e){const i=n(this,Wv).get(t);if(i)return i;const s=o(this,Xv,Yv).call(this,e),r=s.font;s.canvas.width=s.canvas.height=vv,s.font=`30px ${t}`;const a=s.measureText("");let l=a.fontBoundingBoxAscent,h=Math.abs(a.fontBoundingBoxDescent);if(l){const e=l/(l+h);return n(this,Wv).set(t,e),s.canvas.width=s.canvas.height=0,s.font=r,e}s.strokeStyle="red",s.clearRect(0,0,vv,vv),s.strokeText("g",0,0);let c=s.getImageData(0,0,vv,vv).data;h=0;for(let t=c.length-1-3;t>=0;t-=4)if(c[t]>0){h=Math.ceil(t/4/vv);break}s.clearRect(0,0,vv,vv),s.strokeText("A",0,vv),c=s.getImageData(0,0,vv,vv).data,l=0;for(let t=0,e=c.length;t<e;t+=4)if(c[t]>0){l=vv-Math.floor(t/4/vv);break}s.canvas.width=s.canvas.height=0,s.font=r;const d=l?l/(l+h):.8;return n(this,Wv).set(t,d),d},s(Ov,Xv),s(Ov,Kv),s(Ov,Qv),s(Ov,Wv,new Map),s(Ov,jv,new Map),s(Ov,Bv,null),s(Ov,$v,new Set),Ov);function ey(){md("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:t,container:e,viewport:i,...n}=arguments[0],s=Object.keys(n);s.length>0&&Oh("Ignoring `renderTextLayer` parameters: "+s.join(", "));const r=new ty({textContentSource:t,container:e,viewport:i}),{textDivs:a,textContentItemsStr:o}=r;return{promise:r.render(),textDivs:a,textContentItemsStr:o}}function iy(){md("`updateTextLayer`, please use `TextLayer` instead.")}class ny{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){var n;if(!i)return;let s=null;const r=i.name;if("#text"===r)s=i.value;else{if(!ny.shouldBuildText(r))return;null!=(n=null==i?void 0:i.attributes)&&n.textContent?s=i.attributes.textContent:i.value&&(s=i.value)}if(null!==s&&e.push({str:s}),i.children)for(const e of i.children)t(e)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}const sy=65536,ry=jl?class extends _c{_createCanvas(t,e){return Eg.get("canvas").createCanvas(t,e)}}:class extends _c{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}={}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}},ay=jl?class extends xc{_fetchData(t,e){return Cg(t).then((t=>({cMapData:t,compressionType:e})))}}:sd,oy=jl?class extends bc{}:class extends bc{constructor({docId:t,ownerDocument:e=globalThis.document}={}){super(),s(this,Fc),s(this,Oc),s(this,jc),s(this,$c),s(this,Hc),s(this,Vc),s(this,qc),s(this,Yc),s(this,Jc),s(this,Zc),s(this,ed),s(this,Rc,void 0),s(this,Pc,void 0),s(this,Tc,void 0),s(this,Lc,void 0),s(this,Ic,void 0),s(this,Dc,0),r(this,Tc,t),r(this,Lc,e)}addFilter(t){if(!t)return"none";let e=n(this,Fc,Nc).get(t);if(e)return e;const[i,s,r]=o(this,$c,zc).call(this,t),l=1===t.length?i:`${i}${s}${r}`;if(e=n(this,Fc,Nc).get(l),e)return n(this,Fc,Nc).set(t,e),e;const h=`g_${n(this,Tc)}_transfer_map_${a(this,Dc)._++}`,c=`url(#${h})`;n(this,Fc,Nc).set(t,c),n(this,Fc,Nc).set(l,c);const d=o(this,qc,Xc).call(this,h);return o(this,Jc,Qc).call(this,i,s,r,d),c}addHCMFilter(t,e){var i;const s=`${t}-${e}`,r="base";let a=n(this,Oc,Wc).get(r);if((null==a?void 0:a.key)===s||(a?(null==(i=a.filter)||i.remove(),a.key=s,a.url="none",a.filter=null):(a={key:s,url:"none",filter:null},n(this,Oc,Wc).set(r,a)),!t||!e))return a.url;const l=o(this,ed,id).call(this,t);t=rc.makeHexColor(...l);const h=o(this,ed,id).call(this,e);if(e=rc.makeHexColor(...h),n(this,jc,Bc).style.color="","#000000"===t&&"#ffffff"===e||t===e)return a.url;const c=new Array(256);for(let t=0;t<=255;t++){const e=t/255;c[t]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}const d=c.join(","),u=`g_${n(this,Tc)}_hcm_filter`,p=a.filter=o(this,qc,Xc).call(this,u);o(this,Jc,Qc).call(this,d,d,d,p),o(this,Vc,Gc).call(this,p);const f=(t,e)=>{const i=l[t]/255,n=h[t]/255,s=new Array(e+1);for(let t=0;t<=e;t++)s[t]=i+t/e*(n-i);return s.join(",")};return o(this,Jc,Qc).call(this,f(0,5),f(1,5),f(2,5),p),a.url=`url(#${u})`,a.url}addAlphaFilter(t){let e=n(this,Fc,Nc).get(t);if(e)return e;const[i]=o(this,$c,zc).call(this,[t]),s=`alpha_${i}`;if(e=n(this,Fc,Nc).get(s),e)return n(this,Fc,Nc).set(t,e),e;const r=`g_${n(this,Tc)}_alpha_map_${a(this,Dc)._++}`,l=`url(#${r})`;n(this,Fc,Nc).set(t,l),n(this,Fc,Nc).set(s,l);const h=o(this,qc,Xc).call(this,r);return o(this,Zc,td).call(this,i,h),l}addLuminosityFilter(t){let e,i,s=n(this,Fc,Nc).get(t||"luminosity");if(s)return s;if(t?([e]=o(this,$c,zc).call(this,[t]),i=`luminosity_${e}`):i="luminosity",s=n(this,Fc,Nc).get(i),s)return n(this,Fc,Nc).set(t,s),s;const r=`g_${n(this,Tc)}_luminosity_map_${a(this,Dc)._++}`,l=`url(#${r})`;n(this,Fc,Nc).set(t,l),n(this,Fc,Nc).set(i,l);const h=o(this,qc,Xc).call(this,r);return o(this,Hc,Uc).call(this,h),t&&o(this,Zc,td).call(this,e,h),l}addHighlightHCMFilter(t,e,i,s,r){var a;const l=`${e}-${i}-${s}-${r}`;let h=n(this,Oc,Wc).get(t);if((null==h?void 0:h.key)===l||(h?(null==(a=h.filter)||a.remove(),h.key=l,h.url="none",h.filter=null):(h={key:l,url:"none",filter:null},n(this,Oc,Wc).set(t,h)),!e||!i))return h.url;const[c,d]=[e,i].map(o(this,ed,id).bind(this));let u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),p=Math.round(.2126*d[0]+.7152*d[1]+.0722*d[2]),[f,g]=[s,r].map(o(this,ed,id).bind(this));p<u&&([u,p,f,g]=[p,u,g,f]),n(this,jc,Bc).style.color="";const m=(t,e,i)=>{const n=new Array(256),s=(p-u)/i,r=t/255,a=(e-t)/(255*i);let o=0;for(let t=0;t<=i;t++){const e=Math.round(u+t*s),i=r+t*a;for(let t=o;t<=e;t++)n[t]=i;o=e+1}for(let t=o;t<256;t++)n[t]=n[o-1];return n.join(",")},v=`g_${n(this,Tc)}_hcm_${t}_filter`,y=h.filter=o(this,qc,Xc).call(this,v);return o(this,Vc,Gc).call(this,y),o(this,Jc,Qc).call(this,m(f[0],g[0],5),m(f[1],g[1],5),m(f[2],g[2],5),y),h.url=`url(#${v})`,h.url}destroy(t=!1){t&&0!==n(this,Oc,Wc).size||(n(this,Pc)&&(n(this,Pc).parentNode.parentNode.remove(),r(this,Pc,null)),n(this,Rc)&&(n(this,Rc).clear(),r(this,Rc,null)),r(this,Dc,0))}},ly=jl?class extends Sc{_fetchData(t){return Cg(t)}}:rd;function hy(t={}){"string"==typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new py,{docId:i}=e,n=t.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(jl&&"string"==typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,s=t.data?function(t){if(jl&&typeof Buffer<"u"&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return Jh(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"==typeof t&&!isNaN(null==t?void 0:t.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,r=t.httpHeaders||null,a=!0===t.withCredentials,o=t.password??null,l=t.range instanceof fy?t.range:null,h=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:sy;let c=t.worker instanceof Iy?t.worker:null;const d=t.verbosity,u="string"!=typeof t.docBaseUrl||hd(t.docBaseUrl)?null:t.docBaseUrl,p="string"==typeof t.cMapUrl?t.cMapUrl:null,f=!1!==t.cMapPacked,g=t.CMapReaderFactory||ay,m="string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,v=t.StandardFontDataFactory||ly,y=!0!==t.stopAtErrors,b=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,w=!1!==t.isEvalSupported,A="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!jl,_=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,x="boolean"==typeof t.disableFontFace?t.disableFontFace:jl,S=!0===t.fontExtraProperties,k=!0===t.enableXfa,E=t.ownerDocument||globalThis.document,C=!0===t.disableRange,M=!0===t.disableStream,R=!0===t.disableAutoFetch,P=!0===t.pdfBug,T=!0===t.enableHWA,L=l?l.length:t.length??NaN,I="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!jl&&!x,D="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:g===sd&&v===rd&&p&&m&&fd(p,document.baseURI)&&fd(m,document.baseURI),F=t.canvasFactory||new ry({ownerDocument:E,enableHWA:T}),N=t.filterFactory||new oy({docId:i,ownerDocument:E});!function(t){Number.isInteger(t)&&(Dh=t)}(d);const O={canvasFactory:F,filterFactory:N};if(D||(O.cMapReaderFactory=new g({baseUrl:p,isCompressed:f}),O.standardFontDataFactory=new v({baseUrl:m})),!c){const t={verbosity:d,port:cm.workerPort};c=t.port?Iy.fromPort(t):new Iy(t),e._worker=c}const W={docId:i,apiVersion:"4.4.168",data:s,password:o,disableAutoFetch:R,rangeChunkSize:h,length:L,docBaseUrl:u,enableXfa:k,evaluatorOptions:{maxImageSize:b,disableFontFace:x,ignoreErrors:y,isEvalSupported:w,isOffscreenCanvasSupported:A,canvasMaxAreaInBytes:_,fontExtraProperties:S,useSystemFonts:I,cMapUrl:D?p:null,standardFontDataUrl:D?m:null}},j={disableFontFace:x,fontExtraProperties:S,ownerDocument:E,pdfBug:P,styleElement:null,loadingParams:{disableAutoFetch:R,enableXfa:k}};return c.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const t=c.messageHandler.sendWithPromise("GetDocRequest",W,s?[s.buffer]:null);let o;if(l)o=new Vm(l,{disableRange:C,disableStream:M});else if(!s){if(!n)throw new Error("getDocument - no `url` parameter provided.");d={url:n,length:L,httpHeaders:r,withCredentials:a,rangeChunkSize:h,disableRange:C,disableStream:M},o=jl?typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype&&fd(d.url)?new ev(d):new hv(d):fd(d.url)?new ev(d):new rv(d)}var d;return t.then((t=>{if(e.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const n=new Pm(i,t,c.port),s=new $y(n,e,o,j,O);e._transport=s,n.send("Ready",null)}))})).catch(e._capability.reject),e}function cy(t){return"object"==typeof t&&Number.isInteger(null==t?void 0:t.num)&&t.num>=0&&Number.isInteger(null==t?void 0:t.gen)&&t.gen>=0}var dy;const uy=class{constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d"+a(uy,dy)._++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var t,e,i;this.destroyed=!0;try{null!=(t=this._worker)&&t.port&&(this._worker._pendingDestroy=!0),await(null==(e=this._transport)?void 0:e.destroy())}catch(t){throw null!=(i=this._worker)&&i.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};let py=uy;dy=new WeakMap,s(py,dy,0);let fy=class{constructor(t,e,i=!1,n=null){this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const i of this._progressListeners)i(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){Wh("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class gy{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return $h(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var my,vy,yy,by,wy,Ay,_y,xy;class Sy{constructor(t,e,i,n=!1){s(this,yy),s(this,wy),s(this,my,null),s(this,vy,!1),this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new pd:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new Yy,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:s=!1}={}){return new od({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return $h(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return(null==(t=this._transport._htmlForXfa)?void 0:t.children[this._pageIndex])||null}render({canvasContext:t,viewport:e,intent:i="display",annotationMode:n=Kl.ENABLE,transform:s=null,background:a=null,optionalContentConfigPromise:l=null,annotationCanvasMap:h=null,pageColors:c=null,printAnnotationStorage:d=null}){var u,p;null==(u=this._stats)||u.time("Overall");const f=this._transport.getRenderingIntent(i,n,d),{renderingIntent:g,cacheKey:m}=f;r(this,vy,!1),o(this,wy,Ay).call(this),l||(l=this._transport.getOptionalContentConfig(g));let v=this._intentStates.get(m);v||(v=Object.create(null),this._intentStates.set(m,v)),v.streamReaderCancelTimeout&&(clearTimeout(v.streamReaderCancelTimeout),v.streamReaderCancelTimeout=null);const y=!!(g&Vl);v.displayReadyCapability||(v.displayReadyCapability=Promise.withResolvers(),v.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null==(p=this._stats)||p.time("Page Request"),this._pumpOperatorList(f));const b=t=>{var e;v.renderTasks.delete(w),(this._maybeCleanupAfterRender||y)&&r(this,vy,!0),o(this,yy,by).call(this,!y),t?(w.capability.reject(t),this._abortOperatorList({intentState:v,reason:t instanceof Error?t:new Error(t)})):w.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),null!=(e=globalThis.Stats)&&e.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},w=new Qy({callback:b,params:{canvasContext:t,viewport:e,transform:s,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:v.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!y,pdfBug:this._pdfBug,pageColors:c});(v.renderTasks||(v.renderTasks=new Set)).add(w);const A=w.task;return Promise.all([v.displayReadyCapability.promise,l]).then((([t,e])=>{var i;if(this.destroyed)b();else{if(null==(i=this._stats)||i.time("Rendering"),!(e.renderingIntent&g))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");w.initializeGraphics({transparency:t,optionalContentConfig:e}),w.operatorListChanged()}})).catch(b),A}getOperatorList({intent:t="display",annotationMode:e=Kl.ENABLE,printAnnotationStorage:i=null}={}){var n;const s=this._transport.getRenderingIntent(t,e,i,!0);let r,a=this._intentStates.get(s.cacheKey);return a||(a=Object.create(null),this._intentStates.set(s.cacheKey,a)),a.opListReadCapability||(r=Object.create(null),r.operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(r))},a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||(a.renderTasks=new Set)).add(r),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null==(n=this._stats)||n.time("Page Request"),this._pumpOperatorList(s)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then((t=>ny.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,i){const n=e.getReader(),s={items:[],styles:Object.create(null),lang:null};!function e(){n.read().then((function({value:i,done:n}){n?t(s):(s.lang??(s.lang=i.lang),Object.assign(s.styles,i.styles),s.items.push(...i.items),e())}),i)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),r(this,vy,!1),o(this,wy,Ay).call(this),Promise.all(t)}cleanup(t=!1){r(this,vy,!0);const e=o(this,yy,by).call(this,!1);return t&&e&&this._stats&&(this._stats=new pd),e}_startRenderPage(t,e){var i,n;const s=this._intentStates.get(e);s&&(null==(i=this._stats)||i.timeEnd("Page Request"),null==(n=s.displayReadyCapability)||n.resolve(t))}_renderPageChunk(t,e){for(let i=0,n=t.length;i<n;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const t of e.renderTasks)t.operatorListChanged();t.lastChunk&&o(this,yy,by).call(this,!0)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:i}){const{map:n,transfer:s}=i,r=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:n},s).getReader(),a=this._intentStates.get(e);a.streamReader=r;const l=()=>{r.read().then((({value:t,done:e})=>{e?a.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,a),l())}),(t=>{if(a.streamReader=null,!this._transport.destroyed){if(a.operatorList){a.operatorList.lastChunk=!0;for(const t of a.renderTasks)t.operatorListChanged();o(this,yy,by).call(this,!0)}if(a.displayReadyCapability)a.displayReadyCapability.reject(t);else{if(!a.opListReadCapability)throw t;a.opListReadCapability.reject(t)}}}))};l()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(e instanceof ld){let i=100;return e.extraDelay>0&&e.extraDelay<1e3&&(i+=e.extraDelay),void(t.streamReaderCancelTimeout=setTimeout((()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})}),i))}}if(t.streamReader.cancel(new Yh(e.message)).catch((()=>{})),t.streamReader=null,!this._transport.destroyed){for(const[e,i]of this._intentStates)if(i===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}my=new WeakMap,vy=new WeakMap,yy=new WeakSet,by=function(t=!1){if(o(this,wy,Ay).call(this),!n(this,vy)||this.destroyed)return!1;if(t)return r(this,my,setTimeout((()=>{r(this,my,null),o(this,yy,by).call(this,!1)}),5e3)),!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),r(this,vy,!1),!0},wy=new WeakSet,Ay=function(){n(this,my)&&(clearTimeout(n(this,my)),r(this,my,null))};class ky{constructor(){s(this,_y,new Set),s(this,xy,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};n(this,xy).then((()=>{for(const t of n(this,_y))t.call(this,i)}))}addEventListener(t,e){n(this,_y).add(e)}removeEventListener(t,e){n(this,_y).delete(e)}terminate(){n(this,_y).clear()}}_y=new WeakMap,xy=new WeakMap;const Ey={isWorkerDisabled:!1,fakeWorkerId:0};var Cy,My,Ry,Py,Ty;jl&&(Ey.isWorkerDisabled=!0,cm.workerSrc||(cm.workerSrc="./pdf.worker.mjs")),Ey.isSameOrigin=function(t,e){let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch{return!1}const n=new URL(e,i);return i.origin===n.origin},Ey.createCDNWrapper=function(t){const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};const Ly=class{constructor({name:t=null,port:e=null,verbosity:i=Fh()}={}){var a;if(s(this,My),this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){if(null!=(a=n(Ly,Cy))&&a.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(n(Ly,Cy)||r(Ly,Cy,new WeakMap)).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return jl?Promise.all([Eg.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new Pm("main","worker",t),this._messageHandler.on("ready",(function(){})),o(this,My,Ry).call(this)}_initialize(){if(Ey.isWorkerDisabled||n(Ly,Py,Ty))return void this._setupFakeWorker();let{workerSrc:t}=Ly;try{Ey.isSameOrigin(window.location.href,t)||(t=Ey.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new Pm("main","worker",e),n=()=>{s.abort(),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=new AbortController;e.addEventListener("error",(()=>{this._webWorker||n()}),{signal:s.signal}),i.on("test",(t=>{s.abort(),!this.destroyed&&t?(this._messageHandler=i,this._port=e,this._webWorker=e,o(this,My,Ry).call(this)):n()})),i.on("ready",(t=>{if(s.abort(),this.destroyed)n();else try{r()}catch{this._setupFakeWorker()}}));const r=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void r()}catch{Nh("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){Ey.isWorkerDisabled||(Oh("Setting up fake worker."),Ey.isWorkerDisabled=!0),Ly._setupFakeWorkerGlobal.then((t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new ky;this._port=e;const i="fake"+Ey.fakeWorkerId++,n=new Pm(i+"_worker",i,e);t.setup(n,e),this._messageHandler=new Pm(i,i+"_worker",e),o(this,My,Ry).call(this)})).catch((t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){var t;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null==(t=n(Ly,Cy))||t.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){var e;if(null==t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const i=null==(e=n(this,Cy))?void 0:e.get(t.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new Ly(t)}static get workerSrc(){if(cm.workerSrc)return cm.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return $h(this,"_setupFakeWorkerGlobal",(async()=>n(this,Py,Ty)?n(this,Py,Ty):(await import(this.workerSrc)).WorkerMessageHandler)())}};let Iy=Ly;var Dy,Fy,Ny,Oy,Wy,jy,By;Cy=new WeakMap,My=new WeakSet,Ry=function(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})},Py=new WeakSet,Ty=function(){var t;try{return(null==(t=globalThis.pdfjsWorker)?void 0:t.WorkerMessageHandler)||null}catch{return null}},s(Iy,Py),s(Iy,Cy,void 0);class $y{constructor(t,e,i,n,r){s(this,jy),s(this,Dy,new Map),s(this,Fy,new Map),s(this,Ny,new Map),s(this,Oy,new Map),s(this,Wy,null),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new Yy,this.fontLoader=new _g({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.cMapReaderFactory=r.cMapReaderFactory,this.standardFontDataFactory=r.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return $h(this,"annotationStorage",new wg)}getRenderingIntent(t,e=Kl.ENABLE,i=null,n=!1){let s=Ul,r=pg;switch(t){case"any":s=Hl;break;case"display":break;case"print":s=Vl;break;default:Oh(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case Kl.DISABLE:s+=Xl;break;case Kl.ENABLE:break;case Kl.ENABLE_FORMS:s+=Gl;break;case Kl.ENABLE_STORAGE:s+=ql,r=(s&Vl&&i instanceof Ag?i:this.annotationStorage).serializable;break;default:Oh(`getRenderingIntent - invalid annotationMode: ${e}`)}return n&&(s+=Yl),{renderingIntent:s,cacheKey:`${s}_${r.hash}`,annotationStorageSerializable:r}}destroy(){var t;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null==(t=n(this,Wy))||t.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const t of n(this,Fy).values())e.push(t._destroy());n(this,Fy).clear(),n(this,Ny).clear(),n(this,Oy).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return e.push(i),Promise.all(e).then((()=>{var t;this.commonObjs.clear(),this.fontLoader.clear(),n(this,Dy).clear(),this.filterFactory.destroy(),ty.cleanup(),null==(t=this._networkStream)||t.cancelAllRequests(new Yh("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{jh(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then((function({value:t,done:i}){i?e.close():(jh(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}})),t.on("ReaderHeadersReady",(t=>{const i=Promise.withResolvers(),n=this._fullReader;return n.headersReady.then((()=>{var t;(!n.isStreamingSupported||!n.isRangeSupported)&&(this._lastProgress&&(null==(t=e.onProgress)||t.call(e,this._lastProgress)),n.onProgress=t=>{var i;null==(i=e.onProgress)||i.call(e,{loaded:t.loaded,total:t.total})}),i.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})}),i.reject),i.promise})),t.on("GetRangeReader",((t,e)=>{jh(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);i?(e.onPull=()=>{i.read().then((function({value:t,done:i}){i?e.close():(jh(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{i.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}):e.close()})),t.on("GetDoc",(({pdfInfo:t})=>{this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,e._capability.resolve(new gy(t,this))})),t.on("DocException",(function(t){let i;switch(t.name){case"PasswordException":i=new Hh(t.message,t.code);break;case"InvalidPDFException":i=new Vh(t.message);break;case"MissingPDFException":i=new Gh(t.message);break;case"UnexpectedResponseException":i=new qh(t.message,t.status);break;case"UnknownErrorException":i=new Uh(t.message,t.details);break;default:Wh("DocException - expected a valid Error.")}e._capability.reject(i)})),t.on("PasswordRequest",(t=>{if(r(this,Wy,Promise.withResolvers()),e.onPassword){const i=t=>{t instanceof Error?n(this,Wy).reject(t):n(this,Wy).resolve({password:t})};try{e.onPassword(i,t.code)}catch(t){n(this,Wy).reject(t)}}else n(this,Wy).reject(new Hh(t.message,t.code));return n(this,Wy).promise})),t.on("DataLoaded",(t=>{var i;null==(i=e.onProgress)||i.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(t=>{this.destroyed||n(this,Fy).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(([e,i,s])=>{var r;if(this.destroyed||this.commonObjs.has(e))return null;switch(i){case"Font":const{disableFontFace:a,fontExtraProperties:o,pdfBug:l}=this._params;if("error"in s){const t=s.error;Oh(`Error during font loading: ${t}`),this.commonObjs.resolve(e,t);break}const h=l&&null!=(r=globalThis.FontInspector)&&r.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,c=new xg(s,{disableFontFace:a,inspectFont:h});this.fontLoader.bind(c).catch((()=>t.sendWithPromise("FontFallback",{id:e}))).finally((()=>{!o&&c.data&&(c.data=null),this.commonObjs.resolve(e,c)}));break;case"CopyLocalImage":const{imageRef:d}=s;jh(d,"The imageRef must be defined.");for(const t of n(this,Fy).values())for(const[,i]of t.objs)if((null==i?void 0:i.ref)===d)return i.dataLen?(this.commonObjs.resolve(e,structuredClone(i)),i.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(e,s);break;default:throw new Error(`Got unknown common object type ${i}`)}return null})),t.on("obj",(([t,e,i,s])=>{var r;if(this.destroyed)return;const a=n(this,Fy).get(e);if(!a.objs.has(t)){if(0===a._intentStates.size)return void(null==(r=null==s?void 0:s.bitmap)||r.close());switch(i){case"Image":a.objs.resolve(t,s),(null==s?void 0:s.dataLen)>1e7&&(a._maybeCleanupAfterRender=!0);break;case"Pattern":a.objs.resolve(t,s);break;default:throw new Error(`Got unknown object type ${i}`)}}})),t.on("DocProgress",(t=>{var i;this.destroyed||null==(i=e.onProgress)||i.call(e,{loaded:t.loaded,total:t.total})})),t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t;this.annotationStorage.size<=0&&Oh("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:i}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:(null==(t=this._fullReader)?void 0:t.filename)??null},i).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=n(this,Ny).get(e);if(i)return i;const s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&n(this,Oy).set(i.refStr,t);const s=new Sy(e,i,this,this._params.pdfBug);return n(this,Fy).set(e,s),s}));return n(this,Ny).set(e,s),s}getPageIndex(t){return cy(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return o(this,jy,By).call(this,"GetFieldObjects")}hasJSActions(){return o(this,jy,By).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return o(this,jy,By).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return o(this,jy,By).call(this,"GetOptionalContentConfig").then((e=>new Um(e,t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=n(this,Dy).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then((t=>{var e,i;return{info:t[0],metadata:t[1]?new Tm(t[1]):null,contentDispositionFilename:(null==(e=this._fullReader)?void 0:e.filename)??null,contentLength:(null==(i=this._fullReader)?void 0:i.contentLength)??null}}));return n(this,Dy).set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of n(this,Fy).values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),n(this,Dy).clear(),this.filterFactory.destroy(!0),ty.cleanup()}}cachedPageNumber(t){if(!cy(t))return null;const e=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;return n(this,Oy).get(e)??null}}Dy=new WeakMap,Fy=new WeakMap,Ny=new WeakMap,Oy=new WeakMap,Wy=new WeakMap,jy=new WeakSet,By=function(t,e=null){const i=n(this,Dy).get(t);if(i)return i;const s=this.messageHandler.sendWithPromise(t,e);return n(this,Dy).set(t,s),s};const zy=Symbol("INITIAL_DATA");var Hy,Uy,Vy,Gy,qy,Xy;class Yy{constructor(){s(this,Uy),s(this,Hy,Object.create(null))}get(t,e=null){if(e){const i=o(this,Uy,Vy).call(this,t);return i.promise.then((()=>e(i.data))),null}const i=n(this,Hy)[t];if(!i||i.data===zy)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const e=n(this,Hy)[t];return!!e&&e.data!==zy}resolve(t,e=null){const i=o(this,Uy,Vy).call(this,t);i.data=e,i.resolve()}clear(){var t;for(const e in n(this,Hy)){const{data:i}=n(this,Hy)[e];null==(t=null==i?void 0:i.bitmap)||t.close()}r(this,Hy,Object.create(null))}*[Symbol.iterator](){for(const t in n(this,Hy)){const{data:e}=n(this,Hy)[t];e!==zy&&(yield[t,e])}}}Hy=new WeakMap,Uy=new WeakSet,Vy=function(t){var e;return(e=n(this,Hy))[t]||(e[t]={...Promise.withResolvers(),data:zy})};class Ky{constructor(t){s(this,Gy,null),r(this,Gy,t),this.onContinue=null}get promise(){return n(this,Gy).capability.promise}cancel(t=0){n(this,Gy).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=n(this,Gy).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=n(this,Gy);return t.form||t.canvas&&(null==e?void 0:e.size)>0}}Gy=new WeakMap;const Jy=class{constructor({callback:t,params:e,objs:i,commonObjs:n,annotationCanvasMap:r,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:h,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:u=null}){s(this,qy,null),this.callback=t,this.params=e,this.objs=i,this.commonObjs=n,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=h,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Ky(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=e.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){var i,s;if(this.cancelled)return;if(this._canvas){if(n(Jy,Xy).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");n(Jy,Xy).add(this._canvas)}this._pdfBug&&null!=(i=globalThis.StepperManager)&&i.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:r,viewport:a,transform:o,background:l}=this.params;this.gfx=new om(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:a,transparency:t,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,null==(s=this.graphicsReadyCallback)||s.call(this)}cancel(t=null,e=0){var i;this.running=!1,this.cancelled=!0,null==(i=this.gfx)||i.endDrawing(),n(this,qy)&&(window.cancelAnimationFrame(n(this,qy)),r(this,qy,null)),n(Jy,Xy).delete(this._canvas),this.callback(t||new ld(`Rendering cancelled, page ${this._pageIndex+1}`,e))}operatorListChanged(){var t;this.graphicsReady?(null==(t=this.stepper)||t.updateOperatorList(this.operatorList),!this.running&&this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?r(this,qy,window.requestAnimationFrame((()=>{r(this,qy,null),this._nextBound().catch(this._cancelBound)}))):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),n(Jy,Xy).delete(this._canvas),this.callback())))}};let Qy=Jy;qy=new WeakMap,Xy=new WeakMap,s(Qy,Xy,new WeakSet);const Zy="4.4.168",tb="19fbc8998";function eb(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function ib(t){return Math.max(0,Math.min(255,255*t))}class nb{static CMYK_G([t,e,i,n]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+n)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=ib(t),t,t]}static G_HTML([t]){const e=eb(t);return`#${e}${e}${e}`}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_rgb(t){return t.map(ib)}static RGB_HTML(t){return`#${t.map(eb).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,i,n]){return["RGB",1-Math.min(1,t+n),1-Math.min(1,i+n),1-Math.min(1,e+n)]}static CMYK_rgb([t,e,i,n]){return[ib(1-Math.min(1,t+n)),ib(1-Math.min(1,i+n)),ib(1-Math.min(1,e+n))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,i]){const n=1-t,s=1-e,r=1-i;return["CMYK",n,s,r,Math.min(n,s,r)]}}class sb{static setupStorage(t,e,i,n,s){const r=n.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==r.value&&(t.textContent=r.value),"print"===s)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(r.value===i.attributes.xfaOn?t.setAttribute("checked",!0):r.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",(t=>{n.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{if(null!==r.value&&t.setAttribute("value",r.value),"print"===s)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==r.value){t.setAttribute("value",r.value);for(const t of i.children)t.attributes.value===r.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",(t=>{const i=t.target.options,s=-1===i.selectedIndex?"":i[i.selectedIndex].value;n.setValue(e,{value:s})}))}}static setAttributes({html:t,element:e,storage:i=null,intent:n,linkService:s}){const{attributes:r}=e,a=t instanceof HTMLAnchorElement;"radio"===r.type&&(r.name=`${r.name}-${n}`);for(const[e,i]of Object.entries(r))if(null!=i)switch(e){case"class":i.length&&t.setAttribute(e,i.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",i);break;case"style":Object.assign(t.style,i);break;case"textContent":t.textContent=i;break;default:(!a||"href"!==e&&"newWindow"!==e)&&t.setAttribute(e,i)}a&&s.addLinkAttributes(t,r.href,r.newWindow),i&&r.dataId&&this.setupStorage(t,r.dataId,e,i)}static render(t){var e,i;const n=t.annotationStorage,s=t.linkService,r=t.xfaHtml,a=t.intent||"display",o=document.createElement(r.name);r.attributes&&this.setAttributes({html:o,element:r,intent:a,linkService:s});const l="richText"!==a,h=t.div;if(h.append(o),t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;h.style.transform=e}l&&h.setAttribute("class","xfaLayer xfaFont");const c=[];if(0===r.children.length){if(r.value){const t=document.createTextNode(r.value);o.append(t),l&&ny.shouldBuildText(r.name)&&c.push(t)}return{textDivs:c}}const d=[[r,-1,o]];for(;d.length>0;){const[t,r,o]=d.at(-1);if(r+1===t.children.length){d.pop();continue}const h=t.children[++d.at(-1)[1]];if(null===h)continue;const{name:u}=h;if("#text"===u){const t=document.createTextNode(h.value);c.push(t),o.append(t);continue}const p=null!=(e=null==h?void 0:h.attributes)&&e.xmlns?document.createElementNS(h.attributes.xmlns,u):document.createElement(u);if(o.append(p),h.attributes&&this.setAttributes({html:p,element:h,storage:n,intent:a,linkService:s}),(null==(i=h.children)?void 0:i.length)>0)d.push([h,-1,p]);else if(h.value){const t=document.createTextNode(h.value);l&&ny.shouldBuildText(u)&&c.push(t),p.append(t)}}for(const t of h.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const rb=1e3,ab=new WeakSet;function ob(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class lb{static create(t){switch(t.data.annotationType){case lh:return new Aw(t);case oh:return new _w(t);case Sh:switch(t.data.fieldType){case"Tx":return new Sw(t);case"Btn":return t.data.radioButton?new Cw(t):t.data.checkBox?new Ew(t):new Mw(t);case"Ch":return new Rw(t);case"Sig":return new kw(t)}return new xw(t);case _h:return new Pw(t);case hh:return new Lw(t);case ch:return new Iw(t);case dh:return new Dw(t);case uh:return new Fw(t);case fh:return new Nw(t);case wh:return new Ww(t);case Ah:return new jw(t);case ph:return new Ow(t);case gh:return new Bw(t);case mh:return new $w(t);case vh:return new zw(t);case yh:return new Hw(t);case bh:return new Uw(t);case xh:return new Vw(t);default:return new gb(t)}}}var hb,cb,db,ub,pb;const fb=class{constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}={}){s(this,ub),s(this,hb,null),s(this,cb,!1),s(this,db,null),this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:e,richText:i}){return!!(null!=t&&t.str||null!=e&&e.str||null!=i&&i.str)}get hasPopupData(){return fb._hasPopupData(this.data)}updateEdited(t){var e;if(!this.container)return;n(this,hb)||r(this,hb,{rect:this.data.rect.slice(0)});const{rect:i}=t;i&&o(this,ub,pb).call(this,i),null==(e=n(this,db))||e.popup.updateEdited(t)}resetEdited(){var t;n(this,hb)&&(o(this,ub,pb).call(this,n(this,hb).rect),null==(t=n(this,db))||t.popup.resetEdited(),r(this,hb,null))}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof xw||(s.tabIndex=rb);const{style:a}=s;if(a.zIndex=this.parent.zIndex++,e.popupRef&&s.setAttribute("aria-haspopup","dialog"),e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof Pw){const{rotation:t}=e;return!e.hasOwnCanvas&&0!==t&&this.setRotation(t,s),s}const{width:o,height:l}=ob(e.rect);if(!t&&e.borderStyle.width>0){a.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e=`calc(${t}px * var(--scale-factor)) / calc(${i}px * var(--scale-factor))`;a.borderRadius=e}else if(this instanceof Cw){const t=`calc(${o}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`;a.borderRadius=t}switch(e.borderStyle.style){case kh:a.borderStyle="solid";break;case Eh:a.borderStyle="dashed";break;case Ch:Oh("Unimplemented border style: beveled");break;case Mh:Oh("Unimplemented border style: inset");break;case Rh:a.borderBottomStyle="solid"}const n=e.borderColor||null;n?(r(this,cb,!0),a.borderColor=rc.makeHexColor(0|n[0],0|n[1],0|n[2])):a.borderWidth=0}const h=rc.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:c,pageHeight:d,pageX:u,pageY:p}=n.rawDims;a.left=100*(h[0]-u)/c+"%",a.top=100*(h[1]-p)/d+"%";const{rotation:f}=e;return e.hasOwnCanvas||0===f?(a.width=100*o/c+"%",a.height=100*l/d+"%"):this.setRotation(f,s),s}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims,{width:s,height:r}=ob(this.data.rect);let a,o;t%180==0?(a=100*s/i,o=100*r/n):(a=100*r/i,o=100*s/n),e.style.width=`${a}%`,e.style.height=`${o}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,i)=>{const n=i.detail[t],s=n[0],r=n.slice(1);i.target.style[e]=nb[`${s}_HTML`](r),this.annotationStorage.setValue(this.data.id,{[e]:nb[`${s}_rgb`](r)})};return $h(this,"_commonActions",{display:t=>{const{display:e}=t.detail,i=e%2==1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const n of Object.keys(e.detail)){const s=t[n]||i[n];null==s||s(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[n,s]of Object.entries(e)){const r=i[n];if(r){r({detail:{[n]:s},target:t}),delete e[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,s,r]=this.data.rect.map((t=>Math.fround(t)));if(8===t.length){const[n,a,o,l]=t.subarray(2,6);if(s===n&&r===a&&e===o&&i===l)return}const{style:a}=this.container;let o;if(n(this,cb)){const{borderColor:t,borderWidth:e}=a;a.borderWidth=0,o=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${t}" stroke-width="${e}">`],this.container.classList.add("hasBorder")}const l=s-e,h=r-i,{svgFactory:c}=this,d=c.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);const u=c.createElement("defs");d.append(u);const p=c.createElement("clipPath"),f=`clippath_${this.data.id}`;p.setAttribute("id",f),p.setAttribute("clipPathUnits","objectBoundingBox"),u.append(p);for(let i=2,n=t.length;i<n;i+=8){const n=t[i],s=t[i+1],a=t[i+2],d=t[i+3],u=c.createElement("rect"),f=(a-e)/l,g=(r-s)/h,m=(n-a)/l,v=(s-d)/h;u.setAttribute("x",f),u.setAttribute("y",g),u.setAttribute("width",m),u.setAttribute("height",v),p.append(u),null==o||o.push(`<rect vector-effect="non-scaling-stroke" x="${f}" y="${g}" width="${m}" height="${v}"/>`)}n(this,cb)&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(d),this.container.style.clipPath=`url(#${f})`}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const i=r(this,db,new Pw({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(i.render())}render(){Wh("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const i=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:t,id:s,exportValues:r}of n){if(-1===t||s===e)continue;const n="string"==typeof r?r:null,a=document.querySelector(`[data-element-id="${s}"]`);!a||ab.has(a)?i.push({id:s,exportValue:n,domElement:a}):Oh(`_getElementsByName - element not allowed: ${s}`)}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,s=n.getAttribute("data-element-id");s!==e&&ab.has(n)&&i.push({id:s,exportValue:t,domElement:n})}return i}show(){var t;this.container&&(this.container.hidden=!1),null==(t=this.popup)||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),null==(t=this.popup)||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",(()=>{var i;null==(i=this.linkService.eventBus)||i.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})}))}};let gb=fb;var mb,vb,yb,bb,wb,Ab,_b,xb,Sb,kb,Eb,Cb,Mb,Rb,Pb,Tb,Lb,Ib,Db,Fb,Nb,Ob,Wb,jb,Bb,$b,zb,Hb,Ub,Vb,Gb,qb,Xb,Yb,Kb,Jb,Qb,Zb,tw,ew,iw,nw,sw,rw,aw,ow,lw,hw,cw,dw,uw,pw,fw,gw,mw,vw,yw,bw,ww;hb=new WeakMap,cb=new WeakMap,db=new WeakMap,ub=new WeakSet,pb=function(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:r,pageX:a,pageY:o}}}}=this;null==i||i.splice(0,4,...t);const{width:l,height:h}=ob(t);e.left=100*(t[0]-a)/s+"%",e.top=100*(r-t[3]+o)/r+"%",0===n?(e.width=100*l/s+"%",e.height=100*h/r+"%"):this.setRotation(n)};class Aw extends gb{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!(null==e||!e.ignoreBorder),createQuadrilaterals:!0}),s(this,mb),s(this,yb),s(this,wb),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let n=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),n=!0):t.action?(this._bindNamedAction(i,t.action),n=!0):t.attachment?(o(this,yb,bb).call(this,i,t.attachment,t.attachmentDest),n=!0):t.setOCGState?(o(this,wb,Ab).call(this,i,t.setOCGState),n=!0):t.dest?(this._bindLink(i,t.dest),n=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),n=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(i),this.container}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&o(this,mb,vb).call(this)}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),o(this,mb,vb).call(this)}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(e.actions)){const s=i.get(n);s&&(t[s]=()=>{var t;return null==(t=this.linkService.eventBus)||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1})}t.onclick||(t.onclick=()=>!1),o(this,mb,vb).call(this)}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),o(this,mb,vb).call(this),!this._fieldObjects)return Oh('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{var t;null==i||i();const{fields:n,refs:s,include:r}=e,a=[];if(0!==n.length||0!==s.length){const t=new Set(s);for(const e of n){const i=this._fieldObjects[e]||[];for(const{id:e}of i)t.add(e)}for(const e of Object.values(this._fieldObjects))for(const i of e)t.has(i.id)===r&&a.push(i)}else for(const t of Object.values(this._fieldObjects))a.push(...t);const o=this.annotationStorage,l=[];for(const t of a){const{id:e}=t;switch(l.push(e),t.type){case"text":{const i=t.defaultValue||"";o.setValue(e,{value:i});break}case"checkbox":case"radiobutton":{const i=t.defaultValue===t.exportValues;o.setValue(e,{value:i});break}case"combobox":case"listbox":{const i=t.defaultValue||"";o.setValue(e,{value:i});break}default:continue}const i=document.querySelector(`[data-element-id="${e}"]`);i&&(ab.has(i)?i.dispatchEvent(new Event("resetform")):Oh(`_bindResetFormAction - element not allowed: ${e}`))}return this.enableScripting&&(null==(t=this.linkService.eventBus)||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}})),!1}}}mb=new WeakSet,vb=function(){this.container.setAttribute("data-internal-link","")},yb=new WeakSet,bb=function(t,e,i=null){t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>{var t;return null==(t=this.downloadManager)||t.openOrDownloadData(e.content,e.filename,i),!1},o(this,mb,vb).call(this)},wb=new WeakSet,Ab=function(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),o(this,mb,vb).call(this)};class _w extends gb{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class xw extends gb{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&("CANVAS"===(null==(e=t.previousSibling)?void 0:e.nodeName)&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Zh.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,s){i.includes("mouse")?t.addEventListener(i,(t=>{var e;null==(e=this.linkService.eventBus)||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(i,(t=>{var r;if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}s&&(null==(r=this.linkService.eventBus)||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t)}}))}))}_setEventListeners(t,e,i,n){var s,r,a;for(const[o,l]of i)("Action"===l||null!=(s=this.data.actions)&&s[l])&&(("Focus"===l||"Blur"===l)&&(e||(e={focused:!1})),this._setEventListener(t,e,o,l,n),"Focus"!==l||null!=(r=this.data.actions)&&r.Blur?"Blur"===l&&(null==(a=this.data.actions)||!a.Focus)&&this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":rc.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const{fontColor:e}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||9,n=t.style;let s;const r=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(zl*i))||1);s=Math.min(i,r(e/zl))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);s=Math.min(i,r(t/zl))}n.fontSize=`calc(${s}px * var(--scale-factor))`,n.color=rc.makeHexColor(e[0],e[1],e[2]),null!==this.data.textAlignment&&(n.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class Sw extends xw{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,n){const s=this.annotationStorage;for(const r of this._getElementsByName(t.name,t.id))r.domElement&&(r.domElement[e]=i),s.setValue(r.id,{[n]:i})}render(){var t,e;const i=this.annotationStorage,n=this.data.id;this.container.classList.add("textWidgetAnnotation");let s=null;if(this.renderForms){const r=i.getValue(n,{value:this.data.fieldValue});let a=r.value||"";const o=i.getValue(n,{charLimit:this.data.maxLen}).charLimit;o&&a.length>o&&(a=a.slice(0,o));let l=r.formattedValue||(null==(t=this.data.textContent)?void 0:t.join("\n"))||null;l&&this.data.comb&&(l=l.replaceAll(/\s+/g,""));const h={userValue:a,formattedValue:l,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(s=document.createElement("textarea"),s.textContent=l??a,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type="text",s.setAttribute("value",l??a),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(s.hidden=!0),ab.add(s),s.setAttribute("data-element-id",n),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=rb,this._setRequired(s,this.data.required),o&&(s.maxLength=o),s.addEventListener("input",(t=>{i.setValue(n,{value:t.target.value}),this.setPropertyOnSiblings(s,"value",t.target.value,"value"),h.formattedValue=null})),s.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue??"";s.value=h.userValue=e,h.formattedValue=null}));let c=t=>{const{formattedValue:e}=h;null!=e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",(t=>{var e;if(h.focused)return;const{target:i}=t;h.userValue&&(i.value=h.userValue),h.lastCommittedValue=i.value,h.commitKey=1,null!=(e=this.data.actions)&&e.Focus||(h.focused=!0)})),s.addEventListener("updatefromsandbox",(t=>{this.showElementAndHideCanvas(t.target);const e={value(t){h.userValue=t.detail.value??"",i.setValue(n,{value:h.userValue.toString()}),t.target.value=h.userValue},formattedValue(t){const{formattedValue:e}=t.detail;h.formattedValue=e,null!=e&&t.target!==document.activeElement&&(t.target.value=e),i.setValue(n,{formattedValue:e})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:t=>{var e;const{charLimit:s}=t.detail,{target:r}=t;if(0===s)return void r.removeAttribute("maxLength");r.setAttribute("maxLength",s);let a=h.userValue;!a||a.length<=s||(a=a.slice(0,s),r.value=h.userValue=a,i.setValue(n,{value:a}),null==(e=this.linkService.eventBus)||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}}))}};this._dispatchEventFromSandbox(e,t)})),s.addEventListener("keydown",(t=>{var e;h.commitKey=1;let i=-1;if("Escape"===t.key?i=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(h.commitKey=3):i=2,-1===i)return;const{value:s}=t.target;h.lastCommittedValue!==s&&(h.lastCommittedValue=s,h.userValue=s,null==(e=this.linkService.eventBus)||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:s,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}));const t=c;c=null,s.addEventListener("blur",(e=>{var i,s;if(!h.focused||!e.relatedTarget)return;null!=(i=this.data.actions)&&i.Blur||(h.focused=!1);const{value:r}=e.target;h.userValue=r,h.lastCommittedValue!==r&&(null==(s=this.linkService.eventBus)||s.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:r,willCommit:!0,commitKey:h.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}})),t(e)})),null!=(e=this.data.actions)&&e.Keystroke&&s.addEventListener("beforeinput",(t=>{var e;h.lastCommittedValue=null;const{data:i,target:s}=t,{value:r,selectionStart:a,selectionEnd:o}=s;let l=a,c=o;switch(t.inputType){case"deleteWordBackward":{const t=r.substring(0,a).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=r.substring(a).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":a===o&&(l-=1);break;case"deleteContentForward":a===o&&(c+=1)}t.preventDefault(),null==(e=this.linkService.eventBus)||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:r,change:i||"",willCommit:!1,selStart:l,selEnd:c}})})),this._setEventListeners(s,h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}if(c&&s.addEventListener("blur",c),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/o;s.classList.add("comb"),s.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else s=document.createElement("div"),s.textContent=this.data.fieldValue,s.style.verticalAlign="middle",s.style.display="table-cell",this.data.hasOwnCanvas&&(s.hidden=!0);return this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class kw extends xw{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class Ew extends xw{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"==typeof n&&(n="Off"!==n,t.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return ab.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.setAttribute("exportValue",e.exportValue),s.tabIndex=rb,s.addEventListener("change",(n=>{const{name:s,checked:r}=n.target;for(const n of this._getElementsByName(s,i)){const i=r&&n.exportValue===e.exportValue;n.domElement&&(n.domElement.checked=i),t.setValue(n.id,{value:i})}t.setValue(i,{value:r})})),s.addEventListener("resetform",(t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue})),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",(e=>{const n={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(n,e)})),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Cw extends xw{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"==typeof n&&(n=n!==e.buttonValue,t.setValue(i,{value:n})),n)for(const n of this._getElementsByName(e.fieldName,i))t.setValue(n.id,{value:!1});const s=document.createElement("input");if(ab.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.tabIndex=rb,s.addEventListener("change",(e=>{const{name:n,checked:s}=e.target;for(const e of this._getElementsByName(n,i))t.setValue(e.id,{value:!1});t.setValue(i,{value:s})})),s.addEventListener("resetform",(t=>{const i=e.defaultFieldValue;t.target.checked=null!=i&&i===e.buttonValue})),this.enableScripting&&this.hasJSActions){const n=e.buttonValue;s.addEventListener("updatefromsandbox",(e=>{const s={value:e=>{const s=n===e.detail.value;for(const n of this._getElementsByName(e.target.name)){const e=s&&n.id===i;n.domElement&&(n.domElement.checked=e),t.setValue(n.id,{value:e})}}};this._dispatchEventFromSandbox(s,e)})),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Mw extends Aw{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))),t}}class Rw extends xw{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");ab.add(n),n.setAttribute("data-element-id",e),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=rb;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const t of n.options)t.selected=t.value===e}));for(const t of this.data.options){const e=document.createElement("option");e.textContent=t.displayValue,e.value=t.exportValue,i.value.includes(t.exportValue)&&(e.setAttribute("selected",!0),s=!1),n.append(e)}let r=null;if(s){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),n.prepend(t),r=()=>{t.remove(),n.removeEventListener("input",r),r=null},n.addEventListener("input",r)}const a=t=>{const e=t?"value":"textContent",{options:i,multiple:s}=n;return s?Array.prototype.filter.call(i,(t=>t.selected)).map((t=>t[e])):-1===i.selectedIndex?null:i[i.selectedIndex][e]};let o=a(!1);const l=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",(i=>{const s={value(i){null==r||r();const s=i.detail.value,l=new Set(Array.isArray(s)?s:[s]);for(const t of n.options)t.selected=l.has(t.value);t.setValue(e,{value:a(!0)}),o=a(!1)},multipleSelection(t){n.multiple=!0},remove(i){const s=n.options,r=i.detail.remove;s[r].selected=!1,n.remove(r),s.length>0&&-1===Array.prototype.findIndex.call(s,(t=>t.selected))&&(s[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},clear(i){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]}),o=a(!1)},insert(i){const{index:s,displayValue:r,exportValue:h}=i.detail.insert,c=n.children[s],d=document.createElement("option");d.textContent=r,d.value=h,c?c.before(d):n.append(d),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},items(i){const{items:s}=i.detail;for(;0!==n.length;)n.remove(0);for(const t of s){const{displayValue:e,exportValue:i}=t,s=document.createElement("option");s.textContent=e,s.value=i,n.append(s)}n.options.length>0&&(n.options[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},indices(i){const n=new Set(i.detail.indices);for(const t of i.target.options)t.selected=n.has(t.index);t.setValue(e,{value:a(!0)}),o=a(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(s,i)})),n.addEventListener("input",(i=>{var n;const s=a(!0),r=a(!1);t.setValue(e,{value:s}),i.preventDefault(),null==(n=this.linkService.eventBus)||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:r,changeEx:s,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))):n.addEventListener("input",(function(i){t.setValue(e,{value:a(!0)})})),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Pw extends gb{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:gb._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new Tw({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(const i of this.elements)i.popup=t,e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map((t=>`${hc}${t}`)).join(",")),this.container}}class Tw{constructor({container:t,color:e,elements:i,titleObj:a,modificationDate:l,contentsObj:h,richText:c,parent:d,rect:u,parentRect:p,open:f}){var g;s(this,$b),s(this,Hb),s(this,Vb),s(this,qb),s(this,Yb),s(this,Jb),s(this,Zb),s(this,ew),s(this,nw),s(this,_b,o(this,Yb,Kb).bind(this)),s(this,xb,o(this,nw,sw).bind(this)),s(this,Sb,o(this,ew,iw).bind(this)),s(this,kb,o(this,Zb,tw).bind(this)),s(this,Eb,null),s(this,Cb,null),s(this,Mb,null),s(this,Rb,null),s(this,Pb,null),s(this,Tb,null),s(this,Lb,null),s(this,Ib,!1),s(this,Db,null),s(this,Fb,null),s(this,Nb,null),s(this,Ob,null),s(this,Wb,null),s(this,jb,null),s(this,Bb,!1),r(this,Cb,t),r(this,Wb,a),r(this,Mb,h),r(this,Ob,c),r(this,Tb,d),r(this,Eb,e),r(this,Nb,u),r(this,Lb,p),r(this,Pb,i),r(this,Rb,yd.toDateObject(l)),this.trigger=i.flatMap((t=>t.getElementsToTriggerPopup()));for(const t of this.trigger)t.addEventListener("click",n(this,kb)),t.addEventListener("mouseenter",n(this,Sb)),t.addEventListener("mouseleave",n(this,xb)),t.classList.add("popupTriggerArea");for(const t of i)null==(g=t.container)||g.addEventListener("keydown",n(this,_b));n(this,Cb).hidden=!0,f&&o(this,Zb,tw).call(this)}render(){if(n(this,Db))return;const t=r(this,Db,document.createElement("div"));if(t.className="popup",n(this,Eb)){const e=t.style.outlineColor=rc.makeHexColor(...n(this,Eb));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?t.style.backgroundColor=`color-mix(in srgb, ${e} 30%, white)`:t.style.backgroundColor=rc.makeHexColor(...n(this,Eb).map((t=>Math.floor(.7*(255-t)+t))))}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),({dir:i.dir,str:i.textContent}=n(this,Wb)),t.append(e),n(this,Rb)){const t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),t.setAttribute("data-l10n-args",JSON.stringify({date:n(this,Rb).toLocaleDateString(),time:n(this,Rb).toLocaleTimeString()})),e.append(t)}const s=n(this,$b,zb);if(s)sb.render({xfaHtml:s,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const e=this._formatContents(n(this,Mb));t.append(e)}n(this,Cb).append(t)}_formatContents({str:t,dir:e}){const i=document.createElement("p");i.classList.add("popupContent"),i.dir=e;const n=t.split(/(?:\r\n?|\n)/);for(let t=0,e=n.length;t<e;++t){const s=n[t];i.append(document.createTextNode(s)),t<e-1&&i.append(document.createElement("br"))}return i}updateEdited({rect:t,popupContent:e}){var i;n(this,jb)||r(this,jb,{contentsObj:n(this,Mb),richText:n(this,Ob)}),t&&r(this,Fb,null),e&&(r(this,Ob,o(this,qb,Xb).call(this,e)),r(this,Mb,null)),null==(i=n(this,Db))||i.remove(),r(this,Db,null)}resetEdited(){var t;n(this,jb)&&(({contentsObj:a(this,Mb)._,richText:a(this,Ob)._}=n(this,jb)),r(this,jb,null),null==(t=n(this,Db))||t.remove(),r(this,Db,null),r(this,Fb,null))}forceHide(){r(this,Bb,this.isVisible),n(this,Bb)&&(n(this,Cb).hidden=!0)}maybeShow(){n(this,Bb)&&(n(this,Db)||o(this,ew,iw).call(this),r(this,Bb,!1),n(this,Cb).hidden=!1)}get isVisible(){return!1===n(this,Cb).hidden}}_b=new WeakMap,xb=new WeakMap,Sb=new WeakMap,kb=new WeakMap,Eb=new WeakMap,Cb=new WeakMap,Mb=new WeakMap,Rb=new WeakMap,Pb=new WeakMap,Tb=new WeakMap,Lb=new WeakMap,Ib=new WeakMap,Db=new WeakMap,Fb=new WeakMap,Nb=new WeakMap,Ob=new WeakMap,Wb=new WeakMap,jb=new WeakMap,Bb=new WeakMap,$b=new WeakSet,zb=function(){const t=n(this,Ob),e=n(this,Mb);return null!=t&&t.str&&(!(null!=e&&e.str)||e.str===t.str)&&n(this,Ob).html||null},Hb=new WeakSet,Ub=function(){var t,e,i;return(null==(i=null==(e=null==(t=n(this,$b,zb))?void 0:t.attributes)?void 0:e.style)?void 0:i.fontSize)||0},Vb=new WeakSet,Gb=function(){var t,e,i;return(null==(i=null==(e=null==(t=n(this,$b,zb))?void 0:t.attributes)?void 0:e.style)?void 0:i.color)||null},qb=new WeakSet,Xb=function(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},s={style:{color:n(this,Vb,Gb),fontSize:n(this,Hb,Ub)?`calc(${n(this,Hb,Ub)}px * var(--scale-factor))`:""}};for(const i of t.split("\n"))e.push({name:"span",value:i,attributes:s});return i},Yb=new WeakSet,Kb=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&n(this,Ib))&&o(this,Zb,tw).call(this)},Jb=new WeakSet,Qb=function(){if(null!==n(this,Fb))return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:s,pageY:a}}}=n(this,Tb);let o=!!n(this,Lb),l=n(this,o?Lb:Nb);for(const t of n(this,Pb))if(!l||null!==rc.intersect(t.data.rect,l)){l=t.data.rect,o=!0;break}const h=rc.normalizeRect([l[0],t[3]-l[1]+t[1],l[2],t[3]-l[3]+t[1]]),c=o?l[2]-l[0]+5:0,d=h[0]+c,u=h[1];r(this,Fb,[100*(d-s)/e,100*(u-a)/i]);const{style:p}=n(this,Cb);p.left=`${n(this,Fb)[0]}%`,p.top=`${n(this,Fb)[1]}%`},Zb=new WeakSet,tw=function(){r(this,Ib,!n(this,Ib)),n(this,Ib)?(o(this,ew,iw).call(this),n(this,Cb).addEventListener("click",n(this,kb)),n(this,Cb).addEventListener("keydown",n(this,_b))):(o(this,nw,sw).call(this),n(this,Cb).removeEventListener("click",n(this,kb)),n(this,Cb).removeEventListener("keydown",n(this,_b)))},ew=new WeakSet,iw=function(){n(this,Db)||this.render(),this.isVisible?n(this,Ib)&&n(this,Cb).classList.add("focused"):(o(this,Jb,Qb).call(this),n(this,Cb).hidden=!1,n(this,Cb).style.zIndex=parseInt(n(this,Cb).style.zIndex)+1e3)},nw=new WeakSet,sw=function(){n(this,Cb).classList.remove("focused"),!n(this,Ib)&&this.isVisible&&(n(this,Cb).hidden=!0,n(this,Cb).style.zIndex=parseInt(n(this,Cb).style.zIndex)-1e3)};class Lw extends gb{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Jl.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}class Iw extends gb{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),s(this,rw,null)}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:i}=ob(t.rect),n=this.svgFactory.create(e,i,!0),s=r(this,rw,this.svgFactory.createElement("svg:line"));return s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,rw)}addHighlightArea(){this.container.classList.add("highlightArea")}}rw=new WeakMap;class Dw extends gb{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),s(this,aw,null)}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:i}=ob(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,a=r(this,aw,this.svgFactory.createElement("svg:rect"));return a.setAttribute("x",s/2),a.setAttribute("y",s/2),a.setAttribute("width",e-s),a.setAttribute("height",i-s),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),n.append(a),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,aw)}addHighlightArea(){this.container.classList.add("highlightArea")}}aw=new WeakMap;class Fw extends gb{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),s(this,ow,null)}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:i}=ob(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,a=r(this,ow,this.svgFactory.createElement("svg:ellipse"));return a.setAttribute("cx",e/2),a.setAttribute("cy",i/2),a.setAttribute("rx",e/2-s/2),a.setAttribute("ry",i/2-s/2),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),n.append(a),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,ow)}addHighlightArea(){this.container.classList.add("highlightArea")}}ow=new WeakMap;class Nw extends gb{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),s(this,lw,null),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:i,popupRef:n}}=this;if(!e)return this.container;const{width:s,height:a}=ob(t),o=this.svgFactory.create(s,a,!0);let l=[];for(let i=0,n=e.length;i<n;i+=2){const n=e[i]-t[0],s=t[3]-e[i+1];l.push(`${n},${s}`)}l=l.join(" ");const h=r(this,lw,this.svgFactory.createElement(this.svgElementName));return h.setAttribute("points",l),h.setAttribute("stroke-width",i.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),o.append(h),this.container.append(o),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,lw)}addHighlightArea(){this.container.classList.add("highlightArea")}}lw=new WeakMap;class Ow extends Nw{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Ww extends gb{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class jw extends gb{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),s(this,hw,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=Jl.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:e,borderStyle:i,popupRef:s}}=this,{width:r,height:a}=ob(t),o=this.svgFactory.create(r,a,!0);for(const r of e){let e=[];for(let i=0,n=r.length;i<n;i+=2){const n=r[i]-t[0],s=t[3]-r[i+1];e.push(`${n},${s}`)}e=e.join(" ");const a=this.svgFactory.createElement(this.svgElementName);n(this,hw).push(a),a.setAttribute("points",e),a.setAttribute("stroke-width",i.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),!s&&this.hasPopupData&&this._createPopup(),o.append(a)}return this.container.append(o),this.container}getElementsToTriggerPopup(){return n(this,hw)}addHighlightArea(){this.container.classList.add("highlightArea")}}hw=new WeakMap;class Bw extends gb{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class $w extends gb{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class zw extends gb{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class Hw extends gb{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class Uw extends gb{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class Vw extends gb{constructor(t){var e;super(t,{isRenderable:!0}),s(this,dw),s(this,cw,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,null==(e=this.linkService.eventBus)||e.dispatch("fileattachmentannotation",{source:this,...i})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:e}=this;let i;e.hasAppearance||0===e.fillAlpha?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name)?"paperclip":"pushpin"}.svg`,e.fillAlpha&&e.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(100*e.fillAlpha)}%);`)),i.addEventListener("dblclick",o(this,dw,uw).bind(this)),r(this,cw,i);const{isMac:n}=Zh.platform;return t.addEventListener("keydown",(t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&o(this,dw,uw).call(this)})),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return n(this,cw)}addHighlightArea(){this.container.classList.add("highlightArea")}}cw=new WeakMap,dw=new WeakSet,uw=function(){var t;null==(t=this.downloadManager)||t.openOrDownloadData(this.content,this.filename)};let Gw=(ww=class{constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:n,page:a,viewport:o}){s(this,mw),s(this,yw),s(this,pw,null),s(this,fw,null),s(this,gw,new Map),this.div=t,r(this,pw,e),r(this,fw,i),this.page=a,this.viewport=o,this.zIndex=0,this._annotationEditorUIManager=n}async render(t){var e;const{annotations:i}=t,s=this.div;xd(s,this.viewport);const r=new Map,a={data:null,layer:s,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new ad,annotationStorage:t.annotationStorage||new wg,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const t of i){if(t.noHTML)continue;const i=t.annotationType===_h;if(i){const e=r.get(t.id);if(!e)continue;a.elements=e}else{const{width:e,height:i}=ob(t.rect);if(e<=0||i<=0)continue}a.data=t;const s=lb.create(a);if(!s.isRenderable)continue;if(!i&&t.popupRef){const e=r.get(t.popupRef);e?e.push(s):r.set(t.popupRef,[s])}const l=s.render();t.hidden&&(l.style.visibility="hidden"),o(this,mw,vw).call(this,l,t.id),s.annotationEditorType>0&&(n(this,gw).set(s.data.id,s),null==(e=this._annotationEditorUIManager)||e.renderAnnotationElement(s))}o(this,yw,bw).call(this)}update({viewport:t}){const e=this.div;this.viewport=t,xd(e,{rotation:t.rotation}),o(this,yw,bw).call(this),e.hidden=!1}getEditableAnnotations(){return Array.from(n(this,gw).values())}getEditableAnnotation(t){return n(this,gw).get(t)}},pw=new WeakMap,fw=new WeakMap,gw=new WeakMap,mw=new WeakSet,vw=function(t,e){var i;const s=t.firstChild||t;s.id=`${hc}${e}`,this.div.append(t),null==(i=n(this,pw))||i.moveElementInDOM(this.div,t,s,!1)},yw=new WeakSet,bw=function(){if(!n(this,fw))return;const t=this.div;for(const[e,i]of n(this,fw)){const n=t.querySelector(`[data-annotation-id="${e}"]`);if(!n)continue;i.className="annotationContent";const{firstChild:s}=n;s?"CANVAS"===s.nodeName?s.replaceWith(i):s.classList.contains("annotationContent")?s.after(i):s.before(i):n.append(i)}n(this,fw).clear()},ww);const qw=/\r\n?|\n/g;var Xw,Yw,Kw,Jw,Qw,Zw,tA,eA,iA,nA,sA,rA,aA,oA,lA,hA,cA,dA,uA,pA,fA,gA,mA,vA,yA,bA,wA,AA;const _A=class extends og{constructor(t){super({...t,name:"freeTextEditor"}),s(this,sA),s(this,aA),s(this,lA),s(this,cA),s(this,fA),s(this,mA),s(this,wA),s(this,Xw,this.editorDivBlur.bind(this)),s(this,Yw,this.editorDivFocus.bind(this)),s(this,Kw,this.editorDivInput.bind(this)),s(this,Jw,this.editorDivKeydown.bind(this)),s(this,Qw,this.editorDivPaste.bind(this)),s(this,Zw,void 0),s(this,tA,""),s(this,eA,`${this.id}-editor`),s(this,iA,void 0),s(this,nA,null),r(this,Zw,t.color||_A._defaultColor||og._defaultLineColor),r(this,iA,t.fontSize||_A._defaultFontSize)}static get _keyboardManager(){const t=_A.prototype,e=t=>t.isEmpty(),i=Jp.TRANSLATE_SMALL,n=Jp.TRANSLATE_BIG;return $h(this,"_keyboardManager",new gu([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,n],checker:e}]]))}static initialize(t,e){og.initialize(t,e,{strings:["pdfjs-free-text-default-content"]});const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case Ql.FREETEXT_SIZE:_A._defaultFontSize=e;break;case Ql.FREETEXT_COLOR:_A._defaultColor=e}}updateParams(t,e){switch(t){case Ql.FREETEXT_SIZE:o(this,sA,rA).call(this,e);break;case Ql.FREETEXT_COLOR:o(this,aA,oA).call(this,e)}}static get defaultPropertiesToUpdate(){return[[Ql.FREETEXT_SIZE,_A._defaultFontSize],[Ql.FREETEXT_COLOR,_A._defaultColor||og._defaultLineColor]]}get propertiesToUpdate(){return[[Ql.FREETEXT_SIZE,n(this,iA)],[Ql.FREETEXT_COLOR,n(this,Zw)]]}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-_A._internalPadding*t,-(_A._internalPadding+n(this,iA))*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(Jl.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant");const t=this._uiManager._signal;this.editorDiv.addEventListener("keydown",n(this,Jw),{signal:t}),this.editorDiv.addEventListener("focus",n(this,Yw),{signal:t}),this.editorDiv.addEventListener("blur",n(this,Xw),{signal:t}),this.editorDiv.addEventListener("input",n(this,Kw),{signal:t}),this.editorDiv.addEventListener("paste",n(this,Qw),{signal:t})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",n(this,eA)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",n(this,Jw)),this.editorDiv.removeEventListener("focus",n(this,Yw)),this.editorDiv.removeEventListener("blur",n(this,Xw)),this.editorDiv.removeEventListener("input",n(this,Kw)),this.editorDiv.removeEventListener("paste",n(this,Qw)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var t;this.width||(this.enableEditMode(),this.editorDiv.focus(),null!=(t=this._initialOptions)&&t.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=n(this,tA),e=r(this,tA,o(this,lA,hA).call(this).trimEnd());if(t===e)return;const i=t=>{r(this,tA,t),t?(o(this,fA,gA).call(this),this._uiManager.rebuild(this),o(this,cA,dA).call(this)):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),o(this,cA,dA).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){_A._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",n(this,eA)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),og._l10nPromise.get("pdfjs-free-text-default-content").then((t=>{var e;return null==(e=this.editorDiv)?void 0:e.setAttribute("default-content",t)})),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${n(this,iA)}px * var(--scale-factor))`,i.color=n(this,Zw),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),su(this,this.div,["dblclick","keydown"]),this.width){const[i,s]=this.parentDimensions;if(this.annotationElementId){const{position:r}=n(this,nA);let[a,o]=this.getInitialTranslation();[a,o]=this.pageTranslationToScreen(a,o);const[l,h]=this.pageDimensions,[c,d]=this.pageTranslation;let u,p;switch(this.rotation){case 0:u=t+(r[0]-c)/l,p=e+this.height-(r[1]-d)/h;break;case 90:u=t+(r[0]-c)/l,p=e-(r[1]-d)/h,[a,o]=[o,-a];break;case 180:u=t-this.width+(r[0]-c)/l,p=e-(r[1]-d)/h,[a,o]=[-a,-o];break;case 270:u=t+(r[0]-c-this.height*h)/l,p=e+(r[1]-d-this.width*l)/h,[a,o]=[-o,a]}this.setAt(u*i,p*s,a,o)}else this.setAt(t*i,e*s,this.width*i,this.height*s);o(this,fA,gA).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){var e,i,n;const s=t.clipboardData||window.clipboardData,{types:a}=s;if(1===a.length&&"text/plain"===a[0])return;t.preventDefault();const l=o(e=_A,yA,bA).call(e,s.getData("text")||"").replaceAll(qw,"\n");if(!l)return;const h=window.getSelection();if(!h.rangeCount)return;this.editorDiv.normalize(),h.deleteFromDocument();const c=h.getRangeAt(0);if(!l.includes("\n"))return c.insertNode(document.createTextNode(l)),this.editorDiv.normalize(),void h.collapseToStart();const{startContainer:d,startOffset:u}=c,p=[],f=[];if(d.nodeType===Node.TEXT_NODE){const t=d.parentElement;if(f.push(d.nodeValue.slice(u).replaceAll(qw,"")),t!==this.editorDiv){let e=p;for(const n of this.editorDiv.childNodes)n!==t?e.push(o(i=_A,uA,pA).call(i,n)):e=f}p.push(d.nodeValue.slice(0,u).replaceAll(qw,""))}else if(d===this.editorDiv){let t=p,e=0;for(const i of this.editorDiv.childNodes)e++===u&&(t=f),t.push(o(n=_A,uA,pA).call(n,i))}r(this,tA,`${p.join("\n")}${l}${f.join("\n")}`),o(this,fA,gA).call(this);const g=new Range;let m=p.reduce(((t,e)=>t+e.length),0);for(const{firstChild:t}of this.editorDiv.childNodes)if(t.nodeType===Node.TEXT_NODE){const e=t.nodeValue.length;if(m<=e){g.setStart(t,m),g.setEnd(t,m);break}m-=e}h.removeAllRanges(),h.addRange(g)}get contentDiv(){return this.editorDiv}static deserialize(t,e,i){var n;let s=null;if(t instanceof Lw){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:n,rotation:r,id:a},textContent:o,textPosition:l,parent:{page:{pageNumber:h}}}=t;if(!o||0===o.length)return null;s=t={annotationType:Jl.FREETEXT,color:Array.from(i),fontSize:e,value:o.join("\n"),position:l,pageIndex:h-1,rect:n.slice(0),rotation:r,id:a,deleted:!1}}const a=super.deserialize(t,e,i);return r(a,iA,t.fontSize),r(a,Zw,rc.makeHexColor(...t.color)),r(a,tA,o(n=_A,yA,bA).call(n,t.value)),a.annotationElementId=t.id||null,r(a,nA,s),a}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const e=_A._internalPadding*this.parentScale,i=this.getRect(e,e),s=og._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:n(this,Zw)),r={annotationType:Jl.FREETEXT,color:s,fontSize:n(this,iA),value:o(this,mA,vA).call(this),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?r:this.annotationElementId&&!o(this,wA,AA).call(this,r)?null:(r.id=this.annotationElementId,r)}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(this.deleted)return e;const{style:i}=e;i.fontSize=`calc(${n(this,iA)}px * var(--scale-factor))`,i.color=n(this,Zw),e.replaceChildren();for(const t of n(this,tA).split("\n")){const i=document.createElement("div");i.append(t?document.createTextNode(t):document.createElement("br")),e.append(i)}const s=_A._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(s,s),popupContent:n(this,tA)}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}};let xA=_A;var SA,kA,EA,CA,MA,RA,PA,TA,LA,IA,DA,FA,NA,OA,WA,jA,BA,$A,zA,HA,UA,VA,GA,qA,XA,YA,KA,JA,QA,ZA,t_,e_,i_;Xw=new WeakMap,Yw=new WeakMap,Kw=new WeakMap,Jw=new WeakMap,Qw=new WeakMap,Zw=new WeakMap,tA=new WeakMap,eA=new WeakMap,iA=new WeakMap,nA=new WeakMap,sA=new WeakSet,rA=function(t){const e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-n(this,iA))*this.parentScale),r(this,iA,t),o(this,cA,dA).call(this)},i=n(this,iA);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},aA=new WeakSet,oA=function(t){const e=t=>{r(this,Zw,this.editorDiv.style.color=t)},i=n(this,Zw);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},lA=new WeakSet,hA=function(){var t;const e=[];this.editorDiv.normalize();for(const i of this.editorDiv.childNodes)e.push(o(t=_A,uA,pA).call(t,i));return e.join("\n")},cA=new WeakSet,dA=function(){const[t,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,n=e.style.display,s=e.classList.contains("hidden");e.classList.remove("hidden"),e.style.display="hidden",t.div.append(this.div),i=e.getBoundingClientRect(),e.remove(),e.style.display=n,e.classList.toggle("hidden",s)}this.rotation%180==this.parentRotation%180?(this.width=i.width/t,this.height=i.height/e):(this.width=i.height/t,this.height=i.width/e),this.fixAndSetPosition()},uA=new WeakSet,pA=function(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(qw,"")},fA=new WeakSet,gA=function(){if(this.editorDiv.replaceChildren(),n(this,tA))for(const t of n(this,tA).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}},mA=new WeakSet,vA=function(){return n(this,tA).replaceAll(" "," ")},yA=new WeakSet,bA=function(t){return t.replaceAll(" "," ")},wA=new WeakSet,AA=function(t){const{value:e,fontSize:i,color:s,pageIndex:r}=n(this,nA);return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some(((t,e)=>t!==s[e]))||t.pageIndex!==r},s(xA,uA),s(xA,yA),e(xA,"_freeTextDefaultContent",""),e(xA,"_internalPadding",0),e(xA,"_defaultColor",null),e(xA,"_defaultFontSize",10),e(xA,"_type","freetext"),e(xA,"_editorType",Jl.FREETEXT);class n_{constructor(t,e=0,i=0,a=!0){s(this,CA),s(this,RA),s(this,TA),s(this,IA),s(this,FA),s(this,SA,void 0),s(this,kA,[]),s(this,EA,[]);let o=1/0,l=-1/0,h=1/0,c=-1/0;const d=10**-4;for(const{x:i,y:s,width:r,height:a}of t){const t=Math.floor((i-e)/d)*d,u=Math.ceil((i+r+e)/d)*d,p=Math.floor((s-e)/d)*d,f=Math.ceil((s+a+e)/d)*d,g=[t,p,f,!0],m=[u,p,f,!1];n(this,kA).push(g,m),o=Math.min(o,t),l=Math.max(l,u),h=Math.min(h,p),c=Math.max(c,f)}const u=l-o+2*i,p=c-h+2*i,f=o-i,g=h-i,m=n(this,kA).at(a?-1:-2),v=[m[0],m[2]];for(const t of n(this,kA)){const[e,i,n]=t;t[0]=(e-f)/u,t[1]=(i-g)/p,t[2]=(n-g)/p}r(this,SA,{x:f,y:g,width:u,height:p,lastPoint:v})}getOutlines(){n(this,kA).sort(((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]));const t=[];for(const e of n(this,kA))e[3]?(t.push(...o(this,FA,NA).call(this,e)),o(this,TA,LA).call(this,e)):(o(this,IA,DA).call(this,e),t.push(...o(this,FA,NA).call(this,e)));return o(this,CA,MA).call(this,t)}}SA=new WeakMap,kA=new WeakMap,EA=new WeakMap,CA=new WeakSet,MA=function(t){const e=[],i=new Set;for(const i of t){const[t,n,s]=i;e.push([t,n,i],[t,s,i])}e.sort(((t,e)=>t[1]-e[1]||t[0]-e[0]));for(let t=0,n=e.length;t<n;t+=2){const n=e[t][2],s=e[t+1][2];n.push(s),s.push(n),i.add(n),i.add(s)}const s=[];let r;for(;i.size>0;){const t=i.values().next().value;let[e,n,a,o,l]=t;i.delete(t);let h=e,c=n;for(r=[e,a],s.push(r);;){let t;if(i.has(o))t=o;else{if(!i.has(l))break;t=l}i.delete(t),[e,n,a,o,l]=t,h!==e&&(r.push(h,c,e,c===n?n:a),h=e),c=c===n?a:n}r.push(h,c)}return new r_(s,n(this,SA))},RA=new WeakSet,PA=function(t){const e=n(this,EA);let i=0,s=e.length-1;for(;i<=s;){const n=i+s>>1,r=e[n][0];if(r===t)return n;r<t?i=n+1:s=n-1}return s+1},TA=new WeakSet,LA=function([,t,e]){const i=o(this,RA,PA).call(this,t);n(this,EA).splice(i,0,[t,e])},IA=new WeakSet,DA=function([,t,e]){const i=o(this,RA,PA).call(this,t);for(let s=i;s<n(this,EA).length;s++){const[i,r]=n(this,EA)[s];if(i!==t)break;if(i===t&&r===e)return void n(this,EA).splice(s,1)}for(let s=i-1;s>=0;s--){const[i,r]=n(this,EA)[s];if(i!==t)break;if(i===t&&r===e)return void n(this,EA).splice(s,1)}},FA=new WeakSet,NA=function(t){const[e,i,s]=t,r=[[e,i,s]],a=o(this,RA,PA).call(this,s);for(let t=0;t<a;t++){const[i,s]=n(this,EA)[t];for(let t=0,n=r.length;t<n;t++){const[,a,o]=r[t];if(!(s<=a||o<=i)){if(a>=i){if(o>s)r[t][1]=s;else{if(1===n)return[];r.splice(t,1),t--,n--}continue}r[t][2]=i,o>s&&r.push([e,s,o])}}}return r};class s_{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(t,e){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof V_}}class r_ extends s_{constructor(t,e){super(),s(this,OA,void 0),s(this,WA,void 0),r(this,WA,t),r(this,OA,e)}toSVGPath(){const t=[];for(const e of n(this,WA)){let[i,n]=e;t.push(`M${i} ${n}`);for(let s=2;s<e.length;s+=2){const r=e[s],a=e[s+1];r===i?(t.push(`V${a}`),n=a):a===n&&(t.push(`H${r}`),i=r)}t.push("Z")}return t.join(" ")}serialize([t,e,i,s],r){const a=[],o=i-t,l=s-e;for(const e of n(this,WA)){const i=new Array(e.length);for(let n=0;n<e.length;n+=2)i[n]=t+e[n]*o,i[n+1]=s-e[n+1]*l;a.push(i)}return a}get box(){return n(this,OA)}}OA=new WeakMap,WA=new WeakMap;const a_=class{constructor({x:t,y:e},i,a,o,l,h=0){s(this,e_),s(this,jA,void 0),s(this,BA,[]),s(this,$A,void 0),s(this,zA,void 0),s(this,HA,[]),s(this,UA,new Float64Array(18)),s(this,VA,void 0),s(this,GA,void 0),s(this,qA,void 0),s(this,XA,void 0),s(this,YA,void 0),s(this,KA,void 0),s(this,JA,[]),r(this,jA,i),r(this,KA,o*a),r(this,zA,l),n(this,UA).set([NaN,NaN,NaN,NaN,t,e],6),r(this,$A,h),r(this,XA,n(a_,QA)*a),r(this,qA,n(a_,t_)*a),r(this,YA,a),n(this,JA).push(t,e)}get free(){return!0}isEmpty(){return isNaN(n(this,UA)[8])}add({x:t,y:e}){var i;r(this,VA,t),r(this,GA,e);const[s,a,o,l]=n(this,jA);let[h,c,d,u]=n(this,UA).subarray(8,12);const p=t-d,f=e-u,g=Math.hypot(p,f);if(g<n(this,qA))return!1;const m=g-n(this,XA),v=m/g,y=v*p,b=v*f;let w=h,A=c;h=d,c=u,d+=y,u+=b,null==(i=n(this,JA))||i.push(t,e);const _=y/m,x=-b/m*n(this,KA),S=_*n(this,KA);return n(this,UA).set(n(this,UA).subarray(2,8),0),n(this,UA).set([d+x,u+S],4),n(this,UA).set(n(this,UA).subarray(14,18),12),n(this,UA).set([d-x,u-S],16),isNaN(n(this,UA)[6])?(0===n(this,HA).length&&(n(this,UA).set([h+x,c+S],2),n(this,HA).push(NaN,NaN,NaN,NaN,(h+x-s)/o,(c+S-a)/l),n(this,UA).set([h-x,c-S],14),n(this,BA).push(NaN,NaN,NaN,NaN,(h-x-s)/o,(c-S-a)/l)),n(this,UA).set([w,A,h,c,d,u],6),!this.isEmpty()):(n(this,UA).set([w,A,h,c,d,u],6),Math.abs(Math.atan2(A-c,w-h)-Math.atan2(b,y))<Math.PI/2?([h,c,d,u]=n(this,UA).subarray(2,6),n(this,HA).push(NaN,NaN,NaN,NaN,((h+d)/2-s)/o,((c+u)/2-a)/l),[h,c,w,A]=n(this,UA).subarray(14,18),n(this,BA).push(NaN,NaN,NaN,NaN,((w+h)/2-s)/o,((A+c)/2-a)/l),!0):([w,A,h,c,d,u]=n(this,UA).subarray(0,6),n(this,HA).push(((w+5*h)/6-s)/o,((A+5*c)/6-a)/l,((5*h+d)/6-s)/o,((5*c+u)/6-a)/l,((h+d)/2-s)/o,((c+u)/2-a)/l),[d,u,h,c,w,A]=n(this,UA).subarray(12,18),n(this,BA).push(((w+5*h)/6-s)/o,((A+5*c)/6-a)/l,((5*h+d)/6-s)/o,((5*c+u)/6-a)/l,((h+d)/2-s)/o,((c+u)/2-a)/l),!0))}toSVGPath(){if(this.isEmpty())return"";const t=n(this,HA),e=n(this,BA),i=n(this,UA).subarray(4,6),s=n(this,UA).subarray(16,18),[r,a,l,h]=n(this,jA),[c,d,u,p]=o(this,e_,i_).call(this);if(isNaN(n(this,UA)[6])&&!this.isEmpty())return`M${(n(this,UA)[2]-r)/l} ${(n(this,UA)[3]-a)/h} L${(n(this,UA)[4]-r)/l} ${(n(this,UA)[5]-a)/h} L${c} ${d} L${u} ${p} L${(n(this,UA)[16]-r)/l} ${(n(this,UA)[17]-a)/h} L${(n(this,UA)[14]-r)/l} ${(n(this,UA)[15]-a)/h} Z`;const f=[];f.push(`M${t[4]} ${t[5]}`);for(let e=6;e<t.length;e+=6)isNaN(t[e])?f.push(`L${t[e+4]} ${t[e+5]}`):f.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);f.push(`L${(i[0]-r)/l} ${(i[1]-a)/h} L${c} ${d} L${u} ${p} L${(s[0]-r)/l} ${(s[1]-a)/h}`);for(let t=e.length-6;t>=6;t-=6)isNaN(e[t])?f.push(`L${e[t+4]} ${e[t+5]}`):f.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);return f.push(`L${e[4]} ${e[5]} Z`),f.join(" ")}getOutlines(){var t;const e=n(this,HA),i=n(this,BA),s=n(this,UA),r=s.subarray(4,6),a=s.subarray(16,18),[l,h,c,d]=n(this,jA),u=new Float64Array(((null==(t=n(this,JA))?void 0:t.length)??0)+2);for(let t=0,e=u.length-2;t<e;t+=2)u[t]=(n(this,JA)[t]-l)/c,u[t+1]=(n(this,JA)[t+1]-h)/d;u[u.length-2]=(n(this,VA)-l)/c,u[u.length-1]=(n(this,GA)-h)/d;const[p,f,g,m]=o(this,e_,i_).call(this);if(isNaN(s[6])&&!this.isEmpty()){const t=new Float64Array(36);return t.set([NaN,NaN,NaN,NaN,(s[2]-l)/c,(s[3]-h)/d,NaN,NaN,NaN,NaN,(s[4]-l)/c,(s[5]-h)/d,NaN,NaN,NaN,NaN,p,f,NaN,NaN,NaN,NaN,g,m,NaN,NaN,NaN,NaN,(s[16]-l)/c,(s[17]-h)/d,NaN,NaN,NaN,NaN,(s[14]-l)/c,(s[15]-h)/d],0),new V_(t,u,n(this,jA),n(this,YA),n(this,$A),n(this,zA))}const v=new Float64Array(n(this,HA).length+24+n(this,BA).length);let y=e.length;for(let t=0;t<y;t+=2)isNaN(e[t])?v[t]=v[t+1]=NaN:(v[t]=e[t],v[t+1]=e[t+1]);v.set([NaN,NaN,NaN,NaN,(r[0]-l)/c,(r[1]-h)/d,NaN,NaN,NaN,NaN,p,f,NaN,NaN,NaN,NaN,g,m,NaN,NaN,NaN,NaN,(a[0]-l)/c,(a[1]-h)/d],y),y+=24;for(let t=i.length-6;t>=6;t-=6)for(let e=0;e<6;e+=2)isNaN(i[t+e])?(v[y]=v[y+1]=NaN,y+=2):(v[y]=i[t+e],v[y+1]=i[t+e+1],y+=2);return v.set([NaN,NaN,NaN,NaN,i[4],i[5]],y),new V_(v,u,n(this,jA),n(this,YA),n(this,$A),n(this,zA))}};let o_=a_;var l_,h_,c_,d_,u_,p_,f_,g_,m_,v_,y_,b_,w_,A_,__,x_,S_,k_,E_,C_,M_,R_,P_,T_,L_,I_,D_,F_,N_,O_,W_,j_,B_,$_,z_,H_,U_;jA=new WeakMap,BA=new WeakMap,$A=new WeakMap,zA=new WeakMap,HA=new WeakMap,UA=new WeakMap,VA=new WeakMap,GA=new WeakMap,qA=new WeakMap,XA=new WeakMap,YA=new WeakMap,KA=new WeakMap,JA=new WeakMap,QA=new WeakMap,ZA=new WeakMap,t_=new WeakMap,e_=new WeakSet,i_=function(){const t=n(this,UA).subarray(4,6),e=n(this,UA).subarray(16,18),[i,s,r,a]=n(this,jA);return[(n(this,VA)+(t[0]-e[0])/2-i)/r,(n(this,GA)+(t[1]-e[1])/2-s)/a,(n(this,VA)+(e[0]-t[0])/2-i)/r,(n(this,GA)+(e[1]-t[1])/2-s)/a]},s(o_,QA,8),s(o_,ZA,2),s(o_,t_,n(a_,QA)+n(a_,ZA));class V_ extends s_{constructor(t,e,i,a,l,h){super(),s(this,g_),s(this,v_),s(this,b_),s(this,l_,void 0),s(this,h_,null),s(this,c_,void 0),s(this,d_,void 0),s(this,u_,void 0),s(this,p_,void 0),s(this,f_,void 0),r(this,f_,t),r(this,u_,e),r(this,l_,i),r(this,p_,a),r(this,c_,l),r(this,d_,h),o(this,b_,w_).call(this,h);const{x:c,y:d,width:u,height:p}=n(this,h_);for(let e=0,i=t.length;e<i;e+=2)t[e]=(t[e]-c)/u,t[e+1]=(t[e+1]-d)/p;for(let t=0,i=e.length;t<i;t+=2)e[t]=(e[t]-c)/u,e[t+1]=(e[t+1]-d)/p}toSVGPath(){const t=[`M${n(this,f_)[4]} ${n(this,f_)[5]}`];for(let e=6,i=n(this,f_).length;e<i;e+=6)isNaN(n(this,f_)[e])?t.push(`L${n(this,f_)[e+4]} ${n(this,f_)[e+5]}`):t.push(`C${n(this,f_)[e]} ${n(this,f_)[e+1]} ${n(this,f_)[e+2]} ${n(this,f_)[e+3]} ${n(this,f_)[e+4]} ${n(this,f_)[e+5]}`);return t.push("Z"),t.join(" ")}serialize([t,e,i,s],r){const a=i-t,l=s-e;let h,c;switch(r){case 0:h=o(this,g_,m_).call(this,n(this,f_),t,s,a,-l),c=o(this,g_,m_).call(this,n(this,u_),t,s,a,-l);break;case 90:h=o(this,v_,y_).call(this,n(this,f_),t,e,a,l),c=o(this,v_,y_).call(this,n(this,u_),t,e,a,l);break;case 180:h=o(this,g_,m_).call(this,n(this,f_),i,e,-a,l),c=o(this,g_,m_).call(this,n(this,u_),i,e,-a,l);break;case 270:h=o(this,v_,y_).call(this,n(this,f_),i,s,-a,-l),c=o(this,v_,y_).call(this,n(this,u_),i,s,-a,-l)}return{outline:Array.from(h),points:[Array.from(c)]}}get box(){return n(this,h_)}getNewOutline(t,e){const{x:i,y:s,width:r,height:a}=n(this,h_),[o,l,h,c]=n(this,l_),d=r*h,u=a*c,p=i*h+o,f=s*c+l,g=new o_({x:n(this,u_)[0]*d+p,y:n(this,u_)[1]*u+f},n(this,l_),n(this,p_),t,n(this,d_),e??n(this,c_));for(let t=2;t<n(this,u_).length;t+=2)g.add({x:n(this,u_)[t]*d+p,y:n(this,u_)[t+1]*u+f});return g.getOutlines()}}l_=new WeakMap,h_=new WeakMap,c_=new WeakMap,d_=new WeakMap,u_=new WeakMap,p_=new WeakMap,f_=new WeakMap,g_=new WeakSet,m_=function(t,e,i,n,s){const r=new Float64Array(t.length);for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a]*n,r[a+1]=i+t[a+1]*s;return r},v_=new WeakSet,y_=function(t,e,i,n,s){const r=new Float64Array(t.length);for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a+1]*n,r[a+1]=i+t[a]*s;return r},b_=new WeakSet,w_=function(t){const e=n(this,f_);let i=e[4],s=e[5],a=i,o=s,l=i,h=s,c=i,d=s;const u=t?Math.max:Math.min;for(let t=6,n=e.length;t<n;t+=6){if(isNaN(e[t]))a=Math.min(a,e[t+4]),o=Math.min(o,e[t+5]),l=Math.max(l,e[t+4]),h=Math.max(h,e[t+5]),d<e[t+5]?(c=e[t+4],d=e[t+5]):d===e[t+5]&&(c=u(c,e[t+4]));else{const n=rc.bezierBoundingBox(i,s,...e.slice(t,t+6));a=Math.min(a,n[0]),o=Math.min(o,n[1]),l=Math.max(l,n[2]),h=Math.max(h,n[3]),d<n[3]?(c=n[2],d=n[3]):d===n[3]&&(c=u(c,n[2]))}i=e[t+4],s=e[t+5]}const p=a-n(this,c_),f=o-n(this,c_),g=l-a+2*n(this,c_),m=h-o+2*n(this,c_);r(this,h_,{x:p,y:f,width:g,height:m,lastPoint:[c,d]})};const G_=class{constructor({editor:t=null,uiManager:e=null}){var i;s(this,I_),s(this,F_),s(this,O_),s(this,j_),s(this,$_),s(this,H_),s(this,A_,o(this,O_,W_).bind(this)),s(this,__,o(this,$_,z_).bind(this)),s(this,x_,null),s(this,S_,null),s(this,k_,void 0),s(this,E_,null),s(this,C_,!1),s(this,M_,!1),s(this,R_,null),s(this,P_,void 0),s(this,T_,null),s(this,L_,void 0),t?(r(this,M_,!1),r(this,L_,Ql.HIGHLIGHT_COLOR),r(this,R_,t)):(r(this,M_,!0),r(this,L_,Ql.HIGHLIGHT_DEFAULT_COLOR)),r(this,T_,(null==t?void 0:t._uiManager)||e),r(this,P_,n(this,T_)._eventBus),r(this,k_,(null==t?void 0:t.color)||(null==(i=n(this,T_))?void 0:i.highlightColors.values().next().value)||"#FFFF98")}static get _keyboardManager(){return $h(this,"_keyboardManager",new gu([[["Escape","mac+Escape"],G_.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],G_.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],G_.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],G_.prototype._moveToPrevious],[["Home","mac+Home"],G_.prototype._moveToBeginning],[["End","mac+End"],G_.prototype._moveToEnd]]))}renderButton(){const t=r(this,x_,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const e=n(this,T_)._signal;t.addEventListener("click",o(this,j_,B_).bind(this),{signal:e}),t.addEventListener("keydown",n(this,A_),{signal:e});const i=r(this,S_,document.createElement("span"));return i.className="swatch",i.setAttribute("aria-hidden",!0),i.style.backgroundColor=n(this,k_),t.append(i),t}renderMainDropdown(){const t=r(this,E_,o(this,I_,D_).call(this));return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}_colorSelectFromKeyboard(t){if(t.target===n(this,x_))return void o(this,j_,B_).call(this,t);const e=t.target.getAttribute("data-color");e&&o(this,F_,N_).call(this,e,t)}_moveToNext(t){var e,i;n(this,H_,U_)?t.target!==n(this,x_)?null==(i=t.target.nextSibling)||i.focus():null==(e=n(this,E_).firstChild)||e.focus():o(this,j_,B_).call(this,t)}_moveToPrevious(t){var e,i;t.target!==(null==(e=n(this,E_))?void 0:e.firstChild)&&t.target!==n(this,x_)?(n(this,H_,U_)||o(this,j_,B_).call(this,t),null==(i=t.target.previousSibling)||i.focus()):n(this,H_,U_)&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){var e;n(this,H_,U_)?null==(e=n(this,E_).firstChild)||e.focus():o(this,j_,B_).call(this,t)}_moveToEnd(t){var e;n(this,H_,U_)?null==(e=n(this,E_).lastChild)||e.focus():o(this,j_,B_).call(this,t)}hideDropdown(){var t;null==(t=n(this,E_))||t.classList.add("hidden"),window.removeEventListener("pointerdown",n(this,__))}_hideDropdownFromKeyboard(){var t;if(!n(this,M_)){if(!n(this,H_,U_))return void(null==(t=n(this,R_))||t.unselect());this.hideDropdown(),n(this,x_).focus({preventScroll:!0,focusVisible:n(this,C_)})}}updateColor(t){if(n(this,S_)&&(n(this,S_).style.backgroundColor=t),!n(this,E_))return;const e=n(this,T_).highlightColors.values();for(const i of n(this,E_).children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){var t,e;null==(t=n(this,x_))||t.remove(),r(this,x_,null),r(this,S_,null),null==(e=n(this,E_))||e.remove(),r(this,E_,null)}};let q_=G_;var X_,Y_,K_,J_,Q_,Z_,tx,ex,ix,nx,sx,rx,ax,ox,lx,hx,cx,dx,ux,px,fx,gx,mx,vx,yx,bx,wx,Ax,_x,xx,Sx,kx,Ex,Cx,Mx,Rx,Px,Tx,Lx,Ix,Dx,Fx,Nx,Ox,Wx,jx,Bx,$x,zx;A_=new WeakMap,__=new WeakMap,x_=new WeakMap,S_=new WeakMap,k_=new WeakMap,E_=new WeakMap,C_=new WeakMap,M_=new WeakMap,R_=new WeakMap,P_=new WeakMap,T_=new WeakMap,L_=new WeakMap,I_=new WeakSet,D_=function(){const t=document.createElement("div"),e=n(this,T_)._signal;t.addEventListener("contextmenu",gd,{signal:e}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[i,s]of n(this,T_).highlightColors){const r=document.createElement("button");r.tabIndex="0",r.role="option",r.setAttribute("data-color",s),r.title=i,r.setAttribute("data-l10n-id",`pdfjs-editor-colorpicker-${i}`);const a=document.createElement("span");r.append(a),a.className="swatch",a.style.backgroundColor=s,r.setAttribute("aria-selected",s===n(this,k_)),r.addEventListener("click",o(this,F_,N_).bind(this,s),{signal:e}),t.append(r)}return t.addEventListener("keydown",n(this,A_),{signal:e}),t},F_=new WeakSet,N_=function(t,e){e.stopPropagation(),n(this,P_).dispatch("switchannotationeditorparams",{source:this,type:n(this,L_),value:t})},O_=new WeakSet,W_=function(t){G_._keyboardManager.exec(this,t)},j_=new WeakSet,B_=function(t){if(n(this,H_,U_))return void this.hideDropdown();if(r(this,C_,0===t.detail),window.addEventListener("pointerdown",n(this,__),{signal:n(this,T_)._signal}),n(this,E_))return void n(this,E_).classList.remove("hidden");const e=r(this,E_,o(this,I_,D_).call(this));n(this,x_).append(e)},$_=new WeakSet,z_=function(t){var e;null!=(e=n(this,E_))&&e.contains(t.target)||this.hideDropdown()},H_=new WeakSet,U_=function(){return n(this,E_)&&!n(this,E_).classList.contains("hidden")};const Hx=class extends og{constructor(t){super({...t,name:"highlightEditor"}),s(this,px),s(this,gx),s(this,vx),s(this,bx),s(this,Ax),s(this,xx),s(this,kx),s(this,Rx),s(this,Tx),s(this,Ix),s(this,Fx),s(this,Ox),s(this,X_,null),s(this,Y_,0),s(this,K_,void 0),s(this,J_,null),s(this,Q_,null),s(this,Z_,null),s(this,tx,null),s(this,ex,0),s(this,ix,null),s(this,nx,null),s(this,sx,null),s(this,rx,!1),s(this,ax,o(this,Rx,Px).bind(this)),s(this,ox,null),s(this,lx,void 0),s(this,hx,null),s(this,cx,""),s(this,dx,void 0),s(this,ux,""),this.color=t.color||Hx._defaultColor,r(this,dx,t.thickness||Hx._defaultThickness),r(this,lx,t.opacity||Hx._defaultOpacity),r(this,K_,t.boxes||null),r(this,ux,t.methodOfCreation||""),r(this,cx,t.text||""),this._isDraggable=!1,t.highlightId>-1?(r(this,rx,!0),o(this,gx,mx).call(this,t),o(this,kx,Ex).call(this)):(r(this,X_,t.anchorNode),r(this,Y_,t.anchorOffset),r(this,tx,t.focusNode),r(this,ex,t.focusOffset),o(this,px,fx).call(this),o(this,kx,Ex).call(this),this.rotate(this.rotation))}static get _keyboardManager(){const t=Hx.prototype;return $h(this,"_keyboardManager",new gu([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:n(this,rx)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:n(this,dx),methodOfCreation:n(this,ux)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,e){var i;og.initialize(t,e),Hx._defaultColor||(Hx._defaultColor=(null==(i=e.highlightColors)?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(t,e){switch(t){case Ql.HIGHLIGHT_DEFAULT_COLOR:Hx._defaultColor=e;break;case Ql.HIGHLIGHT_THICKNESS:Hx._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return n(this,ox)}updateParams(t,e){switch(t){case Ql.HIGHLIGHT_COLOR:o(this,vx,yx).call(this,e);break;case Ql.HIGHLIGHT_THICKNESS:o(this,bx,wx).call(this,e)}}static get defaultPropertiesToUpdate(){return[[Ql.HIGHLIGHT_DEFAULT_COLOR,Hx._defaultColor],[Ql.HIGHLIGHT_THICKNESS,Hx._defaultThickness]]}get propertiesToUpdate(){return[[Ql.HIGHLIGHT_COLOR,this.color||Hx._defaultColor],[Ql.HIGHLIGHT_THICKNESS,n(this,dx)||Hx._defaultThickness],[Ql.HIGHLIGHT_FREE,n(this,rx)]]}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(r(this,Q_,new q_({editor:this})),t.addColorPicker(n(this,Q_))),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(o(this,Ix,Dx).call(this))}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,o(this,Ix,Dx).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){o(this,xx,Sx).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(o(this,kx,Ex).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var e;let i=!1;this.parent&&!t?o(this,xx,Sx).call(this):t&&(o(this,kx,Ex).call(this,t),i=!this.parent&&(null==(e=this.div)?void 0:e.classList.contains("selectedEditor"))),super.setParent(t),this.show(this._isVisible),i&&this.select()}rotate(t){var e,i,s;const{drawLayer:r}=this.parent;let a;n(this,rx)?(t=(t-this.rotation+360)%360,a=o(e=Hx,Cx,Mx).call(e,n(this,nx).box,t)):a=o(i=Hx,Cx,Mx).call(i,this,t),r.rotate(n(this,sx),t),r.rotate(n(this,hx),t),r.updateBox(n(this,sx),a),r.updateBox(n(this,hx),o(s=Hx,Cx,Mx).call(s,n(this,Z_).box,t))}render(){if(this.div)return this.div;const t=super.render();n(this,cx)&&(t.setAttribute("aria-label",n(this,cx)),t.setAttribute("role","mark")),n(this,rx)?t.classList.add("free"):this.div.addEventListener("keydown",n(this,ax),{signal:this._uiManager._signal});const e=r(this,ix,document.createElement("div"));t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=n(this,J_);const[i,s]=this.parentDimensions;return this.setDims(this.width*i,this.height*s),su(this,n(this,ix),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.parent.drawLayer.addClass(n(this,hx),"hovered")}pointerleave(){this.parent.drawLayer.removeClass(n(this,hx),"hovered")}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:o(this,Tx,Lx).call(this,!0);break;case 1:case 3:o(this,Tx,Lx).call(this,!1)}}select(){var t,e;super.select(),n(this,hx)&&(null==(t=this.parent)||t.drawLayer.removeClass(n(this,hx),"hovered"),null==(e=this.parent)||e.drawLayer.addClass(n(this,hx),"selected"))}unselect(){var t;super.unselect(),n(this,hx)&&(null==(t=this.parent)||t.drawLayer.removeClass(n(this,hx),"selected"),n(this,rx)||o(this,Tx,Lx).call(this,!1))}get _mustFixPosition(){return!n(this,rx)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.show(n(this,sx),t),this.parent.drawLayer.show(n(this,hx),t))}static startHighlighting(t,e,{target:i,x:n,y:s}){const{x:r,y:a,width:l,height:h}=i.getBoundingClientRect(),c=e=>{o(this,jx,Bx).call(this,t,e)},d=t._signal,u={capture:!0,passive:!1,signal:d},p=t=>{t.preventDefault(),t.stopPropagation()},f=e=>{i.removeEventListener("pointermove",c),window.removeEventListener("blur",f),window.removeEventListener("pointerup",f),window.removeEventListener("pointerdown",p,u),window.removeEventListener("contextmenu",gd),o(this,$x,zx).call(this,t,e)};window.addEventListener("blur",f,{signal:d}),window.addEventListener("pointerup",f,{signal:d}),window.addEventListener("pointerdown",p,u),window.addEventListener("contextmenu",gd,{signal:d}),i.addEventListener("pointermove",c,{signal:d}),this._freeHighlight=new o_({x:n,y:s},[r,a,l,h],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static deserialize(t,e,i){var n;const s=super.deserialize(t,e,i),{rect:[a,l,h,c],color:d,quadPoints:u}=t;s.color=rc.makeHexColor(...d),r(s,lx,t.opacity);const[p,f]=s.pageDimensions;s.width=(h-a)/p,s.height=(c-l)/f;const g=r(s,K_,[]);for(let t=0;t<u.length;t+=8)g.push({x:(u[4]-h)/p,y:(c-(1-u[t+5]))/f,width:(u[t+2]-u[t])/p,height:(u[t+5]-u[t+1])/f});return o(n=s,px,fx).call(n),s}serialize(t=!1){if(this.isEmpty()||t)return null;const e=this.getRect(0,0),i=og._colorManager.convert(this.color);return{annotationType:Jl.HIGHLIGHT,color:i,opacity:n(this,lx),thickness:n(this,dx),quadPoints:o(this,Fx,Nx).call(this),outlines:o(this,Ox,Wx).call(this,e),pageIndex:this.pageIndex,rect:e,rotation:o(this,Ix,Dx).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}};let Ux=Hx;var Vx,Gx,qx,Xx,Yx,Kx,Jx,Qx,Zx,tS,eS,iS,nS,sS,rS,aS,oS,lS,hS,cS,dS,uS,pS,fS,gS,mS,vS,yS,bS,wS,AS,_S,xS,SS,kS,ES,CS,MS,RS,PS,TS,LS,IS,DS,FS,NS,OS,WS,jS,BS,$S,zS,HS,US,VS,GS,qS,XS,YS,KS,JS,QS,ZS,tk,ek,ik,nk;X_=new WeakMap,Y_=new WeakMap,K_=new WeakMap,J_=new WeakMap,Q_=new WeakMap,Z_=new WeakMap,tx=new WeakMap,ex=new WeakMap,ix=new WeakMap,nx=new WeakMap,sx=new WeakMap,rx=new WeakMap,ax=new WeakMap,ox=new WeakMap,lx=new WeakMap,hx=new WeakMap,cx=new WeakMap,dx=new WeakMap,ux=new WeakMap,px=new WeakSet,fx=function(){const t=new n_(n(this,K_),.001);r(this,nx,t.getOutlines()),({x:this.x,y:this.y,width:this.width,height:this.height}=n(this,nx).box);const e=new n_(n(this,K_),.0025,.001,"ltr"===this._uiManager.direction);r(this,Z_,e.getOutlines());const{lastPoint:i}=n(this,Z_).box;r(this,ox,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])},gx=new WeakSet,mx=function({highlightOutlines:t,highlightId:e,clipPathId:i}){var s,a;r(this,nx,t);if(r(this,Z_,t.getNewOutline(n(this,dx)/2+1.5,.0025)),e>=0)r(this,sx,e),r(this,J_,i),this.parent.drawLayer.finalizeLine(e,t),r(this,hx,this.parent.drawLayer.highlightOutline(n(this,Z_)));else if(this.parent){const e=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(n(this,sx),t),this.parent.drawLayer.updateBox(n(this,sx),o(s=Hx,Cx,Mx).call(s,n(this,nx).box,(e-this.rotation+360)%360)),this.parent.drawLayer.updateLine(n(this,hx),n(this,Z_)),this.parent.drawLayer.updateBox(n(this,hx),o(a=Hx,Cx,Mx).call(a,n(this,Z_).box,e))}const{x:l,y:h,width:c,height:d}=t.box;switch(this.rotation){case 0:this.x=l,this.y=h,this.width=c,this.height=d;break;case 90:{const[t,e]=this.parentDimensions;this.x=h,this.y=1-l,this.width=c*e/t,this.height=d*t/e;break}case 180:this.x=1-l,this.y=1-h,this.width=c,this.height=d;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-h,this.y=l,this.width=c*e/t,this.height=d*t/e;break}}const{lastPoint:u}=n(this,Z_).box;r(this,ox,[(u[0]-l)/c,(u[1]-h)/d])},vx=new WeakSet,yx=function(t){const e=t=>{var e,i;this.color=t,null==(e=this.parent)||e.drawLayer.changeColor(n(this,sx),t),null==(i=n(this,Q_))||i.updateColor(t)},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)},bx=new WeakSet,wx=function(t){const e=n(this,dx),i=t=>{r(this,dx,t),o(this,Ax,_x).call(this,t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)},Ax=new WeakSet,_x=function(t){if(!n(this,rx))return;o(this,gx,mx).call(this,{highlightOutlines:n(this,nx).getNewOutline(t/2)}),this.fixAndSetPosition();const[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)},xx=new WeakSet,Sx=function(){null===n(this,sx)||!this.parent||(this.parent.drawLayer.remove(n(this,sx)),r(this,sx,null),this.parent.drawLayer.remove(n(this,hx)),r(this,hx,null))},kx=new WeakSet,Ex=function(t=this.parent){null===n(this,sx)&&(({id:a(this,sx)._,clipPathId:a(this,J_)._}=t.drawLayer.highlight(n(this,nx),this.color,n(this,lx))),r(this,hx,t.drawLayer.highlightOutline(n(this,Z_))),n(this,ix)&&(n(this,ix).style.clipPath=n(this,J_)))},Cx=new WeakSet,Mx=function({x:t,y:e,width:i,height:n},s){switch(s){case 90:return{x:1-e-n,y:t,width:n,height:i};case 180:return{x:1-t-i,y:1-e-n,width:i,height:n};case 270:return{x:e,y:1-t-i,width:n,height:i}}return{x:t,y:e,width:i,height:n}},Rx=new WeakSet,Px=function(t){Hx._keyboardManager.exec(this,t)},Tx=new WeakSet,Lx=function(t){if(!n(this,X_))return;const e=window.getSelection();t?e.setPosition(n(this,X_),n(this,Y_)):e.setPosition(n(this,tx),n(this,ex))},Ix=new WeakSet,Dx=function(){return n(this,rx)?this.rotation:0},Fx=new WeakSet,Nx=function(){if(n(this,rx))return null;const[t,e]=this.pageDimensions,i=n(this,K_),s=new Float32Array(8*i.length);let r=0;for(const{x:n,y:a,width:o,height:l}of i){const i=n*t,h=(1-a-l)*e;s[r]=s[r+4]=i,s[r+1]=s[r+3]=h,s[r+2]=s[r+6]=i+o*t,s[r+5]=s[r+7]=h+l*e,r+=8}return s},Ox=new WeakSet,Wx=function(t){return n(this,nx).serialize(t,o(this,Ix,Dx).call(this))},jx=new WeakSet,Bx=function(t,e){this._freeHighlight.add(e)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)},$x=new WeakSet,zx=function(t,e){this._freeHighlight.isEmpty()?t.drawLayer.removeFreeHighlight(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},s(Ux,Cx),s(Ux,jx),s(Ux,$x),e(Ux,"_defaultColor",null),e(Ux,"_defaultOpacity",1),e(Ux,"_defaultThickness",12),e(Ux,"_l10nPromise"),e(Ux,"_type","highlight"),e(Ux,"_editorType",Jl.HIGHLIGHT),e(Ux,"_freeHighlightId",-1),e(Ux,"_freeHighlight",null),e(Ux,"_freeHighlightClipId","");const sk=class extends og{constructor(t){super({...t,name:"inkEditor"}),s(this,aS),s(this,lS),s(this,cS),s(this,uS),s(this,fS),s(this,mS),s(this,yS),s(this,wS),s(this,_S),s(this,SS),s(this,ES),s(this,MS),s(this,PS),s(this,LS),s(this,DS),s(this,NS),s(this,WS),s(this,BS),s(this,zS),s(this,KS),s(this,QS),s(this,tk),s(this,ik),s(this,Vx,0),s(this,Gx,0),s(this,qx,this.canvasPointermove.bind(this)),s(this,Xx,this.canvasPointerleave.bind(this)),s(this,Yx,this.canvasPointerup.bind(this)),s(this,Kx,this.canvasPointerdown.bind(this)),s(this,Jx,null),s(this,Qx,new Path2D),s(this,Zx,!1),s(this,tS,!1),s(this,eS,!1),s(this,iS,null),s(this,nS,0),s(this,sS,0),s(this,rS,null),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t,e){og.initialize(t,e)}static updateDefaultParams(t,e){switch(t){case Ql.INK_THICKNESS:sk._defaultThickness=e;break;case Ql.INK_COLOR:sk._defaultColor=e;break;case Ql.INK_OPACITY:sk._defaultOpacity=e/100}}updateParams(t,e){switch(t){case Ql.INK_THICKNESS:o(this,aS,oS).call(this,e);break;case Ql.INK_COLOR:o(this,lS,hS).call(this,e);break;case Ql.INK_OPACITY:o(this,cS,dS).call(this,e)}}static get defaultPropertiesToUpdate(){return[[Ql.INK_THICKNESS,sk._defaultThickness],[Ql.INK_COLOR,sk._defaultColor||og._defaultLineColor],[Ql.INK_OPACITY,Math.round(100*sk._defaultOpacity)]]}get propertiesToUpdate(){return[[Ql.INK_THICKNESS,this.thickness||sk._defaultThickness],[Ql.INK_COLOR,this.color||sk._defaultColor||og._defaultLineColor],[Ql.INK_OPACITY,Math.round(100*(this.opacity??sk._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(o(this,DS,FS).call(this),o(this,NS,OS).call(this)),this.isAttachedToDOM||(this.parent.add(this),o(this,WS,jS).call(this)),o(this,ik,nk).call(this)))}remove(){var t;null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,n(this,Jx)&&(clearTimeout(n(this,Jx)),r(this,Jx,null)),null==(t=n(this,iS))||t.disconnect(),r(this,iS,null),super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,i=this.width*t,n=this.height*e;this.setDimensions(i,n)}enableEditMode(){n(this,Zx)||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",n(this,Kx),{signal:this._uiManager._signal}))}disableEditMode(){!this.isInEditMode()||null===this.canvas||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",n(this,Kx)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){n(this,Zx)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),r(this,Zx,!0),this.div.classList.add("disabled"),o(this,ik,nk).call(this,!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){0!==t.button||!this.isInEditMode()||n(this,Zx)||(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),o(this,mS,vS).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),o(this,yS,bS).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),o(this,LS,IS).call(this,t)}canvasPointerleave(t){o(this,LS,IS).call(this,t)}get isResizable(){return!this.isEmpty()&&n(this,Zx)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,n,s,a]=o(this,uS,pS).call(this);if(this.setAt(i,n,0,0),this.setDims(s,a),o(this,DS,FS).call(this),this.width){const[i,n]=this.parentDimensions;this.setAspectRatio(this.width*i,this.height*n),this.setAt(t*i,e*n,this.width*i,this.height*n),r(this,eS,!0),o(this,WS,jS).call(this),this.setDims(this.width*i,this.height*n),o(this,PS,TS).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return o(this,NS,OS).call(this),this.div}setDimensions(t,e){const i=Math.round(t),s=Math.round(e);if(n(this,nS)===i&&n(this,sS)===s)return;r(this,nS,i),r(this,sS,s),this.canvas.style.visibility="hidden";const[a,l]=this.parentDimensions;this.width=t/a,this.height=e/l,this.fixAndSetPosition(),n(this,Zx)&&o(this,BS,$S).call(this,t,e),o(this,WS,jS).call(this),o(this,PS,TS).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(t,e,i){var n,s,a;if(t instanceof jw)return null;const l=super.deserialize(t,e,i);l.thickness=t.thickness,l.color=rc.makeHexColor(...t.color),l.opacity=t.opacity;const[h,c]=l.pageDimensions,d=l.width*h,u=l.height*c,p=l.parentScale,f=t.thickness/2;r(l,Zx,!0),r(l,nS,Math.round(d)),r(l,sS,Math.round(u));const{paths:g,rect:m,rotation:v}=t;for(let{bezier:t}of g){t=o(n=sk,XS,YS).call(n,t,m,v);const e=[];l.paths.push(e);let i=p*(t[0]-f),s=p*(t[1]-f);for(let n=2,r=t.length;n<r;n+=6){const r=p*(t[n]-f),a=p*(t[n+1]-f),o=p*(t[n+2]-f),l=p*(t[n+3]-f),h=p*(t[n+4]-f),c=p*(t[n+5]-f);e.push([[i,s],[r,a],[o,l],[h,c]]),i=h,s=c}const r=o(this,US,VS).call(this,e);l.bezierPath2D.push(r)}const y=o(s=l,QS,ZS).call(s);return r(l,Gx,Math.max(og.MIN_SIZE,y[2]-y[0])),r(l,Vx,Math.max(og.MIN_SIZE,y[3]-y[1])),o(a=l,BS,$S).call(a,d,u),l}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=og._colorManager.convert(this.ctx.strokeStyle);return{annotationType:Jl.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:o(this,KS,JS).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};let rk=sk;var ak,ok,lk,hk,ck,dk,uk,pk,fk,gk,mk,vk,yk,bk,wk,Ak,_k,xk,Sk,kk,Ek,Ck,Mk,Rk,Pk,Tk,Lk,Ik,Dk;Vx=new WeakMap,Gx=new WeakMap,qx=new WeakMap,Xx=new WeakMap,Yx=new WeakMap,Kx=new WeakMap,Jx=new WeakMap,Qx=new WeakMap,Zx=new WeakMap,tS=new WeakMap,eS=new WeakMap,iS=new WeakMap,nS=new WeakMap,sS=new WeakMap,rS=new WeakMap,aS=new WeakSet,oS=function(t){const e=t=>{this.thickness=t,o(this,ik,nk).call(this)},i=this.thickness;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},lS=new WeakSet,hS=function(t){const e=t=>{this.color=t,o(this,PS,TS).call(this)},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},cS=new WeakSet,dS=function(t){const e=t=>{this.opacity=t,o(this,PS,TS).call(this)};t/=100;const i=this.opacity;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},uS=new WeakSet,pS=function(){const{parentRotation:t,parentDimensions:[e,i]}=this;switch(t){case 90:return[0,i,i,e];case 180:return[e,i,e,i];case 270:return[e,0,i,e];default:return[0,0,e,i]}},fS=new WeakSet,gS=function(){const{ctx:t,color:e,opacity:i,thickness:n,parentScale:s,scaleFactor:r}=this;var a;t.lineWidth=n*s/r,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${e}${a=i,Math.round(Math.min(255,Math.max(1,255*a))).toString(16).padStart(2,"0")}`},mS=new WeakSet,vS=function(t,e){const i=this._uiManager._signal;this.canvas.addEventListener("contextmenu",gd,{signal:i}),this.canvas.addEventListener("pointerleave",n(this,Xx),{signal:i}),this.canvas.addEventListener("pointermove",n(this,qx),{signal:i}),this.canvas.addEventListener("pointerup",n(this,Yx),{signal:i}),this.canvas.removeEventListener("pointerdown",n(this,Kx)),this.isEditing=!0,n(this,eS)||(r(this,eS,!0),o(this,WS,jS).call(this),this.thickness||(this.thickness=sk._defaultThickness),this.color||(this.color=sk._defaultColor||og._defaultLineColor),this.opacity??(this.opacity=sk._defaultOpacity)),this.currentPath.push([t,e]),r(this,tS,!1),o(this,fS,gS).call(this),r(this,rS,(()=>{o(this,SS,kS).call(this),n(this,rS)&&window.requestAnimationFrame(n(this,rS))})),window.requestAnimationFrame(n(this,rS))},yS=new WeakSet,bS=function(t,e){const[i,s]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&e===s)return;const a=this.currentPath;let l=n(this,Qx);if(a.push([t,e]),r(this,tS,!0),a.length<=2)return l.moveTo(...a[0]),void l.lineTo(t,e);3===a.length&&(r(this,Qx,l=new Path2D),l.moveTo(...a[0])),o(this,ES,CS).call(this,l,...a.at(-3),...a.at(-2),t,e)},wS=new WeakSet,AS=function(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);n(this,Qx).lineTo(...t)},_S=new WeakSet,xS=function(t,e){let i;if(r(this,rS,null),t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),o(this,yS,bS).call(this,t,e),o(this,wS,AS).call(this),1!==this.currentPath.length)i=o(this,MS,RS).call(this);else{const n=[t,e];i=[[n,n.slice(),n.slice(),n]]}const s=n(this,Qx),a=this.currentPath;this.currentPath=[],r(this,Qx,new Path2D);this.addCommands({cmd:()=>{this.allRawPaths.push(a),this.paths.push(i),this.bezierPath2D.push(s),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(o(this,DS,FS).call(this),o(this,NS,OS).call(this)),o(this,ik,nk).call(this))},mustExec:!0})},SS=new WeakSet,kS=function(){if(!n(this,tS))return;r(this,tS,!1);Math.ceil(this.thickness*this.parentScale);const t=this.currentPath.slice(-3),e=t.map((t=>t[0])),i=t.map((t=>t[1]));Math.min(...e),Math.max(...e),Math.min(...i),Math.max(...i);const{ctx:s}=this;s.save(),s.clearRect(0,0,this.canvas.width,this.canvas.height);for(const t of this.bezierPath2D)s.stroke(t);s.stroke(n(this,Qx)),s.restore()},ES=new WeakSet,CS=function(t,e,i,n,s,r,a){const o=(e+n)/2,l=(i+s)/2,h=(n+r)/2,c=(s+a)/2;t.bezierCurveTo(o+2*(n-o)/3,l+2*(s-l)/3,h+2*(n-h)/3,c+2*(s-c)/3,h,c)},MS=new WeakSet,RS=function(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let i,[n,s]=t[0];for(i=1;i<t.length-2;i++){const[r,a]=t[i],[o,l]=t[i+1],h=(r+o)/2,c=(a+l)/2,d=[n+2*(r-n)/3,s+2*(a-s)/3],u=[h+2*(r-h)/3,c+2*(a-c)/3];e.push([[n,s],d,u,[h,c]]),[n,s]=[h,c]}const[r,a]=t[i],[o,l]=t[i+1],h=[n+2*(r-n)/3,s+2*(a-s)/3],c=[o+2*(r-o)/3,l+2*(a-l)/3];return e.push([[n,s],h,c,[o,l]]),e},PS=new WeakSet,TS=function(){if(this.isEmpty())return void o(this,zS,HS).call(this);o(this,fS,gS).call(this);const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),o(this,zS,HS).call(this);for(const t of this.bezierPath2D)e.stroke(t)},LS=new WeakSet,IS=function(t){this.canvas.removeEventListener("pointerleave",n(this,Xx)),this.canvas.removeEventListener("pointermove",n(this,qx)),this.canvas.removeEventListener("pointerup",n(this,Yx)),this.canvas.addEventListener("pointerdown",n(this,Kx),{signal:this._uiManager._signal}),n(this,Jx)&&clearTimeout(n(this,Jx)),r(this,Jx,setTimeout((()=>{r(this,Jx,null),this.canvas.removeEventListener("contextmenu",gd)}),10)),o(this,_S,xS).call(this,t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()},DS=new WeakSet,FS=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},NS=new WeakSet,OS=function(){r(this,iS,new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}))),n(this,iS).observe(this.div),this._uiManager._signal.addEventListener("abort",(()=>{var t;null==(t=n(this,iS))||t.disconnect(),r(this,iS,null)}),{once:!0})},WS=new WeakSet,jS=function(){if(!n(this,eS))return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),o(this,zS,HS).call(this)},BS=new WeakSet,$S=function(t,e){const i=o(this,tk,ek).call(this),s=(t-i)/n(this,Gx),r=(e-i)/n(this,Vx);this.scaleFactor=Math.min(s,r)},zS=new WeakSet,HS=function(){const t=o(this,tk,ek).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)},US=new WeakSet,VS=function(t){const e=new Path2D;for(let i=0,n=t.length;i<n;i++){const[n,s,r,a]=t[i];0===i&&e.moveTo(...n),e.bezierCurveTo(s[0],s[1],r[0],r[1],a[0],a[1])}return e},GS=new WeakSet,qS=function(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]+=n,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]+n,t[e+1]=i+s}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=r-t[e],t[e+1]+=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=r-t[e+1],t[e+1]=a-i}break;default:throw new Error("Invalid rotation")}return t},XS=new WeakSet,YS=function(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]-=n,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]-s,t[e+1]=i-n}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=r-t[e],t[e+1]-=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=a-t[e+1],t[e+1]=r-i}break;default:throw new Error("Invalid rotation")}return t},KS=new WeakSet,JS=function(t,e,i,n){var s,r;const a=[],l=this.thickness/2,h=t*e+l,c=t*i+l;for(const e of this.paths){const i=[],l=[];for(let n=0,s=e.length;n<s;n++){const[r,a,o,d]=e[n];if(r[0]===d[0]&&r[1]===d[1]&&1===s){const e=t*r[0]+h,n=t*r[1]+c;i.push(e,n),l.push(e,n);break}const u=t*r[0]+h,p=t*r[1]+c,f=t*a[0]+h,g=t*a[1]+c,m=t*o[0]+h,v=t*o[1]+c,y=t*d[0]+h,b=t*d[1]+c;0===n&&(i.push(u,p),l.push(u,p)),i.push(f,g,m,v,y,b),l.push(f,g),n===s-1&&l.push(y,b)}a.push({bezier:o(s=sk,GS,qS).call(s,i,n,this.rotation),points:o(r=sk,GS,qS).call(r,l,n,this.rotation)})}return a},QS=new WeakSet,ZS=function(){let t=1/0,e=-1/0,i=1/0,n=-1/0;for(const s of this.paths)for(const[r,a,o,l]of s){const s=rc.bezierBoundingBox(...r,...a,...o,...l);t=Math.min(t,s[0]),i=Math.min(i,s[1]),e=Math.max(e,s[2]),n=Math.max(n,s[3])}return[t,i,e,n]},tk=new WeakSet,ek=function(){return n(this,Zx)?Math.ceil(this.thickness*this.parentScale):0},ik=new WeakSet,nk=function(t=!1){if(this.isEmpty())return;if(!n(this,Zx))return void o(this,PS,TS).call(this);const e=o(this,QS,ZS).call(this),i=o(this,tk,ek).call(this);r(this,Gx,Math.max(og.MIN_SIZE,e[2]-e[0])),r(this,Vx,Math.max(og.MIN_SIZE,e[3]-e[1]));const s=Math.ceil(i+n(this,Gx)*this.scaleFactor),a=Math.ceil(i+n(this,Vx)*this.scaleFactor),[l,h]=this.parentDimensions;this.width=s/l,this.height=a/h,this.setAspectRatio(s,a);const c=this.translationX,d=this.translationY;this.translationX=-e[0],this.translationY=-e[1],o(this,WS,jS).call(this),o(this,PS,TS).call(this),r(this,nS,s),r(this,sS,a),this.setDims(s,a);const u=t?i/this.scaleFactor/2:0;this.translate(c-this.translationX-u,d-this.translationY-u)},s(rk,US),s(rk,GS),s(rk,XS),e(rk,"_defaultColor",null),e(rk,"_defaultOpacity",1),e(rk,"_defaultThickness",1),e(rk,"_type","ink"),e(rk,"_editorType",Jl.INK);const Fk=class extends og{constructor(t){super({...t,name:"stampEditor"}),s(this,vk),s(this,bk),s(this,Ak),s(this,xk),s(this,kk),s(this,Ck),s(this,Rk),s(this,Tk),s(this,Ik),s(this,ak,null),s(this,ok,null),s(this,lk,null),s(this,hk,null),s(this,ck,null),s(this,dk,""),s(this,uk,null),s(this,pk,null),s(this,fk,null),s(this,gk,!1),s(this,mk,!1),r(this,hk,t.bitmapUrl),r(this,ck,t.bitmapFile)}static initialize(t,e){og.initialize(t,e)}static get supportedTypes(){return $h(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((t=>`image/${t}`)))}static get supportedTypesStr(){return $h(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(Jl.STAMP,{bitmapFile:t.getAsFile()})}remove(){var t,e;n(this,ok)&&(r(this,ak,null),this._uiManager.imageManager.deleteId(n(this,ok)),null==(t=n(this,uk))||t.remove(),r(this,uk,null),null==(e=n(this,pk))||e.disconnect(),r(this,pk,null),n(this,fk)&&(clearTimeout(n(this,fk)),r(this,fk,null))),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(n(this,ok)&&null===n(this,uk)&&o(this,Ak,_k).call(this),this.isAttachedToDOM||this.parent.add(this))):n(this,ok)&&o(this,Ak,_k).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(n(this,lk)||n(this,ak)||n(this,hk)||n(this,ck)||n(this,ok))}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),n(this,ak)?o(this,xk,Sk).call(this):o(this,Ak,_k).call(this),this.width){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n)}return this.div}getImageForAltText(){return n(this,uk)}static deserialize(t,e,i){if(t instanceof Uw)return null;const n=super.deserialize(t,e,i),{rect:s,bitmapUrl:a,bitmapId:o,isSvg:l,accessibilityData:h}=t;o&&i.imageManager.isValidId(o)?r(n,ok,o):r(n,hk,a),r(n,gk,l);const[c,d]=n.pageDimensions;return n.width=(s[2]-s[0])/c,n.height=(s[3]-s[1])/d,h&&(n.altTextData=h),n}serialize(t=!1,e=null){if(this.isEmpty())return null;const i={annotationType:Jl.STAMP,bitmapId:n(this,ok),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:n(this,gk),structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=o(this,Tk,Lk).call(this,!0),i.accessibilityData=this.altTextData,i;const{decorative:s,altText:r}=this.altTextData;if(!s&&r&&(i.accessibilityData={type:"Figure",alt:r}),null===e)return i;e.stamps||(e.stamps=new Map);const a=n(this,gk)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(n(this,ok))){if(n(this,gk)){const t=e.stamps.get(n(this,ok));a>t.area&&(t.area=a,t.serialized.bitmap.close(),t.serialized.bitmap=o(this,Tk,Lk).call(this,!1))}}else e.stamps.set(n(this,ok),{area:a,serialized:i}),i.bitmap=o(this,Tk,Lk).call(this,!1);return i}};let Nk=Fk;var Ok,Wk,jk,Bk,$k,zk,Hk,Uk,Vk,Gk,qk,Xk,Yk,Kk,Jk,Qk,Zk,tE,eE,iE,nE,sE,rE,aE;ak=new WeakMap,ok=new WeakMap,lk=new WeakMap,hk=new WeakMap,ck=new WeakMap,dk=new WeakMap,uk=new WeakMap,pk=new WeakMap,fk=new WeakMap,gk=new WeakMap,mk=new WeakMap,vk=new WeakSet,yk=function(t,e=!1){t?(r(this,ak,t.bitmap),e||(r(this,ok,t.id),r(this,gk,t.isSvg)),t.file&&r(this,dk,t.file.name),o(this,xk,Sk).call(this)):this.remove()},bk=new WeakSet,wk=function(){r(this,lk,null),this._uiManager.enableWaiting(!1),n(this,uk)&&this.div.focus()},Ak=new WeakSet,_k=function(){if(n(this,ok))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(n(this,ok)).then((t=>o(this,vk,yk).call(this,t,!0))).finally((()=>o(this,bk,wk).call(this)));if(n(this,hk)){const t=n(this,hk);return r(this,hk,null),this._uiManager.enableWaiting(!0),void r(this,lk,this._uiManager.imageManager.getFromUrl(t).then((t=>o(this,vk,yk).call(this,t))).finally((()=>o(this,bk,wk).call(this))))}if(n(this,ck)){const t=n(this,ck);return r(this,ck,null),this._uiManager.enableWaiting(!0),void r(this,lk,this._uiManager.imageManager.getFromFile(t).then((t=>o(this,vk,yk).call(this,t))).finally((()=>o(this,bk,wk).call(this))))}const t=document.createElement("input");t.type="file",t.accept=Fk.supportedTypesStr;const e=this._uiManager._signal;r(this,lk,new Promise((i=>{t.addEventListener("change",(async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);o(this,vk,yk).call(this,e)}else this.remove();i()}),{signal:e}),t.addEventListener("cancel",(()=>{this.remove(),i()}),{signal:e})})).finally((()=>o(this,bk,wk).call(this)))),t.click()},xk=new WeakSet,Sk=function(){const{div:t}=this;let{width:e,height:i}=n(this,ak);const[s,a]=this.pageDimensions,l=.75;if(this.width)e=this.width*s,i=this.height*a;else if(e>l*s||i>l*a){const t=Math.min(l*s/e,l*a/i);e*=t,i*=t}const[h,c]=this.parentDimensions;this.setDims(e*h/s,i*c/a),this._uiManager.enableWaiting(!1);const d=r(this,uk,document.createElement("canvas"));t.append(d),t.hidden=!1,o(this,Rk,Pk).call(this,e,i),o(this,Ik,Dk).call(this),n(this,mk)||(this.parent.addUndoableEditor(this),r(this,mk,!0)),this._reportTelemetry({action:"inserted_image"}),n(this,dk)&&d.setAttribute("aria-label",n(this,dk))},kk=new WeakSet,Ek=function(t,e){var i;const[s,a]=this.parentDimensions;this.width=t/s,this.height=e/a,this.setDims(t,e),null!=(i=this._initialOptions)&&i.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==n(this,fk)&&clearTimeout(n(this,fk)),r(this,fk,setTimeout((()=>{r(this,fk,null),o(this,Rk,Pk).call(this,t,e)}),200))},Ck=new WeakSet,Mk=function(t,e){const{width:i,height:s}=n(this,ak);let r=i,a=s,o=n(this,ak);for(;r>2*t||a>2*e;){const i=r,n=a;r>2*t&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2)),a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));const s=new OffscreenCanvas(r,a);s.getContext("2d").drawImage(o,0,0,i,n,0,0,r,a),o=s.transferToImageBitmap()}return o},Rk=new WeakSet,Pk=function(t,e){t=Math.ceil(t),e=Math.ceil(e);const i=n(this,uk);if(!i||i.width===t&&i.height===e)return;i.width=t,i.height=e;const s=n(this,gk)?n(this,ak):o(this,Ck,Mk).call(this,t,e);if(this._uiManager.hasMLManager&&!this.hasAltText()){const i=new OffscreenCanvas(t,e).getContext("2d");i.drawImage(s,0,0,s.width,s.height,0,0,t,e),this._uiManager.mlGuess({service:"image-to-text",request:{data:i.getImageData(0,0,t,e).data,width:t,height:e,channels:4}}).then((t=>{const e=(null==t?void 0:t.output)||"";this.parent&&e&&!this.hasAltText()&&(this.altTextData={altText:e,decorative:!1})}))}const r=i.getContext("2d");r.filter=this._uiManager.hcmFilter,r.drawImage(s,0,0,s.width,s.height,0,0,t,e)},Tk=new WeakSet,Lk=function(t){if(t){if(n(this,gk)){const t=this._uiManager.imageManager.getSvgUrl(n(this,ok));if(t)return t}const t=document.createElement("canvas");return({width:t.width,height:t.height}=n(this,ak)),t.getContext("2d").drawImage(n(this,ak),0,0),t.toDataURL()}if(n(this,gk)){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*Mc.PDF_TO_CSS_UNITS),s=Math.round(this.height*e*Mc.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(i,s);return r.getContext("2d").drawImage(n(this,ak),0,0,n(this,ak).width,n(this,ak).height,0,0,i,s),r.transferToImageBitmap()}return structuredClone(n(this,ak))},Ik=new WeakSet,Dk=function(){this._uiManager._signal&&(r(this,pk,new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&o(this,kk,Ek).call(this,e.width,e.height)}))),n(this,pk).observe(this.div),this._uiManager._signal.addEventListener("abort",(()=>{var t;null==(t=n(this,pk))||t.disconnect(),r(this,pk,null)}),{once:!0}))},e(Nk,"_type","stamp"),e(Nk,"_editorType",Jl.STAMP);const oE=class{constructor({uiManager:t,pageIndex:e,div:i,accessibilityManager:a,annotationLayer:o,drawLayer:l,textLayer:h,viewport:c,l10n:d}){s(this,Jk),s(this,Zk),s(this,eE),s(this,nE),s(this,rE),s(this,Ok,void 0),s(this,Wk,!1),s(this,jk,null),s(this,Bk,null),s(this,$k,null),s(this,zk,null),s(this,Hk,null),s(this,Uk,new Map),s(this,Vk,!1),s(this,Gk,!1),s(this,qk,!1),s(this,Xk,null),s(this,Yk,void 0);const u=[...n(oE,Kk).values()];if(!oE._initialized){oE._initialized=!0;for(const e of u)e.initialize(d,t)}t.registerEditorTypes(u),r(this,Yk,t),this.pageIndex=e,this.div=i,r(this,Ok,a),r(this,jk,o),this.viewport=c,r(this,Xk,h),this.drawLayer=l,n(this,Yk).addLayer(this)}get isEmpty(){return 0===n(this,Uk).size}get isInvisible(){return this.isEmpty&&n(this,Yk).getMode()===Jl.NONE}updateToolbar(t){n(this,Yk).updateToolbar(t)}updateMode(t=n(this,Yk).getMode()){switch(o(this,rE,aE).call(this),t){case Jl.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case Jl.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case Jl.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;for(const i of n(oE,Kk).values())e.toggle(`${i._type}Editing`,t===i._editorType);this.div.hidden=!1}hasTextLayer(t){var e;return t===(null==(e=n(this,Xk))?void 0:e.div)}addInkEditorIfNeeded(t){if(n(this,Yk).getMode()===Jl.INK){if(!t)for(const t of n(this,Uk).values())if(t.isEmpty())return void t.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(t){n(this,Yk).setEditingState(t)}addCommands(t){n(this,Yk).addCommands(t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){var e;null==(e=n(this,jk))||e.div.classList.toggle("disabled",!t)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const e of n(this,Uk).values())e.enableEditing(),e.show(!0),e.annotationElementId&&(n(this,Yk).removeChangedExistingAnnotation(e),t.add(e.annotationElementId));if(!n(this,jk))return;const e=n(this,jk).getEditableAnnotations();for(const i of e){if(i.hide(),n(this,Yk).isDeletedAnnotationElement(i.data.id)||t.has(i.data.id))continue;const e=this.deserialize(i);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){var t;r(this,qk,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,i=new Map;for(const s of n(this,Uk).values())if(s.disableEditing(),s.annotationElementId){if(null!==s.serialize()){e.set(s.annotationElementId,s);continue}i.set(s.annotationElementId,s),null==(t=this.getEditableAnnotation(s.annotationElementId))||t.show(),s.remove()}if(n(this,jk)){const t=n(this,jk).getEditableAnnotations();for(const s of t){const{id:t}=s.data;if(n(this,Yk).isDeletedAnnotationElement(t))continue;let r=i.get(t);r?(r.resetAnnotationElement(s),r.show(!1),s.show()):(r=e.get(t),r&&(n(this,Yk).addChangedExistingAnnotation(r),r.renderAnnotationElement(s),r.show(!1)),s.show())}}o(this,rE,aE).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:s}=this.div;for(const t of n(oE,Kk).values())s.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),r(this,qk,!1)}getEditableAnnotation(t){var e;return(null==(e=n(this,jk))?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){n(this,Yk).getActive()!==t&&n(this,Yk).setActiveEditor(t)}enableTextSelection(){var t;this.div.tabIndex=-1,null!=(t=n(this,Xk))&&t.div&&!n(this,zk)&&(r(this,zk,o(this,Jk,Qk).bind(this)),n(this,Xk).div.addEventListener("pointerdown",n(this,zk),{signal:n(this,Yk)._signal}),n(this,Xk).div.classList.add("highlighting"))}disableTextSelection(){var t;this.div.tabIndex=0,null!=(t=n(this,Xk))&&t.div&&n(this,zk)&&(n(this,Xk).div.removeEventListener("pointerdown",n(this,zk)),r(this,zk,null),n(this,Xk).div.classList.remove("highlighting"))}enableClick(){if(n(this,$k))return;const t=n(this,Yk)._signal;r(this,$k,this.pointerdown.bind(this)),r(this,Bk,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",n(this,$k),{signal:t}),this.div.addEventListener("pointerup",n(this,Bk),{signal:t})}disableClick(){n(this,$k)&&(this.div.removeEventListener("pointerdown",n(this,$k)),this.div.removeEventListener("pointerup",n(this,Bk)),r(this,$k,null),r(this,Bk,null))}attach(t){n(this,Uk).set(t.id,t);const{annotationElementId:e}=t;e&&n(this,Yk).isDeletedAnnotationElement(e)&&n(this,Yk).removeDeletedAnnotationElement(t)}detach(t){var e;n(this,Uk).delete(t.id),null==(e=n(this,Ok))||e.removePointerInTextLayer(t.contentDiv),!n(this,qk)&&t.annotationElementId&&n(this,Yk).addDeletedAnnotationElement(t)}remove(t){this.detach(t),n(this,Yk).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,n(this,Gk)||this.addInkEditorIfNeeded(!1)}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(n(this,Yk).addDeletedAnnotationElement(t.annotationElementId),og.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),null==(e=t.parent)||e.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),n(this,Yk).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),n(this,Yk).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var e;if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!n(this,Hk)&&(t._focusEventsAllowed=!1,r(this,Hk,setTimeout((()=>{r(this,Hk,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:n(this,Yk)._signal}),i.focus())}),0))),t._structTreeParentId=null==(e=n(this,Ok))?void 0:e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return n(this,Yk).getId()}get _signal(){return n(this,Yk)._signal}canCreateNewEmptyEditor(){var t;return null==(t=n(this,Zk,tE))?void 0:t.canCreateNewEmptyEditor()}pasteEditor(t,e){n(this,Yk).updateToolbar(t),n(this,Yk).updateMode(t);const{offsetX:i,offsetY:s}=o(this,nE,sE).call(this),r=this.getNextId(),a=o(this,eE,iE).call(this,{parent:this,id:r,x:i,y:s,uiManager:n(this,Yk),isCentered:!0,...e});a&&this.add(a)}deserialize(t){var e;return(null==(e=n(oE,Kk).get(t.annotationType??t.annotationEditorType))?void 0:e.deserialize(t,this,n(this,Yk)))||null}createAndAddNewEditor(t,e,i={}){const s=this.getNextId(),r=o(this,eE,iE).call(this,{parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:n(this,Yk),isCentered:e,...i});return r&&this.add(r),r}addNewEditor(){this.createAndAddNewEditor(o(this,nE,sE).call(this),!0)}setSelected(t){n(this,Yk).setSelected(t)}toggleSelected(t){n(this,Yk).toggleSelected(t)}isSelected(t){return n(this,Yk).isSelected(t)}unselect(t){n(this,Yk).unselect(t)}pointerup(t){const{isMac:e}=Zh.platform;if(!(0!==t.button||t.ctrlKey&&e)&&t.target===this.div&&n(this,Vk)){if(r(this,Vk,!1),!n(this,Wk))return void r(this,Wk,!0);if(n(this,Yk).getMode()===Jl.STAMP)return void n(this,Yk).unselectAll();this.createAndAddNewEditor(t,!1)}}pointerdown(t){if(n(this,Yk).getMode()===Jl.HIGHLIGHT&&this.enableTextSelection(),n(this,Vk))return void r(this,Vk,!1);const{isMac:e}=Zh.platform;if(0!==t.button||t.ctrlKey&&e||t.target!==this.div)return;r(this,Vk,!0);const i=n(this,Yk).getActive();r(this,Wk,!i||i.isEmpty())}findNewParent(t,e,i){const s=n(this,Yk).findParent(e,i);return null!==s&&s!==this&&(s.changeParent(t),!0)}destroy(){var t,e;(null==(t=n(this,Yk).getActive())?void 0:t.parent)===this&&(n(this,Yk).commitOrRemove(),n(this,Yk).setActiveEditor(null)),n(this,Hk)&&(clearTimeout(n(this,Hk)),r(this,Hk,null));for(const t of n(this,Uk).values())null==(e=n(this,Ok))||e.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,n(this,Uk).clear(),n(this,Yk).removeLayer(this)}render({viewport:t}){this.viewport=t,xd(this.div,t);for(const t of n(this,Yk).getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:t}){n(this,Yk).commitOrRemove(),o(this,rE,aE).call(this);const e=this.viewport.rotation,i=t.rotation;if(this.viewport=t,xd(this.div,{rotation:i}),e!==i)for(const t of n(this,Uk).values())t.rotate(i);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return n(this,Yk).viewParameters.realScale}};let lE=oE;var hE,cE,dE,uE,pE,fE,gE,mE,vE,yE;Ok=new WeakMap,Wk=new WeakMap,jk=new WeakMap,Bk=new WeakMap,$k=new WeakMap,zk=new WeakMap,Hk=new WeakMap,Uk=new WeakMap,Vk=new WeakMap,Gk=new WeakMap,qk=new WeakMap,Xk=new WeakMap,Yk=new WeakMap,Kk=new WeakMap,Jk=new WeakSet,Qk=function(t){if(n(this,Yk).unselectAll(),t.target===n(this,Xk).div){const{isMac:e}=Zh.platform;if(0!==t.button||t.ctrlKey&&e)return;n(this,Yk).showAllEditors("highlight",!0,!0),n(this,Xk).div.classList.add("free"),Ux.startHighlighting(this,"ltr"===n(this,Yk).direction,t),n(this,Xk).div.addEventListener("pointerup",(()=>{n(this,Xk).div.classList.remove("free")}),{once:!0,signal:n(this,Yk)._signal}),t.preventDefault()}},Zk=new WeakSet,tE=function(){return n(oE,Kk).get(n(this,Yk).getMode())},eE=new WeakSet,iE=function(t){const e=n(this,Zk,tE);return e?new e.prototype.constructor(t):null},nE=new WeakSet,sE=function(){const{x:t,y:e,width:i,height:n}=this.div.getBoundingClientRect(),s=Math.max(0,t),r=Math.max(0,e),a=(s+Math.min(window.innerWidth,t+i))/2-t,o=(r+Math.min(window.innerHeight,e+n))/2-e,[l,h]=this.viewport.rotation%180==0?[a,o]:[o,a];return{offsetX:l,offsetY:h}},rE=new WeakSet,aE=function(){r(this,Gk,!0);for(const t of n(this,Uk).values())t.isEmpty()&&t.remove();r(this,Gk,!1)},e(lE,"_initialized",!1),s(lE,Kk,new Map([xA,rk,Nk,Ux].map((t=>[t._editorType,t]))));const bE=class{constructor({pageIndex:t}){s(this,gE),s(this,vE),s(this,hE,null),s(this,cE,0),s(this,dE,new Map),s(this,uE,new Map),this.pageIndex=t}setParent(t){if(n(this,hE)){if(n(this,hE)!==t){if(n(this,dE).size>0)for(const e of n(this,dE).values())e.remove(),t.append(e);r(this,hE,t)}}else r(this,hE,t)}static get _svgFactory(){return $h(this,"_svgFactory",new ad)}highlight(t,e,i,s=!1){const r=a(this,cE)._++,l=o(this,gE,mE).call(this,t.box);l.classList.add("highlight"),t.free&&l.classList.add("free");const h=bE._svgFactory.createElement("defs");l.append(h);const c=bE._svgFactory.createElement("path");h.append(c);const d=`path_p${this.pageIndex}_${r}`;c.setAttribute("id",d),c.setAttribute("d",t.toSVGPath()),s&&n(this,uE).set(r,c);const u=o(this,vE,yE).call(this,h,d),p=bE._svgFactory.createElement("use");return l.append(p),l.setAttribute("fill",e),l.setAttribute("fill-opacity",i),p.setAttribute("href",`#${d}`),n(this,dE).set(r,l),{id:r,clipPathId:`url(#${u})`}}highlightOutline(t){const e=a(this,cE)._++,i=o(this,gE,mE).call(this,t.box);i.classList.add("highlightOutline");const s=bE._svgFactory.createElement("defs");i.append(s);const r=bE._svgFactory.createElement("path");s.append(r);const l=`path_p${this.pageIndex}_${e}`;let h;if(r.setAttribute("id",l),r.setAttribute("d",t.toSVGPath()),r.setAttribute("vector-effect","non-scaling-stroke"),t.free){i.classList.add("free");const t=bE._svgFactory.createElement("mask");s.append(t),h=`mask_p${this.pageIndex}_${e}`,t.setAttribute("id",h),t.setAttribute("maskUnits","objectBoundingBox");const n=bE._svgFactory.createElement("rect");t.append(n),n.setAttribute("width","1"),n.setAttribute("height","1"),n.setAttribute("fill","white");const r=bE._svgFactory.createElement("use");t.append(r),r.setAttribute("href",`#${l}`),r.setAttribute("stroke","none"),r.setAttribute("fill","black"),r.setAttribute("fill-rule","nonzero"),r.classList.add("mask")}const c=bE._svgFactory.createElement("use");i.append(c),c.setAttribute("href",`#${l}`),h&&c.setAttribute("mask",`url(#${h})`);const d=c.cloneNode();return i.append(d),c.classList.add("mainOutline"),d.classList.add("secondaryOutline"),n(this,dE).set(e,i),e}finalizeLine(t,e){const i=n(this,uE).get(t);n(this,uE).delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}updateLine(t,e){n(this,dE).get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}removeFreeHighlight(t){this.remove(t),n(this,uE).delete(t)}updatePath(t,e){n(this,uE).get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){var i;o(i=bE,pE,fE).call(i,n(this,dE).get(t),e)}show(t,e){n(this,dE).get(t).classList.toggle("hidden",!e)}rotate(t,e){n(this,dE).get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){n(this,dE).get(t).setAttribute("fill",e)}changeOpacity(t,e){n(this,dE).get(t).setAttribute("fill-opacity",e)}addClass(t,e){n(this,dE).get(t).classList.add(e)}removeClass(t,e){n(this,dE).get(t).classList.remove(e)}remove(t){null!==n(this,hE)&&(n(this,dE).get(t).remove(),n(this,dE).delete(t))}destroy(){r(this,hE,null);for(const t of n(this,dE).values())t.remove();n(this,dE).clear()}};let wE=bE;hE=new WeakMap,cE=new WeakMap,dE=new WeakMap,uE=new WeakMap,pE=new WeakSet,fE=function(t,{x:e=0,y:i=0,width:n=1,height:s=1}={}){const{style:r}=t;r.top=100*i+"%",r.left=100*e+"%",r.width=100*n+"%",r.height=100*s+"%"},gE=new WeakSet,mE=function(t){var e;const i=bE._svgFactory.create(1,1,!0);return n(this,hE).append(i),i.setAttribute("aria-hidden",!0),o(e=bE,pE,fE).call(e,i,t),i},vE=new WeakSet,yE=function(t,e){const i=bE._svgFactory.createElement("clipPath");t.append(i);const n=`clip_${e}`;i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=bE._svgFactory.createElement("use");return i.append(s),s.setAttribute("href",`#${e}`),s.classList.add("clip"),n},s(wE,pE);var AE=Wl.AbortException,_E=Wl.AnnotationEditorLayer,xE=Wl.AnnotationEditorParamsType,SE=Wl.AnnotationEditorType,kE=Wl.AnnotationEditorUIManager,EE=Wl.AnnotationLayer,CE=Wl.AnnotationMode,ME=Wl.CMapCompressionType,RE=Wl.ColorPicker,PE=Wl.DOMSVGFactory,TE=Wl.DrawLayer,LE=Wl.FeatureTest,IE=Wl.GlobalWorkerOptions,DE=Wl.ImageKind,FE=Wl.InvalidPDFException,NE=Wl.MissingPDFException,OE=Wl.OPS,WE=Wl.Outliner,jE=Wl.PDFDataRangeTransport,BE=Wl.PDFDateString,$E=Wl.PDFWorker,zE=Wl.PasswordResponses,HE=Wl.PermissionFlag,UE=Wl.PixelsPerInch,VE=Wl.RenderingCancelledException,GE=Wl.TextLayer,qE=Wl.UnexpectedResponseException,XE=Wl.Util,YE=Wl.VerbosityLevel,KE=Wl.XfaLayer,JE=Wl.build,QE=Wl.createValidAbsoluteUrl,ZE=Wl.fetchData,tC=Wl.getDocument,eC=Wl.getFilenameFromUrl,iC=Wl.getPdfFilenameFromUrl,nC=Wl.getXfaPageViewport,sC=Wl.isDataScheme,rC=Wl.isPdfFile,aC=Wl.noContextMenu,oC=Wl.normalizeUnicode,lC=Wl.renderTextLayer,hC=Wl.setLayerDimensions,cC=Wl.shadow,dC=Wl.updateTextLayer,uC=Wl.version;const pC=Object.freeze(Object.defineProperty({__proto__:null,AbortException:AE,AnnotationEditorLayer:_E,AnnotationEditorParamsType:xE,AnnotationEditorType:SE,AnnotationEditorUIManager:kE,AnnotationLayer:EE,AnnotationMode:CE,CMapCompressionType:ME,ColorPicker:RE,DOMSVGFactory:PE,DrawLayer:TE,FeatureTest:LE,GlobalWorkerOptions:IE,ImageKind:DE,InvalidPDFException:FE,MissingPDFException:NE,OPS:OE,Outliner:WE,PDFDataRangeTransport:jE,PDFDateString:BE,PDFWorker:$E,PasswordResponses:zE,PermissionFlag:HE,PixelsPerInch:UE,RenderingCancelledException:VE,TextLayer:GE,UnexpectedResponseException:qE,Util:XE,VerbosityLevel:YE,XfaLayer:KE,build:JE,createValidAbsoluteUrl:QE,fetchData:ZE,getDocument:tC,getFilenameFromUrl:eC,getPdfFilenameFromUrl:iC,getXfaPageViewport:nC,isDataScheme:sC,isPdfFile:rC,noContextMenu:aC,normalizeUnicode:oC,renderTextLayer:lC,setLayerDimensions:hC,shadow:cC,updateTextLayer:dC,version:uC},Symbol.toStringTag,{value:"Module"}));var fC=globalThis&&globalThis.__spreadArray||function(t,e,i){if(i||2===arguments.length)for(var n,s=0,r=e.length;s<r;s++)(n||!(s in e))&&(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))},gC=fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC([],["onCopy","onCut","onPaste"],!0),["onCompositionEnd","onCompositionStart","onCompositionUpdate"],!0),["onFocus","onBlur"],!0),["onInput","onInvalid","onReset","onSubmit"],!0),["onLoad","onError"],!0),["onKeyDown","onKeyPress","onKeyUp"],!0),["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],!0),["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],!0),["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],!0),["onSelect"],!0),["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],!0),["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],!0),["onScroll"],!0),["onWheel"],!0),["onAnimationStart","onAnimationEnd","onAnimationIteration"],!0),["onTransitionEnd"],!0),["onChange"],!0),["onToggle"],!0);function mC(t,e){var i={};return gC.forEach((function(n){var s=t[n];s&&(i[n]=e?function(t){return s(t,e(n))}:s)})),i}function vC(t){var e=!1;return{promise:new Promise((function(i,n){t.then((function(t){return!e&&i(t)})).catch((function(t){return!e&&n(t)}))})),cancel:function(){e=!0}}}function yC(t){var e,i,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(i=yC(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}function bC(){for(var t,e,i=0,n="",s=arguments.length;i<s;i++)(t=arguments[i])&&(e=yC(t))&&(n&&(n+=" "),n+=e);return n}var wC="production"===process.env.NODE_ENV,AC="Invariant failed";function _C(t,e){if(!t){if(wC)throw new Error(AC);var i="function"==typeof e?e():e,n=i?"".concat(AC,": ").concat(i):AC;throw new Error(n)}}var xC=function(){};if("production"!==process.env.NODE_ENV){var SC=function(t,e){var i=arguments.length;e=new Array(i>1?i-1:0);for(var n=1;n<i;n++)e[n-1]=arguments[n];var s=0,r="Warning: "+t.replace(/%s/g,(function(){return e[s++]}));typeof console<"u"&&console.error(r);try{throw new Error(r)}catch{}};xC=function(t,e,i){var n=arguments.length;i=new Array(n>2?n-2:0);for(var s=2;s<n;s++)i[s-2]=arguments[s];if(void 0===e)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");t||SC.apply(null,[e].concat(i))}}const kC=S(xC);var EC=Object.prototype.hasOwnProperty;function CC(t,e,i){for(i of t.keys())if(MC(i,e))return i}function MC(t,e){var i,n,s;if(t===e)return!0;if(t&&e&&(i=t.constructor)===e.constructor){if(i===Date)return t.getTime()===e.getTime();if(i===RegExp)return t.toString()===e.toString();if(i===Array){if((n=t.length)===e.length)for(;n--&&MC(t[n],e[n]););return-1===n}if(i===Set){if(t.size!==e.size)return!1;for(n of t)if((s=n)&&"object"==typeof s&&!(s=CC(e,s))||!e.has(s))return!1;return!0}if(i===Map){if(t.size!==e.size)return!1;for(n of t)if((s=n[0])&&"object"==typeof s&&!(s=CC(e,s))||!MC(n[1],e.get(s)))return!1;return!0}if(i===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(i===DataView){if((n=t.byteLength)===e.byteLength)for(;n--&&t.getInt8(n)===e.getInt8(n););return-1===n}if(ArrayBuffer.isView(t)){if((n=t.byteLength)===e.byteLength)for(;n--&&t[n]===e[n];);return-1===n}if(!i||"object"==typeof t){for(i in n=0,t)if(EC.call(t,i)&&++n&&!EC.call(e,i)||!(i in e)||!MC(t[i],e[i]))return!1;return Object.keys(e).length===n}}return t!=t&&e!=e}const RC=f(null);function PC({children:t,type:e}){return P.jsx("div",{className:`react-pdf__message react-pdf__message--${e}`,children:t})}class TC{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(t){this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setExternalLinkRel(t){this.externalLinkRel=t}setExternalLinkTarget(t){this.externalLinkTarget=t}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return _C(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(t){_C(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise((e=>{_C(this.pdfDocument,"PDF document not loaded."),_C(t,"Destination is not specified."),"string"==typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)})).then((t=>{_C(Array.isArray(t),`"${t}" is not a valid destination array.`);const e=t[0];new Promise((t=>{_C(this.pdfDocument,"PDF document not loaded."),e instanceof Object?this.pdfDocument.getPageIndex(e).then((e=>{t(e)})).catch((()=>{_C(!1,`"${e}" is not a valid page reference.`)})):"number"==typeof e?t(e):_C(!1,`"${e}" is not a valid destination reference.`)})).then((e=>{const i=e+1;_C(this.pdfViewer,"PDF viewer is not initialized."),_C(i>=1&&i<=this.pagesCount,`"${i}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:i})}))}))}navigateTo(t){this.goToDestination(t)}goToPage(t){const e=t-1;_C(this.pdfViewer,"PDF viewer is not initialized."),_C(t>=1&&t<=this.pagesCount,`"${t}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}addLinkAttributes(t,e,i){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=i?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const LC={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},IC=typeof document<"u",DC=IC&&"file:"===window.location.protocol;function FC(t){return function(t){return typeof t<"u"}(t)&&null!==t}function NC(t){return function(t){return"string"==typeof t}(t)&&/^data:/.test(t)}function OC(t){_C(NC(t),"Invalid data URI.");const[e="",i=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(i):unescape(i)}function WC(){return IC&&window.devicePixelRatio||1}const jC="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function BC(){kC(!DC,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${jC}`)}function $C(t){null!=t&&t.cancel&&t.cancel()}function zC(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}function HC(t){return new Promise(((e,i)=>{const n=new FileReader;n.onload=()=>{if(!n.result)return i(new Error("Error while reading a file."));e(n.result)},n.onerror=t=>{if(!t.target)return i(new Error("Error while reading a file."));const{error:e}=t.target;if(!e)return i(new Error("Error while reading a file."));switch(e.code){case e.NOT_FOUND_ERR:return i(new Error("Error while reading a file: File not found."));case e.SECURITY_ERR:return i(new Error("Error while reading a file: Security error."));case e.ABORT_ERR:return i(new Error("Error while reading a file: Aborted."));default:return i(new Error("Error while reading a file."))}},n.readAsArrayBuffer(t)}))}function UC(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function VC(){return m(UC,{value:void 0,error:void 0})}var GC=globalThis&&globalThis.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function o(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){t.done?s(t.value):function(t){return t instanceof i?t:new i((function(e){e(t)}))}(t.value).then(a,o)}l((n=n.apply(t,e||[])).next())}))},qC=globalThis&&globalThis.__rest||function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const{PDFDataRangeTransport:XC}=pC,YC=(t,e)=>{switch(e){case LC.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case LC.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function KC(t){return"object"==typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const JC=g((function(t,e){var{children:i,className:n,error:s="Failed to load PDF file.",externalLinkRel:r,externalLinkTarget:a,file:o,inputRef:l,imageResourcesPath:d,loading:u="Loading PDF…",noData:p="No PDF file specified.",onItemClick:f,onLoadError:g,onLoadProgress:m,onLoadSuccess:w,onPassword:A=YC,onSourceError:_,onSourceSuccess:x,options:S,renderMode:k,rotate:E}=t,C=qC(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[M,R]=VC(),{value:T,error:L}=M,[I,D]=VC(),{value:F,error:N}=I,O=c(new TC),W=c([]),j=c(void 0),B=c(void 0);o&&o!==j.current&&KC(o)&&(kC(!MC(o,j.current),'File prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.'),j.current=o),S&&S!==B.current&&(kC(!MC(S,B.current),'Options prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.'),B.current=S);const $=c({scrollPageIntoView:t=>{const{dest:e,pageNumber:i,pageIndex:n=i-1}=t;if(f)return void f({dest:e,pageIndex:n,pageNumber:i});const s=W.current[n];s?s.scrollIntoView():kC(!1,`An internal link leading to page ${i} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});y(e,(()=>({linkService:O,pages:W,viewer:$})),[]),v((function(){R({type:"RESET"})}),[o,R]);const z=b((()=>GC(this,void 0,void 0,(function*(){if(!o)return null;if("string"==typeof o)return NC(o)?{data:OC(o)}:(BC(),{url:o});if(o instanceof XC)return{range:o};if(o instanceof ArrayBuffer)return{data:o};if(IC&&function(t){return _C(IC,"isBlob can only be used in a browser environment"),t instanceof Blob}(o))return{data:yield HC(o)};if(_C("object"==typeof o,"Invalid parameter in file, need either Uint8Array, string or a parameter object"),_C(KC(o),"Invalid parameter object: need either .data, .range or .url"),"url"in o&&"string"==typeof o.url){if(NC(o.url)){const{url:t}=o,e=qC(o,["url"]),i=OC(t);return Object.assign({data:i},e)}BC()}return o}))),[o]);v((()=>{const t=vC(z());return t.promise.then((t=>{R({type:"RESOLVE",value:t})})).catch((t=>{R({type:"REJECT",error:t})})),()=>{$C(t)}}),[z,R]),v((()=>{if(!(typeof T>"u")){if(!1===T)return void(L&&(kC(!1,L.toString()),_&&_(L)));x&&x()}}),[T]),v((function(){D({type:"RESET"})}),[D,T]),v((function(){if(!T)return;const t=Object.assign(Object.assign({},T),S),e=tC(t);m&&(e.onProgress=m),A&&(e.onPassword=A);const i=e;return i.promise.then((t=>{D({type:"RESOLVE",value:t})})).catch((t=>{i.destroyed||D({type:"REJECT",error:t})})),()=>{i.destroy()}}),[S,D,T]),v((()=>{if(!(typeof F>"u")){if(!1===F)return void(N&&(kC(!1,N.toString()),g&&g(N)));F&&(w&&w(F),W.current=new Array(F.numPages),O.current.setDocument(F))}}),[F]),v((function(){O.current.setViewer($.current),O.current.setExternalLinkRel(r),O.current.setExternalLinkTarget(a)}),[r,a]);const H=b(((t,e)=>{W.current[t]=e}),[]),U=b((t=>{delete W.current[t]}),[]),V=h((()=>({imageResourcesPath:d,linkService:O.current,onItemClick:f,pdf:F,registerPage:H,renderMode:k,rotate:E,unregisterPage:U})),[d,f,F,H,k,E,U]),G=h((()=>mC(C,(()=>F))),[C,F]);return P.jsx("div",Object.assign({className:bC("react-pdf__Document",n),ref:l,style:{"--scale-factor":"1"}},G,{children:o?null==F?P.jsx(PC,{type:"loading",children:"function"==typeof u?u():u}):!1===F?P.jsx(PC,{type:"error",children:"function"==typeof s?s():s}):P.jsx(RC.Provider,{value:V,children:i}):P.jsx(PC,{type:"no-data",children:"function"==typeof p?p():p})}))}));function QC(){return p(RC)}function ZC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=t.filter(Boolean);return i.length<=1?i[0]||null:function(t){i.forEach((function(e){"function"==typeof e?e(t):e&&(e.current=t)}))}}const tM=f(null),eM={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},iM=/^H(\d+)$/;function nM(t){return"children"in t}function sM(t){return!!nM(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function rM(t){const e={};if(nM(t)){const{role:i}=t,n=i.match(iM);if(n)e.role="heading",e["aria-level"]=Number(n[1]);else if(function(t){return t in eM}(i)){const t=eM[i];t&&(e.role=t)}}return e}function aM(t){const e={};if(nM(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),sM(t)){const[i]=t.children;if(i){const t=aM(i);return Object.assign(Object.assign({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function oM(t){return t?Object.assign(Object.assign({},rM(t)),aM(t)):null}function lM({className:t,node:e}){const i=h((()=>oM(e)),[e]),n=h((()=>!nM(e)||sM(e)?null:e.children.map(((t,e)=>P.jsx(lM,{node:t},e)))),[e]);return P.jsx("span",Object.assign({className:t},i,{children:n}))}function hM(){return p(tM)}function cM(){const t=hM();_C(t,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[n,s]=VC(),{value:r,error:a}=n,{customTextRenderer:o,page:l}=t;return v((function(){s({type:"RESET"})}),[s,l]),v((function(){if(o||!l)return;const t=vC(l.getStructTree()),e=t;return t.promise.then((t=>{s({type:"RESOLVE",value:t})})).catch((t=>{s({type:"REJECT",error:t})})),()=>$C(e)}),[o,l,s]),v((()=>{if(void 0!==r){if(!1===r)return void(a&&(kC(!1,a.toString()),e&&e(a)));r&&i&&i(r)}}),[r]),r?P.jsx(lM,{className:"react-pdf__Page__structTree structTree",node:r}):null}const dM=CE;function uM(t){const e=hM();_C(e,"Unable to find Page context.");const i=Object.assign(Object.assign({},e),t),{_className:n,canvasBackground:s,devicePixelRatio:r=WC(),onRenderError:a,onRenderSuccess:o,page:l,renderForms:d,renderTextLayer:u,rotate:p,scale:f}=i,{canvasRef:g}=t;_C(l,"Attempted to render page canvas, but no page was specified.");const m=c(null);function y(t){(function(t){return"RenderingCancelledException"===t.name})(t)||(kC(!1,t.toString()),a&&a(t))}const w=h((()=>l.getViewport({scale:f*r,rotation:p})),[r,l,p,f]),A=h((()=>l.getViewport({scale:f,rotation:p})),[l,p,f]);v((function(){if(!l)return;l.cleanup();const{current:t}=m;if(!t)return;t.width=w.width,t.height=w.height,t.style.width=`${Math.floor(A.width)}px`,t.style.height=`${Math.floor(A.height)}px`,t.style.visibility="hidden";const e={annotationMode:d?dM.ENABLE_FORMS:dM.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:w};s&&(e.background=s);const i=l.render(e),n=i;return i.promise.then((()=>{t.style.visibility="",l&&o&&o(zC(l,f))})).catch(y),()=>$C(n)}),[s,l,d,w,A]);const _=b((()=>{const{current:t}=m;t&&(t.width=0,t.height=0)}),[]);return v((()=>_),[_]),P.jsx("canvas",{className:`${n}__canvas`,dir:"ltr",ref:ZC(g,m),style:{display:"block",userSelect:"none"},children:u?P.jsx(cM,{}):null})}function pM(){const t=hM();_C(t,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:n,onRenderTextLayerError:s,onRenderTextLayerSuccess:r,page:a,pageIndex:o,pageNumber:l,rotate:d,scale:u}=t;_C(a,"Attempted to load page text content, but no page was specified.");const[p,f]=VC(),{value:g,error:m}=p,y=c(null),w=c(void 0);kC(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10),"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer"),v((function(){f({type:"RESET"})}),[a,f]),v((function(){if(!a)return;const t=vC(a.getTextContent()),e=t;return t.promise.then((t=>{f({type:"RESOLVE",value:t})})).catch((t=>{f({type:"REJECT",error:t})})),()=>$C(e)}),[a,f]),v((()=>{if(void 0!==g){if(!1===g)return void(m&&(kC(!1,m.toString()),i&&i(m)));g&&n&&n(g)}}),[g]);const _=b((()=>{r&&r()}),[r]),x=b((t=>{kC(!1,t.toString()),s&&s(t)}),[s]);const S=h((()=>a.getViewport({scale:u,rotation:d})),[a,d,u]);return A((function(){if(!a||!g)return;const{current:t}=y;if(!t)return;t.innerHTML="";const i=a.streamTextContent({includeMarkedContent:!0}),n=new GE({container:t,textContentSource:i,viewport:S}),s=n;return n.render().then((()=>{const i=document.createElement("div");i.className="endOfContent",t.append(i),w.current=i;const n=t.querySelectorAll('[role="presentation"]');if(e){let t=0;g.items.forEach(((i,s)=>{if(!function(t){return"str"in t}(i))return;const r=n[t];if(!r)return;const a=e(Object.assign({pageIndex:o,pageNumber:l,itemIndex:s},i));r.innerHTML=a,t+=i.str&&i.hasEOL?2:1}))}_()})).catch(x),()=>$C(s)}),[e,x,_,a,o,l,g,S]),P.jsx("div",{className:bC("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=w.current;t&&t.classList.remove("active")},onMouseDown:function(){const t=w.current;t&&t.classList.add("active")},ref:y})}function fM(){const t=QC(),e=hM();_C(e,"Unable to find Page context.");const i=Object.assign(Object.assign({},t),e),{imageResourcesPath:n,linkService:s,onGetAnnotationsError:r,onGetAnnotationsSuccess:a,onRenderAnnotationLayerError:o,onRenderAnnotationLayerSuccess:l,page:d,pdf:u,renderForms:p,rotate:f,scale:g=1}=i;_C(u,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),_C(d,"Attempted to load page annotations, but no page was specified."),_C(s,"Attempted to load page annotations, but no linkService was specified.");const[m,y]=VC(),{value:b,error:w}=m,A=c(null);kC(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10),"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations"),v((function(){y({type:"RESET"})}),[y,d]),v((function(){if(!d)return;const t=vC(d.getAnnotations()),e=t;return t.promise.then((t=>{y({type:"RESOLVE",value:t})})).catch((t=>{y({type:"REJECT",error:t})})),()=>{$C(e)}}),[y,d]),v((()=>{if(void 0!==b){if(!1===b)return void(w&&(kC(!1,w.toString()),r&&r(w)));b&&a&&a(b)}}),[b]);const _=h((()=>d.getViewport({scale:g,rotation:f})),[d,f,g]);return v((function(){if(!(u&&d&&s&&b))return;const{current:t}=A;if(!t)return;const e=_.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:t,l10n:null,page:d,viewport:e},r={annotations:b,annotationStorage:u.annotationStorage,div:t,imageResourcesPath:n,linkService:s,page:d,renderForms:p,viewport:e};t.innerHTML="";try{new EE(i).render(r),l&&l()}catch(t){kC(!1,`${a=t}`),o&&o(a)}var a;return()=>{}}),[b,n,s,d,u,p,_]),P.jsx("div",{className:bC("react-pdf__Page__annotations","annotationLayer"),ref:A})}var gM=globalThis&&globalThis.__rest||function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const mM=1;function vM(t){const e=QC(),i=Object.assign(Object.assign({},e),t),{_className:n="react-pdf__Page",_enableRegisterUnregisterPage:s=!0,canvasBackground:r,canvasRef:a,children:o,className:l,customRenderer:d,customTextRenderer:u,devicePixelRatio:p,error:f="Failed to load the page.",height:g,inputRef:m,loading:y="Loading page…",noData:b="No page specified.",onGetAnnotationsError:w,onGetAnnotationsSuccess:A,onGetStructTreeError:_,onGetStructTreeSuccess:x,onGetTextError:S,onGetTextSuccess:k,onLoadError:E,onLoadSuccess:C,onRenderAnnotationLayerError:M,onRenderAnnotationLayerSuccess:R,onRenderError:T,onRenderSuccess:L,onRenderTextLayerError:I,onRenderTextLayerSuccess:D,pageIndex:F,pageNumber:N,pdf:O,registerPage:W,renderAnnotationLayer:j=!0,renderForms:B=!1,renderMode:$="canvas",renderTextLayer:z=!0,rotate:H,scale:U=mM,unregisterPage:V,width:G}=i,q=gM(i,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[X,Y]=VC(),{value:K,error:J}=X,Q=c(null);_C(O,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const Z=FC(N)?N-1:F??null,tt=N??(FC(F)?F+1:null),et=H??(K?K.rotate:null),it=h((()=>{if(!K)return null;let t=1;const e=U??mM;if(G||g){const e=K.getViewport({scale:1,rotation:et});G?t=G/e.width:g&&(t=g/e.height)}return e*t}),[g,K,et,U,G]);v((function(){return()=>{FC(Z)&&s&&V&&V(Z)}}),[s,O,Z,V]),v((function(){Y({type:"RESET"})}),[Y,O,Z]),v((function(){if(!O||!tt)return;const t=vC(O.getPage(tt)),e=t;return t.promise.then((t=>{Y({type:"RESOLVE",value:t})})).catch((t=>{Y({type:"REJECT",error:t})})),()=>$C(e)}),[Y,O,tt]),v((()=>{if(void 0!==K){if(!1===K)return void(J&&(kC(!1,J.toString()),E&&E(J)));!function(){if(C){if(!K||!it)return;C(zC(K,it))}if(s&&W){if(!FC(Z)||!Q.current)return;W(Z,Q.current)}}()}}),[K,it]);const nt=h((()=>K&&FC(Z)&&tt&&FC(et)&&FC(it)?{_className:n,canvasBackground:r,customTextRenderer:u,devicePixelRatio:p,onGetAnnotationsError:w,onGetAnnotationsSuccess:A,onGetStructTreeError:_,onGetStructTreeSuccess:x,onGetTextError:S,onGetTextSuccess:k,onRenderAnnotationLayerError:M,onRenderAnnotationLayerSuccess:R,onRenderError:T,onRenderSuccess:L,onRenderTextLayerError:I,onRenderTextLayerSuccess:D,page:K,pageIndex:Z,pageNumber:tt,renderForms:B,renderTextLayer:z,rotate:et,scale:it}:null),[n,r,u,p,w,A,_,x,S,k,M,R,T,L,I,D,K,Z,tt,B,z,et,it]),st=h((()=>mC(q,(()=>K&&(it?zC(K,it):void 0)))),[q,K,it]),rt=`${Z}@${it}/${et}`;function at(){switch($){case"custom":return _C(d,'renderMode was set to "custom", but no customRenderer was passed.'),P.jsx(d,{},`${rt}_custom`);case"none":return null;default:return P.jsx(uM,{canvasRef:a},`${rt}_canvas`)}}return P.jsx("div",Object.assign({className:bC(n,l),"data-page-number":tt,ref:ZC(m,Q),style:{"--scale-factor":`${it}`,backgroundColor:r||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},st,{children:tt?null===O||null==K?P.jsx(PC,{type:"loading",children:"function"==typeof y?y():y}):!1===O||!1===K?P.jsx(PC,{type:"error",children:"function"==typeof f?f():f}):P.jsxs(tM.Provider,{value:nt,children:[at(),z?P.jsx(pM,{},`${rt}_text`):null,j?P.jsx(fM,{},`${rt}_annotations`):null,o]}):P.jsx(PC,{type:"no-data",children:"function"==typeof b?b():b})}))}kC(!DC,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${jC}`),IE.workerSrc="pdf.worker.mjs";const yM="SET_ZOOM_LEVEL",bM=t=>({type:yM,value:t}),wM="SET_PDF_PAGINATED",AM="SET_NUM_PAGES",_M=t=>({type:AM,value:t}),xM="SET_CURRENT_PAGE",SM=t=>({type:xM,value:t}),kM={defaultZoomLevel:1,zoomLevel:1,zoomJump:.1,paginated:!0,numPages:0,currentPage:1},EM=(t=kM,e)=>{switch(e.type){case yM:{const{value:i}=e;return{...t,zoomLevel:i}}case wM:{const{value:i}=e;return{...t,paginated:i}}case AM:{const{value:i}=e;return{...t,numPages:i}}case xM:{const{value:i}=e;return{...t,currentPage:i}}default:return t}},CM=f({state:kM,dispatch:()=>null}),MM=({children:t,mainState:e})=>{var i,n,s,r,a,o,l;const[h,c]=m(EM,{...kM,defaultZoomLevel:(null==(n=null==(i=e.config)?void 0:i.pdfZoom)?void 0:n.defaultZoom)??kM.defaultZoomLevel,zoomLevel:(null==(r=null==(s=e.config)?void 0:s.pdfZoom)?void 0:r.defaultZoom)??kM.zoomLevel,zoomJump:(null==(o=null==(a=e.config)?void 0:a.pdfZoom)?void 0:o.zoomJump)??kM.zoomJump,paginated:(null==(l=e.config)||!l.pdfVerticalScrollByDefault)&&kM.paginated,mainState:e});return P.jsx(CM.Provider,{value:{state:h,dispatch:c},children:t})},RM=({pageNum:t})=>{const{state:{mainState:e,paginated:i,zoomLevel:n,numPages:s,currentPage:r}}=p(CM),{t:a}=tl(),o=(null==e?void 0:e.rendererRect)||null,l=t??r;return P.jsxs(PM,{id:"pdf-page-wrapper",$lastPage:l>=s,children:[!i&&P.jsx(TM,{id:"pdf-page-info",children:a("pdfPluginPageNumber",{currentPage:l,allPagesCount:s})}),P.jsx(vM,{pageNumber:l||r,scale:n,height:((null==o?void 0:o.height)??100)-100,width:((null==o?void 0:o.width)??100)-100,loading:a("pdfPluginLoading")})]})},PM=so.div`
|
|
172
|
+
`;var Ol={d:(t,e)=>{for(var i in e)Ol.o(e,i)&&!Ol.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Wl=globalThis.pdfjsLib={};Ol.d(Wl,{AbortException:()=>Yh,AnnotationEditorLayer:()=>lE,AnnotationEditorParamsType:()=>Ql,AnnotationEditorType:()=>Jl,AnnotationEditorUIManager:()=>Jp,AnnotationLayer:()=>Gw,AnnotationMode:()=>Kl,CMapCompressionType:()=>Th,ColorPicker:()=>q_,DOMSVGFactory:()=>ad,DrawLayer:()=>wE,FeatureTest:()=>Zh,GlobalWorkerOptions:()=>cm,ImageKind:()=>ah,InvalidPDFException:()=>Vh,MissingPDFException:()=>Gh,OPS:()=>Lh,Outliner:()=>n_,PDFDataRangeTransport:()=>fb,PDFDateString:()=>bd,PDFWorker:()=>Ib,PasswordResponses:()=>Ih,PermissionFlag:()=>Zl,PixelsPerInch:()=>Mc,RenderingCancelledException:()=>ld,TextLayer:()=>tb,UnexpectedResponseException:()=>qh,Util:()=>rc,VerbosityLevel:()=>Rh,XfaLayer:()=>sy,build:()=>ty,createValidAbsoluteUrl:()=>Bh,fetchData:()=>nd,getDocument:()=>hb,getFilenameFromUrl:()=>dd,getPdfFilenameFromUrl:()=>ud,getXfaPageViewport:()=>yd,isDataScheme:()=>hd,isPdfFile:()=>cd,noContextMenu:()=>gd,normalizeUnicode:()=>lc,renderTextLayer:()=>eb,setLayerDimensions:()=>xd,shadow:()=>Hh,updateTextLayer:()=>ib,version:()=>Zb});const jl=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),Bl=[1,0,0,1,0,0],Hl=[.001,0,0,.001,0,0],zl=1.35,$l=1,Ul=2,Vl=4,Gl=16,ql=32,Xl=64,Yl=256,Kl={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Jl={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},Ql={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},Zl={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},th=0,eh=1,ih=2,nh=3,sh=3,rh=4,ah={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},oh=1,lh=2,hh=3,ch=4,dh=5,uh=6,ph=7,fh=8,gh=9,mh=10,vh=11,bh=12,yh=13,wh=14,Ah=15,_h=16,xh=17,Sh=20,kh=1,Eh=2,Ch=3,Mh=4,Ph=5,Rh={ERRORS:0,WARNINGS:1,INFOS:5},Th={NONE:0,BINARY:1},Lh={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},Ih={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Dh=Rh.WARNINGS;function Fh(){return Dh}function Nh(t){Dh>=Rh.INFOS&&console.log(`Info: ${t}`)}function Oh(t){Dh>=Rh.WARNINGS&&console.log(`Warning: ${t}`)}function Wh(t){throw new Error(t)}function jh(t,e){t||Wh(e)}function Bh(t,e=null,i=null){if(!t)return null;try{if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);(null==e?void 0:e.length)>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=function(t){return decodeURIComponent(escape(t))}(t)}catch{}}const n=e?new URL(t,e):new URL(t);if(function(t){switch(null==t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch{}return null}function Hh(t,e,i,n=!1){return Object.defineProperty(t,e,{value:i,enumerable:!n,configurable:!0,writable:!1}),i}const zh=function(){function t(e,i){this.constructor===t&&Wh("Cannot initialize BaseException."),this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class $h extends zh{constructor(t,e){super(t,"PasswordException"),this.code=e}}class Uh extends zh{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Vh extends zh{constructor(t){super(t,"InvalidPDFException")}}class Gh extends zh{constructor(t){super(t,"MissingPDFException")}}class qh extends zh{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class Xh extends zh{constructor(t){super(t,"FormatError")}}class Yh extends zh{constructor(t){super(t,"AbortException")}}function Kh(t){("object"!=typeof t||void 0===(null==t?void 0:t.length))&&Wh("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const n=[];for(let s=0;s<e;s+=i){const r=Math.min(s+i,e),a=t.subarray(s,r);n.push(String.fromCharCode.apply(null,a))}return n.join("")}function Jh(t){"string"!=typeof t&&Wh("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let n=0;n<e;++n)i[n]=255&t.charCodeAt(n);return i}function Qh(t){const e=Object.create(null);for(const[i,n]of t)e[i]=n;return e}class Zh{static get isLittleEndian(){return Hh(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return Hh(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return Hh(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&"string"==typeof(null==navigator?void 0:navigator.platform)?Hh(this,"platform",{isMac:navigator.platform.includes("Mac")}):Hh(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var t,e;return Hh(this,"isCSSRoundSupported",null==(e=null==(t=globalThis.CSS)?void 0:t.supports)?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const tc=Array.from(Array(256).keys(),(t=>t.toString(16).padStart(2,"0")));var ec,ic,nc,sc;class rc{static makeHexColor(t,e,i){return`#${tc[t]}${tc[e]}${tc[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){const i=this.applyTransform(t,e),n=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),r=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],n[0],s[0],r[0]),Math.min(i[1],n[1],s[1],r[1]),Math.max(i[0],n[0],s[0],r[0]),Math.max(i[1],n[1],s[1],r[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],n=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],r=t[2]*e[1]+t[3]*e[3],a=(i+r)/2,o=Math.sqrt((i+r)**2-4*(i*r-s*n))/2,l=a+o||1,h=a-o||1;return[Math.sqrt(l),Math.sqrt(h)]}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>n)return null;const s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),r=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>r?null:[i,s,n,r]}static bezierBoundingBox(t,e,i,n,s,r,a,l,h){return h?(h[0]=Math.min(h[0],t,a),h[1]=Math.min(h[1],e,l),h[2]=Math.max(h[2],t,a),h[3]=Math.max(h[3],e,l)):h=[Math.min(t,a),Math.min(e,l),Math.max(t,a),Math.max(e,l)],o(this,nc,sc).call(this,t,i,s,a,e,n,r,l,3*(3*(i-s)-t+a),6*(t-2*i+s),3*(i-t),h),o(this,nc,sc).call(this,t,i,s,a,e,n,r,l,3*(3*(n-r)-e+l),6*(e-2*n+r),3*(n-e),h),h}}ec=new WeakSet,ic=function(t,e,i,n,s,r,a,o,l,h){if(l<=0||l>=1)return;const c=1-l,d=l*l,u=d*l,p=c*(c*(c*t+3*l*e)+3*d*i)+u*n,f=c*(c*(c*s+3*l*r)+3*d*a)+u*o;h[0]=Math.min(h[0],p),h[1]=Math.min(h[1],f),h[2]=Math.max(h[2],p),h[3]=Math.max(h[3],f)},nc=new WeakSet,sc=function(t,e,i,n,s,r,a,l,h,c,d,u){if(Math.abs(h)<1e-12)return void(Math.abs(c)>=1e-12&&o(this,ec,ic).call(this,t,e,i,n,s,r,a,l,-d/c,u));const p=c**2-4*d*h;if(p<0)return;const f=Math.sqrt(p),g=2*h;o(this,ec,ic).call(this,t,e,i,n,s,r,a,l,(-c+f)/g,u),o(this,ec,ic).call(this,t,e,i,n,s,r,a,l,(-c-f)/g,u)},s(rc,ec),s(rc,nc);let ac=null,oc=null;function lc(t){return ac||(ac=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,oc=new Map([["ſt","ſt"]])),t.replaceAll(ac,((t,e,i)=>e?e.normalize("NFKC"):oc.get(i)))}const hc="pdfjs_internal_id_",cc=0,dc=1,uc=2,pc=3,fc=4,gc=5,mc=6,vc=7,bc=8;class yc{constructor(){this.constructor===yc&&Wh("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,n,s){return"none"}destroy(t=!1){}}var wc;const Ac=class{constructor({enableHWA:t=!1}={}){s(this,wc,!1),this.constructor===Ac&&Wh("Cannot initialize BaseCanvasFactory."),r(this,wc,t)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!n(this,wc)})}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){Wh("Abstract method `_createCanvas` called.")}};let _c=Ac;wc=new WeakMap;class xc{constructor({baseUrl:t=null,isCompressed:e=!0}){this.constructor===xc&&Wh("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":""),i=this.isCompressed?Th.BINARY:Th.NONE;return this._fetchData(e,i).catch((t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)}))}_fetchData(t,e){Wh("Abstract method `_fetchData` called.")}}class Sc{constructor({baseUrl:t=null}){this.constructor===Sc&&Wh("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetchData(e).catch((t=>{throw new Error(`Unable to load font data at: ${e}`)}))}_fetchData(t){Wh("Abstract method `_fetchData` called.")}}class kc{constructor(){this.constructor===kc&&Wh("Cannot initialize BaseSVGFactory.")}create(t,e,i=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width",`${t}px`),n.setAttribute("height",`${e}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${t} ${e}`),n}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Wh("Abstract method `_createSVG` called.")}}const Ec="http://www.w3.org/2000/svg",Cc=class{};let Mc=Cc;var Pc,Rc,Tc,Lc,Ic,Dc,Fc,Nc,Oc,Wc,jc,Bc,Hc,zc,$c,Uc,Vc,Gc,qc,Xc,Yc,Kc,Jc,Qc,Zc,td,ed,id;e(Mc,"CSS",96),e(Mc,"PDF",72),e(Mc,"PDF_TO_CSS_UNITS",Cc.CSS/Cc.PDF);Pc=new WeakMap,Rc=new WeakMap,Tc=new WeakMap,Lc=new WeakMap,Ic=new WeakMap,Dc=new WeakMap,Fc=new WeakSet,Nc=function(){return n(this,Pc)||r(this,Pc,new Map)},Oc=new WeakSet,Wc=function(){return n(this,Ic)||r(this,Ic,new Map)},jc=new WeakSet,Bc=function(){if(!n(this,Rc)){const t=n(this,Lc).createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const i=n(this,Lc).createElementNS(Ec,"svg");i.setAttribute("width",0),i.setAttribute("height",0),r(this,Rc,n(this,Lc).createElementNS(Ec,"defs")),t.append(i),i.append(n(this,Rc)),n(this,Lc).body.append(t)}return n(this,Rc)},Hc=new WeakSet,zc=function(t){if(1===t.length){const e=t[0],i=new Array(256);for(let t=0;t<256;t++)i[t]=e[t]/255;const n=i.join(",");return[n,n,n]}const[e,i,n]=t,s=new Array(256),r=new Array(256),a=new Array(256);for(let t=0;t<256;t++)s[t]=e[t]/255,r[t]=i[t]/255,a[t]=n[t]/255;return[s.join(","),r.join(","),a.join(",")]},$c=new WeakSet,Uc=function(t){const e=n(this,Lc).createElementNS(Ec,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)},Vc=new WeakSet,Gc=function(t){const e=n(this,Lc).createElementNS(Ec,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)},qc=new WeakSet,Xc=function(t){const e=n(this,Lc).createElementNS(Ec,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),n(this,jc,Bc).append(e),e},Yc=new WeakSet,Kc=function(t,e,i){const s=n(this,Lc).createElementNS(Ec,e);s.setAttribute("type","discrete"),s.setAttribute("tableValues",i),t.append(s)},Jc=new WeakSet,Qc=function(t,e,i,s){const r=n(this,Lc).createElementNS(Ec,"feComponentTransfer");s.append(r),o(this,Yc,Kc).call(this,r,"feFuncR",t),o(this,Yc,Kc).call(this,r,"feFuncG",e),o(this,Yc,Kc).call(this,r,"feFuncB",i)},Zc=new WeakSet,td=function(t,e){const i=n(this,Lc).createElementNS(Ec,"feComponentTransfer");e.append(i),o(this,Yc,Kc).call(this,i,"feFuncA",t)},ed=new WeakSet,id=function(t){return n(this,jc,Bc).style.color=t,wd(getComputedStyle(n(this,jc,Bc)).getPropertyValue("color"))};async function nd(t,e="text"){if(fd(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise(((i,n)=>{const s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType=e,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(200===s.status||0===s.status){switch(e){case"arraybuffer":case"blob":case"json":return void i(s.response)}return void i(s.responseText)}n(new Error(s.statusText))}},s.send(null)}))}class sd extends xc{_fetchData(t,e){return nd(t,this.isCompressed?"arraybuffer":"text").then((t=>({cMapData:t instanceof ArrayBuffer?new Uint8Array(t):Jh(t),compressionType:e})))}}class rd extends Sc{_fetchData(t){return nd(t,"arraybuffer").then((t=>new Uint8Array(t)))}}class ad extends kc{_createSVG(t){return document.createElementNS(Ec,t)}}class od{constructor({viewBox:t,scale:e,rotation:i,offsetX:n=0,offsetY:s=0,dontFlip:r=!1}){this.viewBox=t,this.scale=e,this.rotation=i,this.offsetX=n,this.offsetY=s;const a=(t[2]+t[0])/2,o=(t[3]+t[1])/2;let l,h,c,d,u,p,f,g;switch((i%=360)<0&&(i+=360),i){case 180:l=-1,h=0,c=0,d=1;break;case 90:l=0,h=1,c=1,d=0;break;case 270:l=0,h=-1,c=-1,d=0;break;case 0:l=1,h=0,c=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}r&&(c=-c,d=-d),0===l?(u=Math.abs(o-t[1])*e+n,p=Math.abs(a-t[0])*e+s,f=(t[3]-t[1])*e,g=(t[2]-t[0])*e):(u=Math.abs(a-t[0])*e+n,p=Math.abs(o-t[1])*e+s,f=(t[2]-t[0])*e,g=(t[3]-t[1])*e),this.transform=[l*e,h*e,c*e,d*e,u-l*e*a-c*e*o,p-h*e*a-d*e*o],this.width=f,this.height=g}get rawDims(){const{viewBox:t}=this;return Hh(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}={}){return new od({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){return rc.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=rc.applyTransform([t[0],t[1]],this.transform),i=rc.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return rc.applyInverseTransform([t,e],this.transform)}}class ld extends zh{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}function hd(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function cd(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function dd(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function ud(t,e="document.pdf"){if("string"!=typeof t)return e;if(hd(t))return Oh('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let s=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(s&&(s=s[0],s.includes("%")))try{s=i.exec(decodeURIComponent(s))[0]}catch{}return s||e}class pd{constructor(){e(this,"started",Object.create(null)),e(this,"times",[])}time(t){t in this.started&&Oh(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||Oh(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:t}of this.times)e=Math.max(t.length,e);for(const{name:i,start:n,end:s}of this.times)t.push(`${i.padEnd(e)} ${s-n}ms\n`);return t.join("")}}function fd(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch{return!1}}function gd(t){t.preventDefault()}function md(t){console.log("Deprecated API usage: "+t)}let vd;class bd{static toDateObject(t){if(!t||"string"!=typeof t)return null;vd||(vd=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=vd.exec(t);if(!e)return null;const i=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let r=parseInt(e[4],10);r=r>=0&&r<=23?r:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let c=parseInt(e[9],10)||0;return c=c>=0&&c<=59?c:0,"-"===l?(r+=h,a+=c):"+"===l&&(r-=h,a-=c),new Date(Date.UTC(i,n,s,r,a,o))}}function yd(t,{scale:e=1,rotation:i=0}){const{width:n,height:s}=t.attributes.style,r=[0,0,parseInt(n),parseInt(s)];return new od({viewBox:r,scale:e,rotation:i})}function wd(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map((t=>parseInt(t))):t.startsWith("rgba(")?t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3):(Oh(`Not a valid color format: "${t}"`),[0,0,0])}function Ad(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform();return[e,i,n,s,r,a]}function _d(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform().invertSelf();return[e,i,n,s,r,a]}function xd(t,e,i=!1,n=!0){if(e instanceof od){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:r}=t,a=Zh.isCSSRoundSupported,o=`var(--scale-factor) * ${n}px`,l=`var(--scale-factor) * ${s}px`,h=a?`round(${o}, 1px)`:`calc(${o})`,c=a?`round(${l}, 1px)`:`calc(${l})`;i&&e.rotation%180!=0?(r.width=c,r.height=h):(r.width=h,r.height=c)}n&&t.setAttribute("data-main-rotation",e.rotation)}var Sd,kd,Ed,Cd,Md,Pd,Rd,Td,Ld,Id,Dd,Fd,Nd,Od,Wd,jd;const Bd=class{constructor(t){s(this,Rd),s(this,Ld),s(this,Dd),s(this,Nd),s(this,Wd),s(this,Sd,null),s(this,kd,null),s(this,Ed,void 0),s(this,Cd,null),r(this,Ed,t)}render(){const t=r(this,Sd,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const e=n(this,Ed)._uiManager._signal;t.addEventListener("contextmenu",gd,{signal:e}),t.addEventListener("pointerdown",o(Bd,Md,Pd),{signal:e});const i=r(this,Cd,document.createElement("div"));i.className="buttons",t.append(i);const s=n(this,Ed).toolbarPosition;if(s){const{style:e}=t,i="ltr"===n(this,Ed)._uiManager.direction?1-s[0]:s[0];e.insetInlineEnd=100*i+"%",e.top=`calc(${100*s[1]}% + var(--editor-toolbar-vert-offset))`}return o(this,Nd,Od).call(this),t}hide(){var t;n(this,Sd).classList.add("hidden"),null==(t=n(this,kd))||t.hideDropdown()}show(){n(this,Sd).classList.remove("hidden")}addAltTextButton(t){o(this,Dd,Fd).call(this,t),n(this,Cd).prepend(t,n(this,Wd,jd))}addColorPicker(t){r(this,kd,t);const e=t.renderButton();o(this,Dd,Fd).call(this,e),n(this,Cd).prepend(e,n(this,Wd,jd))}remove(){var t;n(this,Sd).remove(),null==(t=n(this,kd))||t.destroy(),r(this,kd,null)}};let Hd=Bd;var zd,$d,Ud,Vd,Gd,qd,Xd,Yd,Kd,Jd,Qd,Zd,tu,eu,iu;Sd=new WeakMap,kd=new WeakMap,Ed=new WeakMap,Cd=new WeakMap,Md=new WeakSet,Pd=function(t){t.stopPropagation()},Rd=new WeakSet,Td=function(t){n(this,Ed)._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()},Ld=new WeakSet,Id=function(t){n(this,Ed)._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()},Dd=new WeakSet,Fd=function(t){const e=n(this,Ed)._uiManager._signal;t.addEventListener("focusin",o(this,Rd,Td).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",o(this,Ld,Id).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",gd,{signal:e})},Nd=new WeakSet,Od=function(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id",`pdfjs-editor-remove-${n(this,Ed).editorType}-button`),o(this,Dd,Fd).call(this,t),t.addEventListener("click",(t=>{n(this,Ed)._uiManager.delete()}),{signal:n(this,Ed)._uiManager._signal}),n(this,Cd).append(t)},Wd=new WeakSet,jd=function(){const t=document.createElement("div");return t.className="divider",t},s(Hd,Md);class nu{constructor(t){s(this,Vd),s(this,qd),s(this,Yd),s(this,zd,null),s(this,$d,null),s(this,Ud,void 0),r(this,Ud,t)}show(t,e,i){const[s,a]=o(this,qd,Xd).call(this,e,i),{style:l}=n(this,$d)||r(this,$d,o(this,Vd,Gd).call(this));t.append(n(this,$d)),l.insetInlineEnd=100*s+"%",l.top=`calc(${100*a}% + var(--editor-toolbar-vert-offset))`}hide(){n(this,$d).remove()}}function su(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}zd=new WeakMap,$d=new WeakMap,Ud=new WeakMap,Vd=new WeakSet,Gd=function(){const t=r(this,$d,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",gd,{signal:n(this,Ud)._signal});const e=r(this,zd,document.createElement("div"));return e.className="buttons",t.append(e),o(this,Yd,Kd).call(this),t},qd=new WeakSet,Xd=function(t,e){let i=0,n=0;for(const s of t){const t=s.y+s.height;if(t<i)continue;const r=s.x+(e?s.width:0);t>i?(n=r,i=t):e?r>n&&(n=r):r<n&&(n=r)}return[e?1-n:n,i]},Yd=new WeakSet,Kd=function(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=n(this,Ud)._signal;t.addEventListener("contextmenu",gd,{signal:i}),t.addEventListener("click",(()=>{n(this,Ud).highlightSelection("floating_button")}),{signal:i}),n(this,zd).append(t)};class ru{constructor(){s(this,Jd,0)}get id(){return"pdfjs_internal_editor_"+a(this,Jd)._++}}Jd=new WeakMap;const au=class{constructor(){s(this,eu),s(this,Qd,function(){if(typeof crypto<"u"&&"function"==typeof(null==crypto?void 0:crypto.randomUUID))return crypto.randomUUID();const t=new Uint8Array(32);if(typeof crypto<"u"&&"function"==typeof(null==crypto?void 0:crypto.getRandomValues))crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(255*Math.random());return Kh(t)}()),s(this,Zd,0),s(this,tu,null)}static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;e.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';return Hh(this,"_isSVGFittingCanvas",e.decode().then((()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]))))}async getFromFile(t){const{lastModified:e,name:i,size:n,type:s}=t;return o(this,eu,iu).call(this,`${e}_${i}_${n}_${s}`,t)}async getFromUrl(t){return o(this,eu,iu).call(this,t,t)}async getFromId(t){n(this,tu)||r(this,tu,new Map);const e=n(this,tu).get(t);return e?e.bitmap?(e.refCounter+=1,e):e.file?this.getFromFile(e.file):this.getFromUrl(e.url):null}getSvgUrl(t){const e=n(this,tu).get(t);return null!=e&&e.isSvg?e.svgUrl:null}deleteId(t){n(this,tu)||r(this,tu,new Map);const e=n(this,tu).get(t);e&&(e.refCounter-=1,0===e.refCounter&&(e.bitmap=null))}isValidId(t){return t.startsWith(`image_${n(this,Qd)}_`)}};let ou=au;var lu,hu,cu,du,uu,pu;Qd=new WeakMap,Zd=new WeakMap,tu=new WeakMap,eu=new WeakSet,iu=async function(t,e){n(this,tu)||r(this,tu,new Map);let i=n(this,tu).get(t);if(null===i)return null;if(null!=i&&i.bitmap)return i.refCounter+=1,i;try{let t;if(i||(i={bitmap:null,id:`image_${n(this,Qd)}_${a(this,Zd)._++}`,refCounter:0,isSvg:!1}),"string"==typeof e?(i.url=e,t=await nd(e,"blob")):t=i.file=e,"image/svg+xml"===t.type){const e=au._isSVGFittingCanvas,n=new FileReader,s=new Image,r=new Promise(((t,r)=>{s.onload=()=>{i.bitmap=s,i.isSvg=!0,t()},n.onload=async()=>{const t=i.svgUrl=n.result;s.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t},s.onerror=n.onerror=r}));n.readAsDataURL(t),await r}else i.bitmap=await createImageBitmap(t);i.refCounter=1}catch(t){console.error(t),i=null}return n(this,tu).set(t,i),i&&n(this,tu).set(i.id,i),i};class fu{constructor(t=128){s(this,lu,[]),s(this,hu,!1),s(this,cu,void 0),s(this,du,-1),r(this,cu,t)}add({cmd:t,undo:e,post:i,mustExec:s,type:a=NaN,overwriteIfSameType:o=!1,keepUndo:l=!1}){if(s&&t(),n(this,hu))return;const h={cmd:t,undo:e,post:i,type:a};if(-1===n(this,du))return n(this,lu).length>0&&(n(this,lu).length=0),r(this,du,0),void n(this,lu).push(h);if(o&&n(this,lu)[n(this,du)].type===a)return l&&(h.undo=n(this,lu)[n(this,du)].undo),void(n(this,lu)[n(this,du)]=h);const c=n(this,du)+1;c===n(this,cu)?n(this,lu).splice(0,1):(r(this,du,c),c<n(this,lu).length&&n(this,lu).splice(c)),n(this,lu).push(h)}undo(){if(-1===n(this,du))return;r(this,hu,!0);const{undo:t,post:e}=n(this,lu)[n(this,du)];t(),null==e||e(),r(this,hu,!1),r(this,du,n(this,du)-1)}redo(){if(n(this,du)<n(this,lu).length-1){r(this,du,n(this,du)+1),r(this,hu,!0);const{cmd:t,post:e}=n(this,lu)[n(this,du)];t(),null==e||e(),r(this,hu,!1)}}hasSomethingToUndo(){return-1!==n(this,du)}hasSomethingToRedo(){return n(this,du)<n(this,lu).length-1}destroy(){r(this,lu,null)}}lu=new WeakMap,hu=new WeakMap,cu=new WeakMap,du=new WeakMap;class gu{constructor(t){s(this,uu),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=Zh.platform;for(const[i,n,s={}]of t)for(const t of i){const i=t.startsWith("mac+");e&&i?(this.callbacks.set(t.slice(4),{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1))):!e&&!i&&(this.callbacks.set(t,{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(o(this,uu,pu).call(this,e));if(!i)return;const{callback:n,options:{bubbles:s=!1,args:r=[],checker:a=null}}=i;a&&!a(t,e)||(n.bind(t,...r,e)(),s||(e.stopPropagation(),e.preventDefault()))}}uu=new WeakSet,pu=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e};const mu=class{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,wd(n))}e.remove()}(t),Hh(this,"_colors",t)}convert(t){const e=wd(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[t,i]of this._colors)if(i.every(((t,i)=>t===e[i])))return mu._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?rc.makeHexColor(...e):t}};let vu=mu;var bu,yu,wu,Au,_u,xu,Su,ku,Eu,Cu,Mu,Pu,Ru,Tu,Lu,Iu,Du,Fu,Nu,Ou,Wu,ju,Bu,Hu,zu,$u,Uu,Vu,Gu,qu,Xu,Yu,Ku,Ju,Qu,Zu,tp,ep,ip,np,sp,rp,ap,op,lp,hp,cp,dp,up,pp,fp,gp,mp,vp,bp,yp,wp,Ap,_p,xp,Sp,kp,Ep,Cp,Mp,Pp,Rp,Tp,Lp,Ip,Dp,Fp,Np,Op,Wp,jp,Bp,Hp,zp,$p,Up,Vp,Gp,qp,Xp,Yp;e(vu,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));const Kp=class{constructor(t,e,i,a,l,h,c,d,u){s(this,cp),s(this,up),s(this,fp),s(this,mp),s(this,bp),s(this,wp),s(this,_p),s(this,Sp),s(this,Ep),s(this,Mp),s(this,Rp),s(this,Lp),s(this,Dp),s(this,Np),s(this,Wp),s(this,Bp),s(this,zp),s(this,Up),s(this,Gp),s(this,Xp),s(this,bu,new AbortController),s(this,yu,null),s(this,wu,new Map),s(this,Au,new Map),s(this,_u,null),s(this,xu,null),s(this,Su,null),s(this,ku,new fu),s(this,Eu,0),s(this,Cu,new Set),s(this,Mu,null),s(this,Pu,null),s(this,Ru,new Set),s(this,Tu,!1),s(this,Lu,null),s(this,Iu,null),s(this,Du,null),s(this,Fu,!1),s(this,Nu,null),s(this,Ou,new ru),s(this,Wu,!1),s(this,ju,!1),s(this,Bu,null),s(this,Hu,null),s(this,zu,null),s(this,$u,Jl.NONE),s(this,Uu,new Set),s(this,Vu,null),s(this,Gu,null),s(this,qu,null),s(this,Xu,this.blur.bind(this)),s(this,Yu,this.focus.bind(this)),s(this,Ku,this.copy.bind(this)),s(this,Ju,this.cut.bind(this)),s(this,Qu,this.paste.bind(this)),s(this,Zu,this.keydown.bind(this)),s(this,tp,this.keyup.bind(this)),s(this,ep,this.onEditingAction.bind(this)),s(this,ip,this.onPageChanging.bind(this)),s(this,np,this.onScaleChanging.bind(this)),s(this,sp,this.onRotationChanging.bind(this)),s(this,rp,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),s(this,ap,[0,0]),s(this,op,null),s(this,lp,null),s(this,hp,null),this._signal=n(this,bu).signal,r(this,lp,t),r(this,hp,e),r(this,_u,i),this._eventBus=a,this._eventBus._on("editingaction",n(this,ep)),this._eventBus._on("pagechanging",n(this,ip)),this._eventBus._on("scalechanging",n(this,np)),this._eventBus._on("rotationchanging",n(this,sp)),o(this,bp,yp).call(this),o(this,Lp,Ip).call(this),o(this,Sp,kp).call(this),r(this,xu,l.annotationStorage),r(this,Lu,l.filterFactory),r(this,Gu,h),r(this,Du,c||null),r(this,Tu,d),r(this,zu,u||null),this.viewParameters={realScale:Mc.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}static get _keyboardManager(){const t=Kp.prototype,e=t=>n(t,lp).contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),i=(t,{target:e})=>{if(e instanceof HTMLInputElement){const{type:t}=e;return"text"!==t&&"number"!==t}return!0},s=this.TRANSLATE_SMALL,r=this.TRANSLATE_BIG;return Hh(this,"_keyboardManager",new gu([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&n(t,lp).contains(e)&&!t.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&n(t,lp).contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:e}]]))}destroy(){var t,e,i;null==(t=n(this,bu))||t.abort(),r(this,bu,null),this._signal=null,this._eventBus._off("editingaction",n(this,ep)),this._eventBus._off("pagechanging",n(this,ip)),this._eventBus._off("scalechanging",n(this,np)),this._eventBus._off("rotationchanging",n(this,sp));for(const t of n(this,Au).values())t.destroy();n(this,Au).clear(),n(this,wu).clear(),n(this,Ru).clear(),r(this,yu,null),n(this,Uu).clear(),n(this,ku).destroy(),null==(e=n(this,_u))||e.destroy(),null==(i=n(this,Nu))||i.hide(),r(this,Nu,null),n(this,Iu)&&(clearTimeout(n(this,Iu)),r(this,Iu,null)),n(this,op)&&(clearTimeout(n(this,op)),r(this,op,null))}async mlGuess(t){var e;return(null==(e=n(this,zu))?void 0:e.guess(t))||null}get hasMLManager(){return!!n(this,zu)}get hcmFilter(){return Hh(this,"hcmFilter",n(this,Gu)?n(this,Lu).addHCMFilter(n(this,Gu).foreground,n(this,Gu).background):"none")}get direction(){return Hh(this,"direction",getComputedStyle(n(this,lp)).direction)}get highlightColors(){return Hh(this,"highlightColors",n(this,Du)?new Map(n(this,Du).split(",").map((t=>t.split("=").map((t=>t.trim()))))):null)}get highlightColorNames(){return Hh(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,(t=>t.reverse()))):null)}setMainHighlightColorPicker(t){r(this,Hu,t)}editAltText(t){var e;null==(e=n(this,_u))||e.editAltText(this,t)}onPageChanging({pageNumber:t}){r(this,Eu,t-1)}focusMainContainer(){n(this,lp).focus()}findParent(t,e){for(const i of n(this,Au).values()){const{x:n,y:s,width:r,height:a}=i.div.getBoundingClientRect();if(t>=n&&t<=n+r&&e>=s&&e<=s+a)return i}return null}disableUserSelect(t=!1){n(this,hp).classList.toggle("noUserSelect",t)}addShouldRescale(t){n(this,Ru).add(t)}removeShouldRescale(t){n(this,Ru).delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*Mc.PDF_TO_CSS_UNITS;for(const t of n(this,Ru))t.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t=""){const e=document.getSelection();if(!e||e.isCollapsed)return;const{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:a}=e,l=e.toString(),h=o(this,cp,dp).call(this,e).closest(".textLayer"),c=this.getSelectionBoxes(h);if(c){e.empty(),n(this,$u)===Jl.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:Jl.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const e of n(this,Au).values())if(e.hasTextLayer(h)){e.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:c,anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:a,text:l});break}}}addToAnnotationStorage(t){!t.isEmpty()&&n(this,xu)&&!n(this,xu).has(t.id)&&n(this,xu).setValue(t.id,t)}blur(){if(this.isShiftKeyDown=!1,n(this,Fu)&&(r(this,Fu,!1),o(this,mp,vp).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of n(this,Uu))if(e.div.contains(t)){r(this,Bu,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!n(this,Bu))return;const[t,e]=n(this,Bu);r(this,Bu,null),e.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:this._signal}),e.focus()}addEditListeners(){o(this,Sp,kp).call(this),o(this,Mp,Pp).call(this)}removeEditListeners(){o(this,Ep,Cp).call(this),o(this,Rp,Tp).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of n(this,Pu))if(i.isHandlingMimeForPasting(e))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const e of t.dataTransfer.items)for(const i of n(this,Pu))if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){var e;if(t.preventDefault(),null==(e=n(this,yu))||e.commitOrRemove(),!this.hasSelection)return;const i=[];for(const t of n(this,Uu)){const e=t.serialize(!0);e&&i.push(e)}0!==i.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:e}=t;for(const t of e.items)for(const e of n(this,Pu))if(e.isHandlingMimeForPasting(t.type))return void e.paste(t,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(t){return void Oh(`paste: "${t.message}".`)}if(!Array.isArray(i))return;this.unselectAll();const s=this.currentLayer;try{const t=[];for(const e of i){const i=s.deserialize(e);if(!i)return;t.push(i)}const e=()=>{for(const e of t)o(this,zp,$p).call(this,e);o(this,Xp,Yp).call(this,t)},n=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:n,mustExec:!0})}catch(t){Oh(`paste: "${t.message}".`)}}keydown(t){!this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!0),n(this,$u)!==Jl.NONE&&!this.isEditorHandlingKeyboard&&Kp._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,n(this,Fu)&&(r(this,Fu,!1),o(this,mp,vp).call(this,"main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu")}}setEditingState(t){t?(o(this,wp,Ap).call(this),o(this,Mp,Pp).call(this),o(this,Dp,Fp).call(this,{isEditing:n(this,$u)!==Jl.NONE,isEmpty:o(this,Gp,qp).call(this),hasSomethingToUndo:n(this,ku).hasSomethingToUndo(),hasSomethingToRedo:n(this,ku).hasSomethingToRedo(),hasSelectedEditor:!1})):(o(this,_p,xp).call(this),o(this,Rp,Tp).call(this),o(this,Dp,Fp).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!n(this,Pu)){r(this,Pu,t);for(const t of n(this,Pu))o(this,Np,Op).call(this,t.defaultPropertiesToUpdate)}}getId(){return n(this,Ou).id}get currentLayer(){return n(this,Au).get(n(this,Eu))}getLayer(t){return n(this,Au).get(t)}get currentPageIndex(){return n(this,Eu)}addLayer(t){n(this,Au).set(t.pageIndex,t),n(this,Wu)?t.enable():t.disable()}removeLayer(t){n(this,Au).delete(t.pageIndex)}updateMode(t,e=null,i=!1){if(n(this,$u)!==t){if(r(this,$u,t),t===Jl.NONE)return this.setEditingState(!1),void o(this,Bp,Hp).call(this);this.setEditingState(!0),o(this,Wp,jp).call(this),this.unselectAll();for(const e of n(this,Au).values())e.updateMode(t);if(!e&&i)return void this.addNewEditorFromKeyboard();if(e)for(const t of n(this,wu).values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==n(this,$u)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){var i;if(n(this,Pu)){switch(t){case Ql.CREATE:return void this.currentLayer.addNewEditor();case Ql.HIGHLIGHT_DEFAULT_COLOR:null==(i=n(this,Hu))||i.updateColor(e);break;case Ql.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(n(this,qu)||r(this,qu,new Map)).set(t,e),this.showAllEditors("highlight",e)}for(const i of n(this,Uu))i.updateParams(t,e);for(const i of n(this,Pu))i.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){var s;for(const i of n(this,wu).values())i.editorType===t&&i.show(e);((null==(s=n(this,qu))?void 0:s.get(Ql.HIGHLIGHT_SHOW_ALL))??!0)!==e&&o(this,Np,Op).call(this,[[Ql.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(n(this,ju)!==t){r(this,ju,t);for(const e of n(this,Au).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}getEditors(t){const e=[];for(const i of n(this,wu).values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return n(this,wu).get(t)}addEditor(t){n(this,wu).set(t.id,t)}removeEditor(t){var e;t.div.contains(document.activeElement)&&(n(this,Iu)&&clearTimeout(n(this,Iu)),r(this,Iu,setTimeout((()=>{this.focusMainContainer(),r(this,Iu,null)}),0))),n(this,wu).delete(t.id),this.unselect(t),(!t.annotationElementId||!n(this,Cu).has(t.annotationElementId))&&(null==(e=n(this,xu))||e.remove(t.id))}addDeletedAnnotationElement(t){n(this,Cu).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return n(this,Cu).has(t)}removeDeletedAnnotationElement(t){n(this,Cu).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){n(this,yu)!==t&&(r(this,yu,t),t&&o(this,Np,Op).call(this,t.propertiesToUpdate))}updateUI(t){n(this,Up,Vp)===t&&o(this,Np,Op).call(this,t.propertiesToUpdate)}toggleSelected(t){if(n(this,Uu).has(t))return n(this,Uu).delete(t),t.unselect(),void o(this,Dp,Fp).call(this,{hasSelectedEditor:this.hasSelection});n(this,Uu).add(t),t.select(),o(this,Np,Op).call(this,t.propertiesToUpdate),o(this,Dp,Fp).call(this,{hasSelectedEditor:!0})}setSelected(t){for(const e of n(this,Uu))e!==t&&e.unselect();n(this,Uu).clear(),n(this,Uu).add(t),t.select(),o(this,Np,Op).call(this,t.propertiesToUpdate),o(this,Dp,Fp).call(this,{hasSelectedEditor:!0})}isSelected(t){return n(this,Uu).has(t)}get firstSelectedEditor(){return n(this,Uu).values().next().value}unselect(t){t.unselect(),n(this,Uu).delete(t),o(this,Dp,Fp).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==n(this,Uu).size}get isEnterHandled(){return 1===n(this,Uu).size&&this.firstSelectedEditor.isEnterHandled}undo(){n(this,ku).undo(),o(this,Dp,Fp).call(this,{hasSomethingToUndo:n(this,ku).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:o(this,Gp,qp).call(this)})}redo(){n(this,ku).redo(),o(this,Dp,Fp).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:n(this,ku).hasSomethingToRedo(),isEmpty:o(this,Gp,qp).call(this)})}addCommands(t){n(this,ku).add(t),o(this,Dp,Fp).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:o(this,Gp,qp).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...n(this,Uu)];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)o(this,zp,$p).call(this,e)},mustExec:!0})}commitOrRemove(){var t;null==(t=n(this,yu))||t.commitOrRemove()}hasSomethingToControl(){return n(this,yu)||this.hasSelection}selectAll(){for(const t of n(this,Uu))t.commit();o(this,Xp,Yp).call(this,n(this,wu).values())}unselectAll(){if((!n(this,yu)||(n(this,yu).commitOrRemove(),n(this,$u)===Jl.NONE))&&this.hasSelection){for(const t of n(this,Uu))t.unselect();n(this,Uu).clear(),o(this,Dp,Fp).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;n(this,ap)[0]+=t,n(this,ap)[1]+=e;const[s,a]=n(this,ap),o=[...n(this,Uu)];n(this,op)&&clearTimeout(n(this,op)),r(this,op,setTimeout((()=>{r(this,op,null),n(this,ap)[0]=n(this,ap)[1]=0,this.addCommands({cmd:()=>{for(const t of o)n(this,wu).has(t.id)&&t.translateInPage(s,a)},undo:()=>{for(const t of o)n(this,wu).has(t.id)&&t.translateInPage(-s,-a)},mustExec:!1})}),1e3));for(const i of o)i.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),r(this,Mu,new Map);for(const t of n(this,Uu))n(this,Mu).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!n(this,Mu))return!1;this.disableUserSelect(!1);const t=n(this,Mu);r(this,Mu,null);let e=!1;for(const[{x:i,y:n,pageIndex:s},r]of t)r.newX=i,r.newY=n,r.newPageIndex=s,e||(e=i!==r.savedX||n!==r.savedY||s!==r.savedPageIndex);if(!e)return!1;const i=(t,e,i,s)=>{if(n(this,wu).has(t.id)){const r=n(this,Au).get(s);r?t._setParentAndPosition(r,e,i):(t.pageIndex=s,t.x=e,t.y=i)}};return this.addCommands({cmd:()=>{for(const[e,{newX:n,newY:s,newPageIndex:r}]of t)i(e,n,s,r)},undo:()=>{for(const[e,{savedX:n,savedY:s,savedPageIndex:r}]of t)i(e,n,s,r)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(n(this,Mu))for(const i of n(this,Mu).keys())i.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){var t;return(null==(t=this.getActive())?void 0:t.shouldGetKeyboardEvents())||1===n(this,Uu).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return n(this,yu)===t}getActive(){return n(this,yu)}getMode(){return n(this,$u)}get imageManager(){return Hh(this,"imageManager",new ou)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let i=0,n=e.rangeCount;i<n;i++)if(!t.contains(e.getRangeAt(i).commonAncestorContainer))return null;const{x:i,y:n,width:s,height:r}=t.getBoundingClientRect();let a;switch(t.getAttribute("data-main-rotation")){case"90":a=(t,e,a,o)=>({x:(e-n)/r,y:1-(t+a-i)/s,width:o/r,height:a/s});break;case"180":a=(t,e,a,o)=>({x:1-(t+a-i)/s,y:1-(e+o-n)/r,width:a/s,height:o/r});break;case"270":a=(t,e,a,o)=>({x:1-(e+o-n)/r,y:(t-i)/s,width:o/r,height:a/s});break;default:a=(t,e,a,o)=>({x:(t-i)/s,y:(e-n)/r,width:a/s,height:o/r})}const o=[];for(let t=0,i=e.rangeCount;t<i;t++){const i=e.getRangeAt(t);if(!i.collapsed)for(const{x:t,y:e,width:n,height:s}of i.getClientRects())0===n||0===s||o.push(a(t,e,n,s))}return 0===o.length?null:o}addChangedExistingAnnotation({annotationElementId:t,id:e}){(n(this,Su)||r(this,Su,new Map)).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){var e;null==(e=n(this,Su))||e.delete(t)}renderAnnotationElement(t){var e;const i=null==(e=n(this,Su))?void 0:e.get(t.data.id);if(!i)return;const s=n(this,xu).getRawValue(i);s&&(n(this,$u)===Jl.NONE&&!s.hasBeenModified||s.renderAnnotationElement(t))}};let Jp=Kp;var Qp,Zp,tf,ef,nf,sf,rf,af,of;bu=new WeakMap,yu=new WeakMap,wu=new WeakMap,Au=new WeakMap,_u=new WeakMap,xu=new WeakMap,Su=new WeakMap,ku=new WeakMap,Eu=new WeakMap,Cu=new WeakMap,Mu=new WeakMap,Pu=new WeakMap,Ru=new WeakMap,Tu=new WeakMap,Lu=new WeakMap,Iu=new WeakMap,Du=new WeakMap,Fu=new WeakMap,Nu=new WeakMap,Ou=new WeakMap,Wu=new WeakMap,ju=new WeakMap,Bu=new WeakMap,Hu=new WeakMap,zu=new WeakMap,$u=new WeakMap,Uu=new WeakMap,Vu=new WeakMap,Gu=new WeakMap,qu=new WeakMap,Xu=new WeakMap,Yu=new WeakMap,Ku=new WeakMap,Ju=new WeakMap,Qu=new WeakMap,Zu=new WeakMap,tp=new WeakMap,ep=new WeakMap,ip=new WeakMap,np=new WeakMap,sp=new WeakMap,rp=new WeakMap,ap=new WeakMap,op=new WeakMap,lp=new WeakMap,hp=new WeakMap,cp=new WeakSet,dp=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},up=new WeakSet,pp=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=o(this,cp,dp).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(n(this,Nu)||r(this,Nu,new nu(this)),n(this,Nu).show(e,i,"ltr"===this.direction))},fp=new WeakSet,gp=function(){var t,e,i;const s=document.getSelection();if(!s||s.isCollapsed)return void(n(this,Vu)&&(null==(t=n(this,Nu))||t.hide(),r(this,Vu,null),o(this,Dp,Fp).call(this,{hasSelectedText:!1})));const{anchorNode:a}=s;if(a!==n(this,Vu))if(o(this,cp,dp).call(this,s).closest(".textLayer")){if(null==(i=n(this,Nu))||i.hide(),r(this,Vu,a),o(this,Dp,Fp).call(this,{hasSelectedText:!0}),(n(this,$u)===Jl.HIGHLIGHT||n(this,$u)===Jl.NONE)&&(n(this,$u)===Jl.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),r(this,Fu,this.isShiftKeyDown),!this.isShiftKeyDown)){const t=this._signal,e=t=>{"pointerup"===t.type&&0!==t.button||(window.removeEventListener("pointerup",e),window.removeEventListener("blur",e),"pointerup"===t.type&&o(this,mp,vp).call(this,"main_toolbar"))};window.addEventListener("pointerup",e,{signal:t}),window.addEventListener("blur",e,{signal:t})}}else n(this,Vu)&&(null==(e=n(this,Nu))||e.hide(),r(this,Vu,null),o(this,Dp,Fp).call(this,{hasSelectedText:!1}))},mp=new WeakSet,vp=function(t=""){n(this,$u)===Jl.HIGHLIGHT?this.highlightSelection(t):n(this,Tu)&&o(this,up,pp).call(this)},bp=new WeakSet,yp=function(){document.addEventListener("selectionchange",o(this,fp,gp).bind(this),{signal:this._signal})},wp=new WeakSet,Ap=function(){const t=this._signal;window.addEventListener("focus",n(this,Yu),{signal:t}),window.addEventListener("blur",n(this,Xu),{signal:t})},_p=new WeakSet,xp=function(){window.removeEventListener("focus",n(this,Yu)),window.removeEventListener("blur",n(this,Xu))},Sp=new WeakSet,kp=function(){const t=this._signal;window.addEventListener("keydown",n(this,Zu),{signal:t}),window.addEventListener("keyup",n(this,tp),{signal:t})},Ep=new WeakSet,Cp=function(){window.removeEventListener("keydown",n(this,Zu)),window.removeEventListener("keyup",n(this,tp))},Mp=new WeakSet,Pp=function(){const t=this._signal;document.addEventListener("copy",n(this,Ku),{signal:t}),document.addEventListener("cut",n(this,Ju),{signal:t}),document.addEventListener("paste",n(this,Qu),{signal:t})},Rp=new WeakSet,Tp=function(){document.removeEventListener("copy",n(this,Ku)),document.removeEventListener("cut",n(this,Ju)),document.removeEventListener("paste",n(this,Qu))},Lp=new WeakSet,Ip=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},Dp=new WeakSet,Fp=function(t){Object.entries(t).some((([t,e])=>n(this,rp)[t]!==e))&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(n(this,rp),t)}),n(this,$u)===Jl.HIGHLIGHT&&!1===t.hasSelectedEditor&&o(this,Np,Op).call(this,[[Ql.HIGHLIGHT_FREE,!0]]))},Np=new WeakSet,Op=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},Wp=new WeakSet,jp=function(){if(!n(this,Wu)){r(this,Wu,!0);for(const t of n(this,Au).values())t.enable();for(const t of n(this,wu).values())t.enable()}},Bp=new WeakSet,Hp=function(){if(this.unselectAll(),n(this,Wu)){r(this,Wu,!1);for(const t of n(this,Au).values())t.disable();for(const t of n(this,wu).values())t.disable()}},zp=new WeakSet,$p=function(t){const e=n(this,Au).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},Up=new WeakSet,Vp=function(){let t=null;for(t of n(this,Uu));return t},Gp=new WeakSet,qp=function(){if(0===n(this,wu).size)return!0;if(1===n(this,wu).size)for(const t of n(this,wu).values())return t.isEmpty();return!1},Xp=new WeakSet,Yp=function(t){for(const t of n(this,Uu))t.unselect();n(this,Uu).clear();for(const e of t)e.isEmpty()||(n(this,Uu).add(e),e.select());o(this,Dp,Fp).call(this,{hasSelectedEditor:this.hasSelection})},e(Jp,"TRANSLATE_SMALL",1),e(Jp,"TRANSLATE_BIG",10);const lf=class{constructor(t){s(this,af),s(this,Qp,""),s(this,Zp,!1),s(this,tf,null),s(this,ef,null),s(this,nf,null),s(this,sf,!1),s(this,rf,null),r(this,rf,t)}static initialize(t){lf._l10nPromise||(lf._l10nPromise=t)}async render(){const t=r(this,tf,document.createElement("button"));t.className="altText";const e=await lf._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0";const i=n(this,rf)._uiManager._signal;t.addEventListener("contextmenu",gd,{signal:i}),t.addEventListener("pointerdown",(t=>t.stopPropagation()),{signal:i});const s=t=>{t.preventDefault(),n(this,rf)._uiManager.editAltText(n(this,rf))};return t.addEventListener("click",s,{capture:!0,signal:i}),t.addEventListener("keydown",(e=>{e.target===t&&"Enter"===e.key&&(r(this,sf,!0),s(e))}),{signal:i}),await o(this,af,of).call(this),t}finish(){n(this,tf)&&(n(this,tf).focus({focusVisible:n(this,sf)}),r(this,sf,!1))}isEmpty(){return!n(this,Qp)&&!n(this,Zp)}get data(){return{altText:n(this,Qp),decorative:n(this,Zp)}}set data({altText:t,decorative:e}){n(this,Qp)===t&&n(this,Zp)===e||(r(this,Qp,t),r(this,Zp,e),o(this,af,of).call(this))}toggle(t=!1){n(this,tf)&&(!t&&n(this,nf)&&(clearTimeout(n(this,nf)),r(this,nf,null)),n(this,tf).disabled=!t)}destroy(){var t;null==(t=n(this,tf))||t.remove(),r(this,tf,null),r(this,ef,null)}};let hf=lf;var cf,df,uf,pf,ff,gf,mf,vf,bf,yf,wf,Af,_f,xf,Sf,kf,Ef,Cf,Mf,Pf,Rf,Tf,Lf,If,Df,Ff,Nf,Of,Wf,jf,Bf,Hf,zf,$f,Uf,Vf,Gf,qf,Xf,Yf,Kf,Jf,Qf,Zf,tg,eg,ig,ng,sg,rg;Qp=new WeakMap,Zp=new WeakMap,tf=new WeakMap,ef=new WeakMap,nf=new WeakMap,sf=new WeakMap,rf=new WeakMap,af=new WeakSet,of=async function(){var t;const e=n(this,tf);if(!e)return;if(!n(this,Qp)&&!n(this,Zp))return e.classList.remove("done"),void(null==(t=n(this,ef))||t.remove());e.classList.add("done"),lf._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then((t=>{e.setAttribute("aria-label",t)}));let i=n(this,ef);if(!i){r(this,ef,i=document.createElement("span")),i.className="tooltip",i.setAttribute("role","tooltip");const t=i.id=`alt-text-tooltip-${n(this,rf).id}`;e.setAttribute("aria-describedby",t);const s=100,a=n(this,rf)._uiManager._signal;a.addEventListener("abort",(()=>{clearTimeout(n(this,nf)),r(this,nf,null)}),{once:!0}),e.addEventListener("mouseenter",(()=>{r(this,nf,setTimeout((()=>{r(this,nf,null),n(this,ef).classList.add("show"),n(this,rf)._reportTelemetry({action:"alt_text_tooltip"})}),s))}),{signal:a}),e.addEventListener("mouseleave",(()=>{var t;n(this,nf)&&(clearTimeout(n(this,nf)),r(this,nf,null)),null==(t=n(this,ef))||t.classList.remove("show")}),{signal:a})}i.innerText=n(this,Zp)?await lf._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):n(this,Qp),i.parentNode||e.append(i);const s=n(this,rf).getImageForAltText();null==s||s.setAttribute("aria-describedby",i.id)},e(hf,"_l10nPromise",null);const ag=class{constructor(t){s(this,Lf),s(this,Nf),s(this,Wf),s(this,Bf),s(this,zf),s(this,Uf),s(this,Gf),s(this,Xf),s(this,Kf),s(this,Qf),s(this,tg),s(this,ig),s(this,sg),s(this,cf,null),s(this,df,null),s(this,uf,null),s(this,pf,!1),s(this,ff,!1),s(this,gf,null),s(this,mf,null),s(this,vf,this.focusin.bind(this)),s(this,bf,this.focusout.bind(this)),s(this,yf,null),s(this,wf,""),s(this,Af,!1),s(this,_f,null),s(this,xf,!1),s(this,Sf,!1),s(this,kf,!1),s(this,Ef,null),s(this,Cf,0),s(this,Mf,0),s(this,Pf,null),e(this,"_initialOptions",Object.create(null)),e(this,"_isVisible",!0),e(this,"_uiManager",null),e(this,"_focusEventsAllowed",!0),e(this,"_l10nPromise",null),s(this,Rf,!1),s(this,Tf,ag._zIndex++),this.constructor===ag&&Wh("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:i,rawDims:{pageWidth:n,pageHeight:r,pageX:a,pageY:o}}=this.parent.viewport;this.rotation=i,this.pageRotation=(360+i-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,r],this.pageTranslation=[a,o];const[l,h]=this.parentDimensions;this.x=t.x/l,this.y=t.y/h,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const t=ag.prototype._resizeWithKeyboard,e=Jp.TRANSLATE_SMALL,i=Jp.TRANSLATE_BIG;return Hh(this,"_resizerKeyboardManager",new gu([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],ag.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return Hh(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new lg({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e,i){if(ag._l10nPromise||(ag._l10nPromise=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map((e=>[e,t.get(e.replaceAll(/([A-Z])/g,(t=>`-${t.toLowerCase()}`)))])))),null!=i&&i.strings)for(const e of i.strings)ag._l10nPromise.set(e,t.get(e));if(-1!==ag._borderLineWidth)return;const n=getComputedStyle(document.documentElement);ag._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Wh("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return n(this,Rf)}set _isDraggable(t){var e;r(this,Rf,t),null==(e=this.div)||e.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=n(this,Tf)}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):o(this,sg,rg).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&(n(this,Af)?r(this,Af,!1):this.parent.setSelected(this))}focusout(t){var e;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const i=t.relatedTarget;null!=i&&i.closest(`#${this.id}`)||(t.preventDefault(),null!=(e=this.parent)&&e.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,n){const[s,r]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(t+i)/s,this.y=(e+n)/r,this.fixAndSetPosition()}translate(t,e){o(this,Lf,If).call(this,this.parentDimensions,t,e)}translateInPage(t,e){n(this,_f)||r(this,_f,[this.x,this.y]),o(this,Lf,If).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){n(this,_f)||r(this,_f,[this.x,this.y]);const[i,s]=this.parentDimensions;if(this.x+=t/i,this.y+=e/s,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this;const[l,h]=this.getBaseTranslation();a+=l,o+=h,this.div.style.left=`${(100*a).toFixed(2)}%`,this.div.style.top=`${(100*o).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!n(this,_f)&&(n(this,_f)[0]!==this.x||n(this,_f)[1]!==this.y)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=ag,n=i/t,s=i/e;switch(this.rotation){case 90:return[-n,s];case 180:return[n,s];case 270:return[n,-s];default:return[-n,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const[e,i]=this.pageDimensions;let{x:n,y:s,width:r,height:a}=this;if(r*=e,a*=i,n*=e,s*=i,this._mustFixPosition)switch(t){case 0:n=Math.max(0,Math.min(e-r,n)),s=Math.max(0,Math.min(i-a,s));break;case 90:n=Math.max(0,Math.min(e-a,n)),s=Math.min(i,Math.max(r,s));break;case 180:n=Math.min(e,Math.max(r,n)),s=Math.min(i,Math.max(a,s));break;case 270:n=Math.min(e,Math.max(a,n)),s=Math.max(0,Math.min(i-r,s))}this.x=n/=e,this.y=s/=i;const[o,l]=this.getBaseTranslation();n+=o,s+=l;const{style:h}=this.div;h.left=`${(100*n).toFixed(2)}%`,h.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(t,e){var i;return o(i=ag,Df,Ff).call(i,t,e,this.parentRotation)}pageTranslationToScreen(t,e){var i;return o(i=ag,Df,Ff).call(i,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this,n=e*t,s=i*t;return Zh.isCSSRoundSupported?[Math.round(n),Math.round(s)]:[n,s]}setDims(t,e){const[i,s]=this.parentDimensions;this.div.style.width=`${(100*t/i).toFixed(2)}%`,n(this,ff)||(this.div.style.height=`${(100*e/s).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,s=i.endsWith("%"),r=!n(this,ff)&&e.endsWith("%");if(s&&r)return;const[a,o]=this.parentDimensions;s||(t.width=`${(100*parseFloat(i)/a).toFixed(2)}%`),!n(this,ff)&&!r&&(t.height=`${(100*parseFloat(e)/o).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}altTextFinish(){var t;null==(t=n(this,uf))||t.finish()}async addEditToolbar(){return n(this,yf)||n(this,Sf)||(r(this,yf,new Hd(this)),this.div.append(n(this,yf).render()),n(this,uf)&&n(this,yf).addAltTextButton(await n(this,uf).render())),n(this,yf)}removeEditToolbar(){var t;n(this,yf)&&(n(this,yf).remove(),r(this,yf,null),null==(t=n(this,uf))||t.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){n(this,uf)||(hf.initialize(ag._l10nPromise),r(this,uf,new hf(this)),n(this,cf)&&(n(this,uf).data=n(this,cf),r(this,cf,null)),await this.addEditToolbar())}get altTextData(){var t;return null==(t=n(this,uf))?void 0:t.data}set altTextData(t){n(this,uf)&&(n(this,uf).data=t)}hasAltText(){var t;return!(null!=(t=n(this,uf))&&t.isEmpty())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=n(this,pf)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",n(this,vf),{signal:t}),this.div.addEventListener("focusout",n(this,bf),{signal:t});const[e,i]=this.parentDimensions;this.parentRotation%180!=0&&(this.div.style.maxWidth=`${(100*i/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/i).toFixed(2)}%`);const[s,r]=this.getInitialTranslation();return this.translate(s,r),su(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=Zh.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(r(this,Af,!0),this._isDraggable?o(this,Xf,Yf).call(this,t):o(this,Gf,qf).call(this,t))}moveInDOM(){n(this,Ef)&&clearTimeout(n(this,Ef)),r(this,Ef,setTimeout((()=>{var t;r(this,Ef,null),null==(t=this.parent)||t.moveEditorInDOM(this)}),0))}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition()}getRect(t,e,i=this.rotation){const n=this.parentScale,[s,r]=this.pageDimensions,[a,o]=this.pageTranslation,l=t/n,h=e/n,c=this.x*s,d=this.y*r,u=this.width*s,p=this.height*r;switch(i){case 0:return[c+l+a,r-d-h-p+o,c+l+u+a,r-d-h+o];case 90:return[c+h+a,r-d+l+o,c+h+p+a,r-d+l+u+o];case 180:return[c-l-u+a,r-d+h+o,c-l+a,r-d+h+p+o];case 270:return[c-h-p+a,r-d-l-u+o,c-h+a,r-d-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,s,r]=t,a=s-i,o=r-n;switch(this.rotation){case 0:return[i,e-r,a,o];case 90:return[i,e-n,o,a];case 180:return[s,e-n,a,o];case 270:return[s,e-r,o,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){r(this,Sf,!0)}disableEditMode(){r(this,Sf,!1)}isInEditMode(){return n(this,Sf)}shouldGetKeyboardEvents(){return n(this,kf)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t,e;const i=this._uiManager._signal;null==(t=this.div)||t.addEventListener("focusin",n(this,vf),{signal:i}),null==(e=this.div)||e.addEventListener("focusout",n(this,bf),{signal:i})}rotate(t){}serialize(t=!1,e=null){Wh("An editor must be serializable")}static deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});n.rotation=t.rotation,r(n,cf,t.accessibilityData);const[s,a]=n.pageDimensions,[o,l,h,c]=n.getRectInCurrentCoords(t.rect,a);return n.x=o/s,n.y=l/a,n.width=h/s,n.height=c/a,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.div.removeEventListener("focusin",n(this,vf)),this.div.removeEventListener("focusout",n(this,bf)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),n(this,Ef)&&(clearTimeout(n(this,Ef)),r(this,Ef,null)),o(this,sg,rg).call(this),this.removeEditToolbar(),n(this,Pf)){for(const t of n(this,Pf).values())clearTimeout(t);r(this,Pf,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(o(this,Wf,jf).call(this),n(this,gf).classList.remove("hidden"),su(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),r(this,mf,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=n(this,gf).children;if(!n(this,df)){r(this,df,Array.from(e));const t=o(this,Kf,Jf).bind(this),i=o(this,Qf,Zf).bind(this),s=this._uiManager._signal;for(const e of n(this,df)){const n=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:s}),e.addEventListener("blur",i,{signal:s}),e.addEventListener("focus",o(this,tg,eg).bind(this,n),{signal:s}),ag._l10nPromise.get(`pdfjs-editor-resizer-label-${n}`).then((t=>e.setAttribute("aria-label",t)))}}const i=n(this,df)[0];let s=0;for(const t of e){if(t===i)break;s++}const a=(360-this.rotation+this.parentRotation)%360/90*(n(this,df).length/4);if(a!==s){if(a<s)for(let t=0;t<s-a;t++)n(this,gf).append(n(this,gf).firstChild);else if(a>s)for(let t=0;t<a-s;t++)n(this,gf).firstChild.before(n(this,gf).lastChild);let t=0;for(const i of e){const e=n(this,df)[t++].getAttribute("data-resizer-name");ag._l10nPromise.get(`pdfjs-editor-resizer-label-${e}`).then((t=>i.setAttribute("aria-label",t)))}}o(this,ig,ng).call(this,0),r(this,kf,!0),n(this,gf).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){n(this,kf)&&o(this,Uf,Vf).call(this,n(this,wf),{movementX:t,movementY:e})}_stopResizingWithKeyboard(){o(this,sg,rg).call(this),this.div.focus()}select(){var t,e;this.makeResizable(),null==(t=this.div)||t.classList.add("selectedEditor"),n(this,yf)?null==(e=n(this,yf))||e.show():this.addEditToolbar().then((()=>{var t,e;null!=(t=this.div)&&t.classList.contains("selectedEditor")&&(null==(e=n(this,yf))||e.show())}))}unselect(){var t,e,i,s;null==(t=n(this,gf))||t.classList.add("hidden"),null==(e=this.div)||e.classList.remove("selectedEditor"),null!=(i=this.div)&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),null==(s=n(this,yf))||s.hide()}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return n(this,xf)}set isEditing(t){r(this,xf,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){r(this,ff,!0);const i=t/e,{style:n}=this.div;n.aspectRatio=i,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){n(this,Pf)||r(this,Pf,new Map);const{action:e}=t;let i=n(this,Pf).get(e);return i&&clearTimeout(i),i=setTimeout((()=>{this._reportTelemetry(t),n(this,Pf).delete(e),0===n(this,Pf).size&&r(this,Pf,null)}),ag._telemetryTimeout),void n(this,Pf).set(e,i)}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),r(this,pf,!1)}disable(){this.div&&(this.div.tabIndex=-1),r(this,pf,!0)}renderAnnotationElement(t){let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.before(e)}}else e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){const{firstChild:e}=t.container;"DIV"===e.nodeName&&e.classList.contains("annotationContent")&&e.remove()}};let og=ag;cf=new WeakMap,df=new WeakMap,uf=new WeakMap,pf=new WeakMap,ff=new WeakMap,gf=new WeakMap,mf=new WeakMap,vf=new WeakMap,bf=new WeakMap,yf=new WeakMap,wf=new WeakMap,Af=new WeakMap,_f=new WeakMap,xf=new WeakMap,Sf=new WeakMap,kf=new WeakMap,Ef=new WeakMap,Cf=new WeakMap,Mf=new WeakMap,Pf=new WeakMap,Rf=new WeakMap,Tf=new WeakMap,Lf=new WeakSet,If=function([t,e],i,n){[i,n]=this.screenToPageTranslation(i,n),this.x+=i/t,this.y+=n/e,this.fixAndSetPosition()},Df=new WeakSet,Ff=function(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}},Nf=new WeakSet,Of=function(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}},Wf=new WeakSet,jf=function(){if(n(this,gf))return;r(this,gf,document.createElement("div")),n(this,gf).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const t=document.createElement("div");n(this,gf).append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",o(this,Bf,Hf).bind(this,i),{signal:e}),t.addEventListener("contextmenu",gd,{signal:e}),t.tabIndex=-1}this.div.prepend(n(this,gf))},Bf=new WeakSet,Hf=function(t,e){var i;e.preventDefault();const{isMac:s}=Zh.platform;if(0!==e.button||e.ctrlKey&&s)return;null==(i=n(this,uf))||i.toggle(!1);const r=o(this,Uf,Vf).bind(this,t),a=this._isDraggable;this._isDraggable=!1;const l=this._uiManager._signal,h={passive:!0,capture:!0,signal:l};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",r,h),window.addEventListener("contextmenu",gd,{signal:l});const c=this.x,d=this.y,u=this.width,p=this.height,f=this.parent.div.style.cursor,g=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const m=()=>{var t;this.parent.togglePointerEvents(!0),null==(t=n(this,uf))||t.toggle(!0),this._isDraggable=a,window.removeEventListener("pointerup",m),window.removeEventListener("blur",m),window.removeEventListener("pointermove",r,h),window.removeEventListener("contextmenu",gd),this.parent.div.style.cursor=f,this.div.style.cursor=g,o(this,zf,$f).call(this,c,d,u,p)};window.addEventListener("pointerup",m,{signal:l}),window.addEventListener("blur",m,{signal:l})},zf=new WeakSet,$f=function(t,e,i,n){const s=this.x,r=this.y,a=this.width,o=this.height;s===t&&r===e&&a===i&&o===n||this.addCommands({cmd:()=>{this.width=a,this.height=o,this.x=s,this.y=r;const[t,e]=this.parentDimensions;this.setDims(t*a,e*o),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=n,this.x=t,this.y=e;const[s,r]=this.parentDimensions;this.setDims(s*i,r*n),this.fixAndSetPosition()},mustExec:!0})},Uf=new WeakSet,Vf=function(t,e){const[i,n]=this.parentDimensions,s=this.x,r=this.y,a=this.width,l=this.height,h=ag.MIN_SIZE/i,c=ag.MIN_SIZE/n,d=t=>Math.round(1e4*t)/1e4,u=o(this,Nf,Of).call(this,this.rotation),p=(t,e)=>[u[0]*t+u[2]*e,u[1]*t+u[3]*e],f=o(this,Nf,Of).call(this,360-this.rotation);let g,m,v=!1,b=!1;switch(t){case"topLeft":v=!0,g=(t,e)=>[0,0],m=(t,e)=>[t,e];break;case"topMiddle":g=(t,e)=>[t/2,0],m=(t,e)=>[t/2,e];break;case"topRight":v=!0,g=(t,e)=>[t,0],m=(t,e)=>[0,e];break;case"middleRight":b=!0,g=(t,e)=>[t,e/2],m=(t,e)=>[0,e/2];break;case"bottomRight":v=!0,g=(t,e)=>[t,e],m=(t,e)=>[0,0];break;case"bottomMiddle":g=(t,e)=>[t/2,e],m=(t,e)=>[t/2,0];break;case"bottomLeft":v=!0,g=(t,e)=>[0,e],m=(t,e)=>[t,0];break;case"middleLeft":b=!0,g=(t,e)=>[0,e/2],m=(t,e)=>[t,e/2]}const y=g(a,l),w=m(a,l);let A=p(...w);const _=d(s+A[0]),x=d(r+A[1]);let S=1,k=1,[E,C]=this.screenToPageTranslation(e.movementX,e.movementY);if([E,C]=(M=E/i,P=C/n,[f[0]*M+f[2]*P,f[1]*M+f[3]*P]),v){const t=Math.hypot(a,l);S=k=Math.max(Math.min(Math.hypot(w[0]-y[0]-E,w[1]-y[1]-C)/t,1/a,1/l),h/a,c/l)}else b?S=Math.max(h,Math.min(1,Math.abs(w[0]-y[0]-E)))/a:k=Math.max(c,Math.min(1,Math.abs(w[1]-y[1]-C)))/l;var M,P;const R=d(a*S),T=d(l*k);A=p(...m(R,T));const L=_-A[0],I=x-A[1];this.width=R,this.height=T,this.x=L,this.y=I,this.setDims(i*R,n*T),this.fixAndSetPosition()},Gf=new WeakSet,qf=function(t){const{isMac:e}=Zh.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},Xf=new WeakSet,Yf=function(t){const e=this._uiManager.isSelected(this);let i,s;this._uiManager.setUpDragSession();const a=this._uiManager._signal;e&&(this.div.classList.add("moving"),i={passive:!0,capture:!0,signal:a},r(this,Cf,t.clientX),r(this,Mf,t.clientY),s=t=>{const{clientX:e,clientY:i}=t,[s,a]=this.screenToPageTranslation(e-n(this,Cf),i-n(this,Mf));r(this,Cf,e),r(this,Mf,i),this._uiManager.dragSelectedEditors(s,a)},window.addEventListener("pointermove",s,i));const l=()=>{window.removeEventListener("pointerup",l),window.removeEventListener("blur",l),e&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",s,i)),r(this,Af,!1),this._uiManager.endDragSession()||o(this,Gf,qf).call(this,t)};window.addEventListener("pointerup",l,{signal:a}),window.addEventListener("blur",l,{signal:a})},Kf=new WeakSet,Jf=function(t){ag._resizerKeyboardManager.exec(this,t)},Qf=new WeakSet,Zf=function(t){var e;n(this,kf)&&(null==(e=t.relatedTarget)?void 0:e.parentNode)!==n(this,gf)&&o(this,sg,rg).call(this)},tg=new WeakSet,eg=function(t){r(this,wf,n(this,kf)?t:"")},ig=new WeakSet,ng=function(t){if(n(this,df))for(const e of n(this,df))e.tabIndex=t},sg=new WeakSet,rg=function(){if(r(this,kf,!1),o(this,ig,ng).call(this,-1),n(this,mf)){const{savedX:t,savedY:e,savedWidth:i,savedHeight:s}=n(this,mf);o(this,zf,$f).call(this,t,e,i,s),r(this,mf,null)}},s(og,Df),e(og,"_borderLineWidth",-1),e(og,"_colorManager",new vu),e(og,"_zIndex",1),e(og,"_telemetryTimeout",1e3);class lg extends og{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const hg=3285377520,cg=4294901760,dg=65535;class ug{constructor(t){this.h1=t?4294967295&t:hg,this.h2=t?4294967295&t:hg}update(t){let e,i;if("string"==typeof t){e=new Uint8Array(2*t.length),i=0;for(let n=0,s=t.length;n<s;n++){const s=t.charCodeAt(n);s<=255?e[i++]=s:(e[i++]=s>>>8,e[i++]=255&s)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice(),i=e.byteLength}const n=i>>2,s=i-4*n,r=new Uint32Array(e.buffer,0,n);let a=0,o=0,l=this.h1,h=this.h2;const c=3432918353,d=461845907,u=c&dg,p=d&dg;for(let t=0;t<n;t++)1&t?(a=r[t],a=a*c&cg|a*u&dg,a=a<<15|a>>>17,a=a*d&cg|a*p&dg,l^=a,l=l<<13|l>>>19,l=5*l+3864292196):(o=r[t],o=o*c&cg|o*u&dg,o=o<<15|o>>>17,o=o*d&cg|o*p&dg,h^=o,h=h<<13|h>>>19,h=5*h+3864292196);switch(a=0,s){case 3:a^=e[4*n+2]<<16;case 2:a^=e[4*n+1]<<8;case 1:a^=e[4*n],a=a*c&cg|a*u&dg,a=a<<15|a>>>17,a=a*d&cg|a*p&dg,1&n?l^=a:h^=a}this.h1=l,this.h2=h}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&cg|36045*t&dg,e=4283543511*e&cg|(2950163797*(e<<16|t>>>16)&cg)>>>16,t^=e>>>1,t=444984403*t&cg|60499*t&dg,e=3301882366*e&cg|(3120437893*(e<<16|t>>>16)&cg)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const pg=Object.freeze({map:null,hash:"",transfer:void 0});var fg,gg,mg,vg,bg,yg;class wg{constructor(){s(this,mg),s(this,fg,!1),s(this,gg,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=n(this,gg).get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return n(this,gg).get(t)}remove(t){if(n(this,gg).delete(t),0===n(this,gg).size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const t of n(this,gg).values())if(t instanceof og)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=n(this,gg).get(t);let s=!1;if(void 0!==i)for(const[t,n]of Object.entries(e))i[t]!==n&&(s=!0,i[t]=n);else s=!0,n(this,gg).set(t,e);s&&o(this,mg,vg).call(this),e instanceof og&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return n(this,gg).has(t)}getAll(){return n(this,gg).size>0?Qh(n(this,gg)):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return n(this,gg).size}resetModified(){n(this,fg)&&(r(this,fg,!1),"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new Ag(this)}get serializable(){if(0===n(this,gg).size)return pg;const t=new Map,e=new ug,i=[],s=Object.create(null);let r=!1;for(const[i,a]of n(this,gg)){const n=a instanceof og?a.serialize(!1,s):a;n&&(t.set(i,n),e.update(`${i}:${JSON.stringify(n)}`),r||(r=!!n.bitmap))}if(r)for(const e of t.values())e.bitmap&&i.push(e.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:pg}get editorStats(){let t=null;const e=new Map;for(const i of n(this,gg).values()){if(!(i instanceof og))continue;const n=i.telemetryFinalData;if(!n)continue;const{type:s}=n;e.has(s)||e.set(s,Object.getPrototypeOf(i).constructor),t||(t=Object.create(null));const r=t[s]||(t[s]=new Map);for(const[t,e]of Object.entries(n)){if("type"===t)continue;let i=r.get(t);i||(i=new Map,r.set(t,i));const n=i.get(e)??0;i.set(e,n+1)}}for(const[i,n]of e)t[i]=n.computeTelemetryFinalData(t[i]);return t}}fg=new WeakMap,gg=new WeakMap,mg=new WeakSet,vg=function(){n(this,fg)||(r(this,fg,!0),"function"==typeof this.onSetModified&&this.onSetModified())};class Ag extends wg{constructor(t){super(),s(this,bg,void 0);const{map:e,hash:i,transfer:n}=t.serializable,a=structuredClone(e,n?{transfer:n}:null);r(this,bg,{map:a,hash:i,transfer:n})}get print(){Wh("Should not call PrintAnnotationStorage.print")}get serializable(){return n(this,bg)}}bg=new WeakMap;class _g{constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){s(this,yg,new Set),this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),n(this,yg).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,_inspectFont:e}){if(t&&!n(this,yg).has(t.loadedName)){if(jh(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:s,style:r}=t,a=new FontFace(i,s,r);this.addNativeFontFace(a);try{await a.load(),n(this,yg).add(i),null==e||e(t)}catch{Oh(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}Wh("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void await this.loadSystemFont(t);if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw Oh(`Failed to load font '${e.family}': '${i}'.`),t.disableFontFace=!0,i}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise((e=>{const i=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,i)}))}}get isFontLoadingAPISupported(){var t;return Hh(this,"isFontLoadingAPISupported",!(null==(t=this._document)||!t.fonts))}get isSyncFontLoadingSupported(){let t=!1;return(jl||typeof navigator<"u"&&"string"==typeof(null==navigator?void 0:navigator.userAgent)&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),Hh(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(jh(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(i),i}get _loadTestFont(){return Hh(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e){function i(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function n(t,e,i,n){return t.substring(0,e)+n+t.substring(e+i)}let s,r;const a=this._document.createElement("canvas");a.width=1,a.height=1;const o=a.getContext("2d");let l=0;const h=`lt${Date.now()}${this.loadTestFontId++}`;let c=this._loadTestFont;c=n(c,976,h.length,h);const d=1482184792;let u=i(c,16);for(s=0,r=h.length-3;s<r;s+=4)u=u-d+i(h,s)|0;var p;s<h.length&&(u=u-d+i(h+"XXX",s)|0),c=n(c,16,4,(p=u,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));const f=`@font-face {font-family:"${h}";src:${`url(data:font/opentype;base64,${btoa(c)});`}}`;this.insertRule(f);const g=this._document.createElement("div");g.style.visibility="hidden",g.style.width=g.style.height="10px",g.style.position="absolute",g.style.top=g.style.left="0px";for(const e of[t.loadedName,h]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=e,g.append(t)}this._document.body.append(g),function t(e,i){if(++l>30)return Oh("Load test font never loaded."),void i();o.font="30px "+e,o.fillText(".",0,20),o.getImageData(0,0,1,1).data[3]>0?i():setTimeout(t.bind(null,e,i))}(h,(()=>{g.remove(),e.complete()}))}}yg=new WeakMap;class xg{constructor(t,{disableFontFace:e=!1,inspectFont:i=null}){this.compiledGlyphs=Object.create(null);for(const e in t)this[e]=t[e];this.disableFontFace=!0===e,this._inspectFont=i}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return null==(t=this._inspectFont)||t.call(this,this),e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e=Kh(this.data),i=`url(data:${this.mimetype};base64,${btoa(e)});`;let n;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${i}}`}else n=`@font-face {font-family:"${this.loadedName}";src:${i}}`;return null==(t=this._inspectFont)||t.call(this,this,i),n}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(t){Oh(`getPathGenerator - ignoring character: "${t}".`)}if(!Array.isArray(i)||0===i.length)return this.compiledGlyphs[e]=function(t,e){};const n=[];for(let t=0,e=i.length;t<e;)switch(i[t++]){case cc:{const[e,s,r,a,o,l]=i.slice(t,t+6);n.push((t=>t.bezierCurveTo(e,s,r,a,o,l))),t+=6}break;case dc:{const[e,s]=i.slice(t,t+2);n.push((t=>t.moveTo(e,s))),t+=2}break;case uc:{const[e,s]=i.slice(t,t+2);n.push((t=>t.lineTo(e,s))),t+=2}break;case pc:{const[e,s,r,a]=i.slice(t,t+4);n.push((t=>t.quadraticCurveTo(e,s,r,a))),t+=4}break;case fc:n.push((t=>t.restore()));break;case gc:n.push((t=>t.save()));break;case mc:jh(2===n.length,"Scale command is only valid at the third position.");break;case vc:{const[e,s,r,a,o,l]=i.slice(t,t+6);n.push((t=>t.transform(e,s,r,a,o,l))),t+=6}break;case bc:{const[e,s]=i.slice(t,t+2);n.push((t=>t.translate(e,s))),t+=2}}return this.compiledGlyphs[e]=function(t,e){n[0](t),n[1](t),t.scale(e,-e);for(let e=2,i=n.length;e<i;e++)n[e](t)}}}if(jl){var Sg=Promise.withResolvers(),kg=null;(async()=>{const t=await import("./__vite-browser-external-afb87ea8.js"),e=await import("./__vite-browser-external-afb87ea8.js"),i=await import("./__vite-browser-external-afb87ea8.js"),n=await import("./__vite-browser-external-afb87ea8.js");return new Map(Object.entries({fs:t,http:e,https:i,url:n,canvas:undefined,path2d:undefined}))})().then((t=>{kg=t,Sg.resolve()}),(t=>{Oh(`loadPackages: ${t}`),kg=new Map,Sg.resolve()}))}class Eg{static get promise(){return Sg.promise}static get(t){return null==kg?void 0:kg.get(t)}}const Cg=function(t){return Eg.get("fs").promises.readFile(t).then((t=>new Uint8Array(t)))};const Mg="Fill",Pg="Stroke",Rg="Shading";function Tg(t,e){if(!e)return;const i=e[2]-e[0],n=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],i,n),t.clip(s)}class Lg{constructor(){this.constructor===Lg&&Wh("Cannot initialize BaseShadingPattern.")}getPattern(){Wh("Abstract method `getPattern` called.")}}class Ig extends Lg{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(t,e,i,n){let s;if(n===Pg||n===Mg){const r=e.current.getClippedPathBoundingBox(n,Ad(t))||[0,0,0,0],a=Math.ceil(r[2]-r[0])||1,o=Math.ceil(r[3]-r[1])||1,l=e.cachedCanvases.getCanvas("pattern",a,o,!0),h=l.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-r[0],-r[1]),i=rc.transform(i,[1,0,0,1,r[0],r[1]]),h.transform(...e.baseTransform),this.matrix&&h.transform(...this.matrix),Tg(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),s=t.createPattern(l.canvas,"no-repeat");const c=new DOMMatrix(i);s.setTransform(c)}else Tg(t,this._bbox),s=this._createGradient(t);return s}}function Dg(t,e,i,n,s,r,a,o){const l=e.coords,h=e.colors,c=t.data,d=4*t.width;let u;l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=a,a=u),l[n+1]>l[s+1]&&(u=n,n=s,s=u,u=a,a=o,o=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=a,a=u);const p=(l[i]+e.offsetX)*e.scaleX,f=(l[i+1]+e.offsetY)*e.scaleY,g=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,v=(l[s]+e.offsetX)*e.scaleX,b=(l[s+1]+e.offsetY)*e.scaleY;if(f>=b)return;const y=h[r],w=h[r+1],A=h[r+2],_=h[a],x=h[a+1],S=h[a+2],k=h[o],E=h[o+1],C=h[o+2],M=Math.round(f),P=Math.round(b);let R,T,L,I,D,F,N,O;for(let t=M;t<=P;t++){if(t<m){const e=t<f?0:(f-t)/(f-m);R=p-(p-g)*e,T=y-(y-_)*e,L=w-(w-x)*e,I=A-(A-S)*e}else{let e;e=t>b?1:m===b?0:(m-t)/(m-b),R=g-(g-v)*e,T=_-(_-k)*e,L=x-(x-E)*e,I=S-(S-C)*e}let e;e=t<f?0:t>b?1:(f-t)/(f-b),D=p-(p-v)*e,F=y-(y-k)*e,N=w-(w-E)*e,O=A-(A-C)*e;const i=Math.round(Math.min(R,D)),n=Math.round(Math.max(R,D));let s=d*t+4*i;for(let t=i;t<=n;t++)e=(R-t)/(R-D),e<0?e=0:e>1&&(e=1),c[s++]=T-(T-F)*e|0,c[s++]=L-(L-N)*e|0,c[s++]=I-(I-O)*e|0,c[s++]=255}}function Fg(t,e,i){const n=e.coords,s=e.colors;let r,a;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,h=o-1;for(r=0;r<l;r++){let e=r*o;for(let r=0;r<h;r++,e++)Dg(t,i,n[e],n[e+1],n[e+o],s[e],s[e+1],s[e+o]),Dg(t,i,n[e+o+1],n[e+1],n[e+o],s[e+o+1],s[e+1],s[e+o])}break;case"triangles":for(r=0,a=n.length;r<a;r+=3)Dg(t,i,n[r],n[r+1],n[r+2],s[r],s[r+1],s[r+2]);break;default:throw new Error("illegal figure")}}class Ng extends Lg{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,i){const n=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),r=Math.ceil(this._bounds[2])-n,a=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(r*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(a*t[1]*1.1)),3e3),h=r/o,c=a/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-s,scaleX:1/h,scaleY:1/c},u=o+4,p=l+4,f=i.getCanvas("mesh",u,p,!1),g=f.context,m=g.createImageData(o,l);if(e){const t=m.data;for(let i=0,n=t.length;i<n;i+=4)t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=255}for(const t of this._figures)Fg(m,t,d);return g.putImageData(m,2,2),{canvas:f.canvas,offsetX:n-2*h,offsetY:s-2*c,scaleX:h,scaleY:c}}getPattern(t,e,i,n){let s;if(Tg(t,this._bbox),n===Rg)s=rc.singularValueDecompose2dScale(Ad(t));else if(s=rc.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=rc.singularValueDecompose2dScale(this.matrix);s=[s[0]*t[0],s[1]*t[1]]}const r=this._createMeshCanvas(s,n===Rg?null:this._background,e.cachedCanvases);return n!==Rg&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(r.offsetX,r.offsetY),t.scale(r.scaleX,r.scaleY),t.createPattern(r.canvas,"no-repeat")}}class Og extends Lg{getPattern(){return"hotpink"}}const Wg=1,jg=2,Bg=class{constructor(t,e,i,n,s){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=i,this.canvasGraphicsFactory=n,this.baseTransform=s}createPatternCanvas(t){const e=this.operatorList,i=this.bbox,n=this.xstep,s=this.ystep,r=this.paintType,a=this.tilingType,o=this.color,l=this.canvasGraphicsFactory;Nh("TilingType: "+a);const h=i[0],c=i[1],d=i[2],u=i[3],p=rc.singularValueDecompose2dScale(this.matrix),f=rc.singularValueDecompose2dScale(this.baseTransform),g=[p[0]*f[0],p[1]*f[1]],m=this.getSizeAndScale(n,this.ctx.canvas.width,g[0]),v=this.getSizeAndScale(s,this.ctx.canvas.height,g[1]),b=t.cachedCanvases.getCanvas("pattern",m.size,v.size,!0),y=b.context,w=l.createCanvasGraphics(y);w.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(w,r,o);let A=h,_=c,x=d,S=u;return h<0&&(A=0,x+=Math.abs(h)),c<0&&(_=0,S+=Math.abs(c)),y.translate(-m.scale*A,-v.scale*_),w.transform(m.scale,0,0,v.scale,0,0),y.save(),this.clipBbox(w,A,_,x,S),w.baseTransform=Ad(w.ctx),w.executeOperatorList(e),w.endDrawing(),{canvas:b.canvas,scaleX:m.scale,scaleY:v.scale,offsetX:A,offsetY:_}}getSizeAndScale(t,e,i){t=Math.abs(t);const n=Math.max(Bg.MAX_PATTERN_SIZE,e);let s=Math.ceil(t*i);return s>=n?s=n:i=s/t,{scale:i,size:s}}clipBbox(t,e,i,n,s){const r=n-e,a=s-i;t.ctx.rect(e,i,r,a),t.current.updateRectMinMax(Ad(t.ctx),[e,i,n,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case Wg:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case jg:const r=rc.makeHexColor(i[0],i[1],i[2]);n.fillStyle=r,n.strokeStyle=r,s.fillColor=r,s.strokeColor=r;break;default:throw new Xh(`Unsupported paint type: ${e}`)}}getPattern(t,e,i,n){let s=i;n!==Rg&&(s=rc.transform(s,e.baseTransform),this.matrix&&(s=rc.transform(s,this.matrix)));const r=this.createPatternCanvas(e);let a=new DOMMatrix(s);a=a.translate(r.offsetX,r.offsetY),a=a.scale(1/r.scaleX,1/r.scaleY);const o=t.createPattern(r.canvas,"repeat");return o.setTransform(a),o}};let Hg=Bg;function zg({src:t,srcPos:e=0,dest:i,width:n,height:s,nonBlackColor:r=4294967295,inverseDecode:a=!1}){const o=Zh.isLittleEndian?4278190080:255,[l,h]=a?[r,o]:[o,r],c=n>>3,d=7&n,u=t.length;i=new Uint32Array(i.buffer);let p=0;for(let n=0;n<s;n++){for(const n=e+c;e<n;e++){const n=e<u?t[e]:255;i[p++]=128&n?h:l,i[p++]=64&n?h:l,i[p++]=32&n?h:l,i[p++]=16&n?h:l,i[p++]=8&n?h:l,i[p++]=4&n?h:l,i[p++]=2&n?h:l,i[p++]=1&n?h:l}if(0===d)continue;const n=e<u?t[e++]:255;for(let t=0;t<d;t++)i[p++]=n&1<<7-t?h:l}return{srcPos:e,destPos:p}}e(Hg,"MAX_PATTERN_SIZE",3e3);const $g=16;class Ug{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let n;return void 0!==this.cache[t]?(n=this.cache[t],this.canvasFactory.reset(n,e,i)):(n=this.canvasFactory.create(e,i),this.cache[t]=n),n}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function Vg(t,e,i,n,s,r,a,o,l,h){const[c,d,u,p,f,g]=Ad(t);if(0===d&&0===u){const m=a*c+f,v=Math.round(m),b=o*p+g,y=Math.round(b),w=(a+l)*c+f,A=Math.abs(Math.round(w)-v)||1,_=(o+h)*p+g,x=Math.abs(Math.round(_)-y)||1;return t.setTransform(Math.sign(c),0,0,Math.sign(p),v,y),t.drawImage(e,i,n,s,r,0,0,A,x),t.setTransform(c,d,u,p,f,g),[A,x]}if(0===c&&0===p){const m=o*u+f,v=Math.round(m),b=a*d+g,y=Math.round(b),w=(o+h)*u+f,A=Math.abs(Math.round(w)-v)||1,_=(a+l)*d+g,x=Math.abs(Math.round(_)-y)||1;return t.setTransform(0,Math.sign(d),Math.sign(u),0,v,y),t.drawImage(e,i,n,s,r,0,0,x,A),t.setTransform(c,d,u,p,f,g),[x,A]}t.drawImage(e,i,n,s,r,a,o,l,h);return[Math.hypot(c,d)*l,Math.hypot(u,p)*h]}class Gg{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=Bl,this.textMatrixScale=1,this.fontMatrix=Hl,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=th,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,i){[e,i]=rc.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){const i=rc.applyTransform(e,t),n=rc.applyTransform(e.slice(2),t),s=rc.applyTransform([e[0],e[3]],t),r=rc.applyTransform([e[2],e[1]],t);this.minX=Math.min(this.minX,i[0],n[0],s[0],r[0]),this.minY=Math.min(this.minY,i[1],n[1],s[1],r[1]),this.maxX=Math.max(this.maxX,i[0],n[0],s[0],r[0]),this.maxY=Math.max(this.maxY,i[1],n[1],s[1],r[1])}updateScalingPathMinMax(t,e){rc.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.minY=Math.min(this.minY,e[1]),this.maxX=Math.max(this.maxX,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,i,n,s,r,a,o,l,h){const c=rc.bezierBoundingBox(e,i,n,s,r,a,o,l,h);h||this.updateRectMinMax(t,c)}getPathBoundingBox(t=Mg,e=null){const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===Pg){e||Wh("Stroke bounding box must include transform.");const t=rc.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,s=t[1]*this.lineWidth/2;i[0]-=n,i[1]-=s,i[2]+=n,i[3]+=s}return i}updateClipFromPath(){const t=rc.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(t=Mg,e=null){return rc.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function qg(t,e){if(typeof ImageData<"u"&&e instanceof ImageData)return void t.putImageData(e,0,0);const i=e.height,n=e.width,s=i%$g,r=(i-s)/$g,a=0===s?r:r+1,o=t.createImageData(n,$g);let l,h=0;const c=e.data,d=o.data;let u,p,f,g;if(e.kind===ah.GRAYSCALE_1BPP){const e=c.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),g=i.length,m=n+7>>3,v=4294967295,b=Zh.isLittleEndian?4278190080:255;for(u=0;u<a;u++){for(f=u<r?$g:s,l=0,p=0;p<f;p++){const t=e-h;let s=0;const r=t>m?n:8*t-7,a=-8&r;let o=0,d=0;for(;s<a;s+=8)d=c[h++],i[l++]=128&d?v:b,i[l++]=64&d?v:b,i[l++]=32&d?v:b,i[l++]=16&d?v:b,i[l++]=8&d?v:b,i[l++]=4&d?v:b,i[l++]=2&d?v:b,i[l++]=1&d?v:b;for(;s<r;s++)0===o&&(d=c[h++],o=128),i[l++]=d&o?v:b,o>>=1}for(;l<g;)i[l++]=0;t.putImageData(o,0,u*$g)}}else if(e.kind===ah.RGBA_32BPP){for(p=0,g=n*$g*4,u=0;u<r;u++)d.set(c.subarray(h,h+g)),h+=g,t.putImageData(o,0,p),p+=$g;u<a&&(g=n*s*4,d.set(c.subarray(h,h+g)),t.putImageData(o,0,p))}else{if(e.kind!==ah.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);for(f=$g,g=n*f,u=0;u<a;u++){for(u>=r&&(f=s,g=n*f),l=0,p=g;p--;)d[l++]=c[h++],d[l++]=c[h++],d[l++]=c[h++],d[l++]=255;t.putImageData(o,0,u*$g)}}}function Xg(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%$g,r=(i-s)/$g,a=0===s?r:r+1,o=t.createImageData(n,$g);let l=0;const h=e.data,c=o.data;for(let e=0;e<a;e++){const i=e<r?$g:s;({srcPos:l}=zg({src:h,srcPos:l,dest:c,width:n,height:i,nonBlackColor:0})),t.putImageData(o,0,e*$g)}}function Yg(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of i)void 0!==t[n]&&(e[n]=t[n]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function Kg(t){if(t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0),!jl){const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function Jg(t,e){if(e)return!0;const i=rc.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*Mc.PDF_TO_CSS_UNITS);return i[0]<=n&&i[1]<=n}const Qg=["butt","round","square"],Zg=["miter","round","bevel"],tm={},em={};var im,nm,sm,rm;const am=class{constructor(t,e,i,n,r,{optionalContentConfig:a,markedContentStack:o=null},l,h){s(this,im),s(this,sm),this.ctx=t,this.current=new Gg(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=n,this.filterFactory=r,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,this.cachedCanvases=new Ug(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=h,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,e=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing({transform:t,viewport:e,transparency:i=!1,background:n=null}){const s=this.ctx.canvas.width,r=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=n||"#ffffff",this.ctx.fillRect(0,0,s,r),this.ctx.fillStyle=a,i){const t=this.cachedCanvases.getCanvas("transparent",s,r);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...Ad(this.compositeCtx))}this.ctx.save(),Kg(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=Ad(this.ctx)}executeOperatorList(t,e,i,n){const s=t.argsArray,r=t.fnArray;let a=e||0;const o=s.length;if(o===a)return a;const l=o-a>10&&"function"==typeof i,h=l?Date.now()+15:0;let c=0;const d=this.commonObjs,u=this.objs;let p;for(;;){if(void 0!==n&&a===n.nextBreakPoint)return n.breakIt(a,i),a;if(p=r[a],p!==Lh.dependency)this[p].apply(this,s[a]);else for(const t of s[a]){const e=t.startsWith("g_")?d:u;if(!e.has(t))return e.get(t,i),a}if(a++,a===o)return a;if(l&&++c>10){if(Date.now()>h)return i(),a;c=0}}}endDrawing(){o(this,im,nm).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),o(this,sm,rm).call(this)}_scaleImage(t,e){const i=t.width,n=t.height;let s,r,a=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=i,h=n,c="prescale1";for(;a>2&&l>1||o>2&&h>1;){let e=l,i=h;a>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/e),o>2&&h>1&&(i=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h)/2,o/=h/i),s=this.cachedCanvases.getCanvas(c,e,i),r=s.context,r.clearRect(0,0,e,i),r.drawImage(t,0,0,l,h,0,0,e,i),t=s.canvas,l=e,h=i,c="prescale1"===c?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:h}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,s=this.current.fillColor,r=this.current.patternFill,a=Ad(e);let o,l,h,c;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;l=JSON.stringify(r?a:[a.slice(0,4),s]),o=this._cachedBitmapsMap.get(e),o||(o=new Map,this._cachedBitmapsMap.set(e,o));const i=o.get(l);if(i&&!r){return{canvas:i,offsetX:Math.round(Math.min(a[0],a[2])+a[4]),offsetY:Math.round(Math.min(a[1],a[3])+a[5])}}h=i}h||(c=this.cachedCanvases.getCanvas("maskCanvas",i,n),Xg(c.context,t));let d=rc.transform(a,[1/i,0,0,-1/n,0,0]);d=rc.transform(d,[1,0,0,1,0,-n]);const[u,p,f,g]=rc.getAxialAlignedBoundingBox([0,0,i,n],d),m=Math.round(f-u)||1,v=Math.round(g-p)||1,b=this.cachedCanvases.getCanvas("fillCanvas",m,v),y=b.context,w=u,A=p;y.translate(-w,-A),y.transform(...d),h||(h=this._scaleImage(c.canvas,_d(y)),h=h.img,o&&r&&o.set(l,h)),y.imageSmoothingEnabled=Jg(Ad(y),t.interpolate),Vg(y,h,0,0,h.width,h.height,0,0,i,n),y.globalCompositeOperation="source-in";const _=rc.transform(_d(y),[1,0,0,1,-w,-A]);return y.fillStyle=r?s.getPattern(e,this,_,Mg):s,y.fillRect(0,0,i,n),o&&!r&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,b.canvas)),{canvas:b.canvas,offsetX:Math.round(w),offsetY:Math.round(A)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=Qg[t]}setLineJoin(t){this.ctx.lineJoin=Zg[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx,this.ctx=n.context;const s=this.ctx;s.setTransform(...Ad(this.suspendedCtx)),Yg(this.suspendedCtx,s),function(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,n,s,r,a){e.transform(t,i,n,s,r,a),this.__originalTransform(t,i,n,s,r,a)},t.setTransform=function(t,i,n,s,r,a){e.setTransform(t,i,n,s,r,a),this.__originalSetTransform(t,i,n,s,r,a)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},t.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},t.bezierCurveTo=function(t,i,n,s,r,a){e.bezierCurveTo(t,i,n,s,r,a),this.__originalBezierCurveTo(t,i,n,s,r,a)},t.rect=function(t,i,n,s){e.rect(t,i,n,s),this.__originalRect(t,i,n,s)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Yg(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,e,i,n){const s=n[0],r=n[1],a=n[2]-s,o=n[3]-r;0===a||0===o||(this.genericComposeSMask(e.context,i,a,o,e.subtype,e.backdrop,e.transferMap,s,r,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,e,i,n,s,r,a,o,l,h,c){let d=t.canvas,u=o-h,p=l-c;if(r)if(u<0||p<0||u+i>d.width||p+n>d.height){const t=this.cachedCanvases.getCanvas("maskExtension",i,n),e=t.context;e.drawImage(d,-u,-p),r.some((t=>0!==t))&&(e.globalCompositeOperation="destination-atop",e.fillStyle=rc.makeHexColor(...r),e.fillRect(0,0,i,n),e.globalCompositeOperation="source-over"),d=t.canvas,u=p=0}else if(r.some((t=>0!==t))){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const e=new Path2D;e.rect(u,p,i,n),t.clip(e),t.globalCompositeOperation="destination-atop",t.fillStyle=rc.makeHexColor(...r),t.fillRect(u,p,i,n),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),"Alpha"===s&&a?e.filter=this.filterFactory.addAlphaFilter(a):"Luminosity"===s&&(e.filter=this.filterFactory.addLuminosityFilter(a));const f=new Path2D;f.rect(o,l,i,n),e.clip(f),e.globalCompositeOperation="destination-in",e.drawImage(d,u,p,i,n,o,l,i,n),e.restore()}save(){this.inSMaskMode?(Yg(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),Yg(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,n,s,r){this.ctx.transform(t,e,i,n,s,r),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){const n=this.ctx,s=this.current;let r,a,o=s.x,l=s.y;const h=Ad(n),c=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],d=c?i.slice(0):null;for(let i=0,u=0,p=t.length;i<p;i++)switch(0|t[i]){case Lh.rectangle:o=e[u++],l=e[u++];const t=e[u++],i=e[u++],p=o+t,f=l+i;n.moveTo(o,l),0===t||0===i?n.lineTo(p,f):(n.lineTo(p,l),n.lineTo(p,f),n.lineTo(o,f)),c||s.updateRectMinMax(h,[o,l,p,f]),n.closePath();break;case Lh.moveTo:o=e[u++],l=e[u++],n.moveTo(o,l),c||s.updatePathMinMax(h,o,l);break;case Lh.lineTo:o=e[u++],l=e[u++],n.lineTo(o,l),c||s.updatePathMinMax(h,o,l);break;case Lh.curveTo:r=o,a=l,o=e[u+4],l=e[u+5],n.bezierCurveTo(e[u],e[u+1],e[u+2],e[u+3],o,l),s.updateCurvePathMinMax(h,r,a,e[u],e[u+1],e[u+2],e[u+3],o,l,d),u+=6;break;case Lh.curveTo2:r=o,a=l,n.bezierCurveTo(o,l,e[u],e[u+1],e[u+2],e[u+3]),s.updateCurvePathMinMax(h,r,a,o,l,e[u],e[u+1],e[u+2],e[u+3],d),o=e[u+2],l=e[u+3],u+=4;break;case Lh.curveTo3:r=o,a=l,o=e[u+2],l=e[u+3],n.bezierCurveTo(e[u],e[u+1],o,l,o,l),s.updateCurvePathMinMax(h,r,a,e[u],e[u+1],o,l,o,l,d),u+=4;break;case Lh.closePath:n.closePath()}c&&s.updateScalingPathMinMax(h,d),s.setCurrentPoint(o,l)}closePath(){this.ctx.closePath()}stroke(t=!0){const e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof i&&null!=i&&i.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,_d(e),Pg),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){const e=this.ctx,i=this.current.fillColor;let n=!1;this.current.patternFill&&(e.save(),e.fillStyle=i.getPattern(e,this,_d(e),Mg),n=!0);const s=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==s&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),n&&e.restore(),t&&this.consumePath(s)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=tm}eoClip(){this.pendingClip=em}beginText(){this.current.textMatrix=Bl,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(const i of t)e.setTransform(...i.transform),e.translate(i.x,i.y),i.addToPath(e,i.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){var i;const n=this.commonObjs.get(t),s=this.current;if(!n)throw new Error(`Can't find font for ${t}`);if(s.fontMatrix=n.fontMatrix||Hl,(0===s.fontMatrix[0]||0===s.fontMatrix[3])&&Oh("Invalid font matrix for font "+t),e<0?(e=-e,s.fontDirection=-1):s.fontDirection=1,this.current.font=n,this.current.fontSize=e,n.isType3Font)return;const r=n.loadedName||"sans-serif",a=(null==(i=n.systemFontInfo)?void 0:i.css)||`"${r}", ${n.fallbackName}`;let o="normal";n.black?o="900":n.bold&&(o="bold");const l=n.italic?"italic":"normal";let h=e;e<16?h=16:e>100&&(h=100),this.current.fontSizeScale=e/h,this.ctx.font=`${l} ${o} ${h}px ${a}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,n,s,r){this.current.textMatrix=[t,e,i,n,s,r],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,n){const s=this.ctx,r=this.current,a=r.font,o=r.textRenderingMode,l=r.fontSize/r.fontSizeScale,h=o&sh,c=!!(o&rh),d=r.patternFill&&!a.missingFile;let u;(a.disableFontFace||c||d)&&(u=a.getPathGenerator(this.commonObjs,t)),a.disableFontFace||d?(s.save(),s.translate(e,i),s.beginPath(),u(s,l),n&&s.setTransform(...n),(h===th||h===ih)&&s.fill(),(h===eh||h===ih)&&s.stroke(),s.restore()):((h===th||h===ih)&&s.fillText(t,e,i),(h===eh||h===ih)&&s.strokeText(t,e,i)),c&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Ad(s),x:e,y:i,fontSize:l,addToPath:u})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){i=!0;break}return Hh(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const s=this.ctx,r=e.fontSizeScale,a=e.charSpacing,o=e.wordSpacing,l=e.fontDirection,h=e.textHScale*l,c=t.length,d=i.vertical,u=d?1:-1,p=i.defaultVMetrics,f=n*e.fontMatrix[0],g=e.textRenderingMode===th&&!i.disableFontFace&&!e.patternFill;let m;if(s.save(),s.transform(...e.textMatrix),s.translate(e.x,e.y+e.textRise),l>0?s.scale(h,-1):s.scale(h,1),e.patternFill){s.save();const t=e.fillColor.getPattern(s,this,_d(s),Mg);m=Ad(s),s.restore(),s.fillStyle=t}let v=e.lineWidth;const b=e.textMatrixScale;if(0===b||0===v){const t=e.textRenderingMode&sh;(t===eh||t===ih)&&(v=this.getSinglePixelWidth())}else v/=b;if(1!==r&&(s.scale(r,r),v/=r),s.lineWidth=v,i.isInvalidPDFjsFont){const i=[];let n=0;for(const e of t)i.push(e.unicode),n+=e.width;return s.fillText(i.join(""),0,0),e.x+=n*f*h,s.restore(),void this.compose()}let y,w=0;for(y=0;y<c;++y){const e=t[y];if("number"==typeof e){w+=u*e*n/1e3;continue}let h=!1;const c=(e.isSpace?o:0)+a,v=e.fontChar,b=e.accent;let A,_,x=e.width;if(d){const t=e.vmetric||p,i=-(e.vmetric?t[1]:.5*x)*f,n=t[2]*f;x=t?-t[0]:x,A=i/r,_=(w+n)/r}else A=w/r,_=0;if(i.remeasure&&x>0){const t=1e3*s.measureText(v).width/n*r;if(x<t&&this.isFontSubpixelAAEnabled){const e=x/t;h=!0,s.save(),s.scale(e,1),A/=e}else x!==t&&(A+=(x-t)/2e3*n/r)}if(this.contentVisible&&(e.isInFont||i.missingFile))if(g&&!b)s.fillText(v,A,_);else if(this.paintChar(v,A,_,m),b){const t=A+n*b.offset.x/r,e=_-n*b.offset.y/r;this.paintChar(b.fontChar,t,e,m)}w+=d?x*f-c*l:x*f+c*l,h&&s.restore()}d?e.y-=w:e.x+=w*h,s.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,n=i.font,s=i.fontSize,r=i.fontDirection,a=n.vertical?1:-1,o=i.charSpacing,l=i.wordSpacing,h=i.textHScale*r,c=i.fontMatrix||Hl,d=t.length;let u,p,f,g;if(!(i.textRenderingMode===nh)&&0!==s){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...i.textMatrix),e.translate(i.x,i.y),e.scale(h,r),u=0;u<d;++u){if(p=t[u],"number"==typeof p){g=a*p*s/1e3,this.ctx.translate(g,0),i.x+=g*h;continue}const r=(p.isSpace?l:0)+o,d=n.charProcOperatorList[p.operatorListId];d?(this.contentVisible&&(this.processingType3=p,this.save(),e.scale(s,s),e.transform(...c),this.executeOperatorList(d),this.restore()),f=rc.applyTransform([p.width,0],c)[0]*s+r,e.translate(f,0),i.x+=f*h):Oh(`Type3 character "${p.operatorListId}" is not available.`)}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,n,s,r){this.ctx.rect(i,n,s-i,r-n),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const i=t[1],n=this.baseTransform||Ad(this.ctx),s={createCanvasGraphics:t=>new am(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new Hg(t,i,this.ctx,s,n)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,i){const n=rc.makeHexColor(t,e,i);this.ctx.strokeStyle=n,this.current.strokeColor=n}setFillRGBColor(t,e,i){const n=rc.makeHexColor(t,e,i);this.ctx.fillStyle=n,this.current.fillColor=n,this.current.patternFill=!1}_getPattern(t,e=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=function(t){switch(t[0]){case"RadialAxial":return new Ig(t);case"Mesh":return new Ng(t);case"Dummy":return new Og}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t)),this.cachedPatterns.set(t,i)),e&&(i.matrix=e),i}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,_d(e),Rg);const n=_d(e);if(n){const{width:t,height:i}=e.canvas,[s,r,a,o]=rc.getAxialAlignedBoundingBox([0,0,t,i],n);this.ctx.fillRect(s,r,a-s,o-r)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Wh("Should not call beginInlineImage")}beginImageData(){Wh("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=Ad(this.ctx),e)){const t=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],t,i),this.current.updateRectMinMax(Ad(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||Nh("TODO: Support non-isolated groups."),t.knockout&&Oh("Knockout groups not supported.");const i=Ad(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let n=rc.getAxialAlignedBoundingBox(t.bbox,Ad(e));const s=[0,0,e.canvas.width,e.canvas.height];n=rc.intersect(n,s)||[0,0,0,0];const r=Math.floor(n[0]),a=Math.floor(n[1]),o=Math.max(Math.ceil(n[2])-r,1),l=Math.max(Math.ceil(n[3])-a,1);this.current.startNewPathAndClipBox([0,0,o,l]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);const c=this.cachedCanvases.getCanvas(h,o,l),d=c.context;d.translate(-r,-a),d.transform(...i),t.smask?this.smaskStack.push({canvas:c.canvas,context:d,offsetX:r,offsetY:a,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(r,a),e.save()),Yg(e,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=Ad(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const i=rc.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,n,s){if(o(this,im,nm).call(this),Kg(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const n=e[2]-e[0],r=e[3]-e[1];if(s&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=n,e[3]=r;const[s,a]=rc.singularValueDecompose2dScale(Ad(this.ctx)),{viewportScale:o}=this,l=Math.ceil(n*this.outputScaleX*o),h=Math.ceil(r*this.outputScaleY*o);this.annotationCanvas=this.canvasFactory.create(l,h);const{canvas:c,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(t,c),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(s,0,0,-a,0,r*a),Kg(this.ctx)}else Kg(this.ctx),this.ctx.rect(e[0],e[1],n,r),this.ctx.clip(),this.endPath()}this.current=new Gg(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),o(this,sm,rm).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const i=this.ctx,n=this.processingType3;if(n&&(void 0===n.compiled&&(n.compiled=function(t){const{width:e,height:i}=t;if(e>1e3||i>1e3)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let r,a,o,l=new Uint8Array(s*(i+1));const h=e+7&-8;let c=new Uint8Array(h*i),d=0;for(const e of t.data){let t=128;for(;t>0;)c[d++]=e&t?0:255,t>>=1}let u=0;for(d=0,0!==c[d]&&(l[0]=1,++u),a=1;a<e;a++)c[d]!==c[d+1]&&(l[a]=c[d]?2:1,++u),d++;for(0!==c[d]&&(l[a]=2,++u),r=1;r<i;r++){d=r*h,o=r*s,c[d-h]!==c[d]&&(l[o]=c[d]?1:8,++u);let t=(c[d]?4:0)+(c[d-h]?8:0);for(a=1;a<e;a++)t=(t>>2)+(c[d+1]?4:0)+(c[d-h+1]?8:0),n[t]&&(l[o+a]=n[t],++u),d++;if(c[d-h]!==c[d]&&(l[o+a]=c[d]?2:4,++u),u>1e3)return null}for(d=h*(i-1),o=r*s,0!==c[d]&&(l[o]=8,++u),a=1;a<e;a++)c[d]!==c[d+1]&&(l[o+a]=c[d]?4:8,++u),d++;if(0!==c[d]&&(l[o+a]=4,++u),u>1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),f=new Path2D;for(r=0;u&&r<=i;r++){let t=r*s;const i=t+e;for(;t<i&&!l[t];)t++;if(t===i)continue;f.moveTo(t%s,r);const n=t;let a=l[t];do{const e=p[a];do{t+=e}while(!l[t]);const i=l[t];5!==i&&10!==i?(a=i,l[t]=0):(a=i&51*a>>4,l[t]&=a>>2|a<<2),f.lineTo(t%s,t/s|0),l[t]||--u}while(n!==t);--r}return c=null,l=null,function(t){t.save(),t.scale(1/e,-1/i),t.translate(0,-i),t.fill(f),t.beginPath(),t.restore()}}(t)),n.compiled))return void n.compiled(i);const s=this._createMaskCanvas(t),r=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(r,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i=0,n=0,s,r){if(!this.contentVisible)return;t=this.getObject(t.data,t);const a=this.ctx;a.save();const o=Ad(a);a.transform(e,i,n,s,0,0);const l=this._createMaskCanvas(t);a.setTransform(1,0,0,1,l.offsetX-o[4],l.offsetY-o[5]);for(let t=0,h=r.length;t<h;t+=2){const h=rc.transform(o,[e,i,n,s,r[t],r[t+1]]),[c,d]=rc.applyTransform([0,0],h);a.drawImage(l.canvas,c,d)}a.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,n=this.current.patternFill;for(const s of t){const{data:t,width:r,height:a,transform:o}=s,l=this.cachedCanvases.getCanvas("maskCanvas",r,a),h=l.context;h.save();Xg(h,this.getObject(t,s)),h.globalCompositeOperation="source-in",h.fillStyle=n?i.getPattern(h,this,_d(e),Mg):i,h.fillRect(0,0,r,a),h.restore(),e.save(),e.transform(...o),e.scale(1,-1),Vg(e,l.canvas,0,0,r,a,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):Oh("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;const s=this.getObject(t);if(!s)return void Oh("Dependent image isn't ready yet");const r=s.width,a=s.height,o=[];for(let t=0,s=n.length;t<s;t+=2)o.push({transform:[e,0,0,i,n[t],n[t+1]],x:0,y:0,w:r,h:a});this.paintInlineImageXObjectGroup(s,o)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:i,height:n}=t,s=this.cachedCanvases.getCanvas("inlineImage",i,n),r=s.context;return r.filter=this.current.transferMaps,r.drawImage(e,0,0),r.filter="none",s.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,n=this.ctx;if(this.save(),!jl){const{filter:t}=n;"none"!==t&&""!==t&&(n.filter="none")}let s;if(n.scale(1/e,-1/i),t.bitmap)s=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)s=t;else{const n=this.cachedCanvases.getCanvas("inlineImage",e,i).context;qg(n,t),s=this.applyTransferMapsToCanvas(n)}const r=this._scaleImage(s,_d(n));n.imageSmoothingEnabled=Jg(Ad(n),t.interpolate),Vg(n,r.img,0,0,r.paintWidth,r.paintHeight,0,-i,e,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx;let n;if(t.bitmap)n=t.bitmap;else{const e=t.width,i=t.height,s=this.cachedCanvases.getCanvas("inlineImage",e,i).context;qg(s,t),n=this.applyTransferMapsToCanvas(s)}for(const t of e)i.save(),i.transform(...t.transform),i.scale(1,-1),Vg(i,n,t.x,t.y,t.w,t.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(e||(this.pendingClip===em?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Ad(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),n=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,n)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:i,c:n,d:s}=this.ctx.getTransform();let r,a;if(0===i&&0===n){const i=Math.abs(e),n=Math.abs(s);if(i===n)if(0===t)r=a=1/i;else{const e=i*t;r=a=e<1?1/e:1}else if(0===t)r=1/i,a=1/n;else{const e=i*t,s=n*t;r=e<1?1/e:1,a=s<1?1/s:1}}else{const o=Math.abs(e*s-i*n),l=Math.hypot(e,i),h=Math.hypot(n,s);if(0===t)r=h/o,a=l/o;else{const e=t*o;r=h>e?h/e:1,a=l>e?l/e:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:i}=this.current,[n,s]=this.getScaleForStroking();if(e.lineWidth=i||1,1===n&&1===s)return void e.stroke();const r=e.getLineDash();if(t&&e.save(),e.scale(n,s),r.length>0){const t=Math.max(n,s);e.setLineDash(r.map((e=>e/t))),e.lineDashOffset/=t}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};let om=am;im=new WeakSet,nm=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},sm=new WeakSet,rm=function(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}};for(const t in Lh)void 0!==om.prototype[t]&&(om.prototype[Lh[t]]=om.prototype[t]);var lm,hm;class cm{static get workerPort(){return n(this,lm)}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");r(this,lm,t)}static get workerSrc(){return n(this,hm)}static set workerSrc(t){if("string"!=typeof t)throw new Error("Invalid `workerSrc` type.");r(this,hm,t)}}lm=new WeakMap,hm=new WeakMap,s(cm,lm,null),s(cm,hm,"");const dm=1,um=2,pm=1,fm=2,gm=3,mm=4,vm=5,bm=6,ym=7,wm=8;function Am(t){switch(t instanceof Error||"object"==typeof t&&null!==t||Wh('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new Yh(t.message);case"MissingPDFException":return new Gh(t.message);case"PasswordException":return new $h(t.message,t.code);case"UnexpectedResponseException":return new qh(t.message,t.status);case"UnknownErrorException":return new Uh(t.message,t.details);default:return new Uh(t.message,t.toString())}}var _m,xm,Sm,km,Em,Cm,Mm,Pm;class Rm{constructor(t,e,i){s(this,_m),s(this,Sm),s(this,Em),this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream)return void o(this,Sm,km).call(this,e);if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===dm)i.resolve(e.data);else{if(e.callback!==um)throw new Error("Unexpected callback case");i.reject(Am(e.reason))}return}const n=this.actionHandler[e.action];if(!n)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,s=e.sourceName;new Promise((function(t){t(n(e.data))})).then((function(n){i.postMessage({sourceName:t,targetName:s,callback:dm,callbackId:e.callbackId,data:n})}),(function(n){i.postMessage({sourceName:t,targetName:s,callback:um,callbackId:e.callbackId,reason:Am(n)})}))}else e.streamId?o(this,_m,xm).call(this,e):n(e.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const n=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[n]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},i)}catch(t){s.reject(t)}return s.promise}sendWithStream(t,e,i,n){const s=this.streamId++,r=this.sourceName,a=this.targetName,o=this.comObj;return new ReadableStream({start:i=>{const l=Promise.withResolvers();return this.streamControllers[s]={controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:r,targetName:a,action:t,streamId:s,data:e,desiredSize:i.desiredSize},n),l.promise},pull:t=>{const e=Promise.withResolvers();return this.streamControllers[s].pullCall=e,o.postMessage({sourceName:r,targetName:a,stream:bm,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{jh(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();return this.streamControllers[s].cancelCall=e,this.streamControllers[s].isClosed=!0,o.postMessage({sourceName:r,targetName:a,stream:pm,streamId:s,reason:Am(t)}),e.promise}},i)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}_m=new WeakSet,xm=function(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this,a=this.actionHandler[t.action],o={enqueue(t,r=1,a){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=r,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:n,stream:mm,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:gm,streamId:e}),delete r.streamSinks[e])},error(t){jh(t instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:vm,streamId:e,reason:Am(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,new Promise((function(e){e(a(t.data,o))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:wm,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:wm,streamId:e,reason:Am(t)})}))},Sm=new WeakSet,km=function(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this.streamControllers[e],a=this.streamSinks[e];switch(t.stream){case wm:t.success?r.startCall.resolve():r.startCall.reject(Am(t.reason));break;case ym:t.success?r.pullCall.resolve():r.pullCall.reject(Am(t.reason));break;case bm:if(!a){s.postMessage({sourceName:i,targetName:n,stream:ym,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,new Promise((function(t){var e;t(null==(e=a.onPull)?void 0:e.call(a))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:ym,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:ym,streamId:e,reason:Am(t)})}));break;case mm:if(jh(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case gm:if(jh(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),o(this,Em,Cm).call(this,r,e);break;case vm:jh(r,"error should have stream controller"),r.controller.error(Am(t.reason)),o(this,Em,Cm).call(this,r,e);break;case fm:t.success?r.cancelCall.resolve():r.cancelCall.reject(Am(t.reason)),o(this,Em,Cm).call(this,r,e);break;case pm:if(!a)break;new Promise((function(e){var i;e(null==(i=a.onCancel)?void 0:i.call(a,Am(t.reason)))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:fm,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:fm,streamId:e,reason:Am(t)})})),a.sinkCapability.reject(Am(t.reason)),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},Em=new WeakSet,Cm=async function(t,e){var i,n,s;await Promise.allSettled([null==(i=t.startCall)?void 0:i.promise,null==(n=t.pullCall)?void 0:n.promise,null==(s=t.cancelCall)?void 0:s.promise]),delete this.streamControllers[e]};class Tm{constructor({parsedData:t,rawData:e}){s(this,Mm,void 0),s(this,Pm,void 0),r(this,Mm,t),r(this,Pm,e)}getRaw(){return n(this,Pm)}get(t){return n(this,Mm).get(t)??null}getAll(){return Qh(n(this,Mm))}has(t){return n(this,Mm).has(t)}}Mm=new WeakMap,Pm=new WeakMap;const Lm=Symbol("INTERNAL");var Im,Dm,Fm,Nm,Om,Wm,jm,Bm,Hm,zm;class $m{constructor(t,{name:e,intent:i,usage:n}){s(this,Im,!1),s(this,Dm,!1),s(this,Fm,!1),s(this,Nm,!0),r(this,Im,!!(t&Ul)),r(this,Dm,!!(t&Vl)),this.name=e,this.intent=i,this.usage=n}get visible(){if(n(this,Fm))return n(this,Nm);if(!n(this,Nm))return!1;const{print:t,view:e}=this.usage;return n(this,Im)?"OFF"!==(null==e?void 0:e.viewState):!n(this,Dm)||"OFF"!==(null==t?void 0:t.printState)}_setVisible(t,e,i=!1){t!==Lm&&Wh("Internal method `_setVisible` called."),r(this,Fm,i),r(this,Nm,e)}}Im=new WeakMap,Dm=new WeakMap,Fm=new WeakMap,Nm=new WeakMap;class Um{constructor(t,e=Ul){if(s(this,Hm),s(this,Om,null),s(this,Wm,new Map),s(this,jm,null),s(this,Bm,null),this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,r(this,Bm,t.order);for(const i of t.groups)n(this,Wm).set(i.id,new $m(e,i));if("OFF"===t.baseState)for(const t of n(this,Wm).values())t._setVisible(Lm,!1);for(const e of t.on)n(this,Wm).get(e)._setVisible(Lm,!0);for(const e of t.off)n(this,Wm).get(e)._setVisible(Lm,!1);r(this,jm,this.getHash())}}isVisible(t){if(0===n(this,Wm).size)return!0;if(!t)return Nh("Optional content group not defined."),!0;if("OCG"===t.type)return n(this,Wm).has(t.id)?n(this,Wm).get(t.id).visible:(Oh(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return o(this,Hm,zm).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!n(this,Wm).has(e))return Oh(`Optional content group not found: ${e}`),!0;if(n(this,Wm).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!n(this,Wm).has(e))return Oh(`Optional content group not found: ${e}`),!0;if(!n(this,Wm).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!n(this,Wm).has(e))return Oh(`Optional content group not found: ${e}`),!0;if(!n(this,Wm).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!n(this,Wm).has(e))return Oh(`Optional content group not found: ${e}`),!0;if(n(this,Wm).get(e).visible)return!1}return!0}return Oh(`Unknown optional content policy ${t.policy}.`),!0}return Oh(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0){const i=n(this,Wm).get(t);i?(i._setVisible(Lm,!!e,!0),r(this,Om,null)):Oh(`Optional content group not found: ${t}`)}setOCGState({state:t,preserveRB:e}){let i;for(const e of t){switch(e){case"ON":case"OFF":case"Toggle":i=e;continue}const t=n(this,Wm).get(e);if(t)switch(i){case"ON":t._setVisible(Lm,!0);break;case"OFF":t._setVisible(Lm,!1);break;case"Toggle":t._setVisible(Lm,!t.visible)}}r(this,Om,null)}get hasInitialVisibility(){return null===n(this,jm)||this.getHash()===n(this,jm)}getOrder(){return n(this,Wm).size?n(this,Bm)?n(this,Bm).slice():[...n(this,Wm).keys()]:null}getGroups(){return n(this,Wm).size>0?Qh(n(this,Wm)):null}getGroup(t){return n(this,Wm).get(t)||null}getHash(){if(null!==n(this,Om))return n(this,Om);const t=new ug;for(const[e,i]of n(this,Wm))t.update(`${e}:${i.visible}`);return r(this,Om,t.hexdigest())}}Om=new WeakMap,Wm=new WeakMap,jm=new WeakMap,Bm=new WeakMap,Hm=new WeakSet,zm=function(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let s=1;s<e;s++){const e=t[s];let r;if(Array.isArray(e))r=o(this,Hm,zm).call(this,e);else{if(!n(this,Wm).has(e))return Oh(`Optional content group not found: ${e}`),!0;r=n(this,Wm).get(e).visible}switch(i){case"And":if(!r)return!1;break;case"Or":if(r)return!0;break;case"Not":return!r;default:return!0}}return"And"===i};class Vm{constructor(t,{disableRange:e=!1,disableStream:i=!1}){jh(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:n,initialData:s,progressiveDone:r,contentDispositionFilename:a}=t;if(this._queuedChunks=[],this._progressiveDone=r,this._contentDispositionFilename=a,(null==s?void 0:s.length)>0){const t=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!e,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})})),t.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})})),t.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})})),t.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),t.transportReady()}_onReceiveData({begin:t,chunk:e}){const i=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{jh(this._rangeReaders.some((function(e){return e._begin===t&&(e._enqueue(i),!0)})),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t;return(null==(t=this._fullRequestReader)?void 0:t._loaded)??0}_onProgress(t){var e,i,n,s;void 0===t.total?null==(i=null==(e=this._rangeReaders[0])?void 0:e.onProgress)||i.call(e,{loaded:t.loaded}):null==(s=null==(n=this._fullRequestReader)?void 0:n.onProgress)||s.call(n,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;null==(t=this._fullRequestReader)||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){jh(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Gm(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new qm(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){var e;null==(e=this._fullRequestReader)||e.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}}class Gm{constructor(t,e,i=!1,n=null){this._stream=t,this._done=i||!1,this._filename=cd(n)?n:null,this._queuedChunks=e||[],this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class qm{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Xm({getResponseHeader:t,isHttp:e,rangeChunkSize:i,disableRange:n}){const s={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(t("Content-Length"),10);return!Number.isInteger(r)||(s.suggestedLength=r,r<=2*i)||n||!e||"bytes"!==t("Accept-Ranges")||"identity"!==(t("Content-Encoding")||"identity")||(s.allowRangeRequests=!0),s}function Ym(t){const e=t("Content-Disposition");if(e){let t=function(t){let e=!0,i=n("filename\\*","i").exec(t);if(i){i=i[1];let t=a(i);return t=unescape(t),t=o(t),t=l(t),r(t)}if(i=function(t){const e=[];let i;const s=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=s.exec(t));){let[,t,n,s]=i;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[n,s]}const r=[];for(let t=0;t<e.length&&t in e;++t){let[i,n]=e[t];n=a(n),i&&(n=unescape(n),0===t&&(n=o(n))),r.push(n)}return r.join("")}(t),i)return r(l(i));if(i=n("filename","i").exec(t),i){i=i[1];let t=a(i);return t=l(t),r(t)}function n(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function s(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const n=new TextDecoder(t,{fatal:!0}),s=Jh(i);i=n.decode(s),e=!1}catch{}}return i}function r(t){return e&&/[\x80-\xff]/.test(t)&&(t=s("utf-8",t),e&&(t=s("iso-8859-1",t))),t}function a(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const i=e[t].indexOf('"');-1!==i&&(e[t]=e[t].slice(0,i),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function o(t){const e=t.indexOf("'");return-1===e?t:s(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function l(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,i,n){if("q"===i||"Q"===i)return s(e,n=(n=n.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})));try{n=atob(n)}catch{}return s(e,n)}))}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(cd(t))return t}return null}function Km(t,e){return 404===t||0===t&&e.startsWith("file:")?new Gh('Missing PDF "'+e+'".'):new qh(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function Jm(t){return 200===t||206===t}function Qm(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Zm(t){const e=new Headers;for(const i in t){const n=t[i];void 0!==n&&e.append(i,n)}return e}function tv(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(Oh(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class ev{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return(null==(t=this._fullRequestReader)?void 0:t._loaded)??0}getFullReader(){return jh(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new iv(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new nv(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null==(e=this._fullRequestReader)||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class iv{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._headers=Zm(this._stream.httpHeaders);const i=e.url;fetch(i,Qm(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!Jm(t.status))throw Km(t.status,i);this._reader=t.body.getReader(),this._headersCapability.resolve();const e=e=>t.headers.get(e),{allowRangeRequests:n,suggestedLength:s}=Xm({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=Ym(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Yh("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._headersCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null==(t=this.onProgress)||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:tv(e),done:!1})}cancel(t){var e;null==(e=this._reader)||e.cancel(t),this._abortController.abort()}}class nv{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const n=t.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController,this._headers=Zm(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-${i-1}`);const s=n.url;fetch(s,Qm(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!Jm(t.status))throw Km(t.status,s);this._readCapability.resolve(),this._reader=t.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null==(t=this.onProgress)||t.call(this,{loaded:this._loaded}),{value:tv(e),done:!1})}cancel(t){var e;null==(e=this._reader)||e.cancel(t),this._abortController.abort()}}class sv{constructor(t,e={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,i){const n={begin:t,end:e};for(const t in i)n[t]=i[t];return this.request(n)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const t in this.httpHeaders){const i=this.httpHeaders[t];void 0!==i&&e.setRequestHeader(t,i)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),n.expectedStatus=206):n.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(i){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=t.onHeadersReceived,n.onDone=t.onDone,n.onError=t.onError,n.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){var i;const n=this.pendingRequests[t];n&&(null==(i=n.onProgress)||i.call(n,e))}onStateChange(t,e){var i,n,s;const r=this.pendingRequests[t];if(!r)return;const a=r.xhr;if(a.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),4!==a.readyState||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===a.status&&this.isHttp)return void(null==(i=r.onError)||i.call(r,a.status));const o=a.status||200;if((200!==o||206!==r.expectedStatus)&&o!==r.expectedStatus)return void(null==(n=r.onError)||n.call(r,a.status));const l=function(t){const e=t.response;return"string"!=typeof e?e:Jh(e).buffer}(a);if(206===o){const t=a.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);r.onDone({begin:parseInt(e[1],10),chunk:l})}else l?r.onDone({begin:0,chunk:l}):null==(s=r.onError)||s.call(r,a.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class rv{constructor(t){this._source=t,this._manager=new sv(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return jh(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new av(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new ov(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null==(e=this._fullRequestReader)||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class av{constructor(t,e){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(i),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),i=t=>e.getResponseHeader(t),{allowRangeRequests:n,suggestedLength:s}=Xm({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=Ym(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=Km(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;null==(e=this.onProgress)||e.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class ov{constructor(t,e,i){this._manager=t;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,n),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var t;null==(t=this.onClosed)||t.call(this,this)}_onDone(t){const e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=Km(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||null==(e=this.onProgress)||e.call(this,{loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const lv=/^file:\/\/\/[a-zA-Z]:\//;class hv{constructor(t){this.source=t,this.url=function(t){const e=Eg.get("url"),i=e.parse(t);return"file:"===i.protocol||i.host?i:/^[a-z]:[/\\]/i.test(t)?e.parse(`file:///${t}`):(i.host||(i.protocol="file:"),i)}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return(null==(t=this._fullRequestReader)?void 0:t._loaded)??0}getFullReader(){return jh(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new gv(this):new pv(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new mv(this,t,e):new fv(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null==(e=this._fullRequestReader)||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class cv{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,null==(t=this.onProgress)||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Yh("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class dv{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,null==(t=this.onProgress)||t.call(this,{loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function uv(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class pv extends cv{constructor(t){super(t);const e=e=>{if(404===e.statusCode){const t=new Gh(`Missing PDF "${this._url}".`);return this._storedError=t,void this._headersCapability.reject(t)}this._headersCapability.resolve(),this._setReadableStream(e);const i=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:n,suggestedLength:s}=Xm({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=Ym(i)};if(this._request=null,"http:"===this._url.protocol){const i=Eg.get("http");this._request=i.request(uv(this._url,t.httpHeaders),e)}else{const i=Eg.get("https");this._request=i.request(uv(this._url,t.httpHeaders),e)}this._request.on("error",(t=>{this._storedError=t,this._headersCapability.reject(t)})),this._request.end()}}class fv extends dv{constructor(t,e,i){super(t),this._httpHeaders={};for(const e in t.httpHeaders){const i=t.httpHeaders[e];void 0!==i&&(this._httpHeaders[e]=i)}this._httpHeaders.Range=`bytes=${e}-${i-1}`;const n=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new Gh(`Missing PDF "${this._url}".`);this._storedError=t}};if(this._request=null,"http:"===this._url.protocol){const t=Eg.get("http");this._request=t.request(uv(this._url,this._httpHeaders),n)}else{const t=Eg.get("https");this._request=t.request(uv(this._url,this._httpHeaders),n)}this._request.on("error",(t=>{this._storedError=t})),this._request.end()}}class gv extends cv{constructor(t){super(t);let e=decodeURIComponent(this._url.path);lv.test(this._url.href)&&(e=e.replace(/^\//,""));const i=Eg.get("fs");i.promises.lstat(e).then((t=>{this._contentLength=t.size,this._setReadableStream(i.createReadStream(e)),this._headersCapability.resolve()}),(t=>{"ENOENT"===t.code&&(t=new Gh(`Missing PDF "${e}".`)),this._storedError=t,this._headersCapability.reject(t)}))}}class mv extends dv{constructor(t,e,i){super(t);let n=decodeURIComponent(this._url.path);lv.test(this._url.href)&&(n=n.replace(/^\//,""));const s=Eg.get("fs");this._setReadableStream(s.createReadStream(n,{start:e,end:i-1}))}}const vv=30;var bv,yv,wv,Av,_v,xv,Sv,kv,Ev,Cv,Mv,Pv,Rv,Tv,Lv,Iv,Dv,Fv,Nv,Ov,Wv,jv,Bv,Hv,zv,$v,Uv,Vv,Gv,qv,Xv,Yv,Kv,Jv,Qv,Zv;let tb=(Ov=class{constructor({textContentSource:t,container:e,viewport:i}){var a;if(s(this,zv),s(this,Uv),s(this,Gv),s(this,yv,Promise.withResolvers()),s(this,wv,null),s(this,Av,!1),s(this,_v,!(null==(bv=globalThis.FontInspector)||!bv.enabled)),s(this,xv,null),s(this,Sv,null),s(this,kv,0),s(this,Ev,0),s(this,Cv,null),s(this,Mv,null),s(this,Pv,0),s(this,Rv,0),s(this,Tv,Object.create(null)),s(this,Lv,[]),s(this,Iv,null),s(this,Dv,[]),s(this,Fv,new WeakMap),s(this,Nv,null),t instanceof ReadableStream)r(this,Iv,t);else{if("object"!=typeof t)throw new Error('No "textContentSource" parameter specified.');r(this,Iv,new ReadableStream({start(e){e.enqueue(t),e.close()}}))}r(this,wv,r(this,Mv,e)),r(this,Rv,i.scale*(globalThis.devicePixelRatio||1)),r(this,Pv,i.rotation),r(this,Sv,{prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null});const{pageWidth:l,pageHeight:h,pageX:c,pageY:d}=i.rawDims;r(this,Nv,[1,0,0,-1,-c,d+h]),r(this,Ev,l),r(this,kv,h),o(a=Ov,Kv,Jv).call(a),xd(e,i),n(this,yv).promise.catch((()=>{})).then((()=>{n(Ov,Hv).delete(this),r(this,Sv,null),r(this,Tv,null)}))}render(){const t=()=>{n(this,Cv).read().then((({value:e,done:i})=>{i?n(this,yv).resolve():(n(this,xv)??r(this,xv,e.lang),Object.assign(n(this,Tv),e.styles),o(this,zv,$v).call(this,e.items),t())}),n(this,yv).reject)};return r(this,Cv,n(this,Iv).getReader()),n(Ov,Hv).add(this),t(),n(this,yv).promise}update({viewport:t,onBefore:e=null}){var i;const s=t.scale*(globalThis.devicePixelRatio||1),a=t.rotation;if(a!==n(this,Pv)&&(null==e||e(),r(this,Pv,a),xd(n(this,Mv),{rotation:a})),s!==n(this,Rv)){null==e||e(),r(this,Rv,s);const t={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:o(i=Ov,Xv,Yv).call(i,n(this,xv))};for(const e of n(this,Dv))t.properties=n(this,Fv).get(e),t.div=e,o(this,Gv,qv).call(this,t)}}cancel(){var t;const e=new Yh("TextLayer task cancelled.");null==(t=n(this,Cv))||t.cancel(e).catch((()=>{})),r(this,Cv,null),n(this,yv).reject(e)}get textDivs(){return n(this,Dv)}get textContentItemsStr(){return n(this,Lv)}static cleanup(){if(!(n(this,Hv).size>0)){n(this,Wv).clear();for(const{canvas:t}of n(this,jv).values())t.remove();n(this,jv).clear()}}},yv=new WeakMap,wv=new WeakMap,Av=new WeakMap,_v=new WeakMap,xv=new WeakMap,Sv=new WeakMap,kv=new WeakMap,Ev=new WeakMap,Cv=new WeakMap,Mv=new WeakMap,Pv=new WeakMap,Rv=new WeakMap,Tv=new WeakMap,Lv=new WeakMap,Iv=new WeakMap,Dv=new WeakMap,Fv=new WeakMap,Nv=new WeakMap,Wv=new WeakMap,jv=new WeakMap,Bv=new WeakMap,Hv=new WeakMap,zv=new WeakSet,$v=function(t){var e,i;if(n(this,Av))return;(i=n(this,Sv)).ctx??(i.ctx=o(e=Ov,Xv,Yv).call(e,n(this,xv)));const s=n(this,Dv),a=n(this,Lv);for(const e of t){if(s.length>1e5)return Oh("Ignoring additional textDivs for performance reasons."),void r(this,Av,!0);if(void 0!==e.str)a.push(e.str),o(this,Uv,Vv).call(this,e);else if("beginMarkedContentProps"===e.type||"beginMarkedContent"===e.type){const t=n(this,wv);r(this,wv,document.createElement("span")),n(this,wv).classList.add("markedContent"),null!==e.id&&n(this,wv).setAttribute("id",`${e.id}`),t.append(n(this,wv))}else"endMarkedContent"===e.type&&r(this,wv,n(this,wv).parentNode)}},Uv=new WeakSet,Vv=function(t){var e;const i=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};n(this,Dv).push(i);const r=rc.transform(n(this,Nv),t.transform);let a=Math.atan2(r[1],r[0]);const l=n(this,Tv)[t.fontName];l.vertical&&(a+=Math.PI/2);const h=n(this,_v)&&l.fontSubstitution||l.fontFamily,c=Math.hypot(r[2],r[3]),d=c*o(e=Ov,Qv,Zv).call(e,h,n(this,xv));let u,p;0===a?(u=r[4],p=r[5]-d):(u=r[4]+d*Math.sin(a),p=r[5]-d*Math.cos(a));const f="calc(var(--scale-factor)*",g=i.style;n(this,wv)===n(this,Mv)?(g.left=`${(100*u/n(this,Ev)).toFixed(2)}%`,g.top=`${(100*p/n(this,kv)).toFixed(2)}%`):(g.left=`${f}${u.toFixed(2)}px)`,g.top=`${f}${p.toFixed(2)}px)`),g.fontSize=`${f}${(n(Ov,Bv)*c).toFixed(2)}px)`,g.fontFamily=h,s.fontSize=c,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,n(this,_v)&&(i.dataset.fontName=l.fontSubstitutionLoadedName||t.fontName),0!==a&&(s.angle=a*(180/Math.PI));let m=!1;if(t.str.length>1)m=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),i=Math.abs(t.transform[3]);e!==i&&Math.max(e,i)/Math.min(e,i)>1.5&&(m=!0)}if(m&&(s.canvasWidth=l.vertical?t.height:t.width),n(this,Fv).set(i,s),n(this,Sv).div=i,n(this,Sv).properties=s,o(this,Gv,qv).call(this,n(this,Sv)),s.hasText&&n(this,wv).append(i),s.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),n(this,wv).append(t)}},Gv=new WeakSet,qv=function(t){const{div:e,properties:i,ctx:s,prevFontSize:r,prevFontFamily:a}=t,{style:o}=e;let l="";if(n(Ov,Bv)>1&&(l=`scale(${1/n(Ov,Bv)})`),0!==i.canvasWidth&&i.hasText){const{fontFamily:h}=o,{canvasWidth:c,fontSize:d}=i;(r!==d||a!==h)&&(s.font=`${d*n(this,Rv)}px ${h}`,t.prevFontSize=d,t.prevFontFamily=h);const{width:u}=s.measureText(e.textContent);u>0&&(l=`scaleX(${c*n(this,Rv)/u}) ${l}`)}0!==i.angle&&(l=`rotate(${i.angle}deg) ${l}`),l.length>0&&(o.transform=l)},Xv=new WeakSet,Yv=function(t=null){let e=n(this,jv).get(t||(t=""));if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),n(this,jv).set(t,e)}return e},Kv=new WeakSet,Jv=function(){if(null!==n(this,Bv))return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),r(this,Bv,t.getBoundingClientRect().height),t.remove()},Qv=new WeakSet,Zv=function(t,e){const i=n(this,Wv).get(t);if(i)return i;const s=o(this,Xv,Yv).call(this,e),r=s.font;s.canvas.width=s.canvas.height=vv,s.font=`30px ${t}`;const a=s.measureText("");let l=a.fontBoundingBoxAscent,h=Math.abs(a.fontBoundingBoxDescent);if(l){const e=l/(l+h);return n(this,Wv).set(t,e),s.canvas.width=s.canvas.height=0,s.font=r,e}s.strokeStyle="red",s.clearRect(0,0,vv,vv),s.strokeText("g",0,0);let c=s.getImageData(0,0,vv,vv).data;h=0;for(let t=c.length-1-3;t>=0;t-=4)if(c[t]>0){h=Math.ceil(t/4/vv);break}s.clearRect(0,0,vv,vv),s.strokeText("A",0,vv),c=s.getImageData(0,0,vv,vv).data,l=0;for(let t=0,e=c.length;t<e;t+=4)if(c[t]>0){l=vv-Math.floor(t/4/vv);break}s.canvas.width=s.canvas.height=0,s.font=r;const d=l?l/(l+h):.8;return n(this,Wv).set(t,d),d},s(Ov,Xv),s(Ov,Kv),s(Ov,Qv),s(Ov,Wv,new Map),s(Ov,jv,new Map),s(Ov,Bv,null),s(Ov,Hv,new Set),Ov);function eb(){md("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:t,container:e,viewport:i,...n}=arguments[0],s=Object.keys(n);s.length>0&&Oh("Ignoring `renderTextLayer` parameters: "+s.join(", "));const r=new tb({textContentSource:t,container:e,viewport:i}),{textDivs:a,textContentItemsStr:o}=r;return{promise:r.render(),textDivs:a,textContentItemsStr:o}}function ib(){md("`updateTextLayer`, please use `TextLayer` instead.")}class nb{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){var n;if(!i)return;let s=null;const r=i.name;if("#text"===r)s=i.value;else{if(!nb.shouldBuildText(r))return;null!=(n=null==i?void 0:i.attributes)&&n.textContent?s=i.attributes.textContent:i.value&&(s=i.value)}if(null!==s&&e.push({str:s}),i.children)for(const e of i.children)t(e)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}const sb=65536,rb=jl?class extends _c{_createCanvas(t,e){return Eg.get("canvas").createCanvas(t,e)}}:class extends _c{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}={}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}},ab=jl?class extends xc{_fetchData(t,e){return Cg(t).then((t=>({cMapData:t,compressionType:e})))}}:sd,ob=jl?class extends yc{}:class extends yc{constructor({docId:t,ownerDocument:e=globalThis.document}={}){super(),s(this,Fc),s(this,Oc),s(this,jc),s(this,Hc),s(this,$c),s(this,Vc),s(this,qc),s(this,Yc),s(this,Jc),s(this,Zc),s(this,ed),s(this,Pc,void 0),s(this,Rc,void 0),s(this,Tc,void 0),s(this,Lc,void 0),s(this,Ic,void 0),s(this,Dc,0),r(this,Tc,t),r(this,Lc,e)}addFilter(t){if(!t)return"none";let e=n(this,Fc,Nc).get(t);if(e)return e;const[i,s,r]=o(this,Hc,zc).call(this,t),l=1===t.length?i:`${i}${s}${r}`;if(e=n(this,Fc,Nc).get(l),e)return n(this,Fc,Nc).set(t,e),e;const h=`g_${n(this,Tc)}_transfer_map_${a(this,Dc)._++}`,c=`url(#${h})`;n(this,Fc,Nc).set(t,c),n(this,Fc,Nc).set(l,c);const d=o(this,qc,Xc).call(this,h);return o(this,Jc,Qc).call(this,i,s,r,d),c}addHCMFilter(t,e){var i;const s=`${t}-${e}`,r="base";let a=n(this,Oc,Wc).get(r);if((null==a?void 0:a.key)===s||(a?(null==(i=a.filter)||i.remove(),a.key=s,a.url="none",a.filter=null):(a={key:s,url:"none",filter:null},n(this,Oc,Wc).set(r,a)),!t||!e))return a.url;const l=o(this,ed,id).call(this,t);t=rc.makeHexColor(...l);const h=o(this,ed,id).call(this,e);if(e=rc.makeHexColor(...h),n(this,jc,Bc).style.color="","#000000"===t&&"#ffffff"===e||t===e)return a.url;const c=new Array(256);for(let t=0;t<=255;t++){const e=t/255;c[t]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}const d=c.join(","),u=`g_${n(this,Tc)}_hcm_filter`,p=a.filter=o(this,qc,Xc).call(this,u);o(this,Jc,Qc).call(this,d,d,d,p),o(this,Vc,Gc).call(this,p);const f=(t,e)=>{const i=l[t]/255,n=h[t]/255,s=new Array(e+1);for(let t=0;t<=e;t++)s[t]=i+t/e*(n-i);return s.join(",")};return o(this,Jc,Qc).call(this,f(0,5),f(1,5),f(2,5),p),a.url=`url(#${u})`,a.url}addAlphaFilter(t){let e=n(this,Fc,Nc).get(t);if(e)return e;const[i]=o(this,Hc,zc).call(this,[t]),s=`alpha_${i}`;if(e=n(this,Fc,Nc).get(s),e)return n(this,Fc,Nc).set(t,e),e;const r=`g_${n(this,Tc)}_alpha_map_${a(this,Dc)._++}`,l=`url(#${r})`;n(this,Fc,Nc).set(t,l),n(this,Fc,Nc).set(s,l);const h=o(this,qc,Xc).call(this,r);return o(this,Zc,td).call(this,i,h),l}addLuminosityFilter(t){let e,i,s=n(this,Fc,Nc).get(t||"luminosity");if(s)return s;if(t?([e]=o(this,Hc,zc).call(this,[t]),i=`luminosity_${e}`):i="luminosity",s=n(this,Fc,Nc).get(i),s)return n(this,Fc,Nc).set(t,s),s;const r=`g_${n(this,Tc)}_luminosity_map_${a(this,Dc)._++}`,l=`url(#${r})`;n(this,Fc,Nc).set(t,l),n(this,Fc,Nc).set(i,l);const h=o(this,qc,Xc).call(this,r);return o(this,$c,Uc).call(this,h),t&&o(this,Zc,td).call(this,e,h),l}addHighlightHCMFilter(t,e,i,s,r){var a;const l=`${e}-${i}-${s}-${r}`;let h=n(this,Oc,Wc).get(t);if((null==h?void 0:h.key)===l||(h?(null==(a=h.filter)||a.remove(),h.key=l,h.url="none",h.filter=null):(h={key:l,url:"none",filter:null},n(this,Oc,Wc).set(t,h)),!e||!i))return h.url;const[c,d]=[e,i].map(o(this,ed,id).bind(this));let u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),p=Math.round(.2126*d[0]+.7152*d[1]+.0722*d[2]),[f,g]=[s,r].map(o(this,ed,id).bind(this));p<u&&([u,p,f,g]=[p,u,g,f]),n(this,jc,Bc).style.color="";const m=(t,e,i)=>{const n=new Array(256),s=(p-u)/i,r=t/255,a=(e-t)/(255*i);let o=0;for(let t=0;t<=i;t++){const e=Math.round(u+t*s),i=r+t*a;for(let t=o;t<=e;t++)n[t]=i;o=e+1}for(let t=o;t<256;t++)n[t]=n[o-1];return n.join(",")},v=`g_${n(this,Tc)}_hcm_${t}_filter`,b=h.filter=o(this,qc,Xc).call(this,v);return o(this,Vc,Gc).call(this,b),o(this,Jc,Qc).call(this,m(f[0],g[0],5),m(f[1],g[1],5),m(f[2],g[2],5),b),h.url=`url(#${v})`,h.url}destroy(t=!1){t&&0!==n(this,Oc,Wc).size||(n(this,Rc)&&(n(this,Rc).parentNode.parentNode.remove(),r(this,Rc,null)),n(this,Pc)&&(n(this,Pc).clear(),r(this,Pc,null)),r(this,Dc,0))}},lb=jl?class extends Sc{_fetchData(t){return Cg(t)}}:rd;function hb(t={}){"string"==typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new pb,{docId:i}=e,n=t.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(jl&&"string"==typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,s=t.data?function(t){if(jl&&typeof Buffer<"u"&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return Jh(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"==typeof t&&!isNaN(null==t?void 0:t.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,r=t.httpHeaders||null,a=!0===t.withCredentials,o=t.password??null,l=t.range instanceof fb?t.range:null,h=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:sb;let c=t.worker instanceof Ib?t.worker:null;const d=t.verbosity,u="string"!=typeof t.docBaseUrl||hd(t.docBaseUrl)?null:t.docBaseUrl,p="string"==typeof t.cMapUrl?t.cMapUrl:null,f=!1!==t.cMapPacked,g=t.CMapReaderFactory||ab,m="string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,v=t.StandardFontDataFactory||lb,b=!0!==t.stopAtErrors,y=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,w=!1!==t.isEvalSupported,A="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!jl,_=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,x="boolean"==typeof t.disableFontFace?t.disableFontFace:jl,S=!0===t.fontExtraProperties,k=!0===t.enableXfa,E=t.ownerDocument||globalThis.document,C=!0===t.disableRange,M=!0===t.disableStream,P=!0===t.disableAutoFetch,R=!0===t.pdfBug,T=!0===t.enableHWA,L=l?l.length:t.length??NaN,I="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!jl&&!x,D="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:g===sd&&v===rd&&p&&m&&fd(p,document.baseURI)&&fd(m,document.baseURI),F=t.canvasFactory||new rb({ownerDocument:E,enableHWA:T}),N=t.filterFactory||new ob({docId:i,ownerDocument:E});!function(t){Number.isInteger(t)&&(Dh=t)}(d);const O={canvasFactory:F,filterFactory:N};if(D||(O.cMapReaderFactory=new g({baseUrl:p,isCompressed:f}),O.standardFontDataFactory=new v({baseUrl:m})),!c){const t={verbosity:d,port:cm.workerPort};c=t.port?Ib.fromPort(t):new Ib(t),e._worker=c}const W={docId:i,apiVersion:"4.4.168",data:s,password:o,disableAutoFetch:P,rangeChunkSize:h,length:L,docBaseUrl:u,enableXfa:k,evaluatorOptions:{maxImageSize:y,disableFontFace:x,ignoreErrors:b,isEvalSupported:w,isOffscreenCanvasSupported:A,canvasMaxAreaInBytes:_,fontExtraProperties:S,useSystemFonts:I,cMapUrl:D?p:null,standardFontDataUrl:D?m:null}},j={disableFontFace:x,fontExtraProperties:S,ownerDocument:E,pdfBug:R,styleElement:null,loadingParams:{disableAutoFetch:P,enableXfa:k}};return c.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const t=c.messageHandler.sendWithPromise("GetDocRequest",W,s?[s.buffer]:null);let o;if(l)o=new Vm(l,{disableRange:C,disableStream:M});else if(!s){if(!n)throw new Error("getDocument - no `url` parameter provided.");d={url:n,length:L,httpHeaders:r,withCredentials:a,rangeChunkSize:h,disableRange:C,disableStream:M},o=jl?typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype&&fd(d.url)?new ev(d):new hv(d):fd(d.url)?new ev(d):new rv(d)}var d;return t.then((t=>{if(e.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const n=new Rm(i,t,c.port),s=new Hb(n,e,o,j,O);e._transport=s,n.send("Ready",null)}))})).catch(e._capability.reject),e}function cb(t){return"object"==typeof t&&Number.isInteger(null==t?void 0:t.num)&&t.num>=0&&Number.isInteger(null==t?void 0:t.gen)&&t.gen>=0}var db;const ub=class{constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d"+a(ub,db)._++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var t,e,i;this.destroyed=!0;try{null!=(t=this._worker)&&t.port&&(this._worker._pendingDestroy=!0),await(null==(e=this._transport)?void 0:e.destroy())}catch(t){throw null!=(i=this._worker)&&i.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};let pb=ub;db=new WeakMap,s(pb,db,0);let fb=class{constructor(t,e,i=!1,n=null){this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const i of this._progressListeners)i(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){Wh("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class gb{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Hh(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var mb,vb,bb,yb,wb,Ab,_b,xb;class Sb{constructor(t,e,i,n=!1){s(this,bb),s(this,wb),s(this,mb,null),s(this,vb,!1),this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new pd:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new Yb,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:s=!1}={}){return new od({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Hh(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return(null==(t=this._transport._htmlForXfa)?void 0:t.children[this._pageIndex])||null}render({canvasContext:t,viewport:e,intent:i="display",annotationMode:n=Kl.ENABLE,transform:s=null,background:a=null,optionalContentConfigPromise:l=null,annotationCanvasMap:h=null,pageColors:c=null,printAnnotationStorage:d=null}){var u,p;null==(u=this._stats)||u.time("Overall");const f=this._transport.getRenderingIntent(i,n,d),{renderingIntent:g,cacheKey:m}=f;r(this,vb,!1),o(this,wb,Ab).call(this),l||(l=this._transport.getOptionalContentConfig(g));let v=this._intentStates.get(m);v||(v=Object.create(null),this._intentStates.set(m,v)),v.streamReaderCancelTimeout&&(clearTimeout(v.streamReaderCancelTimeout),v.streamReaderCancelTimeout=null);const b=!!(g&Vl);v.displayReadyCapability||(v.displayReadyCapability=Promise.withResolvers(),v.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null==(p=this._stats)||p.time("Page Request"),this._pumpOperatorList(f));const y=t=>{var e;v.renderTasks.delete(w),(this._maybeCleanupAfterRender||b)&&r(this,vb,!0),o(this,bb,yb).call(this,!b),t?(w.capability.reject(t),this._abortOperatorList({intentState:v,reason:t instanceof Error?t:new Error(t)})):w.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),null!=(e=globalThis.Stats)&&e.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},w=new Qb({callback:y,params:{canvasContext:t,viewport:e,transform:s,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:v.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!b,pdfBug:this._pdfBug,pageColors:c});(v.renderTasks||(v.renderTasks=new Set)).add(w);const A=w.task;return Promise.all([v.displayReadyCapability.promise,l]).then((([t,e])=>{var i;if(this.destroyed)y();else{if(null==(i=this._stats)||i.time("Rendering"),!(e.renderingIntent&g))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");w.initializeGraphics({transparency:t,optionalContentConfig:e}),w.operatorListChanged()}})).catch(y),A}getOperatorList({intent:t="display",annotationMode:e=Kl.ENABLE,printAnnotationStorage:i=null}={}){var n;const s=this._transport.getRenderingIntent(t,e,i,!0);let r,a=this._intentStates.get(s.cacheKey);return a||(a=Object.create(null),this._intentStates.set(s.cacheKey,a)),a.opListReadCapability||(r=Object.create(null),r.operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(r))},a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||(a.renderTasks=new Set)).add(r),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null==(n=this._stats)||n.time("Page Request"),this._pumpOperatorList(s)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then((t=>nb.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,i){const n=e.getReader(),s={items:[],styles:Object.create(null),lang:null};!function e(){n.read().then((function({value:i,done:n}){n?t(s):(s.lang??(s.lang=i.lang),Object.assign(s.styles,i.styles),s.items.push(...i.items),e())}),i)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),r(this,vb,!1),o(this,wb,Ab).call(this),Promise.all(t)}cleanup(t=!1){r(this,vb,!0);const e=o(this,bb,yb).call(this,!1);return t&&e&&this._stats&&(this._stats=new pd),e}_startRenderPage(t,e){var i,n;const s=this._intentStates.get(e);s&&(null==(i=this._stats)||i.timeEnd("Page Request"),null==(n=s.displayReadyCapability)||n.resolve(t))}_renderPageChunk(t,e){for(let i=0,n=t.length;i<n;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const t of e.renderTasks)t.operatorListChanged();t.lastChunk&&o(this,bb,yb).call(this,!0)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:i}){const{map:n,transfer:s}=i,r=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:n},s).getReader(),a=this._intentStates.get(e);a.streamReader=r;const l=()=>{r.read().then((({value:t,done:e})=>{e?a.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,a),l())}),(t=>{if(a.streamReader=null,!this._transport.destroyed){if(a.operatorList){a.operatorList.lastChunk=!0;for(const t of a.renderTasks)t.operatorListChanged();o(this,bb,yb).call(this,!0)}if(a.displayReadyCapability)a.displayReadyCapability.reject(t);else{if(!a.opListReadCapability)throw t;a.opListReadCapability.reject(t)}}}))};l()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(e instanceof ld){let i=100;return e.extraDelay>0&&e.extraDelay<1e3&&(i+=e.extraDelay),void(t.streamReaderCancelTimeout=setTimeout((()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})}),i))}}if(t.streamReader.cancel(new Yh(e.message)).catch((()=>{})),t.streamReader=null,!this._transport.destroyed){for(const[e,i]of this._intentStates)if(i===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}mb=new WeakMap,vb=new WeakMap,bb=new WeakSet,yb=function(t=!1){if(o(this,wb,Ab).call(this),!n(this,vb)||this.destroyed)return!1;if(t)return r(this,mb,setTimeout((()=>{r(this,mb,null),o(this,bb,yb).call(this,!1)}),5e3)),!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),r(this,vb,!1),!0},wb=new WeakSet,Ab=function(){n(this,mb)&&(clearTimeout(n(this,mb)),r(this,mb,null))};class kb{constructor(){s(this,_b,new Set),s(this,xb,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};n(this,xb).then((()=>{for(const t of n(this,_b))t.call(this,i)}))}addEventListener(t,e){n(this,_b).add(e)}removeEventListener(t,e){n(this,_b).delete(e)}terminate(){n(this,_b).clear()}}_b=new WeakMap,xb=new WeakMap;const Eb={isWorkerDisabled:!1,fakeWorkerId:0};var Cb,Mb,Pb,Rb,Tb;jl&&(Eb.isWorkerDisabled=!0,cm.workerSrc||(cm.workerSrc="./pdf.worker.mjs")),Eb.isSameOrigin=function(t,e){let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch{return!1}const n=new URL(e,i);return i.origin===n.origin},Eb.createCDNWrapper=function(t){const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};const Lb=class{constructor({name:t=null,port:e=null,verbosity:i=Fh()}={}){var a;if(s(this,Mb),this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){if(null!=(a=n(Lb,Cb))&&a.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(n(Lb,Cb)||r(Lb,Cb,new WeakMap)).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return jl?Promise.all([Eg.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new Rm("main","worker",t),this._messageHandler.on("ready",(function(){})),o(this,Mb,Pb).call(this)}_initialize(){if(Eb.isWorkerDisabled||n(Lb,Rb,Tb))return void this._setupFakeWorker();let{workerSrc:t}=Lb;try{Eb.isSameOrigin(window.location.href,t)||(t=Eb.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new Rm("main","worker",e),n=()=>{s.abort(),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=new AbortController;e.addEventListener("error",(()=>{this._webWorker||n()}),{signal:s.signal}),i.on("test",(t=>{s.abort(),!this.destroyed&&t?(this._messageHandler=i,this._port=e,this._webWorker=e,o(this,Mb,Pb).call(this)):n()})),i.on("ready",(t=>{if(s.abort(),this.destroyed)n();else try{r()}catch{this._setupFakeWorker()}}));const r=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void r()}catch{Nh("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){Eb.isWorkerDisabled||(Oh("Setting up fake worker."),Eb.isWorkerDisabled=!0),Lb._setupFakeWorkerGlobal.then((t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new kb;this._port=e;const i="fake"+Eb.fakeWorkerId++,n=new Rm(i+"_worker",i,e);t.setup(n,e),this._messageHandler=new Rm(i,i+"_worker",e),o(this,Mb,Pb).call(this)})).catch((t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){var t;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null==(t=n(Lb,Cb))||t.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){var e;if(null==t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const i=null==(e=n(this,Cb))?void 0:e.get(t.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new Lb(t)}static get workerSrc(){if(cm.workerSrc)return cm.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Hh(this,"_setupFakeWorkerGlobal",(async()=>n(this,Rb,Tb)?n(this,Rb,Tb):(await import(this.workerSrc)).WorkerMessageHandler)())}};let Ib=Lb;var Db,Fb,Nb,Ob,Wb,jb,Bb;Cb=new WeakMap,Mb=new WeakSet,Pb=function(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})},Rb=new WeakSet,Tb=function(){var t;try{return(null==(t=globalThis.pdfjsWorker)?void 0:t.WorkerMessageHandler)||null}catch{return null}},s(Ib,Rb),s(Ib,Cb,void 0);class Hb{constructor(t,e,i,n,r){s(this,jb),s(this,Db,new Map),s(this,Fb,new Map),s(this,Nb,new Map),s(this,Ob,new Map),s(this,Wb,null),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new Yb,this.fontLoader=new _g({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.cMapReaderFactory=r.cMapReaderFactory,this.standardFontDataFactory=r.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return Hh(this,"annotationStorage",new wg)}getRenderingIntent(t,e=Kl.ENABLE,i=null,n=!1){let s=Ul,r=pg;switch(t){case"any":s=$l;break;case"display":break;case"print":s=Vl;break;default:Oh(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case Kl.DISABLE:s+=Xl;break;case Kl.ENABLE:break;case Kl.ENABLE_FORMS:s+=Gl;break;case Kl.ENABLE_STORAGE:s+=ql,r=(s&Vl&&i instanceof Ag?i:this.annotationStorage).serializable;break;default:Oh(`getRenderingIntent - invalid annotationMode: ${e}`)}return n&&(s+=Yl),{renderingIntent:s,cacheKey:`${s}_${r.hash}`,annotationStorageSerializable:r}}destroy(){var t;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null==(t=n(this,Wb))||t.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const t of n(this,Fb).values())e.push(t._destroy());n(this,Fb).clear(),n(this,Nb).clear(),n(this,Ob).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return e.push(i),Promise.all(e).then((()=>{var t;this.commonObjs.clear(),this.fontLoader.clear(),n(this,Db).clear(),this.filterFactory.destroy(),tb.cleanup(),null==(t=this._networkStream)||t.cancelAllRequests(new Yh("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{jh(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then((function({value:t,done:i}){i?e.close():(jh(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}})),t.on("ReaderHeadersReady",(t=>{const i=Promise.withResolvers(),n=this._fullReader;return n.headersReady.then((()=>{var t;(!n.isStreamingSupported||!n.isRangeSupported)&&(this._lastProgress&&(null==(t=e.onProgress)||t.call(e,this._lastProgress)),n.onProgress=t=>{var i;null==(i=e.onProgress)||i.call(e,{loaded:t.loaded,total:t.total})}),i.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})}),i.reject),i.promise})),t.on("GetRangeReader",((t,e)=>{jh(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);i?(e.onPull=()=>{i.read().then((function({value:t,done:i}){i?e.close():(jh(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{i.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}):e.close()})),t.on("GetDoc",(({pdfInfo:t})=>{this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,e._capability.resolve(new gb(t,this))})),t.on("DocException",(function(t){let i;switch(t.name){case"PasswordException":i=new $h(t.message,t.code);break;case"InvalidPDFException":i=new Vh(t.message);break;case"MissingPDFException":i=new Gh(t.message);break;case"UnexpectedResponseException":i=new qh(t.message,t.status);break;case"UnknownErrorException":i=new Uh(t.message,t.details);break;default:Wh("DocException - expected a valid Error.")}e._capability.reject(i)})),t.on("PasswordRequest",(t=>{if(r(this,Wb,Promise.withResolvers()),e.onPassword){const i=t=>{t instanceof Error?n(this,Wb).reject(t):n(this,Wb).resolve({password:t})};try{e.onPassword(i,t.code)}catch(t){n(this,Wb).reject(t)}}else n(this,Wb).reject(new $h(t.message,t.code));return n(this,Wb).promise})),t.on("DataLoaded",(t=>{var i;null==(i=e.onProgress)||i.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(t=>{this.destroyed||n(this,Fb).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(([e,i,s])=>{var r;if(this.destroyed||this.commonObjs.has(e))return null;switch(i){case"Font":const{disableFontFace:a,fontExtraProperties:o,pdfBug:l}=this._params;if("error"in s){const t=s.error;Oh(`Error during font loading: ${t}`),this.commonObjs.resolve(e,t);break}const h=l&&null!=(r=globalThis.FontInspector)&&r.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,c=new xg(s,{disableFontFace:a,inspectFont:h});this.fontLoader.bind(c).catch((()=>t.sendWithPromise("FontFallback",{id:e}))).finally((()=>{!o&&c.data&&(c.data=null),this.commonObjs.resolve(e,c)}));break;case"CopyLocalImage":const{imageRef:d}=s;jh(d,"The imageRef must be defined.");for(const t of n(this,Fb).values())for(const[,i]of t.objs)if((null==i?void 0:i.ref)===d)return i.dataLen?(this.commonObjs.resolve(e,structuredClone(i)),i.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(e,s);break;default:throw new Error(`Got unknown common object type ${i}`)}return null})),t.on("obj",(([t,e,i,s])=>{var r;if(this.destroyed)return;const a=n(this,Fb).get(e);if(!a.objs.has(t)){if(0===a._intentStates.size)return void(null==(r=null==s?void 0:s.bitmap)||r.close());switch(i){case"Image":a.objs.resolve(t,s),(null==s?void 0:s.dataLen)>1e7&&(a._maybeCleanupAfterRender=!0);break;case"Pattern":a.objs.resolve(t,s);break;default:throw new Error(`Got unknown object type ${i}`)}}})),t.on("DocProgress",(t=>{var i;this.destroyed||null==(i=e.onProgress)||i.call(e,{loaded:t.loaded,total:t.total})})),t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t;this.annotationStorage.size<=0&&Oh("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:i}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:(null==(t=this._fullReader)?void 0:t.filename)??null},i).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=n(this,Nb).get(e);if(i)return i;const s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&n(this,Ob).set(i.refStr,t);const s=new Sb(e,i,this,this._params.pdfBug);return n(this,Fb).set(e,s),s}));return n(this,Nb).set(e,s),s}getPageIndex(t){return cb(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return o(this,jb,Bb).call(this,"GetFieldObjects")}hasJSActions(){return o(this,jb,Bb).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return o(this,jb,Bb).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return o(this,jb,Bb).call(this,"GetOptionalContentConfig").then((e=>new Um(e,t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=n(this,Db).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then((t=>{var e,i;return{info:t[0],metadata:t[1]?new Tm(t[1]):null,contentDispositionFilename:(null==(e=this._fullReader)?void 0:e.filename)??null,contentLength:(null==(i=this._fullReader)?void 0:i.contentLength)??null}}));return n(this,Db).set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of n(this,Fb).values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),n(this,Db).clear(),this.filterFactory.destroy(!0),tb.cleanup()}}cachedPageNumber(t){if(!cb(t))return null;const e=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;return n(this,Ob).get(e)??null}}Db=new WeakMap,Fb=new WeakMap,Nb=new WeakMap,Ob=new WeakMap,Wb=new WeakMap,jb=new WeakSet,Bb=function(t,e=null){const i=n(this,Db).get(t);if(i)return i;const s=this.messageHandler.sendWithPromise(t,e);return n(this,Db).set(t,s),s};const zb=Symbol("INITIAL_DATA");var $b,Ub,Vb,Gb,qb,Xb;class Yb{constructor(){s(this,Ub),s(this,$b,Object.create(null))}get(t,e=null){if(e){const i=o(this,Ub,Vb).call(this,t);return i.promise.then((()=>e(i.data))),null}const i=n(this,$b)[t];if(!i||i.data===zb)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const e=n(this,$b)[t];return!!e&&e.data!==zb}resolve(t,e=null){const i=o(this,Ub,Vb).call(this,t);i.data=e,i.resolve()}clear(){var t;for(const e in n(this,$b)){const{data:i}=n(this,$b)[e];null==(t=null==i?void 0:i.bitmap)||t.close()}r(this,$b,Object.create(null))}*[Symbol.iterator](){for(const t in n(this,$b)){const{data:e}=n(this,$b)[t];e!==zb&&(yield[t,e])}}}$b=new WeakMap,Ub=new WeakSet,Vb=function(t){var e;return(e=n(this,$b))[t]||(e[t]={...Promise.withResolvers(),data:zb})};class Kb{constructor(t){s(this,Gb,null),r(this,Gb,t),this.onContinue=null}get promise(){return n(this,Gb).capability.promise}cancel(t=0){n(this,Gb).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=n(this,Gb).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=n(this,Gb);return t.form||t.canvas&&(null==e?void 0:e.size)>0}}Gb=new WeakMap;const Jb=class{constructor({callback:t,params:e,objs:i,commonObjs:n,annotationCanvasMap:r,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:h,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:u=null}){s(this,qb,null),this.callback=t,this.params=e,this.objs=i,this.commonObjs=n,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=h,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Kb(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=e.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){var i,s;if(this.cancelled)return;if(this._canvas){if(n(Jb,Xb).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");n(Jb,Xb).add(this._canvas)}this._pdfBug&&null!=(i=globalThis.StepperManager)&&i.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:r,viewport:a,transform:o,background:l}=this.params;this.gfx=new om(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:a,transparency:t,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,null==(s=this.graphicsReadyCallback)||s.call(this)}cancel(t=null,e=0){var i;this.running=!1,this.cancelled=!0,null==(i=this.gfx)||i.endDrawing(),n(this,qb)&&(window.cancelAnimationFrame(n(this,qb)),r(this,qb,null)),n(Jb,Xb).delete(this._canvas),this.callback(t||new ld(`Rendering cancelled, page ${this._pageIndex+1}`,e))}operatorListChanged(){var t;this.graphicsReady?(null==(t=this.stepper)||t.updateOperatorList(this.operatorList),!this.running&&this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?r(this,qb,window.requestAnimationFrame((()=>{r(this,qb,null),this._nextBound().catch(this._cancelBound)}))):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),n(Jb,Xb).delete(this._canvas),this.callback())))}};let Qb=Jb;qb=new WeakMap,Xb=new WeakMap,s(Qb,Xb,new WeakSet);const Zb="4.4.168",ty="19fbc8998";function ey(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function iy(t){return Math.max(0,Math.min(255,255*t))}class ny{static CMYK_G([t,e,i,n]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+n)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=iy(t),t,t]}static G_HTML([t]){const e=ey(t);return`#${e}${e}${e}`}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_rgb(t){return t.map(iy)}static RGB_HTML(t){return`#${t.map(ey).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,i,n]){return["RGB",1-Math.min(1,t+n),1-Math.min(1,i+n),1-Math.min(1,e+n)]}static CMYK_rgb([t,e,i,n]){return[iy(1-Math.min(1,t+n)),iy(1-Math.min(1,i+n)),iy(1-Math.min(1,e+n))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,i]){const n=1-t,s=1-e,r=1-i;return["CMYK",n,s,r,Math.min(n,s,r)]}}class sy{static setupStorage(t,e,i,n,s){const r=n.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==r.value&&(t.textContent=r.value),"print"===s)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(r.value===i.attributes.xfaOn?t.setAttribute("checked",!0):r.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",(t=>{n.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{if(null!==r.value&&t.setAttribute("value",r.value),"print"===s)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==r.value){t.setAttribute("value",r.value);for(const t of i.children)t.attributes.value===r.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",(t=>{const i=t.target.options,s=-1===i.selectedIndex?"":i[i.selectedIndex].value;n.setValue(e,{value:s})}))}}static setAttributes({html:t,element:e,storage:i=null,intent:n,linkService:s}){const{attributes:r}=e,a=t instanceof HTMLAnchorElement;"radio"===r.type&&(r.name=`${r.name}-${n}`);for(const[e,i]of Object.entries(r))if(null!=i)switch(e){case"class":i.length&&t.setAttribute(e,i.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",i);break;case"style":Object.assign(t.style,i);break;case"textContent":t.textContent=i;break;default:(!a||"href"!==e&&"newWindow"!==e)&&t.setAttribute(e,i)}a&&s.addLinkAttributes(t,r.href,r.newWindow),i&&r.dataId&&this.setupStorage(t,r.dataId,e,i)}static render(t){var e,i;const n=t.annotationStorage,s=t.linkService,r=t.xfaHtml,a=t.intent||"display",o=document.createElement(r.name);r.attributes&&this.setAttributes({html:o,element:r,intent:a,linkService:s});const l="richText"!==a,h=t.div;if(h.append(o),t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;h.style.transform=e}l&&h.setAttribute("class","xfaLayer xfaFont");const c=[];if(0===r.children.length){if(r.value){const t=document.createTextNode(r.value);o.append(t),l&&nb.shouldBuildText(r.name)&&c.push(t)}return{textDivs:c}}const d=[[r,-1,o]];for(;d.length>0;){const[t,r,o]=d.at(-1);if(r+1===t.children.length){d.pop();continue}const h=t.children[++d.at(-1)[1]];if(null===h)continue;const{name:u}=h;if("#text"===u){const t=document.createTextNode(h.value);c.push(t),o.append(t);continue}const p=null!=(e=null==h?void 0:h.attributes)&&e.xmlns?document.createElementNS(h.attributes.xmlns,u):document.createElement(u);if(o.append(p),h.attributes&&this.setAttributes({html:p,element:h,storage:n,intent:a,linkService:s}),(null==(i=h.children)?void 0:i.length)>0)d.push([h,-1,p]);else if(h.value){const t=document.createTextNode(h.value);l&&nb.shouldBuildText(u)&&c.push(t),p.append(t)}}for(const t of h.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const ry=1e3,ay=new WeakSet;function oy(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class ly{static create(t){switch(t.data.annotationType){case lh:return new Aw(t);case oh:return new _w(t);case Sh:switch(t.data.fieldType){case"Tx":return new Sw(t);case"Btn":return t.data.radioButton?new Cw(t):t.data.checkBox?new Ew(t):new Mw(t);case"Ch":return new Pw(t);case"Sig":return new kw(t)}return new xw(t);case _h:return new Rw(t);case hh:return new Lw(t);case ch:return new Iw(t);case dh:return new Dw(t);case uh:return new Fw(t);case fh:return new Nw(t);case wh:return new Ww(t);case Ah:return new jw(t);case ph:return new Ow(t);case gh:return new Bw(t);case mh:return new Hw(t);case vh:return new zw(t);case bh:return new $w(t);case yh:return new Uw(t);case xh:return new Vw(t);default:return new gy(t)}}}var hy,cy,dy,uy,py;const fy=class{constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}={}){s(this,uy),s(this,hy,null),s(this,cy,!1),s(this,dy,null),this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:e,richText:i}){return!!(null!=t&&t.str||null!=e&&e.str||null!=i&&i.str)}get hasPopupData(){return fy._hasPopupData(this.data)}updateEdited(t){var e;if(!this.container)return;n(this,hy)||r(this,hy,{rect:this.data.rect.slice(0)});const{rect:i}=t;i&&o(this,uy,py).call(this,i),null==(e=n(this,dy))||e.popup.updateEdited(t)}resetEdited(){var t;n(this,hy)&&(o(this,uy,py).call(this,n(this,hy).rect),null==(t=n(this,dy))||t.popup.resetEdited(),r(this,hy,null))}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof xw||(s.tabIndex=ry);const{style:a}=s;if(a.zIndex=this.parent.zIndex++,e.popupRef&&s.setAttribute("aria-haspopup","dialog"),e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof Rw){const{rotation:t}=e;return!e.hasOwnCanvas&&0!==t&&this.setRotation(t,s),s}const{width:o,height:l}=oy(e.rect);if(!t&&e.borderStyle.width>0){a.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e=`calc(${t}px * var(--scale-factor)) / calc(${i}px * var(--scale-factor))`;a.borderRadius=e}else if(this instanceof Cw){const t=`calc(${o}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`;a.borderRadius=t}switch(e.borderStyle.style){case kh:a.borderStyle="solid";break;case Eh:a.borderStyle="dashed";break;case Ch:Oh("Unimplemented border style: beveled");break;case Mh:Oh("Unimplemented border style: inset");break;case Ph:a.borderBottomStyle="solid"}const n=e.borderColor||null;n?(r(this,cy,!0),a.borderColor=rc.makeHexColor(0|n[0],0|n[1],0|n[2])):a.borderWidth=0}const h=rc.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:c,pageHeight:d,pageX:u,pageY:p}=n.rawDims;a.left=100*(h[0]-u)/c+"%",a.top=100*(h[1]-p)/d+"%";const{rotation:f}=e;return e.hasOwnCanvas||0===f?(a.width=100*o/c+"%",a.height=100*l/d+"%"):this.setRotation(f,s),s}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims,{width:s,height:r}=oy(this.data.rect);let a,o;t%180==0?(a=100*s/i,o=100*r/n):(a=100*r/i,o=100*s/n),e.style.width=`${a}%`,e.style.height=`${o}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,i)=>{const n=i.detail[t],s=n[0],r=n.slice(1);i.target.style[e]=ny[`${s}_HTML`](r),this.annotationStorage.setValue(this.data.id,{[e]:ny[`${s}_rgb`](r)})};return Hh(this,"_commonActions",{display:t=>{const{display:e}=t.detail,i=e%2==1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const n of Object.keys(e.detail)){const s=t[n]||i[n];null==s||s(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[n,s]of Object.entries(e)){const r=i[n];if(r){r({detail:{[n]:s},target:t}),delete e[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,s,r]=this.data.rect.map((t=>Math.fround(t)));if(8===t.length){const[n,a,o,l]=t.subarray(2,6);if(s===n&&r===a&&e===o&&i===l)return}const{style:a}=this.container;let o;if(n(this,cy)){const{borderColor:t,borderWidth:e}=a;a.borderWidth=0,o=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${t}" stroke-width="${e}">`],this.container.classList.add("hasBorder")}const l=s-e,h=r-i,{svgFactory:c}=this,d=c.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);const u=c.createElement("defs");d.append(u);const p=c.createElement("clipPath"),f=`clippath_${this.data.id}`;p.setAttribute("id",f),p.setAttribute("clipPathUnits","objectBoundingBox"),u.append(p);for(let i=2,n=t.length;i<n;i+=8){const n=t[i],s=t[i+1],a=t[i+2],d=t[i+3],u=c.createElement("rect"),f=(a-e)/l,g=(r-s)/h,m=(n-a)/l,v=(s-d)/h;u.setAttribute("x",f),u.setAttribute("y",g),u.setAttribute("width",m),u.setAttribute("height",v),p.append(u),null==o||o.push(`<rect vector-effect="non-scaling-stroke" x="${f}" y="${g}" width="${m}" height="${v}"/>`)}n(this,cy)&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(d),this.container.style.clipPath=`url(#${f})`}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const i=r(this,dy,new Rw({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(i.render())}render(){Wh("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const i=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:t,id:s,exportValues:r}of n){if(-1===t||s===e)continue;const n="string"==typeof r?r:null,a=document.querySelector(`[data-element-id="${s}"]`);!a||ay.has(a)?i.push({id:s,exportValue:n,domElement:a}):Oh(`_getElementsByName - element not allowed: ${s}`)}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,s=n.getAttribute("data-element-id");s!==e&&ay.has(n)&&i.push({id:s,exportValue:t,domElement:n})}return i}show(){var t;this.container&&(this.container.hidden=!1),null==(t=this.popup)||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),null==(t=this.popup)||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",(()=>{var i;null==(i=this.linkService.eventBus)||i.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})}))}};let gy=fy;var my,vy,by,yy,wy,Ay,_y,xy,Sy,ky,Ey,Cy,My,Py,Ry,Ty,Ly,Iy,Dy,Fy,Ny,Oy,Wy,jy,By,Hy,zy,$y,Uy,Vy,Gy,qy,Xy,Yy,Ky,Jy,Qy,Zy,tw,ew,iw,nw,sw,rw,aw,ow,lw,hw,cw,dw,uw,pw,fw,gw,mw,vw,bw,yw,ww;hy=new WeakMap,cy=new WeakMap,dy=new WeakMap,uy=new WeakSet,py=function(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:r,pageX:a,pageY:o}}}}=this;null==i||i.splice(0,4,...t);const{width:l,height:h}=oy(t);e.left=100*(t[0]-a)/s+"%",e.top=100*(r-t[3]+o)/r+"%",0===n?(e.width=100*l/s+"%",e.height=100*h/r+"%"):this.setRotation(n)};class Aw extends gy{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!(null==e||!e.ignoreBorder),createQuadrilaterals:!0}),s(this,my),s(this,by),s(this,wy),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let n=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),n=!0):t.action?(this._bindNamedAction(i,t.action),n=!0):t.attachment?(o(this,by,yy).call(this,i,t.attachment,t.attachmentDest),n=!0):t.setOCGState?(o(this,wy,Ay).call(this,i,t.setOCGState),n=!0):t.dest?(this._bindLink(i,t.dest),n=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),n=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(i),this.container}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&o(this,my,vy).call(this)}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),o(this,my,vy).call(this)}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(e.actions)){const s=i.get(n);s&&(t[s]=()=>{var t;return null==(t=this.linkService.eventBus)||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1})}t.onclick||(t.onclick=()=>!1),o(this,my,vy).call(this)}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),o(this,my,vy).call(this),!this._fieldObjects)return Oh('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{var t;null==i||i();const{fields:n,refs:s,include:r}=e,a=[];if(0!==n.length||0!==s.length){const t=new Set(s);for(const e of n){const i=this._fieldObjects[e]||[];for(const{id:e}of i)t.add(e)}for(const e of Object.values(this._fieldObjects))for(const i of e)t.has(i.id)===r&&a.push(i)}else for(const t of Object.values(this._fieldObjects))a.push(...t);const o=this.annotationStorage,l=[];for(const t of a){const{id:e}=t;switch(l.push(e),t.type){case"text":{const i=t.defaultValue||"";o.setValue(e,{value:i});break}case"checkbox":case"radiobutton":{const i=t.defaultValue===t.exportValues;o.setValue(e,{value:i});break}case"combobox":case"listbox":{const i=t.defaultValue||"";o.setValue(e,{value:i});break}default:continue}const i=document.querySelector(`[data-element-id="${e}"]`);i&&(ay.has(i)?i.dispatchEvent(new Event("resetform")):Oh(`_bindResetFormAction - element not allowed: ${e}`))}return this.enableScripting&&(null==(t=this.linkService.eventBus)||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}})),!1}}}my=new WeakSet,vy=function(){this.container.setAttribute("data-internal-link","")},by=new WeakSet,yy=function(t,e,i=null){t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>{var t;return null==(t=this.downloadManager)||t.openOrDownloadData(e.content,e.filename,i),!1},o(this,my,vy).call(this)},wy=new WeakSet,Ay=function(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),o(this,my,vy).call(this)};class _w extends gy{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class xw extends gy{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&("CANVAS"===(null==(e=t.previousSibling)?void 0:e.nodeName)&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Zh.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,s){i.includes("mouse")?t.addEventListener(i,(t=>{var e;null==(e=this.linkService.eventBus)||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(i,(t=>{var r;if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}s&&(null==(r=this.linkService.eventBus)||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t)}}))}))}_setEventListeners(t,e,i,n){var s,r,a;for(const[o,l]of i)("Action"===l||null!=(s=this.data.actions)&&s[l])&&(("Focus"===l||"Blur"===l)&&(e||(e={focused:!1})),this._setEventListener(t,e,o,l,n),"Focus"!==l||null!=(r=this.data.actions)&&r.Blur?"Blur"===l&&(null==(a=this.data.actions)||!a.Focus)&&this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":rc.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const{fontColor:e}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||9,n=t.style;let s;const r=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(zl*i))||1);s=Math.min(i,r(e/zl))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);s=Math.min(i,r(t/zl))}n.fontSize=`calc(${s}px * var(--scale-factor))`,n.color=rc.makeHexColor(e[0],e[1],e[2]),null!==this.data.textAlignment&&(n.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class Sw extends xw{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,n){const s=this.annotationStorage;for(const r of this._getElementsByName(t.name,t.id))r.domElement&&(r.domElement[e]=i),s.setValue(r.id,{[n]:i})}render(){var t,e;const i=this.annotationStorage,n=this.data.id;this.container.classList.add("textWidgetAnnotation");let s=null;if(this.renderForms){const r=i.getValue(n,{value:this.data.fieldValue});let a=r.value||"";const o=i.getValue(n,{charLimit:this.data.maxLen}).charLimit;o&&a.length>o&&(a=a.slice(0,o));let l=r.formattedValue||(null==(t=this.data.textContent)?void 0:t.join("\n"))||null;l&&this.data.comb&&(l=l.replaceAll(/\s+/g,""));const h={userValue:a,formattedValue:l,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(s=document.createElement("textarea"),s.textContent=l??a,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type="text",s.setAttribute("value",l??a),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(s.hidden=!0),ay.add(s),s.setAttribute("data-element-id",n),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=ry,this._setRequired(s,this.data.required),o&&(s.maxLength=o),s.addEventListener("input",(t=>{i.setValue(n,{value:t.target.value}),this.setPropertyOnSiblings(s,"value",t.target.value,"value"),h.formattedValue=null})),s.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue??"";s.value=h.userValue=e,h.formattedValue=null}));let c=t=>{const{formattedValue:e}=h;null!=e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",(t=>{var e;if(h.focused)return;const{target:i}=t;h.userValue&&(i.value=h.userValue),h.lastCommittedValue=i.value,h.commitKey=1,null!=(e=this.data.actions)&&e.Focus||(h.focused=!0)})),s.addEventListener("updatefromsandbox",(t=>{this.showElementAndHideCanvas(t.target);const e={value(t){h.userValue=t.detail.value??"",i.setValue(n,{value:h.userValue.toString()}),t.target.value=h.userValue},formattedValue(t){const{formattedValue:e}=t.detail;h.formattedValue=e,null!=e&&t.target!==document.activeElement&&(t.target.value=e),i.setValue(n,{formattedValue:e})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:t=>{var e;const{charLimit:s}=t.detail,{target:r}=t;if(0===s)return void r.removeAttribute("maxLength");r.setAttribute("maxLength",s);let a=h.userValue;!a||a.length<=s||(a=a.slice(0,s),r.value=h.userValue=a,i.setValue(n,{value:a}),null==(e=this.linkService.eventBus)||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}}))}};this._dispatchEventFromSandbox(e,t)})),s.addEventListener("keydown",(t=>{var e;h.commitKey=1;let i=-1;if("Escape"===t.key?i=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(h.commitKey=3):i=2,-1===i)return;const{value:s}=t.target;h.lastCommittedValue!==s&&(h.lastCommittedValue=s,h.userValue=s,null==(e=this.linkService.eventBus)||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:s,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}));const t=c;c=null,s.addEventListener("blur",(e=>{var i,s;if(!h.focused||!e.relatedTarget)return;null!=(i=this.data.actions)&&i.Blur||(h.focused=!1);const{value:r}=e.target;h.userValue=r,h.lastCommittedValue!==r&&(null==(s=this.linkService.eventBus)||s.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:r,willCommit:!0,commitKey:h.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}})),t(e)})),null!=(e=this.data.actions)&&e.Keystroke&&s.addEventListener("beforeinput",(t=>{var e;h.lastCommittedValue=null;const{data:i,target:s}=t,{value:r,selectionStart:a,selectionEnd:o}=s;let l=a,c=o;switch(t.inputType){case"deleteWordBackward":{const t=r.substring(0,a).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=r.substring(a).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":a===o&&(l-=1);break;case"deleteContentForward":a===o&&(c+=1)}t.preventDefault(),null==(e=this.linkService.eventBus)||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:r,change:i||"",willCommit:!1,selStart:l,selEnd:c}})})),this._setEventListeners(s,h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}if(c&&s.addEventListener("blur",c),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/o;s.classList.add("comb"),s.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else s=document.createElement("div"),s.textContent=this.data.fieldValue,s.style.verticalAlign="middle",s.style.display="table-cell",this.data.hasOwnCanvas&&(s.hidden=!0);return this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class kw extends xw{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class Ew extends xw{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"==typeof n&&(n="Off"!==n,t.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return ay.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.setAttribute("exportValue",e.exportValue),s.tabIndex=ry,s.addEventListener("change",(n=>{const{name:s,checked:r}=n.target;for(const n of this._getElementsByName(s,i)){const i=r&&n.exportValue===e.exportValue;n.domElement&&(n.domElement.checked=i),t.setValue(n.id,{value:i})}t.setValue(i,{value:r})})),s.addEventListener("resetform",(t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue})),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",(e=>{const n={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(n,e)})),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Cw extends xw{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"==typeof n&&(n=n!==e.buttonValue,t.setValue(i,{value:n})),n)for(const n of this._getElementsByName(e.fieldName,i))t.setValue(n.id,{value:!1});const s=document.createElement("input");if(ay.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.tabIndex=ry,s.addEventListener("change",(e=>{const{name:n,checked:s}=e.target;for(const e of this._getElementsByName(n,i))t.setValue(e.id,{value:!1});t.setValue(i,{value:s})})),s.addEventListener("resetform",(t=>{const i=e.defaultFieldValue;t.target.checked=null!=i&&i===e.buttonValue})),this.enableScripting&&this.hasJSActions){const n=e.buttonValue;s.addEventListener("updatefromsandbox",(e=>{const s={value:e=>{const s=n===e.detail.value;for(const n of this._getElementsByName(e.target.name)){const e=s&&n.id===i;n.domElement&&(n.domElement.checked=e),t.setValue(n.id,{value:e})}}};this._dispatchEventFromSandbox(s,e)})),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Mw extends Aw{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))),t}}class Pw extends xw{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");ay.add(n),n.setAttribute("data-element-id",e),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=ry;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const t of n.options)t.selected=t.value===e}));for(const t of this.data.options){const e=document.createElement("option");e.textContent=t.displayValue,e.value=t.exportValue,i.value.includes(t.exportValue)&&(e.setAttribute("selected",!0),s=!1),n.append(e)}let r=null;if(s){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),n.prepend(t),r=()=>{t.remove(),n.removeEventListener("input",r),r=null},n.addEventListener("input",r)}const a=t=>{const e=t?"value":"textContent",{options:i,multiple:s}=n;return s?Array.prototype.filter.call(i,(t=>t.selected)).map((t=>t[e])):-1===i.selectedIndex?null:i[i.selectedIndex][e]};let o=a(!1);const l=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",(i=>{const s={value(i){null==r||r();const s=i.detail.value,l=new Set(Array.isArray(s)?s:[s]);for(const t of n.options)t.selected=l.has(t.value);t.setValue(e,{value:a(!0)}),o=a(!1)},multipleSelection(t){n.multiple=!0},remove(i){const s=n.options,r=i.detail.remove;s[r].selected=!1,n.remove(r),s.length>0&&-1===Array.prototype.findIndex.call(s,(t=>t.selected))&&(s[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},clear(i){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]}),o=a(!1)},insert(i){const{index:s,displayValue:r,exportValue:h}=i.detail.insert,c=n.children[s],d=document.createElement("option");d.textContent=r,d.value=h,c?c.before(d):n.append(d),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},items(i){const{items:s}=i.detail;for(;0!==n.length;)n.remove(0);for(const t of s){const{displayValue:e,exportValue:i}=t,s=document.createElement("option");s.textContent=e,s.value=i,n.append(s)}n.options.length>0&&(n.options[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},indices(i){const n=new Set(i.detail.indices);for(const t of i.target.options)t.selected=n.has(t.index);t.setValue(e,{value:a(!0)}),o=a(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(s,i)})),n.addEventListener("input",(i=>{var n;const s=a(!0),r=a(!1);t.setValue(e,{value:s}),i.preventDefault(),null==(n=this.linkService.eventBus)||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:r,changeEx:s,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))):n.addEventListener("input",(function(i){t.setValue(e,{value:a(!0)})})),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Rw extends gy{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:gy._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new Tw({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(const i of this.elements)i.popup=t,e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map((t=>`${hc}${t}`)).join(",")),this.container}}class Tw{constructor({container:t,color:e,elements:i,titleObj:a,modificationDate:l,contentsObj:h,richText:c,parent:d,rect:u,parentRect:p,open:f}){var g;s(this,Hy),s(this,$y),s(this,Vy),s(this,qy),s(this,Yy),s(this,Jy),s(this,Zy),s(this,ew),s(this,nw),s(this,_y,o(this,Yy,Ky).bind(this)),s(this,xy,o(this,nw,sw).bind(this)),s(this,Sy,o(this,ew,iw).bind(this)),s(this,ky,o(this,Zy,tw).bind(this)),s(this,Ey,null),s(this,Cy,null),s(this,My,null),s(this,Py,null),s(this,Ry,null),s(this,Ty,null),s(this,Ly,null),s(this,Iy,!1),s(this,Dy,null),s(this,Fy,null),s(this,Ny,null),s(this,Oy,null),s(this,Wy,null),s(this,jy,null),s(this,By,!1),r(this,Cy,t),r(this,Wy,a),r(this,My,h),r(this,Oy,c),r(this,Ty,d),r(this,Ey,e),r(this,Ny,u),r(this,Ly,p),r(this,Ry,i),r(this,Py,bd.toDateObject(l)),this.trigger=i.flatMap((t=>t.getElementsToTriggerPopup()));for(const t of this.trigger)t.addEventListener("click",n(this,ky)),t.addEventListener("mouseenter",n(this,Sy)),t.addEventListener("mouseleave",n(this,xy)),t.classList.add("popupTriggerArea");for(const t of i)null==(g=t.container)||g.addEventListener("keydown",n(this,_y));n(this,Cy).hidden=!0,f&&o(this,Zy,tw).call(this)}render(){if(n(this,Dy))return;const t=r(this,Dy,document.createElement("div"));if(t.className="popup",n(this,Ey)){const e=t.style.outlineColor=rc.makeHexColor(...n(this,Ey));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?t.style.backgroundColor=`color-mix(in srgb, ${e} 30%, white)`:t.style.backgroundColor=rc.makeHexColor(...n(this,Ey).map((t=>Math.floor(.7*(255-t)+t))))}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),({dir:i.dir,str:i.textContent}=n(this,Wy)),t.append(e),n(this,Py)){const t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),t.setAttribute("data-l10n-args",JSON.stringify({date:n(this,Py).toLocaleDateString(),time:n(this,Py).toLocaleTimeString()})),e.append(t)}const s=n(this,Hy,zy);if(s)sy.render({xfaHtml:s,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const e=this._formatContents(n(this,My));t.append(e)}n(this,Cy).append(t)}_formatContents({str:t,dir:e}){const i=document.createElement("p");i.classList.add("popupContent"),i.dir=e;const n=t.split(/(?:\r\n?|\n)/);for(let t=0,e=n.length;t<e;++t){const s=n[t];i.append(document.createTextNode(s)),t<e-1&&i.append(document.createElement("br"))}return i}updateEdited({rect:t,popupContent:e}){var i;n(this,jy)||r(this,jy,{contentsObj:n(this,My),richText:n(this,Oy)}),t&&r(this,Fy,null),e&&(r(this,Oy,o(this,qy,Xy).call(this,e)),r(this,My,null)),null==(i=n(this,Dy))||i.remove(),r(this,Dy,null)}resetEdited(){var t;n(this,jy)&&(({contentsObj:a(this,My)._,richText:a(this,Oy)._}=n(this,jy)),r(this,jy,null),null==(t=n(this,Dy))||t.remove(),r(this,Dy,null),r(this,Fy,null))}forceHide(){r(this,By,this.isVisible),n(this,By)&&(n(this,Cy).hidden=!0)}maybeShow(){n(this,By)&&(n(this,Dy)||o(this,ew,iw).call(this),r(this,By,!1),n(this,Cy).hidden=!1)}get isVisible(){return!1===n(this,Cy).hidden}}_y=new WeakMap,xy=new WeakMap,Sy=new WeakMap,ky=new WeakMap,Ey=new WeakMap,Cy=new WeakMap,My=new WeakMap,Py=new WeakMap,Ry=new WeakMap,Ty=new WeakMap,Ly=new WeakMap,Iy=new WeakMap,Dy=new WeakMap,Fy=new WeakMap,Ny=new WeakMap,Oy=new WeakMap,Wy=new WeakMap,jy=new WeakMap,By=new WeakMap,Hy=new WeakSet,zy=function(){const t=n(this,Oy),e=n(this,My);return null!=t&&t.str&&(!(null!=e&&e.str)||e.str===t.str)&&n(this,Oy).html||null},$y=new WeakSet,Uy=function(){var t,e,i;return(null==(i=null==(e=null==(t=n(this,Hy,zy))?void 0:t.attributes)?void 0:e.style)?void 0:i.fontSize)||0},Vy=new WeakSet,Gy=function(){var t,e,i;return(null==(i=null==(e=null==(t=n(this,Hy,zy))?void 0:t.attributes)?void 0:e.style)?void 0:i.color)||null},qy=new WeakSet,Xy=function(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},s={style:{color:n(this,Vy,Gy),fontSize:n(this,$y,Uy)?`calc(${n(this,$y,Uy)}px * var(--scale-factor))`:""}};for(const i of t.split("\n"))e.push({name:"span",value:i,attributes:s});return i},Yy=new WeakSet,Ky=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&n(this,Iy))&&o(this,Zy,tw).call(this)},Jy=new WeakSet,Qy=function(){if(null!==n(this,Fy))return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:s,pageY:a}}}=n(this,Ty);let o=!!n(this,Ly),l=n(this,o?Ly:Ny);for(const t of n(this,Ry))if(!l||null!==rc.intersect(t.data.rect,l)){l=t.data.rect,o=!0;break}const h=rc.normalizeRect([l[0],t[3]-l[1]+t[1],l[2],t[3]-l[3]+t[1]]),c=o?l[2]-l[0]+5:0,d=h[0]+c,u=h[1];r(this,Fy,[100*(d-s)/e,100*(u-a)/i]);const{style:p}=n(this,Cy);p.left=`${n(this,Fy)[0]}%`,p.top=`${n(this,Fy)[1]}%`},Zy=new WeakSet,tw=function(){r(this,Iy,!n(this,Iy)),n(this,Iy)?(o(this,ew,iw).call(this),n(this,Cy).addEventListener("click",n(this,ky)),n(this,Cy).addEventListener("keydown",n(this,_y))):(o(this,nw,sw).call(this),n(this,Cy).removeEventListener("click",n(this,ky)),n(this,Cy).removeEventListener("keydown",n(this,_y)))},ew=new WeakSet,iw=function(){n(this,Dy)||this.render(),this.isVisible?n(this,Iy)&&n(this,Cy).classList.add("focused"):(o(this,Jy,Qy).call(this),n(this,Cy).hidden=!1,n(this,Cy).style.zIndex=parseInt(n(this,Cy).style.zIndex)+1e3)},nw=new WeakSet,sw=function(){n(this,Cy).classList.remove("focused"),!n(this,Iy)&&this.isVisible&&(n(this,Cy).hidden=!0,n(this,Cy).style.zIndex=parseInt(n(this,Cy).style.zIndex)-1e3)};class Lw extends gy{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Jl.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}class Iw extends gy{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),s(this,rw,null)}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:i}=oy(t.rect),n=this.svgFactory.create(e,i,!0),s=r(this,rw,this.svgFactory.createElement("svg:line"));return s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,rw)}addHighlightArea(){this.container.classList.add("highlightArea")}}rw=new WeakMap;class Dw extends gy{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),s(this,aw,null)}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:i}=oy(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,a=r(this,aw,this.svgFactory.createElement("svg:rect"));return a.setAttribute("x",s/2),a.setAttribute("y",s/2),a.setAttribute("width",e-s),a.setAttribute("height",i-s),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),n.append(a),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,aw)}addHighlightArea(){this.container.classList.add("highlightArea")}}aw=new WeakMap;class Fw extends gy{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),s(this,ow,null)}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:i}=oy(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,a=r(this,ow,this.svgFactory.createElement("svg:ellipse"));return a.setAttribute("cx",e/2),a.setAttribute("cy",i/2),a.setAttribute("rx",e/2-s/2),a.setAttribute("ry",i/2-s/2),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),n.append(a),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,ow)}addHighlightArea(){this.container.classList.add("highlightArea")}}ow=new WeakMap;class Nw extends gy{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),s(this,lw,null),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:i,popupRef:n}}=this;if(!e)return this.container;const{width:s,height:a}=oy(t),o=this.svgFactory.create(s,a,!0);let l=[];for(let i=0,n=e.length;i<n;i+=2){const n=e[i]-t[0],s=t[3]-e[i+1];l.push(`${n},${s}`)}l=l.join(" ");const h=r(this,lw,this.svgFactory.createElement(this.svgElementName));return h.setAttribute("points",l),h.setAttribute("stroke-width",i.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),o.append(h),this.container.append(o),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,lw)}addHighlightArea(){this.container.classList.add("highlightArea")}}lw=new WeakMap;class Ow extends Nw{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Ww extends gy{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class jw extends gy{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),s(this,hw,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=Jl.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:e,borderStyle:i,popupRef:s}}=this,{width:r,height:a}=oy(t),o=this.svgFactory.create(r,a,!0);for(const r of e){let e=[];for(let i=0,n=r.length;i<n;i+=2){const n=r[i]-t[0],s=t[3]-r[i+1];e.push(`${n},${s}`)}e=e.join(" ");const a=this.svgFactory.createElement(this.svgElementName);n(this,hw).push(a),a.setAttribute("points",e),a.setAttribute("stroke-width",i.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),!s&&this.hasPopupData&&this._createPopup(),o.append(a)}return this.container.append(o),this.container}getElementsToTriggerPopup(){return n(this,hw)}addHighlightArea(){this.container.classList.add("highlightArea")}}hw=new WeakMap;class Bw extends gy{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class Hw extends gy{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class zw extends gy{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class $w extends gy{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class Uw extends gy{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class Vw extends gy{constructor(t){var e;super(t,{isRenderable:!0}),s(this,dw),s(this,cw,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,null==(e=this.linkService.eventBus)||e.dispatch("fileattachmentannotation",{source:this,...i})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:e}=this;let i;e.hasAppearance||0===e.fillAlpha?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name)?"paperclip":"pushpin"}.svg`,e.fillAlpha&&e.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(100*e.fillAlpha)}%);`)),i.addEventListener("dblclick",o(this,dw,uw).bind(this)),r(this,cw,i);const{isMac:n}=Zh.platform;return t.addEventListener("keydown",(t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&o(this,dw,uw).call(this)})),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return n(this,cw)}addHighlightArea(){this.container.classList.add("highlightArea")}}cw=new WeakMap,dw=new WeakSet,uw=function(){var t;null==(t=this.downloadManager)||t.openOrDownloadData(this.content,this.filename)};let Gw=(ww=class{constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:n,page:a,viewport:o}){s(this,mw),s(this,bw),s(this,pw,null),s(this,fw,null),s(this,gw,new Map),this.div=t,r(this,pw,e),r(this,fw,i),this.page=a,this.viewport=o,this.zIndex=0,this._annotationEditorUIManager=n}async render(t){var e;const{annotations:i}=t,s=this.div;xd(s,this.viewport);const r=new Map,a={data:null,layer:s,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new ad,annotationStorage:t.annotationStorage||new wg,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const t of i){if(t.noHTML)continue;const i=t.annotationType===_h;if(i){const e=r.get(t.id);if(!e)continue;a.elements=e}else{const{width:e,height:i}=oy(t.rect);if(e<=0||i<=0)continue}a.data=t;const s=ly.create(a);if(!s.isRenderable)continue;if(!i&&t.popupRef){const e=r.get(t.popupRef);e?e.push(s):r.set(t.popupRef,[s])}const l=s.render();t.hidden&&(l.style.visibility="hidden"),o(this,mw,vw).call(this,l,t.id),s.annotationEditorType>0&&(n(this,gw).set(s.data.id,s),null==(e=this._annotationEditorUIManager)||e.renderAnnotationElement(s))}o(this,bw,yw).call(this)}update({viewport:t}){const e=this.div;this.viewport=t,xd(e,{rotation:t.rotation}),o(this,bw,yw).call(this),e.hidden=!1}getEditableAnnotations(){return Array.from(n(this,gw).values())}getEditableAnnotation(t){return n(this,gw).get(t)}},pw=new WeakMap,fw=new WeakMap,gw=new WeakMap,mw=new WeakSet,vw=function(t,e){var i;const s=t.firstChild||t;s.id=`${hc}${e}`,this.div.append(t),null==(i=n(this,pw))||i.moveElementInDOM(this.div,t,s,!1)},bw=new WeakSet,yw=function(){if(!n(this,fw))return;const t=this.div;for(const[e,i]of n(this,fw)){const n=t.querySelector(`[data-annotation-id="${e}"]`);if(!n)continue;i.className="annotationContent";const{firstChild:s}=n;s?"CANVAS"===s.nodeName?s.replaceWith(i):s.classList.contains("annotationContent")?s.after(i):s.before(i):n.append(i)}n(this,fw).clear()},ww);const qw=/\r\n?|\n/g;var Xw,Yw,Kw,Jw,Qw,Zw,tA,eA,iA,nA,sA,rA,aA,oA,lA,hA,cA,dA,uA,pA,fA,gA,mA,vA,bA,yA,wA,AA;const _A=class extends og{constructor(t){super({...t,name:"freeTextEditor"}),s(this,sA),s(this,aA),s(this,lA),s(this,cA),s(this,fA),s(this,mA),s(this,wA),s(this,Xw,this.editorDivBlur.bind(this)),s(this,Yw,this.editorDivFocus.bind(this)),s(this,Kw,this.editorDivInput.bind(this)),s(this,Jw,this.editorDivKeydown.bind(this)),s(this,Qw,this.editorDivPaste.bind(this)),s(this,Zw,void 0),s(this,tA,""),s(this,eA,`${this.id}-editor`),s(this,iA,void 0),s(this,nA,null),r(this,Zw,t.color||_A._defaultColor||og._defaultLineColor),r(this,iA,t.fontSize||_A._defaultFontSize)}static get _keyboardManager(){const t=_A.prototype,e=t=>t.isEmpty(),i=Jp.TRANSLATE_SMALL,n=Jp.TRANSLATE_BIG;return Hh(this,"_keyboardManager",new gu([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,n],checker:e}]]))}static initialize(t,e){og.initialize(t,e,{strings:["pdfjs-free-text-default-content"]});const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case Ql.FREETEXT_SIZE:_A._defaultFontSize=e;break;case Ql.FREETEXT_COLOR:_A._defaultColor=e}}updateParams(t,e){switch(t){case Ql.FREETEXT_SIZE:o(this,sA,rA).call(this,e);break;case Ql.FREETEXT_COLOR:o(this,aA,oA).call(this,e)}}static get defaultPropertiesToUpdate(){return[[Ql.FREETEXT_SIZE,_A._defaultFontSize],[Ql.FREETEXT_COLOR,_A._defaultColor||og._defaultLineColor]]}get propertiesToUpdate(){return[[Ql.FREETEXT_SIZE,n(this,iA)],[Ql.FREETEXT_COLOR,n(this,Zw)]]}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-_A._internalPadding*t,-(_A._internalPadding+n(this,iA))*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(Jl.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant");const t=this._uiManager._signal;this.editorDiv.addEventListener("keydown",n(this,Jw),{signal:t}),this.editorDiv.addEventListener("focus",n(this,Yw),{signal:t}),this.editorDiv.addEventListener("blur",n(this,Xw),{signal:t}),this.editorDiv.addEventListener("input",n(this,Kw),{signal:t}),this.editorDiv.addEventListener("paste",n(this,Qw),{signal:t})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",n(this,eA)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",n(this,Jw)),this.editorDiv.removeEventListener("focus",n(this,Yw)),this.editorDiv.removeEventListener("blur",n(this,Xw)),this.editorDiv.removeEventListener("input",n(this,Kw)),this.editorDiv.removeEventListener("paste",n(this,Qw)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var t;this.width||(this.enableEditMode(),this.editorDiv.focus(),null!=(t=this._initialOptions)&&t.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=n(this,tA),e=r(this,tA,o(this,lA,hA).call(this).trimEnd());if(t===e)return;const i=t=>{r(this,tA,t),t?(o(this,fA,gA).call(this),this._uiManager.rebuild(this),o(this,cA,dA).call(this)):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),o(this,cA,dA).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){_A._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",n(this,eA)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),og._l10nPromise.get("pdfjs-free-text-default-content").then((t=>{var e;return null==(e=this.editorDiv)?void 0:e.setAttribute("default-content",t)})),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${n(this,iA)}px * var(--scale-factor))`,i.color=n(this,Zw),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),su(this,this.div,["dblclick","keydown"]),this.width){const[i,s]=this.parentDimensions;if(this.annotationElementId){const{position:r}=n(this,nA);let[a,o]=this.getInitialTranslation();[a,o]=this.pageTranslationToScreen(a,o);const[l,h]=this.pageDimensions,[c,d]=this.pageTranslation;let u,p;switch(this.rotation){case 0:u=t+(r[0]-c)/l,p=e+this.height-(r[1]-d)/h;break;case 90:u=t+(r[0]-c)/l,p=e-(r[1]-d)/h,[a,o]=[o,-a];break;case 180:u=t-this.width+(r[0]-c)/l,p=e-(r[1]-d)/h,[a,o]=[-a,-o];break;case 270:u=t+(r[0]-c-this.height*h)/l,p=e+(r[1]-d-this.width*l)/h,[a,o]=[-o,a]}this.setAt(u*i,p*s,a,o)}else this.setAt(t*i,e*s,this.width*i,this.height*s);o(this,fA,gA).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){var e,i,n;const s=t.clipboardData||window.clipboardData,{types:a}=s;if(1===a.length&&"text/plain"===a[0])return;t.preventDefault();const l=o(e=_A,bA,yA).call(e,s.getData("text")||"").replaceAll(qw,"\n");if(!l)return;const h=window.getSelection();if(!h.rangeCount)return;this.editorDiv.normalize(),h.deleteFromDocument();const c=h.getRangeAt(0);if(!l.includes("\n"))return c.insertNode(document.createTextNode(l)),this.editorDiv.normalize(),void h.collapseToStart();const{startContainer:d,startOffset:u}=c,p=[],f=[];if(d.nodeType===Node.TEXT_NODE){const t=d.parentElement;if(f.push(d.nodeValue.slice(u).replaceAll(qw,"")),t!==this.editorDiv){let e=p;for(const n of this.editorDiv.childNodes)n!==t?e.push(o(i=_A,uA,pA).call(i,n)):e=f}p.push(d.nodeValue.slice(0,u).replaceAll(qw,""))}else if(d===this.editorDiv){let t=p,e=0;for(const i of this.editorDiv.childNodes)e++===u&&(t=f),t.push(o(n=_A,uA,pA).call(n,i))}r(this,tA,`${p.join("\n")}${l}${f.join("\n")}`),o(this,fA,gA).call(this);const g=new Range;let m=p.reduce(((t,e)=>t+e.length),0);for(const{firstChild:t}of this.editorDiv.childNodes)if(t.nodeType===Node.TEXT_NODE){const e=t.nodeValue.length;if(m<=e){g.setStart(t,m),g.setEnd(t,m);break}m-=e}h.removeAllRanges(),h.addRange(g)}get contentDiv(){return this.editorDiv}static deserialize(t,e,i){var n;let s=null;if(t instanceof Lw){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:n,rotation:r,id:a},textContent:o,textPosition:l,parent:{page:{pageNumber:h}}}=t;if(!o||0===o.length)return null;s=t={annotationType:Jl.FREETEXT,color:Array.from(i),fontSize:e,value:o.join("\n"),position:l,pageIndex:h-1,rect:n.slice(0),rotation:r,id:a,deleted:!1}}const a=super.deserialize(t,e,i);return r(a,iA,t.fontSize),r(a,Zw,rc.makeHexColor(...t.color)),r(a,tA,o(n=_A,bA,yA).call(n,t.value)),a.annotationElementId=t.id||null,r(a,nA,s),a}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const e=_A._internalPadding*this.parentScale,i=this.getRect(e,e),s=og._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:n(this,Zw)),r={annotationType:Jl.FREETEXT,color:s,fontSize:n(this,iA),value:o(this,mA,vA).call(this),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?r:this.annotationElementId&&!o(this,wA,AA).call(this,r)?null:(r.id=this.annotationElementId,r)}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(this.deleted)return e;const{style:i}=e;i.fontSize=`calc(${n(this,iA)}px * var(--scale-factor))`,i.color=n(this,Zw),e.replaceChildren();for(const t of n(this,tA).split("\n")){const i=document.createElement("div");i.append(t?document.createTextNode(t):document.createElement("br")),e.append(i)}const s=_A._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(s,s),popupContent:n(this,tA)}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}};let xA=_A;var SA,kA,EA,CA,MA,PA,RA,TA,LA,IA,DA,FA,NA,OA,WA,jA,BA,HA,zA,$A,UA,VA,GA,qA,XA,YA,KA,JA,QA,ZA,t_,e_,i_;Xw=new WeakMap,Yw=new WeakMap,Kw=new WeakMap,Jw=new WeakMap,Qw=new WeakMap,Zw=new WeakMap,tA=new WeakMap,eA=new WeakMap,iA=new WeakMap,nA=new WeakMap,sA=new WeakSet,rA=function(t){const e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-n(this,iA))*this.parentScale),r(this,iA,t),o(this,cA,dA).call(this)},i=n(this,iA);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},aA=new WeakSet,oA=function(t){const e=t=>{r(this,Zw,this.editorDiv.style.color=t)},i=n(this,Zw);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},lA=new WeakSet,hA=function(){var t;const e=[];this.editorDiv.normalize();for(const i of this.editorDiv.childNodes)e.push(o(t=_A,uA,pA).call(t,i));return e.join("\n")},cA=new WeakSet,dA=function(){const[t,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,n=e.style.display,s=e.classList.contains("hidden");e.classList.remove("hidden"),e.style.display="hidden",t.div.append(this.div),i=e.getBoundingClientRect(),e.remove(),e.style.display=n,e.classList.toggle("hidden",s)}this.rotation%180==this.parentRotation%180?(this.width=i.width/t,this.height=i.height/e):(this.width=i.height/t,this.height=i.width/e),this.fixAndSetPosition()},uA=new WeakSet,pA=function(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(qw,"")},fA=new WeakSet,gA=function(){if(this.editorDiv.replaceChildren(),n(this,tA))for(const t of n(this,tA).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}},mA=new WeakSet,vA=function(){return n(this,tA).replaceAll(" "," ")},bA=new WeakSet,yA=function(t){return t.replaceAll(" "," ")},wA=new WeakSet,AA=function(t){const{value:e,fontSize:i,color:s,pageIndex:r}=n(this,nA);return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some(((t,e)=>t!==s[e]))||t.pageIndex!==r},s(xA,uA),s(xA,bA),e(xA,"_freeTextDefaultContent",""),e(xA,"_internalPadding",0),e(xA,"_defaultColor",null),e(xA,"_defaultFontSize",10),e(xA,"_type","freetext"),e(xA,"_editorType",Jl.FREETEXT);class n_{constructor(t,e=0,i=0,a=!0){s(this,CA),s(this,PA),s(this,TA),s(this,IA),s(this,FA),s(this,SA,void 0),s(this,kA,[]),s(this,EA,[]);let o=1/0,l=-1/0,h=1/0,c=-1/0;const d=10**-4;for(const{x:i,y:s,width:r,height:a}of t){const t=Math.floor((i-e)/d)*d,u=Math.ceil((i+r+e)/d)*d,p=Math.floor((s-e)/d)*d,f=Math.ceil((s+a+e)/d)*d,g=[t,p,f,!0],m=[u,p,f,!1];n(this,kA).push(g,m),o=Math.min(o,t),l=Math.max(l,u),h=Math.min(h,p),c=Math.max(c,f)}const u=l-o+2*i,p=c-h+2*i,f=o-i,g=h-i,m=n(this,kA).at(a?-1:-2),v=[m[0],m[2]];for(const t of n(this,kA)){const[e,i,n]=t;t[0]=(e-f)/u,t[1]=(i-g)/p,t[2]=(n-g)/p}r(this,SA,{x:f,y:g,width:u,height:p,lastPoint:v})}getOutlines(){n(this,kA).sort(((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]));const t=[];for(const e of n(this,kA))e[3]?(t.push(...o(this,FA,NA).call(this,e)),o(this,TA,LA).call(this,e)):(o(this,IA,DA).call(this,e),t.push(...o(this,FA,NA).call(this,e)));return o(this,CA,MA).call(this,t)}}SA=new WeakMap,kA=new WeakMap,EA=new WeakMap,CA=new WeakSet,MA=function(t){const e=[],i=new Set;for(const i of t){const[t,n,s]=i;e.push([t,n,i],[t,s,i])}e.sort(((t,e)=>t[1]-e[1]||t[0]-e[0]));for(let t=0,n=e.length;t<n;t+=2){const n=e[t][2],s=e[t+1][2];n.push(s),s.push(n),i.add(n),i.add(s)}const s=[];let r;for(;i.size>0;){const t=i.values().next().value;let[e,n,a,o,l]=t;i.delete(t);let h=e,c=n;for(r=[e,a],s.push(r);;){let t;if(i.has(o))t=o;else{if(!i.has(l))break;t=l}i.delete(t),[e,n,a,o,l]=t,h!==e&&(r.push(h,c,e,c===n?n:a),h=e),c=c===n?a:n}r.push(h,c)}return new r_(s,n(this,SA))},PA=new WeakSet,RA=function(t){const e=n(this,EA);let i=0,s=e.length-1;for(;i<=s;){const n=i+s>>1,r=e[n][0];if(r===t)return n;r<t?i=n+1:s=n-1}return s+1},TA=new WeakSet,LA=function([,t,e]){const i=o(this,PA,RA).call(this,t);n(this,EA).splice(i,0,[t,e])},IA=new WeakSet,DA=function([,t,e]){const i=o(this,PA,RA).call(this,t);for(let s=i;s<n(this,EA).length;s++){const[i,r]=n(this,EA)[s];if(i!==t)break;if(i===t&&r===e)return void n(this,EA).splice(s,1)}for(let s=i-1;s>=0;s--){const[i,r]=n(this,EA)[s];if(i!==t)break;if(i===t&&r===e)return void n(this,EA).splice(s,1)}},FA=new WeakSet,NA=function(t){const[e,i,s]=t,r=[[e,i,s]],a=o(this,PA,RA).call(this,s);for(let t=0;t<a;t++){const[i,s]=n(this,EA)[t];for(let t=0,n=r.length;t<n;t++){const[,a,o]=r[t];if(!(s<=a||o<=i)){if(a>=i){if(o>s)r[t][1]=s;else{if(1===n)return[];r.splice(t,1),t--,n--}continue}r[t][2]=i,o>s&&r.push([e,s,o])}}}return r};class s_{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(t,e){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof V_}}class r_ extends s_{constructor(t,e){super(),s(this,OA,void 0),s(this,WA,void 0),r(this,WA,t),r(this,OA,e)}toSVGPath(){const t=[];for(const e of n(this,WA)){let[i,n]=e;t.push(`M${i} ${n}`);for(let s=2;s<e.length;s+=2){const r=e[s],a=e[s+1];r===i?(t.push(`V${a}`),n=a):a===n&&(t.push(`H${r}`),i=r)}t.push("Z")}return t.join(" ")}serialize([t,e,i,s],r){const a=[],o=i-t,l=s-e;for(const e of n(this,WA)){const i=new Array(e.length);for(let n=0;n<e.length;n+=2)i[n]=t+e[n]*o,i[n+1]=s-e[n+1]*l;a.push(i)}return a}get box(){return n(this,OA)}}OA=new WeakMap,WA=new WeakMap;const a_=class{constructor({x:t,y:e},i,a,o,l,h=0){s(this,e_),s(this,jA,void 0),s(this,BA,[]),s(this,HA,void 0),s(this,zA,void 0),s(this,$A,[]),s(this,UA,new Float64Array(18)),s(this,VA,void 0),s(this,GA,void 0),s(this,qA,void 0),s(this,XA,void 0),s(this,YA,void 0),s(this,KA,void 0),s(this,JA,[]),r(this,jA,i),r(this,KA,o*a),r(this,zA,l),n(this,UA).set([NaN,NaN,NaN,NaN,t,e],6),r(this,HA,h),r(this,XA,n(a_,QA)*a),r(this,qA,n(a_,t_)*a),r(this,YA,a),n(this,JA).push(t,e)}get free(){return!0}isEmpty(){return isNaN(n(this,UA)[8])}add({x:t,y:e}){var i;r(this,VA,t),r(this,GA,e);const[s,a,o,l]=n(this,jA);let[h,c,d,u]=n(this,UA).subarray(8,12);const p=t-d,f=e-u,g=Math.hypot(p,f);if(g<n(this,qA))return!1;const m=g-n(this,XA),v=m/g,b=v*p,y=v*f;let w=h,A=c;h=d,c=u,d+=b,u+=y,null==(i=n(this,JA))||i.push(t,e);const _=b/m,x=-y/m*n(this,KA),S=_*n(this,KA);return n(this,UA).set(n(this,UA).subarray(2,8),0),n(this,UA).set([d+x,u+S],4),n(this,UA).set(n(this,UA).subarray(14,18),12),n(this,UA).set([d-x,u-S],16),isNaN(n(this,UA)[6])?(0===n(this,$A).length&&(n(this,UA).set([h+x,c+S],2),n(this,$A).push(NaN,NaN,NaN,NaN,(h+x-s)/o,(c+S-a)/l),n(this,UA).set([h-x,c-S],14),n(this,BA).push(NaN,NaN,NaN,NaN,(h-x-s)/o,(c-S-a)/l)),n(this,UA).set([w,A,h,c,d,u],6),!this.isEmpty()):(n(this,UA).set([w,A,h,c,d,u],6),Math.abs(Math.atan2(A-c,w-h)-Math.atan2(y,b))<Math.PI/2?([h,c,d,u]=n(this,UA).subarray(2,6),n(this,$A).push(NaN,NaN,NaN,NaN,((h+d)/2-s)/o,((c+u)/2-a)/l),[h,c,w,A]=n(this,UA).subarray(14,18),n(this,BA).push(NaN,NaN,NaN,NaN,((w+h)/2-s)/o,((A+c)/2-a)/l),!0):([w,A,h,c,d,u]=n(this,UA).subarray(0,6),n(this,$A).push(((w+5*h)/6-s)/o,((A+5*c)/6-a)/l,((5*h+d)/6-s)/o,((5*c+u)/6-a)/l,((h+d)/2-s)/o,((c+u)/2-a)/l),[d,u,h,c,w,A]=n(this,UA).subarray(12,18),n(this,BA).push(((w+5*h)/6-s)/o,((A+5*c)/6-a)/l,((5*h+d)/6-s)/o,((5*c+u)/6-a)/l,((h+d)/2-s)/o,((c+u)/2-a)/l),!0))}toSVGPath(){if(this.isEmpty())return"";const t=n(this,$A),e=n(this,BA),i=n(this,UA).subarray(4,6),s=n(this,UA).subarray(16,18),[r,a,l,h]=n(this,jA),[c,d,u,p]=o(this,e_,i_).call(this);if(isNaN(n(this,UA)[6])&&!this.isEmpty())return`M${(n(this,UA)[2]-r)/l} ${(n(this,UA)[3]-a)/h} L${(n(this,UA)[4]-r)/l} ${(n(this,UA)[5]-a)/h} L${c} ${d} L${u} ${p} L${(n(this,UA)[16]-r)/l} ${(n(this,UA)[17]-a)/h} L${(n(this,UA)[14]-r)/l} ${(n(this,UA)[15]-a)/h} Z`;const f=[];f.push(`M${t[4]} ${t[5]}`);for(let e=6;e<t.length;e+=6)isNaN(t[e])?f.push(`L${t[e+4]} ${t[e+5]}`):f.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);f.push(`L${(i[0]-r)/l} ${(i[1]-a)/h} L${c} ${d} L${u} ${p} L${(s[0]-r)/l} ${(s[1]-a)/h}`);for(let t=e.length-6;t>=6;t-=6)isNaN(e[t])?f.push(`L${e[t+4]} ${e[t+5]}`):f.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);return f.push(`L${e[4]} ${e[5]} Z`),f.join(" ")}getOutlines(){var t;const e=n(this,$A),i=n(this,BA),s=n(this,UA),r=s.subarray(4,6),a=s.subarray(16,18),[l,h,c,d]=n(this,jA),u=new Float64Array(((null==(t=n(this,JA))?void 0:t.length)??0)+2);for(let t=0,e=u.length-2;t<e;t+=2)u[t]=(n(this,JA)[t]-l)/c,u[t+1]=(n(this,JA)[t+1]-h)/d;u[u.length-2]=(n(this,VA)-l)/c,u[u.length-1]=(n(this,GA)-h)/d;const[p,f,g,m]=o(this,e_,i_).call(this);if(isNaN(s[6])&&!this.isEmpty()){const t=new Float64Array(36);return t.set([NaN,NaN,NaN,NaN,(s[2]-l)/c,(s[3]-h)/d,NaN,NaN,NaN,NaN,(s[4]-l)/c,(s[5]-h)/d,NaN,NaN,NaN,NaN,p,f,NaN,NaN,NaN,NaN,g,m,NaN,NaN,NaN,NaN,(s[16]-l)/c,(s[17]-h)/d,NaN,NaN,NaN,NaN,(s[14]-l)/c,(s[15]-h)/d],0),new V_(t,u,n(this,jA),n(this,YA),n(this,HA),n(this,zA))}const v=new Float64Array(n(this,$A).length+24+n(this,BA).length);let b=e.length;for(let t=0;t<b;t+=2)isNaN(e[t])?v[t]=v[t+1]=NaN:(v[t]=e[t],v[t+1]=e[t+1]);v.set([NaN,NaN,NaN,NaN,(r[0]-l)/c,(r[1]-h)/d,NaN,NaN,NaN,NaN,p,f,NaN,NaN,NaN,NaN,g,m,NaN,NaN,NaN,NaN,(a[0]-l)/c,(a[1]-h)/d],b),b+=24;for(let t=i.length-6;t>=6;t-=6)for(let e=0;e<6;e+=2)isNaN(i[t+e])?(v[b]=v[b+1]=NaN,b+=2):(v[b]=i[t+e],v[b+1]=i[t+e+1],b+=2);return v.set([NaN,NaN,NaN,NaN,i[4],i[5]],b),new V_(v,u,n(this,jA),n(this,YA),n(this,HA),n(this,zA))}};let o_=a_;var l_,h_,c_,d_,u_,p_,f_,g_,m_,v_,b_,y_,w_,A_,__,x_,S_,k_,E_,C_,M_,P_,R_,T_,L_,I_,D_,F_,N_,O_,W_,j_,B_,H_,z_,$_,U_;jA=new WeakMap,BA=new WeakMap,HA=new WeakMap,zA=new WeakMap,$A=new WeakMap,UA=new WeakMap,VA=new WeakMap,GA=new WeakMap,qA=new WeakMap,XA=new WeakMap,YA=new WeakMap,KA=new WeakMap,JA=new WeakMap,QA=new WeakMap,ZA=new WeakMap,t_=new WeakMap,e_=new WeakSet,i_=function(){const t=n(this,UA).subarray(4,6),e=n(this,UA).subarray(16,18),[i,s,r,a]=n(this,jA);return[(n(this,VA)+(t[0]-e[0])/2-i)/r,(n(this,GA)+(t[1]-e[1])/2-s)/a,(n(this,VA)+(e[0]-t[0])/2-i)/r,(n(this,GA)+(e[1]-t[1])/2-s)/a]},s(o_,QA,8),s(o_,ZA,2),s(o_,t_,n(a_,QA)+n(a_,ZA));class V_ extends s_{constructor(t,e,i,a,l,h){super(),s(this,g_),s(this,v_),s(this,y_),s(this,l_,void 0),s(this,h_,null),s(this,c_,void 0),s(this,d_,void 0),s(this,u_,void 0),s(this,p_,void 0),s(this,f_,void 0),r(this,f_,t),r(this,u_,e),r(this,l_,i),r(this,p_,a),r(this,c_,l),r(this,d_,h),o(this,y_,w_).call(this,h);const{x:c,y:d,width:u,height:p}=n(this,h_);for(let e=0,i=t.length;e<i;e+=2)t[e]=(t[e]-c)/u,t[e+1]=(t[e+1]-d)/p;for(let t=0,i=e.length;t<i;t+=2)e[t]=(e[t]-c)/u,e[t+1]=(e[t+1]-d)/p}toSVGPath(){const t=[`M${n(this,f_)[4]} ${n(this,f_)[5]}`];for(let e=6,i=n(this,f_).length;e<i;e+=6)isNaN(n(this,f_)[e])?t.push(`L${n(this,f_)[e+4]} ${n(this,f_)[e+5]}`):t.push(`C${n(this,f_)[e]} ${n(this,f_)[e+1]} ${n(this,f_)[e+2]} ${n(this,f_)[e+3]} ${n(this,f_)[e+4]} ${n(this,f_)[e+5]}`);return t.push("Z"),t.join(" ")}serialize([t,e,i,s],r){const a=i-t,l=s-e;let h,c;switch(r){case 0:h=o(this,g_,m_).call(this,n(this,f_),t,s,a,-l),c=o(this,g_,m_).call(this,n(this,u_),t,s,a,-l);break;case 90:h=o(this,v_,b_).call(this,n(this,f_),t,e,a,l),c=o(this,v_,b_).call(this,n(this,u_),t,e,a,l);break;case 180:h=o(this,g_,m_).call(this,n(this,f_),i,e,-a,l),c=o(this,g_,m_).call(this,n(this,u_),i,e,-a,l);break;case 270:h=o(this,v_,b_).call(this,n(this,f_),i,s,-a,-l),c=o(this,v_,b_).call(this,n(this,u_),i,s,-a,-l)}return{outline:Array.from(h),points:[Array.from(c)]}}get box(){return n(this,h_)}getNewOutline(t,e){const{x:i,y:s,width:r,height:a}=n(this,h_),[o,l,h,c]=n(this,l_),d=r*h,u=a*c,p=i*h+o,f=s*c+l,g=new o_({x:n(this,u_)[0]*d+p,y:n(this,u_)[1]*u+f},n(this,l_),n(this,p_),t,n(this,d_),e??n(this,c_));for(let t=2;t<n(this,u_).length;t+=2)g.add({x:n(this,u_)[t]*d+p,y:n(this,u_)[t+1]*u+f});return g.getOutlines()}}l_=new WeakMap,h_=new WeakMap,c_=new WeakMap,d_=new WeakMap,u_=new WeakMap,p_=new WeakMap,f_=new WeakMap,g_=new WeakSet,m_=function(t,e,i,n,s){const r=new Float64Array(t.length);for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a]*n,r[a+1]=i+t[a+1]*s;return r},v_=new WeakSet,b_=function(t,e,i,n,s){const r=new Float64Array(t.length);for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a+1]*n,r[a+1]=i+t[a]*s;return r},y_=new WeakSet,w_=function(t){const e=n(this,f_);let i=e[4],s=e[5],a=i,o=s,l=i,h=s,c=i,d=s;const u=t?Math.max:Math.min;for(let t=6,n=e.length;t<n;t+=6){if(isNaN(e[t]))a=Math.min(a,e[t+4]),o=Math.min(o,e[t+5]),l=Math.max(l,e[t+4]),h=Math.max(h,e[t+5]),d<e[t+5]?(c=e[t+4],d=e[t+5]):d===e[t+5]&&(c=u(c,e[t+4]));else{const n=rc.bezierBoundingBox(i,s,...e.slice(t,t+6));a=Math.min(a,n[0]),o=Math.min(o,n[1]),l=Math.max(l,n[2]),h=Math.max(h,n[3]),d<n[3]?(c=n[2],d=n[3]):d===n[3]&&(c=u(c,n[2]))}i=e[t+4],s=e[t+5]}const p=a-n(this,c_),f=o-n(this,c_),g=l-a+2*n(this,c_),m=h-o+2*n(this,c_);r(this,h_,{x:p,y:f,width:g,height:m,lastPoint:[c,d]})};const G_=class{constructor({editor:t=null,uiManager:e=null}){var i;s(this,I_),s(this,F_),s(this,O_),s(this,j_),s(this,H_),s(this,$_),s(this,A_,o(this,O_,W_).bind(this)),s(this,__,o(this,H_,z_).bind(this)),s(this,x_,null),s(this,S_,null),s(this,k_,void 0),s(this,E_,null),s(this,C_,!1),s(this,M_,!1),s(this,P_,null),s(this,R_,void 0),s(this,T_,null),s(this,L_,void 0),t?(r(this,M_,!1),r(this,L_,Ql.HIGHLIGHT_COLOR),r(this,P_,t)):(r(this,M_,!0),r(this,L_,Ql.HIGHLIGHT_DEFAULT_COLOR)),r(this,T_,(null==t?void 0:t._uiManager)||e),r(this,R_,n(this,T_)._eventBus),r(this,k_,(null==t?void 0:t.color)||(null==(i=n(this,T_))?void 0:i.highlightColors.values().next().value)||"#FFFF98")}static get _keyboardManager(){return Hh(this,"_keyboardManager",new gu([[["Escape","mac+Escape"],G_.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],G_.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],G_.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],G_.prototype._moveToPrevious],[["Home","mac+Home"],G_.prototype._moveToBeginning],[["End","mac+End"],G_.prototype._moveToEnd]]))}renderButton(){const t=r(this,x_,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const e=n(this,T_)._signal;t.addEventListener("click",o(this,j_,B_).bind(this),{signal:e}),t.addEventListener("keydown",n(this,A_),{signal:e});const i=r(this,S_,document.createElement("span"));return i.className="swatch",i.setAttribute("aria-hidden",!0),i.style.backgroundColor=n(this,k_),t.append(i),t}renderMainDropdown(){const t=r(this,E_,o(this,I_,D_).call(this));return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}_colorSelectFromKeyboard(t){if(t.target===n(this,x_))return void o(this,j_,B_).call(this,t);const e=t.target.getAttribute("data-color");e&&o(this,F_,N_).call(this,e,t)}_moveToNext(t){var e,i;n(this,$_,U_)?t.target!==n(this,x_)?null==(i=t.target.nextSibling)||i.focus():null==(e=n(this,E_).firstChild)||e.focus():o(this,j_,B_).call(this,t)}_moveToPrevious(t){var e,i;t.target!==(null==(e=n(this,E_))?void 0:e.firstChild)&&t.target!==n(this,x_)?(n(this,$_,U_)||o(this,j_,B_).call(this,t),null==(i=t.target.previousSibling)||i.focus()):n(this,$_,U_)&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){var e;n(this,$_,U_)?null==(e=n(this,E_).firstChild)||e.focus():o(this,j_,B_).call(this,t)}_moveToEnd(t){var e;n(this,$_,U_)?null==(e=n(this,E_).lastChild)||e.focus():o(this,j_,B_).call(this,t)}hideDropdown(){var t;null==(t=n(this,E_))||t.classList.add("hidden"),window.removeEventListener("pointerdown",n(this,__))}_hideDropdownFromKeyboard(){var t;if(!n(this,M_)){if(!n(this,$_,U_))return void(null==(t=n(this,P_))||t.unselect());this.hideDropdown(),n(this,x_).focus({preventScroll:!0,focusVisible:n(this,C_)})}}updateColor(t){if(n(this,S_)&&(n(this,S_).style.backgroundColor=t),!n(this,E_))return;const e=n(this,T_).highlightColors.values();for(const i of n(this,E_).children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){var t,e;null==(t=n(this,x_))||t.remove(),r(this,x_,null),r(this,S_,null),null==(e=n(this,E_))||e.remove(),r(this,E_,null)}};let q_=G_;var X_,Y_,K_,J_,Q_,Z_,tx,ex,ix,nx,sx,rx,ax,ox,lx,hx,cx,dx,ux,px,fx,gx,mx,vx,bx,yx,wx,Ax,_x,xx,Sx,kx,Ex,Cx,Mx,Px,Rx,Tx,Lx,Ix,Dx,Fx,Nx,Ox,Wx,jx,Bx,Hx,zx;A_=new WeakMap,__=new WeakMap,x_=new WeakMap,S_=new WeakMap,k_=new WeakMap,E_=new WeakMap,C_=new WeakMap,M_=new WeakMap,P_=new WeakMap,R_=new WeakMap,T_=new WeakMap,L_=new WeakMap,I_=new WeakSet,D_=function(){const t=document.createElement("div"),e=n(this,T_)._signal;t.addEventListener("contextmenu",gd,{signal:e}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[i,s]of n(this,T_).highlightColors){const r=document.createElement("button");r.tabIndex="0",r.role="option",r.setAttribute("data-color",s),r.title=i,r.setAttribute("data-l10n-id",`pdfjs-editor-colorpicker-${i}`);const a=document.createElement("span");r.append(a),a.className="swatch",a.style.backgroundColor=s,r.setAttribute("aria-selected",s===n(this,k_)),r.addEventListener("click",o(this,F_,N_).bind(this,s),{signal:e}),t.append(r)}return t.addEventListener("keydown",n(this,A_),{signal:e}),t},F_=new WeakSet,N_=function(t,e){e.stopPropagation(),n(this,R_).dispatch("switchannotationeditorparams",{source:this,type:n(this,L_),value:t})},O_=new WeakSet,W_=function(t){G_._keyboardManager.exec(this,t)},j_=new WeakSet,B_=function(t){if(n(this,$_,U_))return void this.hideDropdown();if(r(this,C_,0===t.detail),window.addEventListener("pointerdown",n(this,__),{signal:n(this,T_)._signal}),n(this,E_))return void n(this,E_).classList.remove("hidden");const e=r(this,E_,o(this,I_,D_).call(this));n(this,x_).append(e)},H_=new WeakSet,z_=function(t){var e;null!=(e=n(this,E_))&&e.contains(t.target)||this.hideDropdown()},$_=new WeakSet,U_=function(){return n(this,E_)&&!n(this,E_).classList.contains("hidden")};const $x=class extends og{constructor(t){super({...t,name:"highlightEditor"}),s(this,px),s(this,gx),s(this,vx),s(this,yx),s(this,Ax),s(this,xx),s(this,kx),s(this,Px),s(this,Tx),s(this,Ix),s(this,Fx),s(this,Ox),s(this,X_,null),s(this,Y_,0),s(this,K_,void 0),s(this,J_,null),s(this,Q_,null),s(this,Z_,null),s(this,tx,null),s(this,ex,0),s(this,ix,null),s(this,nx,null),s(this,sx,null),s(this,rx,!1),s(this,ax,o(this,Px,Rx).bind(this)),s(this,ox,null),s(this,lx,void 0),s(this,hx,null),s(this,cx,""),s(this,dx,void 0),s(this,ux,""),this.color=t.color||$x._defaultColor,r(this,dx,t.thickness||$x._defaultThickness),r(this,lx,t.opacity||$x._defaultOpacity),r(this,K_,t.boxes||null),r(this,ux,t.methodOfCreation||""),r(this,cx,t.text||""),this._isDraggable=!1,t.highlightId>-1?(r(this,rx,!0),o(this,gx,mx).call(this,t),o(this,kx,Ex).call(this)):(r(this,X_,t.anchorNode),r(this,Y_,t.anchorOffset),r(this,tx,t.focusNode),r(this,ex,t.focusOffset),o(this,px,fx).call(this),o(this,kx,Ex).call(this),this.rotate(this.rotation))}static get _keyboardManager(){const t=$x.prototype;return Hh(this,"_keyboardManager",new gu([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:n(this,rx)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:n(this,dx),methodOfCreation:n(this,ux)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,e){var i;og.initialize(t,e),$x._defaultColor||($x._defaultColor=(null==(i=e.highlightColors)?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(t,e){switch(t){case Ql.HIGHLIGHT_DEFAULT_COLOR:$x._defaultColor=e;break;case Ql.HIGHLIGHT_THICKNESS:$x._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return n(this,ox)}updateParams(t,e){switch(t){case Ql.HIGHLIGHT_COLOR:o(this,vx,bx).call(this,e);break;case Ql.HIGHLIGHT_THICKNESS:o(this,yx,wx).call(this,e)}}static get defaultPropertiesToUpdate(){return[[Ql.HIGHLIGHT_DEFAULT_COLOR,$x._defaultColor],[Ql.HIGHLIGHT_THICKNESS,$x._defaultThickness]]}get propertiesToUpdate(){return[[Ql.HIGHLIGHT_COLOR,this.color||$x._defaultColor],[Ql.HIGHLIGHT_THICKNESS,n(this,dx)||$x._defaultThickness],[Ql.HIGHLIGHT_FREE,n(this,rx)]]}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(r(this,Q_,new q_({editor:this})),t.addColorPicker(n(this,Q_))),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(o(this,Ix,Dx).call(this))}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,o(this,Ix,Dx).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){o(this,xx,Sx).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(o(this,kx,Ex).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var e;let i=!1;this.parent&&!t?o(this,xx,Sx).call(this):t&&(o(this,kx,Ex).call(this,t),i=!this.parent&&(null==(e=this.div)?void 0:e.classList.contains("selectedEditor"))),super.setParent(t),this.show(this._isVisible),i&&this.select()}rotate(t){var e,i,s;const{drawLayer:r}=this.parent;let a;n(this,rx)?(t=(t-this.rotation+360)%360,a=o(e=$x,Cx,Mx).call(e,n(this,nx).box,t)):a=o(i=$x,Cx,Mx).call(i,this,t),r.rotate(n(this,sx),t),r.rotate(n(this,hx),t),r.updateBox(n(this,sx),a),r.updateBox(n(this,hx),o(s=$x,Cx,Mx).call(s,n(this,Z_).box,t))}render(){if(this.div)return this.div;const t=super.render();n(this,cx)&&(t.setAttribute("aria-label",n(this,cx)),t.setAttribute("role","mark")),n(this,rx)?t.classList.add("free"):this.div.addEventListener("keydown",n(this,ax),{signal:this._uiManager._signal});const e=r(this,ix,document.createElement("div"));t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=n(this,J_);const[i,s]=this.parentDimensions;return this.setDims(this.width*i,this.height*s),su(this,n(this,ix),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.parent.drawLayer.addClass(n(this,hx),"hovered")}pointerleave(){this.parent.drawLayer.removeClass(n(this,hx),"hovered")}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:o(this,Tx,Lx).call(this,!0);break;case 1:case 3:o(this,Tx,Lx).call(this,!1)}}select(){var t,e;super.select(),n(this,hx)&&(null==(t=this.parent)||t.drawLayer.removeClass(n(this,hx),"hovered"),null==(e=this.parent)||e.drawLayer.addClass(n(this,hx),"selected"))}unselect(){var t;super.unselect(),n(this,hx)&&(null==(t=this.parent)||t.drawLayer.removeClass(n(this,hx),"selected"),n(this,rx)||o(this,Tx,Lx).call(this,!1))}get _mustFixPosition(){return!n(this,rx)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.show(n(this,sx),t),this.parent.drawLayer.show(n(this,hx),t))}static startHighlighting(t,e,{target:i,x:n,y:s}){const{x:r,y:a,width:l,height:h}=i.getBoundingClientRect(),c=e=>{o(this,jx,Bx).call(this,t,e)},d=t._signal,u={capture:!0,passive:!1,signal:d},p=t=>{t.preventDefault(),t.stopPropagation()},f=e=>{i.removeEventListener("pointermove",c),window.removeEventListener("blur",f),window.removeEventListener("pointerup",f),window.removeEventListener("pointerdown",p,u),window.removeEventListener("contextmenu",gd),o(this,Hx,zx).call(this,t,e)};window.addEventListener("blur",f,{signal:d}),window.addEventListener("pointerup",f,{signal:d}),window.addEventListener("pointerdown",p,u),window.addEventListener("contextmenu",gd,{signal:d}),i.addEventListener("pointermove",c,{signal:d}),this._freeHighlight=new o_({x:n,y:s},[r,a,l,h],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static deserialize(t,e,i){var n;const s=super.deserialize(t,e,i),{rect:[a,l,h,c],color:d,quadPoints:u}=t;s.color=rc.makeHexColor(...d),r(s,lx,t.opacity);const[p,f]=s.pageDimensions;s.width=(h-a)/p,s.height=(c-l)/f;const g=r(s,K_,[]);for(let t=0;t<u.length;t+=8)g.push({x:(u[4]-h)/p,y:(c-(1-u[t+5]))/f,width:(u[t+2]-u[t])/p,height:(u[t+5]-u[t+1])/f});return o(n=s,px,fx).call(n),s}serialize(t=!1){if(this.isEmpty()||t)return null;const e=this.getRect(0,0),i=og._colorManager.convert(this.color);return{annotationType:Jl.HIGHLIGHT,color:i,opacity:n(this,lx),thickness:n(this,dx),quadPoints:o(this,Fx,Nx).call(this),outlines:o(this,Ox,Wx).call(this,e),pageIndex:this.pageIndex,rect:e,rotation:o(this,Ix,Dx).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}};let Ux=$x;var Vx,Gx,qx,Xx,Yx,Kx,Jx,Qx,Zx,tS,eS,iS,nS,sS,rS,aS,oS,lS,hS,cS,dS,uS,pS,fS,gS,mS,vS,bS,yS,wS,AS,_S,xS,SS,kS,ES,CS,MS,PS,RS,TS,LS,IS,DS,FS,NS,OS,WS,jS,BS,HS,zS,$S,US,VS,GS,qS,XS,YS,KS,JS,QS,ZS,tk,ek,ik,nk;X_=new WeakMap,Y_=new WeakMap,K_=new WeakMap,J_=new WeakMap,Q_=new WeakMap,Z_=new WeakMap,tx=new WeakMap,ex=new WeakMap,ix=new WeakMap,nx=new WeakMap,sx=new WeakMap,rx=new WeakMap,ax=new WeakMap,ox=new WeakMap,lx=new WeakMap,hx=new WeakMap,cx=new WeakMap,dx=new WeakMap,ux=new WeakMap,px=new WeakSet,fx=function(){const t=new n_(n(this,K_),.001);r(this,nx,t.getOutlines()),({x:this.x,y:this.y,width:this.width,height:this.height}=n(this,nx).box);const e=new n_(n(this,K_),.0025,.001,"ltr"===this._uiManager.direction);r(this,Z_,e.getOutlines());const{lastPoint:i}=n(this,Z_).box;r(this,ox,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])},gx=new WeakSet,mx=function({highlightOutlines:t,highlightId:e,clipPathId:i}){var s,a;r(this,nx,t);if(r(this,Z_,t.getNewOutline(n(this,dx)/2+1.5,.0025)),e>=0)r(this,sx,e),r(this,J_,i),this.parent.drawLayer.finalizeLine(e,t),r(this,hx,this.parent.drawLayer.highlightOutline(n(this,Z_)));else if(this.parent){const e=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(n(this,sx),t),this.parent.drawLayer.updateBox(n(this,sx),o(s=$x,Cx,Mx).call(s,n(this,nx).box,(e-this.rotation+360)%360)),this.parent.drawLayer.updateLine(n(this,hx),n(this,Z_)),this.parent.drawLayer.updateBox(n(this,hx),o(a=$x,Cx,Mx).call(a,n(this,Z_).box,e))}const{x:l,y:h,width:c,height:d}=t.box;switch(this.rotation){case 0:this.x=l,this.y=h,this.width=c,this.height=d;break;case 90:{const[t,e]=this.parentDimensions;this.x=h,this.y=1-l,this.width=c*e/t,this.height=d*t/e;break}case 180:this.x=1-l,this.y=1-h,this.width=c,this.height=d;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-h,this.y=l,this.width=c*e/t,this.height=d*t/e;break}}const{lastPoint:u}=n(this,Z_).box;r(this,ox,[(u[0]-l)/c,(u[1]-h)/d])},vx=new WeakSet,bx=function(t){const e=t=>{var e,i;this.color=t,null==(e=this.parent)||e.drawLayer.changeColor(n(this,sx),t),null==(i=n(this,Q_))||i.updateColor(t)},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)},yx=new WeakSet,wx=function(t){const e=n(this,dx),i=t=>{r(this,dx,t),o(this,Ax,_x).call(this,t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)},Ax=new WeakSet,_x=function(t){if(!n(this,rx))return;o(this,gx,mx).call(this,{highlightOutlines:n(this,nx).getNewOutline(t/2)}),this.fixAndSetPosition();const[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)},xx=new WeakSet,Sx=function(){null===n(this,sx)||!this.parent||(this.parent.drawLayer.remove(n(this,sx)),r(this,sx,null),this.parent.drawLayer.remove(n(this,hx)),r(this,hx,null))},kx=new WeakSet,Ex=function(t=this.parent){null===n(this,sx)&&(({id:a(this,sx)._,clipPathId:a(this,J_)._}=t.drawLayer.highlight(n(this,nx),this.color,n(this,lx))),r(this,hx,t.drawLayer.highlightOutline(n(this,Z_))),n(this,ix)&&(n(this,ix).style.clipPath=n(this,J_)))},Cx=new WeakSet,Mx=function({x:t,y:e,width:i,height:n},s){switch(s){case 90:return{x:1-e-n,y:t,width:n,height:i};case 180:return{x:1-t-i,y:1-e-n,width:i,height:n};case 270:return{x:e,y:1-t-i,width:n,height:i}}return{x:t,y:e,width:i,height:n}},Px=new WeakSet,Rx=function(t){$x._keyboardManager.exec(this,t)},Tx=new WeakSet,Lx=function(t){if(!n(this,X_))return;const e=window.getSelection();t?e.setPosition(n(this,X_),n(this,Y_)):e.setPosition(n(this,tx),n(this,ex))},Ix=new WeakSet,Dx=function(){return n(this,rx)?this.rotation:0},Fx=new WeakSet,Nx=function(){if(n(this,rx))return null;const[t,e]=this.pageDimensions,i=n(this,K_),s=new Float32Array(8*i.length);let r=0;for(const{x:n,y:a,width:o,height:l}of i){const i=n*t,h=(1-a-l)*e;s[r]=s[r+4]=i,s[r+1]=s[r+3]=h,s[r+2]=s[r+6]=i+o*t,s[r+5]=s[r+7]=h+l*e,r+=8}return s},Ox=new WeakSet,Wx=function(t){return n(this,nx).serialize(t,o(this,Ix,Dx).call(this))},jx=new WeakSet,Bx=function(t,e){this._freeHighlight.add(e)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)},Hx=new WeakSet,zx=function(t,e){this._freeHighlight.isEmpty()?t.drawLayer.removeFreeHighlight(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},s(Ux,Cx),s(Ux,jx),s(Ux,Hx),e(Ux,"_defaultColor",null),e(Ux,"_defaultOpacity",1),e(Ux,"_defaultThickness",12),e(Ux,"_l10nPromise"),e(Ux,"_type","highlight"),e(Ux,"_editorType",Jl.HIGHLIGHT),e(Ux,"_freeHighlightId",-1),e(Ux,"_freeHighlight",null),e(Ux,"_freeHighlightClipId","");const sk=class extends og{constructor(t){super({...t,name:"inkEditor"}),s(this,aS),s(this,lS),s(this,cS),s(this,uS),s(this,fS),s(this,mS),s(this,bS),s(this,wS),s(this,_S),s(this,SS),s(this,ES),s(this,MS),s(this,RS),s(this,LS),s(this,DS),s(this,NS),s(this,WS),s(this,BS),s(this,zS),s(this,KS),s(this,QS),s(this,tk),s(this,ik),s(this,Vx,0),s(this,Gx,0),s(this,qx,this.canvasPointermove.bind(this)),s(this,Xx,this.canvasPointerleave.bind(this)),s(this,Yx,this.canvasPointerup.bind(this)),s(this,Kx,this.canvasPointerdown.bind(this)),s(this,Jx,null),s(this,Qx,new Path2D),s(this,Zx,!1),s(this,tS,!1),s(this,eS,!1),s(this,iS,null),s(this,nS,0),s(this,sS,0),s(this,rS,null),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t,e){og.initialize(t,e)}static updateDefaultParams(t,e){switch(t){case Ql.INK_THICKNESS:sk._defaultThickness=e;break;case Ql.INK_COLOR:sk._defaultColor=e;break;case Ql.INK_OPACITY:sk._defaultOpacity=e/100}}updateParams(t,e){switch(t){case Ql.INK_THICKNESS:o(this,aS,oS).call(this,e);break;case Ql.INK_COLOR:o(this,lS,hS).call(this,e);break;case Ql.INK_OPACITY:o(this,cS,dS).call(this,e)}}static get defaultPropertiesToUpdate(){return[[Ql.INK_THICKNESS,sk._defaultThickness],[Ql.INK_COLOR,sk._defaultColor||og._defaultLineColor],[Ql.INK_OPACITY,Math.round(100*sk._defaultOpacity)]]}get propertiesToUpdate(){return[[Ql.INK_THICKNESS,this.thickness||sk._defaultThickness],[Ql.INK_COLOR,this.color||sk._defaultColor||og._defaultLineColor],[Ql.INK_OPACITY,Math.round(100*(this.opacity??sk._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(o(this,DS,FS).call(this),o(this,NS,OS).call(this)),this.isAttachedToDOM||(this.parent.add(this),o(this,WS,jS).call(this)),o(this,ik,nk).call(this)))}remove(){var t;null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,n(this,Jx)&&(clearTimeout(n(this,Jx)),r(this,Jx,null)),null==(t=n(this,iS))||t.disconnect(),r(this,iS,null),super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,i=this.width*t,n=this.height*e;this.setDimensions(i,n)}enableEditMode(){n(this,Zx)||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",n(this,Kx),{signal:this._uiManager._signal}))}disableEditMode(){!this.isInEditMode()||null===this.canvas||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",n(this,Kx)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){n(this,Zx)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),r(this,Zx,!0),this.div.classList.add("disabled"),o(this,ik,nk).call(this,!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){0!==t.button||!this.isInEditMode()||n(this,Zx)||(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),o(this,mS,vS).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),o(this,bS,yS).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),o(this,LS,IS).call(this,t)}canvasPointerleave(t){o(this,LS,IS).call(this,t)}get isResizable(){return!this.isEmpty()&&n(this,Zx)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,n,s,a]=o(this,uS,pS).call(this);if(this.setAt(i,n,0,0),this.setDims(s,a),o(this,DS,FS).call(this),this.width){const[i,n]=this.parentDimensions;this.setAspectRatio(this.width*i,this.height*n),this.setAt(t*i,e*n,this.width*i,this.height*n),r(this,eS,!0),o(this,WS,jS).call(this),this.setDims(this.width*i,this.height*n),o(this,RS,TS).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return o(this,NS,OS).call(this),this.div}setDimensions(t,e){const i=Math.round(t),s=Math.round(e);if(n(this,nS)===i&&n(this,sS)===s)return;r(this,nS,i),r(this,sS,s),this.canvas.style.visibility="hidden";const[a,l]=this.parentDimensions;this.width=t/a,this.height=e/l,this.fixAndSetPosition(),n(this,Zx)&&o(this,BS,HS).call(this,t,e),o(this,WS,jS).call(this),o(this,RS,TS).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(t,e,i){var n,s,a;if(t instanceof jw)return null;const l=super.deserialize(t,e,i);l.thickness=t.thickness,l.color=rc.makeHexColor(...t.color),l.opacity=t.opacity;const[h,c]=l.pageDimensions,d=l.width*h,u=l.height*c,p=l.parentScale,f=t.thickness/2;r(l,Zx,!0),r(l,nS,Math.round(d)),r(l,sS,Math.round(u));const{paths:g,rect:m,rotation:v}=t;for(let{bezier:t}of g){t=o(n=sk,XS,YS).call(n,t,m,v);const e=[];l.paths.push(e);let i=p*(t[0]-f),s=p*(t[1]-f);for(let n=2,r=t.length;n<r;n+=6){const r=p*(t[n]-f),a=p*(t[n+1]-f),o=p*(t[n+2]-f),l=p*(t[n+3]-f),h=p*(t[n+4]-f),c=p*(t[n+5]-f);e.push([[i,s],[r,a],[o,l],[h,c]]),i=h,s=c}const r=o(this,US,VS).call(this,e);l.bezierPath2D.push(r)}const b=o(s=l,QS,ZS).call(s);return r(l,Gx,Math.max(og.MIN_SIZE,b[2]-b[0])),r(l,Vx,Math.max(og.MIN_SIZE,b[3]-b[1])),o(a=l,BS,HS).call(a,d,u),l}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=og._colorManager.convert(this.ctx.strokeStyle);return{annotationType:Jl.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:o(this,KS,JS).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};let rk=sk;var ak,ok,lk,hk,ck,dk,uk,pk,fk,gk,mk,vk,bk,yk,wk,Ak,_k,xk,Sk,kk,Ek,Ck,Mk,Pk,Rk,Tk,Lk,Ik,Dk;Vx=new WeakMap,Gx=new WeakMap,qx=new WeakMap,Xx=new WeakMap,Yx=new WeakMap,Kx=new WeakMap,Jx=new WeakMap,Qx=new WeakMap,Zx=new WeakMap,tS=new WeakMap,eS=new WeakMap,iS=new WeakMap,nS=new WeakMap,sS=new WeakMap,rS=new WeakMap,aS=new WeakSet,oS=function(t){const e=t=>{this.thickness=t,o(this,ik,nk).call(this)},i=this.thickness;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},lS=new WeakSet,hS=function(t){const e=t=>{this.color=t,o(this,RS,TS).call(this)},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},cS=new WeakSet,dS=function(t){const e=t=>{this.opacity=t,o(this,RS,TS).call(this)};t/=100;const i=this.opacity;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ql.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},uS=new WeakSet,pS=function(){const{parentRotation:t,parentDimensions:[e,i]}=this;switch(t){case 90:return[0,i,i,e];case 180:return[e,i,e,i];case 270:return[e,0,i,e];default:return[0,0,e,i]}},fS=new WeakSet,gS=function(){const{ctx:t,color:e,opacity:i,thickness:n,parentScale:s,scaleFactor:r}=this;var a;t.lineWidth=n*s/r,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${e}${a=i,Math.round(Math.min(255,Math.max(1,255*a))).toString(16).padStart(2,"0")}`},mS=new WeakSet,vS=function(t,e){const i=this._uiManager._signal;this.canvas.addEventListener("contextmenu",gd,{signal:i}),this.canvas.addEventListener("pointerleave",n(this,Xx),{signal:i}),this.canvas.addEventListener("pointermove",n(this,qx),{signal:i}),this.canvas.addEventListener("pointerup",n(this,Yx),{signal:i}),this.canvas.removeEventListener("pointerdown",n(this,Kx)),this.isEditing=!0,n(this,eS)||(r(this,eS,!0),o(this,WS,jS).call(this),this.thickness||(this.thickness=sk._defaultThickness),this.color||(this.color=sk._defaultColor||og._defaultLineColor),this.opacity??(this.opacity=sk._defaultOpacity)),this.currentPath.push([t,e]),r(this,tS,!1),o(this,fS,gS).call(this),r(this,rS,(()=>{o(this,SS,kS).call(this),n(this,rS)&&window.requestAnimationFrame(n(this,rS))})),window.requestAnimationFrame(n(this,rS))},bS=new WeakSet,yS=function(t,e){const[i,s]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&e===s)return;const a=this.currentPath;let l=n(this,Qx);if(a.push([t,e]),r(this,tS,!0),a.length<=2)return l.moveTo(...a[0]),void l.lineTo(t,e);3===a.length&&(r(this,Qx,l=new Path2D),l.moveTo(...a[0])),o(this,ES,CS).call(this,l,...a.at(-3),...a.at(-2),t,e)},wS=new WeakSet,AS=function(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);n(this,Qx).lineTo(...t)},_S=new WeakSet,xS=function(t,e){let i;if(r(this,rS,null),t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),o(this,bS,yS).call(this,t,e),o(this,wS,AS).call(this),1!==this.currentPath.length)i=o(this,MS,PS).call(this);else{const n=[t,e];i=[[n,n.slice(),n.slice(),n]]}const s=n(this,Qx),a=this.currentPath;this.currentPath=[],r(this,Qx,new Path2D);this.addCommands({cmd:()=>{this.allRawPaths.push(a),this.paths.push(i),this.bezierPath2D.push(s),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(o(this,DS,FS).call(this),o(this,NS,OS).call(this)),o(this,ik,nk).call(this))},mustExec:!0})},SS=new WeakSet,kS=function(){if(!n(this,tS))return;r(this,tS,!1);Math.ceil(this.thickness*this.parentScale);const t=this.currentPath.slice(-3),e=t.map((t=>t[0])),i=t.map((t=>t[1]));Math.min(...e),Math.max(...e),Math.min(...i),Math.max(...i);const{ctx:s}=this;s.save(),s.clearRect(0,0,this.canvas.width,this.canvas.height);for(const t of this.bezierPath2D)s.stroke(t);s.stroke(n(this,Qx)),s.restore()},ES=new WeakSet,CS=function(t,e,i,n,s,r,a){const o=(e+n)/2,l=(i+s)/2,h=(n+r)/2,c=(s+a)/2;t.bezierCurveTo(o+2*(n-o)/3,l+2*(s-l)/3,h+2*(n-h)/3,c+2*(s-c)/3,h,c)},MS=new WeakSet,PS=function(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let i,[n,s]=t[0];for(i=1;i<t.length-2;i++){const[r,a]=t[i],[o,l]=t[i+1],h=(r+o)/2,c=(a+l)/2,d=[n+2*(r-n)/3,s+2*(a-s)/3],u=[h+2*(r-h)/3,c+2*(a-c)/3];e.push([[n,s],d,u,[h,c]]),[n,s]=[h,c]}const[r,a]=t[i],[o,l]=t[i+1],h=[n+2*(r-n)/3,s+2*(a-s)/3],c=[o+2*(r-o)/3,l+2*(a-l)/3];return e.push([[n,s],h,c,[o,l]]),e},RS=new WeakSet,TS=function(){if(this.isEmpty())return void o(this,zS,$S).call(this);o(this,fS,gS).call(this);const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),o(this,zS,$S).call(this);for(const t of this.bezierPath2D)e.stroke(t)},LS=new WeakSet,IS=function(t){this.canvas.removeEventListener("pointerleave",n(this,Xx)),this.canvas.removeEventListener("pointermove",n(this,qx)),this.canvas.removeEventListener("pointerup",n(this,Yx)),this.canvas.addEventListener("pointerdown",n(this,Kx),{signal:this._uiManager._signal}),n(this,Jx)&&clearTimeout(n(this,Jx)),r(this,Jx,setTimeout((()=>{r(this,Jx,null),this.canvas.removeEventListener("contextmenu",gd)}),10)),o(this,_S,xS).call(this,t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()},DS=new WeakSet,FS=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},NS=new WeakSet,OS=function(){r(this,iS,new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}))),n(this,iS).observe(this.div),this._uiManager._signal.addEventListener("abort",(()=>{var t;null==(t=n(this,iS))||t.disconnect(),r(this,iS,null)}),{once:!0})},WS=new WeakSet,jS=function(){if(!n(this,eS))return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),o(this,zS,$S).call(this)},BS=new WeakSet,HS=function(t,e){const i=o(this,tk,ek).call(this),s=(t-i)/n(this,Gx),r=(e-i)/n(this,Vx);this.scaleFactor=Math.min(s,r)},zS=new WeakSet,$S=function(){const t=o(this,tk,ek).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)},US=new WeakSet,VS=function(t){const e=new Path2D;for(let i=0,n=t.length;i<n;i++){const[n,s,r,a]=t[i];0===i&&e.moveTo(...n),e.bezierCurveTo(s[0],s[1],r[0],r[1],a[0],a[1])}return e},GS=new WeakSet,qS=function(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]+=n,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]+n,t[e+1]=i+s}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=r-t[e],t[e+1]+=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=r-t[e+1],t[e+1]=a-i}break;default:throw new Error("Invalid rotation")}return t},XS=new WeakSet,YS=function(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]-=n,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]-s,t[e+1]=i-n}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=r-t[e],t[e+1]-=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=a-t[e+1],t[e+1]=r-i}break;default:throw new Error("Invalid rotation")}return t},KS=new WeakSet,JS=function(t,e,i,n){var s,r;const a=[],l=this.thickness/2,h=t*e+l,c=t*i+l;for(const e of this.paths){const i=[],l=[];for(let n=0,s=e.length;n<s;n++){const[r,a,o,d]=e[n];if(r[0]===d[0]&&r[1]===d[1]&&1===s){const e=t*r[0]+h,n=t*r[1]+c;i.push(e,n),l.push(e,n);break}const u=t*r[0]+h,p=t*r[1]+c,f=t*a[0]+h,g=t*a[1]+c,m=t*o[0]+h,v=t*o[1]+c,b=t*d[0]+h,y=t*d[1]+c;0===n&&(i.push(u,p),l.push(u,p)),i.push(f,g,m,v,b,y),l.push(f,g),n===s-1&&l.push(b,y)}a.push({bezier:o(s=sk,GS,qS).call(s,i,n,this.rotation),points:o(r=sk,GS,qS).call(r,l,n,this.rotation)})}return a},QS=new WeakSet,ZS=function(){let t=1/0,e=-1/0,i=1/0,n=-1/0;for(const s of this.paths)for(const[r,a,o,l]of s){const s=rc.bezierBoundingBox(...r,...a,...o,...l);t=Math.min(t,s[0]),i=Math.min(i,s[1]),e=Math.max(e,s[2]),n=Math.max(n,s[3])}return[t,i,e,n]},tk=new WeakSet,ek=function(){return n(this,Zx)?Math.ceil(this.thickness*this.parentScale):0},ik=new WeakSet,nk=function(t=!1){if(this.isEmpty())return;if(!n(this,Zx))return void o(this,RS,TS).call(this);const e=o(this,QS,ZS).call(this),i=o(this,tk,ek).call(this);r(this,Gx,Math.max(og.MIN_SIZE,e[2]-e[0])),r(this,Vx,Math.max(og.MIN_SIZE,e[3]-e[1]));const s=Math.ceil(i+n(this,Gx)*this.scaleFactor),a=Math.ceil(i+n(this,Vx)*this.scaleFactor),[l,h]=this.parentDimensions;this.width=s/l,this.height=a/h,this.setAspectRatio(s,a);const c=this.translationX,d=this.translationY;this.translationX=-e[0],this.translationY=-e[1],o(this,WS,jS).call(this),o(this,RS,TS).call(this),r(this,nS,s),r(this,sS,a),this.setDims(s,a);const u=t?i/this.scaleFactor/2:0;this.translate(c-this.translationX-u,d-this.translationY-u)},s(rk,US),s(rk,GS),s(rk,XS),e(rk,"_defaultColor",null),e(rk,"_defaultOpacity",1),e(rk,"_defaultThickness",1),e(rk,"_type","ink"),e(rk,"_editorType",Jl.INK);const Fk=class extends og{constructor(t){super({...t,name:"stampEditor"}),s(this,vk),s(this,yk),s(this,Ak),s(this,xk),s(this,kk),s(this,Ck),s(this,Pk),s(this,Tk),s(this,Ik),s(this,ak,null),s(this,ok,null),s(this,lk,null),s(this,hk,null),s(this,ck,null),s(this,dk,""),s(this,uk,null),s(this,pk,null),s(this,fk,null),s(this,gk,!1),s(this,mk,!1),r(this,hk,t.bitmapUrl),r(this,ck,t.bitmapFile)}static initialize(t,e){og.initialize(t,e)}static get supportedTypes(){return Hh(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((t=>`image/${t}`)))}static get supportedTypesStr(){return Hh(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(Jl.STAMP,{bitmapFile:t.getAsFile()})}remove(){var t,e;n(this,ok)&&(r(this,ak,null),this._uiManager.imageManager.deleteId(n(this,ok)),null==(t=n(this,uk))||t.remove(),r(this,uk,null),null==(e=n(this,pk))||e.disconnect(),r(this,pk,null),n(this,fk)&&(clearTimeout(n(this,fk)),r(this,fk,null))),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(n(this,ok)&&null===n(this,uk)&&o(this,Ak,_k).call(this),this.isAttachedToDOM||this.parent.add(this))):n(this,ok)&&o(this,Ak,_k).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(n(this,lk)||n(this,ak)||n(this,hk)||n(this,ck)||n(this,ok))}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),n(this,ak)?o(this,xk,Sk).call(this):o(this,Ak,_k).call(this),this.width){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n)}return this.div}getImageForAltText(){return n(this,uk)}static deserialize(t,e,i){if(t instanceof Uw)return null;const n=super.deserialize(t,e,i),{rect:s,bitmapUrl:a,bitmapId:o,isSvg:l,accessibilityData:h}=t;o&&i.imageManager.isValidId(o)?r(n,ok,o):r(n,hk,a),r(n,gk,l);const[c,d]=n.pageDimensions;return n.width=(s[2]-s[0])/c,n.height=(s[3]-s[1])/d,h&&(n.altTextData=h),n}serialize(t=!1,e=null){if(this.isEmpty())return null;const i={annotationType:Jl.STAMP,bitmapId:n(this,ok),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:n(this,gk),structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=o(this,Tk,Lk).call(this,!0),i.accessibilityData=this.altTextData,i;const{decorative:s,altText:r}=this.altTextData;if(!s&&r&&(i.accessibilityData={type:"Figure",alt:r}),null===e)return i;e.stamps||(e.stamps=new Map);const a=n(this,gk)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(n(this,ok))){if(n(this,gk)){const t=e.stamps.get(n(this,ok));a>t.area&&(t.area=a,t.serialized.bitmap.close(),t.serialized.bitmap=o(this,Tk,Lk).call(this,!1))}}else e.stamps.set(n(this,ok),{area:a,serialized:i}),i.bitmap=o(this,Tk,Lk).call(this,!1);return i}};let Nk=Fk;var Ok,Wk,jk,Bk,Hk,zk,$k,Uk,Vk,Gk,qk,Xk,Yk,Kk,Jk,Qk,Zk,tE,eE,iE,nE,sE,rE,aE;ak=new WeakMap,ok=new WeakMap,lk=new WeakMap,hk=new WeakMap,ck=new WeakMap,dk=new WeakMap,uk=new WeakMap,pk=new WeakMap,fk=new WeakMap,gk=new WeakMap,mk=new WeakMap,vk=new WeakSet,bk=function(t,e=!1){t?(r(this,ak,t.bitmap),e||(r(this,ok,t.id),r(this,gk,t.isSvg)),t.file&&r(this,dk,t.file.name),o(this,xk,Sk).call(this)):this.remove()},yk=new WeakSet,wk=function(){r(this,lk,null),this._uiManager.enableWaiting(!1),n(this,uk)&&this.div.focus()},Ak=new WeakSet,_k=function(){if(n(this,ok))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(n(this,ok)).then((t=>o(this,vk,bk).call(this,t,!0))).finally((()=>o(this,yk,wk).call(this)));if(n(this,hk)){const t=n(this,hk);return r(this,hk,null),this._uiManager.enableWaiting(!0),void r(this,lk,this._uiManager.imageManager.getFromUrl(t).then((t=>o(this,vk,bk).call(this,t))).finally((()=>o(this,yk,wk).call(this))))}if(n(this,ck)){const t=n(this,ck);return r(this,ck,null),this._uiManager.enableWaiting(!0),void r(this,lk,this._uiManager.imageManager.getFromFile(t).then((t=>o(this,vk,bk).call(this,t))).finally((()=>o(this,yk,wk).call(this))))}const t=document.createElement("input");t.type="file",t.accept=Fk.supportedTypesStr;const e=this._uiManager._signal;r(this,lk,new Promise((i=>{t.addEventListener("change",(async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);o(this,vk,bk).call(this,e)}else this.remove();i()}),{signal:e}),t.addEventListener("cancel",(()=>{this.remove(),i()}),{signal:e})})).finally((()=>o(this,yk,wk).call(this)))),t.click()},xk=new WeakSet,Sk=function(){const{div:t}=this;let{width:e,height:i}=n(this,ak);const[s,a]=this.pageDimensions,l=.75;if(this.width)e=this.width*s,i=this.height*a;else if(e>l*s||i>l*a){const t=Math.min(l*s/e,l*a/i);e*=t,i*=t}const[h,c]=this.parentDimensions;this.setDims(e*h/s,i*c/a),this._uiManager.enableWaiting(!1);const d=r(this,uk,document.createElement("canvas"));t.append(d),t.hidden=!1,o(this,Pk,Rk).call(this,e,i),o(this,Ik,Dk).call(this),n(this,mk)||(this.parent.addUndoableEditor(this),r(this,mk,!0)),this._reportTelemetry({action:"inserted_image"}),n(this,dk)&&d.setAttribute("aria-label",n(this,dk))},kk=new WeakSet,Ek=function(t,e){var i;const[s,a]=this.parentDimensions;this.width=t/s,this.height=e/a,this.setDims(t,e),null!=(i=this._initialOptions)&&i.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==n(this,fk)&&clearTimeout(n(this,fk)),r(this,fk,setTimeout((()=>{r(this,fk,null),o(this,Pk,Rk).call(this,t,e)}),200))},Ck=new WeakSet,Mk=function(t,e){const{width:i,height:s}=n(this,ak);let r=i,a=s,o=n(this,ak);for(;r>2*t||a>2*e;){const i=r,n=a;r>2*t&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2)),a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));const s=new OffscreenCanvas(r,a);s.getContext("2d").drawImage(o,0,0,i,n,0,0,r,a),o=s.transferToImageBitmap()}return o},Pk=new WeakSet,Rk=function(t,e){t=Math.ceil(t),e=Math.ceil(e);const i=n(this,uk);if(!i||i.width===t&&i.height===e)return;i.width=t,i.height=e;const s=n(this,gk)?n(this,ak):o(this,Ck,Mk).call(this,t,e);if(this._uiManager.hasMLManager&&!this.hasAltText()){const i=new OffscreenCanvas(t,e).getContext("2d");i.drawImage(s,0,0,s.width,s.height,0,0,t,e),this._uiManager.mlGuess({service:"image-to-text",request:{data:i.getImageData(0,0,t,e).data,width:t,height:e,channels:4}}).then((t=>{const e=(null==t?void 0:t.output)||"";this.parent&&e&&!this.hasAltText()&&(this.altTextData={altText:e,decorative:!1})}))}const r=i.getContext("2d");r.filter=this._uiManager.hcmFilter,r.drawImage(s,0,0,s.width,s.height,0,0,t,e)},Tk=new WeakSet,Lk=function(t){if(t){if(n(this,gk)){const t=this._uiManager.imageManager.getSvgUrl(n(this,ok));if(t)return t}const t=document.createElement("canvas");return({width:t.width,height:t.height}=n(this,ak)),t.getContext("2d").drawImage(n(this,ak),0,0),t.toDataURL()}if(n(this,gk)){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*Mc.PDF_TO_CSS_UNITS),s=Math.round(this.height*e*Mc.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(i,s);return r.getContext("2d").drawImage(n(this,ak),0,0,n(this,ak).width,n(this,ak).height,0,0,i,s),r.transferToImageBitmap()}return structuredClone(n(this,ak))},Ik=new WeakSet,Dk=function(){this._uiManager._signal&&(r(this,pk,new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&o(this,kk,Ek).call(this,e.width,e.height)}))),n(this,pk).observe(this.div),this._uiManager._signal.addEventListener("abort",(()=>{var t;null==(t=n(this,pk))||t.disconnect(),r(this,pk,null)}),{once:!0}))},e(Nk,"_type","stamp"),e(Nk,"_editorType",Jl.STAMP);const oE=class{constructor({uiManager:t,pageIndex:e,div:i,accessibilityManager:a,annotationLayer:o,drawLayer:l,textLayer:h,viewport:c,l10n:d}){s(this,Jk),s(this,Zk),s(this,eE),s(this,nE),s(this,rE),s(this,Ok,void 0),s(this,Wk,!1),s(this,jk,null),s(this,Bk,null),s(this,Hk,null),s(this,zk,null),s(this,$k,null),s(this,Uk,new Map),s(this,Vk,!1),s(this,Gk,!1),s(this,qk,!1),s(this,Xk,null),s(this,Yk,void 0);const u=[...n(oE,Kk).values()];if(!oE._initialized){oE._initialized=!0;for(const e of u)e.initialize(d,t)}t.registerEditorTypes(u),r(this,Yk,t),this.pageIndex=e,this.div=i,r(this,Ok,a),r(this,jk,o),this.viewport=c,r(this,Xk,h),this.drawLayer=l,n(this,Yk).addLayer(this)}get isEmpty(){return 0===n(this,Uk).size}get isInvisible(){return this.isEmpty&&n(this,Yk).getMode()===Jl.NONE}updateToolbar(t){n(this,Yk).updateToolbar(t)}updateMode(t=n(this,Yk).getMode()){switch(o(this,rE,aE).call(this),t){case Jl.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case Jl.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case Jl.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;for(const i of n(oE,Kk).values())e.toggle(`${i._type}Editing`,t===i._editorType);this.div.hidden=!1}hasTextLayer(t){var e;return t===(null==(e=n(this,Xk))?void 0:e.div)}addInkEditorIfNeeded(t){if(n(this,Yk).getMode()===Jl.INK){if(!t)for(const t of n(this,Uk).values())if(t.isEmpty())return void t.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(t){n(this,Yk).setEditingState(t)}addCommands(t){n(this,Yk).addCommands(t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){var e;null==(e=n(this,jk))||e.div.classList.toggle("disabled",!t)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const e of n(this,Uk).values())e.enableEditing(),e.show(!0),e.annotationElementId&&(n(this,Yk).removeChangedExistingAnnotation(e),t.add(e.annotationElementId));if(!n(this,jk))return;const e=n(this,jk).getEditableAnnotations();for(const i of e){if(i.hide(),n(this,Yk).isDeletedAnnotationElement(i.data.id)||t.has(i.data.id))continue;const e=this.deserialize(i);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){var t;r(this,qk,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,i=new Map;for(const s of n(this,Uk).values())if(s.disableEditing(),s.annotationElementId){if(null!==s.serialize()){e.set(s.annotationElementId,s);continue}i.set(s.annotationElementId,s),null==(t=this.getEditableAnnotation(s.annotationElementId))||t.show(),s.remove()}if(n(this,jk)){const t=n(this,jk).getEditableAnnotations();for(const s of t){const{id:t}=s.data;if(n(this,Yk).isDeletedAnnotationElement(t))continue;let r=i.get(t);r?(r.resetAnnotationElement(s),r.show(!1),s.show()):(r=e.get(t),r&&(n(this,Yk).addChangedExistingAnnotation(r),r.renderAnnotationElement(s),r.show(!1)),s.show())}}o(this,rE,aE).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:s}=this.div;for(const t of n(oE,Kk).values())s.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),r(this,qk,!1)}getEditableAnnotation(t){var e;return(null==(e=n(this,jk))?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){n(this,Yk).getActive()!==t&&n(this,Yk).setActiveEditor(t)}enableTextSelection(){var t;this.div.tabIndex=-1,null!=(t=n(this,Xk))&&t.div&&!n(this,zk)&&(r(this,zk,o(this,Jk,Qk).bind(this)),n(this,Xk).div.addEventListener("pointerdown",n(this,zk),{signal:n(this,Yk)._signal}),n(this,Xk).div.classList.add("highlighting"))}disableTextSelection(){var t;this.div.tabIndex=0,null!=(t=n(this,Xk))&&t.div&&n(this,zk)&&(n(this,Xk).div.removeEventListener("pointerdown",n(this,zk)),r(this,zk,null),n(this,Xk).div.classList.remove("highlighting"))}enableClick(){if(n(this,Hk))return;const t=n(this,Yk)._signal;r(this,Hk,this.pointerdown.bind(this)),r(this,Bk,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",n(this,Hk),{signal:t}),this.div.addEventListener("pointerup",n(this,Bk),{signal:t})}disableClick(){n(this,Hk)&&(this.div.removeEventListener("pointerdown",n(this,Hk)),this.div.removeEventListener("pointerup",n(this,Bk)),r(this,Hk,null),r(this,Bk,null))}attach(t){n(this,Uk).set(t.id,t);const{annotationElementId:e}=t;e&&n(this,Yk).isDeletedAnnotationElement(e)&&n(this,Yk).removeDeletedAnnotationElement(t)}detach(t){var e;n(this,Uk).delete(t.id),null==(e=n(this,Ok))||e.removePointerInTextLayer(t.contentDiv),!n(this,qk)&&t.annotationElementId&&n(this,Yk).addDeletedAnnotationElement(t)}remove(t){this.detach(t),n(this,Yk).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,n(this,Gk)||this.addInkEditorIfNeeded(!1)}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(n(this,Yk).addDeletedAnnotationElement(t.annotationElementId),og.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),null==(e=t.parent)||e.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),n(this,Yk).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),n(this,Yk).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var e;if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!n(this,$k)&&(t._focusEventsAllowed=!1,r(this,$k,setTimeout((()=>{r(this,$k,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:n(this,Yk)._signal}),i.focus())}),0))),t._structTreeParentId=null==(e=n(this,Ok))?void 0:e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return n(this,Yk).getId()}get _signal(){return n(this,Yk)._signal}canCreateNewEmptyEditor(){var t;return null==(t=n(this,Zk,tE))?void 0:t.canCreateNewEmptyEditor()}pasteEditor(t,e){n(this,Yk).updateToolbar(t),n(this,Yk).updateMode(t);const{offsetX:i,offsetY:s}=o(this,nE,sE).call(this),r=this.getNextId(),a=o(this,eE,iE).call(this,{parent:this,id:r,x:i,y:s,uiManager:n(this,Yk),isCentered:!0,...e});a&&this.add(a)}deserialize(t){var e;return(null==(e=n(oE,Kk).get(t.annotationType??t.annotationEditorType))?void 0:e.deserialize(t,this,n(this,Yk)))||null}createAndAddNewEditor(t,e,i={}){const s=this.getNextId(),r=o(this,eE,iE).call(this,{parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:n(this,Yk),isCentered:e,...i});return r&&this.add(r),r}addNewEditor(){this.createAndAddNewEditor(o(this,nE,sE).call(this),!0)}setSelected(t){n(this,Yk).setSelected(t)}toggleSelected(t){n(this,Yk).toggleSelected(t)}isSelected(t){return n(this,Yk).isSelected(t)}unselect(t){n(this,Yk).unselect(t)}pointerup(t){const{isMac:e}=Zh.platform;if(!(0!==t.button||t.ctrlKey&&e)&&t.target===this.div&&n(this,Vk)){if(r(this,Vk,!1),!n(this,Wk))return void r(this,Wk,!0);if(n(this,Yk).getMode()===Jl.STAMP)return void n(this,Yk).unselectAll();this.createAndAddNewEditor(t,!1)}}pointerdown(t){if(n(this,Yk).getMode()===Jl.HIGHLIGHT&&this.enableTextSelection(),n(this,Vk))return void r(this,Vk,!1);const{isMac:e}=Zh.platform;if(0!==t.button||t.ctrlKey&&e||t.target!==this.div)return;r(this,Vk,!0);const i=n(this,Yk).getActive();r(this,Wk,!i||i.isEmpty())}findNewParent(t,e,i){const s=n(this,Yk).findParent(e,i);return null!==s&&s!==this&&(s.changeParent(t),!0)}destroy(){var t,e;(null==(t=n(this,Yk).getActive())?void 0:t.parent)===this&&(n(this,Yk).commitOrRemove(),n(this,Yk).setActiveEditor(null)),n(this,$k)&&(clearTimeout(n(this,$k)),r(this,$k,null));for(const t of n(this,Uk).values())null==(e=n(this,Ok))||e.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,n(this,Uk).clear(),n(this,Yk).removeLayer(this)}render({viewport:t}){this.viewport=t,xd(this.div,t);for(const t of n(this,Yk).getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:t}){n(this,Yk).commitOrRemove(),o(this,rE,aE).call(this);const e=this.viewport.rotation,i=t.rotation;if(this.viewport=t,xd(this.div,{rotation:i}),e!==i)for(const t of n(this,Uk).values())t.rotate(i);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return n(this,Yk).viewParameters.realScale}};let lE=oE;var hE,cE,dE,uE,pE,fE,gE,mE,vE,bE;Ok=new WeakMap,Wk=new WeakMap,jk=new WeakMap,Bk=new WeakMap,Hk=new WeakMap,zk=new WeakMap,$k=new WeakMap,Uk=new WeakMap,Vk=new WeakMap,Gk=new WeakMap,qk=new WeakMap,Xk=new WeakMap,Yk=new WeakMap,Kk=new WeakMap,Jk=new WeakSet,Qk=function(t){if(n(this,Yk).unselectAll(),t.target===n(this,Xk).div){const{isMac:e}=Zh.platform;if(0!==t.button||t.ctrlKey&&e)return;n(this,Yk).showAllEditors("highlight",!0,!0),n(this,Xk).div.classList.add("free"),Ux.startHighlighting(this,"ltr"===n(this,Yk).direction,t),n(this,Xk).div.addEventListener("pointerup",(()=>{n(this,Xk).div.classList.remove("free")}),{once:!0,signal:n(this,Yk)._signal}),t.preventDefault()}},Zk=new WeakSet,tE=function(){return n(oE,Kk).get(n(this,Yk).getMode())},eE=new WeakSet,iE=function(t){const e=n(this,Zk,tE);return e?new e.prototype.constructor(t):null},nE=new WeakSet,sE=function(){const{x:t,y:e,width:i,height:n}=this.div.getBoundingClientRect(),s=Math.max(0,t),r=Math.max(0,e),a=(s+Math.min(window.innerWidth,t+i))/2-t,o=(r+Math.min(window.innerHeight,e+n))/2-e,[l,h]=this.viewport.rotation%180==0?[a,o]:[o,a];return{offsetX:l,offsetY:h}},rE=new WeakSet,aE=function(){r(this,Gk,!0);for(const t of n(this,Uk).values())t.isEmpty()&&t.remove();r(this,Gk,!1)},e(lE,"_initialized",!1),s(lE,Kk,new Map([xA,rk,Nk,Ux].map((t=>[t._editorType,t]))));const yE=class{constructor({pageIndex:t}){s(this,gE),s(this,vE),s(this,hE,null),s(this,cE,0),s(this,dE,new Map),s(this,uE,new Map),this.pageIndex=t}setParent(t){if(n(this,hE)){if(n(this,hE)!==t){if(n(this,dE).size>0)for(const e of n(this,dE).values())e.remove(),t.append(e);r(this,hE,t)}}else r(this,hE,t)}static get _svgFactory(){return Hh(this,"_svgFactory",new ad)}highlight(t,e,i,s=!1){const r=a(this,cE)._++,l=o(this,gE,mE).call(this,t.box);l.classList.add("highlight"),t.free&&l.classList.add("free");const h=yE._svgFactory.createElement("defs");l.append(h);const c=yE._svgFactory.createElement("path");h.append(c);const d=`path_p${this.pageIndex}_${r}`;c.setAttribute("id",d),c.setAttribute("d",t.toSVGPath()),s&&n(this,uE).set(r,c);const u=o(this,vE,bE).call(this,h,d),p=yE._svgFactory.createElement("use");return l.append(p),l.setAttribute("fill",e),l.setAttribute("fill-opacity",i),p.setAttribute("href",`#${d}`),n(this,dE).set(r,l),{id:r,clipPathId:`url(#${u})`}}highlightOutline(t){const e=a(this,cE)._++,i=o(this,gE,mE).call(this,t.box);i.classList.add("highlightOutline");const s=yE._svgFactory.createElement("defs");i.append(s);const r=yE._svgFactory.createElement("path");s.append(r);const l=`path_p${this.pageIndex}_${e}`;let h;if(r.setAttribute("id",l),r.setAttribute("d",t.toSVGPath()),r.setAttribute("vector-effect","non-scaling-stroke"),t.free){i.classList.add("free");const t=yE._svgFactory.createElement("mask");s.append(t),h=`mask_p${this.pageIndex}_${e}`,t.setAttribute("id",h),t.setAttribute("maskUnits","objectBoundingBox");const n=yE._svgFactory.createElement("rect");t.append(n),n.setAttribute("width","1"),n.setAttribute("height","1"),n.setAttribute("fill","white");const r=yE._svgFactory.createElement("use");t.append(r),r.setAttribute("href",`#${l}`),r.setAttribute("stroke","none"),r.setAttribute("fill","black"),r.setAttribute("fill-rule","nonzero"),r.classList.add("mask")}const c=yE._svgFactory.createElement("use");i.append(c),c.setAttribute("href",`#${l}`),h&&c.setAttribute("mask",`url(#${h})`);const d=c.cloneNode();return i.append(d),c.classList.add("mainOutline"),d.classList.add("secondaryOutline"),n(this,dE).set(e,i),e}finalizeLine(t,e){const i=n(this,uE).get(t);n(this,uE).delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}updateLine(t,e){n(this,dE).get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}removeFreeHighlight(t){this.remove(t),n(this,uE).delete(t)}updatePath(t,e){n(this,uE).get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){var i;o(i=yE,pE,fE).call(i,n(this,dE).get(t),e)}show(t,e){n(this,dE).get(t).classList.toggle("hidden",!e)}rotate(t,e){n(this,dE).get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){n(this,dE).get(t).setAttribute("fill",e)}changeOpacity(t,e){n(this,dE).get(t).setAttribute("fill-opacity",e)}addClass(t,e){n(this,dE).get(t).classList.add(e)}removeClass(t,e){n(this,dE).get(t).classList.remove(e)}remove(t){null!==n(this,hE)&&(n(this,dE).get(t).remove(),n(this,dE).delete(t))}destroy(){r(this,hE,null);for(const t of n(this,dE).values())t.remove();n(this,dE).clear()}};let wE=yE;hE=new WeakMap,cE=new WeakMap,dE=new WeakMap,uE=new WeakMap,pE=new WeakSet,fE=function(t,{x:e=0,y:i=0,width:n=1,height:s=1}={}){const{style:r}=t;r.top=100*i+"%",r.left=100*e+"%",r.width=100*n+"%",r.height=100*s+"%"},gE=new WeakSet,mE=function(t){var e;const i=yE._svgFactory.create(1,1,!0);return n(this,hE).append(i),i.setAttribute("aria-hidden",!0),o(e=yE,pE,fE).call(e,i,t),i},vE=new WeakSet,bE=function(t,e){const i=yE._svgFactory.createElement("clipPath");t.append(i);const n=`clip_${e}`;i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=yE._svgFactory.createElement("use");return i.append(s),s.setAttribute("href",`#${e}`),s.classList.add("clip"),n},s(wE,pE);var AE=Wl.AbortException,_E=Wl.AnnotationEditorLayer,xE=Wl.AnnotationEditorParamsType,SE=Wl.AnnotationEditorType,kE=Wl.AnnotationEditorUIManager,EE=Wl.AnnotationLayer,CE=Wl.AnnotationMode,ME=Wl.CMapCompressionType,PE=Wl.ColorPicker,RE=Wl.DOMSVGFactory,TE=Wl.DrawLayer,LE=Wl.FeatureTest,IE=Wl.GlobalWorkerOptions,DE=Wl.ImageKind,FE=Wl.InvalidPDFException,NE=Wl.MissingPDFException,OE=Wl.OPS,WE=Wl.Outliner,jE=Wl.PDFDataRangeTransport,BE=Wl.PDFDateString,HE=Wl.PDFWorker,zE=Wl.PasswordResponses,$E=Wl.PermissionFlag,UE=Wl.PixelsPerInch,VE=Wl.RenderingCancelledException,GE=Wl.TextLayer,qE=Wl.UnexpectedResponseException,XE=Wl.Util,YE=Wl.VerbosityLevel,KE=Wl.XfaLayer,JE=Wl.build,QE=Wl.createValidAbsoluteUrl,ZE=Wl.fetchData,tC=Wl.getDocument,eC=Wl.getFilenameFromUrl,iC=Wl.getPdfFilenameFromUrl,nC=Wl.getXfaPageViewport,sC=Wl.isDataScheme,rC=Wl.isPdfFile,aC=Wl.noContextMenu,oC=Wl.normalizeUnicode,lC=Wl.renderTextLayer,hC=Wl.setLayerDimensions,cC=Wl.shadow,dC=Wl.updateTextLayer,uC=Wl.version;const pC=Object.freeze(Object.defineProperty({__proto__:null,AbortException:AE,AnnotationEditorLayer:_E,AnnotationEditorParamsType:xE,AnnotationEditorType:SE,AnnotationEditorUIManager:kE,AnnotationLayer:EE,AnnotationMode:CE,CMapCompressionType:ME,ColorPicker:PE,DOMSVGFactory:RE,DrawLayer:TE,FeatureTest:LE,GlobalWorkerOptions:IE,ImageKind:DE,InvalidPDFException:FE,MissingPDFException:NE,OPS:OE,Outliner:WE,PDFDataRangeTransport:jE,PDFDateString:BE,PDFWorker:HE,PasswordResponses:zE,PermissionFlag:$E,PixelsPerInch:UE,RenderingCancelledException:VE,TextLayer:GE,UnexpectedResponseException:qE,Util:XE,VerbosityLevel:YE,XfaLayer:KE,build:JE,createValidAbsoluteUrl:QE,fetchData:ZE,getDocument:tC,getFilenameFromUrl:eC,getPdfFilenameFromUrl:iC,getXfaPageViewport:nC,isDataScheme:sC,isPdfFile:rC,noContextMenu:aC,normalizeUnicode:oC,renderTextLayer:lC,setLayerDimensions:hC,shadow:cC,updateTextLayer:dC,version:uC},Symbol.toStringTag,{value:"Module"}));var fC=globalThis&&globalThis.__spreadArray||function(t,e,i){if(i||2===arguments.length)for(var n,s=0,r=e.length;s<r;s++)(n||!(s in e))&&(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))},gC=fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC(fC([],["onCopy","onCut","onPaste"],!0),["onCompositionEnd","onCompositionStart","onCompositionUpdate"],!0),["onFocus","onBlur"],!0),["onInput","onInvalid","onReset","onSubmit"],!0),["onLoad","onError"],!0),["onKeyDown","onKeyPress","onKeyUp"],!0),["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],!0),["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],!0),["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],!0),["onSelect"],!0),["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],!0),["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],!0),["onScroll"],!0),["onWheel"],!0),["onAnimationStart","onAnimationEnd","onAnimationIteration"],!0),["onTransitionEnd"],!0),["onChange"],!0),["onToggle"],!0);function mC(t,e){var i={};return gC.forEach((function(n){var s=t[n];s&&(i[n]=e?function(t){return s(t,e(n))}:s)})),i}function vC(t){var e=!1;return{promise:new Promise((function(i,n){t.then((function(t){return!e&&i(t)})).catch((function(t){return!e&&n(t)}))})),cancel:function(){e=!0}}}function bC(t){var e,i,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(i=bC(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}function yC(){for(var t,e,i=0,n="",s=arguments.length;i<s;i++)(t=arguments[i])&&(e=bC(t))&&(n&&(n+=" "),n+=e);return n}var wC="production"===process.env.NODE_ENV,AC="Invariant failed";function _C(t,e){if(!t){if(wC)throw new Error(AC);var i="function"==typeof e?e():e,n=i?"".concat(AC,": ").concat(i):AC;throw new Error(n)}}var xC=function(){};if("production"!==process.env.NODE_ENV){var SC=function(t,e){var i=arguments.length;e=new Array(i>1?i-1:0);for(var n=1;n<i;n++)e[n-1]=arguments[n];var s=0,r="Warning: "+t.replace(/%s/g,(function(){return e[s++]}));typeof console<"u"&&console.error(r);try{throw new Error(r)}catch{}};xC=function(t,e,i){var n=arguments.length;i=new Array(n>2?n-2:0);for(var s=2;s<n;s++)i[s-2]=arguments[s];if(void 0===e)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");t||SC.apply(null,[e].concat(i))}}const kC=S(xC);var EC=Object.prototype.hasOwnProperty;function CC(t,e,i){for(i of t.keys())if(MC(i,e))return i}function MC(t,e){var i,n,s;if(t===e)return!0;if(t&&e&&(i=t.constructor)===e.constructor){if(i===Date)return t.getTime()===e.getTime();if(i===RegExp)return t.toString()===e.toString();if(i===Array){if((n=t.length)===e.length)for(;n--&&MC(t[n],e[n]););return-1===n}if(i===Set){if(t.size!==e.size)return!1;for(n of t)if((s=n)&&"object"==typeof s&&!(s=CC(e,s))||!e.has(s))return!1;return!0}if(i===Map){if(t.size!==e.size)return!1;for(n of t)if((s=n[0])&&"object"==typeof s&&!(s=CC(e,s))||!MC(n[1],e.get(s)))return!1;return!0}if(i===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(i===DataView){if((n=t.byteLength)===e.byteLength)for(;n--&&t.getInt8(n)===e.getInt8(n););return-1===n}if(ArrayBuffer.isView(t)){if((n=t.byteLength)===e.byteLength)for(;n--&&t[n]===e[n];);return-1===n}if(!i||"object"==typeof t){for(i in n=0,t)if(EC.call(t,i)&&++n&&!EC.call(e,i)||!(i in e)||!MC(t[i],e[i]))return!1;return Object.keys(e).length===n}}return t!=t&&e!=e}const PC=f(null);function RC({children:t,type:e}){return R.jsx("div",{className:`react-pdf__message react-pdf__message--${e}`,children:t})}class TC{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(t){this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setExternalLinkRel(t){this.externalLinkRel=t}setExternalLinkTarget(t){this.externalLinkTarget=t}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return _C(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(t){_C(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise((e=>{_C(this.pdfDocument,"PDF document not loaded."),_C(t,"Destination is not specified."),"string"==typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)})).then((t=>{_C(Array.isArray(t),`"${t}" is not a valid destination array.`);const e=t[0];new Promise((t=>{_C(this.pdfDocument,"PDF document not loaded."),e instanceof Object?this.pdfDocument.getPageIndex(e).then((e=>{t(e)})).catch((()=>{_C(!1,`"${e}" is not a valid page reference.`)})):"number"==typeof e?t(e):_C(!1,`"${e}" is not a valid destination reference.`)})).then((e=>{const i=e+1;_C(this.pdfViewer,"PDF viewer is not initialized."),_C(i>=1&&i<=this.pagesCount,`"${i}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:i})}))}))}navigateTo(t){this.goToDestination(t)}goToPage(t){const e=t-1;_C(this.pdfViewer,"PDF viewer is not initialized."),_C(t>=1&&t<=this.pagesCount,`"${t}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}addLinkAttributes(t,e,i){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=i?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const LC={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},IC=typeof document<"u",DC=IC&&"file:"===window.location.protocol;function FC(t){return function(t){return typeof t<"u"}(t)&&null!==t}function NC(t){return function(t){return"string"==typeof t}(t)&&/^data:/.test(t)}function OC(t){_C(NC(t),"Invalid data URI.");const[e="",i=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(i):unescape(i)}function WC(){return IC&&window.devicePixelRatio||1}const jC="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function BC(){kC(!DC,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${jC}`)}function HC(t){null!=t&&t.cancel&&t.cancel()}function zC(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}function $C(t){return new Promise(((e,i)=>{const n=new FileReader;n.onload=()=>{if(!n.result)return i(new Error("Error while reading a file."));e(n.result)},n.onerror=t=>{if(!t.target)return i(new Error("Error while reading a file."));const{error:e}=t.target;if(!e)return i(new Error("Error while reading a file."));switch(e.code){case e.NOT_FOUND_ERR:return i(new Error("Error while reading a file: File not found."));case e.SECURITY_ERR:return i(new Error("Error while reading a file: Security error."));case e.ABORT_ERR:return i(new Error("Error while reading a file: Aborted."));default:return i(new Error("Error while reading a file."))}},n.readAsArrayBuffer(t)}))}function UC(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function VC(){return m(UC,{value:void 0,error:void 0})}var GC=globalThis&&globalThis.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function o(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){t.done?s(t.value):function(t){return t instanceof i?t:new i((function(e){e(t)}))}(t.value).then(a,o)}l((n=n.apply(t,e||[])).next())}))},qC=globalThis&&globalThis.__rest||function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const{PDFDataRangeTransport:XC}=pC,YC=(t,e)=>{switch(e){case LC.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case LC.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function KC(t){return"object"==typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const JC=g((function(t,e){var{children:i,className:n,error:s="Failed to load PDF file.",externalLinkRel:r,externalLinkTarget:a,file:o,inputRef:l,imageResourcesPath:d,loading:u="Loading PDF…",noData:p="No PDF file specified.",onItemClick:f,onLoadError:g,onLoadProgress:m,onLoadSuccess:w,onPassword:A=YC,onSourceError:_,onSourceSuccess:x,options:S,renderMode:k,rotate:E}=t,C=qC(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[M,P]=VC(),{value:T,error:L}=M,[I,D]=VC(),{value:F,error:N}=I,O=c(new TC),W=c([]),j=c(void 0),B=c(void 0);o&&o!==j.current&&KC(o)&&(kC(!MC(o,j.current),'File prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.'),j.current=o),S&&S!==B.current&&(kC(!MC(S,B.current),'Options prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.'),B.current=S);const H=c({scrollPageIntoView:t=>{const{dest:e,pageNumber:i,pageIndex:n=i-1}=t;if(f)return void f({dest:e,pageIndex:n,pageNumber:i});const s=W.current[n];s?s.scrollIntoView():kC(!1,`An internal link leading to page ${i} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});b(e,(()=>({linkService:O,pages:W,viewer:H})),[]),v((function(){P({type:"RESET"})}),[o,P]);const z=y((()=>GC(this,void 0,void 0,(function*(){if(!o)return null;if("string"==typeof o)return NC(o)?{data:OC(o)}:(BC(),{url:o});if(o instanceof XC)return{range:o};if(o instanceof ArrayBuffer)return{data:o};if(IC&&function(t){return _C(IC,"isBlob can only be used in a browser environment"),t instanceof Blob}(o))return{data:yield $C(o)};if(_C("object"==typeof o,"Invalid parameter in file, need either Uint8Array, string or a parameter object"),_C(KC(o),"Invalid parameter object: need either .data, .range or .url"),"url"in o&&"string"==typeof o.url){if(NC(o.url)){const{url:t}=o,e=qC(o,["url"]),i=OC(t);return Object.assign({data:i},e)}BC()}return o}))),[o]);v((()=>{const t=vC(z());return t.promise.then((t=>{P({type:"RESOLVE",value:t})})).catch((t=>{P({type:"REJECT",error:t})})),()=>{HC(t)}}),[z,P]),v((()=>{if(!(typeof T>"u")){if(!1===T)return void(L&&(kC(!1,L.toString()),_&&_(L)));x&&x()}}),[T]),v((function(){D({type:"RESET"})}),[D,T]),v((function(){if(!T)return;const t=Object.assign(Object.assign({},T),S),e=tC(t);m&&(e.onProgress=m),A&&(e.onPassword=A);const i=e;return i.promise.then((t=>{D({type:"RESOLVE",value:t})})).catch((t=>{i.destroyed||D({type:"REJECT",error:t})})),()=>{i.destroy()}}),[S,D,T]),v((()=>{if(!(typeof F>"u")){if(!1===F)return void(N&&(kC(!1,N.toString()),g&&g(N)));F&&(w&&w(F),W.current=new Array(F.numPages),O.current.setDocument(F))}}),[F]),v((function(){O.current.setViewer(H.current),O.current.setExternalLinkRel(r),O.current.setExternalLinkTarget(a)}),[r,a]);const $=y(((t,e)=>{W.current[t]=e}),[]),U=y((t=>{delete W.current[t]}),[]),V=h((()=>({imageResourcesPath:d,linkService:O.current,onItemClick:f,pdf:F,registerPage:$,renderMode:k,rotate:E,unregisterPage:U})),[d,f,F,$,k,E,U]),G=h((()=>mC(C,(()=>F))),[C,F]);return R.jsx("div",Object.assign({className:yC("react-pdf__Document",n),ref:l,style:{"--scale-factor":"1"}},G,{children:o?null==F?R.jsx(RC,{type:"loading",children:"function"==typeof u?u():u}):!1===F?R.jsx(RC,{type:"error",children:"function"==typeof s?s():s}):R.jsx(PC.Provider,{value:V,children:i}):R.jsx(RC,{type:"no-data",children:"function"==typeof p?p():p})}))}));function QC(){return p(PC)}function ZC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=t.filter(Boolean);return i.length<=1?i[0]||null:function(t){i.forEach((function(e){"function"==typeof e?e(t):e&&(e.current=t)}))}}const tM=f(null),eM={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},iM=/^H(\d+)$/;function nM(t){return"children"in t}function sM(t){return!!nM(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function rM(t){const e={};if(nM(t)){const{role:i}=t,n=i.match(iM);if(n)e.role="heading",e["aria-level"]=Number(n[1]);else if(function(t){return t in eM}(i)){const t=eM[i];t&&(e.role=t)}}return e}function aM(t){const e={};if(nM(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),sM(t)){const[i]=t.children;if(i){const t=aM(i);return Object.assign(Object.assign({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function oM(t){return t?Object.assign(Object.assign({},rM(t)),aM(t)):null}function lM({className:t,node:e}){const i=h((()=>oM(e)),[e]),n=h((()=>!nM(e)||sM(e)?null:e.children.map(((t,e)=>R.jsx(lM,{node:t},e)))),[e]);return R.jsx("span",Object.assign({className:t},i,{children:n}))}function hM(){return p(tM)}function cM(){const t=hM();_C(t,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[n,s]=VC(),{value:r,error:a}=n,{customTextRenderer:o,page:l}=t;return v((function(){s({type:"RESET"})}),[s,l]),v((function(){if(o||!l)return;const t=vC(l.getStructTree()),e=t;return t.promise.then((t=>{s({type:"RESOLVE",value:t})})).catch((t=>{s({type:"REJECT",error:t})})),()=>HC(e)}),[o,l,s]),v((()=>{if(void 0!==r){if(!1===r)return void(a&&(kC(!1,a.toString()),e&&e(a)));r&&i&&i(r)}}),[r]),r?R.jsx(lM,{className:"react-pdf__Page__structTree structTree",node:r}):null}const dM=CE;function uM(t){const e=hM();_C(e,"Unable to find Page context.");const i=Object.assign(Object.assign({},e),t),{_className:n,canvasBackground:s,devicePixelRatio:r=WC(),onRenderError:a,onRenderSuccess:o,page:l,renderForms:d,renderTextLayer:u,rotate:p,scale:f}=i,{canvasRef:g}=t;_C(l,"Attempted to render page canvas, but no page was specified.");const m=c(null);function b(t){(function(t){return"RenderingCancelledException"===t.name})(t)||(kC(!1,t.toString()),a&&a(t))}const w=h((()=>l.getViewport({scale:f*r,rotation:p})),[r,l,p,f]),A=h((()=>l.getViewport({scale:f,rotation:p})),[l,p,f]);v((function(){if(!l)return;l.cleanup();const{current:t}=m;if(!t)return;t.width=w.width,t.height=w.height,t.style.width=`${Math.floor(A.width)}px`,t.style.height=`${Math.floor(A.height)}px`,t.style.visibility="hidden";const e={annotationMode:d?dM.ENABLE_FORMS:dM.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:w};s&&(e.background=s);const i=l.render(e),n=i;return i.promise.then((()=>{t.style.visibility="",l&&o&&o(zC(l,f))})).catch(b),()=>HC(n)}),[s,l,d,w,A]);const _=y((()=>{const{current:t}=m;t&&(t.width=0,t.height=0)}),[]);return v((()=>_),[_]),R.jsx("canvas",{className:`${n}__canvas`,dir:"ltr",ref:ZC(g,m),style:{display:"block",userSelect:"none"},children:u?R.jsx(cM,{}):null})}function pM(){const t=hM();_C(t,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:n,onRenderTextLayerError:s,onRenderTextLayerSuccess:r,page:a,pageIndex:o,pageNumber:l,rotate:d,scale:u}=t;_C(a,"Attempted to load page text content, but no page was specified.");const[p,f]=VC(),{value:g,error:m}=p,b=c(null),w=c(void 0);kC(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10),"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer"),v((function(){f({type:"RESET"})}),[a,f]),v((function(){if(!a)return;const t=vC(a.getTextContent()),e=t;return t.promise.then((t=>{f({type:"RESOLVE",value:t})})).catch((t=>{f({type:"REJECT",error:t})})),()=>HC(e)}),[a,f]),v((()=>{if(void 0!==g){if(!1===g)return void(m&&(kC(!1,m.toString()),i&&i(m)));g&&n&&n(g)}}),[g]);const _=y((()=>{r&&r()}),[r]),x=y((t=>{kC(!1,t.toString()),s&&s(t)}),[s]);const S=h((()=>a.getViewport({scale:u,rotation:d})),[a,d,u]);return A((function(){if(!a||!g)return;const{current:t}=b;if(!t)return;t.innerHTML="";const i=a.streamTextContent({includeMarkedContent:!0}),n=new GE({container:t,textContentSource:i,viewport:S}),s=n;return n.render().then((()=>{const i=document.createElement("div");i.className="endOfContent",t.append(i),w.current=i;const n=t.querySelectorAll('[role="presentation"]');if(e){let t=0;g.items.forEach(((i,s)=>{if(!function(t){return"str"in t}(i))return;const r=n[t];if(!r)return;const a=e(Object.assign({pageIndex:o,pageNumber:l,itemIndex:s},i));r.innerHTML=a,t+=i.str&&i.hasEOL?2:1}))}_()})).catch(x),()=>HC(s)}),[e,x,_,a,o,l,g,S]),R.jsx("div",{className:yC("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=w.current;t&&t.classList.remove("active")},onMouseDown:function(){const t=w.current;t&&t.classList.add("active")},ref:b})}function fM(){const t=QC(),e=hM();_C(e,"Unable to find Page context.");const i=Object.assign(Object.assign({},t),e),{imageResourcesPath:n,linkService:s,onGetAnnotationsError:r,onGetAnnotationsSuccess:a,onRenderAnnotationLayerError:o,onRenderAnnotationLayerSuccess:l,page:d,pdf:u,renderForms:p,rotate:f,scale:g=1}=i;_C(u,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),_C(d,"Attempted to load page annotations, but no page was specified."),_C(s,"Attempted to load page annotations, but no linkService was specified.");const[m,b]=VC(),{value:y,error:w}=m,A=c(null);kC(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10),"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations"),v((function(){b({type:"RESET"})}),[b,d]),v((function(){if(!d)return;const t=vC(d.getAnnotations()),e=t;return t.promise.then((t=>{b({type:"RESOLVE",value:t})})).catch((t=>{b({type:"REJECT",error:t})})),()=>{HC(e)}}),[b,d]),v((()=>{if(void 0!==y){if(!1===y)return void(w&&(kC(!1,w.toString()),r&&r(w)));y&&a&&a(y)}}),[y]);const _=h((()=>d.getViewport({scale:g,rotation:f})),[d,f,g]);return v((function(){if(!(u&&d&&s&&y))return;const{current:t}=A;if(!t)return;const e=_.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:t,l10n:null,page:d,viewport:e},r={annotations:y,annotationStorage:u.annotationStorage,div:t,imageResourcesPath:n,linkService:s,page:d,renderForms:p,viewport:e};t.innerHTML="";try{new EE(i).render(r),l&&l()}catch(t){kC(!1,`${a=t}`),o&&o(a)}var a;return()=>{}}),[y,n,s,d,u,p,_]),R.jsx("div",{className:yC("react-pdf__Page__annotations","annotationLayer"),ref:A})}var gM=globalThis&&globalThis.__rest||function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const mM=1;function vM(t){const e=QC(),i=Object.assign(Object.assign({},e),t),{_className:n="react-pdf__Page",_enableRegisterUnregisterPage:s=!0,canvasBackground:r,canvasRef:a,children:o,className:l,customRenderer:d,customTextRenderer:u,devicePixelRatio:p,error:f="Failed to load the page.",height:g,inputRef:m,loading:b="Loading page…",noData:y="No page specified.",onGetAnnotationsError:w,onGetAnnotationsSuccess:A,onGetStructTreeError:_,onGetStructTreeSuccess:x,onGetTextError:S,onGetTextSuccess:k,onLoadError:E,onLoadSuccess:C,onRenderAnnotationLayerError:M,onRenderAnnotationLayerSuccess:P,onRenderError:T,onRenderSuccess:L,onRenderTextLayerError:I,onRenderTextLayerSuccess:D,pageIndex:F,pageNumber:N,pdf:O,registerPage:W,renderAnnotationLayer:j=!0,renderForms:B=!1,renderMode:H="canvas",renderTextLayer:z=!0,rotate:$,scale:U=mM,unregisterPage:V,width:G}=i,q=gM(i,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[X,Y]=VC(),{value:K,error:J}=X,Q=c(null);_C(O,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const Z=FC(N)?N-1:F??null,tt=N??(FC(F)?F+1:null),et=$??(K?K.rotate:null),it=h((()=>{if(!K)return null;let t=1;const e=U??mM;if(G||g){const e=K.getViewport({scale:1,rotation:et});G?t=G/e.width:g&&(t=g/e.height)}return e*t}),[g,K,et,U,G]);v((function(){return()=>{FC(Z)&&s&&V&&V(Z)}}),[s,O,Z,V]),v((function(){Y({type:"RESET"})}),[Y,O,Z]),v((function(){if(!O||!tt)return;const t=vC(O.getPage(tt)),e=t;return t.promise.then((t=>{Y({type:"RESOLVE",value:t})})).catch((t=>{Y({type:"REJECT",error:t})})),()=>HC(e)}),[Y,O,tt]),v((()=>{if(void 0!==K){if(!1===K)return void(J&&(kC(!1,J.toString()),E&&E(J)));!function(){if(C){if(!K||!it)return;C(zC(K,it))}if(s&&W){if(!FC(Z)||!Q.current)return;W(Z,Q.current)}}()}}),[K,it]);const nt=h((()=>K&&FC(Z)&&tt&&FC(et)&&FC(it)?{_className:n,canvasBackground:r,customTextRenderer:u,devicePixelRatio:p,onGetAnnotationsError:w,onGetAnnotationsSuccess:A,onGetStructTreeError:_,onGetStructTreeSuccess:x,onGetTextError:S,onGetTextSuccess:k,onRenderAnnotationLayerError:M,onRenderAnnotationLayerSuccess:P,onRenderError:T,onRenderSuccess:L,onRenderTextLayerError:I,onRenderTextLayerSuccess:D,page:K,pageIndex:Z,pageNumber:tt,renderForms:B,renderTextLayer:z,rotate:et,scale:it}:null),[n,r,u,p,w,A,_,x,S,k,M,P,T,L,I,D,K,Z,tt,B,z,et,it]),st=h((()=>mC(q,(()=>K&&(it?zC(K,it):void 0)))),[q,K,it]),rt=`${Z}@${it}/${et}`;function at(){switch(H){case"custom":return _C(d,'renderMode was set to "custom", but no customRenderer was passed.'),R.jsx(d,{},`${rt}_custom`);case"none":return null;default:return R.jsx(uM,{canvasRef:a},`${rt}_canvas`)}}return R.jsx("div",Object.assign({className:yC(n,l),"data-page-number":tt,ref:ZC(m,Q),style:{"--scale-factor":`${it}`,backgroundColor:r||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},st,{children:tt?null===O||null==K?R.jsx(RC,{type:"loading",children:"function"==typeof b?b():b}):!1===O||!1===K?R.jsx(RC,{type:"error",children:"function"==typeof f?f():f}):R.jsxs(tM.Provider,{value:nt,children:[at(),z?R.jsx(pM,{},`${rt}_text`):null,j?R.jsx(fM,{},`${rt}_annotations`):null,o]}):R.jsx(RC,{type:"no-data",children:"function"==typeof y?y():y})}))}kC(!DC,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${jC}`),IE.workerSrc="pdf.worker.mjs";const bM="SET_ZOOM_LEVEL",yM=t=>({type:bM,value:t}),wM="SET_PDF_PAGINATED",AM="SET_NUM_PAGES",_M=t=>({type:AM,value:t}),xM="SET_CURRENT_PAGE",SM=t=>({type:xM,value:t}),kM={defaultZoomLevel:1,zoomLevel:1,zoomJump:.1,paginated:!0,numPages:0,currentPage:1},EM=(t=kM,e)=>{switch(e.type){case bM:{const{value:i}=e;return{...t,zoomLevel:i}}case wM:{const{value:i}=e;return{...t,paginated:i}}case AM:{const{value:i}=e;return{...t,numPages:i}}case xM:{const{value:i}=e;return{...t,currentPage:i}}default:return t}},CM=f({state:kM,dispatch:()=>null}),MM=({children:t,mainState:e})=>{var i,n,s,r,a,o,l;const[h,c]=m(EM,{...kM,defaultZoomLevel:(null==(n=null==(i=e.config)?void 0:i.pdfZoom)?void 0:n.defaultZoom)??kM.defaultZoomLevel,zoomLevel:(null==(r=null==(s=e.config)?void 0:s.pdfZoom)?void 0:r.defaultZoom)??kM.zoomLevel,zoomJump:(null==(o=null==(a=e.config)?void 0:a.pdfZoom)?void 0:o.zoomJump)??kM.zoomJump,paginated:(null==(l=e.config)||!l.pdfVerticalScrollByDefault)&&kM.paginated,mainState:e});return R.jsx(CM.Provider,{value:{state:h,dispatch:c},children:t})},PM=({pageNum:t})=>{const{state:{mainState:e,paginated:i,zoomLevel:n,numPages:s,currentPage:r}}=p(CM),{t:a}=tl(),o=(null==e?void 0:e.rendererRect)||null,l=t??r;return R.jsxs(RM,{id:"pdf-page-wrapper",$lastPage:l>=s,children:[!i&&R.jsx(TM,{id:"pdf-page-info",children:a("pdfPluginPageNumber",{currentPage:l,allPagesCount:s})}),R.jsx(vM,{pageNumber:l||r,scale:n,height:((null==o?void 0:o.height)??100)-100,width:((null==o?void 0:o.width)??100)-100,loading:a("pdfPluginLoading")})]})},RM=so.div`
|
|
173
173
|
margin: ${t=>t.$lastPage?"20px 0":void 0};
|
|
174
174
|
`,TM=so.div`
|
|
175
175
|
padding: 0 0 10px 10px;
|
|
@@ -180,14 +180,14 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
180
180
|
@media (max-width: 768px) {
|
|
181
181
|
font-size: 10px;
|
|
182
182
|
}
|
|
183
|
-
`,LM=()=>{const{state:{numPages:t}}=p(CM),e=[];for(let i=0;i<t;i++)e.push(
|
|
183
|
+
`,LM=()=>{const{state:{numPages:t}}=p(CM),e=[];for(let i=0;i<t;i++)e.push(R.jsx(PM,{pageNum:i+1},i+1));return R.jsx(R.Fragment,{children:e})},IM=()=>{const{state:{mainState:t,paginated:e},dispatch:i}=p(CM),{t:n}=tl(),s=(null==t?void 0:t.currentDocument)||null;return v((()=>{i(_M(kM.numPages))}),[s]),s&&void 0!==s.fileData?R.jsx(DM,{file:s.fileData,onLoadSuccess:({numPages:t})=>i(_M(t)),loading:R.jsx("span",{children:n("pdfPluginLoading")}),children:e?R.jsx(PM,{}):R.jsx(LM,{})}):null},DM=so(JC)`
|
|
184
184
|
display: flex;
|
|
185
185
|
flex-direction: column;
|
|
186
186
|
margin: 0 auto;
|
|
187
|
-
`,FM=t=>
|
|
187
|
+
`,FM=t=>R.jsx(OM,{...t,reverse:!0}),NM=t=>R.jsx(OM,{...t}),OM=t=>{const{color:e,size:i,reverse:n}=t;return R.jsx("svg",{width:i||"100%",height:i||"100%",style:{transform:""+(n?"rotate(180deg)":"")},viewBox:"0 0 12 12",version:"1.1",children:R.jsx("g",{id:"Icons",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:R.jsx("g",{id:"Rounded",transform:"translate(-548.000000, -1000.000000)",children:R.jsx("g",{id:"AV",transform:"translate(100.000000, 852.000000)",children:R.jsx("g",{id:"-Round-/-AV-/-skip_next",transform:"translate(442.000000, 142.000000)",children:R.jsxs("g",{children:[R.jsx("rect",{id:"Rectangle-Copy-52",x:"0",y:"0",width:"24",height:"24"}),R.jsx("path",{d:"M7.58,16.89 L13.35,12.82 C13.91,12.42 13.91,11.58 13.35,11.19 L7.58,7.11 C6.91,6.65 6,7.12 6,7.93 L6,16.07 C6,16.88 6.91,17.35 7.58,16.89 Z M16,7 L16,17 C16,17.55 16.45,18 17,18 C17.55,18 18,17.55 18,17 L18,7 C18,6.45 17.55,6 17,6 C16.45,6 16,6.45 16,7 Z",id:"icon_color",fill:e||"#aaa"})]})})})})})})},WM=t=>{const{color:e,size:i,reverse:n}=t;return R.jsxs("svg",{width:i||"100%",height:i||"100%",style:{transform:""+(n?"rotate(180deg)":"")},id:"Layer_1",viewBox:"0 0 24 24",children:[R.jsx("path",{d:"M20.57,9.43A8,8,0,0,0,5.26,10,5,5,0,1,0,5,20h5V18H5a3,3,0,0,1,0-6,3.1,3.1,0,0,1,.79.12l1.12.31.14-1.15a6,6,0,0,1,11.74-.82l.15.54.54.16A3.46,3.46,0,0,1,22,14.5,3.5,3.5,0,0,1,18.5,18H16v2h2.5A5.48,5.48,0,0,0,20.57,9.43Z",fill:e||"#aaa"}),R.jsx("polygon",{points:"12 11 12 15.59 10.71 14.29 9.29 15.71 13 19.41 16.71 15.71 15.29 14.29 14 15.59 14 11 12 11",fill:e||"#aaa"})]})},jM=t=>R.jsx(HM,{...t}),BM=t=>R.jsx(HM,{...t,reverse:!0}),HM=t=>{const{color:e,size:i,reverse:n}=t;return R.jsx("svg",{width:i||"100%",height:i||"100%",viewBox:"0 0 32 32",version:"1.1",children:R.jsx("g",{id:"Page-1",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:R.jsx("g",{id:"search-plus-icon",fill:e||"#aaa",children:R.jsx("path",{id:"search-plus",d:n?"M 13 13 L 16 13 L 19 13 L 19 16 L 16 16 L 13 16 L 10 16 L 10 13 Z M 19.4271 21.4271 C 18.0372 22.4175 16.3367 23 14.5 23 C 9.8056 23 6 19.1944 6 14.5 C 6 9.8056 9.8056 6 14.5 6 C 19.1944 6 23 9.8056 23 14.5 C 23 16.3367 22.4175 18.0372 21.4271 19.4271 L 27.0119 25.0119 C 27.5621 25.5621 27.5575 26.4425 27.0117 26.9883 L 26.9883 27.0117 C 26.4439 27.5561 25.5576 27.5576 25.0119 27.0119 L 19.4271 21.4271 L 19.4271 21.4271 L 19.4271 21.4271 Z M 14.5 21 C 18.0899 21 21 18.0899 21 14.5 C 21 10.9101 18.0899 8 14.5 8 C 10.9101 8 8 10.9101 8 14.5 C 8 18.0899 10.9101 21 14.5 21 L 14.5 21 Z":"M 13 13 L 13 10 L 16 10 L 16 13 L 19 13 L 19 16 L 16 16 L 16 19 L 13 19 L 13 16 L 10 16 L 10 13 Z M 19.4271 21.4271 C 18.0372 22.4175 16.3367 23 14.5 23 C 9.8056 23 6 19.1944 6 14.5 C 6 9.8056 9.8056 6 14.5 6 C 19.1944 6 23 9.8056 23 14.5 C 23 16.3367 22.4175 18.0372 21.4271 19.4271 L 27.0119 25.0119 C 27.5621 25.5621 27.5575 26.4425 27.0117 26.9883 L 26.9883 27.0117 C 26.4439 27.5561 25.5576 27.5576 25.0119 27.0119 L 19.4271 21.4271 L 19.4271 21.4271 L 19.4271 21.4271 Z M 14.5 21 C 18.0899 21 21 18.0899 21 14.5 C 21 10.9101 18.0899 8 14.5 8 C 10.9101 8 8 10.9101 8 14.5 C 8 18.0899 10.9101 21 14.5 21 L 14.5 21 Z"})})})})},zM=t=>{const{color:e,size:i}=t;return R.jsx("svg",{width:i||"100%",height:i||"100%",viewBox:"0 0 24 24",children:R.jsx("path",{fill:e||"#aaa",d:"M9.29,13.29,4,18.59V17a1,1,0,0,0-2,0v4a1,1,0,0,0,.08.38,1,1,0,0,0,.54.54A1,1,0,0,0,3,22H7a1,1,0,0,0,0-2H5.41l5.3-5.29a1,1,0,0,0-1.42-1.42ZM5.41,4H7A1,1,0,0,0,7,2H3a1,1,0,0,0-.38.08,1,1,0,0,0-.54.54A1,1,0,0,0,2,3V7A1,1,0,0,0,4,7V5.41l5.29,5.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42ZM21,16a1,1,0,0,0-1,1v1.59l-5.29-5.3a1,1,0,0,0-1.42,1.42L18.59,20H17a1,1,0,0,0,0,2h4a1,1,0,0,0,.38-.08,1,1,0,0,0,.54-.54A1,1,0,0,0,22,21V17A1,1,0,0,0,21,16Zm.92-13.38a1,1,0,0,0-.54-.54A1,1,0,0,0,21,2H17a1,1,0,0,0,0,2h1.59l-5.3,5.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L20,5.41V7a1,1,0,0,0,2,0V3A1,1,0,0,0,21.92,2.62Z"})})},$M=t=>{const{color:e,size:i,reverse:n}=t;return R.jsx("svg",{width:i||"100%",height:i||"100%",style:{transform:""+(n?"rotate(90deg)":"")},version:"1.1",id:"Scroll_1",viewBox:"0 0 297 297",xmlSpace:"preserve",children:R.jsx("path",{fill:e||"#aaa",d:"M206.004,200.723h-31.231V96.277h31.231c0.005,0,0.014,0,0.019,0c5.289,0,9.575-4.287,9.575-9.574\n c0-2.342-0.841-4.488-2.236-6.151L156.168,3.851C154.36,1.428,151.515,0,148.492,0c-3.023,0-5.868,1.428-7.675,3.851L83.302,80.98\n c-2.166,2.902-2.507,6.779-0.883,10.017c1.624,3.236,4.936,5.28,8.559,5.28h31.231v104.445H90.978c-3.623,0-6.934,2.044-8.559,5.28\n c-1.624,3.237-1.283,7.114,0.883,10.017l57.513,77.129c1.808,2.424,4.652,3.852,7.675,3.852c3.023,0,5.868-1.428,7.676-3.852\n l57.514-77.129c2.164-2.902,2.507-6.779,0.883-10.017C212.938,202.767,209.627,200.723,206.004,200.723z"})})},UM=({color:t,size:e,reverse:i})=>R.jsx("svg",{width:e||"100%",height:e||"100%",style:{transform:i?"rotate(180deg)":void 0},id:"Layer_1",viewBox:"0 0 512 512",fill:t||"currentColor",xmlns:"http://www.w3.org/2000/svg",children:R.jsx("path",{d:"M128 0C92.7 0 64 28.7 64 64v96h64V64H354.7L384 93.3V160h64V93.3c0-17-6.7-33.3-18.7-45.3L400 18.7C388 6.7 371.7 0 354.7 0H128zM384 352v32 64H128V384 368 352H384zm64 32h32c17.7 0 32-14.3 32-32V256c0-35.3-28.7-64-64-64H64c-35.3 0-64 28.7-64 64v96c0 17.7 14.3 32 32 32H64v64c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V384zM432 248a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"})}),VM=()=>{const{state:{currentPage:t,numPages:e},dispatch:i}=p(CM),{t:n}=tl();return R.jsxs(GM,{id:"pdf-pagination",children:[R.jsx(qM,{id:"pdf-pagination-prev",onClick:()=>i(SM(t-1)),disabled:1===t,children:R.jsx(FM,{color:"#000",size:"50%"})}),R.jsx(YM,{id:"pdf-pagination-info",children:n("pdfPluginPageNumber",{currentPage:t,allPagesCount:e})}),R.jsx(XM,{id:"pdf-pagination-next",onClick:()=>i(SM(t+1)),disabled:t>=e,children:R.jsx(NM,{color:"#000",size:"50%"})})]})},GM=so.div`
|
|
188
188
|
display: flex;
|
|
189
189
|
align-items: center;
|
|
190
|
-
`,
|
|
190
|
+
`,qM=so(Co)`
|
|
191
191
|
width: 30px;
|
|
192
192
|
height: 30px;
|
|
193
193
|
margin: 0 5px;
|
|
@@ -196,9 +196,9 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
196
196
|
width: 25px;
|
|
197
197
|
height: 25px;
|
|
198
198
|
}
|
|
199
|
-
`,
|
|
199
|
+
`,XM=so(qM)`
|
|
200
200
|
margin: 0 20px 0 5px;
|
|
201
|
-
`,
|
|
201
|
+
`,YM=so.div`
|
|
202
202
|
color: ${t=>t.theme.textPrimary};
|
|
203
203
|
font-size: 14px;
|
|
204
204
|
text-align: left;
|
|
@@ -206,7 +206,7 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
206
206
|
@media (max-width: 768px) {
|
|
207
207
|
font-size: 10px;
|
|
208
208
|
}
|
|
209
|
-
`,YM=()=>{const{t:t}=tl(),{state:{mainState:e,paginated:i,zoomLevel:n,numPages:s,zoomJump:r,defaultZoomLevel:a},dispatch:o}=p(CM),l=(null==e?void 0:e.currentDocument)||null;return P.jsxs(KM,{id:"pdf-controls",children:[i&&s>1&&P.jsx(UM,{}),(null==l?void 0:l.fileData)&&P.jsx(QM,{id:"pdf-download",href:null==l?void 0:l.fileData,download:(null==l?void 0:l.fileName)||(null==l?void 0:l.uri),title:t("downloadButtonLabel"),children:P.jsx(WM,{color:"#000",size:"75%"})}),P.jsx(JM,{id:"pdf-zoom-out",onMouseDown:()=>o(bM(n-r)),children:P.jsx(BM,{color:"#000",size:"80%"})}),P.jsx(JM,{id:"pdf-zoom-in",onMouseDown:()=>o(bM(n+r)),children:P.jsx(jM,{color:"#000",size:"80%"})}),P.jsx(JM,{id:"pdf-zoom-reset",onMouseDown:()=>o(bM(a)),disabled:n===a,children:P.jsx(zM,{color:"#000",size:"70%"})}),s>1&&P.jsx(JM,{id:"pdf-toggle-pagination",onMouseDown:()=>o((t=>({type:wM,value:t}))(!i)),children:P.jsx(HM,{color:"#000",size:"70%",reverse:i})})]})},KM=so.div`
|
|
209
|
+
`,KM={isFirefox:()=>typeof InstallTrigger<"u",isIE:()=>-1!==navigator.userAgent.indexOf("MSIE")||!!document.documentMode,isEdge:()=>!KM.isIE()&&!!window.StyleMedia,isChrome:(t=window)=>!!t.chrome,isSafari:()=>Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0||-1!==navigator.userAgent.toLowerCase().indexOf("safari"),isIOSChrome:()=>-1!==navigator.userAgent.toLowerCase().indexOf("crios")},JM={show(t){const e=document.createElement("div");e.setAttribute("style","font-family:sans-serif; display:table; text-align:center; font-weight:300; font-size:30px; left:0; top:0;position:fixed; z-index: 9990;color: #0460B5; width: 100%; height: 100%; background-color:rgba(255,255,255,.9);transition: opacity .3s ease;"),e.setAttribute("id","printJS-Modal");const i=document.createElement("div");i.setAttribute("style","display:table-cell; vertical-align:middle; padding-bottom:100px;");const n=document.createElement("div");n.setAttribute("class","printClose"),n.setAttribute("id","printClose"),i.appendChild(n);const s=document.createElement("span");s.setAttribute("class","printSpinner"),i.appendChild(s);const r=document.createTextNode(t.modalMessage);i.appendChild(r),e.appendChild(i),document.getElementsByTagName("body")[0].appendChild(e),document.getElementById("printClose").addEventListener("click",(function(){JM.close()}))},close(){const t=document.getElementById("printJS-Modal");t&&t.parentNode.removeChild(t)}};function QM(t){return t.charAt(0).toUpperCase()+t.slice(1)}function ZM(t,e){for(let i=0;i<t.length;i++)if("object"==typeof e&&-1!==e.indexOf(t[i]))return!0;return!1}function tP(t,e){const i=document.createElement("div");if(function(t){return new RegExp("<([A-Za-z][A-Za-z0-9]*)\\b[^>]*>(.*?)</\\1>").test(t)}(e.header))i.innerHTML=e.header;else{const t=document.createElement("h1"),n=document.createTextNode(e.header);t.appendChild(n),t.setAttribute("style",e.headerStyle),i.appendChild(t)}t.insertBefore(i,t.childNodes[0])}function eP(t){t.showModal&&JM.close(),t.onLoadingEnd&&t.onLoadingEnd(),(t.showModal||t.onLoadingStart)&&window.URL.revokeObjectURL(t.printable);let e="mouseover";(KM.isChrome()||KM.isFirefox())&&(e="focus");const i=()=>{window.removeEventListener(e,i),t.onPrintDialogClose();const n=document.getElementById(t.frameId);n&&n.remove()};window.addEventListener(e,i)}const iP=(t,e)=>{document.getElementsByTagName("body")[0].appendChild(e);const i=document.getElementById(t.frameId);i.onload=()=>{if("pdf"===t.type)return void(KM.isFirefox()?setTimeout((()=>nP(i,t)),1e3):nP(i,t));let e=i.contentWindow||i.contentDocument;if(e.document&&(e=e.document),e.body.appendChild(t.printableElement),"pdf"!==t.type&&t.style){const i=document.createElement("style");i.innerHTML=t.style,e.head.appendChild(i)}const n=e.getElementsByTagName("img");n.length>0?function(t){const e=t.map((t=>{if(t.src&&t.src!==window.location.href)return function(t){return new Promise((e=>{const i=()=>{!t||typeof t.naturalWidth>"u"||0===t.naturalWidth||!t.complete?setTimeout(i,500):e()};i()}))}(t)}));return Promise.all(e)}(Array.from(n)).then((()=>nP(i,t))):nP(i,t)}};function nP(t,e){try{if(t.focus(),KM.isEdge()||KM.isIE())try{t.contentWindow.document.execCommand("print",!1,null)}catch{t.contentWindow.print()}else t.contentWindow.print()}catch(t){e.onError(t)}finally{KM.isFirefox()&&(t.style.visibility="hidden",t.style.left="-1px"),eP(e)}}const sP=(t,e)=>{if(t.base64){const i=Uint8Array.from(atob(t.printable),(t=>t.charCodeAt(0)));return void rP(t,e,i)}t.printable=/^(blob|http|\/\/)/i.test(t.printable)?t.printable:window.location.origin+("/"!==t.printable.charAt(0)?"/"+t.printable:t.printable);const i=new window.XMLHttpRequest;i.responseType="arraybuffer",i.addEventListener("error",(()=>{eP(t),t.onError(i.statusText,i)})),i.addEventListener("load",(()=>{if(-1===[200,201].indexOf(i.status))return eP(t),void t.onError(i.statusText,i);rP(t,e,i.response)})),i.open("GET",t.printable,!0),i.send()};function rP(t,e,i){let n=new window.Blob([i],{type:"application/pdf"});n=window.URL.createObjectURL(n),e.setAttribute("src",n),iP(t,e)}const aP=(t,e)=>{const i=function(t){return"object"==typeof t&&t&&(t instanceof HTMLElement||1===t.nodeType)}(t.printable)?t.printable:document.getElementById(t.printable);i?(t.printableElement=oP(i,t),t.header&&tP(t.printableElement,t),iP(t,e)):window.console.error("Invalid HTML element id: "+t.printable)};function oP(t,e){const i=t.cloneNode(),n=Array.prototype.slice.call(t.childNodes);for(let t=0;t<n.length;t++){if(-1!==e.ignoreElements.indexOf(n[t].id))continue;const s=oP(n[t],e);i.appendChild(s)}switch(e.scanStyles&&1===t.nodeType&&i.setAttribute("style",function(t,e){let i="";const n=(document.defaultView||window).getComputedStyle(t,"");for(let t=0;t<n.length;t++)(-1!==e.targetStyles.indexOf("*")||-1!==e.targetStyle.indexOf(n[t])||ZM(e.targetStyles,n[t]))&&n.getPropertyValue(n[t])&&(i+=n[t]+":"+n.getPropertyValue(n[t])+";");return i+="max-width: "+e.maxWidth+"px !important; font-size: "+e.font_size+" !important;",i}(t,e)),t.tagName){case"SELECT":i.value=t.value;break;case"CANVAS":i.getContext("2d").drawImage(t,0,0)}return i}const lP=(t,e)=>{t.printableElement=document.createElement("div"),t.printableElement.setAttribute("style","width:100%"),t.printableElement.innerHTML=t.printable,iP(t,e)},hP=(t,e)=>{t.printable.constructor!==Array&&(t.printable=[t.printable]),t.printableElement=document.createElement("div"),t.printable.forEach((e=>{const i=document.createElement("img");if(i.setAttribute("style",t.imageStyle),i.src=e,KM.isFirefox()){const t=i.src;i.src=t}const n=document.createElement("div");n.appendChild(i),t.printableElement.appendChild(n)})),t.header&&tP(t.printableElement,t),iP(t,e)},cP=(t,e)=>{if("object"!=typeof t.printable)throw new Error("Invalid javascript data object (JSON).");if("boolean"!=typeof t.repeatTableHeader)throw new Error("Invalid value for repeatTableHeader attribute (JSON).");if(!t.properties||!Array.isArray(t.properties))throw new Error("Invalid properties array for your JSON data.");t.properties=t.properties.map((e=>({field:"object"==typeof e?e.field:e,displayName:"object"==typeof e?e.displayName:e,columnSize:"object"==typeof e&&e.columnSize?e.columnSize+";":100/t.properties.length+"%;"}))),t.printableElement=document.createElement("div"),t.header&&tP(t.printableElement,t),t.printableElement.innerHTML+=function(t){const e=t.printable,i=t.properties;let n='<table style="border-collapse: collapse; width: 100%;">';t.repeatTableHeader&&(n+="<thead>"),n+="<tr>";for(let e=0;e<i.length;e++)n+='<th style="width:'+i[e].columnSize+";"+t.gridHeaderStyle+'">'+QM(i[e].displayName)+"</th>";n+="</tr>",t.repeatTableHeader&&(n+="</thead>"),n+="<tbody>";for(let s=0;s<e.length;s++){n+="<tr>";for(let r=0;r<i.length;r++){let a=e[s];const o=i[r].field.split(".");if(o.length>1)for(let t=0;t<o.length;t++)a=a[o[t]];else a=a[i[r].field];n+='<td style="width:'+i[r].columnSize+t.gridStyle+'">'+a+"</td>"}n+="</tr>"}return n+="</tbody></table>",n}(t),iP(t,e)};const dP=["pdf","html","image","json","raw-html"],uP={init(){const t={printable:null,fallbackPrintable:null,type:"pdf",header:null,headerStyle:"font-weight: 300;",maxWidth:800,properties:null,gridHeaderStyle:"font-weight: bold; padding: 5px; border: 1px solid #dddddd;",gridStyle:"border: 1px solid lightgray; margin-bottom: -1px;",showModal:!1,onError:t=>{throw t},onLoadingStart:null,onLoadingEnd:null,onPrintDialogClose:()=>{},onIncompatibleBrowser:()=>{},modalMessage:"Retrieving Document...",frameId:"printJS",printableElement:null,documentTitle:"Document",targetStyle:["clear","display","width","min-width","height","min-height","max-height"],targetStyles:["border","box","break","text-decoration"],ignoreElements:[],repeatTableHeader:!0,css:null,style:null,scanStyles:!0,base64:!1,onPdfOpen:null,font:"TimesNewRoman",font_size:"12pt",honorMarginPadding:!0,honorColor:!1,imageStyle:"max-width: 100%;"},e=arguments[0];if(void 0===e)throw new Error("printJS expects at least 1 attribute.");switch(typeof e){case"string":t.printable=encodeURI(e),t.fallbackPrintable=t.printable,t.type=arguments[1]||t.type;break;case"object":for(var i in t.printable=e.printable,t.fallbackPrintable=typeof e.fallbackPrintable<"u"?e.fallbackPrintable:t.printable,t.fallbackPrintable=t.base64?`data:application/pdf;base64,${t.fallbackPrintable}`:t.fallbackPrintable,t)"printable"===i||"fallbackPrintable"===i||(t[i]=typeof e[i]<"u"?e[i]:t[i]);break;default:throw new Error('Unexpected argument type! Expected "string" or "object", got '+typeof e)}if(!t.printable)throw new Error("Missing printable information.");if(!t.type||"string"!=typeof t.type||-1===dP.indexOf(t.type.toLowerCase()))throw new Error("Invalid print type. Available types are: pdf, html, image and json.");t.showModal&&JM.show(t),t.onLoadingStart&&t.onLoadingStart();const n=document.getElementById(t.frameId);n&&n.parentNode.removeChild(n);const s=document.createElement("iframe");switch(KM.isFirefox()?s.setAttribute("style","width: 1px; height: 100px; position: fixed; left: 0; top: 0; opacity: 0; border-width: 0; margin: 0; padding: 0"):s.setAttribute("style","visibility: hidden; height: 0; width: 0; position: absolute; border: 0"),s.setAttribute("id",t.frameId),"pdf"!==t.type&&(s.srcdoc="<html><head><title>"+t.documentTitle+"</title>",t.css&&(Array.isArray(t.css)||(t.css=[t.css]),t.css.forEach((t=>{s.srcdoc+='<link rel="stylesheet" href="'+t+'">'}))),s.srcdoc+="</head><body></body></html>"),t.type){case"pdf":if(KM.isIE())try{console.info("Print.js doesn't support PDF printing in Internet Explorer."),window.open(t.fallbackPrintable,"_blank").focus(),t.onIncompatibleBrowser()}catch(e){t.onError(e)}finally{t.showModal&&JM.close(),t.onLoadingEnd&&t.onLoadingEnd()}else sP(t,s);break;case"image":hP(t,s);break;case"html":aP(t,s);break;case"raw-html":lP(t,s);break;case"json":cP(t,s)}}}.init;typeof window<"u"&&(window.printJS=uP);const pP=()=>{const{t:t}=tl(),{state:{mainState:e,paginated:i,zoomLevel:n,numPages:s,zoomJump:r,defaultZoomLevel:a},dispatch:o}=p(CM),l=(null==e?void 0:e.currentDocument)||null;return R.jsxs(fP,{id:"pdf-controls",children:[i&&s>1&&R.jsx(VM,{}),(null==l?void 0:l.fileData)&&R.jsx(mP,{id:"pdf-download",href:null==l?void 0:l.fileData,download:(null==l?void 0:l.fileName)||(null==l?void 0:l.uri),title:t("downloadButtonLabel"),children:R.jsx(WM,{color:"#000",size:"75%"})}),R.jsx(gP,{id:"pdf-print",onClick:()=>{var t,e;const i=null==(e=null==l?void 0:l.fileData)?void 0:e.toString().slice((null==(t=null==l?void 0:l.fileData)?void 0:t.toString().indexOf(","))+1);uP({printable:i,type:"pdf",base64:!0})},children:R.jsx(UM,{color:"#000",size:"65%"})}),R.jsx(gP,{id:"pdf-zoom-out",onMouseDown:()=>o(yM(n-r)),children:R.jsx(BM,{color:"#000",size:"80%"})}),R.jsx(gP,{id:"pdf-zoom-in",onMouseDown:()=>o(yM(n+r)),children:R.jsx(jM,{color:"#000",size:"80%"})}),R.jsx(gP,{id:"pdf-zoom-reset",onMouseDown:()=>o(yM(a)),disabled:n===a,children:R.jsx(zM,{color:"#000",size:"70%"})}),s>1&&R.jsx(gP,{id:"pdf-toggle-pagination",onMouseDown:()=>o((t=>({type:wM,value:t}))(!i)),children:R.jsx($M,{color:"#000",size:"70%",reverse:i})})]})},fP=so.div`
|
|
210
210
|
display: flex;
|
|
211
211
|
position: sticky;
|
|
212
212
|
top: 0;
|
|
@@ -220,21 +220,21 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
220
220
|
@media (max-width: 768px) {
|
|
221
221
|
padding: 6px;
|
|
222
222
|
}
|
|
223
|
-
`,
|
|
223
|
+
`,gP=so(Co)`
|
|
224
224
|
width: 30px;
|
|
225
225
|
height: 30px;
|
|
226
226
|
@media (max-width: 768px) {
|
|
227
227
|
width: 25px;
|
|
228
228
|
height: 25px;
|
|
229
229
|
}
|
|
230
|
-
`,
|
|
230
|
+
`,mP=so(Mo)`
|
|
231
231
|
width: 30px;
|
|
232
232
|
height: 30px;
|
|
233
233
|
@media (max-width: 768px) {
|
|
234
234
|
width: 25px;
|
|
235
235
|
height: 25px;
|
|
236
236
|
}
|
|
237
|
-
`;IE.workerSrc=new URL(`https://unpkg.com/pdfjs-dist@${uC}/build/pdf.worker.min.mjs`).toString();const
|
|
237
|
+
`;IE.workerSrc=new URL(`https://unpkg.com/pdfjs-dist@${uC}/build/pdf.worker.min.mjs`).toString();const vP=({mainState:t})=>R.jsx(MM,{mainState:t,children:R.jsxs(bP,{id:"pdf-renderer","data-testid":"pdf-renderer",children:[R.jsx(pP,{}),R.jsx(IM,{})]})});vP.fileTypes=["pdf","application/pdf"],vP.weight=0;const bP=so.div`
|
|
238
238
|
display: flex;
|
|
239
239
|
flex-direction: column;
|
|
240
240
|
flex: 1;
|
|
@@ -255,7 +255,7 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
255
255
|
&::-webkit-scrollbar-thumb:hover {
|
|
256
256
|
background: ${t=>t.theme.primary};
|
|
257
257
|
}
|
|
258
|
-
`,
|
|
258
|
+
`,yP=so(kl)`
|
|
259
259
|
display: flex;
|
|
260
260
|
flex: 1;
|
|
261
261
|
align-items: center;
|
|
@@ -267,23 +267,23 @@ var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,c
|
|
|
267
267
|
linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
|
|
268
268
|
background-size: 20px 20px;
|
|
269
269
|
background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
|
|
270
|
-
`,
|
|
270
|
+
`,wP=t=>R.jsx(yP,{...t});wP.fileTypes=["png","image/png"],wP.weight=0;let AP,_P,xP=[];const SP=t=>{var e={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop"};return t in e?e[t]:"Tag"+t},kP=t=>{var e,i={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE"};return t in i&&(e=i[t]),e},EP=(t,e,i)=>{i=i||0;var n=e+Math.floor(i/8),s=i+t,r=32-t;if(s<=0)throw RangeError("No bits requested");if(s<=8)var a=24+i,o=AP.getUint8(n,_P);else if(s<=16)a=16+i,o=AP.getUint16(n,_P);else{if(!(s<=32))throw RangeError("Too many bits requested");a=i,o=AP.getUint32(n,_P)}return{bits:o<<a>>>r,byteOffset:n+Math.floor(s/8),bitOffset:s%8}},CP=(t,e)=>{if(t<=0)throw RangeError("No bytes requested");if(t<=1)return AP.getUint8(e,_P);if(t<=2)return AP.getUint16(e,_P);if(t<=3)return AP.getUint32(e,_P)>>>8;if(t<=4)return AP.getUint32(e,_P);throw RangeError("Too many bytes requested")},MP=(t,e,i,n)=>{var s=[],r=(t=>{var e;return-1!==["BYTE","ASCII","SBYTE","UNDEFINED"].indexOf(t)?e=1:-1!==["SHORT","SSHORT"].indexOf(t)?e=2:-1!==["LONG","SLONG","FLOAT"].indexOf(t)?e=4:-1!==["RATIONAL","SRATIONAL","DOUBLE"].indexOf(t)&&(e=8),e})(e);if(r*i<=4){if(!1===_P)var a=n>>>8*(4-r);else a=n;s.push(a)}else for(var o=0;o<i;o++){var l=r*o;if(r>=8){if(-1===["RATIONAL","SRATIONAL"].indexOf(e))throw TypeError("Can't handle this field type or size");s.push(CP(4,n+l)),s.push(CP(4,n+l+4))}else s.push(CP(r,n+l))}return"ASCII"===e&&s.forEach((function(t,e,i){i[e]=String.fromCharCode(t)})),s},PP=(t,e)=>{var i=Math.pow(2,8-e);return Math.floor(t*i+(i-1))},RP=(t,e,i,n)=>(typeof n>"u"&&(n=1),"rgba("+t+", "+e+", "+i+", "+n+")"),TP=t=>{for(var e=CP(2,t),i=[],n=t+2,s=0;s<e;n+=12,s++){var r=CP(2,n),a=CP(2,n+2),o=CP(4,n+4),l=CP(4,n+8),h=SP(r),c=kP(a),d=MP(0,c,o,l);i[h]={type:c,values:d}}xP.push(i);var u=CP(4,n);return 0===u?xP:TP(u)},LP=(t,e)=>{let i=e||document.createElement("canvas");if(t&&(AP=new DataView(t),_P=(()=>{var t=CP(2,0);if(18761===t)_P=!0;else{if(19789!==t)throw TypeError("Invalid byte order value.");_P=!1}return _P})(),(()=>{if(42!==CP(2,2))throw RangeError("You forgot your towel!");return!0})())){var n=CP(4,4);xP=TP(n);var s=xP[0],r=s.ImageWidth.values[0],a=s.ImageLength.values[0];i.width=r,i.height=a;var o=[],l=s.Compression?s.Compression.values[0]:1,h=s.SamplesPerPixel.values[0],c=[],d=0,u=!1;if(s.BitsPerSample.values.forEach((function(t,e,i){c[e]={bitsPerSample:t,hasBytesPerSample:!1,bytesPerSample:void 0},t%8==0&&(c[e].hasBytesPerSample=!0,c[e].bytesPerSample=t/8),d+=t}),void 0),d%8==0){u=!0;var p=d/8}var f=s.StripOffsets.values,g=f.length;if(s.StripByteCounts)var m=s.StripByteCounts.values;else{if(1!==g)throw Error("Cannot recover from missing StripByteCounts");m=[Math.ceil(r*a*d/8)]}for(var v=0;v<g;v++){var b=f[v];o[v]=[];for(var y=m[v],w=0,A=0,_=1,x=!0,S=[],k=0,E=0,C=0;w<y;w+=_)switch(l){case 1:var M=0;for(S=[];M<h;M++){if(!c[M].hasBytesPerSample){var P=EP(c[M].bitsPerSample,b+w,A);throw S.push(P.bits),w=P.byteOffset-b,A=P.bitOffset,RangeError("Cannot handle sub-byte bits per sample")}var R=c[M].bytesPerSample*M;S.push(CP(c[M].bytesPerSample,b+w+R))}if(o[v].push(S),!u)throw _=0,RangeError("Cannot handle sub-byte bits per pixel");_=p;break;case 2:case 3:case 4:case 5:case 6:case 7:break;case 32773:if(x){x=!1;var T=1,L=1,I=AP.getInt8(b+w,_P);I>=0&&I<=127?T=I+1:I>=-127&&I<=-1?L=1-I:x=!0}else{var D=CP(1,b+w);for(M=0;M<L;M++){if(!c[E].hasBytesPerSample)throw RangeError("Cannot handle sub-byte bits per sample");C=C<<8*k|D,++k===c[E].bytesPerSample&&(S.push(C),C=k=0,E++),E===h&&(o[v].push(S),S=[],E=0)}0===--T&&(x=!0)}_=1}}if(i.getContext){var F=i.getContext("2d");if(F.fillStyle=RP(255,255,255,0),s.RowsPerStrip)var N=s.RowsPerStrip.values[0];else N=a;var O=o.length,W=a%N,j=0===W?N:W,B=N,H=0,z=s.PhotometricInterpretation.values[0],$=[],U=0;if(s.ExtraSamples&&(U=($=s.ExtraSamples.values).length),s.ColorMap)var V=s.ColorMap.values,G=Math.pow(2,c[0].bitsPerSample);for(v=0;v<O;v++){v+1===O&&(B=j);for(var q=o[v].length,X=H*v,Y=0,K=0;K<q;Y++)for(var J=0;J<r;J++,K++){var Q=o[v][K],Z=0,tt=0,et=0,it=1;if(U>0)for(var nt=0;nt<U;nt++)if(1===$[nt]||2===$[nt]){it=Q[3+nt]/256;break}switch(z){case 0:if(c[0].hasBytesPerSample)var st=Math.pow(16,2*c[0].bytesPerSample);Q.forEach((function(t,e,i){i[e]=st-t}));case 1:Z=tt=et=PP(Q[0],c[0].bitsPerSample);break;case 2:Z=PP(Q[0],c[0].bitsPerSample),tt=PP(Q[1],c[1].bitsPerSample),et=PP(Q[2],c[2].bitsPerSample);break;case 3:if(void 0===V)throw Error("Palette image missing color map");var rt=Q[0];Z=PP(V[rt],16),tt=PP(V[G+rt],16),et=PP(V[2*G+rt],16);break;case 4:throw RangeError("Not Yet Implemented: Transparency mask");case 5:throw RangeError("Not Yet Implemented: CMYK");case 6:throw RangeError("Not Yet Implemented: YCbCr");case 8:throw RangeError("Not Yet Implemented: CIELab");default:throw RangeError("Unknown Photometric Interpretation:",z)}F.fillStyle=RP(Z,tt,et,it),F.fillRect(J,X+Y,1,1)}H=B}}return i}},IP=t=>{const{mainState:{currentDocument:e}}=t,{t:i}=tl(),[n,s]=w(!1),[r,a]=w(!1);return v((()=>{if(!e||n)return;const t=document.getElementById("tiff-img");try{t&&LP(e.fileData,t),s(!0)}catch{a(!0)}}),[e,n]),r?R.jsx(kl,{...t,children:R.jsx("div",{children:i("brokenFile")})}):R.jsx(kl,{...t,children:R.jsx(DP,{id:"tiff-img"})})};IP.fileTypes=["tif","tiff","image/tif","image/tiff"],IP.weight=0,IP.fileLoader=dl;const DP=so.canvas`
|
|
271
271
|
max-width: 95%;
|
|
272
272
|
max-height: 95%;
|
|
273
|
-
`,
|
|
273
|
+
`,FP=({mainState:{currentDocument:t}})=>R.jsx(NP,{id:"txt-renderer",children:null==t?void 0:t.fileData});FP.fileTypes=["txt","text/plain"],FP.weight=0,FP.fileLoader=pl;const NP=so.div`
|
|
274
274
|
display: flex;
|
|
275
275
|
flex-direction: column;
|
|
276
276
|
width: 100%;
|
|
277
277
|
padding: 30px;
|
|
278
|
-
`;var
|
|
278
|
+
`;var OP={exports:{}};
|
|
279
279
|
/* @license
|
|
280
280
|
Papa Parse
|
|
281
281
|
v5.4.1
|
|
282
282
|
https://github.com/mholt/PapaParse
|
|
283
283
|
License: MIT
|
|
284
|
-
*/const wR=S(bR.exports=function t(){var e=typeof self<"u"?self:typeof window<"u"?window:void 0!==e?e:{},i=!e.document&&!!e.postMessage,n=e.IS_PAPA_WORKER||!1,s={},r=0,a={parse:function(i,n){var o=(n=n||{}).dynamicTyping||!1;if(A(o)&&(n.dynamicTypingFunction=o,o={}),n.dynamicTyping=o,n.transform=!!A(n.transform)&&n.transform,n.worker&&a.WORKERS_SUPPORTED){var l=function(){if(!a.WORKERS_SUPPORTED)return!1;var i,n,o=(i=e.URL||e.webkitURL||null,n=t.toString(),a.BLOB_URL||(a.BLOB_URL=i.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",n,")();"],{type:"text/javascript"})))),l=new e.Worker(o);return l.onmessage=m,l.id=r++,s[l.id]=l}();return l.userStep=n.step,l.userChunk=n.chunk,l.userComplete=n.complete,l.userError=n.error,n.step=A(n.step),n.chunk=A(n.chunk),n.complete=A(n.complete),n.error=A(n.error),delete n.worker,void l.postMessage({input:i,config:n,workerId:l.id})}var p,f=null;return a.NODE_STREAM_INPUT,"string"==typeof i?(i=65279===(p=i).charCodeAt(0)?p.slice(1):p,f=n.download?new h(n):new d(n)):!0===i.readable&&A(i.read)&&A(i.on)?f=new u(n):(e.File&&i instanceof File||i instanceof Object)&&(f=new c(n)),f.stream(i)},unparse:function(t,e){var i=!1,n=!0,s=",",r="\r\n",o='"',l=o+o,h=!1,c=null,d=!1;!function(){if("object"==typeof e){if("string"!=typeof e.delimiter||a.BAD_DELIMITERS.filter((function(t){return-1!==e.delimiter.indexOf(t)})).length||(s=e.delimiter),("boolean"==typeof e.quotes||"function"==typeof e.quotes||Array.isArray(e.quotes))&&(i=e.quotes),"boolean"!=typeof e.skipEmptyLines&&"string"!=typeof e.skipEmptyLines||(h=e.skipEmptyLines),"string"==typeof e.newline&&(r=e.newline),"string"==typeof e.quoteChar&&(o=e.quoteChar),"boolean"==typeof e.header&&(n=e.header),Array.isArray(e.columns)){if(0===e.columns.length)throw new Error("Option columns is empty");c=e.columns}void 0!==e.escapeChar&&(l=e.escapeChar+o),("boolean"==typeof e.escapeFormulae||e.escapeFormulae instanceof RegExp)&&(d=e.escapeFormulae instanceof RegExp?e.escapeFormulae:/^[=+\-@\t\r].*$/)}}();var u=new RegExp(f(o),"g");if("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return p(null,t,h);if("object"==typeof t[0])return p(c||Object.keys(t[0]),t,h)}else if("object"==typeof t)return"string"==typeof t.data&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||c),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:"object"==typeof t.data[0]?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||"object"==typeof t.data[0]||(t.data=[t.data])),p(t.fields||[],t.data||[],h);throw new Error("Unable to serialize unrecognized input");function p(t,e,i){var a="";"string"==typeof t&&(t=JSON.parse(t)),"string"==typeof e&&(e=JSON.parse(e));var o=Array.isArray(t)&&0<t.length,l=!Array.isArray(e[0]);if(o&&n){for(var h=0;h<t.length;h++)0<h&&(a+=s),a+=g(t[h],h);0<e.length&&(a+=r)}for(var c=0;c<e.length;c++){var d=o?t.length:e[c].length,u=!1,p=o?0===Object.keys(e[c]).length:0===e[c].length;if(i&&!o&&(u="greedy"===i?""===e[c].join("").trim():1===e[c].length&&0===e[c][0].length),"greedy"===i&&o){for(var f=[],m=0;m<d;m++){var v=l?t[m]:m;f.push(e[c][v])}u=""===f.join("").trim()}if(!u){for(var y=0;y<d;y++){0<y&&!p&&(a+=s);var b=o&&l?t[y]:y;a+=g(e[c][b],y)}c<e.length-1&&(!i||0<d&&!p)&&(a+=r)}}return a}function g(t,e){if(null==t)return"";if(t.constructor===Date)return JSON.stringify(t).slice(1,25);var n=!1;d&&"string"==typeof t&&d.test(t)&&(t="'"+t,n=!0);var r=t.toString().replace(u,l);return(n=n||!0===i||"function"==typeof i&&i(t,e)||Array.isArray(i)&&i[e]||function(t,e){for(var i=0;i<e.length;i++)if(-1<t.indexOf(e[i]))return!0;return!1}(r,a.BAD_DELIMITERS)||-1<r.indexOf(s)||" "===r.charAt(0)||" "===r.charAt(r.length-1))?o+r+o:r}}};if(a.RECORD_SEP=String.fromCharCode(30),a.UNIT_SEP=String.fromCharCode(31),a.BYTE_ORDER_MARK="\ufeff",a.BAD_DELIMITERS=["\r","\n",'"',a.BYTE_ORDER_MARK],a.WORKERS_SUPPORTED=!i&&!!e.Worker,a.NODE_STREAM_INPUT=1,a.LocalChunkSize=10485760,a.RemoteChunkSize=5242880,a.DefaultDelimiter=",",a.Parser=g,a.ParserHandle=p,a.NetworkStreamer=h,a.FileStreamer=c,a.StringStreamer=d,a.ReadableStreamStreamer=u,e.jQuery){var o=e.jQuery;o.fn.parse=function(t){var i=t.config||{},n=[];return this.each((function(t){if("INPUT"!==o(this).prop("tagName").toUpperCase()||"file"!==o(this).attr("type").toLowerCase()||!e.FileReader||!this.files||0===this.files.length)return!0;for(var s=0;s<this.files.length;s++)n.push({file:this.files[s],inputElem:this,instanceConfig:o.extend({},i)})})),s(),this;function s(){if(0!==n.length){var e,i,s,l,h=n[0];if(A(t.before)){var c=t.before(h.file,h.inputElem);if("object"==typeof c){if("abort"===c.action)return e="AbortError",i=h.file,s=h.inputElem,l=c.reason,void(A(t.error)&&t.error({name:e},i,s,l));if("skip"===c.action)return void r();"object"==typeof c.config&&(h.instanceConfig=o.extend(h.instanceConfig,c.config))}else if("skip"===c)return void r()}var d=h.instanceConfig.complete;h.instanceConfig.complete=function(t){A(d)&&d(t,h.file,h.inputElem),r()},a.parse(h.file,h.instanceConfig)}else A(t.complete)&&t.complete()}function r(){n.splice(0,1),s()}}}function l(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var e=b(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null),this._handle=new p(e),(this._handle.streamer=this)._config=e}.call(this,t),this.parseChunk=function(t,i){if(this.isFirstChunk&&A(this._config.beforeFirstChunk)){var s=this._config.beforeFirstChunk(t);void 0!==s&&(t=s)}this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+t;this._partialLine="";var o=this._handle.parse(r,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var l=o.meta.cursor;this._finished||(this._partialLine=r.substring(l-this._baseIndex),this._baseIndex=l),o&&o.data&&(this._rowCount+=o.data.length);var h=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(n)e.postMessage({results:o,workerId:a.WORKER_ID,finished:h});else if(A(this._config.chunk)&&!i){if(this._config.chunk(o,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);o=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(o.data),this._completeResults.errors=this._completeResults.errors.concat(o.errors),this._completeResults.meta=o.meta),this._completed||!h||!A(this._config.complete)||o&&o.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),h||o&&o.meta.paused||this._nextChunk(),o}this._halted=!0},this._sendError=function(t){A(this._config.error)?this._config.error(t):n&&this._config.error&&e.postMessage({workerId:a.WORKER_ID,error:t,finished:!1})}}function h(t){var e;(t=t||{}).chunkSize||(t.chunkSize=a.RemoteChunkSize),l.call(this,t),this._nextChunk=i?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(t){this._input=t,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),i||(e.onload=w(this._chunkLoaded,this),e.onerror=w(this._chunkError,this)),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!i),this._config.downloadRequestHeaders){var t=this._config.downloadRequestHeaders;for(var n in t)e.setRequestHeader(n,t[n])}if(this._config.chunkSize){var s=this._start+this._config.chunkSize-1;e.setRequestHeader("Range","bytes="+this._start+"-"+s)}try{e.send(this._config.downloadRequestBody)}catch(t){this._chunkError(t.message)}i&&0===e.status&&this._chunkError()}},this._chunkLoaded=function(){var t;4===e.readyState&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:e.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null===(t=e.getResponseHeader("Content-Range"))?-1:parseInt(t.substring(t.lastIndexOf("/")+1))),this.parseChunk(e.responseText)))},this._chunkError=function(t){var i=e.statusText||t;this._sendError(new Error(i))}}function c(t){var e,i;(t=t||{}).chunkSize||(t.chunkSize=a.LocalChunkSize),l.call(this,t);var n=typeof FileReader<"u";this.stream=function(t){this._input=t,i=t.slice||t.webkitSlice||t.mozSlice,n?((e=new FileReader).onload=w(this._chunkLoaded,this),e.onerror=w(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var t=this._input;if(this._config.chunkSize){var s=Math.min(this._start+this._config.chunkSize,this._input.size);t=i.call(t,this._start,s)}var r=e.readAsText(t,this._config.encoding);n||this._chunkLoaded({target:{result:r}})},this._chunkLoaded=function(t){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(t.target.result)},this._chunkError=function(){this._sendError(e.error)}}function d(t){var e;l.call(this,t=t||{}),this.stream=function(t){return e=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t,i=this._config.chunkSize;return i?(t=e.substring(0,i),e=e.substring(i)):(t=e,e=""),this._finished=!e,this.parseChunk(t)}}}function u(t){l.call(this,t=t||{});var e=[],i=!0,n=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(t){this._input=t,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){n&&1===e.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):i=!0},this._streamData=w((function(t){try{e.push("string"==typeof t?t:t.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(t){this._streamError(t)}}),this),this._streamError=w((function(t){this._streamCleanUp(),this._sendError(t)}),this),this._streamEnd=w((function(){this._streamCleanUp(),n=!0,this._streamData("")}),this),this._streamCleanUp=w((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function p(t){var e,i,n,s=Math.pow(2,53),r=-s,o=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,l=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,h=this,c=0,d=0,u=!1,p=!1,m=[],v={data:[],errors:[],meta:{}};if(A(t.step)){var y=t.step;t.step=function(e){if(v=e,x())_();else{if(_(),0===v.data.length)return;c+=e.data.length,t.preview&&c>t.preview?i.abort():(v.data=v.data[0],y(v,h))}}}function w(e){return"greedy"===t.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function _(){return v&&n&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+a.DefaultDelimiter+"'"),n=!1),t.skipEmptyLines&&(v.data=v.data.filter((function(t){return!w(t)}))),x()&&function(){if(v)if(Array.isArray(v.data[0])){for(var e=0;x()&&e<v.data.length;e++)v.data[e].forEach(i);v.data.splice(0,1)}else v.data.forEach(i);function i(e,i){A(t.transformHeader)&&(e=t.transformHeader(e,i)),m.push(e)}}(),function(){if(!v||!t.header&&!t.dynamicTyping&&!t.transform)return v;function e(e,i){var n,s=t.header?{}:[];for(n=0;n<e.length;n++){var r=n,a=e[n];t.header&&(r=n>=m.length?"__parsed_extra":m[n]),t.transform&&(a=t.transform(a,r)),a=S(r,a),"__parsed_extra"===r?(s[r]=s[r]||[],s[r].push(a)):s[r]=a}return t.header&&(n>m.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+m.length+" fields but parsed "+n,d+i):n<m.length&&k("FieldMismatch","TooFewFields","Too few fields: expected "+m.length+" fields but parsed "+n,d+i)),s}var i=1;return!v.data.length||Array.isArray(v.data[0])?(v.data=v.data.map(e),i=v.data.length):v.data=e(v.data,0),t.header&&v.meta&&(v.meta.fields=m),d+=i,v}()}function x(){return t.header&&0===m.length}function S(e,i){return n=e,t.dynamicTypingFunction&&void 0===t.dynamicTyping[n]&&(t.dynamicTyping[n]=t.dynamicTypingFunction(n)),!0===(t.dynamicTyping[n]||t.dynamicTyping)?"true"===i||"TRUE"===i||"false"!==i&&"FALSE"!==i&&(function(t){if(o.test(t)){var e=parseFloat(t);if(r<e&&e<s)return!0}return!1}(i)?parseFloat(i):l.test(i)?new Date(i):""===i?null:i):i;var n}function k(t,e,i,n){var s={type:t,code:e,message:i};void 0!==n&&(s.row=n),v.errors.push(s)}this.parse=function(s,r,o){var l=t.quoteChar||'"';if(t.newline||(t.newline=function(t,e){t=t.substring(0,1048576);var i=new RegExp(f(e)+"([^]*?)"+f(e),"gm"),n=(t=t.replace(i,"")).split("\r"),s=t.split("\n"),r=1<s.length&&s[0].length<n[0].length;if(1===n.length||r)return"\n";for(var a=0,o=0;o<n.length;o++)"\n"===n[o][0]&&a++;return a>=n.length/2?"\r\n":"\r"}(s,l)),n=!1,t.delimiter)A(t.delimiter)&&(t.delimiter=t.delimiter(s),v.meta.delimiter=t.delimiter);else{var h=function(e,i,n,s,r){var o,l,h,c;r=r||[",","\t","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var d=0;d<r.length;d++){var u=r[d],p=0,f=0,m=0;h=void 0;for(var v=new g({comments:s,delimiter:u,newline:i,preview:10}).parse(e),y=0;y<v.data.length;y++)if(n&&w(v.data[y]))m++;else{var b=v.data[y].length;f+=b,void 0!==h?0<b&&(p+=Math.abs(b-h),h=b):h=b}0<v.data.length&&(f/=v.data.length-m),(void 0===l||p<=l)&&(void 0===c||c<f)&&1.99<f&&(l=p,o=u,c=f)}return{successful:!!(t.delimiter=o),bestDelimiter:o}}(s,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);h.successful?t.delimiter=h.bestDelimiter:(n=!0,t.delimiter=a.DefaultDelimiter),v.meta.delimiter=t.delimiter}var c=b(t);return t.preview&&t.header&&c.preview++,e=s,i=new g(c),v=i.parse(e,r,o),_(),u?{meta:{paused:!0}}:v||{meta:{paused:!1}}},this.paused=function(){return u},this.pause=function(){u=!0,i.abort(),e=A(t.chunk)?"":e.substring(i.getCharIndex())},this.resume=function(){h.streamer._halted?(u=!1,h.streamer.parseChunk(e,!0)):setTimeout(h.resume,3)},this.aborted=function(){return p},this.abort=function(){p=!0,i.abort(),v.meta.aborted=!0,A(t.complete)&&t.complete(v),e=""}}function f(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(t){var e,i=(t=t||{}).delimiter,n=t.newline,s=t.comments,r=t.step,o=t.preview,l=t.fastMode,h=e=void 0===t.quoteChar||null===t.quoteChar?'"':t.quoteChar;if(void 0!==t.escapeChar&&(h=t.escapeChar),("string"!=typeof i||-1<a.BAD_DELIMITERS.indexOf(i))&&(i=","),s===i)throw new Error("Comment character same as delimiter");!0===s?s="#":("string"!=typeof s||-1<a.BAD_DELIMITERS.indexOf(s))&&(s=!1),"\n"!==n&&"\r"!==n&&"\r\n"!==n&&(n="\n");var c=0,d=!1;this.parse=function(a,u,p){if("string"!=typeof a)throw new Error("Input must be a string");var g=a.length,m=i.length,v=n.length,y=s.length,b=A(r),w=[],_=[],x=[],S=c=0;if(!a)return G();if(t.header&&!u){var k=a.split(n)[0].split(i),E=[],C={},M=!1;for(var R in k){var P=k[R];A(t.transformHeader)&&(P=t.transformHeader(P,R));var T=P,L=C[P]||0;for(0<L&&(M=!0,T=P+"_"+L),C[P]=L+1;E.includes(T);)T=T+"_"+L;E.push(T)}if(M){var I=a.split(n);I[0]=E.join(i),a=I.join(n)}}if(l||!1!==l&&-1===a.indexOf(e)){for(var D=a.split(n),F=0;F<D.length;F++){if(x=D[F],c+=x.length,F!==D.length-1)c+=n.length;else if(p)return G();if(!s||x.substring(0,y)!==s){if(b){if(w=[],z(x.split(i)),q(),d)return G()}else z(x.split(i));if(o&&o<=F)return w=w.slice(0,o),G(!0)}}return G()}for(var N=a.indexOf(i,c),O=a.indexOf(n,c),W=new RegExp(f(h)+f(e),"g"),j=a.indexOf(e,c);;)if(a[c]!==e)if(s&&0===x.length&&a.substring(c,c+y)===s){if(-1===O)return G();c=O+v,O=a.indexOf(n,c),N=a.indexOf(i,c)}else if(-1!==N&&(N<O||-1===O))x.push(a.substring(c,N)),c=N+m,N=a.indexOf(i,c);else{if(-1===O)break;if(x.push(a.substring(c,O)),V(O+v),b&&(q(),d))return G();if(o&&w.length>=o)return G(!0)}else for(j=c,c++;;){if(-1===(j=a.indexOf(e,j+1)))return p||_.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:w.length,index:c}),U();if(j===g-1)return U(a.substring(c,j).replace(W,e));if(e!==h||a[j+1]!==h){if(e===h||0===j||a[j-1]!==h){-1!==N&&N<j+1&&(N=a.indexOf(i,j+1)),-1!==O&&O<j+1&&(O=a.indexOf(n,j+1));var B=H(-1===O?N:Math.min(N,O));if(a.substr(j+1+B,m)===i){x.push(a.substring(c,j).replace(W,e)),a[c=j+1+B+m]!==e&&(j=a.indexOf(e,c)),N=a.indexOf(i,c),O=a.indexOf(n,c);break}var $=H(O);if(a.substring(j+1+$,j+1+$+v)===n){if(x.push(a.substring(c,j).replace(W,e)),V(j+1+$+v),N=a.indexOf(i,c),j=a.indexOf(e,c),b&&(q(),d))return G();if(o&&w.length>=o)return G(!0);break}_.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:w.length,index:c}),j++}}else j++}return U();function z(t){w.push(t),S=c}function H(t){var e=0;if(-1!==t){var i=a.substring(j+1,t);i&&""===i.trim()&&(e=i.length)}return e}function U(t){return p||(void 0===t&&(t=a.substring(c)),x.push(t),c=g,z(x),b&&q()),G()}function V(t){c=t,z(x),x=[],O=a.indexOf(n,c)}function G(t){return{data:w,errors:_,meta:{delimiter:i,linebreak:n,aborted:d,truncated:!!t,cursor:S+(u||0)}}}function q(){r(G()),w=[],_=[]}},this.abort=function(){d=!0},this.getCharIndex=function(){return c}}function m(t){var e=t.data,i=s[e.workerId],n=!1;if(e.error)i.userError(e.error,e.file);else if(e.results&&e.results.data){var r={abort:function(){n=!0,v(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(A(i.userStep)){for(var a=0;a<e.results.data.length&&(i.userStep({data:e.results.data[a],errors:e.results.errors,meta:e.results.meta},r),!n);a++);delete e.results}else A(i.userChunk)&&(i.userChunk(e.results,r,e.file),delete e.results)}e.finished&&!n&&v(e.workerId,e.results)}function v(t,e){var i=s[t];A(i.userComplete)&&i.userComplete(e),i.terminate(),delete s[t]}function y(){throw new Error("Not implemented.")}function b(t){if("object"!=typeof t||null===t)return t;var e=Array.isArray(t)?[]:{};for(var i in t)e[i]=b(t[i]);return e}function w(t,e){return function(){t.apply(e,arguments)}}function A(t){return"function"==typeof t}return n&&(e.onmessage=function(t){var i=t.data;if(void 0===a.WORKER_ID&&i&&(a.WORKER_ID=i.workerId),"string"==typeof i.input)e.postMessage({workerId:a.WORKER_ID,results:a.parse(i.input,i.config),finished:!0});else if(e.File&&i.input instanceof File||i.input instanceof Object){var n=a.parse(i.input,i.config);n&&e.postMessage({workerId:a.WORKER_ID,results:n,finished:!0})}}),(h.prototype=Object.create(l.prototype)).constructor=h,(c.prototype=Object.create(l.prototype)).constructor=c,(d.prototype=Object.create(d.prototype)).constructor=d,(u.prototype=Object.create(l.prototype)).constructor=u,a}()),AR=({mainState:{currentDocument:t,config:e}})=>{var i;const[n,s]=w([]);return v((()=>{var i;if(null!=t&&t.fileData){const n=wR.parse(t.fileData,{delimiter:(null==e?void 0:e.csvDelimiter)??","});(null==(i=n.errors)||!i.length)&&n.data&&s(n.data)}}),[t,null==e?void 0:e.csvDelimiter]),n.length?P.jsx(_R,{children:P.jsxs(xR,{children:[P.jsx("thead",{children:P.jsx("tr",{children:null==(i=n[0])?void 0:i.map((t=>P.jsx("th",{children:t},t)))})}),P.jsx("tbody",{children:n.slice(1,n.length).map((t=>P.jsx("tr",{children:t.map((t=>P.jsx("td",{children:t},t)))},t.join(""))))})]})}):null};AR.fileTypes=["csv","text/csv"],AR.weight=0,AR.fileLoader=pl;const _R=so.div`
|
|
284
|
+
*/const WP=S(OP.exports=function t(){var e=typeof self<"u"?self:typeof window<"u"?window:void 0!==e?e:{},i=!e.document&&!!e.postMessage,n=e.IS_PAPA_WORKER||!1,s={},r=0,a={parse:function(i,n){var o=(n=n||{}).dynamicTyping||!1;if(A(o)&&(n.dynamicTypingFunction=o,o={}),n.dynamicTyping=o,n.transform=!!A(n.transform)&&n.transform,n.worker&&a.WORKERS_SUPPORTED){var l=function(){if(!a.WORKERS_SUPPORTED)return!1;var i,n,o=(i=e.URL||e.webkitURL||null,n=t.toString(),a.BLOB_URL||(a.BLOB_URL=i.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",n,")();"],{type:"text/javascript"})))),l=new e.Worker(o);return l.onmessage=m,l.id=r++,s[l.id]=l}();return l.userStep=n.step,l.userChunk=n.chunk,l.userComplete=n.complete,l.userError=n.error,n.step=A(n.step),n.chunk=A(n.chunk),n.complete=A(n.complete),n.error=A(n.error),delete n.worker,void l.postMessage({input:i,config:n,workerId:l.id})}var p,f=null;return a.NODE_STREAM_INPUT,"string"==typeof i?(i=65279===(p=i).charCodeAt(0)?p.slice(1):p,f=n.download?new h(n):new d(n)):!0===i.readable&&A(i.read)&&A(i.on)?f=new u(n):(e.File&&i instanceof File||i instanceof Object)&&(f=new c(n)),f.stream(i)},unparse:function(t,e){var i=!1,n=!0,s=",",r="\r\n",o='"',l=o+o,h=!1,c=null,d=!1;!function(){if("object"==typeof e){if("string"!=typeof e.delimiter||a.BAD_DELIMITERS.filter((function(t){return-1!==e.delimiter.indexOf(t)})).length||(s=e.delimiter),("boolean"==typeof e.quotes||"function"==typeof e.quotes||Array.isArray(e.quotes))&&(i=e.quotes),"boolean"!=typeof e.skipEmptyLines&&"string"!=typeof e.skipEmptyLines||(h=e.skipEmptyLines),"string"==typeof e.newline&&(r=e.newline),"string"==typeof e.quoteChar&&(o=e.quoteChar),"boolean"==typeof e.header&&(n=e.header),Array.isArray(e.columns)){if(0===e.columns.length)throw new Error("Option columns is empty");c=e.columns}void 0!==e.escapeChar&&(l=e.escapeChar+o),("boolean"==typeof e.escapeFormulae||e.escapeFormulae instanceof RegExp)&&(d=e.escapeFormulae instanceof RegExp?e.escapeFormulae:/^[=+\-@\t\r].*$/)}}();var u=new RegExp(f(o),"g");if("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return p(null,t,h);if("object"==typeof t[0])return p(c||Object.keys(t[0]),t,h)}else if("object"==typeof t)return"string"==typeof t.data&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||c),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:"object"==typeof t.data[0]?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||"object"==typeof t.data[0]||(t.data=[t.data])),p(t.fields||[],t.data||[],h);throw new Error("Unable to serialize unrecognized input");function p(t,e,i){var a="";"string"==typeof t&&(t=JSON.parse(t)),"string"==typeof e&&(e=JSON.parse(e));var o=Array.isArray(t)&&0<t.length,l=!Array.isArray(e[0]);if(o&&n){for(var h=0;h<t.length;h++)0<h&&(a+=s),a+=g(t[h],h);0<e.length&&(a+=r)}for(var c=0;c<e.length;c++){var d=o?t.length:e[c].length,u=!1,p=o?0===Object.keys(e[c]).length:0===e[c].length;if(i&&!o&&(u="greedy"===i?""===e[c].join("").trim():1===e[c].length&&0===e[c][0].length),"greedy"===i&&o){for(var f=[],m=0;m<d;m++){var v=l?t[m]:m;f.push(e[c][v])}u=""===f.join("").trim()}if(!u){for(var b=0;b<d;b++){0<b&&!p&&(a+=s);var y=o&&l?t[b]:b;a+=g(e[c][y],b)}c<e.length-1&&(!i||0<d&&!p)&&(a+=r)}}return a}function g(t,e){if(null==t)return"";if(t.constructor===Date)return JSON.stringify(t).slice(1,25);var n=!1;d&&"string"==typeof t&&d.test(t)&&(t="'"+t,n=!0);var r=t.toString().replace(u,l);return(n=n||!0===i||"function"==typeof i&&i(t,e)||Array.isArray(i)&&i[e]||function(t,e){for(var i=0;i<e.length;i++)if(-1<t.indexOf(e[i]))return!0;return!1}(r,a.BAD_DELIMITERS)||-1<r.indexOf(s)||" "===r.charAt(0)||" "===r.charAt(r.length-1))?o+r+o:r}}};if(a.RECORD_SEP=String.fromCharCode(30),a.UNIT_SEP=String.fromCharCode(31),a.BYTE_ORDER_MARK="\ufeff",a.BAD_DELIMITERS=["\r","\n",'"',a.BYTE_ORDER_MARK],a.WORKERS_SUPPORTED=!i&&!!e.Worker,a.NODE_STREAM_INPUT=1,a.LocalChunkSize=10485760,a.RemoteChunkSize=5242880,a.DefaultDelimiter=",",a.Parser=g,a.ParserHandle=p,a.NetworkStreamer=h,a.FileStreamer=c,a.StringStreamer=d,a.ReadableStreamStreamer=u,e.jQuery){var o=e.jQuery;o.fn.parse=function(t){var i=t.config||{},n=[];return this.each((function(t){if("INPUT"!==o(this).prop("tagName").toUpperCase()||"file"!==o(this).attr("type").toLowerCase()||!e.FileReader||!this.files||0===this.files.length)return!0;for(var s=0;s<this.files.length;s++)n.push({file:this.files[s],inputElem:this,instanceConfig:o.extend({},i)})})),s(),this;function s(){if(0!==n.length){var e,i,s,l,h=n[0];if(A(t.before)){var c=t.before(h.file,h.inputElem);if("object"==typeof c){if("abort"===c.action)return e="AbortError",i=h.file,s=h.inputElem,l=c.reason,void(A(t.error)&&t.error({name:e},i,s,l));if("skip"===c.action)return void r();"object"==typeof c.config&&(h.instanceConfig=o.extend(h.instanceConfig,c.config))}else if("skip"===c)return void r()}var d=h.instanceConfig.complete;h.instanceConfig.complete=function(t){A(d)&&d(t,h.file,h.inputElem),r()},a.parse(h.file,h.instanceConfig)}else A(t.complete)&&t.complete()}function r(){n.splice(0,1),s()}}}function l(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var e=y(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null),this._handle=new p(e),(this._handle.streamer=this)._config=e}.call(this,t),this.parseChunk=function(t,i){if(this.isFirstChunk&&A(this._config.beforeFirstChunk)){var s=this._config.beforeFirstChunk(t);void 0!==s&&(t=s)}this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+t;this._partialLine="";var o=this._handle.parse(r,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var l=o.meta.cursor;this._finished||(this._partialLine=r.substring(l-this._baseIndex),this._baseIndex=l),o&&o.data&&(this._rowCount+=o.data.length);var h=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(n)e.postMessage({results:o,workerId:a.WORKER_ID,finished:h});else if(A(this._config.chunk)&&!i){if(this._config.chunk(o,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);o=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(o.data),this._completeResults.errors=this._completeResults.errors.concat(o.errors),this._completeResults.meta=o.meta),this._completed||!h||!A(this._config.complete)||o&&o.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),h||o&&o.meta.paused||this._nextChunk(),o}this._halted=!0},this._sendError=function(t){A(this._config.error)?this._config.error(t):n&&this._config.error&&e.postMessage({workerId:a.WORKER_ID,error:t,finished:!1})}}function h(t){var e;(t=t||{}).chunkSize||(t.chunkSize=a.RemoteChunkSize),l.call(this,t),this._nextChunk=i?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(t){this._input=t,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),i||(e.onload=w(this._chunkLoaded,this),e.onerror=w(this._chunkError,this)),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!i),this._config.downloadRequestHeaders){var t=this._config.downloadRequestHeaders;for(var n in t)e.setRequestHeader(n,t[n])}if(this._config.chunkSize){var s=this._start+this._config.chunkSize-1;e.setRequestHeader("Range","bytes="+this._start+"-"+s)}try{e.send(this._config.downloadRequestBody)}catch(t){this._chunkError(t.message)}i&&0===e.status&&this._chunkError()}},this._chunkLoaded=function(){var t;4===e.readyState&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:e.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null===(t=e.getResponseHeader("Content-Range"))?-1:parseInt(t.substring(t.lastIndexOf("/")+1))),this.parseChunk(e.responseText)))},this._chunkError=function(t){var i=e.statusText||t;this._sendError(new Error(i))}}function c(t){var e,i;(t=t||{}).chunkSize||(t.chunkSize=a.LocalChunkSize),l.call(this,t);var n=typeof FileReader<"u";this.stream=function(t){this._input=t,i=t.slice||t.webkitSlice||t.mozSlice,n?((e=new FileReader).onload=w(this._chunkLoaded,this),e.onerror=w(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var t=this._input;if(this._config.chunkSize){var s=Math.min(this._start+this._config.chunkSize,this._input.size);t=i.call(t,this._start,s)}var r=e.readAsText(t,this._config.encoding);n||this._chunkLoaded({target:{result:r}})},this._chunkLoaded=function(t){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(t.target.result)},this._chunkError=function(){this._sendError(e.error)}}function d(t){var e;l.call(this,t=t||{}),this.stream=function(t){return e=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t,i=this._config.chunkSize;return i?(t=e.substring(0,i),e=e.substring(i)):(t=e,e=""),this._finished=!e,this.parseChunk(t)}}}function u(t){l.call(this,t=t||{});var e=[],i=!0,n=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(t){this._input=t,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){n&&1===e.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):i=!0},this._streamData=w((function(t){try{e.push("string"==typeof t?t:t.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(t){this._streamError(t)}}),this),this._streamError=w((function(t){this._streamCleanUp(),this._sendError(t)}),this),this._streamEnd=w((function(){this._streamCleanUp(),n=!0,this._streamData("")}),this),this._streamCleanUp=w((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function p(t){var e,i,n,s=Math.pow(2,53),r=-s,o=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,l=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,h=this,c=0,d=0,u=!1,p=!1,m=[],v={data:[],errors:[],meta:{}};if(A(t.step)){var b=t.step;t.step=function(e){if(v=e,x())_();else{if(_(),0===v.data.length)return;c+=e.data.length,t.preview&&c>t.preview?i.abort():(v.data=v.data[0],b(v,h))}}}function w(e){return"greedy"===t.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function _(){return v&&n&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+a.DefaultDelimiter+"'"),n=!1),t.skipEmptyLines&&(v.data=v.data.filter((function(t){return!w(t)}))),x()&&function(){if(v)if(Array.isArray(v.data[0])){for(var e=0;x()&&e<v.data.length;e++)v.data[e].forEach(i);v.data.splice(0,1)}else v.data.forEach(i);function i(e,i){A(t.transformHeader)&&(e=t.transformHeader(e,i)),m.push(e)}}(),function(){if(!v||!t.header&&!t.dynamicTyping&&!t.transform)return v;function e(e,i){var n,s=t.header?{}:[];for(n=0;n<e.length;n++){var r=n,a=e[n];t.header&&(r=n>=m.length?"__parsed_extra":m[n]),t.transform&&(a=t.transform(a,r)),a=S(r,a),"__parsed_extra"===r?(s[r]=s[r]||[],s[r].push(a)):s[r]=a}return t.header&&(n>m.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+m.length+" fields but parsed "+n,d+i):n<m.length&&k("FieldMismatch","TooFewFields","Too few fields: expected "+m.length+" fields but parsed "+n,d+i)),s}var i=1;return!v.data.length||Array.isArray(v.data[0])?(v.data=v.data.map(e),i=v.data.length):v.data=e(v.data,0),t.header&&v.meta&&(v.meta.fields=m),d+=i,v}()}function x(){return t.header&&0===m.length}function S(e,i){return n=e,t.dynamicTypingFunction&&void 0===t.dynamicTyping[n]&&(t.dynamicTyping[n]=t.dynamicTypingFunction(n)),!0===(t.dynamicTyping[n]||t.dynamicTyping)?"true"===i||"TRUE"===i||"false"!==i&&"FALSE"!==i&&(function(t){if(o.test(t)){var e=parseFloat(t);if(r<e&&e<s)return!0}return!1}(i)?parseFloat(i):l.test(i)?new Date(i):""===i?null:i):i;var n}function k(t,e,i,n){var s={type:t,code:e,message:i};void 0!==n&&(s.row=n),v.errors.push(s)}this.parse=function(s,r,o){var l=t.quoteChar||'"';if(t.newline||(t.newline=function(t,e){t=t.substring(0,1048576);var i=new RegExp(f(e)+"([^]*?)"+f(e),"gm"),n=(t=t.replace(i,"")).split("\r"),s=t.split("\n"),r=1<s.length&&s[0].length<n[0].length;if(1===n.length||r)return"\n";for(var a=0,o=0;o<n.length;o++)"\n"===n[o][0]&&a++;return a>=n.length/2?"\r\n":"\r"}(s,l)),n=!1,t.delimiter)A(t.delimiter)&&(t.delimiter=t.delimiter(s),v.meta.delimiter=t.delimiter);else{var h=function(e,i,n,s,r){var o,l,h,c;r=r||[",","\t","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var d=0;d<r.length;d++){var u=r[d],p=0,f=0,m=0;h=void 0;for(var v=new g({comments:s,delimiter:u,newline:i,preview:10}).parse(e),b=0;b<v.data.length;b++)if(n&&w(v.data[b]))m++;else{var y=v.data[b].length;f+=y,void 0!==h?0<y&&(p+=Math.abs(y-h),h=y):h=y}0<v.data.length&&(f/=v.data.length-m),(void 0===l||p<=l)&&(void 0===c||c<f)&&1.99<f&&(l=p,o=u,c=f)}return{successful:!!(t.delimiter=o),bestDelimiter:o}}(s,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);h.successful?t.delimiter=h.bestDelimiter:(n=!0,t.delimiter=a.DefaultDelimiter),v.meta.delimiter=t.delimiter}var c=y(t);return t.preview&&t.header&&c.preview++,e=s,i=new g(c),v=i.parse(e,r,o),_(),u?{meta:{paused:!0}}:v||{meta:{paused:!1}}},this.paused=function(){return u},this.pause=function(){u=!0,i.abort(),e=A(t.chunk)?"":e.substring(i.getCharIndex())},this.resume=function(){h.streamer._halted?(u=!1,h.streamer.parseChunk(e,!0)):setTimeout(h.resume,3)},this.aborted=function(){return p},this.abort=function(){p=!0,i.abort(),v.meta.aborted=!0,A(t.complete)&&t.complete(v),e=""}}function f(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(t){var e,i=(t=t||{}).delimiter,n=t.newline,s=t.comments,r=t.step,o=t.preview,l=t.fastMode,h=e=void 0===t.quoteChar||null===t.quoteChar?'"':t.quoteChar;if(void 0!==t.escapeChar&&(h=t.escapeChar),("string"!=typeof i||-1<a.BAD_DELIMITERS.indexOf(i))&&(i=","),s===i)throw new Error("Comment character same as delimiter");!0===s?s="#":("string"!=typeof s||-1<a.BAD_DELIMITERS.indexOf(s))&&(s=!1),"\n"!==n&&"\r"!==n&&"\r\n"!==n&&(n="\n");var c=0,d=!1;this.parse=function(a,u,p){if("string"!=typeof a)throw new Error("Input must be a string");var g=a.length,m=i.length,v=n.length,b=s.length,y=A(r),w=[],_=[],x=[],S=c=0;if(!a)return G();if(t.header&&!u){var k=a.split(n)[0].split(i),E=[],C={},M=!1;for(var P in k){var R=k[P];A(t.transformHeader)&&(R=t.transformHeader(R,P));var T=R,L=C[R]||0;for(0<L&&(M=!0,T=R+"_"+L),C[R]=L+1;E.includes(T);)T=T+"_"+L;E.push(T)}if(M){var I=a.split(n);I[0]=E.join(i),a=I.join(n)}}if(l||!1!==l&&-1===a.indexOf(e)){for(var D=a.split(n),F=0;F<D.length;F++){if(x=D[F],c+=x.length,F!==D.length-1)c+=n.length;else if(p)return G();if(!s||x.substring(0,b)!==s){if(y){if(w=[],z(x.split(i)),q(),d)return G()}else z(x.split(i));if(o&&o<=F)return w=w.slice(0,o),G(!0)}}return G()}for(var N=a.indexOf(i,c),O=a.indexOf(n,c),W=new RegExp(f(h)+f(e),"g"),j=a.indexOf(e,c);;)if(a[c]!==e)if(s&&0===x.length&&a.substring(c,c+b)===s){if(-1===O)return G();c=O+v,O=a.indexOf(n,c),N=a.indexOf(i,c)}else if(-1!==N&&(N<O||-1===O))x.push(a.substring(c,N)),c=N+m,N=a.indexOf(i,c);else{if(-1===O)break;if(x.push(a.substring(c,O)),V(O+v),y&&(q(),d))return G();if(o&&w.length>=o)return G(!0)}else for(j=c,c++;;){if(-1===(j=a.indexOf(e,j+1)))return p||_.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:w.length,index:c}),U();if(j===g-1)return U(a.substring(c,j).replace(W,e));if(e!==h||a[j+1]!==h){if(e===h||0===j||a[j-1]!==h){-1!==N&&N<j+1&&(N=a.indexOf(i,j+1)),-1!==O&&O<j+1&&(O=a.indexOf(n,j+1));var B=$(-1===O?N:Math.min(N,O));if(a.substr(j+1+B,m)===i){x.push(a.substring(c,j).replace(W,e)),a[c=j+1+B+m]!==e&&(j=a.indexOf(e,c)),N=a.indexOf(i,c),O=a.indexOf(n,c);break}var H=$(O);if(a.substring(j+1+H,j+1+H+v)===n){if(x.push(a.substring(c,j).replace(W,e)),V(j+1+H+v),N=a.indexOf(i,c),j=a.indexOf(e,c),y&&(q(),d))return G();if(o&&w.length>=o)return G(!0);break}_.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:w.length,index:c}),j++}}else j++}return U();function z(t){w.push(t),S=c}function $(t){var e=0;if(-1!==t){var i=a.substring(j+1,t);i&&""===i.trim()&&(e=i.length)}return e}function U(t){return p||(void 0===t&&(t=a.substring(c)),x.push(t),c=g,z(x),y&&q()),G()}function V(t){c=t,z(x),x=[],O=a.indexOf(n,c)}function G(t){return{data:w,errors:_,meta:{delimiter:i,linebreak:n,aborted:d,truncated:!!t,cursor:S+(u||0)}}}function q(){r(G()),w=[],_=[]}},this.abort=function(){d=!0},this.getCharIndex=function(){return c}}function m(t){var e=t.data,i=s[e.workerId],n=!1;if(e.error)i.userError(e.error,e.file);else if(e.results&&e.results.data){var r={abort:function(){n=!0,v(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:b,resume:b};if(A(i.userStep)){for(var a=0;a<e.results.data.length&&(i.userStep({data:e.results.data[a],errors:e.results.errors,meta:e.results.meta},r),!n);a++);delete e.results}else A(i.userChunk)&&(i.userChunk(e.results,r,e.file),delete e.results)}e.finished&&!n&&v(e.workerId,e.results)}function v(t,e){var i=s[t];A(i.userComplete)&&i.userComplete(e),i.terminate(),delete s[t]}function b(){throw new Error("Not implemented.")}function y(t){if("object"!=typeof t||null===t)return t;var e=Array.isArray(t)?[]:{};for(var i in t)e[i]=y(t[i]);return e}function w(t,e){return function(){t.apply(e,arguments)}}function A(t){return"function"==typeof t}return n&&(e.onmessage=function(t){var i=t.data;if(void 0===a.WORKER_ID&&i&&(a.WORKER_ID=i.workerId),"string"==typeof i.input)e.postMessage({workerId:a.WORKER_ID,results:a.parse(i.input,i.config),finished:!0});else if(e.File&&i.input instanceof File||i.input instanceof Object){var n=a.parse(i.input,i.config);n&&e.postMessage({workerId:a.WORKER_ID,results:n,finished:!0})}}),(h.prototype=Object.create(l.prototype)).constructor=h,(c.prototype=Object.create(l.prototype)).constructor=c,(d.prototype=Object.create(d.prototype)).constructor=d,(u.prototype=Object.create(l.prototype)).constructor=u,a}()),jP=({mainState:{currentDocument:t,config:e}})=>{var i;const[n,s]=w([]);return v((()=>{var i;if(null!=t&&t.fileData){const n=WP.parse(t.fileData,{delimiter:(null==e?void 0:e.csvDelimiter)??","});(null==(i=n.errors)||!i.length)&&n.data&&s(n.data)}}),[t,null==e?void 0:e.csvDelimiter]),n.length?R.jsx(BP,{children:R.jsxs(HP,{children:[R.jsx("thead",{children:R.jsx("tr",{children:null==(i=n[0])?void 0:i.map((t=>R.jsx("th",{children:t},t)))})}),R.jsx("tbody",{children:n.slice(1,n.length).map((t=>R.jsx("tr",{children:t.map((t=>R.jsx("td",{children:t},t)))},t.join(""))))})]})}):null};jP.fileTypes=["csv","text/csv"],jP.weight=0,jP.fileLoader=pl;const BP=so.div`
|
|
285
285
|
width: 100%;
|
|
286
|
-
`,
|
|
286
|
+
`,HP=so.table`
|
|
287
287
|
width: 100%;
|
|
288
288
|
text-align: left;
|
|
289
289
|
|
|
@@ -295,17 +295,17 @@ License: MIT
|
|
|
295
295
|
display: none;
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
|
-
`,
|
|
298
|
+
`,zP=t=>R.jsx(kl,{...t});zP.fileTypes=["gif","image/gif"],zP.weight=0;const $P=({mainState:{currentDocument:t}})=>t?R.jsx(UP,{id:"video-renderer",children:R.jsx(VP,{controls:!0,src:t.uri})}):null;$P.fileTypes=["video/mp4","video/quicktime","video/x-msvideo"],$P.weight=0;const UP=so.div`
|
|
299
299
|
width: 100%;
|
|
300
|
-
`,
|
|
300
|
+
`,VP=so.video`
|
|
301
301
|
width: 100%;
|
|
302
302
|
height: 100%;
|
|
303
303
|
border: 0;
|
|
304
|
-
`,
|
|
304
|
+
`,GP=t=>R.jsx(kl,{...t});GP.fileTypes=["webp","image/webp"],GP.weight=0;const qP=[Ml,Pl,Ll,Il,vP,wP,IP,FP,jP,zP,$P,GP],XP=_(g(((t,e)=>{const{documents:i,theme:n}=t;if(!i)throw new Error("Please provide an array of documents to DocViewer!");return R.jsx(So,{ref:e,pluginRenderers:qP,...t,children:R.jsx(Ya,{theme:n?{...Sl,...n}:Sl,children:R.jsxs(YP,{id:"react-doc-viewer","data-testid":"react-doc-viewer",className:t.className,style:t.style,children:[R.jsx(ll,{}),R.jsx(yl,{})]})})})}))),YP=so.div`
|
|
305
305
|
display: flex;
|
|
306
306
|
flex-direction: column;
|
|
307
307
|
background: #ffffff;
|
|
308
308
|
width: 100%;
|
|
309
309
|
height: 100%;
|
|
310
|
-
`;export{Ml as BMPRenderer,
|
|
310
|
+
`;export{Ml as BMPRenderer,jP as CSVRenderer,qP as DocViewerRenderers,zP as GIFRenderer,Pl as HTMLRenderer,Ll as JPGRenderer,Il as MSDocRenderer,vP as PDFRenderer,wP as PNGRenderer,IP as TIFFRenderer,FP as TXTRenderer,$P as VideoRenderer,GP as WebPRenderer,dl as arrayBufferFileLoader,fl as binaryStringFileLoader,ul as dataURLFileLoader,XP as default,gl as defaultFileLoader,oo as supportedLanguages,pl as textFileLoader};
|
|
311
311
|
//# sourceMappingURL=asmaDocViewer.es.js.map
|