@kne-components/system-layout 0.2.0-alpha.2 → 0.2.0-alpha.6
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/build/asset-manifest.json +14 -14
- package/build/index.html +1 -1
- package/build/remoteEntry.js +1 -1
- package/build/remoteEntry.js.map +1 -1
- package/build/static/css/900.e49cd6bb.chunk.css +12 -0
- package/build/static/css/900.e49cd6bb.chunk.css.map +1 -0
- package/build/static/js/{451.8f075edd.chunk.js → 451.2636016f.chunk.js} +2 -2
- package/build/static/js/451.2636016f.chunk.js.map +1 -0
- package/build/static/js/{720.4a4cf04e.chunk.js → 720.bb44ea79.chunk.js} +3 -3
- package/build/static/js/{720.4a4cf04e.chunk.js.map → 720.bb44ea79.chunk.js.map} +1 -1
- package/build/static/js/{184.33759b8d.chunk.js → 803.59e2de29.chunk.js} +2 -2
- package/build/static/js/{184.33759b8d.chunk.js.map → 803.59e2de29.chunk.js.map} +1 -1
- package/build/static/js/948.9acbfde5.chunk.js +2 -0
- package/build/static/js/948.9acbfde5.chunk.js.map +1 -0
- package/build/static/js/{main.41bedc2e.js → main.c47c13c1.js} +2 -2
- package/build/static/js/{main.41bedc2e.js.map → main.c47c13c1.js.map} +1 -1
- package/package.json +1 -1
- package/build/static/css/900.c3e038cc.chunk.css +0 -12
- package/build/static/css/900.c3e038cc.chunk.css.map +0 -1
- package/build/static/js/451.8f075edd.chunk.js.map +0 -1
- package/build/static/js/948.ba5ce9a9.chunk.js +0 -2
- package/build/static/js/948.ba5ce9a9.chunk.js.map +0 -1
- /package/build/static/js/{720.4a4cf04e.chunk.js.LICENSE.txt → 720.bb44ea79.chunk.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(self.webpackChunk_kne_components_system_layout=self.webpackChunk_kne_components_system_layout||[]).push([[184],{1251(){},2899(t,e,i){var n=i(64579),s=i(2316),r=i(90931),a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(s(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=s(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var i=o.test(t);return i||l.test(t)?c(t.slice(2),i?2:8):a.test(t)?NaN:+t}},4167(t,e,i){"use strict";var n=i(52272);function s(){}function r(){}r.resetWarningCache=s,t.exports=function(){function t(t,e,i,s,r,a){if(a!==n){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function e(){return t}t.isRequired=t;var i={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:r,resetWarningCache:s};return i.PropTypes=i,i}},15747(t,e,i){var n;"undefined"!=typeof self&&self,t.exports=(n=i(94922),function(){"use strict";var t={155:function(t){t.exports=n}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,i),r.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};i.r(s),i.d(s,{useReactToPrint:function(){return f}});var r=i(155);const a="printWindow";function o(t){let{level:e="error",messages:i,suppressErrors:n=!1}=t;n||("error"===e?console.error(i):"warning"===e?console.warn(i):console.debug(i))}function l(t,e){if(e||!t){const t=document.getElementById(a);t&&document.body.removeChild(t)}}function c(t){return t instanceof Error?t:new Error("Unknown Error")}function h(t,e){const{documentTitle:i,onAfterPrint:n,onPrintError:s,preserveAfterPrint:r,print:a,suppressErrors:h}=e;setTimeout(()=>{var e,d;if(t.contentWindow){function u(){null==n||n(),l(r)}if(t.contentWindow.focus(),a)a(t).then(u).catch(t=>{s?s("print",c(t)):o({messages:["An error was thrown by the specified `print` function"],suppressErrors:h})});else{if(t.contentWindow.print){const p=null!==(d=null===(e=t.contentDocument)||void 0===e?void 0:e.title)&&void 0!==d?d:"",g=t.ownerDocument.title;i&&(t.ownerDocument.title=i,t.contentDocument&&(t.contentDocument.title=i)),t.contentWindow.print(),i&&(t.ownerDocument.title=g,t.contentDocument&&(t.contentDocument.title=p))}else o({messages:["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."],suppressErrors:h});[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(t=>{var e,i;return(null!==(i=null!==(e=navigator.userAgent)&&void 0!==e?e:navigator.vendor)&&void 0!==i?i:"opera"in window&&window.opera).match(t)})?setTimeout(u,500):u()}}else o({messages:["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/MatthewHerbst/react-to-print/issues/"],suppressErrors:h})},500)}function d(t){const e=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null);let n=i.nextNode();for(;n;)e.push(n),n=i.nextNode();return e}function u(t,e,i){const n=d(t),s=d(e);if(n.length===s.length)for(let r=0;r<n.length;r++){const t=n[r],e=s[r],a=t.shadowRoot;if(null!==a){const t=e.attachShadow({mode:a.mode});t.innerHTML=a.innerHTML,u(a,t,i)}}else o({messages:["When cloning shadow root content, source and target elements have different size. `onBeforePrint` likely resolved too early.",t,e],suppressErrors:i})}const p='\n @page {\n /* Remove browser default header (title) and footer (url) */\n margin: 0;\n }\n @media print {\n body {\n /* Tell browsers to print background colors */\n color-adjust: exact; /* Firefox. This is an older version of "print-color-adjust" */\n print-color-adjust: exact; /* Firefox/Safari */\n -webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */\n }\n }\n';function g(t,e,i,n){var s,r,a,l,d;const{contentNode:g,clonedContentNode:f,clonedImgNodes:m,clonedVideoNodes:v,numResourcesToLoad:w,originalCanvasNodes:b}=i,{bodyClass:y,fonts:A,ignoreGlobalStyles:E,pageStyle:x,nonce:_,suppressErrors:k,copyShadowRoots:C}=n;t.onload=null;const S=null!==(s=t.contentDocument)&&void 0!==s?s:null===(r=t.contentWindow)||void 0===r?void 0:r.document;if(S){const i=S.body.appendChild(f);C&&u(g,i,!!k),A&&((null===(a=t.contentDocument)||void 0===a?void 0:a.fonts)&&(null===(l=t.contentWindow)||void 0===l?void 0:l.FontFace)?A.forEach(i=>{const n=new FontFace(i.family,i.source,{weight:i.weight,style:i.style});t.contentDocument.fonts.add(n),n.loaded.then(()=>{e(n)}).catch(t=>{e(n,["Failed loading the font:",n,"Load error:",c(t)])})}):(A.forEach(t=>{e(t)}),o({messages:['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'],suppressErrors:k})));const n=null!=x?x:p,s=S.createElement("style");_&&(s.setAttribute("nonce",_),S.head.setAttribute("nonce",_)),s.appendChild(S.createTextNode(n)),S.head.appendChild(s),y&&S.body.classList.add(...y.split(" "));const r=S.querySelectorAll("canvas");for(let t=0;t<b.length;++t){const e=b[t],i=r[t];if(void 0===i){o({messages:["A canvas element could not be copied for printing, has it loaded? `onBeforePrint` likely resolved too early.",e],suppressErrors:k});continue}const n=i.getContext("2d");n&&n.drawImage(e,0,0)}for(let t=0;t<m.length;t++){const i=m[t],n=i.getAttribute("src");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,n,s,r,a)=>{e(i,["Error loading <img>",i,"Error",a])},t.src=n}else e(i,['Found an <img> tag with an empty "src" attribute. This prevents pre-loading it.',i])}for(let t=0;t<v.length;t++){const i=v[t];i.preload="auto";const n=i.getAttribute("poster");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,s,r,a,o)=>{e(i,["Error loading video poster",n,"for video",i,"Error:",o])},t.src=n}else i.readyState>=2?e(i):i.src?(i.onloadeddata=()=>{e(i)},i.onerror=(t,n,s,r,a)=>{e(i,["Error loading video",i,"Error",a])},i.onstalled=()=>{e(i,["Loading video stalled, skipping",i])}):e(i,["Error loading video, `src` is empty",i])}const h="select",w=g.querySelectorAll(h),M=S.querySelectorAll(h);for(let t=0;t<w.length;t++)M[t].value=w[t].value;if(!E){const i=document.querySelectorAll("style, link[rel~='stylesheet'], link[as='style']");for(let n=0,s=i.length;n<s;++n){const s=i[n];if("style"===s.tagName.toLowerCase()){const e=S.createElement(s.tagName),i=s.sheet;if(i){let r="";try{const t=i.cssRules.length;for(let e=0;e<t;++e)"string"==typeof i.cssRules[e].cssText&&(r+="".concat(i.cssRules[e].cssText,"\r\n"))}catch(t){o({messages:["A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/MatthewHerbst/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.",s,"Original error: ".concat(c(t).message)],level:"warning"})}e.setAttribute("id","react-to-print-".concat(n)),_&&e.setAttribute("nonce",_),e.appendChild(S.createTextNode(r)),S.head.appendChild(e)}}else if(s.getAttribute("href"))if(s.hasAttribute("disabled"))o({messages:["`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:",s],level:"warning"}),e(s);else{const t=S.createElement(s.tagName);for(let e=0,i=s.attributes.length;e<i;++e){const i=s.attributes[e];i&&t.setAttribute(i.nodeName,null!==(d=i.nodeValue)&&void 0!==d?d:"")}t.onload=()=>{e(t)},t.onerror=(i,n,s,r,a)=>{e(t,["Failed to load",t,"Error:",a])},_&&t.setAttribute("nonce",_),S.head.appendChild(t)}else o({messages:["`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:",s],level:"warning"}),e(s)}}}0===w&&h(t,n)}function f(t){let{bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:f,onBeforePrint:m,onPrintError:v,pageStyle:w,preserveAfterPrint:b,print:y,printIframeProps:A,suppressErrors:E}=t;const x=(0,r.useCallback)(t=>{function r(){const r={bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:f,onBeforePrint:m,onPrintError:v,pageStyle:w,preserveAfterPrint:b,print:y,printIframeProps:A,suppressErrors:E},l=function(t){const e=document.createElement("iframe");return e.width="".concat(document.documentElement.clientWidth,"px"),e.height="".concat(document.documentElement.clientHeight,"px"),e.style.position="absolute",e.style.top="-".concat(document.documentElement.clientHeight+100,"px"),e.style.left="-".concat(document.documentElement.clientWidth+100,"px"),e.id=a,e.srcdoc="<!DOCTYPE html>",t&&(t.allow&&(e.allow=t.allow),void 0!==t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),void 0!==t.sandbox&&(e.sandbox=t.sandbox)),e}(A),c=function(t,e){const{contentRef:i,fonts:n,ignoreGlobalStyles:s,suppressErrors:r}=e,a=function(t){let{contentRef:e,optionalContent:i,suppressErrors:n}=t;return i&&"function"==typeof i?(e&&o({level:"warning",messages:['"react-to-print" received a `contentRef` option and an optional-content param passed to its callback. The `contentRef` option will be ignored.']}),i()):e?e.current:void o({messages:['"react-to-print" did not receive a `contentRef` option or a optional-content param pass to its callback.'],suppressErrors:n})}({contentRef:i,optionalContent:t,suppressErrors:r});if(!a)return;const l=a.cloneNode(!0),c=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),h=l.querySelectorAll("img"),d=l.querySelectorAll("video"),u=n?n.length:0;return{contentNode:a,clonedContentNode:l,clonedImgNodes:h,clonedVideoNodes:d,numResourcesToLoad:(s?0:c.length)+h.length+d.length+u,originalCanvasNodes:a.querySelectorAll("canvas")}}(t,r);if(!c)return void o({messages:["There is nothing to print"],suppressErrors:E});const x=function(t,e,i){const{suppressErrors:n}=t,s=[],r=[];return function(a,l){s.includes(a)?o({level:"debug",messages:["Tried to mark a resource that has already been handled",a],suppressErrors:n}):(l?(o({messages:['"react-to-print" was unable to load a resource but will continue attempting to print the page',...l],suppressErrors:n}),r.push(a)):s.push(a),s.length+r.length===e&&h(i,t))}}(r,c.numResourcesToLoad,l);!function(t,e,i,n){t.onload=()=>{g(t,e,i,n)},document.body.appendChild(t)}(l,x,c,r)}l(b,!0),m?m().then(()=>{r()}).catch(t=>{null==v||v("onBeforePrint",c(t))}):r()},[e,i,n,s,d,u,p,f,m,v,w,b,y,E]);return x}return s}())},19495(t,e,i){"use strict";function n(t){var e,i,n,r=2;for("undefined"!=typeof Symbol&&(i=Symbol.asyncIterator,n=Symbol.iterator);r--;){if(i&&null!=(e=t[i]))return e.call(t);if(n&&null!=(e=t[n]))return new s(e.call(t));i="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function s(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then(function(t){return{value:t,done:e}})}return s=function(t){this.s=t,this.n=t.next},s.prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var i=this.s.return;return void 0===i?Promise.resolve({value:t,done:!0}):e(i.apply(this.s,arguments))},throw:function(t){var i=this.s.return;return void 0===i?Promise.reject(t):e(i.apply(this.s,arguments))}},new s(t)}i.d(e,{A:()=>n})},20046(t,e,i){"use strict";i.d(e,{A:()=>tt});var n=i(94922);const s=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const r="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;var a="object"==typeof self&&self&&self.Object===Object&&self;const o=r||a||Function("return this")();const l=function(){return o.Date.now()};var c=/\s/;const h=function(t){for(var e=t.length;e--&&c.test(t.charAt(e)););return e};var d=/^\s+/;const u=function(t){return t?t.slice(0,h(t)+1).replace(d,""):t};const p=o.Symbol;var g=Object.prototype,f=g.hasOwnProperty,m=g.toString,v=p?p.toStringTag:void 0;const w=function(t){var e=f.call(t,v),i=t[v];try{t[v]=void 0;var n=!0}catch(r){}var s=m.call(t);return n&&(e?t[v]=i:delete t[v]),s};var b=Object.prototype.toString;const y=function(t){return b.call(t)};var A=p?p.toStringTag:void 0;const E=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":A&&A in Object(t)?w(t):y(t)};const x=function(t){return null!=t&&"object"==typeof t};const _=function(t){return"symbol"==typeof t||x(t)&&"[object Symbol]"==E(t)};var k=/^[-+]0x[0-9a-f]+$/i,C=/^0b[01]+$/i,S=/^0o[0-7]+$/i,M=parseInt;const T=function(t){if("number"==typeof t)return t;if(_(t))return NaN;if(s(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=s(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=u(t);var i=C.test(t);return i||S.test(t)?M(t.slice(2),i?2:8):k.test(t)?NaN:+t};var P=Math.max,L=Math.min;const R=function(t,e,i){var n,r,a,o,c,h,d=0,u=!1,p=!1,g=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var i=n,s=r;return n=r=void 0,d=e,o=t.apply(s,i)}function m(t){var i=t-h;return void 0===h||i>=e||i<0||p&&t-d>=a}function v(){var t=l();if(m(t))return w(t);c=setTimeout(v,function(t){var i=e-(t-h);return p?L(i,a-(t-d)):i}(t))}function w(t){return c=void 0,g&&n?f(t):(n=r=void 0,o)}function b(){var t=l(),i=m(t);if(n=arguments,r=this,h=t,i){if(void 0===c)return function(t){return d=t,c=setTimeout(v,e),u?f(t):o}(h);if(p)return clearTimeout(c),c=setTimeout(v,e),f(h)}return void 0===c&&(c=setTimeout(v,e)),o}return e=T(e)||0,s(i)&&(u=!!i.leading,a=(p="maxWait"in i)?P(T(i.maxWait)||0,e):a,g="trailing"in i?!!i.trailing:g),b.cancel=function(){void 0!==c&&clearTimeout(c),d=0,n=h=r=c=void 0},b.flush=function(){return void 0===c?o:w(l())},b};const D=function(t,e,i){var n=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return s(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),R(t,e,{leading:n,maxWait:e,trailing:r})};var F=function(){return F=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},F.apply(this,arguments)};function I(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView:window}function N(t){return t&&t.ownerDocument?t.ownerDocument:document}var O=function(t){return Array.prototype.reduce.call(t,function(t,e){var i=e.name.match(/data-simplebar-(.+)/);if(i){var n=i[1].replace(/\W+(.)/g,function(t,e){return e.toUpperCase()});switch(e.value){case"true":t[n]=!0;break;case"false":t[n]=!1;break;case void 0:t[n]=!0;break;default:t[n]=e.value}}return t},{})};function B(t,e){var i;t&&(i=t.classList).add.apply(i,e.split(" "))}function W(t,e){t&&e.split(" ").forEach(function(e){t.classList.remove(e)})}function z(t){return".".concat(t.split(" ").join("."))}var j=!("undefined"===typeof window||!window.document||!window.document.createElement),H=Object.freeze({__proto__:null,addClasses:B,canUseDOM:j,classNamesToQuery:z,getElementDocument:N,getElementWindow:I,getOptions:O,removeClasses:W}),U=null,V=null;function G(){if(null===U){if("undefined"===typeof document)return U=0;var t=document.body,e=document.createElement("div");e.classList.add("simplebar-hide-scrollbar"),t.appendChild(e);var i=e.getBoundingClientRect().right;t.removeChild(e),U=i}return U}j&&window.addEventListener("resize",function(){V!==window.devicePixelRatio&&(V=window.devicePixelRatio,U=null)});var q=I,X=N,Y=O,K=B,Q=W,Z=z,J=function(){function t(e,i){void 0===i&&(i={});var n=this;if(this.removePreventClickId=null,this.minScrollbarWidth=20,this.stopScrollDelay=175,this.isScrolling=!1,this.isMouseEntering=!1,this.isDragging=!1,this.scrollXTicking=!1,this.scrollYTicking=!1,this.wrapperEl=null,this.contentWrapperEl=null,this.contentEl=null,this.offsetEl=null,this.maskEl=null,this.placeholderEl=null,this.heightAutoObserverWrapperEl=null,this.heightAutoObserverEl=null,this.rtlHelpers=null,this.scrollbarWidth=0,this.resizeObserver=null,this.mutationObserver=null,this.elStyles=null,this.isRtl=null,this.mouseX=0,this.mouseY=0,this.onMouseMove=function(){},this.onWindowResize=function(){},this.onStopScrolling=function(){},this.onMouseEntered=function(){},this.onScroll=function(){var t=q(n.el);n.scrollXTicking||(t.requestAnimationFrame(n.scrollX),n.scrollXTicking=!0),n.scrollYTicking||(t.requestAnimationFrame(n.scrollY),n.scrollYTicking=!0),n.isScrolling||(n.isScrolling=!0,K(n.el,n.classNames.scrolling)),n.showScrollbar("x"),n.showScrollbar("y"),n.onStopScrolling()},this.scrollX=function(){n.axis.x.isOverflowing&&n.positionScrollbar("x"),n.scrollXTicking=!1},this.scrollY=function(){n.axis.y.isOverflowing&&n.positionScrollbar("y"),n.scrollYTicking=!1},this._onStopScrolling=function(){Q(n.el,n.classNames.scrolling),n.options.autoHide&&(n.hideScrollbar("x"),n.hideScrollbar("y")),n.isScrolling=!1},this.onMouseEnter=function(){n.isMouseEntering||(K(n.el,n.classNames.mouseEntered),n.showScrollbar("x"),n.showScrollbar("y"),n.isMouseEntering=!0),n.onMouseEntered()},this._onMouseEntered=function(){Q(n.el,n.classNames.mouseEntered),n.options.autoHide&&(n.hideScrollbar("x"),n.hideScrollbar("y")),n.isMouseEntering=!1},this._onMouseMove=function(t){n.mouseX=t.clientX,n.mouseY=t.clientY,(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&n.onMouseMoveForAxis("x"),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&n.onMouseMoveForAxis("y")},this.onMouseLeave=function(){n.onMouseMove.cancel(),(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&n.onMouseLeaveForAxis("x"),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&n.onMouseLeaveForAxis("y"),n.mouseX=-1,n.mouseY=-1},this._onWindowResize=function(){n.scrollbarWidth=n.getScrollbarWidth(),n.hideNativeScrollbar()},this.onPointerEvent=function(t){var e,i;n.axis.x.track.el&&n.axis.y.track.el&&n.axis.x.scrollbar.el&&n.axis.y.scrollbar.el&&(n.axis.x.track.rect=n.axis.x.track.el.getBoundingClientRect(),n.axis.y.track.rect=n.axis.y.track.el.getBoundingClientRect(),(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&(e=n.isWithinBounds(n.axis.x.track.rect)),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&(i=n.isWithinBounds(n.axis.y.track.rect)),(e||i)&&(t.stopPropagation(),"pointerdown"===t.type&&"touch"!==t.pointerType&&(e&&(n.axis.x.scrollbar.rect=n.axis.x.scrollbar.el.getBoundingClientRect(),n.isWithinBounds(n.axis.x.scrollbar.rect)?n.onDragStart(t,"x"):n.onTrackClick(t,"x")),i&&(n.axis.y.scrollbar.rect=n.axis.y.scrollbar.el.getBoundingClientRect(),n.isWithinBounds(n.axis.y.scrollbar.rect)?n.onDragStart(t,"y"):n.onTrackClick(t,"y")))))},this.drag=function(e){var i,s,r,a,o,l,c,h,d,u,p;if(n.draggedAxis&&n.contentWrapperEl){var g=n.axis[n.draggedAxis].track,f=null!==(s=null===(i=g.rect)||void 0===i?void 0:i[n.axis[n.draggedAxis].sizeAttr])&&void 0!==s?s:0,m=n.axis[n.draggedAxis].scrollbar,v=null!==(a=null===(r=n.contentWrapperEl)||void 0===r?void 0:r[n.axis[n.draggedAxis].scrollSizeAttr])&&void 0!==a?a:0,w=parseInt(null!==(l=null===(o=n.elStyles)||void 0===o?void 0:o[n.axis[n.draggedAxis].sizeAttr])&&void 0!==l?l:"0px",10);e.preventDefault(),e.stopPropagation();var b=("y"===n.draggedAxis?e.pageY:e.pageX)-(null!==(h=null===(c=g.rect)||void 0===c?void 0:c[n.axis[n.draggedAxis].offsetAttr])&&void 0!==h?h:0)-n.axis[n.draggedAxis].dragOffset,y=(b="x"===n.draggedAxis&&n.isRtl?(null!==(u=null===(d=g.rect)||void 0===d?void 0:d[n.axis[n.draggedAxis].sizeAttr])&&void 0!==u?u:0)-m.size-b:b)/(f-m.size)*(v-w);"x"===n.draggedAxis&&n.isRtl&&(y=(null===(p=t.getRtlHelpers())||void 0===p?void 0:p.isScrollingToNegative)?-y:y),n.contentWrapperEl[n.axis[n.draggedAxis].scrollOffsetAttr]=y}},this.onEndDrag=function(t){n.isDragging=!1;var e=X(n.el),i=q(n.el);t.preventDefault(),t.stopPropagation(),Q(n.el,n.classNames.dragging),n.onStopScrolling(),e.removeEventListener("mousemove",n.drag,!0),e.removeEventListener("mouseup",n.onEndDrag,!0),n.removePreventClickId=i.setTimeout(function(){e.removeEventListener("click",n.preventClick,!0),e.removeEventListener("dblclick",n.preventClick,!0),n.removePreventClickId=null})},this.preventClick=function(t){t.preventDefault(),t.stopPropagation()},this.el=e,this.options=F(F({},t.defaultOptions),i),this.classNames=F(F({},t.defaultOptions.classNames),i.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,forceVisible:!1,track:{size:null,el:null,rect:null,isVisible:!1},scrollbar:{size:null,el:null,rect:null,isVisible:!1}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,forceVisible:!1,track:{size:null,el:null,rect:null,isVisible:!1},scrollbar:{size:null,el:null,rect:null,isVisible:!1}}},"object"!==typeof this.el||!this.el.nodeName)throw new Error("Argument passed to SimpleBar must be an HTML element instead of ".concat(this.el));this.onMouseMove=D(this._onMouseMove,64),this.onWindowResize=R(this._onWindowResize,64,{leading:!0}),this.onStopScrolling=R(this._onStopScrolling,this.stopScrollDelay),this.onMouseEntered=R(this._onMouseEntered,this.stopScrollDelay),this.init()}return t.getRtlHelpers=function(){if(t.rtlHelpers)return t.rtlHelpers;var e=document.createElement("div");e.innerHTML='<div class="simplebar-dummy-scrollbar-size"><div></div></div>';var i=e.firstElementChild,n=null===i||void 0===i?void 0:i.firstElementChild;if(!n)return null;document.body.appendChild(i),i.scrollLeft=0;var s=t.getOffset(i),r=t.getOffset(n);i.scrollLeft=-999;var a=t.getOffset(n);return document.body.removeChild(i),t.rtlHelpers={isScrollOriginAtZero:s.left!==r.left,isScrollingToNegative:r.left!==a.left},t.rtlHelpers},t.prototype.getScrollbarWidth=function(){try{return this.contentWrapperEl&&"none"===getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:G()}catch(t){return G()}},t.getOffset=function(t){var e=t.getBoundingClientRect(),i=X(t),n=q(t);return{top:e.top+(n.pageYOffset||i.documentElement.scrollTop),left:e.left+(n.pageXOffset||i.documentElement.scrollLeft)}},t.prototype.init=function(){j&&(this.initDOM(),this.rtlHelpers=t.getRtlHelpers(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},t.prototype.initDOM=function(){var t,e;this.wrapperEl=this.el.querySelector(Z(this.classNames.wrapper)),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector(Z(this.classNames.contentWrapper)),this.contentEl=this.options.contentNode||this.el.querySelector(Z(this.classNames.contentEl)),this.offsetEl=this.el.querySelector(Z(this.classNames.offset)),this.maskEl=this.el.querySelector(Z(this.classNames.mask)),this.placeholderEl=this.findChild(this.wrapperEl,Z(this.classNames.placeholder)),this.heightAutoObserverWrapperEl=this.el.querySelector(Z(this.classNames.heightAutoObserverWrapperEl)),this.heightAutoObserverEl=this.el.querySelector(Z(this.classNames.heightAutoObserverEl)),this.axis.x.track.el=this.findChild(this.el,"".concat(Z(this.classNames.track)).concat(Z(this.classNames.horizontal))),this.axis.y.track.el=this.findChild(this.el,"".concat(Z(this.classNames.track)).concat(Z(this.classNames.vertical))),this.axis.x.scrollbar.el=(null===(t=this.axis.x.track.el)||void 0===t?void 0:t.querySelector(Z(this.classNames.scrollbar)))||null,this.axis.y.scrollbar.el=(null===(e=this.axis.y.track.el)||void 0===e?void 0:e.querySelector(Z(this.classNames.scrollbar)))||null,this.options.autoHide||(K(this.axis.x.scrollbar.el,this.classNames.visible),K(this.axis.y.scrollbar.el,this.classNames.visible))},t.prototype.initListeners=function(){var t,e=this,i=q(this.el);if(this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("pointerdown",this.onPointerEvent,!0),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),null===(t=this.contentWrapperEl)||void 0===t||t.addEventListener("scroll",this.onScroll),i.addEventListener("resize",this.onWindowResize),this.contentEl){if(window.ResizeObserver){var n=!1,s=i.ResizeObserver||ResizeObserver;this.resizeObserver=new s(function(){n&&i.requestAnimationFrame(function(){e.recalculate()})}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),i.requestAnimationFrame(function(){n=!0})}this.mutationObserver=new i.MutationObserver(function(){i.requestAnimationFrame(function(){e.recalculate()})}),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})}},t.prototype.recalculate=function(){if(this.heightAutoObserverEl&&this.contentEl&&this.contentWrapperEl&&this.wrapperEl&&this.placeholderEl){var t=q(this.el);this.elStyles=t.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction;var e=this.contentEl.offsetWidth,i=this.heightAutoObserverEl.offsetHeight<=1,n=this.heightAutoObserverEl.offsetWidth<=1||e>0,s=this.contentWrapperEl.offsetWidth,r=this.elStyles.overflowX,a=this.elStyles.overflowY;this.contentEl.style.padding="".concat(this.elStyles.paddingTop," ").concat(this.elStyles.paddingRight," ").concat(this.elStyles.paddingBottom," ").concat(this.elStyles.paddingLeft),this.wrapperEl.style.margin="-".concat(this.elStyles.paddingTop," -").concat(this.elStyles.paddingRight," -").concat(this.elStyles.paddingBottom," -").concat(this.elStyles.paddingLeft);var o=this.contentEl.scrollHeight,l=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=i?"auto":"100%",this.placeholderEl.style.width=n?"".concat(e||l,"px"):"auto",this.placeholderEl.style.height="".concat(o,"px");var c=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=0!==e&&l>e,this.axis.y.isOverflowing=o>c,this.axis.x.isOverflowing="hidden"!==r&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==a&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.hideNativeScrollbar();var h=this.axis.x.isOverflowing?this.scrollbarWidth:0,d=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&l>s-d,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&o>c-h,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el&&(this.axis.x.scrollbar.el.style.width="".concat(this.axis.x.scrollbar.size,"px")),this.axis.y.scrollbar.el&&(this.axis.y.scrollbar.el.style.height="".concat(this.axis.y.scrollbar.size,"px")),this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")}},t.prototype.getScrollbarSize=function(t){var e,i;if(void 0===t&&(t="y"),!this.axis[t].isOverflowing||!this.contentEl)return 0;var n,s=this.contentEl[this.axis[t].scrollSizeAttr],r=null!==(i=null===(e=this.axis[t].track.el)||void 0===e?void 0:e[this.axis[t].offsetSizeAttr])&&void 0!==i?i:0,a=r/s;return n=Math.max(~~(a*r),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(n=Math.min(n,this.options.scrollbarMaxSize)),n},t.prototype.positionScrollbar=function(e){var i,n,s;void 0===e&&(e="y");var r=this.axis[e].scrollbar;if(this.axis[e].isOverflowing&&this.contentWrapperEl&&r.el&&this.elStyles){var a=this.contentWrapperEl[this.axis[e].scrollSizeAttr],o=(null===(i=this.axis[e].track.el)||void 0===i?void 0:i[this.axis[e].offsetSizeAttr])||0,l=parseInt(this.elStyles[this.axis[e].sizeAttr],10),c=this.contentWrapperEl[this.axis[e].scrollOffsetAttr];c="x"===e&&this.isRtl&&(null===(n=t.getRtlHelpers())||void 0===n?void 0:n.isScrollOriginAtZero)?-c:c,"x"===e&&this.isRtl&&(c=(null===(s=t.getRtlHelpers())||void 0===s?void 0:s.isScrollingToNegative)?c:-c);var h=c/(a-l),d=~~((o-r.size)*h);d="x"===e&&this.isRtl?-d+(o-r.size):d,r.el.style.transform="x"===e?"translate3d(".concat(d,"px, 0, 0)"):"translate3d(0, ".concat(d,"px, 0)")}},t.prototype.toggleTrackVisibility=function(t){void 0===t&&(t="y");var e=this.axis[t].track.el,i=this.axis[t].scrollbar.el;e&&i&&this.contentWrapperEl&&(this.axis[t].isOverflowing||this.axis[t].forceVisible?(e.style.visibility="visible",this.contentWrapperEl.style[this.axis[t].overflowAttr]="scroll",this.el.classList.add("".concat(this.classNames.scrollable,"-").concat(t))):(e.style.visibility="hidden",this.contentWrapperEl.style[this.axis[t].overflowAttr]="hidden",this.el.classList.remove("".concat(this.classNames.scrollable,"-").concat(t))),this.axis[t].isOverflowing?i.style.display="block":i.style.display="none")},t.prototype.showScrollbar=function(t){void 0===t&&(t="y"),this.axis[t].isOverflowing&&!this.axis[t].scrollbar.isVisible&&(K(this.axis[t].scrollbar.el,this.classNames.visible),this.axis[t].scrollbar.isVisible=!0)},t.prototype.hideScrollbar=function(t){void 0===t&&(t="y"),this.isDragging||this.axis[t].isOverflowing&&this.axis[t].scrollbar.isVisible&&(Q(this.axis[t].scrollbar.el,this.classNames.visible),this.axis[t].scrollbar.isVisible=!1)},t.prototype.hideNativeScrollbar=function(){this.offsetEl&&(this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-".concat(this.scrollbarWidth,"px"):"0px",this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-".concat(this.scrollbarWidth,"px"):"0px")},t.prototype.onMouseMoveForAxis=function(t){void 0===t&&(t="y");var e=this.axis[t];e.track.el&&e.scrollbar.el&&(e.track.rect=e.track.el.getBoundingClientRect(),e.scrollbar.rect=e.scrollbar.el.getBoundingClientRect(),this.isWithinBounds(e.track.rect)?(this.showScrollbar(t),K(e.track.el,this.classNames.hover),this.isWithinBounds(e.scrollbar.rect)?K(e.scrollbar.el,this.classNames.hover):Q(e.scrollbar.el,this.classNames.hover)):(Q(e.track.el,this.classNames.hover),this.options.autoHide&&this.hideScrollbar(t)))},t.prototype.onMouseLeaveForAxis=function(t){void 0===t&&(t="y"),Q(this.axis[t].track.el,this.classNames.hover),Q(this.axis[t].scrollbar.el,this.classNames.hover),this.options.autoHide&&this.hideScrollbar(t)},t.prototype.onDragStart=function(t,e){var i;void 0===e&&(e="y"),this.isDragging=!0;var n=X(this.el),s=q(this.el),r=this.axis[e].scrollbar,a="y"===e?t.pageY:t.pageX;this.axis[e].dragOffset=a-((null===(i=r.rect)||void 0===i?void 0:i[this.axis[e].offsetAttr])||0),this.draggedAxis=e,K(this.el,this.classNames.dragging),n.addEventListener("mousemove",this.drag,!0),n.addEventListener("mouseup",this.onEndDrag,!0),null===this.removePreventClickId?(n.addEventListener("click",this.preventClick,!0),n.addEventListener("dblclick",this.preventClick,!0)):(s.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},t.prototype.onTrackClick=function(t,e){var i,n,s,r,a=this;void 0===e&&(e="y");var o=this.axis[e];if(this.options.clickOnTrack&&o.scrollbar.el&&this.contentWrapperEl){t.preventDefault();var l=q(this.el);this.axis[e].scrollbar.rect=o.scrollbar.el.getBoundingClientRect();var c=null!==(n=null===(i=this.axis[e].scrollbar.rect)||void 0===i?void 0:i[this.axis[e].offsetAttr])&&void 0!==n?n:0,h=parseInt(null!==(r=null===(s=this.elStyles)||void 0===s?void 0:s[this.axis[e].sizeAttr])&&void 0!==r?r:"0px",10),d=this.contentWrapperEl[this.axis[e].scrollOffsetAttr],u=("y"===e?this.mouseY-c:this.mouseX-c)<0?-1:1,p=-1===u?d-h:d+h,g=function(){a.contentWrapperEl&&(-1===u?d>p&&(d-=40,a.contentWrapperEl[a.axis[e].scrollOffsetAttr]=d,l.requestAnimationFrame(g)):d<p&&(d+=40,a.contentWrapperEl[a.axis[e].scrollOffsetAttr]=d,l.requestAnimationFrame(g)))};g()}},t.prototype.getContentElement=function(){return this.contentEl},t.prototype.getScrollElement=function(){return this.contentWrapperEl},t.prototype.removeListeners=function(){var t=q(this.el);this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("pointerdown",this.onPointerEvent,!0),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.onMouseMove.cancel(),this.onWindowResize.cancel(),this.onStopScrolling.cancel(),this.onMouseEntered.cancel()},t.prototype.unMount=function(){this.removeListeners()},t.prototype.isWithinBounds=function(t){return this.mouseX>=t.left&&this.mouseX<=t.left+t.width&&this.mouseY>=t.top&&this.mouseY<=t.top+t.height},t.prototype.findChild=function(t,e){var i=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector;return Array.prototype.filter.call(t.children,function(t){return i.call(t,e)})[0]},t.rtlHelpers=null,t.defaultOptions={forceVisible:!1,clickOnTrack:!0,scrollbarMinSize:25,scrollbarMaxSize:0,ariaLabel:"scrollable content",tabIndex:0,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging",scrolling:"simplebar-scrolling",scrollable:"simplebar-scrollable",mouseEntered:"simplebar-mouse-entered"},scrollableNode:null,contentNode:null,autoHide:!0},t.getOptions=Y,t.helpers=H,t}(),$=function(){return $=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},$.apply(this,arguments)};var tt=n.forwardRef(function(t,e){var i=t.children,s=t.scrollableNodeProps,r=void 0===s?{}:s,a=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}(t,["children","scrollableNodeProps"]),o=n.useRef(),l=n.useRef(),c=n.useRef(),h={},d={};Object.keys(a).forEach(function(t){Object.prototype.hasOwnProperty.call(J.defaultOptions,t)?h[t]=a[t]:d[t]=a[t]});var u=$($({},J.defaultOptions.classNames),h.classNames),p=$($({},r),{className:"".concat(u.contentWrapper).concat(r.className?" ".concat(r.className):""),tabIndex:h.tabIndex||J.defaultOptions.tabIndex,role:"region","aria-label":h.ariaLabel||J.defaultOptions.ariaLabel});return n.useEffect(function(){var t;return l.current=p.ref?p.ref.current:l.current,o.current&&(t=new J(o.current,$($($({},h),l.current&&{scrollableNode:l.current}),c.current&&{contentNode:c.current})),"function"===typeof e?e(t):e&&(e.current=t)),function(){null===t||void 0===t||t.unMount(),t=null,"function"===typeof e&&e(null)}},[]),n.createElement("div",$({"data-simplebar":"init",ref:o},d),n.createElement("div",{className:u.wrapper},n.createElement("div",{className:u.heightAutoObserverWrapperEl},n.createElement("div",{className:u.heightAutoObserverEl})),n.createElement("div",{className:u.mask},n.createElement("div",{className:u.offset},"function"===typeof i?i({scrollableNodeRef:l,scrollableNodeProps:$($({},p),{ref:l}),contentNodeRef:c,contentNodeProps:{className:u.contentEl,ref:c}}):n.createElement("div",$({},p),n.createElement("div",{className:u.contentEl},i)))),n.createElement("div",{className:u.placeholder})),n.createElement("div",{className:"".concat(u.track," ").concat(u.horizontal)},n.createElement("div",{className:u.scrollbar})),n.createElement("div",{className:"".concat(u.track," ").concat(u.vertical)},n.createElement("div",{className:u.scrollbar})))});tt.displayName="SimpleBar"},31035(t,e,i){t.exports=i(4167)()},32662(t,e,i){"use strict";i.d(e,{A:()=>n});const n={cache:async function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=n.getItem(t);return s||(s=await e(),n.setItem(t,s,i),s)},getItem:t=>{const e=window.localStorage.getItem(t);try{const{dataType:i,value:s,expire:r}=JSON.parse(e);if(r&&Date.now()>r)return n.removeItem(t),null;if("object"===i&&"null"===s)return null;if("undefined"===i)return;return"number"===i?Number(s):"boolean"===i?Boolean(s):s}catch(i){return null}},setItem:function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=typeof e;window.localStorage.setItem(t,JSON.stringify({dataType:n,value:e,expire:i}))},removeItem:t=>{window.localStorage.removeItem(t)}}},33756(t,e,i){"use strict";i.d(e,{_V:()=>NA});var n={};i.r(n),i.d(n,{dU:()=>vg,ng:()=>Jt,EA:()=>zc,Tm:()=>wd,D6:()=>Zh,YE:()=>hd});var s=i(94922),r=i.n(s),a=i(74946),o=i(16052),l=i.n(o),c=i(64755),h=i.n(c),d=i(28833),u=i(12791),p=i(68102);const g={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M820 436h-40c-4.4 0-8 3.6-8 8v40c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-40c0-4.4-3.6-8-8-8zm32-104H732V120c0-4.4-3.6-8-8-8H300c-4.4 0-8 3.6-8 8v212H172c-44.2 0-80 35.8-80 80v328c0 17.7 14.3 32 32 32h168v132c0 4.4 3.6 8 8 8h424c4.4 0 8-3.6 8-8V772h168c17.7 0 32-14.3 32-32V412c0-44.2-35.8-80-80-80zM360 180h304v152H360V180zm304 664H360V568h304v276zm200-140H732V500H292v204H160V412c0-6.6 5.4-12 12-12h680c6.6 0 12 5.4 12 12v292z"}}]},name:"printer",theme:"outlined"};var f=i(52199);const m=s.forwardRef(function(t,e){return s.createElement(f.A,(0,p.A)({},t,{ref:e,icon:g}))});var v=i(56859),w=i(15032),b=i(79111);const y={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"};const A=s.forwardRef(function(t,e){return s.createElement(f.A,(0,p.A)({},t,{ref:e,icon:y}))});var E,x=i(78678),_=i(10238),k=i.n(_),C=i(20274),S=0,M=!1,T=!1,P="[iFrameSizer]",L=null,R=window.requestAnimationFrame,D=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),F={},I=null,N=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){U("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function O(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function B(t,e,i){t.addEventListener(e,i,!1)}function W(t,e,i){t.removeEventListener(e,i,!1)}function z(t){return P+"["+function(t){var e="Host page: "+t;return window.top!==window.self&&(e=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+t:"Nested host page: "+t),e}(t)+"]"}function j(t){return F[t]?F[t].log:M}function H(t,e){V("log",t,e,j(t))}function U(t,e){V("warn",t,e,!0)}function V(t,e,i,n){!0===n&&"object"===typeof window.console&&console[t](z(e),i)}function G(t){function e(){s("Height"),s("Width"),tt(function(){$(p),Q(g),d("onResized",p)},p,"init")}function i(t){return"border-box"!==t.boxSizing?0:(t.paddingTop?parseInt(t.paddingTop,10):0)+(t.paddingBottom?parseInt(t.paddingBottom,10):0)}function n(t){return"border-box"!==t.boxSizing?0:(t.borderTopWidth?parseInt(t.borderTopWidth,10):0)+(t.borderBottomWidth?parseInt(t.borderBottomWidth,10):0)}function s(t){var e=Number(F[g]["max"+t]),i=Number(F[g]["min"+t]),n=t.toLowerCase(),s=Number(p[n]);H(g,"Checking "+n+" is in range "+i+"-"+e),s<i&&(s=i,H(g,"Set "+n+" to min value")),s>e&&(s=e,H(g,"Set "+n+" to max value")),p[n]=""+s}function r(t){return u.slice(u.indexOf(":")+7+t)}function a(t,e){var i,n,s;i=function(){et("Send Page Info","pageInfo:"+function(){var t=document.body.getBoundingClientRect(),e=p.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:e.height,iframeWidth:e.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(e.top-t.top,10),offsetLeft:parseInt(e.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}(),t,e)},n=32,rt[s=e]||(rt[s]=setTimeout(function(){rt[s]=null,i()},n))}function o(t){var e=t.getBoundingClientRect();return K(g),{x:Math.floor(Number(e.left)+Number(L.x)),y:Math.floor(Number(e.top)+Number(L.y))}}function l(t){var e=t?o(p.iframe):{x:0,y:0},i={x:Number(p.width)+e.x,y:Number(p.height)+e.y};H(g,"Reposition requested from iFrame (offset x:"+e.x+" y:"+e.y+")"),window.top===window.self?(L=i,c(),H(g,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(t?"Offset":"")](i.x,i.y):U(g,"Unable to scroll to requested position, window.parentIFrame not found")}function c(){!1===d("onScroll",L)?Z():Q(g)}function h(t){var e={};if(0===Number(p.width)&&0===Number(p.height)){var i=r(9).split(":");e={x:i[1],y:i[0]}}else e={x:p.width,y:p.height};d(t,{iframe:p.iframe,screenX:Number(e.x),screenY:Number(e.y),type:p.type})}function d(t,e){return q(g,t,e)}var u=t.data,p={},g=null;"[iFrameResizerChild]Ready"===u?function(){for(var t in F)et("iFrame requested init",it(t),F[t].iframe,t)}():P===(""+u).slice(0,13)&&u.slice(13).split(":")[0]in F?(p=function(){var t=u.slice(13).split(":"),e=t[1]?parseInt(t[1],10):0,s=F[t[0]]&&F[t[0]].iframe,r=getComputedStyle(s);return{iframe:s,id:t[0],height:e+i(r)+n(r),width:t[2],type:t[3]}}(),g=p.id,F[g]&&(F[g].loaded=!0),!function(){var t=p.type in{true:1,false:1,undefined:1};return t&&H(g,"Ignoring init message from meta parent page"),t}()&&function(t){var e=!0;return F[t]||(e=!1,U(p.type+" No settings for "+t+". Message was: "+u)),e}(g)&&(H(g,"Received: "+u),function(){var t=!0;return null===p.iframe&&(U(g,"IFrame ("+p.id+") not found"),t=!1),t}()&&function(){var e=t.origin,i=F[g]&&F[g].checkOrigin;if(i&&""+e!=="null"&&!(i.constructor===Array?function(){var t=0,n=!1;for(H(g,"Checking connection is from allowed list of origins: "+i);t<i.length;t++)if(i[t]===e){n=!0;break}return n}():function(){var t=F[g]&&F[g].remoteHost;return H(g,"Checking connection is from: "+t),e===t}()))throw new Error("Unexpected message received from: "+e+" for "+p.iframe.id+". Message was: "+t.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(F[g]&&F[g].firstRun&&F[g]&&(F[g].firstRun=!1),p.type){case"close":Y(p.iframe);break;case"message":t=r(6),H(g,"onMessage passed: {iframe: "+p.iframe.id+", message: "+t+"}"),d("onMessage",{iframe:p.iframe,message:JSON.parse(t)}),H(g,"--");break;case"mouseenter":h("onMouseEnter");break;case"mouseleave":h("onMouseLeave");break;case"autoResize":F[g].autoResize=JSON.parse(r(9));break;case"scrollTo":l(!1);break;case"scrollToOffset":l(!0);break;case"pageInfo":a(F[g]&&F[g].iframe,g),function(){function t(t,n){function s(){F[i]?a(F[i].iframe,i):e()}["scroll","resize"].forEach(function(e){H(i,t+e+" listener for sendPageInfo"),n(window,e,s)})}function e(){t("Remove ",W)}var i=g;t("Add ",B),F[i]&&(F[i].stopPageInfo=e)}();break;case"pageInfoStop":F[g]&&F[g].stopPageInfo&&(F[g].stopPageInfo(),delete F[g].stopPageInfo);break;case"inPageLink":!function(t){var e=t.split("#")[1]||"",i=decodeURIComponent(e),n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){var t=o(n);H(g,"Moving to in page link (#"+e+") at x: "+t.x+" y: "+t.y),L={x:t.x,y:t.y},c(),H(g,"--")}():window.top===window.self?H(g,"In page link #"+e+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(e):H(g,"In page link #"+e+" not found and window.parentIFrame not found")}(r(9));break;case"reset":J(p);break;case"init":e(),d("onInit",p.iframe);break;default:0===Number(p.width)&&0===Number(p.height)?U("Unsupported message received ("+p.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):e()}var t}())):function(t,e){V("info",t,e,j(t))}(g,"Ignored: "+u)}function q(t,e,i){var n=null,s=null;if(F[t]){if("function"!==typeof(n=F[t][e]))throw new TypeError(e+" on iFrame["+t+"] is not a function");s=n(i)}return s}function X(t){var e=t.id;delete F[e]}function Y(t){var e=t.id;if(!1!==q(e,"onClose",e)){H(e,"Removing iFrame: "+e);try{t.parentNode&&t.parentNode.removeChild(t)}catch(i){U(i)}q(e,"onClosed",e),H(e,"--"),X(t),E&&(E.disconnect(),E=null)}else H(e,"Close iframe cancelled by onClose event")}function K(t){null===L&&H(t,"Get page position: "+(L={x:void 0===window.pageXOffset?document.documentElement.scrollLeft:window.pageXOffset,y:void 0===window.pageYOffset?document.documentElement.scrollTop:window.pageYOffset}).x+","+L.y)}function Q(t){null!==L&&(window.scrollTo(L.x,L.y),H(t,"Set page position: "+L.x+","+L.y),Z())}function Z(){L=null}function J(t){H(t.id,"Size reset requested by "+("init"===t.type?"host page":"iFrame")),K(t.id),tt(function(){$(t),et("reset","reset",t.iframe,t.id)},t,"reset")}function $(t){function e(e){T||"0"!==t[e]||(T=!0,H(n,"Hidden iFrame detected, creating visibility listener"),function(){function t(){function t(t){function e(e){return"0px"===(F[t]&&F[t].iframe.style[e])}function i(t){return null!==t.offsetParent}F[t]&&i(F[t].iframe)&&(e("height")||e("width"))&&et("Visibility change","resize",F[t].iframe,t)}Object.keys(F).forEach(function(e){t(e)})}function e(e){H("window","Mutation observed: "+e[0].target+" "+e[0].type),st(t,16)}function i(){var t=document.querySelector("body"),i={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};new n(e).observe(t,i)}var n=O();n&&i()}())}function i(i){!function(e){t.id?(t.iframe.style[e]=t[e]+"px",H(t.id,"IFrame ("+n+") "+e+" set to "+t[e]+"px")):H("undefined","messageData id not set")}(i),e(i)}var n=t.iframe.id;F[n]&&(F[n].sizeHeight&&i("height"),F[n].sizeWidth&&i("width"))}function tt(t,e,i){i!==e.type&&R&&!window.jasmine?(H(e.id,"Requesting animation frame"),R(t)):t()}function et(t,e,i,n,s){var r=!1;n=n||i.id,F[n]&&(i&&"contentWindow"in i&&null!==i.contentWindow?function(){var s=F[n]&&F[n].targetOrigin;H(n,"["+t+"] Sending msg to iframe["+n+"] ("+e+") targetOrigin: "+s),i.contentWindow.postMessage(P+e,s)}():U(n,"["+t+"] IFrame("+n+") not found"),s&&F[n]&&F[n].warningTimeout&&(F[n].msgTimeout=setTimeout(function(){!F[n]||F[n].loaded||r||(r=!0,U(n,"IFrame has not responded within "+F[n].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))},F[n].warningTimeout)))}function it(t){return t+":"+F[t].bodyMarginV1+":"+F[t].sizeWidth+":"+F[t].log+":"+F[t].interval+":"+F[t].enablePublicMethods+":"+F[t].autoResize+":"+F[t].bodyMargin+":"+F[t].heightCalculationMethod+":"+F[t].bodyBackground+":"+F[t].bodyPadding+":"+F[t].tolerance+":"+F[t].inPageLinks+":"+F[t].resizeFrom+":"+F[t].widthCalculationMethod+":"+F[t].mouseEvents}function nt(t,e){function i(t){var e=t.split("Callback");if(2===e.length){var i="on"+e[0].charAt(0).toUpperCase()+e[0].slice(1);this[i]=this[t],delete this[t],U(n,"Deprecated: '"+t+"' has been renamed '"+i+"'. The old method will be removed in the next major version.")}}var n=function(i){if("string"!==typeof i)throw new TypeError("Invaild id for iFrame. Expected String");return""===i&&(t.id=i=function(){var t=e&&e.id||N.id+S++;return null!==document.getElementById(t)&&(t+=S++),t}(),M=(e||{}).log,H(i,"Added missing iframe ID: "+i+" ("+t.src+")")),i}(t.id);n in F&&"iFrameResizer"in t?U(n,"Ignored iFrame, already setup."):(!function(e){var s;e=e||{},F[n]=Object.create(null),F[n].iframe=t,F[n].firstRun=!0,F[n].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(t){if("object"!==typeof t)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(i,e),function(t){for(var e in N)Object.prototype.hasOwnProperty.call(N,e)&&(F[n][e]=Object.prototype.hasOwnProperty.call(t,e)?t[e]:N[e])}(e),F[n]&&(F[n].targetOrigin=!0===F[n].checkOrigin?""===(s=F[n].remoteHost)||null!==s.match(/^(about:blank|javascript:|file:\/\/)/)?"*":s:"*")}(e),function(){switch(H(n,"IFrame scrolling "+(F[n]&&F[n].scrolling?"enabled":"disabled")+" for "+n),t.style.overflow=!1===(F[n]&&F[n].scrolling)?"hidden":"auto",F[n]&&F[n].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=F[n]?F[n].scrolling:"no"}}(),function(){function e(e){var i=F[n][e];1/0!==i&&0!==i&&(t.style[e]="number"===typeof i?i+"px":i,H(n,"Set "+e+" = "+t.style[e]))}function i(t){if(F[n]["min"+t]>F[n]["max"+t])throw new Error("Value for min"+t+" can not be greater than max"+t)}i("Height"),i("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!==typeof(F[n]&&F[n].bodyMargin)&&"0"!==(F[n]&&F[n].bodyMargin)||(F[n].bodyMarginV1=F[n].bodyMargin,F[n].bodyMargin=F[n].bodyMargin+"px"),function(e){var i=O();i&&(E=function(e){if(!t.parentNode)return null;var i=new e(function(e){e.forEach(function(e){Array.prototype.slice.call(e.removedNodes).forEach(function(e){e===t&&Y(t)})})});return i.observe(t.parentNode,{childList:!0}),i}(i)),B(t,"load",function(){et("iFrame.onload",e,t,void 0,!0),function(){var e=F[n]&&F[n].firstRun,i=F[n]&&F[n].heightCalculationMethod in D;!e&&i&&J({iframe:t,height:0,width:0,type:"init"})}()}),et("init",e,t,void 0,!0)}(it(n)),F[n]&&(F[n].iframe.iFrameResizer={close:Y.bind(null,F[n].iframe),removeListeners:X.bind(null,F[n].iframe),resize:et.bind(null,"Window resize","resize",F[n].iframe),moveToAnchor:function(t){et("Move to anchor","moveToAnchor:"+t,F[n].iframe,n)},sendMessage:function(t){et("Send Message","message:"+(t=JSON.stringify(t)),F[n].iframe,n)}}))}function st(t,e){null===I&&(I=setTimeout(function(){I=null,t()},e))}var rt={};function at(){"hidden"!==document.visibilityState&&(H("document","Trigger event: Visibility change"),st(function(){ot("Tab Visible","resize")},16))}function ot(t,e){Object.keys(F).forEach(function(i){(function(t){return F[t]&&"parent"===F[t].resizeFrom&&F[t].autoResize&&!F[t].firstRun})(i)&&et(t,e,F[i].iframe,i)})}function lt(){B(window,"message",G),B(window,"resize",function(){var t;H("window","Trigger event: "+(t="resize")),st(function(){ot("Window "+t,"resize")},16)}),B(document,"visibilitychange",at),B(document,"-webkit-visibilitychange",at)}var ct=function(){function t(t,i){i&&(!function(){if(!i.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==i.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+i.tagName+">")}(),nt(i,t),e.push(i))}var e;return function(){var t,e=["moz","webkit","o","ms"];for(t=0;t<e.length&&!R;t+=1)R=window[e[t]+"RequestAnimationFrame"];R?R=R.bind(window):H("setup","RequestAnimationFrame not supported")}(),lt(),function(i,n){switch(e=[],function(t){t&&t.enablePublicMethods&&U("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof n){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(n||"iframe"),t.bind(void 0,i));break;case"object":t(i,n);break;default:throw new TypeError("Unexpected data type ("+typeof n+")")}return e}}(),ht=i(54159),dt=i.n(ht);function ut(t,e,i){e||(e=[]);var n=e.length++;return Object.defineProperty({},"_",{set:function(s){e[n]=s,t.apply(i,e)}})}var pt=i(89379);function gt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ft(t,e){gt(t,e),e.add(t)}function mt(t,e,i){gt(t,e),e.set(t,i)}function vt(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}function wt(t,e,i){return i(vt(t,e))}function bt(t,e){return t.get(vt(t,e))}function yt(t,e,i){return t.set(vt(t,e),i),i}var At,Et,xt,_t,kt,Ct,St,Mt,Tt,Pt,Lt,Rt,Dt,Ft,It,Nt,Ot,Bt,Wt=i(64467),zt=i(19495);const jt="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),Ht=[.001,0,0,.001,0,0],Ut=1.35,Vt=1,Gt=2,qt=4,Xt=16,Yt=32,Kt=64,Qt=128,Zt=256,Jt={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},$t="pdfjs_internal_editor_",te={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},ee={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_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},ie=0,ne=1,se=2,re=3,ae=3,oe=4,le={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},ce={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},he=1,de=2,ue=3,pe=4,ge=5,fe={ERRORS:0,WARNINGS:1,INFOS:5},me={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,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},ve=0,we=1,be=2,ye=3;let Ae=fe.WARNINGS;function Ee(t){Number.isInteger(t)&&(Ae=t)}function xe(){return Ae}function _e(t){Ae>=fe.INFOS&&console.info("Info: ".concat(t))}function ke(t){Ae>=fe.WARNINGS&&console.warn("Warning: ".concat(t))}function Ce(t){throw new Error(t)}function Se(t,e){t||Ce(e)}function Me(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;if(i&&"string"===typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);(null===e||void 0===e?void 0:e.length)>=2&&(t="http://".concat(t))}if(i.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch(s){}}const n=e?URL.parse(t,e):URL.parse(t);return function(t){switch(null===t||void 0===t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n)?n:null}function Te(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=URL.parse(t);return n?(n.hash=e,n.href):i&&Me(t,"http://example.com")?t.split("#",1)[0]+"".concat(e?"#".concat(e):""):""}function Pe(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(t,e,{value:i,enumerable:!n,configurable:!0,writable:!1}),i}const Le=function(){function t(t,e){this.message=t,this.name=e}return t.prototype=new Error,t.constructor=t,t}();class Re extends Le{constructor(t,e){super(t,"PasswordException"),this.code=e}}class De extends Le{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Fe extends Le{constructor(t){super(t,"InvalidPDFException")}}class Ie extends Le{constructor(t,e,i){super(t,"ResponseException"),this.status=e,this.missing=i}}class Ne extends Le{constructor(t){super(t,"FormatError")}}class Oe extends Le{constructor(t){super(t,"AbortException")}}function Be(t){"object"===typeof t&&void 0!==(null===t||void 0===t?void 0:t.length)||Ce("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 We(t){"string"!==typeof t&&Ce("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}class ze{static get isLittleEndian(){return Pe(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return Pe(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return Pe(this,"isOffscreenCanvasSupported","undefined"!==typeof OffscreenCanvas)}static get isImageDecoderSupported(){return Pe(this,"isImageDecoderSupported","undefined"!==typeof ImageDecoder)}static get platform(){const{platform:t,userAgent:e}=navigator;return Pe(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){var t,e;return Pe(this,"isCSSRoundSupported",null===(t=globalThis.CSS)||void 0===t||null===(e=t.supports)||void 0===e?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const je=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class He{static makeHexColor(t,e,i){return"#".concat(je[t]).concat(je[e]).concat(je[i])}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}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 multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=t[i],s=t[i+1];t[i]=n*e[0]+s*e[2]+e[4],t[i+1]=n*e[1]+s*e[3]+e[5]}static applyTransformToBezier(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],l=e[5];for(let c=0;c<6;c+=2){const e=t[i+c],h=t[i+c+1];t[i+c]=e*n+h*r+o,t[i+c+1]=e*s+h*a+l}}static applyInverseTransform(t,e){const i=t[0],n=t[1],s=e[0]*e[3]-e[1]*e[2];t[0]=(i*e[3]-n*e[2]+e[2]*e[5]-e[4]*e[3])/s,t[1]=(-i*e[1]+n*e[0]+e[4]*e[1]-e[5]*e[0])/s}static axialAlignedBoundingBox(t,e,i){const n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],l=e[5],c=t[0],h=t[1],d=t[2],u=t[3];let p=n*c+o,g=p,f=n*d+o,m=f,v=a*h+l,w=v,b=a*u+l,y=b;if(0!==s||0!==r){const t=s*c,e=s*d,i=r*h,n=r*u;p+=i,m+=i,f+=n,g+=n,v+=t,y+=t,b+=e,w+=e}i[0]=Math.min(i[0],p,f,g,m),i[1]=Math.min(i[1],v,b,w,y),i[2]=Math.max(i[2],p,f,g,m),i[3]=Math.max(i[3],v,b,w,y)}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,e){const i=t[0],n=t[1],s=t[2],r=t[3],a=i**2+n**2,o=i*s+n*r,l=s**2+r**2,c=(a+l)/2,h=Math.sqrt(c**2-(a*l-o**2));e[0]=Math.sqrt(c+h||1),e[1]=Math.sqrt(c-h||1)}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 pointBoundingBox(t,e,i){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}static rectBoundingBox(t,e,i,n,s){s[0]=Math.min(s[0],t,i),s[1]=Math.min(s[1],e,n),s[2]=Math.max(s[2],t,i),s[3]=Math.max(s[3],e,n)}static bezierBoundingBox(t,e,i,n,s,r,a,o,l){l[0]=Math.min(l[0],t,a),l[1]=Math.min(l[1],e,o),l[2]=Math.max(l[2],t,a),l[3]=Math.max(l[3],e,o),vt(He,this,Ve).call(this,t,i,s,a,e,n,r,o,3*(3*(i-s)-t+a),6*(t-2*i+s),3*(i-t),l),vt(He,this,Ve).call(this,t,i,s,a,e,n,r,o,3*(3*(n-r)-e+o),6*(e-2*n+r),3*(n-e),l)}}function Ue(t,e,i,n,s,r,a,o,l,c){if(l<=0||l>=1)return;const h=1-l,d=l*l,u=d*l,p=h*(h*(h*t+3*l*e)+3*d*i)+u*n,g=h*(h*(h*s+3*l*r)+3*d*a)+u*o;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],g),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],g)}function Ve(t,e,i,n,s,r,a,o,l,c,h,d){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&vt(At,this,Ue).call(this,t,e,i,n,s,r,a,o,-h/c,d));const u=c**2-4*h*l;if(u<0)return;const p=Math.sqrt(u),g=2*l;vt(At,this,Ue).call(this,t,e,i,n,s,r,a,o,(-c+p)/g,d),vt(At,this,Ue).call(this,t,e,i,n,s,r,a,o,(-c-p)/g,d)}At=He;let Ge=null,qe=null;function Xe(){if("function"===typeof crypto.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),Be(t)}const Ye="pdfjs_internal_id_";function Ke(t,e,i){return Math.min(Math.max(t,e),i)}function Qe(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(Be(t))}"function"!==typeof Promise.try&&(Promise.try=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return new Promise(e=>{e(t(...i))})}),"function"!==typeof Math.sumPrecise&&(Math.sumPrecise=function(t){return t.reduce((t,e)=>t+e,0)});class Ze{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(!Ze.shouldBuildText(r))return;null!==i&&void 0!==i&&null!==(n=i.attributes)&&void 0!==n&&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)}}class Je{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(t){let{html:e,element:i,storage:n=null,intent:s,linkService:r}=t;const{attributes:a}=i,o=e instanceof HTMLAnchorElement;"radio"===a.type&&(a.name="".concat(a.name,"-").concat(s));for(const[l,c]of Object.entries(a))if(null!==c&&void 0!==c)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!o||"href"!==l&&"newWindow"!==l)&&e.setAttribute(l,c)}o&&r.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,i,n)}static render(t){const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,s=t.intent||"display",r=document.createElement(n.name);n.attributes&&this.setAttributes({html:r,element:n,intent:s,linkService:i});const a="richText"!==s,o=t.div;if(o.append(r),t.viewport){const e="matrix(".concat(t.viewport.transform.join(","),")");o.style.transform=e}a&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const t=document.createTextNode(n.value);r.append(t),a&&Ze.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const c=[[n,-1,r]];for(;c.length>0;){var h,d;const[t,n,r]=c.at(-1);if(n+1===t.children.length){c.pop();continue}const o=t.children[++c.at(-1)[1]];if(null===o)continue;const{name:u}=o;if("#text"===u){const t=document.createTextNode(o.value);l.push(t),r.append(t);continue}const p=null!==o&&void 0!==o&&null!==(h=o.attributes)&&void 0!==h&&h.xmlns?document.createElementNS(o.attributes.xmlns,u):document.createElement(u);if(r.append(p),o.attributes&&this.setAttributes({html:p,element:o,storage:e,intent:s,linkService:i}),(null===(d=o.children)||void 0===d?void 0:d.length)>0)c.push([o,-1,p]);else if(o.value){const t=document.createTextNode(o.value);a&&Ze.shouldBuildText(u)&&l.push(t),p.append(t)}}for(const u of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))u.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e="matrix(".concat(t.viewport.transform.join(","),")");t.div.style.transform=e,t.div.hidden=!1}}const $e="http://www.w3.org/2000/svg";class ti{}async function ei(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";if(oi(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)n(new Error(s.statusText));else{switch(e){case"arraybuffer":case"blob":case"json":return void i(s.response)}i(s.responseText)}},s.send(null)})}Et=ti,(0,Wt.A)(ti,"CSS",96),(0,Wt.A)(ti,"PDF",72),(0,Wt.A)(ti,"PDF_TO_CSS_UNITS",Et.CSS/Et.PDF);class ii{constructor(t){let{viewBox:e,userUnit:i,scale:n,rotation:s,offsetX:r=0,offsetY:a=0,dontFlip:o=!1}=t;this.viewBox=e,this.userUnit=i,this.scale=n,this.rotation=s,this.offsetX=r,this.offsetY=a,n*=i;const l=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let h,d,u,p,g,f,m,v;switch(s%=360,s<0&&(s+=360),s){case 180:h=-1,d=0,u=0,p=1;break;case 90:h=0,d=1,u=1,p=0;break;case 270:h=0,d=-1,u=-1,p=0;break;case 0:h=1,d=0,u=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(u=-u,p=-p),0===h?(g=Math.abs(c-e[1])*n+r,f=Math.abs(l-e[0])*n+a,m=(e[3]-e[1])*n,v=(e[2]-e[0])*n):(g=Math.abs(l-e[0])*n+r,f=Math.abs(c-e[1])*n+a,m=(e[2]-e[0])*n,v=(e[3]-e[1])*n),this.transform=[h*n,d*n,u*n,p*n,g-h*n*l-u*n*c,f-d*n*l-p*n*c],this.width=m,this.height=v}get rawDims(){const t=this.viewBox;return Pe(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new ii({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){const i=[t,e];return He.applyTransform(i,this.transform),i}convertToViewportRectangle(t){const e=[t[0],t[1]];He.applyTransform(e,this.transform);const i=[t[2],t[3]];return He.applyTransform(i,this.transform),[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){const i=[t,e];return He.applyInverseTransform(i,this.transform),i}}class ni extends Le{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function si(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function ri(t){return"string"===typeof t&&/\.pdf$/i.test(t)}class ai{constructor(){(0,Wt.A)(this,"started",Object.create(null)),(0,Wt.A)(this,"times",[])}time(t){t in this.started&&ke("Timer is already running for ".concat(t)),this.started[t]=Date.now()}timeEnd(t){t in this.started||ke("Timer has not been started for ".concat(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:i}of this.times)e=Math.max(i.length,e);for(const{name:i,start:n,end:s}of this.times)t.push("".concat(i.padEnd(e)," ").concat(s-n,"ms\n"));return t.join("")}}function oi(t,e){const i=e?URL.parse(t,e):URL.parse(t);return"http:"===(null===i||void 0===i?void 0:i.protocol)||"https:"===(null===i||void 0===i?void 0:i.protocol)}function li(t){t.preventDefault()}function ci(t){t.preventDefault(),t.stopPropagation()}class hi{static toDateObject(t){if(t instanceof Date)return t;if(!t||"string"!==typeof t)return null;vt(hi,this,di)._||(di._=vt(hi,this,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?")));const e=vt(hi,this,di)._.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 c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let h=parseInt(e[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===l?(r+=c,a+=h):"+"===l&&(r-=c,a-=h),new Date(Date.UTC(i,n,s,r,a,o))}}var di={_:void 0};function ui(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):(ke('Not a valid color format: "'.concat(t,'"')),[0,0,0])}function pi(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform();return[e,i,n,s,r,a]}function gi(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 fi(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof ii){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:r}=t,a=ze.isCSSRoundSupported,o="var(--total-scale-factor) * ".concat(n,"px"),l="var(--total-scale-factor) * ".concat(s,"px"),c=a?"round(down, ".concat(o,", var(--scale-round-x))"):"calc(".concat(o,")"),h=a?"round(down, ".concat(l,", var(--scale-round-y))"):"calc(".concat(l,")");i&&e.rotation%180!==0?(r.width=h,r.height=c):(r.width=c,r.height=h)}n&&t.setAttribute("data-main-rotation",e.rotation)}class mi{constructor(){const{pixelRatio:t}=mi;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,r=1/0,a=1/0,o=1/0;(i=mi.capPixels(i,s))>0&&(r=Math.sqrt(i/(t*e))),-1!==n&&(a=n/t,o=n/e);const l=Math.min(r,a,o);return(this.sx>l||this.sy>l)&&(this.sx=l,this.sy=l,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,i):i}return t}}const vi=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class wi{static get isDarkMode(){var t,e;return Pe(this,"isDarkMode",!(null===(t=window)||void 0===t||null===(e=t.matchMedia)||void 0===e||!e.call(t,"(prefers-color-scheme: dark)").matches))}}function bi(t,e){const i=t[0]/255,n=t[1]/255,s=t[2]/255,r=Math.max(i,n,s),a=Math.min(i,n,s),o=(r+a)/2;if(r===a)e[0]=e[1]=0;else{const t=r-a;switch(e[1]=o<.5?t/(r+a):t/(2-r-a),r){case i:e[0]=60*((n-s)/t+(n<s?6:0));break;case n:e[0]=60*((s-i)/t+2);break;case s:e[0]=60*((i-n)/t+4)}}e[2]=o}function yi(t,e){const i=t[0],n=t[1],s=t[2],r=(1-Math.abs(2*s-1))*n,a=r*(1-Math.abs(i/60%2-1)),o=s-r/2;switch(Math.floor(i/60)){case 0:e[0]=r+o,e[1]=a+o,e[2]=o;break;case 1:e[0]=a+o,e[1]=r+o,e[2]=o;break;case 2:e[0]=o,e[1]=r+o,e[2]=a+o;break;case 3:e[0]=o,e[1]=a+o,e[2]=r+o;break;case 4:e[0]=a+o,e[1]=o,e[2]=r+o;break;case 5:case 6:e[0]=r+o,e[1]=o,e[2]=a+o}}function Ai(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function Ei(t,e,i){yi(t,i),i.map(Ai);const n=.2126*i[0]+.7152*i[1]+.0722*i[2];yi(e,i),i.map(Ai);const s=.2126*i[0]+.7152*i[1]+.0722*i[2];return n>s?(n+.05)/(s+.05):(s+.05)/(n+.05)}const xi=new Map;function _i(t,e){let{html:i,dir:n,className:s}=t;const r=document.createDocumentFragment();if("string"===typeof i){const t=document.createElement("p");t.dir=n||"auto";const e=i.split(/(?:\r\n?|\n)/);for(let i=0,n=e.length;i<n;++i){const s=e[i];t.append(document.createTextNode(s)),i<n-1&&t.append(document.createElement("br"))}r.append(t)}else Je.render({xfaHtml:i,div:r,intent:"richText"});r.firstChild.classList.add("richText",s),e.append(r)}var ki=new WeakMap,Ci=new WeakMap,Si=new WeakMap,Mi=new WeakMap,Ti=new WeakMap,Pi=new WeakMap,Li=new WeakMap,Ri=new WeakMap,Di=new WeakSet;class Fi{constructor(t){ft(this,Di),mt(this,ki,null),mt(this,Ci,null),mt(this,Si,void 0),mt(this,Mi,null),mt(this,Ti,null),mt(this,Pi,null),mt(this,Li,null),mt(this,Ri,null),yt(Si,this,t),zi._||(zi._=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"}))}render(){const t=yt(ki,this,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=bt(Si,this)._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",li,{signal:e}),t.addEventListener("pointerdown",Ii,{signal:e}));const i=yt(Mi,this,document.createElement("div"));i.className="buttons",t.append(i);const n=bt(Si,this).toolbarPosition;if(n){const{style:e}=t,i="ltr"===bt(Si,this)._uiManager.direction?1-n[0]:n[0];e.insetInlineEnd="".concat(100*i,"%"),e.top="calc(".concat(100*n[1],"% + var(--editor-toolbar-vert-offset))")}return t}get div(){return bt(ki,this)}hide(){var t;bt(ki,this).classList.add("hidden"),null===(t=bt(Ci,this))||void 0===t||t.hideDropdown()}show(){var t,e;bt(ki,this).classList.remove("hidden"),null===(t=bt(Ti,this))||void 0===t||t.shown(),null===(e=bt(Pi,this))||void 0===e||e.shown()}addDeleteButton(){const{editorType:t,_uiManager:e}=bt(Si,this),i=document.createElement("button");i.classList.add("basic","deleteButton"),i.tabIndex=0,i.setAttribute("data-l10n-id",zi._[t]),vt(Di,this,Bi).call(this,i)&&i.addEventListener("click",t=>{e.delete()},{signal:e._signal}),bt(Mi,this).append(i)}async addAltText(t){const e=await t.render();vt(Di,this,Bi).call(this,e),bt(Mi,this).append(e,wt(Di,this,Wi)),yt(Ti,this,t)}addComment(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(bt(Pi,this))return;const i=t.renderForToolbar();if(!i)return;vt(Di,this,Bi).call(this,i);const n=yt(Li,this,wt(Di,this,Wi));e?(bt(Mi,this).insertBefore(i,e),bt(Mi,this).insertBefore(n,e)):bt(Mi,this).append(i,n),yt(Pi,this,t),t.toolbar=this}addColorPicker(t){if(bt(Ci,this))return;yt(Ci,this,t);const e=t.renderButton();vt(Di,this,Bi).call(this,e),bt(Mi,this).append(e,wt(Di,this,Wi))}async addEditSignatureButton(t){const e=yt(Ri,this,await t.renderEditButton(bt(Si,this)));vt(Di,this,Bi).call(this,e),bt(Mi,this).append(e,wt(Di,this,Wi))}removeButton(t){var e,i;if("comment"===t)null===(e=bt(Pi,this))||void 0===e||e.removeToolbarCommentButton(),yt(Pi,this,null),null===(i=bt(Li,this))||void 0===i||i.remove(),yt(Li,this,null)}async addButton(t,e){switch(t){case"colorPicker":this.addColorPicker(e);break;case"altText":await this.addAltText(e);break;case"editSignature":await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(e)}}async addButtonBefore(t,e,i){const n=bt(Mi,this).querySelector(i);n&&"comment"===t&&this.addComment(e,n)}updateEditSignatureButton(t){bt(Ri,this)&&(bt(Ri,this).title=t)}remove(){var t;bt(ki,this).remove(),null===(t=bt(Ci,this))||void 0===t||t.destroy(),yt(Ci,this,null)}}function Ii(t){t.stopPropagation()}function Ni(t){bt(Si,this)._focusEventsAllowed=!1,ci(t)}function Oi(t){bt(Si,this)._focusEventsAllowed=!0,ci(t)}function Bi(t){const e=bt(Si,this)._uiManager._signal;return e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("focusin",vt(Di,this,Ni).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",vt(Di,this,Oi).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",li,{signal:e}),!0)}function Wi(t){const e=document.createElement("div");return e.className="divider",e}var zi={_:null},ji=new WeakMap,Hi=new WeakMap,Ui=new WeakMap,Vi=new WeakSet;class Gi{constructor(t){ft(this,Vi),mt(this,ji,null),mt(this,Hi,null),mt(this,Ui,void 0),yt(Ui,this,t)}show(t,e,i){const[n,s]=vt(Vi,this,Xi).call(this,e,i),{style:r}=bt(Hi,this)||yt(Hi,this,vt(Vi,this,qi).call(this));t.append(bt(Hi,this)),r.insetInlineEnd="".concat(100*n,"%"),r.top="calc(".concat(100*s,"% + var(--editor-toolbar-vert-offset))")}hide(){bt(Hi,this).remove()}}function qi(){const t=yt(Hi,this,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const e=bt(Ui,this)._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",li,{signal:e});const i=yt(ji,this,document.createElement("div"));return i.className="buttons",t.append(i),bt(Ui,this).hasCommentManager()&&vt(Vi,this,Yi).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{bt(Ui,this).commentSelection("floating_button")}),vt(Vi,this,Yi).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{bt(Ui,this).highlightSelection("floating_button")}),t}function Xi(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]}function Yi(t,e,i,n){const s=document.createElement("button");s.classList.add("basic",t),s.tabIndex=0,s.setAttribute("data-l10n-id",e);const r=document.createElement("span");s.append(r),r.className="visuallyHidden",r.setAttribute("data-l10n-id",i);const a=bt(Ui,this)._signal;a instanceof AbortSignal&&!a.aborted&&(s.addEventListener("contextmenu",li,{signal:a}),s.addEventListener("click",n,{signal:a})),bt(ji,this).append(s)}function Ki(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}var Qi=new WeakMap;class Zi{constructor(){mt(this,Qi,0)}get id(){var t,e;return"".concat($t).concat((yt(Qi,this,(t=bt(Qi,this),e=t++,t)),e))}}var Ji=new WeakMap,$i=new WeakMap,tn=new WeakMap,en=new WeakSet;class nn{constructor(){ft(this,en),mt(this,Ji,Xe()),mt(this,$i,0),mt(this,tn,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 Pe(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 vt(en,this,sn).call(this,"".concat(e,"_").concat(i,"_").concat(n,"_").concat(s),t)}async getFromUrl(t){return vt(en,this,sn).call(this,t,t)}async getFromBlob(t,e){const i=await e;return vt(en,this,sn).call(this,t,i)}async getFromId(t){bt(tn,this)||yt(tn,this,new Map);const e=bt(tn,this).get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:t}=e;return delete e.blobPromise,this.getFromBlob(e.id,t)}return this.getFromUrl(e.url)}getFromCanvas(t,e){var i,n,s;bt(tn,this)||yt(tn,this,new Map);let r=bt(tn,this).get(t);if(null!==(s=r)&&void 0!==s&&s.bitmap)return r.refCounter+=1,r;const a=new OffscreenCanvas(e.width,e.height);return a.getContext("2d").drawImage(e,0,0),r={bitmap:a.transferToImageBitmap(),id:"image_".concat(bt(Ji,this),"_").concat((yt($i,this,(i=bt($i,this),n=i++,i)),n)),refCounter:1,isSvg:!1},bt(tn,this).set(t,r),bt(tn,this).set(r.id,r),r}getSvgUrl(t){const e=bt(tn,this).get(t);return null!==e&&void 0!==e&&e.isSvg?e.svgUrl:null}deleteId(t){var e;bt(tn,this)||yt(tn,this,new Map);const i=bt(tn,this).get(t);if(!i)return;if(i.refCounter-=1,0!==i.refCounter)return;const{bitmap:n}=i;if(!i.url&&!i.file){const t=new OffscreenCanvas(n.width,n.height);t.getContext("bitmaprenderer").transferFromImageBitmap(n),i.blobPromise=t.convertToBlob()}null===(e=n.close)||void 0===e||e.call(n),i.bitmap=null}isValidId(t){return t.startsWith("image_".concat(bt(Ji,this),"_"))}}async function sn(t,e){var i;bt(tn,this)||yt(tn,this,new Map);let n=bt(tn,this).get(t);if(null===n)return null;if(null!==(i=n)&&void 0!==i&&i.bitmap)return n.refCounter+=1,n;try{var s,r;let t;if(n||(n={bitmap:null,id:"image_".concat(bt(Ji,this),"_").concat((yt($i,this,(s=bt($i,this),r=s++,s)),r)),refCounter:0,isSvg:!1}),"string"===typeof e?(n.url=e,t=await ei(e,"blob")):e instanceof File?t=n.file=e:e instanceof Blob&&(t=e),"image/svg+xml"===t.type){const e=xt._isSVGFittingCanvas,i=new FileReader,s=new Image,r=new Promise((t,r)=>{s.onload=()=>{n.bitmap=s,n.isSvg=!0,t()},i.onload=async()=>{const t=n.svgUrl=i.result;s.src=await e?"".concat(t,"#svgView(preserveAspectRatio(none))"):t},s.onerror=i.onerror=r});i.readAsDataURL(t),await r}else n.bitmap=await createImageBitmap(t);n.refCounter=1}catch(a){ke(a),n=null}return bt(tn,this).set(t,n),n&&bt(tn,this).set(n.id,n),n}xt=nn;var rn=new WeakMap,an=new WeakMap,on=new WeakMap,ln=new WeakMap;class cn{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;mt(this,rn,[]),mt(this,an,!1),mt(this,on,void 0),mt(this,ln,-1),yt(on,this,t)}add(t){let{cmd:e,undo:i,post:n,mustExec:s,type:r=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}=t;if(s&&e(),bt(an,this))return;const l={cmd:e,undo:i,post:n,type:r};if(-1===bt(ln,this))return bt(rn,this).length>0&&(bt(rn,this).length=0),yt(ln,this,0),void bt(rn,this).push(l);if(a&&bt(rn,this)[bt(ln,this)].type===r)return o&&(l.undo=bt(rn,this)[bt(ln,this)].undo),void(bt(rn,this)[bt(ln,this)]=l);const c=bt(ln,this)+1;c===bt(on,this)?bt(rn,this).splice(0,1):(yt(ln,this,c),c<bt(rn,this).length&&bt(rn,this).splice(c)),bt(rn,this).push(l)}undo(){if(-1===bt(ln,this))return;yt(an,this,!0);const{undo:t,post:e}=bt(rn,this)[bt(ln,this)];t(),null===e||void 0===e||e(),yt(an,this,!1),yt(ln,this,bt(ln,this)-1)}redo(){if(bt(ln,this)<bt(rn,this).length-1){yt(ln,this,bt(ln,this)+1),yt(an,this,!0);const{cmd:t,post:e}=bt(rn,this)[bt(ln,this)];t(),null===e||void 0===e||e(),yt(an,this,!1)}}hasSomethingToUndo(){return-1!==bt(ln,this)}hasSomethingToRedo(){return bt(ln,this)<bt(rn,this).length-1}cleanType(t){if(-1!==bt(ln,this)){for(let e=bt(ln,this);e>=0;e--)if(bt(rn,this)[e].type!==t)return bt(rn,this).splice(e+1,bt(ln,this)-e),void yt(ln,this,e);bt(rn,this).length=0,yt(ln,this,-1)}}destroy(){yt(rn,this,null)}}var hn=new WeakSet;class dn{constructor(t){ft(this,hn),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=ze.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(vt(hn,this,un).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||ci(e))}}function un(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}class pn{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,ui(n))}e.remove()}(t),Pe(this,"_colors",t)}convert(t){const e=ui(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,n]of this._colors)if(n.every((t,i)=>t===e[i]))return pn._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?He.makeHexColor(...e):t}}(0,Wt.A)(pn,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var gn=new WeakMap,fn=new WeakMap,mn=new WeakMap,vn=new WeakMap,wn=new WeakMap,bn=new WeakMap,yn=new WeakMap,An=new WeakMap,En=new WeakMap,xn=new WeakMap,_n=new WeakMap,kn=new WeakMap,Cn=new WeakMap,Sn=new WeakMap,Mn=new WeakMap,Tn=new WeakMap,Pn=new WeakMap,Ln=new WeakMap,Rn=new WeakMap,Dn=new WeakMap,Fn=new WeakMap,In=new WeakMap,Nn=new WeakMap,On=new WeakMap,Bn=new WeakMap,Wn=new WeakMap,zn=new WeakMap,jn=new WeakMap,Hn=new WeakMap,Un=new WeakMap,Vn=new WeakMap,Gn=new WeakMap,qn=new WeakMap,Xn=new WeakMap,Yn=new WeakMap,Kn=new WeakMap,Qn=new WeakMap,Zn=new WeakMap,Jn=new WeakMap,$n=new WeakMap,ts=new WeakMap,es=new WeakMap,is=new WeakMap,ns=new WeakMap,ss=new WeakMap,rs=new WeakMap,as=new WeakMap,os=new WeakMap,ls=new WeakMap,cs=new WeakSet;class hs{static get _keyboardManager(){const t=hs.prototype,e=t=>bt(rs,t).contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),i=(t,e)=>{let{target:i}=e;if(i instanceof HTMLInputElement){const{type:t}=i;return"text"!==t&&"number"!==t}return!0},n=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return Pe(this,"_keyboardManager",new dn([[["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,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&bt(rs,t).contains(i)&&!t.isEnterHandled}}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&bt(rs,t).contains(document.activeElement)}}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}]]))}constructor(t,e,i,n,s,r,a,o,l,c,h,d,u,p,g,f){ft(this,cs),mt(this,gn,new AbortController),mt(this,fn,null),mt(this,mn,null),mt(this,vn,new Map),mt(this,wn,new Map),mt(this,bn,null),mt(this,yn,null),mt(this,An,null),mt(this,En,new cn),mt(this,xn,null),mt(this,_n,null),mt(this,kn,null),mt(this,Cn,0),mt(this,Sn,new Set),mt(this,Mn,null),mt(this,Tn,null),mt(this,Pn,new Set),(0,Wt.A)(this,"_editorUndoBar",null),mt(this,Ln,!1),mt(this,Rn,!1),mt(this,Dn,!1),mt(this,Fn,null),mt(this,In,null),mt(this,Nn,null),mt(this,On,null),mt(this,Bn,!1),mt(this,Wn,null),mt(this,zn,new Zi),mt(this,jn,!1),mt(this,Hn,!1),mt(this,Un,!1),mt(this,Vn,null),mt(this,Gn,null),mt(this,qn,null),mt(this,Xn,null),mt(this,Yn,null),mt(this,Kn,te.NONE),mt(this,Qn,new Set),mt(this,Zn,null),mt(this,Jn,null),mt(this,$n,null),mt(this,ts,null),mt(this,es,null),mt(this,is,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),mt(this,ns,[0,0]),mt(this,ss,null),mt(this,rs,null),mt(this,as,null),mt(this,os,null),mt(this,ls,null);const m=this._signal=bt(gn,this).signal;yt(rs,this,t),yt(as,this,e),yt(os,this,i),yt(bn,this,n),yt(xn,this,s),yt(Jn,this,r),yt(es,this,o),this._eventBus=a,a._on("editingaction",this.onEditingAction.bind(this),{signal:m}),a._on("pagechanging",this.onPageChanging.bind(this),{signal:m}),a._on("scalechanging",this.onScaleChanging.bind(this),{signal:m}),a._on("rotationchanging",this.onRotationChanging.bind(this),{signal:m}),a._on("setpreference",this.onSetPreference.bind(this),{signal:m}),a._on("switchannotationeditorparams",t=>this.updateParams(t.type,t.value),{signal:m}),window.addEventListener("pointerdown",()=>{yt(Hn,this,!0)},{capture:!0,signal:m}),window.addEventListener("pointerup",()=>{yt(Hn,this,!1)},{capture:!0,signal:m}),vt(cs,this,ms).call(this),vt(cs,this,xs).call(this),vt(cs,this,bs).call(this),yt(yn,this,o.annotationStorage),yt(Fn,this,o.filterFactory),yt($n,this,l),yt(On,this,c||null),yt(Ln,this,h),yt(Rn,this,d),yt(Dn,this,u),yt(Yn,this,p||null),this.viewParameters={realScale:ti.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=g||null,this._supportsPinchToZoom=!1!==f,null===s||void 0===s||s.setSidebarUiManager(this)}destroy(){var t,e,i,n,s,r,a,o,l;null===(t=bt(ls,this))||void 0===t||t.resolve(),yt(ls,this,null),null===(e=bt(gn,this))||void 0===e||e.abort(),yt(gn,this,null),this._signal=null;for(const c of bt(wn,this).values())c.destroy();bt(wn,this).clear(),bt(vn,this).clear(),bt(Pn,this).clear(),null===(i=bt(Xn,this))||void 0===i||i.clear(),yt(fn,this,null),bt(Qn,this).clear(),bt(En,this).destroy(),null===(n=bt(bn,this))||void 0===n||n.destroy(),null===(s=bt(xn,this))||void 0===s||s.destroy(),null===(r=bt(Jn,this))||void 0===r||r.destroy(),null===(a=bt(Wn,this))||void 0===a||a.hide(),yt(Wn,this,null),null===(o=bt(qn,this))||void 0===o||o.destroy(),yt(qn,this,null),yt(mn,this,null),bt(In,this)&&(clearTimeout(bt(In,this)),yt(In,this,null)),bt(ss,this)&&(clearTimeout(bt(ss,this)),yt(ss,this,null)),null===(l=this._editorUndoBar)||void 0===l||l.destroy(),yt(es,this,null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return bt(Yn,this)}get useNewAltTextFlow(){return bt(Rn,this)}get useNewAltTextWhenAddingImage(){return bt(Dn,this)}get hcmFilter(){return Pe(this,"hcmFilter",bt($n,this)?bt(Fn,this).addHCMFilter(bt($n,this).foreground,bt($n,this).background):"none")}get direction(){return Pe(this,"direction",getComputedStyle(bt(rs,this)).direction)}get _highlightColors(){return Pe(this,"_highlightColors",bt(On,this)?new Map(bt(On,this).split(",").map(t=>((t=t.split("=").map(t=>t.trim()))[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return Pe(this,"highlightColors",null);const e=new Map,i=!!bt($n,this);for(const[n,s]of t){const t=n.endsWith("_HCM");i&&t?e.set(n.replace("_HCM",""),s):i||t||e.set(n,s)}return Pe(this,"highlightColors",e)}get highlightColorNames(){return Pe(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),yt(kn,this,t)}setMainHighlightColorPicker(t){yt(qn,this,t)}editAltText(t){var e;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null===(e=bt(bn,this))||void 0===e||e.editAltText(this,t,i)}hasCommentManager(){return!!bt(xn,this)}editComment(t,e,i,n){var s;null===(s=bt(xn,this))||void 0===s||s.showDialog(this,t,e,i,n)}selectComment(t,e){const i=bt(wn,this).get(t),n=null===i||void 0===i?void 0:i.getEditorByUID(e);null===n||void 0===n||n.toggleComment(!0,!0)}updateComment(t){var e;null===(e=bt(xn,this))||void 0===e||e.updateComment(t.getData())}updatePopupColor(t){var e;null===(e=bt(xn,this))||void 0===e||e.updatePopupColor(t)}removeComment(t){var e;null===(e=bt(xn,this))||void 0===e||e.removeComments([t.uid])}toggleComment(t,e){var i;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;null===(i=bt(xn,this))||void 0===i||i.toggleCommentPopup(t,e,n)}makeCommentColor(t,e){var i;return t&&(null===(i=bt(xn,this))||void 0===i?void 0:i.makeCommentColor(t,e))||null}getCommentDialogElement(){var t;return(null===(t=bt(xn,this))||void 0===t?void 0:t.dialogElement)||null}async waitForEditorsRendered(t){if(bt(wn,this).has(t-1))return;const{resolve:e,promise:i}=Promise.withResolvers(),n=i=>{i.pageNumber===t&&(this._eventBus._off("editorsrendered",n),e())};this._eventBus.on("editorsrendered",n),await i}getSignature(t){var e;null===(e=bt(Jn,this))||void 0===e||e.getSignature({uiManager:this,editor:t})}get signatureManager(){return bt(Jn,this)}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference(t){let{name:e,value:i}=t;if("enableNewAltTextWhenAddingImage"===e)yt(Dn,this,i)}onPageChanging(t){let{pageNumber:e}=t;yt(Cn,this,e-1)}focusMainContainer(){bt(rs,this).focus()}findParent(t,e){for(const i of bt(wn,this).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(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];bt(as,this).classList.toggle("noUserSelect",t)}addShouldRescale(t){bt(Pn,this).add(t)}removeShouldRescale(t){bt(Pn,this).delete(t)}onScaleChanging(t){var e;let{scale:i}=t;this.commitOrRemove(),this.viewParameters.realScale=i*ti.PDF_TO_CSS_UNITS;for(const n of bt(Pn,this))n.onScaleChanging();null===(e=bt(kn,this))||void 0===e||e.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:n,anchorOffset:s,focusNode:r,focusOffset:a}=i,o=i.toString(),l=vt(cs,this,ds).call(this,i).closest(".textLayer"),c=this.getSelectionBoxes(l);if(!c)return;i.empty();const h=vt(cs,this,us).call(this,l),d=bt(Kn,this)===te.NONE,u=()=>{const i=null===h||void 0===h?void 0:h.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:c,anchorNode:n,anchorOffset:s,focusNode:r,focusOffset:a,text:o});d&&this.showAllEditors("highlight",!0,!0),e&&(null===i||void 0===i||i.editComment())};d?this.switchToMode(te.HIGHLIGHT,u):u()}commentSelection(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.highlightSelection(t,!0)}getAndRemoveDataFromAnnotationStorage(t){if(!bt(yn,this))return null;const e="".concat($t).concat(t),i=bt(yn,this).getRawValue(e);return i&&bt(yn,this).remove(e),i}addToAnnotationStorage(t){t.isEmpty()||!bt(yn,this)||bt(yn,this).has(t.id)||bt(yn,this).setValue(t.id,t)}a11yAlert(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=bt(os,this);i&&(i.setAttribute("data-l10n-id",t),e?i.setAttribute("data-l10n-args",JSON.stringify(e)):i.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,bt(Bn,this)&&(yt(Bn,this,!1),vt(cs,this,fs).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of bt(Qn,this))if(e.div.contains(t)){yt(Gn,this,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!bt(Gn,this))return;const[t,e]=bt(Gn,this);yt(Gn,this,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){vt(cs,this,bs).call(this),vt(cs,this,As).call(this)}removeEditListeners(){vt(cs,this,ys).call(this),vt(cs,this,Es).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of bt(Tn,this))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 bt(Tn,this))if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){var e;if(t.preventDefault(),null===(e=bt(fn,this))||void 0===e||e.commitOrRemove(),!this.hasSelection)return;const i=[];for(const n of bt(Qn,this)){const t=n.serialize(!0);t&&i.push(t)}0!==i.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const r of e.items)for(const t of bt(Tn,this))if(t.isHandlingMimeForPasting(r.type))return void t.paste(r,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(s){return void ke('paste: "'.concat(s.message,'".'))}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const t=[];for(const r of i){const e=await n.deserialize(r);if(!e)return;t.push(e)}const e=()=>{for(const e of t)vt(cs,this,Ms).call(this,e);vt(cs,this,Ls).call(this,t)},s=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:s,mustExec:!0})}catch(s){ke('paste: "'.concat(s.message,'".'))}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),bt(Kn,this)===te.NONE||this.isEditorHandlingKeyboard||hs._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,bt(Bn,this)&&(yt(Bn,this,!1),vt(cs,this,fs).call(this,"main_toolbar")))}onEditingAction(t){let{name:e}=t;switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu")}}setEditingState(t){t?(vt(cs,this,vs).call(this),vt(cs,this,As).call(this),vt(cs,this,_s).call(this,{isEditing:bt(Kn,this)!==te.NONE,isEmpty:vt(cs,this,Ps).call(this),hasSomethingToUndo:bt(En,this).hasSomethingToUndo(),hasSomethingToRedo:bt(En,this).hasSomethingToRedo(),hasSelectedEditor:!1})):(vt(cs,this,ws).call(this),vt(cs,this,Es).call(this),vt(cs,this,_s).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!bt(Tn,this)){yt(Tn,this,t);for(const t of bt(Tn,this))vt(cs,this,ks).call(this,t.defaultPropertiesToUpdate)}}getId(){return bt(zn,this).id}get currentLayer(){return bt(wn,this).get(bt(Cn,this))}getLayer(t){return bt(wn,this).get(t)}get currentPageIndex(){return bt(Cn,this)}addLayer(t){bt(wn,this).set(t.pageIndex,t),bt(jn,this)?t.enable():t.disable()}removeLayer(t){bt(wn,this).delete(t.pageIndex)}async updateMode(t){var e,i;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(bt(Kn,this)!==t&&(!bt(ls,this)||(await bt(ls,this).promise,bt(ls,this)))){var o,l;if(yt(ls,this,Promise.withResolvers()),null===(e=bt(kn,this))||void 0===e||e.commitOrRemove(),bt(Kn,this)===te.POPUP)null===(o=bt(xn,this))||void 0===o||o.hideSidebar();if(null===(i=bt(xn,this))||void 0===i||i.destroyPopup(),yt(Kn,this,t),t===te.NONE){var c;this.setEditingState(!1),vt(cs,this,Ss).call(this);for(const t of bt(vn,this).values())t.hideStandaloneCommentButton();return null===(c=this._editorUndoBar)||void 0===c||c.hide(),this.toggleComment(null),void bt(ls,this).resolve()}for(const t of bt(vn,this).values())t.addStandaloneCommentButton();if(t===te.SIGNATURE)await(null===(l=bt(Jn,this))||void 0===l?void 0:l.loadSignatures());this.setEditingState(!0),await vt(cs,this,Cs).call(this),this.unselectAll();for(const e of bt(wn,this).values())e.updateMode(t);if(t===te.POPUP){var h;bt(mn,this)||yt(mn,this,await bt(es,this).getAnnotationsByType(new Set(bt(Tn,this).map(t=>t._editorType))));const t=new Set,e=[];for(const i of bt(vn,this).values()){const{annotationElementId:n,hasComment:s,deleted:r}=i;n&&t.add(n),s&&!r&&e.push(i.getData())}for(const i of bt(mn,this)){const{id:n,popupRef:s,contentsObj:r}=i;s&&null!==r&&void 0!==r&&r.str&&!t.has(n)&&!bt(Sn,this).has(n)&&e.push(i)}null===(h=bt(xn,this))||void 0===h||h.showSidebar(e)}if(!n)return s&&this.addNewEditorFromKeyboard(),void bt(ls,this).resolve();for(const t of bt(vn,this).values())t.uid===n?(this.setSelected(t),a?t.editComment():r?t.enterInEditMode():t.focus()):t.unselect();bt(ls,this).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==bt(Kn,this)&&this._eventBus.dispatch("switchannotationeditormode",(0,pt.A)({source:this},t))}updateParams(t,e){if(bt(Tn,this)){switch(t){case ee.CREATE:return void this.currentLayer.addNewEditor(e);case ee.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(bt(ts,this)||yt(ts,this,new Map)).set(t,e),this.showAllEditors("highlight",e)}if(this.hasSelection)for(const i of bt(Qn,this))i.updateParams(t,e);else for(const i of bt(Tn,this))i.updateDefaultParams(t,e)}}showAllEditors(t,e){var i,n;for(const s of bt(vn,this).values())s.editorType===t&&s.show(e);(null===(i=null===(n=bt(ts,this))||void 0===n?void 0:n.get(ee.HIGHLIGHT_SHOW_ALL))||void 0===i||i)!==e&&vt(cs,this,ks).call(this,[[ee.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(bt(Un,this)!==t){yt(Un,this,t);for(const e of bt(wn,this).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}*getEditors(t){for(const e of bt(vn,this).values())e.pageIndex===t&&(yield e)}getEditor(t){return bt(vn,this).get(t)}addEditor(t){bt(vn,this).set(t.id,t)}removeEditor(t){var e,i;(t.div.contains(document.activeElement)&&(bt(In,this)&&clearTimeout(bt(In,this)),yt(In,this,setTimeout(()=>{this.focusMainContainer(),yt(In,this,null)},0))),bt(vn,this).delete(t.id),t.annotationElementId)&&(null===(e=bt(Xn,this))||void 0===e||e.delete(t.annotationElementId));(this.unselect(t),t.annotationElementId&&bt(Sn,this).has(t.annotationElementId))||(null===(i=bt(yn,this))||void 0===i||i.remove(t.id))}addDeletedAnnotationElement(t){bt(Sn,this).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return bt(Sn,this).has(t)}removeDeletedAnnotationElement(t){bt(Sn,this).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){bt(fn,this)!==t&&(yt(fn,this,t),t&&vt(cs,this,ks).call(this,t.propertiesToUpdate))}updateUI(t){wt(cs,this,Ts)===t&&vt(cs,this,ks).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){vt(cs,this,ks).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(bt(Qn,this).has(t))return bt(Qn,this).delete(t),t.unselect(),void vt(cs,this,_s).call(this,{hasSelectedEditor:this.hasSelection});bt(Qn,this).add(t),t.select(),vt(cs,this,ks).call(this,t.propertiesToUpdate),vt(cs,this,_s).call(this,{hasSelectedEditor:!0})}setSelected(t){var e;this.updateToolbar({mode:t.mode,editId:t.id}),null===(e=bt(kn,this))||void 0===e||e.commitOrRemove();for(const i of bt(Qn,this))i!==t&&i.unselect();bt(Qn,this).clear(),bt(Qn,this).add(t),t.select(),vt(cs,this,ks).call(this,t.propertiesToUpdate),vt(cs,this,_s).call(this,{hasSelectedEditor:!0})}isSelected(t){return bt(Qn,this).has(t)}get firstSelectedEditor(){return bt(Qn,this).values().next().value}unselect(t){t.unselect(),bt(Qn,this).delete(t),vt(cs,this,_s).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==bt(Qn,this).size}get isEnterHandled(){return 1===bt(Qn,this).size&&this.firstSelectedEditor.isEnterHandled}undo(){var t;bt(En,this).undo(),vt(cs,this,_s).call(this,{hasSomethingToUndo:bt(En,this).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:vt(cs,this,Ps).call(this)}),null===(t=this._editorUndoBar)||void 0===t||t.hide()}redo(){bt(En,this).redo(),vt(cs,this,_s).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:bt(En,this).hasSomethingToRedo(),isEmpty:vt(cs,this,Ps).call(this)})}addCommands(t){bt(En,this).add(t),vt(cs,this,_s).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:vt(cs,this,Ps).call(this)})}cleanUndoStack(t){bt(En,this).cleanType(t)}delete(){var t;this.commitOrRemove();const e=null===(t=this.currentLayer)||void 0===t?void 0:t.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const i=e?[e]:[...bt(Qn,this)],n=()=>{for(const t of i)vt(cs,this,Ms).call(this,t)};this.addCommands({cmd:()=>{var t;null===(t=this._editorUndoBar)||void 0===t||t.show(n,1===i.length?i[0].editorType:i.length);for(const e of i)e.remove()},undo:n,mustExec:!0})}commitOrRemove(){var t;null===(t=bt(fn,this))||void 0===t||t.commitOrRemove()}hasSomethingToControl(){return bt(fn,this)||this.hasSelection}selectAll(){for(const t of bt(Qn,this))t.commit();vt(cs,this,Ls).call(this,bt(vn,this).values())}unselectAll(){var t;if((!bt(fn,this)||(bt(fn,this).commitOrRemove(),bt(Kn,this)===te.NONE))&&(null===(t=bt(kn,this))||void 0===t||!t.commitOrRemove())&&this.hasSelection){for(const t of bt(Qn,this))t.unselect();bt(Qn,this).clear(),vt(cs,this,_s).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;bt(ns,this)[0]+=t,bt(ns,this)[1]+=e;const[i,n]=bt(ns,this),s=[...bt(Qn,this)];bt(ss,this)&&clearTimeout(bt(ss,this)),yt(ss,this,setTimeout(()=>{yt(ss,this,null),bt(ns,this)[0]=bt(ns,this)[1]=0,this.addCommands({cmd:()=>{for(const t of s)bt(vn,this).has(t.id)&&(t.translateInPage(i,n),t.translationDone())},undo:()=>{for(const t of s)bt(vn,this).has(t.id)&&(t.translateInPage(-i,-n),t.translationDone())},mustExec:!1})},1e3));for(const r of s)r.translateInPage(t,e),r.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),yt(Mn,this,new Map);for(const t of bt(Qn,this))bt(Mn,this).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!bt(Mn,this))return!1;this.disableUserSelect(!1);const t=bt(Mn,this);yt(Mn,this,null);let e=!1;for(const[{x:n,y:s,pageIndex:r},a]of t)a.newX=n,a.newY=s,a.newPageIndex=r,e||(e=n!==a.savedX||s!==a.savedY||r!==a.savedPageIndex);if(!e)return!1;const i=(t,e,i,n)=>{if(bt(vn,this).has(t.id)){const s=bt(wn,this).get(n);s?t._setParentAndPosition(s,e,i):(t.pageIndex=n,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(bt(Mn,this))for(const i of bt(Mn,this).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?void 0:t.shouldGetKeyboardEvents())||1===bt(Qn,this).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return bt(fn,this)===t}getActive(){return bt(fn,this)}getMode(){return bt(Kn,this)}isEditingMode(){return bt(Kn,this)!==te.NONE}get imageManager(){return Pe(this,"imageManager",new nn)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let l=0,c=e.rangeCount;l<c;l++)if(!t.contains(e.getRangeAt(l).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 l=0,c=e.rangeCount;l<c;l++){const t=e.getRangeAt(l);if(!t.collapsed)for(const{x:e,y:i,width:n,height:s}of t.getClientRects())0!==n&&0!==s&&o.push(a(e,i,n,s))}return 0===o.length?null:o}addChangedExistingAnnotation(t){let{annotationElementId:e,id:i}=t;(bt(An,this)||yt(An,this,new Map)).set(e,i)}removeChangedExistingAnnotation(t){var e;let{annotationElementId:i}=t;null===(e=bt(An,this))||void 0===e||e.delete(i)}renderAnnotationElement(t){var e;const i=null===(e=bt(An,this))||void 0===e?void 0:e.get(t.data.id);if(!i)return;const n=bt(yn,this).getRawValue(i);n&&(bt(Kn,this)!==te.NONE||n.hasBeenModified)&&n.renderAnnotationElement(t)}setMissingCanvas(t,e,i){var n;const s=null===(n=bt(Xn,this))||void 0===n?void 0:n.get(t);s&&(s.setCanvas(e,i),bt(Xn,this).delete(t))}addMissingCanvas(t,e){(bt(Xn,this)||yt(Xn,this,new Map)).set(t,e)}}function ds(t){let{anchorNode:e}=t;return e.nodeType===Node.TEXT_NODE?e.parentElement:e}function us(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of bt(wn,this).values())if(i.hasTextLayer(t))return i;return null}function ps(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=vt(cs,this,ds).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(bt(Wn,this)||yt(Wn,this,new Gi(this)),bt(Wn,this).show(e,i,"ltr"===this.direction))}function gs(){var t;const e=document.getSelection();if(!e||e.isCollapsed){var i;if(bt(Zn,this))null===(i=bt(Wn,this))||void 0===i||i.hide(),yt(Zn,this,null),vt(cs,this,_s).call(this,{hasSelectedText:!1});return}const{anchorNode:n}=e;if(n===bt(Zn,this))return;const s=vt(cs,this,ds).call(this,e).closest(".textLayer");var r;if(s){if(null===(t=bt(Wn,this))||void 0===t||t.hide(),yt(Zn,this,n),vt(cs,this,_s).call(this,{hasSelectedText:!0}),(bt(Kn,this)===te.HIGHLIGHT||bt(Kn,this)===te.NONE)&&(bt(Kn,this)===te.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),yt(Bn,this,this.isShiftKeyDown),!this.isShiftKeyDown)){const t=bt(Kn,this)===te.HIGHLIGHT?vt(cs,this,us).call(this,s):null;if(null===t||void 0===t||t.toggleDrawing(),bt(Hn,this)){const e=new AbortController,i=this.combinedSignal(e),n=i=>{"pointerup"===i.type&&0!==i.button||(e.abort(),null===t||void 0===t||t.toggleDrawing(!0),"pointerup"===i.type&&vt(cs,this,fs).call(this,"main_toolbar"))};window.addEventListener("pointerup",n,{signal:i}),window.addEventListener("blur",n,{signal:i})}else null===t||void 0===t||t.toggleDrawing(!0),vt(cs,this,fs).call(this,"main_toolbar")}}else bt(Zn,this)&&(null===(r=bt(Wn,this))||void 0===r||r.hide(),yt(Zn,this,null),vt(cs,this,_s).call(this,{hasSelectedText:!1}))}function fs(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";bt(Kn,this)===te.HIGHLIGHT?this.highlightSelection(t):bt(Ln,this)&&vt(cs,this,ps).call(this)}function ms(){document.addEventListener("selectionchange",vt(cs,this,gs).bind(this),{signal:this._signal})}function vs(){if(bt(Nn,this))return;yt(Nn,this,new AbortController);const t=this.combinedSignal(bt(Nn,this));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}function ws(){var t;null===(t=bt(Nn,this))||void 0===t||t.abort(),yt(Nn,this,null)}function bs(){if(bt(Vn,this))return;yt(Vn,this,new AbortController);const t=this.combinedSignal(bt(Vn,this));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}function ys(){var t;null===(t=bt(Vn,this))||void 0===t||t.abort(),yt(Vn,this,null)}function As(){if(bt(_n,this))return;yt(_n,this,new AbortController);const t=this.combinedSignal(bt(_n,this));document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}function Es(){var t;null===(t=bt(_n,this))||void 0===t||t.abort(),yt(_n,this,null)}function xs(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}function _s(t){Object.entries(t).some(t=>{let[e,i]=t;return bt(is,this)[e]!==i})&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(bt(is,this),t)}),bt(Kn,this)===te.HIGHLIGHT&&!1===t.hasSelectedEditor&&vt(cs,this,ks).call(this,[[ee.HIGHLIGHT_FREE,!0]]))}function ks(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}async function Cs(){if(!bt(jn,this)){yt(jn,this,!0);const t=[];for(const e of bt(wn,this).values())t.push(e.enable());await Promise.all(t);for(const e of bt(vn,this).values())e.enable()}}function Ss(){if(this.unselectAll(),bt(jn,this)){yt(jn,this,!1);for(const t of bt(wn,this).values())t.disable();for(const t of bt(vn,this).values())t.disable()}}function Ms(t){const e=bt(wn,this).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}function Ts(t){let e=null;for(e of bt(Qn,t));return e}function Ps(){if(0===bt(vn,this).size)return!0;if(1===bt(vn,this).size)for(const t of bt(vn,this).values())return t.isEmpty();return!1}function Ls(t){for(const e of bt(Qn,this))e.unselect();bt(Qn,this).clear();for(const e of t)e.isEmpty()||(bt(Qn,this).add(e),e.select());vt(cs,this,_s).call(this,{hasSelectedEditor:this.hasSelection})}(0,Wt.A)(hs,"TRANSLATE_SMALL",1),(0,Wt.A)(hs,"TRANSLATE_BIG",10);var Rs=new WeakMap,Ds=new WeakMap,Fs=new WeakMap,Is=new WeakMap,Ns=new WeakMap,Os=new WeakMap,Bs=new WeakMap,Ws=new WeakMap,zs=new WeakMap,js=new WeakMap,Hs=new WeakMap,Us=new WeakMap,Vs=new WeakSet;class Gs{constructor(t){ft(this,Vs),mt(this,Rs,null),mt(this,Ds,!1),mt(this,Fs,null),mt(this,Is,null),mt(this,Ns,null),mt(this,Os,null),mt(this,Bs,!1),mt(this,Ws,null),mt(this,zs,null),mt(this,js,null),mt(this,Hs,null),mt(this,Us,!1),yt(zs,this,t),yt(Us,this,t._uiManager.useNewAltTextFlow),Ys._||(Ys._=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(t){var e;null!==(e=Gs._l10n)&&void 0!==e||(Gs._l10n=t)}async render(){const t=yt(Fs,this,document.createElement("button"));t.className="altText",t.tabIndex="0";const e=yt(Is,this,document.createElement("span"));t.append(e),bt(Us,this)?(t.classList.add("new"),t.setAttribute("data-l10n-id",Ys._.missing),e.setAttribute("data-l10n-id",Ys._["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=bt(zs,this)._uiManager._signal;t.addEventListener("contextmenu",li,{signal:i}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const n=t=>{t.preventDefault(),bt(zs,this)._uiManager.editAltText(bt(zs,this)),bt(Us,this)&&bt(zs,this)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:wt(Vs,this,qs)}})};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(yt(Bs,this,!0),n(e))},{signal:i}),await vt(Vs,this,Xs).call(this),t}finish(){bt(Fs,this)&&(bt(Fs,this).focus({focusVisible:bt(Bs,this)}),yt(Bs,this,!1))}isEmpty(){return bt(Us,this)?null===bt(Rs,this):!bt(Rs,this)&&!bt(Ds,this)}hasData(){return bt(Us,this)?null!==bt(Rs,this)||!!bt(js,this):this.isEmpty()}get guessedText(){return bt(js,this)}async setGuessedText(t){null===bt(Rs,this)&&(yt(js,this,t),yt(Hs,this,await Gs._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),vt(Vs,this,Xs).call(this))}toggleAltTextBadge(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e;if(!bt(Us,this)||bt(Rs,this))return null===(e=bt(Ws,this))||void 0===e||e.remove(),void yt(Ws,this,null);if(!bt(Ws,this)){const t=yt(Ws,this,document.createElement("div"));t.className="noAltTextBadge",bt(zs,this).div.append(t)}bt(Ws,this).classList.toggle("hidden",!t)}serialize(t){let e=bt(Rs,this);return t||bt(js,this)!==e||(e=bt(Hs,this)),{altText:e,decorative:bt(Ds,this),guessedText:bt(js,this),textWithDisclaimer:bt(Hs,this)}}get data(){return{altText:bt(Rs,this),decorative:bt(Ds,this)}}set data(t){let{altText:e,decorative:i,guessedText:n,textWithDisclaimer:s,cancel:r=!1}=t;n&&(yt(js,this,n),yt(Hs,this,s)),bt(Rs,this)===e&&bt(Ds,this)===i||(r||(yt(Rs,this,e),yt(Ds,this,i)),vt(Vs,this,Xs).call(this))}toggle(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];bt(Fs,this)&&(!t&&bt(Os,this)&&(clearTimeout(bt(Os,this)),yt(Os,this,null)),bt(Fs,this).disabled=!t)}shown(){bt(zs,this)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:wt(Vs,this,qs)}})}destroy(){var t,e;null===(t=bt(Fs,this))||void 0===t||t.remove(),yt(Fs,this,null),yt(Is,this,null),yt(Ns,this,null),null===(e=bt(Ws,this))||void 0===e||e.remove(),yt(Ws,this,null)}}function qs(t){return(bt(Rs,t)?"added":null===bt(Rs,t)&&t.guessedText&&"review")||"missing"}async function Xs(){const t=bt(Fs,this);if(!t)return;if(bt(Us,this)){var e,i;if(t.classList.toggle("done",!!bt(Rs,this)),t.setAttribute("data-l10n-id",Ys._[wt(Vs,this,qs)]),null===(e=bt(Is,this))||void 0===e||e.setAttribute("data-l10n-id",Ys._["".concat(wt(Vs,this,qs),"-label")]),!bt(Rs,this))return void(null===(i=bt(Ns,this))||void 0===i||i.remove())}else{var n;if(!bt(Rs,this)&&!bt(Ds,this))return t.classList.remove("done"),void(null===(n=bt(Ns,this))||void 0===n||n.remove());t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let s=bt(Ns,this);if(!s){yt(Ns,this,s=document.createElement("span")),s.className="tooltip",s.setAttribute("role","tooltip"),s.id="alt-text-tooltip-".concat(bt(zs,this).id);const e=100,i=bt(zs,this)._uiManager._signal;i.addEventListener("abort",()=>{clearTimeout(bt(Os,this)),yt(Os,this,null)},{once:!0}),t.addEventListener("mouseenter",()=>{yt(Os,this,setTimeout(()=>{yt(Os,this,null),bt(Ns,this).classList.add("show"),bt(zs,this)._reportTelemetry({action:"alt_text_tooltip"})},e))},{signal:i}),t.addEventListener("mouseleave",()=>{var t;bt(Os,this)&&(clearTimeout(bt(Os,this)),yt(Os,this,null)),null===(t=bt(Ns,this))||void 0===t||t.classList.remove("show")},{signal:i})}bt(Ds,this)?s.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(s.removeAttribute("data-l10n-id"),s.textContent=bt(Rs,this)),s.parentNode||t.append(s);const r=bt(zs,this).getElementForAltText();null===r||void 0===r||r.setAttribute("aria-describedby",s.id)}var Ys={_:null};(0,Wt.A)(Gs,"_l10n",null);var Ks=new WeakMap,Qs=new WeakMap,Zs=new WeakMap,Js=new WeakMap,$s=new WeakMap,tr=new WeakMap,er=new WeakMap,ir=new WeakMap,nr=new WeakMap,sr=new WeakMap,rr=new WeakSet;class ar{constructor(t){ft(this,rr),mt(this,Ks,null),mt(this,Qs,null),mt(this,Zs,!1),mt(this,Js,null),mt(this,$s,null),mt(this,tr,null),mt(this,er,null),mt(this,ir,null),mt(this,nr,!1),mt(this,sr,null),yt(Js,this,t)}renderForToolbar(){const t=yt(Qs,this,document.createElement("button"));return t.className="comment",vt(rr,this,or).call(this,t,!1)}renderForStandalone(){const t=yt(Ks,this,document.createElement("button"));t.className="annotationCommentButton";const e=bt(Js,this).commentButtonPosition;if(e){const{style:i}=t;i.insetInlineEnd="calc(".concat(100*("ltr"===bt(Js,this)._uiManager.direction?1-e[0]:e[0]),"% - var(--comment-button-dim))"),i.top="calc(".concat(100*e[1],"% - var(--comment-button-dim))");const n=bt(Js,this).commentButtonColor;n&&(i.backgroundColor=n)}return vt(rr,this,or).call(this,t,!0)}focusButton(){setTimeout(()=>{var t,e;null===(t=null!==(e=bt(Ks,this))&&void 0!==e?e:bt(Qs,this))||void 0===t||t.focus()},0)}onUpdatedColor(){if(!bt(Ks,this))return;const t=bt(Js,this).commentButtonColor;t&&(bt(Ks,this).style.backgroundColor=t),bt(Js,this)._uiManager.updatePopupColor(bt(Js,this))}get commentButtonWidth(){var t,e;return(null!==(t=null===(e=bt(Ks,this))||void 0===e?void 0:e.getBoundingClientRect().width)&&void 0!==t?t:0)/bt(Js,this).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(bt(sr,this))return bt(sr,this);if(!bt(Ks,this))return null;const{x:t,y:e,height:i}=bt(Ks,this).getBoundingClientRect(),{x:n,y:s,width:r,height:a}=bt(Js,this).parent.boundingClientRect;return[(t-n)/r,(e+i-s)/a]}set commentPopupPositionInLayer(t){yt(sr,this,t)}hasDefaultPopupPosition(){return null===bt(sr,this)}removeStandaloneCommentButton(){var t;null===(t=bt(Ks,this))||void 0===t||t.remove(),yt(Ks,this,null)}removeToolbarCommentButton(){var t;null===(t=bt(Qs,this))||void 0===t||t.remove(),yt(Qs,this,null)}setCommentButtonStates(t){let{selected:e,hasPopup:i}=t;bt(Ks,this)&&(bt(Ks,this).classList.toggle("selected",e),bt(Ks,this).ariaExpanded=i)}edit(t){const e=this.commentPopupPositionInLayer;let i,n;if(e)[i,n]=e;else{[i,n]=bt(Js,this).commentButtonPosition;const{width:t,height:e,x:s,y:r}=bt(Js,this);i=s+i*t,n=r+n*e}const s=bt(Js,this).parent.boundingClientRect,{x:r,y:a,width:o,height:l}=s;bt(Js,this)._uiManager.editComment(bt(Js,this),r+i*o,a+n*l,(0,pt.A)((0,pt.A)({},t),{},{parentDimensions:s}))}finish(){bt(Qs,this)&&(bt(Qs,this).focus({focusVisible:bt(Zs,this)}),yt(Zs,this,!1))}isDeleted(){return bt(nr,this)||""===bt(er,this)}isEmpty(){return null===bt(er,this)}hasBeenEdited(){return this.isDeleted()||bt(er,this)!==bt($s,this)}serialize(){return this.data}get data(){return{text:bt(er,this),richText:bt(tr,this),date:bt(ir,this),deleted:this.isDeleted()}}set data(t){if(t!==bt(er,this)&&yt(tr,this,null),null===t)return yt(er,this,""),void yt(nr,this,!0);yt(er,this,t),yt(ir,this,new Date),yt(nr,this,!1)}setInitialText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;yt($s,this,t),this.data=t,yt(ir,this,null),yt(tr,this,e)}shown(){}destroy(){var t,e;null===(t=bt(Qs,this))||void 0===t||t.remove(),yt(Qs,this,null),null===(e=bt(Ks,this))||void 0===e||e.remove(),yt(Ks,this,null),yt(er,this,""),yt(tr,this,null),yt(ir,this,null),yt(Js,this,null),yt(Zs,this,!1),yt(nr,this,!1)}}function or(t,e){if(!bt(Js,this)._uiManager.hasCommentManager())return null;t.tabIndex="0",t.ariaHasPopup="dialog",e?(t.ariaControls="commentPopup",t.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(t.ariaControlsElements=[bt(Js,this)._uiManager.getCommentDialogElement()],t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button"));const i=bt(Js,this)._uiManager._signal;if(!(i instanceof AbortSignal)||i.aborted)return t;t.addEventListener("contextmenu",li,{signal:i}),e&&(t.addEventListener("focusin",t=>{bt(Js,this)._focusEventsAllowed=!1,ci(t)},{capture:!0,signal:i}),t.addEventListener("focusout",t=>{bt(Js,this)._focusEventsAllowed=!0,ci(t)},{capture:!0,signal:i})),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const n=e=>{e.preventDefault(),t===bt(Qs,this)?this.edit():bt(Js,this).toggleComment(!0)};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(yt(Zs,this,!0),n(e))},{signal:i}),t.addEventListener("pointerenter",()=>{bt(Js,this).toggleComment(!1,!0)},{signal:i}),t.addEventListener("pointerleave",()=>{bt(Js,this).toggleComment(!1,!1)},{signal:i}),t}var lr=new WeakMap,cr=new WeakMap,hr=new WeakMap,dr=new WeakMap,ur=new WeakMap,pr=new WeakMap,gr=new WeakMap,fr=new WeakMap,mr=new WeakMap,vr=new WeakMap,wr=new WeakMap,br=new WeakMap,yr=new WeakSet;class Ar{constructor(t){let{container:e,isPinchingDisabled:i=null,isPinchingStopped:n=null,onPinchStart:s=null,onPinching:r=null,onPinchEnd:a=null,signal:o}=t;ft(this,yr),mt(this,lr,void 0),mt(this,cr,!1),mt(this,hr,null),mt(this,dr,void 0),mt(this,ur,void 0),mt(this,pr,void 0),mt(this,gr,void 0),mt(this,fr,null),mt(this,mr,void 0),mt(this,vr,null),mt(this,wr,void 0),mt(this,br,null),yt(lr,this,e),yt(hr,this,n),yt(dr,this,i),yt(ur,this,s),yt(pr,this,r),yt(gr,this,a),yt(wr,this,new AbortController),yt(mr,this,AbortSignal.any([o,bt(wr,this).signal])),e.addEventListener("touchstart",vt(yr,this,Er).bind(this),{passive:!1,signal:bt(mr,this)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/mi.pixelRatio}destroy(){var t,e;null===(t=bt(wr,this))||void 0===t||t.abort(),yt(wr,this,null),null===(e=bt(fr,this))||void 0===e||e.abort(),yt(fr,this,null)}}function Er(t){var e,i;if(null!==(e=bt(dr,this))&&void 0!==e&&e.call(this))return;if(1===t.touches.length){if(bt(fr,this))return;const t=yt(fr,this,new AbortController),e=AbortSignal.any([bt(mr,this),t.signal]),i=bt(lr,this),n={capture:!0,signal:e,passive:!1},s=t=>{var e;"touch"===t.pointerType&&(null===(e=bt(fr,this))||void 0===e||e.abort(),yt(fr,this,null))};return i.addEventListener("pointerdown",t=>{"touch"===t.pointerType&&(ci(t),s(t))},n),i.addEventListener("pointerup",s,n),void i.addEventListener("pointercancel",s,n)}if(!bt(br,this)){var n;yt(br,this,new AbortController);const t=AbortSignal.any([bt(mr,this),bt(br,this).signal]),e=bt(lr,this),i={signal:t,capture:!1,passive:!1};e.addEventListener("touchmove",vt(yr,this,xr).bind(this),i);const s=vt(yr,this,_r).bind(this);e.addEventListener("touchend",s,i),e.addEventListener("touchcancel",s,i),i.capture=!0,e.addEventListener("pointerdown",ci,i),e.addEventListener("pointermove",ci,i),e.addEventListener("pointercancel",ci,i),e.addEventListener("pointerup",ci,i),null===(n=bt(ur,this))||void 0===n||n.call(this)}if(ci(t),2!==t.touches.length||null!==(i=bt(hr,this))&&void 0!==i&&i.call(this))return void yt(vr,this,null);let[s,r]=t.touches;s.identifier>r.identifier&&([s,r]=[r,s]),yt(vr,this,{touch0X:s.screenX,touch0Y:s.screenY,touch1X:r.screenX,touch1Y:r.screenY})}function xr(t){var e;if(!bt(vr,this)||2!==t.touches.length)return;ci(t);let[i,n]=t.touches;i.identifier>n.identifier&&([i,n]=[n,i]);const{screenX:s,screenY:r}=i,{screenX:a,screenY:o}=n,l=bt(vr,this),{touch0X:c,touch0Y:h,touch1X:d,touch1Y:u}=l,p=d-c,g=u-h,f=a-s,m=o-r,v=Math.hypot(f,m)||1,w=Math.hypot(p,g)||1;if(!bt(cr,this)&&Math.abs(w-v)<=_t.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=s,l.touch0Y=r,l.touch1X=a,l.touch1Y=o,!bt(cr,this))return void yt(cr,this,!0);const b=[(s+a)/2,(r+o)/2];null===(e=bt(pr,this))||void 0===e||e.call(this,b,w,v)}function _r(t){if(!(t.touches.length>=2)){var e;if(bt(br,this))bt(br,this).abort(),yt(br,this,null),null===(e=bt(gr,this))||void 0===e||e.call(this);bt(vr,this)&&(ci(t),yt(vr,this,null),yt(cr,this,!1))}}_t=Ar;var kr=new WeakMap,Cr=new WeakMap,Sr=new WeakMap,Mr=new WeakMap,Tr=new WeakMap,Pr=new WeakMap,Lr=new WeakMap,Rr=new WeakMap,Dr=new WeakMap,Fr=new WeakMap,Ir=new WeakMap,Nr=new WeakMap,Or=new WeakMap,Br=new WeakMap,Wr=new WeakMap,zr=new WeakMap,jr=new WeakMap,Hr=new WeakMap,Ur=new WeakMap,Vr=new WeakMap,Gr=new WeakMap,qr=new WeakMap,Xr=new WeakMap,Yr=new WeakMap,Kr=new WeakMap,Qr=new WeakMap,Zr=new WeakSet;class Jr{static get _resizerKeyboardManager(){const t=Jr.prototype._resizeWithKeyboard,e=hs.TRANSLATE_SMALL,i=hs.TRANSLATE_BIG;return Pe(this,"_resizerKeyboardManager",new dn([[["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"],Jr.prototype._stopResizingWithKeyboard]]))}constructor(t){ft(this,Zr),mt(this,kr,null),mt(this,Cr,null),mt(this,Sr,null),mt(this,Mr,null),mt(this,Tr,null),mt(this,Pr,!1),mt(this,Lr,null),mt(this,Rr,""),mt(this,Dr,null),mt(this,Fr,null),mt(this,Ir,null),mt(this,Nr,null),mt(this,Or,null),mt(this,Br,""),mt(this,Wr,!1),mt(this,zr,null),mt(this,jr,!1),mt(this,Hr,!1),mt(this,Ur,!1),mt(this,Vr,null),mt(this,Gr,0),mt(this,qr,0),mt(this,Xr,null),mt(this,Yr,null),(0,Wt.A)(this,"isSelected",!1),(0,Wt.A)(this,"_isCopy",!1),(0,Wt.A)(this,"_editToolbar",null),(0,Wt.A)(this,"_initialOptions",Object.create(null)),(0,Wt.A)(this,"_initialData",null),(0,Wt.A)(this,"_isVisible",!0),(0,Wt.A)(this,"_uiManager",null),(0,Wt.A)(this,"_focusEventsAllowed",!0),mt(this,Kr,!1),mt(this,Qr,Jr._zIndex++),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,this.annotationElementId=t.annotationElementId||null,this.creationDate=t.creationDate||new Date,this.modificationDate=t.modificationDate||null;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:s,pageY:r}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[s,r];const[a,o]=this.parentDimensions;this.x=t.x/a,this.y=t.y/o,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return Pe(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new wa({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){var i;if(null!==(i=Jr._l10n)&&void 0!==i||(Jr._l10n=t),Jr._l10nResizer||(Jr._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),-1!==Jr._borderLineWidth)return;const n=getComputedStyle(document.documentElement);Jr._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Ce("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return bt(Kr,this)}set _isDraggable(t){var e;yt(Kr,this,t),null===(e=this.div)||void 0===e||e.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}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=bt(Qr,this)}setParent(t){var e;null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(vt(Zr,this,va).call(this),null===(e=bt(Nr,this))||void 0===e||e.remove(),yt(Nr,this,null));this.parent=t}focusin(t){this._focusEventsAllowed&&(bt(Wr,this)?yt(Wr,this,!1):this.parent.setSelected(this))}focusout(t){var e;if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const i=t.relatedTarget;null!==i&&void 0!==i&&i.closest("#".concat(this.id))||(t.preventDefault(),null!==(e=this.parent)&&void 0!==e&&e.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&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()}_moveAfterPaste(t,e){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n),this._onTranslated()}translate(t,e){vt(Zr,this,$r).call(this,this.parentDimensions,t,e)}translateInPage(t,e){bt(zr,this)||yt(zr,this,[this.x,this.y,this.width,this.height]),vt(Zr,this,$r).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){bt(zr,this)||yt(zr,this,[this.x,this.y,this.width,this.height]);const{div:i,parentDimensions:[n,s]}=this;if(this.x+=t/n,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:r,y:a}=this;const[o,l]=this.getBaseTranslation();r+=o,a+=l;const{style:c}=i;c.left="".concat((100*r).toFixed(2),"%"),c.top="".concat((100*a).toFixed(2),"%"),this._onTranslating(r,a),i.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!bt(zr,this)&&(bt(zr,this)[0]!==this.x||bt(zr,this)[1]!==this.y)}get _hasBeenResized(){return!!bt(zr,this)&&(bt(zr,this)[2]!==this.width||bt(zr,this)[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=Jr,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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rotation;const{div:{style:e},pageDimensions:[i,n]}=this;let{x:s,y:r,width:a,height:o}=this;if(a*=i,o*=n,s*=i,r*=n,this._mustFixPosition)switch(t){case 0:s=Ke(s,0,i-a),r=Ke(r,0,n-o);break;case 90:s=Ke(s,0,i-o),r=Ke(r,a,n);break;case 180:s=Ke(s,a,i),r=Ke(r,o,n);break;case 270:s=Ke(s,o,i),r=Ke(r,0,n-a)}this.x=s/=i,this.y=r/=n;const[l,c]=this.getBaseTranslation();s+=l,r+=c,e.left="".concat((100*s).toFixed(2),"%"),e.top="".concat((100*r).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(t,e){return ta.call(Jr,t,e,this.parentRotation)}pageTranslationToScreen(t,e){return ta.call(Jr,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;return[e*t,i*t]}setDims(){const{div:{style:t},width:e,height:i}=this;t.width="".concat((100*e).toFixed(2),"%"),t.height="".concat((100*i).toFixed(2),"%")}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(1e4*t)/1e4}_onResizing(){}altTextFinish(){var t;null===(t=bt(Sr,this))||void 0===t||t.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||bt(Hr,this))return this._editToolbar;this._editToolbar=new Fi(this),this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[e,i]of t)await this._editToolbar.addButton(e,i);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){var t;null===(t=this._editToolbar)||void 0===t||t.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){var t;null===(t=this._editToolbar)||void 0===t||t.removeButton("comment")}removeEditToolbar(){var t,e;null===(t=this._editToolbar)||void 0===t||t.remove(),this._editToolbar=null,null===(e=bt(Sr,this))||void 0===e||e.destroy()}addContainer(t){var e;const i=null===(e=this._editToolbar)||void 0===e?void 0:e.div;i?i.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return bt(Sr,this)||(Gs.initialize(Jr._l10n),yt(Sr,this,new Gs(this)),bt(kr,this)&&(bt(Sr,this).data=bt(kr,this),yt(kr,this,null))),bt(Sr,this)}get altTextData(){var t;return null===(t=bt(Sr,this))||void 0===t?void 0:t.data}set altTextData(t){bt(Sr,this)&&(bt(Sr,this).data=t)}get guessedAltText(){var t;return null===(t=bt(Sr,this))||void 0===t?void 0:t.guessedText}async setGuessedAltText(t){var e;await(null===(e=bt(Sr,this))||void 0===e?void 0:e.setGuessedText(t))}serializeAltText(t){var e;return null===(e=bt(Sr,this))||void 0===e?void 0:e.serialize(t)}hasAltText(){return!!bt(Sr,this)&&!bt(Sr,this).isEmpty()}hasAltTextData(){var t,e;return null!==(t=null===(e=bt(Sr,this))||void 0===e?void 0:e.hasData())&&void 0!==t&&t}focusCommentButton(){var t;null===(t=bt(Mr,this))||void 0===t||t.focusButton()}addCommentButton(){return bt(Mr,this)||yt(Mr,this,new ar(this))}addStandaloneCommentButton(){bt(Tr,this)?this._uiManager.isEditingMode()&&bt(Tr,this).classList.remove("hidden"):this.hasComment&&(yt(Tr,this,bt(Mr,this).renderForStandalone()),this.div.append(bt(Tr,this)))}removeStandaloneCommentButton(){bt(Mr,this).removeStandaloneCommentButton(),yt(Tr,this,null)}hideStandaloneCommentButton(){var t;null===(t=bt(Tr,this))||void 0===t||t.classList.add("hidden")}get comment(){var t;const{data:{richText:e,text:i,date:n,deleted:s}}=bt(Mr,this);return{text:i,richText:e,date:n,deleted:s,color:this.getNonHCMColor(),opacity:null!==(t=this.opacity)&&void 0!==t?t:1}}set comment(t){bt(Mr,this)||yt(Mr,this,new ar(this)),bt(Mr,this).data=t,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData(t){let{comment:e,popupRef:i,richText:n}=t;if(!i)return;if(bt(Mr,this)||yt(Mr,this,new ar(this)),bt(Mr,this).setInitialText(e,n),!this.annotationElementId)return;const s=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);s&&this.updateFromAnnotationLayer(s)}get hasEditedComment(){var t;return null===(t=bt(Mr,this))||void 0===t?void 0:t.hasBeenEdited()}get hasDeletedComment(){var t;return null===(t=bt(Mr,this))||void 0===t?void 0:t.isDeleted()}get hasComment(){return!!bt(Mr,this)&&!bt(Mr,this).isEmpty()&&!bt(Mr,this).isDeleted()}async editComment(t){bt(Mr,this)||yt(Mr,this,new ar(this)),bt(Mr,this).edit(t)}toggleComment(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){bt(Mr,this).setSelectedButton(t)}addComment(t){if(this.hasEditedComment){const e=180,i=100,[,,,n]=t.rect,[s]=this.pageDimensions,[r]=this.pageTranslation,a=r+s+1,o=n-i,l=a+e;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[a,o,l,n]}}}updateFromAnnotationLayer(t){let{popup:{contents:e,deleted:i}}=t;bt(Mr,this).data=i?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){var t;const e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=bt(Pr,this)?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),vt(Zr,this,ua).call(this);const[i,n]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth="".concat((100*n/i).toFixed(2),"%"),e.style.maxHeight="".concat((100*i/n).toFixed(2),"%"));const[s,r]=this.getInitialTranslation();return this.translate(s,r),Ki(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(bt(Yr,this)||yt(Yr,this,new Ar({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:vt(Zr,this,oa).bind(this),onPinching:vt(Zr,this,la).bind(this),onPinchEnd:vt(Zr,this,ca).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),null===(t=this._uiManager._editorUndoBar)||void 0===t||t.hide(),e}pointerdown(t){const{isMac:e}=ze.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(yt(Wr,this,!0),this._isDraggable?vt(Zr,this,da).call(this,t):vt(Zr,this,ha).call(this,t))}_onStartDragging(){}_onStopDragging(){}moveInDOM(){bt(Vr,this)&&clearTimeout(bt(Vr,this)),yt(Vr,this,setTimeout(()=>{var t;yt(Vr,this,null),null===(t=this.parent)||void 0===t||t.moveEditorInDOM(this)},0))}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.rotation;const n=this.parentScale,[s,r]=this.pageDimensions,[a,o]=this.pageTranslation,l=t/n,c=e/n,h=this.x*s,d=this.y*r,u=this.width*s,p=this.height*r;switch(i){case 0:return[h+l+a,r-d-c-p+o,h+l+u+a,r-d-c+o];case 90:return[h+c+a,r-d+l+o,h+c+p+a,r-d+l+u+o];case 180:return[h-l-u+a,r-d+c+o,h-l+a,r-d+c+p+o];case 270:return[h-c-p+a,r-d-l-u+o,h-c+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")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&Jr._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){var t;null===(t=bt(Mr,this))||void 0===t||t.onUpdatedColor()}getData(){const{comment:{text:t,color:e,date:i,opacity:n,deleted:s,richText:r},uid:a,pageIndex:o,creationDate:l,modificationDate:c}=this;return{id:a,pageIndex:o,rect:this.getPDFRect(),richText:r,contentsObj:{str:t},creationDate:l,modificationDate:i||c,popupRef:!s,color:e,opacity:n}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),yt(Hr,this,!0),!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),yt(Hr,this,!1),!0)}isInEditMode(){return bt(Hr,this)}shouldGetKeyboardEvents(){return bt(Ur,this)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:i,right:n}=this.getClientDimensions(),{innerHeight:s,innerWidth:r}=window;return e<r&&n>0&&t<s&&i>0}rebuild(){vt(Zr,this,ua).call(this)}rotate(t){}resize(){}serializeDeleted(){var t;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:(null===(t=this._initialData)||void 0===t?void 0:t.popupRef)||""}}serialize(){var t;return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:(null===(t=this._initialData)||void 0===t?void 0:t.popupRef)||""}}static async deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});n.rotation=t.rotation,yt(kr,n,t.accessibilityData),n._isCopy=t.isCopy||!1;const[s,r]=n.pageDimensions,[a,o,l,c]=n.getRectInCurrentCoords(t.rect,r);return n.x=a/s,n.y=o/r,n.width=l/s,n.height=c/r,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){var t,e;if(null===(t=bt(Or,this))||void 0===t||t.abort(),yt(Or,this,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),bt(Vr,this)&&(clearTimeout(bt(Vr,this)),yt(Vr,this,null)),vt(Zr,this,va).call(this),this.removeEditToolbar(),bt(Xr,this)){for(const t of bt(Xr,this).values())clearTimeout(t);yt(Xr,this,null)}this.parent=null,null===(e=bt(Yr,this))||void 0===e||e.destroy(),yt(Yr,this,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(vt(Zr,this,ia).call(this),bt(Dr,this).classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return"ltr"===this._uiManager.direction?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[t,e]}=this,[i,n,s,r]=this.getPDFRect();return[Jr._round(i+(s-i)*t),Jr._round(n+(r-n)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return bt(Mr,this).commentPopupPositionInLayer}set commentPopupPosition(t){bt(Mr,this).commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return bt(Mr,this).hasDefaultPopupPosition()}get commentButtonWidth(){return bt(Mr,this).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){bt(Mr,this).setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),yt(Ir,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=bt(Dr,this).children;if(!bt(Cr,this)){yt(Cr,this,Array.from(e));const t=vt(Zr,this,pa).bind(this),i=vt(Zr,this,ga).bind(this),n=this._uiManager._signal;for(const e of bt(Cr,this)){const s=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:n}),e.addEventListener("blur",i,{signal:n}),e.addEventListener("focus",vt(Zr,this,fa).bind(this,s),{signal:n}),e.setAttribute("data-l10n-id",Jr._l10nResizer[s])}}const i=bt(Cr,this)[0];let n=0;for(const r of e){if(r===i)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*(bt(Cr,this).length/4);if(s!==n){if(s<n)for(let e=0;e<n-s;e++)bt(Dr,this).append(bt(Dr,this).firstChild);else if(s>n)for(let e=0;e<s-n;e++)bt(Dr,this).firstChild.before(bt(Dr,this).lastChild);let t=0;for(const i of e){const e=bt(Cr,this)[t++].getAttribute("data-resizer-name");i.setAttribute("data-l10n-id",Jr._l10nResizer[e])}}vt(Zr,this,ma).call(this,0),yt(Ur,this,!0),bt(Dr,this).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){bt(Ur,this)&&vt(Zr,this,aa).call(this,bt(Br,this),{deltaX:t,deltaY:e,fromKeyboard:!0})}_stopResizingWithKeyboard(){vt(Zr,this,va).call(this),this.div.focus()}select(){var t,e,i;this.isSelected&&this._editToolbar?this._editToolbar.show():(this.isSelected=!0,this.makeResizable(),null===(t=this.div)||void 0===t||t.classList.add("selectedEditor"),this._editToolbar?(null===(e=this._editToolbar)||void 0===e||e.show(),null===(i=bt(Sr,this))||void 0===i||i.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{var t,e;null!==(t=this.div)&&void 0!==t&&t.classList.contains("selectedEditor")&&(null===(e=this._editToolbar)||void 0===e||e.show())}))}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>{var t;return null===(t=this.div)||void 0===t?void 0:t.focus({preventScroll:!0})},0)}unselect(){var t,e,i,n,s;this.isSelected&&(this.isSelected=!1,null===(t=bt(Dr,this))||void 0===t||t.classList.add("hidden"),null===(e=this.div)||void 0===e||e.classList.remove("selectedEditor"),null!==(i=this.div)&&void 0!==i&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),null===(n=this._editToolbar)||void 0===n||n.hide(),null===(s=bt(Sr,this))||void 0===s||s.toggleAltTextBadge(!0),this.hasComment&&this._uiManager.toggleComment(this,!1,!1))}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){"BUTTON"!==t.target.nodeName&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return bt(jr,this)}set isEditing(t){yt(jr,this,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){bt(Xr,this)||yt(Xr,this,new Map);const{action:e}=t;let i=bt(Xr,this).get(e);return i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),bt(Xr,this).delete(e),0===bt(Xr,this).size&&yt(Xr,this,null)},Jr._telemetryTimeout),void bt(Xr,this).set(e,i)}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),yt(Pr,this,!1)}disable(){this.div&&(this.div.tabIndex=-1),yt(Pr,this,!0)}updateFakeAnnotationElement(t){if(bt(Nr,this)||this.deleted)return this.deleted?(bt(Nr,this).remove(),void yt(Nr,this,null)):void((this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&bt(Nr,this).updateEdited({rect:this.getPDFRect(),popup:this.comment}));yt(Nr,this,t.addFakeAnnotation(this))}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;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"===(null===e||void 0===e?void 0:e.nodeName)&&e.classList.contains("annotationContent")&&e.remove()}}function $r(t,e,i){let[n,s]=t;[e,i]=this.screenToPageTranslation(e,i),this.x+=e/n,this.y+=i/s,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}function ta(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}function ea(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]}}function ia(){if(bt(Dr,this))return;yt(Dr,this,document.createElement("div")),bt(Dr,this).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");bt(Dr,this).append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",vt(Zr,this,na).bind(this,i),{signal:e}),t.addEventListener("contextmenu",li,{signal:e}),t.tabIndex=-1}this.div.prepend(bt(Dr,this))}function na(t,e){var i;e.preventDefault();const{isMac:n}=ze.platform;if(0!==e.button||e.ctrlKey&&n)return;null===(i=bt(Sr,this))||void 0===i||i.toggle(!1);const s=this._isDraggable;this._isDraggable=!1,yt(Fr,this,[e.screenX,e.screenY]);const r=new AbortController,a=this._uiManager.combinedSignal(r);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",vt(Zr,this,aa).bind(this,t),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",ci,{passive:!1,signal:a}),window.addEventListener("contextmenu",li,{signal:a}),yt(Ir,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const o=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const c=()=>{var t;r.abort(),this.parent.togglePointerEvents(!0),null===(t=bt(Sr,this))||void 0===t||t.toggle(!0),this._isDraggable=s,this.parent.div.style.cursor=o,this.div.style.cursor=l,vt(Zr,this,ra).call(this)};window.addEventListener("pointerup",c,{signal:a}),window.addEventListener("blur",c,{signal:a})}function sa(t,e,i,n){this.width=i,this.height=n,this.x=t,this.y=e,this.setDims(),this.fixAndSetPosition(),this._onResized()}function ra(){if(!bt(Ir,this))return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=bt(Ir,this);yt(Ir,this,null);const s=this.x,r=this.y,a=this.width,o=this.height;s===t&&r===e&&a===i&&o===n||this.addCommands({cmd:vt(Zr,this,sa).bind(this,s,r,a,o),undo:vt(Zr,this,sa).bind(this,t,e,i,n),mustExec:!0})}function aa(t,e){const[i,n]=this.parentDimensions,s=this.x,r=this.y,a=this.width,o=this.height,l=kt.MIN_SIZE/i,c=kt.MIN_SIZE/n,h=vt(Zr,this,ea).call(this,this.rotation),d=(t,e)=>[h[0]*t+h[2]*e,h[1]*t+h[3]*e],u=vt(Zr,this,ea).call(this,360-this.rotation);let p,g,f=!1,m=!1;switch(t){case"topLeft":f=!0,p=(t,e)=>[0,0],g=(t,e)=>[t,e];break;case"topMiddle":p=(t,e)=>[t/2,0],g=(t,e)=>[t/2,e];break;case"topRight":f=!0,p=(t,e)=>[t,0],g=(t,e)=>[0,e];break;case"middleRight":m=!0,p=(t,e)=>[t,e/2],g=(t,e)=>[0,e/2];break;case"bottomRight":f=!0,p=(t,e)=>[t,e],g=(t,e)=>[0,0];break;case"bottomMiddle":p=(t,e)=>[t/2,e],g=(t,e)=>[t/2,0];break;case"bottomLeft":f=!0,p=(t,e)=>[0,e],g=(t,e)=>[t,0];break;case"middleLeft":m=!0,p=(t,e)=>[0,e/2],g=(t,e)=>[t,e/2]}const v=p(a,o),w=g(a,o);let b=d(...w);const y=kt._round(s+b[0]),A=kt._round(r+b[1]);let E,x,_=1,k=1;if(e.fromKeyboard)({deltaX:E,deltaY:x}=e);else{const{screenX:t,screenY:i}=e,[n,s]=bt(Fr,this);[E,x]=this.screenToPageTranslation(t-n,i-s),bt(Fr,this)[0]=t,bt(Fr,this)[1]=i}var C,S;if([E,x]=(C=E/i,S=x/n,[u[0]*C+u[2]*S,u[1]*C+u[3]*S]),f){const t=Math.hypot(a,o);_=k=Math.max(Math.min(Math.hypot(w[0]-v[0]-E,w[1]-v[1]-x)/t,1/a,1/o),l/a,c/o)}else m?_=Ke(Math.abs(w[0]-v[0]-E),l,1)/a:k=Ke(Math.abs(w[1]-v[1]-x),c,1)/o;const M=kt._round(a*_),T=kt._round(o*k);b=d(...g(M,T));const P=y-b[0],L=A-b[1];bt(zr,this)||yt(zr,this,[this.x,this.y,this.width,this.height]),this.width=M,this.height=T,this.x=P,this.y=L,this.setDims(),this.fixAndSetPosition(),this._onResizing()}function oa(){var t;yt(Ir,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),null===(t=bt(Sr,this))||void 0===t||t.toggle(!1),this.parent.togglePointerEvents(!1)}function la(t,e,i){let n=i/e*.7+1-.7;if(1===n)return;const s=vt(Zr,this,ea).call(this,this.rotation),r=(t,e)=>[s[0]*t+s[2]*e,s[1]*t+s[3]*e],[a,o]=this.parentDimensions,l=this.x,c=this.y,h=this.width,d=this.height,u=kt.MIN_SIZE/a,p=kt.MIN_SIZE/o;n=Math.max(Math.min(n,1/h,1/d),u/h,p/d);const g=kt._round(h*n),f=kt._round(d*n);if(g===h&&f===d)return;bt(zr,this)||yt(zr,this,[l,c,h,d]);const m=r(h/2,d/2),v=kt._round(l+m[0]),w=kt._round(c+m[1]),b=r(g/2,f/2);this.x=v-b[0],this.y=w-b[1],this.width=g,this.height=f,this.setDims(),this.fixAndSetPosition(),this._onResizing()}function ca(){var t;null===(t=bt(Sr,this))||void 0===t||t.toggle(!0),this.parent.togglePointerEvents(!0),vt(Zr,this,ra).call(this)}function ha(t){const{isMac:e}=ze.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}function da(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const n=new AbortController,s=this._uiManager.combinedSignal(n),r={capture:!0,passive:!1,signal:s},a=t=>{n.abort(),yt(Lr,this,null),yt(Wr,this,!1),this._uiManager.endDragSession()||vt(Zr,this,ha).call(this,t),i&&this._onStopDragging()};e&&(yt(Gr,this,t.clientX),yt(qr,this,t.clientY),yt(Lr,this,t.pointerId),yt(Rr,this,t.pointerType),window.addEventListener("pointermove",t=>{i||(i=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:e,clientY:n,pointerId:s}=t;if(s!==bt(Lr,this))return void ci(t);const[r,a]=this.screenToPageTranslation(e-bt(Gr,this),n-bt(qr,this));yt(Gr,this,e),yt(qr,this,n),this._uiManager.dragSelectedEditors(r,a)},r),window.addEventListener("touchmove",ci,r),window.addEventListener("pointerdown",t=>{t.pointerType===bt(Rr,this)&&(bt(Yr,this)||t.isPrimary)&&a(t),ci(t)},r));const o=t=>{bt(Lr,this)&&bt(Lr,this)!==t.pointerId?ci(t):a(t)};window.addEventListener("pointerup",o,{signal:s}),window.addEventListener("blur",o,{signal:s})}function ua(){if(bt(Or,this)||!this.div)return;yt(Or,this,new AbortController);const t=this._uiManager.combinedSignal(bt(Or,this));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}function pa(t){kt._resizerKeyboardManager.exec(this,t)}function ga(t){var e;bt(Ur,this)&&(null===(e=t.relatedTarget)||void 0===e?void 0:e.parentNode)!==bt(Dr,this)&&vt(Zr,this,va).call(this)}function fa(t){yt(Br,this,bt(Ur,this)?t:"")}function ma(t){if(bt(Cr,this))for(const e of bt(Cr,this))e.tabIndex=t}function va(){yt(Ur,this,!1),vt(Zr,this,ma).call(this,-1),vt(Zr,this,ra).call(this)}kt=Jr,(0,Wt.A)(Jr,"_l10n",null),(0,Wt.A)(Jr,"_l10nResizer",null),(0,Wt.A)(Jr,"_borderLineWidth",-1),(0,Wt.A)(Jr,"_colorManager",new pn),(0,Wt.A)(Jr,"_zIndex",1),(0,Wt.A)(Jr,"_telemetryTimeout",1e3);class wa extends Jr{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const ba=3285377520,ya=4294901760,Aa=65535;class Ea{constructor(t){this.h1=t?4294967295&t:ba,this.h2=t?4294967295&t:ba}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,c=this.h2;const h=3432918353,d=461845907,u=11601,p=13715;for(let g=0;g<n;g++)1&g?(a=r[g],a=a*h&ya|a*u&Aa,a=a<<15|a>>>17,a=a*d&ya|a*p&Aa,l^=a,l=l<<13|l>>>19,l=5*l+3864292196):(o=r[g],o=o*h&ya|o*u&Aa,o=o<<15|o>>>17,o=o*d&ya|o*p&Aa,c^=o,c=c<<13|c>>>19,c=5*c+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*h&ya|a*u&Aa,a=a<<15|a>>>17,a=a*d&ya|a*p&Aa,1&n?l^=a:c^=a}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&ya|36045*t&Aa,e=4283543511*e&ya|(2950163797*(e<<16|t>>>16)&ya)>>>16,t^=e>>>1,t=444984403*t&ya|60499*t&Aa,e=3301882366*e&ya|(3120437893*(e<<16|t>>>16)&ya)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const xa=Object.freeze({map:null,hash:"",transfer:void 0});var _a=new WeakMap,ka=new WeakMap,Ca=new WeakMap,Sa=new WeakMap,Ma=new WeakSet;class Ta{constructor(){ft(this,Ma),mt(this,_a,!1),mt(this,ka,null),mt(this,Ca,null),mt(this,Sa,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=bt(Sa,this).get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return bt(Sa,this).get(t)}remove(t){const e=bt(Sa,this).get(t);if(void 0!==e&&(e instanceof Jr&&bt(Ca,this).delete(e.annotationElementId),bt(Sa,this).delete(t),0===bt(Sa,this).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor)){for(const t of bt(Sa,this).values())if(t instanceof Jr)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=bt(Sa,this).get(t);let n=!1;if(void 0!==i)for(const[s,r]of Object.entries(e))i[s]!==r&&(n=!0,i[s]=r);else n=!0,bt(Sa,this).set(t,e);n&&vt(Ma,this,Pa).call(this),e instanceof Jr&&((bt(Ca,this)||yt(Ca,this,new Map)).set(e.annotationElementId,e),"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type))}has(t){return bt(Sa,this).has(t)}get size(){return bt(Sa,this).size}resetModified(){bt(_a,this)&&(yt(_a,this,!1),"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new Ra(this)}get serializable(){if(0===bt(Sa,this).size)return xa;const t=new Map,e=new Ea,i=[],n=Object.create(null);let s=!1;for(const[r,a]of bt(Sa,this)){const i=a instanceof Jr?a.serialize(!1,n):a;i&&(t.set(r,i),e.update("".concat(r,":").concat(JSON.stringify(i))),s||(s=!!i.bitmap))}if(s)for(const r of t.values())r.bitmap&&i.push(r.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:xa}get editorStats(){let t=null;const e=new Map;let i=0,n=0;for(const a of bt(Sa,this).values()){var s;if(!(a instanceof Jr)){a.popup&&(a.popup.deleted?n+=1:i+=1);continue}a.isCommentDeleted?n+=1:a.hasEditedComment&&(i+=1);const o=a.telemetryFinalData;if(!o)continue;const{type:l}=o;e.has(l)||e.set(l,Object.getPrototypeOf(a).constructor),t||(t=Object.create(null));const c=(s=t)[l]||(s[l]=new Map);for(const[t,e]of Object.entries(o)){var r;if("type"===t)continue;let i=c.get(t);i||(i=new Map,c.set(t,i));const n=null!==(r=i.get(e))&&void 0!==r?r:0;i.set(e,n+1)}}if((n>0||i>0)&&(t||(t=Object.create(null)),t.comments={deleted:n,edited:i}),!t)return null;for(const[a,o]of e)t[a]=o.computeTelemetryFinalData(t[a]);return t}resetModifiedIds(){yt(ka,this,null)}updateEditor(t,e){var i;const n=null===(i=bt(Ca,this))||void 0===i?void 0:i.get(t);return!!n&&(n.updateFromAnnotationLayer(e),!0)}getEditor(t){var e;return(null===(e=bt(Ca,this))||void 0===e?void 0:e.get(t))||null}get modifiedIds(){if(bt(ka,this))return bt(ka,this);const t=[];if(bt(Ca,this))for(const e of bt(Ca,this).values())e.serialize()&&t.push(e.annotationElementId);return yt(ka,this,{ids:new Set(t),hash:t.join(",")})}[Symbol.iterator](){return bt(Sa,this).entries()}}function Pa(){bt(_a,this)||(yt(_a,this,!0),"function"===typeof this.onSetModified&&this.onSetModified())}var La=new WeakMap;class Ra extends Ta{constructor(t){super(),mt(this,La,void 0);const{map:e,hash:i,transfer:n}=t.serializable,s=structuredClone(e,n?{transfer:n}:null);yt(La,this,{map:s,hash:i,transfer:n})}get print(){Ce("Should not call PrintAnnotationStorage.print")}get serializable(){return bt(La,this)}get modifiedIds(){return Pe(this,"modifiedIds",{ids:new Set,hash:""})}}var Da=new WeakMap;class Fa{constructor(t){let{ownerDocument:e=globalThis.document,styleElement:i=null}=t;mt(this,Da,new Set),this._document=e,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(),bt(Da,this).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){let{systemFontInfo:e,disableFontFace:i,_inspectFont:n}=t;if(e&&!bt(Da,this).has(e.loadedName)){if(Se(!i,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:i,style:r}=e,a=new FontFace(t,i,r);this.addNativeFontFace(a);try{await a.load(),bt(Da,this).add(t),null===n||void 0===n||n(e)}catch(s){ke("Cannot load system font: ".concat(e.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(a)}return}Ce("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 ke("Failed to load font '".concat(e.family,"': '").concat(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 Pe(this,"isFontLoadingAPISupported",!(null===(t=this._document)||void 0===t||!t.fonts))}get isSyncFontLoadingSupported(){return Pe(this,"isSyncFontLoadingSupported",jt||ze.platform.isFirefox)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(Se(!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 Pe(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 c="lt".concat(Date.now()).concat(this.loadTestFontId++);let h=this._loadTestFont;h=n(h,976,c.length,c);const d=1482184792;let u=i(h,16);for(s=0,r=c.length-3;s<r;s+=4)u=u-d+i(c,s)|0;var p;s<c.length&&(u=u-d+i(c+"XXX",s)|0),h=n(h,16,4,(p=u,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));const g="url(data:font/opentype;base64,".concat(btoa(h),");"),f='@font-face {font-family:"'.concat(c,'";src:').concat(g,"}");this.insertRule(f);const m=this._document.createElement("div");m.style.visibility="hidden",m.style.width=m.style.height="10px",m.style.position="absolute",m.style.top=m.style.left="0px";for(const v of[t.loadedName,c]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=v,m.append(t)}this._document.body.append(m),function t(e,i){if(++l>30)return ke("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))}(c,()=>{m.remove(),e.complete()})}}var Ia=new WeakMap;class Na{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;mt(this,Ia,void 0),this.compiledGlyphs=Object.create(null),yt(Ia,this,t),this._inspectFont=e,i&&Object.assign(this,i),n&&(this.charProcOperatorList=n)}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 ".concat(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)||void 0===t||t.call(this,this),e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e="url(data:".concat(this.mimetype,";base64,").concat(Qe(this.data),");");let i;if(this.cssFontInfo){let t="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(t+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),i='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(t,"src:").concat(e,"}")}else i='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(e,"}");return null===(t=this._inspectFont)||void 0===t||t.call(this,this,e),i}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];const i=this.loadedName+"_path_"+e;let n;try{n=t.get(i)}catch(r){ke('getPathGenerator - ignoring character: "'.concat(r,'".'))}const s=new Path2D(n||"");return this.fontExtraProperties||t.delete(i),this.compiledGlyphs[e]=s}get black(){return bt(Ia,this).black}get bold(){return bt(Ia,this).bold}get disableFontFace(){var t;return null!==(t=bt(Ia,this).disableFontFace)&&void 0!==t&&t}get fontExtraProperties(){var t;return null!==(t=bt(Ia,this).fontExtraProperties)&&void 0!==t&&t}get isInvalidPDFjsFont(){return bt(Ia,this).isInvalidPDFjsFont}get isType3Font(){return bt(Ia,this).isType3Font}get italic(){return bt(Ia,this).italic}get missingFile(){return bt(Ia,this).missingFile}get remeasure(){return bt(Ia,this).remeasure}get vertical(){return bt(Ia,this).vertical}get ascent(){return bt(Ia,this).ascent}get defaultWidth(){return bt(Ia,this).defaultWidth}get descent(){return bt(Ia,this).descent}get bbox(){return bt(Ia,this).bbox}get fontMatrix(){return bt(Ia,this).fontMatrix}get fallbackName(){return bt(Ia,this).fallbackName}get loadedName(){return bt(Ia,this).loadedName}get mimetype(){return bt(Ia,this).mimetype}get name(){return bt(Ia,this).name}get data(){return bt(Ia,this).data}clearData(){bt(Ia,this).clearData()}get cssFontInfo(){return bt(Ia,this).cssFontInfo}get systemFontInfo(){return bt(Ia,this).systemFontInfo}get defaultVMetrics(){return bt(Ia,this).defaultVMetrics}}function Oa(t){if("string"!==typeof t)return null;if(t.endsWith("/"))return t;throw new Error('Invalid factory url: "'.concat(t,'" must include trailing slash.'))}const Ba=t=>"object"===typeof t&&Number.isInteger(null===t||void 0===t?void 0:t.num)&&t.num>=0&&Number.isInteger(null===t||void 0===t?void 0:t.gen)&&t.gen>=0,Wa=function(t,e,i){if(!Array.isArray(i)||i.length<2)return!1;const[n,s,...r]=i;if(!t(n)&&!Number.isInteger(n))return!1;if(!e(s))return!1;const a=r.length;let o=!0;switch(s.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return 0===a;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(4!==a)return!1;o=!1;break;default:return!1}for(const l of r)if(!("number"===typeof l||o&&null===l))return!1;return!0}.bind(null,Ba,t=>"object"===typeof t&&"string"===typeof(null===t||void 0===t?void 0:t.name));var za=new WeakMap,ja=new WeakMap;class Ha{constructor(){mt(this,za,new Map),mt(this,ja,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};bt(ja,this).then(()=>{for(const[t]of bt(za,this))t.call(this,i)})}addEventListener(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=null;if((null===i||void 0===i?void 0:i.signal)instanceof AbortSignal){const{signal:s}=i;if(s.aborted)return void ke("LoopbackPort - cannot use an `aborted` signal.");const r=()=>this.removeEventListener(t,e);n=()=>s.removeEventListener("abort",r),s.addEventListener("abort",r)}bt(za,this).set(e,n)}removeEventListener(t,e){const i=bt(za,this).get(e);null===i||void 0===i||i(),bt(za,this).delete(e)}terminate(){for(const[,t]of bt(za,this))null===t||void 0===t||t();bt(za,this).clear()}}const Ua=1,Va=2,Ga=1,qa=2,Xa=3,Ya=4,Ka=5,Qa=6,Za=7,Ja=8;function $a(){}function to(t){if(t instanceof Oe||t instanceof Fe||t instanceof Re||t instanceof Ie||t instanceof De)return t;switch(t instanceof Error||"object"===typeof t&&null!==t||Ce('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new Oe(t.message);case"InvalidPDFException":return new Fe(t.message);case"PasswordException":return new Re(t.message,t.code);case"ResponseException":return new Ie(t.message,t.status,t.missing);case"UnknownErrorException":return new De(t.message,t.details)}return new De(t.message,t.toString())}var eo=new WeakMap,io=new WeakSet;class no{constructor(t,e,i){ft(this,io),mt(this,eo,new AbortController),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),i.addEventListener("message",vt(io,this,so).bind(this),{signal:bt(eo,this).signal})}on(t,e){const i=this.actionHandler;if(i[t])throw new Error('There is already an actionName called "'.concat(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(r){s.reject(r)}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:Qa,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{Se(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:Ga,streamId:s,reason:to(t)}),e.promise}},i)}destroy(){var t;null===(t=bt(eo,this))||void 0===t||t.abort(),yt(eo,this,null)}}function so(t){let{data:e}=t;if(e.targetName!==this.sourceName)return;if(e.stream)return void vt(io,this,ao).call(this,e);if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error("Cannot resolve callback ".concat(t));if(delete this.callbackCapabilities[t],e.callback===Ua)i.resolve(e.data);else{if(e.callback!==Va)throw new Error("Unexpected callback case");i.reject(to(e.reason))}return}const i=this.actionHandler[e.action];if(!i)throw new Error("Unknown action from worker: ".concat(e.action));if(e.callbackId){const t=this.sourceName,n=e.sourceName,s=this.comObj;return void Promise.try(i,e.data).then(function(i){s.postMessage({sourceName:t,targetName:n,callback:Ua,callbackId:e.callbackId,data:i})},function(i){s.postMessage({sourceName:t,targetName:n,callback:Va,callbackId:e.callbackId,reason:to(i)})})}e.streamId?vt(io,this,ro).call(this,e):i(e.data)}function ro(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this,a=this.actionHandler[t.action],o={enqueue(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2?arguments[2]:void 0;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:Ya,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:Xa,streamId:e}),delete r.streamSinks[e])},error(t){Se(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:Ka,streamId:e,reason:to(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,Promise.try(a,t.data,o).then(function(){s.postMessage({sourceName:i,targetName:n,stream:Ja,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:Ja,streamId:e,reason:to(t)})})}function ao(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 Ja:t.success?r.startCall.resolve():r.startCall.reject(to(t.reason));break;case Za:t.success?r.pullCall.resolve():r.pullCall.reject(to(t.reason));break;case Qa:if(!a){s.postMessage({sourceName:i,targetName:n,stream:Za,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,Promise.try(a.onPull||$a).then(function(){s.postMessage({sourceName:i,targetName:n,stream:Za,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:Za,streamId:e,reason:to(t)})});break;case Ya:if(Se(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case Xa:if(Se(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),vt(io,this,oo).call(this,r,e);break;case Ka:Se(r,"error should have stream controller"),r.controller.error(to(t.reason)),vt(io,this,oo).call(this,r,e);break;case qa:t.success?r.cancelCall.resolve():r.cancelCall.reject(to(t.reason)),vt(io,this,oo).call(this,r,e);break;case Ga:if(!a)break;const o=to(t.reason);Promise.try(a.onCancel||$a,o).then(function(){s.postMessage({sourceName:i,targetName:n,stream:qa,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:qa,streamId:e,reason:to(t)})}),a.sinkCapability.reject(o),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async function oo(t,e){var i,n,s;await Promise.allSettled([null===(i=t.startCall)||void 0===i?void 0:i.promise,null===(n=t.pullCall)||void 0===n?void 0:n.promise,null===(s=t.cancelCall)||void 0===s?void 0:s.promise]),delete this.streamControllers[e]}var lo=new WeakMap;class co{constructor(t){let{enableHWA:e=!1}=t;mt(this,lo,!1),yt(lo,this,e)}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:!bt(lo,this)})}}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){Ce("Abstract method `_createCanvas` called.")}}class ho extends co{constructor(t){let{ownerDocument:e=globalThis.document,enableHWA:i=!1}=t;super({enableHWA:i}),this._document=e}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}}class uo{constructor(t){let{baseUrl:e=null,isCompressed:i=!0}=t;this.baseUrl=e,this.isCompressed=i}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const i=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(i).then(t=>({cMapData:t,isCompressed:this.isCompressed})).catch(t=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(i))})}async _fetch(t){Ce("Abstract method `_fetch` called.")}}class po extends uo{async _fetch(t){const e=await ei(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):We(e)}}class go{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(){}}var fo=new WeakMap,mo=new WeakMap,vo=new WeakMap,wo=new WeakMap,bo=new WeakMap,yo=new WeakMap,Ao=new WeakMap,Eo=new WeakSet;class xo extends go{constructor(t){let{docId:e,ownerDocument:i=globalThis.document}=t;super(),ft(this,Eo),mt(this,fo,void 0),mt(this,mo,void 0),mt(this,vo,void 0),mt(this,wo,void 0),mt(this,bo,void 0),mt(this,yo,void 0),mt(this,Ao,0),yt(wo,this,e),yt(bo,this,i)}addFilter(t){var e,i;if(!t)return"none";let n=wt(Eo,this,_o).get(t);if(n)return n;const[s,r,a]=vt(Eo,this,So).call(this,t),o=1===t.length?s:"".concat(s).concat(r).concat(a);if(n=wt(Eo,this,_o).get(o),n)return wt(Eo,this,_o).set(t,n),n;const l="g_".concat(bt(wo,this),"_transfer_map_").concat((yt(Ao,this,(e=bt(Ao,this),i=e++,e)),i)),c=vt(Eo,this,Mo).call(this,l);wt(Eo,this,_o).set(t,c),wt(Eo,this,_o).set(o,c);const h=vt(Eo,this,Lo).call(this,l);return vt(Eo,this,Do).call(this,s,r,a,h),c}addHCMFilter(t,e){var i;const n="".concat(t,"-").concat(e),s="base";let r=wt(Eo,this,ko).get(s);if((null===(i=r)||void 0===i?void 0:i.key)===n)return r.url;var a;r?(null===(a=r.filter)||void 0===a||a.remove(),r.key=n,r.url="none",r.filter=null):(r={key:n,url:"none",filter:null},wt(Eo,this,ko).set(s,r));if(!t||!e)return r.url;const o=vt(Eo,this,Io).call(this,t);t=He.makeHexColor(...o);const l=vt(Eo,this,Io).call(this,e);if(e=He.makeHexColor(...l),wt(Eo,this,Co).style.color="","#000000"===t&&"#ffffff"===e||t===e)return r.url;const c=new Array(256);for(let g=0;g<=255;g++){const t=g/255;c[g]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const h=c.join(","),d="g_".concat(bt(wo,this),"_hcm_filter"),u=r.filter=vt(Eo,this,Lo).call(this,d);vt(Eo,this,Do).call(this,h,h,h,u),vt(Eo,this,Po).call(this,u);const p=(t,e)=>{const i=o[t]/255,n=l[t]/255,s=new Array(e+1);for(let r=0;r<=e;r++)s[r]=i+r/e*(n-i);return s.join(",")};return vt(Eo,this,Do).call(this,p(0,5),p(1,5),p(2,5),u),r.url=vt(Eo,this,Mo).call(this,d),r.url}addAlphaFilter(t){var e,i;let n=wt(Eo,this,_o).get(t);if(n)return n;const[s]=vt(Eo,this,So).call(this,[t]),r="alpha_".concat(s);if(n=wt(Eo,this,_o).get(r),n)return wt(Eo,this,_o).set(t,n),n;const a="g_".concat(bt(wo,this),"_alpha_map_").concat((yt(Ao,this,(e=bt(Ao,this),i=e++,e)),i)),o=vt(Eo,this,Mo).call(this,a);wt(Eo,this,_o).set(t,o),wt(Eo,this,_o).set(r,o);const l=vt(Eo,this,Lo).call(this,a);return vt(Eo,this,Fo).call(this,s,l),o}addLuminosityFilter(t){var e,i;let n,s,r=wt(Eo,this,_o).get(t||"luminosity");if(r)return r;if(t?([n]=vt(Eo,this,So).call(this,[t]),s="luminosity_".concat(n)):s="luminosity",r=wt(Eo,this,_o).get(s),r)return wt(Eo,this,_o).set(t,r),r;const a="g_".concat(bt(wo,this),"_luminosity_map_").concat((yt(Ao,this,(e=bt(Ao,this),i=e++,e)),i)),o=vt(Eo,this,Mo).call(this,a);wt(Eo,this,_o).set(t,o),wt(Eo,this,_o).set(s,o);const l=vt(Eo,this,Lo).call(this,a);return vt(Eo,this,To).call(this,l),t&&vt(Eo,this,Fo).call(this,n,l),o}addHighlightHCMFilter(t,e,i,n,s){var r;const a="".concat(e,"-").concat(i,"-").concat(n,"-").concat(s);let o=wt(Eo,this,ko).get(t);if((null===(r=o)||void 0===r?void 0:r.key)===a)return o.url;var l;o?(null===(l=o.filter)||void 0===l||l.remove(),o.key=a,o.url="none",o.filter=null):(o={key:a,url:"none",filter:null},wt(Eo,this,ko).set(t,o));if(!e||!i)return o.url;const[c,h]=[e,i].map(vt(Eo,this,Io).bind(this));let d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),u=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[p,g]=[n,s].map(vt(Eo,this,Io).bind(this));u<d&&([d,u,p,g]=[u,d,g,p]),wt(Eo,this,Co).style.color="";const f=(t,e,i)=>{const n=new Array(256),s=(u-d)/i,r=t/255,a=(e-t)/(255*i);let o=0;for(let l=0;l<=i;l++){const t=Math.round(d+l*s),e=r+l*a;for(let i=o;i<=t;i++)n[i]=e;o=t+1}for(let l=o;l<256;l++)n[l]=n[o-1];return n.join(",")},m="g_".concat(bt(wo,this),"_hcm_").concat(t,"_filter"),v=o.filter=vt(Eo,this,Lo).call(this,m);return vt(Eo,this,Po).call(this,v),vt(Eo,this,Do).call(this,f(p[0],g[0],5),f(p[1],g[1],5),f(p[2],g[2],5),v),o.url=vt(Eo,this,Mo).call(this,m),o.url}destroy(){var t,e,i,n;arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&null!==(t=bt(yo,this))&&void 0!==t&&t.size||(null===(e=bt(vo,this))||void 0===e||e.parentNode.parentNode.remove(),yt(vo,this,null),null===(i=bt(mo,this))||void 0===i||i.clear(),yt(mo,this,null),null===(n=bt(yo,this))||void 0===n||n.clear(),yt(yo,this,null),yt(Ao,this,0))}}function _o(t){return bt(mo,t)||yt(mo,t,new Map)}function ko(t){return bt(yo,t)||yt(yo,t,new Map)}function Co(t){if(!bt(vo,t)){const e=bt(bo,t).createElement("div"),{style:i}=e;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const n=bt(bo,t).createElementNS($e,"svg");n.setAttribute("width",0),n.setAttribute("height",0),yt(vo,t,bt(bo,t).createElementNS($e,"defs")),e.append(n),n.append(bt(vo,t)),bt(bo,t).body.append(e)}return bt(vo,t)}function So(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 o=0;o<256;o++)s[o]=e[o]/255,r[o]=i[o]/255,a[o]=n[o]/255;return[s.join(","),r.join(","),a.join(",")]}function Mo(t){if(void 0===bt(fo,this)){yt(fo,this,"");const t=bt(bo,this).URL;t!==bt(bo,this).baseURI&&(si(t)?ke('#createUrl: ignore "data:"-URL for performance reasons.'):yt(fo,this,Te(t,"")))}return"url(".concat(bt(fo,this),"#").concat(t,")")}function To(t){const e=bt(bo,this).createElementNS($e,"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)}function Po(t){const e=bt(bo,this).createElementNS($e,"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)}function Lo(t){const e=bt(bo,this).createElementNS($e,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),wt(Eo,this,Co).append(e),e}function Ro(t,e,i){const n=bt(bo,this).createElementNS($e,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}function Do(t,e,i,n){const s=bt(bo,this).createElementNS($e,"feComponentTransfer");n.append(s),vt(Eo,this,Ro).call(this,s,"feFuncR",t),vt(Eo,this,Ro).call(this,s,"feFuncG",e),vt(Eo,this,Ro).call(this,s,"feFuncB",i)}function Fo(t,e){const i=bt(bo,this).createElementNS($e,"feComponentTransfer");e.append(i),vt(Eo,this,Ro).call(this,i,"feFuncA",t)}function Io(t){return wt(Eo,this,Co).style.color=t,ui(getComputedStyle(wt(Eo,this,Co)).getPropertyValue("color"))}class No{constructor(t){let{baseUrl:e=null}=t;this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const i="".concat(this.baseUrl).concat(e);return this._fetch(i).catch(t=>{throw new Error("Unable to load font data at: ".concat(i))})}async _fetch(t){Ce("Abstract method `_fetch` called.")}}class Oo extends No{async _fetch(t){const e=await ei(t,"arraybuffer");return new Uint8Array(e)}}class Bo{constructor(t){let{baseUrl:e=null}=t;this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");const i="".concat(this.baseUrl).concat(e);return this._fetch(i).catch(t=>{throw new Error("Unable to load wasm data at: ".concat(i))})}async _fetch(t){Ce("Abstract method `_fetch` called.")}}class Wo extends Bo{async _fetch(t){const e=await ei(t,"arraybuffer");return new Uint8Array(e)}}async function zo(t){const e=process.getBuiltinModule("fs"),i=await e.promises.readFile(t);return new Uint8Array(i)}jt&&ke("Please use the `legacy` build in Node.js environments.");class jo extends go{}class Ho extends co{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire("file:///home/runner/work/system-layout/system-layout/node_modules/pdfjs-dist/build/pdf.mjs")("@napi-rs/canvas").createCanvas(t,e)}}class Uo extends uo{async _fetch(t){return zo(t)}}class Vo extends No{async _fetch(t){return zo(t)}}class Go extends Bo{async _fetch(t){return zo(t)}}const qo="__forcedDependency",{floor:Xo,ceil:Yo}=Math;function Ko(t,e,i,n,s,r){t[4*e+0]=Math.min(t[4*e+0],i),t[4*e+1]=Math.min(t[4*e+1],n),t[4*e+2]=Math.max(t[4*e+2],s),t[4*e+3]=Math.max(t[4*e+3],r)}const Qo=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];var Zo=new WeakMap,Jo=new WeakMap;class $o{constructor(t,e){mt(this,Zo,void 0),mt(this,Jo,void 0),yt(Zo,this,t),yt(Jo,this,e)}get length(){return bt(Zo,this).length}isEmpty(t){return bt(Zo,this)[t]===Qo}minX(t){return bt(Jo,this)[4*t+0]/256}minY(t){return bt(Jo,this)[4*t+1]/256}maxX(t){return(bt(Jo,this)[4*t+2]+1)/256}maxY(t){return(bt(Jo,this)[4*t+3]+1)/256}}const tl=(t,e)=>{if(!t)return;let i=t.get(e);return i||(i={dependencies:new Set,isRenderingOperation:!1},t.set(e,i)),i};var el=new WeakMap,il=new WeakMap,nl=new WeakMap,sl=new WeakMap,rl=new WeakMap,al=new WeakMap,ol=new WeakMap,ll=new WeakMap,cl=new WeakMap,hl=new WeakMap,dl=new WeakMap,ul=new WeakMap,pl=new WeakMap,gl=new WeakMap,fl=new WeakMap,ml=new WeakMap,vl=new WeakMap,wl=new WeakSet;class bl{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];ft(this,wl),mt(this,el,{__proto__:null}),mt(this,il,{__proto__:null,transform:[],moveText:[],sameLineText:[],[qo]:[]}),mt(this,nl,new Map),mt(this,sl,[]),mt(this,rl,[]),mt(this,al,[[1,0,0,1,0,0]]),mt(this,ol,[-1/0,-1/0,1/0,1/0]),mt(this,ll,new Float64Array([1/0,1/0,-1/0,-1/0])),mt(this,cl,-1),mt(this,hl,new Set),mt(this,dl,new Map),mt(this,ul,new Map),mt(this,pl,void 0),mt(this,gl,void 0),mt(this,fl,void 0),mt(this,ml,void 0),mt(this,vl,void 0),yt(pl,this,t.width),yt(gl,this,t.height),vt(wl,this,yl).call(this,e),i&&yt(vl,this,new Map)}growOperationsCount(t){t>=bt(ml,this).length&&vt(wl,this,yl).call(this,t,bt(ml,this))}save(t){return yt(el,this,{__proto__:bt(el,this)}),yt(il,this,{__proto__:bt(il,this),transform:{__proto__:bt(il,this).transform},moveText:{__proto__:bt(il,this).moveText},sameLineText:{__proto__:bt(il,this).sameLineText},[qo]:{__proto__:bt(il,this)[qo]}}),yt(ol,this,{__proto__:bt(ol,this)}),bt(sl,this).push(t),this}restore(t){const e=Object.getPrototypeOf(bt(el,this));if(null===e)return this;yt(el,this,e),yt(il,this,Object.getPrototypeOf(bt(il,this))),yt(ol,this,Object.getPrototypeOf(bt(ol,this)));const i=bt(sl,this).pop();var n;void 0!==i&&(null===(n=tl(bt(vl,this),t))||void 0===n||n.dependencies.add(i),bt(ml,this)[t]=bt(ml,this)[i]);return this}recordOpenMarker(t){return bt(sl,this).push(t),this}getOpenMarker(){return 0===bt(sl,this).length?null:bt(sl,this).at(-1)}recordCloseMarker(t){const e=bt(sl,this).pop();var i;void 0!==e&&(null===(i=tl(bt(vl,this),t))||void 0===i||i.dependencies.add(e),bt(ml,this)[t]=bt(ml,this)[e]);return this}beginMarkedContent(t){return bt(rl,this).push(t),this}endMarkedContent(t){const e=bt(rl,this).pop();var i;void 0!==e&&(null===(i=tl(bt(vl,this),t))||void 0===i||i.dependencies.add(e),bt(ml,this)[t]=bt(ml,this)[e]);return this}pushBaseTransform(t){return bt(al,this).push(He.multiplyByDOMMatrix(bt(al,this).at(-1),t.getTransform())),this}popBaseTransform(){return bt(al,this).length>1&&bt(al,this).pop(),this}recordSimpleData(t,e){return bt(el,this)[t]=e,this}recordIncrementalData(t,e){return bt(il,this)[t].push(e),this}resetIncrementalData(t,e){return bt(il,this)[t].length=0,this}recordNamedData(t,e){return bt(nl,this).set(t,e),this}recordSimpleDataFromNamed(t,e,i){var n;bt(el,this)[t]=null!==(n=bt(nl,this).get(e))&&void 0!==n?n:i}recordFutureForcedDependency(t,e){return this.recordIncrementalData(qo,e),this}inheritSimpleDataAsFutureForcedDependencies(t){for(const e of t)e in bt(el,this)&&this.recordFutureForcedDependency(e,bt(el,this)[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of bt(hl,this))this.recordFutureForcedDependency(qo,t);return this}resetBBox(t){return bt(cl,this)!==t&&(yt(cl,this,t),bt(ll,this)[0]=1/0,bt(ll,this)[1]=1/0,bt(ll,this)[2]=-1/0,bt(ll,this)[3]=-1/0),this}recordClipBox(t,e,i,n,s,r){const a=He.multiplyByDOMMatrix(bt(al,this).at(-1),e.getTransform()),o=[1/0,1/0,-1/0,-1/0];He.axialAlignedBoundingBox([i,s,n,r],a,o);const l=He.intersect(bt(ol,this),o);return l?(bt(ol,this)[0]=l[0],bt(ol,this)[1]=l[1],bt(ol,this)[2]=l[2],bt(ol,this)[3]=l[3]):(bt(ol,this)[0]=bt(ol,this)[1]=1/0,bt(ol,this)[2]=bt(ol,this)[3]=-1/0),this}recordBBox(t,e,i,n,s,r){const a=bt(ol,this);if(a[0]===1/0)return this;const o=He.multiplyByDOMMatrix(bt(al,this).at(-1),e.getTransform());if(a[0]===-1/0)return He.axialAlignedBoundingBox([i,s,n,r],o,bt(ll,this)),this;const l=[1/0,1/0,-1/0,-1/0];return He.axialAlignedBoundingBox([i,s,n,r],o,l),bt(ll,this)[0]=Math.min(bt(ll,this)[0],Math.max(l[0],a[0])),bt(ll,this)[1]=Math.min(bt(ll,this)[1],Math.max(l[1],a[1])),bt(ll,this)[2]=Math.max(bt(ll,this)[2],Math.min(l[2],a[2])),bt(ll,this)[3]=Math.max(bt(ll,this)[3],Math.min(l[3],a[3])),this}recordCharacterBBox(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6?arguments[6]:void 0;const o=i.bbox;let l,c;if(o&&(l=o[2]!==o[0]&&o[3]!==o[1]&&bt(ul,this).get(i),!1!==l&&(c=[0,0,0,0],He.axialAlignedBoundingBox(o,i.fontMatrix,c),1===n&&0===s&&0===r||He.scaleMinMax([n,0,0,-n,s,r],c),l)))return this.recordBBox(t,e,c[0],c[2],c[1],c[3]);if(!a)return this.recordFullPageBBox(t);const h=a();return o&&c&&void 0===l&&(l=c[0]<=s-h.actualBoundingBoxLeft&&c[2]>=s+h.actualBoundingBoxRight&&c[1]<=r-h.actualBoundingBoxAscent&&c[3]>=r+h.actualBoundingBoxDescent,bt(ul,this).set(i,l),l)?this.recordBBox(t,e,c[0],c[2],c[1],c[3]):this.recordBBox(t,e,s-h.actualBoundingBoxLeft,s+h.actualBoundingBoxRight,r-h.actualBoundingBoxAscent,r+h.actualBoundingBoxDescent)}recordFullPageBBox(t){return bt(ll,this)[0]=Math.max(0,bt(ol,this)[0]),bt(ll,this)[1]=Math.max(0,bt(ol,this)[1]),bt(ll,this)[2]=Math.min(bt(pl,this),bt(ol,this)[2]),bt(ll,this)[3]=Math.min(bt(gl,this),bt(ol,this)[3]),this}getSimpleIndex(t){return bt(el,this)[t]}recordDependencies(t,e){const i=bt(hl,this),n=bt(el,this),s=bt(il,this);for(const r of e)r in bt(el,this)?i.add(n[r]):r in s&&s[r].forEach(i.add,i);return this}recordNamedDependency(t,e){return bt(nl,this).has(e)&&bt(hl,this).add(bt(nl,this).get(e)),this}recordOperation(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.recordDependencies(t,[qo]),bt(vl,this)){const e=tl(bt(vl,this),t),{dependencies:i}=e;bt(hl,this).forEach(i.add,i),bt(sl,this).forEach(i.add,i),bt(rl,this).forEach(i.add,i),i.delete(t),e.isRenderingOperation=!0}if(bt(cl,this)===t){const i=Xo(256*bt(ll,this)[0]/bt(pl,this)),n=Xo(256*bt(ll,this)[1]/bt(gl,this)),s=Yo(256*bt(ll,this)[2]/bt(pl,this)),r=Yo(256*bt(ll,this)[3]/bt(gl,this));Ko(bt(fl,this),t,i,n,s,r);for(const e of bt(hl,this))e!==t&&Ko(bt(fl,this),e,i,n,s,r);for(const e of bt(sl,this))e!==t&&Ko(bt(fl,this),e,i,n,s,r);for(const e of bt(rl,this))e!==t&&Ko(bt(fl,this),e,i,n,s,r);e||(bt(hl,this).clear(),yt(cl,this,-1))}return this}recordShowTextOperation(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=Array.from(bt(hl,this));this.recordOperation(t,e),this.recordIncrementalData("sameLineText",t);for(const n of i)this.recordIncrementalData("sameLineText",n);return this}bboxToClipBoxDropOperation(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return bt(cl,this)===t&&(yt(cl,this,-1),bt(ol,this)[0]=Math.max(bt(ol,this)[0],bt(ll,this)[0]),bt(ol,this)[1]=Math.max(bt(ol,this)[1],bt(ll,this)[1]),bt(ol,this)[2]=Math.min(bt(ol,this)[2],bt(ll,this)[2]),bt(ol,this)[3]=Math.min(bt(ol,this)[3],bt(ll,this)[3]),e||bt(hl,this).clear()),this}_takePendingDependencies(){const t=bt(hl,this);return yt(hl,this,new Set),t}_extractOperation(t){const e=bt(dl,this).get(t);return bt(dl,this).delete(t),e}_pushPendingDependencies(t){for(const e of t)bt(hl,this).add(e)}take(){return bt(ul,this).clear(),new $o(bt(ml,this),bt(fl,this))}takeDebugMetadata(){return bt(vl,this)}}function yl(t,e){const i=new ArrayBuffer(4*t);yt(fl,this,new Uint8ClampedArray(i)),yt(ml,this,new Uint32Array(i)),e&&e.length>0?(bt(ml,this).set(e),bt(ml,this).fill(Qo,e.length)):bt(ml,this).fill(Qo)}var Al=new WeakMap,El=new WeakMap,xl=new WeakMap,_l=new WeakMap,kl=new WeakMap;class Cl{constructor(t,e,i){if(mt(this,Al,void 0),mt(this,El,void 0),mt(this,xl,void 0),mt(this,_l,0),mt(this,kl,0),t instanceof Cl&&bt(xl,t)===!!i)return t;yt(Al,this,t),yt(El,this,e),yt(xl,this,!!i)}growOperationsCount(){throw new Error("Unreachable")}save(t){var e;return yt(kl,this,(e=bt(kl,this),e++,e)),bt(Al,this).save(bt(El,this)),this}restore(t){var e;bt(kl,this)>0&&(bt(Al,this).restore(bt(El,this)),yt(kl,this,(e=bt(kl,this),e--,e)));return this}recordOpenMarker(t){var e;return yt(_l,this,(e=bt(_l,this),e++,e)),this}getOpenMarker(){return bt(_l,this)>0?bt(El,this):bt(Al,this).getOpenMarker()}recordCloseMarker(t){var e;return yt(_l,this,(e=bt(_l,this),e--,e)),this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return bt(Al,this).pushBaseTransform(t),this}popBaseTransform(){return bt(Al,this).popBaseTransform(),this}recordSimpleData(t,e){return bt(Al,this).recordSimpleData(t,bt(El,this)),this}recordIncrementalData(t,e){return bt(Al,this).recordIncrementalData(t,bt(El,this)),this}resetIncrementalData(t,e){return bt(Al,this).resetIncrementalData(t,bt(El,this)),this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,i){return bt(Al,this).recordSimpleDataFromNamed(t,e,bt(El,this)),this}recordFutureForcedDependency(t,e){return bt(Al,this).recordFutureForcedDependency(t,bt(El,this)),this}inheritSimpleDataAsFutureForcedDependencies(t){return bt(Al,this).inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return bt(Al,this).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return bt(xl,this)||bt(Al,this).resetBBox(bt(El,this)),this}recordClipBox(t,e,i,n,s,r){return bt(xl,this)||bt(Al,this).recordClipBox(bt(El,this),e,i,n,s,r),this}recordBBox(t,e,i,n,s,r){return bt(xl,this)||bt(Al,this).recordBBox(bt(El,this),e,i,n,s,r),this}recordCharacterBBox(t,e,i,n,s,r,a){return bt(xl,this)||bt(Al,this).recordCharacterBBox(bt(El,this),e,i,n,s,r,a),this}recordFullPageBBox(t){return bt(xl,this)||bt(Al,this).recordFullPageBBox(bt(El,this)),this}getSimpleIndex(t){return bt(Al,this).getSimpleIndex(t)}recordDependencies(t,e){return bt(Al,this).recordDependencies(bt(El,this),e),this}recordNamedDependency(t,e){return bt(Al,this).recordNamedDependency(bt(El,this),e),this}recordOperation(t){return bt(Al,this).recordOperation(bt(El,this),!0),this}recordShowTextOperation(t){return bt(Al,this).recordShowTextOperation(bt(El,this),!0),this}bboxToClipBoxDropOperation(t){return bt(xl,this)||bt(Al,this).bboxToClipBoxDropOperation(bt(El,this),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const Sl=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],Ml=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],Tl=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],Pl=["filter","fillColor","fillAlpha"],Ll=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],Rl=["transform"],Dl=["transform","fillColor"],Fl="Fill",Il="Stroke",Nl="Shading";function Ol(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 Bl{isModifyingCurrentTransform(){return!1}getPattern(){Ce("Abstract method `getPattern` called.")}}class Wl extends Bl{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 i of this._colorStops)e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,n){let s;if(n===Il||n===Fl){const r=e.current.getClippedPathBoundingBox(n,pi(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),c=l.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-r[0],-r[1]),i=He.transform(i,[1,0,0,1,r[0],r[1]]),c.transform(...e.baseTransform),this.matrix&&c.transform(...this.matrix),Ol(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),s=t.createPattern(l.canvas,"no-repeat");const h=new DOMMatrix(i);s.setTransform(h)}else Ol(t,this._bbox),s=this._createGradient(t);return s}}function zl(t,e,i,n,s,r,a,o){const l=e.coords,c=e.colors,h=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,g=(l[i+1]+e.offsetY)*e.scaleY,f=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,v=(l[s]+e.offsetX)*e.scaleX,w=(l[s+1]+e.offsetY)*e.scaleY;if(g>=w)return;const b=c[r],y=c[r+1],A=c[r+2],E=c[a],x=c[a+1],_=c[a+2],k=c[o],C=c[o+1],S=c[o+2],M=Math.round(g),T=Math.round(w);let P,L,R,D,F,I,N,O;for(let B=M;B<=T;B++){if(B<m){const t=B<g?0:(g-B)/(g-m);P=p-(p-f)*t,L=b-(b-E)*t,R=y-(y-x)*t,D=A-(A-_)*t}else{let t;t=B>w?1:m===w?0:(m-B)/(m-w),P=f-(f-v)*t,L=E-(E-k)*t,R=x-(x-C)*t,D=_-(_-S)*t}let t;t=B<g?0:B>w?1:(g-B)/(g-w),F=p-(p-v)*t,I=b-(b-k)*t,N=y-(y-C)*t,O=A-(A-S)*t;const e=Math.round(Math.min(P,F)),i=Math.round(Math.max(P,F));let n=d*B+4*e;for(let s=e;s<=i;s++)t=(P-s)/(P-F),t<0?t=0:t>1&&(t=1),h[n++]=L-(L-I)*t|0,h[n++]=R-(R-N)*t|0,h[n++]=D-(D-O)*t|0,h[n++]=255}}function jl(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,c=o-1;for(r=0;r<l;r++){let e=r*o;for(let r=0;r<c;r++,e++)zl(t,i,n[e],n[e+1],n[e+o],s[e],s[e+1],s[e+o]),zl(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)zl(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 Hl extends Bl{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],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),c=r/o,h=a/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-s,scaleX:1/c,scaleY:1/h},u=o+4,p=l+4,g=i.getCanvas("mesh",u,p),f=g.context,m=f.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 v of this._figures)jl(m,v,d);f.putImageData(m,2,2);return{canvas:g.canvas,offsetX:n-2*c,offsetY:s-2*h,scaleX:c,scaleY:h}}isModifyingCurrentTransform(){return!0}getPattern(t,e,i,n){Ol(t,this._bbox);const s=new Float32Array(2);if(n===Nl)He.singularValueDecompose2dScale(pi(t),s);else if(this.matrix){He.singularValueDecompose2dScale(this.matrix,s);const[t,i]=s;He.singularValueDecompose2dScale(e.baseTransform,s),s[0]*=t,s[1]*=i}else He.singularValueDecompose2dScale(e.baseTransform,s);const r=this._createMeshCanvas(s,n===Nl?null:this._background,e.cachedCanvases);return n!==Nl&&(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 Ul extends Bl{getPattern(){return"hotpink"}}const Vl=1,Gl=2;class ql{constructor(t,e,i,n){this.color=t[1],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.ctx=e,this.canvasGraphicsFactory=i,this.baseTransform=n}createPatternCanvas(t,e){var i,n;const{bbox:s,operatorList:r,paintType:a,tilingType:o,color:l,canvasGraphicsFactory:c}=this;let{xstep:h,ystep:d}=this;h=Math.abs(h),d=Math.abs(d),_e("TilingType: "+o);const u=s[0],p=s[1],g=s[2],f=s[3],m=g-u,v=f-p,w=new Float32Array(2);He.singularValueDecompose2dScale(this.matrix,w);const[b,y]=w;He.singularValueDecompose2dScale(this.baseTransform,w);const A=b*w[0],E=y*w[1];let x=m,_=v,k=!1,C=!1;const S=Math.ceil(h*A),M=Math.ceil(d*E);S>=Math.ceil(m*A)?x=h:k=!0,M>=Math.ceil(v*E)?_=d:C=!0;const T=this.getSizeAndScale(x,this.ctx.canvas.width,A),P=this.getSizeAndScale(_,this.ctx.canvas.height,E),L=t.cachedCanvases.getCanvas("pattern",T.size,P.size),R=L.context,D=c.createCanvasGraphics(R,e);if(D.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(D,a,l),R.translate(-T.scale*u,-P.scale*p),D.transform(0,T.scale,0,0,P.scale,0,0),R.save(),null===(i=D.dependencyTracker)||void 0===i||i.save(),this.clipBbox(D,u,p,g,f),D.baseTransform=pi(D.ctx),D.executeOperatorList(r),D.endDrawing(),null===(n=D.dependencyTracker)||void 0===n||n.restore(),R.restore(),k||C){const e=L.canvas;k&&(x=h),C&&(_=d);const i=this.getSizeAndScale(x,this.ctx.canvas.width,A),n=this.getSizeAndScale(_,this.ctx.canvas.height,E),s=i.size,r=n.size,a=t.cachedCanvases.getCanvas("pattern-workaround",s,r),o=a.context,l=k?Math.floor(m/h):0,c=C?Math.floor(v/d):0;for(let t=0;t<=l;t++)for(let i=0;i<=c;i++)o.drawImage(e,s*t,r*i,s,r,0,0,s,r);return{canvas:a.canvas,scaleX:i.scale,scaleY:n.scale,offsetX:u,offsetY:p}}return{canvas:L.canvas,scaleX:T.scale,scaleY:P.scale,offsetX:u,offsetY:p}}getSizeAndScale(t,e,i){const n=Math.max(ql.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),He.axialAlignedBoundingBox([e,i,n,s],pi(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case Vl:const{fillStyle:t,strokeStyle:r}=this.ctx;n.fillStyle=s.fillColor=t,n.strokeStyle=s.strokeColor=r;break;case Gl:n.fillStyle=n.strokeStyle=i,s.fillColor=s.strokeColor=i;break;default:throw new Ne("Unsupported paint type: ".concat(e))}}isModifyingCurrentTransform(){return!1}getPattern(t,e,i,n,s){let r=i;n!==Nl&&(r=He.transform(r,e.baseTransform),this.matrix&&(r=He.transform(r,this.matrix)));const a=this.createPatternCanvas(e,s);let o=new DOMMatrix(r);o=o.translate(a.offsetX,a.offsetY),o=o.scale(1/a.scaleX,1/a.scaleY);const l=t.createPattern(a.canvas,"repeat");return l.setTransform(o),l}}function Xl(t){let{src:e,srcPos:i=0,dest:n,width:s,height:r,nonBlackColor:a=4294967295,inverseDecode:o=!1}=t;const l=ze.isLittleEndian?4278190080:255,[c,h]=o?[a,l]:[l,a],d=s>>3,u=7&s,p=e.length;n=new Uint32Array(n.buffer);let g=0;for(let f=0;f<r;f++){for(const s=i+d;i<s;i++){const t=i<p?e[i]:255;n[g++]=128&t?h:c,n[g++]=64&t?h:c,n[g++]=32&t?h:c,n[g++]=16&t?h:c,n[g++]=8&t?h:c,n[g++]=4&t?h:c,n[g++]=2&t?h:c,n[g++]=1&t?h:c}if(0===u)continue;const t=i<p?e[i++]:255;for(let e=0;e<u;e++)n[g++]=t&1<<7-e?h:c}return{srcPos:i,destPos:g}}(0,Wt.A)(ql,"MAX_PATTERN_SIZE",3e3);const Yl=16,Kl=new DOMMatrix,Ql=new Float32Array(2),Zl=new Float32Array([1/0,1/0,-1/0,-1/0]);class Jl{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 $l(t,e,i,n,s,r,a,o,l,c){const[h,d,u,p,g,f]=pi(t);if(0===d&&0===u){const m=a*h+g,v=Math.round(m),w=o*p+f,b=Math.round(w),y=(a+l)*h+g,A=Math.abs(Math.round(y)-v)||1,E=(o+c)*p+f,x=Math.abs(Math.round(E)-b)||1;return t.setTransform(Math.sign(h),0,0,Math.sign(p),v,b),t.drawImage(e,i,n,s,r,0,0,A,x),t.setTransform(h,d,u,p,g,f),[A,x]}if(0===h&&0===p){const m=o*u+g,v=Math.round(m),w=a*d+f,b=Math.round(w),y=(o+c)*u+g,A=Math.abs(Math.round(y)-v)||1,E=(a+l)*d+f,x=Math.abs(Math.round(E)-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(h,d,u,p,g,f),[x,A]}t.drawImage(e,i,n,s,r,a,o,l,c);return[Math.hypot(h,d)*l,Math.hypot(u,p)*c]}class tc{constructor(t,e,i){(0,Wt.A)(this,"alphaIsShape",!1),(0,Wt.A)(this,"fontSize",0),(0,Wt.A)(this,"fontSizeScale",1),(0,Wt.A)(this,"textMatrix",null),(0,Wt.A)(this,"textMatrixScale",1),(0,Wt.A)(this,"fontMatrix",Ht),(0,Wt.A)(this,"leading",0),(0,Wt.A)(this,"x",0),(0,Wt.A)(this,"y",0),(0,Wt.A)(this,"lineX",0),(0,Wt.A)(this,"lineY",0),(0,Wt.A)(this,"charSpacing",0),(0,Wt.A)(this,"wordSpacing",0),(0,Wt.A)(this,"textHScale",1),(0,Wt.A)(this,"textRenderingMode",ie),(0,Wt.A)(this,"textRise",0),(0,Wt.A)(this,"fillColor","#000000"),(0,Wt.A)(this,"strokeColor","#000000"),(0,Wt.A)(this,"patternFill",!1),(0,Wt.A)(this,"patternStroke",!1),(0,Wt.A)(this,"fillAlpha",1),(0,Wt.A)(this,"strokeAlpha",1),(0,Wt.A)(this,"lineWidth",1),(0,Wt.A)(this,"activeSMask",null),(0,Wt.A)(this,"transferMaps","none"),null===i||void 0===i||i(this),this.clipBox=new Float32Array([0,0,t,e]),this.minMax=Zl.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fl,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=this.minMax.slice();if(t===Il){e||Ce("Stroke bounding box must include transform."),He.singularValueDecompose2dScale(e,Ql);const t=Ql[0]*this.lineWidth/2,n=Ql[1]*this.lineWidth/2;i[0]-=t,i[1]-=n,i[2]+=t,i[3]+=n}return i}updateClipFromPath(){const t=He.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(Zl,0)}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fl,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return He.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function ec(t,e){if(e instanceof ImageData)return void t.putImageData(e,0,0);const i=e.height,n=e.width,s=i%Yl,r=(i-s)/Yl,a=0===s?r:r+1,o=t.createImageData(n,Yl);let l,c=0;const h=e.data,d=o.data;let u,p,g,f;if(e.kind===le.GRAYSCALE_1BPP){const e=h.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),f=i.length,m=n+7>>3,v=4294967295,w=ze.isLittleEndian?4278190080:255;for(u=0;u<a;u++){for(g=u<r?Yl:s,l=0,p=0;p<g;p++){const t=e-c;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=h[c++],i[l++]=128&d?v:w,i[l++]=64&d?v:w,i[l++]=32&d?v:w,i[l++]=16&d?v:w,i[l++]=8&d?v:w,i[l++]=4&d?v:w,i[l++]=2&d?v:w,i[l++]=1&d?v:w;for(;s<r;s++)0===o&&(d=h[c++],o=128),i[l++]=d&o?v:w,o>>=1}for(;l<f;)i[l++]=0;t.putImageData(o,0,u*Yl)}}else if(e.kind===le.RGBA_32BPP){for(p=0,f=n*Yl*4,u=0;u<r;u++)d.set(h.subarray(c,c+f)),c+=f,t.putImageData(o,0,p),p+=Yl;u<a&&(f=n*s*4,d.set(h.subarray(c,c+f)),t.putImageData(o,0,p))}else{if(e.kind!==le.RGB_24BPP)throw new Error("bad image kind: ".concat(e.kind));for(g=Yl,f=n*g,u=0;u<a;u++){for(u>=r&&(g=s,f=n*g),l=0,p=f;p--;)d[l++]=h[c++],d[l++]=h[c++],d[l++]=h[c++],d[l++]=255;t.putImageData(o,0,u*Yl)}}}function ic(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%Yl,r=(i-s)/Yl,a=0===s?r:r+1,o=t.createImageData(n,Yl);let l=0;const c=e.data,h=o.data;for(let d=0;d<a;d++){const e=d<r?Yl:s;({srcPos:l}=Xl({src:c,srcPos:l,dest:h,width:n,height:e,nonBlackColor:0})),t.putImageData(o,0,d*Yl)}}function nc(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 sc(t){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);const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}function rc(t,e){if(e)return!0;He.singularValueDecompose2dScale(t,Ql);const i=Math.fround(mi.pixelRatio*ti.PDF_TO_CSS_UNITS);return Ql[0]<=i&&Ql[1]<=i}const ac=["butt","round","square"],oc=["miter","round","bevel"],lc={},cc={};var hc=new WeakSet;class dc{constructor(t,e,i,n,s,r,a,o,l){let{optionalContentConfig:c,markedContentStack:h=null}=r;ft(this,hc),this.ctx=t,this.current=new tc(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=s,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=h||[],this.optionalContentConfig=c,this.cachedCanvases=new Jl(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=a,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=o,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=null!==l&&void 0!==l?l:null}getObject(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var n;return"string"===typeof e?(null===(n=this.dependencyTracker)||void 0===n||n.recordNamedDependency(t,e),e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e)):i}beginDrawing(t){let{transform:e,viewport:i,transparency:n=!1,background:s=null}=t;const r=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,r,a),this.ctx.fillStyle=o,n){const t=this.cachedCanvases.getCanvas("transparent",r,a);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...pi(this.compositeCtx))}this.ctx.save(),sc(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=pi(this.ctx)}executeOperatorList(t,e,i,n,s){const r=t.argsArray,a=t.fnArray;let o=e||0;const l=r.length;if(l===o)return o;const c=l-o>10&&"function"===typeof i,h=c?Date.now()+15:0;let d=0;const u=this.commonObjs,p=this.objs;let g,f;for(;;){if(void 0!==n&&o===n.nextBreakPoint)return n.breakIt(o,i),o;var m;if(!s||s(o))if(g=a[o],f=null!==(m=r[o])&&void 0!==m?m:null,g!==me.dependency)null===f?this[g](o):this[g](o,...f);else for(const t of f){var v;null===(v=this.dependencyTracker)||void 0===v||v.recordNamedData(t,o);const e=t.startsWith("g_")?u:p;if(!e.has(t))return e.get(t,i),o}if(o++,o===l)return o;if(c&&++d>10){if(Date.now()>h)return i(),o;d=0}}}endDrawing(){vt(hc,this,uc).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),vt(hc,this,pc).call(this)}_scaleImage(t,e){var i,n;const s=null!==(i=t.width)&&void 0!==i?i:t.displayWidth,r=null!==(n=t.height)&&void 0!==n?n:t.displayHeight;let a,o,l=Math.max(Math.hypot(e[0],e[1]),1),c=Math.max(Math.hypot(e[2],e[3]),1),h=s,d=r,u="prescale1";for(;l>2&&h>1||c>2&&d>1;){let e=h,i=d;l>2&&h>1&&(e=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h/2),l/=h/e),c>2&&d>1&&(i=d>=16384?Math.floor(d/2)-1||1:Math.ceil(d)/2,c/=d/i),a=this.cachedCanvases.getCanvas(u,e,i),o=a.context,o.clearRect(0,0,e,i),o.drawImage(t,0,0,h,d,0,0,e,i),t=a.canvas,h=e,d=i,u="prescale1"===u?"prescale2":"prescale1"}return{img:t,paintWidth:h,paintHeight:d}}_createMaskCanvas(t,e){var i;const n=this.ctx,{width:s,height:r}=e,a=this.current.fillColor,o=this.current.patternFill,l=pi(n);let c,h,d,u;if((e.bitmap||e.data)&&e.count>1){const i=e.bitmap||e.data.buffer;h=JSON.stringify(o?l:[l.slice(0,4),a]),c=this._cachedBitmapsMap.get(i),c||(c=new Map,this._cachedBitmapsMap.set(i,c));const n=c.get(h);if(n&&!o){var p;const e=Math.round(Math.min(l[0],l[2])+l[4]),i=Math.round(Math.min(l[1],l[3])+l[5]);return null===(p=this.dependencyTracker)||void 0===p||p.recordDependencies(t,Dl),{canvas:n,offsetX:e,offsetY:i}}d=n}d||(u=this.cachedCanvases.getCanvas("maskCanvas",s,r),ic(u.context,e));let g=He.transform(l,[1/s,0,0,-1/r,0,0]);g=He.transform(g,[1,0,0,1,0,-r]);const f=Zl.slice();He.axialAlignedBoundingBox([0,0,s,r],g,f);const[m,v,w,b]=f,y=Math.round(w-m)||1,A=Math.round(b-v)||1,E=this.cachedCanvases.getCanvas("fillCanvas",y,A),x=E.context,_=m,k=v;x.translate(-_,-k),x.transform(...g),d||(d=this._scaleImage(u.canvas,gi(x)),d=d.img,c&&o&&c.set(h,d)),x.imageSmoothingEnabled=rc(pi(x),e.interpolate),$l(x,d,0,0,d.width,d.height,0,0,s,r),x.globalCompositeOperation="source-in";const C=He.transform(gi(x),[1,0,0,1,-_,-k]);return x.fillStyle=o?a.getPattern(n,this,C,Fl,t):a,x.fillRect(0,0,s,r),c&&!o&&(this.cachedCanvases.delete("fillCanvas"),c.set(h,E.canvas)),null===(i=this.dependencyTracker)||void 0===i||i.recordDependencies(t,Dl),{canvas:E.canvas,offsetX:Math.round(_),offsetY:Math.round(k)}}setLineWidth(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("lineWidth",t),e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("lineCap",t),this.ctx.lineCap=ac[e]}setLineJoin(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("lineJoin",t),this.ctx.lineJoin=oc[e]}setMiterLimit(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("miterLimit",t),this.ctx.miterLimit=e}setDash(t,e,i){var n;null===(n=this.dependencyTracker)||void 0===n||n.recordSimpleData("dash",t);const s=this.ctx;void 0!==s.setLineDash&&(s.setLineDash(e),s.lineDashOffset=i)}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){var i,n,s,r,a;for(const[o,l]of e)switch(o){case"LW":this.setLineWidth(t,l);break;case"LC":this.setLineCap(t,l);break;case"LJ":this.setLineJoin(t,l);break;case"ML":this.setMiterLimit(t,l);break;case"D":this.setDash(t,l[0],l[1]);break;case"RI":this.setRenderingIntent(t,l);break;case"FL":this.setFlatness(t,l);break;case"Font":this.setFont(t,l[0],l[1]);break;case"CA":null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=l;break;case"ca":null===(n=this.dependencyTracker)||void 0===n||n.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=l;break;case"BM":null===(s=this.dependencyTracker)||void 0===s||s.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=l;break;case"SMask":null===(r=this.dependencyTracker)||void 0===r||r.recordSimpleData("SMask",t),this.current.activeSMask=l?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":null===(a=this.dependencyTracker)||void 0===a||a.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(l)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(t){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,i=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(n,e,i);this.suspendedCtx=this.ctx;const r=this.ctx=s.context;r.setTransform(this.suspendedCtx.getTransform()),nc(this.suspendedCtx,r),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()}}(r,this.suspendedCtx),this.setGState(t,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),nc(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,c,h){let d=t.canvas,u=o-c,p=l-h;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),e.globalCompositeOperation="destination-atop",e.fillStyle=r,e.fillRect(0,0,i,n),e.globalCompositeOperation="source-over",d=t.canvas,u=p=0}else{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=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 g=new Path2D;g.rect(o,l,i,n),e.clip(g),e.globalCompositeOperation="destination-in",e.drawImage(d,u,p,i,n,o,l,i,n),e.restore()}save(t){var e;this.inSMaskMode&&nc(this.ctx,this.suspendedCtx),this.ctx.save();const i=this.current;this.stateStack.push(i),this.current=i.clone(),null===(e=this.dependencyTracker)||void 0===e||e.save(t)}restore(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.restore(t),0!==this.stateStack.length?(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&nc(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null):this.inSMaskMode&&this.endSMaskMode()}transform(t,e,i,n,s,r,a){var o;null===(o=this.dependencyTracker)||void 0===o||o.recordIncrementalData("transform",t),this.ctx.transform(e,i,n,s,r,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i,n){let[s]=i;if(!n)return s||(s=i[0]=new Path2D),void this[e](t,s);if(null!==this.dependencyTracker){const i=e===me.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,n[0]-i,n[2]+i,n[1]-i,n[3]+i).recordDependencies(t,["transform"])}if(!(s instanceof Path2D)){const t=i[0]=new Path2D;for(let e=0,i=s.length;e<i;)switch(s[e++]){case ve:t.moveTo(s[e++],s[e++]);break;case we:t.lineTo(s[e++],s[e++]);break;case be:t.bezierCurveTo(s[e++],s[e++],s[e++],s[e++],s[e++],s[e++]);break;case ye:t.closePath();break;default:ke("Unrecognized drawing path operator: ".concat(s[e-1]))}s=t}He.axialAlignedBoundingBox(n,pi(this.ctx),this.current.minMax),this[e](t,s),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,e){var i;let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const s=this.ctx,r=this.current.strokeColor;if(s.globalAlpha=this.current.strokeAlpha,this.contentVisible)if("object"===typeof r&&null!==r&&void 0!==r&&r.getPattern){const i=r.isModifyingCurrentTransform()?s.getTransform():null;if(s.save(),s.strokeStyle=r.getPattern(s,this,gi(s),Il,t),i){const t=new Path2D;t.addPath(e,s.getTransform().invertSelf().multiplySelf(i)),e=t}this.rescaleAndStroke(e,!1),s.restore()}else this.rescaleAndStroke(e,!0);null===(i=this.dependencyTracker)||void 0===i||i.recordDependencies(t,Sl),n&&this.consumePath(t,e,this.current.getClippedPathBoundingBox(Il,pi(this.ctx))),s.globalAlpha=this.current.fillAlpha}closeStroke(t,e){this.stroke(t,e)}fill(t,e){var i;let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const s=this.ctx,r=this.current.fillColor;let a=!1;if(this.current.patternFill){var o;const i=r.isModifyingCurrentTransform()?s.getTransform():null;if(null===(o=this.dependencyTracker)||void 0===o||o.save(t),s.save(),s.fillStyle=r.getPattern(s,this,gi(s),Fl,t),i){const t=new Path2D;t.addPath(e,s.getTransform().invertSelf().multiplySelf(i)),e=t}a=!0}const l=this.current.getClippedPathBoundingBox();var c;(this.contentVisible&&null!==l&&(this.pendingEOFill?(s.fill(e,"evenodd"),this.pendingEOFill=!1):s.fill(e)),null===(i=this.dependencyTracker)||void 0===i||i.recordDependencies(t,Ml),a)&&(s.restore(),null===(c=this.dependencyTracker)||void 0===c||c.restore(t));n&&this.consumePath(t,e,l)}eoFill(t,e){this.pendingEOFill=!0,this.fill(t,e)}fillStroke(t,e){this.fill(t,e,!1),this.stroke(t,e,!1),this.consumePath(t,e)}eoFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}closeFillStroke(t,e){this.fillStroke(t,e)}closeEOFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}endPath(t,e){this.consumePath(t,e)}rawFillPath(t,e){var i;this.ctx.fill(e),null===(i=this.dependencyTracker)||void 0===i||i.recordDependencies(t,Pl).recordOperation(t)}clip(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordFutureForcedDependency("clipMode",t),this.pendingClip=lc}eoClip(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordFutureForcedDependency("clipMode",t),this.pendingClip=cc}beginText(t){var e;this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,null===(e=this.dependencyTracker)||void 0===e||e.recordOpenMarker(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){const e=this.pendingTextPaths,i=this.ctx;if(this.dependencyTracker){const{dependencyTracker:i}=this;void 0!==e&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",t),i.recordCloseMarker(t)}if(void 0!==e){const t=new Path2D,n=i.getTransform().invertSelf();for(const{transform:i,x:s,y:r,fontSize:a,path:o}of e)o&&t.addPath(o,new DOMMatrix(i).preMultiplySelf(n).translate(s,r).scale(a,-a));i.clip(t)}delete this.pendingTextPaths}setCharSpacing(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("charSpacing",t),this.current.charSpacing=e}setWordSpacing(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("wordSpacing",t),this.current.wordSpacing=e}setHScale(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("hScale",t),this.current.textHScale=e/100}setLeading(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("leading",t),this.current.leading=-e}setFont(t,e,i){var n,s;null===(n=this.dependencyTracker)||void 0===n||n.recordSimpleData("font",t).recordSimpleDataFromNamed("fontObj",e,t);const r=this.commonObjs.get(e),a=this.current;if(!r)throw new Error("Can't find font for ".concat(e));if(a.fontMatrix=r.fontMatrix||Ht,0!==a.fontMatrix[0]&&0!==a.fontMatrix[3]||ke("Invalid font matrix for font "+e),i<0?(i=-i,a.fontDirection=-1):a.fontDirection=1,this.current.font=r,this.current.fontSize=i,r.isType3Font)return;const o=r.loadedName||"sans-serif",l=(null===(s=r.systemFontInfo)||void 0===s?void 0:s.css)||'"'.concat(o,'", ').concat(r.fallbackName);let c="normal";r.black?c="900":r.bold&&(c="bold");const h=r.italic?"italic":"normal";let d=i;i<16?d=16:i>100&&(d=100),this.current.fontSizeScale=i/d,this.ctx.font="".concat(h," ").concat(c," ").concat(d,"px ").concat(l)}setTextRenderingMode(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=e}setTextRise(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("textRise",t),this.current.textRise=e}moveText(t,e,i){var n;null===(n=this.dependencyTracker)||void 0===n||n.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=i}setLeadingMoveText(t,e,i){this.setLeading(t,-i),this.moveText(t,e,i)}setTextMatrix(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("textMatrix",t);const{current:n}=this;n.textMatrix=e,n.textMatrixScale=Math.hypot(e[0],e[1]),n.x=n.lineX=0,n.y=n.lineY=0}nextLine(t){var e,i;this.moveText(t,0,this.current.leading),null===(e=this.dependencyTracker)||void 0===e||e.recordIncrementalData("moveText",null!==(i=this.dependencyTracker.getSimpleIndex("leading"))&&void 0!==i?i:t)}paintChar(t,e,i,n,s,r){const a=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,h=o.fontSize/o.fontSizeScale,d=c&ae,u=!!(c&oe),p=o.patternFill&&!l.missingFile,g=o.patternStroke&&!l.missingFile;let f;if((l.disableFontFace||u||p||g)&&!l.missingFile&&(f=l.getPathGenerator(this.commonObjs,e)),f&&(l.disableFontFace||p||g)){var m;let e;if(a.save(),a.translate(i,n),a.scale(h,-h),null===(m=this.dependencyTracker)||void 0===m||m.recordCharacterBBox(t,a,l),d===ie||d===se)if(s){e=a.getTransform(),a.setTransform(...s);const t=vt(hc,this,gc).call(this,f,e,s);a.fill(t)}else a.fill(f);if(d===ne||d===se)if(r){e||(e=a.getTransform()),a.setTransform(...r);const{a:t,b:i,c:n,d:s}=e,o=He.inverseTransform(r),l=He.transform([t,i,n,s,0,0],o);He.singularValueDecompose2dScale(l,Ql),a.lineWidth*=Math.max(Ql[0],Ql[1])/h,a.stroke(vt(hc,this,gc).call(this,f,e,r))}else a.lineWidth/=h,a.stroke(f);a.restore()}else{var v;if(d===ie||d===se)a.fillText(e,i,n),null===(v=this.dependencyTracker)||void 0===v||v.recordCharacterBBox(t,a,l,h,i,n,()=>a.measureText(e));if(d===ne||d===se){var w;if(this.dependencyTracker)null===(w=this.dependencyTracker)||void 0===w||w.recordCharacterBBox(t,a,l,h,i,n,()=>a.measureText(e)).recordDependencies(t,Sl);a.strokeText(e,i,n)}}if(u){var b;(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:pi(a),x:i,y:n,fontSize:h,path:f}),null===(b=this.dependencyTracker)||void 0===b||b.recordCharacterBBox(t,a,l,h,i,n)}}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 n=3;n<e.length;n+=4)if(e[n]>0&&e[n]<255){i=!0;break}return Pe(this,"isFontSubpixelAAEnabled",i)}showText(t,e){var i;this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,Ll).resetBBox(t),this.current.textRenderingMode&oe&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());const n=this.current,s=n.font;var r;if(s.isType3Font)return this.showType3Text(t,e),void(null===(r=this.dependencyTracker)||void 0===r||r.recordShowTextOperation(t));const a=n.fontSize;var o;if(0===a)return void(null===(o=this.dependencyTracker)||void 0===o||o.recordOperation(t));const l=this.ctx,c=n.fontSizeScale,h=n.charSpacing,d=n.wordSpacing,u=n.fontDirection,p=n.textHScale*u,g=e.length,f=s.vertical,m=f?1:-1,v=s.defaultVMetrics,w=a*n.fontMatrix[0],b=n.textRenderingMode===ie&&!s.disableFontFace&&!n.patternFill;let y,A;if(l.save(),n.textMatrix&&l.transform(...n.textMatrix),l.translate(n.x,n.y+n.textRise),u>0?l.scale(p,-1):l.scale(p,1),n.patternFill){l.save();const e=n.fillColor.getPattern(l,this,gi(l),Fl,t);y=pi(l),l.restore(),l.fillStyle=e}if(n.patternStroke){l.save();const e=n.strokeColor.getPattern(l,this,gi(l),Il,t);A=pi(l),l.restore(),l.strokeStyle=e}let E=n.lineWidth;const x=n.textMatrixScale;if(0===x||0===E){const t=n.textRenderingMode&ae;t!==ne&&t!==se||(E=this.getSinglePixelWidth())}else E/=x;if(1!==c&&(l.scale(c,c),E/=c),l.lineWidth=E,s.isInvalidPDFjsFont){const i=[];let s=0;for(const t of e)i.push(t.unicode),s+=t.width;const r=i.join("");if(l.fillText(r,0,0),null!==this.dependencyTracker){const e=l.measureText(r);this.dependencyTracker.recordBBox(t,this.ctx,-e.actualBoundingBoxLeft,e.actualBoundingBoxRight,-e.actualBoundingBoxAscent,e.actualBoundingBoxDescent).recordShowTextOperation(t)}return n.x+=s*w*p,l.restore(),void this.compose()}let _,k=0;for(_=0;_<g;++_){const i=e[_];if("number"===typeof i){k+=m*i*a/1e3;continue}let n=!1;const r=(i.isSpace?d:0)+h,o=i.fontChar,p=i.accent;let g,E,x,S=i.width;if(f){const t=i.vmetric||v,e=-(i.vmetric?t[1]:.5*S)*w,n=t[2]*w;S=t?-t[0]:S,g=e/c,E=(k+n)/c}else g=k/c,E=0;if(s.remeasure&&S>0){x=l.measureText(o);const t=1e3*x.width/a*c;if(S<t&&this.isFontSubpixelAAEnabled){const e=S/t;n=!0,l.save(),l.scale(e,1),g/=e}else S!==t&&(g+=(S-t)/2e3*a/c)}var C;if(this.contentVisible&&(i.isInFont||s.missingFile))if(b&&!p)l.fillText(o,g,E),null===(C=this.dependencyTracker)||void 0===C||C.recordCharacterBBox(t,l,x?{bbox:null}:s,a/c,g,E,()=>null!==x&&void 0!==x?x:l.measureText(o));else if(this.paintChar(t,o,g,E,y,A),p){const e=g+a*p.offset.x/c,i=E-a*p.offset.y/c;this.paintChar(t,p.fontChar,e,i,y,A)}k+=f?S*w-r*u:S*w+r*u,n&&l.restore()}f?n.y-=k:n.x+=k*p,l.restore(),this.compose(),null===(i=this.dependencyTracker)||void 0===i||i.recordShowTextOperation(t)}showType3Text(t,e){const i=this.ctx,n=this.current,s=n.font,r=n.fontSize,a=n.fontDirection,o=s.vertical?1:-1,l=n.charSpacing,c=n.wordSpacing,h=n.textHScale*a,d=n.fontMatrix||Ht,u=e.length;let p,g,f,m;if(n.textRenderingMode===re||0===r)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),n.textMatrix&&i.transform(...n.textMatrix),i.translate(n.x,n.y+n.textRise),i.scale(h,a);const v=this.dependencyTracker;for(this.dependencyTracker=v?new Cl(v,t):null,p=0;p<u;++p){if(g=e[p],"number"===typeof g){m=o*g*r/1e3,this.ctx.translate(m,0),n.x+=m*h;continue}const t=(g.isSpace?c:0)+l,a=s.charProcOperatorList[g.operatorListId];a?this.contentVisible&&(this.save(),i.scale(r,r),i.transform(...d),this.executeOperatorList(a),this.restore()):ke('Type3 character "'.concat(g.operatorListId,'" is not available.'));const u=[g.width,0];He.applyTransform(u,d),f=u[0]*r+t,i.translate(f,0),n.x+=f*h}i.restore(),v&&(this.dependencyTracker=v)}setCharWidth(t,e,i){}setCharWidthAndBounds(t,e,i,n,s,r,a){var o;const l=new Path2D;l.rect(n,s,r-n,a-s),this.ctx.clip(l),null===(o=this.dependencyTracker)||void 0===o||o.recordBBox(t,this.ctx,n,r,s,a).recordClipBox(t,this.ctx,n,r,s,a),this.endPath(t)}getColorN_Pattern(t,e){let i;if("TilingPattern"===e[0]){const t=this.baseTransform||pi(this.ctx),n={createCanvasGraphics:(t,e)=>new dc(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new Cl(this.dependencyTracker,e,!0):null)};i=new ql(e,this.ctx,n,t)}else i=this._getPattern(t,e[1],e[2]);return i}setStrokeColorN(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordSimpleData("strokeColor",t);for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];this.current.strokeColor=this.getColorN_Pattern(t,n),this.current.patternStroke=!0}setFillColorN(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordSimpleData("fillColor",t);for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];this.current.fillColor=this.getColorN_Pattern(t,n),this.current.patternFill=!0}setStrokeRGBColor(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}setStrokeTransparent(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1}setFillTransparent(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.cachedPatterns.has(e)?i=this.cachedPatterns.get(e):(i=function(t){switch(t[0]){case"RadialAxial":return new Wl(t);case"Mesh":return new Hl(t);case"Dummy":return new Ul}throw new Error("Unknown IR type: ".concat(t[0]))}(this.getObject(t,e)),this.cachedPatterns.set(e,i)),n&&(i.matrix=n),i}shadingFill(t,e){var i;if(!this.contentVisible)return;const n=this.ctx;this.save(t);const s=this._getPattern(t,e);n.fillStyle=s.getPattern(n,this,gi(n),Nl,t);const r=gi(n);if(r){const{width:t,height:e}=n.canvas,i=Zl.slice();He.axialAlignedBoundingBox([0,0,t,e],r,i);const[s,a,o,l]=i;this.ctx.fillRect(s,a,o-s,l-a)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);null===(i=this.dependencyTracker)||void 0===i||i.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,Rl).recordDependencies(t,Ml).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t)}beginInlineImage(){Ce("Should not call beginInlineImage")}beginImageData(){Ce("Should not call beginImageData")}paintFormXObjectBegin(t,e,i){if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),e&&this.transform(t,...e),this.baseTransform=pi(this.ctx),i)){var n;He.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[e,s,r,a]=i,o=new Path2D;o.rect(e,s,r-e,a-s),this.ctx.clip(o),null===(n=this.dependencyTracker)||void 0===n||n.recordClipBox(t,this.ctx,e,r,s,a),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,e){var i;if(!this.contentVisible)return;this.save(t),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const n=this.ctx;e.isolated||_e("TODO: Support non-isolated groups."),e.knockout&&ke("Knockout groups not supported.");const s=pi(n);if(e.matrix&&n.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let r=Zl.slice();He.axialAlignedBoundingBox(e.bbox,pi(n),r);const a=[0,0,n.canvas.width,n.canvas.height];r=He.intersect(r,a)||[0,0,0,0];const o=Math.floor(r[0]),l=Math.floor(r[1]),c=Math.max(Math.ceil(r[2])-o,1),h=Math.max(Math.ceil(r[3])-l,1);this.current.startNewPathAndClipBox([0,0,c,h]);let d="groupAt"+this.groupLevel;e.smask&&(d+="_smask_"+this.smaskCounter++%2);const u=this.cachedCanvases.getCanvas(d,c,h),p=u.context;p.translate(-o,-l),p.transform(...s);let g=new Path2D;const[f,m,v,w]=e.bbox;if(g.rect(f,m,v-f,w-m),e.matrix){const t=new Path2D;t.addPath(g,new DOMMatrix(e.matrix)),g=t}p.clip(g),e.smask&&this.smaskStack.push({canvas:u.canvas,context:p,offsetX:o,offsetY:l,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}),e.smask&&!this.dependencyTracker||(n.setTransform(1,0,0,1,0,0),n.translate(o,l),n.save()),nc(n,p),this.ctx=p,null===(i=this.dependencyTracker)||void 0===i||i.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(n),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}endGroup(t,e){var i;if(!this.contentVisible)return;this.groupLevel--;const n=this.ctx,s=this.groupStack.pop();if(this.ctx=s,this.ctx.imageSmoothingEnabled=!1,null===(i=this.dependencyTracker)||void 0===i||i.popBaseTransform(),e.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const e=pi(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...e);const i=Zl.slice();He.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],e,i),this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,n,s,r){if(vt(hc,this,uc).call(this),sc(this.ctx),this.ctx.save(),this.save(t),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const s=i[2]-i[0],a=i[3]-i[1];if(r&&this.annotationCanvasMap){(n=n.slice())[4]-=i[0],n[5]-=i[1],(i=i.slice())[0]=i[1]=0,i[2]=s,i[3]=a,He.singularValueDecompose2dScale(pi(this.ctx),Ql);const{viewportScale:t}=this,r=Math.ceil(s*this.outputScaleX*t),o=Math.ceil(a*this.outputScaleY*t);this.annotationCanvas=this.canvasFactory.create(r,o);const{canvas:l,context:c}=this.annotationCanvas;this.annotationCanvasMap.set(e,l),this.annotationCanvas.savedCtx=this.ctx,this.ctx=c,this.ctx.save(),this.ctx.setTransform(Ql[0],0,0,-Ql[1],0,a*Ql[1]),sc(this.ctx)}else{sc(this.ctx),this.endPath(t);const e=new Path2D;e.rect(i[0],i[1],s,a),this.ctx.clip(e)}}this.current=new tc(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(t,...n),this.transform(t,...s)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),vt(hc,this,pc).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t,e){var i;if(!this.contentVisible)return;const n=e.count;(e=this.getObject(t,e.data,e)).count=n;const s=this.ctx,r=this._createMaskCanvas(t,e),a=r.canvas;s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(a,r.offsetX,r.offsetY),null===(i=this.dependencyTracker)||void 0===i||i.resetBBox(t).recordBBox(t,this.ctx,r.offsetX,r.offsetX+a.width,r.offsetY,r.offsetY+a.height).recordOperation(t),s.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i){var n,s;let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0;if(!this.contentVisible)return;e=this.getObject(t,e.data,e);const c=this.ctx;c.save();const h=pi(c);c.transform(i,r,a,o,0,0);const d=this._createMaskCanvas(t,e);c.setTransform(1,0,0,1,d.offsetX-h[4],d.offsetY-h[5]),null===(n=this.dependencyTracker)||void 0===n||n.resetBBox(t);for(let p=0,g=l.length;p<g;p+=2){var u;const e=He.transform(h,[i,r,a,o,l[p],l[p+1]]);c.drawImage(d.canvas,e[4],e[5]),null===(u=this.dependencyTracker)||void 0===u||u.recordBBox(t,this.ctx,e[4],e[4]+d.canvas.width,e[5],e[5]+d.canvas.height)}c.restore(),this.compose(),null===(s=this.dependencyTracker)||void 0===s||s.recordOperation(t)}paintImageMaskXObjectGroup(t,e){var i,n;if(!this.contentVisible)return;const s=this.ctx,r=this.current.fillColor,a=this.current.patternFill;null===(i=this.dependencyTracker)||void 0===i||i.resetBBox(t).recordDependencies(t,Dl);for(const l of e){var o;const{data:e,width:i,height:n,transform:c}=l,h=this.cachedCanvases.getCanvas("maskCanvas",i,n),d=h.context;d.save();ic(d,this.getObject(t,e,l)),d.globalCompositeOperation="source-in",d.fillStyle=a?r.getPattern(d,this,gi(s),Fl,t):r,d.fillRect(0,0,i,n),d.restore(),s.save(),s.transform(...c),s.scale(1,-1),$l(s,h.canvas,0,0,i,n,0,-1,1,1),null===(o=this.dependencyTracker)||void 0===o||o.recordBBox(t,s,0,i,0,n),s.restore()}this.compose(),null===(n=this.dependencyTracker)||void 0===n||n.recordOperation(t)}paintImageXObject(t,e){if(!this.contentVisible)return;const i=this.getObject(t,e);i?this.paintInlineImageXObject(t,i):ke("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n,s){if(!this.contentVisible)return;const r=this.getObject(t,e);if(!r)return void ke("Dependent image isn't ready yet");const a=r.width,o=r.height,l=[];for(let c=0,h=s.length;c<h;c+=2)l.push({transform:[i,0,0,n,s[c],s[c+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(t,r,l)}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,e){var i;if(!this.contentVisible)return;const n=e.width,s=e.height,r=this.ctx;this.save(t);const{filter:a}=r;let o;if("none"!==a&&""!==a&&(r.filter="none"),r.scale(1/n,-1/s),e.bitmap)o=this.applyTransferMapsToBitmap(e);else if("function"===typeof HTMLElement&&e instanceof HTMLElement||!e.data)o=e;else{const t=this.cachedCanvases.getCanvas("inlineImage",n,s).context;ec(t,e),o=this.applyTransferMapsToCanvas(t)}const l=this._scaleImage(o,gi(r));r.imageSmoothingEnabled=rc(pi(r),e.interpolate),null===(i=this.dependencyTracker)||void 0===i||i.resetBBox(t).recordBBox(t,r,0,n,-s,0).recordDependencies(t,Tl).recordOperation(t),$l(r,l.img,0,0,l.paintWidth,l.paintHeight,0,-s,n,s),this.compose(),this.restore(t)}paintInlineImageXObjectGroup(t,e,i){var n,s;if(!this.contentVisible)return;const r=this.ctx;let a;if(e.bitmap)a=e.bitmap;else{const t=e.width,i=e.height,n=this.cachedCanvases.getCanvas("inlineImage",t,i).context;ec(n,e),a=this.applyTransferMapsToCanvas(n)}null===(n=this.dependencyTracker)||void 0===n||n.resetBBox(t);for(const l of i){var o;r.save(),r.transform(...l.transform),r.scale(1,-1),$l(r,a,l.x,l.y,l.w,l.h,0,-1,1,1),null===(o=this.dependencyTracker)||void 0===o||o.recordBBox(t,r,0,1,-1,0),r.restore()}null===(s=this.dependencyTracker)||void 0===s||s.recordOperation(t),this.compose()}paintSolidColorImageMask(t){var e;this.contentVisible&&(null===(e=this.dependencyTracker)||void 0===e||e.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,Ml).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t,e){}markPointProps(t,e,i){}beginMarkedContent(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e,i){var n;null===(n=this.dependencyTracker)||void 0===n||n.beginMarkedContent(t),"OC"===e?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,e,i){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const s=this.ctx;var r,a;this.pendingClip?(n||(this.pendingClip===cc?s.clip(e,"evenodd"):s.clip(e)),this.pendingClip=null,null===(r=this.dependencyTracker)||void 0===r||r.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):null===(a=this.dependencyTracker)||void 0===a||a.recordOperation(t);this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=pi(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),c=Math.hypot(n,s);if(0===t)r=c/o,a=l/o;else{const e=t*o;r=c>e?c/e:1,a=l>e?l/e:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:i,current:{lineWidth:n}}=this,[s,r]=this.getScaleForStroking();if(s===r)return i.lineWidth=(n||1)*s,void i.stroke(t);const a=i.getLineDash();e&&i.save(),i.scale(s,r),Kl.a=1/s,Kl.d=1/r;const o=new Path2D;if(o.addPath(t,Kl),a.length>0){const t=Math.max(s,r);i.setLineDash(a.map(e=>e/t)),i.lineDashOffset/=t}i.lineWidth=n||1,i.stroke(o),e&&i.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}function uc(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,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)}function pc(){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}}}function gc(t,e,i){const n=new Path2D;return n.addPath(t,new DOMMatrix(i).invertSelf().multiplySelf(e)),n}for(const tE in me)void 0!==dc.prototype[tE]&&(dc.prototype[me[tE]]=dc.prototype[tE]);var fc=new WeakMap,mc=new WeakMap,vc=new WeakMap,wc=new WeakSet;class bc{static write(t){const e=new TextEncoder,i={};let n=0;for(const l of bc.strings){const s=e.encode(t[l]);i[l]=s,n+=4+s.length}const s=new ArrayBuffer(n),r=new Uint8Array(s),a=new DataView(s);let o=0;for(const l of bc.strings){const t=i[l],e=t.length;a.setUint32(o,e),r.set(t,o+4),o+=4+e}return Se(o===s.byteLength,"CssFontInfo.write: Buffer overflow"),s}constructor(t){ft(this,wc),mt(this,fc,void 0),mt(this,mc,void 0),mt(this,vc,void 0),yt(fc,this,t),yt(mc,this,new DataView(bt(fc,this))),yt(vc,this,new TextDecoder)}get fontFamily(){return vt(wc,this,yc).call(this,0)}get fontWeight(){return vt(wc,this,yc).call(this,1)}get italicAngle(){return vt(wc,this,yc).call(this,2)}}function yc(t){Se(t<Ct.strings.length,"Invalid string index");let e=0;for(let n=0;n<t;n++)e+=bt(mc,this).getUint32(e)+4;const i=bt(mc,this).getUint32(e);return bt(vc,this).decode(new Uint8Array(bt(fc,this),e+4,i))}Ct=bc,(0,Wt.A)(bc,"strings",["fontFamily","fontWeight","italicAngle"]);var Ac=new WeakMap,Ec=new WeakMap,xc=new WeakMap,_c=new WeakSet;class kc{static write(t){const e=new TextEncoder,i={};let n=0;for(const d of kc.strings){const s=e.encode(t[d]);i[d]=s,n+=4+s.length}n+=4;let s,r,a=1+n;t.style&&(s=e.encode(t.style.style),r=e.encode(t.style.weight),a+=4+s.length+4+r.length);const o=new ArrayBuffer(a),l=new Uint8Array(o),c=new DataView(o);let h=0;c.setUint8(h++,t.guessFallback?1:0),c.setUint32(h,0),h+=4,n=0;for(const d of kc.strings){const t=i[d],e=t.length;n+=4+e,c.setUint32(h,e),l.set(t,h+4),h+=4+e}return c.setUint32(h-n-4,n),t.style&&(c.setUint32(h,s.length),l.set(s,h+4),h+=4+s.length,c.setUint32(h,r.length),l.set(r,h+4),h+=4+r.length),Se(h<=o.byteLength,"SubstitionInfo.write: Buffer overflow"),o.transferToFixedLength(h)}constructor(t){ft(this,_c),mt(this,Ac,void 0),mt(this,Ec,void 0),mt(this,xc,void 0),yt(Ac,this,t),yt(Ec,this,new DataView(bt(Ac,this))),yt(xc,this,new TextDecoder)}get guessFallback(){return 0!==bt(Ec,this).getUint8(0)}get css(){return vt(_c,this,Cc).call(this,0)}get loadedName(){return vt(_c,this,Cc).call(this,1)}get baseFontName(){return vt(_c,this,Cc).call(this,2)}get src(){return vt(_c,this,Cc).call(this,3)}get style(){let t=1;t+=4+bt(Ec,this).getUint32(t);const e=bt(Ec,this).getUint32(t),i=bt(xc,this).decode(new Uint8Array(bt(Ac,this),t+4,e));t+=4+e;const n=bt(Ec,this).getUint32(t);return{style:i,weight:bt(xc,this).decode(new Uint8Array(bt(Ac,this),t+4,n))}}}function Cc(t){Se(t<St.strings.length,"Invalid string index");let e=5;for(let n=0;n<t;n++)e+=bt(Ec,this).getUint32(e)+4;const i=bt(Ec,this).getUint32(e);return bt(xc,this).decode(new Uint8Array(bt(Ac,this),e+4,i))}St=kc,(0,Wt.A)(kc,"strings",["css","loadedName","baseFontName","src"]);var Sc=new WeakMap,Mc=new WeakMap,Tc=new WeakMap,Pc=new WeakSet;class Lc{constructor(t){let{data:e,extra:i}=t;ft(this,Pc),mt(this,Sc,void 0),mt(this,Mc,void 0),mt(this,Tc,void 0),yt(Sc,this,e),yt(Mc,this,new TextDecoder),yt(Tc,this,new DataView(bt(Sc,this))),i&&Object.assign(this,i)}get black(){return vt(Pc,this,Rc).call(this,0)}get bold(){return vt(Pc,this,Rc).call(this,1)}get disableFontFace(){return vt(Pc,this,Rc).call(this,2)}get fontExtraProperties(){return vt(Pc,this,Rc).call(this,3)}get isInvalidPDFjsFont(){return vt(Pc,this,Rc).call(this,4)}get isType3Font(){return vt(Pc,this,Rc).call(this,5)}get italic(){return vt(Pc,this,Rc).call(this,6)}get missingFile(){return vt(Pc,this,Rc).call(this,7)}get remeasure(){return vt(Pc,this,Rc).call(this,8)}get vertical(){return vt(Pc,this,Rc).call(this,9)}get ascent(){return vt(Pc,this,Dc).call(this,0)}get defaultWidth(){return vt(Pc,this,Dc).call(this,1)}get descent(){return vt(Pc,this,Dc).call(this,2)}get bbox(){let t=Nc._;if(0===bt(Tc,this).getUint8(t))return;t+=1;const e=[];for(let i=0;i<4;i++)e.push(bt(Tc,this).getInt16(t,!0)),t+=2;return e}get fontMatrix(){let t=Oc._;if(0===bt(Tc,this).getUint8(t))return;t+=1;const e=[];for(let i=0;i<6;i++)e.push(bt(Tc,this).getFloat64(t,!0)),t+=8;return e}get defaultVMetrics(){let t=Bc._;if(0===bt(Tc,this).getUint8(t))return;t+=1;const e=[];for(let i=0;i<3;i++)e.push(bt(Tc,this).getInt16(t,!0)),t+=2;return e}get fallbackName(){return vt(Pc,this,Fc).call(this,0)}get loadedName(){return vt(Pc,this,Fc).call(this,1)}get mimetype(){return vt(Pc,this,Fc).call(this,2)}get name(){return vt(Pc,this,Fc).call(this,3)}get data(){let t=Wc._;t+=4+bt(Tc,this).getUint32(t);t+=4+bt(Tc,this).getUint32(t);t+=4+bt(Tc,this).getUint32(t);const e=bt(Tc,this).getUint32(t);if(0!==e)return new Uint8Array(bt(Sc,this),t+4,e)}clearData(){let t=Wc._;t+=4+bt(Tc,this).getUint32(t);t+=4+bt(Tc,this).getUint32(t);t+=4+bt(Tc,this).getUint32(t);const e=bt(Tc,this).getUint32(t);new Uint8Array(bt(Sc,this),t+4,e).fill(0),bt(Tc,this).setUint32(t,0)}get cssFontInfo(){let t=Wc._;t+=4+bt(Tc,this).getUint32(t);t+=4+bt(Tc,this).getUint32(t);const e=bt(Tc,this).getUint32(t);if(0===e)return null;const i=new Uint8Array(e);return i.set(new Uint8Array(bt(Sc,this),t+4,e)),new bc(i.buffer)}get systemFontInfo(){let t=Wc._;t+=4+bt(Tc,this).getUint32(t);const e=bt(Tc,this).getUint32(t);if(0===e)return null;const i=new Uint8Array(e);return i.set(new Uint8Array(bt(Sc,this),t+4,e)),new kc(i.buffer)}static write(t){const e=t.systemFontInfo?kc.write(t.systemFontInfo):null,i=t.cssFontInfo?bc.write(t.cssFontInfo):null,n=new TextEncoder,s={};let r=0;for(const g of Lc.strings)s[g]=n.encode(t[g]),r+=4+s[g].length;const a=Wc._+4+r+4+(e?e.byteLength:0)+4+(i?i.byteLength:0)+4+(t.data?t.data.length:0),o=new ArrayBuffer(a),l=new Uint8Array(o),c=new DataView(o);let h=0;const d=Lc.bools.length;let u=0,p=0;for(let g=0;g<d;g++){const e=t[Lc.bools[g]];u|=(void 0===e?0:e?2:1)<<p,p+=2,8!==p&&g!==d-1||(c.setUint8(h++,u),u=0,p=0)}Se(h===Ic._,"FontInfo.write: Boolean properties offset mismatch");for(const g of Lc.numbers)c.setFloat64(h,t[g]),h+=8;if(Se(h===Nc._,"FontInfo.write: Number properties offset mismatch"),t.bbox){c.setUint8(h++,4);for(const e of t.bbox)c.setInt16(h,e,!0),h+=2}else c.setUint8(h++,0),h+=8;if(Se(h===Oc._,"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){c.setUint8(h++,6);for(const e of t.fontMatrix)c.setFloat64(h,e,!0),h+=8}else c.setUint8(h++,0),h+=48;if(Se(h===Bc._,"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){c.setUint8(h++,1);for(const e of t.defaultVMetrics)c.setInt16(h,e,!0),h+=2}else c.setUint8(h++,0),h+=6;Se(h===Wc._,"FontInfo.write: DefaultVMetrics properties offset mismatch"),c.setUint32(Wc._,0),h+=4;for(const g of Lc.strings){const t=s[g],e=t.length;c.setUint32(h,e),l.set(t,h+4),h+=4+e}if(c.setUint32(Wc._,h-Wc._-4),e){const t=e.byteLength;c.setUint32(h,t),Se(h+4+t<=o.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),l.set(new Uint8Array(e),h+4),h+=4+t}else c.setUint32(h,0),h+=4;if(i){const t=i.byteLength;c.setUint32(h,t),Se(h+4+t<=o.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),l.set(new Uint8Array(i),h+4),h+=4+t}else c.setUint32(h,0),h+=4;return void 0===t.data?(c.setUint32(h,0),h+=4):(c.setUint32(h,t.data.length),l.set(t.data,h+4),h+=4+t.data.length),Se(h<=o.byteLength,"FontInfo.write: Buffer overflow"),o.transferToFixedLength(h)}}function Rc(t){Se(t<Mt.bools.length,"Invalid boolean index");const e=Math.floor(t/4),i=2*t%8,n=bt(Tc,this).getUint8(e)>>i&3;return 0===n?void 0:2===n}function Dc(t){return Se(t<Mt.numbers.length,"Invalid number index"),bt(Tc,this).getFloat64(Ic._+8*t)}function Fc(t){Se(t<Mt.strings.length,"Invalid string index");let e=Wc._+4;for(let s=0;s<t;s++)e+=bt(Tc,this).getUint32(e)+4;const i=bt(Tc,this).getUint32(e),n=new Uint8Array(i);return n.set(new Uint8Array(bt(Sc,this),e+4,i)),bt(Mc,this).decode(n)}Mt=Lc,(0,Wt.A)(Lc,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),(0,Wt.A)(Lc,"numbers",["ascent","defaultWidth","descent"]),(0,Wt.A)(Lc,"strings",["fallbackName","loadedName","mimetype","name"]);var Ic={_:Math.ceil(2*Mt.bools.length/8)},Nc={_:vt(Mt,Mt,Ic)._+8*Mt.numbers.length},Oc={_:vt(Mt,Mt,Nc)._+1+8},Bc={_:vt(Mt,Mt,Oc)._+1+48},Wc={_:vt(Mt,Mt,Bc)._+1+6};class zc{static get workerPort(){return vt(zc,this,jc)._}static set workerPort(t){if(!("undefined"!==typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");jc._=vt(zc,this,t)}static get workerSrc(){return vt(zc,this,Hc)._}static set workerSrc(t){if("string"!==typeof t)throw new Error("Invalid `workerSrc` type.");Hc._=vt(zc,this,t)}}var jc={_:null},Hc={_:""},Uc=new WeakMap,Vc=new WeakMap;class Gc{constructor(t){let{parsedData:e,rawData:i}=t;mt(this,Uc,void 0),mt(this,Vc,void 0),yt(Uc,this,e),yt(Vc,this,i)}getRaw(){return bt(Vc,this)}get(t){var e;return null!==(e=bt(Uc,this).get(t))&&void 0!==e?e:null}[Symbol.iterator](){return bt(Uc,this).entries()}}const qc=Symbol("INTERNAL");var Xc=new WeakMap,Yc=new WeakMap,Kc=new WeakMap,Qc=new WeakMap;class Zc{constructor(t,e){let{name:i,intent:n,usage:s,rbGroups:r}=e;mt(this,Xc,!1),mt(this,Yc,!1),mt(this,Kc,!1),mt(this,Qc,!0),yt(Xc,this,!!(t&Gt)),yt(Yc,this,!!(t&qt)),this.name=i,this.intent=n,this.usage=s,this.rbGroups=r}get visible(){if(bt(Kc,this))return bt(Qc,this);if(!bt(Qc,this))return!1;const{print:t,view:e}=this.usage;return bt(Xc,this)?"OFF"!==(null===e||void 0===e?void 0:e.viewState):!bt(Yc,this)||"OFF"!==(null===t||void 0===t?void 0:t.printState)}_setVisible(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t!==qc&&Ce("Internal method `_setVisible` called."),yt(Kc,this,i),yt(Qc,this,e)}}var Jc=new WeakMap,$c=new WeakMap,th=new WeakMap,eh=new WeakMap,ih=new WeakSet;class nh{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gt;if(ft(this,ih),mt(this,Jc,null),mt(this,$c,new Map),mt(this,th,null),mt(this,eh,null),this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,yt(eh,this,t.order);for(const i of t.groups)bt($c,this).set(i.id,new Zc(e,i));if("OFF"===t.baseState)for(const t of bt($c,this).values())t._setVisible(qc,!1);for(const e of t.on)bt($c,this).get(e)._setVisible(qc,!0);for(const e of t.off)bt($c,this).get(e)._setVisible(qc,!1);yt(th,this,this.getHash())}}isVisible(t){if(0===bt($c,this).size)return!0;if(!t)return _e("Optional content group not defined."),!0;if("OCG"===t.type)return bt($c,this).has(t.id)?bt($c,this).get(t.id).visible:(ke("Optional content group not found: ".concat(t.id)),!0);if("OCMD"===t.type){if(t.expression)return vt(ih,this,sh).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!bt($c,this).has(e))return ke("Optional content group not found: ".concat(e)),!0;if(bt($c,this).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!bt($c,this).has(e))return ke("Optional content group not found: ".concat(e)),!0;if(!bt($c,this).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!bt($c,this).has(e))return ke("Optional content group not found: ".concat(e)),!0;if(!bt($c,this).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!bt($c,this).has(e))return ke("Optional content group not found: ".concat(e)),!0;if(bt($c,this).get(e).visible)return!1}return!0}return ke("Unknown optional content policy ".concat(t.policy,".")),!0}return ke("Unknown group type ".concat(t.type,".")),!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=bt($c,this).get(t);if(n){if(i&&e&&n.rbGroups.length)for(const e of n.rbGroups)for(const i of e){var s;if(i!==t)null===(s=bt($c,this).get(i))||void 0===s||s._setVisible(qc,!1,!0)}n._setVisible(qc,!!e,!0),yt(Jc,this,null)}else ke("Optional content group not found: ".concat(t))}setOCGState(t){let e,{state:i,preserveRB:n}=t;for(const s of i){switch(s){case"ON":case"OFF":case"Toggle":e=s;continue}const t=bt($c,this).get(s);if(t)switch(e){case"ON":this.setVisibility(s,!0,n);break;case"OFF":this.setVisibility(s,!1,n);break;case"Toggle":this.setVisibility(s,!t.visible,n)}}yt(Jc,this,null)}get hasInitialVisibility(){return null===bt(th,this)||this.getHash()===bt(th,this)}getOrder(){return bt($c,this).size?bt(eh,this)?bt(eh,this).slice():[...bt($c,this).keys()]:null}getGroup(t){return bt($c,this).get(t)||null}getHash(){if(null!==bt(Jc,this))return bt(Jc,this);const t=new Ea;for(const[e,i]of bt($c,this))t.update("".concat(e,":").concat(i.visible));return yt(Jc,this,t.hexdigest())}[Symbol.iterator](){return bt($c,this).entries()}}function sh(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;n<e;n++){const e=t[n];let s;if(Array.isArray(e))s=vt(ih,this,sh).call(this,e);else{if(!bt($c,this).has(e))return ke("Optional content group not found: ".concat(e)),!0;s=bt($c,this).get(e).visible}switch(i){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return"And"===i}class rh{constructor(t,e){let{disableRange:i=!1,disableStream:n=!1}=e;Se(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:r,progressiveDone:a,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,(null===r||void 0===r?void 0:r.length)>0){const t=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!n,this._isRangeSupported=!i,this._contentLength=s,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(t){let{begin:e,chunk:i}=t;const n=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{Se(this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(n),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}_onProgress(t){var e,i,n,s;void 0===t.total?null===(e=this._rangeReaders[0])||void 0===e||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded}):null===(n=this._fullRequestReader)||void 0===n||null===(s=n.onProgress)||void 0===s||s.call(n,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;null===(t=this._fullRequestReader)||void 0===t||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){Se(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new ah(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new oh(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class ah{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t,this._done=i||!1,this._filename=ri(n)?n:null,this._queuedChunks=e||[],this._loaded=0;for(const s of this._queuedChunks)this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else 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 e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class oh{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 e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function lh(t,e){const i=new Headers;if(!t||!e||"object"!==typeof e)return i;for(const n in e){const t=e[n];void 0!==t&&i.append(n,t)}return i}function ch(t){var e,i;return null!==(e=null===(i=URL.parse(t))||void 0===i?void 0:i.origin)&&void 0!==e?e:null}function hh(t){let{responseHeaders:e,isHttp:i,rangeChunkSize:n,disableRange:s}=t;const r={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e.get("Content-Length"),10);if(!Number.isInteger(a))return r;if(r.suggestedLength=a,a<=2*n)return r;if(s||!i)return r;if("bytes"!==e.get("Accept-Ranges"))return r;return"identity"!==(e.get("Content-Encoding")||"identity")||(r.allowRangeRequests=!0),r}function dh(t){const e=t.get("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 n=0;n<e.length&&n in e;++n){let[t,i]=e[n];i=a(i),t&&(i=unescape(i),0===n&&(i=o(i))),r.push(i)}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=We(i);i=n.decode(s),e=!1}catch(n){}}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(r){}return s(e,n)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(i){}if(ri(t))return t}return null}function uh(t,e){return new Ie("Unexpected server response (".concat(t,') while retrieving PDF "').concat(e,'".'),t,404===t||0===t&&e.startsWith("file:"))}function ph(t){return 200===t||206===t}function gh(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function fh(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(ke("getArrayBuffer - unexpected data format: ".concat(t)),new Uint8Array(t).buffer)}class mh{constructor(t){(0,Wt.A)(this,"_responseOrigin",null),this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=lh(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return Se(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new vh(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new wh(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class vh{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;const i=new Headers(t.headers),n=e.url;fetch(n,gh(i,this._withCredentials,this._abortController)).then(e=>{if(t._responseOrigin=ch(e.url),!ph(e.status))throw uh(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const i=e.headers,{allowRangeRequests:s,suggestedLength:r}=hh({responseHeaders:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=r||this._contentLength,this._filename=dh(i),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Oe("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)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:fh(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class wh{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;const s=new Headers(t.headers);s.append("Range","bytes=".concat(e,"-").concat(i-1));const r=n.url;fetch(r,gh(s,this._withCredentials,this._abortController)).then(e=>{const i=ch(e.url);if(i!==t._responseOrigin)throw new Error('Expected range response-origin "'.concat(i,'" to match "').concat(t._responseOrigin,'".'));if(!ph(e.status))throw uh(e.status,r);this._readCapability.resolve(),this._reader=e.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)||void 0===t||t.call(this,{loaded:this._loaded}),{value:fh(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class bh{constructor(t){let{url:e,httpHeaders:i,withCredentials:n}=t;(0,Wt.A)(this,"_responseOrigin",null),this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=lh(this.isHttp,i),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}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[s,r]of this.headers)e.setRequestHeader(s,r);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1)),n.expectedStatus=206):n.expectedStatus=200,e.responseType="arraybuffer",Se(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>{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)||void 0===i||i.call(n,e))}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const n=i.xhr;if(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==n.readyState)return;if(!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void i.onError(n.status);const s=n.status||200;if(!(200===s&&206===i.expectedStatus)&&s!==i.expectedStatus)return void i.onError(n.status);const r=function(t){const e=t.response;return"string"!==typeof e?e:We(e).buffer}(n);if(206===s){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);e?i.onDone({begin:parseInt(e[1],10),chunk:r}):(ke('Missing or invalid "Content-Range" header.'),i.onError(0))}else r?i.onDone({begin:0,chunk:r}):i.onError(n.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 yh{constructor(t){this._source=t,this._manager=new bh(t),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 Se(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new Ah(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new Eh(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class Ah{constructor(t,e){this._manager=t,this._url=e.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=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);this._manager._responseOrigin=ch(e.responseURL);const i=e.getAllResponseHeaders(),n=new Headers(i?i.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(t=>{const[e,...i]=t.split(": ");return[e,i.join(": ")]}):[]),{allowRangeRequests:s,suggestedLength:r}=hh({responseHeaders:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=r||this._contentLength,this._filename=dh(n),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);if(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=uh(t,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;null===(e=this.onProgress)||void 0===e||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._headersCapability.promise}async read(){if(await this._headersCapability.promise,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._headersCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Eh{constructor(t,e,i){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,end:i,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var t;const e=ch(null===(t=this._manager.getRequestXhr(this._requestId))||void 0===t?void 0:t.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error('Expected range response-origin "'.concat(e,'" to match "').concat(this._manager._responseOrigin,'".')),this._onError(0))}_close(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){var e;null!==(e=this._storedError)&&void 0!==e||(this._storedError=uh(t,this._url));for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||(null===(e=this.onProgress)||void 0===e||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 e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const xh=/^[a-z][a-z0-9\-+.]+:/i;class _h{constructor(t){this.source=t,this.url=function(t){if(xh.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}(t.url),Se("file:"===this.url.protocol,"PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return Se(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new kh(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Ch(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class kh{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();const i=process.getBuiltinModule("fs");i.promises.lstat(this._url).then(t=>{this._contentLength=t.size,this._setReadableStream(i.createReadStream(this._url)),this._headersCapability.resolve()},t=>{"ENOENT"===t.code&&(t=uh(0,this._url.href)),this._storedError=t,this._headersCapability.reject(t)})}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();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return{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 Oe("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Ch{constructor(t,e,i){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const n=t.source;this._isStreamingSupported=!n.disableStream;const s=process.getBuiltinModule("fs");this._setReadableStream(s.createReadStream(this._url,{start:e,end:i-1}))}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();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return{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)}}const Sh=Symbol("INITIAL_DATA");var Mh=new WeakMap,Th=new WeakSet;class Ph{constructor(){ft(this,Th),mt(this,Mh,Object.create(null))}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=vt(Th,this,Lh).call(this,t);return i.promise.then(()=>e(i.data)),null}const i=bt(Mh,this)[t];if(!i||i.data===Sh)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}has(t){const e=bt(Mh,this)[t];return!!e&&e.data!==Sh}delete(t){const e=bt(Mh,this)[t];return!(!e||e.data===Sh)&&(delete bt(Mh,this)[t],!0)}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=vt(Th,this,Lh).call(this,t);i.data=e,i.resolve()}clear(){for(const e in bt(Mh,this)){var t;const{data:i}=bt(Mh,this)[e];null===i||void 0===i||null===(t=i.bitmap)||void 0===t||t.close()}yt(Mh,this,Object.create(null))}*[Symbol.iterator](){for(const t in bt(Mh,this)){const{data:e}=bt(Mh,this)[t];e!==Sh&&(yield[t,e])}}}function Lh(t){var e;return(e=bt(Mh,this))[t]||(e[t]=(0,pt.A)((0,pt.A)({},Promise.withResolvers()),{},{data:Sh}))}var Rh=new WeakMap,Dh=new WeakMap,Fh=new WeakMap,Ih=new WeakMap,Nh=new WeakMap,Oh=new WeakMap,Bh=new WeakMap,Wh=new WeakMap,zh=new WeakMap,jh=new WeakMap,Hh=new WeakMap,Uh=new WeakMap,Vh=new WeakMap,Gh=new WeakMap,qh=new WeakMap,Xh=new WeakMap,Yh=new WeakMap,Kh=new WeakMap,Qh=new WeakSet;class Zh{constructor(t){var e;let{textContentSource:i,container:n,viewport:s}=t;if(ft(this,Qh),mt(this,Rh,Promise.withResolvers()),mt(this,Dh,null),mt(this,Fh,!1),mt(this,Ih,!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled)),mt(this,Nh,null),mt(this,Oh,null),mt(this,Bh,0),mt(this,Wh,0),mt(this,zh,null),mt(this,jh,null),mt(this,Hh,0),mt(this,Uh,0),mt(this,Vh,Object.create(null)),mt(this,Gh,[]),mt(this,qh,null),mt(this,Xh,[]),mt(this,Yh,new WeakMap),mt(this,Kh,null),i instanceof ReadableStream)yt(qh,this,i);else{if("object"!==typeof i)throw new Error('No "textContentSource" parameter specified.');yt(qh,this,new ReadableStream({start(t){t.enqueue(i),t.close()}}))}yt(Dh,this,yt(jh,this,n)),yt(Uh,this,s.scale*mi.pixelRatio),yt(Hh,this,s.rotation),yt(Oh,this,{div:null,properties:null,ctx:null});const{pageWidth:r,pageHeight:a,pageX:o,pageY:l}=s.rawDims;yt(Kh,this,[1,0,0,-1,-o,l+a]),yt(Wh,this,r),yt(Bh,this,a),nd.call(Zh),fi(n,s),bt(Rh,this).promise.finally(()=>{cd._.delete(this),yt(Oh,this,null),yt(Vh,this,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=ze.platform;return Pe(this,"fontFamilyMap",new Map([["sans-serif","".concat(t&&e?"Calibri, ":"","sans-serif")],["monospace","".concat(t&&e?"Lucida Console, ":"","monospace")]]))}render(){const t=()=>{bt(zh,this).read().then(e=>{var i;let{value:n,done:s}=e;s?bt(Rh,this).resolve():(null!==(i=bt(Nh,this))&&void 0!==i||yt(Nh,this,n.lang),Object.assign(bt(Vh,this),n.styles),vt(Qh,this,Jh).call(this,n.items),t())},bt(Rh,this).reject)};return yt(zh,this,bt(qh,this).getReader()),cd._.add(this),t(),bt(Rh,this).promise}update(t){let{viewport:e,onBefore:i=null}=t;const n=e.scale*mi.pixelRatio,s=e.rotation;if(s!==bt(Hh,this)&&(null===i||void 0===i||i(),yt(Hh,this,s),fi(bt(jh,this),{rotation:s})),n!==bt(Uh,this)){null===i||void 0===i||i(),yt(Uh,this,n);const t={div:null,properties:null,ctx:ed.call(Zh,bt(Nh,this))};for(const e of bt(Xh,this))t.properties=bt(Yh,this).get(e),t.div=e,vt(Qh,this,td).call(this,t)}}cancel(){var t;const e=new Oe("TextLayer task cancelled.");null===(t=bt(zh,this))||void 0===t||t.cancel(e).catch(()=>{}),yt(zh,this,null),bt(Rh,this).reject(e)}get textDivs(){return bt(Xh,this)}get textContentItemsStr(){return bt(Gh,this)}static cleanup(){if(!(vt(Zh,this,cd)._.size>0)){vt(Zh,this,rd)._.clear();for(const{canvas:t}of vt(Zh,this,ad)._.values())t.remove();vt(Zh,this,ad)._.clear()}}}function Jh(t){var e,i;if(bt(Fh,this))return;null!==(i=(e=bt(Oh,this)).ctx)&&void 0!==i||(e.ctx=ed.call(Tt,bt(Nh,this)));const n=bt(Xh,this),s=bt(Gh,this);for(const r of t){if(n.length>1e5)return ke("Ignoring additional textDivs for performance reasons."),void yt(Fh,this,!0);if(void 0!==r.str)s.push(r.str),vt(Qh,this,$h).call(this,r);else if("beginMarkedContentProps"===r.type||"beginMarkedContent"===r.type){const t=bt(Dh,this);yt(Dh,this,document.createElement("span")),bt(Dh,this).classList.add("markedContent"),r.id&&bt(Dh,this).setAttribute("id","".concat(r.id)),t.append(bt(Dh,this))}else"endMarkedContent"===r.type&&yt(Dh,this,bt(Dh,this).parentNode)}}function $h(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};bt(Xh,this).push(e);const n=He.transform(bt(Kh,this),t.transform);let s=Math.atan2(n[1],n[0]);const r=bt(Vh,this)[t.fontName];r.vertical&&(s+=Math.PI/2);let a=bt(Ih,this)&&r.fontSubstitution||r.fontFamily;a=Tt.fontFamilyMap.get(a)||a;const o=Math.hypot(n[2],n[3]),l=o*sd.call(Tt,a,r,bt(Nh,this));let c,h;0===s?(c=n[4],h=n[5]-l):(c=n[4]+l*Math.sin(s),h=n[5]-l*Math.cos(s));const d="calc(var(--total-scale-factor) *",u=e.style;bt(Dh,this)===bt(jh,this)?(u.left="".concat((100*c/bt(Wh,this)).toFixed(2),"%"),u.top="".concat((100*h/bt(Bh,this)).toFixed(2),"%")):(u.left="".concat(d).concat(c.toFixed(2),"px)"),u.top="".concat(d).concat(h.toFixed(2),"px)")),u.fontSize="".concat(d).concat((ld._*o).toFixed(2),"px)"),u.fontFamily=a,i.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,bt(Ih,this)&&(e.dataset.fontName=r.fontSubstitutionLoadedName||t.fontName),0!==s&&(i.angle=s*(180/Math.PI));let p=!1;if(t.str.length>1)p=!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&&(p=!0)}if(p&&(i.canvasWidth=r.vertical?t.height:t.width),bt(Yh,this).set(e,i),bt(Oh,this).div=e,bt(Oh,this).properties=i,vt(Qh,this,td).call(this,bt(Oh,this)),i.hasText&&bt(Dh,this).append(e),i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),bt(Dh,this).append(t)}}function td(t){const{div:e,properties:i,ctx:n}=t,{style:s}=e;let r="";if(ld._>1&&(r="scale(".concat(1/ld._,")")),0!==i.canvasWidth&&i.hasText){const{fontFamily:t}=s,{canvasWidth:a,fontSize:o}=i;id.call(Tt,n,o*bt(Uh,this),t);const{width:l}=n.measureText(e.textContent);l>0&&(r="scaleX(".concat(a*bt(Uh,this)/l,") ").concat(r))}0!==i.angle&&(r="rotate(".concat(i.angle,"deg) ").concat(r)),r.length>0&&(s.transform=r)}function ed(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=vt(Tt,this,ad)._.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}),vt(Tt,this,ad)._.set(t,e),vt(Tt,this,od)._.set(e,{size:0,family:""})}return e}function id(t,e,i){const n=vt(Tt,this,od)._.get(t);e===n.size&&i===n.family||(t.font="".concat(e,"px ").concat(i),n.size=e,n.family=i)}function nd(){if(null!==vt(Tt,this,ld)._)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),ld._=vt(Tt,this,t.getBoundingClientRect().height),t.remove()}function sd(t,e,i){const n=vt(Tt,this,rd)._.get(t);if(n)return n;const s=vt(Tt,this,ed).call(this,i);s.canvas.width=s.canvas.height=30,vt(Tt,this,id).call(this,s,30,t);const r=s.measureText(""),a=r.fontBoundingBoxAscent,o=Math.abs(r.fontBoundingBoxDescent);s.canvas.width=s.canvas.height=0;let l=.8;return a?l=a/(a+o):(ze.platform.isFirefox&&ke("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?l=e.ascent:e.descent&&(l=1+e.descent)),vt(Tt,this,rd)._.set(t,l),l}Tt=Zh;var rd={_:new Map},ad={_:new Map},od={_:new WeakMap},ld={_:null},cd={_:new Set};function hd(){var t,e;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"string"===typeof i||i instanceof URL?i={url:i}:(i instanceof ArrayBuffer||ArrayBuffer.isView(i))&&(i={data:i});const n=new dd,{docId:s}=n,r=i.url?function(t){if(t instanceof URL)return t.href;if("string"===typeof t){if(jt)return t;const e=URL.parse(t,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(i.url):null,a=i.data?function(t){if(jt&&"undefined"!==typeof Buffer&&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 We(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"===typeof t&&!isNaN(null===t||void 0===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.")}(i.data):null,o=i.httpHeaders||null,l=!0===i.withCredentials,c=null!==(t=i.password)&&void 0!==t?t:null,h=i.range instanceof wd?i.range:null,d=Number.isInteger(i.rangeChunkSize)&&i.rangeChunkSize>0?i.rangeChunkSize:65536;let u=i.worker instanceof Td?i.worker:null;const p=i.verbosity,g="string"!==typeof i.docBaseUrl||si(i.docBaseUrl)?null:i.docBaseUrl,f=Oa(i.cMapUrl),m=!1!==i.cMapPacked,v=i.CMapReaderFactory||(jt?Uo:po),w=Oa(i.iccUrl),b=Oa(i.standardFontDataUrl),y=i.StandardFontDataFactory||(jt?Vo:Oo),A=Oa(i.wasmUrl),E=i.WasmFactory||(jt?Go:Wo),x=!0!==i.stopAtErrors,_=Number.isInteger(i.maxImageSize)&&i.maxImageSize>-1?i.maxImageSize:-1,k=!1!==i.isEvalSupported,C="boolean"===typeof i.isOffscreenCanvasSupported?i.isOffscreenCanvasSupported:!jt,S="boolean"===typeof i.isImageDecoderSupported?i.isImageDecoderSupported:!jt&&(ze.platform.isFirefox||!globalThis.chrome),M=Number.isInteger(i.canvasMaxAreaInBytes)?i.canvasMaxAreaInBytes:-1,T="boolean"===typeof i.disableFontFace?i.disableFontFace:jt,P=!0===i.fontExtraProperties,L=!0===i.enableXfa,R=i.ownerDocument||globalThis.document,D=!0===i.disableRange,F=!0===i.disableStream,I=!0===i.disableAutoFetch,N=!0===i.pdfBug,O=i.CanvasFactory||(jt?Ho:ho),B=i.FilterFactory||(jt?jo:xo),W=!0===i.enableHWA,z=!1!==i.useWasm,j=h?h.length:null!==(e=i.length)&&void 0!==e?e:NaN,H="boolean"===typeof i.useSystemFonts?i.useSystemFonts:!jt&&!T,U="boolean"===typeof i.useWorkerFetch?i.useWorkerFetch:!!(v===po&&y===Oo&&E===Wo&&f&&b&&A&&oi(f,document.baseURI)&&oi(b,document.baseURI)&&oi(A,document.baseURI));Ee(p);const V={canvasFactory:new O({ownerDocument:R,enableHWA:W}),filterFactory:new B({docId:s,ownerDocument:R}),cMapReaderFactory:U?null:new v({baseUrl:f,isCompressed:m}),standardFontDataFactory:U?null:new y({baseUrl:b}),wasmFactory:U?null:new E({baseUrl:A})};u||(u=Td.create({verbosity:p,port:zc.workerPort}),n._worker=u);const G={docId:s,apiVersion:"5.4.296",data:a,password:c,disableAutoFetch:I,rangeChunkSize:d,length:j,docBaseUrl:g,enableXfa:L,evaluatorOptions:{maxImageSize:_,disableFontFace:T,ignoreErrors:x,isEvalSupported:k,isOffscreenCanvasSupported:C,isImageDecoderSupported:S,canvasMaxAreaInBytes:M,fontExtraProperties:P,useSystemFonts:H,useWasm:z,useWorkerFetch:U,cMapUrl:f,iccUrl:w,standardFontDataUrl:b,wasmUrl:A}},q={ownerDocument:R,pdfBug:N,styleElement:null,loadingParams:{disableAutoFetch:I,enableXfa:L}};return u.promise.then(function(){if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const t=u.messageHandler.sendWithPromise("GetDocRequest",G,a?[a.buffer]:null);let e;if(h)e=new rh(h,{disableRange:D,disableStream:F});else if(!a){if(!r)throw new Error("getDocument - no `url` parameter provided.");const t=oi(r)?mh:jt?_h:yh;e=new t({url:r,length:j,httpHeaders:o,withCredentials:l,rangeChunkSize:d,disableRange:D,disableStream:F})}return t.then(t=>{if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const i=new no(s,t,u.port),r=new Vd(i,n,e,q,V,W);n._transport=r,i.send("Ready",null)})}).catch(n._capability.reject),n}class dd{constructor(){(0,Wt.A)(this,"_capability",Promise.withResolvers()),(0,Wt.A)(this,"_transport",null),(0,Wt.A)(this,"_worker",null),(0,Wt.A)(this,"docId","d".concat((ud._=(Pt=ud._,Lt=Pt++,Pt),Lt))),(0,Wt.A)(this,"destroyed",!1),(0,Wt.A)(this,"onPassword",null),(0,Wt.A)(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var t;this.destroyed=!0;try{var e,i;null!==(e=this._worker)&&void 0!==e&&e.port&&(this._worker._pendingDestroy=!0),await(null===(i=this._transport)||void 0===i?void 0:i.destroy())}catch(s){var n;throw null!==(n=this._worker)&&void 0!==n&&n.port&&delete this._worker._pendingDestroy,s}this._transport=null,null===(t=this._worker)||void 0===t||t.destroy(),this._worker=null}async getData(){return this._transport.getData()}}var ud={_:0},pd=new WeakMap,gd=new WeakMap,fd=new WeakMap,md=new WeakMap,vd=new WeakMap;class wd{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;mt(this,pd,Promise.withResolvers()),mt(this,gd,[]),mt(this,fd,[]),mt(this,md,[]),mt(this,vd,[]),this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n}addRangeListener(t){bt(vd,this).push(t)}addProgressListener(t){bt(md,this).push(t)}addProgressiveReadListener(t){bt(fd,this).push(t)}addProgressiveDoneListener(t){bt(gd,this).push(t)}onDataRange(t,e){for(const i of bt(vd,this))i(t,e)}onDataProgress(t,e){bt(pd,this).promise.then(()=>{for(const i of bt(md,this))i(t,e)})}onDataProgressiveRead(t){bt(pd,this).promise.then(()=>{for(const e of bt(fd,this))e(t)})}onDataProgressiveDone(){bt(pd,this).promise.then(()=>{for(const t of bt(gd,this))t()})}transportReady(){bt(pd,this).resolve()}requestDataRange(t,e){Ce("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class bd{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Pe(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()}getAnnotationsByType(t,e){return this._transport.getAnnotationsByType(t,e)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];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 yd=new WeakMap,Ad=new WeakSet;class Ed{constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];ft(this,Ad),mt(this,yd,!1),this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new ai:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new Ph,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}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(){let{scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new ii({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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 Pe(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null}render(t){var e,i,n;let{canvasContext:s,canvas:r=s.canvas,viewport:a,intent:o="display",annotationMode:l=Jt.ENABLE,transform:c=null,background:h=null,optionalContentConfigPromise:d=null,annotationCanvasMap:u=null,pageColors:p=null,printAnnotationStorage:g=null,isEditing:f=!1,recordOperations:m=!1,operationsFilter:v=null}=t;null===(e=this._stats)||void 0===e||e.time("Overall");const w=this._transport.getRenderingIntent(o,l,g,f),{renderingIntent:b,cacheKey:y}=w;yt(yd,this,!1),d||(d=this._transport.getOptionalContentConfig(b));let A=this._intentStates.get(y);A||(A=Object.create(null),this._intentStates.set(y,A)),A.streamReaderCancelTimeout&&(clearTimeout(A.streamReaderCancelTimeout),A.streamReaderCancelTimeout=null);const E=!!(b&qt);var x;A.displayReadyCapability||(A.displayReadyCapability=Promise.withResolvers(),A.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(x=this._stats)||void 0===x||x.time("Page Request"),this._pumpOperatorList(w));const _=Boolean(this._pdfBug&&(null===(i=globalThis.StepperManager)||void 0===i?void 0:i.enabled)),k=!this.recordedBBoxes&&(m||_),C=t=>{if(A.renderTasks.delete(S),k){var e;const t=null===(e=S.gfx)||void 0===e?void 0:e.dependencyTracker.take();t&&(S.stepper&&S.stepper.setOperatorBBoxes(t,S.gfx.dependencyTracker.takeDebugMetadata()),m&&(this.recordedBBoxes=t))}var i;(E&&yt(yd,this,!0),vt(Ad,this,xd).call(this),t?(S.capability.reject(t),this._abortOperatorList({intentState:A,reason:t instanceof Error?t:new Error(t)})):S.capability.resolve(),this._stats)&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),null!==(i=globalThis.Stats)&&void 0!==i&&i.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},S=new Kd({callback:C,params:{canvas:r,canvasContext:s,dependencyTracker:k?new bl(r,A.operatorList.length,_):null,viewport:a,transform:c,background:h},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:u,operatorList:A.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!E,pdfBug:this._pdfBug,pageColors:p,enableHWA:this._transport.enableHWA,operationsFilter:v});((n=A).renderTasks||(n.renderTasks=new Set)).add(S);const M=S.task;return Promise.all([A.displayReadyCapability.promise,d]).then(t=>{var e;let[i,n]=t;if(this.destroyed)C();else{if(null===(e=this._stats)||void 0===e||e.time("Rendering"),!(n.renderingIntent&b))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");S.initializeGraphics({transparency:i,optionalContentConfig:n}),S.operatorListChanged()}}).catch(C),M}getOperatorList(){let{intent:t="display",annotationMode:e=Jt.ENABLE,printAnnotationStorage:i=null,isEditing:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=this._transport.getRenderingIntent(t,e,i,n,!0);let r,a=this._intentStates.get(s.cacheKey);var o,l;(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(),((o=a).renderTasks||(o.renderTasks=new Set)).add(r),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(l=this._stats)||void 0===l||l.time("Page Request"),this._pumpOperatorList(s));return a.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1,disableNormalization:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(t=>Ze.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(i){var n;let{value:r,done:a}=i;a?t(s):(null!==(n=s.lang)&&void 0!==n||(s.lang=r.lang),Object.assign(s.styles,r.styles),s.items.push(...r.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(),yt(yd,this,!1),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];yt(yd,this,!0);const e=vt(Ad,this,xd).call(this);return t&&e&&this._stats&&(this._stats=new ai),e}_startRenderPage(t,e){var i,n;const s=this._intentStates.get(e);s&&(null===(i=this._stats)||void 0===i||i.timeEnd("Page Request"),null===(n=s.displayReadyCapability)||void 0===n||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 i of e.renderTasks)i.operatorListChanged();t.lastChunk&&vt(Ad,this,xd).call(this)}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:i,annotationStorageSerializable:n,modifiedIds:s}=t;const{map:r,transfer:a}=n,o=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:r,modifiedIds:s},a).getReader(),l=this._intentStates.get(i);l.streamReader=o;const c=()=>{o.read().then(t=>{let{value:e,done:i}=t;i?l.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,l),c())},t=>{if(l.streamReader=null,!this._transport.destroyed){if(l.operatorList){l.operatorList.lastChunk=!0;for(const t of l.renderTasks)t.operatorListChanged();vt(Ad,this,xd).call(this)}if(l.displayReadyCapability)l.displayReadyCapability.reject(t);else{if(!l.opListReadCapability)throw t;l.opListReadCapability.reject(t)}}})};c()}_abortOperatorList(t){let{intentState:e,reason:i,force:n=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(i instanceof ni){let t=100;return i.extraDelay>0&&i.extraDelay<1e3&&(t+=i.extraDelay),void(e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:i,force:!0})},t))}}if(e.streamReader.cancel(new Oe(i.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[t,i]of this._intentStates)if(i===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}function xd(){if(!bt(yd,this)||this.destroyed)return!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(),yt(yd,this,!1),!0}var _d=new WeakMap,kd=new WeakMap,Cd=new WeakMap,Sd=new WeakMap,Md=new WeakSet;class Td{constructor(){let{name:t=null,port:e=null,verbosity:i=xe()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(ft(this,Md),mt(this,_d,Promise.withResolvers()),mt(this,kd,null),mt(this,Cd,null),mt(this,Sd,null),this.name=t,this.destroyed=!1,this.verbosity=i,e){if(Od._.has(e))throw new Error("Cannot use more than one PDFWorker per port.");Od._.set(e,this),vt(Md,this,Ld).call(this,e)}else vt(Md,this,Rd).call(this)}get promise(){return bt(_d,this).promise}get port(){return bt(Cd,this)}get messageHandler(){return bt(kd,this)}destroy(){var t,e;this.destroyed=!0,null===(t=bt(Sd,this))||void 0===t||t.terminate(),yt(Sd,this,null),Od._.delete(bt(Cd,this)),yt(Cd,this,null),null===(e=bt(kd,this))||void 0===e||e.destroy(),yt(kd,this,null)}static create(t){const e=vt(Td,this,Od)._.get(null===t||void 0===t?void 0:t.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new Td(t)}static get workerSrc(){if(zc.workerSrc)return zc.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Pe(this,"_setupFakeWorkerGlobal",(async()=>{if(wt(Td,this,Fd))return wt(Td,this,Fd);return(await i(59169)(this.workerSrc)).WorkerMessageHandler})())}}function Pd(){bt(_d,this).resolve(),bt(kd,this).send("configure",{verbosity:this.verbosity})}function Ld(t){yt(Cd,this,t),yt(kd,this,new no("main","worker",t)),bt(kd,this).on("ready",()=>{}),vt(Md,this,Pd).call(this)}function Rd(){if(Nd._||Fd(Rt))return void vt(Md,this,Dd).call(this);let{workerSrc:t}=Rt;try{Rt._isSameOrigin(window.location,t)||(t=Rt._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new no("main","worker",e),n=()=>{s.abort(),i.destroy(),e.terminate(),this.destroyed?bt(_d,this).reject(new Error("Worker was destroyed")):vt(Md,this,Dd).call(this)},s=new AbortController;e.addEventListener("error",()=>{bt(Sd,this)||n()},{signal:s.signal}),i.on("test",t=>{s.abort(),!this.destroyed&&t?(yt(kd,this,i),yt(Cd,this,e),yt(Sd,this,e),vt(Md,this,Pd).call(this)):n()}),i.on("ready",t=>{if(s.abort(),this.destroyed)n();else try{r()}catch(e){vt(Md,this,Dd).call(this)}});const r=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void r()}catch(e){_e("The worker has been disabled.")}vt(Md,this,Dd).call(this)}function Dd(){Nd._||(ke("Setting up fake worker."),Nd._=!0),Rt._setupFakeWorkerGlobal.then(t=>{var e,i;if(this.destroyed)return void bt(_d,this).reject(new Error("Worker was destroyed"));const n=new Ha;yt(Cd,this,n);const s="fake".concat((Id._=(e=Id._,i=e++,e),i)),r=new no(s+"_worker",s,n);t.setup(r,n),yt(kd,this,new no(s,s+"_worker",n)),vt(Md,this,Pd).call(this)}).catch(t=>{bt(_d,this).reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))})}function Fd(t){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch(i){return null}}Rt=Td;var Id={_:0},Nd={_:!1},Od={_:new WeakMap};jt&&(Nd._=vt(Rt,Rt,!0),zc.workerSrc||(zc.workerSrc="./pdf.worker.mjs")),Rt._isSameOrigin=(t,e)=>{const i=URL.parse(t);if(null===i||void 0===i||!i.origin||"null"===i.origin)return!1;const n=new URL(e,i);return i.origin===n.origin},Rt._createCDNWrapper=t=>{const e='await import("'.concat(t,'");');return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},Rt.fromPort=t=>{var e;if(e="`PDFWorker.fromPort` - please use `PDFWorker.create` instead.",console.log("Deprecated API usage: "+e),null===t||void 0===t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return Rt.create(t)};var Bd=new WeakMap,Wd=new WeakMap,zd=new WeakMap,jd=new WeakMap,Hd=new WeakMap,Ud=new WeakSet;class Vd{constructor(t,e,i,n,s,r){ft(this,Ud),mt(this,Bd,new Map),mt(this,Wd,new Map),mt(this,zd,new Map),mt(this,jd,new Map),mt(this,Hd,null),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new Ph,this.fontLoader=new Fa({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.wasmFactory=s.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=r,this.setupMessageHandler()}get annotationStorage(){return Pe(this,"annotationStorage",new Ta)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jt.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=Gt,a=xa;switch(t){case"any":r=Vt;break;case"display":break;case"print":r=qt;break;default:ke("getRenderingIntent - invalid intent: ".concat(t))}const o=r&qt&&i instanceof Ra?i:this.annotationStorage;switch(e){case Jt.DISABLE:r+=Kt;break;case Jt.ENABLE:break;case Jt.ENABLE_FORMS:r+=Xt;break;case Jt.ENABLE_STORAGE:r+=Yt,a=o.serializable;break;default:ke("getRenderingIntent - invalid annotationMode: ".concat(e))}n&&(r+=Qt),s&&(r+=Zt);const{ids:l,hash:c}=o.modifiedIds;return{renderingIntent:r,cacheKey:[r,a.hash,c].join("_"),annotationStorageSerializable:a,modifiedIds:l}}destroy(){var t;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null===(t=bt(Hd,this))||void 0===t||t.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const n of bt(Wd,this).values())e.push(n._destroy());bt(Wd,this).clear(),bt(zd,this).clear(),bt(jd,this).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return e.push(i),Promise.all(e).then(()=>{var t,e;this.commonObjs.clear(),this.fontLoader.clear(),bt(Bd,this).clear(),this.filterFactory.destroy(),Zh.cleanup(),null===(t=this._networkStream)||void 0===t||t.cancelAllRequests(new Oe("Worker was terminated.")),null===(e=this.messageHandler)||void 0===e||e.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)=>{Se(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(t){let{value:i,done:n}=t;n?e.close():(Se(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))}).catch(t=>{e.error(t)})},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("ReaderHeadersReady",async t=>{await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:n,contentLength:s}=this._fullReader;if(!i||!n){var r;if(this._lastProgress)null===(r=e.onProgress)||void 0===r||r.call(e,this._lastProgress);this._fullReader.onProgress=t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})}}return{isStreamingSupported:i,isRangeSupported:n,contentLength:s}}),t.on("GetRangeReader",(t,e)=>{Se(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);i?(e.onPull=()=>{i.read().then(function(t){let{value:i,done:n}=t;n?e.close():(Se(i instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))}).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",t=>{let{pdfInfo:i}=t;this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,e._capability.resolve(new bd(i,this))}),t.on("DocException",t=>{e._capability.reject(to(t))}),t.on("PasswordRequest",t=>{yt(Hd,this,Promise.withResolvers());try{if(!e.onPassword)throw to(t);const i=t=>{t instanceof Error?bt(Hd,this).reject(t):bt(Hd,this).resolve({password:t})};e.onPassword(i,t.code)}catch(i){bt(Hd,this).reject(i)}return bt(Hd,this).promise}),t.on("DataLoaded",t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{if(this.destroyed)return;bt(Wd,this).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",e=>{var i;let[n,s,r]=e;if(this.destroyed)return null;if(this.commonObjs.has(n))return null;switch(s){case"Font":if("error"in r){const t=r.error;ke("Error during font loading: ".concat(t)),this.commonObjs.resolve(n,t);break}const e=new Lc(r),a=this._params.pdfBug&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,o=new Na(e,a,r.extra,r.charProcOperatorList);this.fontLoader.bind(o).catch(()=>t.sendWithPromise("FontFallback",{id:n})).finally(()=>{!o.fontExtraProperties&&o.data&&o.clearData(),this.commonObjs.resolve(n,o)});break;case"CopyLocalImage":const{imageRef:l}=r;Se(l,"The imageRef must be defined.");for(const t of bt(Wd,this).values())for(const[,e]of t.objs)if((null===e||void 0===e?void 0:e.ref)===l)return e.dataLen?(this.commonObjs.resolve(n,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,r);break;default:throw new Error("Got unknown common object type ".concat(s))}return null}),t.on("obj",t=>{let[e,i,n,s]=t;if(this.destroyed)return;const r=bt(Wd,this).get(i);var a;if(!r.objs.has(e))if(0!==r._intentStates.size)switch(n){case"Image":case"Pattern":r.objs.resolve(e,s);break;default:throw new Error("Got unknown object type ".concat(n))}else null===s||void 0===s||null===(a=s.bitmap)||void 0===a||a.close()}),t.on("DocProgress",t=>{var i;this.destroyed||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})}),t.on("FetchBinaryData",async t=>{if(this.destroyed)throw new Error("Worker was destroyed.");const e=this[t.type];if(!e)throw new Error("".concat(t.type," not initialized, see the `useWorkerFetch` parameter."));return e.fetch(t)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t,e;this.annotationStorage.size<=0&&ke("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:i,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:i,filename:null!==(t=null===(e=this._fullReader)||void 0===e?void 0:e.filename)&&void 0!==t?t:null},n).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=bt(zd,this).get(e);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&bt(jd,this).set(i.refStr,t);const n=new Ed(e,i,this,this._params.pdfBug);return bt(Wd,this).set(e,n),n});return bt(zd,this).set(e,n),n}getPageIndex(t){return Ba(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 vt(Ud,this,Gd).call(this,"GetFieldObjects")}hasJSActions(){return vt(Ud,this,Gd).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)}getAnnotationsByType(t,e){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:e})}getDocJSActions(){return vt(Ud,this,Gd).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 vt(Ud,this,Gd).call(this,"GetOptionalContentConfig").then(e=>new nh(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=bt(Bd,this).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(t=>{var e,i,n,s;return{info:t[0],metadata:t[1]?new Gc(t[1]):null,contentDispositionFilename:null!==(e=null===(i=this._fullReader)||void 0===i?void 0:i.filename)&&void 0!==e?e:null,contentLength:null!==(n=null===(s=this._fullReader)||void 0===s?void 0:s.contentLength)&&void 0!==n?n:null}});return bt(Bd,this).set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of bt(Wd,this).values()){if(!t.cleanup())throw new Error("startCleanup: Page ".concat(t.pageNumber," is currently rendering."))}this.commonObjs.clear(),t||this.fontLoader.clear(),bt(Bd,this).clear(),this.filterFactory.destroy(!0),Zh.cleanup()}}cachedPageNumber(t){var e;if(!Ba(t))return null;const i=0===t.gen?"".concat(t.num,"R"):"".concat(t.num,"R").concat(t.gen);return null!==(e=bt(jd,this).get(i))&&void 0!==e?e:null}}function Gd(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=bt(Bd,this).get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return bt(Bd,this).set(t,n),n}var qd=new WeakMap;class Xd{constructor(t){mt(this,qd,null),(0,Wt.A)(this,"onContinue",null),(0,Wt.A)(this,"onError",null),yt(qd,this,t)}get promise(){return bt(qd,this).capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;bt(qd,this).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=bt(qd,this).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=bt(qd,this);return t.form||t.canvas&&(null===e||void 0===e?void 0:e.size)>0}}var Yd=new WeakMap;class Kd{constructor(t){let{callback:e,params:i,objs:n,commonObjs:s,annotationCanvasMap:r,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:u=null,enableHWA:p=!1,operationsFilter:g=null}=t;mt(this,Yd,null),this.callback=e,this.params=i,this.objs=n,this.commonObjs=s,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===h&&"undefined"!==typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Xd(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=i.canvas,this._canvasContext=i.canvas?null:i.canvasContext,this._enableHWA=p,this._dependencyTracker=i.dependencyTracker,this._operationsFilter=g}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(t){var e,i;let{transparency:n=!1,optionalContentConfig:s}=t;if(this.cancelled)return;if(this._canvas){if(Qd._.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.");Qd._.add(this._canvas)}this._pdfBug&&null!==(e=globalThis.StepperManager)&&void 0!==e&&e.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:r,transform:a,background:o,dependencyTracker:l}=this.params,c=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new dc(c,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:s},this.annotationCanvasMap,this.pageColors,l),this.gfx.beginDrawing({transform:a,viewport:r,transparency:n,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,null===(i=this.graphicsReadyCallback)||void 0===i||i.call(this)}cancel(){var t,e,i;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,null===(t=this.gfx)||void 0===t||t.endDrawing(),bt(Yd,this)&&(window.cancelAnimationFrame(bt(Yd,this)),yt(Yd,this,null)),Qd._.delete(this._canvas),n||(n=new ni("Rendering cancelled, page ".concat(this._pageIndex+1),s)),this.callback(n),null===(e=(i=this.task).onError)||void 0===e||e.call(i,n)}operatorListChanged(){var t,e;this.graphicsReady?(null===(t=this.gfx.dependencyTracker)||void 0===t||t.growOperationsCount(this.operatorList.fnArray.length),null===(e=this.stepper)||void 0===e||e.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?yt(Yd,this,window.requestAnimationFrame(()=>{yt(Yd,this,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._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),Qd._.delete(this._canvas),this.callback())))}}var Qd={_:new WeakSet};var Zd=new WeakMap,Jd=new WeakMap,$d=new WeakMap,tu=new WeakMap,eu=new WeakMap,iu=new WeakMap,nu=new WeakMap,su=new WeakMap,ru=new WeakMap,au=new WeakMap,ou=new WeakSet;class lu{static get _keyboardManager(){return Pe(this,"_keyboardManager",new dn([[["Escape","mac+Escape"],lu.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],lu.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],lu.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],lu.prototype._moveToPrevious],[["Home","mac+Home"],lu.prototype._moveToBeginning],[["End","mac+End"],lu.prototype._moveToEnd]]))}constructor(t){var e,i;let{editor:n=null,uiManager:s=null}=t;ft(this,ou),mt(this,Zd,null),mt(this,Jd,null),mt(this,$d,void 0),mt(this,tu,null),mt(this,eu,!1),mt(this,iu,!1),mt(this,nu,null),mt(this,su,void 0),mt(this,ru,null),mt(this,au,null),n?(yt(iu,this,!1),yt(nu,this,n)):yt(iu,this,!0),yt(au,this,(null===n||void 0===n?void 0:n._uiManager)||s),yt(su,this,bt(au,this)._eventBus),yt($d,this,(null===n||void 0===n||null===(e=n.color)||void 0===e?void 0:e.toUpperCase())||(null===(i=bt(au,this))||void 0===i?void 0:i.highlightColors.values().next().value)||"#FFFF98"),fu._||(fu._=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}renderButton(){const t=yt(Zd,this,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",bt(nu,this)&&(t.ariaControls="".concat(bt(nu,this).id,"_colorpicker_dropdown"));const e=bt(au,this)._signal;t.addEventListener("click",vt(ou,this,uu).bind(this),{signal:e}),t.addEventListener("keydown",vt(ou,this,du).bind(this),{signal:e});const i=yt(Jd,this,document.createElement("span"));return i.className="swatch",i.ariaHidden="true",i.style.backgroundColor=bt($d,this),t.append(i),t}renderMainDropdown(){const t=yt(tu,this,vt(ou,this,cu).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===bt(Zd,this))return void vt(ou,this,uu).call(this,t);const e=t.target.getAttribute("data-color");e&&vt(ou,this,hu).call(this,e,t)}_moveToNext(t){var e,i;wt(ou,this,gu)?t.target!==bt(Zd,this)?null===(e=t.target.nextSibling)||void 0===e||e.focus():null===(i=bt(tu,this).firstChild)||void 0===i||i.focus():vt(ou,this,uu).call(this,t)}_moveToPrevious(t){var e,i;t.target!==(null===(e=bt(tu,this))||void 0===e?void 0:e.firstChild)&&t.target!==bt(Zd,this)?(wt(ou,this,gu)||vt(ou,this,uu).call(this,t),null===(i=t.target.previousSibling)||void 0===i||i.focus()):wt(ou,this,gu)&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){var e;wt(ou,this,gu)?null===(e=bt(tu,this).firstChild)||void 0===e||e.focus():vt(ou,this,uu).call(this,t)}_moveToEnd(t){var e;wt(ou,this,gu)?null===(e=bt(tu,this).lastChild)||void 0===e||e.focus():vt(ou,this,uu).call(this,t)}hideDropdown(){var t,e;null===(t=bt(tu,this))||void 0===t||t.classList.add("hidden"),bt(Zd,this).ariaExpanded="false",null===(e=bt(ru,this))||void 0===e||e.abort(),yt(ru,this,null)}_hideDropdownFromKeyboard(){var t;bt(iu,this)||(wt(ou,this,gu)?(this.hideDropdown(),bt(Zd,this).focus({preventScroll:!0,focusVisible:bt(eu,this)})):null===(t=bt(nu,this))||void 0===t||t.unselect())}updateColor(t){if(bt(Jd,this)&&(bt(Jd,this).style.backgroundColor=t),!bt(tu,this))return;const e=bt(au,this).highlightColors.values();for(const i of bt(tu,this).children)i.ariaSelected=e.next().value===t.toUpperCase()}destroy(){var t,e;null===(t=bt(Zd,this))||void 0===t||t.remove(),yt(Zd,this,null),yt(Jd,this,null),null===(e=bt(tu,this))||void 0===e||e.remove(),yt(tu,this,null)}}function cu(){const t=document.createElement("div"),e=bt(au,this)._signal;t.addEventListener("contextmenu",li,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),bt(nu,this)&&(t.id="".concat(bt(nu,this).id,"_colorpicker_dropdown"));for(const[i,n]of bt(au,this).highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",n),s.title=i,s.setAttribute("data-l10n-id",fu._[i]);const r=document.createElement("span");s.append(r),r.className="swatch",r.style.backgroundColor=n,s.ariaSelected=n===bt($d,this),s.addEventListener("click",vt(ou,this,hu).bind(this,n),{signal:e}),t.append(s)}return t.addEventListener("keydown",vt(ou,this,du).bind(this),{signal:e}),t}function hu(t,e){e.stopPropagation(),bt(su,this).dispatch("switchannotationeditorparams",{source:this,type:ee.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)}function du(t){Dt._keyboardManager.exec(this,t)}function uu(t){if(wt(ou,this,gu))return void this.hideDropdown();if(yt(eu,this,0===t.detail),bt(ru,this)||(yt(ru,this,new AbortController),window.addEventListener("pointerdown",vt(ou,this,pu).bind(this),{signal:bt(au,this).combinedSignal(bt(ru,this))})),bt(Zd,this).ariaExpanded="true",bt(tu,this))return void bt(tu,this).classList.remove("hidden");const e=yt(tu,this,vt(ou,this,cu).call(this));bt(Zd,this).append(e)}function pu(t){var e;null!==(e=bt(tu,this))&&void 0!==e&&e.contains(t.target)||this.hideDropdown()}function gu(t){return bt(tu,t)&&!bt(tu,t).classList.contains("hidden")}Dt=lu;var fu={_:null},mu=new WeakMap,vu=new WeakMap,wu=new WeakMap;class bu{constructor(t){mt(this,mu,null),mt(this,vu,null),mt(this,wu,null),yt(vu,this,t),yt(wu,this,t._uiManager),yu._||(yu._=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(bt(mu,this))return bt(mu,this);const{editorType:t,colorType:e,colorValue:i}=bt(vu,this),n=yt(mu,this,document.createElement("input"));return n.type="color",n.value=i||"#000000",n.className="basicColorPicker",n.tabIndex=0,n.setAttribute("data-l10n-id",yu._[t]),n.addEventListener("input",()=>{bt(wu,this).updateParams(e,n.value)},{signal:bt(wu,this)._signal}),n}update(t){bt(mu,this)&&(bt(mu,this).value=t)}destroy(){var t;null===(t=bt(mu,this))||void 0===t||t.remove(),yt(mu,this,null)}hideDropdown(){}}var yu={_:null};function Au(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function Eu(t){return Math.max(0,Math.min(255,255*t))}class xu{static CMYK_G(t){let[e,i,n,s]=t;return["G",1-Math.min(1,.3*e+.59*n+.11*i+s)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_rgb(t){let[e]=t;return e=Eu(e),[e,e,e]}static G_HTML(t){let[e]=t;const i=Au(e);return"#".concat(i).concat(i).concat(i)}static RGB_G(t){let[e,i,n]=t;return["G",.3*e+.59*i+.11*n]}static RGB_rgb(t){return t.map(Eu)}static RGB_HTML(t){return"#".concat(t.map(Au).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){let[e,i,n,s]=t;return["RGB",1-Math.min(1,e+s),1-Math.min(1,n+s),1-Math.min(1,i+s)]}static CMYK_rgb(t){let[e,i,n,s]=t;return[Eu(1-Math.min(1,e+s)),Eu(1-Math.min(1,n+s)),Eu(1-Math.min(1,i+s))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,i,n]=t;const s=1-e,r=1-i,a=1-n;return["CMYK",s,r,a,Math.min(s,r,a)]}}class _u{create(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];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","".concat(t,"px")),n.setAttribute("height","".concat(e,"px"))),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox","0 0 ".concat(t," ").concat(e)),n}createElement(t){if("string"!==typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Ce("Abstract method `_createSVG` called.")}}class ku extends _u{_createSVG(t){return document.createElementNS($e,t)}}const Cu=new WeakSet,Su=60*(new Date).getTimezoneOffset()*1e3;class Mu{static create(t){switch(t.data.annotationType){case ce.LINK:return new Ou(t);case ce.TEXT:return new ju(t);case ce.WIDGET:switch(t.data.fieldType){case"Tx":return new Uu(t);case"Btn":return t.data.radioButton?new qu(t):t.data.checkBox?new Gu(t):new Xu(t);case"Ch":return new Yu(t);case"Sig":return new Vu(t)}return new Hu(t);case ce.POPUP:return new Qu(t);case ce.FREETEXT:return new Wp(t);case ce.LINE:return new jp(t);case ce.SQUARE:return new Up(t);case ce.CIRCLE:return new Gp(t);case ce.POLYLINE:return new Xp(t);case ce.CARET:return new Kp(t);case ce.INK:return new $p(t);case ce.POLYGON:return new Yp(t);case ce.HIGHLIGHT:return new eg(t);case ce.UNDERLINE:return new ig(t);case ce.SQUIGGLY:return new ng(t);case ce.STRIKEOUT:return new sg(t);case ce.STAMP:return new rg(t);case ce.FILEATTACHMENT:return new lg(t);default:return new Du(t)}}}var Tu=new WeakMap,Pu=new WeakMap,Lu=new WeakMap,Ru=new WeakSet;class Du{constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ft(this,Ru),mt(this,Tu,null),mt(this,Pu,!1),mt(this,Lu,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.enableComment=t.enableComment,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(t){let{contentsObj:e,richText:i}=t;return!!(null!==e&&void 0!==e&&e.str||null!==i&&void 0!==i&&i.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return Du._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){var t;const{data:e}=this,i=null===(t=this.annotationStorage)||void 0===t?void 0:t.getEditor(e.id);return i?i.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){var t;const e=null===(t=this.annotationStorage)||void 0===t?void 0:t.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;const{quadPoints:i,inkLists:n,rect:s}=this.data;let r=-1/0,a=-1/0;if((null===i||void 0===i?void 0:i.length)>=8){for(let t=0;t<i.length;t+=8)i[t+1]>a?(a=i[t+1],r=i[t+2]):i[t+1]===a&&(r=Math.max(r,i[t+2]));return[r,a]}if((null===n||void 0===n?void 0:n.length)>=1){for(const t of n)for(let e=0,i=t.length;e<i;e+=2)t[e+1]>a?(a=t[e+1],r=t[e]):t[e+1]===a&&(r=Math.max(r,t[e]));if(r!==1/0)return[r,a]}return s?[s[2],s[3]]:null}_normalizePoint(t){const{page:{view:e},viewport:{rawDims:{pageWidth:i,pageHeight:n,pageX:s,pageY:r}}}=this.parent;return t[1]=e[3]-t[1]+e[1],t[0]=100*(t[0]-s)/i,t[1]=100*(t[1]-r)/n,t}get commentText(){var t,e;const{data:i}=this;return(null===(t=this.annotationStorage.getRawValue("".concat($t).concat(i.id)))||void 0===t||null===(t=t.popup)||void 0===t?void 0:t.contents)||(null===(e=i.contentsObj)||void 0===e?void 0:e.str)||""}set commentText(t){const{data:e}=this,i={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(e.id,{popup:i})||this.annotationStorage.setValue("".concat($t).concat(e.id),{id:e.id,annotationType:e.annotationType,pageIndex:this.parent.page._pageIndex,popup:i,popupRef:e.popupRef,modificationDate:new Date}),t||this.removePopup()}removePopup(){var t,e;null===(t=(null===(e=bt(Lu,this))||void 0===e?void 0:e.popup)||this.popup)||void 0===t||t.remove(),yt(Lu,this,this.popup=null)}updateEdited(t){var e;if(!this.container)return;t.rect&&(bt(Tu,this)||yt(Tu,this,{rect:this.data.rect.slice(0)}));const{rect:i,popup:n}=t;i&&vt(Ru,this,Fu).call(this,i);let s=(null===(e=bt(Lu,this))||void 0===e?void 0:e.popup)||this.popup;!s&&null!==n&&void 0!==n&&n.text&&(this._createPopup(n),s=bt(Lu,this).popup),s&&(s.updateEdited(t),null!==n&&void 0!==n&&n.deleted&&(s.remove(),yt(Lu,this,null),this.popup=null))}resetEdited(){var t;bt(Tu,this)&&(vt(Ru,this,Fu).call(this,bt(Tu,this).rect),null===(t=bt(Lu,this))||void 0===t||t.popup.resetEdited(),yt(Tu,this,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 Hu||this instanceof Ou||(s.tabIndex=0);const{style:r}=s;if(r.zIndex=this.parent.zIndex,this.parent.zIndex+=2,e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof Qu){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,s),s}const{width:a,height:o}=this;if(!t&&e.borderStyle.width>0){r.borderWidth="".concat(e.borderStyle.width,"px");const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e="calc(".concat(t,"px * var(--total-scale-factor)) / calc(").concat(i,"px * var(--total-scale-factor))");r.borderRadius=e}else if(this instanceof qu){const t="calc(".concat(a,"px * var(--total-scale-factor)) / calc(").concat(o,"px * var(--total-scale-factor))");r.borderRadius=t}switch(e.borderStyle.style){case he:r.borderStyle="solid";break;case de:r.borderStyle="dashed";break;case ue:ke("Unimplemented border style: beveled");break;case pe:ke("Unimplemented border style: inset");break;case ge:r.borderBottomStyle="solid"}const n=e.borderColor||null;n?(yt(Pu,this,!0),r.borderColor=He.makeHexColor(0|n[0],0|n[1],0|n[2])):r.borderWidth=0}const l=He.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:h,pageX:d,pageY:u}=n.rawDims;r.left="".concat(100*(l[0]-d)/c,"%"),r.top="".concat(100*(l[1]-u)/h,"%");const{rotation:p}=e;return e.hasOwnCanvas||0===p?(r.width="".concat(100*a/c,"%"),r.height="".concat(100*o/h,"%")):this.setRotation(p,s),s}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims;let{width:s,height:r}=this;t%180!==0&&([s,r]=[r,s]),e.style.width="".concat(100*s/i,"%"),e.style.height="".concat(100*r/n,"%"),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]=xu["".concat(s,"_HTML")](r),this.annotationStorage.setValue(this.data.id,{[e]:xu["".concat(s,"_rgb")](r)})};return Pe(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||void 0===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,n,s]=this.data.rect.map(t=>Math.fround(t));if(8===t.length){const[r,a,o,l]=t.subarray(2,6);if(n===r&&s===a&&e===o&&i===l)return}const{style:r}=this.container;let a;if(bt(Pu,this)){const{borderColor:t,borderWidth:e}=r;r.borderWidth=0,a=["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="'.concat(t,'" stroke-width="').concat(e,'">')],this.container.classList.add("hasBorder")}const o=n-e,l=s-i,{svgFactory:c}=this,h=c.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0),h.role="none";const d=c.createElement("defs");h.append(d);const u=c.createElement("clipPath"),p="clippath_".concat(this.data.id);u.setAttribute("id",p),u.setAttribute("clipPathUnits","objectBoundingBox"),d.append(u);for(let f=2,m=t.length;f<m;f+=8){var g;const i=t[f],n=t[f+1],r=t[f+2],h=t[f+3],d=c.createElement("rect"),p=(r-e)/o,m=(s-n)/l,v=(i-r)/o,w=(n-h)/l;d.setAttribute("x",p),d.setAttribute("y",m),d.setAttribute("width",v),d.setAttribute("height",w),u.append(d),null===(g=a)||void 0===g||g.push('<rect vector-effect="non-scaling-stroke" x="'.concat(p,'" y="').concat(m,'" width="').concat(v,'" height="').concat(w,'"/>'))}bt(Pu,this)&&(a.push("</g></svg>')"),r.backgroundImage=a.join("")),this.container.append(h),this.container.style.clipPath="url(#".concat(p,")")}_createPopup(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const{data:e}=this;let i,n;t?(i={str:t.text},n=t.date):(i=e.contentsObj,n=e.modificationDate);const s=yt(Lu,this,new Qu({data:{color:e.color,titleObj:e.titleObj,modificationDate:n,contentsObj:i,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_".concat(e.id),rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}));this.parent._commentManager||this.parent.div.append(s.render())}get hasPopupElement(){return!!(bt(Lu,this)||this.popup||this.data.popupRef)}get extraPopupElement(){return bt(Lu,this)}render(){Ce("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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)continue;if(s===e)continue;const n="string"===typeof r?r:null,a=document.querySelector('[data-element-id="'.concat(s,'"]'));!a||Cu.has(a)?i.push({id:s,exportValue:n,domElement:a}):ke("_getElementsByName - element not allowed: ".concat(s))}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,s=n.getAttribute("data-element-id");s!==e&&(Cu.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)||void 0===t||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),null===(t=this.popup)||void 0===t||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")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{var i;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}function Fu(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:r,pageX:a,pageY:o}}}}=this;null===i||void 0===i||i.splice(0,4,...t),e.left="".concat(100*(t[0]-a)/s,"%"),e.top="".concat(100*(r-t[3]+o)/r,"%"),0===n?(e.width="".concat(100*(t[2]-t[0])/s,"%"),e.height="".concat(100*(t[3]-t[1])/r,"%")):this.setRotation(n)}class Iu extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.editor=t.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:t}=this;t.hasComment&&(this._createPopup(t.comment),this.extraPopupElement.popup.renderCommentButton())}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(t){this.editor.comment=t,t||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.container.remove(),this.container=null,this.removePopup()}}var Nu=new WeakSet;class Ou extends Du{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!(null===e||void 0===e||!e.ignoreBorder),createQuadrilaterals:!0}),ft(this,Nu),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,t.overlaidText),n=!0):t.attachment?(vt(Nu,this,Wu).call(this,i,t.attachment,t.overlaidText,t.attachmentDest),n=!0):t.setOCGState?(vt(Nu,this,zu).call(this,i,t.setOCGState,t.overlaidText),n=!0):t.dest?(this._bindLink(i,t.dest,t.overlaidText),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){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&vt(Nu,this,Bu).call(this),i&&(t.title=i)}_bindNamedAction(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),i&&(t.title=i),vt(Nu,this,Bu).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)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1})}e.overlaidText&&(t.title=e.overlaidText),t.onclick||(t.onclick=()=>!1),vt(Nu,this,Bu).call(this)}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),vt(Nu,this,Bu).call(this),!this._fieldObjects)return ke('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{null===i||void 0===i||i();const{fields:t,refs:n,include:s}=e,r=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const i of t){const t=this._fieldObjects[i]||[];for(const{id:i}of t)e.add(i)}for(const t of Object.values(this._fieldObjects))for(const i of t)e.has(i.id)===s&&r.push(i)}else for(const e of Object.values(this._fieldObjects))r.push(...e);const a=this.annotationStorage,o=[];for(const e of r){const{id:t}=e;switch(o.push(t),e.type){case"text":{const i=e.defaultValue||"";a.setValue(t,{value:i});break}case"checkbox":case"radiobutton":{const i=e.defaultValue===e.exportValues;a.setValue(t,{value:i});break}case"combobox":case"listbox":{const i=e.defaultValue||"";a.setValue(t,{value:i});break}default:continue}const i=document.querySelector('[data-element-id="'.concat(t,'"]'));i&&(Cu.has(i)?i.dispatchEvent(new Event("resetform")):ke("_bindResetFormAction - element not allowed: ".concat(t)))}var l;this.enableScripting&&(null===(l=this.linkService.eventBus)||void 0===l||l.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}));return!1}}}function Bu(){this.container.setAttribute("data-internal-link","")}function Wu(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;t.href=this.linkService.getAnchorUrl(""),e.description?t.title=e.description:i&&(t.title=i),t.onclick=()=>{var t;return null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(e.content,e.filename,n),!1},vt(Nu,this,Bu).call(this)}function zu(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),i&&(t.title=i),vt(Nu,this,Bu).call(this)}class ju extends Du{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 Hu extends Du{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&("CANVAS"===(null===(e=t.previousSibling)||void 0===e?void 0:e.nodeName)&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return ze.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)||void 0===e||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)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t)}}))})}_setEventListeners(t,e,i,n){for(const[o,l]of i){var s,r,a;if("Action"===l||null!==(s=this.data.actions)&&void 0!==s&&s[l])"Focus"!==l&&"Blur"!==l||e||(e={focused:!1}),this._setEventListener(t,e,o,l,n),"Focus"!==l||null!==(r=this.data.actions)&&void 0!==r&&r.Blur?"Blur"!==l||null!==(a=this.data.actions)&&void 0!==a&&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":He.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,s=t.style;let r;const a=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/(Ut*n))||1);r=Math.min(n,a(e/Ut))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(n,a(t/Ut))}s.fontSize="calc(".concat(r,"px * var(--total-scale-factor))"),s.color=He.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(s.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class Uu extends Hu{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(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){var n;const r=t.getValue(e,{value:this.data.fieldValue});let a=r.value||"";const o=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;o&&a.length>o&&(a=a.slice(0,o));let l=r.formattedValue||(null===(n=this.data.textContent)||void 0===n?void 0:n.join("\n"))||null;l&&this.data.comb&&(l=l.replaceAll(/\s+/g,""));const c={userValue:a,formattedValue:l,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=null!==l&&void 0!==l?l:a,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type=this.data.password?"password":"text",i.setAttribute("value",null!==l&&void 0!==l?l:a),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),Cu.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=0;const{datetimeFormat:h,datetimeType:d,timeStep:u}=this.data,p=!!d&&this.enableScripting;h&&(i.title=h),this._setRequired(i,this.data.required),o&&(i.maxLength=o),i.addEventListener("input",n=>{t.setValue(e,{value:n.target.value}),this.setPropertyOnSiblings(i,"value",n.target.value,"value"),c.formattedValue=null}),i.addEventListener("resetform",t=>{var e;const n=null!==(e=this.data.defaultFieldValue)&&void 0!==e?e:"";i.value=c.userValue=n,c.formattedValue=null});let g=t=>{const{formattedValue:e}=c;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var s;i.addEventListener("focus",t=>{var e;if(c.focused)return;const{target:i}=t;if(p&&(i.type=d,u&&(i.step=u)),c.userValue){const t=c.userValue;if(p)if("time"===d){const e=new Date(t),n=[e.getHours(),e.getMinutes(),e.getSeconds()];i.value=n.map(t=>t.toString().padStart(2,"0")).join(":")}else i.value=new Date(t-Su).toISOString().split("date"===d?"T":".",1)[0];else i.value=t}c.lastCommittedValue=i.value,c.commitKey=1,null!==(e=this.data.actions)&&void 0!==e&&e.Focus||(c.focused=!0)}),i.addEventListener("updatefromsandbox",i=>{this.showElementAndHideCanvas(i.target);const n={value(i){var n;c.userValue=null!==(n=i.detail.value)&&void 0!==n?n:"",p||t.setValue(e,{value:c.userValue.toString()}),i.target.value=c.userValue},formattedValue(i){const{formattedValue:n}=i.detail;c.formattedValue=n,null!==n&&void 0!==n&&i.target!==document.activeElement&&(i.target.value=n);const s={formattedValue:n};p&&(s.value=n),t.setValue(e,s)},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{var n;const{charLimit:s}=i.detail,{target:r}=i;if(0===s)return void r.removeAttribute("maxLength");r.setAttribute("maxLength",s);let a=c.userValue;!a||a.length<=s||(a=a.slice(0,s),r.value=c.userValue=a,t.setValue(e,{value:a}),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}}))}};this._dispatchEventFromSandbox(n,i)}),i.addEventListener("keydown",t=>{var i;c.commitKey=1;let n=-1;if("Escape"===t.key?n=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(c.commitKey=3):n=2,-1===n)return;const{value:s}=t.target;c.lastCommittedValue!==s&&(c.lastCommittedValue=s,c.userValue=s,null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:n,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});const n=g;g=null,i.addEventListener("blur",t=>{var i;if(!c.focused||!t.relatedTarget)return;null!==(i=this.data.actions)&&void 0!==i&&i.Blur||(c.focused=!1);const{target:s}=t;let{value:r}=s;if(p){if(r&&"time"===d){const t=r.split(":").map(t=>parseInt(t,10));r=new Date(2e3,0,1,t[0],t[1],t[2]||0).valueOf(),s.step=""}else r.includes("T")||(r="".concat(r,"T00:00")),r=new Date(r).valueOf();s.type="text"}var a;(c.userValue=r,c.lastCommittedValue!==r)&&(null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:c.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}));n(t)}),null!==(s=this.data.actions)&&void 0!==s&&s.Keystroke&&i.addEventListener("beforeinput",t=>{var i;c.lastCommittedValue=null;const{data:n,target:s}=t,{value:r,selectionStart:a,selectionEnd:o}=s;let l=a,h=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&&(h+=t[0].length);break}case"deleteContentBackward":a===o&&(l-=1);break;case"deleteContentForward":a===o&&(h+=1)}t.preventDefault(),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,change:n||"",willCommit:!1,selStart:l,selEnd:h}})}),this._setEventListeners(i,c,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(g&&i.addEventListener("blur",g),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/o;i.classList.add("comb"),i.style.letterSpacing="calc(".concat(t,"px * var(--total-scale-factor) - 1ch)")}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Vu extends Hu{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class Gu extends Hu{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 Cu.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=0,s.addEventListener("change",n=>{const{name:s,checked:r}=n.target;for(const a of this._getElementsByName(s,i)){const i=r&&a.exportValue===e.exportValue;a.domElement&&(a.domElement.checked=i),t.setValue(a.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 qu extends Hu{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 r of this._getElementsByName(e.fieldName,i))t.setValue(r.id,{value:!1});const s=document.createElement("input");if(Cu.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=0,s.addEventListener("change",e=>{const{name:n,checked:s}=e.target;for(const r of this._getElementsByName(n,i))t.setValue(r.id,{value:!1});t.setValue(i,{value:s})}),s.addEventListener("resetform",t=>{const i=e.defaultFieldValue;t.target.checked=null!==i&&void 0!==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 Xu extends Ou{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 Yu extends Hu{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");Cu.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=0;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 i of n.options)i.selected=i.value===e});for(const c of this.data.options){const t=document.createElement("option");t.textContent=c.displayValue,t.value=c.exportValue,i.value.includes(c.exportValue)&&(t.setAttribute("selected",!0),s=!1),n.append(t)}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){var s;null===(s=r)||void 0===s||s();const l=i.detail.value,c=new Set(Array.isArray(l)?l:[l]);for(const t of n.options)t.selected=c.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;if(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:c}=i.detail.insert,h=n.children[s],d=document.createElement("option");d.textContent=r,d.value=c,h?h.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)||void 0===n||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}}var Ku=new WeakSet;class Qu extends Du{constructor(t){const{data:e,elements:i,parent:n}=t,s=!!n._commentManager;if(super(t,{isRenderable:!s&&Du._hasPopupData(e)}),ft(this,Ku),this.elements=i,s&&Du._hasPopupData(e)){const t=this.popup=vt(Ku,this,Zu).call(this);for(const e of i)e.popup=t}else this.popup=null}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const e=this.popup=vt(Ku,this,Zu).call(this),i=[];for(const n of this.elements)n.popup=e,n.container.ariaHasPopup="dialog",i.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(t=>"".concat(Ye).concat(t)).join(",")),this.container}}function Zu(){return new kp({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,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,commentManager:this.parent._commentManager})}var Ju=new WeakMap,$u=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,cp=new WeakMap,hp=new WeakMap,dp=new WeakMap,up=new WeakMap,pp=new WeakMap,gp=new WeakMap,fp=new WeakMap,mp=new WeakMap,vp=new WeakMap,wp=new WeakMap,bp=new WeakMap,yp=new WeakMap,Ap=new WeakMap,Ep=new WeakMap,xp=new WeakMap,_p=new WeakSet;class kp{constructor(t){let{container:e,color:i,elements:n,titleObj:s,modificationDate:r,contentsObj:a,richText:o,parent:l,rect:c,parentRect:h,open:d,commentManager:u=null}=t;ft(this,_p),mt(this,Ju,null),mt(this,$u,vt(_p,this,Fp).bind(this)),mt(this,tp,vt(_p,this,Bp).bind(this)),mt(this,ep,vt(_p,this,Op).bind(this)),mt(this,ip,vt(_p,this,Np).bind(this)),mt(this,np,null),mt(this,sp,null),mt(this,rp,null),mt(this,ap,null),mt(this,op,null),mt(this,lp,null),mt(this,cp,null),mt(this,hp,!1),mt(this,dp,null),mt(this,up,null),mt(this,pp,null),mt(this,gp,null),mt(this,fp,null),mt(this,mp,null),mt(this,vp,null),mt(this,wp,null),mt(this,bp,null),mt(this,yp,null),mt(this,Ap,!1),mt(this,Ep,null),mt(this,xp,null),yt(sp,this,e),yt(bp,this,s),yt(rp,this,a),yt(wp,this,o),yt(lp,this,l),yt(np,this,i),yt(vp,this,c),yt(cp,this,h),yt(op,this,n),yt(Ju,this,u),yt(Ep,this,n[0]),yt(ap,this,hi.toDateObject(r)),this.trigger=n.flatMap(t=>t.getElementsToTriggerPopup()),u?this.renderCommentButton():(vt(_p,this,Cp).call(this),bt(sp,this).hidden=!0,d&&vt(_p,this,Np).call(this))}renderCommentButton(){if(bt(gp,this))return;if(bt(fp,this)||vt(_p,this,Sp).call(this),!bt(fp,this))return;const{signal:t}=yt(up,this,new AbortController),e=!!bt(Ep,this).extraPopupElement,i=()=>{bt(Ju,this).toggleCommentPopup(this,!0,void 0,!e)},n=()=>{bt(Ju,this).toggleCommentPopup(this,!1,!0,!e)},s=()=>{bt(Ju,this).toggleCommentPopup(this,!1,!1)};if(e){yt(gp,this,bt(Ep,this).container);for(const e of this.trigger)e.ariaHasPopup="dialog",e.ariaControls="commentPopup",e.addEventListener("keydown",bt($u,this),{signal:t}),e.addEventListener("click",i,{signal:t}),e.addEventListener("pointerenter",n,{signal:t}),e.addEventListener("pointerleave",s,{signal:t}),e.classList.add("popupTriggerArea")}else{const e=yt(gp,this,document.createElement("button"));e.className="annotationCommentButton";const r=bt(Ep,this).container;e.style.zIndex=r.style.zIndex+1,e.tabIndex=0,e.ariaHasPopup="dialog",e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button"),vt(_p,this,Tp).call(this),vt(_p,this,Mp).call(this),e.addEventListener("keydown",bt($u,this),{signal:t}),e.addEventListener("click",i,{signal:t}),e.addEventListener("pointerenter",n,{signal:t}),e.addEventListener("pointerleave",s,{signal:t}),r.after(e)}}get commentButtonColor(){const{color:t,opacity:e}=bt(Ep,this).commentData;return t?bt(lp,this)._commentManager.makeCommentColor(t,e):null}focusCommentButton(){setTimeout(()=>{var t;null===(t=bt(gp,this))||void 0===t||t.focus()},0)}getData(){const{richText:t,color:e,opacity:i,creationDate:n,modificationDate:s}=bt(Ep,this).commentData;return{contentsObj:{str:this.comment},richText:t,color:e,opacity:i,creationDate:n,modificationDate:s}}get elementBeforePopup(){return bt(gp,this)}get comment(){return bt(xp,this)||yt(xp,this,bt(Ep,this).commentText),bt(xp,this)}set comment(t){t!==this.comment&&(bt(Ep,this).commentText=yt(xp,this,t))}get parentBoundingClientRect(){return bt(Ep,this).layer.getBoundingClientRect()}setCommentButtonStates(t){let{selected:e,hasPopup:i}=t;bt(gp,this)&&(bt(gp,this).classList.toggle("selected",e),bt(gp,this).ariaExpanded=i)}setSelectedCommentButton(t){bt(gp,this).classList.toggle("selected",t)}get commentPopupPosition(){if(bt(mp,this))return bt(mp,this);const{x:t,y:e,height:i}=bt(gp,this).getBoundingClientRect(),{x:n,y:s,width:r,height:a}=bt(Ep,this).layer.getBoundingClientRect();return[(t-n)/r,(e+i-s)/a]}set commentPopupPosition(t){yt(mp,this,t)}hasDefaultPopupPosition(){return null===bt(mp,this)}get commentButtonPosition(){return bt(fp,this)}get commentButtonWidth(){return bt(gp,this).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(t){const[e,i]=bt(mp,this)||this.commentButtonPosition.map(t=>t/100),n=this.parentBoundingClientRect,{x:s,y:r,width:a,height:o}=n;bt(Ju,this).showDialog(null,this,s+e*a,r+i*o,(0,pt.A)((0,pt.A)({},t),{},{parentDimensions:n}))}render(){var t,e;if(bt(dp,this))return;const i=yt(dp,this,document.createElement("div"));if(i.className="popup",bt(np,this)){const t=i.style.outlineColor=He.makeHexColor(...bt(np,this));i.style.backgroundColor="color-mix(in srgb, ".concat(t," 30%, white)")}const n=document.createElement("span");if(n.className="header",null!==(t=bt(bp,this))&&void 0!==t&&t.str){const t=document.createElement("span");t.className="title",n.append(t),({dir:t.dir,str:t.textContent}=bt(bp,this))}if(i.append(n),bt(ap,this)){const t=document.createElement("time");t.className="popupDate",t.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),t.setAttribute("data-l10n-args",JSON.stringify({dateObj:bt(ap,this).valueOf()})),t.dateTime=bt(ap,this).toISOString(),n.append(t)}_i({html:wt(_p,this,Pp)||bt(rp,this).str,dir:null===(e=bt(rp,this))||void 0===e?void 0:e.dir,className:"popupContent"},i),bt(sp,this).append(i)}updateEdited(t){var e;let{rect:i,popup:n,deleted:s}=t;if(bt(Ju,this))return s?(this.remove(),yt(xp,this,null)):n&&(n.deleted?this.remove():(vt(_p,this,Tp).call(this),yt(xp,this,n.text))),void(i&&(yt(fp,this,null),vt(_p,this,Sp).call(this),vt(_p,this,Mp).call(this)));s||null!==n&&void 0!==n&&n.deleted?this.remove():(vt(_p,this,Cp).call(this),bt(yp,this)||yt(yp,this,{contentsObj:bt(rp,this),richText:bt(wp,this)}),i&&yt(pp,this,null),n&&n.text&&(yt(wp,this,vt(_p,this,Dp).call(this,n.text)),yt(ap,this,hi.toDateObject(n.date)),yt(rp,this,null)),null===(e=bt(dp,this))||void 0===e||e.remove(),yt(dp,this,null))}resetEdited(){var t;bt(yp,this)&&(({contentsObj:ut(yt,[rp,this])._,richText:ut(yt,[wp,this])._}=bt(yp,this)),yt(yp,this,null),null===(t=bt(dp,this))||void 0===t||t.remove(),yt(dp,this,null),yt(pp,this,null))}remove(){var t,e,i;if(null===(t=bt(up,this))||void 0===t||t.abort(),yt(up,this,null),null===(e=bt(dp,this))||void 0===e||e.remove(),yt(dp,this,null),yt(Ap,this,!1),yt(hp,this,!1),null===(i=bt(gp,this))||void 0===i||i.remove(),yt(gp,this,null),this.trigger)for(const n of this.trigger)n.classList.remove("popupTriggerArea")}forceHide(){yt(Ap,this,this.isVisible),bt(Ap,this)&&(bt(sp,this).hidden=!0)}maybeShow(){bt(Ju,this)||(vt(_p,this,Cp).call(this),bt(Ap,this)&&(bt(dp,this)||vt(_p,this,Op).call(this),yt(Ap,this,!1),bt(sp,this).hidden=!1))}get isVisible(){return!bt(Ju,this)&&!1===bt(sp,this).hidden}}function Cp(){if(bt(up,this))return;yt(up,this,new AbortController);const{signal:t}=bt(up,this);for(const i of this.trigger)i.addEventListener("click",bt(ip,this),{signal:t}),i.addEventListener("pointerenter",bt(ep,this),{signal:t}),i.addEventListener("pointerleave",bt(tp,this),{signal:t}),i.classList.add("popupTriggerArea");for(const i of bt(op,this)){var e;null===(e=i.container)||void 0===e||e.addEventListener("keydown",bt($u,this),{signal:t})}}function Sp(){const t=bt(op,this).find(t=>t.hasCommentButton);t&&yt(fp,this,t._normalizePoint(t.commentButtonPosition))}function Mp(){if(bt(Ep,this).extraPopupElement&&!bt(Ep,this).editor)return;this.renderCommentButton();const[t,e]=bt(fp,this),{style:i}=bt(gp,this);i.left="calc(".concat(t,"%)"),i.top="calc(".concat(e,"% - var(--comment-button-dim))")}function Tp(){bt(Ep,this).extraPopupElement||(this.renderCommentButton(),bt(gp,this).style.backgroundColor=this.commentButtonColor||"")}function Pp(t){const e=bt(wp,t),i=bt(rp,t);return null===e||void 0===e||!e.str||null!==i&&void 0!==i&&i.str&&i.str!==e.str?null:bt(wp,t).html||null}function Lp(t){var e;return(null===(e=wt(_p,t,Pp))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.fontSize)||0}function Rp(t){var e;return(null===(e=wt(_p,t,Pp))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.color)||null}function Dp(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:wt(_p,this,Rp),fontSize:wt(_p,this,Lp)?"calc(".concat(wt(_p,this,Lp),"px * var(--total-scale-factor))"):""}};for(const s of t.split("\n"))e.push({name:"span",value:s,attributes:n});return i}function Fp(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&bt(hp,this))&&vt(_p,this,Np).call(this)}function Ip(){if(null!==bt(pp,this))return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:s}}}=bt(lp,this);let r=!!bt(cp,this),a=bt(r?cp:vp,this);for(const u of bt(op,this))if(!a||null!==He.intersect(u.data.rect,a)){a=u.data.rect,r=!0;break}const o=He.normalizeRect([a[0],t[3]-a[1]+t[1],a[2],t[3]-a[3]+t[1]]),l=r?a[2]-a[0]+5:0,c=o[0]+l,h=o[1];yt(pp,this,[100*(c-n)/e,100*(h-s)/i]);const{style:d}=bt(sp,this);d.left="".concat(bt(pp,this)[0],"%"),d.top="".concat(bt(pp,this)[1],"%")}function Np(){bt(Ju,this)?bt(Ju,this).toggleCommentPopup(this,!1):(yt(hp,this,!bt(hp,this)),bt(hp,this)?(vt(_p,this,Op).call(this),bt(sp,this).addEventListener("click",bt(ip,this)),bt(sp,this).addEventListener("keydown",bt($u,this))):(vt(_p,this,Bp).call(this),bt(sp,this).removeEventListener("click",bt(ip,this)),bt(sp,this).removeEventListener("keydown",bt($u,this))))}function Op(){bt(dp,this)||this.render(),this.isVisible?bt(hp,this)&&bt(sp,this).classList.add("focused"):(vt(_p,this,Ip).call(this),bt(sp,this).hidden=!1,bt(sp,this).style.zIndex=parseInt(bt(sp,this).style.zIndex)+1e3)}function Bp(){bt(sp,this).classList.remove("focused"),!bt(hp,this)&&this.isVisible&&(bt(sp,this).hidden=!0,bt(sp,this).style.zIndex=parseInt(bt(sp,this).style.zIndex)-1e3)}class Wp extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=te.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}}var zp=new WeakMap;class jp extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),mt(this,zp,null)}render(){this.container.classList.add("lineAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),s=yt(zp,this,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 bt(zp,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Hp=new WeakMap;class Up extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),mt(this,Hp,null)}render(){this.container.classList.add("squareAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=yt(Hp,this,this.svgFactory.createElement("svg:rect"));return r.setAttribute("x",s/2),r.setAttribute("y",s/2),r.setAttribute("width",e-s),r.setAttribute("height",i-s),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(Hp,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Vp=new WeakMap;class Gp extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),mt(this,Vp,null)}render(){this.container.classList.add("circleAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=yt(Vp,this,this.svgFactory.createElement("svg:ellipse"));return r.setAttribute("cx",e/2),r.setAttribute("cy",i/2),r.setAttribute("rx",e/2-s/2),r.setAttribute("ry",i/2-s/2),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(Vp,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var qp=new WeakMap;class Xp extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),mt(this,qp,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},width:s,height:r}=this;if(!e)return this.container;const a=this.svgFactory.create(s,r,!0);let o=[];for(let c=0,h=e.length;c<h;c+=2){const i=e[c]-t[0],n=t[3]-e[c+1];o.push("".concat(i,",").concat(n))}o=o.join(" ");const l=yt(qp,this,this.svgFactory.createElement(this.svgElementName));return l.setAttribute("points",o),l.setAttribute("stroke-width",i.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),a.append(l),this.container.append(a),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(qp,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class Yp extends Xp{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Kp extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var Qp=new WeakMap,Zp=new WeakMap,Jp=new WeakSet;class $p extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),ft(this,Jp),mt(this,Qp,null),mt(this,Zp,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?te.HIGHLIGHT:te.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:e,inkLists:i,borderStyle:n,popupRef:s}}=this,{transform:r,width:a,height:o}=vt(Jp,this,tg).call(this,e,t),l=this.svgFactory.create(a,o,!0),c=yt(Qp,this,this.svgFactory.createElement("svg:g"));l.append(c),c.setAttribute("stroke-width",n.width||1),c.setAttribute("stroke-linecap","round"),c.setAttribute("stroke-linejoin","round"),c.setAttribute("stroke-miterlimit",10),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),c.setAttribute("transform",r);for(let h=0,d=i.length;h<d;h++){const t=this.svgFactory.createElement(this.svgElementName);bt(Zp,this).push(t),t.setAttribute("points",i[h].join(",")),c.append(t)}return!s&&this.hasPopupData&&this._createPopup(),this.container.append(l),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:e,points:i,rect:n}=t,s=bt(Qp,this);if(e>=0&&s.setAttribute("stroke-width",e||1),i)for(let r=0,a=bt(Zp,this).length;r<a;r++)bt(Zp,this)[r].setAttribute("points",i[r].join(","));if(n){const{transform:t,width:e,height:i}=vt(Jp,this,tg).call(this,this.data.rotation,n);s.parentElement.setAttribute("viewBox","0 0 ".concat(e," ").concat(i)),s.setAttribute("transform",t)}}getElementsToTriggerPopup(){return bt(Zp,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function tg(t,e){switch(t){case 90:return{transform:"rotate(90) translate(".concat(-e[0],",").concat(e[1],") scale(1,-1)"),width:e[3]-e[1],height:e[2]-e[0]};case 180:return{transform:"rotate(180) translate(".concat(-e[2],",").concat(e[1],") scale(1,-1)"),width:e[2]-e[0],height:e[3]-e[1]};case 270:return{transform:"rotate(270) translate(".concat(-e[2],",").concat(e[3],") scale(1,-1)"),width:e[3]-e[1],height:e[2]-e[0]};default:return{transform:"translate(".concat(-e[0],",").concat(e[3],") scale(1,-1)"),width:e[2]-e[0],height:e[3]-e[1]}}}class eg extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=te.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const e=document.createElement("mark");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class ig extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),t){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class ng extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),t){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class sg extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),t){const e=document.createElement("s");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class rg extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=te.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var ag=new WeakMap,og=new WeakSet;class lg extends Du{constructor(t){var e;super(t,{isRenderable:!0}),ft(this,og),mt(this,ag,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",(0,pt.A)({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="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(e.name)?"paperclip":"pushpin",".svg"),e.fillAlpha&&e.fillAlpha<1&&(i.style="filter: opacity(".concat(Math.round(100*e.fillAlpha),"%);"))),i.addEventListener("dblclick",vt(og,this,cg).bind(this)),yt(ag,this,i);const{isMac:n}=ze.platform;return t.addEventListener("keydown",t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&vt(og,this,cg).call(this)}),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return bt(ag,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function cg(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.content,this.filename)}var hg=new WeakMap,dg=new WeakMap,ug=new WeakMap,pg=new WeakMap,gg=new WeakMap,fg=new WeakMap,mg=new WeakSet;class vg{constructor(t){let{div:e,accessibilityManager:i,annotationCanvasMap:n,annotationEditorUIManager:s,page:r,viewport:a,structTreeLayer:o,commentManager:l,linkService:c,annotationStorage:h}=t;ft(this,mg),mt(this,hg,null),mt(this,dg,null),mt(this,ug,null),mt(this,pg,new Map),mt(this,gg,null),mt(this,fg,null),this.div=e,yt(hg,this,i),yt(dg,this,n),yt(gg,this,o||null),yt(fg,this,c||null),yt(ug,this,h||new Ta),this.page=r,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=s,this._commentManager=l||null}hasEditableAnnotations(){return bt(pg,this).size>0}async render(t){const{annotations:e}=t,i=this.div;fi(i,this.viewport);const n=new Map,s={data:null,layer:i,linkService:bt(fg,this),downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new ku,annotationStorage:bt(ug,this),enableComment:!0===t.enableComment,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const o of e){var r;if(o.noHTML)continue;const t=o.annotationType===ce.POPUP;if(t){const t=n.get(o.id);if(!t)continue;s.elements=t}else if(o.rect[2]===o.rect[0]||o.rect[3]===o.rect[1])continue;s.data=o;const e=Mu.create(s);if(!e.isRenderable)continue;if(!t&&o.popupRef){const t=n.get(o.popupRef);t?t.push(e):n.set(o.popupRef,[e])}const i=e.render();var a;if(o.hidden&&(i.style.visibility="hidden"),await vt(mg,this,wg).call(this,i,o.id,s.elements),null===(r=e.extraPopupElement)||void 0===r||null===(r=r.popup)||void 0===r||r.renderCommentButton(),e._isEditable)bt(pg,this).set(e.data.id,e),null===(a=this._annotationEditorUIManager)||void 0===a||a.renderAnnotationElement(e)}vt(mg,this,bg).call(this)}async addLinkAnnotations(t){const e={data:null,layer:this.div,linkService:bt(fg,this),svgFactory:new ku,parent:this};for(const i of t){i.borderStyle||(i.borderStyle=vg._defaultBorderStyle),e.data=i;const t=Mu.create(e);if(!t.isRenderable)continue;const n=t.render();await vt(mg,this,wg).call(this,n,i.id,null)}}update(t){let{viewport:e}=t;const i=this.div;this.viewport=e,fi(i,{rotation:e.rotation}),vt(mg,this,bg).call(this),i.hidden=!1}getEditableAnnotations(){return Array.from(bt(pg,this).values())}getEditableAnnotation(t){return bt(pg,this).get(t)}addFakeAnnotation(t){var e;const{div:i}=this,{id:n,rotation:s}=t,r=new Iu({data:{id:n,rect:t.getPDFRect(),rotation:s},editor:t,layer:i,parent:this,enableComment:!!this._commentManager,linkService:bt(fg,this),annotationStorage:bt(ug,this)}),a=r.render();return i.append(a),null===(e=bt(hg,this))||void 0===e||e.moveElementInDOM(i,a,a,!1),r.createOrUpdatePopup(),r}static get _defaultBorderStyle(){return Pe(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:he,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}async function wg(t,e,i){var n;const s=t.firstChild||t,r=s.id="".concat(Ye).concat(e),a=await(null===(n=bt(gg,this))||void 0===n?void 0:n.getAriaAttributes(r));if(a)for(const[l,c]of a)s.setAttribute(l,c);var o;i?i.at(-1).container.after(t):(this.div.append(t),null===(o=bt(hg,this))||void 0===o||o.moveElementInDOM(this.div,t,s,!1))}function bg(){if(!bt(dg,this))return;const t=this.div;for(const[i,n]of bt(dg,this)){const s=t.querySelector('[data-annotation-id="'.concat(i,'"]'));if(!s)continue;n.className="annotationContent";const{firstChild:r}=s;r?"CANVAS"===r.nodeName?r.replaceWith(n):r.classList.contains("annotationContent")?r.after(n):r.before(n):s.append(n);const a=bt(pg,this).get(i);var e;if(a)if(a._hasNoCanvas)null===(e=this._annotationEditorUIManager)||void 0===e||e.setMissingCanvas(i,s.id,n),a._hasNoCanvas=!1;else a.canvas=n}bt(dg,this).clear()}const yg=/\r\n?|\n/g;var Ag=new WeakMap,Eg=new WeakMap,xg=new WeakMap,_g=new WeakMap,kg=new WeakSet;class Cg extends Jr{static get _keyboardManager(){const t=Cg.prototype,e=t=>t.isEmpty(),i=hs.TRANSLATE_SMALL,n=hs.TRANSLATE_BIG;return Pe(this,"_keyboardManager",new dn([[["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}]]))}constructor(t){super((0,pt.A)((0,pt.A)({},t),{},{name:"freeTextEditor"})),ft(this,kg),mt(this,Ag,""),mt(this,Eg,"".concat(this.id,"-editor")),mt(this,xg,null),mt(this,_g,void 0),(0,Wt.A)(this,"_colorPicker",null),this.color=t.color||Cg._defaultColor||Jr._defaultLineColor,yt(_g,this,t.fontSize||Cg._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static initialize(t,e){Jr.initialize(t,e);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case ee.FREETEXT_SIZE:Cg._defaultFontSize=e;break;case ee.FREETEXT_COLOR:Cg._defaultColor=e}}updateParams(t,e){switch(t){case ee.FREETEXT_SIZE:vt(kg,this,Sg).call(this,e);break;case ee.FREETEXT_COLOR:vt(kg,this,Mg).call(this,e)}}static get defaultPropertiesToUpdate(){return[[ee.FREETEXT_SIZE,Cg._defaultFontSize],[ee.FREETEXT_COLOR,Cg._defaultColor||Jr._defaultLineColor]]}get propertiesToUpdate(){return[[ee.FREETEXT_SIZE,bt(_g,this)],[ee.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new bu(this)),[["colorPicker",this._colorPicker]]}get colorType(){return ee.FREETEXT_COLOR}onUpdatedColor(){var t;this.editorDiv.style.color=this.color,null===(t=this._colorPicker)||void 0===t||t.update(this.color),super.onUpdatedColor()}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-Cg._internalPadding*t,-(Cg._internalPadding+bt(_g,this))*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),yt(xg,this,new AbortController);const t=this._uiManager.combinedSignal(bt(xg,this));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){var t;return!!super.disableEditMode()&&(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",bt(Eg,this)),this._isDraggable=!0,null===(t=bt(xg,this))||void 0===t||t.abort(),yt(xg,this,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0)}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){var e;this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),null!==(e=this._initialOptions)&&void 0!==e&&e.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=bt(Ag,this),e=yt(Ag,this,vt(kg,this,Tg).call(this).trimEnd());if(t===e)return;const i=t=>{yt(Ag,this,t),t?(vt(kg,this,Rg).call(this),this._uiManager.rebuild(this),vt(kg,this,Pg).call(this)):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),vt(kg,this,Pg).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){Cg._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)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,e;(this._isCopy||this.annotationElementId)&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",bt(Eg,this)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize="calc(".concat(bt(_g,this),"px * var(--total-scale-factor))"),i.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:s}=this._initialData;let[r,a]=this.getInitialTranslation();[r,a]=this.pageTranslationToScreen(r,a);const[o,l]=this.pageDimensions,[c,h]=this.pageTranslation;let d,u;switch(this.rotation){case 0:d=t+(s[0]-c)/o,u=e+this.height-(s[1]-h)/l;break;case 90:d=t+(s[0]-c)/o,u=e-(s[1]-h)/l,[r,a]=[a,-r];break;case 180:d=t-this.width+(s[0]-c)/o,u=e-(s[1]-h)/l,[r,a]=[-r,-a];break;case 270:d=t+(s[0]-c-this.height*l)/o,u=e+(s[1]-h-this.width*o)/l,[r,a]=[-a,r]}this.setAt(d*i,u*n,r,a)}else this._moveAfterPaste(t,e);vt(kg,this,Rg).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=Fg.call(Cg,e.getData("text")||"").replaceAll(yg,"\n");if(!n)return;const s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();const r=s.getRangeAt(0);if(!n.includes("\n"))return r.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void s.collapseToStart();const{startContainer:a,startOffset:o}=r,l=[],c=[];if(a.nodeType===Node.TEXT_NODE){const t=a.parentElement;if(c.push(a.nodeValue.slice(o).replaceAll(yg,"")),t!==this.editorDiv){let e=l;for(const i of this.editorDiv.childNodes)i!==t?e.push(Lg.call(Cg,i)):e=c}l.push(a.nodeValue.slice(0,o).replaceAll(yg,""))}else if(a===this.editorDiv){let t=l,e=0;for(const i of this.editorDiv.childNodes)e++===o&&(t=c),t.push(Lg.call(Cg,i))}yt(Ag,this,"".concat(l.join("\n")).concat(n).concat(c.join("\n"))),vt(kg,this,Rg).call(this);const h=new Range;let d=Math.sumPrecise(l.map(t=>t.length));for(const{firstChild:u}of this.editorDiv.childNodes)if(u.nodeType===Node.TEXT_NODE){const t=u.nodeValue.length;if(d<=t){h.setStart(u,d),h.setEnd(u,d);break}d-=t}s.removeAllRanges(),s.addRange(h)}get contentDiv(){return this.editorDiv}getPDFRect(){const t=Cg._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,e,i){let n=null;if(t instanceof Wp){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:s,rotation:r,id:a,popupRef:o,richText:l,contentsObj:c,creationDate:h,modificationDate:d},textContent:u,textPosition:p,parent:{page:{pageNumber:g}}}=t;if(!u||0===u.length)return null;n=t={annotationType:te.FREETEXT,color:Array.from(i),fontSize:e,value:u.join("\n"),position:p,pageIndex:g-1,rect:s.slice(0),rotation:r,annotationElementId:a,id:a,deleted:!1,popupRef:o,comment:(null===c||void 0===c?void 0:c.str)||null,richText:l,creationDate:h,modificationDate:d}}const s=await super.deserialize(t,e,i);return yt(_g,s,t.fontSize),s.color=He.makeHexColor(...t.color),yt(Ag,s,Fg.call(Cg,t.value)),s._initialData=n,t.comment&&s.setCommentData(t),s}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e=Jr._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(t),{color:e,fontSize:bt(_g,this),value:vt(kg,this,Dg).call(this)});return this.addComment(i),t?(i.isCopy=!0,i):this.annotationElementId&&!vt(kg,this,Ig).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(!e)return null;const{style:i}=e;i.fontSize="calc(".concat(bt(_g,this),"px * var(--total-scale-factor))"),i.color=this.color,e.replaceChildren();for(const n of bt(Ag,this).split("\n")){const t=document.createElement("div");t.append(n?document.createTextNode(n):document.createElement("br")),e.append(t)}return t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:bt(Ag,this)}}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}function Sg(t){const e=t=>{this.editorDiv.style.fontSize="calc(".concat(t,"px * var(--total-scale-factor))"),this.translate(0,-(t-bt(_g,this))*this.parentScale),yt(_g,this,t),vt(kg,this,Pg).call(this)},i=bt(_g,this);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ee.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function Mg(t){const e=t=>{this.color=t,this.onUpdatedColor()},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:ee.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function Tg(){const t=[];this.editorDiv.normalize();let e=null;for(const n of this.editorDiv.childNodes){var i;(null===(i=e)||void 0===i?void 0:i.nodeType)===Node.TEXT_NODE&&"BR"===n.nodeName||(t.push(Lg.call(Ft,n)),e=n)}return t.join("\n")}function Pg(){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()}function Lg(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(yg,"")}function Rg(){if(this.editorDiv.replaceChildren(),bt(Ag,this))for(const t of bt(Ag,this).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}function Dg(){return bt(Ag,this).replaceAll("\xa0"," ")}function Fg(t){return t.replaceAll(" ","\xa0")}function Ig(t){const{value:e,fontSize:i,color:n,pageIndex:s}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some((t,e)=>t!==n[e])||t.pageIndex!==s}Ft=Cg,(0,Wt.A)(Cg,"_freeTextDefaultContent",""),(0,Wt.A)(Cg,"_internalPadding",0),(0,Wt.A)(Cg,"_defaultColor",null),(0,Wt.A)(Cg,"_defaultFontSize",10),(0,Wt.A)(Cg,"_type","freetext"),(0,Wt.A)(Cg,"_editorType",te.FREETEXT);class Ng{toSVGPath(){Ce("Abstract method `toSVGPath` must be implemented.")}get box(){Ce("Abstract getter `box` must be implemented.")}serialize(t,e){Ce("Abstract method `serialize` must be implemented.")}static _rescale(t,e,i,n,s,r){r||(r=new Float32Array(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}static _rescaleAndSwap(t,e,i,n,s,r){r||(r=new Float32Array(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}static _translate(t,e,i,n){n||(n=new Float32Array(t.length));for(let s=0,r=t.length;s<r;s+=2)n[s]=e+t[s],n[s+1]=i+t[s+1];return n}static svgRound(t){return Math.round(1e4*t)}static _normalizePoint(t,e,i,n,s){switch(s){case 90:return[1-e/i,t/n];case 180:return[1-t/i,1-e/n];case 270:return[e/i,1-t/n];default:return[t/i,e/n]}}static _normalizePagePoint(t,e,i){switch(i){case 90:return[1-e,t];case 180:return[1-t,1-e];case 270:return[e,1-t];default:return[t,e]}}static createBezierPoints(t,e,i,n,s,r){return[(t+5*i)/6,(e+5*n)/6,(5*i+s)/6,(5*n+r)/6,(i+s)/2,(n+r)/2]}}(0,Wt.A)(Ng,"PRECISION",1e-4);var Og=new WeakMap,Bg=new WeakMap,Wg=new WeakMap,zg=new WeakMap,jg=new WeakMap,Hg=new WeakMap,Ug=new WeakMap,Vg=new WeakMap,Gg=new WeakMap,qg=new WeakMap,Xg=new WeakMap,Yg=new WeakMap,Kg=new WeakMap,Qg=new WeakSet;class Zg{constructor(t,e,i,n,s){let{x:r,y:a}=t,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;ft(this,Qg),mt(this,Og,void 0),mt(this,Bg,[]),mt(this,Wg,void 0),mt(this,zg,void 0),mt(this,jg,[]),mt(this,Hg,new Float32Array(18)),mt(this,Ug,void 0),mt(this,Vg,void 0),mt(this,Gg,void 0),mt(this,qg,void 0),mt(this,Xg,void 0),mt(this,Yg,void 0),mt(this,Kg,[]),yt(Og,this,e),yt(Yg,this,n*i),yt(zg,this,s),bt(Hg,this).set([NaN,NaN,NaN,NaN,r,a],6),yt(Wg,this,o),yt(qg,this,af._*i),yt(Gg,this,of._*i),yt(Xg,this,i),bt(Kg,this).push(r,a)}isEmpty(){return isNaN(bt(Hg,this)[8])}add(t){var e;let{x:i,y:n}=t;yt(Ug,this,i),yt(Vg,this,n);const[s,r,a,o]=bt(Og,this);let[l,c,h,d]=bt(Hg,this).subarray(8,12);const u=i-h,p=n-d,g=Math.hypot(u,p);if(g<bt(Gg,this))return!1;const f=g-bt(qg,this),m=f/g,v=m*u,w=m*p;let b=l,y=c;l=h,c=d,h+=v,d+=w,null===(e=bt(Kg,this))||void 0===e||e.push(i,n);const A=v/f,E=-w/f*bt(Yg,this),x=A*bt(Yg,this);if(bt(Hg,this).set(bt(Hg,this).subarray(2,8),0),bt(Hg,this).set([h+E,d+x],4),bt(Hg,this).set(bt(Hg,this).subarray(14,18),12),bt(Hg,this).set([h-E,d-x],16),isNaN(bt(Hg,this)[6]))return 0===bt(jg,this).length&&(bt(Hg,this).set([l+E,c+x],2),bt(jg,this).push(NaN,NaN,NaN,NaN,(l+E-s)/a,(c+x-r)/o),bt(Hg,this).set([l-E,c-x],14),bt(Bg,this).push(NaN,NaN,NaN,NaN,(l-E-s)/a,(c-x-r)/o)),bt(Hg,this).set([b,y,l,c,h,d],6),!this.isEmpty();bt(Hg,this).set([b,y,l,c,h,d],6);return Math.abs(Math.atan2(y-c,b-l)-Math.atan2(w,v))<Math.PI/2?([l,c,h,d]=bt(Hg,this).subarray(2,6),bt(jg,this).push(NaN,NaN,NaN,NaN,((l+h)/2-s)/a,((c+d)/2-r)/o),[l,c,b,y]=bt(Hg,this).subarray(14,18),bt(Bg,this).push(NaN,NaN,NaN,NaN,((b+l)/2-s)/a,((y+c)/2-r)/o),!0):([b,y,l,c,h,d]=bt(Hg,this).subarray(0,6),bt(jg,this).push(((b+5*l)/6-s)/a,((y+5*c)/6-r)/o,((5*l+h)/6-s)/a,((5*c+d)/6-r)/o,((l+h)/2-s)/a,((c+d)/2-r)/o),[h,d,l,c,b,y]=bt(Hg,this).subarray(12,18),bt(Bg,this).push(((b+5*l)/6-s)/a,((y+5*c)/6-r)/o,((5*l+h)/6-s)/a,((5*c+d)/6-r)/o,((l+h)/2-s)/a,((c+d)/2-r)/o),!0)}toSVGPath(){if(this.isEmpty())return"";const t=bt(jg,this),e=bt(Bg,this);if(isNaN(bt(Hg,this)[6])&&!this.isEmpty())return vt(Qg,this,$g).call(this);const i=[];i.push("M".concat(t[4]," ").concat(t[5]));for(let n=6;n<t.length;n+=6)isNaN(t[n])?i.push("L".concat(t[n+4]," ").concat(t[n+5])):i.push("C".concat(t[n]," ").concat(t[n+1]," ").concat(t[n+2]," ").concat(t[n+3]," ").concat(t[n+4]," ").concat(t[n+5]));vt(Qg,this,ef).call(this,i);for(let n=e.length-6;n>=6;n-=6)isNaN(e[n])?i.push("L".concat(e[n+4]," ").concat(e[n+5])):i.push("C".concat(e[n]," ").concat(e[n+1]," ").concat(e[n+2]," ").concat(e[n+3]," ").concat(e[n+4]," ").concat(e[n+5]));return vt(Qg,this,tf).call(this,i),i.join(" ")}newFreeDrawOutline(t,e,i,n,s,r){return new mf(t,e,i,n,s,r)}getOutlines(){var t,e;const i=bt(jg,this),n=bt(Bg,this),s=bt(Hg,this),[r,a,o,l]=bt(Og,this),c=new Float32Array((null!==(t=null===(e=bt(Kg,this))||void 0===e?void 0:e.length)&&void 0!==t?t:0)+2);for(let u=0,p=c.length-2;u<p;u+=2)c[u]=(bt(Kg,this)[u]-r)/o,c[u+1]=(bt(Kg,this)[u+1]-a)/l;if(c[c.length-2]=(bt(Ug,this)-r)/o,c[c.length-1]=(bt(Vg,this)-a)/l,isNaN(s[6])&&!this.isEmpty())return vt(Qg,this,nf).call(this,c);const h=new Float32Array(bt(jg,this).length+24+bt(Bg,this).length);let d=i.length;for(let u=0;u<d;u+=2)isNaN(i[u])?h[u]=h[u+1]=NaN:(h[u]=i[u],h[u+1]=i[u+1]);d=vt(Qg,this,rf).call(this,h,d);for(let u=n.length-6;u>=6;u-=6)for(let t=0;t<6;t+=2)isNaN(n[u+t])?(h[d]=h[d+1]=NaN,d+=2):(h[d]=n[u+t],h[d+1]=n[u+t+1],d+=2);return vt(Qg,this,sf).call(this,h,d),this.newFreeDrawOutline(h,c,bt(Og,this),bt(Xg,this),bt(Wg,this),bt(zg,this))}}function Jg(){const t=bt(Hg,this).subarray(4,6),e=bt(Hg,this).subarray(16,18),[i,n,s,r]=bt(Og,this);return[(bt(Ug,this)+(t[0]-e[0])/2-i)/s,(bt(Vg,this)+(t[1]-e[1])/2-n)/r,(bt(Ug,this)+(e[0]-t[0])/2-i)/s,(bt(Vg,this)+(e[1]-t[1])/2-n)/r]}function $g(){const[t,e,i,n]=bt(Og,this),[s,r,a,o]=vt(Qg,this,Jg).call(this);return"M".concat((bt(Hg,this)[2]-t)/i," ").concat((bt(Hg,this)[3]-e)/n," L").concat((bt(Hg,this)[4]-t)/i," ").concat((bt(Hg,this)[5]-e)/n," L").concat(s," ").concat(r," L").concat(a," ").concat(o," L").concat((bt(Hg,this)[16]-t)/i," ").concat((bt(Hg,this)[17]-e)/n," L").concat((bt(Hg,this)[14]-t)/i," ").concat((bt(Hg,this)[15]-e)/n," Z")}function tf(t){const e=bt(Bg,this);t.push("L".concat(e[4]," ").concat(e[5]," Z"))}function ef(t){const[e,i,n,s]=bt(Og,this),r=bt(Hg,this).subarray(4,6),a=bt(Hg,this).subarray(16,18),[o,l,c,h]=vt(Qg,this,Jg).call(this);t.push("L".concat((r[0]-e)/n," ").concat((r[1]-i)/s," L").concat(o," ").concat(l," L").concat(c," ").concat(h," L").concat((a[0]-e)/n," ").concat((a[1]-i)/s))}function nf(t){const e=bt(Hg,this),[i,n,s,r]=bt(Og,this),[a,o,l,c]=vt(Qg,this,Jg).call(this),h=new Float32Array(36);return h.set([NaN,NaN,NaN,NaN,(e[2]-i)/s,(e[3]-n)/r,NaN,NaN,NaN,NaN,(e[4]-i)/s,(e[5]-n)/r,NaN,NaN,NaN,NaN,a,o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,(e[16]-i)/s,(e[17]-n)/r,NaN,NaN,NaN,NaN,(e[14]-i)/s,(e[15]-n)/r],0),this.newFreeDrawOutline(h,t,bt(Og,this),bt(Xg,this),bt(Wg,this),bt(zg,this))}function sf(t,e){const i=bt(Bg,this);return t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e),e+6}function rf(t,e){const i=bt(Hg,this).subarray(4,6),n=bt(Hg,this).subarray(16,18),[s,r,a,o]=bt(Og,this),[l,c,h,d]=vt(Qg,this,Jg).call(this);return t.set([NaN,NaN,NaN,NaN,(i[0]-s)/a,(i[1]-r)/o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,h,d,NaN,NaN,NaN,NaN,(n[0]-s)/a,(n[1]-r)/o],e),e+24}var af={_:8},of={_:af._+2},lf=new WeakMap,cf=new WeakMap,hf=new WeakMap,df=new WeakMap,uf=new WeakMap,pf=new WeakMap,gf=new WeakMap,ff=new WeakSet;class mf extends Ng{constructor(t,e,i,n,s,r){super(),ft(this,ff),mt(this,lf,void 0),mt(this,cf,new Float32Array(4)),mt(this,hf,void 0),mt(this,df,void 0),mt(this,uf,void 0),mt(this,pf,void 0),mt(this,gf,void 0),yt(gf,this,t),yt(uf,this,e),yt(lf,this,i),yt(pf,this,n),yt(hf,this,s),yt(df,this,r),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],vt(ff,this,vf).call(this,r);const[a,o,l,c]=bt(cf,this);for(let h=0,d=t.length;h<d;h+=2)t[h]=(t[h]-a)/l,t[h+1]=(t[h+1]-o)/c;for(let h=0,d=e.length;h<d;h+=2)e[h]=(e[h]-a)/l,e[h+1]=(e[h+1]-o)/c}toSVGPath(){const t=["M".concat(bt(gf,this)[4]," ").concat(bt(gf,this)[5])];for(let e=6,i=bt(gf,this).length;e<i;e+=6)isNaN(bt(gf,this)[e])?t.push("L".concat(bt(gf,this)[e+4]," ").concat(bt(gf,this)[e+5])):t.push("C".concat(bt(gf,this)[e]," ").concat(bt(gf,this)[e+1]," ").concat(bt(gf,this)[e+2]," ").concat(bt(gf,this)[e+3]," ").concat(bt(gf,this)[e+4]," ").concat(bt(gf,this)[e+5]));return t.push("Z"),t.join(" ")}serialize(t,e){let[i,n,s,r]=t;const a=s-i,o=r-n;let l,c;switch(e){case 0:l=Ng._rescale(bt(gf,this),i,r,a,-o),c=Ng._rescale(bt(uf,this),i,r,a,-o);break;case 90:l=Ng._rescaleAndSwap(bt(gf,this),i,n,a,o),c=Ng._rescaleAndSwap(bt(uf,this),i,n,a,o);break;case 180:l=Ng._rescale(bt(gf,this),s,n,-a,o),c=Ng._rescale(bt(uf,this),s,n,-a,o);break;case 270:l=Ng._rescaleAndSwap(bt(gf,this),s,r,-a,-o),c=Ng._rescaleAndSwap(bt(uf,this),s,r,-a,-o)}return{outline:Array.from(l),points:[Array.from(c)]}}get box(){return bt(cf,this)}newOutliner(t,e,i,n,s){return new Zg(t,e,i,n,s,arguments.length>5&&void 0!==arguments[5]?arguments[5]:0)}getNewOutline(t,e){const[i,n,s,r]=bt(cf,this),[a,o,l,c]=bt(lf,this),h=s*l,d=r*c,u=i*l+a,p=n*c+o,g=this.newOutliner({x:bt(uf,this)[0]*h+u,y:bt(uf,this)[1]*d+p},bt(lf,this),bt(pf,this),t,bt(df,this),null!==e&&void 0!==e?e:bt(hf,this));for(let f=2;f<bt(uf,this).length;f+=2)g.add({x:bt(uf,this)[f]*h+u,y:bt(uf,this)[f+1]*d+p});return g.getOutlines()}}function vf(t){const e=bt(gf,this);let i=e[4],n=e[5];const s=[i,n,i,n];let r=i,a=n,o=i,l=n;const c=t?Math.max:Math.min,h=new Float32Array(4);for(let u=6,p=e.length;u<p;u+=6){const t=e[u+4],d=e[u+5];isNaN(e[u])?(He.pointBoundingBox(t,d,s),a>d?(r=t,a=d):a===d&&(r=c(r,t)),l<d?(o=t,l=d):l===d&&(o=c(o,t))):(h[0]=h[1]=1/0,h[2]=h[3]=-1/0,He.bezierBoundingBox(i,n,...e.slice(u,u+6),h),He.rectBoundingBox(h[0],h[1],h[2],h[3],s),a>h[1]?(r=h[0],a=h[1]):a===h[1]&&(r=c(r,h[0])),l<h[3]?(o=h[2],l=h[3]):l===h[3]&&(o=c(o,h[2]))),i=t,n=d}const d=bt(cf,this);d[0]=s[0]-bt(hf,this),d[1]=s[1]-bt(hf,this),d[2]=s[2]-s[0]+2*bt(hf,this),d[3]=s[3]-s[1]+2*bt(hf,this),this.firstPoint=[r,a],this.lastPoint=[o,l]}var wf=new WeakMap,bf=new WeakMap,yf=new WeakMap,Af=new WeakMap,Ef=new WeakMap,xf=new WeakSet;class _f{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];ft(this,xf),mt(this,wf,void 0),mt(this,bf,void 0),mt(this,yf,void 0),mt(this,Af,[]),mt(this,Ef,[]);const s=[1/0,1/0,-1/0,-1/0],r=10**-4;for(const{x:g,y:f,width:m,height:v}of t){const t=Math.floor((g-e)/r)*r,i=Math.ceil((g+m+e)/r)*r,n=Math.floor((f-e)/r)*r,a=Math.ceil((f+v+e)/r)*r,o=[t,n,a,!0],l=[i,n,a,!1];bt(Af,this).push(o,l),He.rectBoundingBox(t,n,i,a,s)}const a=s[2]-s[0]+2*i,o=s[3]-s[1]+2*i,l=s[0]-i,c=s[1]-i;let h=n?-1/0:1/0,d=1/0;const u=bt(Af,this).at(n?-1:-2),p=[u[0],u[2]];for(const g of bt(Af,this)){const[t,e,i,s]=g;!s&&n?e<d?(d=e,h=t):e===d&&(h=Math.max(h,t)):s&&!n&&(e<d?(d=e,h=t):e===d&&(h=Math.min(h,t))),g[0]=(t-l)/a,g[1]=(e-c)/o,g[2]=(i-c)/o}yt(wf,this,new Float32Array([l,c,a,o])),yt(bf,this,[h,d]),yt(yf,this,p)}getOutlines(){bt(Af,this).sort((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const t=[];for(const e of bt(Af,this))e[3]?(t.push(...vt(xf,this,Tf).call(this,e)),vt(xf,this,Sf).call(this,e)):(vt(xf,this,Mf).call(this,e),t.push(...vt(xf,this,Tf).call(this,e)));return vt(xf,this,kf).call(this,t)}}function kf(t){const e=[],i=new Set;for(const r of t){const[t,i,n]=r;e.push([t,i,r],[t,n,r])}e.sort((t,e)=>t[1]-e[1]||t[0]-e[0]);for(let r=0,a=e.length;r<a;r+=2){const t=e[r][2],n=e[r+1][2];t.push(n),n.push(t),i.add(t),i.add(n)}const n=[];let s;for(;i.size>0;){const t=i.values().next().value;let[e,r,a,o,l]=t;i.delete(t);let c=e,h=r;for(s=[e,a],n.push(s);;){let t;if(i.has(o))t=o;else{if(!i.has(l))break;t=l}i.delete(t),[e,r,a,o,l]=t,c!==e&&(s.push(c,h,e,h===r?r:a),c=e),h=h===r?a:r}s.push(c,h)}return new Rf(n,bt(wf,this),bt(bf,this),bt(yf,this))}function Cf(t){const e=bt(Ef,this);let i=0,n=e.length-1;for(;i<=n;){const s=i+n>>1,r=e[s][0];if(r===t)return s;r<t?i=s+1:n=s-1}return n+1}function Sf(t){let[,e,i]=t;const n=vt(xf,this,Cf).call(this,e);bt(Ef,this).splice(n,0,[e,i])}function Mf(t){let[,e,i]=t;const n=vt(xf,this,Cf).call(this,e);for(let s=n;s<bt(Ef,this).length;s++){const[t,n]=bt(Ef,this)[s];if(t!==e)break;if(t===e&&n===i)return void bt(Ef,this).splice(s,1)}for(let s=n-1;s>=0;s--){const[t,n]=bt(Ef,this)[s];if(t!==e)break;if(t===e&&n===i)return void bt(Ef,this).splice(s,1)}}function Tf(t){const[e,i,n]=t,s=[[e,i,n]],r=vt(xf,this,Cf).call(this,n);for(let a=0;a<r;a++){const[t,i]=bt(Ef,this)[a];for(let n=0,r=s.length;n<r;n++){const[,a,o]=s[n];if(!(i<=a||o<=t))if(a>=t)if(o>i)s[n][1]=i;else{if(1===r)return[];s.splice(n,1),n--,r--}else s[n][2]=t,o>i&&s.push([e,i,o])}}return s}var Pf=new WeakMap,Lf=new WeakMap;class Rf extends Ng{constructor(t,e,i,n){super(),mt(this,Pf,void 0),mt(this,Lf,void 0),yt(Lf,this,t),yt(Pf,this,e),this.firstPoint=i,this.lastPoint=n}toSVGPath(){const t=[];for(const e of bt(Lf,this)){let[i,n]=e;t.push("M".concat(i," ").concat(n));for(let s=2;s<e.length;s+=2){const r=e[s],a=e[s+1];r===i?(t.push("V".concat(a)),n=a):a===n&&(t.push("H".concat(r)),i=r)}t.push("Z")}return t.join(" ")}serialize(t,e){let[i,n,s,r]=t;const a=[],o=s-i,l=r-n;for(const c of bt(Lf,this)){const t=new Array(c.length);for(let e=0;e<c.length;e+=2)t[e]=i+c[e]*o,t[e+1]=r-c[e+1]*l;a.push(t)}return a}get box(){return bt(Pf,this)}get classNamesForOutlining(){return["highlightOutline"]}}class Df extends Zg{newFreeDrawOutline(t,e,i,n,s,r){return new Ff(t,e,i,n,s,r)}}class Ff extends mf{newOutliner(t,e,i,n,s){return new Df(t,e,i,n,s,arguments.length>5&&void 0!==arguments[5]?arguments[5]:0)}}var If=new WeakMap,Nf=new WeakMap,Of=new WeakMap,Bf=new WeakMap,Wf=new WeakMap,zf=new WeakMap,jf=new WeakMap,Hf=new WeakMap,Uf=new WeakMap,Vf=new WeakMap,Gf=new WeakMap,qf=new WeakMap,Xf=new WeakMap,Yf=new WeakMap,Kf=new WeakMap,Qf=new WeakMap,Zf=new WeakMap,Jf=new WeakMap,$f=new WeakSet;class tm extends Jr{static get _keyboardManager(){const t=tm.prototype;return Pe(this,"_keyboardManager",new dn([[["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]}]]))}constructor(t){super((0,pt.A)((0,pt.A)({},t),{},{name:"highlightEditor"})),ft(this,$f),mt(this,If,null),mt(this,Nf,0),mt(this,Of,void 0),mt(this,Bf,null),mt(this,Wf,null),mt(this,zf,null),mt(this,jf,null),mt(this,Hf,0),mt(this,Uf,null),mt(this,Vf,null),mt(this,Gf,null),mt(this,qf,!1),mt(this,Xf,null),mt(this,Yf,null),mt(this,Kf,null),mt(this,Qf,""),mt(this,Zf,void 0),mt(this,Jf,""),this.color=t.color||tm._defaultColor,yt(Zf,this,t.thickness||tm._defaultThickness),this.opacity=t.opacity||tm._defaultOpacity,yt(Of,this,t.boxes||null),yt(Jf,this,t.methodOfCreation||""),yt(Qf,this,t.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(yt(qf,this,!0),vt($f,this,im).call(this,t),vt($f,this,om).call(this)):bt(Of,this)&&(yt(If,this,t.anchorNode),yt(Nf,this,t.anchorOffset),yt(jf,this,t.focusNode),yt(Hf,this,t.focusOffset),vt($f,this,em).call(this),vt($f,this,om).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}get telemetryInitialData(){return{action:"added",type:bt(qf,this)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:bt(Zf,this),methodOfCreation:bt(Jf,this)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,e){var i;Jr.initialize(t,e),tm._defaultColor||(tm._defaultColor=(null===(i=e.highlightColors)||void 0===i?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(t,e){switch(t){case ee.HIGHLIGHT_COLOR:tm._defaultColor=e;break;case ee.HIGHLIGHT_THICKNESS:tm._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return bt(Yf,this)}get commentButtonPosition(){return bt(Xf,this)}updateParams(t,e){switch(t){case ee.HIGHLIGHT_COLOR:vt($f,this,nm).call(this,e);break;case ee.HIGHLIGHT_THICKNESS:vt($f,this,sm).call(this,e)}}static get defaultPropertiesToUpdate(){return[[ee.HIGHLIGHT_COLOR,tm._defaultColor],[ee.HIGHLIGHT_THICKNESS,tm._defaultThickness]]}get propertiesToUpdate(){return[[ee.HIGHLIGHT_COLOR,this.color||tm._defaultColor],[ee.HIGHLIGHT_THICKNESS,bt(Zf,this)||tm._defaultThickness],[ee.HIGHLIGHT_FREE,bt(qf,this)]]}onUpdatedColor(){var t,e;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(bt(Gf,this),{root:{fill:this.color,"fill-opacity":this.opacity}}),null===(e=bt(Wf,this))||void 0===e||e.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){if(this._uiManager.highlightColors){return[["colorPicker",yt(Wf,this,new lu({editor:this}))]]}return super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(vt($f,this,dm).call(this))}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,vt($f,this,dm).call(this))}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){vt($f,this,am).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(vt($f,this,om).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;if(this.parent&&!t)vt($f,this,am).call(this);else if(t){var i;vt($f,this,om).call(this,t),e=!this.parent&&(null===(i=this.div)||void 0===i?void 0:i.classList.contains("selectedEditor"))}super.setParent(t),this.show(this._isVisible),e&&this.select()}rotate(t){const{drawLayer:e}=this.parent;let i;bt(qf,this)?(t=(t-this.rotation+360)%360,i=lm.call(tm,bt(Vf,this).box,t)):i=lm.call(tm,[this.x,this.y,this.width,this.height],t),e.updateProperties(bt(Gf,this),{bbox:i,root:{"data-main-rotation":t}}),e.updateProperties(bt(Kf,this),{bbox:lm.call(tm,bt(zf,this).box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();bt(Qf,this)&&(t.setAttribute("aria-label",bt(Qf,this)),t.setAttribute("role","mark")),bt(qf,this)?t.classList.add("free"):this.div.addEventListener("keydown",vt($f,this,cm).bind(this),{signal:this._uiManager._signal});const e=yt(Uf,this,document.createElement("div"));return t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=bt(Bf,this),this.setDims(this.width,this.height),Ki(this,bt(Uf,this),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){var t;this.isSelected||(null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(bt(Kf,this),{rootClass:{hovered:!0}}))}pointerleave(){var t;this.isSelected||(null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(bt(Kf,this),{rootClass:{hovered:!1}}))}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:vt($f,this,hm).call(this,!0);break;case 1:case 3:vt($f,this,hm).call(this,!1)}}select(){var t;super.select(),bt(Kf,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(bt(Kf,this),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var t;super.unselect(),bt(Kf,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(bt(Kf,this),{rootClass:{selected:!1}}),bt(qf,this)||vt($f,this,hm).call(this,!1))}get _mustFixPosition(){return!bt(qf,this)}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(bt(Gf,this),{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(bt(Kf,this),{rootClass:{hidden:!t}}))}static startHighlighting(t,e,i){let{target:n,x:s,y:r}=i;const{x:a,y:o,width:l,height:c}=n.getBoundingClientRect(),h=new AbortController,d=t.combinedSignal(h),u=e=>{h.abort(),vt(tm,this,fm).call(this,t,e)};window.addEventListener("blur",u,{signal:d}),window.addEventListener("pointerup",u,{signal:d}),window.addEventListener("pointerdown",ci,{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",li,{signal:d}),n.addEventListener("pointermove",vt(tm,this,gm).bind(this,t),{signal:d}),this._freeHighlight=new Df({x:s,y:r},[a,o,l,c],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0))}static async deserialize(t,e,i){let n=null;if(t instanceof eg){const{data:{quadPoints:e,rect:i,rotation:s,id:r,color:a,opacity:o,popupRef:l,richText:c,contentsObj:h,creationDate:d,modificationDate:u},parent:{page:{pageNumber:p}}}=t;n=t={annotationType:te.HIGHLIGHT,color:Array.from(a),opacity:o,quadPoints:e,boxes:null,pageIndex:p-1,rect:i.slice(0),rotation:s,annotationElementId:r,id:r,deleted:!1,popupRef:l,richText:c,comment:(null===h||void 0===h?void 0:h.str)||null,creationDate:d,modificationDate:u}}else if(t instanceof $p){const{data:{inkLists:e,rect:i,rotation:s,id:r,color:a,borderStyle:{rawWidth:o},popupRef:l,richText:c,contentsObj:h,creationDate:d,modificationDate:u},parent:{page:{pageNumber:p}}}=t;n=t={annotationType:te.HIGHLIGHT,color:Array.from(a),thickness:o,inkLists:e,boxes:null,pageIndex:p-1,rect:i.slice(0),rotation:s,annotationElementId:r,id:r,deleted:!1,popupRef:l,richText:c,comment:(null===h||void 0===h?void 0:h.str)||null,creationDate:d,modificationDate:u}}const{color:s,quadPoints:r,inkLists:a,opacity:o}=t,l=await super.deserialize(t,e,i);l.color=He.makeHexColor(...s),l.opacity=o||1,a&&yt(Zf,l,t.thickness),l._initialData=n,t.comment&&l.setCommentData(t);const[c,h]=l.pageDimensions,[d,u]=l.pageTranslation;if(r){const t=yt(Of,l,[]);for(let e=0;e<r.length;e+=8)t.push({x:(r[e]-d)/c,y:1-(r[e+1]-u)/h,width:(r[e+2]-r[e])/c,height:(r[e+1]-r[e+5])/h});vt($f,l,em).call(l),vt($f,l,om).call(l),l.rotate(l.rotation)}else if(a){yt(qf,l,!0);const t=a[0],i={x:t[0]-d,y:h-(t[1]-u)},n=new Df(i,[0,0,c,h],1,bt(Zf,l)/2,!0,.001);for(let e=0,a=t.length;e<a;e+=2)i.x=t[e]-d,i.y=h-(t[e+1]-u),n.add(i);const{id:s,clipPathId:r}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:l.color,"fill-opacity":l._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:n.toSVGPath()}},!0,!0);vt($f,l,im).call(l,{highlightOutlines:n.getOutlines(),highlightId:s,clipPathId:r}),vt($f,l,om).call(l),l.rotate(l.parentRotation)}return l}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const e=Jr._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i=super.serialize(t);return Object.assign(i,{color:e,opacity:this.opacity,thickness:bt(Zf,this),quadPoints:vt($f,this,um).call(this),outlines:vt($f,this,pm).call(this,i.rect)}),this.addComment(i),this.annotationElementId&&!vt($f,this,mm).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}}function em(){const t=new _f(bt(Of,this),.001);yt(Vf,this,t.getOutlines()),[this.x,this.y,this.width,this.height]=bt(Vf,this).box;const e=new _f(bt(Of,this),.0025,.001,"ltr"===this._uiManager.direction);yt(zf,this,e.getOutlines());const{firstPoint:i}=bt(Vf,this);yt(Xf,this,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]);const{lastPoint:n}=bt(zf,this);yt(Yf,this,[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height])}function im(t){let{highlightOutlines:e,highlightId:i,clipPathId:n}=t;yt(Vf,this,e);if(yt(zf,this,e.getNewOutline(bt(Zf,this)/2+1.5,.0025)),i>=0)yt(Gf,this,i),yt(Bf,this,n),this.parent.drawLayer.finalizeDraw(i,{bbox:e.box,path:{d:e.toSVGPath()}}),yt(Kf,this,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:bt(zf,this).box,path:{d:bt(zf,this).toSVGPath()}},!0));else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(bt(Gf,this),{bbox:lm.call(It,bt(Vf,this).box,(t-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(bt(Kf,this),{bbox:lm.call(It,bt(zf,this).box,t),path:{d:bt(zf,this).toSVGPath()}})}const[s,r,a,o]=e.box;switch(this.rotation){case 0:this.x=s,this.y=r,this.width=a,this.height=o;break;case 90:{const[t,e]=this.parentDimensions;this.x=r,this.y=1-s,this.width=a*e/t,this.height=o*t/e;break}case 180:this.x=1-s,this.y=1-r,this.width=a,this.height=o;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-r,this.y=s,this.width=a*e/t,this.height=o*t/e;break}}const{firstPoint:l}=e;yt(Xf,this,[(l[0]-s)/a,(l[1]-r)/o]);const{lastPoint:c}=bt(zf,this);yt(Yf,this,[(c[0]-s)/a,(c[1]-r)/o])}function nm(t){const e=(t,e)=>{this.color=t,this.opacity=e,this.onUpdatedColor()},i=this.color,n=this.opacity;this.addCommands({cmd:e.bind(this,t,It._defaultOpacity),undo:e.bind(this,i,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ee.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)}function sm(t){const e=bt(Zf,this),i=t=>{yt(Zf,this,t),vt($f,this,rm).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:ee.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}function rm(t){bt(qf,this)&&(vt($f,this,im).call(this,{highlightOutlines:bt(Vf,this).getNewOutline(t/2)}),this.fixAndSetPosition(),this.setDims(this.width,this.height))}function am(){null!==bt(Gf,this)&&this.parent&&(this.parent.drawLayer.remove(bt(Gf,this)),yt(Gf,this,null),this.parent.drawLayer.remove(bt(Kf,this)),yt(Kf,this,null))}function om(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null===bt(Gf,this)&&(({id:ut(yt,[Gf,this])._,clipPathId:ut(yt,[Bf,this])._}=t.drawLayer.draw({bbox:bt(Vf,this).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:bt(qf,this)},path:{d:bt(Vf,this).toSVGPath()}},!1,!0)),yt(Kf,this,t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:bt(qf,this)},bbox:bt(zf,this).box,path:{d:bt(zf,this).toSVGPath()}},bt(qf,this))),bt(Uf,this)&&(bt(Uf,this).style.clipPath=bt(Bf,this)))}function lm(t,e){let[i,n,s,r]=t;switch(e){case 90:return[1-n-r,i,r,s];case 180:return[1-i-s,1-n-r,s,r];case 270:return[n,1-i-s,r,s]}return[i,n,s,r]}function cm(t){It._keyboardManager.exec(this,t)}function hm(t){if(!bt(If,this))return;const e=window.getSelection();t?e.setPosition(bt(If,this),bt(Nf,this)):e.setPosition(bt(jf,this),bt(Hf,this))}function dm(){return bt(qf,this)?this.rotation:0}function um(){if(bt(qf,this))return null;const[t,e]=this.pageDimensions,[i,n]=this.pageTranslation,s=bt(Of,this),r=new Float32Array(8*s.length);let a=0;for(const{x:o,y:l,width:c,height:h}of s){const s=o*t+i,d=(1-l)*e+n;r[a]=r[a+4]=s,r[a+1]=r[a+3]=d,r[a+2]=r[a+6]=s+c*t,r[a+5]=r[a+7]=d-h*e,a+=8}return r}function pm(t){return bt(Vf,this).serialize(t,vt($f,this,dm).call(this))}function gm(t,e){this._freeHighlight.add(e)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}function fm(t,e){this._freeHighlight.isEmpty()?t.drawLayer.remove(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=""}function mm(t){const{color:e}=this._initialData;return this.hasEditedComment||t.color.some((t,i)=>t!==e[i])}It=tm,(0,Wt.A)(tm,"_defaultColor",null),(0,Wt.A)(tm,"_defaultOpacity",1),(0,Wt.A)(tm,"_defaultThickness",12),(0,Wt.A)(tm,"_type","highlight"),(0,Wt.A)(tm,"_editorType",te.HIGHLIGHT),(0,Wt.A)(tm,"_freeHighlightId",-1),(0,Wt.A)(tm,"_freeHighlight",null),(0,Wt.A)(tm,"_freeHighlightClipId","");var vm=new WeakMap;class wm{constructor(){mt(this,vm,Object.create(null))}updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(const[e,i]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,i)}updateSVGProperty(t,e){bt(vm,this)[t]=e}toSVGProperties(){const t=bt(vm,this);return yt(vm,this,Object.create(null)),{root:t}}reset(){yt(vm,this,Object.create(null))}updateAll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;this.updateProperties(t)}clone(){Ce("Not implemented")}}var bm=new WeakMap,ym=new WeakMap,Am=new WeakSet;class Em extends Jr{constructor(t){super(t),ft(this,Am),mt(this,bm,null),mt(this,ym,void 0),(0,Wt.A)(this,"_colorPicker",null),(0,Wt.A)(this,"_drawId",null),yt(ym,this,t.mustBeCommitted||!1),this._addOutlines(t)}onUpdatedColor(){var t;null===(t=this._colorPicker)||void 0===t||t.update(this.color),super.onUpdatedColor()}_addOutlines(t){t.drawOutlines&&(vt(Am,this,xm).call(this,t),vt(Am,this,Cm).call(this))}static _mergeSVGProperties(t,e){const i=new Set(Object.keys(t));for(const[n,s]of Object.entries(e))i.has(n)?Object.assign(t[n],s):t[n]=s;return t}static getDefaultDrawingOptions(t){Ce("Not implemented")}static get typesMap(){Ce("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,e){const i=this.typesMap.get(t);i&&this._defaultDrawingOptions.updateProperty(i,e),this._currentParent&&(Lm._.updateProperty(i,e),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,e){const i=this.constructor.typesMap.get(t);i&&this._updateProperty(t,i,e)}static get defaultPropertiesToUpdate(){const t=[],e=this._defaultDrawingOptions;for(const[i,n]of this.typesMap)t.push([i,e[n]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:e}=this;for(const[i,n]of this.constructor.typesMap)t.push([i,e[n]]);return t}_updateProperty(t,e,i){const n=this._drawingOptions,s=n[e],r=i=>{var s;n.updateProperty(e,i);const r=bt(bm,this).updateProperty(e,i);r&&vt(Am,this,Tm).call(this,r),null===(s=this.parent)||void 0===s||s.drawLayer.updateProperties(this._drawId,n.toSVGProperties()),t===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:r.bind(this,i),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,Em._mergeSVGProperties(bt(bm,this).getPathResizingSVGProperties(vt(Am,this,Mm).call(this)),{bbox:vt(Am,this,Pm).call(this)}))}_onResized(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,Em._mergeSVGProperties(bt(bm,this).getPathResizedSVGProperties(vt(Am,this,Mm).call(this)),{bbox:vt(Am,this,Pm).call(this)}))}_onTranslating(t,e){var i;null===(i=this.parent)||void 0===i||i.drawLayer.updateProperties(this._drawId,{bbox:vt(Am,this,Pm).call(this)})}_onTranslated(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,Em._mergeSVGProperties(bt(bm,this).getPathTranslatedSVGProperties(vt(Am,this,Mm).call(this),this.parentDimensions),{bbox:vt(Am,this,Pm).call(this)}))}_onStartDragging(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,bt(ym,this)&&(yt(ym,this,!1),this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){vt(Am,this,km).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(vt(Am,this,Cm).call(this),vt(Am,this,Tm).call(this,bt(bm,this).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;if(this.parent&&!t)this._uiManager.removeShouldRescale(this),vt(Am,this,km).call(this);else if(t){var i;this._uiManager.addShouldRescale(this),vt(Am,this,Cm).call(this,t),e=!this.parent&&(null===(i=this.div)||void 0===i?void 0:i.classList.contains("selectedEditor"))}super.setParent(t),e&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Em._mergeSVGProperties({bbox:vt(Am,this,Pm).call(this)},bt(bm,this).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&vt(Am,this,Tm).call(this,bt(bm,this).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,e;this._isCopy&&(t=this.x,e=this.y);const i=super.render();i.classList.add("draw");const n=document.createElement("div");return i.append(n),n.setAttribute("aria-hidden","true"),n.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,e),i}static createDrawerInstance(t,e,i,n,s){Ce("Not implemented")}static startDrawing(t,e,i,n){var s,r;const{target:a,offsetX:o,offsetY:l,pointerId:c,pointerType:h}=n;if(Im._&&Im._!==h)return;const{viewport:{rotation:d}}=t,{width:u,height:p}=a.getBoundingClientRect(),g=Rm._=new AbortController,f=t.combinedSignal(g);Fm._||(Fm._=c),null!==(s=Im._)&&void 0!==s||(Im._=h),window.addEventListener("pointerup",t=>{var e;Fm._===t.pointerId?this._endDraw(t):null===(e=Nm._)||void 0===e||e.delete(t.pointerId)},{signal:f}),window.addEventListener("pointercancel",t=>{var e;Fm._===t.pointerId?this._currentParent.endDrawingSession():null===(e=Nm._)||void 0===e||e.delete(t.pointerId)},{signal:f}),window.addEventListener("pointerdown",t=>{Im._===t.pointerType&&((Nm._||(Nm._=new Set)).add(t.pointerId),Lm._.isCancellable()&&(Lm._.removeLastElement(),Lm._.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:f}),window.addEventListener("contextmenu",li,{signal:f}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:f}),a.addEventListener("touchmove",t=>{t.timeStamp===Om._&&ci(t)},{signal:f}),t.toggleDrawing(),null===(r=e._editorUndoBar)||void 0===r||r.hide(),Lm._?t.drawLayer.updateProperties(this._currentDrawId,Lm._.startNew(o,l,u,p,d)):(e.updateUIForDefaultProperties(this),Lm._=this.createDrawerInstance(o,l,u,p,d),Dm._=this.getDefaultDrawingOptions(),this._currentParent=t,({id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(Dm._.toSVGProperties(),Lm._.defaultSVGProperties),!0,!1)))}static _drawMove(t){var e;if(Om._=-1,!Lm._)return;const{offsetX:i,offsetY:n,pointerId:s}=t;Fm._===s&&((null===(e=Nm._)||void 0===e?void 0:e.size)>=1?this._endDraw(t):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,Lm._.add(i,n)),Om._=t.timeStamp,ci(t)))}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,Lm._=null,Dm._=null,Im._=null,Om._=NaN),Rm._&&(Rm._.abort(),Rm._=null,Fm._=NaN,Nm._=null)}static _endDraw(t){const e=this._currentParent;if(e){if(e.toggleDrawing(!0),this._cleanup(!1),(null===t||void 0===t?void 0:t.target)===e.div&&e.drawLayer.updateProperties(this._currentDrawId,Lm._.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const t=Lm._,i=this._currentDrawId,n=t.getLastElement();return void e.addCommands({cmd:()=>{e.drawLayer.updateProperties(i,t.setLastElement(n))},undo:()=>{e.drawLayer.updateProperties(i,t.removeLastElement())},mustExec:!1,type:ee.DRAW_STEP})}this.endDrawing(!1)}}static endDrawing(t){const e=this._currentParent;if(!e)return null;if(e.toggleDrawing(!0),e.cleanUndoStack(ee.DRAW_STEP),!Lm._.isEmpty()){const{pageDimensions:[i,n],scale:s}=e,r=e.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:Lm._.getOutlines(i*s,n*s,s,this._INNER_MARGIN),drawingOptions:Dm._,mustBeCommitted:!t});return this._cleanup(!0),r}return e.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,e,i,n,s,r){Ce("Not implemented")}static async deserialize(t,e,i){const{rawDims:{pageWidth:n,pageHeight:s,pageX:r,pageY:a}}=e.viewport,o=this.deserializeDraw(r,a,n,s,this._INNER_MARGIN,t),l=await super.deserialize(t,e,i);return l.createDrawingOptions(t),vt(Am,l,xm).call(l,{drawOutlines:o}),vt(Am,l,Cm).call(l),l.onScaleChanging(),l.rotate(),l}serializeDraw(t){const[e,i]=this.pageTranslation,[n,s]=this.pageDimensions;return bt(bm,this).serialize([e,i,n,s],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}}function xm(t){let{drawOutlines:e,drawId:i,drawingOptions:n}=t;yt(bm,this,e),this._drawingOptions||(this._drawingOptions=n),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-".concat(this.editorType,"-added-alert")),i>=0?(this._drawId=i,this.parent.drawLayer.finalizeDraw(i,e.defaultProperties)):this._drawId=vt(Am,this,_m).call(this,e,this.parent),vt(Am,this,Tm).call(this,e.box)}function _m(t,e){const{id:i}=e.drawLayer.draw(Nt._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return i}function km(){null!==this._drawId&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}function Cm(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null!==this._drawId&&this.parent===t||(null===this._drawId?(this._drawingOptions.updateAll(),this._drawId=vt(Am,this,_m).call(this,bt(bm,this),t)):this.parent.drawLayer.updateParent(this._drawId,t.drawLayer))}function Sm(t){let[e,i,n,s]=t;const{parentDimensions:[r,a],rotation:o}=this;switch(o){case 90:return[i,1-e,n*(a/r),s*(r/a)];case 180:return[1-e,1-i,n,s];case 270:return[1-i,e,n*(a/r),s*(r/a)];default:return[e,i,n,s]}}function Mm(){const{x:t,y:e,width:i,height:n,parentDimensions:[s,r],rotation:a}=this;switch(a){case 90:return[1-e,t,i*(s/r),n*(r/s)];case 180:return[1-t,1-e,i,n];case 270:return[e,1-t,i*(s/r),n*(r/s)];default:return[t,e,i,n]}}function Tm(t){[this.x,this.y,this.width,this.height]=vt(Am,this,Sm).call(this,t),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}function Pm(){const{x:t,y:e,width:i,height:n,rotation:s,parentRotation:r,parentDimensions:[a,o]}=this;switch((4*s+r)/90){case 1:return[1-e-n,t,n,i];case 2:return[1-t-i,1-e-n,i,n];case 3:return[e,1-t-i,n,i];case 4:return[t,e-i*(a/o),n*(o/a),i*(a/o)];case 5:return[1-e,t,i*(a/o),n*(o/a)];case 6:return[1-t-n*(o/a),1-e,n*(o/a),i*(a/o)];case 7:return[e-i*(a/o),1-t-n*(o/a),i*(a/o),n*(o/a)];case 8:return[t-i,e-n,i,n];case 9:return[1-e,t-i,n,i];case 10:return[1-t,1-e,i,n];case 11:return[e-n,1-t,n,i];case 12:return[t-n*(o/a),e,n*(o/a),i*(a/o)];case 13:return[1-e-i*(a/o),t-n*(o/a),i*(a/o),n*(o/a)];case 14:return[1-t,1-e-i*(a/o),n*(o/a),i*(a/o)];case 15:return[e,1-t,i*(a/o),n*(o/a)];default:return[t,e,i,n]}}Nt=Em,(0,Wt.A)(Em,"_currentDrawId",-1),(0,Wt.A)(Em,"_currentParent",null);var Lm={_:null},Rm={_:null},Dm={_:null},Fm={_:NaN},Im={_:null},Nm={_:null},Om={_:NaN};(0,Wt.A)(Em,"_INNER_MARGIN",3);var Bm=new WeakMap,Wm=new WeakMap,zm=new WeakMap,jm=new WeakMap,Hm=new WeakMap,Um=new WeakMap,Vm=new WeakMap,Gm=new WeakMap,qm=new WeakMap,Xm=new WeakMap,Ym=new WeakMap,Km=new WeakSet;class Qm{constructor(t,e,i,n,s,r){ft(this,Km),mt(this,Bm,new Float64Array(6)),mt(this,Wm,void 0),mt(this,zm,void 0),mt(this,jm,void 0),mt(this,Hm,void 0),mt(this,Um,void 0),mt(this,Vm,""),mt(this,Gm,0),mt(this,qm,new lv),mt(this,Xm,void 0),mt(this,Ym,void 0),yt(Xm,this,i),yt(Ym,this,n),yt(jm,this,s),yt(Hm,this,r),[t,e]=vt(Km,this,Zm).call(this,t,e);const a=yt(Wm,this,[NaN,NaN,NaN,NaN,t,e]);yt(Um,this,[t,e]),yt(zm,this,[{line:a,points:bt(Um,this)}]),bt(Bm,this).set(a,0)}updateProperty(t,e){"stroke-width"===t&&yt(Hm,this,e)}isEmpty(){return!bt(zm,this)||0===bt(zm,this).length}isCancellable(){return bt(Um,this).length<=10}add(t,e){[t,e]=vt(Km,this,Zm).call(this,t,e);const[i,n,s,r]=bt(Bm,this).subarray(2,6),a=t-s,o=e-r;return Math.hypot(bt(Xm,this)*a,bt(Ym,this)*o)<=2?null:(bt(Um,this).push(t,e),isNaN(i)?(bt(Bm,this).set([s,r,t,e],2),bt(Wm,this).push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(bt(Bm,this)[0])&&bt(Wm,this).splice(6,6),bt(Bm,this).set([i,n,s,r,t,e],0),bt(Wm,this).push(...Ng.createBezierPoints(i,n,s,r,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){const i=this.add(t,e);return i||(2===bt(Um,this).length?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,i,n,s){yt(Xm,this,i),yt(Ym,this,n),yt(jm,this,s),[t,e]=vt(Km,this,Zm).call(this,t,e);const r=yt(Wm,this,[NaN,NaN,NaN,NaN,t,e]);yt(Um,this,[t,e]);const a=bt(zm,this).at(-1);return a&&(a.line=new Float32Array(a.line),a.points=new Float32Array(a.points)),bt(zm,this).push({line:r,points:bt(Um,this)}),bt(Bm,this).set(r,0),yt(Gm,this,0),this.toSVGPath(),null}getLastElement(){return bt(zm,this).at(-1)}setLastElement(t){return bt(zm,this)?(bt(zm,this).push(t),yt(Wm,this,t.line),yt(Um,this,t.points),yt(Gm,this,0),{path:{d:this.toSVGPath()}}):bt(qm,this).setLastElement(t)}removeLastElement(){if(!bt(zm,this))return bt(qm,this).removeLastElement();bt(zm,this).pop(),yt(Vm,this,"");for(let t=0,e=bt(zm,this).length;t<e;t++){const{line:e,points:i}=bt(zm,this)[t];yt(Wm,this,e),yt(Um,this,i),yt(Gm,this,0),this.toSVGPath()}return{path:{d:bt(Vm,this)}}}toSVGPath(){const t=Ng.svgRound(bt(Wm,this)[4]),e=Ng.svgRound(bt(Wm,this)[5]);if(2===bt(Um,this).length)return yt(Vm,this,"".concat(bt(Vm,this)," M ").concat(t," ").concat(e," Z")),bt(Vm,this);if(bt(Um,this).length<=6){const i=bt(Vm,this).lastIndexOf("M");yt(Vm,this,"".concat(bt(Vm,this).slice(0,i)," M ").concat(t," ").concat(e)),yt(Gm,this,6)}if(4===bt(Um,this).length){const t=Ng.svgRound(bt(Wm,this)[10]),e=Ng.svgRound(bt(Wm,this)[11]);return yt(Vm,this,"".concat(bt(Vm,this)," L ").concat(t," ").concat(e)),yt(Gm,this,12),bt(Vm,this)}const i=[];0===bt(Gm,this)&&(i.push("M ".concat(t," ").concat(e)),yt(Gm,this,6));for(let n=bt(Gm,this),s=bt(Wm,this).length;n<s;n+=6){const[t,e,s,r,a,o]=bt(Wm,this).slice(n,n+6).map(Ng.svgRound);i.push("C".concat(t," ").concat(e," ").concat(s," ").concat(r," ").concat(a," ").concat(o))}return yt(Vm,this,bt(Vm,this)+i.join(" ")),yt(Gm,this,bt(Wm,this).length),bt(Vm,this)}getOutlines(t,e,i,n){const s=bt(zm,this).at(-1);return s.line=new Float32Array(s.line),s.points=new Float32Array(s.points),bt(qm,this).build(bt(zm,this),t,e,i,bt(jm,this),bt(Hm,this),n),yt(Bm,this,null),yt(Wm,this,null),yt(zm,this,null),yt(Vm,this,null),bt(qm,this)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}function Zm(t,e){return Ng._normalizePoint(t,e,bt(Xm,this),bt(Ym,this),bt(jm,this))}var Jm=new WeakMap,$m=new WeakMap,tv=new WeakMap,ev=new WeakMap,iv=new WeakMap,nv=new WeakMap,sv=new WeakMap,rv=new WeakMap,av=new WeakMap,ov=new WeakSet;class lv extends Ng{constructor(){super(...arguments),ft(this,ov),mt(this,Jm,void 0),mt(this,$m,0),mt(this,tv,void 0),mt(this,ev,void 0),mt(this,iv,void 0),mt(this,nv,void 0),mt(this,sv,void 0),mt(this,rv,void 0),mt(this,av,void 0)}build(t,e,i,n,s,r,a){yt(iv,this,e),yt(nv,this,i),yt(sv,this,n),yt(rv,this,s),yt(av,this,r),yt(tv,this,null!==a&&void 0!==a?a:0),yt(ev,this,t),vt(ov,this,dv).call(this)}get thickness(){return bt(av,this)}setLastElement(t){return bt(ev,this).push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return bt(ev,this).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:e}of bt(ev,this))if(t.push("M".concat(Ng.svgRound(e[4])," ").concat(Ng.svgRound(e[5]))),6!==e.length)if(12===e.length&&isNaN(e[6]))t.push("L".concat(Ng.svgRound(e[10])," ").concat(Ng.svgRound(e[11])));else for(let i=6,n=e.length;i<n;i+=6){const[n,s,r,a,o,l]=e.subarray(i,i+6).map(Ng.svgRound);t.push("C".concat(n," ").concat(s," ").concat(r," ").concat(a," ").concat(o," ").concat(l))}else t.push("Z");return t.join("")}serialize(t,e){let[i,n,s,r]=t;const a=[],o=[],[l,c,h,d]=vt(ov,this,hv).call(this);let u,p,g,f,m,v,w,b,y;switch(bt(rv,this)){case 0:y=Ng._rescale,u=i,p=n+r,g=s,f=-r,m=i+l*s,v=n+(1-c-d)*r,w=i+(l+h)*s,b=n+(1-c)*r;break;case 90:y=Ng._rescaleAndSwap,u=i,p=n,g=s,f=r,m=i+c*s,v=n+l*r,w=i+(c+d)*s,b=n+(l+h)*r;break;case 180:y=Ng._rescale,u=i+s,p=n,g=-s,f=r,m=i+(1-l-h)*s,v=n+c*r,w=i+(1-l)*s,b=n+(c+d)*r;break;case 270:y=Ng._rescaleAndSwap,u=i+s,p=n+r,g=-s,f=-r,m=i+(1-c-d)*s,v=n+(1-l-h)*r,w=i+(1-c)*s,b=n+(1-l)*r}for(const{line:A,points:E}of bt(ev,this))a.push(y(A,u,p,g,f,e?new Array(A.length):null)),o.push(y(E,u,p,g,f,e?new Array(E.length):null));return{lines:a,points:o,rect:[m,v,w,b]}}static deserialize(t,e,i,n,s,r){let{paths:{lines:a,points:o},rotation:l,thickness:c}=r;const h=[];let d,u,p,g,f;switch(l){case 0:f=Ng._rescale,d=-t/i,u=e/n+1,p=1/i,g=-1/n;break;case 90:f=Ng._rescaleAndSwap,d=-e/n,u=-t/i,p=1/n,g=1/i;break;case 180:f=Ng._rescale,d=t/i+1,u=-e/n,p=-1/i,g=1/n;break;case 270:f=Ng._rescaleAndSwap,d=e/n+1,u=t/i+1,p=-1/n,g=-1/i}if(!a){a=[];for(const t of o){const e=t.length;if(2===e){a.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1]]));continue}if(4===e){a.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1],NaN,NaN,NaN,NaN,t[2],t[3]]));continue}const i=new Float32Array(3*(e-2));a.push(i);let[n,s,r,o]=t.subarray(0,4);i.set([NaN,NaN,NaN,NaN,n,s],0);for(let a=4;a<e;a+=2){const e=t[a],l=t[a+1];i.set(Ng.createBezierPoints(n,s,r,o,e,l),3*(a-2)),[n,s,r,o]=[r,o,e,l]}}}for(let v=0,w=a.length;v<w;v++)h.push({line:f(a[v].map(t=>null!==t&&void 0!==t?t:NaN),d,u,p,g),points:f(o[v].map(t=>null!==t&&void 0!==t?t:NaN),d,u,p,g)});const m=new this.prototype.constructor;return m.build(h,i,n,1,l,c,s),m}get box(){return bt(Jm,this)}updateProperty(t,e){return"stroke-width"===t?vt(ov,this,uv).call(this,e):null}updateParentDimensions(t,e){let[i,n]=t;const[s,r]=vt(ov,this,cv).call(this);yt(iv,this,i),yt(nv,this,n),yt(sv,this,e);const[a,o]=vt(ov,this,cv).call(this),l=a-s,c=o-r,h=bt(Jm,this);return h[0]-=l,h[1]-=c,h[2]+=2*l,h[3]+=2*c,h}updateRotation(t){return yt($m,this,t),{path:{transform:this.rotationTransform}}}get viewBox(){return bt(Jm,this).map(Ng.svgRound).join(" ")}get defaultProperties(){const[t,e]=bt(Jm,this);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(Ng.svgRound(t)," ").concat(Ng.svgRound(e))}}}get rotationTransform(){const[,,t,e]=bt(Jm,this);let i=0,n=0,s=0,r=0,a=0,o=0;switch(bt($m,this)){case 90:n=e/t,s=-t/e,a=t;break;case 180:i=-1,r=-1,a=t,o=e;break;case 270:n=-e/t,s=t/e,o=e;break;default:return""}return"matrix(".concat(i," ").concat(n," ").concat(s," ").concat(r," ").concat(Ng.svgRound(a)," ").concat(Ng.svgRound(o),")")}getPathResizingSVGProperties(t){let[e,i,n,s]=t;const[r,a]=vt(ov,this,cv).call(this),[o,l,c,h]=bt(Jm,this);if(Math.abs(c-r)<=Ng.PRECISION||Math.abs(h-a)<=Ng.PRECISION){const t=e+n/2-(o+c/2),r=i+s/2-(l+h/2);return{path:{"transform-origin":"".concat(Ng.svgRound(e)," ").concat(Ng.svgRound(i)),transform:"".concat(this.rotationTransform," translate(").concat(t," ").concat(r,")")}}}const d=(n-2*r)/(c-2*r),u=(s-2*a)/(h-2*a),p=c/n,g=h/s;return{path:{"transform-origin":"".concat(Ng.svgRound(o)," ").concat(Ng.svgRound(l)),transform:"".concat(this.rotationTransform," scale(").concat(p," ").concat(g,") ")+"translate(".concat(Ng.svgRound(r)," ").concat(Ng.svgRound(a),") scale(").concat(d," ").concat(u,") ")+"translate(".concat(Ng.svgRound(-r)," ").concat(Ng.svgRound(-a),")")}}}getPathResizedSVGProperties(t){let[e,i,n,s]=t;const[r,a]=vt(ov,this,cv).call(this),o=bt(Jm,this),[l,c,h,d]=o;if(o[0]=e,o[1]=i,o[2]=n,o[3]=s,Math.abs(h-r)<=Ng.PRECISION||Math.abs(d-a)<=Ng.PRECISION){const t=e+n/2-(l+h/2),r=i+s/2-(c+d/2);for(const{line:e,points:i}of bt(ev,this))Ng._translate(e,t,r,e),Ng._translate(i,t,r,i);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(Ng.svgRound(e)," ").concat(Ng.svgRound(i)),transform:this.rotationTransform||null,d:this.toSVGPath()}}}const u=(n-2*r)/(h-2*r),p=(s-2*a)/(d-2*a),g=-u*(l+r)+e+r,f=-p*(c+a)+i+a;if(1!==u||1!==p||0!==g||0!==f)for(const{line:m,points:v}of bt(ev,this))Ng._rescale(m,g,f,u,p,m),Ng._rescale(v,g,f,u,p,v);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(Ng.svgRound(e)," ").concat(Ng.svgRound(i)),transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties(t,e){let[i,n]=t;const[s,r]=e,a=bt(Jm,this),o=i-a[0],l=n-a[1];if(bt(iv,this)===s&&bt(nv,this)===r)for(const{line:c,points:h}of bt(ev,this))Ng._translate(c,o,l,c),Ng._translate(h,o,l,h);else{const t=bt(iv,this)/s,e=bt(nv,this)/r;yt(iv,this,s),yt(nv,this,r);for(const{line:i,points:n}of bt(ev,this))Ng._rescale(i,o,l,t,e,i),Ng._rescale(n,o,l,t,e,n);a[2]*=t,a[3]*=e}return a[0]=i,a[1]=n,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":"".concat(Ng.svgRound(i)," ").concat(Ng.svgRound(n))}}}get defaultSVGProperties(){const t=bt(Jm,this);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":"".concat(Ng.svgRound(t[0])," ").concat(Ng.svgRound(t[1])),transform:this.rotationTransform||null},bbox:t}}}function cv(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bt(av,this);const e=bt(tv,this)+t/2*bt(sv,this);return bt(rv,this)%180===0?[e/bt(iv,this),e/bt(nv,this)]:[e/bt(nv,this),e/bt(iv,this)]}function hv(){const[t,e,i,n]=bt(Jm,this),[s,r]=vt(ov,this,cv).call(this,0);return[t+s,e+r,i-2*s,n-2*r]}function dv(){const t=yt(Jm,this,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:n}of bt(ev,this)){if(n.length<=12){for(let e=4,i=n.length;e<i;e+=6)He.pointBoundingBox(n[e],n[e+1],t);continue}let e=n[4],i=n[5];for(let s=6,r=n.length;s<r;s+=6){const[r,a,o,l,c,h]=n.subarray(s,s+6);He.bezierBoundingBox(e,i,r,a,o,l,c,h,t),e=c,i=h}}const[e,i]=vt(ov,this,cv).call(this);t[0]=Ke(t[0]-e,0,1),t[1]=Ke(t[1]-i,0,1),t[2]=Ke(t[2]+e,0,1),t[3]=Ke(t[3]+i,0,1),t[2]-=t[0],t[3]-=t[1]}function uv(t){const[e,i]=vt(ov,this,cv).call(this);yt(av,this,t);const[n,s]=vt(ov,this,cv).call(this),[r,a]=[n-e,s-i],o=bt(Jm,this);return o[0]-=r,o[1]-=a,o[2]+=2*r,o[3]+=2*a,o}class pv extends wm{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:Jr._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,e){"stroke-width"===t&&(null!==e&&void 0!==e||(e=this["stroke-width"]),e*=this._viewParameters.realScale),super.updateSVGProperty(t,e)}clone(){const t=new pv(this._viewParameters);return t.updateAll(this),t}}var gv=new WeakSet;class fv extends Em{constructor(t){super((0,pt.A)((0,pt.A)({},t),{},{name:"inkEditor"})),ft(this,gv),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,e){Jr.initialize(t,e),this._defaultDrawingOptions=new pv(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!0}static get typesMap(){return Pe(this,"typesMap",new Map([[ee.INK_THICKNESS,"stroke-width"],[ee.INK_COLOR,"stroke"],[ee.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,e,i,n,s){return new Qm(t,e,i,n,s,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,e,i,n,s,r){return lv.deserialize(t,e,i,n,s,r)}static async deserialize(t,e,i){let n=null;if(t instanceof $p){const{data:{inkLists:e,rect:i,rotation:s,id:r,color:a,opacity:o,borderStyle:{rawWidth:l},popupRef:c,richText:h,contentsObj:d,creationDate:u,modificationDate:p},parent:{page:{pageNumber:g}}}=t;n=t={annotationType:te.INK,color:Array.from(a),thickness:l,opacity:o,paths:{points:e},boxes:null,pageIndex:g-1,rect:i.slice(0),rotation:s,annotationElementId:r,id:r,deleted:!1,popupRef:c,richText:h,comment:(null===d||void 0===d?void 0:d.str)||null,creationDate:u,modificationDate:p}}const s=await super.deserialize(t,e,i);return s._initialData=n,t.comment&&s.setCommentData(t),s}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new bu(this)),[["colorPicker",this._colorPicker]]}get colorType(){return ee.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:e,parent:i}=this;e.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(t,e.toSVGProperties())}static onScaleChangingWhenDrawing(){const t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions(t){let{color:e,thickness:i,opacity:n}=t;this._drawingOptions=fv.getDefaultDrawingOptions({stroke:He.makeHexColor(...e),"stroke-width":i,"stroke-opacity":n})}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:e,points:i}=this.serializeDraw(t),{_drawingOptions:{stroke:n,"stroke-opacity":s,"stroke-width":r}}=this,a=Object.assign(super.serialize(t),{color:Jr._colorManager.convert(n),opacity:s,thickness:r,paths:{lines:e,points:i}});return this.addComment(a),t?(a.isCopy=!0,a):this.annotationElementId&&!vt(gv,this,mv).call(this,a)?null:(a.id=this.annotationElementId,a)}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;const{points:e,rect:i}=this.serializeDraw(!1);return t.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:e,popup:this.comment}),null}}function mv(t){const{color:e,thickness:i,opacity:n,pageIndex:s}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||t.color.some((t,i)=>t!==e[i])||t.thickness!==i||t.opacity!==n||t.pageIndex!==s}(0,Wt.A)(fv,"_type","ink"),(0,Wt.A)(fv,"_editorType",te.INK),(0,Wt.A)(fv,"_defaultDrawingOptions",null);class vv extends lv{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}class wv{static extractContoursFromText(t,e,i,n,s,r){let{fontFamily:a,fontStyle:o,fontWeight:l}=e,c=new OffscreenCanvas(1,1),h=c.getContext("2d",{alpha:!1});const d=h.font="".concat(o," ").concat(l," ").concat(200,"px ").concat(a),{actualBoundingBoxLeft:u,actualBoundingBoxRight:p,actualBoundingBoxAscent:g,actualBoundingBoxDescent:f,fontBoundingBoxAscent:m,fontBoundingBoxDescent:v,width:w}=h.measureText(t),b=1.5,y=Math.ceil(Math.max(Math.abs(u)+Math.abs(p)||0,w)*b),A=Math.ceil(Math.max(Math.abs(g)+Math.abs(f)||200,Math.abs(m)+Math.abs(v)||200)*b);c=new OffscreenCanvas(y,A),h=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),h.font=d,h.filter="grayscale(1)",h.fillStyle="white",h.fillRect(0,0,y,A),h.fillStyle="black",h.fillText(t,.5*y/2,1.5*A/2);const E=vt(wv,this,Sv).call(this,h.getImageData(0,0,y,A).data),x=vt(wv,this,Cv).call(this,E),_=vt(wv,this,Mv).call(this,x),k=vt(wv,this,Ev).call(this,E,y,A,_);return this.processDrawnLines({lines:{curves:k,width:y,height:A},pageWidth:i,pageHeight:n,rotation:s,innerMargin:r,mustSmooth:!0,areContours:!0})}static process(t,e,i,n,s){const[r,a,o]=vt(wv,this,Tv).call(this,t),[l,c]=vt(wv,this,kv).call(this,r,a,o,Math.hypot(a,o)*vt(wv,this,Pv)._.sigmaSFactor,vt(wv,this,Pv)._.sigmaR,vt(wv,this,Pv)._.kernelSize),h=vt(wv,this,Mv).call(this,c),d=vt(wv,this,Ev).call(this,l,a,o,h);return this.processDrawnLines({lines:{curves:d,width:a,height:o},pageWidth:e,pageHeight:i,rotation:n,innerMargin:s,mustSmooth:!0,areContours:!0})}static processDrawnLines(t){var e;let{lines:i,pageWidth:n,pageHeight:s,rotation:r,innerMargin:a,mustSmooth:o,areContours:l}=t;r%180!==0&&([n,s]=[s,n]);const{curves:c,width:h,height:d}=i,u=null!==(e=i.thickness)&&void 0!==e?e:0,p=[],g=Math.min(n/h,s/d),f=g/n,m=g/s,v=[];for(const{points:b}of c){const t=o?vt(wv,this,_v).call(this,b):b;if(!t)continue;v.push(t);const e=t.length,i=new Float32Array(e),n=new Float32Array(3*(2===e?2:e-2));if(p.push({line:n,points:i}),2===e){i[0]=t[0]*f,i[1]=t[1]*m,n.set([NaN,NaN,NaN,NaN,i[0],i[1]],0);continue}let[s,r,a,l]=t;s*=f,r*=m,a*=f,l*=m,i.set([s,r,a,l],0),n.set([NaN,NaN,NaN,NaN,s,r],0);for(let o=4;o<e;o+=2){const e=i[o]=t[o]*f,c=i[o+1]=t[o+1]*m;n.set(Ng.createBezierPoints(s,r,a,l,e,c),3*(o-2)),[s,r,a,l]=[a,l,e,c]}}if(0===p.length)return null;const w=l?new vv:new lv;return w.build(p,n,s,1,r,l?0:u,a),{outline:w,newCurves:v,areContours:l,thickness:u,width:h,height:d}}static async compressSignature(t){let e,{outlines:i,areContours:n,thickness:s,width:r,height:a}=t,o=1/0,l=-1/0,c=0;for(const w of i){c+=w.length;for(let t=2,e=w.length;t<e;t++){const e=w[t]-w[t-2];o=Math.min(o,e),l=Math.max(l,e)}}e=o>=-128&&l<=127?Int8Array:o>=-32768&&l<=32767?Int16Array:Int32Array;const h=i.length,d=8+3*h,u=new Uint32Array(d);let p=0;u[p++]=d*Uint32Array.BYTES_PER_ELEMENT+(c-2*h)*e.BYTES_PER_ELEMENT,u[p++]=0,u[p++]=r,u[p++]=a,u[p++]=n?0:1,u[p++]=Math.max(0,Math.floor(null!==s&&void 0!==s?s:0)),u[p++]=h,u[p++]=e.BYTES_PER_ELEMENT;for(const w of i)u[p++]=w.length-2,u[p++]=w[0],u[p++]=w[1];const g=new CompressionStream("deflate-raw"),f=g.writable.getWriter();await f.ready,f.write(u);const m=e.prototype.constructor;for(const w of i){const t=new m(w.length-2);for(let e=2,i=w.length;e<i;e++)t[e-2]=w[e]-w[e-2];f.write(t)}f.close();const v=await new Response(g.readable).arrayBuffer();return Qe(new Uint8Array(v))}static async decompressSignature(t){try{const l=(a=t,Uint8Array.fromBase64?Uint8Array.fromBase64(a):We(atob(a))),{readable:c,writable:h}=new DecompressionStream("deflate-raw"),d=h.getWriter();await d.ready,d.write(l).then(async()=>{await d.ready,await d.close()}).catch(()=>{});let u=null,p=0;var e,i=!1,n=!1;try{for(var s,r=(0,zt.A)(c);i=!(s=await r.next()).done;i=!1){const t=s.value;u||(u=new Uint8Array(new Uint32Array(t.buffer,0,4)[0])),u.set(t,p),p+=t.length}}catch(o){n=!0,e=o}finally{try{i&&null!=r.return&&await r.return()}finally{if(n)throw e}}const g=new Uint32Array(u.buffer,0,u.length>>2),f=g[1];if(0!==f)throw new Error("Invalid version: ".concat(f));const m=g[2],v=g[3],w=0===g[4],b=g[5],y=g[6],A=g[7],E=[],x=(8+3*y)*Uint32Array.BYTES_PER_ELEMENT;let _;switch(A){case Int8Array.BYTES_PER_ELEMENT:_=new Int8Array(u.buffer,x);break;case Int16Array.BYTES_PER_ELEMENT:_=new Int16Array(u.buffer,x);break;case Int32Array.BYTES_PER_ELEMENT:_=new Int32Array(u.buffer,x)}p=0;for(let t=0;t<y;t++){const e=g[3*t+8],i=new Float32Array(e+2);E.push(i);for(let n=0;n<2;n++)i[n]=g[3*t+8+n+1];for(let t=0;t<e;t++)i[t+2]=i[t]+_[p++]}return{areContours:w,thickness:b,outlines:E,width:m,height:v}}catch(l){return ke("decompressSignature: ".concat(l)),null}var a}}function bv(t,e,i,n){return n-=e,0===(i-=t)?n>0?0:4:1===i?n+6:2-n}function yv(t,e,i,n,s,r,a){const o=vt(Ot,this,bv).call(this,i,n,s,r);for(let l=0;l<8;l++){const s=(-l+o-a+16)%8;if(0!==t[(i+vt(Ot,this,Lv)._[2*s])*e+(n+vt(Ot,this,Lv)._[2*s+1])])return s}return-1}function Av(t,e,i,n,s,r,a){const o=vt(Ot,this,bv).call(this,i,n,s,r);for(let l=0;l<8;l++){const s=(l+o+a+16)%8;if(0!==t[(i+vt(Ot,this,Lv)._[2*s])*e+(n+vt(Ot,this,Lv)._[2*s+1])])return s}return-1}function Ev(t,e,i,n){const s=t.length,r=new Int32Array(s);for(let c=0;c<s;c++)r[c]=t[c]<=n?1:0;for(let c=1;c<i-1;c++)r[c*e]=r[c*e+e-1]=0;for(let c=0;c<e;c++)r[c]=r[e*i-1-c]=0;let a,o=1;const l=[];for(let c=1;c<i-1;c++){a=1;for(let t=1;t<e-1;t++){const i=c*e+t,n=r[i];if(0===n)continue;let s=c,h=t;if(1===n&&0===r[i-1])o+=1,h-=1;else{if(!(n>=1&&0===r[i+1])){1!==n&&(a=Math.abs(n));continue}o+=1,h+=1,n>1&&(a=n)}const d=[t,c],u=h===t+1,p={isHole:u,points:d,id:o,parent:0};let g;l.push(p);for(const t of l)if(t.id===a){g=t;break}g?g.isHole?p.parent=u?g.parent:a:p.parent=u?a:g.parent:p.parent=u?a:0;const f=vt(Ot,this,yv).call(this,r,e,c,t,s,h,0);if(-1===f){r[i]=-o,1!==r[i]&&(a=Math.abs(r[i]));continue}let m=vt(Ot,this,Lv)._[2*f],v=vt(Ot,this,Lv)._[2*f+1];const w=c+m,b=t+v;s=w,h=b;let y=c,A=t;for(;;){const n=vt(Ot,this,Av).call(this,r,e,y,A,s,h,1);m=vt(Ot,this,Lv)._[2*n],v=vt(Ot,this,Lv)._[2*n+1];const l=y+m,u=A+v;d.push(u,l);const p=y*e+A;if(0===r[p+1]?r[p]=-o:1===r[p]&&(r[p]=o),l===c&&u===t&&y===w&&A===b){1!==r[i]&&(a=Math.abs(r[i]));break}s=y,h=A,y=l,A=u}}}return l}function xv(t,e,i,n){if(i-e<=4){for(let s=e;s<i-2;s+=2)n.push(t[s],t[s+1]);return}const s=t[e],r=t[e+1],a=t[i-4]-s,o=t[i-3]-r,l=Math.hypot(a,o),c=a/l,h=o/l,d=c*r-h*s,u=o/a,p=1/l,g=Math.atan(u),f=Math.cos(g),m=Math.sin(g),v=p*(Math.abs(f)+Math.abs(m)),w=p*(1-v+v**2),b=Math.max(Math.atan(Math.abs(m+f)*w),Math.atan(Math.abs(m-f)*w));let y=0,A=e;for(let E=e+2;E<i-2;E+=2){const e=Math.abs(d-c*t[E+1]+h*t[E]);e>y&&(A=E,y=e)}y>(l*b)**2?(vt(Ot,this,xv).call(this,t,e,A+2,n),vt(Ot,this,xv).call(this,t,A,i,n)):n.push(s,r)}function _v(t){const e=[],i=t.length;return vt(Ot,this,xv).call(this,t,0,i,e),e.push(t[i-2],t[i-1]),e.length<=4?null:e}function kv(t,e,i,n,s,r){const a=new Float32Array(r**2),o=-2*n**2,l=r>>1;for(let g=0;g<r;g++){const t=(g-l)**2;for(let e=0;e<r;e++)a[g*r+e]=Math.exp((t+(e-l)**2)/o)}const c=new Float32Array(256),h=-2*s**2;for(let g=0;g<256;g++)c[g]=Math.exp(g**2/h);const d=t.length,u=new Uint8Array(d),p=new Uint32Array(256);for(let g=0;g<i;g++)for(let n=0;n<e;n++){const s=g*e+n,o=t[s];let h=0,d=0;for(let u=0;u<r;u++){const s=g+u-l;if(!(s<0||s>=i))for(let i=0;i<r;i++){const p=n+i-l;if(p<0||p>=e)continue;const g=t[s*e+p],f=a[u*r+i]*c[Math.abs(g-o)];h+=g*f,d+=f}}p[u[s]=Math.round(h/d)]++}return[u,p]}function Cv(t){const e=new Uint32Array(256);for(const i of t)e[i]++;return e}function Sv(t){const e=t.length,i=new Uint8ClampedArray(e>>2);let n=-1/0,s=1/0;for(let a=0,o=i.length;a<o;a++){const e=i[a]=t[a<<2];n=Math.max(n,e),s=Math.min(s,e)}const r=255/(n-s);for(let a=0,o=i.length;a<o;a++)i[a]=(i[a]-s)*r;return i}function Mv(t){let e,i=-1/0,n=-1/0;const s=t.findIndex(t=>0!==t);let r=s,a=s;for(e=s;e<256;e++){const s=t[e];s>i&&(e-r>n&&(n=e-r,a=e-1),i=s,r=e)}for(e=a-1;e>=0&&!(t[e]>t[e+1]);e--);return e}function Tv(t){const e=t,{width:i,height:n}=t,{maxDim:s}=vt(Ot,this,Pv)._;let r=i,a=n;if(i>s||n>s){let o=i,l=n,c=Math.log2(Math.max(i,n)/s);const h=Math.floor(c);c=c===h?h-1:h;for(let i=0;i<c;i++){r=Math.ceil(o/2),a=Math.ceil(l/2);const i=new OffscreenCanvas(r,a);i.getContext("2d").drawImage(t,0,0,o,l,0,0,r,a),o=r,l=a,t!==e&&t.close(),t=i.transferToImageBitmap()}const d=Math.min(s/r,s/a);r=Math.round(r*d),a=Math.round(a*d)}const o=new OffscreenCanvas(r,a).getContext("2d",{willReadFrequently:!0});o.fillStyle="white",o.fillRect(0,0,r,a),o.filter="grayscale(1)",o.drawImage(t,0,0,t.width,t.height,0,0,r,a);const l=o.getImageData(0,0,r,a).data;return[vt(Ot,this,Sv).call(this,l),r,a]}Ot=wv;var Pv={_:{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}},Lv={_:new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1])};class Rv extends wm{constructor(){super(),super.updateProperties({fill:Jr._defaultLineColor,"stroke-width":0})}clone(){const t=new Rv;return t.updateAll(this),t}}class Dv extends pv{constructor(t){super(t),super.updateProperties({stroke:Jr._defaultLineColor,"stroke-width":1})}clone(){const t=new Dv(this._viewParameters);return t.updateAll(this),t}}var Fv=new WeakMap,Iv=new WeakMap,Nv=new WeakMap,Ov=new WeakMap;class Bv extends Em{constructor(t){super((0,pt.A)((0,pt.A)({},t),{},{mustBeCommitted:!0,name:"signatureEditor"})),mt(this,Fv,!1),mt(this,Iv,null),mt(this,Nv,null),mt(this,Ov,null),this._willKeepAspectRatio=!0,yt(Nv,this,t.signatureData||null),yt(Iv,this,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,e){Jr.initialize(t,e),this._defaultDrawingOptions=new Rv,this._defaultDrawnSignatureOptions=new Dv(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!1}static get typesMap(){return Pe(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!bt(Iv,this)}}static computeTelemetryFinalData(t){var e,i;const n=t.get("hasDescription");return{hasAltText:null!==(e=n.get(!0))&&void 0!==e?e:0,hasNoAltText:null!==(i=n.get(!1))&&void 0!==i?i:0}}get isResizable(){return!0}onScaleChanging(){null!==this._drawId&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,e;const{_isCopy:i}=this;if(i&&(this._isCopy=!1,t=this.x,e=this.y),super.render(),null===this._drawId)if(bt(Nv,this)){const{lines:t,mustSmooth:e,areContours:i,description:n,uuid:s,heightInPage:r}=bt(Nv,this),{rawDims:{pageWidth:a,pageHeight:o},rotation:l}=this.parent.viewport,c=wv.processDrawnLines({lines:t,pageWidth:a,pageHeight:o,rotation:l,innerMargin:Bv._INNER_MARGIN,mustSmooth:e,areContours:i});this.addSignature(c,r,n,s)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:bt(Iv,this)||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(t,e)),this.div}setUuid(t){yt(Ov,this,t),this.addEditToolbar()}getUuid(){return bt(Ov,this)}get description(){return bt(Iv,this)}set description(t){yt(Iv,this,t),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(e=>{null===e||void 0===e||e.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:e,thickness:i,width:n,height:s}=bt(Nv,this),r=Math.max(n,s);return{areContours:e,outline:wv.processDrawnLines({lines:{curves:t.map(t=>({points:t})),thickness:i,width:n,height:s},pageWidth:r,pageHeight:r,rotation:0,innerMargin:0,mustSmooth:!1,areContours:e}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,e,i,n){const{x:s,y:r}=this,{outline:a}=yt(Nv,this,t);let o;yt(Fv,this,a instanceof vv),this.description=i,bt(Fv,this)?o=Bv.getDefaultDrawingOptions():(o=Bv._defaultDrawnSignatureOptions.clone(),o.updateProperties({"stroke-width":a.thickness})),this._addOutlines({drawOutlines:a,drawingOptions:o});const[,l]=this.pageDimensions;let c=e/l;c=c>=1?.5:c,this.width*=c/this.height,this.width>=1&&(c*=.9/this.width,this.width=.9),this.height=c,this.setDims(),this.x=s,this.y=r,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(n),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!n,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:n}=this.parent.viewport;return wv.process(t,e,i,n,Bv._INNER_MARGIN)}getFromText(t,e){const{rawDims:{pageWidth:i,pageHeight:n},rotation:s}=this.parent.viewport;return wv.extractContoursFromText(t,e,i,n,s,Bv._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:n}=this.parent.viewport;return wv.processDrawnLines({lines:t,pageWidth:e,pageHeight:i,rotation:n,innerMargin:Bv._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions(t){let{areContours:e,thickness:i}=t;e?this._drawingOptions=Bv.getDefaultDrawingOptions():(this._drawingOptions=Bv._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":i}))}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;const{lines:e,points:i}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":n}}=this,s=Object.assign(super.serialize(t),{isSignature:!0,areContours:bt(Fv,this),color:[0,0,0],thickness:bt(Fv,this)?0:n});return this.addComment(s),t?(s.paths={lines:e,points:i},s.uuid=bt(Ov,this),s.isCopy=!0):s.lines=e,bt(Iv,this)&&(s.accessibilityData={type:"Figure",alt:bt(Iv,this)}),s}static deserializeDraw(t,e,i,n,s,r){return r.areContours?vv.deserialize(t,e,i,n,s,r):lv.deserialize(t,e,i,n,s,r)}static async deserialize(t,e,i){var n;const s=await super.deserialize(t,e,i);return yt(Fv,s,t.areContours),s.description=(null===(n=t.accessibilityData)||void 0===n?void 0:n.alt)||"",yt(Ov,s,t.uuid),s}}(0,Wt.A)(Bv,"_type","signature"),(0,Wt.A)(Bv,"_editorType",te.SIGNATURE),(0,Wt.A)(Bv,"_defaultDrawingOptions",null);var Wv=new WeakMap,zv=new WeakMap,jv=new WeakMap,Hv=new WeakMap,Uv=new WeakMap,Vv=new WeakMap,Gv=new WeakMap,qv=new WeakMap,Xv=new WeakMap,Yv=new WeakMap,Kv=new WeakMap,Qv=new WeakSet;class Zv extends Jr{constructor(t){super((0,pt.A)((0,pt.A)({},t),{},{name:"stampEditor"})),ft(this,Qv),mt(this,Wv,null),mt(this,zv,null),mt(this,jv,null),mt(this,Hv,null),mt(this,Uv,null),mt(this,Vv,""),mt(this,Gv,null),mt(this,qv,!1),mt(this,Xv,null),mt(this,Yv,!1),mt(this,Kv,!1),yt(Hv,this,t.bitmapUrl),yt(Uv,this,t.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,e){Jr.initialize(t,e)}static isHandlingMimeForPasting(t){return vi.includes(t)}static paste(t,e){e.pasteEditor({mode:te.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var t;return{type:"stamp",hasAltText:!(null===(t=this.altTextData)||void 0===t||!t.altText)}}static computeTelemetryFinalData(t){var e,i;const n=t.get("hasAltText");return{hasAltText:null!==(e=n.get(!0))&&void 0!==e?e:0,hasNoAltText:null!==(i=n.get(!1))&&void 0!==i?i:0}}async mlGuessAltText(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:n,width:s,height:r}=t||this.copyCanvas(null,null,!0).imageData,a=await i.guess({name:"altText",request:{data:n,width:s,height:r,channels:n.length/(s*r)}});if(!a)throw new Error("No response from the AI service.");if(a.error)throw new Error("Error from the AI service.");if(a.cancel)return null;if(!a.output)throw new Error("No valid response from the AI service.");const o=a.output;return await this.setGuessedAltText(o),e&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1}),o}remove(){var t;bt(zv,this)&&(yt(Wv,this,null),this._uiManager.imageManager.deleteId(bt(zv,this)),null===(t=bt(Gv,this))||void 0===t||t.remove(),yt(Gv,this,null),bt(Xv,this)&&(clearTimeout(bt(Xv,this)),yt(Xv,this,null)));super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(bt(zv,this)&&null===bt(Gv,this)&&vt(Qv,this,tw).call(this),this.isAttachedToDOM||this.parent.add(this))):bt(zv,this)&&vt(Qv,this,tw).call(this)}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(bt(jv,this)||bt(Wv,this)||bt(Hv,this)||bt(Uv,this)||bt(zv,this)||bt(qv,this))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;return this._isCopy&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.createAltText(),bt(qv,this)||(bt(Wv,this)?vt(Qv,this,ew).call(this):vt(Qv,this,tw).call(this)),this._isCopy&&this._moveAfterPaste(t,e),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,e){const{id:i,bitmap:n}=this._uiManager.imageManager.getFromCanvas(t,e);e.remove(),i&&this._uiManager.imageManager.isValidId(i)&&(yt(zv,this,i),n&&yt(Wv,this,n),yt(qv,this,!1),vt(Qv,this,ew).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;null!==bt(Xv,this)&&clearTimeout(bt(Xv,this));yt(Xv,this,setTimeout(()=>{yt(Xv,this,null),vt(Qv,this,nw).call(this)},200))}copyCanvas(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t||(t=224);const{width:n,height:s}=bt(Wv,this),r=new mi;let a=bt(Wv,this),o=n,l=s,c=null;if(e){if(n>e||s>e){const t=Math.min(e/n,e/s);o=Math.floor(n*t),l=Math.floor(s*t)}c=document.createElement("canvas");const t=c.width=Math.ceil(o*r.sx),i=c.height=Math.ceil(l*r.sy);bt(Yv,this)||(a=vt(Qv,this,iw).call(this,t,i));const h=c.getContext("2d");h.filter=this._uiManager.hcmFilter;let d="white",u="#cfcfd8";"none"!==this._uiManager.hcmFilter?u="black":wi.isDarkMode&&(d="#8f8f9d",u="#42414d");const p=15,g=p*r.sx,f=p*r.sy,m=new OffscreenCanvas(2*g,2*f),v=m.getContext("2d");v.fillStyle=d,v.fillRect(0,0,2*g,2*f),v.fillStyle=u,v.fillRect(0,0,g,f),v.fillRect(g,f,g,f),h.fillStyle=h.createPattern(m,"repeat"),h.fillRect(0,0,t,i),h.drawImage(a,0,0,a.width,a.height,0,0,t,i)}let h=null;if(i){let e,i;if(r.symmetric&&a.width<t&&a.height<t)e=a.width,i=a.height;else if(a=bt(Wv,this),n>t||s>t){const r=Math.min(t/n,t/s);e=Math.floor(n*r),i=Math.floor(s*r),bt(Yv,this)||(a=vt(Qv,this,iw).call(this,e,i))}const o=new OffscreenCanvas(e,i).getContext("2d",{willReadFrequently:!0});o.drawImage(a,0,0,a.width,a.height,0,0,e,i),h={width:e,height:i,data:o.getImageData(0,0,e,i).data}}return{canvas:c,width:o,height:l,imageData:h}}static async deserialize(t,e,i){let n=null,s=!1;if(t instanceof rg){var r;const{data:{rect:a,rotation:o,id:l,structParent:c,popupRef:h,richText:d,contentsObj:u,creationDate:p,modificationDate:g},container:f,parent:{page:{pageNumber:m}},canvas:v}=t;let w,b;v?(delete t.canvas,({id:w,bitmap:b}=i.imageManager.getFromCanvas(f.id,v)),v.remove()):(s=!0,t._hasNoCanvas=!0);const y=(null===(r=await e._structTree.getAriaAttributes("".concat(Ye).concat(l)))||void 0===r?void 0:r.get("aria-label"))||"";n=t={annotationType:te.STAMP,bitmapId:w,bitmap:b,pageIndex:m-1,rect:a.slice(0),rotation:o,annotationElementId:l,id:l,deleted:!1,accessibilityData:{decorative:!1,altText:y},isSvg:!1,structParent:c,popupRef:h,richText:d,comment:(null===u||void 0===u?void 0:u.str)||null,creationDate:p,modificationDate:g}}const a=await super.deserialize(t,e,i),{rect:o,bitmap:l,bitmapUrl:c,bitmapId:h,isSvg:d,accessibilityData:u}=t;s?(i.addMissingCanvas(t.id,a),yt(qv,a,!0)):h&&i.imageManager.isValidId(h)?(yt(zv,a,h),l&&yt(Wv,a,l)):yt(Hv,a,c),yt(Yv,a,d);const[p,g]=a.pageDimensions;return a.width=(o[2]-o[0])/p,a.height=(o[3]-o[1])/g,u&&(a.altTextData=u),a._initialData=n,t.comment&&a.setCommentData(t),yt(Kv,a,!!n),a}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=Object.assign(super.serialize(t),{bitmapId:bt(zv,this),isSvg:bt(Yv,this)});if(this.addComment(i),t)return i.bitmapUrl=vt(Qv,this,sw).call(this,!0),i.accessibilityData=this.serializeAltText(!0),i.isCopy=!0,i;const{decorative:n,altText:s}=this.serializeAltText(!1);if(!n&&s&&(i.accessibilityData={type:"Figure",alt:s}),this.annotationElementId){const t=vt(Qv,this,rw).call(this,i);if(t.isSame)return null;var r;if(t.isSameAltText)delete i.accessibilityData;else i.accessibilityData.structParent=null!==(r=this._initialData.structParent)&&void 0!==r?r:-1;return i.id=this.annotationElementId,delete i.bitmapId,i}if(null===e)return i;e.stamps||(e.stamps=new Map);const a=bt(Yv,this)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(bt(zv,this))){if(bt(Yv,this)){const t=e.stamps.get(bt(zv,this));a>t.area&&(t.area=a,t.serialized.bitmap.close(),t.serialized.bitmap=vt(Qv,this,sw).call(this,!1))}}else e.stamps.set(bt(zv,this),{area:a,serialized:i}),i.bitmap=vt(Qv,this,sw).call(this,!1);return i}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}function Jv(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?(yt(Wv,this,t.bitmap),e||(yt(zv,this,t.id),yt(Yv,this,t.isSvg)),t.file&&yt(Vv,this,t.file.name),vt(Qv,this,ew).call(this)):this.remove()}function $v(){if(yt(jv,this,null),this._uiManager.enableWaiting(!1),bt(Gv,this))if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&bt(Wv,this))this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&bt(Wv,this)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch(t){}}this.div.focus()}}function tw(){if(bt(zv,this))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(bt(zv,this)).then(t=>vt(Qv,this,Jv).call(this,t,!0)).finally(()=>vt(Qv,this,$v).call(this));if(bt(Hv,this)){const t=bt(Hv,this);return yt(Hv,this,null),this._uiManager.enableWaiting(!0),void yt(jv,this,this._uiManager.imageManager.getFromUrl(t).then(t=>vt(Qv,this,Jv).call(this,t)).finally(()=>vt(Qv,this,$v).call(this)))}if(bt(Uv,this)){const t=bt(Uv,this);return yt(Uv,this,null),this._uiManager.enableWaiting(!0),void yt(jv,this,this._uiManager.imageManager.getFromFile(t).then(t=>vt(Qv,this,Jv).call(this,t)).finally(()=>vt(Qv,this,$v).call(this)))}const t=document.createElement("input");t.type="file",t.accept=vi.join(",");const e=this._uiManager._signal;yt(jv,this,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]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),vt(Qv,this,Jv).call(this,e)}else this.remove();i()},{signal:e}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:e})}).finally(()=>vt(Qv,this,$v).call(this))),t.click()}function ew(){var t;const{div:e}=this;let{width:i,height:n}=bt(Wv,this);const[s,r]=this.pageDimensions,a=.75;if(this.width)i=this.width*s,n=this.height*r;else if(i>a*s||n>a*r){const t=Math.min(a*s/i,a*r/n);i*=t,n*=t}this._uiManager.enableWaiting(!1);const o=yt(Gv,this,document.createElement("canvas"));o.setAttribute("role","img"),this.addContainer(o),this.width=i/s,this.height=n/r,this.setDims(),null!==(t=this._initialOptions)&&void 0!==t&&t.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(e.hidden=!1),vt(Qv,this,nw).call(this),bt(Kv,this)||(this.parent.addUndoableEditor(this),yt(Kv,this,!0)),this._reportTelemetry({action:"inserted_image"}),bt(Vv,this)&&this.div.setAttribute("aria-description",bt(Vv,this)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}function iw(t,e){const{width:i,height:n}=bt(Wv,this);let s=i,r=n,a=bt(Wv,this);for(;s>2*t||r>2*e;){const i=s,n=r;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),r>2*e&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2));const o=new OffscreenCanvas(s,r);o.getContext("2d").drawImage(a,0,0,i,n,0,0,s,r),a=o.transferToImageBitmap()}return a}function nw(){const[t,e]=this.parentDimensions,{width:i,height:n}=this,s=new mi,r=Math.ceil(i*t*s.sx),a=Math.ceil(n*e*s.sy),o=bt(Gv,this);if(!o||o.width===r&&o.height===a)return;o.width=r,o.height=a;const l=bt(Yv,this)?bt(Wv,this):vt(Qv,this,iw).call(this,r,a),c=o.getContext("2d");c.filter=this._uiManager.hcmFilter,c.drawImage(l,0,0,l.width,l.height,0,0,r,a)}function sw(t){if(t){if(bt(Yv,this)){const t=this._uiManager.imageManager.getSvgUrl(bt(zv,this));if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=bt(Wv,this));return t.getContext("2d").drawImage(bt(Wv,this),0,0),t.toDataURL()}if(bt(Yv,this)){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*ti.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*ti.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,n);return s.getContext("2d").drawImage(bt(Wv,this),0,0,bt(Wv,this).width,bt(Wv,this).height,0,0,i,n),s.transferToImageBitmap()}return structuredClone(bt(Wv,this))}function rw(t){var e;const{pageIndex:i,accessibilityData:{altText:n}}=this._initialData,s=t.pageIndex===i,r=((null===(e=t.accessibilityData)||void 0===e?void 0:e.alt)||"")===n;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&s&&r,isSameAltText:r}}(0,Wt.A)(Zv,"_type","stamp"),(0,Wt.A)(Zv,"_editorType",te.STAMP);var aw=new WeakMap,ow=new WeakMap,lw=new WeakMap,cw=new WeakMap,hw=new WeakMap,dw=new WeakMap,uw=new WeakMap,pw=new WeakMap,gw=new WeakMap,fw=new WeakMap,mw=new WeakMap,vw=new WeakMap,ww=new WeakMap,bw=new WeakMap,yw=new WeakMap,Aw=new WeakMap,Ew=new WeakSet;class xw{constructor(t){let{uiManager:e,pageIndex:i,div:n,structTreeLayer:s,accessibilityManager:r,annotationLayer:a,drawLayer:o,textLayer:l,viewport:c,l10n:h}=t;ft(this,Ew),mt(this,aw,void 0),mt(this,ow,!1),mt(this,lw,null),mt(this,cw,null),mt(this,hw,null),mt(this,dw,new Map),mt(this,uw,!1),mt(this,pw,!1),mt(this,gw,!1),mt(this,fw,null),mt(this,mw,null),mt(this,vw,null),mt(this,ww,null),mt(this,bw,null),mt(this,yw,-1),mt(this,Aw,void 0);const d=[...Pw._.values()];if(!xw._initialized){xw._initialized=!0;for(const t of d)t.initialize(h,e)}e.registerEditorTypes(d),yt(Aw,this,e),this.pageIndex=i,this.div=n,yt(aw,this,r),yt(lw,this,a),this.viewport=c,yt(vw,this,l),this.drawLayer=o,this._structTree=s,bt(Aw,this).addLayer(this)}get isEmpty(){return 0===bt(dw,this).size}get isInvisible(){return this.isEmpty&&bt(Aw,this).getMode()===te.NONE}updateToolbar(t){bt(Aw,this).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bt(Aw,this).getMode();switch(vt(Ew,this,Tw).call(this),t){case te.NONE:return this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case te.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case te.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;if(e.toggle("nonEditing",!1),t===te.POPUP)e.toggle("commentEditing",!0);else{e.toggle("commentEditing",!1);for(const i of Pw._.values())e.toggle("".concat(i._type,"Editing"),t===i._editorType)}this.div.hidden=!1}hasTextLayer(t){var e;return t===(null===(e=bt(vw,this))||void 0===e?void 0:e.div)}setEditingState(t){bt(Aw,this).setEditingState(t)}addCommands(t){bt(Aw,this).addCommands(t)}cleanUndoStack(t){bt(Aw,this).cleanUndoStack(t)}toggleDrawing(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("drawing",!t)}togglePointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(){var t;let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=bt(lw,this))||void 0===t||t.div.classList.toggle("disabled",!e)}async enable(){var t;yt(gw,this,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),null===(t=bt(bw,this))||void 0===t||t.abort(),yt(bw,this,null);const e=new Set;for(const n of wt(Ew,this,_w))n.enableEditing(),n.show(!0),n.annotationElementId&&(bt(Aw,this).removeChangedExistingAnnotation(n),e.add(n.annotationElementId));const i=bt(lw,this);if(i)for(const n of i.getEditableAnnotations()){if(n.hide(),bt(Aw,this).isDeletedAnnotationElement(n.data.id))continue;if(e.has(n.data.id))continue;const t=await this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}yt(gw,this,!1),bt(Aw,this)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(yt(pw,this,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),bt(vw,this)&&!bt(bw,this)){yt(bw,this,new AbortController);const t=bt(Aw,this).combinedSignal(bt(bw,this));bt(vw,this).div.addEventListener("pointerdown",t=>{const{clientX:e,clientY:i,timeStamp:n}=t;if(n-bt(yw,this)>500)return void yt(yw,this,n);yt(yw,this,-1);const{classList:s}=this.div;s.toggle("getElements",!0);const r=document.elementsFromPoint(e,i);if(s.toggle("getElements",!1),!this.div.contains(r[0]))return;let a;const o=new RegExp("^".concat($t,"[0-9]+$"));for(const c of r)if(o.test(c.id)){a=c.id;break}if(!a)return;const l=bt(dw,this).get(a);null===(null===l||void 0===l?void 0:l.annotationElementId)&&(t.stopPropagation(),t.preventDefault(),l.dblclick(t))},{signal:t,capture:!0})}const t=bt(lw,this);if(t){const i=new Map,n=new Map;for(const r of wt(Ew,this,_w)){var e;r.disableEditing(),r.annotationElementId?null===r.serialize()?(n.set(r.annotationElementId,r),null===(e=this.getEditableAnnotation(r.annotationElementId))||void 0===e||e.show(),r.remove()):i.set(r.annotationElementId,r):r.updateFakeAnnotationElement(t)}const s=t.getEditableAnnotations();for(const t of s){const{id:e}=t.data;if(bt(Aw,this).isDeletedAnnotationElement(e)){t.updateEdited({deleted:!0});continue}let s=n.get(e);s?(s.resetAnnotationElement(t),s.show(!1),t.show()):(s=i.get(e),s&&(bt(Aw,this).addChangedExistingAnnotation(s),s.renderAnnotationElement(t)&&s.show(!1)),t.show())}}vt(Ew,this,Tw).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const n of Pw._.values())i.remove("".concat(n._type,"Editing"));this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),yt(pw,this,!1)}getEditableAnnotation(t){var e;return(null===(e=bt(lw,this))||void 0===e?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){bt(Aw,this).getActive()!==t&&bt(Aw,this).setActiveEditor(t)}enableTextSelection(){var t;if(this.div.tabIndex=-1,null!==(t=bt(vw,this))&&void 0!==t&&t.div&&!bt(ww,this)){yt(ww,this,new AbortController);const t=bt(Aw,this).combinedSignal(bt(ww,this));bt(vw,this).div.addEventListener("pointerdown",vt(Ew,this,kw).bind(this),{signal:t}),bt(vw,this).div.classList.add("highlighting")}}disableTextSelection(){var t;this.div.tabIndex=0,null!==(t=bt(vw,this))&&void 0!==t&&t.div&&bt(ww,this)&&(bt(ww,this).abort(),yt(ww,this,null),bt(vw,this).div.classList.remove("highlighting"))}enableClick(){if(bt(cw,this))return;yt(cw,this,new AbortController);const t=bt(Aw,this).combinedSignal(bt(cw,this));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){var t;null===(t=bt(cw,this))||void 0===t||t.abort(),yt(cw,this,null)}attach(t){bt(dw,this).set(t.id,t);const{annotationElementId:e}=t;e&&bt(Aw,this).isDeletedAnnotationElement(e)&&bt(Aw,this).removeDeletedAnnotationElement(t)}detach(t){var e;bt(dw,this).delete(t.id),null===(e=bt(aw,this))||void 0===e||e.removePointerInTextLayer(t.contentDiv),!bt(pw,this)&&t.annotationElementId&&bt(Aw,this).addDeletedAnnotationElement(t)}remove(t){this.detach(t),bt(Aw,this).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(bt(Aw,this).addDeletedAnnotationElement(t.annotationElementId),Jr.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),null===(e=t.parent)||void 0===e||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),bt(Aw,this).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!bt(gw,this)),bt(Aw,this).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var e;if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!bt(hw,this)&&(t._focusEventsAllowed=!1,yt(hw,this,setTimeout(()=>{yt(hw,this,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:bt(Aw,this)._signal}),i.focus())},0))),t._structTreeParentId=null===(e=bt(aw,this))||void 0===e?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})}getEditorByUID(t){for(const e of bt(dw,this).values())if(e.uid===t)return e;return null}getNextId(){return bt(Aw,this).getId()}combinedSignal(t){return bt(Aw,this).combinedSignal(t)}canCreateNewEmptyEditor(){var t;return null===(t=wt(Ew,this,Cw))||void 0===t?void 0:t.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await bt(Aw,this).updateMode(t.mode);const{offsetX:i,offsetY:n}=vt(Ew,this,Mw).call(this),s=this.getNextId(),r=vt(Ew,this,Sw).call(this,(0,pt.A)({parent:this,id:s,x:i,y:n,uiManager:bt(Aw,this),isCentered:!0},e));r&&this.add(r)}async deserialize(t){var e,i;return await(null===(e=Pw._.get(null!==(i=t.annotationType)&&void 0!==i?i:t.annotationEditorType))||void 0===e?void 0:e.deserialize(t,this,bt(Aw,this)))||null}createAndAddNewEditor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.getNextId(),s=vt(Ew,this,Sw).call(this,(0,pt.A)({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:bt(Aw,this),isCentered:e},i));return s&&this.add(s),s}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.createAndAddNewEditor(vt(Ew,this,Mw).call(this),!0,t)}setSelected(t){bt(Aw,this).setSelected(t)}toggleSelected(t){bt(Aw,this).toggleSelected(t)}unselect(t){bt(Aw,this).unselect(t)}pointerup(t){var e;const{isMac:i}=ze.platform;if(0!==t.button||t.ctrlKey&&i)return;if(t.target!==this.div)return;if(!bt(uw,this))return;if(yt(uw,this,!1),null!==(e=wt(Ew,this,Cw))&&void 0!==e&&e.isDrawer&&wt(Ew,this,Cw).supportMultipleDrawings)return;if(!bt(ow,this))return void yt(ow,this,!0);const n=bt(Aw,this).getMode();n!==te.STAMP&&n!==te.SIGNATURE?this.createAndAddNewEditor(t,!1):bt(Aw,this).unselectAll()}pointerdown(t){var e;if(bt(Aw,this).getMode()===te.HIGHLIGHT&&this.enableTextSelection(),bt(uw,this))return void yt(uw,this,!1);const{isMac:i}=ze.platform;if(0!==t.button||t.ctrlKey&&i)return;if(t.target!==this.div)return;if(yt(uw,this,!0),null!==(e=wt(Ew,this,Cw))&&void 0!==e&&e.isDrawer)return void this.startDrawingSession(t);const n=bt(Aw,this).getActive();yt(ow,this,!n||n.isEmpty())}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),bt(fw,this))return void wt(Ew,this,Cw).startDrawing(this,bt(Aw,this),!1,t);bt(Aw,this).setCurrentDrawingSession(this),yt(fw,this,new AbortController);const e=bt(Aw,this).combinedSignal(bt(fw,this));this.div.addEventListener("blur",t=>{let{relatedTarget:e}=t;e&&!this.div.contains(e)&&(yt(mw,this,null),this.commitOrRemove())},{signal:e}),wt(Ew,this,Cw).startDrawing(this,bt(Aw,this),!1,t)}pause(t){if(t){const{activeElement:t}=document;return void(this.div.contains(t)&&yt(mw,this,t))}bt(mw,this)&&setTimeout(()=>{var t;null===(t=bt(mw,this))||void 0===t||t.focus(),yt(mw,this,null)},0)}endDrawingSession(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return bt(fw,this)?(bt(Aw,this).setCurrentDrawingSession(null),bt(fw,this).abort(),yt(fw,this,null),yt(mw,this,null),wt(Ew,this,Cw).endDrawing(t)):null}findNewParent(t,e,i){const n=bt(Aw,this).findParent(e,i);return null!==n&&n!==this&&(n.changeParent(t),!0)}commitOrRemove(){return!!bt(fw,this)&&(this.endDrawingSession(),!0)}onScaleChanging(){bt(fw,this)&&wt(Ew,this,Cw).onScaleChangingWhenDrawing(this)}destroy(){var t;this.commitOrRemove(),(null===(t=bt(Aw,this).getActive())||void 0===t?void 0:t.parent)===this&&(bt(Aw,this).commitOrRemove(),bt(Aw,this).setActiveEditor(null)),bt(hw,this)&&(clearTimeout(bt(hw,this)),yt(hw,this,null));for(const i of bt(dw,this).values()){var e;null===(e=bt(aw,this))||void 0===e||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove()}this.div=null,bt(dw,this).clear(),bt(Aw,this).removeLayer(this)}render(t){let{viewport:e}=t;this.viewport=e,fi(this.div,e);for(const i of bt(Aw,this).getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update(t){let{viewport:e}=t;bt(Aw,this).commitOrRemove(),vt(Ew,this,Tw).call(this);const i=this.viewport.rotation,n=e.rotation;if(this.viewport=e,fi(this.div,{rotation:n}),i!==n)for(const s of bt(dw,this).values())s.rotate(n)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return bt(Aw,this).viewParameters.realScale}}function _w(t){return 0!==bt(dw,t).size?bt(dw,t).values():bt(Aw,t).getEditors(t.pageIndex)}function kw(t){bt(Aw,this).unselectAll();const{target:e}=t;if(e===bt(vw,this).div||("img"===e.getAttribute("role")||e.classList.contains("endOfContent"))&&bt(vw,this).div.contains(e)){const{isMac:e}=ze.platform;if(0!==t.button||t.ctrlKey&&e)return;bt(Aw,this).showAllEditors("highlight",!0,!0),bt(vw,this).div.classList.add("free"),this.toggleDrawing(),tm.startHighlighting(this,"ltr"===bt(Aw,this).direction,{target:bt(vw,this).div,x:t.x,y:t.y}),bt(vw,this).div.addEventListener("pointerup",()=>{bt(vw,this).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:bt(Aw,this)._signal}),t.preventDefault()}}function Cw(t){return Pw._.get(bt(Aw,t).getMode())}function Sw(t){const e=wt(Ew,this,Cw);return e?new e.prototype.constructor(t):null}function Mw(){const{x:t,y:e,width:i,height:n}=this.boundingClientRect,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,c]=this.viewport.rotation%180===0?[a,o]:[o,a];return{offsetX:l,offsetY:c}}function Tw(){for(const t of bt(dw,this).values())t.isEmpty()&&t.remove()}(0,Wt.A)(xw,"_initialized",!1);var Pw={_:new Map([Cg,fv,Zv,tm,Bv].map(t=>[t._editorType,t]))},Lw=new WeakMap,Rw=new WeakMap,Dw=new WeakMap,Fw=new WeakSet;class Iw{constructor(t){let{pageIndex:e}=t;ft(this,Fw),mt(this,Lw,null),mt(this,Rw,new Map),mt(this,Dw,new Map),this.pageIndex=e}setParent(t){if(bt(Lw,this)){if(bt(Lw,this)!==t){if(bt(Rw,this).size>0)for(const e of bt(Rw,this).values())e.remove(),t.append(e);yt(Lw,this,t)}}else yt(Lw,this,t)}static get _svgFactory(){return Pe(this,"_svgFactory",new ku)}draw(t){var e,i;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=(zw._=(e=zw._,i=e++,e),i),a=vt(Fw,this,Ow).call(this),o=Iw._svgFactory.createElement("defs");a.append(o);const l=Iw._svgFactory.createElement("path");o.append(l);const c="path_p".concat(this.pageIndex,"_").concat(r);l.setAttribute("id",c),l.setAttribute("vector-effect","non-scaling-stroke"),n&&bt(Dw,this).set(r,l);const h=s?vt(Fw,this,Bw).call(this,o,c):null,d=Iw._svgFactory.createElement("use");return a.append(d),d.setAttribute("href","#".concat(c)),this.updateProperties(a,t),bt(Rw,this).set(r,a),{id:r,clipPathId:"url(#".concat(h,")")}}drawOutline(t,e){var i,n;const s=(zw._=(i=zw._,n=i++,i),n),r=vt(Fw,this,Ow).call(this),a=Iw._svgFactory.createElement("defs");r.append(a);const o=Iw._svgFactory.createElement("path");a.append(o);const l="path_p".concat(this.pageIndex,"_").concat(s);let c;if(o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),e){const t=Iw._svgFactory.createElement("mask");a.append(t),c="mask_p".concat(this.pageIndex,"_").concat(s),t.setAttribute("id",c),t.setAttribute("maskUnits","objectBoundingBox");const e=Iw._svgFactory.createElement("rect");t.append(e),e.setAttribute("width","1"),e.setAttribute("height","1"),e.setAttribute("fill","white");const i=Iw._svgFactory.createElement("use");t.append(i),i.setAttribute("href","#".concat(l)),i.setAttribute("stroke","none"),i.setAttribute("fill","black"),i.setAttribute("fill-rule","nonzero"),i.classList.add("mask")}const h=Iw._svgFactory.createElement("use");r.append(h),h.setAttribute("href","#".concat(l)),c&&h.setAttribute("mask","url(#".concat(c,")"));const d=h.cloneNode();return r.append(d),h.classList.add("mainOutline"),d.classList.add("secondaryOutline"),this.updateProperties(r,t),bt(Rw,this).set(s,r),s}finalizeDraw(t,e){bt(Dw,this).delete(t),this.updateProperties(t,e)}updateProperties(t,e){if(!e)return;const{root:i,bbox:n,rootClass:s,path:r}=e,a="number"===typeof t?bt(Rw,this).get(t):t;if(a){if(i&&vt(Fw,this,Ww).call(this,a,i),n&&Nw.call(Iw,a,n),s){const{classList:t}=a;for(const[e,i]of Object.entries(s))t.toggle(e,i)}if(r){const t=a.firstChild.firstChild;vt(Fw,this,Ww).call(this,t,r)}}}updateParent(t,e){if(e===this)return;const i=bt(Rw,this).get(t);i&&(bt(Lw,e).append(i),bt(Rw,this).delete(t),bt(Rw,e).set(t,i))}remove(t){bt(Dw,this).delete(t),null!==bt(Lw,this)&&(bt(Rw,this).get(t).remove(),bt(Rw,this).delete(t))}destroy(){yt(Lw,this,null);for(const t of bt(Rw,this).values())t.remove();bt(Rw,this).clear(),bt(Dw,this).clear()}}function Nw(t,e){let[i,n,s,r]=e;const{style:a}=t;a.top="".concat(100*n,"%"),a.left="".concat(100*i,"%"),a.width="".concat(100*s,"%"),a.height="".concat(100*r,"%")}function Ow(){const t=Bt._svgFactory.create(1,1,!0);return bt(Lw,this).append(t),t.setAttribute("aria-hidden",!0),t}function Bw(t,e){const i=Bt._svgFactory.createElement("clipPath");t.append(i);const n="clip_".concat(e);i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=Bt._svgFactory.createElement("use");return i.append(s),s.setAttribute("href","#".concat(e)),s.classList.add("clip"),n}function Ww(t,e){for(const[i,n]of Object.entries(e))null===n?t.removeAttribute(i):t.setAttribute(i,n)}Bt=Iw;var zw={_:0};globalThis._pdfjsTestingUtils={HighlightOutliner:_f},globalThis.pdfjsLib={AbortException:Oe,AnnotationEditorLayer:xw,AnnotationEditorParamsType:ee,AnnotationEditorType:te,AnnotationEditorUIManager:hs,AnnotationLayer:vg,AnnotationMode:Jt,AnnotationType:ce,applyOpacity:function(t,e,i,n){const s=255*(1-(n=Math.min(Math.max(null!==n&&void 0!==n?n:1,0),1)));return[t=Math.round(t*n+s),e=Math.round(e*n+s),i=Math.round(i*n+s)]},build:"f56dc8601",ColorPicker:lu,createValidAbsoluteUrl:Me,CSSConstants:class{static get commentForegroundColor(){const t=document.createElement("span");t.classList.add("comment","sidebar");const{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);const{color:i}=window.getComputedStyle(t);return t.remove(),Pe(this,"commentForegroundColor",ui(i))}},DOMSVGFactory:ku,DrawLayer:Iw,FeatureTest:ze,fetchData:ei,findContrastColor:function(t,e){const i=t[0]+256*t[1]+65536*t[2]+16777216*e[0]+4294967296*e[1]+1099511627776*e[2];let n=xi.get(i);if(n)return n;const s=new Float32Array(9),r=s.subarray(0,3),a=s.subarray(3,6);bi(t,a);const o=s.subarray(6,9);bi(e,o);const l=o[2]<.5,c=l?12:4.5;if(a[2]=l?Math.sqrt(a[2]):1-Math.sqrt(1-a[2]),Ei(a,o,r)<c){let t,e;l?(t=a[2],e=1):(t=0,e=a[2]);const i=.005;for(;e-t>i;){const i=a[2]=(t+e)/2;l===Ei(a,o,r)<c?t=i:e=i}a[2]=l?e:t}return yi(a,r),n=He.makeHexColor(Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])),xi.set(i,n),n},getDocument:hd,getFilenameFromUrl:function(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)},getPdfFilenameFromUrl:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(si(t))return ke('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=(t=>{try{return new URL(t)}catch(e){try{return new URL(decodeURIComponent(t))}catch(i){try{return new URL(t,"https://foo.bar")}catch(n){try{return new URL(decodeURIComponent(t),"https://foo.bar")}catch(s){return null}}}}})(t);if(!i)return e;const n=t=>{try{let e=decodeURIComponent(t);return e.includes("/")?(e=e.split("/").at(-1),e.test(/^\.pdf$/i)?e:t):e}catch(e){return t}},s=/\.pdf$/i,r=i.pathname.split("/").at(-1);if(s.test(r))return n(r);if(i.searchParams.size>0){const t=Array.from(i.searchParams.values()).reverse();for(const i of t)if(s.test(i))return n(i);const e=Array.from(i.searchParams.keys()).reverse();for(const i of e)if(s.test(i))return n(i)}if(i.hash){const t=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(i.hash);if(t)return n(t[0])}return e},getRGB:ui,getUuid:Xe,getXfaPageViewport:function(t,e){let{scale:i=1,rotation:n=0}=e;const{width:s,height:r}=t.attributes.style,a=[0,0,parseInt(s),parseInt(r)];return new ii({viewBox:a,userUnit:1,scale:i,rotation:n})},GlobalWorkerOptions:zc,ImageKind:le,InvalidPDFException:Fe,isDataScheme:si,isPdfFile:ri,isValidExplicitDest:Wa,MathClamp:Ke,noContextMenu:li,normalizeUnicode:function(t){return Ge||(Ge=/([\xA0\xB5\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+)/g,qe=new Map([["\ufb05","\u017ft"]])),t.replaceAll(Ge,(t,e,i)=>e?e.normalize("NFKC"):qe.get(i))},OPS:me,OutputScale:mi,PasswordResponses:{NEED_PASSWORD:1,INCORRECT_PASSWORD:2},PDFDataRangeTransport:wd,PDFDateString:hi,PDFWorker:Td,PermissionFlag:{PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},PixelsPerInch:ti,RenderingCancelledException:ni,renderRichText:_i,ResponseException:Ie,setLayerDimensions:fi,shadow:Pe,SignatureExtractor:wv,stopEvent:ci,SupportedImageMimeTypes:vi,TextLayer:Zh,TouchManager:Ar,updateUrlHash:Te,Util:He,VerbosityLevel:fe,version:"5.4.296",XfaLayer:Je};var jw=i(53986),Hw=i(89261);function Uw(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=Uw(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}const Vw=function(){for(var t,e,i=0,n="",s=arguments.length;i<s;i++)(t=arguments[i])&&(e=Uw(t))&&(n&&(n+=" "),n+=e);return n};var Gw=Object.prototype.hasOwnProperty;function qw(t,e,i){for(i of t.keys())if(Xw(i,e))return i}function Xw(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--&&Xw(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=qw(e,s)))return!1;if(!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=qw(e,s)))return!1;if(!Xw(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(Gw.call(t,i)&&++n&&!Gw.call(e,i))return!1;if(!(i in e)||!Xw(t[i],e[i]))return!1}return Object.keys(e).length===n}}return t!==t&&e!==e}function Yw(t){let e=!1;return{promise:new Promise((i,n)=>{t.then(t=>!e&&i(t)).catch(t=>!e&&n(t))}),cancel(){e=!0}}}const Kw=["onCopy","onCut","onPaste","onCompositionEnd","onCompositionStart","onCompositionUpdate","onFocus","onBlur","onInput","onInvalid","onReset","onSubmit","onLoad","onError","onKeyDown","onKeyPress","onKeyUp","onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting","onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionEnd","onChange","onToggle"];function Qw(t,e){const i={};for(const n of Kw){const s=t[n];s&&(i[n]=e?t=>s(t,e(n)):s)}return i}var Zw="Invariant failed";function Jw(t,e){if(!t)throw new Error(Zw)}var $w=i(98677);const tb=(0,s.createContext)(null);class eb{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}setHash(){}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return Jw(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(t){Jw(this.pdfViewer),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}addLinkAttributes(t,e,i){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=i?"_blank":this.externalLinkTarget||""}goToDestination(t){return new Promise(e=>{Jw(this.pdfDocument),Jw(t),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)}).then(t=>{Jw(Array.isArray(t),'"'.concat(t,'" is not a valid destination array.'));const e=t[0];new Promise(t=>{Jw(this.pdfDocument),e instanceof Object?this.pdfDocument.getPageIndex(e).then(e=>{t(e)}).catch(()=>{Jw(!1,'"'.concat(e,'" is not a valid page reference.'))}):"number"===typeof e?t(e):Jw(!1,'"'.concat(e,'" is not a valid destination reference.'))}).then(e=>{const i=e+1;Jw(this.pdfViewer),Jw(i>=1&&i<=this.pagesCount,'"'.concat(i,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:i})})})}goToPage(t){const e=t-1;Jw(this.pdfViewer),Jw(t>=1&&t<=this.pagesCount,'"'.concat(t,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}goToXY(){}cachePageRef(){}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}executeNamedAction(){}executeSetOCGState(){}isPageVisible(){return!0}isPageCached(){return!0}navigateTo(t){this.goToDestination(t)}}function ib(t){let{children:e,type:i}=t;return(0,Hw.jsx)("div",{className:"react-pdf__message react-pdf__message--".concat(i),children:e})}const nb={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};function sb(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 rb(){return(0,s.useReducer)(sb,{value:void 0,error:void 0})}const ab="undefined"!==typeof window,ob=ab&&"file:"===window.location.protocol;function lb(t){return function(t){return"undefined"!==typeof t}(t)&&null!==t}function cb(t){return function(t){return"string"===typeof t}(t)&&/^data:/.test(t)}function hb(t){Jw(cb(t));const[e="",i=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(i):unescape(i)}function db(){return ab&&window.devicePixelRatio||1}const ub="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function pb(){$w(!ob,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ".concat(ub))}function gb(t){(null===t||void 0===t?void 0:t.cancel)&&t.cancel()}function fb(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}const mb=["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate","scale"],vb=["url"],{Tm:wb}=n,bb=(t,e)=>{switch(e){case nb.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case nb.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function yb(t){return"object"===typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const Ab=(0,s.forwardRef)(function(t,e){let{children:i,className:n,error:r="Failed to load PDF file.",externalLinkRel:a,externalLinkTarget:o,file:l,inputRef:c,imageResourcesPath:h,loading:d="Loading PDF\u2026",noData:u="No PDF file specified.",onItemClick:p,onLoadError:g,onLoadProgress:f,onLoadSuccess:m,onPassword:v=bb,onSourceError:w,onSourceSuccess:b,options:y,renderMode:A,rotate:E,scale:x}=t,_=(0,jw.A)(t,mb);const[k,C]=rb(),{value:S,error:M}=k,[T,P]=rb(),{value:L,error:R}=T,D=(0,s.useRef)(new eb),F=(0,s.useRef)([]),I=(0,s.useRef)(void 0),N=(0,s.useRef)(void 0);l&&l!==I.current&&yb(l)&&($w(!Xw(l,I.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.'),I.current=l),y&&y!==N.current&&($w(!Xw(y,N.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.'),N.current=y);const O=(0,s.useRef)({scrollPageIntoView:t=>{const{dest:e,pageNumber:i,pageIndex:n=i-1}=t;if(p)return void p({dest:e,pageIndex:n,pageNumber:i});const s=F.current[n];s?s.scrollIntoView():$w(!1,"An internal link leading to page ".concat(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>."))}});(0,s.useImperativeHandle)(e,()=>({linkService:D,pages:F,viewer:O}),[]),(0,s.useEffect)(function(){C({type:"RESET"})},[l,C]);const B=(0,s.useCallback)(async()=>{if(!l)return null;if("string"===typeof l){if(cb(l)){return{data:hb(l)}}return pb(),{url:l}}if(l instanceof wb)return{range:l};if(l instanceof ArrayBuffer)return{data:l};if(ab&&function(t){return Jw(ab),t instanceof Blob}(l)){const t=await function(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)})}(l);return{data:t}}if(Jw("object"===typeof l),Jw(yb(l)),"url"in l&&"string"===typeof l.url){if(cb(l.url)){const{url:t}=l,e=(0,jw.A)(l,vb),i=hb(t);return(0,pt.A)({data:i},e)}pb()}return l},[l]);(0,s.useEffect)(()=>{const t=Yw(B());return t.promise.then(t=>{C({type:"RESOLVE",value:t})}).catch(t=>{C({type:"REJECT",error:t})}),()=>{gb(t)}},[B,C]),(0,s.useEffect)(()=>{"undefined"!==typeof S&&(!1!==S?b&&b():M&&($w(!1,M.toString()),w&&w(M)))},[S]),(0,s.useEffect)(function(){P({type:"RESET"})},[P,S]),(0,s.useEffect)(function(){if(!S)return;const t=hd(y?(0,pt.A)((0,pt.A)({},S),y):S);f&&(t.onProgress=f),v&&(t.onPassword=v);const e=t,i=e.promise.then(t=>{P({type:"RESOLVE",value:t})}).catch(t=>{e.destroyed||P({type:"REJECT",error:t})});return()=>{i.finally(()=>e.destroy())}},[y,P,S]),(0,s.useEffect)(()=>{"undefined"!==typeof L&&(!1!==L?L&&(m&&m(L),F.current=new Array(L.numPages),D.current.setDocument(L)):R&&($w(!1,R.toString()),g&&g(R)))},[L]),(0,s.useEffect)(function(){D.current.setViewer(O.current),D.current.setExternalLinkRel(a),D.current.setExternalLinkTarget(o)},[a,o]);const W=(0,s.useCallback)((t,e)=>{F.current[t]=e},[]),z=(0,s.useCallback)(t=>{delete F.current[t]},[]),j=(0,s.useMemo)(()=>({imageResourcesPath:h,linkService:D.current,onItemClick:p,pdf:L,registerPage:W,renderMode:A,rotate:E,scale:x,unregisterPage:z}),[h,p,L,W,A,E,x,z]),H=(0,s.useMemo)(()=>Qw(_,()=>L),[_,L]);return(0,Hw.jsx)("div",(0,pt.A)((0,pt.A)({className:Vw("react-pdf__Document",n),ref:c},H),{},{children:l?void 0===L||null===L?(0,Hw.jsx)(ib,{type:"loading",children:"function"===typeof d?d():d}):!1===L?(0,Hw.jsx)(ib,{type:"error",children:"function"===typeof r?r():r}):function(){if(t=j,!Boolean(null===t||void 0===t?void 0:t.pdf))throw new Error("pdf is undefined");var t;const e="function"===typeof i?i(j):i;return(0,Hw.jsx)(tb.Provider,{value:j,children:e})}():(0,Hw.jsx)(ib,{type:"no-data",children:"function"===typeof u?u():u})}))});function Eb(){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){for(var e=0,n=i;e<n.length;e++){var s=n[e];"function"===typeof s?s(t):s&&(s.current=t)}}}function xb(){return(0,s.useContext)(tb)}const _b=(0,s.createContext)(null);function kb(){return(0,s.useContext)(_b)}function Cb(){const t=xb(),e=kb();Jw(e);const i=(0,pt.A)((0,pt.A)({},t),e),{imageResourcesPath:n,linkService:r,onGetAnnotationsError:a,onGetAnnotationsSuccess:o,onRenderAnnotationLayerError:l,onRenderAnnotationLayerSuccess:c,page:h,pdf:d,renderForms:u,rotate:p,scale:g=1}=i;Jw(d),Jw(h),Jw(r);const[f,m]=rb(),{value:v,error:w}=f,b=(0,s.useRef)(null);$w(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"),(0,s.useEffect)(function(){m({type:"RESET"})},[m,h]),(0,s.useEffect)(function(){if(!h)return;const t=Yw(h.getAnnotations()),e=t;return t.promise.then(t=>{m({type:"RESOLVE",value:t})}).catch(t=>{m({type:"REJECT",error:t})}),()=>{gb(e)}},[m,h]),(0,s.useEffect)(()=>{void 0!==v&&(!1!==v?v&&o&&o(v):w&&($w(!1,w.toString()),a&&a(w)))},[v]);const y=(0,s.useMemo)(()=>h.getViewport({scale:g,rotation:p}),[h,p,g]);return(0,s.useEffect)(function(){if(!d||!h||!r||!v)return;const{current:t}=b;if(!t)return;const e=y.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,annotationStorage:d.annotationStorage,commentManager:null,div:t,l10n:null,linkService:r,page:h,structTreeLayer:null,viewport:e},s={annotations:v,annotationStorage:d.annotationStorage,div:t,imageResourcesPath:n,linkService:r,page:h,renderForms:u,viewport:e};t.innerHTML="";try{new vg(i).render(s),c&&c()}catch(a){!function(t){$w(!1,"".concat(t)),l&&l(t)}(a)}return()=>{}},[v,n,r,h,d,u,y]),(0,Hw.jsx)("div",{className:Vw("react-pdf__Page__annotations","annotationLayer"),ref:b})}const Sb={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},Mb=/^H(\d+)$/;function Tb(t){return"children"in t}function Pb(t){return!!Tb(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function Lb(t){const e={};if(Tb(t)){const{role:i}=t,n=i.match(Mb);if(n)e.role="heading",e["aria-level"]=Number(n[1]);else if(function(t){return t in Sb}(i)){const t=Sb[i];t&&(e.role=t)}}return e}function Rb(t){const e={};if(Tb(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),Pb(t)){const[i]=t.children;if(i){const t=Rb(i);return(0,pt.A)((0,pt.A)({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function Db(t){return t?(0,pt.A)((0,pt.A)({},Lb(t)),Rb(t)):null}function Fb(t){let{className:e,node:i}=t;const n=(0,s.useMemo)(()=>Db(i),[i]),r=(0,s.useMemo)(()=>Tb(i)?Pb(i)?null:i.children.map((t,e)=>(0,Hw.jsx)(Fb,{node:t},e)):null,[i]);return(0,Hw.jsx)("span",(0,pt.A)((0,pt.A)({className:e},n),{},{children:r}))}function Ib(){const t=kb();Jw(t);const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[n,r]=rb(),{value:a,error:o}=n,{customTextRenderer:l,page:c}=t;return(0,s.useEffect)(function(){r({type:"RESET"})},[r,c]),(0,s.useEffect)(function(){if(l)return;if(!c)return;const t=Yw(c.getStructTree()),e=t;return t.promise.then(t=>{r({type:"RESOLVE",value:t})}).catch(t=>{r({type:"REJECT",error:t})}),()=>gb(e)},[l,c,r]),(0,s.useEffect)(()=>{void 0!==a&&(!1!==a?a&&i&&i(a):o&&($w(!1,o.toString()),e&&e(o)))},[a]),a?(0,Hw.jsx)(Fb,{className:"react-pdf__Page__structTree structTree",node:a}):null}const Nb=Jt;function Ob(t){const e=kb();Jw(e);const i=(0,pt.A)((0,pt.A)({},e),t),{_className:n,canvasBackground:r,devicePixelRatio:a=db(),onRenderError:o,onRenderSuccess:l,page:c,renderForms:h,renderTextLayer:d,rotate:u,scale:p}=i,{canvasRef:g}=t;Jw(c);const f=(0,s.useRef)(null);function m(t){(function(t){return"RenderingCancelledException"===t.name})(t)||($w(!1,t.toString()),o&&o(t))}const v=(0,s.useMemo)(()=>c.getViewport({scale:p*a,rotation:u}),[a,c,u,p]),w=(0,s.useMemo)(()=>c.getViewport({scale:p,rotation:u}),[c,u,p]);(0,s.useEffect)(function(){if(!c)return;c.cleanup();const{current:t}=f;if(!t)return;t.width=v.width,t.height=v.height,t.style.width="".concat(Math.floor(w.width),"px"),t.style.height="".concat(Math.floor(w.height),"px"),t.style.visibility="hidden";const e={annotationMode:h?Nb.ENABLE_FORMS:Nb.ENABLE,canvas:t,canvasContext:t.getContext("2d",{alpha:!1}),viewport:v};r&&(e.background=r);const i=c.render(e),n=i;return i.promise.then(()=>{t.style.visibility="",c&&l&&l(fb(c,p))}).catch(m),()=>gb(n)},[r,c,h,v,w]);const b=(0,s.useCallback)(()=>{const{current:t}=f;t&&(t.width=0,t.height=0)},[]);return(0,s.useEffect)(()=>b,[b]),(0,Hw.jsx)("canvas",{className:"".concat(n,"__canvas"),dir:"ltr",ref:Eb(g,f),style:{display:"block",userSelect:"none"},children:d?(0,Hw.jsx)(Ib,{}):null})}function Bb(){const t=kb();Jw(t);const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:n,onRenderTextLayerError:r,onRenderTextLayerSuccess:a,page:o,pageIndex:l,pageNumber:c,rotate:h,scale:d}=t;Jw(o);const[u,p]=rb(),{value:g,error:f}=u,m=(0,s.useRef)(null);$w(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"),(0,s.useEffect)(function(){p({type:"RESET"})},[o,p]),(0,s.useEffect)(function(){if(!o)return;const t=Yw(o.getTextContent()),e=t;return t.promise.then(t=>{p({type:"RESOLVE",value:t})}).catch(t=>{p({type:"REJECT",error:t})}),()=>gb(e)},[o,p]),(0,s.useEffect)(()=>{void 0!==g&&(!1!==g?g&&n&&n(g):f&&($w(!1,f.toString()),i&&i(f)))},[g]);const v=(0,s.useCallback)(()=>{a&&a()},[a]),w=(0,s.useCallback)(t=>{$w(!1,t.toString()),r&&r(t)},[r]);const b=(0,s.useMemo)(()=>o.getViewport({scale:d,rotation:h}),[o,h,d]);return(0,s.useLayoutEffect)(function(){if(!o||!g)return;const{current:t}=m;if(!t)return;t.innerHTML="";const i=o.streamTextContent({includeMarkedContent:!0}),n=new Zh({container:t,textContentSource:i,viewport:b}),s=n;return n.render().then(()=>{const i=document.createElement("div");i.className="endOfContent",t.append(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((0,pt.A)({pageIndex:l,pageNumber:c,itemIndex:s},i));r.innerHTML=a,t+=i.str&&i.hasEOL?2:1})}v()}).catch(w),()=>gb(s)},[e,w,v,o,l,c,g,b]),(0,Hw.jsx)("div",{className:Vw("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=m.current;t&&t.classList.remove("selecting")},onMouseDown:function(){const t=m.current;t&&t.classList.add("selecting")},ref:m})}const Wb=["_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"],zb=1;function jb(t){const e=xb(),i=(0,pt.A)((0,pt.A)({},e),t),{_className:n="react-pdf__Page",_enableRegisterUnregisterPage:r=!0,canvasBackground:a,canvasRef:o,children:l,className:c,customRenderer:h,customTextRenderer:d,devicePixelRatio:u,error:p="Failed to load the page.",height:g,inputRef:f,loading:m="Loading page\u2026",noData:v="No page specified.",onGetAnnotationsError:w,onGetAnnotationsSuccess:b,onGetStructTreeError:y,onGetStructTreeSuccess:A,onGetTextError:E,onGetTextSuccess:x,onLoadError:_,onLoadSuccess:k,onRenderAnnotationLayerError:C,onRenderAnnotationLayerSuccess:S,onRenderError:M,onRenderSuccess:T,onRenderTextLayerError:P,onRenderTextLayerSuccess:L,pageIndex:R,pageNumber:D,pdf:F,registerPage:I,renderAnnotationLayer:N=!0,renderForms:O=!1,renderMode:B="canvas",renderTextLayer:W=!0,rotate:z,scale:j=zb,unregisterPage:H,width:U}=i,V=(0,jw.A)(i,Wb),[G,q]=rb(),{value:X,error:Y}=G,K=(0,s.useRef)(null);Jw(F);const Q=lb(D)?D-1:null!==R&&void 0!==R?R:null,Z=null!==D&&void 0!==D?D:lb(R)?R+1:null,J=null!==z&&void 0!==z?z:X?X.rotate:null,$=(0,s.useMemo)(()=>{if(!X)return null;let t=1;const e=null!==j&&void 0!==j?j:zb;if(U||g){const e=X.getViewport({scale:1,rotation:J});U?t=U/e.width:g&&(t=g/e.height)}return e*t},[g,X,J,j,U]);(0,s.useEffect)(function(){return()=>{lb(Q)&&r&&H&&H(Q)}},[r,F,Q,H]),(0,s.useEffect)(function(){q({type:"RESET"})},[q,F,Q]),(0,s.useEffect)(function(){if(!F||!Z)return;const t=Yw(F.getPage(Z)),e=t;return t.promise.then(t=>{q({type:"RESOLVE",value:t})}).catch(t=>{q({type:"REJECT",error:t})}),()=>gb(e)},[q,F,Z]),(0,s.useEffect)(()=>{void 0!==X&&(!1!==X?function(){if(k){if(!X||!$)return;k(fb(X,$))}if(r&&I){if(!lb(Q)||!K.current)return;I(Q,K.current)}}():Y&&($w(!1,Y.toString()),_&&_(Y)))},[X,$]);const tt=(0,s.useMemo)(()=>lb(Q)&&Z&&lb(J)&&lb($)?{_className:n,canvasBackground:a,customTextRenderer:d,devicePixelRatio:u,onGetAnnotationsError:w,onGetAnnotationsSuccess:b,onGetStructTreeError:y,onGetStructTreeSuccess:A,onGetTextError:E,onGetTextSuccess:x,onRenderAnnotationLayerError:C,onRenderAnnotationLayerSuccess:S,onRenderError:M,onRenderSuccess:T,onRenderTextLayerError:P,onRenderTextLayerSuccess:L,page:X,pageIndex:Q,pageNumber:Z,renderForms:O,renderTextLayer:W,rotate:J,scale:$}:null,[n,a,d,u,w,b,y,A,E,x,C,S,M,T,P,L,X,Q,Z,O,W,J,$]),et=(0,s.useMemo)(()=>Qw(V,()=>X?$?fb(X,$):void 0:X),[V,X,$]),it="".concat(Q,"@").concat($,"/").concat(J);function nt(){switch(B){case"custom":return Jw(h),(0,Hw.jsx)(h,{},"".concat(it,"_custom"));case"none":return null;default:return(0,Hw.jsx)(Ob,{canvasRef:o},"".concat(it,"_canvas"))}}return(0,Hw.jsx)("div",(0,pt.A)((0,pt.A)({className:Vw(n,c),"data-page-number":Z,ref:Eb(f,K),style:{"--scale-round-x":"1px","--scale-round-y":"1px","--scale-factor":"1","--user-unit":"".concat($),"--total-scale-factor":"calc(var(--scale-factor) * var(--user-unit))",backgroundColor:a||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},et),{},{children:Z?null===F||void 0===X||null===X?(0,Hw.jsx)(ib,{type:"loading",children:"function"===typeof m?m():m}):!1===F||!1===X?(0,Hw.jsx)(ib,{type:"error",children:"function"===typeof p?p():p}):function(){if(t=tt,!Boolean(null===t||void 0===t?void 0:t.page))throw new Error("page is undefined");var t;const e="function"===typeof l?l(tt):l;return(0,Hw.jsxs)(_b.Provider,{value:tt,children:[nt(),W?(0,Hw.jsx)(Bb,{},"".concat(it,"_text")):null,N?(0,Hw.jsx)(Cb,{},"".concat(it,"_annotations")):null,e]})}():(0,Hw.jsx)(ib,{type:"no-data",children:"function"===typeof v?v():v})}))}var Hb=i(50805),Ub=i(15747),Vb=i(67346);const Gb=function(t,e){e=Object.assign({},{defaultValue:"defaultValue",value:"value",onChange:"onChange"},e);var i=(0,s.useRef)(e.value in t),n=(0,s.useState)(t[e.defaultValue]),r=(0,Vb.A)(n,2),a=r[0],o=r[1],l=i.current?t[e.value]:a;return[l,(0,x.A)(function(n){for(var s="function"===typeof n?l=n(l):n,r=arguments.length,a=new Array(r>1?r-1:0),c=1;c<r;c++)a[c-1]=arguments[c];t[e.onChange]&&t[e.onChange].apply(t,[s].concat(a)),i.current||o(s)})]};var qb;const Xb=["title","titleId"];function Yb(){return Yb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},Yb.apply(null,arguments)}function Kb(t,e){let{title:i,titleId:n}=t,r=function(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,Xb);return s.createElement("svg",Yb({t:1731465967110,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1541,xmlnsXlink:"http://www.w3.org/1999/xlink",width:200,height:200,ref:e,"aria-labelledby":n},r),i?s.createElement("title",{id:n},i):null,qb||(qb=s.createElement("path",{d:"M112 166h-7q-21 3-35 18.5T56 222v562q3 20 18.5 34.5T112 833h388l56-167-119-179-103 123-72-71-5-5q-17-13-38-11.5T183 539l-71 71V222h259l18-56H112z m388 0l-18 56h407v379L654 327l-4-5q-18-16-41.5-14.5T570 328l-72 85 169 253-55 167h277l7-1q21-2 35-18t14-37V215q-3-21-18.5-35T889 166H500zM306 277q-34 0-58.5 24.5t-24.5 59q0 34.5 24.5 59T306 444q23 0 42.5-12t30.5-31l-45-68 14-44q-19-12-42-12z",fill:"#E0E0E0","p-id":1542})))}const Qb=s.forwardRef(Kb);i.p;var Zb,Jb;const $b=["title","titleId"];function ty(){return ty=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},ty.apply(null,arguments)}function ey(t,e){let{title:i,titleId:n}=t,r=function(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,$b);return s.createElement("svg",ty({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u7f16\u7ec4 10"):i?s.createElement("title",{id:n},i):null,Zb||(Zb=s.createElement("defs",null,s.createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"linearGradient-1"},s.createElement("stop",{stopColor:"#F5F5F5",offset:"0%"}),s.createElement("stop",{stopColor:"#E0E0E0",offset:"100%"})))),Jb||(Jb=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807Icon",transform:"translate(-760.000000, -2364.000000)"},s.createElement("g",{id:"\\u7F16\\u7EC4-10",transform:"translate(760.000000, 2364.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u65E0\\u6027\\u522B",fill:"url(#linearGradient-1)"},s.createElement("rect",{id:"Mask\\u5907\\u4EFD",x:0,y:0,width:56,height:56})),s.createElement("g",{id:"\\u5934\\u50CF_avatar-(1)\\u5907\\u4EFD",transform:"translate(8.000000, 12.000000)",fill:"#FFFFFF",fillRule:"nonzero"},s.createElement("path",{d:"M40,41.3851428 C40,40.9828571 40,35.6022857 39,33.792 C38.4,32.5851428 37.4,31.7805714 36.2,30.976 C34.8,30.1714285 33,29.3668572 30.8,28.9645714 C30.6,28.9645714 29.2,28.7634285 28,28.3611428 C26.6,27.9588571 26,27.7577143 25.8,27.5565714 L25.8,26.3497143 C26,23.7348571 27.4,22.3268572 28.6,21.12 C29,20.7177143 29.4,20.3154285 29.8,19.712 C31.2,17.7005714 31.4,15.6891429 31.4,15.2868571 C31.4,14.8845714 31.4,14.6834286 31.2,14.2811429 C31,13.8788572 30.8,13.4765714 30.6,13.2754286 C30.6,12.672 30.8,12.0685714 30.8,11.6662857 C30.8,10.6605715 31,9.05142856 30.6,7.44228572 C30.6,7.24114285 30.6,6.83885715 30.4,6.43657145 C30,5.22971431 29.6,4.22400004 28.8,3.4194286 C28.4,3.4194286 25.6,0.603428618 18,0 L15,0 C14.6,0 14.2,0 13.8,0.201142873 C12.4,0.603428571 12.2,1.60914289 12,2.01142859 L12,3.21828573 L11.8,3.4194286 C11.6,3.62057147 9.60000004,5.43085719 9.40000002,7.84457142 C9.20000001,9.45371426 9.20000001,11.8674285 9.40000002,13.6777143 C9.20000001,14.08 8.80000002,14.4822858 8.80000002,15.488 C8.80000002,15.8902857 9,17.9017143 10.4,19.712 C10.8,20.1142857 11,20.5165715 11.6,21.12 C12.8,22.528 14.2,23.936 14.4,26.3497143 L14.4,27.5565714 C14,27.7577143 13.4,28.16 12,28.5622857 C10.6,28.9645714 9.20000001,29.1657143 9,29.1657143 C7,29.568 5.19999998,30.1714285 3.80000001,30.976 C2.60000001,31.7805714 1.60000003,32.7862857 1,33.792 C0,35.6022857 0,40.9828571 0,41.3851428 L0,42.3908571 C0,43.1954286 0.800000015,44 1.8,44 L38.2,44 C39.2,44 40,43.1954286 40,42.1897143 L40,41.3851428 Z",id:"\\u8DEF\\u5F84"})))))))}const iy=s.forwardRef(ey);i.p;var ny;const sy=["title","titleId"];function ry(){return ry=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},ry.apply(null,arguments)}function ay(t,e){let{title:i,titleId:n}=t,r=function(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,sy);return s.createElement("svg",ry({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u5934\u50cf-\u5973"):i?s.createElement("title",{id:n},i):null,ny||(ny=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-792.000000, -230.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u5973",transform:"translate(792.000000, 230.000000)"},s.createElement("rect",{id:"Mask\\u5907\\u4EFD",fill:"#F1F1F1",x:0,y:0,width:56,height:56}),s.createElement("g",{id:"\\u5973",transform:"translate(9.000000, 13.000000)",fillRule:"nonzero"},s.createElement("path",{d:"M19.1219936,0 C26.9032378,0 28.9014356,5.58612362 28.7427755,11.9244473 C28.5841154,18.262771 25.3419303,30.1526079 25.3419303,30.1526079 L19.1334908,30.1526079 L19.1219936,0 Z",id:"\\u8DEF\\u5F84",fill:"#370B00"}),s.createElement("path",{d:"M18.5011497,0 C10.7291032,0 8.7217078,5.58612362 8.88726615,11.9244473 C9.05282451,18.262771 12.2881114,30.1526079 12.2881114,30.1526079 L18.4965509,30.1526079 L18.5011497,0 Z",id:"\\u8DEF\\u5F84",fill:"#420E04"}),s.createElement("path",{d:"M14.2564166,26.7815518 C11.9891865,29.1996673 7.8778199,30.5010196 3.9780001,31.1309294 C0.0781803048,31.7608392 0,35.9948487 0,37.2177506 L0,43 L18.5011497,43 L18.5011497,26.7815518 L14.2564166,26.7815518 Z",id:"\\u8DEF\\u5F84",fill:"#EAE9E8"}),s.createElement("path",{d:"M18.5011497,21.5807577 L14.1736374,21.5807577 L14.1736374,27.196877 C14.1736374,28.0298347 15.5532906,30.6740717 18.5011497,30.6740717 L18.5011497,21.5807577 Z",id:"\\u8DEF\\u5F84",fill:"#EAC1A4"}),s.createElement("path",{d:"M18.5011497,3.92251556 C12.1202536,3.92251556 11.1751911,8.53723974 11.1751911,14.2502683 C11.1751911,20.0948165 16.693804,24.5872505 18.5011497,24.5872505 L18.5011497,3.92251556 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("path",{d:"M11.0372258,13.419618 C10.5888385,11.7352436 9.97489279,11.7352436 9.71505809,12.1621056 C9.45522339,12.5889676 10.351998,14.2387315 10.3749922,15.6000751 C10.3979864,16.9614187 10.7980859,17.1552372 11.294761,16.663769 C11.7914362,16.1723009 11.0372258,13.419618 11.0372258,13.419618 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#DDDCDB",points:"14.247219 27.1368856 11.4603194 28.8327967 15.6199739 36.09868 18.5011497 30.6740717"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#F4F2F2",points:"14.247219 26.7815518 11.4603194 28.8327967 15.6199739 35.7433462 18.5011497 30.6740717"}),s.createElement("path",{d:"M22.7642782,26.7815518 C25.0338077,29.1996673 29.1451744,30.5010196 33.0426947,31.1309294 C36.940215,31.7608392 37,35.9948487 37,37.2177506 L37,43 L18.5011497,43 L18.5011497,26.7815518 L22.7642782,26.7815518 Z",id:"\\u8DEF\\u5F84",fill:"#DDDCDB"}),s.createElement("path",{d:"M18.5011497,21.5807577 L22.8263626,21.5807577 L22.8263626,27.196877 C22.8263626,28.0298347 21.4467094,30.6740717 18.5011497,30.6740717 L18.5011497,21.5807577 Z",id:"\\u8DEF\\u5F84",fill:"#DDB597"}),s.createElement("path",{d:"M18.5011497,3.92251556 C24.8797464,3.92251556 25.8248089,8.53723974 25.8248089,14.2502683 C25.8248089,20.0948165 20.306196,24.5872505 18.5011497,24.5872505 L18.5011497,3.92251556 Z",id:"\\u8DEF\\u5F84",fill:"#EDC19C"}),s.createElement("path",{d:"M25.9673731,13.419618 C26.4272575,11.7352436 27.0320055,11.7352436 27.2918402,12.1621056 C27.5516748,12.5889676 26.6526008,14.2387315 26.6296066,15.6000751 C26.6066124,16.9614187 26.206513,17.1552372 25.7098378,16.663769 C25.2131626,16.1723009 25.967373,13.4196179 25.9673731,13.419618 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#DDDCDB",points:"22.752781 27.1368856 25.5396806 28.8327967 21.3800261 36.09868 18.5011497 30.6740717"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#EFEEED",points:"22.752781 26.7815518 25.5396806 28.8327967 21.3800261 35.7433462 18.5011497 30.6740717"}),s.createElement("path",{d:"M9.10801068,29.8549582 C7.43626653,30.4331409 5.71634854,30.860165 3.96880244,31.1309294 C0.0712820906,31.7608392 0,35.9948487 0,37.2177506 L0,43 L16.3373936,43 L9.10801068,29.848036 L9.10801068,29.8549582 Z",id:"\\u8DEF\\u5F84",fill:"#1D1D1D"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#303030",points:"9.10801068 29.8549582 7.32595862 30.4110324 7.10061524 34.8896222 10.4393761 36.7216678 10.4393761 42.9976927 16.3373936 42.9976927 9.10801068 29.8549582"}),s.createElement("path",{d:"M27.8942887,29.8549582 C29.5652485,30.433138 31.2844029,30.8601635 33.0311976,31.1309294 C36.940215,31.7608392 37,35.9902339 37,37.2177506 L37,43 L20.6741036,43 L27.9034864,29.848036 L27.8942887,29.8549582 Z",id:"\\u8DEF\\u5F84",fill:"#1D1D1D"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#303030",points:"27.8942887 29.8549582 29.6763408 30.4110324 29.8993848 34.8896222 26.5629234 36.7216678 26.5629234 42.9976927 20.6626064 42.9976927"}),s.createElement("path",{d:"M10.8072836,5.07619661 C9.67366851,9.80398152 11.1062085,14.2871861 11.267168,14.7163554 C11.267168,14.7163554 12.1248524,14.8524898 13.3366478,12.6581885 C14.9140514,9.79936683 16.8041763,8.32265508 18.4459636,7.55661088 L18.4459636,0 C14.334597,0 11.6005842,1.79974245 10.8072836,5.07619661 Z",id:"\\u8DEF\\u5F84",fill:"#471207"}),s.createElement("path",{d:"M25.6224598,14.7140481 C25.7742216,14.2871861 27.2067616,9.80398157 26.0823442,5.07388927 C25.2936424,1.80204979 22.5573302,0 18.4459636,0 L18.4459636,7.55661088 C19.5462153,7.03397245 20.7468113,6.75837793 21.9640793,6.74903414 C24.4014667,8.41494958 25.6155615,11.7513952 25.6224598,14.7140481 Z",id:"\\u8DEF\\u5F84",fill:"#370B00"})))))))}const oy=s.forwardRef(ay);i.p;var ly;const cy=["title","titleId"];function hy(){return hy=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},hy.apply(null,arguments)}function dy(t,e){let{title:i,titleId:n}=t,r=function(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,cy);return s.createElement("svg",hy({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u5934\u50cf-\u7537"):i?s.createElement("title",{id:n},i):null,ly||(ly=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-792.000000, -166.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u7537",transform:"translate(792.000000, 166.000000)"},s.createElement("rect",{id:"Mask",fill:"#F1F1F1",x:0,y:0,width:56,height:56}),s.createElement("g",{id:"Group-46",transform:"translate(7.671233, 12.041096)"},s.createElement("path",{d:"M20.3287113,17.7016171 L14.8261307,17.7016171 L14.8261307,21.8854179 L14.8261307,24.6737429 C14.8261307,25.7091313 16.5713146,28.9930418 20.3287113,28.9930418 L20.3287113,17.7016171 Z",id:"Fill-2",fill:"#DDB597"}),s.createElement("path",{d:"M18.1163052,33.9077874 C18.1163052,33.9077874 16.9107652,32.9969521 15.601989,31.3099039 C14.2932128,29.6230745 12.4333964,25.9116559 12.4333964,25.9116559 C11.796773,26.003812 11.1961258,26.0999083 10.6276562,26.2001637 L19.059062,43.7260274 L20.3287336,43.7260274 L20.3287336,29.2137349 L18.1163052,33.9077874 Z",id:"Fill-4",fill:"#EFEEED"}),s.createElement("path",{d:"M12.4334858,31.7147341 L8.64391162,30.0953254 L10.2679829,26.2654829 C4.85701892,27.2599373 2.57978853,28.6396525 1.7219446,30.5000682 C0.757736068,32.592078 0,43.7258961 0,43.7258961 L18.0757257,43.7258961 L10.3430638,38.5075824 L12.4334858,31.7147341 Z",id:"Fill-6",fill:"#1D1D1D"}),s.createElement("path",{d:"M20.3287113,17.7016171 L25.8312918,17.7016171 L25.8312918,21.8854179 L25.8312918,24.6737429 C25.8312918,25.7091313 24.0861079,28.9930418 20.3287113,28.9930418 L20.3287113,17.7016171 Z",id:"Fill-8",fill:"#D1AC93"}),s.createElement("path",{d:"M22.5412291,33.9077874 C22.5412291,33.9077874 23.7467691,32.9969521 25.0553218,31.3099039 C26.364098,29.6230745 28.2241379,25.9116559 28.2241379,25.9116559 C28.8607613,26.003812 29.4614085,26.0999083 30.0296546,26.2001637 L21.5984722,43.7260274 L20.3288006,43.7260274 L20.3288006,29.2137349 L22.5412291,33.9077874 Z",id:"Fill-10",fill:"#DDDCDB"}),s.createElement("path",{d:"M28.2240485,31.7147341 L32.0133992,30.0953254 L30.3895513,26.2654829 C35.8005153,27.2599373 38.0777457,28.6396525 38.9353662,30.5000682 C39.8997982,32.592078 40.6575342,43.7258961 40.6575342,43.7258961 L22.5815851,43.7258961 L30.314247,38.5075824 L28.2240485,31.7147341 Z",id:"Fill-12",fill:"#0F0F0F"}),s.createElement("path",{d:"M20.3287113,3.71115593 C14.1291744,3.71115593 13.2107742,8.10203448 13.2107742,13.5180132 C13.2107742,19.5112264 15.9664218,23.3250894 20.3287113,23.3250894 L20.3287113,3.71115593 Z",id:"Fill-14",fill:"#EBCFB7"}),s.createElement("path",{d:"M20.3287113,3.71115593 C26.5282481,3.71115593 27.4466484,8.10203448 27.4466484,13.5180132 C27.4466484,19.5112264 24.6910007,23.3250894 20.3287113,23.3250894 L20.3287113,3.71115593 Z",id:"Fill-16",fill:"#EFC7A6"}),s.createElement("path",{d:"M13.0715617,12.7308772 C12.6353774,11.1337961 12.0383055,11.1337961 11.7858013,11.5387578 C11.5330737,11.9435005 12.4056656,13.5180351 12.4286815,14.8001217 C12.4516974,16.0824272 12.8398388,16.2752765 13.3231721,15.80771 C13.8062819,15.3399246 13.0715617,12.7308772 13.0715617,12.7308772",id:"Fill-18",fill:"#EBCFB7"}),s.createElement("path",{d:"M27.5859726,12.7308772 C28.0221568,11.1337961 28.6192287,11.1337961 28.8717329,11.5387578 C29.1242371,11.9435005 28.2516452,13.5180351 28.2288528,14.8001217 C28.2058369,16.0824272 27.817472,16.2752765 27.3343622,15.80771 C26.8510289,15.3399246 27.5859726,12.7308772 27.5859726,12.7308772",id:"Fill-20",fill:"#EBCFB7"}),s.createElement("path",{d:"M12.3795884,25.9199302 C11.7632994,26.0094596 11.1796348,26.1029291 10.6277008,26.2001199 C10.5054709,26.2217908 10.3870398,26.2436806 10.2679382,26.2655705 L8.64386693,30.0951941 L12.4334411,31.7148217 L10.3430191,38.50767 L18.075681,43.7259836 L19.0591067,43.7259836 L12.3795884,25.9199302 Z",id:"Fill-22",fill:"#3A3939"}),s.createElement("path",{d:"M32.0133992,30.0952379 L30.3895513,26.2656142 C30.2834102,26.2459134 30.1768221,26.2264315 30.0686699,26.2071684 L30.0686699,26.2069495 C30.0628601,26.205855 30.0566033,26.2051983 30.0510169,26.2041039 C30.0438664,26.2027905 29.1706041,26.0423381 28.2939899,25.9223819 L21.6763687,43.5636049 L21.6765921,43.5633861 L21.5986063,43.7260274 L22.5815851,43.7260274 L30.314247,38.5077137 L28.2240485,31.7146466 L32.0133992,30.0952379 Z",id:"Fill-24",fill:"#2D2D2D"}),s.createElement("path",{d:"M20.3287113,6.64640537 L20.3287113,0 C16.3335585,0 13.6766779,1.70762469 12.9146962,4.81335203 C11.8139567,9.29901349 13.0521211,13.3967874 13.2000483,13.8032813 C13.8612518,13.932869 14.0167765,11.6642083 14.0167765,9.24144327 C14.0167765,3.89113401 16.7697427,6.64640537 20.3287113,6.64640537",id:"Fill-26",fill:"#370B00"}),s.createElement("path",{d:"M20.3287113,6.64640537 L20.3287113,0 C24.3238641,0 26.9807446,1.70762469 27.7427263,4.81335203 C28.8434659,9.29901349 27.605078,13.3967874 27.4573742,13.8032813 C26.7961707,13.932869 26.640646,11.6642083 26.640646,9.24144327 C26.640646,3.89113401 23.8876798,6.64640537 20.3287113,6.64640537",id:"Fill-28",fill:"#230600"}),s.createElement("polygon",{id:"Fill-30",fill:"#2A798C",points:"20.3287113 33.2162443 18.6501169 33.2162443 19.425506 43.7259836 20.3287113 43.7259836"}),s.createElement("polygon",{id:"Fill-32",fill:"#266C77",points:"21.23214 43.7259179 22.0073056 33.2161786 20.3287113 33.2161786 20.3287113 43.7259179"}),s.createElement("polygon",{id:"Fill-34",fill:"#3691AD",points:"18.2760532 31.4385503 19.1256293 33.2162224 20.3287113 33.2162224 20.3287113 28.9930199"}),s.createElement("polygon",{id:"Fill-36",fill:"#266C77",points:"22.3812799 31.4385503 20.3286219 28.9930199 20.3286219 33.2162224 21.5317039 33.2162224"}),s.createElement("path",{d:"M23.9005061,25.9844833 L25.8313812,24.1571213 C26.8119019,24.7194707 28.2241379,25.9115902 28.2241379,25.9115902 C28.2241379,25.9115902 26.4673343,29.8497873 25.1587815,31.6071019 C23.8497818,33.3639787 22.4846949,34.4026505 22.4846949,34.4026505 L20.3288006,29.2136692 L20.4320369,29.1004989 L23.9005061,25.9844833 Z",id:"Fill-38",fill:"#CCCCCC"}),s.createElement("path",{d:"M23.7972922,25.9115902 L25.8314035,24.1571213 C26.8119243,24.6969242 28.2241602,25.9115902 28.2241602,25.9115902 C28.2241602,25.9115902 26.3641204,29.6230088 25.0553442,31.3098382 C23.7465679,32.9968864 22.5412514,33.9077218 22.5412514,33.9077218 L20.328823,29.2136692 L20.328823,28.9034905 L23.7972922,25.9115902 Z",id:"Fill-40",fill:"#F4F2F2"}),s.createElement("path",{d:"M16.7568047,25.9844833 L14.826153,24.1571213 C13.8456323,24.7194707 12.4333964,25.9115902 12.4333964,25.9115902 C12.4333964,25.9115902 14.1899765,29.8497873 15.4987527,31.6071019 C16.807529,33.3639787 18.1726158,34.4026505 18.1726158,34.4026505 L20.3287336,29.2136692 L20.2252739,29.1004989 L16.7568047,25.9844833 Z",id:"Fill-42",fill:"#CCCCCC"}),s.createElement("path",{d:"M16.8601303,25.9115902 L14.826019,24.1571213 C13.8454982,24.6969242 12.4334858,25.9115902 12.4334858,25.9115902 C12.4334858,25.9115902 14.2933021,29.6230088 15.6020784,31.3098382 C16.9108546,32.9968864 18.1163946,33.9077218 18.1163946,33.9077218 L20.3285995,29.2136692 L20.3285995,28.9034905 L16.8601303,25.9115902 Z",id:"Fill-44",fill:"#FFFFFF"})))))))}const uy=s.forwardRef(dy);i.p;function py(){return py=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},py.apply(this,arguments)}var gy={doc:t=>s.createElement("svg",py({t:1646123881490,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1408,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1409}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1410}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1411}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#2C97FF","p-id":1412}),s.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 16 16h48a64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m0 192h-32V576h32a32 32 0 0 1 32 32v96a32 32 0 0 1-32 32z m160-192a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m32 160a32 32 0 0 1-32 32 32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32z m128 32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32h32a64 64 0 0 0-64-64 64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64h-32a32 32 0 0 1-32 32z",fill:"#FFFFFF","p-id":1413})),docx:t=>s.createElement("svg",py({t:1646123881490,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1408,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1409}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1410}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1411}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#2C97FF","p-id":1412}),s.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 16 16h48a64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m0 192h-32V576h32a32 32 0 0 1 32 32v96a32 32 0 0 1-32 32z m160-192a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m32 160a32 32 0 0 1-32 32 32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32z m128 32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32h32a64 64 0 0 0-64-64 64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64h-32a32 32 0 0 1-32 32z",fill:"#FFFFFF","p-id":1413})),full:t=>s.createElement("svg",py({width:"1em",height:"1em",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),s.createElement("title",null,"\u5145\u6ee1"),s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-145.000000, -1567.000000)",fill:"#222222",fillRule:"nonzero"},s.createElement("g",{id:"\\u5145\\u6EE1",transform:"translate(145.000000, 1567.000000)"},s.createElement("path",{d:"M12.09375,0 C12.35,0 12.6,0.05 12.8359375,0.15 C13.0640625,0.2453125 13.2671875,0.3828125 13.4421875,0.5578125 C13.6171875,0.7328125 13.7546875,0.9375 13.85,1.1640625 C13.95,1.4 14,1.65 14,1.90625 L14,1.90625 L14,12.09375 C14,12.35 13.95,12.6 13.85,12.8359375 C13.7546875,13.0640625 13.6171875,13.2671875 13.4421875,13.4421875 C13.2671875,13.6171875 13.0625,13.7546875 12.8359375,13.85 C12.6,13.95 12.35,14 12.09375,14 L12.09375,14 L1.90625,14 C1.65,14 1.4,13.95 1.1640625,13.85 C0.9359375,13.7546875 0.7328125,13.6171875 0.5578125,13.4421875 C0.3828125,13.2671875 0.2453125,13.0625 0.15,12.8359375 C0.05,12.6 0,12.35 0,12.09375 L0,12.09375 L0,1.90625 C0,1.65 0.05,1.4 0.15,1.1640625 C0.2453125,0.9359375 0.3828125,0.7328125 0.5578125,0.5578125 C0.7328125,0.3828125 0.9375,0.2453125 1.1640625,0.15 C1.4,0.05 1.65,0 1.90625,0 L1.90625,0 Z M12.09375,1.125 L1.90625,1.125 C1.475,1.125 1.125,1.475 1.125,1.90625 L1.125,1.90625 L1.125,12.09375 C1.125,12.525 1.475,12.875 1.90625,12.875 L1.90625,12.875 L12.09375,12.875 C12.525,12.875 12.875,12.525 12.875,12.09375 L12.875,12.09375 L12.875,1.90625 C12.875,1.475 12.525,1.125 12.09375,1.125 L12.09375,1.125 Z M2.5734375,7.484375 C2.878125,7.490625 3.125,7.740625 3.125,8.046875 L3.125,8.046875 L3.125,10.0640625 L5.1265625,8.0625 C5.3453125,7.84375 5.703125,7.84375 5.921875,8.0625 C6.140625,8.28125 6.140625,8.6390625 5.921875,8.8578125 L5.921875,8.8578125 L3.903125,10.875 L5.909375,10.875 C6.2265625,10.875 6.4890625,11.13125 6.484375,11.4484375 C6.478125,11.7546875 6.228125,12 5.921875,12 L5.921875,12 L2.5734375,12 C2.25625,12 2,11.74375 2,11.4265625 L2,11.4265625 L2,8.0578125 C2,7.740625 2.2578125,7.478125 2.5734375,7.484375 Z M11.4296875,2 C11.7453125,2 12,2.25625 12,2.5703125 L12,2.5703125 L12,5.940625 C12,6.2578125 11.7421875,6.5203125 11.4265625,6.5140625 C11.121875,6.5078125 10.875,6.2578125 10.875,5.9515625 L10.875,5.9515625 L10.875,3.9359375 L8.8734375,5.9375 C8.6546875,6.15625 8.296875,6.15625 8.078125,5.9375 C7.859375,5.71875 7.859375,5.3609375 8.078125,5.1421875 L8.078125,5.1421875 L10.0953125,3.125 L8.0890625,3.125 C7.771875,3.125 7.509375,2.86875 7.515625,2.5515625 C7.521875,2.2453125 7.771875,2 8.078125,2 L8.078125,2 Z",id:"\\u5F62\\u72B6\\u7ED3\\u5408"}))))),gif:t=>s.createElement("svg",py({t:1646123917228,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1827,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1828}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1829}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1830}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#CC7598","p-id":1831}),s.createElement("path",{d:"M288 672h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32z m96 80a16 16 0 0 1-16 16 16 16 0 0 1-16-16V560a16 16 0 0 1 16-16 16 16 0 0 1 16 16z m176-208h-96a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h48a16 16 0 0 0 0-32h-48v-64h80a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":1832})),jpg:t=>s.createElement("svg",py({t:1646123877293,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1269,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1270}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1271}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1272}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":1273}),s.createElement("path",{d:"M320 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m256 32h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32zM208 544a16 16 0 0 0-16 16v144a32 32 0 0 1-64 0v-16a16 16 0 0 0-32 0v16a64 64 0 0 0 128 0V560a16 16 0 0 0-16-16z",fill:"#FFFFFF","p-id":1274})),mp4:t=>s.createElement("svg",py({t:1646123927989,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1966,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192c-35.328 0-64 28.672-64 64v320h576c35.328 0 64 28.672 64 64v415.744c0 35.328-28.672 64-64 64H128v31.744c0 35.328 28.672 64 64 64h768c35.328 0 64-28.672 64-64v-640L704 0z",fill:"#EAEAEA","p-id":1967}),s.createElement("path",{d:"M704 0v256c0 35.328 28.672 64 64 64h256L704 0z",fill:"#434854","p-id":1968}),s.createElement("path",{d:"M768 320l256 256V320z",opacity:.1,"p-id":1969}),s.createElement("path",{d:"M704 832c0 17.92-14.336 31.744-31.744 31.744H31.744C13.824 863.744 0 849.408 0 832V480.256c0-17.92 14.336-31.744 31.744-31.744h640c17.92 0 31.744 14.336 31.744 31.744V832z",fill:"#724AE2","p-id":1970}),s.createElement("path",{d:"M537.088 547.84c9.728 0 14.336 4.608 14.336 13.824v132.608h18.944c9.728 0.512 14.336 4.608 14.336 13.312s-5.12 13.312-15.36 13.312h-18.432v37.888c-0.512 9.728-5.12 14.336-13.824 14.336s-13.312-5.12-13.312-15.36v-36.864h-79.36c-12.8-0.512-19.456-4.096-19.456-11.776 0-4.096 1.536-7.68 4.096-11.776l94.208-141.312 0.512-1.024c3.584-4.608 8.192-7.168 13.312-7.168z m-302.592-1.536c7.168 0 11.264 5.12 11.264 15.872v193.536c0 10.752-4.608 15.872-11.264 15.872s-11.264-5.12-11.264-15.872V622.08l-44.544 140.8c-2.048 6.144-8.192 8.704-12.288 8.704s-10.24-3.072-12.288-8.704l-46.08-140.8v133.632c0 10.752-6.144 15.872-12.8 15.872s-12.8-5.12-12.8-15.872V562.176c0-10.752 5.632-15.872 12.8-15.872 4.608 0 10.752 3.072 12.8 8.704L166.4 728.064l56.832-173.056c2.048-6.144 6.144-8.704 11.264-8.704z m121.856 0c35.328 0 63.488 28.672 63.488 64 0 34.816-27.648 62.976-62.464 64h-33.28v79.872c0 8.704-7.168 15.872-15.872 15.872-8.192 0-15.36-6.656-15.872-14.848V562.176c0-8.192 6.656-15.36 14.848-15.872h49.152z m166.912 58.368l-59.904 90.112h59.904v-90.112z m-166.912-26.624h-31.744v64h31.744c17.92 0 31.744-14.848 31.744-32.256s-13.824-31.744-31.744-31.744z",fill:"#FFFFFF","p-id":1971})),pdf:t=>s.createElement("svg",py({t:1646123842588,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1304,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192c-35.328 0-64 28.672-64 64v320h576c35.328 0 64 28.672 64 64v415.744c0 35.328-28.672 64-64 64H128v31.744c0 35.328 28.672 64 64 64h768c35.328 0 64-28.672 64-64v-640L704 0z",fill:"#EAEAEA","p-id":1305}),s.createElement("path",{d:"M704 0v256c0 35.328 28.672 64 64 64h256L704 0z",fill:"#434854","p-id":1306}),s.createElement("path",{d:"M768 320l256 256V320z",opacity:.1,"p-id":1307}),s.createElement("path",{d:"M704 832c0 17.92-14.336 31.744-31.744 31.744H31.744C13.824 863.744 0 849.408 0 832V480.256c0-17.92 14.336-31.744 31.744-31.744h640c17.92 0 31.744 14.336 31.744 31.744V832z",fill:"#CD4050","p-id":1308}),s.createElement("path",{d:"M192 544.256h-48.128c-8.704 0-15.872 7.168-15.872 15.872v192c0 8.704 7.168 15.872 15.872 15.872s15.872-7.168 15.872-15.872v-79.872h31.744c35.328 0 64-28.672 64-64s-28.16-64-63.488-64z m158.72 0c34.816 0 62.976 27.648 64 62.464v97.792c0 34.816-27.648 62.976-62.464 64h-49.664c-8.704 0-15.36-6.656-15.872-14.848V560.64c0-8.704 6.656-15.36 14.848-15.872h49.152z m227.328 0c8.704 0 15.872 7.168 15.872 15.872S586.752 576 578.048 576h-80.384v64h48.128c8.704 0 15.872 7.168 15.872 15.872s-7.168 15.872-15.872 15.872h-48.128v79.872c0 8.704-7.168 15.872-15.872 15.872s-15.872-7.168-15.872-15.872v-192c0-8.704 7.168-15.872 15.872-15.872h96.256zM350.72 576h-31.744v159.744h31.744c17.408 0 31.232-13.824 31.744-30.72v-97.28C382.976 590.336 368.64 576 350.72 576zM192 576c17.92 0 31.744 14.336 31.744 31.744S209.92 640 192 640h-31.744v-64H192z",fill:"#FFFFFF","p-id":1309})),png:t=>s.createElement("svg",py({t:1646123868693,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1130,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1131}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1132}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1133}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":1134}),s.createElement("path",{d:"M160 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m448 32h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32zM400 544a16 16 0 0 0-16 16v137.6l-98.88-146.56a7.36 7.36 0 0 0-2.24-2.24l-2.56-1.6h-16l-2.56 2.24v5.12a13.76 13.76 0 0 0 0 3.52v192a16 16 0 0 0 32 0v-137.6l96 142.08a15.68 15.68 0 0 0 32-3.2v-192A16 16 0 0 0 400 544z",fill:"#FFFFFF","p-id":1135})),ppt:t=>s.createElement("svg",py({t:1646123861524,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":991,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":992}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":993}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":994}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#F05264","p-id":995}),s.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m160-96h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m240-96H464a16 16 0 0 0 0 32h48v176a16 16 0 0 0 32 0V576h48a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":996})),pptx:t=>s.createElement("svg",py({t:1646123861524,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":991,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":992}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":993}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":994}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#F05264","p-id":995}),s.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m160-96h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m240-96H464a16 16 0 0 0 0 32h48v176a16 16 0 0 0 32 0V576h48a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":996})),rar:t=>s.createElement("svg",py({t:1646123940344,className:"icon",viewBox:"0 0 1056 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2245,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M1.248 0h1024v1024h-1024z",fillOpacity:0,"p-id":2246}),s.createElement("path",{d:"M849.248 1024h-672c-41.6 0-76.8-35.2-73.6-80V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v710.4c0 41.6-32 76.8-73.6 76.8z",fill:"#F5F1EC","p-id":2247}),s.createElement("path",{d:"M922.848 313.6h-819.2V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v76.8z",fill:"#E0B773","p-id":2248}),s.createElement("path",{d:"M244.448 252.8v-57.6h25.6l25.6 54.4h25.6l-32-54.4c19.2-6.4 25.6-19.2 25.6-35.2 0-12.8-3.2-22.4-12.8-28.8-6.4-6.4-16-9.6-25.6-9.6h-51.2v131.2h19.2z m32-73.6h-32v-38.4h32c6.4 0 9.6 0 16 3.2 3.2 3.2 3.2 6.4 3.2 16 0 6.4-3.2 9.6-6.4 12.8 0 3.2-6.4 6.4-12.8 6.4z m83.2 73.6l9.6-28.8h48l9.6 28.8h22.4l-48-131.2h-16l-48 131.2h22.4z m54.4-48h-38.4l19.2-57.6 19.2 57.6z m86.4 48v-57.6h25.6l25.6 54.4h22.4l-28.8-54.4c16-6.4 25.6-19.2 25.6-35.2 0-12.8-3.2-22.4-12.8-28.8-6.4-6.4-16-9.6-25.6-9.6h-51.2v131.2h19.2z m28.8-73.6h-28.8v-38.4h32c6.4 0 9.6 0 16 3.2 3.2 3.2 6.4 6.4 6.4 16 0 6.4-3.2 9.6-6.4 12.8-6.4 3.2-12.8 6.4-19.2 6.4z",fill:"#FFFFFF","p-id":2249}),s.createElement("path",{d:"M922.848 236.8h-150.4c-41.6 0-76.8-35.2-73.6-80V0l112 118.4 112 118.4z",fill:"#F5F1EC","p-id":2250}),s.createElement("path",{d:"M426.848 464v409.6h172.8V464h-172.8z m150.4 140.8h-64v41.6h64v44.8h-64v41.6h64v44.8h-64v44.8h-64v-44.8h64v-44.8h-64v-41.6h64v-44.8h-64v-41.6h64v-41.6h-64v-44.8h64v44.8h64v41.6z",fill:"#E0B773","p-id":2251})),rotate:t=>s.createElement("svg",py({width:"1em",height:"1em",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),s.createElement("title",null,"\u65cb\u8f6c"),s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-77.000000, -1567.000000)",fill:"#222222",fillRule:"nonzero"},s.createElement("g",{id:"\\u65CB\\u8F6C",transform:"translate(77.000000, 1567.000000)"},s.createElement("path",{d:"M9.16414904,5.6345426 C9.35110931,5.6345426 9.53041217,5.70881228 9.66261304,5.84101315 C9.79481391,5.97321402 9.86908359,6.15251688 9.86908359,6.33947715 L9.86908359,12.683888 C9.86908359,13.0732126 9.55347364,13.3888226 9.16414904,13.3888226 L0.704934547,13.3888226 C0.315609953,13.3888226 1.8189894e-12,13.0732126 1.8189894e-12,12.683888 L1.8189894e-12,6.33947715 C1.8189894e-12,6.15251688 0.0742696765,5.97321402 0.206470548,5.84101315 C0.33867142,5.70881228 0.517974281,5.6345426 0.704934547,5.6345426 L9.16414904,5.6345426 Z M8.4592145,7.04441168 L1.40986909,7.04441168 L1.40986909,11.9789535 L8.4592145,11.9789535 L8.4592145,7.04441168 Z M7.58258803,0.714885198 C7.63035214,0.738767256 7.66052367,0.787585825 7.66052367,0.840987728 L7.66052367,2.02739256 C11.1625178,2.03011634 14,4.86980822 14,8.37180343 C14,8.62367799 13.8656872,8.85643618 13.6475639,8.98238459 C13.4294405,9.108333 13.1606904,9.108333 12.942567,8.98238459 C12.7244437,8.85643618 12.5900924,8.62367799 12.5901309,8.37180343 C12.5901323,5.64845715 10.3838686,3.43998499 7.66052367,3.43726164 L7.66052367,4.50664733 C7.66052367,4.56004923 7.63035214,4.6088678 7.58258803,4.63274986 C7.53482391,4.65663192 7.47766614,4.65147801 7.43494462,4.61943686 L4.99093655,2.78660706 C4.95543522,2.75998107 4.93454178,2.71819419 4.93454178,2.67381753 C4.93454178,2.62944087 4.95543522,2.58765399 4.99093655,2.561028 L7.43494462,0.728198195 C7.47766614,0.696157053 7.53482391,0.691003139 7.58258803,0.714885198 Z",id:"\\u5F62\\u72B6\\u7ED3\\u5408"}))))),svg:t=>s.createElement("svg",py({t:1646123950101,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2385,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":2386}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":2387}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":2388}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":2389}),s.createElement("path",{d:"M160 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m246.08-96a16 16 0 0 0-20.8 8.96l-64 155.84-64-155.84a16 16 0 1 0-29.44 11.84l77.76 192a24.96 24.96 0 0 0 3.2 4.8 12.8 12.8 0 0 0 4.8 3.2 12.8 12.8 0 0 0 4.8 0h5.76l3.2-2.24a13.12 13.12 0 0 0 5.44-6.4l77.76-192a15.68 15.68 0 0 0-4.48-20.16zM576 672h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":2390})),unknow:t=>s.createElement("svg",py({t:1646123889587,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1551,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M914.92 287.344L697.718 81.474v128.338c0 43.554 34.968 79.189 77.706 79.189h141.99l-2.494-1.657z",fill:"#027AFF","p-id":1552}),s.createElement("path",{d:"M768.284 316.733c-54.48 0-99.056-48.997-99.056-108.882V66.223h-373.35c-30.593 0-55.624 27-55.624 60v348.869h490.802c37.476 0 68.137 33.073 68.137 73.496v207.894c0 40.424-30.661 73.497-68.137 73.497H240.254v70.128c0 33 25.031 60 55.625 60h563.637c30.594 0 55.625-27 55.625-60V316.733H768.284z",fill:"#027AFF","p-id":1553}),s.createElement("path",{d:"M699.302 519.057H156.028c-31.109 0-56.561 25.381-56.561 56.403v153.038c0 31.021 25.452 56.402 56.561 56.402h543.274c31.11 0 56.562-25.38 56.562-56.402V575.46c0-31.022-25.453-56.403-56.562-56.403z m-444.857 211.51c-4.902 4.135-10.558 6.203-16.874 6.203-6.41 0-12.066-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.451-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.545 11.28-7.636 15.417z m29.884-89.775c-2.263 2.068-9.993 6.957-23.379 14.571-3.865 2.256-6.222 4.136-7.07 5.64-0.566 0.846-0.849 2.82-0.849 6.016 0 4.7-1.508 8.367-4.619 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.84-3.29-3.489-2.632-5.186-6.392-5.186-11.28v-10.247c0-7.896 3.583-14.477 10.841-19.553 6.976-3.572 13.764-7.238 20.457-10.81 7.259-3.854 10.84-8.367 10.84-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.57 5.64-2.357 2.068-5.94 6.486-10.653 13.348-4.148 6.017-9.05 8.93-14.612 8.93-4.336 0-7.918-1.503-10.84-4.605-2.923-2.82-4.431-6.487-4.431-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.91-18.143 16.874 0 30.637 4.418 41.384 13.349 10.18 8.46 15.271 18.989 15.271 31.68 0 12.69-3.488 22.372-10.652 29.14zM442.7 730.566c-4.902 4.136-10.558 6.204-16.874 6.204-6.41 0-12.066-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.45-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.64 11.28-7.636 15.417z m29.884-89.774c-2.263 2.068-9.993 6.957-23.38 14.571-3.864 2.256-6.221 4.136-7.07 5.64-0.565 0.846-0.848 2.82-0.848 6.016 0 4.7-1.508 8.367-4.619 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.84-3.29-3.489-2.632-5.186-6.392-5.186-11.28v-10.247c0-7.896 3.583-14.477 10.841-19.553 6.976-3.572 13.764-7.238 20.457-10.81 7.258-3.854 10.84-8.367 10.84-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.57 5.64-2.358 2.068-5.94 6.486-10.653 13.348-4.148 6.017-9.05 8.93-14.612 8.93-4.336 0-7.919-1.503-10.841-4.605-2.922-2.82-4.43-6.487-4.43-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.91-18.143 16.873 0 30.637 4.418 41.383 13.349 10.181 8.46 15.272 18.989 15.272 31.68 0 12.69-3.582 22.372-10.652 29.14z m158.372 89.774c-4.902 4.136-10.558 6.204-16.874 6.204-6.41 0-12.067-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.45-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.64 11.28-7.636 15.417z m29.883-89.774c-2.262 2.068-9.992 6.957-23.378 14.571-3.865 2.256-6.222 4.136-7.07 5.64-0.566 0.846-0.85 2.82-0.85 6.016 0 4.7-1.507 8.367-4.618 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.841-3.29-3.488-2.632-5.185-6.392-5.185-11.28v-10.247c0-7.896 3.582-14.477 10.841-19.553 6.976-3.572 13.763-7.238 20.456-10.81 7.26-3.854 10.841-8.367 10.841-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.571 5.64-2.357 2.068-5.94 6.486-10.653 13.348-4.147 6.017-9.05 8.93-14.611 8.93-4.337 0-7.919-1.503-10.841-4.605-2.923-2.82-4.43-6.487-4.43-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.909-18.143 16.874 0 30.637 4.418 41.384 13.349 10.181 8.46 15.272 18.989 15.272 31.68 0 12.69-3.582 22.372-10.653 29.14z",fill:"#027AFF","p-id":1554})),xls:t=>s.createElement("svg",py({t:1646123896342,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1688,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1689}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1690}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1691}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#009688","p-id":1692}),s.createElement("path",{d:"M512 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m-112 96h-80V560a16 16 0 0 0-32 0v192a16 16 0 0 0 16 16h96a16 16 0 0 0 0-32z m-146.88 8.32l-57.6-91.84 52.8-84.16a15.36 15.36 0 0 0-6.08-21.76 18.56 18.56 0 0 0-23.68 5.76l-42.88 68.8-42.88-68.8a18.56 18.56 0 0 0-23.68-5.76 15.36 15.36 0 0 0-6.4 21.76l53.12 84.16-57.6 91.84a15.36 15.36 0 0 0 6.4 21.76A17.92 17.92 0 0 0 128 760l47.68-75.84L224 760a18.56 18.56 0 0 0 23.68 6.08 15.36 15.36 0 0 0 5.44-21.76z",fill:"#FFFFFF","p-id":1693})),xlsx:t=>s.createElement("svg",py({t:1646123896342,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1688,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1689}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1690}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1691}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#009688","p-id":1692}),s.createElement("path",{d:"M512 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m-112 96h-80V560a16 16 0 0 0-32 0v192a16 16 0 0 0 16 16h96a16 16 0 0 0 0-32z m-146.88 8.32l-57.6-91.84 52.8-84.16a15.36 15.36 0 0 0-6.08-21.76 18.56 18.56 0 0 0-23.68 5.76l-42.88 68.8-42.88-68.8a18.56 18.56 0 0 0-23.68-5.76 15.36 15.36 0 0 0-6.4 21.76l53.12 84.16-57.6 91.84a15.36 15.36 0 0 0 6.4 21.76A17.92 17.92 0 0 0 128 760l47.68-75.84L224 760a18.56 18.56 0 0 0 23.68 6.08 15.36 15.36 0 0 0 5.44-21.76z",fill:"#FFFFFF","p-id":1693})),zip:t=>s.createElement("svg",py({t:1646123936994,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2105,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M0 0h1024v1024H0z",fillOpacity:0,"p-id":2106}),s.createElement("path",{d:"M848 1024H176c-41.6 0-76.8-35.2-73.6-80V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v710.4c0 41.6-32 76.8-73.6 76.8z",fill:"#F5ECEC","p-id":2107}),s.createElement("path",{d:"M921.6 313.6H102.4V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v76.8z",fill:"#BC8585","p-id":2108}),s.createElement("path",{d:"M300.8 252.8v-19.2H240l57.6-96v-16h-80v16h57.6l-57.6 96v16h83.2z m70.4 0V121.6H352v131.2h19.2z m80 0v-51.2H480c12.8 0 22.4-3.2 32-12.8 6.4-6.4 9.6-16 9.6-25.6 0-6.4 0-12.8-3.2-19.2-3.2-6.4-6.4-9.6-9.6-12.8-6.4-3.2-9.6-6.4-16-6.4h-64V256h22.4z m28.8-70.4h-28.8v-41.6H480c6.4 0 9.6 0 12.8 3.2 3.2 0 3.2 3.2 6.4 6.4 0 3.2 3.2 6.4 3.2 9.6 0 6.4-3.2 9.6-6.4 12.8-3.2 6.4-9.6 9.6-16 9.6z",fill:"#FFFFFF","p-id":2109}),s.createElement("path",{d:"M921.6 236.8H771.2c-41.6 0-76.8-35.2-73.6-80V0l112 118.4 112 118.4z",fill:"#F5ECEC","p-id":2110}),s.createElement("path",{d:"M425.6 464v409.6h172.8V464H425.6zM576 604.8h-64v41.6h64v44.8h-64v41.6h64v44.8h-64v44.8h-64v-44.8h64v-44.8h-64v-41.6h64v-44.8h-64v-41.6h64v-41.6h-64v-44.8h64v44.8h64v41.6z",fill:"#BC8585","p-id":2111}))};const fy=t=>{const{size:e,type:i}=Object.assign({},{size:40,type:"unknow"},t),n=gy[i]||gy.unknow;return r().createElement(n,{width:e,height:e})};var my=i(85553),vy=i(92679),wy=i.n(vy),by=i(80263),yy=i.n(by);var Ay=i(57325),Ey=i.n(Ay);function xy(){return xy=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},xy.apply(null,arguments)}function _y(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}const ky=["id","url","error","apis","loading","ttl","cacheName"],Cy=["paramsType","paramsName"],Sy=["data"],My=t=>e=>{var i;const n=Object.assign({},{loading:null,ttl:6e6,cacheName:"file-cache"},e),{id:s,error:o,apis:c,loading:d,ttl:u,cacheName:p}=n,g=_y(n,ky),{apis:f}=(0,a.usePreset)(),m=h()({},f,c);if(!s)return null;if(null==m||null==(i=m.file)||!i.getUrl)return console.warn("\u8bf7\u5728Global\u7ec4\u4ef6\u8bbe\u7f6epreset.apis.file.getUrl\u53c2\u6570"),null;const v=Object.assign({paramsType:"params",paramsName:"id"},m.file.getUrl),{paramsType:w,paramsName:b}=v,y=_y(v,Cy),A={},E=s.split("?")[0];return A[w]={[b]:E},r().createElement(l(),xy({},Object.assign({},y,A),{updateType:"refresh",error:o,loading:d,cache:p,ttl:u,render:e=>{let{data:i}=e,n=_y(e,Sy);return r().createElement(t,xy({},g,{id:E,data:i,fetchApi:n}))}}))},Ty=["data","children"],Py=(My(t=>{let{data:e,children:i}=t;return i(xy({url:e},_y(t,Ty)))}),(t,e)=>{const i=document.createElement("a"),n=new MouseEvent("click");i.download=e,i.target="_blank",i.href=t,i.dispatchEvent(n)}),Ly=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file",i=arguments.length>2?arguments[2]:void 0;if(!t)throw new Error((null==i?void 0:i.notFoundFile)||"\u672a\u83b7\u53d6\u5230\u4e0b\u8f7d\u7684\u6587\u4ef6\u4fe1\u606f");if("string"===typeof t&&/blob:http(s)?:/.test(t))return void Py(t,e);if("[object Blob]"===Object.prototype.toString.call(t)){const i=new Blob([t],{type:t.type});return void Py(URL.createObjectURL(i),e)}const n=(0,o.getAjax)(),{data:s,headers:r}=await n({url:t,responseType:"blob"}),a=null==r?void 0:r["content-disposition"];if(a){const t=a.match(/filename\*?=(?:UTF-8'')?([^;]+)/i);if(t&&t[1])e=decodeURIComponent(t[1].replace(/['"]/g,""));else{const t=a.match(/filename="?([^"]+)"?/i);t&&(e=t[1])}}Py(URL.createObjectURL(new Blob([s],{type:null==s?void 0:s.type})),e)},Ry=t=>{let{url:e,staticUrl:i}=t;return/^(blob:)?https?:\/\//.test(e)?e:i+e},Dy=t=>{let{url:e,staticUrl:i}=t;var n;const{apis:s}=(0,a.usePreset)(),r=i||(null==(n=s.file)?void 0:n.staticUrl)||"";return Ry({staticUrl:r,url:e})},Fy=["paramsType","paramsName"],Iy=["isLoading","data","error","refresh"],Ny=t=>{let{id:e,src:i,filename:n,staticUrl:r,apis:l,onError:c,onSuccess:h}=t;var u,p;const{message:g}=d.App.useApp(),{apis:f}=(0,a.usePreset)(),m=Object.assign({},f,l),v=r||(null==(u=m.file)?void 0:u.staticUrl)||"",[w,b]=(0,s.useState)(!1),y=Object.assign({paramsType:"params",paramsName:"id"},null==(p=m.file)?void 0:p.getUrl),{paramsType:A,paramsName:E}=y,_=_y(y,Fy),k={};k[A]={[E]:e};const C=(0,o.useFetch)(Object.assign({},_,k,{auto:!1})),{isLoading:S,data:M,error:T,refresh:P}=C,L=_y(C,Iy),R=(0,x.A)(c||g.error),D=(0,x.A)(h),F=(0,x.A)(t=>Ly(Ry({staticUrl:v,url:t}),n).then(D).catch(t=>{R(t.message)}));return(0,s.useEffect)(()=>{S||(T?R(T):M&&(b(!0),F(M).then(()=>{b(!1)})))},[S,T,M,R]),xy({},L,{isLoading:S||w,download:()=>i?F(i):P(e?k:{})})},Oy={unnamedDownloadFile:"\u672a\u547d\u540d\u4e0b\u8f7d\u6587\u4ef6",fileUpload:"\u4e0a\u4f20\u6587\u4ef6",uploadTips:"\u652f\u6301\u6269\u5c55\u540d{accept}\uff0c\u5355\u4e2a\u6587\u4ef6\u5927\u5c0f\u4e0d\u8d85\u8fc7{fileSize}M\uff0c\u6700\u591a\u4e0a\u4f20{maxLength}\u4e2a\u9644\u4ef6",maxLengthError:"\u4e0a\u4f20\u6587\u4ef6\u4e0d\u80fd\u8d85\u8fc7\u6700\u5927\u5141\u8bb8\u6570\u91cf{maxLength}",fileSizeError:"\u6587\u4ef6{filename}\u4e0d\u80fd\u8d85\u8fc7{fileSize}MB!",uploadError:"\u6587\u4ef6{filename}\u4e0a\u4f20\u9519\u8bef{error}",uploadAnomaly:"\u6587\u4ef6{filename}\u4e0a\u4f20\u5f02\u5e38{error}",fileLoadedError:"\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25",fileNotFoundError:"\u672a\u6307\u5b9a\u6587\u4ef6",pageNotFoundError:"\u672a\u6307\u5b9a\u9875\u9762",unSupportFileType:"\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u7c7b\u578b",unSupportFileTypeDescription:"\u7cfb\u7edf\u4e0d\u652f\u6301\u8be5\u6587\u4ef6\u7c7b\u578b\u9884\u89c8\uff0c\u8bf7\u4e0b\u8f7d\u5230\u672c\u5730\u540e\u8fdb\u884c\u9884\u89c8",uploading:"\u6b63\u5728\u4e0a\u4f20",unNamedDownloadFile:"\u672a\u547d\u540d\u4e0b\u8f7d\u6587\u4ef6",notFoundFile:"\u672a\u83b7\u53d6\u5230\u4e0b\u8f7d\u7684\u6587\u4ef6\u4fe1\u606f",downloadSuccess:"\u4e0b\u8f7d\u6210\u529f",pleaseSetApi:"\u8bf7\u5728Global\u7ec4\u4ef6\u8bbe\u7f6epreset.apis.file.getUrl\u53c2\u6570",filePreview:"\u6587\u4ef6\u9884\u89c8"},By=["id","src","filename","api","onSuccess","onError","onClick"],Wy=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),i=Object.assign({},{filename:e({id:"unnamedDownloadFile"})},t),{id:n,src:s,filename:a,api:o,onSuccess:l,onError:c,onClick:h}=i,p=_y(i,By),{isLoading:g,download:f}=Ny({id:n,src:s,filename:a,api:o,onError:c,onSuccess:l});return r().createElement(d.Button,xy({icon:r().createElement(u.A,null)},k()(p,["locale"]),{loading:g,onClick:function(){h&&h(...arguments),f()}}))});Wy.useDownload=Ny,Wy.download=Py,Wy.downloadBlobFile=Ly;var zy="_Cmp6z",jy="_lmC4r",Hy="_-jyU7",Uy="_lN9hC",Vy="_yaqrz",Gy="_SXsiw",qy="_15U-a",Xy="_tpRpL";const Yy=["className","url","maxWidth","ignoreContent"],Ky=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{let{data:e,apis:i,contentWindowUrl:n}=t;var o;const l=(0,s.useRef)(null),{apis:c}=(0,a.usePreset)(),{formatMessage:h}=(0,C.useIntl)(),d=Object.assign({},c,i),u=n||(null==(o=d.file)?void 0:o.contentWindowUrl)||"https://cdn.jsdelivr.net/npm/@kne/iframe-resizer@0.1.3/dist/contentWindow.js";return(0,s.useEffect)(()=>{const t=(new DOMParser).parseFromString(e,"text/html");t.querySelectorAll("script").forEach(t=>{t.parentElement.removeChild(t)});const i=document.createElement("script");i.src=u,t.head.appendChild(i);const n=document.createElement("style");n.innerText="html,body{height:auto!important;}body{pointer-events: none;background: #FFFFFF;}",t.head.appendChild(n),l.current.srcdoc=t.documentElement.outerHTML},[e]),(0,s.useEffect)(()=>{ct({checkOrigin:!1},l.current)},[]),r().createElement("iframe",{title:h({id:"filePreview"}),frameBorder:"0",width:"100%",ref:l})}),Qy=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),i=Object.assign({},t),{className:n,url:s,maxWidth:a,ignoreContent:o}=i,c=_y(i,Yy),h=r().createElement("iframe",{title:e({id:"filePreview"}),src:s,width:"100%",className:Xy});return r().createElement("div",{className:dt()(n,zy),style:{maxWidth:a}},o?h:r().createElement(l(),{url:s,transformResponse:t=>{let{data:e}=t;return{data:{code:200,results:e}}},showError:!1,error:h,render:t=>{let{data:e}=t;return r().createElement(Ky,xy({},c,{url:s,data:e}))}}))}),Zy=["url","filename","type"],Jy=t=>{var e;let{url:i,filename:n,type:s}=t,o=_y(t,Zy);const{apis:l}=(0,a.usePreset)(),c=Object.assign({},l,o.apis),h=Dy({staticUrl:o.staticUrl||(null==(e=c.file)?void 0:e.staticUrl),url:i}),d=s&&lA[s]||cA(n||h);return r().createElement(d,xy({},o,{url:h}))},$y=["url","apis","className"],tA=(0,s.memo)((0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{var e;const{formatMessage:i}=(0,C.useIntl)(),{url:n,apis:o,maxWidth:l,scale:c,rotate:h,className:u,pdfjsUrl:p}=Object.assign({},{autoSize:!0,renderTextLayer:!1,scale:100,rotate:0,maxWidth:1200},t),[g,f]=(0,s.useState)(0),{apis:m}=(0,a.usePreset)(),v=Object.assign({},m,o),w=p||(null==(e=v.file)?void 0:e.pdfjsUrl)||"https://cdn.jsdelivr.net/npm/pdfjs-dist@5.4.296";zc.workerSrc=w+"/build/pdf.worker.min.mjs";const b=(0,s.useMemo)(()=>({file:n,options:{standardFontDataUrl:w+"/standard_fonts/",cMapUrl:w+"/cmaps/",cMapPacked:!0}}),[w,n]),[y,A]=(0,s.useState)(l),E=(0,Hb.A)(()=>{E.current&&E.current.clientWidth&&A(Math.min(E.current.clientWidth,l))});return r().createElement("div",{ref:E,className:dt()(u,zy),style:{maxWidth:l}},r().createElement(Ab,xy({},b,{error:i({id:"fileLoadedError"}),loading:r().createElement("div",{className:jy},r().createElement(d.Spin,null)),noData:i({id:"fileNotFoundError"}),onLoadSuccess:t=>{let{numPages:e}=t;f(e)}}),r().createElement(d.Flex,{vertical:!0,gap:8},g>=1&&Array.from(new Array(g),(t,e)=>r().createElement(jb,{key:"page_".concat(e),className:"preview-item",scale:c/100,rotate:h,pageNumber:e+1,width:y,loading:null,renderAnnotationLayer:!1,renderTextLayer:!0,noData:i({id:"pageNotFoundError"})})))))})),eA=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{let{url:e,className:i,maxWidth:n}=t;const{formatMessage:a}=(0,C.useIntl)(),[l,c]=(0,s.useState)(""),[h,u]=(0,s.useState)(!0),[p,g]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(0,o.getAjax)()({url:e,method:"GET"}).then(t=>{let{data:e}=t;c(e),u(!1)},()=>{u(!1),g(!0)})},[e]),r().createElement("div",{className:dt()(i,zy),style:{maxWidth:n}},h?r().createElement("div",{className:jy},r().createElement(d.Spin,null)):null,r().createElement("div",{className:Hy},p?r().createElement("div",{className:Uy},a({id:"fileLoadedError"})):r().createElement("div",{className:Vy},l)))}),iA=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{let{maxWidth:e}=t;const{formatMessage:i}=(0,C.useIntl)();return r().createElement("div",{className:zy,style:{maxWidth:e}},r().createElement("div",{className:Hy},r().createElement(d.Result,{status:"500",title:i({id:"unSupportFileType"}),subTitle:i({id:"unSupportFileTypeDescription"})})))}),nA=["url","scale","rotate","className","maxWidth","origin"],sA=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{let{url:e,scale:i,rotate:n,className:a,maxWidth:o,origin:l}=t,c=_y(t,nA);const[h,u]=(0,s.useState)(!0),[p,g]=(0,s.useState)(!1),{formatMessage:f}=(0,C.useIntl)();return(0,s.useEffect)(()=>{const t=new Image;t.src=e;const i=()=>{u(!1)},n=()=>{u(!1),g(!0)};return t.addEventListener("load",i),t.addEventListener("error",n),()=>{t.removeEventListener("load",i),t.removeEventListener("error",n)}},[e,i,n]),l?r().createElement("img",xy({alt:f({id:"filePreview"})},c,{className:a,src:e})):r().createElement("div",{className:dt()(a,zy),style:{maxWidth:o}},h?r().createElement("div",{className:jy},r().createElement(d.Spin,null)):null,p?r().createElement("div",{className:Uy},f({id:"fileLoadedError"})):r().createElement("img",xy({alt:f({id:"filePreview"})},c,{src:e})))}),rA=["url","maxWidth"],aA=["url","maxWidth","origin","controls","getElement"],oA=t=>{const e=(t||"").split("?")[0].toLowerCase();return/.txt$/.test(e)?"txt":/.pdf$/.test(e)?"pdf":/.(png|jpg|jpeg)$/.test(e)?"image":/.(html|htm)$/.test(e)?"html":/.(doc|docx|xls|xlsx|ppt|pptx|csv)$/.test(e)?"office":/.(mp3|wav|ogg|aac)$/.test(e)?"audio":/.(mp4|avi|mov|mkv|flv)$/.test(e)?"video":"unknown"},lA={txt:eA,pdf:tA,image:sA,html:Qy,office:t=>{var e;let{url:i,apis:n,className:s}=t,o=_y(t,$y);const{apis:c}=(0,a.usePreset)(),h=Object.assign({},c,n);return r().createElement(l(),xy({},(null==(e=h.file)?void 0:e.previewOffice)||{loader:async()=>({data:[{url:"https://view.officeapps.live.com/op/embed.aspx?src=".concat(encodeURIComponent(i)),type:"html"}]})},{render:t=>{let{data:e}=t;const{data:i}=e;return i.map(t=>{let{url:e,type:i}=t;return r().createElement(Jy,xy({},o,{type:i,ignoreContent:!0,url:e,className:s,key:e}))})}}))},audio:t=>{let{url:e,maxWidth:i}=t,n=_y(t,rA);return r().createElement("div",{className:zy,style:{maxWidth:i}},r().createElement("div",{className:Gy},r().createElement("audio",xy({},n,{src:e,controls:!0}))))},video:t=>{let{url:e,maxWidth:i,origin:n,controls:a=!0,getElement:o}=t,l=_y(t,aA);const c=(0,s.useRef)(null),h=(0,x.A)(o);return(0,s.useEffect)(()=>{h(c.current)},[h]),n?r().createElement("video",xy({controls:a},l,{src:e,ref:c})):r().createElement("div",{className:zy,style:{maxWidth:i}},r().createElement("div",{className:qy},r().createElement("video",xy({controls:a},l,{src:e,ref:c}))))},unknown:iA},cA=t=>lA[oA(t)],hA=["data","id","staticUrl","className","fetchApi","filename","render"],dA=My(t=>{let{data:e,id:i,staticUrl:n,className:s,fetchApi:a,filename:o,render:l}=t,c=_y(t,hA);const h=Dy({staticUrl:n,url:e}),d=e&&cA(e)||o&&cA(o);return"function"===typeof l?l({data:e,id:i,staticUrl:n,className:s,fetchApi:a,filename:o,url:h,component:d}):r().createElement(d,xy({},c,{className:s,url:h}))}),uA=["id","src","originName","filename"],pA=t=>{let{id:e,src:i,originName:n,filename:s}=t,a=_y(t,uA);return i?r().createElement(Jy,xy({},a,{url:i,filename:s||n})):r().createElement(dA,xy({},a,{id:e,filename:s||n}))},gA=["content","onSuccess","onError","onBeforePrint","printProps","contentRef"],fA=t=>{let{onSuccess:e,onError:i,onBeforePrint:n,printProps:a,contentRef:o}=t,l=_y(t,gA);const[c,h]=(0,s.useState)(!1),u=(0,Ub.useReactToPrint)(xy({contentRef:o,bodyClass:document.body.getAttribute("class"),onBeforePrint:async function(){h(!0),n&&await n(...arguments)},onPrintError:function(){h(!1),i&&i(...arguments)},onAfterPrint:function(){h(!1),e&&e(...arguments)}},a));return r().createElement(d.Button,xy({},l,{onClick:()=>{h(!0),u()},loading:c}))};var mA=".file-modal-outer {\n min-height: 100px;\n}\n\n.file-title {\n margin-right: 30px;\n}\n\n.ellipse {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n word-break: break-all;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLm1vZHVsZXMuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGlCQUFpQjtBQUNuQjs7QUFFQTtFQUNFLGtCQUFrQjtBQUNwQjs7QUFFQTtFQUNFLGdCQUFnQjtFQUNoQix1QkFBdUI7RUFDdkIsb0JBQW9CO0VBQ3BCLHFCQUFxQjtFQUNyQiw0QkFBNEI7RUFDNUIscUJBQXFCO0FBQ3ZCIiwiZmlsZSI6InN0eWxlLm1vZHVsZXMuc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5maWxlLW1vZGFsLW91dGVyIHtcbiAgbWluLWhlaWdodDogMTAwcHg7XG59XG5cbi5maWxlLXRpdGxlIHtcbiAgbWFyZ2luLXJpZ2h0OiAzMHB4O1xufVxuXG4uZWxsaXBzZSB7XG4gIG92ZXJmbG93OiBoaWRkZW47XG4gIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICBkaXNwbGF5OiAtd2Via2l0LWJveDtcbiAgLXdlYmtpdC1saW5lLWNsYW1wOiAxO1xuICAtd2Via2l0LWJveC1vcmllbnQ6IHZlcnRpY2FsO1xuICB3b3JkLWJyZWFrOiBicmVhay1hbGw7XG59Il19 */";const vA=["title","filename","originName","openDownload","openPrint","id","src","apis"],wA=["renderModal"],bA=(0,C.createIntlProvider)("zh-CN",Oy,"react-file"),yA=t=>{const e=Object.assign({},{renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{renderModal:i}=e,n=(t=>{const e=Object.assign({},{footer:null,openDownload:!1,openPrint:!1},t),{title:i,filename:n,originName:a,openDownload:o,openPrint:l,id:c,src:h,apis:u}=e,p=_y(e,vA),[g,f]=Gb(p,{value:"open",default:"defaultOpen",onChange:"onOpenChange"}),{message:v}=d.App.useApp(),w=(0,s.useRef)();return xy({},p,{open:g,onOpenChange:f,onCancel:()=>{f(!1)},title:r().createElement(d.Space,{size:10,className:mA["file-title"]},r().createElement("span",{className:mA.ellipse},i||n||a),r().createElement("span",null,o&&r().createElement(bA,null,t=>{let{formatMessage:e}=t;return r().createElement(Wy,{className:"btn-no-padding",type:"link",id:c,src:h,apis:u,filename:n||a,onSuccess:()=>{v.success(e({id:"downloadSuccess"}))}})}),l&&["txt","pdf","image","html"].indexOf(oA(n||a))>-1&&r().createElement(fA,{contentRef:w,type:"link",icon:r().createElement(m,null)}))),children:r().createElement("div",{ref:w,className:mA["file-modal-outer"]},r().createElement(pA,{id:c,src:h,filename:n||a,apis:u}))})})(_y(e,wA));return Object.assign({},n,{renderModal:t=>i(Object.assign({},n,t))})},AA=t=>{let{params:e}=t;const{data:i}=e;return new Promise((t,e)=>{const n=new window.Image;n.src=i,n.addEventListener("load",()=>{t(i)}),n.addEventListener("error",t=>{e(t)})})};var EA="_H1zfc",xA="_BAe2W",_A="_9kK1I",kA="_Wwi2N";const CA=["id","src","alt","onClick","loading","error","className","apis","staticUrl"],SA=["id","src","alt","gender","loading","error","className","gap","icon","children","shape","size","width","height","defaultAvatar","apis","staticUrl"],MA=r().createElement(d.Skeleton.Avatar,{shape:"square",active:!0}),TA=r().createElement(Qb,null),PA=r().createElement(iy,null),LA=r().createElement(oy,null),RA=r().createElement(uy,null),DA=t=>{let{data:e,className:i,alt:n,innerLoading:s,loading:o,error:c,innerError:h,children:d,onClick:u,staticUrl:p}=t;var g;const{apis:f}=(0,a.usePreset)(),m=Object.assign({},f),v=Dy({staticUrl:p||(null==(g=m.file)?void 0:g.staticUrl),url:e});return r().createElement(l(),{loader:AA,params:{data:v},error:h||c,loading:s||o,render:t=>{let{data:e}=t;return"function"===typeof d?d({alt:n,className:dt()(i,xA),src:e}):r().createElement("img",{alt:n,className:dt()(i,xA),src:e,onClick:u})}})},FA=My(DA),IA=t=>{let{loading:e,error:i,src:n,id:s,alt:a,className:o,children:l,apis:c,onClick:h,staticUrl:d}=t;const u=(t,e)=>{const i=t.type;return!i&&t.render?t.render(Object.assign({},t.props,e)):r().createElement(i,Object.assign({},t.props,e))},p=e&&u(e,{className:_A}),g=i&&u(i,{className:kA});return s?r().createElement(FA,{alt:a,className:o,id:s,loading:p,innerLoading:p,error:g,innerError:g,apis:c,onClick:h},l):n?r().createElement(DA,{alt:a,className:o,staticUrl:d,data:n,loading:p,error:g,onClick:h},l):g},NA=t=>{const e=Object.assign({},{loading:MA,error:TA},t),{id:i,src:n,alt:s,onClick:a,loading:o,error:l,className:c,apis:h,staticUrl:d}=e,u=_y(e,CA);return r().createElement("div",xy({},u,{className:dt()(c,EA)}),IA({loading:o,error:l,src:n,id:i,alt:s,className:c,apis:h,onClick:a,staticUrl:d}))};NA.Avatar=t=>{const e=Object.assign({},{size:100,defaultAvatar:PA,error:TA,shape:"circle"},t),{id:i,src:n,alt:s,gender:a,loading:o,error:l,className:c,gap:h,icon:u,children:p,shape:g,size:f,width:m,height:v,defaultAvatar:w,apis:b,staticUrl:y}=e,A=_y(e,SA),E=(()=>{const t=m&&v?{style:{width:m,height:v}}:{size:f};let e=g;if(m&&m!==v&&(e="square"),i||n)return IA({loading:o||r().createElement(d.Skeleton.Avatar,{shape:e,active:!0}),staticUrl:y,error:l,src:n,defaultAvatar:w,id:i,alt:s,className:c,apis:b,children:i=>r().createElement(d.Avatar,xy({},i,{gap:h,shape:e},t))});if(a){const i=["F","female","f"].indexOf(a)>-1?LA:["M","male","m"].indexOf(a)>-1?RA:PA;return r().createElement(d.Avatar,xy({},A,{src:i,gap:h,shape:e},t))}return r().createElement(d.Avatar,xy({},A,{gap:h,icon:u,shape:e,size:f,src:w},t),p)})();return r().createElement("div",xy({},A,{className:dt()(c,EA),style:{width:m&&v?m:f,height:m&&v?v:f}}),E)};const OA=t=>{const{item:e,hasPreview:i,getPermission:n,apis:s,onEdit:a,onDelete:o,onPreview:l,renderModal:c}=Object.assign({},{hasPreview:!0,apis:{},getPermission:()=>!0,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{filename:h,id:u,src:p}=e,{onOpenChange:g,renderModal:f}=yA({apis:s,id:u,src:p,filename:h,renderModal:c});return r().createElement(d.Flex,{justify:"end"},i&&n("preview",e)&&r().createElement(r().Fragment,null,r().createElement(d.Button,{type:"text",icon:r().createElement(v.A,null),onClick:()=>{l?l(e):g(!0)}}),f()),n("edit",e)&&r().createElement(my.lV,{type:"text",icon:r().createElement(w.A,null),onClick:()=>a&&a(e)}),n("download",e)&&r().createElement(Wy,{type:"text",id:u,src:p,filename:h}),n("delete",e)&&r().createElement(my.ZF,{type:"text",icon:r().createElement(b.A,null),onClick:()=>o&&o(e)}))};var BA="_yRMtw",WA="_OivOI",zA="_doPR9",jA="_bLeUP",HA="_mZdoa";const UA=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),{className:i,dataSource:n,getPermission:s,infoItemRenders:a,onDelete:o,onEdit:l,apis:c,renderModal:h}=Object.assign({},{infoItemRenders:[t=>t.userName?r().createElement(d.Typography.Text,null,t.userName):null,t=>t.date?r().createElement(d.Typography.Text,null,yy()(t.date).format("YYYY-MM-DD HH:mm:ss")):null],getPermission:()=>!0,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t);return r().createElement(d.List,{className:i,dataSource:n.map((t,e)=>(t.index=e,t)),rowKey:t=>"item_".concat(t.uuid&&"uuid_".concat(t.uuid)||t.id&&"id_".concat(t.id)||t.src&&"src_".concat(t.src)),renderItem:t=>{const{type:i,filename:n}=t;return r().createElement(d.List.Item,{className:BA},r().createElement(d.Row,{justify:"space-between",wrap:!1,className:WA},r().createElement(d.Col,{flex:1},r().createElement("div",{className:zA}),r().createElement(d.Space,{className:"is-block",align:"start",size:4},r().createElement(fy,{type:wy()(null==n?void 0:n.split(".")),size:14}),n||"")),a&&a.map((e,n)=>r().createElement(d.Col,{span:e.span||4,key:n},"uploading"!==i&&("function"===typeof e?e:e.render)(t),r().createElement("div",{className:zA}))),r().createElement(d.Col,{className:HA},"uploading"!==i?r().createElement(OA,{getPermission:s,item:t,apis:c,onDelete:o,renderModal:h,onEdit:l}):r().createElement(d.Space,{className:jA},r().createElement(d.Spin,{size:"small"}),r().createElement(d.Typography.Link,null,e({id:"uploading"}))))))},bordered:!0})}),VA=t=>{const{locale:e}=(0,a.useContext)(),{formatMessage:i}=(0,C.createIntl)({locale:e,namespace:"react-file"}),{multiple:n,fileSize:r,maxLength:o,value:l,concurrentCount:c,onAdd:h,onError:u,onSave:p,onChange:g,onUpload:f}=Object.assign({},{concurrentCount:1,value:[]},t),{apis:m}=(0,a.usePreset)(),{message:v}=d.App.useApp(),[w,b]=(0,s.useState)([]),y=(0,s.useRef)(c),A=(0,s.useMemo)(()=>(t=>{const e=[];let i=0;const n=()=>{if(0!==e.length){if(i<t){const t=e.shift();i+=1,t().finally(()=>{i-=1,n()})}}else i=0};return t=>new Promise(i=>{e.push(()=>{const e=Promise.resolve().then(()=>t());return i(e),e}),n()})})(y.current),[]),E=(0,x.A)(async t=>{const e=o-l.length;1!==o&&!0===n&&t.length>e?v.error(i({id:"maxLengthError"},{maxLength:o})):await Promise.allSettled(t.map(async t=>{if(t.size>1024*r*1024)return void v.error(i({id:"fileSizeError"},{filename:t.name,fileSize:r}));const e=Ey()(),s=n=>{const s=n.message||i({id:"uploadError"},{filename:t.name,error:n.message?":"+n.message:""});v.error(s),u&&u({file:t,error:n,errMsg:s}),b(t=>{const i=t.slice(0),n=i.findIndex(t=>t.uuid===e);return n>-1&&i.splice(n,1),i})};try{var a;b(1===o||!0!==n?[{uuid:e,type:"uploading",filename:t.name}]:i=>{const n=i.slice(0);return n.unshift({uuid:e,type:"uploading",filename:t.name}),n}),h&&await Promise.resolve(h(t));const r=f||(null==(a=m.file)?void 0:a.upload),{data:l}=await A(()=>r({file:t}));if(0!==l.code)return void s(new Error(i({id:"uploadError"},{filename:t.name,error:l.msg?":"+l.msg:""})));const c=p?await Promise.resolve(p(l,t,e)):Object.assign({},l.data,{filename:l.data.filename||l.data.originName||t.name,id:l.data.id,uuid:e});b(t=>{const i=t.slice(0),n=i.findIndex(t=>t.uuid===e);return n>-1&&i.splice(n,1),i}),g(1===o||!0!==n?[c]:t=>{const e=(t||[]).slice(0);return e.push(c),e})}catch(l){s(l)}}))});return{fileList:w,onFileSelected:E}};var GA="_-hhpT",qA="_FyygJ",XA="_hBEXs",YA="_BMSEY";const KA=[".pdf",".jpg",".png",".jpeg",".doc",".docx",".xls",".xlsx",".html",".msg",".eml",".zip"],QA=["children","className","buttonText","accept","multiple","onChange"],ZA=["children"],JA=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),i=(0,s.useRef)(null),n=Object.assign({},{accept:KA,buttonText:e({id:"fileUpload"}),children:t=>{let{children:e}=t,i=_y(t,ZA);return r().createElement(d.Button,xy({icon:r().createElement(A,null)},i),l,e)}},t),{children:a,className:o,buttonText:l,accept:c,multiple:h,onChange:u}=n,p=_y(n,QA);return a(xy({},p,{className:dt()(o,GA),children:!p.disabled&&r().createElement("input",{ref:i,type:"file",accept:c,multiple:h,className:qA,onChange:t=>{const e=[].slice.call(t.target.files,0);0!==e.length&&(i.current.setAttribute("type","text"),i.current.setAttribute("type","file"),u(e))}})}))}),$A=["className","fileSize","maxLength","multiple","size","accept","children","renderTips","showUploadList","onSave","ossUpload","getPermission","concurrentCount","apis","renderModal"];(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),i=Object.assign({},{defaultValue:[],accept:KA,renderTips:t=>t,children:e({id:"fileUpload"}),multiple:!0,showUploadList:!0,maxLength:10,fileSize:30,concurrentCount:10,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{className:n,fileSize:s,maxLength:a,multiple:o,size:l,accept:c,children:h,renderTips:u,showUploadList:p,onSave:g,ossUpload:f,getPermission:m,concurrentCount:v,apis:w,renderModal:b}=i,y=_y(i,$A),[A,E]=Gb(y),x=A||[],{fileList:_,onFileSelected:S}=VA({multiple:o,onSave:g,ossUpload:f,fileSize:s,maxLength:a,value:x,onChange:E,concurrentCount:v});c.map(t=>t.replace(/^\./,"")).join("\u3001");const M=[...x,..._],T=u(e({id:"uploadTips"},{fileSize:s,maxLength:a,accept:c.map(t=>t.replace(/^\./,"")).join(",")}),{fileSize:s,maxLength:a,accept:c});return r().createElement(d.Flex,{vertical:!0,gap:8},r().createElement(d.Flex,{gap:8},r().createElement(JA,xy({},k()(y,["value","onChange"]),{size:l,multiple:o,accept:c,className:n,buttonText:h,onChange:S})),T&&r().createElement("div",{className:YA},T)),p&&M.length>0&&r().createElement(UA,{className:XA,dataSource:M,infoItemRenders:[],getPermission:m||(t=>["delete","preview"].indexOf(t)>-1),onDelete:t=>{const e=x.slice(0),i=e.indexOf(t);i>-1&&e.splice(i,1),E(e)},apis:w,renderModal:b}))})},43373(t,e,i){"use strict";i.d(e,{A:()=>m});var n=i(92099),s=i(48183),r=i(72367),a=i(50171),o=i(42912),l=i(74572),c=i(41705),h=i(94922),d=i.n(h),u=i(31035),p=i.n(u);function g(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var i,n=(0,l.A)(t);if(e){var s=(0,l.A)(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return(0,o.A)(this,i)}}var f=function(t){(0,a.A)(i,t);var e=g(i);function i(){var t;(0,n.A)(this,i);for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];return t=e.call.apply(e,[this].concat(a)),(0,c.A)((0,r.A)(t),"state",{error:null}),t}return(0,s.A)(i,[{key:"componentDidCatch",value:function(t){this.setState(function(){return{error:t}}),this.props.onError(t)}},{key:"render",value:function(){var t=this.props,e=t.errorComponent,i=t.errorRender;return this.state.error?e?d().createElement(e,{error:this.state.error}):i?i(this.state.error):(console.error(this.state.error),null):this.props.children}}]),i}(h.Component);(0,c.A)(f,"propTypes",{onError:p().func,children:p().node,errorComponent:p().elementType,errorRender:p().func}),(0,c.A)(f,"defaultProps",{onError:function(){}});const m=f},50805(t,e,i){"use strict";i.d(e,{A:()=>c});var n=i(94922),s=i(98771),r=i.n(s),a=i(95600),o=i.n(a),l=i(78678);const c=(t,e)=>{const i=(0,n.useRef)(null);i.current=Object.assign({},{time:500,isDebounce:!1},e);const s=(0,n.useRef)(null),a=(0,l.A)(t);return(0,n.useLayoutEffect)(()=>{const t=s.current,e=()=>window.requestAnimationFrame(()=>{t&&a(t)});e();const n=new ResizeObserver((i.current.isDebounce?o():r())(e,i.current.time));return t&&n.observe(t),()=>{n.disconnect()}},[a]),s}},52272(t){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},53986(t,e,i){"use strict";function n(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}i.d(e,{A:()=>n})},64579(t,e,i){var n=i(78913),s=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(s,""):t}},78678(t,e,i){"use strict";i.d(e,{A:()=>s});var n=i(94922);const s=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=(0,n.useRef)(t);return e||(i.current=t),(0,n.useCallback)(function(){return i.current&&i.current(...arguments)},[])}},78913(t){var e=/\s/;t.exports=function(t){for(var i=t.length;i--&&e.test(t.charAt(i)););return i}},85553(t,e,i){"use strict";i.d(e,{Ay:()=>N,ZF:()=>L,lV:()=>E});var n=i(94922),s=i.n(n),r=i(28833),a=i(78678),o=i(86340),l=i(89195),c=i(58612),h=i(54159),d=i.n(h),u=i(20274),p=(i(16052),i(50805)),g=i(26938),f=i.n(g),m=i(73075),v=i.n(m);function w(){return w=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},w.apply(null,arguments)}function b(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}const y=["onClick","children","loading"],A=t=>{const[e,i]=(0,n.useState)(!1),s=(0,a.A)(function(){return i(!0),Promise.resolve(t&&t(...arguments)).then(()=>{i(!1)}).catch(t=>{i(!1),console.error(t)})});return{isLoading:e,setIsLoading:i,callback:s}},E=t=>{let{onClick:e,children:i,loading:n}=t,a=b(t,y);const{isLoading:o,callback:l}=A(e);return s().createElement(r.Button,w({},a,{loading:n||o,onClick:l}),"function"===typeof i?i(n||o):i)};var x="_zIHFy",_="_R-IrF",k="_F1kMl",C="_Iee0d",S="_aGBVE",M="_0oW1K";const T={message:"\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f",confirm:"\u786e\u5b9a",delete:"\u5220\u9664",cancel:"\u53d6\u6d88",more:"\u66f4\u591a"},P=["title","message","isDelete","showCancel","cancelText","onCancel","isModal","okText","placement","children","onClick","getContainer","renderModal"],L=(0,u.createWithIntlProvider)("zh-CN",T,"button-group")(t=>{const{formatMessage:e}=(0,u.useIntl)(),i=Object.assign({},{isDelete:!0},t),{title:o,message:l,isDelete:h,showCancel:p,cancelText:g,onCancel:f,isModal:m,okText:v,placement:y,children:E,onClick:T,getContainer:L,renderModal:R}=i,D=b(i,P),[F,I]=(0,n.useState)(!1),{isLoading:N,callback:O}=A(T),B=(0,a.A)(()=>{I(!0)}),W=s().createElement(r.Flex,{className:k,vertical:!0,gap:8,onClick:t=>{t.stopPropagation()}},o&&s().createElement(r.Flex,{align:"flex-start",gap:8,className:C},h&&s().createElement(c.A,{className:"title-icon"}),o),s().createElement(r.Flex,{align:"flex-start",gap:8,className:d()(S,{[M]:o})},!o&&h?s().createElement(c.A,{className:"title-icon"}):null,l||e({id:"message"}))),z=()=>"function"===typeof E?E(w({},D,{onClick:B})):s().createElement(r.Button,w({},D,{loading:N,onClick:()=>{B()}}),E);if(m){const t={open:F,onCancel:()=>{I(!1),f&&f()},wrapClassName:_,okText:v||e(h?{id:"delete"}:{id:"confirm"}),cancelText:g||e({id:"cancel"}),onOk:t=>(I(!1),O(t)),closable:!1,okButtonProps:{danger:h},getContainer:L,children:W};return s().createElement(s().Fragment,null,"function"===typeof R?R(t):s().createElement(r.Modal,t),z())}return s().createElement(r.Popconfirm,{overlayClassName:d()(x),okButtonProps:{danger:h},title:W,open:F,getPopupContainer:L,onCancel:f,placement:y,showCancel:p,okText:v||e(h?{id:"delete"}:{id:"confirm"}),cancelText:g||e({id:"cancel"}),onOpenChange:I,onConfirm:t=>{O(t)}},z())}),R=v()(t=>{let{amountWidth:e,moreBtnWidth:i,buttonWidthList:n,spaceProps:s,compact:r}=t;const a=r?0:["small","middle","large"].indexOf(s.size)>-1?8*(["small","middle","large"].indexOf(s.size)+1):Number.isInteger(s.size)?s.size:8;let o=0,l=0;for(;e>=l+n[o]+o*a&&o<n.length;)l+=n[o],o+=1;for(;e<l+(o-1)*a+(o<n.length?i+a:0)&&o>0;)l-=n[o-1],o-=1;return o},t=>{let{amountWidth:e,moreBtnWidth:i,buttonWidthList:n,spaceProps:s,compact:r}=t;return"".concat(e).concat(i).concat(n.join(",")).concat(Object.values(s).join(",")).concat(r&&r.toString())});var D={"width-container":"_V58ju","hidden-container":"_XN3o6","hidden-inner":"_-depB","more-link-btn":"_Hh4Wb","menu-list":"_juFTd"};const F=["list","more","moreType","compact","showLength","getPopupContainer","trigger","itemClassName"],I=["className","confirm","buttonComponent","tooltipProps"],N=(0,u.createWithIntlProvider)("zh-CN",T,"button-group")(t=>{const{formatMessage:e}=(0,u.useIntl)(),i=Object.assign({},t),{list:c,more:h,moreType:g,compact:m,showLength:v,getPopupContainer:y,trigger:A,itemClassName:x}=i,_=b(i,F),k=(0,n.useMemo)(()=>c.filter(t=>!(null!=t&&t.hidden)),[c]),C=f()(_,["size","split","align","style"]),[S,M]=(0,n.useState)(k.length&&1),T=Number.isInteger(v)?v:S,P=(0,a.A)(()=>{const t=O.current,e=B.current,i=N.current;if(!t)return;const s=t.querySelectorAll(".button-group-item");if(!s)return;if(0===s.length)return;const r=i.clientWidth,a=e.clientWidth,o=[].map.call(s,t=>t.offsetWidth),l=R({amountWidth:r,moreBtnWidth:a,buttonWidthList:o,spaceProps:C,compact:m});(0,n.startTransition)(()=>{M(l)})}),N=(0,p.A)(P),O=(0,p.A)(P),B=(0,p.A)(P),W=k.slice(T),z=(t,e,i)=>{if("function"===typeof t)return t({key:e,className:d()("button-group-item",D["btn-item"],x)},{isDropdown:i});const{className:n,confirm:a,buttonComponent:o,tooltipProps:l}=t,c=b(t,I),h=a||c.message,u=o||(h?L:E),p=s().createElement(u,w({danger:h&&!1!==c.isDelete},Object.assign({},c,h&&(c.isModal||i)?{isModal:!0}:{},i?{type:"default"}:{}),{key:e,className:d()("button-group-item",n,x)}));return l?s().createElement(r.Tooltip,l,p):p},j=h||("link"===g?s().createElement(r.Button,{type:"link",className:d()("button-group-item",x,D["more-link-btn"])},s().createElement(l.A,{style:{fontSize:"16px"}})):s().createElement(r.Button,null,e({id:"more"}),s().createElement(o.A,null))),H=m?r.Space.Compact:r.Space;return s().createElement(s().Fragment,null,s().createElement("div",{className:D["width-container"],ref:N}),s().createElement("div",{className:D["hidden-container"]},s().createElement("div",{className:D["hidden-inner"],ref:B},j),s().createElement("div",{className:D["hidden-inner"],ref:O},s().createElement(H,C,k.map((t,e)=>s().createElement(n.Fragment,{key:e},z(t,e,!1)))))),s().createElement(H,C,k.slice(0,T).map((t,e)=>s().createElement(n.Fragment,{key:e},z(t,e,!1))),W.length>0&&s().createElement(r.Dropdown,{getPopupContainer:y,trigger:A,rootClassName:D["menu-list"],menu:{items:W.map((t,e)=>({key:e,label:z(t,e,!0)}))}},j)))})},93375(t,e,i){var n=i(36382);t.exports=function(){return n.Date.now()}},95600(t,e,i){var n=i(2316),s=i(93375),r=i(2899),a=Math.max,o=Math.min;t.exports=function(t,e,i){var l,c,h,d,u,p,g=0,f=!1,m=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function w(e){var i=l,n=c;return l=c=void 0,g=e,d=t.apply(n,i)}function b(t){var i=t-p;return void 0===p||i>=e||i<0||m&&t-g>=h}function y(){var t=s();if(b(t))return A(t);u=setTimeout(y,function(t){var i=e-(t-p);return m?o(i,h-(t-g)):i}(t))}function A(t){return u=void 0,v&&l?w(t):(l=c=void 0,d)}function E(){var t=s(),i=b(t);if(l=arguments,c=this,p=t,i){if(void 0===u)return function(t){return g=t,u=setTimeout(y,e),f?w(t):d}(p);if(m)return clearTimeout(u),u=setTimeout(y,e),w(p)}return void 0===u&&(u=setTimeout(y,e)),d}return e=r(e)||0,n(i)&&(f=!!i.leading,h=(m="maxWait"in i)?a(r(i.maxWait)||0,e):h,v="trailing"in i?!!i.trailing:v),E.cancel=function(){void 0!==u&&clearTimeout(u),g=0,l=p=c=u=void 0},E.flush=function(){return void 0===u?d:A(s())},E}},98677(t){"use strict";var e=function(){};t.exports=e},98771(t,e,i){var n=i(95600),s=i(2316);t.exports=function(t,e,i){var r=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return s(i)&&(r="leading"in i?!!i.leading:r,a="trailing"in i?!!i.trailing:a),n(t,e,{leading:r,maxWait:e,trailing:a})}}}]);
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
(self.webpackChunk_kne_components_system_layout=self.webpackChunk_kne_components_system_layout||[]).push([[803],{1251(){},2899(t,e,i){var n=i(64579),s=i(2316),r=i(90931),a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(s(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=s(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var i=o.test(t);return i||l.test(t)?c(t.slice(2),i?2:8):a.test(t)?NaN:+t}},4167(t,e,i){"use strict";var n=i(52272);function s(){}function r(){}r.resetWarningCache=s,t.exports=function(){function t(t,e,i,s,r,a){if(a!==n){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function e(){return t}t.isRequired=t;var i={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:r,resetWarningCache:s};return i.PropTypes=i,i}},15747(t,e,i){var n;"undefined"!=typeof self&&self,t.exports=(n=i(94922),function(){"use strict";var t={155:function(t){t.exports=n}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,i),r.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};i.r(s),i.d(s,{useReactToPrint:function(){return f}});var r=i(155);const a="printWindow";function o(t){let{level:e="error",messages:i,suppressErrors:n=!1}=t;n||("error"===e?console.error(i):"warning"===e?console.warn(i):console.debug(i))}function l(t,e){if(e||!t){const t=document.getElementById(a);t&&document.body.removeChild(t)}}function c(t){return t instanceof Error?t:new Error("Unknown Error")}function h(t,e){const{documentTitle:i,onAfterPrint:n,onPrintError:s,preserveAfterPrint:r,print:a,suppressErrors:h}=e;setTimeout(()=>{var e,d;if(t.contentWindow){function u(){null==n||n(),l(r)}if(t.contentWindow.focus(),a)a(t).then(u).catch(t=>{s?s("print",c(t)):o({messages:["An error was thrown by the specified `print` function"],suppressErrors:h})});else{if(t.contentWindow.print){const p=null!==(d=null===(e=t.contentDocument)||void 0===e?void 0:e.title)&&void 0!==d?d:"",g=t.ownerDocument.title;i&&(t.ownerDocument.title=i,t.contentDocument&&(t.contentDocument.title=i)),t.contentWindow.print(),i&&(t.ownerDocument.title=g,t.contentDocument&&(t.contentDocument.title=p))}else o({messages:["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."],suppressErrors:h});[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(t=>{var e,i;return(null!==(i=null!==(e=navigator.userAgent)&&void 0!==e?e:navigator.vendor)&&void 0!==i?i:"opera"in window&&window.opera).match(t)})?setTimeout(u,500):u()}}else o({messages:["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/MatthewHerbst/react-to-print/issues/"],suppressErrors:h})},500)}function d(t){const e=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null);let n=i.nextNode();for(;n;)e.push(n),n=i.nextNode();return e}function u(t,e,i){const n=d(t),s=d(e);if(n.length===s.length)for(let r=0;r<n.length;r++){const t=n[r],e=s[r],a=t.shadowRoot;if(null!==a){const t=e.attachShadow({mode:a.mode});t.innerHTML=a.innerHTML,u(a,t,i)}}else o({messages:["When cloning shadow root content, source and target elements have different size. `onBeforePrint` likely resolved too early.",t,e],suppressErrors:i})}const p='\n @page {\n /* Remove browser default header (title) and footer (url) */\n margin: 0;\n }\n @media print {\n body {\n /* Tell browsers to print background colors */\n color-adjust: exact; /* Firefox. This is an older version of "print-color-adjust" */\n print-color-adjust: exact; /* Firefox/Safari */\n -webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */\n }\n }\n';function g(t,e,i,n){var s,r,a,l,d;const{contentNode:g,clonedContentNode:f,clonedImgNodes:m,clonedVideoNodes:v,numResourcesToLoad:w,originalCanvasNodes:b}=i,{bodyClass:y,fonts:A,ignoreGlobalStyles:E,pageStyle:x,nonce:_,suppressErrors:k,copyShadowRoots:C}=n;t.onload=null;const S=null!==(s=t.contentDocument)&&void 0!==s?s:null===(r=t.contentWindow)||void 0===r?void 0:r.document;if(S){const i=S.body.appendChild(f);C&&u(g,i,!!k),A&&((null===(a=t.contentDocument)||void 0===a?void 0:a.fonts)&&(null===(l=t.contentWindow)||void 0===l?void 0:l.FontFace)?A.forEach(i=>{const n=new FontFace(i.family,i.source,{weight:i.weight,style:i.style});t.contentDocument.fonts.add(n),n.loaded.then(()=>{e(n)}).catch(t=>{e(n,["Failed loading the font:",n,"Load error:",c(t)])})}):(A.forEach(t=>{e(t)}),o({messages:['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'],suppressErrors:k})));const n=null!=x?x:p,s=S.createElement("style");_&&(s.setAttribute("nonce",_),S.head.setAttribute("nonce",_)),s.appendChild(S.createTextNode(n)),S.head.appendChild(s),y&&S.body.classList.add(...y.split(" "));const r=S.querySelectorAll("canvas");for(let t=0;t<b.length;++t){const e=b[t],i=r[t];if(void 0===i){o({messages:["A canvas element could not be copied for printing, has it loaded? `onBeforePrint` likely resolved too early.",e],suppressErrors:k});continue}const n=i.getContext("2d");n&&n.drawImage(e,0,0)}for(let t=0;t<m.length;t++){const i=m[t],n=i.getAttribute("src");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,n,s,r,a)=>{e(i,["Error loading <img>",i,"Error",a])},t.src=n}else e(i,['Found an <img> tag with an empty "src" attribute. This prevents pre-loading it.',i])}for(let t=0;t<v.length;t++){const i=v[t];i.preload="auto";const n=i.getAttribute("poster");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,s,r,a,o)=>{e(i,["Error loading video poster",n,"for video",i,"Error:",o])},t.src=n}else i.readyState>=2?e(i):i.src?(i.onloadeddata=()=>{e(i)},i.onerror=(t,n,s,r,a)=>{e(i,["Error loading video",i,"Error",a])},i.onstalled=()=>{e(i,["Loading video stalled, skipping",i])}):e(i,["Error loading video, `src` is empty",i])}const h="select",w=g.querySelectorAll(h),M=S.querySelectorAll(h);for(let t=0;t<w.length;t++)M[t].value=w[t].value;if(!E){const i=document.querySelectorAll("style, link[rel~='stylesheet'], link[as='style']");for(let n=0,s=i.length;n<s;++n){const s=i[n];if("style"===s.tagName.toLowerCase()){const e=S.createElement(s.tagName),i=s.sheet;if(i){let r="";try{const t=i.cssRules.length;for(let e=0;e<t;++e)"string"==typeof i.cssRules[e].cssText&&(r+="".concat(i.cssRules[e].cssText,"\r\n"))}catch(t){o({messages:["A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/MatthewHerbst/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.",s,"Original error: ".concat(c(t).message)],level:"warning"})}e.setAttribute("id","react-to-print-".concat(n)),_&&e.setAttribute("nonce",_),e.appendChild(S.createTextNode(r)),S.head.appendChild(e)}}else if(s.getAttribute("href"))if(s.hasAttribute("disabled"))o({messages:["`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:",s],level:"warning"}),e(s);else{const t=S.createElement(s.tagName);for(let e=0,i=s.attributes.length;e<i;++e){const i=s.attributes[e];i&&t.setAttribute(i.nodeName,null!==(d=i.nodeValue)&&void 0!==d?d:"")}t.onload=()=>{e(t)},t.onerror=(i,n,s,r,a)=>{e(t,["Failed to load",t,"Error:",a])},_&&t.setAttribute("nonce",_),S.head.appendChild(t)}else o({messages:["`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:",s],level:"warning"}),e(s)}}}0===w&&h(t,n)}function f(t){let{bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:f,onBeforePrint:m,onPrintError:v,pageStyle:w,preserveAfterPrint:b,print:y,printIframeProps:A,suppressErrors:E}=t;const x=(0,r.useCallback)(t=>{function r(){const r={bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:f,onBeforePrint:m,onPrintError:v,pageStyle:w,preserveAfterPrint:b,print:y,printIframeProps:A,suppressErrors:E},l=function(t){const e=document.createElement("iframe");return e.width="".concat(document.documentElement.clientWidth,"px"),e.height="".concat(document.documentElement.clientHeight,"px"),e.style.position="absolute",e.style.top="-".concat(document.documentElement.clientHeight+100,"px"),e.style.left="-".concat(document.documentElement.clientWidth+100,"px"),e.id=a,e.srcdoc="<!DOCTYPE html>",t&&(t.allow&&(e.allow=t.allow),void 0!==t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),void 0!==t.sandbox&&(e.sandbox=t.sandbox)),e}(A),c=function(t,e){const{contentRef:i,fonts:n,ignoreGlobalStyles:s,suppressErrors:r}=e,a=function(t){let{contentRef:e,optionalContent:i,suppressErrors:n}=t;return i&&"function"==typeof i?(e&&o({level:"warning",messages:['"react-to-print" received a `contentRef` option and an optional-content param passed to its callback. The `contentRef` option will be ignored.']}),i()):e?e.current:void o({messages:['"react-to-print" did not receive a `contentRef` option or a optional-content param pass to its callback.'],suppressErrors:n})}({contentRef:i,optionalContent:t,suppressErrors:r});if(!a)return;const l=a.cloneNode(!0),c=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),h=l.querySelectorAll("img"),d=l.querySelectorAll("video"),u=n?n.length:0;return{contentNode:a,clonedContentNode:l,clonedImgNodes:h,clonedVideoNodes:d,numResourcesToLoad:(s?0:c.length)+h.length+d.length+u,originalCanvasNodes:a.querySelectorAll("canvas")}}(t,r);if(!c)return void o({messages:["There is nothing to print"],suppressErrors:E});const x=function(t,e,i){const{suppressErrors:n}=t,s=[],r=[];return function(a,l){s.includes(a)?o({level:"debug",messages:["Tried to mark a resource that has already been handled",a],suppressErrors:n}):(l?(o({messages:['"react-to-print" was unable to load a resource but will continue attempting to print the page',...l],suppressErrors:n}),r.push(a)):s.push(a),s.length+r.length===e&&h(i,t))}}(r,c.numResourcesToLoad,l);!function(t,e,i,n){t.onload=()=>{g(t,e,i,n)},document.body.appendChild(t)}(l,x,c,r)}l(b,!0),m?m().then(()=>{r()}).catch(t=>{null==v||v("onBeforePrint",c(t))}):r()},[e,i,n,s,d,u,p,f,m,v,w,b,y,E]);return x}return s}())},19495(t,e,i){"use strict";function n(t){var e,i,n,r=2;for("undefined"!=typeof Symbol&&(i=Symbol.asyncIterator,n=Symbol.iterator);r--;){if(i&&null!=(e=t[i]))return e.call(t);if(n&&null!=(e=t[n]))return new s(e.call(t));i="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function s(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then(function(t){return{value:t,done:e}})}return s=function(t){this.s=t,this.n=t.next},s.prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var i=this.s.return;return void 0===i?Promise.resolve({value:t,done:!0}):e(i.apply(this.s,arguments))},throw:function(t){var i=this.s.return;return void 0===i?Promise.reject(t):e(i.apply(this.s,arguments))}},new s(t)}i.d(e,{A:()=>n})},20046(t,e,i){"use strict";i.d(e,{A:()=>tt});var n=i(94922);const s=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const r="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;var a="object"==typeof self&&self&&self.Object===Object&&self;const o=r||a||Function("return this")();const l=function(){return o.Date.now()};var c=/\s/;const h=function(t){for(var e=t.length;e--&&c.test(t.charAt(e)););return e};var d=/^\s+/;const u=function(t){return t?t.slice(0,h(t)+1).replace(d,""):t};const p=o.Symbol;var g=Object.prototype,f=g.hasOwnProperty,m=g.toString,v=p?p.toStringTag:void 0;const w=function(t){var e=f.call(t,v),i=t[v];try{t[v]=void 0;var n=!0}catch(r){}var s=m.call(t);return n&&(e?t[v]=i:delete t[v]),s};var b=Object.prototype.toString;const y=function(t){return b.call(t)};var A=p?p.toStringTag:void 0;const E=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":A&&A in Object(t)?w(t):y(t)};const x=function(t){return null!=t&&"object"==typeof t};const _=function(t){return"symbol"==typeof t||x(t)&&"[object Symbol]"==E(t)};var k=/^[-+]0x[0-9a-f]+$/i,C=/^0b[01]+$/i,S=/^0o[0-7]+$/i,M=parseInt;const T=function(t){if("number"==typeof t)return t;if(_(t))return NaN;if(s(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=s(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=u(t);var i=C.test(t);return i||S.test(t)?M(t.slice(2),i?2:8):k.test(t)?NaN:+t};var P=Math.max,L=Math.min;const R=function(t,e,i){var n,r,a,o,c,h,d=0,u=!1,p=!1,g=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var i=n,s=r;return n=r=void 0,d=e,o=t.apply(s,i)}function m(t){var i=t-h;return void 0===h||i>=e||i<0||p&&t-d>=a}function v(){var t=l();if(m(t))return w(t);c=setTimeout(v,function(t){var i=e-(t-h);return p?L(i,a-(t-d)):i}(t))}function w(t){return c=void 0,g&&n?f(t):(n=r=void 0,o)}function b(){var t=l(),i=m(t);if(n=arguments,r=this,h=t,i){if(void 0===c)return function(t){return d=t,c=setTimeout(v,e),u?f(t):o}(h);if(p)return clearTimeout(c),c=setTimeout(v,e),f(h)}return void 0===c&&(c=setTimeout(v,e)),o}return e=T(e)||0,s(i)&&(u=!!i.leading,a=(p="maxWait"in i)?P(T(i.maxWait)||0,e):a,g="trailing"in i?!!i.trailing:g),b.cancel=function(){void 0!==c&&clearTimeout(c),d=0,n=h=r=c=void 0},b.flush=function(){return void 0===c?o:w(l())},b};const D=function(t,e,i){var n=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return s(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),R(t,e,{leading:n,maxWait:e,trailing:r})};var F=function(){return F=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},F.apply(this,arguments)};function I(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView:window}function N(t){return t&&t.ownerDocument?t.ownerDocument:document}var O=function(t){return Array.prototype.reduce.call(t,function(t,e){var i=e.name.match(/data-simplebar-(.+)/);if(i){var n=i[1].replace(/\W+(.)/g,function(t,e){return e.toUpperCase()});switch(e.value){case"true":t[n]=!0;break;case"false":t[n]=!1;break;case void 0:t[n]=!0;break;default:t[n]=e.value}}return t},{})};function B(t,e){var i;t&&(i=t.classList).add.apply(i,e.split(" "))}function W(t,e){t&&e.split(" ").forEach(function(e){t.classList.remove(e)})}function z(t){return".".concat(t.split(" ").join("."))}var j=!("undefined"===typeof window||!window.document||!window.document.createElement),H=Object.freeze({__proto__:null,addClasses:B,canUseDOM:j,classNamesToQuery:z,getElementDocument:N,getElementWindow:I,getOptions:O,removeClasses:W}),U=null,V=null;function G(){if(null===U){if("undefined"===typeof document)return U=0;var t=document.body,e=document.createElement("div");e.classList.add("simplebar-hide-scrollbar"),t.appendChild(e);var i=e.getBoundingClientRect().right;t.removeChild(e),U=i}return U}j&&window.addEventListener("resize",function(){V!==window.devicePixelRatio&&(V=window.devicePixelRatio,U=null)});var q=I,X=N,Y=O,K=B,Q=W,Z=z,J=function(){function t(e,i){void 0===i&&(i={});var n=this;if(this.removePreventClickId=null,this.minScrollbarWidth=20,this.stopScrollDelay=175,this.isScrolling=!1,this.isMouseEntering=!1,this.isDragging=!1,this.scrollXTicking=!1,this.scrollYTicking=!1,this.wrapperEl=null,this.contentWrapperEl=null,this.contentEl=null,this.offsetEl=null,this.maskEl=null,this.placeholderEl=null,this.heightAutoObserverWrapperEl=null,this.heightAutoObserverEl=null,this.rtlHelpers=null,this.scrollbarWidth=0,this.resizeObserver=null,this.mutationObserver=null,this.elStyles=null,this.isRtl=null,this.mouseX=0,this.mouseY=0,this.onMouseMove=function(){},this.onWindowResize=function(){},this.onStopScrolling=function(){},this.onMouseEntered=function(){},this.onScroll=function(){var t=q(n.el);n.scrollXTicking||(t.requestAnimationFrame(n.scrollX),n.scrollXTicking=!0),n.scrollYTicking||(t.requestAnimationFrame(n.scrollY),n.scrollYTicking=!0),n.isScrolling||(n.isScrolling=!0,K(n.el,n.classNames.scrolling)),n.showScrollbar("x"),n.showScrollbar("y"),n.onStopScrolling()},this.scrollX=function(){n.axis.x.isOverflowing&&n.positionScrollbar("x"),n.scrollXTicking=!1},this.scrollY=function(){n.axis.y.isOverflowing&&n.positionScrollbar("y"),n.scrollYTicking=!1},this._onStopScrolling=function(){Q(n.el,n.classNames.scrolling),n.options.autoHide&&(n.hideScrollbar("x"),n.hideScrollbar("y")),n.isScrolling=!1},this.onMouseEnter=function(){n.isMouseEntering||(K(n.el,n.classNames.mouseEntered),n.showScrollbar("x"),n.showScrollbar("y"),n.isMouseEntering=!0),n.onMouseEntered()},this._onMouseEntered=function(){Q(n.el,n.classNames.mouseEntered),n.options.autoHide&&(n.hideScrollbar("x"),n.hideScrollbar("y")),n.isMouseEntering=!1},this._onMouseMove=function(t){n.mouseX=t.clientX,n.mouseY=t.clientY,(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&n.onMouseMoveForAxis("x"),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&n.onMouseMoveForAxis("y")},this.onMouseLeave=function(){n.onMouseMove.cancel(),(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&n.onMouseLeaveForAxis("x"),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&n.onMouseLeaveForAxis("y"),n.mouseX=-1,n.mouseY=-1},this._onWindowResize=function(){n.scrollbarWidth=n.getScrollbarWidth(),n.hideNativeScrollbar()},this.onPointerEvent=function(t){var e,i;n.axis.x.track.el&&n.axis.y.track.el&&n.axis.x.scrollbar.el&&n.axis.y.scrollbar.el&&(n.axis.x.track.rect=n.axis.x.track.el.getBoundingClientRect(),n.axis.y.track.rect=n.axis.y.track.el.getBoundingClientRect(),(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&(e=n.isWithinBounds(n.axis.x.track.rect)),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&(i=n.isWithinBounds(n.axis.y.track.rect)),(e||i)&&(t.stopPropagation(),"pointerdown"===t.type&&"touch"!==t.pointerType&&(e&&(n.axis.x.scrollbar.rect=n.axis.x.scrollbar.el.getBoundingClientRect(),n.isWithinBounds(n.axis.x.scrollbar.rect)?n.onDragStart(t,"x"):n.onTrackClick(t,"x")),i&&(n.axis.y.scrollbar.rect=n.axis.y.scrollbar.el.getBoundingClientRect(),n.isWithinBounds(n.axis.y.scrollbar.rect)?n.onDragStart(t,"y"):n.onTrackClick(t,"y")))))},this.drag=function(e){var i,s,r,a,o,l,c,h,d,u,p;if(n.draggedAxis&&n.contentWrapperEl){var g=n.axis[n.draggedAxis].track,f=null!==(s=null===(i=g.rect)||void 0===i?void 0:i[n.axis[n.draggedAxis].sizeAttr])&&void 0!==s?s:0,m=n.axis[n.draggedAxis].scrollbar,v=null!==(a=null===(r=n.contentWrapperEl)||void 0===r?void 0:r[n.axis[n.draggedAxis].scrollSizeAttr])&&void 0!==a?a:0,w=parseInt(null!==(l=null===(o=n.elStyles)||void 0===o?void 0:o[n.axis[n.draggedAxis].sizeAttr])&&void 0!==l?l:"0px",10);e.preventDefault(),e.stopPropagation();var b=("y"===n.draggedAxis?e.pageY:e.pageX)-(null!==(h=null===(c=g.rect)||void 0===c?void 0:c[n.axis[n.draggedAxis].offsetAttr])&&void 0!==h?h:0)-n.axis[n.draggedAxis].dragOffset,y=(b="x"===n.draggedAxis&&n.isRtl?(null!==(u=null===(d=g.rect)||void 0===d?void 0:d[n.axis[n.draggedAxis].sizeAttr])&&void 0!==u?u:0)-m.size-b:b)/(f-m.size)*(v-w);"x"===n.draggedAxis&&n.isRtl&&(y=(null===(p=t.getRtlHelpers())||void 0===p?void 0:p.isScrollingToNegative)?-y:y),n.contentWrapperEl[n.axis[n.draggedAxis].scrollOffsetAttr]=y}},this.onEndDrag=function(t){n.isDragging=!1;var e=X(n.el),i=q(n.el);t.preventDefault(),t.stopPropagation(),Q(n.el,n.classNames.dragging),n.onStopScrolling(),e.removeEventListener("mousemove",n.drag,!0),e.removeEventListener("mouseup",n.onEndDrag,!0),n.removePreventClickId=i.setTimeout(function(){e.removeEventListener("click",n.preventClick,!0),e.removeEventListener("dblclick",n.preventClick,!0),n.removePreventClickId=null})},this.preventClick=function(t){t.preventDefault(),t.stopPropagation()},this.el=e,this.options=F(F({},t.defaultOptions),i),this.classNames=F(F({},t.defaultOptions.classNames),i.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,forceVisible:!1,track:{size:null,el:null,rect:null,isVisible:!1},scrollbar:{size:null,el:null,rect:null,isVisible:!1}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,forceVisible:!1,track:{size:null,el:null,rect:null,isVisible:!1},scrollbar:{size:null,el:null,rect:null,isVisible:!1}}},"object"!==typeof this.el||!this.el.nodeName)throw new Error("Argument passed to SimpleBar must be an HTML element instead of ".concat(this.el));this.onMouseMove=D(this._onMouseMove,64),this.onWindowResize=R(this._onWindowResize,64,{leading:!0}),this.onStopScrolling=R(this._onStopScrolling,this.stopScrollDelay),this.onMouseEntered=R(this._onMouseEntered,this.stopScrollDelay),this.init()}return t.getRtlHelpers=function(){if(t.rtlHelpers)return t.rtlHelpers;var e=document.createElement("div");e.innerHTML='<div class="simplebar-dummy-scrollbar-size"><div></div></div>';var i=e.firstElementChild,n=null===i||void 0===i?void 0:i.firstElementChild;if(!n)return null;document.body.appendChild(i),i.scrollLeft=0;var s=t.getOffset(i),r=t.getOffset(n);i.scrollLeft=-999;var a=t.getOffset(n);return document.body.removeChild(i),t.rtlHelpers={isScrollOriginAtZero:s.left!==r.left,isScrollingToNegative:r.left!==a.left},t.rtlHelpers},t.prototype.getScrollbarWidth=function(){try{return this.contentWrapperEl&&"none"===getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:G()}catch(t){return G()}},t.getOffset=function(t){var e=t.getBoundingClientRect(),i=X(t),n=q(t);return{top:e.top+(n.pageYOffset||i.documentElement.scrollTop),left:e.left+(n.pageXOffset||i.documentElement.scrollLeft)}},t.prototype.init=function(){j&&(this.initDOM(),this.rtlHelpers=t.getRtlHelpers(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},t.prototype.initDOM=function(){var t,e;this.wrapperEl=this.el.querySelector(Z(this.classNames.wrapper)),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector(Z(this.classNames.contentWrapper)),this.contentEl=this.options.contentNode||this.el.querySelector(Z(this.classNames.contentEl)),this.offsetEl=this.el.querySelector(Z(this.classNames.offset)),this.maskEl=this.el.querySelector(Z(this.classNames.mask)),this.placeholderEl=this.findChild(this.wrapperEl,Z(this.classNames.placeholder)),this.heightAutoObserverWrapperEl=this.el.querySelector(Z(this.classNames.heightAutoObserverWrapperEl)),this.heightAutoObserverEl=this.el.querySelector(Z(this.classNames.heightAutoObserverEl)),this.axis.x.track.el=this.findChild(this.el,"".concat(Z(this.classNames.track)).concat(Z(this.classNames.horizontal))),this.axis.y.track.el=this.findChild(this.el,"".concat(Z(this.classNames.track)).concat(Z(this.classNames.vertical))),this.axis.x.scrollbar.el=(null===(t=this.axis.x.track.el)||void 0===t?void 0:t.querySelector(Z(this.classNames.scrollbar)))||null,this.axis.y.scrollbar.el=(null===(e=this.axis.y.track.el)||void 0===e?void 0:e.querySelector(Z(this.classNames.scrollbar)))||null,this.options.autoHide||(K(this.axis.x.scrollbar.el,this.classNames.visible),K(this.axis.y.scrollbar.el,this.classNames.visible))},t.prototype.initListeners=function(){var t,e=this,i=q(this.el);if(this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("pointerdown",this.onPointerEvent,!0),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),null===(t=this.contentWrapperEl)||void 0===t||t.addEventListener("scroll",this.onScroll),i.addEventListener("resize",this.onWindowResize),this.contentEl){if(window.ResizeObserver){var n=!1,s=i.ResizeObserver||ResizeObserver;this.resizeObserver=new s(function(){n&&i.requestAnimationFrame(function(){e.recalculate()})}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),i.requestAnimationFrame(function(){n=!0})}this.mutationObserver=new i.MutationObserver(function(){i.requestAnimationFrame(function(){e.recalculate()})}),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})}},t.prototype.recalculate=function(){if(this.heightAutoObserverEl&&this.contentEl&&this.contentWrapperEl&&this.wrapperEl&&this.placeholderEl){var t=q(this.el);this.elStyles=t.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction;var e=this.contentEl.offsetWidth,i=this.heightAutoObserverEl.offsetHeight<=1,n=this.heightAutoObserverEl.offsetWidth<=1||e>0,s=this.contentWrapperEl.offsetWidth,r=this.elStyles.overflowX,a=this.elStyles.overflowY;this.contentEl.style.padding="".concat(this.elStyles.paddingTop," ").concat(this.elStyles.paddingRight," ").concat(this.elStyles.paddingBottom," ").concat(this.elStyles.paddingLeft),this.wrapperEl.style.margin="-".concat(this.elStyles.paddingTop," -").concat(this.elStyles.paddingRight," -").concat(this.elStyles.paddingBottom," -").concat(this.elStyles.paddingLeft);var o=this.contentEl.scrollHeight,l=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=i?"auto":"100%",this.placeholderEl.style.width=n?"".concat(e||l,"px"):"auto",this.placeholderEl.style.height="".concat(o,"px");var c=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=0!==e&&l>e,this.axis.y.isOverflowing=o>c,this.axis.x.isOverflowing="hidden"!==r&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==a&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.hideNativeScrollbar();var h=this.axis.x.isOverflowing?this.scrollbarWidth:0,d=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&l>s-d,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&o>c-h,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el&&(this.axis.x.scrollbar.el.style.width="".concat(this.axis.x.scrollbar.size,"px")),this.axis.y.scrollbar.el&&(this.axis.y.scrollbar.el.style.height="".concat(this.axis.y.scrollbar.size,"px")),this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")}},t.prototype.getScrollbarSize=function(t){var e,i;if(void 0===t&&(t="y"),!this.axis[t].isOverflowing||!this.contentEl)return 0;var n,s=this.contentEl[this.axis[t].scrollSizeAttr],r=null!==(i=null===(e=this.axis[t].track.el)||void 0===e?void 0:e[this.axis[t].offsetSizeAttr])&&void 0!==i?i:0,a=r/s;return n=Math.max(~~(a*r),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(n=Math.min(n,this.options.scrollbarMaxSize)),n},t.prototype.positionScrollbar=function(e){var i,n,s;void 0===e&&(e="y");var r=this.axis[e].scrollbar;if(this.axis[e].isOverflowing&&this.contentWrapperEl&&r.el&&this.elStyles){var a=this.contentWrapperEl[this.axis[e].scrollSizeAttr],o=(null===(i=this.axis[e].track.el)||void 0===i?void 0:i[this.axis[e].offsetSizeAttr])||0,l=parseInt(this.elStyles[this.axis[e].sizeAttr],10),c=this.contentWrapperEl[this.axis[e].scrollOffsetAttr];c="x"===e&&this.isRtl&&(null===(n=t.getRtlHelpers())||void 0===n?void 0:n.isScrollOriginAtZero)?-c:c,"x"===e&&this.isRtl&&(c=(null===(s=t.getRtlHelpers())||void 0===s?void 0:s.isScrollingToNegative)?c:-c);var h=c/(a-l),d=~~((o-r.size)*h);d="x"===e&&this.isRtl?-d+(o-r.size):d,r.el.style.transform="x"===e?"translate3d(".concat(d,"px, 0, 0)"):"translate3d(0, ".concat(d,"px, 0)")}},t.prototype.toggleTrackVisibility=function(t){void 0===t&&(t="y");var e=this.axis[t].track.el,i=this.axis[t].scrollbar.el;e&&i&&this.contentWrapperEl&&(this.axis[t].isOverflowing||this.axis[t].forceVisible?(e.style.visibility="visible",this.contentWrapperEl.style[this.axis[t].overflowAttr]="scroll",this.el.classList.add("".concat(this.classNames.scrollable,"-").concat(t))):(e.style.visibility="hidden",this.contentWrapperEl.style[this.axis[t].overflowAttr]="hidden",this.el.classList.remove("".concat(this.classNames.scrollable,"-").concat(t))),this.axis[t].isOverflowing?i.style.display="block":i.style.display="none")},t.prototype.showScrollbar=function(t){void 0===t&&(t="y"),this.axis[t].isOverflowing&&!this.axis[t].scrollbar.isVisible&&(K(this.axis[t].scrollbar.el,this.classNames.visible),this.axis[t].scrollbar.isVisible=!0)},t.prototype.hideScrollbar=function(t){void 0===t&&(t="y"),this.isDragging||this.axis[t].isOverflowing&&this.axis[t].scrollbar.isVisible&&(Q(this.axis[t].scrollbar.el,this.classNames.visible),this.axis[t].scrollbar.isVisible=!1)},t.prototype.hideNativeScrollbar=function(){this.offsetEl&&(this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-".concat(this.scrollbarWidth,"px"):"0px",this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-".concat(this.scrollbarWidth,"px"):"0px")},t.prototype.onMouseMoveForAxis=function(t){void 0===t&&(t="y");var e=this.axis[t];e.track.el&&e.scrollbar.el&&(e.track.rect=e.track.el.getBoundingClientRect(),e.scrollbar.rect=e.scrollbar.el.getBoundingClientRect(),this.isWithinBounds(e.track.rect)?(this.showScrollbar(t),K(e.track.el,this.classNames.hover),this.isWithinBounds(e.scrollbar.rect)?K(e.scrollbar.el,this.classNames.hover):Q(e.scrollbar.el,this.classNames.hover)):(Q(e.track.el,this.classNames.hover),this.options.autoHide&&this.hideScrollbar(t)))},t.prototype.onMouseLeaveForAxis=function(t){void 0===t&&(t="y"),Q(this.axis[t].track.el,this.classNames.hover),Q(this.axis[t].scrollbar.el,this.classNames.hover),this.options.autoHide&&this.hideScrollbar(t)},t.prototype.onDragStart=function(t,e){var i;void 0===e&&(e="y"),this.isDragging=!0;var n=X(this.el),s=q(this.el),r=this.axis[e].scrollbar,a="y"===e?t.pageY:t.pageX;this.axis[e].dragOffset=a-((null===(i=r.rect)||void 0===i?void 0:i[this.axis[e].offsetAttr])||0),this.draggedAxis=e,K(this.el,this.classNames.dragging),n.addEventListener("mousemove",this.drag,!0),n.addEventListener("mouseup",this.onEndDrag,!0),null===this.removePreventClickId?(n.addEventListener("click",this.preventClick,!0),n.addEventListener("dblclick",this.preventClick,!0)):(s.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},t.prototype.onTrackClick=function(t,e){var i,n,s,r,a=this;void 0===e&&(e="y");var o=this.axis[e];if(this.options.clickOnTrack&&o.scrollbar.el&&this.contentWrapperEl){t.preventDefault();var l=q(this.el);this.axis[e].scrollbar.rect=o.scrollbar.el.getBoundingClientRect();var c=null!==(n=null===(i=this.axis[e].scrollbar.rect)||void 0===i?void 0:i[this.axis[e].offsetAttr])&&void 0!==n?n:0,h=parseInt(null!==(r=null===(s=this.elStyles)||void 0===s?void 0:s[this.axis[e].sizeAttr])&&void 0!==r?r:"0px",10),d=this.contentWrapperEl[this.axis[e].scrollOffsetAttr],u=("y"===e?this.mouseY-c:this.mouseX-c)<0?-1:1,p=-1===u?d-h:d+h,g=function(){a.contentWrapperEl&&(-1===u?d>p&&(d-=40,a.contentWrapperEl[a.axis[e].scrollOffsetAttr]=d,l.requestAnimationFrame(g)):d<p&&(d+=40,a.contentWrapperEl[a.axis[e].scrollOffsetAttr]=d,l.requestAnimationFrame(g)))};g()}},t.prototype.getContentElement=function(){return this.contentEl},t.prototype.getScrollElement=function(){return this.contentWrapperEl},t.prototype.removeListeners=function(){var t=q(this.el);this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("pointerdown",this.onPointerEvent,!0),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.onMouseMove.cancel(),this.onWindowResize.cancel(),this.onStopScrolling.cancel(),this.onMouseEntered.cancel()},t.prototype.unMount=function(){this.removeListeners()},t.prototype.isWithinBounds=function(t){return this.mouseX>=t.left&&this.mouseX<=t.left+t.width&&this.mouseY>=t.top&&this.mouseY<=t.top+t.height},t.prototype.findChild=function(t,e){var i=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector;return Array.prototype.filter.call(t.children,function(t){return i.call(t,e)})[0]},t.rtlHelpers=null,t.defaultOptions={forceVisible:!1,clickOnTrack:!0,scrollbarMinSize:25,scrollbarMaxSize:0,ariaLabel:"scrollable content",tabIndex:0,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging",scrolling:"simplebar-scrolling",scrollable:"simplebar-scrollable",mouseEntered:"simplebar-mouse-entered"},scrollableNode:null,contentNode:null,autoHide:!0},t.getOptions=Y,t.helpers=H,t}(),$=function(){return $=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},$.apply(this,arguments)};var tt=n.forwardRef(function(t,e){var i=t.children,s=t.scrollableNodeProps,r=void 0===s?{}:s,a=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}(t,["children","scrollableNodeProps"]),o=n.useRef(),l=n.useRef(),c=n.useRef(),h={},d={};Object.keys(a).forEach(function(t){Object.prototype.hasOwnProperty.call(J.defaultOptions,t)?h[t]=a[t]:d[t]=a[t]});var u=$($({},J.defaultOptions.classNames),h.classNames),p=$($({},r),{className:"".concat(u.contentWrapper).concat(r.className?" ".concat(r.className):""),tabIndex:h.tabIndex||J.defaultOptions.tabIndex,role:"region","aria-label":h.ariaLabel||J.defaultOptions.ariaLabel});return n.useEffect(function(){var t;return l.current=p.ref?p.ref.current:l.current,o.current&&(t=new J(o.current,$($($({},h),l.current&&{scrollableNode:l.current}),c.current&&{contentNode:c.current})),"function"===typeof e?e(t):e&&(e.current=t)),function(){null===t||void 0===t||t.unMount(),t=null,"function"===typeof e&&e(null)}},[]),n.createElement("div",$({"data-simplebar":"init",ref:o},d),n.createElement("div",{className:u.wrapper},n.createElement("div",{className:u.heightAutoObserverWrapperEl},n.createElement("div",{className:u.heightAutoObserverEl})),n.createElement("div",{className:u.mask},n.createElement("div",{className:u.offset},"function"===typeof i?i({scrollableNodeRef:l,scrollableNodeProps:$($({},p),{ref:l}),contentNodeRef:c,contentNodeProps:{className:u.contentEl,ref:c}}):n.createElement("div",$({},p),n.createElement("div",{className:u.contentEl},i)))),n.createElement("div",{className:u.placeholder})),n.createElement("div",{className:"".concat(u.track," ").concat(u.horizontal)},n.createElement("div",{className:u.scrollbar})),n.createElement("div",{className:"".concat(u.track," ").concat(u.vertical)},n.createElement("div",{className:u.scrollbar})))});tt.displayName="SimpleBar"},31035(t,e,i){t.exports=i(4167)()},32662(t,e,i){"use strict";i.d(e,{A:()=>n});const n={cache:async function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=n.getItem(t);return s||(s=await e(),n.setItem(t,s,i),s)},getItem:t=>{const e=window.localStorage.getItem(t);try{const{dataType:i,value:s,expire:r}=JSON.parse(e);if(r&&Date.now()>r)return n.removeItem(t),null;if("object"===i&&"null"===s)return null;if("undefined"===i)return;return"number"===i?Number(s):"boolean"===i?Boolean(s):s}catch(i){return null}},setItem:function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=typeof e;window.localStorage.setItem(t,JSON.stringify({dataType:n,value:e,expire:i}))},removeItem:t=>{window.localStorage.removeItem(t)}}},33756(t,e,i){"use strict";i.d(e,{_V:()=>NA});var n={};i.r(n),i.d(n,{dU:()=>vg,ng:()=>Jt,EA:()=>zc,Tm:()=>wd,D6:()=>Zh,YE:()=>hd});var s=i(94922),r=i.n(s),a=i(74946),o=i(16052),l=i.n(o),c=i(64755),h=i.n(c),d=i(28833),u=i(12791),p=i(68102);const g={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M820 436h-40c-4.4 0-8 3.6-8 8v40c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-40c0-4.4-3.6-8-8-8zm32-104H732V120c0-4.4-3.6-8-8-8H300c-4.4 0-8 3.6-8 8v212H172c-44.2 0-80 35.8-80 80v328c0 17.7 14.3 32 32 32h168v132c0 4.4 3.6 8 8 8h424c4.4 0 8-3.6 8-8V772h168c17.7 0 32-14.3 32-32V412c0-44.2-35.8-80-80-80zM360 180h304v152H360V180zm304 664H360V568h304v276zm200-140H732V500H292v204H160V412c0-6.6 5.4-12 12-12h680c6.6 0 12 5.4 12 12v292z"}}]},name:"printer",theme:"outlined"};var f=i(52199);const m=s.forwardRef(function(t,e){return s.createElement(f.A,(0,p.A)({},t,{ref:e,icon:g}))});var v=i(56859),w=i(15032),b=i(79111);const y={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"};const A=s.forwardRef(function(t,e){return s.createElement(f.A,(0,p.A)({},t,{ref:e,icon:y}))});var E,x=i(78678),_=i(10238),k=i.n(_),C=i(20274),S=0,M=!1,T=!1,P="[iFrameSizer]",L=null,R=window.requestAnimationFrame,D=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),F={},I=null,N=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){U("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function O(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function B(t,e,i){t.addEventListener(e,i,!1)}function W(t,e,i){t.removeEventListener(e,i,!1)}function z(t){return P+"["+function(t){var e="Host page: "+t;return window.top!==window.self&&(e=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+t:"Nested host page: "+t),e}(t)+"]"}function j(t){return F[t]?F[t].log:M}function H(t,e){V("log",t,e,j(t))}function U(t,e){V("warn",t,e,!0)}function V(t,e,i,n){!0===n&&"object"===typeof window.console&&console[t](z(e),i)}function G(t){function e(){s("Height"),s("Width"),tt(function(){$(p),Q(g),d("onResized",p)},p,"init")}function i(t){return"border-box"!==t.boxSizing?0:(t.paddingTop?parseInt(t.paddingTop,10):0)+(t.paddingBottom?parseInt(t.paddingBottom,10):0)}function n(t){return"border-box"!==t.boxSizing?0:(t.borderTopWidth?parseInt(t.borderTopWidth,10):0)+(t.borderBottomWidth?parseInt(t.borderBottomWidth,10):0)}function s(t){var e=Number(F[g]["max"+t]),i=Number(F[g]["min"+t]),n=t.toLowerCase(),s=Number(p[n]);H(g,"Checking "+n+" is in range "+i+"-"+e),s<i&&(s=i,H(g,"Set "+n+" to min value")),s>e&&(s=e,H(g,"Set "+n+" to max value")),p[n]=""+s}function r(t){return u.slice(u.indexOf(":")+7+t)}function a(t,e){var i,n,s;i=function(){et("Send Page Info","pageInfo:"+function(){var t=document.body.getBoundingClientRect(),e=p.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:e.height,iframeWidth:e.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(e.top-t.top,10),offsetLeft:parseInt(e.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}(),t,e)},n=32,rt[s=e]||(rt[s]=setTimeout(function(){rt[s]=null,i()},n))}function o(t){var e=t.getBoundingClientRect();return K(g),{x:Math.floor(Number(e.left)+Number(L.x)),y:Math.floor(Number(e.top)+Number(L.y))}}function l(t){var e=t?o(p.iframe):{x:0,y:0},i={x:Number(p.width)+e.x,y:Number(p.height)+e.y};H(g,"Reposition requested from iFrame (offset x:"+e.x+" y:"+e.y+")"),window.top===window.self?(L=i,c(),H(g,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(t?"Offset":"")](i.x,i.y):U(g,"Unable to scroll to requested position, window.parentIFrame not found")}function c(){!1===d("onScroll",L)?Z():Q(g)}function h(t){var e={};if(0===Number(p.width)&&0===Number(p.height)){var i=r(9).split(":");e={x:i[1],y:i[0]}}else e={x:p.width,y:p.height};d(t,{iframe:p.iframe,screenX:Number(e.x),screenY:Number(e.y),type:p.type})}function d(t,e){return q(g,t,e)}var u=t.data,p={},g=null;"[iFrameResizerChild]Ready"===u?function(){for(var t in F)et("iFrame requested init",it(t),F[t].iframe,t)}():P===(""+u).slice(0,13)&&u.slice(13).split(":")[0]in F?(p=function(){var t=u.slice(13).split(":"),e=t[1]?parseInt(t[1],10):0,s=F[t[0]]&&F[t[0]].iframe,r=getComputedStyle(s);return{iframe:s,id:t[0],height:e+i(r)+n(r),width:t[2],type:t[3]}}(),g=p.id,F[g]&&(F[g].loaded=!0),!function(){var t=p.type in{true:1,false:1,undefined:1};return t&&H(g,"Ignoring init message from meta parent page"),t}()&&function(t){var e=!0;return F[t]||(e=!1,U(p.type+" No settings for "+t+". Message was: "+u)),e}(g)&&(H(g,"Received: "+u),function(){var t=!0;return null===p.iframe&&(U(g,"IFrame ("+p.id+") not found"),t=!1),t}()&&function(){var e=t.origin,i=F[g]&&F[g].checkOrigin;if(i&&""+e!=="null"&&!(i.constructor===Array?function(){var t=0,n=!1;for(H(g,"Checking connection is from allowed list of origins: "+i);t<i.length;t++)if(i[t]===e){n=!0;break}return n}():function(){var t=F[g]&&F[g].remoteHost;return H(g,"Checking connection is from: "+t),e===t}()))throw new Error("Unexpected message received from: "+e+" for "+p.iframe.id+". Message was: "+t.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(F[g]&&F[g].firstRun&&F[g]&&(F[g].firstRun=!1),p.type){case"close":Y(p.iframe);break;case"message":t=r(6),H(g,"onMessage passed: {iframe: "+p.iframe.id+", message: "+t+"}"),d("onMessage",{iframe:p.iframe,message:JSON.parse(t)}),H(g,"--");break;case"mouseenter":h("onMouseEnter");break;case"mouseleave":h("onMouseLeave");break;case"autoResize":F[g].autoResize=JSON.parse(r(9));break;case"scrollTo":l(!1);break;case"scrollToOffset":l(!0);break;case"pageInfo":a(F[g]&&F[g].iframe,g),function(){function t(t,n){function s(){F[i]?a(F[i].iframe,i):e()}["scroll","resize"].forEach(function(e){H(i,t+e+" listener for sendPageInfo"),n(window,e,s)})}function e(){t("Remove ",W)}var i=g;t("Add ",B),F[i]&&(F[i].stopPageInfo=e)}();break;case"pageInfoStop":F[g]&&F[g].stopPageInfo&&(F[g].stopPageInfo(),delete F[g].stopPageInfo);break;case"inPageLink":!function(t){var e=t.split("#")[1]||"",i=decodeURIComponent(e),n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){var t=o(n);H(g,"Moving to in page link (#"+e+") at x: "+t.x+" y: "+t.y),L={x:t.x,y:t.y},c(),H(g,"--")}():window.top===window.self?H(g,"In page link #"+e+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(e):H(g,"In page link #"+e+" not found and window.parentIFrame not found")}(r(9));break;case"reset":J(p);break;case"init":e(),d("onInit",p.iframe);break;default:0===Number(p.width)&&0===Number(p.height)?U("Unsupported message received ("+p.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):e()}var t}())):function(t,e){V("info",t,e,j(t))}(g,"Ignored: "+u)}function q(t,e,i){var n=null,s=null;if(F[t]){if("function"!==typeof(n=F[t][e]))throw new TypeError(e+" on iFrame["+t+"] is not a function");s=n(i)}return s}function X(t){var e=t.id;delete F[e]}function Y(t){var e=t.id;if(!1!==q(e,"onClose",e)){H(e,"Removing iFrame: "+e);try{t.parentNode&&t.parentNode.removeChild(t)}catch(i){U(i)}q(e,"onClosed",e),H(e,"--"),X(t),E&&(E.disconnect(),E=null)}else H(e,"Close iframe cancelled by onClose event")}function K(t){null===L&&H(t,"Get page position: "+(L={x:void 0===window.pageXOffset?document.documentElement.scrollLeft:window.pageXOffset,y:void 0===window.pageYOffset?document.documentElement.scrollTop:window.pageYOffset}).x+","+L.y)}function Q(t){null!==L&&(window.scrollTo(L.x,L.y),H(t,"Set page position: "+L.x+","+L.y),Z())}function Z(){L=null}function J(t){H(t.id,"Size reset requested by "+("init"===t.type?"host page":"iFrame")),K(t.id),tt(function(){$(t),et("reset","reset",t.iframe,t.id)},t,"reset")}function $(t){function e(e){T||"0"!==t[e]||(T=!0,H(n,"Hidden iFrame detected, creating visibility listener"),function(){function t(){function t(t){function e(e){return"0px"===(F[t]&&F[t].iframe.style[e])}function i(t){return null!==t.offsetParent}F[t]&&i(F[t].iframe)&&(e("height")||e("width"))&&et("Visibility change","resize",F[t].iframe,t)}Object.keys(F).forEach(function(e){t(e)})}function e(e){H("window","Mutation observed: "+e[0].target+" "+e[0].type),st(t,16)}function i(){var t=document.querySelector("body"),i={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};new n(e).observe(t,i)}var n=O();n&&i()}())}function i(i){!function(e){t.id?(t.iframe.style[e]=t[e]+"px",H(t.id,"IFrame ("+n+") "+e+" set to "+t[e]+"px")):H("undefined","messageData id not set")}(i),e(i)}var n=t.iframe.id;F[n]&&(F[n].sizeHeight&&i("height"),F[n].sizeWidth&&i("width"))}function tt(t,e,i){i!==e.type&&R&&!window.jasmine?(H(e.id,"Requesting animation frame"),R(t)):t()}function et(t,e,i,n,s){var r=!1;n=n||i.id,F[n]&&(i&&"contentWindow"in i&&null!==i.contentWindow?function(){var s=F[n]&&F[n].targetOrigin;H(n,"["+t+"] Sending msg to iframe["+n+"] ("+e+") targetOrigin: "+s),i.contentWindow.postMessage(P+e,s)}():U(n,"["+t+"] IFrame("+n+") not found"),s&&F[n]&&F[n].warningTimeout&&(F[n].msgTimeout=setTimeout(function(){!F[n]||F[n].loaded||r||(r=!0,U(n,"IFrame has not responded within "+F[n].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))},F[n].warningTimeout)))}function it(t){return t+":"+F[t].bodyMarginV1+":"+F[t].sizeWidth+":"+F[t].log+":"+F[t].interval+":"+F[t].enablePublicMethods+":"+F[t].autoResize+":"+F[t].bodyMargin+":"+F[t].heightCalculationMethod+":"+F[t].bodyBackground+":"+F[t].bodyPadding+":"+F[t].tolerance+":"+F[t].inPageLinks+":"+F[t].resizeFrom+":"+F[t].widthCalculationMethod+":"+F[t].mouseEvents}function nt(t,e){function i(t){var e=t.split("Callback");if(2===e.length){var i="on"+e[0].charAt(0).toUpperCase()+e[0].slice(1);this[i]=this[t],delete this[t],U(n,"Deprecated: '"+t+"' has been renamed '"+i+"'. The old method will be removed in the next major version.")}}var n=function(i){if("string"!==typeof i)throw new TypeError("Invaild id for iFrame. Expected String");return""===i&&(t.id=i=function(){var t=e&&e.id||N.id+S++;return null!==document.getElementById(t)&&(t+=S++),t}(),M=(e||{}).log,H(i,"Added missing iframe ID: "+i+" ("+t.src+")")),i}(t.id);n in F&&"iFrameResizer"in t?U(n,"Ignored iFrame, already setup."):(!function(e){var s;e=e||{},F[n]=Object.create(null),F[n].iframe=t,F[n].firstRun=!0,F[n].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(t){if("object"!==typeof t)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(i,e),function(t){for(var e in N)Object.prototype.hasOwnProperty.call(N,e)&&(F[n][e]=Object.prototype.hasOwnProperty.call(t,e)?t[e]:N[e])}(e),F[n]&&(F[n].targetOrigin=!0===F[n].checkOrigin?""===(s=F[n].remoteHost)||null!==s.match(/^(about:blank|javascript:|file:\/\/)/)?"*":s:"*")}(e),function(){switch(H(n,"IFrame scrolling "+(F[n]&&F[n].scrolling?"enabled":"disabled")+" for "+n),t.style.overflow=!1===(F[n]&&F[n].scrolling)?"hidden":"auto",F[n]&&F[n].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=F[n]?F[n].scrolling:"no"}}(),function(){function e(e){var i=F[n][e];1/0!==i&&0!==i&&(t.style[e]="number"===typeof i?i+"px":i,H(n,"Set "+e+" = "+t.style[e]))}function i(t){if(F[n]["min"+t]>F[n]["max"+t])throw new Error("Value for min"+t+" can not be greater than max"+t)}i("Height"),i("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!==typeof(F[n]&&F[n].bodyMargin)&&"0"!==(F[n]&&F[n].bodyMargin)||(F[n].bodyMarginV1=F[n].bodyMargin,F[n].bodyMargin=F[n].bodyMargin+"px"),function(e){var i=O();i&&(E=function(e){if(!t.parentNode)return null;var i=new e(function(e){e.forEach(function(e){Array.prototype.slice.call(e.removedNodes).forEach(function(e){e===t&&Y(t)})})});return i.observe(t.parentNode,{childList:!0}),i}(i)),B(t,"load",function(){et("iFrame.onload",e,t,void 0,!0),function(){var e=F[n]&&F[n].firstRun,i=F[n]&&F[n].heightCalculationMethod in D;!e&&i&&J({iframe:t,height:0,width:0,type:"init"})}()}),et("init",e,t,void 0,!0)}(it(n)),F[n]&&(F[n].iframe.iFrameResizer={close:Y.bind(null,F[n].iframe),removeListeners:X.bind(null,F[n].iframe),resize:et.bind(null,"Window resize","resize",F[n].iframe),moveToAnchor:function(t){et("Move to anchor","moveToAnchor:"+t,F[n].iframe,n)},sendMessage:function(t){et("Send Message","message:"+(t=JSON.stringify(t)),F[n].iframe,n)}}))}function st(t,e){null===I&&(I=setTimeout(function(){I=null,t()},e))}var rt={};function at(){"hidden"!==document.visibilityState&&(H("document","Trigger event: Visibility change"),st(function(){ot("Tab Visible","resize")},16))}function ot(t,e){Object.keys(F).forEach(function(i){(function(t){return F[t]&&"parent"===F[t].resizeFrom&&F[t].autoResize&&!F[t].firstRun})(i)&&et(t,e,F[i].iframe,i)})}function lt(){B(window,"message",G),B(window,"resize",function(){var t;H("window","Trigger event: "+(t="resize")),st(function(){ot("Window "+t,"resize")},16)}),B(document,"visibilitychange",at),B(document,"-webkit-visibilitychange",at)}var ct=function(){function t(t,i){i&&(!function(){if(!i.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==i.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+i.tagName+">")}(),nt(i,t),e.push(i))}var e;return function(){var t,e=["moz","webkit","o","ms"];for(t=0;t<e.length&&!R;t+=1)R=window[e[t]+"RequestAnimationFrame"];R?R=R.bind(window):H("setup","RequestAnimationFrame not supported")}(),lt(),function(i,n){switch(e=[],function(t){t&&t.enablePublicMethods&&U("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof n){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(n||"iframe"),t.bind(void 0,i));break;case"object":t(i,n);break;default:throw new TypeError("Unexpected data type ("+typeof n+")")}return e}}(),ht=i(54159),dt=i.n(ht);function ut(t,e,i){e||(e=[]);var n=e.length++;return Object.defineProperty({},"_",{set:function(s){e[n]=s,t.apply(i,e)}})}var pt=i(89379);function gt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ft(t,e){gt(t,e),e.add(t)}function mt(t,e,i){gt(t,e),e.set(t,i)}function vt(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}function wt(t,e,i){return i(vt(t,e))}function bt(t,e){return t.get(vt(t,e))}function yt(t,e,i){return t.set(vt(t,e),i),i}var At,Et,xt,_t,kt,Ct,St,Mt,Tt,Pt,Lt,Rt,Dt,Ft,It,Nt,Ot,Bt,Wt=i(64467),zt=i(19495);const jt="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),Ht=[.001,0,0,.001,0,0],Ut=1.35,Vt=1,Gt=2,qt=4,Xt=16,Yt=32,Kt=64,Qt=128,Zt=256,Jt={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},$t="pdfjs_internal_editor_",te={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},ee={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_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},ie=0,ne=1,se=2,re=3,ae=3,oe=4,le={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},ce={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},he=1,de=2,ue=3,pe=4,ge=5,fe={ERRORS:0,WARNINGS:1,INFOS:5},me={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,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},ve=0,we=1,be=2,ye=3;let Ae=fe.WARNINGS;function Ee(t){Number.isInteger(t)&&(Ae=t)}function xe(){return Ae}function _e(t){Ae>=fe.INFOS&&console.info("Info: ".concat(t))}function ke(t){Ae>=fe.WARNINGS&&console.warn("Warning: ".concat(t))}function Ce(t){throw new Error(t)}function Se(t,e){t||Ce(e)}function Me(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;if(i&&"string"===typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);(null===e||void 0===e?void 0:e.length)>=2&&(t="http://".concat(t))}if(i.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch(s){}}const n=e?URL.parse(t,e):URL.parse(t);return function(t){switch(null===t||void 0===t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n)?n:null}function Te(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=URL.parse(t);return n?(n.hash=e,n.href):i&&Me(t,"http://example.com")?t.split("#",1)[0]+"".concat(e?"#".concat(e):""):""}function Pe(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(t,e,{value:i,enumerable:!n,configurable:!0,writable:!1}),i}const Le=function(){function t(t,e){this.message=t,this.name=e}return t.prototype=new Error,t.constructor=t,t}();class Re extends Le{constructor(t,e){super(t,"PasswordException"),this.code=e}}class De extends Le{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Fe extends Le{constructor(t){super(t,"InvalidPDFException")}}class Ie extends Le{constructor(t,e,i){super(t,"ResponseException"),this.status=e,this.missing=i}}class Ne extends Le{constructor(t){super(t,"FormatError")}}class Oe extends Le{constructor(t){super(t,"AbortException")}}function Be(t){"object"===typeof t&&void 0!==(null===t||void 0===t?void 0:t.length)||Ce("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 We(t){"string"!==typeof t&&Ce("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}class ze{static get isLittleEndian(){return Pe(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return Pe(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return Pe(this,"isOffscreenCanvasSupported","undefined"!==typeof OffscreenCanvas)}static get isImageDecoderSupported(){return Pe(this,"isImageDecoderSupported","undefined"!==typeof ImageDecoder)}static get platform(){const{platform:t,userAgent:e}=navigator;return Pe(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){var t,e;return Pe(this,"isCSSRoundSupported",null===(t=globalThis.CSS)||void 0===t||null===(e=t.supports)||void 0===e?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const je=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class He{static makeHexColor(t,e,i){return"#".concat(je[t]).concat(je[e]).concat(je[i])}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}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 multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=t[i],s=t[i+1];t[i]=n*e[0]+s*e[2]+e[4],t[i+1]=n*e[1]+s*e[3]+e[5]}static applyTransformToBezier(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],l=e[5];for(let c=0;c<6;c+=2){const e=t[i+c],h=t[i+c+1];t[i+c]=e*n+h*r+o,t[i+c+1]=e*s+h*a+l}}static applyInverseTransform(t,e){const i=t[0],n=t[1],s=e[0]*e[3]-e[1]*e[2];t[0]=(i*e[3]-n*e[2]+e[2]*e[5]-e[4]*e[3])/s,t[1]=(-i*e[1]+n*e[0]+e[4]*e[1]-e[5]*e[0])/s}static axialAlignedBoundingBox(t,e,i){const n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],l=e[5],c=t[0],h=t[1],d=t[2],u=t[3];let p=n*c+o,g=p,f=n*d+o,m=f,v=a*h+l,w=v,b=a*u+l,y=b;if(0!==s||0!==r){const t=s*c,e=s*d,i=r*h,n=r*u;p+=i,m+=i,f+=n,g+=n,v+=t,y+=t,b+=e,w+=e}i[0]=Math.min(i[0],p,f,g,m),i[1]=Math.min(i[1],v,b,w,y),i[2]=Math.max(i[2],p,f,g,m),i[3]=Math.max(i[3],v,b,w,y)}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,e){const i=t[0],n=t[1],s=t[2],r=t[3],a=i**2+n**2,o=i*s+n*r,l=s**2+r**2,c=(a+l)/2,h=Math.sqrt(c**2-(a*l-o**2));e[0]=Math.sqrt(c+h||1),e[1]=Math.sqrt(c-h||1)}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 pointBoundingBox(t,e,i){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}static rectBoundingBox(t,e,i,n,s){s[0]=Math.min(s[0],t,i),s[1]=Math.min(s[1],e,n),s[2]=Math.max(s[2],t,i),s[3]=Math.max(s[3],e,n)}static bezierBoundingBox(t,e,i,n,s,r,a,o,l){l[0]=Math.min(l[0],t,a),l[1]=Math.min(l[1],e,o),l[2]=Math.max(l[2],t,a),l[3]=Math.max(l[3],e,o),vt(He,this,Ve).call(this,t,i,s,a,e,n,r,o,3*(3*(i-s)-t+a),6*(t-2*i+s),3*(i-t),l),vt(He,this,Ve).call(this,t,i,s,a,e,n,r,o,3*(3*(n-r)-e+o),6*(e-2*n+r),3*(n-e),l)}}function Ue(t,e,i,n,s,r,a,o,l,c){if(l<=0||l>=1)return;const h=1-l,d=l*l,u=d*l,p=h*(h*(h*t+3*l*e)+3*d*i)+u*n,g=h*(h*(h*s+3*l*r)+3*d*a)+u*o;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],g),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],g)}function Ve(t,e,i,n,s,r,a,o,l,c,h,d){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&vt(At,this,Ue).call(this,t,e,i,n,s,r,a,o,-h/c,d));const u=c**2-4*h*l;if(u<0)return;const p=Math.sqrt(u),g=2*l;vt(At,this,Ue).call(this,t,e,i,n,s,r,a,o,(-c+p)/g,d),vt(At,this,Ue).call(this,t,e,i,n,s,r,a,o,(-c-p)/g,d)}At=He;let Ge=null,qe=null;function Xe(){if("function"===typeof crypto.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),Be(t)}const Ye="pdfjs_internal_id_";function Ke(t,e,i){return Math.min(Math.max(t,e),i)}function Qe(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(Be(t))}"function"!==typeof Promise.try&&(Promise.try=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return new Promise(e=>{e(t(...i))})}),"function"!==typeof Math.sumPrecise&&(Math.sumPrecise=function(t){return t.reduce((t,e)=>t+e,0)});class Ze{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(!Ze.shouldBuildText(r))return;null!==i&&void 0!==i&&null!==(n=i.attributes)&&void 0!==n&&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)}}class Je{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(t){let{html:e,element:i,storage:n=null,intent:s,linkService:r}=t;const{attributes:a}=i,o=e instanceof HTMLAnchorElement;"radio"===a.type&&(a.name="".concat(a.name,"-").concat(s));for(const[l,c]of Object.entries(a))if(null!==c&&void 0!==c)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!o||"href"!==l&&"newWindow"!==l)&&e.setAttribute(l,c)}o&&r.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,i,n)}static render(t){const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,s=t.intent||"display",r=document.createElement(n.name);n.attributes&&this.setAttributes({html:r,element:n,intent:s,linkService:i});const a="richText"!==s,o=t.div;if(o.append(r),t.viewport){const e="matrix(".concat(t.viewport.transform.join(","),")");o.style.transform=e}a&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const t=document.createTextNode(n.value);r.append(t),a&&Ze.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const c=[[n,-1,r]];for(;c.length>0;){var h,d;const[t,n,r]=c.at(-1);if(n+1===t.children.length){c.pop();continue}const o=t.children[++c.at(-1)[1]];if(null===o)continue;const{name:u}=o;if("#text"===u){const t=document.createTextNode(o.value);l.push(t),r.append(t);continue}const p=null!==o&&void 0!==o&&null!==(h=o.attributes)&&void 0!==h&&h.xmlns?document.createElementNS(o.attributes.xmlns,u):document.createElement(u);if(r.append(p),o.attributes&&this.setAttributes({html:p,element:o,storage:e,intent:s,linkService:i}),(null===(d=o.children)||void 0===d?void 0:d.length)>0)c.push([o,-1,p]);else if(o.value){const t=document.createTextNode(o.value);a&&Ze.shouldBuildText(u)&&l.push(t),p.append(t)}}for(const u of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))u.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e="matrix(".concat(t.viewport.transform.join(","),")");t.div.style.transform=e,t.div.hidden=!1}}const $e="http://www.w3.org/2000/svg";class ti{}async function ei(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";if(oi(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)n(new Error(s.statusText));else{switch(e){case"arraybuffer":case"blob":case"json":return void i(s.response)}i(s.responseText)}},s.send(null)})}Et=ti,(0,Wt.A)(ti,"CSS",96),(0,Wt.A)(ti,"PDF",72),(0,Wt.A)(ti,"PDF_TO_CSS_UNITS",Et.CSS/Et.PDF);class ii{constructor(t){let{viewBox:e,userUnit:i,scale:n,rotation:s,offsetX:r=0,offsetY:a=0,dontFlip:o=!1}=t;this.viewBox=e,this.userUnit=i,this.scale=n,this.rotation=s,this.offsetX=r,this.offsetY=a,n*=i;const l=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let h,d,u,p,g,f,m,v;switch(s%=360,s<0&&(s+=360),s){case 180:h=-1,d=0,u=0,p=1;break;case 90:h=0,d=1,u=1,p=0;break;case 270:h=0,d=-1,u=-1,p=0;break;case 0:h=1,d=0,u=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(u=-u,p=-p),0===h?(g=Math.abs(c-e[1])*n+r,f=Math.abs(l-e[0])*n+a,m=(e[3]-e[1])*n,v=(e[2]-e[0])*n):(g=Math.abs(l-e[0])*n+r,f=Math.abs(c-e[1])*n+a,m=(e[2]-e[0])*n,v=(e[3]-e[1])*n),this.transform=[h*n,d*n,u*n,p*n,g-h*n*l-u*n*c,f-d*n*l-p*n*c],this.width=m,this.height=v}get rawDims(){const t=this.viewBox;return Pe(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new ii({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){const i=[t,e];return He.applyTransform(i,this.transform),i}convertToViewportRectangle(t){const e=[t[0],t[1]];He.applyTransform(e,this.transform);const i=[t[2],t[3]];return He.applyTransform(i,this.transform),[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){const i=[t,e];return He.applyInverseTransform(i,this.transform),i}}class ni extends Le{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function si(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function ri(t){return"string"===typeof t&&/\.pdf$/i.test(t)}class ai{constructor(){(0,Wt.A)(this,"started",Object.create(null)),(0,Wt.A)(this,"times",[])}time(t){t in this.started&&ke("Timer is already running for ".concat(t)),this.started[t]=Date.now()}timeEnd(t){t in this.started||ke("Timer has not been started for ".concat(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:i}of this.times)e=Math.max(i.length,e);for(const{name:i,start:n,end:s}of this.times)t.push("".concat(i.padEnd(e)," ").concat(s-n,"ms\n"));return t.join("")}}function oi(t,e){const i=e?URL.parse(t,e):URL.parse(t);return"http:"===(null===i||void 0===i?void 0:i.protocol)||"https:"===(null===i||void 0===i?void 0:i.protocol)}function li(t){t.preventDefault()}function ci(t){t.preventDefault(),t.stopPropagation()}class hi{static toDateObject(t){if(t instanceof Date)return t;if(!t||"string"!==typeof t)return null;vt(hi,this,di)._||(di._=vt(hi,this,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?")));const e=vt(hi,this,di)._.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 c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let h=parseInt(e[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===l?(r+=c,a+=h):"+"===l&&(r-=c,a-=h),new Date(Date.UTC(i,n,s,r,a,o))}}var di={_:void 0};function ui(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):(ke('Not a valid color format: "'.concat(t,'"')),[0,0,0])}function pi(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform();return[e,i,n,s,r,a]}function gi(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 fi(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof ii){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:r}=t,a=ze.isCSSRoundSupported,o="var(--total-scale-factor) * ".concat(n,"px"),l="var(--total-scale-factor) * ".concat(s,"px"),c=a?"round(down, ".concat(o,", var(--scale-round-x))"):"calc(".concat(o,")"),h=a?"round(down, ".concat(l,", var(--scale-round-y))"):"calc(".concat(l,")");i&&e.rotation%180!==0?(r.width=h,r.height=c):(r.width=c,r.height=h)}n&&t.setAttribute("data-main-rotation",e.rotation)}class mi{constructor(){const{pixelRatio:t}=mi;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,r=1/0,a=1/0,o=1/0;(i=mi.capPixels(i,s))>0&&(r=Math.sqrt(i/(t*e))),-1!==n&&(a=n/t,o=n/e);const l=Math.min(r,a,o);return(this.sx>l||this.sy>l)&&(this.sx=l,this.sy=l,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,i):i}return t}}const vi=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class wi{static get isDarkMode(){var t,e;return Pe(this,"isDarkMode",!(null===(t=window)||void 0===t||null===(e=t.matchMedia)||void 0===e||!e.call(t,"(prefers-color-scheme: dark)").matches))}}function bi(t,e){const i=t[0]/255,n=t[1]/255,s=t[2]/255,r=Math.max(i,n,s),a=Math.min(i,n,s),o=(r+a)/2;if(r===a)e[0]=e[1]=0;else{const t=r-a;switch(e[1]=o<.5?t/(r+a):t/(2-r-a),r){case i:e[0]=60*((n-s)/t+(n<s?6:0));break;case n:e[0]=60*((s-i)/t+2);break;case s:e[0]=60*((i-n)/t+4)}}e[2]=o}function yi(t,e){const i=t[0],n=t[1],s=t[2],r=(1-Math.abs(2*s-1))*n,a=r*(1-Math.abs(i/60%2-1)),o=s-r/2;switch(Math.floor(i/60)){case 0:e[0]=r+o,e[1]=a+o,e[2]=o;break;case 1:e[0]=a+o,e[1]=r+o,e[2]=o;break;case 2:e[0]=o,e[1]=r+o,e[2]=a+o;break;case 3:e[0]=o,e[1]=a+o,e[2]=r+o;break;case 4:e[0]=a+o,e[1]=o,e[2]=r+o;break;case 5:case 6:e[0]=r+o,e[1]=o,e[2]=a+o}}function Ai(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function Ei(t,e,i){yi(t,i),i.map(Ai);const n=.2126*i[0]+.7152*i[1]+.0722*i[2];yi(e,i),i.map(Ai);const s=.2126*i[0]+.7152*i[1]+.0722*i[2];return n>s?(n+.05)/(s+.05):(s+.05)/(n+.05)}const xi=new Map;function _i(t,e){let{html:i,dir:n,className:s}=t;const r=document.createDocumentFragment();if("string"===typeof i){const t=document.createElement("p");t.dir=n||"auto";const e=i.split(/(?:\r\n?|\n)/);for(let i=0,n=e.length;i<n;++i){const s=e[i];t.append(document.createTextNode(s)),i<n-1&&t.append(document.createElement("br"))}r.append(t)}else Je.render({xfaHtml:i,div:r,intent:"richText"});r.firstChild.classList.add("richText",s),e.append(r)}var ki=new WeakMap,Ci=new WeakMap,Si=new WeakMap,Mi=new WeakMap,Ti=new WeakMap,Pi=new WeakMap,Li=new WeakMap,Ri=new WeakMap,Di=new WeakSet;class Fi{constructor(t){ft(this,Di),mt(this,ki,null),mt(this,Ci,null),mt(this,Si,void 0),mt(this,Mi,null),mt(this,Ti,null),mt(this,Pi,null),mt(this,Li,null),mt(this,Ri,null),yt(Si,this,t),zi._||(zi._=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"}))}render(){const t=yt(ki,this,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=bt(Si,this)._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",li,{signal:e}),t.addEventListener("pointerdown",Ii,{signal:e}));const i=yt(Mi,this,document.createElement("div"));i.className="buttons",t.append(i);const n=bt(Si,this).toolbarPosition;if(n){const{style:e}=t,i="ltr"===bt(Si,this)._uiManager.direction?1-n[0]:n[0];e.insetInlineEnd="".concat(100*i,"%"),e.top="calc(".concat(100*n[1],"% + var(--editor-toolbar-vert-offset))")}return t}get div(){return bt(ki,this)}hide(){var t;bt(ki,this).classList.add("hidden"),null===(t=bt(Ci,this))||void 0===t||t.hideDropdown()}show(){var t,e;bt(ki,this).classList.remove("hidden"),null===(t=bt(Ti,this))||void 0===t||t.shown(),null===(e=bt(Pi,this))||void 0===e||e.shown()}addDeleteButton(){const{editorType:t,_uiManager:e}=bt(Si,this),i=document.createElement("button");i.classList.add("basic","deleteButton"),i.tabIndex=0,i.setAttribute("data-l10n-id",zi._[t]),vt(Di,this,Bi).call(this,i)&&i.addEventListener("click",t=>{e.delete()},{signal:e._signal}),bt(Mi,this).append(i)}async addAltText(t){const e=await t.render();vt(Di,this,Bi).call(this,e),bt(Mi,this).append(e,wt(Di,this,Wi)),yt(Ti,this,t)}addComment(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(bt(Pi,this))return;const i=t.renderForToolbar();if(!i)return;vt(Di,this,Bi).call(this,i);const n=yt(Li,this,wt(Di,this,Wi));e?(bt(Mi,this).insertBefore(i,e),bt(Mi,this).insertBefore(n,e)):bt(Mi,this).append(i,n),yt(Pi,this,t),t.toolbar=this}addColorPicker(t){if(bt(Ci,this))return;yt(Ci,this,t);const e=t.renderButton();vt(Di,this,Bi).call(this,e),bt(Mi,this).append(e,wt(Di,this,Wi))}async addEditSignatureButton(t){const e=yt(Ri,this,await t.renderEditButton(bt(Si,this)));vt(Di,this,Bi).call(this,e),bt(Mi,this).append(e,wt(Di,this,Wi))}removeButton(t){var e,i;if("comment"===t)null===(e=bt(Pi,this))||void 0===e||e.removeToolbarCommentButton(),yt(Pi,this,null),null===(i=bt(Li,this))||void 0===i||i.remove(),yt(Li,this,null)}async addButton(t,e){switch(t){case"colorPicker":this.addColorPicker(e);break;case"altText":await this.addAltText(e);break;case"editSignature":await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(e)}}async addButtonBefore(t,e,i){const n=bt(Mi,this).querySelector(i);n&&"comment"===t&&this.addComment(e,n)}updateEditSignatureButton(t){bt(Ri,this)&&(bt(Ri,this).title=t)}remove(){var t;bt(ki,this).remove(),null===(t=bt(Ci,this))||void 0===t||t.destroy(),yt(Ci,this,null)}}function Ii(t){t.stopPropagation()}function Ni(t){bt(Si,this)._focusEventsAllowed=!1,ci(t)}function Oi(t){bt(Si,this)._focusEventsAllowed=!0,ci(t)}function Bi(t){const e=bt(Si,this)._uiManager._signal;return e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("focusin",vt(Di,this,Ni).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",vt(Di,this,Oi).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",li,{signal:e}),!0)}function Wi(t){const e=document.createElement("div");return e.className="divider",e}var zi={_:null},ji=new WeakMap,Hi=new WeakMap,Ui=new WeakMap,Vi=new WeakSet;class Gi{constructor(t){ft(this,Vi),mt(this,ji,null),mt(this,Hi,null),mt(this,Ui,void 0),yt(Ui,this,t)}show(t,e,i){const[n,s]=vt(Vi,this,Xi).call(this,e,i),{style:r}=bt(Hi,this)||yt(Hi,this,vt(Vi,this,qi).call(this));t.append(bt(Hi,this)),r.insetInlineEnd="".concat(100*n,"%"),r.top="calc(".concat(100*s,"% + var(--editor-toolbar-vert-offset))")}hide(){bt(Hi,this).remove()}}function qi(){const t=yt(Hi,this,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const e=bt(Ui,this)._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",li,{signal:e});const i=yt(ji,this,document.createElement("div"));return i.className="buttons",t.append(i),bt(Ui,this).hasCommentManager()&&vt(Vi,this,Yi).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{bt(Ui,this).commentSelection("floating_button")}),vt(Vi,this,Yi).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{bt(Ui,this).highlightSelection("floating_button")}),t}function Xi(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]}function Yi(t,e,i,n){const s=document.createElement("button");s.classList.add("basic",t),s.tabIndex=0,s.setAttribute("data-l10n-id",e);const r=document.createElement("span");s.append(r),r.className="visuallyHidden",r.setAttribute("data-l10n-id",i);const a=bt(Ui,this)._signal;a instanceof AbortSignal&&!a.aborted&&(s.addEventListener("contextmenu",li,{signal:a}),s.addEventListener("click",n,{signal:a})),bt(ji,this).append(s)}function Ki(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}var Qi=new WeakMap;class Zi{constructor(){mt(this,Qi,0)}get id(){var t,e;return"".concat($t).concat((yt(Qi,this,(t=bt(Qi,this),e=t++,t)),e))}}var Ji=new WeakMap,$i=new WeakMap,tn=new WeakMap,en=new WeakSet;class nn{constructor(){ft(this,en),mt(this,Ji,Xe()),mt(this,$i,0),mt(this,tn,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 Pe(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 vt(en,this,sn).call(this,"".concat(e,"_").concat(i,"_").concat(n,"_").concat(s),t)}async getFromUrl(t){return vt(en,this,sn).call(this,t,t)}async getFromBlob(t,e){const i=await e;return vt(en,this,sn).call(this,t,i)}async getFromId(t){bt(tn,this)||yt(tn,this,new Map);const e=bt(tn,this).get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:t}=e;return delete e.blobPromise,this.getFromBlob(e.id,t)}return this.getFromUrl(e.url)}getFromCanvas(t,e){var i,n,s;bt(tn,this)||yt(tn,this,new Map);let r=bt(tn,this).get(t);if(null!==(s=r)&&void 0!==s&&s.bitmap)return r.refCounter+=1,r;const a=new OffscreenCanvas(e.width,e.height);return a.getContext("2d").drawImage(e,0,0),r={bitmap:a.transferToImageBitmap(),id:"image_".concat(bt(Ji,this),"_").concat((yt($i,this,(i=bt($i,this),n=i++,i)),n)),refCounter:1,isSvg:!1},bt(tn,this).set(t,r),bt(tn,this).set(r.id,r),r}getSvgUrl(t){const e=bt(tn,this).get(t);return null!==e&&void 0!==e&&e.isSvg?e.svgUrl:null}deleteId(t){var e;bt(tn,this)||yt(tn,this,new Map);const i=bt(tn,this).get(t);if(!i)return;if(i.refCounter-=1,0!==i.refCounter)return;const{bitmap:n}=i;if(!i.url&&!i.file){const t=new OffscreenCanvas(n.width,n.height);t.getContext("bitmaprenderer").transferFromImageBitmap(n),i.blobPromise=t.convertToBlob()}null===(e=n.close)||void 0===e||e.call(n),i.bitmap=null}isValidId(t){return t.startsWith("image_".concat(bt(Ji,this),"_"))}}async function sn(t,e){var i;bt(tn,this)||yt(tn,this,new Map);let n=bt(tn,this).get(t);if(null===n)return null;if(null!==(i=n)&&void 0!==i&&i.bitmap)return n.refCounter+=1,n;try{var s,r;let t;if(n||(n={bitmap:null,id:"image_".concat(bt(Ji,this),"_").concat((yt($i,this,(s=bt($i,this),r=s++,s)),r)),refCounter:0,isSvg:!1}),"string"===typeof e?(n.url=e,t=await ei(e,"blob")):e instanceof File?t=n.file=e:e instanceof Blob&&(t=e),"image/svg+xml"===t.type){const e=xt._isSVGFittingCanvas,i=new FileReader,s=new Image,r=new Promise((t,r)=>{s.onload=()=>{n.bitmap=s,n.isSvg=!0,t()},i.onload=async()=>{const t=n.svgUrl=i.result;s.src=await e?"".concat(t,"#svgView(preserveAspectRatio(none))"):t},s.onerror=i.onerror=r});i.readAsDataURL(t),await r}else n.bitmap=await createImageBitmap(t);n.refCounter=1}catch(a){ke(a),n=null}return bt(tn,this).set(t,n),n&&bt(tn,this).set(n.id,n),n}xt=nn;var rn=new WeakMap,an=new WeakMap,on=new WeakMap,ln=new WeakMap;class cn{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;mt(this,rn,[]),mt(this,an,!1),mt(this,on,void 0),mt(this,ln,-1),yt(on,this,t)}add(t){let{cmd:e,undo:i,post:n,mustExec:s,type:r=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}=t;if(s&&e(),bt(an,this))return;const l={cmd:e,undo:i,post:n,type:r};if(-1===bt(ln,this))return bt(rn,this).length>0&&(bt(rn,this).length=0),yt(ln,this,0),void bt(rn,this).push(l);if(a&&bt(rn,this)[bt(ln,this)].type===r)return o&&(l.undo=bt(rn,this)[bt(ln,this)].undo),void(bt(rn,this)[bt(ln,this)]=l);const c=bt(ln,this)+1;c===bt(on,this)?bt(rn,this).splice(0,1):(yt(ln,this,c),c<bt(rn,this).length&&bt(rn,this).splice(c)),bt(rn,this).push(l)}undo(){if(-1===bt(ln,this))return;yt(an,this,!0);const{undo:t,post:e}=bt(rn,this)[bt(ln,this)];t(),null===e||void 0===e||e(),yt(an,this,!1),yt(ln,this,bt(ln,this)-1)}redo(){if(bt(ln,this)<bt(rn,this).length-1){yt(ln,this,bt(ln,this)+1),yt(an,this,!0);const{cmd:t,post:e}=bt(rn,this)[bt(ln,this)];t(),null===e||void 0===e||e(),yt(an,this,!1)}}hasSomethingToUndo(){return-1!==bt(ln,this)}hasSomethingToRedo(){return bt(ln,this)<bt(rn,this).length-1}cleanType(t){if(-1!==bt(ln,this)){for(let e=bt(ln,this);e>=0;e--)if(bt(rn,this)[e].type!==t)return bt(rn,this).splice(e+1,bt(ln,this)-e),void yt(ln,this,e);bt(rn,this).length=0,yt(ln,this,-1)}}destroy(){yt(rn,this,null)}}var hn=new WeakSet;class dn{constructor(t){ft(this,hn),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=ze.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(vt(hn,this,un).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||ci(e))}}function un(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}class pn{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,ui(n))}e.remove()}(t),Pe(this,"_colors",t)}convert(t){const e=ui(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,n]of this._colors)if(n.every((t,i)=>t===e[i]))return pn._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?He.makeHexColor(...e):t}}(0,Wt.A)(pn,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var gn=new WeakMap,fn=new WeakMap,mn=new WeakMap,vn=new WeakMap,wn=new WeakMap,bn=new WeakMap,yn=new WeakMap,An=new WeakMap,En=new WeakMap,xn=new WeakMap,_n=new WeakMap,kn=new WeakMap,Cn=new WeakMap,Sn=new WeakMap,Mn=new WeakMap,Tn=new WeakMap,Pn=new WeakMap,Ln=new WeakMap,Rn=new WeakMap,Dn=new WeakMap,Fn=new WeakMap,In=new WeakMap,Nn=new WeakMap,On=new WeakMap,Bn=new WeakMap,Wn=new WeakMap,zn=new WeakMap,jn=new WeakMap,Hn=new WeakMap,Un=new WeakMap,Vn=new WeakMap,Gn=new WeakMap,qn=new WeakMap,Xn=new WeakMap,Yn=new WeakMap,Kn=new WeakMap,Qn=new WeakMap,Zn=new WeakMap,Jn=new WeakMap,$n=new WeakMap,ts=new WeakMap,es=new WeakMap,is=new WeakMap,ns=new WeakMap,ss=new WeakMap,rs=new WeakMap,as=new WeakMap,os=new WeakMap,ls=new WeakMap,cs=new WeakSet;class hs{static get _keyboardManager(){const t=hs.prototype,e=t=>bt(rs,t).contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),i=(t,e)=>{let{target:i}=e;if(i instanceof HTMLInputElement){const{type:t}=i;return"text"!==t&&"number"!==t}return!0},n=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return Pe(this,"_keyboardManager",new dn([[["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,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&bt(rs,t).contains(i)&&!t.isEnterHandled}}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&bt(rs,t).contains(document.activeElement)}}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}]]))}constructor(t,e,i,n,s,r,a,o,l,c,h,d,u,p,g,f){ft(this,cs),mt(this,gn,new AbortController),mt(this,fn,null),mt(this,mn,null),mt(this,vn,new Map),mt(this,wn,new Map),mt(this,bn,null),mt(this,yn,null),mt(this,An,null),mt(this,En,new cn),mt(this,xn,null),mt(this,_n,null),mt(this,kn,null),mt(this,Cn,0),mt(this,Sn,new Set),mt(this,Mn,null),mt(this,Tn,null),mt(this,Pn,new Set),(0,Wt.A)(this,"_editorUndoBar",null),mt(this,Ln,!1),mt(this,Rn,!1),mt(this,Dn,!1),mt(this,Fn,null),mt(this,In,null),mt(this,Nn,null),mt(this,On,null),mt(this,Bn,!1),mt(this,Wn,null),mt(this,zn,new Zi),mt(this,jn,!1),mt(this,Hn,!1),mt(this,Un,!1),mt(this,Vn,null),mt(this,Gn,null),mt(this,qn,null),mt(this,Xn,null),mt(this,Yn,null),mt(this,Kn,te.NONE),mt(this,Qn,new Set),mt(this,Zn,null),mt(this,Jn,null),mt(this,$n,null),mt(this,ts,null),mt(this,es,null),mt(this,is,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),mt(this,ns,[0,0]),mt(this,ss,null),mt(this,rs,null),mt(this,as,null),mt(this,os,null),mt(this,ls,null);const m=this._signal=bt(gn,this).signal;yt(rs,this,t),yt(as,this,e),yt(os,this,i),yt(bn,this,n),yt(xn,this,s),yt(Jn,this,r),yt(es,this,o),this._eventBus=a,a._on("editingaction",this.onEditingAction.bind(this),{signal:m}),a._on("pagechanging",this.onPageChanging.bind(this),{signal:m}),a._on("scalechanging",this.onScaleChanging.bind(this),{signal:m}),a._on("rotationchanging",this.onRotationChanging.bind(this),{signal:m}),a._on("setpreference",this.onSetPreference.bind(this),{signal:m}),a._on("switchannotationeditorparams",t=>this.updateParams(t.type,t.value),{signal:m}),window.addEventListener("pointerdown",()=>{yt(Hn,this,!0)},{capture:!0,signal:m}),window.addEventListener("pointerup",()=>{yt(Hn,this,!1)},{capture:!0,signal:m}),vt(cs,this,ms).call(this),vt(cs,this,xs).call(this),vt(cs,this,bs).call(this),yt(yn,this,o.annotationStorage),yt(Fn,this,o.filterFactory),yt($n,this,l),yt(On,this,c||null),yt(Ln,this,h),yt(Rn,this,d),yt(Dn,this,u),yt(Yn,this,p||null),this.viewParameters={realScale:ti.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=g||null,this._supportsPinchToZoom=!1!==f,null===s||void 0===s||s.setSidebarUiManager(this)}destroy(){var t,e,i,n,s,r,a,o,l;null===(t=bt(ls,this))||void 0===t||t.resolve(),yt(ls,this,null),null===(e=bt(gn,this))||void 0===e||e.abort(),yt(gn,this,null),this._signal=null;for(const c of bt(wn,this).values())c.destroy();bt(wn,this).clear(),bt(vn,this).clear(),bt(Pn,this).clear(),null===(i=bt(Xn,this))||void 0===i||i.clear(),yt(fn,this,null),bt(Qn,this).clear(),bt(En,this).destroy(),null===(n=bt(bn,this))||void 0===n||n.destroy(),null===(s=bt(xn,this))||void 0===s||s.destroy(),null===(r=bt(Jn,this))||void 0===r||r.destroy(),null===(a=bt(Wn,this))||void 0===a||a.hide(),yt(Wn,this,null),null===(o=bt(qn,this))||void 0===o||o.destroy(),yt(qn,this,null),yt(mn,this,null),bt(In,this)&&(clearTimeout(bt(In,this)),yt(In,this,null)),bt(ss,this)&&(clearTimeout(bt(ss,this)),yt(ss,this,null)),null===(l=this._editorUndoBar)||void 0===l||l.destroy(),yt(es,this,null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return bt(Yn,this)}get useNewAltTextFlow(){return bt(Rn,this)}get useNewAltTextWhenAddingImage(){return bt(Dn,this)}get hcmFilter(){return Pe(this,"hcmFilter",bt($n,this)?bt(Fn,this).addHCMFilter(bt($n,this).foreground,bt($n,this).background):"none")}get direction(){return Pe(this,"direction",getComputedStyle(bt(rs,this)).direction)}get _highlightColors(){return Pe(this,"_highlightColors",bt(On,this)?new Map(bt(On,this).split(",").map(t=>((t=t.split("=").map(t=>t.trim()))[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return Pe(this,"highlightColors",null);const e=new Map,i=!!bt($n,this);for(const[n,s]of t){const t=n.endsWith("_HCM");i&&t?e.set(n.replace("_HCM",""),s):i||t||e.set(n,s)}return Pe(this,"highlightColors",e)}get highlightColorNames(){return Pe(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),yt(kn,this,t)}setMainHighlightColorPicker(t){yt(qn,this,t)}editAltText(t){var e;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null===(e=bt(bn,this))||void 0===e||e.editAltText(this,t,i)}hasCommentManager(){return!!bt(xn,this)}editComment(t,e,i,n){var s;null===(s=bt(xn,this))||void 0===s||s.showDialog(this,t,e,i,n)}selectComment(t,e){const i=bt(wn,this).get(t),n=null===i||void 0===i?void 0:i.getEditorByUID(e);null===n||void 0===n||n.toggleComment(!0,!0)}updateComment(t){var e;null===(e=bt(xn,this))||void 0===e||e.updateComment(t.getData())}updatePopupColor(t){var e;null===(e=bt(xn,this))||void 0===e||e.updatePopupColor(t)}removeComment(t){var e;null===(e=bt(xn,this))||void 0===e||e.removeComments([t.uid])}toggleComment(t,e){var i;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;null===(i=bt(xn,this))||void 0===i||i.toggleCommentPopup(t,e,n)}makeCommentColor(t,e){var i;return t&&(null===(i=bt(xn,this))||void 0===i?void 0:i.makeCommentColor(t,e))||null}getCommentDialogElement(){var t;return(null===(t=bt(xn,this))||void 0===t?void 0:t.dialogElement)||null}async waitForEditorsRendered(t){if(bt(wn,this).has(t-1))return;const{resolve:e,promise:i}=Promise.withResolvers(),n=i=>{i.pageNumber===t&&(this._eventBus._off("editorsrendered",n),e())};this._eventBus.on("editorsrendered",n),await i}getSignature(t){var e;null===(e=bt(Jn,this))||void 0===e||e.getSignature({uiManager:this,editor:t})}get signatureManager(){return bt(Jn,this)}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference(t){let{name:e,value:i}=t;if("enableNewAltTextWhenAddingImage"===e)yt(Dn,this,i)}onPageChanging(t){let{pageNumber:e}=t;yt(Cn,this,e-1)}focusMainContainer(){bt(rs,this).focus()}findParent(t,e){for(const i of bt(wn,this).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(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];bt(as,this).classList.toggle("noUserSelect",t)}addShouldRescale(t){bt(Pn,this).add(t)}removeShouldRescale(t){bt(Pn,this).delete(t)}onScaleChanging(t){var e;let{scale:i}=t;this.commitOrRemove(),this.viewParameters.realScale=i*ti.PDF_TO_CSS_UNITS;for(const n of bt(Pn,this))n.onScaleChanging();null===(e=bt(kn,this))||void 0===e||e.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:n,anchorOffset:s,focusNode:r,focusOffset:a}=i,o=i.toString(),l=vt(cs,this,ds).call(this,i).closest(".textLayer"),c=this.getSelectionBoxes(l);if(!c)return;i.empty();const h=vt(cs,this,us).call(this,l),d=bt(Kn,this)===te.NONE,u=()=>{const i=null===h||void 0===h?void 0:h.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:c,anchorNode:n,anchorOffset:s,focusNode:r,focusOffset:a,text:o});d&&this.showAllEditors("highlight",!0,!0),e&&(null===i||void 0===i||i.editComment())};d?this.switchToMode(te.HIGHLIGHT,u):u()}commentSelection(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.highlightSelection(t,!0)}getAndRemoveDataFromAnnotationStorage(t){if(!bt(yn,this))return null;const e="".concat($t).concat(t),i=bt(yn,this).getRawValue(e);return i&&bt(yn,this).remove(e),i}addToAnnotationStorage(t){t.isEmpty()||!bt(yn,this)||bt(yn,this).has(t.id)||bt(yn,this).setValue(t.id,t)}a11yAlert(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=bt(os,this);i&&(i.setAttribute("data-l10n-id",t),e?i.setAttribute("data-l10n-args",JSON.stringify(e)):i.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,bt(Bn,this)&&(yt(Bn,this,!1),vt(cs,this,fs).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of bt(Qn,this))if(e.div.contains(t)){yt(Gn,this,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!bt(Gn,this))return;const[t,e]=bt(Gn,this);yt(Gn,this,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){vt(cs,this,bs).call(this),vt(cs,this,As).call(this)}removeEditListeners(){vt(cs,this,ys).call(this),vt(cs,this,Es).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of bt(Tn,this))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 bt(Tn,this))if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){var e;if(t.preventDefault(),null===(e=bt(fn,this))||void 0===e||e.commitOrRemove(),!this.hasSelection)return;const i=[];for(const n of bt(Qn,this)){const t=n.serialize(!0);t&&i.push(t)}0!==i.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const r of e.items)for(const t of bt(Tn,this))if(t.isHandlingMimeForPasting(r.type))return void t.paste(r,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(s){return void ke('paste: "'.concat(s.message,'".'))}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const t=[];for(const r of i){const e=await n.deserialize(r);if(!e)return;t.push(e)}const e=()=>{for(const e of t)vt(cs,this,Ms).call(this,e);vt(cs,this,Ls).call(this,t)},s=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:s,mustExec:!0})}catch(s){ke('paste: "'.concat(s.message,'".'))}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),bt(Kn,this)===te.NONE||this.isEditorHandlingKeyboard||hs._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,bt(Bn,this)&&(yt(Bn,this,!1),vt(cs,this,fs).call(this,"main_toolbar")))}onEditingAction(t){let{name:e}=t;switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu")}}setEditingState(t){t?(vt(cs,this,vs).call(this),vt(cs,this,As).call(this),vt(cs,this,_s).call(this,{isEditing:bt(Kn,this)!==te.NONE,isEmpty:vt(cs,this,Ps).call(this),hasSomethingToUndo:bt(En,this).hasSomethingToUndo(),hasSomethingToRedo:bt(En,this).hasSomethingToRedo(),hasSelectedEditor:!1})):(vt(cs,this,ws).call(this),vt(cs,this,Es).call(this),vt(cs,this,_s).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!bt(Tn,this)){yt(Tn,this,t);for(const t of bt(Tn,this))vt(cs,this,ks).call(this,t.defaultPropertiesToUpdate)}}getId(){return bt(zn,this).id}get currentLayer(){return bt(wn,this).get(bt(Cn,this))}getLayer(t){return bt(wn,this).get(t)}get currentPageIndex(){return bt(Cn,this)}addLayer(t){bt(wn,this).set(t.pageIndex,t),bt(jn,this)?t.enable():t.disable()}removeLayer(t){bt(wn,this).delete(t.pageIndex)}async updateMode(t){var e,i;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(bt(Kn,this)!==t&&(!bt(ls,this)||(await bt(ls,this).promise,bt(ls,this)))){var o,l;if(yt(ls,this,Promise.withResolvers()),null===(e=bt(kn,this))||void 0===e||e.commitOrRemove(),bt(Kn,this)===te.POPUP)null===(o=bt(xn,this))||void 0===o||o.hideSidebar();if(null===(i=bt(xn,this))||void 0===i||i.destroyPopup(),yt(Kn,this,t),t===te.NONE){var c;this.setEditingState(!1),vt(cs,this,Ss).call(this);for(const t of bt(vn,this).values())t.hideStandaloneCommentButton();return null===(c=this._editorUndoBar)||void 0===c||c.hide(),this.toggleComment(null),void bt(ls,this).resolve()}for(const t of bt(vn,this).values())t.addStandaloneCommentButton();if(t===te.SIGNATURE)await(null===(l=bt(Jn,this))||void 0===l?void 0:l.loadSignatures());this.setEditingState(!0),await vt(cs,this,Cs).call(this),this.unselectAll();for(const e of bt(wn,this).values())e.updateMode(t);if(t===te.POPUP){var h;bt(mn,this)||yt(mn,this,await bt(es,this).getAnnotationsByType(new Set(bt(Tn,this).map(t=>t._editorType))));const t=new Set,e=[];for(const i of bt(vn,this).values()){const{annotationElementId:n,hasComment:s,deleted:r}=i;n&&t.add(n),s&&!r&&e.push(i.getData())}for(const i of bt(mn,this)){const{id:n,popupRef:s,contentsObj:r}=i;s&&null!==r&&void 0!==r&&r.str&&!t.has(n)&&!bt(Sn,this).has(n)&&e.push(i)}null===(h=bt(xn,this))||void 0===h||h.showSidebar(e)}if(!n)return s&&this.addNewEditorFromKeyboard(),void bt(ls,this).resolve();for(const t of bt(vn,this).values())t.uid===n?(this.setSelected(t),a?t.editComment():r?t.enterInEditMode():t.focus()):t.unselect();bt(ls,this).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==bt(Kn,this)&&this._eventBus.dispatch("switchannotationeditormode",(0,pt.A)({source:this},t))}updateParams(t,e){if(bt(Tn,this)){switch(t){case ee.CREATE:return void this.currentLayer.addNewEditor(e);case ee.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(bt(ts,this)||yt(ts,this,new Map)).set(t,e),this.showAllEditors("highlight",e)}if(this.hasSelection)for(const i of bt(Qn,this))i.updateParams(t,e);else for(const i of bt(Tn,this))i.updateDefaultParams(t,e)}}showAllEditors(t,e){var i,n;for(const s of bt(vn,this).values())s.editorType===t&&s.show(e);(null===(i=null===(n=bt(ts,this))||void 0===n?void 0:n.get(ee.HIGHLIGHT_SHOW_ALL))||void 0===i||i)!==e&&vt(cs,this,ks).call(this,[[ee.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(bt(Un,this)!==t){yt(Un,this,t);for(const e of bt(wn,this).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}*getEditors(t){for(const e of bt(vn,this).values())e.pageIndex===t&&(yield e)}getEditor(t){return bt(vn,this).get(t)}addEditor(t){bt(vn,this).set(t.id,t)}removeEditor(t){var e,i;(t.div.contains(document.activeElement)&&(bt(In,this)&&clearTimeout(bt(In,this)),yt(In,this,setTimeout(()=>{this.focusMainContainer(),yt(In,this,null)},0))),bt(vn,this).delete(t.id),t.annotationElementId)&&(null===(e=bt(Xn,this))||void 0===e||e.delete(t.annotationElementId));(this.unselect(t),t.annotationElementId&&bt(Sn,this).has(t.annotationElementId))||(null===(i=bt(yn,this))||void 0===i||i.remove(t.id))}addDeletedAnnotationElement(t){bt(Sn,this).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return bt(Sn,this).has(t)}removeDeletedAnnotationElement(t){bt(Sn,this).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){bt(fn,this)!==t&&(yt(fn,this,t),t&&vt(cs,this,ks).call(this,t.propertiesToUpdate))}updateUI(t){wt(cs,this,Ts)===t&&vt(cs,this,ks).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){vt(cs,this,ks).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(bt(Qn,this).has(t))return bt(Qn,this).delete(t),t.unselect(),void vt(cs,this,_s).call(this,{hasSelectedEditor:this.hasSelection});bt(Qn,this).add(t),t.select(),vt(cs,this,ks).call(this,t.propertiesToUpdate),vt(cs,this,_s).call(this,{hasSelectedEditor:!0})}setSelected(t){var e;this.updateToolbar({mode:t.mode,editId:t.id}),null===(e=bt(kn,this))||void 0===e||e.commitOrRemove();for(const i of bt(Qn,this))i!==t&&i.unselect();bt(Qn,this).clear(),bt(Qn,this).add(t),t.select(),vt(cs,this,ks).call(this,t.propertiesToUpdate),vt(cs,this,_s).call(this,{hasSelectedEditor:!0})}isSelected(t){return bt(Qn,this).has(t)}get firstSelectedEditor(){return bt(Qn,this).values().next().value}unselect(t){t.unselect(),bt(Qn,this).delete(t),vt(cs,this,_s).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==bt(Qn,this).size}get isEnterHandled(){return 1===bt(Qn,this).size&&this.firstSelectedEditor.isEnterHandled}undo(){var t;bt(En,this).undo(),vt(cs,this,_s).call(this,{hasSomethingToUndo:bt(En,this).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:vt(cs,this,Ps).call(this)}),null===(t=this._editorUndoBar)||void 0===t||t.hide()}redo(){bt(En,this).redo(),vt(cs,this,_s).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:bt(En,this).hasSomethingToRedo(),isEmpty:vt(cs,this,Ps).call(this)})}addCommands(t){bt(En,this).add(t),vt(cs,this,_s).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:vt(cs,this,Ps).call(this)})}cleanUndoStack(t){bt(En,this).cleanType(t)}delete(){var t;this.commitOrRemove();const e=null===(t=this.currentLayer)||void 0===t?void 0:t.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const i=e?[e]:[...bt(Qn,this)],n=()=>{for(const t of i)vt(cs,this,Ms).call(this,t)};this.addCommands({cmd:()=>{var t;null===(t=this._editorUndoBar)||void 0===t||t.show(n,1===i.length?i[0].editorType:i.length);for(const e of i)e.remove()},undo:n,mustExec:!0})}commitOrRemove(){var t;null===(t=bt(fn,this))||void 0===t||t.commitOrRemove()}hasSomethingToControl(){return bt(fn,this)||this.hasSelection}selectAll(){for(const t of bt(Qn,this))t.commit();vt(cs,this,Ls).call(this,bt(vn,this).values())}unselectAll(){var t;if((!bt(fn,this)||(bt(fn,this).commitOrRemove(),bt(Kn,this)===te.NONE))&&(null===(t=bt(kn,this))||void 0===t||!t.commitOrRemove())&&this.hasSelection){for(const t of bt(Qn,this))t.unselect();bt(Qn,this).clear(),vt(cs,this,_s).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;bt(ns,this)[0]+=t,bt(ns,this)[1]+=e;const[i,n]=bt(ns,this),s=[...bt(Qn,this)];bt(ss,this)&&clearTimeout(bt(ss,this)),yt(ss,this,setTimeout(()=>{yt(ss,this,null),bt(ns,this)[0]=bt(ns,this)[1]=0,this.addCommands({cmd:()=>{for(const t of s)bt(vn,this).has(t.id)&&(t.translateInPage(i,n),t.translationDone())},undo:()=>{for(const t of s)bt(vn,this).has(t.id)&&(t.translateInPage(-i,-n),t.translationDone())},mustExec:!1})},1e3));for(const r of s)r.translateInPage(t,e),r.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),yt(Mn,this,new Map);for(const t of bt(Qn,this))bt(Mn,this).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!bt(Mn,this))return!1;this.disableUserSelect(!1);const t=bt(Mn,this);yt(Mn,this,null);let e=!1;for(const[{x:n,y:s,pageIndex:r},a]of t)a.newX=n,a.newY=s,a.newPageIndex=r,e||(e=n!==a.savedX||s!==a.savedY||r!==a.savedPageIndex);if(!e)return!1;const i=(t,e,i,n)=>{if(bt(vn,this).has(t.id)){const s=bt(wn,this).get(n);s?t._setParentAndPosition(s,e,i):(t.pageIndex=n,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(bt(Mn,this))for(const i of bt(Mn,this).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?void 0:t.shouldGetKeyboardEvents())||1===bt(Qn,this).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return bt(fn,this)===t}getActive(){return bt(fn,this)}getMode(){return bt(Kn,this)}isEditingMode(){return bt(Kn,this)!==te.NONE}get imageManager(){return Pe(this,"imageManager",new nn)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let l=0,c=e.rangeCount;l<c;l++)if(!t.contains(e.getRangeAt(l).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 l=0,c=e.rangeCount;l<c;l++){const t=e.getRangeAt(l);if(!t.collapsed)for(const{x:e,y:i,width:n,height:s}of t.getClientRects())0!==n&&0!==s&&o.push(a(e,i,n,s))}return 0===o.length?null:o}addChangedExistingAnnotation(t){let{annotationElementId:e,id:i}=t;(bt(An,this)||yt(An,this,new Map)).set(e,i)}removeChangedExistingAnnotation(t){var e;let{annotationElementId:i}=t;null===(e=bt(An,this))||void 0===e||e.delete(i)}renderAnnotationElement(t){var e;const i=null===(e=bt(An,this))||void 0===e?void 0:e.get(t.data.id);if(!i)return;const n=bt(yn,this).getRawValue(i);n&&(bt(Kn,this)!==te.NONE||n.hasBeenModified)&&n.renderAnnotationElement(t)}setMissingCanvas(t,e,i){var n;const s=null===(n=bt(Xn,this))||void 0===n?void 0:n.get(t);s&&(s.setCanvas(e,i),bt(Xn,this).delete(t))}addMissingCanvas(t,e){(bt(Xn,this)||yt(Xn,this,new Map)).set(t,e)}}function ds(t){let{anchorNode:e}=t;return e.nodeType===Node.TEXT_NODE?e.parentElement:e}function us(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of bt(wn,this).values())if(i.hasTextLayer(t))return i;return null}function ps(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=vt(cs,this,ds).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(bt(Wn,this)||yt(Wn,this,new Gi(this)),bt(Wn,this).show(e,i,"ltr"===this.direction))}function gs(){var t;const e=document.getSelection();if(!e||e.isCollapsed){var i;if(bt(Zn,this))null===(i=bt(Wn,this))||void 0===i||i.hide(),yt(Zn,this,null),vt(cs,this,_s).call(this,{hasSelectedText:!1});return}const{anchorNode:n}=e;if(n===bt(Zn,this))return;const s=vt(cs,this,ds).call(this,e).closest(".textLayer");var r;if(s){if(null===(t=bt(Wn,this))||void 0===t||t.hide(),yt(Zn,this,n),vt(cs,this,_s).call(this,{hasSelectedText:!0}),(bt(Kn,this)===te.HIGHLIGHT||bt(Kn,this)===te.NONE)&&(bt(Kn,this)===te.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),yt(Bn,this,this.isShiftKeyDown),!this.isShiftKeyDown)){const t=bt(Kn,this)===te.HIGHLIGHT?vt(cs,this,us).call(this,s):null;if(null===t||void 0===t||t.toggleDrawing(),bt(Hn,this)){const e=new AbortController,i=this.combinedSignal(e),n=i=>{"pointerup"===i.type&&0!==i.button||(e.abort(),null===t||void 0===t||t.toggleDrawing(!0),"pointerup"===i.type&&vt(cs,this,fs).call(this,"main_toolbar"))};window.addEventListener("pointerup",n,{signal:i}),window.addEventListener("blur",n,{signal:i})}else null===t||void 0===t||t.toggleDrawing(!0),vt(cs,this,fs).call(this,"main_toolbar")}}else bt(Zn,this)&&(null===(r=bt(Wn,this))||void 0===r||r.hide(),yt(Zn,this,null),vt(cs,this,_s).call(this,{hasSelectedText:!1}))}function fs(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";bt(Kn,this)===te.HIGHLIGHT?this.highlightSelection(t):bt(Ln,this)&&vt(cs,this,ps).call(this)}function ms(){document.addEventListener("selectionchange",vt(cs,this,gs).bind(this),{signal:this._signal})}function vs(){if(bt(Nn,this))return;yt(Nn,this,new AbortController);const t=this.combinedSignal(bt(Nn,this));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}function ws(){var t;null===(t=bt(Nn,this))||void 0===t||t.abort(),yt(Nn,this,null)}function bs(){if(bt(Vn,this))return;yt(Vn,this,new AbortController);const t=this.combinedSignal(bt(Vn,this));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}function ys(){var t;null===(t=bt(Vn,this))||void 0===t||t.abort(),yt(Vn,this,null)}function As(){if(bt(_n,this))return;yt(_n,this,new AbortController);const t=this.combinedSignal(bt(_n,this));document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}function Es(){var t;null===(t=bt(_n,this))||void 0===t||t.abort(),yt(_n,this,null)}function xs(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}function _s(t){Object.entries(t).some(t=>{let[e,i]=t;return bt(is,this)[e]!==i})&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(bt(is,this),t)}),bt(Kn,this)===te.HIGHLIGHT&&!1===t.hasSelectedEditor&&vt(cs,this,ks).call(this,[[ee.HIGHLIGHT_FREE,!0]]))}function ks(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}async function Cs(){if(!bt(jn,this)){yt(jn,this,!0);const t=[];for(const e of bt(wn,this).values())t.push(e.enable());await Promise.all(t);for(const e of bt(vn,this).values())e.enable()}}function Ss(){if(this.unselectAll(),bt(jn,this)){yt(jn,this,!1);for(const t of bt(wn,this).values())t.disable();for(const t of bt(vn,this).values())t.disable()}}function Ms(t){const e=bt(wn,this).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}function Ts(t){let e=null;for(e of bt(Qn,t));return e}function Ps(){if(0===bt(vn,this).size)return!0;if(1===bt(vn,this).size)for(const t of bt(vn,this).values())return t.isEmpty();return!1}function Ls(t){for(const e of bt(Qn,this))e.unselect();bt(Qn,this).clear();for(const e of t)e.isEmpty()||(bt(Qn,this).add(e),e.select());vt(cs,this,_s).call(this,{hasSelectedEditor:this.hasSelection})}(0,Wt.A)(hs,"TRANSLATE_SMALL",1),(0,Wt.A)(hs,"TRANSLATE_BIG",10);var Rs=new WeakMap,Ds=new WeakMap,Fs=new WeakMap,Is=new WeakMap,Ns=new WeakMap,Os=new WeakMap,Bs=new WeakMap,Ws=new WeakMap,zs=new WeakMap,js=new WeakMap,Hs=new WeakMap,Us=new WeakMap,Vs=new WeakSet;class Gs{constructor(t){ft(this,Vs),mt(this,Rs,null),mt(this,Ds,!1),mt(this,Fs,null),mt(this,Is,null),mt(this,Ns,null),mt(this,Os,null),mt(this,Bs,!1),mt(this,Ws,null),mt(this,zs,null),mt(this,js,null),mt(this,Hs,null),mt(this,Us,!1),yt(zs,this,t),yt(Us,this,t._uiManager.useNewAltTextFlow),Ys._||(Ys._=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(t){var e;null!==(e=Gs._l10n)&&void 0!==e||(Gs._l10n=t)}async render(){const t=yt(Fs,this,document.createElement("button"));t.className="altText",t.tabIndex="0";const e=yt(Is,this,document.createElement("span"));t.append(e),bt(Us,this)?(t.classList.add("new"),t.setAttribute("data-l10n-id",Ys._.missing),e.setAttribute("data-l10n-id",Ys._["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=bt(zs,this)._uiManager._signal;t.addEventListener("contextmenu",li,{signal:i}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const n=t=>{t.preventDefault(),bt(zs,this)._uiManager.editAltText(bt(zs,this)),bt(Us,this)&&bt(zs,this)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:wt(Vs,this,qs)}})};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(yt(Bs,this,!0),n(e))},{signal:i}),await vt(Vs,this,Xs).call(this),t}finish(){bt(Fs,this)&&(bt(Fs,this).focus({focusVisible:bt(Bs,this)}),yt(Bs,this,!1))}isEmpty(){return bt(Us,this)?null===bt(Rs,this):!bt(Rs,this)&&!bt(Ds,this)}hasData(){return bt(Us,this)?null!==bt(Rs,this)||!!bt(js,this):this.isEmpty()}get guessedText(){return bt(js,this)}async setGuessedText(t){null===bt(Rs,this)&&(yt(js,this,t),yt(Hs,this,await Gs._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),vt(Vs,this,Xs).call(this))}toggleAltTextBadge(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e;if(!bt(Us,this)||bt(Rs,this))return null===(e=bt(Ws,this))||void 0===e||e.remove(),void yt(Ws,this,null);if(!bt(Ws,this)){const t=yt(Ws,this,document.createElement("div"));t.className="noAltTextBadge",bt(zs,this).div.append(t)}bt(Ws,this).classList.toggle("hidden",!t)}serialize(t){let e=bt(Rs,this);return t||bt(js,this)!==e||(e=bt(Hs,this)),{altText:e,decorative:bt(Ds,this),guessedText:bt(js,this),textWithDisclaimer:bt(Hs,this)}}get data(){return{altText:bt(Rs,this),decorative:bt(Ds,this)}}set data(t){let{altText:e,decorative:i,guessedText:n,textWithDisclaimer:s,cancel:r=!1}=t;n&&(yt(js,this,n),yt(Hs,this,s)),bt(Rs,this)===e&&bt(Ds,this)===i||(r||(yt(Rs,this,e),yt(Ds,this,i)),vt(Vs,this,Xs).call(this))}toggle(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];bt(Fs,this)&&(!t&&bt(Os,this)&&(clearTimeout(bt(Os,this)),yt(Os,this,null)),bt(Fs,this).disabled=!t)}shown(){bt(zs,this)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:wt(Vs,this,qs)}})}destroy(){var t,e;null===(t=bt(Fs,this))||void 0===t||t.remove(),yt(Fs,this,null),yt(Is,this,null),yt(Ns,this,null),null===(e=bt(Ws,this))||void 0===e||e.remove(),yt(Ws,this,null)}}function qs(t){return(bt(Rs,t)?"added":null===bt(Rs,t)&&t.guessedText&&"review")||"missing"}async function Xs(){const t=bt(Fs,this);if(!t)return;if(bt(Us,this)){var e,i;if(t.classList.toggle("done",!!bt(Rs,this)),t.setAttribute("data-l10n-id",Ys._[wt(Vs,this,qs)]),null===(e=bt(Is,this))||void 0===e||e.setAttribute("data-l10n-id",Ys._["".concat(wt(Vs,this,qs),"-label")]),!bt(Rs,this))return void(null===(i=bt(Ns,this))||void 0===i||i.remove())}else{var n;if(!bt(Rs,this)&&!bt(Ds,this))return t.classList.remove("done"),void(null===(n=bt(Ns,this))||void 0===n||n.remove());t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let s=bt(Ns,this);if(!s){yt(Ns,this,s=document.createElement("span")),s.className="tooltip",s.setAttribute("role","tooltip"),s.id="alt-text-tooltip-".concat(bt(zs,this).id);const e=100,i=bt(zs,this)._uiManager._signal;i.addEventListener("abort",()=>{clearTimeout(bt(Os,this)),yt(Os,this,null)},{once:!0}),t.addEventListener("mouseenter",()=>{yt(Os,this,setTimeout(()=>{yt(Os,this,null),bt(Ns,this).classList.add("show"),bt(zs,this)._reportTelemetry({action:"alt_text_tooltip"})},e))},{signal:i}),t.addEventListener("mouseleave",()=>{var t;bt(Os,this)&&(clearTimeout(bt(Os,this)),yt(Os,this,null)),null===(t=bt(Ns,this))||void 0===t||t.classList.remove("show")},{signal:i})}bt(Ds,this)?s.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(s.removeAttribute("data-l10n-id"),s.textContent=bt(Rs,this)),s.parentNode||t.append(s);const r=bt(zs,this).getElementForAltText();null===r||void 0===r||r.setAttribute("aria-describedby",s.id)}var Ys={_:null};(0,Wt.A)(Gs,"_l10n",null);var Ks=new WeakMap,Qs=new WeakMap,Zs=new WeakMap,Js=new WeakMap,$s=new WeakMap,tr=new WeakMap,er=new WeakMap,ir=new WeakMap,nr=new WeakMap,sr=new WeakMap,rr=new WeakSet;class ar{constructor(t){ft(this,rr),mt(this,Ks,null),mt(this,Qs,null),mt(this,Zs,!1),mt(this,Js,null),mt(this,$s,null),mt(this,tr,null),mt(this,er,null),mt(this,ir,null),mt(this,nr,!1),mt(this,sr,null),yt(Js,this,t)}renderForToolbar(){const t=yt(Qs,this,document.createElement("button"));return t.className="comment",vt(rr,this,or).call(this,t,!1)}renderForStandalone(){const t=yt(Ks,this,document.createElement("button"));t.className="annotationCommentButton";const e=bt(Js,this).commentButtonPosition;if(e){const{style:i}=t;i.insetInlineEnd="calc(".concat(100*("ltr"===bt(Js,this)._uiManager.direction?1-e[0]:e[0]),"% - var(--comment-button-dim))"),i.top="calc(".concat(100*e[1],"% - var(--comment-button-dim))");const n=bt(Js,this).commentButtonColor;n&&(i.backgroundColor=n)}return vt(rr,this,or).call(this,t,!0)}focusButton(){setTimeout(()=>{var t,e;null===(t=null!==(e=bt(Ks,this))&&void 0!==e?e:bt(Qs,this))||void 0===t||t.focus()},0)}onUpdatedColor(){if(!bt(Ks,this))return;const t=bt(Js,this).commentButtonColor;t&&(bt(Ks,this).style.backgroundColor=t),bt(Js,this)._uiManager.updatePopupColor(bt(Js,this))}get commentButtonWidth(){var t,e;return(null!==(t=null===(e=bt(Ks,this))||void 0===e?void 0:e.getBoundingClientRect().width)&&void 0!==t?t:0)/bt(Js,this).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(bt(sr,this))return bt(sr,this);if(!bt(Ks,this))return null;const{x:t,y:e,height:i}=bt(Ks,this).getBoundingClientRect(),{x:n,y:s,width:r,height:a}=bt(Js,this).parent.boundingClientRect;return[(t-n)/r,(e+i-s)/a]}set commentPopupPositionInLayer(t){yt(sr,this,t)}hasDefaultPopupPosition(){return null===bt(sr,this)}removeStandaloneCommentButton(){var t;null===(t=bt(Ks,this))||void 0===t||t.remove(),yt(Ks,this,null)}removeToolbarCommentButton(){var t;null===(t=bt(Qs,this))||void 0===t||t.remove(),yt(Qs,this,null)}setCommentButtonStates(t){let{selected:e,hasPopup:i}=t;bt(Ks,this)&&(bt(Ks,this).classList.toggle("selected",e),bt(Ks,this).ariaExpanded=i)}edit(t){const e=this.commentPopupPositionInLayer;let i,n;if(e)[i,n]=e;else{[i,n]=bt(Js,this).commentButtonPosition;const{width:t,height:e,x:s,y:r}=bt(Js,this);i=s+i*t,n=r+n*e}const s=bt(Js,this).parent.boundingClientRect,{x:r,y:a,width:o,height:l}=s;bt(Js,this)._uiManager.editComment(bt(Js,this),r+i*o,a+n*l,(0,pt.A)((0,pt.A)({},t),{},{parentDimensions:s}))}finish(){bt(Qs,this)&&(bt(Qs,this).focus({focusVisible:bt(Zs,this)}),yt(Zs,this,!1))}isDeleted(){return bt(nr,this)||""===bt(er,this)}isEmpty(){return null===bt(er,this)}hasBeenEdited(){return this.isDeleted()||bt(er,this)!==bt($s,this)}serialize(){return this.data}get data(){return{text:bt(er,this),richText:bt(tr,this),date:bt(ir,this),deleted:this.isDeleted()}}set data(t){if(t!==bt(er,this)&&yt(tr,this,null),null===t)return yt(er,this,""),void yt(nr,this,!0);yt(er,this,t),yt(ir,this,new Date),yt(nr,this,!1)}setInitialText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;yt($s,this,t),this.data=t,yt(ir,this,null),yt(tr,this,e)}shown(){}destroy(){var t,e;null===(t=bt(Qs,this))||void 0===t||t.remove(),yt(Qs,this,null),null===(e=bt(Ks,this))||void 0===e||e.remove(),yt(Ks,this,null),yt(er,this,""),yt(tr,this,null),yt(ir,this,null),yt(Js,this,null),yt(Zs,this,!1),yt(nr,this,!1)}}function or(t,e){if(!bt(Js,this)._uiManager.hasCommentManager())return null;t.tabIndex="0",t.ariaHasPopup="dialog",e?(t.ariaControls="commentPopup",t.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(t.ariaControlsElements=[bt(Js,this)._uiManager.getCommentDialogElement()],t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button"));const i=bt(Js,this)._uiManager._signal;if(!(i instanceof AbortSignal)||i.aborted)return t;t.addEventListener("contextmenu",li,{signal:i}),e&&(t.addEventListener("focusin",t=>{bt(Js,this)._focusEventsAllowed=!1,ci(t)},{capture:!0,signal:i}),t.addEventListener("focusout",t=>{bt(Js,this)._focusEventsAllowed=!0,ci(t)},{capture:!0,signal:i})),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const n=e=>{e.preventDefault(),t===bt(Qs,this)?this.edit():bt(Js,this).toggleComment(!0)};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(yt(Zs,this,!0),n(e))},{signal:i}),t.addEventListener("pointerenter",()=>{bt(Js,this).toggleComment(!1,!0)},{signal:i}),t.addEventListener("pointerleave",()=>{bt(Js,this).toggleComment(!1,!1)},{signal:i}),t}var lr=new WeakMap,cr=new WeakMap,hr=new WeakMap,dr=new WeakMap,ur=new WeakMap,pr=new WeakMap,gr=new WeakMap,fr=new WeakMap,mr=new WeakMap,vr=new WeakMap,wr=new WeakMap,br=new WeakMap,yr=new WeakSet;class Ar{constructor(t){let{container:e,isPinchingDisabled:i=null,isPinchingStopped:n=null,onPinchStart:s=null,onPinching:r=null,onPinchEnd:a=null,signal:o}=t;ft(this,yr),mt(this,lr,void 0),mt(this,cr,!1),mt(this,hr,null),mt(this,dr,void 0),mt(this,ur,void 0),mt(this,pr,void 0),mt(this,gr,void 0),mt(this,fr,null),mt(this,mr,void 0),mt(this,vr,null),mt(this,wr,void 0),mt(this,br,null),yt(lr,this,e),yt(hr,this,n),yt(dr,this,i),yt(ur,this,s),yt(pr,this,r),yt(gr,this,a),yt(wr,this,new AbortController),yt(mr,this,AbortSignal.any([o,bt(wr,this).signal])),e.addEventListener("touchstart",vt(yr,this,Er).bind(this),{passive:!1,signal:bt(mr,this)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/mi.pixelRatio}destroy(){var t,e;null===(t=bt(wr,this))||void 0===t||t.abort(),yt(wr,this,null),null===(e=bt(fr,this))||void 0===e||e.abort(),yt(fr,this,null)}}function Er(t){var e,i;if(null!==(e=bt(dr,this))&&void 0!==e&&e.call(this))return;if(1===t.touches.length){if(bt(fr,this))return;const t=yt(fr,this,new AbortController),e=AbortSignal.any([bt(mr,this),t.signal]),i=bt(lr,this),n={capture:!0,signal:e,passive:!1},s=t=>{var e;"touch"===t.pointerType&&(null===(e=bt(fr,this))||void 0===e||e.abort(),yt(fr,this,null))};return i.addEventListener("pointerdown",t=>{"touch"===t.pointerType&&(ci(t),s(t))},n),i.addEventListener("pointerup",s,n),void i.addEventListener("pointercancel",s,n)}if(!bt(br,this)){var n;yt(br,this,new AbortController);const t=AbortSignal.any([bt(mr,this),bt(br,this).signal]),e=bt(lr,this),i={signal:t,capture:!1,passive:!1};e.addEventListener("touchmove",vt(yr,this,xr).bind(this),i);const s=vt(yr,this,_r).bind(this);e.addEventListener("touchend",s,i),e.addEventListener("touchcancel",s,i),i.capture=!0,e.addEventListener("pointerdown",ci,i),e.addEventListener("pointermove",ci,i),e.addEventListener("pointercancel",ci,i),e.addEventListener("pointerup",ci,i),null===(n=bt(ur,this))||void 0===n||n.call(this)}if(ci(t),2!==t.touches.length||null!==(i=bt(hr,this))&&void 0!==i&&i.call(this))return void yt(vr,this,null);let[s,r]=t.touches;s.identifier>r.identifier&&([s,r]=[r,s]),yt(vr,this,{touch0X:s.screenX,touch0Y:s.screenY,touch1X:r.screenX,touch1Y:r.screenY})}function xr(t){var e;if(!bt(vr,this)||2!==t.touches.length)return;ci(t);let[i,n]=t.touches;i.identifier>n.identifier&&([i,n]=[n,i]);const{screenX:s,screenY:r}=i,{screenX:a,screenY:o}=n,l=bt(vr,this),{touch0X:c,touch0Y:h,touch1X:d,touch1Y:u}=l,p=d-c,g=u-h,f=a-s,m=o-r,v=Math.hypot(f,m)||1,w=Math.hypot(p,g)||1;if(!bt(cr,this)&&Math.abs(w-v)<=_t.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=s,l.touch0Y=r,l.touch1X=a,l.touch1Y=o,!bt(cr,this))return void yt(cr,this,!0);const b=[(s+a)/2,(r+o)/2];null===(e=bt(pr,this))||void 0===e||e.call(this,b,w,v)}function _r(t){if(!(t.touches.length>=2)){var e;if(bt(br,this))bt(br,this).abort(),yt(br,this,null),null===(e=bt(gr,this))||void 0===e||e.call(this);bt(vr,this)&&(ci(t),yt(vr,this,null),yt(cr,this,!1))}}_t=Ar;var kr=new WeakMap,Cr=new WeakMap,Sr=new WeakMap,Mr=new WeakMap,Tr=new WeakMap,Pr=new WeakMap,Lr=new WeakMap,Rr=new WeakMap,Dr=new WeakMap,Fr=new WeakMap,Ir=new WeakMap,Nr=new WeakMap,Or=new WeakMap,Br=new WeakMap,Wr=new WeakMap,zr=new WeakMap,jr=new WeakMap,Hr=new WeakMap,Ur=new WeakMap,Vr=new WeakMap,Gr=new WeakMap,qr=new WeakMap,Xr=new WeakMap,Yr=new WeakMap,Kr=new WeakMap,Qr=new WeakMap,Zr=new WeakSet;class Jr{static get _resizerKeyboardManager(){const t=Jr.prototype._resizeWithKeyboard,e=hs.TRANSLATE_SMALL,i=hs.TRANSLATE_BIG;return Pe(this,"_resizerKeyboardManager",new dn([[["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"],Jr.prototype._stopResizingWithKeyboard]]))}constructor(t){ft(this,Zr),mt(this,kr,null),mt(this,Cr,null),mt(this,Sr,null),mt(this,Mr,null),mt(this,Tr,null),mt(this,Pr,!1),mt(this,Lr,null),mt(this,Rr,""),mt(this,Dr,null),mt(this,Fr,null),mt(this,Ir,null),mt(this,Nr,null),mt(this,Or,null),mt(this,Br,""),mt(this,Wr,!1),mt(this,zr,null),mt(this,jr,!1),mt(this,Hr,!1),mt(this,Ur,!1),mt(this,Vr,null),mt(this,Gr,0),mt(this,qr,0),mt(this,Xr,null),mt(this,Yr,null),(0,Wt.A)(this,"isSelected",!1),(0,Wt.A)(this,"_isCopy",!1),(0,Wt.A)(this,"_editToolbar",null),(0,Wt.A)(this,"_initialOptions",Object.create(null)),(0,Wt.A)(this,"_initialData",null),(0,Wt.A)(this,"_isVisible",!0),(0,Wt.A)(this,"_uiManager",null),(0,Wt.A)(this,"_focusEventsAllowed",!0),mt(this,Kr,!1),mt(this,Qr,Jr._zIndex++),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,this.annotationElementId=t.annotationElementId||null,this.creationDate=t.creationDate||new Date,this.modificationDate=t.modificationDate||null;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:s,pageY:r}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[s,r];const[a,o]=this.parentDimensions;this.x=t.x/a,this.y=t.y/o,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return Pe(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new wa({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){var i;if(null!==(i=Jr._l10n)&&void 0!==i||(Jr._l10n=t),Jr._l10nResizer||(Jr._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),-1!==Jr._borderLineWidth)return;const n=getComputedStyle(document.documentElement);Jr._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Ce("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return bt(Kr,this)}set _isDraggable(t){var e;yt(Kr,this,t),null===(e=this.div)||void 0===e||e.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}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=bt(Qr,this)}setParent(t){var e;null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(vt(Zr,this,va).call(this),null===(e=bt(Nr,this))||void 0===e||e.remove(),yt(Nr,this,null));this.parent=t}focusin(t){this._focusEventsAllowed&&(bt(Wr,this)?yt(Wr,this,!1):this.parent.setSelected(this))}focusout(t){var e;if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const i=t.relatedTarget;null!==i&&void 0!==i&&i.closest("#".concat(this.id))||(t.preventDefault(),null!==(e=this.parent)&&void 0!==e&&e.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&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()}_moveAfterPaste(t,e){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n),this._onTranslated()}translate(t,e){vt(Zr,this,$r).call(this,this.parentDimensions,t,e)}translateInPage(t,e){bt(zr,this)||yt(zr,this,[this.x,this.y,this.width,this.height]),vt(Zr,this,$r).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){bt(zr,this)||yt(zr,this,[this.x,this.y,this.width,this.height]);const{div:i,parentDimensions:[n,s]}=this;if(this.x+=t/n,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:r,y:a}=this;const[o,l]=this.getBaseTranslation();r+=o,a+=l;const{style:c}=i;c.left="".concat((100*r).toFixed(2),"%"),c.top="".concat((100*a).toFixed(2),"%"),this._onTranslating(r,a),i.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!bt(zr,this)&&(bt(zr,this)[0]!==this.x||bt(zr,this)[1]!==this.y)}get _hasBeenResized(){return!!bt(zr,this)&&(bt(zr,this)[2]!==this.width||bt(zr,this)[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=Jr,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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rotation;const{div:{style:e},pageDimensions:[i,n]}=this;let{x:s,y:r,width:a,height:o}=this;if(a*=i,o*=n,s*=i,r*=n,this._mustFixPosition)switch(t){case 0:s=Ke(s,0,i-a),r=Ke(r,0,n-o);break;case 90:s=Ke(s,0,i-o),r=Ke(r,a,n);break;case 180:s=Ke(s,a,i),r=Ke(r,o,n);break;case 270:s=Ke(s,o,i),r=Ke(r,0,n-a)}this.x=s/=i,this.y=r/=n;const[l,c]=this.getBaseTranslation();s+=l,r+=c,e.left="".concat((100*s).toFixed(2),"%"),e.top="".concat((100*r).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(t,e){return ta.call(Jr,t,e,this.parentRotation)}pageTranslationToScreen(t,e){return ta.call(Jr,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;return[e*t,i*t]}setDims(){const{div:{style:t},width:e,height:i}=this;t.width="".concat((100*e).toFixed(2),"%"),t.height="".concat((100*i).toFixed(2),"%")}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(1e4*t)/1e4}_onResizing(){}altTextFinish(){var t;null===(t=bt(Sr,this))||void 0===t||t.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||bt(Hr,this))return this._editToolbar;this._editToolbar=new Fi(this),this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[e,i]of t)await this._editToolbar.addButton(e,i);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){var t;null===(t=this._editToolbar)||void 0===t||t.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){var t;null===(t=this._editToolbar)||void 0===t||t.removeButton("comment")}removeEditToolbar(){var t,e;null===(t=this._editToolbar)||void 0===t||t.remove(),this._editToolbar=null,null===(e=bt(Sr,this))||void 0===e||e.destroy()}addContainer(t){var e;const i=null===(e=this._editToolbar)||void 0===e?void 0:e.div;i?i.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return bt(Sr,this)||(Gs.initialize(Jr._l10n),yt(Sr,this,new Gs(this)),bt(kr,this)&&(bt(Sr,this).data=bt(kr,this),yt(kr,this,null))),bt(Sr,this)}get altTextData(){var t;return null===(t=bt(Sr,this))||void 0===t?void 0:t.data}set altTextData(t){bt(Sr,this)&&(bt(Sr,this).data=t)}get guessedAltText(){var t;return null===(t=bt(Sr,this))||void 0===t?void 0:t.guessedText}async setGuessedAltText(t){var e;await(null===(e=bt(Sr,this))||void 0===e?void 0:e.setGuessedText(t))}serializeAltText(t){var e;return null===(e=bt(Sr,this))||void 0===e?void 0:e.serialize(t)}hasAltText(){return!!bt(Sr,this)&&!bt(Sr,this).isEmpty()}hasAltTextData(){var t,e;return null!==(t=null===(e=bt(Sr,this))||void 0===e?void 0:e.hasData())&&void 0!==t&&t}focusCommentButton(){var t;null===(t=bt(Mr,this))||void 0===t||t.focusButton()}addCommentButton(){return bt(Mr,this)||yt(Mr,this,new ar(this))}addStandaloneCommentButton(){bt(Tr,this)?this._uiManager.isEditingMode()&&bt(Tr,this).classList.remove("hidden"):this.hasComment&&(yt(Tr,this,bt(Mr,this).renderForStandalone()),this.div.append(bt(Tr,this)))}removeStandaloneCommentButton(){bt(Mr,this).removeStandaloneCommentButton(),yt(Tr,this,null)}hideStandaloneCommentButton(){var t;null===(t=bt(Tr,this))||void 0===t||t.classList.add("hidden")}get comment(){var t;const{data:{richText:e,text:i,date:n,deleted:s}}=bt(Mr,this);return{text:i,richText:e,date:n,deleted:s,color:this.getNonHCMColor(),opacity:null!==(t=this.opacity)&&void 0!==t?t:1}}set comment(t){bt(Mr,this)||yt(Mr,this,new ar(this)),bt(Mr,this).data=t,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData(t){let{comment:e,popupRef:i,richText:n}=t;if(!i)return;if(bt(Mr,this)||yt(Mr,this,new ar(this)),bt(Mr,this).setInitialText(e,n),!this.annotationElementId)return;const s=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);s&&this.updateFromAnnotationLayer(s)}get hasEditedComment(){var t;return null===(t=bt(Mr,this))||void 0===t?void 0:t.hasBeenEdited()}get hasDeletedComment(){var t;return null===(t=bt(Mr,this))||void 0===t?void 0:t.isDeleted()}get hasComment(){return!!bt(Mr,this)&&!bt(Mr,this).isEmpty()&&!bt(Mr,this).isDeleted()}async editComment(t){bt(Mr,this)||yt(Mr,this,new ar(this)),bt(Mr,this).edit(t)}toggleComment(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){bt(Mr,this).setSelectedButton(t)}addComment(t){if(this.hasEditedComment){const e=180,i=100,[,,,n]=t.rect,[s]=this.pageDimensions,[r]=this.pageTranslation,a=r+s+1,o=n-i,l=a+e;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[a,o,l,n]}}}updateFromAnnotationLayer(t){let{popup:{contents:e,deleted:i}}=t;bt(Mr,this).data=i?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){var t;const e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=bt(Pr,this)?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),vt(Zr,this,ua).call(this);const[i,n]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth="".concat((100*n/i).toFixed(2),"%"),e.style.maxHeight="".concat((100*i/n).toFixed(2),"%"));const[s,r]=this.getInitialTranslation();return this.translate(s,r),Ki(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(bt(Yr,this)||yt(Yr,this,new Ar({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:vt(Zr,this,oa).bind(this),onPinching:vt(Zr,this,la).bind(this),onPinchEnd:vt(Zr,this,ca).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),null===(t=this._uiManager._editorUndoBar)||void 0===t||t.hide(),e}pointerdown(t){const{isMac:e}=ze.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(yt(Wr,this,!0),this._isDraggable?vt(Zr,this,da).call(this,t):vt(Zr,this,ha).call(this,t))}_onStartDragging(){}_onStopDragging(){}moveInDOM(){bt(Vr,this)&&clearTimeout(bt(Vr,this)),yt(Vr,this,setTimeout(()=>{var t;yt(Vr,this,null),null===(t=this.parent)||void 0===t||t.moveEditorInDOM(this)},0))}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.rotation;const n=this.parentScale,[s,r]=this.pageDimensions,[a,o]=this.pageTranslation,l=t/n,c=e/n,h=this.x*s,d=this.y*r,u=this.width*s,p=this.height*r;switch(i){case 0:return[h+l+a,r-d-c-p+o,h+l+u+a,r-d-c+o];case 90:return[h+c+a,r-d+l+o,h+c+p+a,r-d+l+u+o];case 180:return[h-l-u+a,r-d+c+o,h-l+a,r-d+c+p+o];case 270:return[h-c-p+a,r-d-l-u+o,h-c+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")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&Jr._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){var t;null===(t=bt(Mr,this))||void 0===t||t.onUpdatedColor()}getData(){const{comment:{text:t,color:e,date:i,opacity:n,deleted:s,richText:r},uid:a,pageIndex:o,creationDate:l,modificationDate:c}=this;return{id:a,pageIndex:o,rect:this.getPDFRect(),richText:r,contentsObj:{str:t},creationDate:l,modificationDate:i||c,popupRef:!s,color:e,opacity:n}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),yt(Hr,this,!0),!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),yt(Hr,this,!1),!0)}isInEditMode(){return bt(Hr,this)}shouldGetKeyboardEvents(){return bt(Ur,this)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:i,right:n}=this.getClientDimensions(),{innerHeight:s,innerWidth:r}=window;return e<r&&n>0&&t<s&&i>0}rebuild(){vt(Zr,this,ua).call(this)}rotate(t){}resize(){}serializeDeleted(){var t;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:(null===(t=this._initialData)||void 0===t?void 0:t.popupRef)||""}}serialize(){var t;return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:(null===(t=this._initialData)||void 0===t?void 0:t.popupRef)||""}}static async deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});n.rotation=t.rotation,yt(kr,n,t.accessibilityData),n._isCopy=t.isCopy||!1;const[s,r]=n.pageDimensions,[a,o,l,c]=n.getRectInCurrentCoords(t.rect,r);return n.x=a/s,n.y=o/r,n.width=l/s,n.height=c/r,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){var t,e;if(null===(t=bt(Or,this))||void 0===t||t.abort(),yt(Or,this,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),bt(Vr,this)&&(clearTimeout(bt(Vr,this)),yt(Vr,this,null)),vt(Zr,this,va).call(this),this.removeEditToolbar(),bt(Xr,this)){for(const t of bt(Xr,this).values())clearTimeout(t);yt(Xr,this,null)}this.parent=null,null===(e=bt(Yr,this))||void 0===e||e.destroy(),yt(Yr,this,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(vt(Zr,this,ia).call(this),bt(Dr,this).classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return"ltr"===this._uiManager.direction?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[t,e]}=this,[i,n,s,r]=this.getPDFRect();return[Jr._round(i+(s-i)*t),Jr._round(n+(r-n)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return bt(Mr,this).commentPopupPositionInLayer}set commentPopupPosition(t){bt(Mr,this).commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return bt(Mr,this).hasDefaultPopupPosition()}get commentButtonWidth(){return bt(Mr,this).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){bt(Mr,this).setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),yt(Ir,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=bt(Dr,this).children;if(!bt(Cr,this)){yt(Cr,this,Array.from(e));const t=vt(Zr,this,pa).bind(this),i=vt(Zr,this,ga).bind(this),n=this._uiManager._signal;for(const e of bt(Cr,this)){const s=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:n}),e.addEventListener("blur",i,{signal:n}),e.addEventListener("focus",vt(Zr,this,fa).bind(this,s),{signal:n}),e.setAttribute("data-l10n-id",Jr._l10nResizer[s])}}const i=bt(Cr,this)[0];let n=0;for(const r of e){if(r===i)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*(bt(Cr,this).length/4);if(s!==n){if(s<n)for(let e=0;e<n-s;e++)bt(Dr,this).append(bt(Dr,this).firstChild);else if(s>n)for(let e=0;e<s-n;e++)bt(Dr,this).firstChild.before(bt(Dr,this).lastChild);let t=0;for(const i of e){const e=bt(Cr,this)[t++].getAttribute("data-resizer-name");i.setAttribute("data-l10n-id",Jr._l10nResizer[e])}}vt(Zr,this,ma).call(this,0),yt(Ur,this,!0),bt(Dr,this).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){bt(Ur,this)&&vt(Zr,this,aa).call(this,bt(Br,this),{deltaX:t,deltaY:e,fromKeyboard:!0})}_stopResizingWithKeyboard(){vt(Zr,this,va).call(this),this.div.focus()}select(){var t,e,i;this.isSelected&&this._editToolbar?this._editToolbar.show():(this.isSelected=!0,this.makeResizable(),null===(t=this.div)||void 0===t||t.classList.add("selectedEditor"),this._editToolbar?(null===(e=this._editToolbar)||void 0===e||e.show(),null===(i=bt(Sr,this))||void 0===i||i.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{var t,e;null!==(t=this.div)&&void 0!==t&&t.classList.contains("selectedEditor")&&(null===(e=this._editToolbar)||void 0===e||e.show())}))}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>{var t;return null===(t=this.div)||void 0===t?void 0:t.focus({preventScroll:!0})},0)}unselect(){var t,e,i,n,s;this.isSelected&&(this.isSelected=!1,null===(t=bt(Dr,this))||void 0===t||t.classList.add("hidden"),null===(e=this.div)||void 0===e||e.classList.remove("selectedEditor"),null!==(i=this.div)&&void 0!==i&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),null===(n=this._editToolbar)||void 0===n||n.hide(),null===(s=bt(Sr,this))||void 0===s||s.toggleAltTextBadge(!0),this.hasComment&&this._uiManager.toggleComment(this,!1,!1))}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){"BUTTON"!==t.target.nodeName&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return bt(jr,this)}set isEditing(t){yt(jr,this,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){bt(Xr,this)||yt(Xr,this,new Map);const{action:e}=t;let i=bt(Xr,this).get(e);return i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),bt(Xr,this).delete(e),0===bt(Xr,this).size&&yt(Xr,this,null)},Jr._telemetryTimeout),void bt(Xr,this).set(e,i)}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),yt(Pr,this,!1)}disable(){this.div&&(this.div.tabIndex=-1),yt(Pr,this,!0)}updateFakeAnnotationElement(t){if(bt(Nr,this)||this.deleted)return this.deleted?(bt(Nr,this).remove(),void yt(Nr,this,null)):void((this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&bt(Nr,this).updateEdited({rect:this.getPDFRect(),popup:this.comment}));yt(Nr,this,t.addFakeAnnotation(this))}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;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"===(null===e||void 0===e?void 0:e.nodeName)&&e.classList.contains("annotationContent")&&e.remove()}}function $r(t,e,i){let[n,s]=t;[e,i]=this.screenToPageTranslation(e,i),this.x+=e/n,this.y+=i/s,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}function ta(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}function ea(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]}}function ia(){if(bt(Dr,this))return;yt(Dr,this,document.createElement("div")),bt(Dr,this).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");bt(Dr,this).append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",vt(Zr,this,na).bind(this,i),{signal:e}),t.addEventListener("contextmenu",li,{signal:e}),t.tabIndex=-1}this.div.prepend(bt(Dr,this))}function na(t,e){var i;e.preventDefault();const{isMac:n}=ze.platform;if(0!==e.button||e.ctrlKey&&n)return;null===(i=bt(Sr,this))||void 0===i||i.toggle(!1);const s=this._isDraggable;this._isDraggable=!1,yt(Fr,this,[e.screenX,e.screenY]);const r=new AbortController,a=this._uiManager.combinedSignal(r);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",vt(Zr,this,aa).bind(this,t),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",ci,{passive:!1,signal:a}),window.addEventListener("contextmenu",li,{signal:a}),yt(Ir,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const o=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const c=()=>{var t;r.abort(),this.parent.togglePointerEvents(!0),null===(t=bt(Sr,this))||void 0===t||t.toggle(!0),this._isDraggable=s,this.parent.div.style.cursor=o,this.div.style.cursor=l,vt(Zr,this,ra).call(this)};window.addEventListener("pointerup",c,{signal:a}),window.addEventListener("blur",c,{signal:a})}function sa(t,e,i,n){this.width=i,this.height=n,this.x=t,this.y=e,this.setDims(),this.fixAndSetPosition(),this._onResized()}function ra(){if(!bt(Ir,this))return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=bt(Ir,this);yt(Ir,this,null);const s=this.x,r=this.y,a=this.width,o=this.height;s===t&&r===e&&a===i&&o===n||this.addCommands({cmd:vt(Zr,this,sa).bind(this,s,r,a,o),undo:vt(Zr,this,sa).bind(this,t,e,i,n),mustExec:!0})}function aa(t,e){const[i,n]=this.parentDimensions,s=this.x,r=this.y,a=this.width,o=this.height,l=kt.MIN_SIZE/i,c=kt.MIN_SIZE/n,h=vt(Zr,this,ea).call(this,this.rotation),d=(t,e)=>[h[0]*t+h[2]*e,h[1]*t+h[3]*e],u=vt(Zr,this,ea).call(this,360-this.rotation);let p,g,f=!1,m=!1;switch(t){case"topLeft":f=!0,p=(t,e)=>[0,0],g=(t,e)=>[t,e];break;case"topMiddle":p=(t,e)=>[t/2,0],g=(t,e)=>[t/2,e];break;case"topRight":f=!0,p=(t,e)=>[t,0],g=(t,e)=>[0,e];break;case"middleRight":m=!0,p=(t,e)=>[t,e/2],g=(t,e)=>[0,e/2];break;case"bottomRight":f=!0,p=(t,e)=>[t,e],g=(t,e)=>[0,0];break;case"bottomMiddle":p=(t,e)=>[t/2,e],g=(t,e)=>[t/2,0];break;case"bottomLeft":f=!0,p=(t,e)=>[0,e],g=(t,e)=>[t,0];break;case"middleLeft":m=!0,p=(t,e)=>[0,e/2],g=(t,e)=>[t,e/2]}const v=p(a,o),w=g(a,o);let b=d(...w);const y=kt._round(s+b[0]),A=kt._round(r+b[1]);let E,x,_=1,k=1;if(e.fromKeyboard)({deltaX:E,deltaY:x}=e);else{const{screenX:t,screenY:i}=e,[n,s]=bt(Fr,this);[E,x]=this.screenToPageTranslation(t-n,i-s),bt(Fr,this)[0]=t,bt(Fr,this)[1]=i}var C,S;if([E,x]=(C=E/i,S=x/n,[u[0]*C+u[2]*S,u[1]*C+u[3]*S]),f){const t=Math.hypot(a,o);_=k=Math.max(Math.min(Math.hypot(w[0]-v[0]-E,w[1]-v[1]-x)/t,1/a,1/o),l/a,c/o)}else m?_=Ke(Math.abs(w[0]-v[0]-E),l,1)/a:k=Ke(Math.abs(w[1]-v[1]-x),c,1)/o;const M=kt._round(a*_),T=kt._round(o*k);b=d(...g(M,T));const P=y-b[0],L=A-b[1];bt(zr,this)||yt(zr,this,[this.x,this.y,this.width,this.height]),this.width=M,this.height=T,this.x=P,this.y=L,this.setDims(),this.fixAndSetPosition(),this._onResizing()}function oa(){var t;yt(Ir,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),null===(t=bt(Sr,this))||void 0===t||t.toggle(!1),this.parent.togglePointerEvents(!1)}function la(t,e,i){let n=i/e*.7+1-.7;if(1===n)return;const s=vt(Zr,this,ea).call(this,this.rotation),r=(t,e)=>[s[0]*t+s[2]*e,s[1]*t+s[3]*e],[a,o]=this.parentDimensions,l=this.x,c=this.y,h=this.width,d=this.height,u=kt.MIN_SIZE/a,p=kt.MIN_SIZE/o;n=Math.max(Math.min(n,1/h,1/d),u/h,p/d);const g=kt._round(h*n),f=kt._round(d*n);if(g===h&&f===d)return;bt(zr,this)||yt(zr,this,[l,c,h,d]);const m=r(h/2,d/2),v=kt._round(l+m[0]),w=kt._round(c+m[1]),b=r(g/2,f/2);this.x=v-b[0],this.y=w-b[1],this.width=g,this.height=f,this.setDims(),this.fixAndSetPosition(),this._onResizing()}function ca(){var t;null===(t=bt(Sr,this))||void 0===t||t.toggle(!0),this.parent.togglePointerEvents(!0),vt(Zr,this,ra).call(this)}function ha(t){const{isMac:e}=ze.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}function da(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const n=new AbortController,s=this._uiManager.combinedSignal(n),r={capture:!0,passive:!1,signal:s},a=t=>{n.abort(),yt(Lr,this,null),yt(Wr,this,!1),this._uiManager.endDragSession()||vt(Zr,this,ha).call(this,t),i&&this._onStopDragging()};e&&(yt(Gr,this,t.clientX),yt(qr,this,t.clientY),yt(Lr,this,t.pointerId),yt(Rr,this,t.pointerType),window.addEventListener("pointermove",t=>{i||(i=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:e,clientY:n,pointerId:s}=t;if(s!==bt(Lr,this))return void ci(t);const[r,a]=this.screenToPageTranslation(e-bt(Gr,this),n-bt(qr,this));yt(Gr,this,e),yt(qr,this,n),this._uiManager.dragSelectedEditors(r,a)},r),window.addEventListener("touchmove",ci,r),window.addEventListener("pointerdown",t=>{t.pointerType===bt(Rr,this)&&(bt(Yr,this)||t.isPrimary)&&a(t),ci(t)},r));const o=t=>{bt(Lr,this)&&bt(Lr,this)!==t.pointerId?ci(t):a(t)};window.addEventListener("pointerup",o,{signal:s}),window.addEventListener("blur",o,{signal:s})}function ua(){if(bt(Or,this)||!this.div)return;yt(Or,this,new AbortController);const t=this._uiManager.combinedSignal(bt(Or,this));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}function pa(t){kt._resizerKeyboardManager.exec(this,t)}function ga(t){var e;bt(Ur,this)&&(null===(e=t.relatedTarget)||void 0===e?void 0:e.parentNode)!==bt(Dr,this)&&vt(Zr,this,va).call(this)}function fa(t){yt(Br,this,bt(Ur,this)?t:"")}function ma(t){if(bt(Cr,this))for(const e of bt(Cr,this))e.tabIndex=t}function va(){yt(Ur,this,!1),vt(Zr,this,ma).call(this,-1),vt(Zr,this,ra).call(this)}kt=Jr,(0,Wt.A)(Jr,"_l10n",null),(0,Wt.A)(Jr,"_l10nResizer",null),(0,Wt.A)(Jr,"_borderLineWidth",-1),(0,Wt.A)(Jr,"_colorManager",new pn),(0,Wt.A)(Jr,"_zIndex",1),(0,Wt.A)(Jr,"_telemetryTimeout",1e3);class wa extends Jr{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const ba=3285377520,ya=4294901760,Aa=65535;class Ea{constructor(t){this.h1=t?4294967295&t:ba,this.h2=t?4294967295&t:ba}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,c=this.h2;const h=3432918353,d=461845907,u=11601,p=13715;for(let g=0;g<n;g++)1&g?(a=r[g],a=a*h&ya|a*u&Aa,a=a<<15|a>>>17,a=a*d&ya|a*p&Aa,l^=a,l=l<<13|l>>>19,l=5*l+3864292196):(o=r[g],o=o*h&ya|o*u&Aa,o=o<<15|o>>>17,o=o*d&ya|o*p&Aa,c^=o,c=c<<13|c>>>19,c=5*c+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*h&ya|a*u&Aa,a=a<<15|a>>>17,a=a*d&ya|a*p&Aa,1&n?l^=a:c^=a}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&ya|36045*t&Aa,e=4283543511*e&ya|(2950163797*(e<<16|t>>>16)&ya)>>>16,t^=e>>>1,t=444984403*t&ya|60499*t&Aa,e=3301882366*e&ya|(3120437893*(e<<16|t>>>16)&ya)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const xa=Object.freeze({map:null,hash:"",transfer:void 0});var _a=new WeakMap,ka=new WeakMap,Ca=new WeakMap,Sa=new WeakMap,Ma=new WeakSet;class Ta{constructor(){ft(this,Ma),mt(this,_a,!1),mt(this,ka,null),mt(this,Ca,null),mt(this,Sa,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=bt(Sa,this).get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return bt(Sa,this).get(t)}remove(t){const e=bt(Sa,this).get(t);if(void 0!==e&&(e instanceof Jr&&bt(Ca,this).delete(e.annotationElementId),bt(Sa,this).delete(t),0===bt(Sa,this).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor)){for(const t of bt(Sa,this).values())if(t instanceof Jr)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=bt(Sa,this).get(t);let n=!1;if(void 0!==i)for(const[s,r]of Object.entries(e))i[s]!==r&&(n=!0,i[s]=r);else n=!0,bt(Sa,this).set(t,e);n&&vt(Ma,this,Pa).call(this),e instanceof Jr&&((bt(Ca,this)||yt(Ca,this,new Map)).set(e.annotationElementId,e),"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type))}has(t){return bt(Sa,this).has(t)}get size(){return bt(Sa,this).size}resetModified(){bt(_a,this)&&(yt(_a,this,!1),"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new Ra(this)}get serializable(){if(0===bt(Sa,this).size)return xa;const t=new Map,e=new Ea,i=[],n=Object.create(null);let s=!1;for(const[r,a]of bt(Sa,this)){const i=a instanceof Jr?a.serialize(!1,n):a;i&&(t.set(r,i),e.update("".concat(r,":").concat(JSON.stringify(i))),s||(s=!!i.bitmap))}if(s)for(const r of t.values())r.bitmap&&i.push(r.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:xa}get editorStats(){let t=null;const e=new Map;let i=0,n=0;for(const a of bt(Sa,this).values()){var s;if(!(a instanceof Jr)){a.popup&&(a.popup.deleted?n+=1:i+=1);continue}a.isCommentDeleted?n+=1:a.hasEditedComment&&(i+=1);const o=a.telemetryFinalData;if(!o)continue;const{type:l}=o;e.has(l)||e.set(l,Object.getPrototypeOf(a).constructor),t||(t=Object.create(null));const c=(s=t)[l]||(s[l]=new Map);for(const[t,e]of Object.entries(o)){var r;if("type"===t)continue;let i=c.get(t);i||(i=new Map,c.set(t,i));const n=null!==(r=i.get(e))&&void 0!==r?r:0;i.set(e,n+1)}}if((n>0||i>0)&&(t||(t=Object.create(null)),t.comments={deleted:n,edited:i}),!t)return null;for(const[a,o]of e)t[a]=o.computeTelemetryFinalData(t[a]);return t}resetModifiedIds(){yt(ka,this,null)}updateEditor(t,e){var i;const n=null===(i=bt(Ca,this))||void 0===i?void 0:i.get(t);return!!n&&(n.updateFromAnnotationLayer(e),!0)}getEditor(t){var e;return(null===(e=bt(Ca,this))||void 0===e?void 0:e.get(t))||null}get modifiedIds(){if(bt(ka,this))return bt(ka,this);const t=[];if(bt(Ca,this))for(const e of bt(Ca,this).values())e.serialize()&&t.push(e.annotationElementId);return yt(ka,this,{ids:new Set(t),hash:t.join(",")})}[Symbol.iterator](){return bt(Sa,this).entries()}}function Pa(){bt(_a,this)||(yt(_a,this,!0),"function"===typeof this.onSetModified&&this.onSetModified())}var La=new WeakMap;class Ra extends Ta{constructor(t){super(),mt(this,La,void 0);const{map:e,hash:i,transfer:n}=t.serializable,s=structuredClone(e,n?{transfer:n}:null);yt(La,this,{map:s,hash:i,transfer:n})}get print(){Ce("Should not call PrintAnnotationStorage.print")}get serializable(){return bt(La,this)}get modifiedIds(){return Pe(this,"modifiedIds",{ids:new Set,hash:""})}}var Da=new WeakMap;class Fa{constructor(t){let{ownerDocument:e=globalThis.document,styleElement:i=null}=t;mt(this,Da,new Set),this._document=e,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(),bt(Da,this).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){let{systemFontInfo:e,disableFontFace:i,_inspectFont:n}=t;if(e&&!bt(Da,this).has(e.loadedName)){if(Se(!i,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:i,style:r}=e,a=new FontFace(t,i,r);this.addNativeFontFace(a);try{await a.load(),bt(Da,this).add(t),null===n||void 0===n||n(e)}catch(s){ke("Cannot load system font: ".concat(e.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(a)}return}Ce("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 ke("Failed to load font '".concat(e.family,"': '").concat(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 Pe(this,"isFontLoadingAPISupported",!(null===(t=this._document)||void 0===t||!t.fonts))}get isSyncFontLoadingSupported(){return Pe(this,"isSyncFontLoadingSupported",jt||ze.platform.isFirefox)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(Se(!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 Pe(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 c="lt".concat(Date.now()).concat(this.loadTestFontId++);let h=this._loadTestFont;h=n(h,976,c.length,c);const d=1482184792;let u=i(h,16);for(s=0,r=c.length-3;s<r;s+=4)u=u-d+i(c,s)|0;var p;s<c.length&&(u=u-d+i(c+"XXX",s)|0),h=n(h,16,4,(p=u,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));const g="url(data:font/opentype;base64,".concat(btoa(h),");"),f='@font-face {font-family:"'.concat(c,'";src:').concat(g,"}");this.insertRule(f);const m=this._document.createElement("div");m.style.visibility="hidden",m.style.width=m.style.height="10px",m.style.position="absolute",m.style.top=m.style.left="0px";for(const v of[t.loadedName,c]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=v,m.append(t)}this._document.body.append(m),function t(e,i){if(++l>30)return ke("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))}(c,()=>{m.remove(),e.complete()})}}var Ia=new WeakMap;class Na{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;mt(this,Ia,void 0),this.compiledGlyphs=Object.create(null),yt(Ia,this,t),this._inspectFont=e,i&&Object.assign(this,i),n&&(this.charProcOperatorList=n)}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 ".concat(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)||void 0===t||t.call(this,this),e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e="url(data:".concat(this.mimetype,";base64,").concat(Qe(this.data),");");let i;if(this.cssFontInfo){let t="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(t+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),i='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(t,"src:").concat(e,"}")}else i='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(e,"}");return null===(t=this._inspectFont)||void 0===t||t.call(this,this,e),i}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];const i=this.loadedName+"_path_"+e;let n;try{n=t.get(i)}catch(r){ke('getPathGenerator - ignoring character: "'.concat(r,'".'))}const s=new Path2D(n||"");return this.fontExtraProperties||t.delete(i),this.compiledGlyphs[e]=s}get black(){return bt(Ia,this).black}get bold(){return bt(Ia,this).bold}get disableFontFace(){var t;return null!==(t=bt(Ia,this).disableFontFace)&&void 0!==t&&t}get fontExtraProperties(){var t;return null!==(t=bt(Ia,this).fontExtraProperties)&&void 0!==t&&t}get isInvalidPDFjsFont(){return bt(Ia,this).isInvalidPDFjsFont}get isType3Font(){return bt(Ia,this).isType3Font}get italic(){return bt(Ia,this).italic}get missingFile(){return bt(Ia,this).missingFile}get remeasure(){return bt(Ia,this).remeasure}get vertical(){return bt(Ia,this).vertical}get ascent(){return bt(Ia,this).ascent}get defaultWidth(){return bt(Ia,this).defaultWidth}get descent(){return bt(Ia,this).descent}get bbox(){return bt(Ia,this).bbox}get fontMatrix(){return bt(Ia,this).fontMatrix}get fallbackName(){return bt(Ia,this).fallbackName}get loadedName(){return bt(Ia,this).loadedName}get mimetype(){return bt(Ia,this).mimetype}get name(){return bt(Ia,this).name}get data(){return bt(Ia,this).data}clearData(){bt(Ia,this).clearData()}get cssFontInfo(){return bt(Ia,this).cssFontInfo}get systemFontInfo(){return bt(Ia,this).systemFontInfo}get defaultVMetrics(){return bt(Ia,this).defaultVMetrics}}function Oa(t){if("string"!==typeof t)return null;if(t.endsWith("/"))return t;throw new Error('Invalid factory url: "'.concat(t,'" must include trailing slash.'))}const Ba=t=>"object"===typeof t&&Number.isInteger(null===t||void 0===t?void 0:t.num)&&t.num>=0&&Number.isInteger(null===t||void 0===t?void 0:t.gen)&&t.gen>=0,Wa=function(t,e,i){if(!Array.isArray(i)||i.length<2)return!1;const[n,s,...r]=i;if(!t(n)&&!Number.isInteger(n))return!1;if(!e(s))return!1;const a=r.length;let o=!0;switch(s.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return 0===a;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(4!==a)return!1;o=!1;break;default:return!1}for(const l of r)if(!("number"===typeof l||o&&null===l))return!1;return!0}.bind(null,Ba,t=>"object"===typeof t&&"string"===typeof(null===t||void 0===t?void 0:t.name));var za=new WeakMap,ja=new WeakMap;class Ha{constructor(){mt(this,za,new Map),mt(this,ja,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};bt(ja,this).then(()=>{for(const[t]of bt(za,this))t.call(this,i)})}addEventListener(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=null;if((null===i||void 0===i?void 0:i.signal)instanceof AbortSignal){const{signal:s}=i;if(s.aborted)return void ke("LoopbackPort - cannot use an `aborted` signal.");const r=()=>this.removeEventListener(t,e);n=()=>s.removeEventListener("abort",r),s.addEventListener("abort",r)}bt(za,this).set(e,n)}removeEventListener(t,e){const i=bt(za,this).get(e);null===i||void 0===i||i(),bt(za,this).delete(e)}terminate(){for(const[,t]of bt(za,this))null===t||void 0===t||t();bt(za,this).clear()}}const Ua=1,Va=2,Ga=1,qa=2,Xa=3,Ya=4,Ka=5,Qa=6,Za=7,Ja=8;function $a(){}function to(t){if(t instanceof Oe||t instanceof Fe||t instanceof Re||t instanceof Ie||t instanceof De)return t;switch(t instanceof Error||"object"===typeof t&&null!==t||Ce('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new Oe(t.message);case"InvalidPDFException":return new Fe(t.message);case"PasswordException":return new Re(t.message,t.code);case"ResponseException":return new Ie(t.message,t.status,t.missing);case"UnknownErrorException":return new De(t.message,t.details)}return new De(t.message,t.toString())}var eo=new WeakMap,io=new WeakSet;class no{constructor(t,e,i){ft(this,io),mt(this,eo,new AbortController),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),i.addEventListener("message",vt(io,this,so).bind(this),{signal:bt(eo,this).signal})}on(t,e){const i=this.actionHandler;if(i[t])throw new Error('There is already an actionName called "'.concat(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(r){s.reject(r)}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:Qa,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{Se(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:Ga,streamId:s,reason:to(t)}),e.promise}},i)}destroy(){var t;null===(t=bt(eo,this))||void 0===t||t.abort(),yt(eo,this,null)}}function so(t){let{data:e}=t;if(e.targetName!==this.sourceName)return;if(e.stream)return void vt(io,this,ao).call(this,e);if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error("Cannot resolve callback ".concat(t));if(delete this.callbackCapabilities[t],e.callback===Ua)i.resolve(e.data);else{if(e.callback!==Va)throw new Error("Unexpected callback case");i.reject(to(e.reason))}return}const i=this.actionHandler[e.action];if(!i)throw new Error("Unknown action from worker: ".concat(e.action));if(e.callbackId){const t=this.sourceName,n=e.sourceName,s=this.comObj;return void Promise.try(i,e.data).then(function(i){s.postMessage({sourceName:t,targetName:n,callback:Ua,callbackId:e.callbackId,data:i})},function(i){s.postMessage({sourceName:t,targetName:n,callback:Va,callbackId:e.callbackId,reason:to(i)})})}e.streamId?vt(io,this,ro).call(this,e):i(e.data)}function ro(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this,a=this.actionHandler[t.action],o={enqueue(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2?arguments[2]:void 0;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:Ya,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:Xa,streamId:e}),delete r.streamSinks[e])},error(t){Se(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:Ka,streamId:e,reason:to(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,Promise.try(a,t.data,o).then(function(){s.postMessage({sourceName:i,targetName:n,stream:Ja,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:Ja,streamId:e,reason:to(t)})})}function ao(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 Ja:t.success?r.startCall.resolve():r.startCall.reject(to(t.reason));break;case Za:t.success?r.pullCall.resolve():r.pullCall.reject(to(t.reason));break;case Qa:if(!a){s.postMessage({sourceName:i,targetName:n,stream:Za,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,Promise.try(a.onPull||$a).then(function(){s.postMessage({sourceName:i,targetName:n,stream:Za,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:Za,streamId:e,reason:to(t)})});break;case Ya:if(Se(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case Xa:if(Se(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),vt(io,this,oo).call(this,r,e);break;case Ka:Se(r,"error should have stream controller"),r.controller.error(to(t.reason)),vt(io,this,oo).call(this,r,e);break;case qa:t.success?r.cancelCall.resolve():r.cancelCall.reject(to(t.reason)),vt(io,this,oo).call(this,r,e);break;case Ga:if(!a)break;const o=to(t.reason);Promise.try(a.onCancel||$a,o).then(function(){s.postMessage({sourceName:i,targetName:n,stream:qa,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:qa,streamId:e,reason:to(t)})}),a.sinkCapability.reject(o),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async function oo(t,e){var i,n,s;await Promise.allSettled([null===(i=t.startCall)||void 0===i?void 0:i.promise,null===(n=t.pullCall)||void 0===n?void 0:n.promise,null===(s=t.cancelCall)||void 0===s?void 0:s.promise]),delete this.streamControllers[e]}var lo=new WeakMap;class co{constructor(t){let{enableHWA:e=!1}=t;mt(this,lo,!1),yt(lo,this,e)}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:!bt(lo,this)})}}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){Ce("Abstract method `_createCanvas` called.")}}class ho extends co{constructor(t){let{ownerDocument:e=globalThis.document,enableHWA:i=!1}=t;super({enableHWA:i}),this._document=e}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}}class uo{constructor(t){let{baseUrl:e=null,isCompressed:i=!0}=t;this.baseUrl=e,this.isCompressed=i}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const i=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(i).then(t=>({cMapData:t,isCompressed:this.isCompressed})).catch(t=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(i))})}async _fetch(t){Ce("Abstract method `_fetch` called.")}}class po extends uo{async _fetch(t){const e=await ei(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):We(e)}}class go{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(){}}var fo=new WeakMap,mo=new WeakMap,vo=new WeakMap,wo=new WeakMap,bo=new WeakMap,yo=new WeakMap,Ao=new WeakMap,Eo=new WeakSet;class xo extends go{constructor(t){let{docId:e,ownerDocument:i=globalThis.document}=t;super(),ft(this,Eo),mt(this,fo,void 0),mt(this,mo,void 0),mt(this,vo,void 0),mt(this,wo,void 0),mt(this,bo,void 0),mt(this,yo,void 0),mt(this,Ao,0),yt(wo,this,e),yt(bo,this,i)}addFilter(t){var e,i;if(!t)return"none";let n=wt(Eo,this,_o).get(t);if(n)return n;const[s,r,a]=vt(Eo,this,So).call(this,t),o=1===t.length?s:"".concat(s).concat(r).concat(a);if(n=wt(Eo,this,_o).get(o),n)return wt(Eo,this,_o).set(t,n),n;const l="g_".concat(bt(wo,this),"_transfer_map_").concat((yt(Ao,this,(e=bt(Ao,this),i=e++,e)),i)),c=vt(Eo,this,Mo).call(this,l);wt(Eo,this,_o).set(t,c),wt(Eo,this,_o).set(o,c);const h=vt(Eo,this,Lo).call(this,l);return vt(Eo,this,Do).call(this,s,r,a,h),c}addHCMFilter(t,e){var i;const n="".concat(t,"-").concat(e),s="base";let r=wt(Eo,this,ko).get(s);if((null===(i=r)||void 0===i?void 0:i.key)===n)return r.url;var a;r?(null===(a=r.filter)||void 0===a||a.remove(),r.key=n,r.url="none",r.filter=null):(r={key:n,url:"none",filter:null},wt(Eo,this,ko).set(s,r));if(!t||!e)return r.url;const o=vt(Eo,this,Io).call(this,t);t=He.makeHexColor(...o);const l=vt(Eo,this,Io).call(this,e);if(e=He.makeHexColor(...l),wt(Eo,this,Co).style.color="","#000000"===t&&"#ffffff"===e||t===e)return r.url;const c=new Array(256);for(let g=0;g<=255;g++){const t=g/255;c[g]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const h=c.join(","),d="g_".concat(bt(wo,this),"_hcm_filter"),u=r.filter=vt(Eo,this,Lo).call(this,d);vt(Eo,this,Do).call(this,h,h,h,u),vt(Eo,this,Po).call(this,u);const p=(t,e)=>{const i=o[t]/255,n=l[t]/255,s=new Array(e+1);for(let r=0;r<=e;r++)s[r]=i+r/e*(n-i);return s.join(",")};return vt(Eo,this,Do).call(this,p(0,5),p(1,5),p(2,5),u),r.url=vt(Eo,this,Mo).call(this,d),r.url}addAlphaFilter(t){var e,i;let n=wt(Eo,this,_o).get(t);if(n)return n;const[s]=vt(Eo,this,So).call(this,[t]),r="alpha_".concat(s);if(n=wt(Eo,this,_o).get(r),n)return wt(Eo,this,_o).set(t,n),n;const a="g_".concat(bt(wo,this),"_alpha_map_").concat((yt(Ao,this,(e=bt(Ao,this),i=e++,e)),i)),o=vt(Eo,this,Mo).call(this,a);wt(Eo,this,_o).set(t,o),wt(Eo,this,_o).set(r,o);const l=vt(Eo,this,Lo).call(this,a);return vt(Eo,this,Fo).call(this,s,l),o}addLuminosityFilter(t){var e,i;let n,s,r=wt(Eo,this,_o).get(t||"luminosity");if(r)return r;if(t?([n]=vt(Eo,this,So).call(this,[t]),s="luminosity_".concat(n)):s="luminosity",r=wt(Eo,this,_o).get(s),r)return wt(Eo,this,_o).set(t,r),r;const a="g_".concat(bt(wo,this),"_luminosity_map_").concat((yt(Ao,this,(e=bt(Ao,this),i=e++,e)),i)),o=vt(Eo,this,Mo).call(this,a);wt(Eo,this,_o).set(t,o),wt(Eo,this,_o).set(s,o);const l=vt(Eo,this,Lo).call(this,a);return vt(Eo,this,To).call(this,l),t&&vt(Eo,this,Fo).call(this,n,l),o}addHighlightHCMFilter(t,e,i,n,s){var r;const a="".concat(e,"-").concat(i,"-").concat(n,"-").concat(s);let o=wt(Eo,this,ko).get(t);if((null===(r=o)||void 0===r?void 0:r.key)===a)return o.url;var l;o?(null===(l=o.filter)||void 0===l||l.remove(),o.key=a,o.url="none",o.filter=null):(o={key:a,url:"none",filter:null},wt(Eo,this,ko).set(t,o));if(!e||!i)return o.url;const[c,h]=[e,i].map(vt(Eo,this,Io).bind(this));let d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),u=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[p,g]=[n,s].map(vt(Eo,this,Io).bind(this));u<d&&([d,u,p,g]=[u,d,g,p]),wt(Eo,this,Co).style.color="";const f=(t,e,i)=>{const n=new Array(256),s=(u-d)/i,r=t/255,a=(e-t)/(255*i);let o=0;for(let l=0;l<=i;l++){const t=Math.round(d+l*s),e=r+l*a;for(let i=o;i<=t;i++)n[i]=e;o=t+1}for(let l=o;l<256;l++)n[l]=n[o-1];return n.join(",")},m="g_".concat(bt(wo,this),"_hcm_").concat(t,"_filter"),v=o.filter=vt(Eo,this,Lo).call(this,m);return vt(Eo,this,Po).call(this,v),vt(Eo,this,Do).call(this,f(p[0],g[0],5),f(p[1],g[1],5),f(p[2],g[2],5),v),o.url=vt(Eo,this,Mo).call(this,m),o.url}destroy(){var t,e,i,n;arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&null!==(t=bt(yo,this))&&void 0!==t&&t.size||(null===(e=bt(vo,this))||void 0===e||e.parentNode.parentNode.remove(),yt(vo,this,null),null===(i=bt(mo,this))||void 0===i||i.clear(),yt(mo,this,null),null===(n=bt(yo,this))||void 0===n||n.clear(),yt(yo,this,null),yt(Ao,this,0))}}function _o(t){return bt(mo,t)||yt(mo,t,new Map)}function ko(t){return bt(yo,t)||yt(yo,t,new Map)}function Co(t){if(!bt(vo,t)){const e=bt(bo,t).createElement("div"),{style:i}=e;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const n=bt(bo,t).createElementNS($e,"svg");n.setAttribute("width",0),n.setAttribute("height",0),yt(vo,t,bt(bo,t).createElementNS($e,"defs")),e.append(n),n.append(bt(vo,t)),bt(bo,t).body.append(e)}return bt(vo,t)}function So(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 o=0;o<256;o++)s[o]=e[o]/255,r[o]=i[o]/255,a[o]=n[o]/255;return[s.join(","),r.join(","),a.join(",")]}function Mo(t){if(void 0===bt(fo,this)){yt(fo,this,"");const t=bt(bo,this).URL;t!==bt(bo,this).baseURI&&(si(t)?ke('#createUrl: ignore "data:"-URL for performance reasons.'):yt(fo,this,Te(t,"")))}return"url(".concat(bt(fo,this),"#").concat(t,")")}function To(t){const e=bt(bo,this).createElementNS($e,"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)}function Po(t){const e=bt(bo,this).createElementNS($e,"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)}function Lo(t){const e=bt(bo,this).createElementNS($e,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),wt(Eo,this,Co).append(e),e}function Ro(t,e,i){const n=bt(bo,this).createElementNS($e,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}function Do(t,e,i,n){const s=bt(bo,this).createElementNS($e,"feComponentTransfer");n.append(s),vt(Eo,this,Ro).call(this,s,"feFuncR",t),vt(Eo,this,Ro).call(this,s,"feFuncG",e),vt(Eo,this,Ro).call(this,s,"feFuncB",i)}function Fo(t,e){const i=bt(bo,this).createElementNS($e,"feComponentTransfer");e.append(i),vt(Eo,this,Ro).call(this,i,"feFuncA",t)}function Io(t){return wt(Eo,this,Co).style.color=t,ui(getComputedStyle(wt(Eo,this,Co)).getPropertyValue("color"))}class No{constructor(t){let{baseUrl:e=null}=t;this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const i="".concat(this.baseUrl).concat(e);return this._fetch(i).catch(t=>{throw new Error("Unable to load font data at: ".concat(i))})}async _fetch(t){Ce("Abstract method `_fetch` called.")}}class Oo extends No{async _fetch(t){const e=await ei(t,"arraybuffer");return new Uint8Array(e)}}class Bo{constructor(t){let{baseUrl:e=null}=t;this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");const i="".concat(this.baseUrl).concat(e);return this._fetch(i).catch(t=>{throw new Error("Unable to load wasm data at: ".concat(i))})}async _fetch(t){Ce("Abstract method `_fetch` called.")}}class Wo extends Bo{async _fetch(t){const e=await ei(t,"arraybuffer");return new Uint8Array(e)}}async function zo(t){const e=process.getBuiltinModule("fs"),i=await e.promises.readFile(t);return new Uint8Array(i)}jt&&ke("Please use the `legacy` build in Node.js environments.");class jo extends go{}class Ho extends co{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire("file:///home/runner/work/system-layout/system-layout/node_modules/pdfjs-dist/build/pdf.mjs")("@napi-rs/canvas").createCanvas(t,e)}}class Uo extends uo{async _fetch(t){return zo(t)}}class Vo extends No{async _fetch(t){return zo(t)}}class Go extends Bo{async _fetch(t){return zo(t)}}const qo="__forcedDependency",{floor:Xo,ceil:Yo}=Math;function Ko(t,e,i,n,s,r){t[4*e+0]=Math.min(t[4*e+0],i),t[4*e+1]=Math.min(t[4*e+1],n),t[4*e+2]=Math.max(t[4*e+2],s),t[4*e+3]=Math.max(t[4*e+3],r)}const Qo=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];var Zo=new WeakMap,Jo=new WeakMap;class $o{constructor(t,e){mt(this,Zo,void 0),mt(this,Jo,void 0),yt(Zo,this,t),yt(Jo,this,e)}get length(){return bt(Zo,this).length}isEmpty(t){return bt(Zo,this)[t]===Qo}minX(t){return bt(Jo,this)[4*t+0]/256}minY(t){return bt(Jo,this)[4*t+1]/256}maxX(t){return(bt(Jo,this)[4*t+2]+1)/256}maxY(t){return(bt(Jo,this)[4*t+3]+1)/256}}const tl=(t,e)=>{if(!t)return;let i=t.get(e);return i||(i={dependencies:new Set,isRenderingOperation:!1},t.set(e,i)),i};var el=new WeakMap,il=new WeakMap,nl=new WeakMap,sl=new WeakMap,rl=new WeakMap,al=new WeakMap,ol=new WeakMap,ll=new WeakMap,cl=new WeakMap,hl=new WeakMap,dl=new WeakMap,ul=new WeakMap,pl=new WeakMap,gl=new WeakMap,fl=new WeakMap,ml=new WeakMap,vl=new WeakMap,wl=new WeakSet;class bl{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];ft(this,wl),mt(this,el,{__proto__:null}),mt(this,il,{__proto__:null,transform:[],moveText:[],sameLineText:[],[qo]:[]}),mt(this,nl,new Map),mt(this,sl,[]),mt(this,rl,[]),mt(this,al,[[1,0,0,1,0,0]]),mt(this,ol,[-1/0,-1/0,1/0,1/0]),mt(this,ll,new Float64Array([1/0,1/0,-1/0,-1/0])),mt(this,cl,-1),mt(this,hl,new Set),mt(this,dl,new Map),mt(this,ul,new Map),mt(this,pl,void 0),mt(this,gl,void 0),mt(this,fl,void 0),mt(this,ml,void 0),mt(this,vl,void 0),yt(pl,this,t.width),yt(gl,this,t.height),vt(wl,this,yl).call(this,e),i&&yt(vl,this,new Map)}growOperationsCount(t){t>=bt(ml,this).length&&vt(wl,this,yl).call(this,t,bt(ml,this))}save(t){return yt(el,this,{__proto__:bt(el,this)}),yt(il,this,{__proto__:bt(il,this),transform:{__proto__:bt(il,this).transform},moveText:{__proto__:bt(il,this).moveText},sameLineText:{__proto__:bt(il,this).sameLineText},[qo]:{__proto__:bt(il,this)[qo]}}),yt(ol,this,{__proto__:bt(ol,this)}),bt(sl,this).push(t),this}restore(t){const e=Object.getPrototypeOf(bt(el,this));if(null===e)return this;yt(el,this,e),yt(il,this,Object.getPrototypeOf(bt(il,this))),yt(ol,this,Object.getPrototypeOf(bt(ol,this)));const i=bt(sl,this).pop();var n;void 0!==i&&(null===(n=tl(bt(vl,this),t))||void 0===n||n.dependencies.add(i),bt(ml,this)[t]=bt(ml,this)[i]);return this}recordOpenMarker(t){return bt(sl,this).push(t),this}getOpenMarker(){return 0===bt(sl,this).length?null:bt(sl,this).at(-1)}recordCloseMarker(t){const e=bt(sl,this).pop();var i;void 0!==e&&(null===(i=tl(bt(vl,this),t))||void 0===i||i.dependencies.add(e),bt(ml,this)[t]=bt(ml,this)[e]);return this}beginMarkedContent(t){return bt(rl,this).push(t),this}endMarkedContent(t){const e=bt(rl,this).pop();var i;void 0!==e&&(null===(i=tl(bt(vl,this),t))||void 0===i||i.dependencies.add(e),bt(ml,this)[t]=bt(ml,this)[e]);return this}pushBaseTransform(t){return bt(al,this).push(He.multiplyByDOMMatrix(bt(al,this).at(-1),t.getTransform())),this}popBaseTransform(){return bt(al,this).length>1&&bt(al,this).pop(),this}recordSimpleData(t,e){return bt(el,this)[t]=e,this}recordIncrementalData(t,e){return bt(il,this)[t].push(e),this}resetIncrementalData(t,e){return bt(il,this)[t].length=0,this}recordNamedData(t,e){return bt(nl,this).set(t,e),this}recordSimpleDataFromNamed(t,e,i){var n;bt(el,this)[t]=null!==(n=bt(nl,this).get(e))&&void 0!==n?n:i}recordFutureForcedDependency(t,e){return this.recordIncrementalData(qo,e),this}inheritSimpleDataAsFutureForcedDependencies(t){for(const e of t)e in bt(el,this)&&this.recordFutureForcedDependency(e,bt(el,this)[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of bt(hl,this))this.recordFutureForcedDependency(qo,t);return this}resetBBox(t){return bt(cl,this)!==t&&(yt(cl,this,t),bt(ll,this)[0]=1/0,bt(ll,this)[1]=1/0,bt(ll,this)[2]=-1/0,bt(ll,this)[3]=-1/0),this}recordClipBox(t,e,i,n,s,r){const a=He.multiplyByDOMMatrix(bt(al,this).at(-1),e.getTransform()),o=[1/0,1/0,-1/0,-1/0];He.axialAlignedBoundingBox([i,s,n,r],a,o);const l=He.intersect(bt(ol,this),o);return l?(bt(ol,this)[0]=l[0],bt(ol,this)[1]=l[1],bt(ol,this)[2]=l[2],bt(ol,this)[3]=l[3]):(bt(ol,this)[0]=bt(ol,this)[1]=1/0,bt(ol,this)[2]=bt(ol,this)[3]=-1/0),this}recordBBox(t,e,i,n,s,r){const a=bt(ol,this);if(a[0]===1/0)return this;const o=He.multiplyByDOMMatrix(bt(al,this).at(-1),e.getTransform());if(a[0]===-1/0)return He.axialAlignedBoundingBox([i,s,n,r],o,bt(ll,this)),this;const l=[1/0,1/0,-1/0,-1/0];return He.axialAlignedBoundingBox([i,s,n,r],o,l),bt(ll,this)[0]=Math.min(bt(ll,this)[0],Math.max(l[0],a[0])),bt(ll,this)[1]=Math.min(bt(ll,this)[1],Math.max(l[1],a[1])),bt(ll,this)[2]=Math.max(bt(ll,this)[2],Math.min(l[2],a[2])),bt(ll,this)[3]=Math.max(bt(ll,this)[3],Math.min(l[3],a[3])),this}recordCharacterBBox(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6?arguments[6]:void 0;const o=i.bbox;let l,c;if(o&&(l=o[2]!==o[0]&&o[3]!==o[1]&&bt(ul,this).get(i),!1!==l&&(c=[0,0,0,0],He.axialAlignedBoundingBox(o,i.fontMatrix,c),1===n&&0===s&&0===r||He.scaleMinMax([n,0,0,-n,s,r],c),l)))return this.recordBBox(t,e,c[0],c[2],c[1],c[3]);if(!a)return this.recordFullPageBBox(t);const h=a();return o&&c&&void 0===l&&(l=c[0]<=s-h.actualBoundingBoxLeft&&c[2]>=s+h.actualBoundingBoxRight&&c[1]<=r-h.actualBoundingBoxAscent&&c[3]>=r+h.actualBoundingBoxDescent,bt(ul,this).set(i,l),l)?this.recordBBox(t,e,c[0],c[2],c[1],c[3]):this.recordBBox(t,e,s-h.actualBoundingBoxLeft,s+h.actualBoundingBoxRight,r-h.actualBoundingBoxAscent,r+h.actualBoundingBoxDescent)}recordFullPageBBox(t){return bt(ll,this)[0]=Math.max(0,bt(ol,this)[0]),bt(ll,this)[1]=Math.max(0,bt(ol,this)[1]),bt(ll,this)[2]=Math.min(bt(pl,this),bt(ol,this)[2]),bt(ll,this)[3]=Math.min(bt(gl,this),bt(ol,this)[3]),this}getSimpleIndex(t){return bt(el,this)[t]}recordDependencies(t,e){const i=bt(hl,this),n=bt(el,this),s=bt(il,this);for(const r of e)r in bt(el,this)?i.add(n[r]):r in s&&s[r].forEach(i.add,i);return this}recordNamedDependency(t,e){return bt(nl,this).has(e)&&bt(hl,this).add(bt(nl,this).get(e)),this}recordOperation(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.recordDependencies(t,[qo]),bt(vl,this)){const e=tl(bt(vl,this),t),{dependencies:i}=e;bt(hl,this).forEach(i.add,i),bt(sl,this).forEach(i.add,i),bt(rl,this).forEach(i.add,i),i.delete(t),e.isRenderingOperation=!0}if(bt(cl,this)===t){const i=Xo(256*bt(ll,this)[0]/bt(pl,this)),n=Xo(256*bt(ll,this)[1]/bt(gl,this)),s=Yo(256*bt(ll,this)[2]/bt(pl,this)),r=Yo(256*bt(ll,this)[3]/bt(gl,this));Ko(bt(fl,this),t,i,n,s,r);for(const e of bt(hl,this))e!==t&&Ko(bt(fl,this),e,i,n,s,r);for(const e of bt(sl,this))e!==t&&Ko(bt(fl,this),e,i,n,s,r);for(const e of bt(rl,this))e!==t&&Ko(bt(fl,this),e,i,n,s,r);e||(bt(hl,this).clear(),yt(cl,this,-1))}return this}recordShowTextOperation(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=Array.from(bt(hl,this));this.recordOperation(t,e),this.recordIncrementalData("sameLineText",t);for(const n of i)this.recordIncrementalData("sameLineText",n);return this}bboxToClipBoxDropOperation(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return bt(cl,this)===t&&(yt(cl,this,-1),bt(ol,this)[0]=Math.max(bt(ol,this)[0],bt(ll,this)[0]),bt(ol,this)[1]=Math.max(bt(ol,this)[1],bt(ll,this)[1]),bt(ol,this)[2]=Math.min(bt(ol,this)[2],bt(ll,this)[2]),bt(ol,this)[3]=Math.min(bt(ol,this)[3],bt(ll,this)[3]),e||bt(hl,this).clear()),this}_takePendingDependencies(){const t=bt(hl,this);return yt(hl,this,new Set),t}_extractOperation(t){const e=bt(dl,this).get(t);return bt(dl,this).delete(t),e}_pushPendingDependencies(t){for(const e of t)bt(hl,this).add(e)}take(){return bt(ul,this).clear(),new $o(bt(ml,this),bt(fl,this))}takeDebugMetadata(){return bt(vl,this)}}function yl(t,e){const i=new ArrayBuffer(4*t);yt(fl,this,new Uint8ClampedArray(i)),yt(ml,this,new Uint32Array(i)),e&&e.length>0?(bt(ml,this).set(e),bt(ml,this).fill(Qo,e.length)):bt(ml,this).fill(Qo)}var Al=new WeakMap,El=new WeakMap,xl=new WeakMap,_l=new WeakMap,kl=new WeakMap;class Cl{constructor(t,e,i){if(mt(this,Al,void 0),mt(this,El,void 0),mt(this,xl,void 0),mt(this,_l,0),mt(this,kl,0),t instanceof Cl&&bt(xl,t)===!!i)return t;yt(Al,this,t),yt(El,this,e),yt(xl,this,!!i)}growOperationsCount(){throw new Error("Unreachable")}save(t){var e;return yt(kl,this,(e=bt(kl,this),e++,e)),bt(Al,this).save(bt(El,this)),this}restore(t){var e;bt(kl,this)>0&&(bt(Al,this).restore(bt(El,this)),yt(kl,this,(e=bt(kl,this),e--,e)));return this}recordOpenMarker(t){var e;return yt(_l,this,(e=bt(_l,this),e++,e)),this}getOpenMarker(){return bt(_l,this)>0?bt(El,this):bt(Al,this).getOpenMarker()}recordCloseMarker(t){var e;return yt(_l,this,(e=bt(_l,this),e--,e)),this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return bt(Al,this).pushBaseTransform(t),this}popBaseTransform(){return bt(Al,this).popBaseTransform(),this}recordSimpleData(t,e){return bt(Al,this).recordSimpleData(t,bt(El,this)),this}recordIncrementalData(t,e){return bt(Al,this).recordIncrementalData(t,bt(El,this)),this}resetIncrementalData(t,e){return bt(Al,this).resetIncrementalData(t,bt(El,this)),this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,i){return bt(Al,this).recordSimpleDataFromNamed(t,e,bt(El,this)),this}recordFutureForcedDependency(t,e){return bt(Al,this).recordFutureForcedDependency(t,bt(El,this)),this}inheritSimpleDataAsFutureForcedDependencies(t){return bt(Al,this).inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return bt(Al,this).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return bt(xl,this)||bt(Al,this).resetBBox(bt(El,this)),this}recordClipBox(t,e,i,n,s,r){return bt(xl,this)||bt(Al,this).recordClipBox(bt(El,this),e,i,n,s,r),this}recordBBox(t,e,i,n,s,r){return bt(xl,this)||bt(Al,this).recordBBox(bt(El,this),e,i,n,s,r),this}recordCharacterBBox(t,e,i,n,s,r,a){return bt(xl,this)||bt(Al,this).recordCharacterBBox(bt(El,this),e,i,n,s,r,a),this}recordFullPageBBox(t){return bt(xl,this)||bt(Al,this).recordFullPageBBox(bt(El,this)),this}getSimpleIndex(t){return bt(Al,this).getSimpleIndex(t)}recordDependencies(t,e){return bt(Al,this).recordDependencies(bt(El,this),e),this}recordNamedDependency(t,e){return bt(Al,this).recordNamedDependency(bt(El,this),e),this}recordOperation(t){return bt(Al,this).recordOperation(bt(El,this),!0),this}recordShowTextOperation(t){return bt(Al,this).recordShowTextOperation(bt(El,this),!0),this}bboxToClipBoxDropOperation(t){return bt(xl,this)||bt(Al,this).bboxToClipBoxDropOperation(bt(El,this),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const Sl=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],Ml=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],Tl=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],Pl=["filter","fillColor","fillAlpha"],Ll=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],Rl=["transform"],Dl=["transform","fillColor"],Fl="Fill",Il="Stroke",Nl="Shading";function Ol(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 Bl{isModifyingCurrentTransform(){return!1}getPattern(){Ce("Abstract method `getPattern` called.")}}class Wl extends Bl{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 i of this._colorStops)e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,n){let s;if(n===Il||n===Fl){const r=e.current.getClippedPathBoundingBox(n,pi(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),c=l.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-r[0],-r[1]),i=He.transform(i,[1,0,0,1,r[0],r[1]]),c.transform(...e.baseTransform),this.matrix&&c.transform(...this.matrix),Ol(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),s=t.createPattern(l.canvas,"no-repeat");const h=new DOMMatrix(i);s.setTransform(h)}else Ol(t,this._bbox),s=this._createGradient(t);return s}}function zl(t,e,i,n,s,r,a,o){const l=e.coords,c=e.colors,h=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,g=(l[i+1]+e.offsetY)*e.scaleY,f=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,v=(l[s]+e.offsetX)*e.scaleX,w=(l[s+1]+e.offsetY)*e.scaleY;if(g>=w)return;const b=c[r],y=c[r+1],A=c[r+2],E=c[a],x=c[a+1],_=c[a+2],k=c[o],C=c[o+1],S=c[o+2],M=Math.round(g),T=Math.round(w);let P,L,R,D,F,I,N,O;for(let B=M;B<=T;B++){if(B<m){const t=B<g?0:(g-B)/(g-m);P=p-(p-f)*t,L=b-(b-E)*t,R=y-(y-x)*t,D=A-(A-_)*t}else{let t;t=B>w?1:m===w?0:(m-B)/(m-w),P=f-(f-v)*t,L=E-(E-k)*t,R=x-(x-C)*t,D=_-(_-S)*t}let t;t=B<g?0:B>w?1:(g-B)/(g-w),F=p-(p-v)*t,I=b-(b-k)*t,N=y-(y-C)*t,O=A-(A-S)*t;const e=Math.round(Math.min(P,F)),i=Math.round(Math.max(P,F));let n=d*B+4*e;for(let s=e;s<=i;s++)t=(P-s)/(P-F),t<0?t=0:t>1&&(t=1),h[n++]=L-(L-I)*t|0,h[n++]=R-(R-N)*t|0,h[n++]=D-(D-O)*t|0,h[n++]=255}}function jl(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,c=o-1;for(r=0;r<l;r++){let e=r*o;for(let r=0;r<c;r++,e++)zl(t,i,n[e],n[e+1],n[e+o],s[e],s[e+1],s[e+o]),zl(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)zl(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 Hl extends Bl{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],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),c=r/o,h=a/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-s,scaleX:1/c,scaleY:1/h},u=o+4,p=l+4,g=i.getCanvas("mesh",u,p),f=g.context,m=f.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 v of this._figures)jl(m,v,d);f.putImageData(m,2,2);return{canvas:g.canvas,offsetX:n-2*c,offsetY:s-2*h,scaleX:c,scaleY:h}}isModifyingCurrentTransform(){return!0}getPattern(t,e,i,n){Ol(t,this._bbox);const s=new Float32Array(2);if(n===Nl)He.singularValueDecompose2dScale(pi(t),s);else if(this.matrix){He.singularValueDecompose2dScale(this.matrix,s);const[t,i]=s;He.singularValueDecompose2dScale(e.baseTransform,s),s[0]*=t,s[1]*=i}else He.singularValueDecompose2dScale(e.baseTransform,s);const r=this._createMeshCanvas(s,n===Nl?null:this._background,e.cachedCanvases);return n!==Nl&&(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 Ul extends Bl{getPattern(){return"hotpink"}}const Vl=1,Gl=2;class ql{constructor(t,e,i,n){this.color=t[1],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.ctx=e,this.canvasGraphicsFactory=i,this.baseTransform=n}createPatternCanvas(t,e){var i,n;const{bbox:s,operatorList:r,paintType:a,tilingType:o,color:l,canvasGraphicsFactory:c}=this;let{xstep:h,ystep:d}=this;h=Math.abs(h),d=Math.abs(d),_e("TilingType: "+o);const u=s[0],p=s[1],g=s[2],f=s[3],m=g-u,v=f-p,w=new Float32Array(2);He.singularValueDecompose2dScale(this.matrix,w);const[b,y]=w;He.singularValueDecompose2dScale(this.baseTransform,w);const A=b*w[0],E=y*w[1];let x=m,_=v,k=!1,C=!1;const S=Math.ceil(h*A),M=Math.ceil(d*E);S>=Math.ceil(m*A)?x=h:k=!0,M>=Math.ceil(v*E)?_=d:C=!0;const T=this.getSizeAndScale(x,this.ctx.canvas.width,A),P=this.getSizeAndScale(_,this.ctx.canvas.height,E),L=t.cachedCanvases.getCanvas("pattern",T.size,P.size),R=L.context,D=c.createCanvasGraphics(R,e);if(D.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(D,a,l),R.translate(-T.scale*u,-P.scale*p),D.transform(0,T.scale,0,0,P.scale,0,0),R.save(),null===(i=D.dependencyTracker)||void 0===i||i.save(),this.clipBbox(D,u,p,g,f),D.baseTransform=pi(D.ctx),D.executeOperatorList(r),D.endDrawing(),null===(n=D.dependencyTracker)||void 0===n||n.restore(),R.restore(),k||C){const e=L.canvas;k&&(x=h),C&&(_=d);const i=this.getSizeAndScale(x,this.ctx.canvas.width,A),n=this.getSizeAndScale(_,this.ctx.canvas.height,E),s=i.size,r=n.size,a=t.cachedCanvases.getCanvas("pattern-workaround",s,r),o=a.context,l=k?Math.floor(m/h):0,c=C?Math.floor(v/d):0;for(let t=0;t<=l;t++)for(let i=0;i<=c;i++)o.drawImage(e,s*t,r*i,s,r,0,0,s,r);return{canvas:a.canvas,scaleX:i.scale,scaleY:n.scale,offsetX:u,offsetY:p}}return{canvas:L.canvas,scaleX:T.scale,scaleY:P.scale,offsetX:u,offsetY:p}}getSizeAndScale(t,e,i){const n=Math.max(ql.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),He.axialAlignedBoundingBox([e,i,n,s],pi(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case Vl:const{fillStyle:t,strokeStyle:r}=this.ctx;n.fillStyle=s.fillColor=t,n.strokeStyle=s.strokeColor=r;break;case Gl:n.fillStyle=n.strokeStyle=i,s.fillColor=s.strokeColor=i;break;default:throw new Ne("Unsupported paint type: ".concat(e))}}isModifyingCurrentTransform(){return!1}getPattern(t,e,i,n,s){let r=i;n!==Nl&&(r=He.transform(r,e.baseTransform),this.matrix&&(r=He.transform(r,this.matrix)));const a=this.createPatternCanvas(e,s);let o=new DOMMatrix(r);o=o.translate(a.offsetX,a.offsetY),o=o.scale(1/a.scaleX,1/a.scaleY);const l=t.createPattern(a.canvas,"repeat");return l.setTransform(o),l}}function Xl(t){let{src:e,srcPos:i=0,dest:n,width:s,height:r,nonBlackColor:a=4294967295,inverseDecode:o=!1}=t;const l=ze.isLittleEndian?4278190080:255,[c,h]=o?[a,l]:[l,a],d=s>>3,u=7&s,p=e.length;n=new Uint32Array(n.buffer);let g=0;for(let f=0;f<r;f++){for(const s=i+d;i<s;i++){const t=i<p?e[i]:255;n[g++]=128&t?h:c,n[g++]=64&t?h:c,n[g++]=32&t?h:c,n[g++]=16&t?h:c,n[g++]=8&t?h:c,n[g++]=4&t?h:c,n[g++]=2&t?h:c,n[g++]=1&t?h:c}if(0===u)continue;const t=i<p?e[i++]:255;for(let e=0;e<u;e++)n[g++]=t&1<<7-e?h:c}return{srcPos:i,destPos:g}}(0,Wt.A)(ql,"MAX_PATTERN_SIZE",3e3);const Yl=16,Kl=new DOMMatrix,Ql=new Float32Array(2),Zl=new Float32Array([1/0,1/0,-1/0,-1/0]);class Jl{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 $l(t,e,i,n,s,r,a,o,l,c){const[h,d,u,p,g,f]=pi(t);if(0===d&&0===u){const m=a*h+g,v=Math.round(m),w=o*p+f,b=Math.round(w),y=(a+l)*h+g,A=Math.abs(Math.round(y)-v)||1,E=(o+c)*p+f,x=Math.abs(Math.round(E)-b)||1;return t.setTransform(Math.sign(h),0,0,Math.sign(p),v,b),t.drawImage(e,i,n,s,r,0,0,A,x),t.setTransform(h,d,u,p,g,f),[A,x]}if(0===h&&0===p){const m=o*u+g,v=Math.round(m),w=a*d+f,b=Math.round(w),y=(o+c)*u+g,A=Math.abs(Math.round(y)-v)||1,E=(a+l)*d+f,x=Math.abs(Math.round(E)-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(h,d,u,p,g,f),[x,A]}t.drawImage(e,i,n,s,r,a,o,l,c);return[Math.hypot(h,d)*l,Math.hypot(u,p)*c]}class tc{constructor(t,e,i){(0,Wt.A)(this,"alphaIsShape",!1),(0,Wt.A)(this,"fontSize",0),(0,Wt.A)(this,"fontSizeScale",1),(0,Wt.A)(this,"textMatrix",null),(0,Wt.A)(this,"textMatrixScale",1),(0,Wt.A)(this,"fontMatrix",Ht),(0,Wt.A)(this,"leading",0),(0,Wt.A)(this,"x",0),(0,Wt.A)(this,"y",0),(0,Wt.A)(this,"lineX",0),(0,Wt.A)(this,"lineY",0),(0,Wt.A)(this,"charSpacing",0),(0,Wt.A)(this,"wordSpacing",0),(0,Wt.A)(this,"textHScale",1),(0,Wt.A)(this,"textRenderingMode",ie),(0,Wt.A)(this,"textRise",0),(0,Wt.A)(this,"fillColor","#000000"),(0,Wt.A)(this,"strokeColor","#000000"),(0,Wt.A)(this,"patternFill",!1),(0,Wt.A)(this,"patternStroke",!1),(0,Wt.A)(this,"fillAlpha",1),(0,Wt.A)(this,"strokeAlpha",1),(0,Wt.A)(this,"lineWidth",1),(0,Wt.A)(this,"activeSMask",null),(0,Wt.A)(this,"transferMaps","none"),null===i||void 0===i||i(this),this.clipBox=new Float32Array([0,0,t,e]),this.minMax=Zl.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fl,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=this.minMax.slice();if(t===Il){e||Ce("Stroke bounding box must include transform."),He.singularValueDecompose2dScale(e,Ql);const t=Ql[0]*this.lineWidth/2,n=Ql[1]*this.lineWidth/2;i[0]-=t,i[1]-=n,i[2]+=t,i[3]+=n}return i}updateClipFromPath(){const t=He.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(Zl,0)}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fl,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return He.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function ec(t,e){if(e instanceof ImageData)return void t.putImageData(e,0,0);const i=e.height,n=e.width,s=i%Yl,r=(i-s)/Yl,a=0===s?r:r+1,o=t.createImageData(n,Yl);let l,c=0;const h=e.data,d=o.data;let u,p,g,f;if(e.kind===le.GRAYSCALE_1BPP){const e=h.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),f=i.length,m=n+7>>3,v=4294967295,w=ze.isLittleEndian?4278190080:255;for(u=0;u<a;u++){for(g=u<r?Yl:s,l=0,p=0;p<g;p++){const t=e-c;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=h[c++],i[l++]=128&d?v:w,i[l++]=64&d?v:w,i[l++]=32&d?v:w,i[l++]=16&d?v:w,i[l++]=8&d?v:w,i[l++]=4&d?v:w,i[l++]=2&d?v:w,i[l++]=1&d?v:w;for(;s<r;s++)0===o&&(d=h[c++],o=128),i[l++]=d&o?v:w,o>>=1}for(;l<f;)i[l++]=0;t.putImageData(o,0,u*Yl)}}else if(e.kind===le.RGBA_32BPP){for(p=0,f=n*Yl*4,u=0;u<r;u++)d.set(h.subarray(c,c+f)),c+=f,t.putImageData(o,0,p),p+=Yl;u<a&&(f=n*s*4,d.set(h.subarray(c,c+f)),t.putImageData(o,0,p))}else{if(e.kind!==le.RGB_24BPP)throw new Error("bad image kind: ".concat(e.kind));for(g=Yl,f=n*g,u=0;u<a;u++){for(u>=r&&(g=s,f=n*g),l=0,p=f;p--;)d[l++]=h[c++],d[l++]=h[c++],d[l++]=h[c++],d[l++]=255;t.putImageData(o,0,u*Yl)}}}function ic(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%Yl,r=(i-s)/Yl,a=0===s?r:r+1,o=t.createImageData(n,Yl);let l=0;const c=e.data,h=o.data;for(let d=0;d<a;d++){const e=d<r?Yl:s;({srcPos:l}=Xl({src:c,srcPos:l,dest:h,width:n,height:e,nonBlackColor:0})),t.putImageData(o,0,d*Yl)}}function nc(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 sc(t){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);const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}function rc(t,e){if(e)return!0;He.singularValueDecompose2dScale(t,Ql);const i=Math.fround(mi.pixelRatio*ti.PDF_TO_CSS_UNITS);return Ql[0]<=i&&Ql[1]<=i}const ac=["butt","round","square"],oc=["miter","round","bevel"],lc={},cc={};var hc=new WeakSet;class dc{constructor(t,e,i,n,s,r,a,o,l){let{optionalContentConfig:c,markedContentStack:h=null}=r;ft(this,hc),this.ctx=t,this.current=new tc(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=s,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=h||[],this.optionalContentConfig=c,this.cachedCanvases=new Jl(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=a,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=o,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=null!==l&&void 0!==l?l:null}getObject(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var n;return"string"===typeof e?(null===(n=this.dependencyTracker)||void 0===n||n.recordNamedDependency(t,e),e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e)):i}beginDrawing(t){let{transform:e,viewport:i,transparency:n=!1,background:s=null}=t;const r=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,r,a),this.ctx.fillStyle=o,n){const t=this.cachedCanvases.getCanvas("transparent",r,a);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...pi(this.compositeCtx))}this.ctx.save(),sc(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=pi(this.ctx)}executeOperatorList(t,e,i,n,s){const r=t.argsArray,a=t.fnArray;let o=e||0;const l=r.length;if(l===o)return o;const c=l-o>10&&"function"===typeof i,h=c?Date.now()+15:0;let d=0;const u=this.commonObjs,p=this.objs;let g,f;for(;;){if(void 0!==n&&o===n.nextBreakPoint)return n.breakIt(o,i),o;var m;if(!s||s(o))if(g=a[o],f=null!==(m=r[o])&&void 0!==m?m:null,g!==me.dependency)null===f?this[g](o):this[g](o,...f);else for(const t of f){var v;null===(v=this.dependencyTracker)||void 0===v||v.recordNamedData(t,o);const e=t.startsWith("g_")?u:p;if(!e.has(t))return e.get(t,i),o}if(o++,o===l)return o;if(c&&++d>10){if(Date.now()>h)return i(),o;d=0}}}endDrawing(){vt(hc,this,uc).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),vt(hc,this,pc).call(this)}_scaleImage(t,e){var i,n;const s=null!==(i=t.width)&&void 0!==i?i:t.displayWidth,r=null!==(n=t.height)&&void 0!==n?n:t.displayHeight;let a,o,l=Math.max(Math.hypot(e[0],e[1]),1),c=Math.max(Math.hypot(e[2],e[3]),1),h=s,d=r,u="prescale1";for(;l>2&&h>1||c>2&&d>1;){let e=h,i=d;l>2&&h>1&&(e=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h/2),l/=h/e),c>2&&d>1&&(i=d>=16384?Math.floor(d/2)-1||1:Math.ceil(d)/2,c/=d/i),a=this.cachedCanvases.getCanvas(u,e,i),o=a.context,o.clearRect(0,0,e,i),o.drawImage(t,0,0,h,d,0,0,e,i),t=a.canvas,h=e,d=i,u="prescale1"===u?"prescale2":"prescale1"}return{img:t,paintWidth:h,paintHeight:d}}_createMaskCanvas(t,e){var i;const n=this.ctx,{width:s,height:r}=e,a=this.current.fillColor,o=this.current.patternFill,l=pi(n);let c,h,d,u;if((e.bitmap||e.data)&&e.count>1){const i=e.bitmap||e.data.buffer;h=JSON.stringify(o?l:[l.slice(0,4),a]),c=this._cachedBitmapsMap.get(i),c||(c=new Map,this._cachedBitmapsMap.set(i,c));const n=c.get(h);if(n&&!o){var p;const e=Math.round(Math.min(l[0],l[2])+l[4]),i=Math.round(Math.min(l[1],l[3])+l[5]);return null===(p=this.dependencyTracker)||void 0===p||p.recordDependencies(t,Dl),{canvas:n,offsetX:e,offsetY:i}}d=n}d||(u=this.cachedCanvases.getCanvas("maskCanvas",s,r),ic(u.context,e));let g=He.transform(l,[1/s,0,0,-1/r,0,0]);g=He.transform(g,[1,0,0,1,0,-r]);const f=Zl.slice();He.axialAlignedBoundingBox([0,0,s,r],g,f);const[m,v,w,b]=f,y=Math.round(w-m)||1,A=Math.round(b-v)||1,E=this.cachedCanvases.getCanvas("fillCanvas",y,A),x=E.context,_=m,k=v;x.translate(-_,-k),x.transform(...g),d||(d=this._scaleImage(u.canvas,gi(x)),d=d.img,c&&o&&c.set(h,d)),x.imageSmoothingEnabled=rc(pi(x),e.interpolate),$l(x,d,0,0,d.width,d.height,0,0,s,r),x.globalCompositeOperation="source-in";const C=He.transform(gi(x),[1,0,0,1,-_,-k]);return x.fillStyle=o?a.getPattern(n,this,C,Fl,t):a,x.fillRect(0,0,s,r),c&&!o&&(this.cachedCanvases.delete("fillCanvas"),c.set(h,E.canvas)),null===(i=this.dependencyTracker)||void 0===i||i.recordDependencies(t,Dl),{canvas:E.canvas,offsetX:Math.round(_),offsetY:Math.round(k)}}setLineWidth(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("lineWidth",t),e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("lineCap",t),this.ctx.lineCap=ac[e]}setLineJoin(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("lineJoin",t),this.ctx.lineJoin=oc[e]}setMiterLimit(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("miterLimit",t),this.ctx.miterLimit=e}setDash(t,e,i){var n;null===(n=this.dependencyTracker)||void 0===n||n.recordSimpleData("dash",t);const s=this.ctx;void 0!==s.setLineDash&&(s.setLineDash(e),s.lineDashOffset=i)}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){var i,n,s,r,a;for(const[o,l]of e)switch(o){case"LW":this.setLineWidth(t,l);break;case"LC":this.setLineCap(t,l);break;case"LJ":this.setLineJoin(t,l);break;case"ML":this.setMiterLimit(t,l);break;case"D":this.setDash(t,l[0],l[1]);break;case"RI":this.setRenderingIntent(t,l);break;case"FL":this.setFlatness(t,l);break;case"Font":this.setFont(t,l[0],l[1]);break;case"CA":null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=l;break;case"ca":null===(n=this.dependencyTracker)||void 0===n||n.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=l;break;case"BM":null===(s=this.dependencyTracker)||void 0===s||s.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=l;break;case"SMask":null===(r=this.dependencyTracker)||void 0===r||r.recordSimpleData("SMask",t),this.current.activeSMask=l?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":null===(a=this.dependencyTracker)||void 0===a||a.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(l)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(t){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,i=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(n,e,i);this.suspendedCtx=this.ctx;const r=this.ctx=s.context;r.setTransform(this.suspendedCtx.getTransform()),nc(this.suspendedCtx,r),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()}}(r,this.suspendedCtx),this.setGState(t,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),nc(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,c,h){let d=t.canvas,u=o-c,p=l-h;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),e.globalCompositeOperation="destination-atop",e.fillStyle=r,e.fillRect(0,0,i,n),e.globalCompositeOperation="source-over",d=t.canvas,u=p=0}else{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=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 g=new Path2D;g.rect(o,l,i,n),e.clip(g),e.globalCompositeOperation="destination-in",e.drawImage(d,u,p,i,n,o,l,i,n),e.restore()}save(t){var e;this.inSMaskMode&&nc(this.ctx,this.suspendedCtx),this.ctx.save();const i=this.current;this.stateStack.push(i),this.current=i.clone(),null===(e=this.dependencyTracker)||void 0===e||e.save(t)}restore(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.restore(t),0!==this.stateStack.length?(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&nc(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null):this.inSMaskMode&&this.endSMaskMode()}transform(t,e,i,n,s,r,a){var o;null===(o=this.dependencyTracker)||void 0===o||o.recordIncrementalData("transform",t),this.ctx.transform(e,i,n,s,r,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i,n){let[s]=i;if(!n)return s||(s=i[0]=new Path2D),void this[e](t,s);if(null!==this.dependencyTracker){const i=e===me.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,n[0]-i,n[2]+i,n[1]-i,n[3]+i).recordDependencies(t,["transform"])}if(!(s instanceof Path2D)){const t=i[0]=new Path2D;for(let e=0,i=s.length;e<i;)switch(s[e++]){case ve:t.moveTo(s[e++],s[e++]);break;case we:t.lineTo(s[e++],s[e++]);break;case be:t.bezierCurveTo(s[e++],s[e++],s[e++],s[e++],s[e++],s[e++]);break;case ye:t.closePath();break;default:ke("Unrecognized drawing path operator: ".concat(s[e-1]))}s=t}He.axialAlignedBoundingBox(n,pi(this.ctx),this.current.minMax),this[e](t,s),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,e){var i;let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const s=this.ctx,r=this.current.strokeColor;if(s.globalAlpha=this.current.strokeAlpha,this.contentVisible)if("object"===typeof r&&null!==r&&void 0!==r&&r.getPattern){const i=r.isModifyingCurrentTransform()?s.getTransform():null;if(s.save(),s.strokeStyle=r.getPattern(s,this,gi(s),Il,t),i){const t=new Path2D;t.addPath(e,s.getTransform().invertSelf().multiplySelf(i)),e=t}this.rescaleAndStroke(e,!1),s.restore()}else this.rescaleAndStroke(e,!0);null===(i=this.dependencyTracker)||void 0===i||i.recordDependencies(t,Sl),n&&this.consumePath(t,e,this.current.getClippedPathBoundingBox(Il,pi(this.ctx))),s.globalAlpha=this.current.fillAlpha}closeStroke(t,e){this.stroke(t,e)}fill(t,e){var i;let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const s=this.ctx,r=this.current.fillColor;let a=!1;if(this.current.patternFill){var o;const i=r.isModifyingCurrentTransform()?s.getTransform():null;if(null===(o=this.dependencyTracker)||void 0===o||o.save(t),s.save(),s.fillStyle=r.getPattern(s,this,gi(s),Fl,t),i){const t=new Path2D;t.addPath(e,s.getTransform().invertSelf().multiplySelf(i)),e=t}a=!0}const l=this.current.getClippedPathBoundingBox();var c;(this.contentVisible&&null!==l&&(this.pendingEOFill?(s.fill(e,"evenodd"),this.pendingEOFill=!1):s.fill(e)),null===(i=this.dependencyTracker)||void 0===i||i.recordDependencies(t,Ml),a)&&(s.restore(),null===(c=this.dependencyTracker)||void 0===c||c.restore(t));n&&this.consumePath(t,e,l)}eoFill(t,e){this.pendingEOFill=!0,this.fill(t,e)}fillStroke(t,e){this.fill(t,e,!1),this.stroke(t,e,!1),this.consumePath(t,e)}eoFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}closeFillStroke(t,e){this.fillStroke(t,e)}closeEOFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}endPath(t,e){this.consumePath(t,e)}rawFillPath(t,e){var i;this.ctx.fill(e),null===(i=this.dependencyTracker)||void 0===i||i.recordDependencies(t,Pl).recordOperation(t)}clip(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordFutureForcedDependency("clipMode",t),this.pendingClip=lc}eoClip(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordFutureForcedDependency("clipMode",t),this.pendingClip=cc}beginText(t){var e;this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,null===(e=this.dependencyTracker)||void 0===e||e.recordOpenMarker(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){const e=this.pendingTextPaths,i=this.ctx;if(this.dependencyTracker){const{dependencyTracker:i}=this;void 0!==e&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",t),i.recordCloseMarker(t)}if(void 0!==e){const t=new Path2D,n=i.getTransform().invertSelf();for(const{transform:i,x:s,y:r,fontSize:a,path:o}of e)o&&t.addPath(o,new DOMMatrix(i).preMultiplySelf(n).translate(s,r).scale(a,-a));i.clip(t)}delete this.pendingTextPaths}setCharSpacing(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("charSpacing",t),this.current.charSpacing=e}setWordSpacing(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("wordSpacing",t),this.current.wordSpacing=e}setHScale(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("hScale",t),this.current.textHScale=e/100}setLeading(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("leading",t),this.current.leading=-e}setFont(t,e,i){var n,s;null===(n=this.dependencyTracker)||void 0===n||n.recordSimpleData("font",t).recordSimpleDataFromNamed("fontObj",e,t);const r=this.commonObjs.get(e),a=this.current;if(!r)throw new Error("Can't find font for ".concat(e));if(a.fontMatrix=r.fontMatrix||Ht,0!==a.fontMatrix[0]&&0!==a.fontMatrix[3]||ke("Invalid font matrix for font "+e),i<0?(i=-i,a.fontDirection=-1):a.fontDirection=1,this.current.font=r,this.current.fontSize=i,r.isType3Font)return;const o=r.loadedName||"sans-serif",l=(null===(s=r.systemFontInfo)||void 0===s?void 0:s.css)||'"'.concat(o,'", ').concat(r.fallbackName);let c="normal";r.black?c="900":r.bold&&(c="bold");const h=r.italic?"italic":"normal";let d=i;i<16?d=16:i>100&&(d=100),this.current.fontSizeScale=i/d,this.ctx.font="".concat(h," ").concat(c," ").concat(d,"px ").concat(l)}setTextRenderingMode(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=e}setTextRise(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("textRise",t),this.current.textRise=e}moveText(t,e,i){var n;null===(n=this.dependencyTracker)||void 0===n||n.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=i}setLeadingMoveText(t,e,i){this.setLeading(t,-i),this.moveText(t,e,i)}setTextMatrix(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("textMatrix",t);const{current:n}=this;n.textMatrix=e,n.textMatrixScale=Math.hypot(e[0],e[1]),n.x=n.lineX=0,n.y=n.lineY=0}nextLine(t){var e,i;this.moveText(t,0,this.current.leading),null===(e=this.dependencyTracker)||void 0===e||e.recordIncrementalData("moveText",null!==(i=this.dependencyTracker.getSimpleIndex("leading"))&&void 0!==i?i:t)}paintChar(t,e,i,n,s,r){const a=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,h=o.fontSize/o.fontSizeScale,d=c&ae,u=!!(c&oe),p=o.patternFill&&!l.missingFile,g=o.patternStroke&&!l.missingFile;let f;if((l.disableFontFace||u||p||g)&&!l.missingFile&&(f=l.getPathGenerator(this.commonObjs,e)),f&&(l.disableFontFace||p||g)){var m;let e;if(a.save(),a.translate(i,n),a.scale(h,-h),null===(m=this.dependencyTracker)||void 0===m||m.recordCharacterBBox(t,a,l),d===ie||d===se)if(s){e=a.getTransform(),a.setTransform(...s);const t=vt(hc,this,gc).call(this,f,e,s);a.fill(t)}else a.fill(f);if(d===ne||d===se)if(r){e||(e=a.getTransform()),a.setTransform(...r);const{a:t,b:i,c:n,d:s}=e,o=He.inverseTransform(r),l=He.transform([t,i,n,s,0,0],o);He.singularValueDecompose2dScale(l,Ql),a.lineWidth*=Math.max(Ql[0],Ql[1])/h,a.stroke(vt(hc,this,gc).call(this,f,e,r))}else a.lineWidth/=h,a.stroke(f);a.restore()}else{var v;if(d===ie||d===se)a.fillText(e,i,n),null===(v=this.dependencyTracker)||void 0===v||v.recordCharacterBBox(t,a,l,h,i,n,()=>a.measureText(e));if(d===ne||d===se){var w;if(this.dependencyTracker)null===(w=this.dependencyTracker)||void 0===w||w.recordCharacterBBox(t,a,l,h,i,n,()=>a.measureText(e)).recordDependencies(t,Sl);a.strokeText(e,i,n)}}if(u){var b;(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:pi(a),x:i,y:n,fontSize:h,path:f}),null===(b=this.dependencyTracker)||void 0===b||b.recordCharacterBBox(t,a,l,h,i,n)}}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 n=3;n<e.length;n+=4)if(e[n]>0&&e[n]<255){i=!0;break}return Pe(this,"isFontSubpixelAAEnabled",i)}showText(t,e){var i;this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,Ll).resetBBox(t),this.current.textRenderingMode&oe&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());const n=this.current,s=n.font;var r;if(s.isType3Font)return this.showType3Text(t,e),void(null===(r=this.dependencyTracker)||void 0===r||r.recordShowTextOperation(t));const a=n.fontSize;var o;if(0===a)return void(null===(o=this.dependencyTracker)||void 0===o||o.recordOperation(t));const l=this.ctx,c=n.fontSizeScale,h=n.charSpacing,d=n.wordSpacing,u=n.fontDirection,p=n.textHScale*u,g=e.length,f=s.vertical,m=f?1:-1,v=s.defaultVMetrics,w=a*n.fontMatrix[0],b=n.textRenderingMode===ie&&!s.disableFontFace&&!n.patternFill;let y,A;if(l.save(),n.textMatrix&&l.transform(...n.textMatrix),l.translate(n.x,n.y+n.textRise),u>0?l.scale(p,-1):l.scale(p,1),n.patternFill){l.save();const e=n.fillColor.getPattern(l,this,gi(l),Fl,t);y=pi(l),l.restore(),l.fillStyle=e}if(n.patternStroke){l.save();const e=n.strokeColor.getPattern(l,this,gi(l),Il,t);A=pi(l),l.restore(),l.strokeStyle=e}let E=n.lineWidth;const x=n.textMatrixScale;if(0===x||0===E){const t=n.textRenderingMode&ae;t!==ne&&t!==se||(E=this.getSinglePixelWidth())}else E/=x;if(1!==c&&(l.scale(c,c),E/=c),l.lineWidth=E,s.isInvalidPDFjsFont){const i=[];let s=0;for(const t of e)i.push(t.unicode),s+=t.width;const r=i.join("");if(l.fillText(r,0,0),null!==this.dependencyTracker){const e=l.measureText(r);this.dependencyTracker.recordBBox(t,this.ctx,-e.actualBoundingBoxLeft,e.actualBoundingBoxRight,-e.actualBoundingBoxAscent,e.actualBoundingBoxDescent).recordShowTextOperation(t)}return n.x+=s*w*p,l.restore(),void this.compose()}let _,k=0;for(_=0;_<g;++_){const i=e[_];if("number"===typeof i){k+=m*i*a/1e3;continue}let n=!1;const r=(i.isSpace?d:0)+h,o=i.fontChar,p=i.accent;let g,E,x,S=i.width;if(f){const t=i.vmetric||v,e=-(i.vmetric?t[1]:.5*S)*w,n=t[2]*w;S=t?-t[0]:S,g=e/c,E=(k+n)/c}else g=k/c,E=0;if(s.remeasure&&S>0){x=l.measureText(o);const t=1e3*x.width/a*c;if(S<t&&this.isFontSubpixelAAEnabled){const e=S/t;n=!0,l.save(),l.scale(e,1),g/=e}else S!==t&&(g+=(S-t)/2e3*a/c)}var C;if(this.contentVisible&&(i.isInFont||s.missingFile))if(b&&!p)l.fillText(o,g,E),null===(C=this.dependencyTracker)||void 0===C||C.recordCharacterBBox(t,l,x?{bbox:null}:s,a/c,g,E,()=>null!==x&&void 0!==x?x:l.measureText(o));else if(this.paintChar(t,o,g,E,y,A),p){const e=g+a*p.offset.x/c,i=E-a*p.offset.y/c;this.paintChar(t,p.fontChar,e,i,y,A)}k+=f?S*w-r*u:S*w+r*u,n&&l.restore()}f?n.y-=k:n.x+=k*p,l.restore(),this.compose(),null===(i=this.dependencyTracker)||void 0===i||i.recordShowTextOperation(t)}showType3Text(t,e){const i=this.ctx,n=this.current,s=n.font,r=n.fontSize,a=n.fontDirection,o=s.vertical?1:-1,l=n.charSpacing,c=n.wordSpacing,h=n.textHScale*a,d=n.fontMatrix||Ht,u=e.length;let p,g,f,m;if(n.textRenderingMode===re||0===r)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),n.textMatrix&&i.transform(...n.textMatrix),i.translate(n.x,n.y+n.textRise),i.scale(h,a);const v=this.dependencyTracker;for(this.dependencyTracker=v?new Cl(v,t):null,p=0;p<u;++p){if(g=e[p],"number"===typeof g){m=o*g*r/1e3,this.ctx.translate(m,0),n.x+=m*h;continue}const t=(g.isSpace?c:0)+l,a=s.charProcOperatorList[g.operatorListId];a?this.contentVisible&&(this.save(),i.scale(r,r),i.transform(...d),this.executeOperatorList(a),this.restore()):ke('Type3 character "'.concat(g.operatorListId,'" is not available.'));const u=[g.width,0];He.applyTransform(u,d),f=u[0]*r+t,i.translate(f,0),n.x+=f*h}i.restore(),v&&(this.dependencyTracker=v)}setCharWidth(t,e,i){}setCharWidthAndBounds(t,e,i,n,s,r,a){var o;const l=new Path2D;l.rect(n,s,r-n,a-s),this.ctx.clip(l),null===(o=this.dependencyTracker)||void 0===o||o.recordBBox(t,this.ctx,n,r,s,a).recordClipBox(t,this.ctx,n,r,s,a),this.endPath(t)}getColorN_Pattern(t,e){let i;if("TilingPattern"===e[0]){const t=this.baseTransform||pi(this.ctx),n={createCanvasGraphics:(t,e)=>new dc(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new Cl(this.dependencyTracker,e,!0):null)};i=new ql(e,this.ctx,n,t)}else i=this._getPattern(t,e[1],e[2]);return i}setStrokeColorN(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordSimpleData("strokeColor",t);for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];this.current.strokeColor=this.getColorN_Pattern(t,n),this.current.patternStroke=!0}setFillColorN(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordSimpleData("fillColor",t);for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];this.current.fillColor=this.getColorN_Pattern(t,n),this.current.patternFill=!0}setStrokeRGBColor(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}setStrokeTransparent(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1}setFillTransparent(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.cachedPatterns.has(e)?i=this.cachedPatterns.get(e):(i=function(t){switch(t[0]){case"RadialAxial":return new Wl(t);case"Mesh":return new Hl(t);case"Dummy":return new Ul}throw new Error("Unknown IR type: ".concat(t[0]))}(this.getObject(t,e)),this.cachedPatterns.set(e,i)),n&&(i.matrix=n),i}shadingFill(t,e){var i;if(!this.contentVisible)return;const n=this.ctx;this.save(t);const s=this._getPattern(t,e);n.fillStyle=s.getPattern(n,this,gi(n),Nl,t);const r=gi(n);if(r){const{width:t,height:e}=n.canvas,i=Zl.slice();He.axialAlignedBoundingBox([0,0,t,e],r,i);const[s,a,o,l]=i;this.ctx.fillRect(s,a,o-s,l-a)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);null===(i=this.dependencyTracker)||void 0===i||i.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,Rl).recordDependencies(t,Ml).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t)}beginInlineImage(){Ce("Should not call beginInlineImage")}beginImageData(){Ce("Should not call beginImageData")}paintFormXObjectBegin(t,e,i){if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),e&&this.transform(t,...e),this.baseTransform=pi(this.ctx),i)){var n;He.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[e,s,r,a]=i,o=new Path2D;o.rect(e,s,r-e,a-s),this.ctx.clip(o),null===(n=this.dependencyTracker)||void 0===n||n.recordClipBox(t,this.ctx,e,r,s,a),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,e){var i;if(!this.contentVisible)return;this.save(t),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const n=this.ctx;e.isolated||_e("TODO: Support non-isolated groups."),e.knockout&&ke("Knockout groups not supported.");const s=pi(n);if(e.matrix&&n.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let r=Zl.slice();He.axialAlignedBoundingBox(e.bbox,pi(n),r);const a=[0,0,n.canvas.width,n.canvas.height];r=He.intersect(r,a)||[0,0,0,0];const o=Math.floor(r[0]),l=Math.floor(r[1]),c=Math.max(Math.ceil(r[2])-o,1),h=Math.max(Math.ceil(r[3])-l,1);this.current.startNewPathAndClipBox([0,0,c,h]);let d="groupAt"+this.groupLevel;e.smask&&(d+="_smask_"+this.smaskCounter++%2);const u=this.cachedCanvases.getCanvas(d,c,h),p=u.context;p.translate(-o,-l),p.transform(...s);let g=new Path2D;const[f,m,v,w]=e.bbox;if(g.rect(f,m,v-f,w-m),e.matrix){const t=new Path2D;t.addPath(g,new DOMMatrix(e.matrix)),g=t}p.clip(g),e.smask&&this.smaskStack.push({canvas:u.canvas,context:p,offsetX:o,offsetY:l,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}),e.smask&&!this.dependencyTracker||(n.setTransform(1,0,0,1,0,0),n.translate(o,l),n.save()),nc(n,p),this.ctx=p,null===(i=this.dependencyTracker)||void 0===i||i.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(n),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}endGroup(t,e){var i;if(!this.contentVisible)return;this.groupLevel--;const n=this.ctx,s=this.groupStack.pop();if(this.ctx=s,this.ctx.imageSmoothingEnabled=!1,null===(i=this.dependencyTracker)||void 0===i||i.popBaseTransform(),e.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const e=pi(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...e);const i=Zl.slice();He.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],e,i),this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,n,s,r){if(vt(hc,this,uc).call(this),sc(this.ctx),this.ctx.save(),this.save(t),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const s=i[2]-i[0],a=i[3]-i[1];if(r&&this.annotationCanvasMap){(n=n.slice())[4]-=i[0],n[5]-=i[1],(i=i.slice())[0]=i[1]=0,i[2]=s,i[3]=a,He.singularValueDecompose2dScale(pi(this.ctx),Ql);const{viewportScale:t}=this,r=Math.ceil(s*this.outputScaleX*t),o=Math.ceil(a*this.outputScaleY*t);this.annotationCanvas=this.canvasFactory.create(r,o);const{canvas:l,context:c}=this.annotationCanvas;this.annotationCanvasMap.set(e,l),this.annotationCanvas.savedCtx=this.ctx,this.ctx=c,this.ctx.save(),this.ctx.setTransform(Ql[0],0,0,-Ql[1],0,a*Ql[1]),sc(this.ctx)}else{sc(this.ctx),this.endPath(t);const e=new Path2D;e.rect(i[0],i[1],s,a),this.ctx.clip(e)}}this.current=new tc(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(t,...n),this.transform(t,...s)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),vt(hc,this,pc).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t,e){var i;if(!this.contentVisible)return;const n=e.count;(e=this.getObject(t,e.data,e)).count=n;const s=this.ctx,r=this._createMaskCanvas(t,e),a=r.canvas;s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(a,r.offsetX,r.offsetY),null===(i=this.dependencyTracker)||void 0===i||i.resetBBox(t).recordBBox(t,this.ctx,r.offsetX,r.offsetX+a.width,r.offsetY,r.offsetY+a.height).recordOperation(t),s.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i){var n,s;let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0;if(!this.contentVisible)return;e=this.getObject(t,e.data,e);const c=this.ctx;c.save();const h=pi(c);c.transform(i,r,a,o,0,0);const d=this._createMaskCanvas(t,e);c.setTransform(1,0,0,1,d.offsetX-h[4],d.offsetY-h[5]),null===(n=this.dependencyTracker)||void 0===n||n.resetBBox(t);for(let p=0,g=l.length;p<g;p+=2){var u;const e=He.transform(h,[i,r,a,o,l[p],l[p+1]]);c.drawImage(d.canvas,e[4],e[5]),null===(u=this.dependencyTracker)||void 0===u||u.recordBBox(t,this.ctx,e[4],e[4]+d.canvas.width,e[5],e[5]+d.canvas.height)}c.restore(),this.compose(),null===(s=this.dependencyTracker)||void 0===s||s.recordOperation(t)}paintImageMaskXObjectGroup(t,e){var i,n;if(!this.contentVisible)return;const s=this.ctx,r=this.current.fillColor,a=this.current.patternFill;null===(i=this.dependencyTracker)||void 0===i||i.resetBBox(t).recordDependencies(t,Dl);for(const l of e){var o;const{data:e,width:i,height:n,transform:c}=l,h=this.cachedCanvases.getCanvas("maskCanvas",i,n),d=h.context;d.save();ic(d,this.getObject(t,e,l)),d.globalCompositeOperation="source-in",d.fillStyle=a?r.getPattern(d,this,gi(s),Fl,t):r,d.fillRect(0,0,i,n),d.restore(),s.save(),s.transform(...c),s.scale(1,-1),$l(s,h.canvas,0,0,i,n,0,-1,1,1),null===(o=this.dependencyTracker)||void 0===o||o.recordBBox(t,s,0,i,0,n),s.restore()}this.compose(),null===(n=this.dependencyTracker)||void 0===n||n.recordOperation(t)}paintImageXObject(t,e){if(!this.contentVisible)return;const i=this.getObject(t,e);i?this.paintInlineImageXObject(t,i):ke("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n,s){if(!this.contentVisible)return;const r=this.getObject(t,e);if(!r)return void ke("Dependent image isn't ready yet");const a=r.width,o=r.height,l=[];for(let c=0,h=s.length;c<h;c+=2)l.push({transform:[i,0,0,n,s[c],s[c+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(t,r,l)}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,e){var i;if(!this.contentVisible)return;const n=e.width,s=e.height,r=this.ctx;this.save(t);const{filter:a}=r;let o;if("none"!==a&&""!==a&&(r.filter="none"),r.scale(1/n,-1/s),e.bitmap)o=this.applyTransferMapsToBitmap(e);else if("function"===typeof HTMLElement&&e instanceof HTMLElement||!e.data)o=e;else{const t=this.cachedCanvases.getCanvas("inlineImage",n,s).context;ec(t,e),o=this.applyTransferMapsToCanvas(t)}const l=this._scaleImage(o,gi(r));r.imageSmoothingEnabled=rc(pi(r),e.interpolate),null===(i=this.dependencyTracker)||void 0===i||i.resetBBox(t).recordBBox(t,r,0,n,-s,0).recordDependencies(t,Tl).recordOperation(t),$l(r,l.img,0,0,l.paintWidth,l.paintHeight,0,-s,n,s),this.compose(),this.restore(t)}paintInlineImageXObjectGroup(t,e,i){var n,s;if(!this.contentVisible)return;const r=this.ctx;let a;if(e.bitmap)a=e.bitmap;else{const t=e.width,i=e.height,n=this.cachedCanvases.getCanvas("inlineImage",t,i).context;ec(n,e),a=this.applyTransferMapsToCanvas(n)}null===(n=this.dependencyTracker)||void 0===n||n.resetBBox(t);for(const l of i){var o;r.save(),r.transform(...l.transform),r.scale(1,-1),$l(r,a,l.x,l.y,l.w,l.h,0,-1,1,1),null===(o=this.dependencyTracker)||void 0===o||o.recordBBox(t,r,0,1,-1,0),r.restore()}null===(s=this.dependencyTracker)||void 0===s||s.recordOperation(t),this.compose()}paintSolidColorImageMask(t){var e;this.contentVisible&&(null===(e=this.dependencyTracker)||void 0===e||e.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,Ml).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t,e){}markPointProps(t,e,i){}beginMarkedContent(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e,i){var n;null===(n=this.dependencyTracker)||void 0===n||n.beginMarkedContent(t),"OC"===e?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,e,i){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const s=this.ctx;var r,a;this.pendingClip?(n||(this.pendingClip===cc?s.clip(e,"evenodd"):s.clip(e)),this.pendingClip=null,null===(r=this.dependencyTracker)||void 0===r||r.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):null===(a=this.dependencyTracker)||void 0===a||a.recordOperation(t);this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=pi(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),c=Math.hypot(n,s);if(0===t)r=c/o,a=l/o;else{const e=t*o;r=c>e?c/e:1,a=l>e?l/e:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:i,current:{lineWidth:n}}=this,[s,r]=this.getScaleForStroking();if(s===r)return i.lineWidth=(n||1)*s,void i.stroke(t);const a=i.getLineDash();e&&i.save(),i.scale(s,r),Kl.a=1/s,Kl.d=1/r;const o=new Path2D;if(o.addPath(t,Kl),a.length>0){const t=Math.max(s,r);i.setLineDash(a.map(e=>e/t)),i.lineDashOffset/=t}i.lineWidth=n||1,i.stroke(o),e&&i.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}function uc(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,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)}function pc(){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}}}function gc(t,e,i){const n=new Path2D;return n.addPath(t,new DOMMatrix(i).invertSelf().multiplySelf(e)),n}for(const tE in me)void 0!==dc.prototype[tE]&&(dc.prototype[me[tE]]=dc.prototype[tE]);var fc=new WeakMap,mc=new WeakMap,vc=new WeakMap,wc=new WeakSet;class bc{static write(t){const e=new TextEncoder,i={};let n=0;for(const l of bc.strings){const s=e.encode(t[l]);i[l]=s,n+=4+s.length}const s=new ArrayBuffer(n),r=new Uint8Array(s),a=new DataView(s);let o=0;for(const l of bc.strings){const t=i[l],e=t.length;a.setUint32(o,e),r.set(t,o+4),o+=4+e}return Se(o===s.byteLength,"CssFontInfo.write: Buffer overflow"),s}constructor(t){ft(this,wc),mt(this,fc,void 0),mt(this,mc,void 0),mt(this,vc,void 0),yt(fc,this,t),yt(mc,this,new DataView(bt(fc,this))),yt(vc,this,new TextDecoder)}get fontFamily(){return vt(wc,this,yc).call(this,0)}get fontWeight(){return vt(wc,this,yc).call(this,1)}get italicAngle(){return vt(wc,this,yc).call(this,2)}}function yc(t){Se(t<Ct.strings.length,"Invalid string index");let e=0;for(let n=0;n<t;n++)e+=bt(mc,this).getUint32(e)+4;const i=bt(mc,this).getUint32(e);return bt(vc,this).decode(new Uint8Array(bt(fc,this),e+4,i))}Ct=bc,(0,Wt.A)(bc,"strings",["fontFamily","fontWeight","italicAngle"]);var Ac=new WeakMap,Ec=new WeakMap,xc=new WeakMap,_c=new WeakSet;class kc{static write(t){const e=new TextEncoder,i={};let n=0;for(const d of kc.strings){const s=e.encode(t[d]);i[d]=s,n+=4+s.length}n+=4;let s,r,a=1+n;t.style&&(s=e.encode(t.style.style),r=e.encode(t.style.weight),a+=4+s.length+4+r.length);const o=new ArrayBuffer(a),l=new Uint8Array(o),c=new DataView(o);let h=0;c.setUint8(h++,t.guessFallback?1:0),c.setUint32(h,0),h+=4,n=0;for(const d of kc.strings){const t=i[d],e=t.length;n+=4+e,c.setUint32(h,e),l.set(t,h+4),h+=4+e}return c.setUint32(h-n-4,n),t.style&&(c.setUint32(h,s.length),l.set(s,h+4),h+=4+s.length,c.setUint32(h,r.length),l.set(r,h+4),h+=4+r.length),Se(h<=o.byteLength,"SubstitionInfo.write: Buffer overflow"),o.transferToFixedLength(h)}constructor(t){ft(this,_c),mt(this,Ac,void 0),mt(this,Ec,void 0),mt(this,xc,void 0),yt(Ac,this,t),yt(Ec,this,new DataView(bt(Ac,this))),yt(xc,this,new TextDecoder)}get guessFallback(){return 0!==bt(Ec,this).getUint8(0)}get css(){return vt(_c,this,Cc).call(this,0)}get loadedName(){return vt(_c,this,Cc).call(this,1)}get baseFontName(){return vt(_c,this,Cc).call(this,2)}get src(){return vt(_c,this,Cc).call(this,3)}get style(){let t=1;t+=4+bt(Ec,this).getUint32(t);const e=bt(Ec,this).getUint32(t),i=bt(xc,this).decode(new Uint8Array(bt(Ac,this),t+4,e));t+=4+e;const n=bt(Ec,this).getUint32(t);return{style:i,weight:bt(xc,this).decode(new Uint8Array(bt(Ac,this),t+4,n))}}}function Cc(t){Se(t<St.strings.length,"Invalid string index");let e=5;for(let n=0;n<t;n++)e+=bt(Ec,this).getUint32(e)+4;const i=bt(Ec,this).getUint32(e);return bt(xc,this).decode(new Uint8Array(bt(Ac,this),e+4,i))}St=kc,(0,Wt.A)(kc,"strings",["css","loadedName","baseFontName","src"]);var Sc=new WeakMap,Mc=new WeakMap,Tc=new WeakMap,Pc=new WeakSet;class Lc{constructor(t){let{data:e,extra:i}=t;ft(this,Pc),mt(this,Sc,void 0),mt(this,Mc,void 0),mt(this,Tc,void 0),yt(Sc,this,e),yt(Mc,this,new TextDecoder),yt(Tc,this,new DataView(bt(Sc,this))),i&&Object.assign(this,i)}get black(){return vt(Pc,this,Rc).call(this,0)}get bold(){return vt(Pc,this,Rc).call(this,1)}get disableFontFace(){return vt(Pc,this,Rc).call(this,2)}get fontExtraProperties(){return vt(Pc,this,Rc).call(this,3)}get isInvalidPDFjsFont(){return vt(Pc,this,Rc).call(this,4)}get isType3Font(){return vt(Pc,this,Rc).call(this,5)}get italic(){return vt(Pc,this,Rc).call(this,6)}get missingFile(){return vt(Pc,this,Rc).call(this,7)}get remeasure(){return vt(Pc,this,Rc).call(this,8)}get vertical(){return vt(Pc,this,Rc).call(this,9)}get ascent(){return vt(Pc,this,Dc).call(this,0)}get defaultWidth(){return vt(Pc,this,Dc).call(this,1)}get descent(){return vt(Pc,this,Dc).call(this,2)}get bbox(){let t=Nc._;if(0===bt(Tc,this).getUint8(t))return;t+=1;const e=[];for(let i=0;i<4;i++)e.push(bt(Tc,this).getInt16(t,!0)),t+=2;return e}get fontMatrix(){let t=Oc._;if(0===bt(Tc,this).getUint8(t))return;t+=1;const e=[];for(let i=0;i<6;i++)e.push(bt(Tc,this).getFloat64(t,!0)),t+=8;return e}get defaultVMetrics(){let t=Bc._;if(0===bt(Tc,this).getUint8(t))return;t+=1;const e=[];for(let i=0;i<3;i++)e.push(bt(Tc,this).getInt16(t,!0)),t+=2;return e}get fallbackName(){return vt(Pc,this,Fc).call(this,0)}get loadedName(){return vt(Pc,this,Fc).call(this,1)}get mimetype(){return vt(Pc,this,Fc).call(this,2)}get name(){return vt(Pc,this,Fc).call(this,3)}get data(){let t=Wc._;t+=4+bt(Tc,this).getUint32(t);t+=4+bt(Tc,this).getUint32(t);t+=4+bt(Tc,this).getUint32(t);const e=bt(Tc,this).getUint32(t);if(0!==e)return new Uint8Array(bt(Sc,this),t+4,e)}clearData(){let t=Wc._;t+=4+bt(Tc,this).getUint32(t);t+=4+bt(Tc,this).getUint32(t);t+=4+bt(Tc,this).getUint32(t);const e=bt(Tc,this).getUint32(t);new Uint8Array(bt(Sc,this),t+4,e).fill(0),bt(Tc,this).setUint32(t,0)}get cssFontInfo(){let t=Wc._;t+=4+bt(Tc,this).getUint32(t);t+=4+bt(Tc,this).getUint32(t);const e=bt(Tc,this).getUint32(t);if(0===e)return null;const i=new Uint8Array(e);return i.set(new Uint8Array(bt(Sc,this),t+4,e)),new bc(i.buffer)}get systemFontInfo(){let t=Wc._;t+=4+bt(Tc,this).getUint32(t);const e=bt(Tc,this).getUint32(t);if(0===e)return null;const i=new Uint8Array(e);return i.set(new Uint8Array(bt(Sc,this),t+4,e)),new kc(i.buffer)}static write(t){const e=t.systemFontInfo?kc.write(t.systemFontInfo):null,i=t.cssFontInfo?bc.write(t.cssFontInfo):null,n=new TextEncoder,s={};let r=0;for(const g of Lc.strings)s[g]=n.encode(t[g]),r+=4+s[g].length;const a=Wc._+4+r+4+(e?e.byteLength:0)+4+(i?i.byteLength:0)+4+(t.data?t.data.length:0),o=new ArrayBuffer(a),l=new Uint8Array(o),c=new DataView(o);let h=0;const d=Lc.bools.length;let u=0,p=0;for(let g=0;g<d;g++){const e=t[Lc.bools[g]];u|=(void 0===e?0:e?2:1)<<p,p+=2,8!==p&&g!==d-1||(c.setUint8(h++,u),u=0,p=0)}Se(h===Ic._,"FontInfo.write: Boolean properties offset mismatch");for(const g of Lc.numbers)c.setFloat64(h,t[g]),h+=8;if(Se(h===Nc._,"FontInfo.write: Number properties offset mismatch"),t.bbox){c.setUint8(h++,4);for(const e of t.bbox)c.setInt16(h,e,!0),h+=2}else c.setUint8(h++,0),h+=8;if(Se(h===Oc._,"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){c.setUint8(h++,6);for(const e of t.fontMatrix)c.setFloat64(h,e,!0),h+=8}else c.setUint8(h++,0),h+=48;if(Se(h===Bc._,"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){c.setUint8(h++,1);for(const e of t.defaultVMetrics)c.setInt16(h,e,!0),h+=2}else c.setUint8(h++,0),h+=6;Se(h===Wc._,"FontInfo.write: DefaultVMetrics properties offset mismatch"),c.setUint32(Wc._,0),h+=4;for(const g of Lc.strings){const t=s[g],e=t.length;c.setUint32(h,e),l.set(t,h+4),h+=4+e}if(c.setUint32(Wc._,h-Wc._-4),e){const t=e.byteLength;c.setUint32(h,t),Se(h+4+t<=o.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),l.set(new Uint8Array(e),h+4),h+=4+t}else c.setUint32(h,0),h+=4;if(i){const t=i.byteLength;c.setUint32(h,t),Se(h+4+t<=o.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),l.set(new Uint8Array(i),h+4),h+=4+t}else c.setUint32(h,0),h+=4;return void 0===t.data?(c.setUint32(h,0),h+=4):(c.setUint32(h,t.data.length),l.set(t.data,h+4),h+=4+t.data.length),Se(h<=o.byteLength,"FontInfo.write: Buffer overflow"),o.transferToFixedLength(h)}}function Rc(t){Se(t<Mt.bools.length,"Invalid boolean index");const e=Math.floor(t/4),i=2*t%8,n=bt(Tc,this).getUint8(e)>>i&3;return 0===n?void 0:2===n}function Dc(t){return Se(t<Mt.numbers.length,"Invalid number index"),bt(Tc,this).getFloat64(Ic._+8*t)}function Fc(t){Se(t<Mt.strings.length,"Invalid string index");let e=Wc._+4;for(let s=0;s<t;s++)e+=bt(Tc,this).getUint32(e)+4;const i=bt(Tc,this).getUint32(e),n=new Uint8Array(i);return n.set(new Uint8Array(bt(Sc,this),e+4,i)),bt(Mc,this).decode(n)}Mt=Lc,(0,Wt.A)(Lc,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),(0,Wt.A)(Lc,"numbers",["ascent","defaultWidth","descent"]),(0,Wt.A)(Lc,"strings",["fallbackName","loadedName","mimetype","name"]);var Ic={_:Math.ceil(2*Mt.bools.length/8)},Nc={_:vt(Mt,Mt,Ic)._+8*Mt.numbers.length},Oc={_:vt(Mt,Mt,Nc)._+1+8},Bc={_:vt(Mt,Mt,Oc)._+1+48},Wc={_:vt(Mt,Mt,Bc)._+1+6};class zc{static get workerPort(){return vt(zc,this,jc)._}static set workerPort(t){if(!("undefined"!==typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");jc._=vt(zc,this,t)}static get workerSrc(){return vt(zc,this,Hc)._}static set workerSrc(t){if("string"!==typeof t)throw new Error("Invalid `workerSrc` type.");Hc._=vt(zc,this,t)}}var jc={_:null},Hc={_:""},Uc=new WeakMap,Vc=new WeakMap;class Gc{constructor(t){let{parsedData:e,rawData:i}=t;mt(this,Uc,void 0),mt(this,Vc,void 0),yt(Uc,this,e),yt(Vc,this,i)}getRaw(){return bt(Vc,this)}get(t){var e;return null!==(e=bt(Uc,this).get(t))&&void 0!==e?e:null}[Symbol.iterator](){return bt(Uc,this).entries()}}const qc=Symbol("INTERNAL");var Xc=new WeakMap,Yc=new WeakMap,Kc=new WeakMap,Qc=new WeakMap;class Zc{constructor(t,e){let{name:i,intent:n,usage:s,rbGroups:r}=e;mt(this,Xc,!1),mt(this,Yc,!1),mt(this,Kc,!1),mt(this,Qc,!0),yt(Xc,this,!!(t&Gt)),yt(Yc,this,!!(t&qt)),this.name=i,this.intent=n,this.usage=s,this.rbGroups=r}get visible(){if(bt(Kc,this))return bt(Qc,this);if(!bt(Qc,this))return!1;const{print:t,view:e}=this.usage;return bt(Xc,this)?"OFF"!==(null===e||void 0===e?void 0:e.viewState):!bt(Yc,this)||"OFF"!==(null===t||void 0===t?void 0:t.printState)}_setVisible(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t!==qc&&Ce("Internal method `_setVisible` called."),yt(Kc,this,i),yt(Qc,this,e)}}var Jc=new WeakMap,$c=new WeakMap,th=new WeakMap,eh=new WeakMap,ih=new WeakSet;class nh{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gt;if(ft(this,ih),mt(this,Jc,null),mt(this,$c,new Map),mt(this,th,null),mt(this,eh,null),this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,yt(eh,this,t.order);for(const i of t.groups)bt($c,this).set(i.id,new Zc(e,i));if("OFF"===t.baseState)for(const t of bt($c,this).values())t._setVisible(qc,!1);for(const e of t.on)bt($c,this).get(e)._setVisible(qc,!0);for(const e of t.off)bt($c,this).get(e)._setVisible(qc,!1);yt(th,this,this.getHash())}}isVisible(t){if(0===bt($c,this).size)return!0;if(!t)return _e("Optional content group not defined."),!0;if("OCG"===t.type)return bt($c,this).has(t.id)?bt($c,this).get(t.id).visible:(ke("Optional content group not found: ".concat(t.id)),!0);if("OCMD"===t.type){if(t.expression)return vt(ih,this,sh).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!bt($c,this).has(e))return ke("Optional content group not found: ".concat(e)),!0;if(bt($c,this).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!bt($c,this).has(e))return ke("Optional content group not found: ".concat(e)),!0;if(!bt($c,this).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!bt($c,this).has(e))return ke("Optional content group not found: ".concat(e)),!0;if(!bt($c,this).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!bt($c,this).has(e))return ke("Optional content group not found: ".concat(e)),!0;if(bt($c,this).get(e).visible)return!1}return!0}return ke("Unknown optional content policy ".concat(t.policy,".")),!0}return ke("Unknown group type ".concat(t.type,".")),!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=bt($c,this).get(t);if(n){if(i&&e&&n.rbGroups.length)for(const e of n.rbGroups)for(const i of e){var s;if(i!==t)null===(s=bt($c,this).get(i))||void 0===s||s._setVisible(qc,!1,!0)}n._setVisible(qc,!!e,!0),yt(Jc,this,null)}else ke("Optional content group not found: ".concat(t))}setOCGState(t){let e,{state:i,preserveRB:n}=t;for(const s of i){switch(s){case"ON":case"OFF":case"Toggle":e=s;continue}const t=bt($c,this).get(s);if(t)switch(e){case"ON":this.setVisibility(s,!0,n);break;case"OFF":this.setVisibility(s,!1,n);break;case"Toggle":this.setVisibility(s,!t.visible,n)}}yt(Jc,this,null)}get hasInitialVisibility(){return null===bt(th,this)||this.getHash()===bt(th,this)}getOrder(){return bt($c,this).size?bt(eh,this)?bt(eh,this).slice():[...bt($c,this).keys()]:null}getGroup(t){return bt($c,this).get(t)||null}getHash(){if(null!==bt(Jc,this))return bt(Jc,this);const t=new Ea;for(const[e,i]of bt($c,this))t.update("".concat(e,":").concat(i.visible));return yt(Jc,this,t.hexdigest())}[Symbol.iterator](){return bt($c,this).entries()}}function sh(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;n<e;n++){const e=t[n];let s;if(Array.isArray(e))s=vt(ih,this,sh).call(this,e);else{if(!bt($c,this).has(e))return ke("Optional content group not found: ".concat(e)),!0;s=bt($c,this).get(e).visible}switch(i){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return"And"===i}class rh{constructor(t,e){let{disableRange:i=!1,disableStream:n=!1}=e;Se(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:r,progressiveDone:a,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,(null===r||void 0===r?void 0:r.length)>0){const t=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!n,this._isRangeSupported=!i,this._contentLength=s,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(t){let{begin:e,chunk:i}=t;const n=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{Se(this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(n),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}_onProgress(t){var e,i,n,s;void 0===t.total?null===(e=this._rangeReaders[0])||void 0===e||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded}):null===(n=this._fullRequestReader)||void 0===n||null===(s=n.onProgress)||void 0===s||s.call(n,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;null===(t=this._fullRequestReader)||void 0===t||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){Se(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new ah(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new oh(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class ah{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t,this._done=i||!1,this._filename=ri(n)?n:null,this._queuedChunks=e||[],this._loaded=0;for(const s of this._queuedChunks)this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else 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 e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class oh{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 e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function lh(t,e){const i=new Headers;if(!t||!e||"object"!==typeof e)return i;for(const n in e){const t=e[n];void 0!==t&&i.append(n,t)}return i}function ch(t){var e,i;return null!==(e=null===(i=URL.parse(t))||void 0===i?void 0:i.origin)&&void 0!==e?e:null}function hh(t){let{responseHeaders:e,isHttp:i,rangeChunkSize:n,disableRange:s}=t;const r={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e.get("Content-Length"),10);if(!Number.isInteger(a))return r;if(r.suggestedLength=a,a<=2*n)return r;if(s||!i)return r;if("bytes"!==e.get("Accept-Ranges"))return r;return"identity"!==(e.get("Content-Encoding")||"identity")||(r.allowRangeRequests=!0),r}function dh(t){const e=t.get("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 n=0;n<e.length&&n in e;++n){let[t,i]=e[n];i=a(i),t&&(i=unescape(i),0===n&&(i=o(i))),r.push(i)}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=We(i);i=n.decode(s),e=!1}catch(n){}}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(r){}return s(e,n)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(i){}if(ri(t))return t}return null}function uh(t,e){return new Ie("Unexpected server response (".concat(t,') while retrieving PDF "').concat(e,'".'),t,404===t||0===t&&e.startsWith("file:"))}function ph(t){return 200===t||206===t}function gh(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function fh(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(ke("getArrayBuffer - unexpected data format: ".concat(t)),new Uint8Array(t).buffer)}class mh{constructor(t){(0,Wt.A)(this,"_responseOrigin",null),this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=lh(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return Se(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new vh(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new wh(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class vh{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;const i=new Headers(t.headers),n=e.url;fetch(n,gh(i,this._withCredentials,this._abortController)).then(e=>{if(t._responseOrigin=ch(e.url),!ph(e.status))throw uh(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const i=e.headers,{allowRangeRequests:s,suggestedLength:r}=hh({responseHeaders:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=r||this._contentLength,this._filename=dh(i),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Oe("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)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:fh(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class wh{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;const s=new Headers(t.headers);s.append("Range","bytes=".concat(e,"-").concat(i-1));const r=n.url;fetch(r,gh(s,this._withCredentials,this._abortController)).then(e=>{const i=ch(e.url);if(i!==t._responseOrigin)throw new Error('Expected range response-origin "'.concat(i,'" to match "').concat(t._responseOrigin,'".'));if(!ph(e.status))throw uh(e.status,r);this._readCapability.resolve(),this._reader=e.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)||void 0===t||t.call(this,{loaded:this._loaded}),{value:fh(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class bh{constructor(t){let{url:e,httpHeaders:i,withCredentials:n}=t;(0,Wt.A)(this,"_responseOrigin",null),this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=lh(this.isHttp,i),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}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[s,r]of this.headers)e.setRequestHeader(s,r);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1)),n.expectedStatus=206):n.expectedStatus=200,e.responseType="arraybuffer",Se(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>{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)||void 0===i||i.call(n,e))}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const n=i.xhr;if(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==n.readyState)return;if(!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void i.onError(n.status);const s=n.status||200;if(!(200===s&&206===i.expectedStatus)&&s!==i.expectedStatus)return void i.onError(n.status);const r=function(t){const e=t.response;return"string"!==typeof e?e:We(e).buffer}(n);if(206===s){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);e?i.onDone({begin:parseInt(e[1],10),chunk:r}):(ke('Missing or invalid "Content-Range" header.'),i.onError(0))}else r?i.onDone({begin:0,chunk:r}):i.onError(n.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 yh{constructor(t){this._source=t,this._manager=new bh(t),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 Se(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new Ah(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new Eh(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class Ah{constructor(t,e){this._manager=t,this._url=e.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=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);this._manager._responseOrigin=ch(e.responseURL);const i=e.getAllResponseHeaders(),n=new Headers(i?i.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(t=>{const[e,...i]=t.split(": ");return[e,i.join(": ")]}):[]),{allowRangeRequests:s,suggestedLength:r}=hh({responseHeaders:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=r||this._contentLength,this._filename=dh(n),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);if(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=uh(t,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;null===(e=this.onProgress)||void 0===e||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._headersCapability.promise}async read(){if(await this._headersCapability.promise,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._headersCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Eh{constructor(t,e,i){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,end:i,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var t;const e=ch(null===(t=this._manager.getRequestXhr(this._requestId))||void 0===t?void 0:t.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error('Expected range response-origin "'.concat(e,'" to match "').concat(this._manager._responseOrigin,'".')),this._onError(0))}_close(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){var e;null!==(e=this._storedError)&&void 0!==e||(this._storedError=uh(t,this._url));for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||(null===(e=this.onProgress)||void 0===e||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 e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const xh=/^[a-z][a-z0-9\-+.]+:/i;class _h{constructor(t){this.source=t,this.url=function(t){if(xh.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}(t.url),Se("file:"===this.url.protocol,"PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return Se(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new kh(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Ch(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class kh{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();const i=process.getBuiltinModule("fs");i.promises.lstat(this._url).then(t=>{this._contentLength=t.size,this._setReadableStream(i.createReadStream(this._url)),this._headersCapability.resolve()},t=>{"ENOENT"===t.code&&(t=uh(0,this._url.href)),this._storedError=t,this._headersCapability.reject(t)})}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();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return{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 Oe("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Ch{constructor(t,e,i){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const n=t.source;this._isStreamingSupported=!n.disableStream;const s=process.getBuiltinModule("fs");this._setReadableStream(s.createReadStream(this._url,{start:e,end:i-1}))}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();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return{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)}}const Sh=Symbol("INITIAL_DATA");var Mh=new WeakMap,Th=new WeakSet;class Ph{constructor(){ft(this,Th),mt(this,Mh,Object.create(null))}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=vt(Th,this,Lh).call(this,t);return i.promise.then(()=>e(i.data)),null}const i=bt(Mh,this)[t];if(!i||i.data===Sh)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}has(t){const e=bt(Mh,this)[t];return!!e&&e.data!==Sh}delete(t){const e=bt(Mh,this)[t];return!(!e||e.data===Sh)&&(delete bt(Mh,this)[t],!0)}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=vt(Th,this,Lh).call(this,t);i.data=e,i.resolve()}clear(){for(const e in bt(Mh,this)){var t;const{data:i}=bt(Mh,this)[e];null===i||void 0===i||null===(t=i.bitmap)||void 0===t||t.close()}yt(Mh,this,Object.create(null))}*[Symbol.iterator](){for(const t in bt(Mh,this)){const{data:e}=bt(Mh,this)[t];e!==Sh&&(yield[t,e])}}}function Lh(t){var e;return(e=bt(Mh,this))[t]||(e[t]=(0,pt.A)((0,pt.A)({},Promise.withResolvers()),{},{data:Sh}))}var Rh=new WeakMap,Dh=new WeakMap,Fh=new WeakMap,Ih=new WeakMap,Nh=new WeakMap,Oh=new WeakMap,Bh=new WeakMap,Wh=new WeakMap,zh=new WeakMap,jh=new WeakMap,Hh=new WeakMap,Uh=new WeakMap,Vh=new WeakMap,Gh=new WeakMap,qh=new WeakMap,Xh=new WeakMap,Yh=new WeakMap,Kh=new WeakMap,Qh=new WeakSet;class Zh{constructor(t){var e;let{textContentSource:i,container:n,viewport:s}=t;if(ft(this,Qh),mt(this,Rh,Promise.withResolvers()),mt(this,Dh,null),mt(this,Fh,!1),mt(this,Ih,!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled)),mt(this,Nh,null),mt(this,Oh,null),mt(this,Bh,0),mt(this,Wh,0),mt(this,zh,null),mt(this,jh,null),mt(this,Hh,0),mt(this,Uh,0),mt(this,Vh,Object.create(null)),mt(this,Gh,[]),mt(this,qh,null),mt(this,Xh,[]),mt(this,Yh,new WeakMap),mt(this,Kh,null),i instanceof ReadableStream)yt(qh,this,i);else{if("object"!==typeof i)throw new Error('No "textContentSource" parameter specified.');yt(qh,this,new ReadableStream({start(t){t.enqueue(i),t.close()}}))}yt(Dh,this,yt(jh,this,n)),yt(Uh,this,s.scale*mi.pixelRatio),yt(Hh,this,s.rotation),yt(Oh,this,{div:null,properties:null,ctx:null});const{pageWidth:r,pageHeight:a,pageX:o,pageY:l}=s.rawDims;yt(Kh,this,[1,0,0,-1,-o,l+a]),yt(Wh,this,r),yt(Bh,this,a),nd.call(Zh),fi(n,s),bt(Rh,this).promise.finally(()=>{cd._.delete(this),yt(Oh,this,null),yt(Vh,this,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=ze.platform;return Pe(this,"fontFamilyMap",new Map([["sans-serif","".concat(t&&e?"Calibri, ":"","sans-serif")],["monospace","".concat(t&&e?"Lucida Console, ":"","monospace")]]))}render(){const t=()=>{bt(zh,this).read().then(e=>{var i;let{value:n,done:s}=e;s?bt(Rh,this).resolve():(null!==(i=bt(Nh,this))&&void 0!==i||yt(Nh,this,n.lang),Object.assign(bt(Vh,this),n.styles),vt(Qh,this,Jh).call(this,n.items),t())},bt(Rh,this).reject)};return yt(zh,this,bt(qh,this).getReader()),cd._.add(this),t(),bt(Rh,this).promise}update(t){let{viewport:e,onBefore:i=null}=t;const n=e.scale*mi.pixelRatio,s=e.rotation;if(s!==bt(Hh,this)&&(null===i||void 0===i||i(),yt(Hh,this,s),fi(bt(jh,this),{rotation:s})),n!==bt(Uh,this)){null===i||void 0===i||i(),yt(Uh,this,n);const t={div:null,properties:null,ctx:ed.call(Zh,bt(Nh,this))};for(const e of bt(Xh,this))t.properties=bt(Yh,this).get(e),t.div=e,vt(Qh,this,td).call(this,t)}}cancel(){var t;const e=new Oe("TextLayer task cancelled.");null===(t=bt(zh,this))||void 0===t||t.cancel(e).catch(()=>{}),yt(zh,this,null),bt(Rh,this).reject(e)}get textDivs(){return bt(Xh,this)}get textContentItemsStr(){return bt(Gh,this)}static cleanup(){if(!(vt(Zh,this,cd)._.size>0)){vt(Zh,this,rd)._.clear();for(const{canvas:t}of vt(Zh,this,ad)._.values())t.remove();vt(Zh,this,ad)._.clear()}}}function Jh(t){var e,i;if(bt(Fh,this))return;null!==(i=(e=bt(Oh,this)).ctx)&&void 0!==i||(e.ctx=ed.call(Tt,bt(Nh,this)));const n=bt(Xh,this),s=bt(Gh,this);for(const r of t){if(n.length>1e5)return ke("Ignoring additional textDivs for performance reasons."),void yt(Fh,this,!0);if(void 0!==r.str)s.push(r.str),vt(Qh,this,$h).call(this,r);else if("beginMarkedContentProps"===r.type||"beginMarkedContent"===r.type){const t=bt(Dh,this);yt(Dh,this,document.createElement("span")),bt(Dh,this).classList.add("markedContent"),r.id&&bt(Dh,this).setAttribute("id","".concat(r.id)),t.append(bt(Dh,this))}else"endMarkedContent"===r.type&&yt(Dh,this,bt(Dh,this).parentNode)}}function $h(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};bt(Xh,this).push(e);const n=He.transform(bt(Kh,this),t.transform);let s=Math.atan2(n[1],n[0]);const r=bt(Vh,this)[t.fontName];r.vertical&&(s+=Math.PI/2);let a=bt(Ih,this)&&r.fontSubstitution||r.fontFamily;a=Tt.fontFamilyMap.get(a)||a;const o=Math.hypot(n[2],n[3]),l=o*sd.call(Tt,a,r,bt(Nh,this));let c,h;0===s?(c=n[4],h=n[5]-l):(c=n[4]+l*Math.sin(s),h=n[5]-l*Math.cos(s));const d="calc(var(--total-scale-factor) *",u=e.style;bt(Dh,this)===bt(jh,this)?(u.left="".concat((100*c/bt(Wh,this)).toFixed(2),"%"),u.top="".concat((100*h/bt(Bh,this)).toFixed(2),"%")):(u.left="".concat(d).concat(c.toFixed(2),"px)"),u.top="".concat(d).concat(h.toFixed(2),"px)")),u.fontSize="".concat(d).concat((ld._*o).toFixed(2),"px)"),u.fontFamily=a,i.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,bt(Ih,this)&&(e.dataset.fontName=r.fontSubstitutionLoadedName||t.fontName),0!==s&&(i.angle=s*(180/Math.PI));let p=!1;if(t.str.length>1)p=!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&&(p=!0)}if(p&&(i.canvasWidth=r.vertical?t.height:t.width),bt(Yh,this).set(e,i),bt(Oh,this).div=e,bt(Oh,this).properties=i,vt(Qh,this,td).call(this,bt(Oh,this)),i.hasText&&bt(Dh,this).append(e),i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),bt(Dh,this).append(t)}}function td(t){const{div:e,properties:i,ctx:n}=t,{style:s}=e;let r="";if(ld._>1&&(r="scale(".concat(1/ld._,")")),0!==i.canvasWidth&&i.hasText){const{fontFamily:t}=s,{canvasWidth:a,fontSize:o}=i;id.call(Tt,n,o*bt(Uh,this),t);const{width:l}=n.measureText(e.textContent);l>0&&(r="scaleX(".concat(a*bt(Uh,this)/l,") ").concat(r))}0!==i.angle&&(r="rotate(".concat(i.angle,"deg) ").concat(r)),r.length>0&&(s.transform=r)}function ed(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=vt(Tt,this,ad)._.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}),vt(Tt,this,ad)._.set(t,e),vt(Tt,this,od)._.set(e,{size:0,family:""})}return e}function id(t,e,i){const n=vt(Tt,this,od)._.get(t);e===n.size&&i===n.family||(t.font="".concat(e,"px ").concat(i),n.size=e,n.family=i)}function nd(){if(null!==vt(Tt,this,ld)._)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),ld._=vt(Tt,this,t.getBoundingClientRect().height),t.remove()}function sd(t,e,i){const n=vt(Tt,this,rd)._.get(t);if(n)return n;const s=vt(Tt,this,ed).call(this,i);s.canvas.width=s.canvas.height=30,vt(Tt,this,id).call(this,s,30,t);const r=s.measureText(""),a=r.fontBoundingBoxAscent,o=Math.abs(r.fontBoundingBoxDescent);s.canvas.width=s.canvas.height=0;let l=.8;return a?l=a/(a+o):(ze.platform.isFirefox&&ke("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?l=e.ascent:e.descent&&(l=1+e.descent)),vt(Tt,this,rd)._.set(t,l),l}Tt=Zh;var rd={_:new Map},ad={_:new Map},od={_:new WeakMap},ld={_:null},cd={_:new Set};function hd(){var t,e;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"string"===typeof i||i instanceof URL?i={url:i}:(i instanceof ArrayBuffer||ArrayBuffer.isView(i))&&(i={data:i});const n=new dd,{docId:s}=n,r=i.url?function(t){if(t instanceof URL)return t.href;if("string"===typeof t){if(jt)return t;const e=URL.parse(t,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(i.url):null,a=i.data?function(t){if(jt&&"undefined"!==typeof Buffer&&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 We(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"===typeof t&&!isNaN(null===t||void 0===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.")}(i.data):null,o=i.httpHeaders||null,l=!0===i.withCredentials,c=null!==(t=i.password)&&void 0!==t?t:null,h=i.range instanceof wd?i.range:null,d=Number.isInteger(i.rangeChunkSize)&&i.rangeChunkSize>0?i.rangeChunkSize:65536;let u=i.worker instanceof Td?i.worker:null;const p=i.verbosity,g="string"!==typeof i.docBaseUrl||si(i.docBaseUrl)?null:i.docBaseUrl,f=Oa(i.cMapUrl),m=!1!==i.cMapPacked,v=i.CMapReaderFactory||(jt?Uo:po),w=Oa(i.iccUrl),b=Oa(i.standardFontDataUrl),y=i.StandardFontDataFactory||(jt?Vo:Oo),A=Oa(i.wasmUrl),E=i.WasmFactory||(jt?Go:Wo),x=!0!==i.stopAtErrors,_=Number.isInteger(i.maxImageSize)&&i.maxImageSize>-1?i.maxImageSize:-1,k=!1!==i.isEvalSupported,C="boolean"===typeof i.isOffscreenCanvasSupported?i.isOffscreenCanvasSupported:!jt,S="boolean"===typeof i.isImageDecoderSupported?i.isImageDecoderSupported:!jt&&(ze.platform.isFirefox||!globalThis.chrome),M=Number.isInteger(i.canvasMaxAreaInBytes)?i.canvasMaxAreaInBytes:-1,T="boolean"===typeof i.disableFontFace?i.disableFontFace:jt,P=!0===i.fontExtraProperties,L=!0===i.enableXfa,R=i.ownerDocument||globalThis.document,D=!0===i.disableRange,F=!0===i.disableStream,I=!0===i.disableAutoFetch,N=!0===i.pdfBug,O=i.CanvasFactory||(jt?Ho:ho),B=i.FilterFactory||(jt?jo:xo),W=!0===i.enableHWA,z=!1!==i.useWasm,j=h?h.length:null!==(e=i.length)&&void 0!==e?e:NaN,H="boolean"===typeof i.useSystemFonts?i.useSystemFonts:!jt&&!T,U="boolean"===typeof i.useWorkerFetch?i.useWorkerFetch:!!(v===po&&y===Oo&&E===Wo&&f&&b&&A&&oi(f,document.baseURI)&&oi(b,document.baseURI)&&oi(A,document.baseURI));Ee(p);const V={canvasFactory:new O({ownerDocument:R,enableHWA:W}),filterFactory:new B({docId:s,ownerDocument:R}),cMapReaderFactory:U?null:new v({baseUrl:f,isCompressed:m}),standardFontDataFactory:U?null:new y({baseUrl:b}),wasmFactory:U?null:new E({baseUrl:A})};u||(u=Td.create({verbosity:p,port:zc.workerPort}),n._worker=u);const G={docId:s,apiVersion:"5.4.296",data:a,password:c,disableAutoFetch:I,rangeChunkSize:d,length:j,docBaseUrl:g,enableXfa:L,evaluatorOptions:{maxImageSize:_,disableFontFace:T,ignoreErrors:x,isEvalSupported:k,isOffscreenCanvasSupported:C,isImageDecoderSupported:S,canvasMaxAreaInBytes:M,fontExtraProperties:P,useSystemFonts:H,useWasm:z,useWorkerFetch:U,cMapUrl:f,iccUrl:w,standardFontDataUrl:b,wasmUrl:A}},q={ownerDocument:R,pdfBug:N,styleElement:null,loadingParams:{disableAutoFetch:I,enableXfa:L}};return u.promise.then(function(){if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const t=u.messageHandler.sendWithPromise("GetDocRequest",G,a?[a.buffer]:null);let e;if(h)e=new rh(h,{disableRange:D,disableStream:F});else if(!a){if(!r)throw new Error("getDocument - no `url` parameter provided.");const t=oi(r)?mh:jt?_h:yh;e=new t({url:r,length:j,httpHeaders:o,withCredentials:l,rangeChunkSize:d,disableRange:D,disableStream:F})}return t.then(t=>{if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const i=new no(s,t,u.port),r=new Vd(i,n,e,q,V,W);n._transport=r,i.send("Ready",null)})}).catch(n._capability.reject),n}class dd{constructor(){(0,Wt.A)(this,"_capability",Promise.withResolvers()),(0,Wt.A)(this,"_transport",null),(0,Wt.A)(this,"_worker",null),(0,Wt.A)(this,"docId","d".concat((ud._=(Pt=ud._,Lt=Pt++,Pt),Lt))),(0,Wt.A)(this,"destroyed",!1),(0,Wt.A)(this,"onPassword",null),(0,Wt.A)(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var t;this.destroyed=!0;try{var e,i;null!==(e=this._worker)&&void 0!==e&&e.port&&(this._worker._pendingDestroy=!0),await(null===(i=this._transport)||void 0===i?void 0:i.destroy())}catch(s){var n;throw null!==(n=this._worker)&&void 0!==n&&n.port&&delete this._worker._pendingDestroy,s}this._transport=null,null===(t=this._worker)||void 0===t||t.destroy(),this._worker=null}async getData(){return this._transport.getData()}}var ud={_:0},pd=new WeakMap,gd=new WeakMap,fd=new WeakMap,md=new WeakMap,vd=new WeakMap;class wd{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;mt(this,pd,Promise.withResolvers()),mt(this,gd,[]),mt(this,fd,[]),mt(this,md,[]),mt(this,vd,[]),this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n}addRangeListener(t){bt(vd,this).push(t)}addProgressListener(t){bt(md,this).push(t)}addProgressiveReadListener(t){bt(fd,this).push(t)}addProgressiveDoneListener(t){bt(gd,this).push(t)}onDataRange(t,e){for(const i of bt(vd,this))i(t,e)}onDataProgress(t,e){bt(pd,this).promise.then(()=>{for(const i of bt(md,this))i(t,e)})}onDataProgressiveRead(t){bt(pd,this).promise.then(()=>{for(const e of bt(fd,this))e(t)})}onDataProgressiveDone(){bt(pd,this).promise.then(()=>{for(const t of bt(gd,this))t()})}transportReady(){bt(pd,this).resolve()}requestDataRange(t,e){Ce("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class bd{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Pe(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()}getAnnotationsByType(t,e){return this._transport.getAnnotationsByType(t,e)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];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 yd=new WeakMap,Ad=new WeakSet;class Ed{constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];ft(this,Ad),mt(this,yd,!1),this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new ai:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new Ph,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}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(){let{scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new ii({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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 Pe(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null}render(t){var e,i,n;let{canvasContext:s,canvas:r=s.canvas,viewport:a,intent:o="display",annotationMode:l=Jt.ENABLE,transform:c=null,background:h=null,optionalContentConfigPromise:d=null,annotationCanvasMap:u=null,pageColors:p=null,printAnnotationStorage:g=null,isEditing:f=!1,recordOperations:m=!1,operationsFilter:v=null}=t;null===(e=this._stats)||void 0===e||e.time("Overall");const w=this._transport.getRenderingIntent(o,l,g,f),{renderingIntent:b,cacheKey:y}=w;yt(yd,this,!1),d||(d=this._transport.getOptionalContentConfig(b));let A=this._intentStates.get(y);A||(A=Object.create(null),this._intentStates.set(y,A)),A.streamReaderCancelTimeout&&(clearTimeout(A.streamReaderCancelTimeout),A.streamReaderCancelTimeout=null);const E=!!(b&qt);var x;A.displayReadyCapability||(A.displayReadyCapability=Promise.withResolvers(),A.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(x=this._stats)||void 0===x||x.time("Page Request"),this._pumpOperatorList(w));const _=Boolean(this._pdfBug&&(null===(i=globalThis.StepperManager)||void 0===i?void 0:i.enabled)),k=!this.recordedBBoxes&&(m||_),C=t=>{if(A.renderTasks.delete(S),k){var e;const t=null===(e=S.gfx)||void 0===e?void 0:e.dependencyTracker.take();t&&(S.stepper&&S.stepper.setOperatorBBoxes(t,S.gfx.dependencyTracker.takeDebugMetadata()),m&&(this.recordedBBoxes=t))}var i;(E&&yt(yd,this,!0),vt(Ad,this,xd).call(this),t?(S.capability.reject(t),this._abortOperatorList({intentState:A,reason:t instanceof Error?t:new Error(t)})):S.capability.resolve(),this._stats)&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),null!==(i=globalThis.Stats)&&void 0!==i&&i.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},S=new Kd({callback:C,params:{canvas:r,canvasContext:s,dependencyTracker:k?new bl(r,A.operatorList.length,_):null,viewport:a,transform:c,background:h},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:u,operatorList:A.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!E,pdfBug:this._pdfBug,pageColors:p,enableHWA:this._transport.enableHWA,operationsFilter:v});((n=A).renderTasks||(n.renderTasks=new Set)).add(S);const M=S.task;return Promise.all([A.displayReadyCapability.promise,d]).then(t=>{var e;let[i,n]=t;if(this.destroyed)C();else{if(null===(e=this._stats)||void 0===e||e.time("Rendering"),!(n.renderingIntent&b))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");S.initializeGraphics({transparency:i,optionalContentConfig:n}),S.operatorListChanged()}}).catch(C),M}getOperatorList(){let{intent:t="display",annotationMode:e=Jt.ENABLE,printAnnotationStorage:i=null,isEditing:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=this._transport.getRenderingIntent(t,e,i,n,!0);let r,a=this._intentStates.get(s.cacheKey);var o,l;(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(),((o=a).renderTasks||(o.renderTasks=new Set)).add(r),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(l=this._stats)||void 0===l||l.time("Page Request"),this._pumpOperatorList(s));return a.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1,disableNormalization:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(t=>Ze.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(i){var n;let{value:r,done:a}=i;a?t(s):(null!==(n=s.lang)&&void 0!==n||(s.lang=r.lang),Object.assign(s.styles,r.styles),s.items.push(...r.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(),yt(yd,this,!1),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];yt(yd,this,!0);const e=vt(Ad,this,xd).call(this);return t&&e&&this._stats&&(this._stats=new ai),e}_startRenderPage(t,e){var i,n;const s=this._intentStates.get(e);s&&(null===(i=this._stats)||void 0===i||i.timeEnd("Page Request"),null===(n=s.displayReadyCapability)||void 0===n||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 i of e.renderTasks)i.operatorListChanged();t.lastChunk&&vt(Ad,this,xd).call(this)}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:i,annotationStorageSerializable:n,modifiedIds:s}=t;const{map:r,transfer:a}=n,o=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:r,modifiedIds:s},a).getReader(),l=this._intentStates.get(i);l.streamReader=o;const c=()=>{o.read().then(t=>{let{value:e,done:i}=t;i?l.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,l),c())},t=>{if(l.streamReader=null,!this._transport.destroyed){if(l.operatorList){l.operatorList.lastChunk=!0;for(const t of l.renderTasks)t.operatorListChanged();vt(Ad,this,xd).call(this)}if(l.displayReadyCapability)l.displayReadyCapability.reject(t);else{if(!l.opListReadCapability)throw t;l.opListReadCapability.reject(t)}}})};c()}_abortOperatorList(t){let{intentState:e,reason:i,force:n=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(i instanceof ni){let t=100;return i.extraDelay>0&&i.extraDelay<1e3&&(t+=i.extraDelay),void(e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:i,force:!0})},t))}}if(e.streamReader.cancel(new Oe(i.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[t,i]of this._intentStates)if(i===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}function xd(){if(!bt(yd,this)||this.destroyed)return!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(),yt(yd,this,!1),!0}var _d=new WeakMap,kd=new WeakMap,Cd=new WeakMap,Sd=new WeakMap,Md=new WeakSet;class Td{constructor(){let{name:t=null,port:e=null,verbosity:i=xe()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(ft(this,Md),mt(this,_d,Promise.withResolvers()),mt(this,kd,null),mt(this,Cd,null),mt(this,Sd,null),this.name=t,this.destroyed=!1,this.verbosity=i,e){if(Od._.has(e))throw new Error("Cannot use more than one PDFWorker per port.");Od._.set(e,this),vt(Md,this,Ld).call(this,e)}else vt(Md,this,Rd).call(this)}get promise(){return bt(_d,this).promise}get port(){return bt(Cd,this)}get messageHandler(){return bt(kd,this)}destroy(){var t,e;this.destroyed=!0,null===(t=bt(Sd,this))||void 0===t||t.terminate(),yt(Sd,this,null),Od._.delete(bt(Cd,this)),yt(Cd,this,null),null===(e=bt(kd,this))||void 0===e||e.destroy(),yt(kd,this,null)}static create(t){const e=vt(Td,this,Od)._.get(null===t||void 0===t?void 0:t.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new Td(t)}static get workerSrc(){if(zc.workerSrc)return zc.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Pe(this,"_setupFakeWorkerGlobal",(async()=>{if(wt(Td,this,Fd))return wt(Td,this,Fd);return(await i(59169)(this.workerSrc)).WorkerMessageHandler})())}}function Pd(){bt(_d,this).resolve(),bt(kd,this).send("configure",{verbosity:this.verbosity})}function Ld(t){yt(Cd,this,t),yt(kd,this,new no("main","worker",t)),bt(kd,this).on("ready",()=>{}),vt(Md,this,Pd).call(this)}function Rd(){if(Nd._||Fd(Rt))return void vt(Md,this,Dd).call(this);let{workerSrc:t}=Rt;try{Rt._isSameOrigin(window.location,t)||(t=Rt._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new no("main","worker",e),n=()=>{s.abort(),i.destroy(),e.terminate(),this.destroyed?bt(_d,this).reject(new Error("Worker was destroyed")):vt(Md,this,Dd).call(this)},s=new AbortController;e.addEventListener("error",()=>{bt(Sd,this)||n()},{signal:s.signal}),i.on("test",t=>{s.abort(),!this.destroyed&&t?(yt(kd,this,i),yt(Cd,this,e),yt(Sd,this,e),vt(Md,this,Pd).call(this)):n()}),i.on("ready",t=>{if(s.abort(),this.destroyed)n();else try{r()}catch(e){vt(Md,this,Dd).call(this)}});const r=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void r()}catch(e){_e("The worker has been disabled.")}vt(Md,this,Dd).call(this)}function Dd(){Nd._||(ke("Setting up fake worker."),Nd._=!0),Rt._setupFakeWorkerGlobal.then(t=>{var e,i;if(this.destroyed)return void bt(_d,this).reject(new Error("Worker was destroyed"));const n=new Ha;yt(Cd,this,n);const s="fake".concat((Id._=(e=Id._,i=e++,e),i)),r=new no(s+"_worker",s,n);t.setup(r,n),yt(kd,this,new no(s,s+"_worker",n)),vt(Md,this,Pd).call(this)}).catch(t=>{bt(_d,this).reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))})}function Fd(t){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch(i){return null}}Rt=Td;var Id={_:0},Nd={_:!1},Od={_:new WeakMap};jt&&(Nd._=vt(Rt,Rt,!0),zc.workerSrc||(zc.workerSrc="./pdf.worker.mjs")),Rt._isSameOrigin=(t,e)=>{const i=URL.parse(t);if(null===i||void 0===i||!i.origin||"null"===i.origin)return!1;const n=new URL(e,i);return i.origin===n.origin},Rt._createCDNWrapper=t=>{const e='await import("'.concat(t,'");');return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},Rt.fromPort=t=>{var e;if(e="`PDFWorker.fromPort` - please use `PDFWorker.create` instead.",console.log("Deprecated API usage: "+e),null===t||void 0===t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return Rt.create(t)};var Bd=new WeakMap,Wd=new WeakMap,zd=new WeakMap,jd=new WeakMap,Hd=new WeakMap,Ud=new WeakSet;class Vd{constructor(t,e,i,n,s,r){ft(this,Ud),mt(this,Bd,new Map),mt(this,Wd,new Map),mt(this,zd,new Map),mt(this,jd,new Map),mt(this,Hd,null),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new Ph,this.fontLoader=new Fa({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.wasmFactory=s.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=r,this.setupMessageHandler()}get annotationStorage(){return Pe(this,"annotationStorage",new Ta)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jt.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=Gt,a=xa;switch(t){case"any":r=Vt;break;case"display":break;case"print":r=qt;break;default:ke("getRenderingIntent - invalid intent: ".concat(t))}const o=r&qt&&i instanceof Ra?i:this.annotationStorage;switch(e){case Jt.DISABLE:r+=Kt;break;case Jt.ENABLE:break;case Jt.ENABLE_FORMS:r+=Xt;break;case Jt.ENABLE_STORAGE:r+=Yt,a=o.serializable;break;default:ke("getRenderingIntent - invalid annotationMode: ".concat(e))}n&&(r+=Qt),s&&(r+=Zt);const{ids:l,hash:c}=o.modifiedIds;return{renderingIntent:r,cacheKey:[r,a.hash,c].join("_"),annotationStorageSerializable:a,modifiedIds:l}}destroy(){var t;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null===(t=bt(Hd,this))||void 0===t||t.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const n of bt(Wd,this).values())e.push(n._destroy());bt(Wd,this).clear(),bt(zd,this).clear(),bt(jd,this).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return e.push(i),Promise.all(e).then(()=>{var t,e;this.commonObjs.clear(),this.fontLoader.clear(),bt(Bd,this).clear(),this.filterFactory.destroy(),Zh.cleanup(),null===(t=this._networkStream)||void 0===t||t.cancelAllRequests(new Oe("Worker was terminated.")),null===(e=this.messageHandler)||void 0===e||e.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)=>{Se(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(t){let{value:i,done:n}=t;n?e.close():(Se(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))}).catch(t=>{e.error(t)})},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("ReaderHeadersReady",async t=>{await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:n,contentLength:s}=this._fullReader;if(!i||!n){var r;if(this._lastProgress)null===(r=e.onProgress)||void 0===r||r.call(e,this._lastProgress);this._fullReader.onProgress=t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})}}return{isStreamingSupported:i,isRangeSupported:n,contentLength:s}}),t.on("GetRangeReader",(t,e)=>{Se(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);i?(e.onPull=()=>{i.read().then(function(t){let{value:i,done:n}=t;n?e.close():(Se(i instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))}).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",t=>{let{pdfInfo:i}=t;this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,e._capability.resolve(new bd(i,this))}),t.on("DocException",t=>{e._capability.reject(to(t))}),t.on("PasswordRequest",t=>{yt(Hd,this,Promise.withResolvers());try{if(!e.onPassword)throw to(t);const i=t=>{t instanceof Error?bt(Hd,this).reject(t):bt(Hd,this).resolve({password:t})};e.onPassword(i,t.code)}catch(i){bt(Hd,this).reject(i)}return bt(Hd,this).promise}),t.on("DataLoaded",t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{if(this.destroyed)return;bt(Wd,this).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",e=>{var i;let[n,s,r]=e;if(this.destroyed)return null;if(this.commonObjs.has(n))return null;switch(s){case"Font":if("error"in r){const t=r.error;ke("Error during font loading: ".concat(t)),this.commonObjs.resolve(n,t);break}const e=new Lc(r),a=this._params.pdfBug&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,o=new Na(e,a,r.extra,r.charProcOperatorList);this.fontLoader.bind(o).catch(()=>t.sendWithPromise("FontFallback",{id:n})).finally(()=>{!o.fontExtraProperties&&o.data&&o.clearData(),this.commonObjs.resolve(n,o)});break;case"CopyLocalImage":const{imageRef:l}=r;Se(l,"The imageRef must be defined.");for(const t of bt(Wd,this).values())for(const[,e]of t.objs)if((null===e||void 0===e?void 0:e.ref)===l)return e.dataLen?(this.commonObjs.resolve(n,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,r);break;default:throw new Error("Got unknown common object type ".concat(s))}return null}),t.on("obj",t=>{let[e,i,n,s]=t;if(this.destroyed)return;const r=bt(Wd,this).get(i);var a;if(!r.objs.has(e))if(0!==r._intentStates.size)switch(n){case"Image":case"Pattern":r.objs.resolve(e,s);break;default:throw new Error("Got unknown object type ".concat(n))}else null===s||void 0===s||null===(a=s.bitmap)||void 0===a||a.close()}),t.on("DocProgress",t=>{var i;this.destroyed||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})}),t.on("FetchBinaryData",async t=>{if(this.destroyed)throw new Error("Worker was destroyed.");const e=this[t.type];if(!e)throw new Error("".concat(t.type," not initialized, see the `useWorkerFetch` parameter."));return e.fetch(t)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t,e;this.annotationStorage.size<=0&&ke("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:i,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:i,filename:null!==(t=null===(e=this._fullReader)||void 0===e?void 0:e.filename)&&void 0!==t?t:null},n).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=bt(zd,this).get(e);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&bt(jd,this).set(i.refStr,t);const n=new Ed(e,i,this,this._params.pdfBug);return bt(Wd,this).set(e,n),n});return bt(zd,this).set(e,n),n}getPageIndex(t){return Ba(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 vt(Ud,this,Gd).call(this,"GetFieldObjects")}hasJSActions(){return vt(Ud,this,Gd).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)}getAnnotationsByType(t,e){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:e})}getDocJSActions(){return vt(Ud,this,Gd).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 vt(Ud,this,Gd).call(this,"GetOptionalContentConfig").then(e=>new nh(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=bt(Bd,this).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(t=>{var e,i,n,s;return{info:t[0],metadata:t[1]?new Gc(t[1]):null,contentDispositionFilename:null!==(e=null===(i=this._fullReader)||void 0===i?void 0:i.filename)&&void 0!==e?e:null,contentLength:null!==(n=null===(s=this._fullReader)||void 0===s?void 0:s.contentLength)&&void 0!==n?n:null}});return bt(Bd,this).set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of bt(Wd,this).values()){if(!t.cleanup())throw new Error("startCleanup: Page ".concat(t.pageNumber," is currently rendering."))}this.commonObjs.clear(),t||this.fontLoader.clear(),bt(Bd,this).clear(),this.filterFactory.destroy(!0),Zh.cleanup()}}cachedPageNumber(t){var e;if(!Ba(t))return null;const i=0===t.gen?"".concat(t.num,"R"):"".concat(t.num,"R").concat(t.gen);return null!==(e=bt(jd,this).get(i))&&void 0!==e?e:null}}function Gd(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=bt(Bd,this).get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return bt(Bd,this).set(t,n),n}var qd=new WeakMap;class Xd{constructor(t){mt(this,qd,null),(0,Wt.A)(this,"onContinue",null),(0,Wt.A)(this,"onError",null),yt(qd,this,t)}get promise(){return bt(qd,this).capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;bt(qd,this).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=bt(qd,this).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=bt(qd,this);return t.form||t.canvas&&(null===e||void 0===e?void 0:e.size)>0}}var Yd=new WeakMap;class Kd{constructor(t){let{callback:e,params:i,objs:n,commonObjs:s,annotationCanvasMap:r,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:u=null,enableHWA:p=!1,operationsFilter:g=null}=t;mt(this,Yd,null),this.callback=e,this.params=i,this.objs=n,this.commonObjs=s,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===h&&"undefined"!==typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Xd(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=i.canvas,this._canvasContext=i.canvas?null:i.canvasContext,this._enableHWA=p,this._dependencyTracker=i.dependencyTracker,this._operationsFilter=g}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(t){var e,i;let{transparency:n=!1,optionalContentConfig:s}=t;if(this.cancelled)return;if(this._canvas){if(Qd._.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.");Qd._.add(this._canvas)}this._pdfBug&&null!==(e=globalThis.StepperManager)&&void 0!==e&&e.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:r,transform:a,background:o,dependencyTracker:l}=this.params,c=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new dc(c,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:s},this.annotationCanvasMap,this.pageColors,l),this.gfx.beginDrawing({transform:a,viewport:r,transparency:n,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,null===(i=this.graphicsReadyCallback)||void 0===i||i.call(this)}cancel(){var t,e,i;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,null===(t=this.gfx)||void 0===t||t.endDrawing(),bt(Yd,this)&&(window.cancelAnimationFrame(bt(Yd,this)),yt(Yd,this,null)),Qd._.delete(this._canvas),n||(n=new ni("Rendering cancelled, page ".concat(this._pageIndex+1),s)),this.callback(n),null===(e=(i=this.task).onError)||void 0===e||e.call(i,n)}operatorListChanged(){var t,e;this.graphicsReady?(null===(t=this.gfx.dependencyTracker)||void 0===t||t.growOperationsCount(this.operatorList.fnArray.length),null===(e=this.stepper)||void 0===e||e.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?yt(Yd,this,window.requestAnimationFrame(()=>{yt(Yd,this,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._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),Qd._.delete(this._canvas),this.callback())))}}var Qd={_:new WeakSet};var Zd=new WeakMap,Jd=new WeakMap,$d=new WeakMap,tu=new WeakMap,eu=new WeakMap,iu=new WeakMap,nu=new WeakMap,su=new WeakMap,ru=new WeakMap,au=new WeakMap,ou=new WeakSet;class lu{static get _keyboardManager(){return Pe(this,"_keyboardManager",new dn([[["Escape","mac+Escape"],lu.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],lu.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],lu.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],lu.prototype._moveToPrevious],[["Home","mac+Home"],lu.prototype._moveToBeginning],[["End","mac+End"],lu.prototype._moveToEnd]]))}constructor(t){var e,i;let{editor:n=null,uiManager:s=null}=t;ft(this,ou),mt(this,Zd,null),mt(this,Jd,null),mt(this,$d,void 0),mt(this,tu,null),mt(this,eu,!1),mt(this,iu,!1),mt(this,nu,null),mt(this,su,void 0),mt(this,ru,null),mt(this,au,null),n?(yt(iu,this,!1),yt(nu,this,n)):yt(iu,this,!0),yt(au,this,(null===n||void 0===n?void 0:n._uiManager)||s),yt(su,this,bt(au,this)._eventBus),yt($d,this,(null===n||void 0===n||null===(e=n.color)||void 0===e?void 0:e.toUpperCase())||(null===(i=bt(au,this))||void 0===i?void 0:i.highlightColors.values().next().value)||"#FFFF98"),fu._||(fu._=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}renderButton(){const t=yt(Zd,this,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",bt(nu,this)&&(t.ariaControls="".concat(bt(nu,this).id,"_colorpicker_dropdown"));const e=bt(au,this)._signal;t.addEventListener("click",vt(ou,this,uu).bind(this),{signal:e}),t.addEventListener("keydown",vt(ou,this,du).bind(this),{signal:e});const i=yt(Jd,this,document.createElement("span"));return i.className="swatch",i.ariaHidden="true",i.style.backgroundColor=bt($d,this),t.append(i),t}renderMainDropdown(){const t=yt(tu,this,vt(ou,this,cu).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===bt(Zd,this))return void vt(ou,this,uu).call(this,t);const e=t.target.getAttribute("data-color");e&&vt(ou,this,hu).call(this,e,t)}_moveToNext(t){var e,i;wt(ou,this,gu)?t.target!==bt(Zd,this)?null===(e=t.target.nextSibling)||void 0===e||e.focus():null===(i=bt(tu,this).firstChild)||void 0===i||i.focus():vt(ou,this,uu).call(this,t)}_moveToPrevious(t){var e,i;t.target!==(null===(e=bt(tu,this))||void 0===e?void 0:e.firstChild)&&t.target!==bt(Zd,this)?(wt(ou,this,gu)||vt(ou,this,uu).call(this,t),null===(i=t.target.previousSibling)||void 0===i||i.focus()):wt(ou,this,gu)&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){var e;wt(ou,this,gu)?null===(e=bt(tu,this).firstChild)||void 0===e||e.focus():vt(ou,this,uu).call(this,t)}_moveToEnd(t){var e;wt(ou,this,gu)?null===(e=bt(tu,this).lastChild)||void 0===e||e.focus():vt(ou,this,uu).call(this,t)}hideDropdown(){var t,e;null===(t=bt(tu,this))||void 0===t||t.classList.add("hidden"),bt(Zd,this).ariaExpanded="false",null===(e=bt(ru,this))||void 0===e||e.abort(),yt(ru,this,null)}_hideDropdownFromKeyboard(){var t;bt(iu,this)||(wt(ou,this,gu)?(this.hideDropdown(),bt(Zd,this).focus({preventScroll:!0,focusVisible:bt(eu,this)})):null===(t=bt(nu,this))||void 0===t||t.unselect())}updateColor(t){if(bt(Jd,this)&&(bt(Jd,this).style.backgroundColor=t),!bt(tu,this))return;const e=bt(au,this).highlightColors.values();for(const i of bt(tu,this).children)i.ariaSelected=e.next().value===t.toUpperCase()}destroy(){var t,e;null===(t=bt(Zd,this))||void 0===t||t.remove(),yt(Zd,this,null),yt(Jd,this,null),null===(e=bt(tu,this))||void 0===e||e.remove(),yt(tu,this,null)}}function cu(){const t=document.createElement("div"),e=bt(au,this)._signal;t.addEventListener("contextmenu",li,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),bt(nu,this)&&(t.id="".concat(bt(nu,this).id,"_colorpicker_dropdown"));for(const[i,n]of bt(au,this).highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",n),s.title=i,s.setAttribute("data-l10n-id",fu._[i]);const r=document.createElement("span");s.append(r),r.className="swatch",r.style.backgroundColor=n,s.ariaSelected=n===bt($d,this),s.addEventListener("click",vt(ou,this,hu).bind(this,n),{signal:e}),t.append(s)}return t.addEventListener("keydown",vt(ou,this,du).bind(this),{signal:e}),t}function hu(t,e){e.stopPropagation(),bt(su,this).dispatch("switchannotationeditorparams",{source:this,type:ee.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)}function du(t){Dt._keyboardManager.exec(this,t)}function uu(t){if(wt(ou,this,gu))return void this.hideDropdown();if(yt(eu,this,0===t.detail),bt(ru,this)||(yt(ru,this,new AbortController),window.addEventListener("pointerdown",vt(ou,this,pu).bind(this),{signal:bt(au,this).combinedSignal(bt(ru,this))})),bt(Zd,this).ariaExpanded="true",bt(tu,this))return void bt(tu,this).classList.remove("hidden");const e=yt(tu,this,vt(ou,this,cu).call(this));bt(Zd,this).append(e)}function pu(t){var e;null!==(e=bt(tu,this))&&void 0!==e&&e.contains(t.target)||this.hideDropdown()}function gu(t){return bt(tu,t)&&!bt(tu,t).classList.contains("hidden")}Dt=lu;var fu={_:null},mu=new WeakMap,vu=new WeakMap,wu=new WeakMap;class bu{constructor(t){mt(this,mu,null),mt(this,vu,null),mt(this,wu,null),yt(vu,this,t),yt(wu,this,t._uiManager),yu._||(yu._=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(bt(mu,this))return bt(mu,this);const{editorType:t,colorType:e,colorValue:i}=bt(vu,this),n=yt(mu,this,document.createElement("input"));return n.type="color",n.value=i||"#000000",n.className="basicColorPicker",n.tabIndex=0,n.setAttribute("data-l10n-id",yu._[t]),n.addEventListener("input",()=>{bt(wu,this).updateParams(e,n.value)},{signal:bt(wu,this)._signal}),n}update(t){bt(mu,this)&&(bt(mu,this).value=t)}destroy(){var t;null===(t=bt(mu,this))||void 0===t||t.remove(),yt(mu,this,null)}hideDropdown(){}}var yu={_:null};function Au(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function Eu(t){return Math.max(0,Math.min(255,255*t))}class xu{static CMYK_G(t){let[e,i,n,s]=t;return["G",1-Math.min(1,.3*e+.59*n+.11*i+s)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_rgb(t){let[e]=t;return e=Eu(e),[e,e,e]}static G_HTML(t){let[e]=t;const i=Au(e);return"#".concat(i).concat(i).concat(i)}static RGB_G(t){let[e,i,n]=t;return["G",.3*e+.59*i+.11*n]}static RGB_rgb(t){return t.map(Eu)}static RGB_HTML(t){return"#".concat(t.map(Au).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){let[e,i,n,s]=t;return["RGB",1-Math.min(1,e+s),1-Math.min(1,n+s),1-Math.min(1,i+s)]}static CMYK_rgb(t){let[e,i,n,s]=t;return[Eu(1-Math.min(1,e+s)),Eu(1-Math.min(1,n+s)),Eu(1-Math.min(1,i+s))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,i,n]=t;const s=1-e,r=1-i,a=1-n;return["CMYK",s,r,a,Math.min(s,r,a)]}}class _u{create(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];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","".concat(t,"px")),n.setAttribute("height","".concat(e,"px"))),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox","0 0 ".concat(t," ").concat(e)),n}createElement(t){if("string"!==typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Ce("Abstract method `_createSVG` called.")}}class ku extends _u{_createSVG(t){return document.createElementNS($e,t)}}const Cu=new WeakSet,Su=60*(new Date).getTimezoneOffset()*1e3;class Mu{static create(t){switch(t.data.annotationType){case ce.LINK:return new Ou(t);case ce.TEXT:return new ju(t);case ce.WIDGET:switch(t.data.fieldType){case"Tx":return new Uu(t);case"Btn":return t.data.radioButton?new qu(t):t.data.checkBox?new Gu(t):new Xu(t);case"Ch":return new Yu(t);case"Sig":return new Vu(t)}return new Hu(t);case ce.POPUP:return new Qu(t);case ce.FREETEXT:return new Wp(t);case ce.LINE:return new jp(t);case ce.SQUARE:return new Up(t);case ce.CIRCLE:return new Gp(t);case ce.POLYLINE:return new Xp(t);case ce.CARET:return new Kp(t);case ce.INK:return new $p(t);case ce.POLYGON:return new Yp(t);case ce.HIGHLIGHT:return new eg(t);case ce.UNDERLINE:return new ig(t);case ce.SQUIGGLY:return new ng(t);case ce.STRIKEOUT:return new sg(t);case ce.STAMP:return new rg(t);case ce.FILEATTACHMENT:return new lg(t);default:return new Du(t)}}}var Tu=new WeakMap,Pu=new WeakMap,Lu=new WeakMap,Ru=new WeakSet;class Du{constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ft(this,Ru),mt(this,Tu,null),mt(this,Pu,!1),mt(this,Lu,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.enableComment=t.enableComment,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(t){let{contentsObj:e,richText:i}=t;return!!(null!==e&&void 0!==e&&e.str||null!==i&&void 0!==i&&i.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return Du._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){var t;const{data:e}=this,i=null===(t=this.annotationStorage)||void 0===t?void 0:t.getEditor(e.id);return i?i.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){var t;const e=null===(t=this.annotationStorage)||void 0===t?void 0:t.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;const{quadPoints:i,inkLists:n,rect:s}=this.data;let r=-1/0,a=-1/0;if((null===i||void 0===i?void 0:i.length)>=8){for(let t=0;t<i.length;t+=8)i[t+1]>a?(a=i[t+1],r=i[t+2]):i[t+1]===a&&(r=Math.max(r,i[t+2]));return[r,a]}if((null===n||void 0===n?void 0:n.length)>=1){for(const t of n)for(let e=0,i=t.length;e<i;e+=2)t[e+1]>a?(a=t[e+1],r=t[e]):t[e+1]===a&&(r=Math.max(r,t[e]));if(r!==1/0)return[r,a]}return s?[s[2],s[3]]:null}_normalizePoint(t){const{page:{view:e},viewport:{rawDims:{pageWidth:i,pageHeight:n,pageX:s,pageY:r}}}=this.parent;return t[1]=e[3]-t[1]+e[1],t[0]=100*(t[0]-s)/i,t[1]=100*(t[1]-r)/n,t}get commentText(){var t,e;const{data:i}=this;return(null===(t=this.annotationStorage.getRawValue("".concat($t).concat(i.id)))||void 0===t||null===(t=t.popup)||void 0===t?void 0:t.contents)||(null===(e=i.contentsObj)||void 0===e?void 0:e.str)||""}set commentText(t){const{data:e}=this,i={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(e.id,{popup:i})||this.annotationStorage.setValue("".concat($t).concat(e.id),{id:e.id,annotationType:e.annotationType,pageIndex:this.parent.page._pageIndex,popup:i,popupRef:e.popupRef,modificationDate:new Date}),t||this.removePopup()}removePopup(){var t,e;null===(t=(null===(e=bt(Lu,this))||void 0===e?void 0:e.popup)||this.popup)||void 0===t||t.remove(),yt(Lu,this,this.popup=null)}updateEdited(t){var e;if(!this.container)return;t.rect&&(bt(Tu,this)||yt(Tu,this,{rect:this.data.rect.slice(0)}));const{rect:i,popup:n}=t;i&&vt(Ru,this,Fu).call(this,i);let s=(null===(e=bt(Lu,this))||void 0===e?void 0:e.popup)||this.popup;!s&&null!==n&&void 0!==n&&n.text&&(this._createPopup(n),s=bt(Lu,this).popup),s&&(s.updateEdited(t),null!==n&&void 0!==n&&n.deleted&&(s.remove(),yt(Lu,this,null),this.popup=null))}resetEdited(){var t;bt(Tu,this)&&(vt(Ru,this,Fu).call(this,bt(Tu,this).rect),null===(t=bt(Lu,this))||void 0===t||t.popup.resetEdited(),yt(Tu,this,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 Hu||this instanceof Ou||(s.tabIndex=0);const{style:r}=s;if(r.zIndex=this.parent.zIndex,this.parent.zIndex+=2,e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof Qu){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,s),s}const{width:a,height:o}=this;if(!t&&e.borderStyle.width>0){r.borderWidth="".concat(e.borderStyle.width,"px");const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e="calc(".concat(t,"px * var(--total-scale-factor)) / calc(").concat(i,"px * var(--total-scale-factor))");r.borderRadius=e}else if(this instanceof qu){const t="calc(".concat(a,"px * var(--total-scale-factor)) / calc(").concat(o,"px * var(--total-scale-factor))");r.borderRadius=t}switch(e.borderStyle.style){case he:r.borderStyle="solid";break;case de:r.borderStyle="dashed";break;case ue:ke("Unimplemented border style: beveled");break;case pe:ke("Unimplemented border style: inset");break;case ge:r.borderBottomStyle="solid"}const n=e.borderColor||null;n?(yt(Pu,this,!0),r.borderColor=He.makeHexColor(0|n[0],0|n[1],0|n[2])):r.borderWidth=0}const l=He.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:h,pageX:d,pageY:u}=n.rawDims;r.left="".concat(100*(l[0]-d)/c,"%"),r.top="".concat(100*(l[1]-u)/h,"%");const{rotation:p}=e;return e.hasOwnCanvas||0===p?(r.width="".concat(100*a/c,"%"),r.height="".concat(100*o/h,"%")):this.setRotation(p,s),s}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims;let{width:s,height:r}=this;t%180!==0&&([s,r]=[r,s]),e.style.width="".concat(100*s/i,"%"),e.style.height="".concat(100*r/n,"%"),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]=xu["".concat(s,"_HTML")](r),this.annotationStorage.setValue(this.data.id,{[e]:xu["".concat(s,"_rgb")](r)})};return Pe(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||void 0===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,n,s]=this.data.rect.map(t=>Math.fround(t));if(8===t.length){const[r,a,o,l]=t.subarray(2,6);if(n===r&&s===a&&e===o&&i===l)return}const{style:r}=this.container;let a;if(bt(Pu,this)){const{borderColor:t,borderWidth:e}=r;r.borderWidth=0,a=["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="'.concat(t,'" stroke-width="').concat(e,'">')],this.container.classList.add("hasBorder")}const o=n-e,l=s-i,{svgFactory:c}=this,h=c.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0),h.role="none";const d=c.createElement("defs");h.append(d);const u=c.createElement("clipPath"),p="clippath_".concat(this.data.id);u.setAttribute("id",p),u.setAttribute("clipPathUnits","objectBoundingBox"),d.append(u);for(let f=2,m=t.length;f<m;f+=8){var g;const i=t[f],n=t[f+1],r=t[f+2],h=t[f+3],d=c.createElement("rect"),p=(r-e)/o,m=(s-n)/l,v=(i-r)/o,w=(n-h)/l;d.setAttribute("x",p),d.setAttribute("y",m),d.setAttribute("width",v),d.setAttribute("height",w),u.append(d),null===(g=a)||void 0===g||g.push('<rect vector-effect="non-scaling-stroke" x="'.concat(p,'" y="').concat(m,'" width="').concat(v,'" height="').concat(w,'"/>'))}bt(Pu,this)&&(a.push("</g></svg>')"),r.backgroundImage=a.join("")),this.container.append(h),this.container.style.clipPath="url(#".concat(p,")")}_createPopup(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const{data:e}=this;let i,n;t?(i={str:t.text},n=t.date):(i=e.contentsObj,n=e.modificationDate);const s=yt(Lu,this,new Qu({data:{color:e.color,titleObj:e.titleObj,modificationDate:n,contentsObj:i,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_".concat(e.id),rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}));this.parent._commentManager||this.parent.div.append(s.render())}get hasPopupElement(){return!!(bt(Lu,this)||this.popup||this.data.popupRef)}get extraPopupElement(){return bt(Lu,this)}render(){Ce("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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)continue;if(s===e)continue;const n="string"===typeof r?r:null,a=document.querySelector('[data-element-id="'.concat(s,'"]'));!a||Cu.has(a)?i.push({id:s,exportValue:n,domElement:a}):ke("_getElementsByName - element not allowed: ".concat(s))}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,s=n.getAttribute("data-element-id");s!==e&&(Cu.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)||void 0===t||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),null===(t=this.popup)||void 0===t||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")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{var i;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}function Fu(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:r,pageX:a,pageY:o}}}}=this;null===i||void 0===i||i.splice(0,4,...t),e.left="".concat(100*(t[0]-a)/s,"%"),e.top="".concat(100*(r-t[3]+o)/r,"%"),0===n?(e.width="".concat(100*(t[2]-t[0])/s,"%"),e.height="".concat(100*(t[3]-t[1])/r,"%")):this.setRotation(n)}class Iu extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.editor=t.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:t}=this;t.hasComment&&(this._createPopup(t.comment),this.extraPopupElement.popup.renderCommentButton())}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(t){this.editor.comment=t,t||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.container.remove(),this.container=null,this.removePopup()}}var Nu=new WeakSet;class Ou extends Du{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!(null===e||void 0===e||!e.ignoreBorder),createQuadrilaterals:!0}),ft(this,Nu),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,t.overlaidText),n=!0):t.attachment?(vt(Nu,this,Wu).call(this,i,t.attachment,t.overlaidText,t.attachmentDest),n=!0):t.setOCGState?(vt(Nu,this,zu).call(this,i,t.setOCGState,t.overlaidText),n=!0):t.dest?(this._bindLink(i,t.dest,t.overlaidText),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){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&vt(Nu,this,Bu).call(this),i&&(t.title=i)}_bindNamedAction(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),i&&(t.title=i),vt(Nu,this,Bu).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)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1})}e.overlaidText&&(t.title=e.overlaidText),t.onclick||(t.onclick=()=>!1),vt(Nu,this,Bu).call(this)}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),vt(Nu,this,Bu).call(this),!this._fieldObjects)return ke('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{null===i||void 0===i||i();const{fields:t,refs:n,include:s}=e,r=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const i of t){const t=this._fieldObjects[i]||[];for(const{id:i}of t)e.add(i)}for(const t of Object.values(this._fieldObjects))for(const i of t)e.has(i.id)===s&&r.push(i)}else for(const e of Object.values(this._fieldObjects))r.push(...e);const a=this.annotationStorage,o=[];for(const e of r){const{id:t}=e;switch(o.push(t),e.type){case"text":{const i=e.defaultValue||"";a.setValue(t,{value:i});break}case"checkbox":case"radiobutton":{const i=e.defaultValue===e.exportValues;a.setValue(t,{value:i});break}case"combobox":case"listbox":{const i=e.defaultValue||"";a.setValue(t,{value:i});break}default:continue}const i=document.querySelector('[data-element-id="'.concat(t,'"]'));i&&(Cu.has(i)?i.dispatchEvent(new Event("resetform")):ke("_bindResetFormAction - element not allowed: ".concat(t)))}var l;this.enableScripting&&(null===(l=this.linkService.eventBus)||void 0===l||l.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}));return!1}}}function Bu(){this.container.setAttribute("data-internal-link","")}function Wu(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;t.href=this.linkService.getAnchorUrl(""),e.description?t.title=e.description:i&&(t.title=i),t.onclick=()=>{var t;return null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(e.content,e.filename,n),!1},vt(Nu,this,Bu).call(this)}function zu(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),i&&(t.title=i),vt(Nu,this,Bu).call(this)}class ju extends Du{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 Hu extends Du{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&("CANVAS"===(null===(e=t.previousSibling)||void 0===e?void 0:e.nodeName)&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return ze.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)||void 0===e||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)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t)}}))})}_setEventListeners(t,e,i,n){for(const[o,l]of i){var s,r,a;if("Action"===l||null!==(s=this.data.actions)&&void 0!==s&&s[l])"Focus"!==l&&"Blur"!==l||e||(e={focused:!1}),this._setEventListener(t,e,o,l,n),"Focus"!==l||null!==(r=this.data.actions)&&void 0!==r&&r.Blur?"Blur"!==l||null!==(a=this.data.actions)&&void 0!==a&&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":He.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,s=t.style;let r;const a=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/(Ut*n))||1);r=Math.min(n,a(e/Ut))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(n,a(t/Ut))}s.fontSize="calc(".concat(r,"px * var(--total-scale-factor))"),s.color=He.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(s.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class Uu extends Hu{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(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){var n;const r=t.getValue(e,{value:this.data.fieldValue});let a=r.value||"";const o=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;o&&a.length>o&&(a=a.slice(0,o));let l=r.formattedValue||(null===(n=this.data.textContent)||void 0===n?void 0:n.join("\n"))||null;l&&this.data.comb&&(l=l.replaceAll(/\s+/g,""));const c={userValue:a,formattedValue:l,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=null!==l&&void 0!==l?l:a,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type=this.data.password?"password":"text",i.setAttribute("value",null!==l&&void 0!==l?l:a),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),Cu.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=0;const{datetimeFormat:h,datetimeType:d,timeStep:u}=this.data,p=!!d&&this.enableScripting;h&&(i.title=h),this._setRequired(i,this.data.required),o&&(i.maxLength=o),i.addEventListener("input",n=>{t.setValue(e,{value:n.target.value}),this.setPropertyOnSiblings(i,"value",n.target.value,"value"),c.formattedValue=null}),i.addEventListener("resetform",t=>{var e;const n=null!==(e=this.data.defaultFieldValue)&&void 0!==e?e:"";i.value=c.userValue=n,c.formattedValue=null});let g=t=>{const{formattedValue:e}=c;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var s;i.addEventListener("focus",t=>{var e;if(c.focused)return;const{target:i}=t;if(p&&(i.type=d,u&&(i.step=u)),c.userValue){const t=c.userValue;if(p)if("time"===d){const e=new Date(t),n=[e.getHours(),e.getMinutes(),e.getSeconds()];i.value=n.map(t=>t.toString().padStart(2,"0")).join(":")}else i.value=new Date(t-Su).toISOString().split("date"===d?"T":".",1)[0];else i.value=t}c.lastCommittedValue=i.value,c.commitKey=1,null!==(e=this.data.actions)&&void 0!==e&&e.Focus||(c.focused=!0)}),i.addEventListener("updatefromsandbox",i=>{this.showElementAndHideCanvas(i.target);const n={value(i){var n;c.userValue=null!==(n=i.detail.value)&&void 0!==n?n:"",p||t.setValue(e,{value:c.userValue.toString()}),i.target.value=c.userValue},formattedValue(i){const{formattedValue:n}=i.detail;c.formattedValue=n,null!==n&&void 0!==n&&i.target!==document.activeElement&&(i.target.value=n);const s={formattedValue:n};p&&(s.value=n),t.setValue(e,s)},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{var n;const{charLimit:s}=i.detail,{target:r}=i;if(0===s)return void r.removeAttribute("maxLength");r.setAttribute("maxLength",s);let a=c.userValue;!a||a.length<=s||(a=a.slice(0,s),r.value=c.userValue=a,t.setValue(e,{value:a}),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}}))}};this._dispatchEventFromSandbox(n,i)}),i.addEventListener("keydown",t=>{var i;c.commitKey=1;let n=-1;if("Escape"===t.key?n=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(c.commitKey=3):n=2,-1===n)return;const{value:s}=t.target;c.lastCommittedValue!==s&&(c.lastCommittedValue=s,c.userValue=s,null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:n,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});const n=g;g=null,i.addEventListener("blur",t=>{var i;if(!c.focused||!t.relatedTarget)return;null!==(i=this.data.actions)&&void 0!==i&&i.Blur||(c.focused=!1);const{target:s}=t;let{value:r}=s;if(p){if(r&&"time"===d){const t=r.split(":").map(t=>parseInt(t,10));r=new Date(2e3,0,1,t[0],t[1],t[2]||0).valueOf(),s.step=""}else r.includes("T")||(r="".concat(r,"T00:00")),r=new Date(r).valueOf();s.type="text"}var a;(c.userValue=r,c.lastCommittedValue!==r)&&(null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:c.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}));n(t)}),null!==(s=this.data.actions)&&void 0!==s&&s.Keystroke&&i.addEventListener("beforeinput",t=>{var i;c.lastCommittedValue=null;const{data:n,target:s}=t,{value:r,selectionStart:a,selectionEnd:o}=s;let l=a,h=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&&(h+=t[0].length);break}case"deleteContentBackward":a===o&&(l-=1);break;case"deleteContentForward":a===o&&(h+=1)}t.preventDefault(),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,change:n||"",willCommit:!1,selStart:l,selEnd:h}})}),this._setEventListeners(i,c,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(g&&i.addEventListener("blur",g),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/o;i.classList.add("comb"),i.style.letterSpacing="calc(".concat(t,"px * var(--total-scale-factor) - 1ch)")}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Vu extends Hu{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class Gu extends Hu{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 Cu.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=0,s.addEventListener("change",n=>{const{name:s,checked:r}=n.target;for(const a of this._getElementsByName(s,i)){const i=r&&a.exportValue===e.exportValue;a.domElement&&(a.domElement.checked=i),t.setValue(a.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 qu extends Hu{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 r of this._getElementsByName(e.fieldName,i))t.setValue(r.id,{value:!1});const s=document.createElement("input");if(Cu.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=0,s.addEventListener("change",e=>{const{name:n,checked:s}=e.target;for(const r of this._getElementsByName(n,i))t.setValue(r.id,{value:!1});t.setValue(i,{value:s})}),s.addEventListener("resetform",t=>{const i=e.defaultFieldValue;t.target.checked=null!==i&&void 0!==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 Xu extends Ou{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 Yu extends Hu{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");Cu.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=0;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 i of n.options)i.selected=i.value===e});for(const c of this.data.options){const t=document.createElement("option");t.textContent=c.displayValue,t.value=c.exportValue,i.value.includes(c.exportValue)&&(t.setAttribute("selected",!0),s=!1),n.append(t)}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){var s;null===(s=r)||void 0===s||s();const l=i.detail.value,c=new Set(Array.isArray(l)?l:[l]);for(const t of n.options)t.selected=c.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;if(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:c}=i.detail.insert,h=n.children[s],d=document.createElement("option");d.textContent=r,d.value=c,h?h.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)||void 0===n||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}}var Ku=new WeakSet;class Qu extends Du{constructor(t){const{data:e,elements:i,parent:n}=t,s=!!n._commentManager;if(super(t,{isRenderable:!s&&Du._hasPopupData(e)}),ft(this,Ku),this.elements=i,s&&Du._hasPopupData(e)){const t=this.popup=vt(Ku,this,Zu).call(this);for(const e of i)e.popup=t}else this.popup=null}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const e=this.popup=vt(Ku,this,Zu).call(this),i=[];for(const n of this.elements)n.popup=e,n.container.ariaHasPopup="dialog",i.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(t=>"".concat(Ye).concat(t)).join(",")),this.container}}function Zu(){return new kp({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,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,commentManager:this.parent._commentManager})}var Ju=new WeakMap,$u=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,cp=new WeakMap,hp=new WeakMap,dp=new WeakMap,up=new WeakMap,pp=new WeakMap,gp=new WeakMap,fp=new WeakMap,mp=new WeakMap,vp=new WeakMap,wp=new WeakMap,bp=new WeakMap,yp=new WeakMap,Ap=new WeakMap,Ep=new WeakMap,xp=new WeakMap,_p=new WeakSet;class kp{constructor(t){let{container:e,color:i,elements:n,titleObj:s,modificationDate:r,contentsObj:a,richText:o,parent:l,rect:c,parentRect:h,open:d,commentManager:u=null}=t;ft(this,_p),mt(this,Ju,null),mt(this,$u,vt(_p,this,Fp).bind(this)),mt(this,tp,vt(_p,this,Bp).bind(this)),mt(this,ep,vt(_p,this,Op).bind(this)),mt(this,ip,vt(_p,this,Np).bind(this)),mt(this,np,null),mt(this,sp,null),mt(this,rp,null),mt(this,ap,null),mt(this,op,null),mt(this,lp,null),mt(this,cp,null),mt(this,hp,!1),mt(this,dp,null),mt(this,up,null),mt(this,pp,null),mt(this,gp,null),mt(this,fp,null),mt(this,mp,null),mt(this,vp,null),mt(this,wp,null),mt(this,bp,null),mt(this,yp,null),mt(this,Ap,!1),mt(this,Ep,null),mt(this,xp,null),yt(sp,this,e),yt(bp,this,s),yt(rp,this,a),yt(wp,this,o),yt(lp,this,l),yt(np,this,i),yt(vp,this,c),yt(cp,this,h),yt(op,this,n),yt(Ju,this,u),yt(Ep,this,n[0]),yt(ap,this,hi.toDateObject(r)),this.trigger=n.flatMap(t=>t.getElementsToTriggerPopup()),u?this.renderCommentButton():(vt(_p,this,Cp).call(this),bt(sp,this).hidden=!0,d&&vt(_p,this,Np).call(this))}renderCommentButton(){if(bt(gp,this))return;if(bt(fp,this)||vt(_p,this,Sp).call(this),!bt(fp,this))return;const{signal:t}=yt(up,this,new AbortController),e=!!bt(Ep,this).extraPopupElement,i=()=>{bt(Ju,this).toggleCommentPopup(this,!0,void 0,!e)},n=()=>{bt(Ju,this).toggleCommentPopup(this,!1,!0,!e)},s=()=>{bt(Ju,this).toggleCommentPopup(this,!1,!1)};if(e){yt(gp,this,bt(Ep,this).container);for(const e of this.trigger)e.ariaHasPopup="dialog",e.ariaControls="commentPopup",e.addEventListener("keydown",bt($u,this),{signal:t}),e.addEventListener("click",i,{signal:t}),e.addEventListener("pointerenter",n,{signal:t}),e.addEventListener("pointerleave",s,{signal:t}),e.classList.add("popupTriggerArea")}else{const e=yt(gp,this,document.createElement("button"));e.className="annotationCommentButton";const r=bt(Ep,this).container;e.style.zIndex=r.style.zIndex+1,e.tabIndex=0,e.ariaHasPopup="dialog",e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button"),vt(_p,this,Tp).call(this),vt(_p,this,Mp).call(this),e.addEventListener("keydown",bt($u,this),{signal:t}),e.addEventListener("click",i,{signal:t}),e.addEventListener("pointerenter",n,{signal:t}),e.addEventListener("pointerleave",s,{signal:t}),r.after(e)}}get commentButtonColor(){const{color:t,opacity:e}=bt(Ep,this).commentData;return t?bt(lp,this)._commentManager.makeCommentColor(t,e):null}focusCommentButton(){setTimeout(()=>{var t;null===(t=bt(gp,this))||void 0===t||t.focus()},0)}getData(){const{richText:t,color:e,opacity:i,creationDate:n,modificationDate:s}=bt(Ep,this).commentData;return{contentsObj:{str:this.comment},richText:t,color:e,opacity:i,creationDate:n,modificationDate:s}}get elementBeforePopup(){return bt(gp,this)}get comment(){return bt(xp,this)||yt(xp,this,bt(Ep,this).commentText),bt(xp,this)}set comment(t){t!==this.comment&&(bt(Ep,this).commentText=yt(xp,this,t))}get parentBoundingClientRect(){return bt(Ep,this).layer.getBoundingClientRect()}setCommentButtonStates(t){let{selected:e,hasPopup:i}=t;bt(gp,this)&&(bt(gp,this).classList.toggle("selected",e),bt(gp,this).ariaExpanded=i)}setSelectedCommentButton(t){bt(gp,this).classList.toggle("selected",t)}get commentPopupPosition(){if(bt(mp,this))return bt(mp,this);const{x:t,y:e,height:i}=bt(gp,this).getBoundingClientRect(),{x:n,y:s,width:r,height:a}=bt(Ep,this).layer.getBoundingClientRect();return[(t-n)/r,(e+i-s)/a]}set commentPopupPosition(t){yt(mp,this,t)}hasDefaultPopupPosition(){return null===bt(mp,this)}get commentButtonPosition(){return bt(fp,this)}get commentButtonWidth(){return bt(gp,this).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(t){const[e,i]=bt(mp,this)||this.commentButtonPosition.map(t=>t/100),n=this.parentBoundingClientRect,{x:s,y:r,width:a,height:o}=n;bt(Ju,this).showDialog(null,this,s+e*a,r+i*o,(0,pt.A)((0,pt.A)({},t),{},{parentDimensions:n}))}render(){var t,e;if(bt(dp,this))return;const i=yt(dp,this,document.createElement("div"));if(i.className="popup",bt(np,this)){const t=i.style.outlineColor=He.makeHexColor(...bt(np,this));i.style.backgroundColor="color-mix(in srgb, ".concat(t," 30%, white)")}const n=document.createElement("span");if(n.className="header",null!==(t=bt(bp,this))&&void 0!==t&&t.str){const t=document.createElement("span");t.className="title",n.append(t),({dir:t.dir,str:t.textContent}=bt(bp,this))}if(i.append(n),bt(ap,this)){const t=document.createElement("time");t.className="popupDate",t.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),t.setAttribute("data-l10n-args",JSON.stringify({dateObj:bt(ap,this).valueOf()})),t.dateTime=bt(ap,this).toISOString(),n.append(t)}_i({html:wt(_p,this,Pp)||bt(rp,this).str,dir:null===(e=bt(rp,this))||void 0===e?void 0:e.dir,className:"popupContent"},i),bt(sp,this).append(i)}updateEdited(t){var e;let{rect:i,popup:n,deleted:s}=t;if(bt(Ju,this))return s?(this.remove(),yt(xp,this,null)):n&&(n.deleted?this.remove():(vt(_p,this,Tp).call(this),yt(xp,this,n.text))),void(i&&(yt(fp,this,null),vt(_p,this,Sp).call(this),vt(_p,this,Mp).call(this)));s||null!==n&&void 0!==n&&n.deleted?this.remove():(vt(_p,this,Cp).call(this),bt(yp,this)||yt(yp,this,{contentsObj:bt(rp,this),richText:bt(wp,this)}),i&&yt(pp,this,null),n&&n.text&&(yt(wp,this,vt(_p,this,Dp).call(this,n.text)),yt(ap,this,hi.toDateObject(n.date)),yt(rp,this,null)),null===(e=bt(dp,this))||void 0===e||e.remove(),yt(dp,this,null))}resetEdited(){var t;bt(yp,this)&&(({contentsObj:ut(yt,[rp,this])._,richText:ut(yt,[wp,this])._}=bt(yp,this)),yt(yp,this,null),null===(t=bt(dp,this))||void 0===t||t.remove(),yt(dp,this,null),yt(pp,this,null))}remove(){var t,e,i;if(null===(t=bt(up,this))||void 0===t||t.abort(),yt(up,this,null),null===(e=bt(dp,this))||void 0===e||e.remove(),yt(dp,this,null),yt(Ap,this,!1),yt(hp,this,!1),null===(i=bt(gp,this))||void 0===i||i.remove(),yt(gp,this,null),this.trigger)for(const n of this.trigger)n.classList.remove("popupTriggerArea")}forceHide(){yt(Ap,this,this.isVisible),bt(Ap,this)&&(bt(sp,this).hidden=!0)}maybeShow(){bt(Ju,this)||(vt(_p,this,Cp).call(this),bt(Ap,this)&&(bt(dp,this)||vt(_p,this,Op).call(this),yt(Ap,this,!1),bt(sp,this).hidden=!1))}get isVisible(){return!bt(Ju,this)&&!1===bt(sp,this).hidden}}function Cp(){if(bt(up,this))return;yt(up,this,new AbortController);const{signal:t}=bt(up,this);for(const i of this.trigger)i.addEventListener("click",bt(ip,this),{signal:t}),i.addEventListener("pointerenter",bt(ep,this),{signal:t}),i.addEventListener("pointerleave",bt(tp,this),{signal:t}),i.classList.add("popupTriggerArea");for(const i of bt(op,this)){var e;null===(e=i.container)||void 0===e||e.addEventListener("keydown",bt($u,this),{signal:t})}}function Sp(){const t=bt(op,this).find(t=>t.hasCommentButton);t&&yt(fp,this,t._normalizePoint(t.commentButtonPosition))}function Mp(){if(bt(Ep,this).extraPopupElement&&!bt(Ep,this).editor)return;this.renderCommentButton();const[t,e]=bt(fp,this),{style:i}=bt(gp,this);i.left="calc(".concat(t,"%)"),i.top="calc(".concat(e,"% - var(--comment-button-dim))")}function Tp(){bt(Ep,this).extraPopupElement||(this.renderCommentButton(),bt(gp,this).style.backgroundColor=this.commentButtonColor||"")}function Pp(t){const e=bt(wp,t),i=bt(rp,t);return null===e||void 0===e||!e.str||null!==i&&void 0!==i&&i.str&&i.str!==e.str?null:bt(wp,t).html||null}function Lp(t){var e;return(null===(e=wt(_p,t,Pp))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.fontSize)||0}function Rp(t){var e;return(null===(e=wt(_p,t,Pp))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.color)||null}function Dp(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:wt(_p,this,Rp),fontSize:wt(_p,this,Lp)?"calc(".concat(wt(_p,this,Lp),"px * var(--total-scale-factor))"):""}};for(const s of t.split("\n"))e.push({name:"span",value:s,attributes:n});return i}function Fp(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&bt(hp,this))&&vt(_p,this,Np).call(this)}function Ip(){if(null!==bt(pp,this))return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:s}}}=bt(lp,this);let r=!!bt(cp,this),a=bt(r?cp:vp,this);for(const u of bt(op,this))if(!a||null!==He.intersect(u.data.rect,a)){a=u.data.rect,r=!0;break}const o=He.normalizeRect([a[0],t[3]-a[1]+t[1],a[2],t[3]-a[3]+t[1]]),l=r?a[2]-a[0]+5:0,c=o[0]+l,h=o[1];yt(pp,this,[100*(c-n)/e,100*(h-s)/i]);const{style:d}=bt(sp,this);d.left="".concat(bt(pp,this)[0],"%"),d.top="".concat(bt(pp,this)[1],"%")}function Np(){bt(Ju,this)?bt(Ju,this).toggleCommentPopup(this,!1):(yt(hp,this,!bt(hp,this)),bt(hp,this)?(vt(_p,this,Op).call(this),bt(sp,this).addEventListener("click",bt(ip,this)),bt(sp,this).addEventListener("keydown",bt($u,this))):(vt(_p,this,Bp).call(this),bt(sp,this).removeEventListener("click",bt(ip,this)),bt(sp,this).removeEventListener("keydown",bt($u,this))))}function Op(){bt(dp,this)||this.render(),this.isVisible?bt(hp,this)&&bt(sp,this).classList.add("focused"):(vt(_p,this,Ip).call(this),bt(sp,this).hidden=!1,bt(sp,this).style.zIndex=parseInt(bt(sp,this).style.zIndex)+1e3)}function Bp(){bt(sp,this).classList.remove("focused"),!bt(hp,this)&&this.isVisible&&(bt(sp,this).hidden=!0,bt(sp,this).style.zIndex=parseInt(bt(sp,this).style.zIndex)-1e3)}class Wp extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=te.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}}var zp=new WeakMap;class jp extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),mt(this,zp,null)}render(){this.container.classList.add("lineAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),s=yt(zp,this,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 bt(zp,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Hp=new WeakMap;class Up extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),mt(this,Hp,null)}render(){this.container.classList.add("squareAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=yt(Hp,this,this.svgFactory.createElement("svg:rect"));return r.setAttribute("x",s/2),r.setAttribute("y",s/2),r.setAttribute("width",e-s),r.setAttribute("height",i-s),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(Hp,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Vp=new WeakMap;class Gp extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),mt(this,Vp,null)}render(){this.container.classList.add("circleAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=yt(Vp,this,this.svgFactory.createElement("svg:ellipse"));return r.setAttribute("cx",e/2),r.setAttribute("cy",i/2),r.setAttribute("rx",e/2-s/2),r.setAttribute("ry",i/2-s/2),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(Vp,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var qp=new WeakMap;class Xp extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),mt(this,qp,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},width:s,height:r}=this;if(!e)return this.container;const a=this.svgFactory.create(s,r,!0);let o=[];for(let c=0,h=e.length;c<h;c+=2){const i=e[c]-t[0],n=t[3]-e[c+1];o.push("".concat(i,",").concat(n))}o=o.join(" ");const l=yt(qp,this,this.svgFactory.createElement(this.svgElementName));return l.setAttribute("points",o),l.setAttribute("stroke-width",i.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),a.append(l),this.container.append(a),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(qp,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class Yp extends Xp{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Kp extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var Qp=new WeakMap,Zp=new WeakMap,Jp=new WeakSet;class $p extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),ft(this,Jp),mt(this,Qp,null),mt(this,Zp,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?te.HIGHLIGHT:te.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:e,inkLists:i,borderStyle:n,popupRef:s}}=this,{transform:r,width:a,height:o}=vt(Jp,this,tg).call(this,e,t),l=this.svgFactory.create(a,o,!0),c=yt(Qp,this,this.svgFactory.createElement("svg:g"));l.append(c),c.setAttribute("stroke-width",n.width||1),c.setAttribute("stroke-linecap","round"),c.setAttribute("stroke-linejoin","round"),c.setAttribute("stroke-miterlimit",10),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),c.setAttribute("transform",r);for(let h=0,d=i.length;h<d;h++){const t=this.svgFactory.createElement(this.svgElementName);bt(Zp,this).push(t),t.setAttribute("points",i[h].join(",")),c.append(t)}return!s&&this.hasPopupData&&this._createPopup(),this.container.append(l),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:e,points:i,rect:n}=t,s=bt(Qp,this);if(e>=0&&s.setAttribute("stroke-width",e||1),i)for(let r=0,a=bt(Zp,this).length;r<a;r++)bt(Zp,this)[r].setAttribute("points",i[r].join(","));if(n){const{transform:t,width:e,height:i}=vt(Jp,this,tg).call(this,this.data.rotation,n);s.parentElement.setAttribute("viewBox","0 0 ".concat(e," ").concat(i)),s.setAttribute("transform",t)}}getElementsToTriggerPopup(){return bt(Zp,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function tg(t,e){switch(t){case 90:return{transform:"rotate(90) translate(".concat(-e[0],",").concat(e[1],") scale(1,-1)"),width:e[3]-e[1],height:e[2]-e[0]};case 180:return{transform:"rotate(180) translate(".concat(-e[2],",").concat(e[1],") scale(1,-1)"),width:e[2]-e[0],height:e[3]-e[1]};case 270:return{transform:"rotate(270) translate(".concat(-e[2],",").concat(e[3],") scale(1,-1)"),width:e[3]-e[1],height:e[2]-e[0]};default:return{transform:"translate(".concat(-e[0],",").concat(e[3],") scale(1,-1)"),width:e[2]-e[0],height:e[3]-e[1]}}}class eg extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=te.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const e=document.createElement("mark");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class ig extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),t){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class ng extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),t){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class sg extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),t){const e=document.createElement("s");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class rg extends Du{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=te.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var ag=new WeakMap,og=new WeakSet;class lg extends Du{constructor(t){var e;super(t,{isRenderable:!0}),ft(this,og),mt(this,ag,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",(0,pt.A)({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="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(e.name)?"paperclip":"pushpin",".svg"),e.fillAlpha&&e.fillAlpha<1&&(i.style="filter: opacity(".concat(Math.round(100*e.fillAlpha),"%);"))),i.addEventListener("dblclick",vt(og,this,cg).bind(this)),yt(ag,this,i);const{isMac:n}=ze.platform;return t.addEventListener("keydown",t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&vt(og,this,cg).call(this)}),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return bt(ag,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function cg(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.content,this.filename)}var hg=new WeakMap,dg=new WeakMap,ug=new WeakMap,pg=new WeakMap,gg=new WeakMap,fg=new WeakMap,mg=new WeakSet;class vg{constructor(t){let{div:e,accessibilityManager:i,annotationCanvasMap:n,annotationEditorUIManager:s,page:r,viewport:a,structTreeLayer:o,commentManager:l,linkService:c,annotationStorage:h}=t;ft(this,mg),mt(this,hg,null),mt(this,dg,null),mt(this,ug,null),mt(this,pg,new Map),mt(this,gg,null),mt(this,fg,null),this.div=e,yt(hg,this,i),yt(dg,this,n),yt(gg,this,o||null),yt(fg,this,c||null),yt(ug,this,h||new Ta),this.page=r,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=s,this._commentManager=l||null}hasEditableAnnotations(){return bt(pg,this).size>0}async render(t){const{annotations:e}=t,i=this.div;fi(i,this.viewport);const n=new Map,s={data:null,layer:i,linkService:bt(fg,this),downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new ku,annotationStorage:bt(ug,this),enableComment:!0===t.enableComment,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const o of e){var r;if(o.noHTML)continue;const t=o.annotationType===ce.POPUP;if(t){const t=n.get(o.id);if(!t)continue;s.elements=t}else if(o.rect[2]===o.rect[0]||o.rect[3]===o.rect[1])continue;s.data=o;const e=Mu.create(s);if(!e.isRenderable)continue;if(!t&&o.popupRef){const t=n.get(o.popupRef);t?t.push(e):n.set(o.popupRef,[e])}const i=e.render();var a;if(o.hidden&&(i.style.visibility="hidden"),await vt(mg,this,wg).call(this,i,o.id,s.elements),null===(r=e.extraPopupElement)||void 0===r||null===(r=r.popup)||void 0===r||r.renderCommentButton(),e._isEditable)bt(pg,this).set(e.data.id,e),null===(a=this._annotationEditorUIManager)||void 0===a||a.renderAnnotationElement(e)}vt(mg,this,bg).call(this)}async addLinkAnnotations(t){const e={data:null,layer:this.div,linkService:bt(fg,this),svgFactory:new ku,parent:this};for(const i of t){i.borderStyle||(i.borderStyle=vg._defaultBorderStyle),e.data=i;const t=Mu.create(e);if(!t.isRenderable)continue;const n=t.render();await vt(mg,this,wg).call(this,n,i.id,null)}}update(t){let{viewport:e}=t;const i=this.div;this.viewport=e,fi(i,{rotation:e.rotation}),vt(mg,this,bg).call(this),i.hidden=!1}getEditableAnnotations(){return Array.from(bt(pg,this).values())}getEditableAnnotation(t){return bt(pg,this).get(t)}addFakeAnnotation(t){var e;const{div:i}=this,{id:n,rotation:s}=t,r=new Iu({data:{id:n,rect:t.getPDFRect(),rotation:s},editor:t,layer:i,parent:this,enableComment:!!this._commentManager,linkService:bt(fg,this),annotationStorage:bt(ug,this)}),a=r.render();return i.append(a),null===(e=bt(hg,this))||void 0===e||e.moveElementInDOM(i,a,a,!1),r.createOrUpdatePopup(),r}static get _defaultBorderStyle(){return Pe(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:he,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}async function wg(t,e,i){var n;const s=t.firstChild||t,r=s.id="".concat(Ye).concat(e),a=await(null===(n=bt(gg,this))||void 0===n?void 0:n.getAriaAttributes(r));if(a)for(const[l,c]of a)s.setAttribute(l,c);var o;i?i.at(-1).container.after(t):(this.div.append(t),null===(o=bt(hg,this))||void 0===o||o.moveElementInDOM(this.div,t,s,!1))}function bg(){if(!bt(dg,this))return;const t=this.div;for(const[i,n]of bt(dg,this)){const s=t.querySelector('[data-annotation-id="'.concat(i,'"]'));if(!s)continue;n.className="annotationContent";const{firstChild:r}=s;r?"CANVAS"===r.nodeName?r.replaceWith(n):r.classList.contains("annotationContent")?r.after(n):r.before(n):s.append(n);const a=bt(pg,this).get(i);var e;if(a)if(a._hasNoCanvas)null===(e=this._annotationEditorUIManager)||void 0===e||e.setMissingCanvas(i,s.id,n),a._hasNoCanvas=!1;else a.canvas=n}bt(dg,this).clear()}const yg=/\r\n?|\n/g;var Ag=new WeakMap,Eg=new WeakMap,xg=new WeakMap,_g=new WeakMap,kg=new WeakSet;class Cg extends Jr{static get _keyboardManager(){const t=Cg.prototype,e=t=>t.isEmpty(),i=hs.TRANSLATE_SMALL,n=hs.TRANSLATE_BIG;return Pe(this,"_keyboardManager",new dn([[["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}]]))}constructor(t){super((0,pt.A)((0,pt.A)({},t),{},{name:"freeTextEditor"})),ft(this,kg),mt(this,Ag,""),mt(this,Eg,"".concat(this.id,"-editor")),mt(this,xg,null),mt(this,_g,void 0),(0,Wt.A)(this,"_colorPicker",null),this.color=t.color||Cg._defaultColor||Jr._defaultLineColor,yt(_g,this,t.fontSize||Cg._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static initialize(t,e){Jr.initialize(t,e);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case ee.FREETEXT_SIZE:Cg._defaultFontSize=e;break;case ee.FREETEXT_COLOR:Cg._defaultColor=e}}updateParams(t,e){switch(t){case ee.FREETEXT_SIZE:vt(kg,this,Sg).call(this,e);break;case ee.FREETEXT_COLOR:vt(kg,this,Mg).call(this,e)}}static get defaultPropertiesToUpdate(){return[[ee.FREETEXT_SIZE,Cg._defaultFontSize],[ee.FREETEXT_COLOR,Cg._defaultColor||Jr._defaultLineColor]]}get propertiesToUpdate(){return[[ee.FREETEXT_SIZE,bt(_g,this)],[ee.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new bu(this)),[["colorPicker",this._colorPicker]]}get colorType(){return ee.FREETEXT_COLOR}onUpdatedColor(){var t;this.editorDiv.style.color=this.color,null===(t=this._colorPicker)||void 0===t||t.update(this.color),super.onUpdatedColor()}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-Cg._internalPadding*t,-(Cg._internalPadding+bt(_g,this))*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),yt(xg,this,new AbortController);const t=this._uiManager.combinedSignal(bt(xg,this));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){var t;return!!super.disableEditMode()&&(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",bt(Eg,this)),this._isDraggable=!0,null===(t=bt(xg,this))||void 0===t||t.abort(),yt(xg,this,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0)}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){var e;this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),null!==(e=this._initialOptions)&&void 0!==e&&e.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=bt(Ag,this),e=yt(Ag,this,vt(kg,this,Tg).call(this).trimEnd());if(t===e)return;const i=t=>{yt(Ag,this,t),t?(vt(kg,this,Rg).call(this),this._uiManager.rebuild(this),vt(kg,this,Pg).call(this)):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),vt(kg,this,Pg).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){Cg._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)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,e;(this._isCopy||this.annotationElementId)&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",bt(Eg,this)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize="calc(".concat(bt(_g,this),"px * var(--total-scale-factor))"),i.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:s}=this._initialData;let[r,a]=this.getInitialTranslation();[r,a]=this.pageTranslationToScreen(r,a);const[o,l]=this.pageDimensions,[c,h]=this.pageTranslation;let d,u;switch(this.rotation){case 0:d=t+(s[0]-c)/o,u=e+this.height-(s[1]-h)/l;break;case 90:d=t+(s[0]-c)/o,u=e-(s[1]-h)/l,[r,a]=[a,-r];break;case 180:d=t-this.width+(s[0]-c)/o,u=e-(s[1]-h)/l,[r,a]=[-r,-a];break;case 270:d=t+(s[0]-c-this.height*l)/o,u=e+(s[1]-h-this.width*o)/l,[r,a]=[-a,r]}this.setAt(d*i,u*n,r,a)}else this._moveAfterPaste(t,e);vt(kg,this,Rg).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=Fg.call(Cg,e.getData("text")||"").replaceAll(yg,"\n");if(!n)return;const s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();const r=s.getRangeAt(0);if(!n.includes("\n"))return r.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void s.collapseToStart();const{startContainer:a,startOffset:o}=r,l=[],c=[];if(a.nodeType===Node.TEXT_NODE){const t=a.parentElement;if(c.push(a.nodeValue.slice(o).replaceAll(yg,"")),t!==this.editorDiv){let e=l;for(const i of this.editorDiv.childNodes)i!==t?e.push(Lg.call(Cg,i)):e=c}l.push(a.nodeValue.slice(0,o).replaceAll(yg,""))}else if(a===this.editorDiv){let t=l,e=0;for(const i of this.editorDiv.childNodes)e++===o&&(t=c),t.push(Lg.call(Cg,i))}yt(Ag,this,"".concat(l.join("\n")).concat(n).concat(c.join("\n"))),vt(kg,this,Rg).call(this);const h=new Range;let d=Math.sumPrecise(l.map(t=>t.length));for(const{firstChild:u}of this.editorDiv.childNodes)if(u.nodeType===Node.TEXT_NODE){const t=u.nodeValue.length;if(d<=t){h.setStart(u,d),h.setEnd(u,d);break}d-=t}s.removeAllRanges(),s.addRange(h)}get contentDiv(){return this.editorDiv}getPDFRect(){const t=Cg._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,e,i){let n=null;if(t instanceof Wp){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:s,rotation:r,id:a,popupRef:o,richText:l,contentsObj:c,creationDate:h,modificationDate:d},textContent:u,textPosition:p,parent:{page:{pageNumber:g}}}=t;if(!u||0===u.length)return null;n=t={annotationType:te.FREETEXT,color:Array.from(i),fontSize:e,value:u.join("\n"),position:p,pageIndex:g-1,rect:s.slice(0),rotation:r,annotationElementId:a,id:a,deleted:!1,popupRef:o,comment:(null===c||void 0===c?void 0:c.str)||null,richText:l,creationDate:h,modificationDate:d}}const s=await super.deserialize(t,e,i);return yt(_g,s,t.fontSize),s.color=He.makeHexColor(...t.color),yt(Ag,s,Fg.call(Cg,t.value)),s._initialData=n,t.comment&&s.setCommentData(t),s}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e=Jr._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(t),{color:e,fontSize:bt(_g,this),value:vt(kg,this,Dg).call(this)});return this.addComment(i),t?(i.isCopy=!0,i):this.annotationElementId&&!vt(kg,this,Ig).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(!e)return null;const{style:i}=e;i.fontSize="calc(".concat(bt(_g,this),"px * var(--total-scale-factor))"),i.color=this.color,e.replaceChildren();for(const n of bt(Ag,this).split("\n")){const t=document.createElement("div");t.append(n?document.createTextNode(n):document.createElement("br")),e.append(t)}return t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:bt(Ag,this)}}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}function Sg(t){const e=t=>{this.editorDiv.style.fontSize="calc(".concat(t,"px * var(--total-scale-factor))"),this.translate(0,-(t-bt(_g,this))*this.parentScale),yt(_g,this,t),vt(kg,this,Pg).call(this)},i=bt(_g,this);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ee.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function Mg(t){const e=t=>{this.color=t,this.onUpdatedColor()},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:ee.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function Tg(){const t=[];this.editorDiv.normalize();let e=null;for(const n of this.editorDiv.childNodes){var i;(null===(i=e)||void 0===i?void 0:i.nodeType)===Node.TEXT_NODE&&"BR"===n.nodeName||(t.push(Lg.call(Ft,n)),e=n)}return t.join("\n")}function Pg(){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()}function Lg(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(yg,"")}function Rg(){if(this.editorDiv.replaceChildren(),bt(Ag,this))for(const t of bt(Ag,this).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}function Dg(){return bt(Ag,this).replaceAll("\xa0"," ")}function Fg(t){return t.replaceAll(" ","\xa0")}function Ig(t){const{value:e,fontSize:i,color:n,pageIndex:s}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some((t,e)=>t!==n[e])||t.pageIndex!==s}Ft=Cg,(0,Wt.A)(Cg,"_freeTextDefaultContent",""),(0,Wt.A)(Cg,"_internalPadding",0),(0,Wt.A)(Cg,"_defaultColor",null),(0,Wt.A)(Cg,"_defaultFontSize",10),(0,Wt.A)(Cg,"_type","freetext"),(0,Wt.A)(Cg,"_editorType",te.FREETEXT);class Ng{toSVGPath(){Ce("Abstract method `toSVGPath` must be implemented.")}get box(){Ce("Abstract getter `box` must be implemented.")}serialize(t,e){Ce("Abstract method `serialize` must be implemented.")}static _rescale(t,e,i,n,s,r){r||(r=new Float32Array(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}static _rescaleAndSwap(t,e,i,n,s,r){r||(r=new Float32Array(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}static _translate(t,e,i,n){n||(n=new Float32Array(t.length));for(let s=0,r=t.length;s<r;s+=2)n[s]=e+t[s],n[s+1]=i+t[s+1];return n}static svgRound(t){return Math.round(1e4*t)}static _normalizePoint(t,e,i,n,s){switch(s){case 90:return[1-e/i,t/n];case 180:return[1-t/i,1-e/n];case 270:return[e/i,1-t/n];default:return[t/i,e/n]}}static _normalizePagePoint(t,e,i){switch(i){case 90:return[1-e,t];case 180:return[1-t,1-e];case 270:return[e,1-t];default:return[t,e]}}static createBezierPoints(t,e,i,n,s,r){return[(t+5*i)/6,(e+5*n)/6,(5*i+s)/6,(5*n+r)/6,(i+s)/2,(n+r)/2]}}(0,Wt.A)(Ng,"PRECISION",1e-4);var Og=new WeakMap,Bg=new WeakMap,Wg=new WeakMap,zg=new WeakMap,jg=new WeakMap,Hg=new WeakMap,Ug=new WeakMap,Vg=new WeakMap,Gg=new WeakMap,qg=new WeakMap,Xg=new WeakMap,Yg=new WeakMap,Kg=new WeakMap,Qg=new WeakSet;class Zg{constructor(t,e,i,n,s){let{x:r,y:a}=t,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;ft(this,Qg),mt(this,Og,void 0),mt(this,Bg,[]),mt(this,Wg,void 0),mt(this,zg,void 0),mt(this,jg,[]),mt(this,Hg,new Float32Array(18)),mt(this,Ug,void 0),mt(this,Vg,void 0),mt(this,Gg,void 0),mt(this,qg,void 0),mt(this,Xg,void 0),mt(this,Yg,void 0),mt(this,Kg,[]),yt(Og,this,e),yt(Yg,this,n*i),yt(zg,this,s),bt(Hg,this).set([NaN,NaN,NaN,NaN,r,a],6),yt(Wg,this,o),yt(qg,this,af._*i),yt(Gg,this,of._*i),yt(Xg,this,i),bt(Kg,this).push(r,a)}isEmpty(){return isNaN(bt(Hg,this)[8])}add(t){var e;let{x:i,y:n}=t;yt(Ug,this,i),yt(Vg,this,n);const[s,r,a,o]=bt(Og,this);let[l,c,h,d]=bt(Hg,this).subarray(8,12);const u=i-h,p=n-d,g=Math.hypot(u,p);if(g<bt(Gg,this))return!1;const f=g-bt(qg,this),m=f/g,v=m*u,w=m*p;let b=l,y=c;l=h,c=d,h+=v,d+=w,null===(e=bt(Kg,this))||void 0===e||e.push(i,n);const A=v/f,E=-w/f*bt(Yg,this),x=A*bt(Yg,this);if(bt(Hg,this).set(bt(Hg,this).subarray(2,8),0),bt(Hg,this).set([h+E,d+x],4),bt(Hg,this).set(bt(Hg,this).subarray(14,18),12),bt(Hg,this).set([h-E,d-x],16),isNaN(bt(Hg,this)[6]))return 0===bt(jg,this).length&&(bt(Hg,this).set([l+E,c+x],2),bt(jg,this).push(NaN,NaN,NaN,NaN,(l+E-s)/a,(c+x-r)/o),bt(Hg,this).set([l-E,c-x],14),bt(Bg,this).push(NaN,NaN,NaN,NaN,(l-E-s)/a,(c-x-r)/o)),bt(Hg,this).set([b,y,l,c,h,d],6),!this.isEmpty();bt(Hg,this).set([b,y,l,c,h,d],6);return Math.abs(Math.atan2(y-c,b-l)-Math.atan2(w,v))<Math.PI/2?([l,c,h,d]=bt(Hg,this).subarray(2,6),bt(jg,this).push(NaN,NaN,NaN,NaN,((l+h)/2-s)/a,((c+d)/2-r)/o),[l,c,b,y]=bt(Hg,this).subarray(14,18),bt(Bg,this).push(NaN,NaN,NaN,NaN,((b+l)/2-s)/a,((y+c)/2-r)/o),!0):([b,y,l,c,h,d]=bt(Hg,this).subarray(0,6),bt(jg,this).push(((b+5*l)/6-s)/a,((y+5*c)/6-r)/o,((5*l+h)/6-s)/a,((5*c+d)/6-r)/o,((l+h)/2-s)/a,((c+d)/2-r)/o),[h,d,l,c,b,y]=bt(Hg,this).subarray(12,18),bt(Bg,this).push(((b+5*l)/6-s)/a,((y+5*c)/6-r)/o,((5*l+h)/6-s)/a,((5*c+d)/6-r)/o,((l+h)/2-s)/a,((c+d)/2-r)/o),!0)}toSVGPath(){if(this.isEmpty())return"";const t=bt(jg,this),e=bt(Bg,this);if(isNaN(bt(Hg,this)[6])&&!this.isEmpty())return vt(Qg,this,$g).call(this);const i=[];i.push("M".concat(t[4]," ").concat(t[5]));for(let n=6;n<t.length;n+=6)isNaN(t[n])?i.push("L".concat(t[n+4]," ").concat(t[n+5])):i.push("C".concat(t[n]," ").concat(t[n+1]," ").concat(t[n+2]," ").concat(t[n+3]," ").concat(t[n+4]," ").concat(t[n+5]));vt(Qg,this,ef).call(this,i);for(let n=e.length-6;n>=6;n-=6)isNaN(e[n])?i.push("L".concat(e[n+4]," ").concat(e[n+5])):i.push("C".concat(e[n]," ").concat(e[n+1]," ").concat(e[n+2]," ").concat(e[n+3]," ").concat(e[n+4]," ").concat(e[n+5]));return vt(Qg,this,tf).call(this,i),i.join(" ")}newFreeDrawOutline(t,e,i,n,s,r){return new mf(t,e,i,n,s,r)}getOutlines(){var t,e;const i=bt(jg,this),n=bt(Bg,this),s=bt(Hg,this),[r,a,o,l]=bt(Og,this),c=new Float32Array((null!==(t=null===(e=bt(Kg,this))||void 0===e?void 0:e.length)&&void 0!==t?t:0)+2);for(let u=0,p=c.length-2;u<p;u+=2)c[u]=(bt(Kg,this)[u]-r)/o,c[u+1]=(bt(Kg,this)[u+1]-a)/l;if(c[c.length-2]=(bt(Ug,this)-r)/o,c[c.length-1]=(bt(Vg,this)-a)/l,isNaN(s[6])&&!this.isEmpty())return vt(Qg,this,nf).call(this,c);const h=new Float32Array(bt(jg,this).length+24+bt(Bg,this).length);let d=i.length;for(let u=0;u<d;u+=2)isNaN(i[u])?h[u]=h[u+1]=NaN:(h[u]=i[u],h[u+1]=i[u+1]);d=vt(Qg,this,rf).call(this,h,d);for(let u=n.length-6;u>=6;u-=6)for(let t=0;t<6;t+=2)isNaN(n[u+t])?(h[d]=h[d+1]=NaN,d+=2):(h[d]=n[u+t],h[d+1]=n[u+t+1],d+=2);return vt(Qg,this,sf).call(this,h,d),this.newFreeDrawOutline(h,c,bt(Og,this),bt(Xg,this),bt(Wg,this),bt(zg,this))}}function Jg(){const t=bt(Hg,this).subarray(4,6),e=bt(Hg,this).subarray(16,18),[i,n,s,r]=bt(Og,this);return[(bt(Ug,this)+(t[0]-e[0])/2-i)/s,(bt(Vg,this)+(t[1]-e[1])/2-n)/r,(bt(Ug,this)+(e[0]-t[0])/2-i)/s,(bt(Vg,this)+(e[1]-t[1])/2-n)/r]}function $g(){const[t,e,i,n]=bt(Og,this),[s,r,a,o]=vt(Qg,this,Jg).call(this);return"M".concat((bt(Hg,this)[2]-t)/i," ").concat((bt(Hg,this)[3]-e)/n," L").concat((bt(Hg,this)[4]-t)/i," ").concat((bt(Hg,this)[5]-e)/n," L").concat(s," ").concat(r," L").concat(a," ").concat(o," L").concat((bt(Hg,this)[16]-t)/i," ").concat((bt(Hg,this)[17]-e)/n," L").concat((bt(Hg,this)[14]-t)/i," ").concat((bt(Hg,this)[15]-e)/n," Z")}function tf(t){const e=bt(Bg,this);t.push("L".concat(e[4]," ").concat(e[5]," Z"))}function ef(t){const[e,i,n,s]=bt(Og,this),r=bt(Hg,this).subarray(4,6),a=bt(Hg,this).subarray(16,18),[o,l,c,h]=vt(Qg,this,Jg).call(this);t.push("L".concat((r[0]-e)/n," ").concat((r[1]-i)/s," L").concat(o," ").concat(l," L").concat(c," ").concat(h," L").concat((a[0]-e)/n," ").concat((a[1]-i)/s))}function nf(t){const e=bt(Hg,this),[i,n,s,r]=bt(Og,this),[a,o,l,c]=vt(Qg,this,Jg).call(this),h=new Float32Array(36);return h.set([NaN,NaN,NaN,NaN,(e[2]-i)/s,(e[3]-n)/r,NaN,NaN,NaN,NaN,(e[4]-i)/s,(e[5]-n)/r,NaN,NaN,NaN,NaN,a,o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,(e[16]-i)/s,(e[17]-n)/r,NaN,NaN,NaN,NaN,(e[14]-i)/s,(e[15]-n)/r],0),this.newFreeDrawOutline(h,t,bt(Og,this),bt(Xg,this),bt(Wg,this),bt(zg,this))}function sf(t,e){const i=bt(Bg,this);return t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e),e+6}function rf(t,e){const i=bt(Hg,this).subarray(4,6),n=bt(Hg,this).subarray(16,18),[s,r,a,o]=bt(Og,this),[l,c,h,d]=vt(Qg,this,Jg).call(this);return t.set([NaN,NaN,NaN,NaN,(i[0]-s)/a,(i[1]-r)/o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,h,d,NaN,NaN,NaN,NaN,(n[0]-s)/a,(n[1]-r)/o],e),e+24}var af={_:8},of={_:af._+2},lf=new WeakMap,cf=new WeakMap,hf=new WeakMap,df=new WeakMap,uf=new WeakMap,pf=new WeakMap,gf=new WeakMap,ff=new WeakSet;class mf extends Ng{constructor(t,e,i,n,s,r){super(),ft(this,ff),mt(this,lf,void 0),mt(this,cf,new Float32Array(4)),mt(this,hf,void 0),mt(this,df,void 0),mt(this,uf,void 0),mt(this,pf,void 0),mt(this,gf,void 0),yt(gf,this,t),yt(uf,this,e),yt(lf,this,i),yt(pf,this,n),yt(hf,this,s),yt(df,this,r),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],vt(ff,this,vf).call(this,r);const[a,o,l,c]=bt(cf,this);for(let h=0,d=t.length;h<d;h+=2)t[h]=(t[h]-a)/l,t[h+1]=(t[h+1]-o)/c;for(let h=0,d=e.length;h<d;h+=2)e[h]=(e[h]-a)/l,e[h+1]=(e[h+1]-o)/c}toSVGPath(){const t=["M".concat(bt(gf,this)[4]," ").concat(bt(gf,this)[5])];for(let e=6,i=bt(gf,this).length;e<i;e+=6)isNaN(bt(gf,this)[e])?t.push("L".concat(bt(gf,this)[e+4]," ").concat(bt(gf,this)[e+5])):t.push("C".concat(bt(gf,this)[e]," ").concat(bt(gf,this)[e+1]," ").concat(bt(gf,this)[e+2]," ").concat(bt(gf,this)[e+3]," ").concat(bt(gf,this)[e+4]," ").concat(bt(gf,this)[e+5]));return t.push("Z"),t.join(" ")}serialize(t,e){let[i,n,s,r]=t;const a=s-i,o=r-n;let l,c;switch(e){case 0:l=Ng._rescale(bt(gf,this),i,r,a,-o),c=Ng._rescale(bt(uf,this),i,r,a,-o);break;case 90:l=Ng._rescaleAndSwap(bt(gf,this),i,n,a,o),c=Ng._rescaleAndSwap(bt(uf,this),i,n,a,o);break;case 180:l=Ng._rescale(bt(gf,this),s,n,-a,o),c=Ng._rescale(bt(uf,this),s,n,-a,o);break;case 270:l=Ng._rescaleAndSwap(bt(gf,this),s,r,-a,-o),c=Ng._rescaleAndSwap(bt(uf,this),s,r,-a,-o)}return{outline:Array.from(l),points:[Array.from(c)]}}get box(){return bt(cf,this)}newOutliner(t,e,i,n,s){return new Zg(t,e,i,n,s,arguments.length>5&&void 0!==arguments[5]?arguments[5]:0)}getNewOutline(t,e){const[i,n,s,r]=bt(cf,this),[a,o,l,c]=bt(lf,this),h=s*l,d=r*c,u=i*l+a,p=n*c+o,g=this.newOutliner({x:bt(uf,this)[0]*h+u,y:bt(uf,this)[1]*d+p},bt(lf,this),bt(pf,this),t,bt(df,this),null!==e&&void 0!==e?e:bt(hf,this));for(let f=2;f<bt(uf,this).length;f+=2)g.add({x:bt(uf,this)[f]*h+u,y:bt(uf,this)[f+1]*d+p});return g.getOutlines()}}function vf(t){const e=bt(gf,this);let i=e[4],n=e[5];const s=[i,n,i,n];let r=i,a=n,o=i,l=n;const c=t?Math.max:Math.min,h=new Float32Array(4);for(let u=6,p=e.length;u<p;u+=6){const t=e[u+4],d=e[u+5];isNaN(e[u])?(He.pointBoundingBox(t,d,s),a>d?(r=t,a=d):a===d&&(r=c(r,t)),l<d?(o=t,l=d):l===d&&(o=c(o,t))):(h[0]=h[1]=1/0,h[2]=h[3]=-1/0,He.bezierBoundingBox(i,n,...e.slice(u,u+6),h),He.rectBoundingBox(h[0],h[1],h[2],h[3],s),a>h[1]?(r=h[0],a=h[1]):a===h[1]&&(r=c(r,h[0])),l<h[3]?(o=h[2],l=h[3]):l===h[3]&&(o=c(o,h[2]))),i=t,n=d}const d=bt(cf,this);d[0]=s[0]-bt(hf,this),d[1]=s[1]-bt(hf,this),d[2]=s[2]-s[0]+2*bt(hf,this),d[3]=s[3]-s[1]+2*bt(hf,this),this.firstPoint=[r,a],this.lastPoint=[o,l]}var wf=new WeakMap,bf=new WeakMap,yf=new WeakMap,Af=new WeakMap,Ef=new WeakMap,xf=new WeakSet;class _f{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];ft(this,xf),mt(this,wf,void 0),mt(this,bf,void 0),mt(this,yf,void 0),mt(this,Af,[]),mt(this,Ef,[]);const s=[1/0,1/0,-1/0,-1/0],r=10**-4;for(const{x:g,y:f,width:m,height:v}of t){const t=Math.floor((g-e)/r)*r,i=Math.ceil((g+m+e)/r)*r,n=Math.floor((f-e)/r)*r,a=Math.ceil((f+v+e)/r)*r,o=[t,n,a,!0],l=[i,n,a,!1];bt(Af,this).push(o,l),He.rectBoundingBox(t,n,i,a,s)}const a=s[2]-s[0]+2*i,o=s[3]-s[1]+2*i,l=s[0]-i,c=s[1]-i;let h=n?-1/0:1/0,d=1/0;const u=bt(Af,this).at(n?-1:-2),p=[u[0],u[2]];for(const g of bt(Af,this)){const[t,e,i,s]=g;!s&&n?e<d?(d=e,h=t):e===d&&(h=Math.max(h,t)):s&&!n&&(e<d?(d=e,h=t):e===d&&(h=Math.min(h,t))),g[0]=(t-l)/a,g[1]=(e-c)/o,g[2]=(i-c)/o}yt(wf,this,new Float32Array([l,c,a,o])),yt(bf,this,[h,d]),yt(yf,this,p)}getOutlines(){bt(Af,this).sort((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const t=[];for(const e of bt(Af,this))e[3]?(t.push(...vt(xf,this,Tf).call(this,e)),vt(xf,this,Sf).call(this,e)):(vt(xf,this,Mf).call(this,e),t.push(...vt(xf,this,Tf).call(this,e)));return vt(xf,this,kf).call(this,t)}}function kf(t){const e=[],i=new Set;for(const r of t){const[t,i,n]=r;e.push([t,i,r],[t,n,r])}e.sort((t,e)=>t[1]-e[1]||t[0]-e[0]);for(let r=0,a=e.length;r<a;r+=2){const t=e[r][2],n=e[r+1][2];t.push(n),n.push(t),i.add(t),i.add(n)}const n=[];let s;for(;i.size>0;){const t=i.values().next().value;let[e,r,a,o,l]=t;i.delete(t);let c=e,h=r;for(s=[e,a],n.push(s);;){let t;if(i.has(o))t=o;else{if(!i.has(l))break;t=l}i.delete(t),[e,r,a,o,l]=t,c!==e&&(s.push(c,h,e,h===r?r:a),c=e),h=h===r?a:r}s.push(c,h)}return new Rf(n,bt(wf,this),bt(bf,this),bt(yf,this))}function Cf(t){const e=bt(Ef,this);let i=0,n=e.length-1;for(;i<=n;){const s=i+n>>1,r=e[s][0];if(r===t)return s;r<t?i=s+1:n=s-1}return n+1}function Sf(t){let[,e,i]=t;const n=vt(xf,this,Cf).call(this,e);bt(Ef,this).splice(n,0,[e,i])}function Mf(t){let[,e,i]=t;const n=vt(xf,this,Cf).call(this,e);for(let s=n;s<bt(Ef,this).length;s++){const[t,n]=bt(Ef,this)[s];if(t!==e)break;if(t===e&&n===i)return void bt(Ef,this).splice(s,1)}for(let s=n-1;s>=0;s--){const[t,n]=bt(Ef,this)[s];if(t!==e)break;if(t===e&&n===i)return void bt(Ef,this).splice(s,1)}}function Tf(t){const[e,i,n]=t,s=[[e,i,n]],r=vt(xf,this,Cf).call(this,n);for(let a=0;a<r;a++){const[t,i]=bt(Ef,this)[a];for(let n=0,r=s.length;n<r;n++){const[,a,o]=s[n];if(!(i<=a||o<=t))if(a>=t)if(o>i)s[n][1]=i;else{if(1===r)return[];s.splice(n,1),n--,r--}else s[n][2]=t,o>i&&s.push([e,i,o])}}return s}var Pf=new WeakMap,Lf=new WeakMap;class Rf extends Ng{constructor(t,e,i,n){super(),mt(this,Pf,void 0),mt(this,Lf,void 0),yt(Lf,this,t),yt(Pf,this,e),this.firstPoint=i,this.lastPoint=n}toSVGPath(){const t=[];for(const e of bt(Lf,this)){let[i,n]=e;t.push("M".concat(i," ").concat(n));for(let s=2;s<e.length;s+=2){const r=e[s],a=e[s+1];r===i?(t.push("V".concat(a)),n=a):a===n&&(t.push("H".concat(r)),i=r)}t.push("Z")}return t.join(" ")}serialize(t,e){let[i,n,s,r]=t;const a=[],o=s-i,l=r-n;for(const c of bt(Lf,this)){const t=new Array(c.length);for(let e=0;e<c.length;e+=2)t[e]=i+c[e]*o,t[e+1]=r-c[e+1]*l;a.push(t)}return a}get box(){return bt(Pf,this)}get classNamesForOutlining(){return["highlightOutline"]}}class Df extends Zg{newFreeDrawOutline(t,e,i,n,s,r){return new Ff(t,e,i,n,s,r)}}class Ff extends mf{newOutliner(t,e,i,n,s){return new Df(t,e,i,n,s,arguments.length>5&&void 0!==arguments[5]?arguments[5]:0)}}var If=new WeakMap,Nf=new WeakMap,Of=new WeakMap,Bf=new WeakMap,Wf=new WeakMap,zf=new WeakMap,jf=new WeakMap,Hf=new WeakMap,Uf=new WeakMap,Vf=new WeakMap,Gf=new WeakMap,qf=new WeakMap,Xf=new WeakMap,Yf=new WeakMap,Kf=new WeakMap,Qf=new WeakMap,Zf=new WeakMap,Jf=new WeakMap,$f=new WeakSet;class tm extends Jr{static get _keyboardManager(){const t=tm.prototype;return Pe(this,"_keyboardManager",new dn([[["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]}]]))}constructor(t){super((0,pt.A)((0,pt.A)({},t),{},{name:"highlightEditor"})),ft(this,$f),mt(this,If,null),mt(this,Nf,0),mt(this,Of,void 0),mt(this,Bf,null),mt(this,Wf,null),mt(this,zf,null),mt(this,jf,null),mt(this,Hf,0),mt(this,Uf,null),mt(this,Vf,null),mt(this,Gf,null),mt(this,qf,!1),mt(this,Xf,null),mt(this,Yf,null),mt(this,Kf,null),mt(this,Qf,""),mt(this,Zf,void 0),mt(this,Jf,""),this.color=t.color||tm._defaultColor,yt(Zf,this,t.thickness||tm._defaultThickness),this.opacity=t.opacity||tm._defaultOpacity,yt(Of,this,t.boxes||null),yt(Jf,this,t.methodOfCreation||""),yt(Qf,this,t.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(yt(qf,this,!0),vt($f,this,im).call(this,t),vt($f,this,om).call(this)):bt(Of,this)&&(yt(If,this,t.anchorNode),yt(Nf,this,t.anchorOffset),yt(jf,this,t.focusNode),yt(Hf,this,t.focusOffset),vt($f,this,em).call(this),vt($f,this,om).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}get telemetryInitialData(){return{action:"added",type:bt(qf,this)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:bt(Zf,this),methodOfCreation:bt(Jf,this)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,e){var i;Jr.initialize(t,e),tm._defaultColor||(tm._defaultColor=(null===(i=e.highlightColors)||void 0===i?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(t,e){switch(t){case ee.HIGHLIGHT_COLOR:tm._defaultColor=e;break;case ee.HIGHLIGHT_THICKNESS:tm._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return bt(Yf,this)}get commentButtonPosition(){return bt(Xf,this)}updateParams(t,e){switch(t){case ee.HIGHLIGHT_COLOR:vt($f,this,nm).call(this,e);break;case ee.HIGHLIGHT_THICKNESS:vt($f,this,sm).call(this,e)}}static get defaultPropertiesToUpdate(){return[[ee.HIGHLIGHT_COLOR,tm._defaultColor],[ee.HIGHLIGHT_THICKNESS,tm._defaultThickness]]}get propertiesToUpdate(){return[[ee.HIGHLIGHT_COLOR,this.color||tm._defaultColor],[ee.HIGHLIGHT_THICKNESS,bt(Zf,this)||tm._defaultThickness],[ee.HIGHLIGHT_FREE,bt(qf,this)]]}onUpdatedColor(){var t,e;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(bt(Gf,this),{root:{fill:this.color,"fill-opacity":this.opacity}}),null===(e=bt(Wf,this))||void 0===e||e.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){if(this._uiManager.highlightColors){return[["colorPicker",yt(Wf,this,new lu({editor:this}))]]}return super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(vt($f,this,dm).call(this))}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,vt($f,this,dm).call(this))}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){vt($f,this,am).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(vt($f,this,om).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;if(this.parent&&!t)vt($f,this,am).call(this);else if(t){var i;vt($f,this,om).call(this,t),e=!this.parent&&(null===(i=this.div)||void 0===i?void 0:i.classList.contains("selectedEditor"))}super.setParent(t),this.show(this._isVisible),e&&this.select()}rotate(t){const{drawLayer:e}=this.parent;let i;bt(qf,this)?(t=(t-this.rotation+360)%360,i=lm.call(tm,bt(Vf,this).box,t)):i=lm.call(tm,[this.x,this.y,this.width,this.height],t),e.updateProperties(bt(Gf,this),{bbox:i,root:{"data-main-rotation":t}}),e.updateProperties(bt(Kf,this),{bbox:lm.call(tm,bt(zf,this).box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();bt(Qf,this)&&(t.setAttribute("aria-label",bt(Qf,this)),t.setAttribute("role","mark")),bt(qf,this)?t.classList.add("free"):this.div.addEventListener("keydown",vt($f,this,cm).bind(this),{signal:this._uiManager._signal});const e=yt(Uf,this,document.createElement("div"));return t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=bt(Bf,this),this.setDims(this.width,this.height),Ki(this,bt(Uf,this),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){var t;this.isSelected||(null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(bt(Kf,this),{rootClass:{hovered:!0}}))}pointerleave(){var t;this.isSelected||(null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(bt(Kf,this),{rootClass:{hovered:!1}}))}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:vt($f,this,hm).call(this,!0);break;case 1:case 3:vt($f,this,hm).call(this,!1)}}select(){var t;super.select(),bt(Kf,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(bt(Kf,this),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var t;super.unselect(),bt(Kf,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(bt(Kf,this),{rootClass:{selected:!1}}),bt(qf,this)||vt($f,this,hm).call(this,!1))}get _mustFixPosition(){return!bt(qf,this)}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(bt(Gf,this),{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(bt(Kf,this),{rootClass:{hidden:!t}}))}static startHighlighting(t,e,i){let{target:n,x:s,y:r}=i;const{x:a,y:o,width:l,height:c}=n.getBoundingClientRect(),h=new AbortController,d=t.combinedSignal(h),u=e=>{h.abort(),vt(tm,this,fm).call(this,t,e)};window.addEventListener("blur",u,{signal:d}),window.addEventListener("pointerup",u,{signal:d}),window.addEventListener("pointerdown",ci,{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",li,{signal:d}),n.addEventListener("pointermove",vt(tm,this,gm).bind(this,t),{signal:d}),this._freeHighlight=new Df({x:s,y:r},[a,o,l,c],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0))}static async deserialize(t,e,i){let n=null;if(t instanceof eg){const{data:{quadPoints:e,rect:i,rotation:s,id:r,color:a,opacity:o,popupRef:l,richText:c,contentsObj:h,creationDate:d,modificationDate:u},parent:{page:{pageNumber:p}}}=t;n=t={annotationType:te.HIGHLIGHT,color:Array.from(a),opacity:o,quadPoints:e,boxes:null,pageIndex:p-1,rect:i.slice(0),rotation:s,annotationElementId:r,id:r,deleted:!1,popupRef:l,richText:c,comment:(null===h||void 0===h?void 0:h.str)||null,creationDate:d,modificationDate:u}}else if(t instanceof $p){const{data:{inkLists:e,rect:i,rotation:s,id:r,color:a,borderStyle:{rawWidth:o},popupRef:l,richText:c,contentsObj:h,creationDate:d,modificationDate:u},parent:{page:{pageNumber:p}}}=t;n=t={annotationType:te.HIGHLIGHT,color:Array.from(a),thickness:o,inkLists:e,boxes:null,pageIndex:p-1,rect:i.slice(0),rotation:s,annotationElementId:r,id:r,deleted:!1,popupRef:l,richText:c,comment:(null===h||void 0===h?void 0:h.str)||null,creationDate:d,modificationDate:u}}const{color:s,quadPoints:r,inkLists:a,opacity:o}=t,l=await super.deserialize(t,e,i);l.color=He.makeHexColor(...s),l.opacity=o||1,a&&yt(Zf,l,t.thickness),l._initialData=n,t.comment&&l.setCommentData(t);const[c,h]=l.pageDimensions,[d,u]=l.pageTranslation;if(r){const t=yt(Of,l,[]);for(let e=0;e<r.length;e+=8)t.push({x:(r[e]-d)/c,y:1-(r[e+1]-u)/h,width:(r[e+2]-r[e])/c,height:(r[e+1]-r[e+5])/h});vt($f,l,em).call(l),vt($f,l,om).call(l),l.rotate(l.rotation)}else if(a){yt(qf,l,!0);const t=a[0],i={x:t[0]-d,y:h-(t[1]-u)},n=new Df(i,[0,0,c,h],1,bt(Zf,l)/2,!0,.001);for(let e=0,a=t.length;e<a;e+=2)i.x=t[e]-d,i.y=h-(t[e+1]-u),n.add(i);const{id:s,clipPathId:r}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:l.color,"fill-opacity":l._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:n.toSVGPath()}},!0,!0);vt($f,l,im).call(l,{highlightOutlines:n.getOutlines(),highlightId:s,clipPathId:r}),vt($f,l,om).call(l),l.rotate(l.parentRotation)}return l}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const e=Jr._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i=super.serialize(t);return Object.assign(i,{color:e,opacity:this.opacity,thickness:bt(Zf,this),quadPoints:vt($f,this,um).call(this),outlines:vt($f,this,pm).call(this,i.rect)}),this.addComment(i),this.annotationElementId&&!vt($f,this,mm).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}}function em(){const t=new _f(bt(Of,this),.001);yt(Vf,this,t.getOutlines()),[this.x,this.y,this.width,this.height]=bt(Vf,this).box;const e=new _f(bt(Of,this),.0025,.001,"ltr"===this._uiManager.direction);yt(zf,this,e.getOutlines());const{firstPoint:i}=bt(Vf,this);yt(Xf,this,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]);const{lastPoint:n}=bt(zf,this);yt(Yf,this,[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height])}function im(t){let{highlightOutlines:e,highlightId:i,clipPathId:n}=t;yt(Vf,this,e);if(yt(zf,this,e.getNewOutline(bt(Zf,this)/2+1.5,.0025)),i>=0)yt(Gf,this,i),yt(Bf,this,n),this.parent.drawLayer.finalizeDraw(i,{bbox:e.box,path:{d:e.toSVGPath()}}),yt(Kf,this,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:bt(zf,this).box,path:{d:bt(zf,this).toSVGPath()}},!0));else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(bt(Gf,this),{bbox:lm.call(It,bt(Vf,this).box,(t-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(bt(Kf,this),{bbox:lm.call(It,bt(zf,this).box,t),path:{d:bt(zf,this).toSVGPath()}})}const[s,r,a,o]=e.box;switch(this.rotation){case 0:this.x=s,this.y=r,this.width=a,this.height=o;break;case 90:{const[t,e]=this.parentDimensions;this.x=r,this.y=1-s,this.width=a*e/t,this.height=o*t/e;break}case 180:this.x=1-s,this.y=1-r,this.width=a,this.height=o;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-r,this.y=s,this.width=a*e/t,this.height=o*t/e;break}}const{firstPoint:l}=e;yt(Xf,this,[(l[0]-s)/a,(l[1]-r)/o]);const{lastPoint:c}=bt(zf,this);yt(Yf,this,[(c[0]-s)/a,(c[1]-r)/o])}function nm(t){const e=(t,e)=>{this.color=t,this.opacity=e,this.onUpdatedColor()},i=this.color,n=this.opacity;this.addCommands({cmd:e.bind(this,t,It._defaultOpacity),undo:e.bind(this,i,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ee.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)}function sm(t){const e=bt(Zf,this),i=t=>{yt(Zf,this,t),vt($f,this,rm).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:ee.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}function rm(t){bt(qf,this)&&(vt($f,this,im).call(this,{highlightOutlines:bt(Vf,this).getNewOutline(t/2)}),this.fixAndSetPosition(),this.setDims(this.width,this.height))}function am(){null!==bt(Gf,this)&&this.parent&&(this.parent.drawLayer.remove(bt(Gf,this)),yt(Gf,this,null),this.parent.drawLayer.remove(bt(Kf,this)),yt(Kf,this,null))}function om(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null===bt(Gf,this)&&(({id:ut(yt,[Gf,this])._,clipPathId:ut(yt,[Bf,this])._}=t.drawLayer.draw({bbox:bt(Vf,this).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:bt(qf,this)},path:{d:bt(Vf,this).toSVGPath()}},!1,!0)),yt(Kf,this,t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:bt(qf,this)},bbox:bt(zf,this).box,path:{d:bt(zf,this).toSVGPath()}},bt(qf,this))),bt(Uf,this)&&(bt(Uf,this).style.clipPath=bt(Bf,this)))}function lm(t,e){let[i,n,s,r]=t;switch(e){case 90:return[1-n-r,i,r,s];case 180:return[1-i-s,1-n-r,s,r];case 270:return[n,1-i-s,r,s]}return[i,n,s,r]}function cm(t){It._keyboardManager.exec(this,t)}function hm(t){if(!bt(If,this))return;const e=window.getSelection();t?e.setPosition(bt(If,this),bt(Nf,this)):e.setPosition(bt(jf,this),bt(Hf,this))}function dm(){return bt(qf,this)?this.rotation:0}function um(){if(bt(qf,this))return null;const[t,e]=this.pageDimensions,[i,n]=this.pageTranslation,s=bt(Of,this),r=new Float32Array(8*s.length);let a=0;for(const{x:o,y:l,width:c,height:h}of s){const s=o*t+i,d=(1-l)*e+n;r[a]=r[a+4]=s,r[a+1]=r[a+3]=d,r[a+2]=r[a+6]=s+c*t,r[a+5]=r[a+7]=d-h*e,a+=8}return r}function pm(t){return bt(Vf,this).serialize(t,vt($f,this,dm).call(this))}function gm(t,e){this._freeHighlight.add(e)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}function fm(t,e){this._freeHighlight.isEmpty()?t.drawLayer.remove(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=""}function mm(t){const{color:e}=this._initialData;return this.hasEditedComment||t.color.some((t,i)=>t!==e[i])}It=tm,(0,Wt.A)(tm,"_defaultColor",null),(0,Wt.A)(tm,"_defaultOpacity",1),(0,Wt.A)(tm,"_defaultThickness",12),(0,Wt.A)(tm,"_type","highlight"),(0,Wt.A)(tm,"_editorType",te.HIGHLIGHT),(0,Wt.A)(tm,"_freeHighlightId",-1),(0,Wt.A)(tm,"_freeHighlight",null),(0,Wt.A)(tm,"_freeHighlightClipId","");var vm=new WeakMap;class wm{constructor(){mt(this,vm,Object.create(null))}updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(const[e,i]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,i)}updateSVGProperty(t,e){bt(vm,this)[t]=e}toSVGProperties(){const t=bt(vm,this);return yt(vm,this,Object.create(null)),{root:t}}reset(){yt(vm,this,Object.create(null))}updateAll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;this.updateProperties(t)}clone(){Ce("Not implemented")}}var bm=new WeakMap,ym=new WeakMap,Am=new WeakSet;class Em extends Jr{constructor(t){super(t),ft(this,Am),mt(this,bm,null),mt(this,ym,void 0),(0,Wt.A)(this,"_colorPicker",null),(0,Wt.A)(this,"_drawId",null),yt(ym,this,t.mustBeCommitted||!1),this._addOutlines(t)}onUpdatedColor(){var t;null===(t=this._colorPicker)||void 0===t||t.update(this.color),super.onUpdatedColor()}_addOutlines(t){t.drawOutlines&&(vt(Am,this,xm).call(this,t),vt(Am,this,Cm).call(this))}static _mergeSVGProperties(t,e){const i=new Set(Object.keys(t));for(const[n,s]of Object.entries(e))i.has(n)?Object.assign(t[n],s):t[n]=s;return t}static getDefaultDrawingOptions(t){Ce("Not implemented")}static get typesMap(){Ce("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,e){const i=this.typesMap.get(t);i&&this._defaultDrawingOptions.updateProperty(i,e),this._currentParent&&(Lm._.updateProperty(i,e),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,e){const i=this.constructor.typesMap.get(t);i&&this._updateProperty(t,i,e)}static get defaultPropertiesToUpdate(){const t=[],e=this._defaultDrawingOptions;for(const[i,n]of this.typesMap)t.push([i,e[n]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:e}=this;for(const[i,n]of this.constructor.typesMap)t.push([i,e[n]]);return t}_updateProperty(t,e,i){const n=this._drawingOptions,s=n[e],r=i=>{var s;n.updateProperty(e,i);const r=bt(bm,this).updateProperty(e,i);r&&vt(Am,this,Tm).call(this,r),null===(s=this.parent)||void 0===s||s.drawLayer.updateProperties(this._drawId,n.toSVGProperties()),t===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:r.bind(this,i),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,Em._mergeSVGProperties(bt(bm,this).getPathResizingSVGProperties(vt(Am,this,Mm).call(this)),{bbox:vt(Am,this,Pm).call(this)}))}_onResized(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,Em._mergeSVGProperties(bt(bm,this).getPathResizedSVGProperties(vt(Am,this,Mm).call(this)),{bbox:vt(Am,this,Pm).call(this)}))}_onTranslating(t,e){var i;null===(i=this.parent)||void 0===i||i.drawLayer.updateProperties(this._drawId,{bbox:vt(Am,this,Pm).call(this)})}_onTranslated(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,Em._mergeSVGProperties(bt(bm,this).getPathTranslatedSVGProperties(vt(Am,this,Mm).call(this),this.parentDimensions),{bbox:vt(Am,this,Pm).call(this)}))}_onStartDragging(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,bt(ym,this)&&(yt(ym,this,!1),this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){vt(Am,this,km).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(vt(Am,this,Cm).call(this),vt(Am,this,Tm).call(this,bt(bm,this).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;if(this.parent&&!t)this._uiManager.removeShouldRescale(this),vt(Am,this,km).call(this);else if(t){var i;this._uiManager.addShouldRescale(this),vt(Am,this,Cm).call(this,t),e=!this.parent&&(null===(i=this.div)||void 0===i?void 0:i.classList.contains("selectedEditor"))}super.setParent(t),e&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Em._mergeSVGProperties({bbox:vt(Am,this,Pm).call(this)},bt(bm,this).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&vt(Am,this,Tm).call(this,bt(bm,this).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,e;this._isCopy&&(t=this.x,e=this.y);const i=super.render();i.classList.add("draw");const n=document.createElement("div");return i.append(n),n.setAttribute("aria-hidden","true"),n.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,e),i}static createDrawerInstance(t,e,i,n,s){Ce("Not implemented")}static startDrawing(t,e,i,n){var s,r;const{target:a,offsetX:o,offsetY:l,pointerId:c,pointerType:h}=n;if(Im._&&Im._!==h)return;const{viewport:{rotation:d}}=t,{width:u,height:p}=a.getBoundingClientRect(),g=Rm._=new AbortController,f=t.combinedSignal(g);Fm._||(Fm._=c),null!==(s=Im._)&&void 0!==s||(Im._=h),window.addEventListener("pointerup",t=>{var e;Fm._===t.pointerId?this._endDraw(t):null===(e=Nm._)||void 0===e||e.delete(t.pointerId)},{signal:f}),window.addEventListener("pointercancel",t=>{var e;Fm._===t.pointerId?this._currentParent.endDrawingSession():null===(e=Nm._)||void 0===e||e.delete(t.pointerId)},{signal:f}),window.addEventListener("pointerdown",t=>{Im._===t.pointerType&&((Nm._||(Nm._=new Set)).add(t.pointerId),Lm._.isCancellable()&&(Lm._.removeLastElement(),Lm._.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:f}),window.addEventListener("contextmenu",li,{signal:f}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:f}),a.addEventListener("touchmove",t=>{t.timeStamp===Om._&&ci(t)},{signal:f}),t.toggleDrawing(),null===(r=e._editorUndoBar)||void 0===r||r.hide(),Lm._?t.drawLayer.updateProperties(this._currentDrawId,Lm._.startNew(o,l,u,p,d)):(e.updateUIForDefaultProperties(this),Lm._=this.createDrawerInstance(o,l,u,p,d),Dm._=this.getDefaultDrawingOptions(),this._currentParent=t,({id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(Dm._.toSVGProperties(),Lm._.defaultSVGProperties),!0,!1)))}static _drawMove(t){var e;if(Om._=-1,!Lm._)return;const{offsetX:i,offsetY:n,pointerId:s}=t;Fm._===s&&((null===(e=Nm._)||void 0===e?void 0:e.size)>=1?this._endDraw(t):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,Lm._.add(i,n)),Om._=t.timeStamp,ci(t)))}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,Lm._=null,Dm._=null,Im._=null,Om._=NaN),Rm._&&(Rm._.abort(),Rm._=null,Fm._=NaN,Nm._=null)}static _endDraw(t){const e=this._currentParent;if(e){if(e.toggleDrawing(!0),this._cleanup(!1),(null===t||void 0===t?void 0:t.target)===e.div&&e.drawLayer.updateProperties(this._currentDrawId,Lm._.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const t=Lm._,i=this._currentDrawId,n=t.getLastElement();return void e.addCommands({cmd:()=>{e.drawLayer.updateProperties(i,t.setLastElement(n))},undo:()=>{e.drawLayer.updateProperties(i,t.removeLastElement())},mustExec:!1,type:ee.DRAW_STEP})}this.endDrawing(!1)}}static endDrawing(t){const e=this._currentParent;if(!e)return null;if(e.toggleDrawing(!0),e.cleanUndoStack(ee.DRAW_STEP),!Lm._.isEmpty()){const{pageDimensions:[i,n],scale:s}=e,r=e.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:Lm._.getOutlines(i*s,n*s,s,this._INNER_MARGIN),drawingOptions:Dm._,mustBeCommitted:!t});return this._cleanup(!0),r}return e.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,e,i,n,s,r){Ce("Not implemented")}static async deserialize(t,e,i){const{rawDims:{pageWidth:n,pageHeight:s,pageX:r,pageY:a}}=e.viewport,o=this.deserializeDraw(r,a,n,s,this._INNER_MARGIN,t),l=await super.deserialize(t,e,i);return l.createDrawingOptions(t),vt(Am,l,xm).call(l,{drawOutlines:o}),vt(Am,l,Cm).call(l),l.onScaleChanging(),l.rotate(),l}serializeDraw(t){const[e,i]=this.pageTranslation,[n,s]=this.pageDimensions;return bt(bm,this).serialize([e,i,n,s],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}}function xm(t){let{drawOutlines:e,drawId:i,drawingOptions:n}=t;yt(bm,this,e),this._drawingOptions||(this._drawingOptions=n),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-".concat(this.editorType,"-added-alert")),i>=0?(this._drawId=i,this.parent.drawLayer.finalizeDraw(i,e.defaultProperties)):this._drawId=vt(Am,this,_m).call(this,e,this.parent),vt(Am,this,Tm).call(this,e.box)}function _m(t,e){const{id:i}=e.drawLayer.draw(Nt._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return i}function km(){null!==this._drawId&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}function Cm(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null!==this._drawId&&this.parent===t||(null===this._drawId?(this._drawingOptions.updateAll(),this._drawId=vt(Am,this,_m).call(this,bt(bm,this),t)):this.parent.drawLayer.updateParent(this._drawId,t.drawLayer))}function Sm(t){let[e,i,n,s]=t;const{parentDimensions:[r,a],rotation:o}=this;switch(o){case 90:return[i,1-e,n*(a/r),s*(r/a)];case 180:return[1-e,1-i,n,s];case 270:return[1-i,e,n*(a/r),s*(r/a)];default:return[e,i,n,s]}}function Mm(){const{x:t,y:e,width:i,height:n,parentDimensions:[s,r],rotation:a}=this;switch(a){case 90:return[1-e,t,i*(s/r),n*(r/s)];case 180:return[1-t,1-e,i,n];case 270:return[e,1-t,i*(s/r),n*(r/s)];default:return[t,e,i,n]}}function Tm(t){[this.x,this.y,this.width,this.height]=vt(Am,this,Sm).call(this,t),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}function Pm(){const{x:t,y:e,width:i,height:n,rotation:s,parentRotation:r,parentDimensions:[a,o]}=this;switch((4*s+r)/90){case 1:return[1-e-n,t,n,i];case 2:return[1-t-i,1-e-n,i,n];case 3:return[e,1-t-i,n,i];case 4:return[t,e-i*(a/o),n*(o/a),i*(a/o)];case 5:return[1-e,t,i*(a/o),n*(o/a)];case 6:return[1-t-n*(o/a),1-e,n*(o/a),i*(a/o)];case 7:return[e-i*(a/o),1-t-n*(o/a),i*(a/o),n*(o/a)];case 8:return[t-i,e-n,i,n];case 9:return[1-e,t-i,n,i];case 10:return[1-t,1-e,i,n];case 11:return[e-n,1-t,n,i];case 12:return[t-n*(o/a),e,n*(o/a),i*(a/o)];case 13:return[1-e-i*(a/o),t-n*(o/a),i*(a/o),n*(o/a)];case 14:return[1-t,1-e-i*(a/o),n*(o/a),i*(a/o)];case 15:return[e,1-t,i*(a/o),n*(o/a)];default:return[t,e,i,n]}}Nt=Em,(0,Wt.A)(Em,"_currentDrawId",-1),(0,Wt.A)(Em,"_currentParent",null);var Lm={_:null},Rm={_:null},Dm={_:null},Fm={_:NaN},Im={_:null},Nm={_:null},Om={_:NaN};(0,Wt.A)(Em,"_INNER_MARGIN",3);var Bm=new WeakMap,Wm=new WeakMap,zm=new WeakMap,jm=new WeakMap,Hm=new WeakMap,Um=new WeakMap,Vm=new WeakMap,Gm=new WeakMap,qm=new WeakMap,Xm=new WeakMap,Ym=new WeakMap,Km=new WeakSet;class Qm{constructor(t,e,i,n,s,r){ft(this,Km),mt(this,Bm,new Float64Array(6)),mt(this,Wm,void 0),mt(this,zm,void 0),mt(this,jm,void 0),mt(this,Hm,void 0),mt(this,Um,void 0),mt(this,Vm,""),mt(this,Gm,0),mt(this,qm,new lv),mt(this,Xm,void 0),mt(this,Ym,void 0),yt(Xm,this,i),yt(Ym,this,n),yt(jm,this,s),yt(Hm,this,r),[t,e]=vt(Km,this,Zm).call(this,t,e);const a=yt(Wm,this,[NaN,NaN,NaN,NaN,t,e]);yt(Um,this,[t,e]),yt(zm,this,[{line:a,points:bt(Um,this)}]),bt(Bm,this).set(a,0)}updateProperty(t,e){"stroke-width"===t&&yt(Hm,this,e)}isEmpty(){return!bt(zm,this)||0===bt(zm,this).length}isCancellable(){return bt(Um,this).length<=10}add(t,e){[t,e]=vt(Km,this,Zm).call(this,t,e);const[i,n,s,r]=bt(Bm,this).subarray(2,6),a=t-s,o=e-r;return Math.hypot(bt(Xm,this)*a,bt(Ym,this)*o)<=2?null:(bt(Um,this).push(t,e),isNaN(i)?(bt(Bm,this).set([s,r,t,e],2),bt(Wm,this).push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(bt(Bm,this)[0])&&bt(Wm,this).splice(6,6),bt(Bm,this).set([i,n,s,r,t,e],0),bt(Wm,this).push(...Ng.createBezierPoints(i,n,s,r,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){const i=this.add(t,e);return i||(2===bt(Um,this).length?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,i,n,s){yt(Xm,this,i),yt(Ym,this,n),yt(jm,this,s),[t,e]=vt(Km,this,Zm).call(this,t,e);const r=yt(Wm,this,[NaN,NaN,NaN,NaN,t,e]);yt(Um,this,[t,e]);const a=bt(zm,this).at(-1);return a&&(a.line=new Float32Array(a.line),a.points=new Float32Array(a.points)),bt(zm,this).push({line:r,points:bt(Um,this)}),bt(Bm,this).set(r,0),yt(Gm,this,0),this.toSVGPath(),null}getLastElement(){return bt(zm,this).at(-1)}setLastElement(t){return bt(zm,this)?(bt(zm,this).push(t),yt(Wm,this,t.line),yt(Um,this,t.points),yt(Gm,this,0),{path:{d:this.toSVGPath()}}):bt(qm,this).setLastElement(t)}removeLastElement(){if(!bt(zm,this))return bt(qm,this).removeLastElement();bt(zm,this).pop(),yt(Vm,this,"");for(let t=0,e=bt(zm,this).length;t<e;t++){const{line:e,points:i}=bt(zm,this)[t];yt(Wm,this,e),yt(Um,this,i),yt(Gm,this,0),this.toSVGPath()}return{path:{d:bt(Vm,this)}}}toSVGPath(){const t=Ng.svgRound(bt(Wm,this)[4]),e=Ng.svgRound(bt(Wm,this)[5]);if(2===bt(Um,this).length)return yt(Vm,this,"".concat(bt(Vm,this)," M ").concat(t," ").concat(e," Z")),bt(Vm,this);if(bt(Um,this).length<=6){const i=bt(Vm,this).lastIndexOf("M");yt(Vm,this,"".concat(bt(Vm,this).slice(0,i)," M ").concat(t," ").concat(e)),yt(Gm,this,6)}if(4===bt(Um,this).length){const t=Ng.svgRound(bt(Wm,this)[10]),e=Ng.svgRound(bt(Wm,this)[11]);return yt(Vm,this,"".concat(bt(Vm,this)," L ").concat(t," ").concat(e)),yt(Gm,this,12),bt(Vm,this)}const i=[];0===bt(Gm,this)&&(i.push("M ".concat(t," ").concat(e)),yt(Gm,this,6));for(let n=bt(Gm,this),s=bt(Wm,this).length;n<s;n+=6){const[t,e,s,r,a,o]=bt(Wm,this).slice(n,n+6).map(Ng.svgRound);i.push("C".concat(t," ").concat(e," ").concat(s," ").concat(r," ").concat(a," ").concat(o))}return yt(Vm,this,bt(Vm,this)+i.join(" ")),yt(Gm,this,bt(Wm,this).length),bt(Vm,this)}getOutlines(t,e,i,n){const s=bt(zm,this).at(-1);return s.line=new Float32Array(s.line),s.points=new Float32Array(s.points),bt(qm,this).build(bt(zm,this),t,e,i,bt(jm,this),bt(Hm,this),n),yt(Bm,this,null),yt(Wm,this,null),yt(zm,this,null),yt(Vm,this,null),bt(qm,this)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}function Zm(t,e){return Ng._normalizePoint(t,e,bt(Xm,this),bt(Ym,this),bt(jm,this))}var Jm=new WeakMap,$m=new WeakMap,tv=new WeakMap,ev=new WeakMap,iv=new WeakMap,nv=new WeakMap,sv=new WeakMap,rv=new WeakMap,av=new WeakMap,ov=new WeakSet;class lv extends Ng{constructor(){super(...arguments),ft(this,ov),mt(this,Jm,void 0),mt(this,$m,0),mt(this,tv,void 0),mt(this,ev,void 0),mt(this,iv,void 0),mt(this,nv,void 0),mt(this,sv,void 0),mt(this,rv,void 0),mt(this,av,void 0)}build(t,e,i,n,s,r,a){yt(iv,this,e),yt(nv,this,i),yt(sv,this,n),yt(rv,this,s),yt(av,this,r),yt(tv,this,null!==a&&void 0!==a?a:0),yt(ev,this,t),vt(ov,this,dv).call(this)}get thickness(){return bt(av,this)}setLastElement(t){return bt(ev,this).push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return bt(ev,this).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:e}of bt(ev,this))if(t.push("M".concat(Ng.svgRound(e[4])," ").concat(Ng.svgRound(e[5]))),6!==e.length)if(12===e.length&&isNaN(e[6]))t.push("L".concat(Ng.svgRound(e[10])," ").concat(Ng.svgRound(e[11])));else for(let i=6,n=e.length;i<n;i+=6){const[n,s,r,a,o,l]=e.subarray(i,i+6).map(Ng.svgRound);t.push("C".concat(n," ").concat(s," ").concat(r," ").concat(a," ").concat(o," ").concat(l))}else t.push("Z");return t.join("")}serialize(t,e){let[i,n,s,r]=t;const a=[],o=[],[l,c,h,d]=vt(ov,this,hv).call(this);let u,p,g,f,m,v,w,b,y;switch(bt(rv,this)){case 0:y=Ng._rescale,u=i,p=n+r,g=s,f=-r,m=i+l*s,v=n+(1-c-d)*r,w=i+(l+h)*s,b=n+(1-c)*r;break;case 90:y=Ng._rescaleAndSwap,u=i,p=n,g=s,f=r,m=i+c*s,v=n+l*r,w=i+(c+d)*s,b=n+(l+h)*r;break;case 180:y=Ng._rescale,u=i+s,p=n,g=-s,f=r,m=i+(1-l-h)*s,v=n+c*r,w=i+(1-l)*s,b=n+(c+d)*r;break;case 270:y=Ng._rescaleAndSwap,u=i+s,p=n+r,g=-s,f=-r,m=i+(1-c-d)*s,v=n+(1-l-h)*r,w=i+(1-c)*s,b=n+(1-l)*r}for(const{line:A,points:E}of bt(ev,this))a.push(y(A,u,p,g,f,e?new Array(A.length):null)),o.push(y(E,u,p,g,f,e?new Array(E.length):null));return{lines:a,points:o,rect:[m,v,w,b]}}static deserialize(t,e,i,n,s,r){let{paths:{lines:a,points:o},rotation:l,thickness:c}=r;const h=[];let d,u,p,g,f;switch(l){case 0:f=Ng._rescale,d=-t/i,u=e/n+1,p=1/i,g=-1/n;break;case 90:f=Ng._rescaleAndSwap,d=-e/n,u=-t/i,p=1/n,g=1/i;break;case 180:f=Ng._rescale,d=t/i+1,u=-e/n,p=-1/i,g=1/n;break;case 270:f=Ng._rescaleAndSwap,d=e/n+1,u=t/i+1,p=-1/n,g=-1/i}if(!a){a=[];for(const t of o){const e=t.length;if(2===e){a.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1]]));continue}if(4===e){a.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1],NaN,NaN,NaN,NaN,t[2],t[3]]));continue}const i=new Float32Array(3*(e-2));a.push(i);let[n,s,r,o]=t.subarray(0,4);i.set([NaN,NaN,NaN,NaN,n,s],0);for(let a=4;a<e;a+=2){const e=t[a],l=t[a+1];i.set(Ng.createBezierPoints(n,s,r,o,e,l),3*(a-2)),[n,s,r,o]=[r,o,e,l]}}}for(let v=0,w=a.length;v<w;v++)h.push({line:f(a[v].map(t=>null!==t&&void 0!==t?t:NaN),d,u,p,g),points:f(o[v].map(t=>null!==t&&void 0!==t?t:NaN),d,u,p,g)});const m=new this.prototype.constructor;return m.build(h,i,n,1,l,c,s),m}get box(){return bt(Jm,this)}updateProperty(t,e){return"stroke-width"===t?vt(ov,this,uv).call(this,e):null}updateParentDimensions(t,e){let[i,n]=t;const[s,r]=vt(ov,this,cv).call(this);yt(iv,this,i),yt(nv,this,n),yt(sv,this,e);const[a,o]=vt(ov,this,cv).call(this),l=a-s,c=o-r,h=bt(Jm,this);return h[0]-=l,h[1]-=c,h[2]+=2*l,h[3]+=2*c,h}updateRotation(t){return yt($m,this,t),{path:{transform:this.rotationTransform}}}get viewBox(){return bt(Jm,this).map(Ng.svgRound).join(" ")}get defaultProperties(){const[t,e]=bt(Jm,this);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(Ng.svgRound(t)," ").concat(Ng.svgRound(e))}}}get rotationTransform(){const[,,t,e]=bt(Jm,this);let i=0,n=0,s=0,r=0,a=0,o=0;switch(bt($m,this)){case 90:n=e/t,s=-t/e,a=t;break;case 180:i=-1,r=-1,a=t,o=e;break;case 270:n=-e/t,s=t/e,o=e;break;default:return""}return"matrix(".concat(i," ").concat(n," ").concat(s," ").concat(r," ").concat(Ng.svgRound(a)," ").concat(Ng.svgRound(o),")")}getPathResizingSVGProperties(t){let[e,i,n,s]=t;const[r,a]=vt(ov,this,cv).call(this),[o,l,c,h]=bt(Jm,this);if(Math.abs(c-r)<=Ng.PRECISION||Math.abs(h-a)<=Ng.PRECISION){const t=e+n/2-(o+c/2),r=i+s/2-(l+h/2);return{path:{"transform-origin":"".concat(Ng.svgRound(e)," ").concat(Ng.svgRound(i)),transform:"".concat(this.rotationTransform," translate(").concat(t," ").concat(r,")")}}}const d=(n-2*r)/(c-2*r),u=(s-2*a)/(h-2*a),p=c/n,g=h/s;return{path:{"transform-origin":"".concat(Ng.svgRound(o)," ").concat(Ng.svgRound(l)),transform:"".concat(this.rotationTransform," scale(").concat(p," ").concat(g,") ")+"translate(".concat(Ng.svgRound(r)," ").concat(Ng.svgRound(a),") scale(").concat(d," ").concat(u,") ")+"translate(".concat(Ng.svgRound(-r)," ").concat(Ng.svgRound(-a),")")}}}getPathResizedSVGProperties(t){let[e,i,n,s]=t;const[r,a]=vt(ov,this,cv).call(this),o=bt(Jm,this),[l,c,h,d]=o;if(o[0]=e,o[1]=i,o[2]=n,o[3]=s,Math.abs(h-r)<=Ng.PRECISION||Math.abs(d-a)<=Ng.PRECISION){const t=e+n/2-(l+h/2),r=i+s/2-(c+d/2);for(const{line:e,points:i}of bt(ev,this))Ng._translate(e,t,r,e),Ng._translate(i,t,r,i);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(Ng.svgRound(e)," ").concat(Ng.svgRound(i)),transform:this.rotationTransform||null,d:this.toSVGPath()}}}const u=(n-2*r)/(h-2*r),p=(s-2*a)/(d-2*a),g=-u*(l+r)+e+r,f=-p*(c+a)+i+a;if(1!==u||1!==p||0!==g||0!==f)for(const{line:m,points:v}of bt(ev,this))Ng._rescale(m,g,f,u,p,m),Ng._rescale(v,g,f,u,p,v);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(Ng.svgRound(e)," ").concat(Ng.svgRound(i)),transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties(t,e){let[i,n]=t;const[s,r]=e,a=bt(Jm,this),o=i-a[0],l=n-a[1];if(bt(iv,this)===s&&bt(nv,this)===r)for(const{line:c,points:h}of bt(ev,this))Ng._translate(c,o,l,c),Ng._translate(h,o,l,h);else{const t=bt(iv,this)/s,e=bt(nv,this)/r;yt(iv,this,s),yt(nv,this,r);for(const{line:i,points:n}of bt(ev,this))Ng._rescale(i,o,l,t,e,i),Ng._rescale(n,o,l,t,e,n);a[2]*=t,a[3]*=e}return a[0]=i,a[1]=n,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":"".concat(Ng.svgRound(i)," ").concat(Ng.svgRound(n))}}}get defaultSVGProperties(){const t=bt(Jm,this);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":"".concat(Ng.svgRound(t[0])," ").concat(Ng.svgRound(t[1])),transform:this.rotationTransform||null},bbox:t}}}function cv(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bt(av,this);const e=bt(tv,this)+t/2*bt(sv,this);return bt(rv,this)%180===0?[e/bt(iv,this),e/bt(nv,this)]:[e/bt(nv,this),e/bt(iv,this)]}function hv(){const[t,e,i,n]=bt(Jm,this),[s,r]=vt(ov,this,cv).call(this,0);return[t+s,e+r,i-2*s,n-2*r]}function dv(){const t=yt(Jm,this,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:n}of bt(ev,this)){if(n.length<=12){for(let e=4,i=n.length;e<i;e+=6)He.pointBoundingBox(n[e],n[e+1],t);continue}let e=n[4],i=n[5];for(let s=6,r=n.length;s<r;s+=6){const[r,a,o,l,c,h]=n.subarray(s,s+6);He.bezierBoundingBox(e,i,r,a,o,l,c,h,t),e=c,i=h}}const[e,i]=vt(ov,this,cv).call(this);t[0]=Ke(t[0]-e,0,1),t[1]=Ke(t[1]-i,0,1),t[2]=Ke(t[2]+e,0,1),t[3]=Ke(t[3]+i,0,1),t[2]-=t[0],t[3]-=t[1]}function uv(t){const[e,i]=vt(ov,this,cv).call(this);yt(av,this,t);const[n,s]=vt(ov,this,cv).call(this),[r,a]=[n-e,s-i],o=bt(Jm,this);return o[0]-=r,o[1]-=a,o[2]+=2*r,o[3]+=2*a,o}class pv extends wm{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:Jr._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,e){"stroke-width"===t&&(null!==e&&void 0!==e||(e=this["stroke-width"]),e*=this._viewParameters.realScale),super.updateSVGProperty(t,e)}clone(){const t=new pv(this._viewParameters);return t.updateAll(this),t}}var gv=new WeakSet;class fv extends Em{constructor(t){super((0,pt.A)((0,pt.A)({},t),{},{name:"inkEditor"})),ft(this,gv),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,e){Jr.initialize(t,e),this._defaultDrawingOptions=new pv(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!0}static get typesMap(){return Pe(this,"typesMap",new Map([[ee.INK_THICKNESS,"stroke-width"],[ee.INK_COLOR,"stroke"],[ee.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,e,i,n,s){return new Qm(t,e,i,n,s,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,e,i,n,s,r){return lv.deserialize(t,e,i,n,s,r)}static async deserialize(t,e,i){let n=null;if(t instanceof $p){const{data:{inkLists:e,rect:i,rotation:s,id:r,color:a,opacity:o,borderStyle:{rawWidth:l},popupRef:c,richText:h,contentsObj:d,creationDate:u,modificationDate:p},parent:{page:{pageNumber:g}}}=t;n=t={annotationType:te.INK,color:Array.from(a),thickness:l,opacity:o,paths:{points:e},boxes:null,pageIndex:g-1,rect:i.slice(0),rotation:s,annotationElementId:r,id:r,deleted:!1,popupRef:c,richText:h,comment:(null===d||void 0===d?void 0:d.str)||null,creationDate:u,modificationDate:p}}const s=await super.deserialize(t,e,i);return s._initialData=n,t.comment&&s.setCommentData(t),s}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new bu(this)),[["colorPicker",this._colorPicker]]}get colorType(){return ee.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:e,parent:i}=this;e.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(t,e.toSVGProperties())}static onScaleChangingWhenDrawing(){const t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions(t){let{color:e,thickness:i,opacity:n}=t;this._drawingOptions=fv.getDefaultDrawingOptions({stroke:He.makeHexColor(...e),"stroke-width":i,"stroke-opacity":n})}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:e,points:i}=this.serializeDraw(t),{_drawingOptions:{stroke:n,"stroke-opacity":s,"stroke-width":r}}=this,a=Object.assign(super.serialize(t),{color:Jr._colorManager.convert(n),opacity:s,thickness:r,paths:{lines:e,points:i}});return this.addComment(a),t?(a.isCopy=!0,a):this.annotationElementId&&!vt(gv,this,mv).call(this,a)?null:(a.id=this.annotationElementId,a)}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;const{points:e,rect:i}=this.serializeDraw(!1);return t.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:e,popup:this.comment}),null}}function mv(t){const{color:e,thickness:i,opacity:n,pageIndex:s}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||t.color.some((t,i)=>t!==e[i])||t.thickness!==i||t.opacity!==n||t.pageIndex!==s}(0,Wt.A)(fv,"_type","ink"),(0,Wt.A)(fv,"_editorType",te.INK),(0,Wt.A)(fv,"_defaultDrawingOptions",null);class vv extends lv{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}class wv{static extractContoursFromText(t,e,i,n,s,r){let{fontFamily:a,fontStyle:o,fontWeight:l}=e,c=new OffscreenCanvas(1,1),h=c.getContext("2d",{alpha:!1});const d=h.font="".concat(o," ").concat(l," ").concat(200,"px ").concat(a),{actualBoundingBoxLeft:u,actualBoundingBoxRight:p,actualBoundingBoxAscent:g,actualBoundingBoxDescent:f,fontBoundingBoxAscent:m,fontBoundingBoxDescent:v,width:w}=h.measureText(t),b=1.5,y=Math.ceil(Math.max(Math.abs(u)+Math.abs(p)||0,w)*b),A=Math.ceil(Math.max(Math.abs(g)+Math.abs(f)||200,Math.abs(m)+Math.abs(v)||200)*b);c=new OffscreenCanvas(y,A),h=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),h.font=d,h.filter="grayscale(1)",h.fillStyle="white",h.fillRect(0,0,y,A),h.fillStyle="black",h.fillText(t,.5*y/2,1.5*A/2);const E=vt(wv,this,Sv).call(this,h.getImageData(0,0,y,A).data),x=vt(wv,this,Cv).call(this,E),_=vt(wv,this,Mv).call(this,x),k=vt(wv,this,Ev).call(this,E,y,A,_);return this.processDrawnLines({lines:{curves:k,width:y,height:A},pageWidth:i,pageHeight:n,rotation:s,innerMargin:r,mustSmooth:!0,areContours:!0})}static process(t,e,i,n,s){const[r,a,o]=vt(wv,this,Tv).call(this,t),[l,c]=vt(wv,this,kv).call(this,r,a,o,Math.hypot(a,o)*vt(wv,this,Pv)._.sigmaSFactor,vt(wv,this,Pv)._.sigmaR,vt(wv,this,Pv)._.kernelSize),h=vt(wv,this,Mv).call(this,c),d=vt(wv,this,Ev).call(this,l,a,o,h);return this.processDrawnLines({lines:{curves:d,width:a,height:o},pageWidth:e,pageHeight:i,rotation:n,innerMargin:s,mustSmooth:!0,areContours:!0})}static processDrawnLines(t){var e;let{lines:i,pageWidth:n,pageHeight:s,rotation:r,innerMargin:a,mustSmooth:o,areContours:l}=t;r%180!==0&&([n,s]=[s,n]);const{curves:c,width:h,height:d}=i,u=null!==(e=i.thickness)&&void 0!==e?e:0,p=[],g=Math.min(n/h,s/d),f=g/n,m=g/s,v=[];for(const{points:b}of c){const t=o?vt(wv,this,_v).call(this,b):b;if(!t)continue;v.push(t);const e=t.length,i=new Float32Array(e),n=new Float32Array(3*(2===e?2:e-2));if(p.push({line:n,points:i}),2===e){i[0]=t[0]*f,i[1]=t[1]*m,n.set([NaN,NaN,NaN,NaN,i[0],i[1]],0);continue}let[s,r,a,l]=t;s*=f,r*=m,a*=f,l*=m,i.set([s,r,a,l],0),n.set([NaN,NaN,NaN,NaN,s,r],0);for(let o=4;o<e;o+=2){const e=i[o]=t[o]*f,c=i[o+1]=t[o+1]*m;n.set(Ng.createBezierPoints(s,r,a,l,e,c),3*(o-2)),[s,r,a,l]=[a,l,e,c]}}if(0===p.length)return null;const w=l?new vv:new lv;return w.build(p,n,s,1,r,l?0:u,a),{outline:w,newCurves:v,areContours:l,thickness:u,width:h,height:d}}static async compressSignature(t){let e,{outlines:i,areContours:n,thickness:s,width:r,height:a}=t,o=1/0,l=-1/0,c=0;for(const w of i){c+=w.length;for(let t=2,e=w.length;t<e;t++){const e=w[t]-w[t-2];o=Math.min(o,e),l=Math.max(l,e)}}e=o>=-128&&l<=127?Int8Array:o>=-32768&&l<=32767?Int16Array:Int32Array;const h=i.length,d=8+3*h,u=new Uint32Array(d);let p=0;u[p++]=d*Uint32Array.BYTES_PER_ELEMENT+(c-2*h)*e.BYTES_PER_ELEMENT,u[p++]=0,u[p++]=r,u[p++]=a,u[p++]=n?0:1,u[p++]=Math.max(0,Math.floor(null!==s&&void 0!==s?s:0)),u[p++]=h,u[p++]=e.BYTES_PER_ELEMENT;for(const w of i)u[p++]=w.length-2,u[p++]=w[0],u[p++]=w[1];const g=new CompressionStream("deflate-raw"),f=g.writable.getWriter();await f.ready,f.write(u);const m=e.prototype.constructor;for(const w of i){const t=new m(w.length-2);for(let e=2,i=w.length;e<i;e++)t[e-2]=w[e]-w[e-2];f.write(t)}f.close();const v=await new Response(g.readable).arrayBuffer();return Qe(new Uint8Array(v))}static async decompressSignature(t){try{const l=(a=t,Uint8Array.fromBase64?Uint8Array.fromBase64(a):We(atob(a))),{readable:c,writable:h}=new DecompressionStream("deflate-raw"),d=h.getWriter();await d.ready,d.write(l).then(async()=>{await d.ready,await d.close()}).catch(()=>{});let u=null,p=0;var e,i=!1,n=!1;try{for(var s,r=(0,zt.A)(c);i=!(s=await r.next()).done;i=!1){const t=s.value;u||(u=new Uint8Array(new Uint32Array(t.buffer,0,4)[0])),u.set(t,p),p+=t.length}}catch(o){n=!0,e=o}finally{try{i&&null!=r.return&&await r.return()}finally{if(n)throw e}}const g=new Uint32Array(u.buffer,0,u.length>>2),f=g[1];if(0!==f)throw new Error("Invalid version: ".concat(f));const m=g[2],v=g[3],w=0===g[4],b=g[5],y=g[6],A=g[7],E=[],x=(8+3*y)*Uint32Array.BYTES_PER_ELEMENT;let _;switch(A){case Int8Array.BYTES_PER_ELEMENT:_=new Int8Array(u.buffer,x);break;case Int16Array.BYTES_PER_ELEMENT:_=new Int16Array(u.buffer,x);break;case Int32Array.BYTES_PER_ELEMENT:_=new Int32Array(u.buffer,x)}p=0;for(let t=0;t<y;t++){const e=g[3*t+8],i=new Float32Array(e+2);E.push(i);for(let n=0;n<2;n++)i[n]=g[3*t+8+n+1];for(let t=0;t<e;t++)i[t+2]=i[t]+_[p++]}return{areContours:w,thickness:b,outlines:E,width:m,height:v}}catch(l){return ke("decompressSignature: ".concat(l)),null}var a}}function bv(t,e,i,n){return n-=e,0===(i-=t)?n>0?0:4:1===i?n+6:2-n}function yv(t,e,i,n,s,r,a){const o=vt(Ot,this,bv).call(this,i,n,s,r);for(let l=0;l<8;l++){const s=(-l+o-a+16)%8;if(0!==t[(i+vt(Ot,this,Lv)._[2*s])*e+(n+vt(Ot,this,Lv)._[2*s+1])])return s}return-1}function Av(t,e,i,n,s,r,a){const o=vt(Ot,this,bv).call(this,i,n,s,r);for(let l=0;l<8;l++){const s=(l+o+a+16)%8;if(0!==t[(i+vt(Ot,this,Lv)._[2*s])*e+(n+vt(Ot,this,Lv)._[2*s+1])])return s}return-1}function Ev(t,e,i,n){const s=t.length,r=new Int32Array(s);for(let c=0;c<s;c++)r[c]=t[c]<=n?1:0;for(let c=1;c<i-1;c++)r[c*e]=r[c*e+e-1]=0;for(let c=0;c<e;c++)r[c]=r[e*i-1-c]=0;let a,o=1;const l=[];for(let c=1;c<i-1;c++){a=1;for(let t=1;t<e-1;t++){const i=c*e+t,n=r[i];if(0===n)continue;let s=c,h=t;if(1===n&&0===r[i-1])o+=1,h-=1;else{if(!(n>=1&&0===r[i+1])){1!==n&&(a=Math.abs(n));continue}o+=1,h+=1,n>1&&(a=n)}const d=[t,c],u=h===t+1,p={isHole:u,points:d,id:o,parent:0};let g;l.push(p);for(const t of l)if(t.id===a){g=t;break}g?g.isHole?p.parent=u?g.parent:a:p.parent=u?a:g.parent:p.parent=u?a:0;const f=vt(Ot,this,yv).call(this,r,e,c,t,s,h,0);if(-1===f){r[i]=-o,1!==r[i]&&(a=Math.abs(r[i]));continue}let m=vt(Ot,this,Lv)._[2*f],v=vt(Ot,this,Lv)._[2*f+1];const w=c+m,b=t+v;s=w,h=b;let y=c,A=t;for(;;){const n=vt(Ot,this,Av).call(this,r,e,y,A,s,h,1);m=vt(Ot,this,Lv)._[2*n],v=vt(Ot,this,Lv)._[2*n+1];const l=y+m,u=A+v;d.push(u,l);const p=y*e+A;if(0===r[p+1]?r[p]=-o:1===r[p]&&(r[p]=o),l===c&&u===t&&y===w&&A===b){1!==r[i]&&(a=Math.abs(r[i]));break}s=y,h=A,y=l,A=u}}}return l}function xv(t,e,i,n){if(i-e<=4){for(let s=e;s<i-2;s+=2)n.push(t[s],t[s+1]);return}const s=t[e],r=t[e+1],a=t[i-4]-s,o=t[i-3]-r,l=Math.hypot(a,o),c=a/l,h=o/l,d=c*r-h*s,u=o/a,p=1/l,g=Math.atan(u),f=Math.cos(g),m=Math.sin(g),v=p*(Math.abs(f)+Math.abs(m)),w=p*(1-v+v**2),b=Math.max(Math.atan(Math.abs(m+f)*w),Math.atan(Math.abs(m-f)*w));let y=0,A=e;for(let E=e+2;E<i-2;E+=2){const e=Math.abs(d-c*t[E+1]+h*t[E]);e>y&&(A=E,y=e)}y>(l*b)**2?(vt(Ot,this,xv).call(this,t,e,A+2,n),vt(Ot,this,xv).call(this,t,A,i,n)):n.push(s,r)}function _v(t){const e=[],i=t.length;return vt(Ot,this,xv).call(this,t,0,i,e),e.push(t[i-2],t[i-1]),e.length<=4?null:e}function kv(t,e,i,n,s,r){const a=new Float32Array(r**2),o=-2*n**2,l=r>>1;for(let g=0;g<r;g++){const t=(g-l)**2;for(let e=0;e<r;e++)a[g*r+e]=Math.exp((t+(e-l)**2)/o)}const c=new Float32Array(256),h=-2*s**2;for(let g=0;g<256;g++)c[g]=Math.exp(g**2/h);const d=t.length,u=new Uint8Array(d),p=new Uint32Array(256);for(let g=0;g<i;g++)for(let n=0;n<e;n++){const s=g*e+n,o=t[s];let h=0,d=0;for(let u=0;u<r;u++){const s=g+u-l;if(!(s<0||s>=i))for(let i=0;i<r;i++){const p=n+i-l;if(p<0||p>=e)continue;const g=t[s*e+p],f=a[u*r+i]*c[Math.abs(g-o)];h+=g*f,d+=f}}p[u[s]=Math.round(h/d)]++}return[u,p]}function Cv(t){const e=new Uint32Array(256);for(const i of t)e[i]++;return e}function Sv(t){const e=t.length,i=new Uint8ClampedArray(e>>2);let n=-1/0,s=1/0;for(let a=0,o=i.length;a<o;a++){const e=i[a]=t[a<<2];n=Math.max(n,e),s=Math.min(s,e)}const r=255/(n-s);for(let a=0,o=i.length;a<o;a++)i[a]=(i[a]-s)*r;return i}function Mv(t){let e,i=-1/0,n=-1/0;const s=t.findIndex(t=>0!==t);let r=s,a=s;for(e=s;e<256;e++){const s=t[e];s>i&&(e-r>n&&(n=e-r,a=e-1),i=s,r=e)}for(e=a-1;e>=0&&!(t[e]>t[e+1]);e--);return e}function Tv(t){const e=t,{width:i,height:n}=t,{maxDim:s}=vt(Ot,this,Pv)._;let r=i,a=n;if(i>s||n>s){let o=i,l=n,c=Math.log2(Math.max(i,n)/s);const h=Math.floor(c);c=c===h?h-1:h;for(let i=0;i<c;i++){r=Math.ceil(o/2),a=Math.ceil(l/2);const i=new OffscreenCanvas(r,a);i.getContext("2d").drawImage(t,0,0,o,l,0,0,r,a),o=r,l=a,t!==e&&t.close(),t=i.transferToImageBitmap()}const d=Math.min(s/r,s/a);r=Math.round(r*d),a=Math.round(a*d)}const o=new OffscreenCanvas(r,a).getContext("2d",{willReadFrequently:!0});o.fillStyle="white",o.fillRect(0,0,r,a),o.filter="grayscale(1)",o.drawImage(t,0,0,t.width,t.height,0,0,r,a);const l=o.getImageData(0,0,r,a).data;return[vt(Ot,this,Sv).call(this,l),r,a]}Ot=wv;var Pv={_:{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}},Lv={_:new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1])};class Rv extends wm{constructor(){super(),super.updateProperties({fill:Jr._defaultLineColor,"stroke-width":0})}clone(){const t=new Rv;return t.updateAll(this),t}}class Dv extends pv{constructor(t){super(t),super.updateProperties({stroke:Jr._defaultLineColor,"stroke-width":1})}clone(){const t=new Dv(this._viewParameters);return t.updateAll(this),t}}var Fv=new WeakMap,Iv=new WeakMap,Nv=new WeakMap,Ov=new WeakMap;class Bv extends Em{constructor(t){super((0,pt.A)((0,pt.A)({},t),{},{mustBeCommitted:!0,name:"signatureEditor"})),mt(this,Fv,!1),mt(this,Iv,null),mt(this,Nv,null),mt(this,Ov,null),this._willKeepAspectRatio=!0,yt(Nv,this,t.signatureData||null),yt(Iv,this,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,e){Jr.initialize(t,e),this._defaultDrawingOptions=new Rv,this._defaultDrawnSignatureOptions=new Dv(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!1}static get typesMap(){return Pe(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!bt(Iv,this)}}static computeTelemetryFinalData(t){var e,i;const n=t.get("hasDescription");return{hasAltText:null!==(e=n.get(!0))&&void 0!==e?e:0,hasNoAltText:null!==(i=n.get(!1))&&void 0!==i?i:0}}get isResizable(){return!0}onScaleChanging(){null!==this._drawId&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,e;const{_isCopy:i}=this;if(i&&(this._isCopy=!1,t=this.x,e=this.y),super.render(),null===this._drawId)if(bt(Nv,this)){const{lines:t,mustSmooth:e,areContours:i,description:n,uuid:s,heightInPage:r}=bt(Nv,this),{rawDims:{pageWidth:a,pageHeight:o},rotation:l}=this.parent.viewport,c=wv.processDrawnLines({lines:t,pageWidth:a,pageHeight:o,rotation:l,innerMargin:Bv._INNER_MARGIN,mustSmooth:e,areContours:i});this.addSignature(c,r,n,s)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:bt(Iv,this)||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(t,e)),this.div}setUuid(t){yt(Ov,this,t),this.addEditToolbar()}getUuid(){return bt(Ov,this)}get description(){return bt(Iv,this)}set description(t){yt(Iv,this,t),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(e=>{null===e||void 0===e||e.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:e,thickness:i,width:n,height:s}=bt(Nv,this),r=Math.max(n,s);return{areContours:e,outline:wv.processDrawnLines({lines:{curves:t.map(t=>({points:t})),thickness:i,width:n,height:s},pageWidth:r,pageHeight:r,rotation:0,innerMargin:0,mustSmooth:!1,areContours:e}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,e,i,n){const{x:s,y:r}=this,{outline:a}=yt(Nv,this,t);let o;yt(Fv,this,a instanceof vv),this.description=i,bt(Fv,this)?o=Bv.getDefaultDrawingOptions():(o=Bv._defaultDrawnSignatureOptions.clone(),o.updateProperties({"stroke-width":a.thickness})),this._addOutlines({drawOutlines:a,drawingOptions:o});const[,l]=this.pageDimensions;let c=e/l;c=c>=1?.5:c,this.width*=c/this.height,this.width>=1&&(c*=.9/this.width,this.width=.9),this.height=c,this.setDims(),this.x=s,this.y=r,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(n),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!n,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:n}=this.parent.viewport;return wv.process(t,e,i,n,Bv._INNER_MARGIN)}getFromText(t,e){const{rawDims:{pageWidth:i,pageHeight:n},rotation:s}=this.parent.viewport;return wv.extractContoursFromText(t,e,i,n,s,Bv._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:n}=this.parent.viewport;return wv.processDrawnLines({lines:t,pageWidth:e,pageHeight:i,rotation:n,innerMargin:Bv._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions(t){let{areContours:e,thickness:i}=t;e?this._drawingOptions=Bv.getDefaultDrawingOptions():(this._drawingOptions=Bv._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":i}))}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;const{lines:e,points:i}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":n}}=this,s=Object.assign(super.serialize(t),{isSignature:!0,areContours:bt(Fv,this),color:[0,0,0],thickness:bt(Fv,this)?0:n});return this.addComment(s),t?(s.paths={lines:e,points:i},s.uuid=bt(Ov,this),s.isCopy=!0):s.lines=e,bt(Iv,this)&&(s.accessibilityData={type:"Figure",alt:bt(Iv,this)}),s}static deserializeDraw(t,e,i,n,s,r){return r.areContours?vv.deserialize(t,e,i,n,s,r):lv.deserialize(t,e,i,n,s,r)}static async deserialize(t,e,i){var n;const s=await super.deserialize(t,e,i);return yt(Fv,s,t.areContours),s.description=(null===(n=t.accessibilityData)||void 0===n?void 0:n.alt)||"",yt(Ov,s,t.uuid),s}}(0,Wt.A)(Bv,"_type","signature"),(0,Wt.A)(Bv,"_editorType",te.SIGNATURE),(0,Wt.A)(Bv,"_defaultDrawingOptions",null);var Wv=new WeakMap,zv=new WeakMap,jv=new WeakMap,Hv=new WeakMap,Uv=new WeakMap,Vv=new WeakMap,Gv=new WeakMap,qv=new WeakMap,Xv=new WeakMap,Yv=new WeakMap,Kv=new WeakMap,Qv=new WeakSet;class Zv extends Jr{constructor(t){super((0,pt.A)((0,pt.A)({},t),{},{name:"stampEditor"})),ft(this,Qv),mt(this,Wv,null),mt(this,zv,null),mt(this,jv,null),mt(this,Hv,null),mt(this,Uv,null),mt(this,Vv,""),mt(this,Gv,null),mt(this,qv,!1),mt(this,Xv,null),mt(this,Yv,!1),mt(this,Kv,!1),yt(Hv,this,t.bitmapUrl),yt(Uv,this,t.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,e){Jr.initialize(t,e)}static isHandlingMimeForPasting(t){return vi.includes(t)}static paste(t,e){e.pasteEditor({mode:te.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var t;return{type:"stamp",hasAltText:!(null===(t=this.altTextData)||void 0===t||!t.altText)}}static computeTelemetryFinalData(t){var e,i;const n=t.get("hasAltText");return{hasAltText:null!==(e=n.get(!0))&&void 0!==e?e:0,hasNoAltText:null!==(i=n.get(!1))&&void 0!==i?i:0}}async mlGuessAltText(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:n,width:s,height:r}=t||this.copyCanvas(null,null,!0).imageData,a=await i.guess({name:"altText",request:{data:n,width:s,height:r,channels:n.length/(s*r)}});if(!a)throw new Error("No response from the AI service.");if(a.error)throw new Error("Error from the AI service.");if(a.cancel)return null;if(!a.output)throw new Error("No valid response from the AI service.");const o=a.output;return await this.setGuessedAltText(o),e&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1}),o}remove(){var t;bt(zv,this)&&(yt(Wv,this,null),this._uiManager.imageManager.deleteId(bt(zv,this)),null===(t=bt(Gv,this))||void 0===t||t.remove(),yt(Gv,this,null),bt(Xv,this)&&(clearTimeout(bt(Xv,this)),yt(Xv,this,null)));super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(bt(zv,this)&&null===bt(Gv,this)&&vt(Qv,this,tw).call(this),this.isAttachedToDOM||this.parent.add(this))):bt(zv,this)&&vt(Qv,this,tw).call(this)}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(bt(jv,this)||bt(Wv,this)||bt(Hv,this)||bt(Uv,this)||bt(zv,this)||bt(qv,this))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;return this._isCopy&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.createAltText(),bt(qv,this)||(bt(Wv,this)?vt(Qv,this,ew).call(this):vt(Qv,this,tw).call(this)),this._isCopy&&this._moveAfterPaste(t,e),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,e){const{id:i,bitmap:n}=this._uiManager.imageManager.getFromCanvas(t,e);e.remove(),i&&this._uiManager.imageManager.isValidId(i)&&(yt(zv,this,i),n&&yt(Wv,this,n),yt(qv,this,!1),vt(Qv,this,ew).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;null!==bt(Xv,this)&&clearTimeout(bt(Xv,this));yt(Xv,this,setTimeout(()=>{yt(Xv,this,null),vt(Qv,this,nw).call(this)},200))}copyCanvas(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t||(t=224);const{width:n,height:s}=bt(Wv,this),r=new mi;let a=bt(Wv,this),o=n,l=s,c=null;if(e){if(n>e||s>e){const t=Math.min(e/n,e/s);o=Math.floor(n*t),l=Math.floor(s*t)}c=document.createElement("canvas");const t=c.width=Math.ceil(o*r.sx),i=c.height=Math.ceil(l*r.sy);bt(Yv,this)||(a=vt(Qv,this,iw).call(this,t,i));const h=c.getContext("2d");h.filter=this._uiManager.hcmFilter;let d="white",u="#cfcfd8";"none"!==this._uiManager.hcmFilter?u="black":wi.isDarkMode&&(d="#8f8f9d",u="#42414d");const p=15,g=p*r.sx,f=p*r.sy,m=new OffscreenCanvas(2*g,2*f),v=m.getContext("2d");v.fillStyle=d,v.fillRect(0,0,2*g,2*f),v.fillStyle=u,v.fillRect(0,0,g,f),v.fillRect(g,f,g,f),h.fillStyle=h.createPattern(m,"repeat"),h.fillRect(0,0,t,i),h.drawImage(a,0,0,a.width,a.height,0,0,t,i)}let h=null;if(i){let e,i;if(r.symmetric&&a.width<t&&a.height<t)e=a.width,i=a.height;else if(a=bt(Wv,this),n>t||s>t){const r=Math.min(t/n,t/s);e=Math.floor(n*r),i=Math.floor(s*r),bt(Yv,this)||(a=vt(Qv,this,iw).call(this,e,i))}const o=new OffscreenCanvas(e,i).getContext("2d",{willReadFrequently:!0});o.drawImage(a,0,0,a.width,a.height,0,0,e,i),h={width:e,height:i,data:o.getImageData(0,0,e,i).data}}return{canvas:c,width:o,height:l,imageData:h}}static async deserialize(t,e,i){let n=null,s=!1;if(t instanceof rg){var r;const{data:{rect:a,rotation:o,id:l,structParent:c,popupRef:h,richText:d,contentsObj:u,creationDate:p,modificationDate:g},container:f,parent:{page:{pageNumber:m}},canvas:v}=t;let w,b;v?(delete t.canvas,({id:w,bitmap:b}=i.imageManager.getFromCanvas(f.id,v)),v.remove()):(s=!0,t._hasNoCanvas=!0);const y=(null===(r=await e._structTree.getAriaAttributes("".concat(Ye).concat(l)))||void 0===r?void 0:r.get("aria-label"))||"";n=t={annotationType:te.STAMP,bitmapId:w,bitmap:b,pageIndex:m-1,rect:a.slice(0),rotation:o,annotationElementId:l,id:l,deleted:!1,accessibilityData:{decorative:!1,altText:y},isSvg:!1,structParent:c,popupRef:h,richText:d,comment:(null===u||void 0===u?void 0:u.str)||null,creationDate:p,modificationDate:g}}const a=await super.deserialize(t,e,i),{rect:o,bitmap:l,bitmapUrl:c,bitmapId:h,isSvg:d,accessibilityData:u}=t;s?(i.addMissingCanvas(t.id,a),yt(qv,a,!0)):h&&i.imageManager.isValidId(h)?(yt(zv,a,h),l&&yt(Wv,a,l)):yt(Hv,a,c),yt(Yv,a,d);const[p,g]=a.pageDimensions;return a.width=(o[2]-o[0])/p,a.height=(o[3]-o[1])/g,u&&(a.altTextData=u),a._initialData=n,t.comment&&a.setCommentData(t),yt(Kv,a,!!n),a}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=Object.assign(super.serialize(t),{bitmapId:bt(zv,this),isSvg:bt(Yv,this)});if(this.addComment(i),t)return i.bitmapUrl=vt(Qv,this,sw).call(this,!0),i.accessibilityData=this.serializeAltText(!0),i.isCopy=!0,i;const{decorative:n,altText:s}=this.serializeAltText(!1);if(!n&&s&&(i.accessibilityData={type:"Figure",alt:s}),this.annotationElementId){const t=vt(Qv,this,rw).call(this,i);if(t.isSame)return null;var r;if(t.isSameAltText)delete i.accessibilityData;else i.accessibilityData.structParent=null!==(r=this._initialData.structParent)&&void 0!==r?r:-1;return i.id=this.annotationElementId,delete i.bitmapId,i}if(null===e)return i;e.stamps||(e.stamps=new Map);const a=bt(Yv,this)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(bt(zv,this))){if(bt(Yv,this)){const t=e.stamps.get(bt(zv,this));a>t.area&&(t.area=a,t.serialized.bitmap.close(),t.serialized.bitmap=vt(Qv,this,sw).call(this,!1))}}else e.stamps.set(bt(zv,this),{area:a,serialized:i}),i.bitmap=vt(Qv,this,sw).call(this,!1);return i}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}function Jv(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?(yt(Wv,this,t.bitmap),e||(yt(zv,this,t.id),yt(Yv,this,t.isSvg)),t.file&&yt(Vv,this,t.file.name),vt(Qv,this,ew).call(this)):this.remove()}function $v(){if(yt(jv,this,null),this._uiManager.enableWaiting(!1),bt(Gv,this))if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&bt(Wv,this))this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&bt(Wv,this)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch(t){}}this.div.focus()}}function tw(){if(bt(zv,this))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(bt(zv,this)).then(t=>vt(Qv,this,Jv).call(this,t,!0)).finally(()=>vt(Qv,this,$v).call(this));if(bt(Hv,this)){const t=bt(Hv,this);return yt(Hv,this,null),this._uiManager.enableWaiting(!0),void yt(jv,this,this._uiManager.imageManager.getFromUrl(t).then(t=>vt(Qv,this,Jv).call(this,t)).finally(()=>vt(Qv,this,$v).call(this)))}if(bt(Uv,this)){const t=bt(Uv,this);return yt(Uv,this,null),this._uiManager.enableWaiting(!0),void yt(jv,this,this._uiManager.imageManager.getFromFile(t).then(t=>vt(Qv,this,Jv).call(this,t)).finally(()=>vt(Qv,this,$v).call(this)))}const t=document.createElement("input");t.type="file",t.accept=vi.join(",");const e=this._uiManager._signal;yt(jv,this,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]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),vt(Qv,this,Jv).call(this,e)}else this.remove();i()},{signal:e}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:e})}).finally(()=>vt(Qv,this,$v).call(this))),t.click()}function ew(){var t;const{div:e}=this;let{width:i,height:n}=bt(Wv,this);const[s,r]=this.pageDimensions,a=.75;if(this.width)i=this.width*s,n=this.height*r;else if(i>a*s||n>a*r){const t=Math.min(a*s/i,a*r/n);i*=t,n*=t}this._uiManager.enableWaiting(!1);const o=yt(Gv,this,document.createElement("canvas"));o.setAttribute("role","img"),this.addContainer(o),this.width=i/s,this.height=n/r,this.setDims(),null!==(t=this._initialOptions)&&void 0!==t&&t.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(e.hidden=!1),vt(Qv,this,nw).call(this),bt(Kv,this)||(this.parent.addUndoableEditor(this),yt(Kv,this,!0)),this._reportTelemetry({action:"inserted_image"}),bt(Vv,this)&&this.div.setAttribute("aria-description",bt(Vv,this)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}function iw(t,e){const{width:i,height:n}=bt(Wv,this);let s=i,r=n,a=bt(Wv,this);for(;s>2*t||r>2*e;){const i=s,n=r;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),r>2*e&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2));const o=new OffscreenCanvas(s,r);o.getContext("2d").drawImage(a,0,0,i,n,0,0,s,r),a=o.transferToImageBitmap()}return a}function nw(){const[t,e]=this.parentDimensions,{width:i,height:n}=this,s=new mi,r=Math.ceil(i*t*s.sx),a=Math.ceil(n*e*s.sy),o=bt(Gv,this);if(!o||o.width===r&&o.height===a)return;o.width=r,o.height=a;const l=bt(Yv,this)?bt(Wv,this):vt(Qv,this,iw).call(this,r,a),c=o.getContext("2d");c.filter=this._uiManager.hcmFilter,c.drawImage(l,0,0,l.width,l.height,0,0,r,a)}function sw(t){if(t){if(bt(Yv,this)){const t=this._uiManager.imageManager.getSvgUrl(bt(zv,this));if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=bt(Wv,this));return t.getContext("2d").drawImage(bt(Wv,this),0,0),t.toDataURL()}if(bt(Yv,this)){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*ti.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*ti.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,n);return s.getContext("2d").drawImage(bt(Wv,this),0,0,bt(Wv,this).width,bt(Wv,this).height,0,0,i,n),s.transferToImageBitmap()}return structuredClone(bt(Wv,this))}function rw(t){var e;const{pageIndex:i,accessibilityData:{altText:n}}=this._initialData,s=t.pageIndex===i,r=((null===(e=t.accessibilityData)||void 0===e?void 0:e.alt)||"")===n;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&s&&r,isSameAltText:r}}(0,Wt.A)(Zv,"_type","stamp"),(0,Wt.A)(Zv,"_editorType",te.STAMP);var aw=new WeakMap,ow=new WeakMap,lw=new WeakMap,cw=new WeakMap,hw=new WeakMap,dw=new WeakMap,uw=new WeakMap,pw=new WeakMap,gw=new WeakMap,fw=new WeakMap,mw=new WeakMap,vw=new WeakMap,ww=new WeakMap,bw=new WeakMap,yw=new WeakMap,Aw=new WeakMap,Ew=new WeakSet;class xw{constructor(t){let{uiManager:e,pageIndex:i,div:n,structTreeLayer:s,accessibilityManager:r,annotationLayer:a,drawLayer:o,textLayer:l,viewport:c,l10n:h}=t;ft(this,Ew),mt(this,aw,void 0),mt(this,ow,!1),mt(this,lw,null),mt(this,cw,null),mt(this,hw,null),mt(this,dw,new Map),mt(this,uw,!1),mt(this,pw,!1),mt(this,gw,!1),mt(this,fw,null),mt(this,mw,null),mt(this,vw,null),mt(this,ww,null),mt(this,bw,null),mt(this,yw,-1),mt(this,Aw,void 0);const d=[...Pw._.values()];if(!xw._initialized){xw._initialized=!0;for(const t of d)t.initialize(h,e)}e.registerEditorTypes(d),yt(Aw,this,e),this.pageIndex=i,this.div=n,yt(aw,this,r),yt(lw,this,a),this.viewport=c,yt(vw,this,l),this.drawLayer=o,this._structTree=s,bt(Aw,this).addLayer(this)}get isEmpty(){return 0===bt(dw,this).size}get isInvisible(){return this.isEmpty&&bt(Aw,this).getMode()===te.NONE}updateToolbar(t){bt(Aw,this).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bt(Aw,this).getMode();switch(vt(Ew,this,Tw).call(this),t){case te.NONE:return this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case te.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case te.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;if(e.toggle("nonEditing",!1),t===te.POPUP)e.toggle("commentEditing",!0);else{e.toggle("commentEditing",!1);for(const i of Pw._.values())e.toggle("".concat(i._type,"Editing"),t===i._editorType)}this.div.hidden=!1}hasTextLayer(t){var e;return t===(null===(e=bt(vw,this))||void 0===e?void 0:e.div)}setEditingState(t){bt(Aw,this).setEditingState(t)}addCommands(t){bt(Aw,this).addCommands(t)}cleanUndoStack(t){bt(Aw,this).cleanUndoStack(t)}toggleDrawing(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("drawing",!t)}togglePointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(){var t;let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=bt(lw,this))||void 0===t||t.div.classList.toggle("disabled",!e)}async enable(){var t;yt(gw,this,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),null===(t=bt(bw,this))||void 0===t||t.abort(),yt(bw,this,null);const e=new Set;for(const n of wt(Ew,this,_w))n.enableEditing(),n.show(!0),n.annotationElementId&&(bt(Aw,this).removeChangedExistingAnnotation(n),e.add(n.annotationElementId));const i=bt(lw,this);if(i)for(const n of i.getEditableAnnotations()){if(n.hide(),bt(Aw,this).isDeletedAnnotationElement(n.data.id))continue;if(e.has(n.data.id))continue;const t=await this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}yt(gw,this,!1),bt(Aw,this)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(yt(pw,this,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),bt(vw,this)&&!bt(bw,this)){yt(bw,this,new AbortController);const t=bt(Aw,this).combinedSignal(bt(bw,this));bt(vw,this).div.addEventListener("pointerdown",t=>{const{clientX:e,clientY:i,timeStamp:n}=t;if(n-bt(yw,this)>500)return void yt(yw,this,n);yt(yw,this,-1);const{classList:s}=this.div;s.toggle("getElements",!0);const r=document.elementsFromPoint(e,i);if(s.toggle("getElements",!1),!this.div.contains(r[0]))return;let a;const o=new RegExp("^".concat($t,"[0-9]+$"));for(const c of r)if(o.test(c.id)){a=c.id;break}if(!a)return;const l=bt(dw,this).get(a);null===(null===l||void 0===l?void 0:l.annotationElementId)&&(t.stopPropagation(),t.preventDefault(),l.dblclick(t))},{signal:t,capture:!0})}const t=bt(lw,this);if(t){const i=new Map,n=new Map;for(const r of wt(Ew,this,_w)){var e;r.disableEditing(),r.annotationElementId?null===r.serialize()?(n.set(r.annotationElementId,r),null===(e=this.getEditableAnnotation(r.annotationElementId))||void 0===e||e.show(),r.remove()):i.set(r.annotationElementId,r):r.updateFakeAnnotationElement(t)}const s=t.getEditableAnnotations();for(const t of s){const{id:e}=t.data;if(bt(Aw,this).isDeletedAnnotationElement(e)){t.updateEdited({deleted:!0});continue}let s=n.get(e);s?(s.resetAnnotationElement(t),s.show(!1),t.show()):(s=i.get(e),s&&(bt(Aw,this).addChangedExistingAnnotation(s),s.renderAnnotationElement(t)&&s.show(!1)),t.show())}}vt(Ew,this,Tw).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const n of Pw._.values())i.remove("".concat(n._type,"Editing"));this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),yt(pw,this,!1)}getEditableAnnotation(t){var e;return(null===(e=bt(lw,this))||void 0===e?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){bt(Aw,this).getActive()!==t&&bt(Aw,this).setActiveEditor(t)}enableTextSelection(){var t;if(this.div.tabIndex=-1,null!==(t=bt(vw,this))&&void 0!==t&&t.div&&!bt(ww,this)){yt(ww,this,new AbortController);const t=bt(Aw,this).combinedSignal(bt(ww,this));bt(vw,this).div.addEventListener("pointerdown",vt(Ew,this,kw).bind(this),{signal:t}),bt(vw,this).div.classList.add("highlighting")}}disableTextSelection(){var t;this.div.tabIndex=0,null!==(t=bt(vw,this))&&void 0!==t&&t.div&&bt(ww,this)&&(bt(ww,this).abort(),yt(ww,this,null),bt(vw,this).div.classList.remove("highlighting"))}enableClick(){if(bt(cw,this))return;yt(cw,this,new AbortController);const t=bt(Aw,this).combinedSignal(bt(cw,this));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){var t;null===(t=bt(cw,this))||void 0===t||t.abort(),yt(cw,this,null)}attach(t){bt(dw,this).set(t.id,t);const{annotationElementId:e}=t;e&&bt(Aw,this).isDeletedAnnotationElement(e)&&bt(Aw,this).removeDeletedAnnotationElement(t)}detach(t){var e;bt(dw,this).delete(t.id),null===(e=bt(aw,this))||void 0===e||e.removePointerInTextLayer(t.contentDiv),!bt(pw,this)&&t.annotationElementId&&bt(Aw,this).addDeletedAnnotationElement(t)}remove(t){this.detach(t),bt(Aw,this).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(bt(Aw,this).addDeletedAnnotationElement(t.annotationElementId),Jr.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),null===(e=t.parent)||void 0===e||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),bt(Aw,this).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!bt(gw,this)),bt(Aw,this).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var e;if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!bt(hw,this)&&(t._focusEventsAllowed=!1,yt(hw,this,setTimeout(()=>{yt(hw,this,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:bt(Aw,this)._signal}),i.focus())},0))),t._structTreeParentId=null===(e=bt(aw,this))||void 0===e?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})}getEditorByUID(t){for(const e of bt(dw,this).values())if(e.uid===t)return e;return null}getNextId(){return bt(Aw,this).getId()}combinedSignal(t){return bt(Aw,this).combinedSignal(t)}canCreateNewEmptyEditor(){var t;return null===(t=wt(Ew,this,Cw))||void 0===t?void 0:t.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await bt(Aw,this).updateMode(t.mode);const{offsetX:i,offsetY:n}=vt(Ew,this,Mw).call(this),s=this.getNextId(),r=vt(Ew,this,Sw).call(this,(0,pt.A)({parent:this,id:s,x:i,y:n,uiManager:bt(Aw,this),isCentered:!0},e));r&&this.add(r)}async deserialize(t){var e,i;return await(null===(e=Pw._.get(null!==(i=t.annotationType)&&void 0!==i?i:t.annotationEditorType))||void 0===e?void 0:e.deserialize(t,this,bt(Aw,this)))||null}createAndAddNewEditor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.getNextId(),s=vt(Ew,this,Sw).call(this,(0,pt.A)({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:bt(Aw,this),isCentered:e},i));return s&&this.add(s),s}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.createAndAddNewEditor(vt(Ew,this,Mw).call(this),!0,t)}setSelected(t){bt(Aw,this).setSelected(t)}toggleSelected(t){bt(Aw,this).toggleSelected(t)}unselect(t){bt(Aw,this).unselect(t)}pointerup(t){var e;const{isMac:i}=ze.platform;if(0!==t.button||t.ctrlKey&&i)return;if(t.target!==this.div)return;if(!bt(uw,this))return;if(yt(uw,this,!1),null!==(e=wt(Ew,this,Cw))&&void 0!==e&&e.isDrawer&&wt(Ew,this,Cw).supportMultipleDrawings)return;if(!bt(ow,this))return void yt(ow,this,!0);const n=bt(Aw,this).getMode();n!==te.STAMP&&n!==te.SIGNATURE?this.createAndAddNewEditor(t,!1):bt(Aw,this).unselectAll()}pointerdown(t){var e;if(bt(Aw,this).getMode()===te.HIGHLIGHT&&this.enableTextSelection(),bt(uw,this))return void yt(uw,this,!1);const{isMac:i}=ze.platform;if(0!==t.button||t.ctrlKey&&i)return;if(t.target!==this.div)return;if(yt(uw,this,!0),null!==(e=wt(Ew,this,Cw))&&void 0!==e&&e.isDrawer)return void this.startDrawingSession(t);const n=bt(Aw,this).getActive();yt(ow,this,!n||n.isEmpty())}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),bt(fw,this))return void wt(Ew,this,Cw).startDrawing(this,bt(Aw,this),!1,t);bt(Aw,this).setCurrentDrawingSession(this),yt(fw,this,new AbortController);const e=bt(Aw,this).combinedSignal(bt(fw,this));this.div.addEventListener("blur",t=>{let{relatedTarget:e}=t;e&&!this.div.contains(e)&&(yt(mw,this,null),this.commitOrRemove())},{signal:e}),wt(Ew,this,Cw).startDrawing(this,bt(Aw,this),!1,t)}pause(t){if(t){const{activeElement:t}=document;return void(this.div.contains(t)&&yt(mw,this,t))}bt(mw,this)&&setTimeout(()=>{var t;null===(t=bt(mw,this))||void 0===t||t.focus(),yt(mw,this,null)},0)}endDrawingSession(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return bt(fw,this)?(bt(Aw,this).setCurrentDrawingSession(null),bt(fw,this).abort(),yt(fw,this,null),yt(mw,this,null),wt(Ew,this,Cw).endDrawing(t)):null}findNewParent(t,e,i){const n=bt(Aw,this).findParent(e,i);return null!==n&&n!==this&&(n.changeParent(t),!0)}commitOrRemove(){return!!bt(fw,this)&&(this.endDrawingSession(),!0)}onScaleChanging(){bt(fw,this)&&wt(Ew,this,Cw).onScaleChangingWhenDrawing(this)}destroy(){var t;this.commitOrRemove(),(null===(t=bt(Aw,this).getActive())||void 0===t?void 0:t.parent)===this&&(bt(Aw,this).commitOrRemove(),bt(Aw,this).setActiveEditor(null)),bt(hw,this)&&(clearTimeout(bt(hw,this)),yt(hw,this,null));for(const i of bt(dw,this).values()){var e;null===(e=bt(aw,this))||void 0===e||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove()}this.div=null,bt(dw,this).clear(),bt(Aw,this).removeLayer(this)}render(t){let{viewport:e}=t;this.viewport=e,fi(this.div,e);for(const i of bt(Aw,this).getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update(t){let{viewport:e}=t;bt(Aw,this).commitOrRemove(),vt(Ew,this,Tw).call(this);const i=this.viewport.rotation,n=e.rotation;if(this.viewport=e,fi(this.div,{rotation:n}),i!==n)for(const s of bt(dw,this).values())s.rotate(n)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return bt(Aw,this).viewParameters.realScale}}function _w(t){return 0!==bt(dw,t).size?bt(dw,t).values():bt(Aw,t).getEditors(t.pageIndex)}function kw(t){bt(Aw,this).unselectAll();const{target:e}=t;if(e===bt(vw,this).div||("img"===e.getAttribute("role")||e.classList.contains("endOfContent"))&&bt(vw,this).div.contains(e)){const{isMac:e}=ze.platform;if(0!==t.button||t.ctrlKey&&e)return;bt(Aw,this).showAllEditors("highlight",!0,!0),bt(vw,this).div.classList.add("free"),this.toggleDrawing(),tm.startHighlighting(this,"ltr"===bt(Aw,this).direction,{target:bt(vw,this).div,x:t.x,y:t.y}),bt(vw,this).div.addEventListener("pointerup",()=>{bt(vw,this).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:bt(Aw,this)._signal}),t.preventDefault()}}function Cw(t){return Pw._.get(bt(Aw,t).getMode())}function Sw(t){const e=wt(Ew,this,Cw);return e?new e.prototype.constructor(t):null}function Mw(){const{x:t,y:e,width:i,height:n}=this.boundingClientRect,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,c]=this.viewport.rotation%180===0?[a,o]:[o,a];return{offsetX:l,offsetY:c}}function Tw(){for(const t of bt(dw,this).values())t.isEmpty()&&t.remove()}(0,Wt.A)(xw,"_initialized",!1);var Pw={_:new Map([Cg,fv,Zv,tm,Bv].map(t=>[t._editorType,t]))},Lw=new WeakMap,Rw=new WeakMap,Dw=new WeakMap,Fw=new WeakSet;class Iw{constructor(t){let{pageIndex:e}=t;ft(this,Fw),mt(this,Lw,null),mt(this,Rw,new Map),mt(this,Dw,new Map),this.pageIndex=e}setParent(t){if(bt(Lw,this)){if(bt(Lw,this)!==t){if(bt(Rw,this).size>0)for(const e of bt(Rw,this).values())e.remove(),t.append(e);yt(Lw,this,t)}}else yt(Lw,this,t)}static get _svgFactory(){return Pe(this,"_svgFactory",new ku)}draw(t){var e,i;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=(zw._=(e=zw._,i=e++,e),i),a=vt(Fw,this,Ow).call(this),o=Iw._svgFactory.createElement("defs");a.append(o);const l=Iw._svgFactory.createElement("path");o.append(l);const c="path_p".concat(this.pageIndex,"_").concat(r);l.setAttribute("id",c),l.setAttribute("vector-effect","non-scaling-stroke"),n&&bt(Dw,this).set(r,l);const h=s?vt(Fw,this,Bw).call(this,o,c):null,d=Iw._svgFactory.createElement("use");return a.append(d),d.setAttribute("href","#".concat(c)),this.updateProperties(a,t),bt(Rw,this).set(r,a),{id:r,clipPathId:"url(#".concat(h,")")}}drawOutline(t,e){var i,n;const s=(zw._=(i=zw._,n=i++,i),n),r=vt(Fw,this,Ow).call(this),a=Iw._svgFactory.createElement("defs");r.append(a);const o=Iw._svgFactory.createElement("path");a.append(o);const l="path_p".concat(this.pageIndex,"_").concat(s);let c;if(o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),e){const t=Iw._svgFactory.createElement("mask");a.append(t),c="mask_p".concat(this.pageIndex,"_").concat(s),t.setAttribute("id",c),t.setAttribute("maskUnits","objectBoundingBox");const e=Iw._svgFactory.createElement("rect");t.append(e),e.setAttribute("width","1"),e.setAttribute("height","1"),e.setAttribute("fill","white");const i=Iw._svgFactory.createElement("use");t.append(i),i.setAttribute("href","#".concat(l)),i.setAttribute("stroke","none"),i.setAttribute("fill","black"),i.setAttribute("fill-rule","nonzero"),i.classList.add("mask")}const h=Iw._svgFactory.createElement("use");r.append(h),h.setAttribute("href","#".concat(l)),c&&h.setAttribute("mask","url(#".concat(c,")"));const d=h.cloneNode();return r.append(d),h.classList.add("mainOutline"),d.classList.add("secondaryOutline"),this.updateProperties(r,t),bt(Rw,this).set(s,r),s}finalizeDraw(t,e){bt(Dw,this).delete(t),this.updateProperties(t,e)}updateProperties(t,e){if(!e)return;const{root:i,bbox:n,rootClass:s,path:r}=e,a="number"===typeof t?bt(Rw,this).get(t):t;if(a){if(i&&vt(Fw,this,Ww).call(this,a,i),n&&Nw.call(Iw,a,n),s){const{classList:t}=a;for(const[e,i]of Object.entries(s))t.toggle(e,i)}if(r){const t=a.firstChild.firstChild;vt(Fw,this,Ww).call(this,t,r)}}}updateParent(t,e){if(e===this)return;const i=bt(Rw,this).get(t);i&&(bt(Lw,e).append(i),bt(Rw,this).delete(t),bt(Rw,e).set(t,i))}remove(t){bt(Dw,this).delete(t),null!==bt(Lw,this)&&(bt(Rw,this).get(t).remove(),bt(Rw,this).delete(t))}destroy(){yt(Lw,this,null);for(const t of bt(Rw,this).values())t.remove();bt(Rw,this).clear(),bt(Dw,this).clear()}}function Nw(t,e){let[i,n,s,r]=e;const{style:a}=t;a.top="".concat(100*n,"%"),a.left="".concat(100*i,"%"),a.width="".concat(100*s,"%"),a.height="".concat(100*r,"%")}function Ow(){const t=Bt._svgFactory.create(1,1,!0);return bt(Lw,this).append(t),t.setAttribute("aria-hidden",!0),t}function Bw(t,e){const i=Bt._svgFactory.createElement("clipPath");t.append(i);const n="clip_".concat(e);i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=Bt._svgFactory.createElement("use");return i.append(s),s.setAttribute("href","#".concat(e)),s.classList.add("clip"),n}function Ww(t,e){for(const[i,n]of Object.entries(e))null===n?t.removeAttribute(i):t.setAttribute(i,n)}Bt=Iw;var zw={_:0};globalThis._pdfjsTestingUtils={HighlightOutliner:_f},globalThis.pdfjsLib={AbortException:Oe,AnnotationEditorLayer:xw,AnnotationEditorParamsType:ee,AnnotationEditorType:te,AnnotationEditorUIManager:hs,AnnotationLayer:vg,AnnotationMode:Jt,AnnotationType:ce,applyOpacity:function(t,e,i,n){const s=255*(1-(n=Math.min(Math.max(null!==n&&void 0!==n?n:1,0),1)));return[t=Math.round(t*n+s),e=Math.round(e*n+s),i=Math.round(i*n+s)]},build:"f56dc8601",ColorPicker:lu,createValidAbsoluteUrl:Me,CSSConstants:class{static get commentForegroundColor(){const t=document.createElement("span");t.classList.add("comment","sidebar");const{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);const{color:i}=window.getComputedStyle(t);return t.remove(),Pe(this,"commentForegroundColor",ui(i))}},DOMSVGFactory:ku,DrawLayer:Iw,FeatureTest:ze,fetchData:ei,findContrastColor:function(t,e){const i=t[0]+256*t[1]+65536*t[2]+16777216*e[0]+4294967296*e[1]+1099511627776*e[2];let n=xi.get(i);if(n)return n;const s=new Float32Array(9),r=s.subarray(0,3),a=s.subarray(3,6);bi(t,a);const o=s.subarray(6,9);bi(e,o);const l=o[2]<.5,c=l?12:4.5;if(a[2]=l?Math.sqrt(a[2]):1-Math.sqrt(1-a[2]),Ei(a,o,r)<c){let t,e;l?(t=a[2],e=1):(t=0,e=a[2]);const i=.005;for(;e-t>i;){const i=a[2]=(t+e)/2;l===Ei(a,o,r)<c?t=i:e=i}a[2]=l?e:t}return yi(a,r),n=He.makeHexColor(Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])),xi.set(i,n),n},getDocument:hd,getFilenameFromUrl:function(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)},getPdfFilenameFromUrl:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(si(t))return ke('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=(t=>{try{return new URL(t)}catch(e){try{return new URL(decodeURIComponent(t))}catch(i){try{return new URL(t,"https://foo.bar")}catch(n){try{return new URL(decodeURIComponent(t),"https://foo.bar")}catch(s){return null}}}}})(t);if(!i)return e;const n=t=>{try{let e=decodeURIComponent(t);return e.includes("/")?(e=e.split("/").at(-1),e.test(/^\.pdf$/i)?e:t):e}catch(e){return t}},s=/\.pdf$/i,r=i.pathname.split("/").at(-1);if(s.test(r))return n(r);if(i.searchParams.size>0){const t=Array.from(i.searchParams.values()).reverse();for(const i of t)if(s.test(i))return n(i);const e=Array.from(i.searchParams.keys()).reverse();for(const i of e)if(s.test(i))return n(i)}if(i.hash){const t=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(i.hash);if(t)return n(t[0])}return e},getRGB:ui,getUuid:Xe,getXfaPageViewport:function(t,e){let{scale:i=1,rotation:n=0}=e;const{width:s,height:r}=t.attributes.style,a=[0,0,parseInt(s),parseInt(r)];return new ii({viewBox:a,userUnit:1,scale:i,rotation:n})},GlobalWorkerOptions:zc,ImageKind:le,InvalidPDFException:Fe,isDataScheme:si,isPdfFile:ri,isValidExplicitDest:Wa,MathClamp:Ke,noContextMenu:li,normalizeUnicode:function(t){return Ge||(Ge=/([\xA0\xB5\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+)/g,qe=new Map([["\ufb05","\u017ft"]])),t.replaceAll(Ge,(t,e,i)=>e?e.normalize("NFKC"):qe.get(i))},OPS:me,OutputScale:mi,PasswordResponses:{NEED_PASSWORD:1,INCORRECT_PASSWORD:2},PDFDataRangeTransport:wd,PDFDateString:hi,PDFWorker:Td,PermissionFlag:{PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},PixelsPerInch:ti,RenderingCancelledException:ni,renderRichText:_i,ResponseException:Ie,setLayerDimensions:fi,shadow:Pe,SignatureExtractor:wv,stopEvent:ci,SupportedImageMimeTypes:vi,TextLayer:Zh,TouchManager:Ar,updateUrlHash:Te,Util:He,VerbosityLevel:fe,version:"5.4.296",XfaLayer:Je};var jw=i(53986),Hw=i(89261);function Uw(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=Uw(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}const Vw=function(){for(var t,e,i=0,n="",s=arguments.length;i<s;i++)(t=arguments[i])&&(e=Uw(t))&&(n&&(n+=" "),n+=e);return n};var Gw=Object.prototype.hasOwnProperty;function qw(t,e,i){for(i of t.keys())if(Xw(i,e))return i}function Xw(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--&&Xw(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=qw(e,s)))return!1;if(!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=qw(e,s)))return!1;if(!Xw(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(Gw.call(t,i)&&++n&&!Gw.call(e,i))return!1;if(!(i in e)||!Xw(t[i],e[i]))return!1}return Object.keys(e).length===n}}return t!==t&&e!==e}function Yw(t){let e=!1;return{promise:new Promise((i,n)=>{t.then(t=>!e&&i(t)).catch(t=>!e&&n(t))}),cancel(){e=!0}}}const Kw=["onCopy","onCut","onPaste","onCompositionEnd","onCompositionStart","onCompositionUpdate","onFocus","onBlur","onInput","onInvalid","onReset","onSubmit","onLoad","onError","onKeyDown","onKeyPress","onKeyUp","onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting","onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionEnd","onChange","onToggle"];function Qw(t,e){const i={};for(const n of Kw){const s=t[n];s&&(i[n]=e?t=>s(t,e(n)):s)}return i}var Zw="Invariant failed";function Jw(t,e){if(!t)throw new Error(Zw)}var $w=i(98677);const tb=(0,s.createContext)(null);class eb{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}setHash(){}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return Jw(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(t){Jw(this.pdfViewer),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}addLinkAttributes(t,e,i){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=i?"_blank":this.externalLinkTarget||""}goToDestination(t){return new Promise(e=>{Jw(this.pdfDocument),Jw(t),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)}).then(t=>{Jw(Array.isArray(t),'"'.concat(t,'" is not a valid destination array.'));const e=t[0];new Promise(t=>{Jw(this.pdfDocument),e instanceof Object?this.pdfDocument.getPageIndex(e).then(e=>{t(e)}).catch(()=>{Jw(!1,'"'.concat(e,'" is not a valid page reference.'))}):"number"===typeof e?t(e):Jw(!1,'"'.concat(e,'" is not a valid destination reference.'))}).then(e=>{const i=e+1;Jw(this.pdfViewer),Jw(i>=1&&i<=this.pagesCount,'"'.concat(i,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:i})})})}goToPage(t){const e=t-1;Jw(this.pdfViewer),Jw(t>=1&&t<=this.pagesCount,'"'.concat(t,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}goToXY(){}cachePageRef(){}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}executeNamedAction(){}executeSetOCGState(){}isPageVisible(){return!0}isPageCached(){return!0}navigateTo(t){this.goToDestination(t)}}function ib(t){let{children:e,type:i}=t;return(0,Hw.jsx)("div",{className:"react-pdf__message react-pdf__message--".concat(i),children:e})}const nb={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};function sb(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 rb(){return(0,s.useReducer)(sb,{value:void 0,error:void 0})}const ab="undefined"!==typeof window,ob=ab&&"file:"===window.location.protocol;function lb(t){return function(t){return"undefined"!==typeof t}(t)&&null!==t}function cb(t){return function(t){return"string"===typeof t}(t)&&/^data:/.test(t)}function hb(t){Jw(cb(t));const[e="",i=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(i):unescape(i)}function db(){return ab&&window.devicePixelRatio||1}const ub="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function pb(){$w(!ob,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ".concat(ub))}function gb(t){(null===t||void 0===t?void 0:t.cancel)&&t.cancel()}function fb(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}const mb=["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate","scale"],vb=["url"],{Tm:wb}=n,bb=(t,e)=>{switch(e){case nb.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case nb.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function yb(t){return"object"===typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const Ab=(0,s.forwardRef)(function(t,e){let{children:i,className:n,error:r="Failed to load PDF file.",externalLinkRel:a,externalLinkTarget:o,file:l,inputRef:c,imageResourcesPath:h,loading:d="Loading PDF\u2026",noData:u="No PDF file specified.",onItemClick:p,onLoadError:g,onLoadProgress:f,onLoadSuccess:m,onPassword:v=bb,onSourceError:w,onSourceSuccess:b,options:y,renderMode:A,rotate:E,scale:x}=t,_=(0,jw.A)(t,mb);const[k,C]=rb(),{value:S,error:M}=k,[T,P]=rb(),{value:L,error:R}=T,D=(0,s.useRef)(new eb),F=(0,s.useRef)([]),I=(0,s.useRef)(void 0),N=(0,s.useRef)(void 0);l&&l!==I.current&&yb(l)&&($w(!Xw(l,I.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.'),I.current=l),y&&y!==N.current&&($w(!Xw(y,N.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.'),N.current=y);const O=(0,s.useRef)({scrollPageIntoView:t=>{const{dest:e,pageNumber:i,pageIndex:n=i-1}=t;if(p)return void p({dest:e,pageIndex:n,pageNumber:i});const s=F.current[n];s?s.scrollIntoView():$w(!1,"An internal link leading to page ".concat(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>."))}});(0,s.useImperativeHandle)(e,()=>({linkService:D,pages:F,viewer:O}),[]),(0,s.useEffect)(function(){C({type:"RESET"})},[l,C]);const B=(0,s.useCallback)(async()=>{if(!l)return null;if("string"===typeof l){if(cb(l)){return{data:hb(l)}}return pb(),{url:l}}if(l instanceof wb)return{range:l};if(l instanceof ArrayBuffer)return{data:l};if(ab&&function(t){return Jw(ab),t instanceof Blob}(l)){const t=await function(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)})}(l);return{data:t}}if(Jw("object"===typeof l),Jw(yb(l)),"url"in l&&"string"===typeof l.url){if(cb(l.url)){const{url:t}=l,e=(0,jw.A)(l,vb),i=hb(t);return(0,pt.A)({data:i},e)}pb()}return l},[l]);(0,s.useEffect)(()=>{const t=Yw(B());return t.promise.then(t=>{C({type:"RESOLVE",value:t})}).catch(t=>{C({type:"REJECT",error:t})}),()=>{gb(t)}},[B,C]),(0,s.useEffect)(()=>{"undefined"!==typeof S&&(!1!==S?b&&b():M&&($w(!1,M.toString()),w&&w(M)))},[S]),(0,s.useEffect)(function(){P({type:"RESET"})},[P,S]),(0,s.useEffect)(function(){if(!S)return;const t=hd(y?(0,pt.A)((0,pt.A)({},S),y):S);f&&(t.onProgress=f),v&&(t.onPassword=v);const e=t,i=e.promise.then(t=>{P({type:"RESOLVE",value:t})}).catch(t=>{e.destroyed||P({type:"REJECT",error:t})});return()=>{i.finally(()=>e.destroy())}},[y,P,S]),(0,s.useEffect)(()=>{"undefined"!==typeof L&&(!1!==L?L&&(m&&m(L),F.current=new Array(L.numPages),D.current.setDocument(L)):R&&($w(!1,R.toString()),g&&g(R)))},[L]),(0,s.useEffect)(function(){D.current.setViewer(O.current),D.current.setExternalLinkRel(a),D.current.setExternalLinkTarget(o)},[a,o]);const W=(0,s.useCallback)((t,e)=>{F.current[t]=e},[]),z=(0,s.useCallback)(t=>{delete F.current[t]},[]),j=(0,s.useMemo)(()=>({imageResourcesPath:h,linkService:D.current,onItemClick:p,pdf:L,registerPage:W,renderMode:A,rotate:E,scale:x,unregisterPage:z}),[h,p,L,W,A,E,x,z]),H=(0,s.useMemo)(()=>Qw(_,()=>L),[_,L]);return(0,Hw.jsx)("div",(0,pt.A)((0,pt.A)({className:Vw("react-pdf__Document",n),ref:c},H),{},{children:l?void 0===L||null===L?(0,Hw.jsx)(ib,{type:"loading",children:"function"===typeof d?d():d}):!1===L?(0,Hw.jsx)(ib,{type:"error",children:"function"===typeof r?r():r}):function(){if(t=j,!Boolean(null===t||void 0===t?void 0:t.pdf))throw new Error("pdf is undefined");var t;const e="function"===typeof i?i(j):i;return(0,Hw.jsx)(tb.Provider,{value:j,children:e})}():(0,Hw.jsx)(ib,{type:"no-data",children:"function"===typeof u?u():u})}))});function Eb(){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){for(var e=0,n=i;e<n.length;e++){var s=n[e];"function"===typeof s?s(t):s&&(s.current=t)}}}function xb(){return(0,s.useContext)(tb)}const _b=(0,s.createContext)(null);function kb(){return(0,s.useContext)(_b)}function Cb(){const t=xb(),e=kb();Jw(e);const i=(0,pt.A)((0,pt.A)({},t),e),{imageResourcesPath:n,linkService:r,onGetAnnotationsError:a,onGetAnnotationsSuccess:o,onRenderAnnotationLayerError:l,onRenderAnnotationLayerSuccess:c,page:h,pdf:d,renderForms:u,rotate:p,scale:g=1}=i;Jw(d),Jw(h),Jw(r);const[f,m]=rb(),{value:v,error:w}=f,b=(0,s.useRef)(null);$w(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"),(0,s.useEffect)(function(){m({type:"RESET"})},[m,h]),(0,s.useEffect)(function(){if(!h)return;const t=Yw(h.getAnnotations()),e=t;return t.promise.then(t=>{m({type:"RESOLVE",value:t})}).catch(t=>{m({type:"REJECT",error:t})}),()=>{gb(e)}},[m,h]),(0,s.useEffect)(()=>{void 0!==v&&(!1!==v?v&&o&&o(v):w&&($w(!1,w.toString()),a&&a(w)))},[v]);const y=(0,s.useMemo)(()=>h.getViewport({scale:g,rotation:p}),[h,p,g]);return(0,s.useEffect)(function(){if(!d||!h||!r||!v)return;const{current:t}=b;if(!t)return;const e=y.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,annotationStorage:d.annotationStorage,commentManager:null,div:t,l10n:null,linkService:r,page:h,structTreeLayer:null,viewport:e},s={annotations:v,annotationStorage:d.annotationStorage,div:t,imageResourcesPath:n,linkService:r,page:h,renderForms:u,viewport:e};t.innerHTML="";try{new vg(i).render(s),c&&c()}catch(a){!function(t){$w(!1,"".concat(t)),l&&l(t)}(a)}return()=>{}},[v,n,r,h,d,u,y]),(0,Hw.jsx)("div",{className:Vw("react-pdf__Page__annotations","annotationLayer"),ref:b})}const Sb={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},Mb=/^H(\d+)$/;function Tb(t){return"children"in t}function Pb(t){return!!Tb(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function Lb(t){const e={};if(Tb(t)){const{role:i}=t,n=i.match(Mb);if(n)e.role="heading",e["aria-level"]=Number(n[1]);else if(function(t){return t in Sb}(i)){const t=Sb[i];t&&(e.role=t)}}return e}function Rb(t){const e={};if(Tb(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),Pb(t)){const[i]=t.children;if(i){const t=Rb(i);return(0,pt.A)((0,pt.A)({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function Db(t){return t?(0,pt.A)((0,pt.A)({},Lb(t)),Rb(t)):null}function Fb(t){let{className:e,node:i}=t;const n=(0,s.useMemo)(()=>Db(i),[i]),r=(0,s.useMemo)(()=>Tb(i)?Pb(i)?null:i.children.map((t,e)=>(0,Hw.jsx)(Fb,{node:t},e)):null,[i]);return(0,Hw.jsx)("span",(0,pt.A)((0,pt.A)({className:e},n),{},{children:r}))}function Ib(){const t=kb();Jw(t);const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[n,r]=rb(),{value:a,error:o}=n,{customTextRenderer:l,page:c}=t;return(0,s.useEffect)(function(){r({type:"RESET"})},[r,c]),(0,s.useEffect)(function(){if(l)return;if(!c)return;const t=Yw(c.getStructTree()),e=t;return t.promise.then(t=>{r({type:"RESOLVE",value:t})}).catch(t=>{r({type:"REJECT",error:t})}),()=>gb(e)},[l,c,r]),(0,s.useEffect)(()=>{void 0!==a&&(!1!==a?a&&i&&i(a):o&&($w(!1,o.toString()),e&&e(o)))},[a]),a?(0,Hw.jsx)(Fb,{className:"react-pdf__Page__structTree structTree",node:a}):null}const Nb=Jt;function Ob(t){const e=kb();Jw(e);const i=(0,pt.A)((0,pt.A)({},e),t),{_className:n,canvasBackground:r,devicePixelRatio:a=db(),onRenderError:o,onRenderSuccess:l,page:c,renderForms:h,renderTextLayer:d,rotate:u,scale:p}=i,{canvasRef:g}=t;Jw(c);const f=(0,s.useRef)(null);function m(t){(function(t){return"RenderingCancelledException"===t.name})(t)||($w(!1,t.toString()),o&&o(t))}const v=(0,s.useMemo)(()=>c.getViewport({scale:p*a,rotation:u}),[a,c,u,p]),w=(0,s.useMemo)(()=>c.getViewport({scale:p,rotation:u}),[c,u,p]);(0,s.useEffect)(function(){if(!c)return;c.cleanup();const{current:t}=f;if(!t)return;t.width=v.width,t.height=v.height,t.style.width="".concat(Math.floor(w.width),"px"),t.style.height="".concat(Math.floor(w.height),"px"),t.style.visibility="hidden";const e={annotationMode:h?Nb.ENABLE_FORMS:Nb.ENABLE,canvas:t,canvasContext:t.getContext("2d",{alpha:!1}),viewport:v};r&&(e.background=r);const i=c.render(e),n=i;return i.promise.then(()=>{t.style.visibility="",c&&l&&l(fb(c,p))}).catch(m),()=>gb(n)},[r,c,h,v,w]);const b=(0,s.useCallback)(()=>{const{current:t}=f;t&&(t.width=0,t.height=0)},[]);return(0,s.useEffect)(()=>b,[b]),(0,Hw.jsx)("canvas",{className:"".concat(n,"__canvas"),dir:"ltr",ref:Eb(g,f),style:{display:"block",userSelect:"none"},children:d?(0,Hw.jsx)(Ib,{}):null})}function Bb(){const t=kb();Jw(t);const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:n,onRenderTextLayerError:r,onRenderTextLayerSuccess:a,page:o,pageIndex:l,pageNumber:c,rotate:h,scale:d}=t;Jw(o);const[u,p]=rb(),{value:g,error:f}=u,m=(0,s.useRef)(null);$w(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"),(0,s.useEffect)(function(){p({type:"RESET"})},[o,p]),(0,s.useEffect)(function(){if(!o)return;const t=Yw(o.getTextContent()),e=t;return t.promise.then(t=>{p({type:"RESOLVE",value:t})}).catch(t=>{p({type:"REJECT",error:t})}),()=>gb(e)},[o,p]),(0,s.useEffect)(()=>{void 0!==g&&(!1!==g?g&&n&&n(g):f&&($w(!1,f.toString()),i&&i(f)))},[g]);const v=(0,s.useCallback)(()=>{a&&a()},[a]),w=(0,s.useCallback)(t=>{$w(!1,t.toString()),r&&r(t)},[r]);const b=(0,s.useMemo)(()=>o.getViewport({scale:d,rotation:h}),[o,h,d]);return(0,s.useLayoutEffect)(function(){if(!o||!g)return;const{current:t}=m;if(!t)return;t.innerHTML="";const i=o.streamTextContent({includeMarkedContent:!0}),n=new Zh({container:t,textContentSource:i,viewport:b}),s=n;return n.render().then(()=>{const i=document.createElement("div");i.className="endOfContent",t.append(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((0,pt.A)({pageIndex:l,pageNumber:c,itemIndex:s},i));r.innerHTML=a,t+=i.str&&i.hasEOL?2:1})}v()}).catch(w),()=>gb(s)},[e,w,v,o,l,c,g,b]),(0,Hw.jsx)("div",{className:Vw("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=m.current;t&&t.classList.remove("selecting")},onMouseDown:function(){const t=m.current;t&&t.classList.add("selecting")},ref:m})}const Wb=["_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"],zb=1;function jb(t){const e=xb(),i=(0,pt.A)((0,pt.A)({},e),t),{_className:n="react-pdf__Page",_enableRegisterUnregisterPage:r=!0,canvasBackground:a,canvasRef:o,children:l,className:c,customRenderer:h,customTextRenderer:d,devicePixelRatio:u,error:p="Failed to load the page.",height:g,inputRef:f,loading:m="Loading page\u2026",noData:v="No page specified.",onGetAnnotationsError:w,onGetAnnotationsSuccess:b,onGetStructTreeError:y,onGetStructTreeSuccess:A,onGetTextError:E,onGetTextSuccess:x,onLoadError:_,onLoadSuccess:k,onRenderAnnotationLayerError:C,onRenderAnnotationLayerSuccess:S,onRenderError:M,onRenderSuccess:T,onRenderTextLayerError:P,onRenderTextLayerSuccess:L,pageIndex:R,pageNumber:D,pdf:F,registerPage:I,renderAnnotationLayer:N=!0,renderForms:O=!1,renderMode:B="canvas",renderTextLayer:W=!0,rotate:z,scale:j=zb,unregisterPage:H,width:U}=i,V=(0,jw.A)(i,Wb),[G,q]=rb(),{value:X,error:Y}=G,K=(0,s.useRef)(null);Jw(F);const Q=lb(D)?D-1:null!==R&&void 0!==R?R:null,Z=null!==D&&void 0!==D?D:lb(R)?R+1:null,J=null!==z&&void 0!==z?z:X?X.rotate:null,$=(0,s.useMemo)(()=>{if(!X)return null;let t=1;const e=null!==j&&void 0!==j?j:zb;if(U||g){const e=X.getViewport({scale:1,rotation:J});U?t=U/e.width:g&&(t=g/e.height)}return e*t},[g,X,J,j,U]);(0,s.useEffect)(function(){return()=>{lb(Q)&&r&&H&&H(Q)}},[r,F,Q,H]),(0,s.useEffect)(function(){q({type:"RESET"})},[q,F,Q]),(0,s.useEffect)(function(){if(!F||!Z)return;const t=Yw(F.getPage(Z)),e=t;return t.promise.then(t=>{q({type:"RESOLVE",value:t})}).catch(t=>{q({type:"REJECT",error:t})}),()=>gb(e)},[q,F,Z]),(0,s.useEffect)(()=>{void 0!==X&&(!1!==X?function(){if(k){if(!X||!$)return;k(fb(X,$))}if(r&&I){if(!lb(Q)||!K.current)return;I(Q,K.current)}}():Y&&($w(!1,Y.toString()),_&&_(Y)))},[X,$]);const tt=(0,s.useMemo)(()=>lb(Q)&&Z&&lb(J)&&lb($)?{_className:n,canvasBackground:a,customTextRenderer:d,devicePixelRatio:u,onGetAnnotationsError:w,onGetAnnotationsSuccess:b,onGetStructTreeError:y,onGetStructTreeSuccess:A,onGetTextError:E,onGetTextSuccess:x,onRenderAnnotationLayerError:C,onRenderAnnotationLayerSuccess:S,onRenderError:M,onRenderSuccess:T,onRenderTextLayerError:P,onRenderTextLayerSuccess:L,page:X,pageIndex:Q,pageNumber:Z,renderForms:O,renderTextLayer:W,rotate:J,scale:$}:null,[n,a,d,u,w,b,y,A,E,x,C,S,M,T,P,L,X,Q,Z,O,W,J,$]),et=(0,s.useMemo)(()=>Qw(V,()=>X?$?fb(X,$):void 0:X),[V,X,$]),it="".concat(Q,"@").concat($,"/").concat(J);function nt(){switch(B){case"custom":return Jw(h),(0,Hw.jsx)(h,{},"".concat(it,"_custom"));case"none":return null;default:return(0,Hw.jsx)(Ob,{canvasRef:o},"".concat(it,"_canvas"))}}return(0,Hw.jsx)("div",(0,pt.A)((0,pt.A)({className:Vw(n,c),"data-page-number":Z,ref:Eb(f,K),style:{"--scale-round-x":"1px","--scale-round-y":"1px","--scale-factor":"1","--user-unit":"".concat($),"--total-scale-factor":"calc(var(--scale-factor) * var(--user-unit))",backgroundColor:a||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},et),{},{children:Z?null===F||void 0===X||null===X?(0,Hw.jsx)(ib,{type:"loading",children:"function"===typeof m?m():m}):!1===F||!1===X?(0,Hw.jsx)(ib,{type:"error",children:"function"===typeof p?p():p}):function(){if(t=tt,!Boolean(null===t||void 0===t?void 0:t.page))throw new Error("page is undefined");var t;const e="function"===typeof l?l(tt):l;return(0,Hw.jsxs)(_b.Provider,{value:tt,children:[nt(),W?(0,Hw.jsx)(Bb,{},"".concat(it,"_text")):null,N?(0,Hw.jsx)(Cb,{},"".concat(it,"_annotations")):null,e]})}():(0,Hw.jsx)(ib,{type:"no-data",children:"function"===typeof v?v():v})}))}var Hb=i(50805),Ub=i(15747),Vb=i(67346);const Gb=function(t,e){e=Object.assign({},{defaultValue:"defaultValue",value:"value",onChange:"onChange"},e);var i=(0,s.useRef)(e.value in t),n=(0,s.useState)(t[e.defaultValue]),r=(0,Vb.A)(n,2),a=r[0],o=r[1],l=i.current?t[e.value]:a;return[l,(0,x.A)(function(n){for(var s="function"===typeof n?l=n(l):n,r=arguments.length,a=new Array(r>1?r-1:0),c=1;c<r;c++)a[c-1]=arguments[c];t[e.onChange]&&t[e.onChange].apply(t,[s].concat(a)),i.current||o(s)})]};var qb;const Xb=["title","titleId"];function Yb(){return Yb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},Yb.apply(null,arguments)}function Kb(t,e){let{title:i,titleId:n}=t,r=function(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,Xb);return s.createElement("svg",Yb({t:1731465967110,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1541,xmlnsXlink:"http://www.w3.org/1999/xlink",width:200,height:200,ref:e,"aria-labelledby":n},r),i?s.createElement("title",{id:n},i):null,qb||(qb=s.createElement("path",{d:"M112 166h-7q-21 3-35 18.5T56 222v562q3 20 18.5 34.5T112 833h388l56-167-119-179-103 123-72-71-5-5q-17-13-38-11.5T183 539l-71 71V222h259l18-56H112z m388 0l-18 56h407v379L654 327l-4-5q-18-16-41.5-14.5T570 328l-72 85 169 253-55 167h277l7-1q21-2 35-18t14-37V215q-3-21-18.5-35T889 166H500zM306 277q-34 0-58.5 24.5t-24.5 59q0 34.5 24.5 59T306 444q23 0 42.5-12t30.5-31l-45-68 14-44q-19-12-42-12z",fill:"#E0E0E0","p-id":1542})))}const Qb=s.forwardRef(Kb);i.p;var Zb,Jb;const $b=["title","titleId"];function ty(){return ty=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},ty.apply(null,arguments)}function ey(t,e){let{title:i,titleId:n}=t,r=function(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,$b);return s.createElement("svg",ty({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u7f16\u7ec4 10"):i?s.createElement("title",{id:n},i):null,Zb||(Zb=s.createElement("defs",null,s.createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"linearGradient-1"},s.createElement("stop",{stopColor:"#F5F5F5",offset:"0%"}),s.createElement("stop",{stopColor:"#E0E0E0",offset:"100%"})))),Jb||(Jb=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807Icon",transform:"translate(-760.000000, -2364.000000)"},s.createElement("g",{id:"\\u7F16\\u7EC4-10",transform:"translate(760.000000, 2364.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u65E0\\u6027\\u522B",fill:"url(#linearGradient-1)"},s.createElement("rect",{id:"Mask\\u5907\\u4EFD",x:0,y:0,width:56,height:56})),s.createElement("g",{id:"\\u5934\\u50CF_avatar-(1)\\u5907\\u4EFD",transform:"translate(8.000000, 12.000000)",fill:"#FFFFFF",fillRule:"nonzero"},s.createElement("path",{d:"M40,41.3851428 C40,40.9828571 40,35.6022857 39,33.792 C38.4,32.5851428 37.4,31.7805714 36.2,30.976 C34.8,30.1714285 33,29.3668572 30.8,28.9645714 C30.6,28.9645714 29.2,28.7634285 28,28.3611428 C26.6,27.9588571 26,27.7577143 25.8,27.5565714 L25.8,26.3497143 C26,23.7348571 27.4,22.3268572 28.6,21.12 C29,20.7177143 29.4,20.3154285 29.8,19.712 C31.2,17.7005714 31.4,15.6891429 31.4,15.2868571 C31.4,14.8845714 31.4,14.6834286 31.2,14.2811429 C31,13.8788572 30.8,13.4765714 30.6,13.2754286 C30.6,12.672 30.8,12.0685714 30.8,11.6662857 C30.8,10.6605715 31,9.05142856 30.6,7.44228572 C30.6,7.24114285 30.6,6.83885715 30.4,6.43657145 C30,5.22971431 29.6,4.22400004 28.8,3.4194286 C28.4,3.4194286 25.6,0.603428618 18,0 L15,0 C14.6,0 14.2,0 13.8,0.201142873 C12.4,0.603428571 12.2,1.60914289 12,2.01142859 L12,3.21828573 L11.8,3.4194286 C11.6,3.62057147 9.60000004,5.43085719 9.40000002,7.84457142 C9.20000001,9.45371426 9.20000001,11.8674285 9.40000002,13.6777143 C9.20000001,14.08 8.80000002,14.4822858 8.80000002,15.488 C8.80000002,15.8902857 9,17.9017143 10.4,19.712 C10.8,20.1142857 11,20.5165715 11.6,21.12 C12.8,22.528 14.2,23.936 14.4,26.3497143 L14.4,27.5565714 C14,27.7577143 13.4,28.16 12,28.5622857 C10.6,28.9645714 9.20000001,29.1657143 9,29.1657143 C7,29.568 5.19999998,30.1714285 3.80000001,30.976 C2.60000001,31.7805714 1.60000003,32.7862857 1,33.792 C0,35.6022857 0,40.9828571 0,41.3851428 L0,42.3908571 C0,43.1954286 0.800000015,44 1.8,44 L38.2,44 C39.2,44 40,43.1954286 40,42.1897143 L40,41.3851428 Z",id:"\\u8DEF\\u5F84"})))))))}const iy=s.forwardRef(ey);i.p;var ny;const sy=["title","titleId"];function ry(){return ry=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},ry.apply(null,arguments)}function ay(t,e){let{title:i,titleId:n}=t,r=function(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,sy);return s.createElement("svg",ry({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u5934\u50cf-\u5973"):i?s.createElement("title",{id:n},i):null,ny||(ny=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-792.000000, -230.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u5973",transform:"translate(792.000000, 230.000000)"},s.createElement("rect",{id:"Mask\\u5907\\u4EFD",fill:"#F1F1F1",x:0,y:0,width:56,height:56}),s.createElement("g",{id:"\\u5973",transform:"translate(9.000000, 13.000000)",fillRule:"nonzero"},s.createElement("path",{d:"M19.1219936,0 C26.9032378,0 28.9014356,5.58612362 28.7427755,11.9244473 C28.5841154,18.262771 25.3419303,30.1526079 25.3419303,30.1526079 L19.1334908,30.1526079 L19.1219936,0 Z",id:"\\u8DEF\\u5F84",fill:"#370B00"}),s.createElement("path",{d:"M18.5011497,0 C10.7291032,0 8.7217078,5.58612362 8.88726615,11.9244473 C9.05282451,18.262771 12.2881114,30.1526079 12.2881114,30.1526079 L18.4965509,30.1526079 L18.5011497,0 Z",id:"\\u8DEF\\u5F84",fill:"#420E04"}),s.createElement("path",{d:"M14.2564166,26.7815518 C11.9891865,29.1996673 7.8778199,30.5010196 3.9780001,31.1309294 C0.0781803048,31.7608392 0,35.9948487 0,37.2177506 L0,43 L18.5011497,43 L18.5011497,26.7815518 L14.2564166,26.7815518 Z",id:"\\u8DEF\\u5F84",fill:"#EAE9E8"}),s.createElement("path",{d:"M18.5011497,21.5807577 L14.1736374,21.5807577 L14.1736374,27.196877 C14.1736374,28.0298347 15.5532906,30.6740717 18.5011497,30.6740717 L18.5011497,21.5807577 Z",id:"\\u8DEF\\u5F84",fill:"#EAC1A4"}),s.createElement("path",{d:"M18.5011497,3.92251556 C12.1202536,3.92251556 11.1751911,8.53723974 11.1751911,14.2502683 C11.1751911,20.0948165 16.693804,24.5872505 18.5011497,24.5872505 L18.5011497,3.92251556 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("path",{d:"M11.0372258,13.419618 C10.5888385,11.7352436 9.97489279,11.7352436 9.71505809,12.1621056 C9.45522339,12.5889676 10.351998,14.2387315 10.3749922,15.6000751 C10.3979864,16.9614187 10.7980859,17.1552372 11.294761,16.663769 C11.7914362,16.1723009 11.0372258,13.419618 11.0372258,13.419618 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#DDDCDB",points:"14.247219 27.1368856 11.4603194 28.8327967 15.6199739 36.09868 18.5011497 30.6740717"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#F4F2F2",points:"14.247219 26.7815518 11.4603194 28.8327967 15.6199739 35.7433462 18.5011497 30.6740717"}),s.createElement("path",{d:"M22.7642782,26.7815518 C25.0338077,29.1996673 29.1451744,30.5010196 33.0426947,31.1309294 C36.940215,31.7608392 37,35.9948487 37,37.2177506 L37,43 L18.5011497,43 L18.5011497,26.7815518 L22.7642782,26.7815518 Z",id:"\\u8DEF\\u5F84",fill:"#DDDCDB"}),s.createElement("path",{d:"M18.5011497,21.5807577 L22.8263626,21.5807577 L22.8263626,27.196877 C22.8263626,28.0298347 21.4467094,30.6740717 18.5011497,30.6740717 L18.5011497,21.5807577 Z",id:"\\u8DEF\\u5F84",fill:"#DDB597"}),s.createElement("path",{d:"M18.5011497,3.92251556 C24.8797464,3.92251556 25.8248089,8.53723974 25.8248089,14.2502683 C25.8248089,20.0948165 20.306196,24.5872505 18.5011497,24.5872505 L18.5011497,3.92251556 Z",id:"\\u8DEF\\u5F84",fill:"#EDC19C"}),s.createElement("path",{d:"M25.9673731,13.419618 C26.4272575,11.7352436 27.0320055,11.7352436 27.2918402,12.1621056 C27.5516748,12.5889676 26.6526008,14.2387315 26.6296066,15.6000751 C26.6066124,16.9614187 26.206513,17.1552372 25.7098378,16.663769 C25.2131626,16.1723009 25.967373,13.4196179 25.9673731,13.419618 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#DDDCDB",points:"22.752781 27.1368856 25.5396806 28.8327967 21.3800261 36.09868 18.5011497 30.6740717"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#EFEEED",points:"22.752781 26.7815518 25.5396806 28.8327967 21.3800261 35.7433462 18.5011497 30.6740717"}),s.createElement("path",{d:"M9.10801068,29.8549582 C7.43626653,30.4331409 5.71634854,30.860165 3.96880244,31.1309294 C0.0712820906,31.7608392 0,35.9948487 0,37.2177506 L0,43 L16.3373936,43 L9.10801068,29.848036 L9.10801068,29.8549582 Z",id:"\\u8DEF\\u5F84",fill:"#1D1D1D"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#303030",points:"9.10801068 29.8549582 7.32595862 30.4110324 7.10061524 34.8896222 10.4393761 36.7216678 10.4393761 42.9976927 16.3373936 42.9976927 9.10801068 29.8549582"}),s.createElement("path",{d:"M27.8942887,29.8549582 C29.5652485,30.433138 31.2844029,30.8601635 33.0311976,31.1309294 C36.940215,31.7608392 37,35.9902339 37,37.2177506 L37,43 L20.6741036,43 L27.9034864,29.848036 L27.8942887,29.8549582 Z",id:"\\u8DEF\\u5F84",fill:"#1D1D1D"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#303030",points:"27.8942887 29.8549582 29.6763408 30.4110324 29.8993848 34.8896222 26.5629234 36.7216678 26.5629234 42.9976927 20.6626064 42.9976927"}),s.createElement("path",{d:"M10.8072836,5.07619661 C9.67366851,9.80398152 11.1062085,14.2871861 11.267168,14.7163554 C11.267168,14.7163554 12.1248524,14.8524898 13.3366478,12.6581885 C14.9140514,9.79936683 16.8041763,8.32265508 18.4459636,7.55661088 L18.4459636,0 C14.334597,0 11.6005842,1.79974245 10.8072836,5.07619661 Z",id:"\\u8DEF\\u5F84",fill:"#471207"}),s.createElement("path",{d:"M25.6224598,14.7140481 C25.7742216,14.2871861 27.2067616,9.80398157 26.0823442,5.07388927 C25.2936424,1.80204979 22.5573302,0 18.4459636,0 L18.4459636,7.55661088 C19.5462153,7.03397245 20.7468113,6.75837793 21.9640793,6.74903414 C24.4014667,8.41494958 25.6155615,11.7513952 25.6224598,14.7140481 Z",id:"\\u8DEF\\u5F84",fill:"#370B00"})))))))}const oy=s.forwardRef(ay);i.p;var ly;const cy=["title","titleId"];function hy(){return hy=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},hy.apply(null,arguments)}function dy(t,e){let{title:i,titleId:n}=t,r=function(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,cy);return s.createElement("svg",hy({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u5934\u50cf-\u7537"):i?s.createElement("title",{id:n},i):null,ly||(ly=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-792.000000, -166.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u7537",transform:"translate(792.000000, 166.000000)"},s.createElement("rect",{id:"Mask",fill:"#F1F1F1",x:0,y:0,width:56,height:56}),s.createElement("g",{id:"Group-46",transform:"translate(7.671233, 12.041096)"},s.createElement("path",{d:"M20.3287113,17.7016171 L14.8261307,17.7016171 L14.8261307,21.8854179 L14.8261307,24.6737429 C14.8261307,25.7091313 16.5713146,28.9930418 20.3287113,28.9930418 L20.3287113,17.7016171 Z",id:"Fill-2",fill:"#DDB597"}),s.createElement("path",{d:"M18.1163052,33.9077874 C18.1163052,33.9077874 16.9107652,32.9969521 15.601989,31.3099039 C14.2932128,29.6230745 12.4333964,25.9116559 12.4333964,25.9116559 C11.796773,26.003812 11.1961258,26.0999083 10.6276562,26.2001637 L19.059062,43.7260274 L20.3287336,43.7260274 L20.3287336,29.2137349 L18.1163052,33.9077874 Z",id:"Fill-4",fill:"#EFEEED"}),s.createElement("path",{d:"M12.4334858,31.7147341 L8.64391162,30.0953254 L10.2679829,26.2654829 C4.85701892,27.2599373 2.57978853,28.6396525 1.7219446,30.5000682 C0.757736068,32.592078 0,43.7258961 0,43.7258961 L18.0757257,43.7258961 L10.3430638,38.5075824 L12.4334858,31.7147341 Z",id:"Fill-6",fill:"#1D1D1D"}),s.createElement("path",{d:"M20.3287113,17.7016171 L25.8312918,17.7016171 L25.8312918,21.8854179 L25.8312918,24.6737429 C25.8312918,25.7091313 24.0861079,28.9930418 20.3287113,28.9930418 L20.3287113,17.7016171 Z",id:"Fill-8",fill:"#D1AC93"}),s.createElement("path",{d:"M22.5412291,33.9077874 C22.5412291,33.9077874 23.7467691,32.9969521 25.0553218,31.3099039 C26.364098,29.6230745 28.2241379,25.9116559 28.2241379,25.9116559 C28.8607613,26.003812 29.4614085,26.0999083 30.0296546,26.2001637 L21.5984722,43.7260274 L20.3288006,43.7260274 L20.3288006,29.2137349 L22.5412291,33.9077874 Z",id:"Fill-10",fill:"#DDDCDB"}),s.createElement("path",{d:"M28.2240485,31.7147341 L32.0133992,30.0953254 L30.3895513,26.2654829 C35.8005153,27.2599373 38.0777457,28.6396525 38.9353662,30.5000682 C39.8997982,32.592078 40.6575342,43.7258961 40.6575342,43.7258961 L22.5815851,43.7258961 L30.314247,38.5075824 L28.2240485,31.7147341 Z",id:"Fill-12",fill:"#0F0F0F"}),s.createElement("path",{d:"M20.3287113,3.71115593 C14.1291744,3.71115593 13.2107742,8.10203448 13.2107742,13.5180132 C13.2107742,19.5112264 15.9664218,23.3250894 20.3287113,23.3250894 L20.3287113,3.71115593 Z",id:"Fill-14",fill:"#EBCFB7"}),s.createElement("path",{d:"M20.3287113,3.71115593 C26.5282481,3.71115593 27.4466484,8.10203448 27.4466484,13.5180132 C27.4466484,19.5112264 24.6910007,23.3250894 20.3287113,23.3250894 L20.3287113,3.71115593 Z",id:"Fill-16",fill:"#EFC7A6"}),s.createElement("path",{d:"M13.0715617,12.7308772 C12.6353774,11.1337961 12.0383055,11.1337961 11.7858013,11.5387578 C11.5330737,11.9435005 12.4056656,13.5180351 12.4286815,14.8001217 C12.4516974,16.0824272 12.8398388,16.2752765 13.3231721,15.80771 C13.8062819,15.3399246 13.0715617,12.7308772 13.0715617,12.7308772",id:"Fill-18",fill:"#EBCFB7"}),s.createElement("path",{d:"M27.5859726,12.7308772 C28.0221568,11.1337961 28.6192287,11.1337961 28.8717329,11.5387578 C29.1242371,11.9435005 28.2516452,13.5180351 28.2288528,14.8001217 C28.2058369,16.0824272 27.817472,16.2752765 27.3343622,15.80771 C26.8510289,15.3399246 27.5859726,12.7308772 27.5859726,12.7308772",id:"Fill-20",fill:"#EBCFB7"}),s.createElement("path",{d:"M12.3795884,25.9199302 C11.7632994,26.0094596 11.1796348,26.1029291 10.6277008,26.2001199 C10.5054709,26.2217908 10.3870398,26.2436806 10.2679382,26.2655705 L8.64386693,30.0951941 L12.4334411,31.7148217 L10.3430191,38.50767 L18.075681,43.7259836 L19.0591067,43.7259836 L12.3795884,25.9199302 Z",id:"Fill-22",fill:"#3A3939"}),s.createElement("path",{d:"M32.0133992,30.0952379 L30.3895513,26.2656142 C30.2834102,26.2459134 30.1768221,26.2264315 30.0686699,26.2071684 L30.0686699,26.2069495 C30.0628601,26.205855 30.0566033,26.2051983 30.0510169,26.2041039 C30.0438664,26.2027905 29.1706041,26.0423381 28.2939899,25.9223819 L21.6763687,43.5636049 L21.6765921,43.5633861 L21.5986063,43.7260274 L22.5815851,43.7260274 L30.314247,38.5077137 L28.2240485,31.7146466 L32.0133992,30.0952379 Z",id:"Fill-24",fill:"#2D2D2D"}),s.createElement("path",{d:"M20.3287113,6.64640537 L20.3287113,0 C16.3335585,0 13.6766779,1.70762469 12.9146962,4.81335203 C11.8139567,9.29901349 13.0521211,13.3967874 13.2000483,13.8032813 C13.8612518,13.932869 14.0167765,11.6642083 14.0167765,9.24144327 C14.0167765,3.89113401 16.7697427,6.64640537 20.3287113,6.64640537",id:"Fill-26",fill:"#370B00"}),s.createElement("path",{d:"M20.3287113,6.64640537 L20.3287113,0 C24.3238641,0 26.9807446,1.70762469 27.7427263,4.81335203 C28.8434659,9.29901349 27.605078,13.3967874 27.4573742,13.8032813 C26.7961707,13.932869 26.640646,11.6642083 26.640646,9.24144327 C26.640646,3.89113401 23.8876798,6.64640537 20.3287113,6.64640537",id:"Fill-28",fill:"#230600"}),s.createElement("polygon",{id:"Fill-30",fill:"#2A798C",points:"20.3287113 33.2162443 18.6501169 33.2162443 19.425506 43.7259836 20.3287113 43.7259836"}),s.createElement("polygon",{id:"Fill-32",fill:"#266C77",points:"21.23214 43.7259179 22.0073056 33.2161786 20.3287113 33.2161786 20.3287113 43.7259179"}),s.createElement("polygon",{id:"Fill-34",fill:"#3691AD",points:"18.2760532 31.4385503 19.1256293 33.2162224 20.3287113 33.2162224 20.3287113 28.9930199"}),s.createElement("polygon",{id:"Fill-36",fill:"#266C77",points:"22.3812799 31.4385503 20.3286219 28.9930199 20.3286219 33.2162224 21.5317039 33.2162224"}),s.createElement("path",{d:"M23.9005061,25.9844833 L25.8313812,24.1571213 C26.8119019,24.7194707 28.2241379,25.9115902 28.2241379,25.9115902 C28.2241379,25.9115902 26.4673343,29.8497873 25.1587815,31.6071019 C23.8497818,33.3639787 22.4846949,34.4026505 22.4846949,34.4026505 L20.3288006,29.2136692 L20.4320369,29.1004989 L23.9005061,25.9844833 Z",id:"Fill-38",fill:"#CCCCCC"}),s.createElement("path",{d:"M23.7972922,25.9115902 L25.8314035,24.1571213 C26.8119243,24.6969242 28.2241602,25.9115902 28.2241602,25.9115902 C28.2241602,25.9115902 26.3641204,29.6230088 25.0553442,31.3098382 C23.7465679,32.9968864 22.5412514,33.9077218 22.5412514,33.9077218 L20.328823,29.2136692 L20.328823,28.9034905 L23.7972922,25.9115902 Z",id:"Fill-40",fill:"#F4F2F2"}),s.createElement("path",{d:"M16.7568047,25.9844833 L14.826153,24.1571213 C13.8456323,24.7194707 12.4333964,25.9115902 12.4333964,25.9115902 C12.4333964,25.9115902 14.1899765,29.8497873 15.4987527,31.6071019 C16.807529,33.3639787 18.1726158,34.4026505 18.1726158,34.4026505 L20.3287336,29.2136692 L20.2252739,29.1004989 L16.7568047,25.9844833 Z",id:"Fill-42",fill:"#CCCCCC"}),s.createElement("path",{d:"M16.8601303,25.9115902 L14.826019,24.1571213 C13.8454982,24.6969242 12.4334858,25.9115902 12.4334858,25.9115902 C12.4334858,25.9115902 14.2933021,29.6230088 15.6020784,31.3098382 C16.9108546,32.9968864 18.1163946,33.9077218 18.1163946,33.9077218 L20.3285995,29.2136692 L20.3285995,28.9034905 L16.8601303,25.9115902 Z",id:"Fill-44",fill:"#FFFFFF"})))))))}const uy=s.forwardRef(dy);i.p;function py(){return py=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},py.apply(this,arguments)}var gy={doc:t=>s.createElement("svg",py({t:1646123881490,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1408,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1409}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1410}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1411}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#2C97FF","p-id":1412}),s.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 16 16h48a64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m0 192h-32V576h32a32 32 0 0 1 32 32v96a32 32 0 0 1-32 32z m160-192a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m32 160a32 32 0 0 1-32 32 32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32z m128 32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32h32a64 64 0 0 0-64-64 64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64h-32a32 32 0 0 1-32 32z",fill:"#FFFFFF","p-id":1413})),docx:t=>s.createElement("svg",py({t:1646123881490,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1408,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1409}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1410}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1411}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#2C97FF","p-id":1412}),s.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 16 16h48a64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m0 192h-32V576h32a32 32 0 0 1 32 32v96a32 32 0 0 1-32 32z m160-192a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m32 160a32 32 0 0 1-32 32 32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32z m128 32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32h32a64 64 0 0 0-64-64 64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64h-32a32 32 0 0 1-32 32z",fill:"#FFFFFF","p-id":1413})),full:t=>s.createElement("svg",py({width:"1em",height:"1em",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),s.createElement("title",null,"\u5145\u6ee1"),s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-145.000000, -1567.000000)",fill:"#222222",fillRule:"nonzero"},s.createElement("g",{id:"\\u5145\\u6EE1",transform:"translate(145.000000, 1567.000000)"},s.createElement("path",{d:"M12.09375,0 C12.35,0 12.6,0.05 12.8359375,0.15 C13.0640625,0.2453125 13.2671875,0.3828125 13.4421875,0.5578125 C13.6171875,0.7328125 13.7546875,0.9375 13.85,1.1640625 C13.95,1.4 14,1.65 14,1.90625 L14,1.90625 L14,12.09375 C14,12.35 13.95,12.6 13.85,12.8359375 C13.7546875,13.0640625 13.6171875,13.2671875 13.4421875,13.4421875 C13.2671875,13.6171875 13.0625,13.7546875 12.8359375,13.85 C12.6,13.95 12.35,14 12.09375,14 L12.09375,14 L1.90625,14 C1.65,14 1.4,13.95 1.1640625,13.85 C0.9359375,13.7546875 0.7328125,13.6171875 0.5578125,13.4421875 C0.3828125,13.2671875 0.2453125,13.0625 0.15,12.8359375 C0.05,12.6 0,12.35 0,12.09375 L0,12.09375 L0,1.90625 C0,1.65 0.05,1.4 0.15,1.1640625 C0.2453125,0.9359375 0.3828125,0.7328125 0.5578125,0.5578125 C0.7328125,0.3828125 0.9375,0.2453125 1.1640625,0.15 C1.4,0.05 1.65,0 1.90625,0 L1.90625,0 Z M12.09375,1.125 L1.90625,1.125 C1.475,1.125 1.125,1.475 1.125,1.90625 L1.125,1.90625 L1.125,12.09375 C1.125,12.525 1.475,12.875 1.90625,12.875 L1.90625,12.875 L12.09375,12.875 C12.525,12.875 12.875,12.525 12.875,12.09375 L12.875,12.09375 L12.875,1.90625 C12.875,1.475 12.525,1.125 12.09375,1.125 L12.09375,1.125 Z M2.5734375,7.484375 C2.878125,7.490625 3.125,7.740625 3.125,8.046875 L3.125,8.046875 L3.125,10.0640625 L5.1265625,8.0625 C5.3453125,7.84375 5.703125,7.84375 5.921875,8.0625 C6.140625,8.28125 6.140625,8.6390625 5.921875,8.8578125 L5.921875,8.8578125 L3.903125,10.875 L5.909375,10.875 C6.2265625,10.875 6.4890625,11.13125 6.484375,11.4484375 C6.478125,11.7546875 6.228125,12 5.921875,12 L5.921875,12 L2.5734375,12 C2.25625,12 2,11.74375 2,11.4265625 L2,11.4265625 L2,8.0578125 C2,7.740625 2.2578125,7.478125 2.5734375,7.484375 Z M11.4296875,2 C11.7453125,2 12,2.25625 12,2.5703125 L12,2.5703125 L12,5.940625 C12,6.2578125 11.7421875,6.5203125 11.4265625,6.5140625 C11.121875,6.5078125 10.875,6.2578125 10.875,5.9515625 L10.875,5.9515625 L10.875,3.9359375 L8.8734375,5.9375 C8.6546875,6.15625 8.296875,6.15625 8.078125,5.9375 C7.859375,5.71875 7.859375,5.3609375 8.078125,5.1421875 L8.078125,5.1421875 L10.0953125,3.125 L8.0890625,3.125 C7.771875,3.125 7.509375,2.86875 7.515625,2.5515625 C7.521875,2.2453125 7.771875,2 8.078125,2 L8.078125,2 Z",id:"\\u5F62\\u72B6\\u7ED3\\u5408"}))))),gif:t=>s.createElement("svg",py({t:1646123917228,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1827,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1828}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1829}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1830}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#CC7598","p-id":1831}),s.createElement("path",{d:"M288 672h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32z m96 80a16 16 0 0 1-16 16 16 16 0 0 1-16-16V560a16 16 0 0 1 16-16 16 16 0 0 1 16 16z m176-208h-96a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h48a16 16 0 0 0 0-32h-48v-64h80a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":1832})),jpg:t=>s.createElement("svg",py({t:1646123877293,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1269,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1270}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1271}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1272}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":1273}),s.createElement("path",{d:"M320 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m256 32h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32zM208 544a16 16 0 0 0-16 16v144a32 32 0 0 1-64 0v-16a16 16 0 0 0-32 0v16a64 64 0 0 0 128 0V560a16 16 0 0 0-16-16z",fill:"#FFFFFF","p-id":1274})),mp4:t=>s.createElement("svg",py({t:1646123927989,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1966,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192c-35.328 0-64 28.672-64 64v320h576c35.328 0 64 28.672 64 64v415.744c0 35.328-28.672 64-64 64H128v31.744c0 35.328 28.672 64 64 64h768c35.328 0 64-28.672 64-64v-640L704 0z",fill:"#EAEAEA","p-id":1967}),s.createElement("path",{d:"M704 0v256c0 35.328 28.672 64 64 64h256L704 0z",fill:"#434854","p-id":1968}),s.createElement("path",{d:"M768 320l256 256V320z",opacity:.1,"p-id":1969}),s.createElement("path",{d:"M704 832c0 17.92-14.336 31.744-31.744 31.744H31.744C13.824 863.744 0 849.408 0 832V480.256c0-17.92 14.336-31.744 31.744-31.744h640c17.92 0 31.744 14.336 31.744 31.744V832z",fill:"#724AE2","p-id":1970}),s.createElement("path",{d:"M537.088 547.84c9.728 0 14.336 4.608 14.336 13.824v132.608h18.944c9.728 0.512 14.336 4.608 14.336 13.312s-5.12 13.312-15.36 13.312h-18.432v37.888c-0.512 9.728-5.12 14.336-13.824 14.336s-13.312-5.12-13.312-15.36v-36.864h-79.36c-12.8-0.512-19.456-4.096-19.456-11.776 0-4.096 1.536-7.68 4.096-11.776l94.208-141.312 0.512-1.024c3.584-4.608 8.192-7.168 13.312-7.168z m-302.592-1.536c7.168 0 11.264 5.12 11.264 15.872v193.536c0 10.752-4.608 15.872-11.264 15.872s-11.264-5.12-11.264-15.872V622.08l-44.544 140.8c-2.048 6.144-8.192 8.704-12.288 8.704s-10.24-3.072-12.288-8.704l-46.08-140.8v133.632c0 10.752-6.144 15.872-12.8 15.872s-12.8-5.12-12.8-15.872V562.176c0-10.752 5.632-15.872 12.8-15.872 4.608 0 10.752 3.072 12.8 8.704L166.4 728.064l56.832-173.056c2.048-6.144 6.144-8.704 11.264-8.704z m121.856 0c35.328 0 63.488 28.672 63.488 64 0 34.816-27.648 62.976-62.464 64h-33.28v79.872c0 8.704-7.168 15.872-15.872 15.872-8.192 0-15.36-6.656-15.872-14.848V562.176c0-8.192 6.656-15.36 14.848-15.872h49.152z m166.912 58.368l-59.904 90.112h59.904v-90.112z m-166.912-26.624h-31.744v64h31.744c17.92 0 31.744-14.848 31.744-32.256s-13.824-31.744-31.744-31.744z",fill:"#FFFFFF","p-id":1971})),pdf:t=>s.createElement("svg",py({t:1646123842588,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1304,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192c-35.328 0-64 28.672-64 64v320h576c35.328 0 64 28.672 64 64v415.744c0 35.328-28.672 64-64 64H128v31.744c0 35.328 28.672 64 64 64h768c35.328 0 64-28.672 64-64v-640L704 0z",fill:"#EAEAEA","p-id":1305}),s.createElement("path",{d:"M704 0v256c0 35.328 28.672 64 64 64h256L704 0z",fill:"#434854","p-id":1306}),s.createElement("path",{d:"M768 320l256 256V320z",opacity:.1,"p-id":1307}),s.createElement("path",{d:"M704 832c0 17.92-14.336 31.744-31.744 31.744H31.744C13.824 863.744 0 849.408 0 832V480.256c0-17.92 14.336-31.744 31.744-31.744h640c17.92 0 31.744 14.336 31.744 31.744V832z",fill:"#CD4050","p-id":1308}),s.createElement("path",{d:"M192 544.256h-48.128c-8.704 0-15.872 7.168-15.872 15.872v192c0 8.704 7.168 15.872 15.872 15.872s15.872-7.168 15.872-15.872v-79.872h31.744c35.328 0 64-28.672 64-64s-28.16-64-63.488-64z m158.72 0c34.816 0 62.976 27.648 64 62.464v97.792c0 34.816-27.648 62.976-62.464 64h-49.664c-8.704 0-15.36-6.656-15.872-14.848V560.64c0-8.704 6.656-15.36 14.848-15.872h49.152z m227.328 0c8.704 0 15.872 7.168 15.872 15.872S586.752 576 578.048 576h-80.384v64h48.128c8.704 0 15.872 7.168 15.872 15.872s-7.168 15.872-15.872 15.872h-48.128v79.872c0 8.704-7.168 15.872-15.872 15.872s-15.872-7.168-15.872-15.872v-192c0-8.704 7.168-15.872 15.872-15.872h96.256zM350.72 576h-31.744v159.744h31.744c17.408 0 31.232-13.824 31.744-30.72v-97.28C382.976 590.336 368.64 576 350.72 576zM192 576c17.92 0 31.744 14.336 31.744 31.744S209.92 640 192 640h-31.744v-64H192z",fill:"#FFFFFF","p-id":1309})),png:t=>s.createElement("svg",py({t:1646123868693,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1130,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1131}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1132}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1133}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":1134}),s.createElement("path",{d:"M160 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m448 32h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32zM400 544a16 16 0 0 0-16 16v137.6l-98.88-146.56a7.36 7.36 0 0 0-2.24-2.24l-2.56-1.6h-16l-2.56 2.24v5.12a13.76 13.76 0 0 0 0 3.52v192a16 16 0 0 0 32 0v-137.6l96 142.08a15.68 15.68 0 0 0 32-3.2v-192A16 16 0 0 0 400 544z",fill:"#FFFFFF","p-id":1135})),ppt:t=>s.createElement("svg",py({t:1646123861524,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":991,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":992}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":993}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":994}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#F05264","p-id":995}),s.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m160-96h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m240-96H464a16 16 0 0 0 0 32h48v176a16 16 0 0 0 32 0V576h48a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":996})),pptx:t=>s.createElement("svg",py({t:1646123861524,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":991,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":992}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":993}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":994}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#F05264","p-id":995}),s.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m160-96h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m240-96H464a16 16 0 0 0 0 32h48v176a16 16 0 0 0 32 0V576h48a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":996})),rar:t=>s.createElement("svg",py({t:1646123940344,className:"icon",viewBox:"0 0 1056 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2245,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M1.248 0h1024v1024h-1024z",fillOpacity:0,"p-id":2246}),s.createElement("path",{d:"M849.248 1024h-672c-41.6 0-76.8-35.2-73.6-80V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v710.4c0 41.6-32 76.8-73.6 76.8z",fill:"#F5F1EC","p-id":2247}),s.createElement("path",{d:"M922.848 313.6h-819.2V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v76.8z",fill:"#E0B773","p-id":2248}),s.createElement("path",{d:"M244.448 252.8v-57.6h25.6l25.6 54.4h25.6l-32-54.4c19.2-6.4 25.6-19.2 25.6-35.2 0-12.8-3.2-22.4-12.8-28.8-6.4-6.4-16-9.6-25.6-9.6h-51.2v131.2h19.2z m32-73.6h-32v-38.4h32c6.4 0 9.6 0 16 3.2 3.2 3.2 3.2 6.4 3.2 16 0 6.4-3.2 9.6-6.4 12.8 0 3.2-6.4 6.4-12.8 6.4z m83.2 73.6l9.6-28.8h48l9.6 28.8h22.4l-48-131.2h-16l-48 131.2h22.4z m54.4-48h-38.4l19.2-57.6 19.2 57.6z m86.4 48v-57.6h25.6l25.6 54.4h22.4l-28.8-54.4c16-6.4 25.6-19.2 25.6-35.2 0-12.8-3.2-22.4-12.8-28.8-6.4-6.4-16-9.6-25.6-9.6h-51.2v131.2h19.2z m28.8-73.6h-28.8v-38.4h32c6.4 0 9.6 0 16 3.2 3.2 3.2 6.4 6.4 6.4 16 0 6.4-3.2 9.6-6.4 12.8-6.4 3.2-12.8 6.4-19.2 6.4z",fill:"#FFFFFF","p-id":2249}),s.createElement("path",{d:"M922.848 236.8h-150.4c-41.6 0-76.8-35.2-73.6-80V0l112 118.4 112 118.4z",fill:"#F5F1EC","p-id":2250}),s.createElement("path",{d:"M426.848 464v409.6h172.8V464h-172.8z m150.4 140.8h-64v41.6h64v44.8h-64v41.6h64v44.8h-64v44.8h-64v-44.8h64v-44.8h-64v-41.6h64v-44.8h-64v-41.6h64v-41.6h-64v-44.8h64v44.8h64v41.6z",fill:"#E0B773","p-id":2251})),rotate:t=>s.createElement("svg",py({width:"1em",height:"1em",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),s.createElement("title",null,"\u65cb\u8f6c"),s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-77.000000, -1567.000000)",fill:"#222222",fillRule:"nonzero"},s.createElement("g",{id:"\\u65CB\\u8F6C",transform:"translate(77.000000, 1567.000000)"},s.createElement("path",{d:"M9.16414904,5.6345426 C9.35110931,5.6345426 9.53041217,5.70881228 9.66261304,5.84101315 C9.79481391,5.97321402 9.86908359,6.15251688 9.86908359,6.33947715 L9.86908359,12.683888 C9.86908359,13.0732126 9.55347364,13.3888226 9.16414904,13.3888226 L0.704934547,13.3888226 C0.315609953,13.3888226 1.8189894e-12,13.0732126 1.8189894e-12,12.683888 L1.8189894e-12,6.33947715 C1.8189894e-12,6.15251688 0.0742696765,5.97321402 0.206470548,5.84101315 C0.33867142,5.70881228 0.517974281,5.6345426 0.704934547,5.6345426 L9.16414904,5.6345426 Z M8.4592145,7.04441168 L1.40986909,7.04441168 L1.40986909,11.9789535 L8.4592145,11.9789535 L8.4592145,7.04441168 Z M7.58258803,0.714885198 C7.63035214,0.738767256 7.66052367,0.787585825 7.66052367,0.840987728 L7.66052367,2.02739256 C11.1625178,2.03011634 14,4.86980822 14,8.37180343 C14,8.62367799 13.8656872,8.85643618 13.6475639,8.98238459 C13.4294405,9.108333 13.1606904,9.108333 12.942567,8.98238459 C12.7244437,8.85643618 12.5900924,8.62367799 12.5901309,8.37180343 C12.5901323,5.64845715 10.3838686,3.43998499 7.66052367,3.43726164 L7.66052367,4.50664733 C7.66052367,4.56004923 7.63035214,4.6088678 7.58258803,4.63274986 C7.53482391,4.65663192 7.47766614,4.65147801 7.43494462,4.61943686 L4.99093655,2.78660706 C4.95543522,2.75998107 4.93454178,2.71819419 4.93454178,2.67381753 C4.93454178,2.62944087 4.95543522,2.58765399 4.99093655,2.561028 L7.43494462,0.728198195 C7.47766614,0.696157053 7.53482391,0.691003139 7.58258803,0.714885198 Z",id:"\\u5F62\\u72B6\\u7ED3\\u5408"}))))),svg:t=>s.createElement("svg",py({t:1646123950101,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2385,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":2386}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":2387}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":2388}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":2389}),s.createElement("path",{d:"M160 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m246.08-96a16 16 0 0 0-20.8 8.96l-64 155.84-64-155.84a16 16 0 1 0-29.44 11.84l77.76 192a24.96 24.96 0 0 0 3.2 4.8 12.8 12.8 0 0 0 4.8 3.2 12.8 12.8 0 0 0 4.8 0h5.76l3.2-2.24a13.12 13.12 0 0 0 5.44-6.4l77.76-192a15.68 15.68 0 0 0-4.48-20.16zM576 672h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":2390})),unknow:t=>s.createElement("svg",py({t:1646123889587,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1551,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M914.92 287.344L697.718 81.474v128.338c0 43.554 34.968 79.189 77.706 79.189h141.99l-2.494-1.657z",fill:"#027AFF","p-id":1552}),s.createElement("path",{d:"M768.284 316.733c-54.48 0-99.056-48.997-99.056-108.882V66.223h-373.35c-30.593 0-55.624 27-55.624 60v348.869h490.802c37.476 0 68.137 33.073 68.137 73.496v207.894c0 40.424-30.661 73.497-68.137 73.497H240.254v70.128c0 33 25.031 60 55.625 60h563.637c30.594 0 55.625-27 55.625-60V316.733H768.284z",fill:"#027AFF","p-id":1553}),s.createElement("path",{d:"M699.302 519.057H156.028c-31.109 0-56.561 25.381-56.561 56.403v153.038c0 31.021 25.452 56.402 56.561 56.402h543.274c31.11 0 56.562-25.38 56.562-56.402V575.46c0-31.022-25.453-56.403-56.562-56.403z m-444.857 211.51c-4.902 4.135-10.558 6.203-16.874 6.203-6.41 0-12.066-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.451-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.545 11.28-7.636 15.417z m29.884-89.775c-2.263 2.068-9.993 6.957-23.379 14.571-3.865 2.256-6.222 4.136-7.07 5.64-0.566 0.846-0.849 2.82-0.849 6.016 0 4.7-1.508 8.367-4.619 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.84-3.29-3.489-2.632-5.186-6.392-5.186-11.28v-10.247c0-7.896 3.583-14.477 10.841-19.553 6.976-3.572 13.764-7.238 20.457-10.81 7.259-3.854 10.84-8.367 10.84-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.57 5.64-2.357 2.068-5.94 6.486-10.653 13.348-4.148 6.017-9.05 8.93-14.612 8.93-4.336 0-7.918-1.503-10.84-4.605-2.923-2.82-4.431-6.487-4.431-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.91-18.143 16.874 0 30.637 4.418 41.384 13.349 10.18 8.46 15.271 18.989 15.271 31.68 0 12.69-3.488 22.372-10.652 29.14zM442.7 730.566c-4.902 4.136-10.558 6.204-16.874 6.204-6.41 0-12.066-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.45-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.64 11.28-7.636 15.417z m29.884-89.774c-2.263 2.068-9.993 6.957-23.38 14.571-3.864 2.256-6.221 4.136-7.07 5.64-0.565 0.846-0.848 2.82-0.848 6.016 0 4.7-1.508 8.367-4.619 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.84-3.29-3.489-2.632-5.186-6.392-5.186-11.28v-10.247c0-7.896 3.583-14.477 10.841-19.553 6.976-3.572 13.764-7.238 20.457-10.81 7.258-3.854 10.84-8.367 10.84-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.57 5.64-2.358 2.068-5.94 6.486-10.653 13.348-4.148 6.017-9.05 8.93-14.612 8.93-4.336 0-7.919-1.503-10.841-4.605-2.922-2.82-4.43-6.487-4.43-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.91-18.143 16.873 0 30.637 4.418 41.383 13.349 10.181 8.46 15.272 18.989 15.272 31.68 0 12.69-3.582 22.372-10.652 29.14z m158.372 89.774c-4.902 4.136-10.558 6.204-16.874 6.204-6.41 0-12.067-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.45-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.64 11.28-7.636 15.417z m29.883-89.774c-2.262 2.068-9.992 6.957-23.378 14.571-3.865 2.256-6.222 4.136-7.07 5.64-0.566 0.846-0.85 2.82-0.85 6.016 0 4.7-1.507 8.367-4.618 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.841-3.29-3.488-2.632-5.185-6.392-5.185-11.28v-10.247c0-7.896 3.582-14.477 10.841-19.553 6.976-3.572 13.763-7.238 20.456-10.81 7.26-3.854 10.841-8.367 10.841-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.571 5.64-2.357 2.068-5.94 6.486-10.653 13.348-4.147 6.017-9.05 8.93-14.611 8.93-4.337 0-7.919-1.503-10.841-4.605-2.923-2.82-4.43-6.487-4.43-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.909-18.143 16.874 0 30.637 4.418 41.384 13.349 10.181 8.46 15.272 18.989 15.272 31.68 0 12.69-3.582 22.372-10.653 29.14z",fill:"#027AFF","p-id":1554})),xls:t=>s.createElement("svg",py({t:1646123896342,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1688,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1689}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1690}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1691}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#009688","p-id":1692}),s.createElement("path",{d:"M512 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m-112 96h-80V560a16 16 0 0 0-32 0v192a16 16 0 0 0 16 16h96a16 16 0 0 0 0-32z m-146.88 8.32l-57.6-91.84 52.8-84.16a15.36 15.36 0 0 0-6.08-21.76 18.56 18.56 0 0 0-23.68 5.76l-42.88 68.8-42.88-68.8a18.56 18.56 0 0 0-23.68-5.76 15.36 15.36 0 0 0-6.4 21.76l53.12 84.16-57.6 91.84a15.36 15.36 0 0 0 6.4 21.76A17.92 17.92 0 0 0 128 760l47.68-75.84L224 760a18.56 18.56 0 0 0 23.68 6.08 15.36 15.36 0 0 0 5.44-21.76z",fill:"#FFFFFF","p-id":1693})),xlsx:t=>s.createElement("svg",py({t:1646123896342,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1688,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1689}),s.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1690}),s.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1691}),s.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#009688","p-id":1692}),s.createElement("path",{d:"M512 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m-112 96h-80V560a16 16 0 0 0-32 0v192a16 16 0 0 0 16 16h96a16 16 0 0 0 0-32z m-146.88 8.32l-57.6-91.84 52.8-84.16a15.36 15.36 0 0 0-6.08-21.76 18.56 18.56 0 0 0-23.68 5.76l-42.88 68.8-42.88-68.8a18.56 18.56 0 0 0-23.68-5.76 15.36 15.36 0 0 0-6.4 21.76l53.12 84.16-57.6 91.84a15.36 15.36 0 0 0 6.4 21.76A17.92 17.92 0 0 0 128 760l47.68-75.84L224 760a18.56 18.56 0 0 0 23.68 6.08 15.36 15.36 0 0 0 5.44-21.76z",fill:"#FFFFFF","p-id":1693})),zip:t=>s.createElement("svg",py({t:1646123936994,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2105,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),s.createElement("defs",null,s.createElement("style",{type:"text/css"})),s.createElement("path",{d:"M0 0h1024v1024H0z",fillOpacity:0,"p-id":2106}),s.createElement("path",{d:"M848 1024H176c-41.6 0-76.8-35.2-73.6-80V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v710.4c0 41.6-32 76.8-73.6 76.8z",fill:"#F5ECEC","p-id":2107}),s.createElement("path",{d:"M921.6 313.6H102.4V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v76.8z",fill:"#BC8585","p-id":2108}),s.createElement("path",{d:"M300.8 252.8v-19.2H240l57.6-96v-16h-80v16h57.6l-57.6 96v16h83.2z m70.4 0V121.6H352v131.2h19.2z m80 0v-51.2H480c12.8 0 22.4-3.2 32-12.8 6.4-6.4 9.6-16 9.6-25.6 0-6.4 0-12.8-3.2-19.2-3.2-6.4-6.4-9.6-9.6-12.8-6.4-3.2-9.6-6.4-16-6.4h-64V256h22.4z m28.8-70.4h-28.8v-41.6H480c6.4 0 9.6 0 12.8 3.2 3.2 0 3.2 3.2 6.4 6.4 0 3.2 3.2 6.4 3.2 9.6 0 6.4-3.2 9.6-6.4 12.8-3.2 6.4-9.6 9.6-16 9.6z",fill:"#FFFFFF","p-id":2109}),s.createElement("path",{d:"M921.6 236.8H771.2c-41.6 0-76.8-35.2-73.6-80V0l112 118.4 112 118.4z",fill:"#F5ECEC","p-id":2110}),s.createElement("path",{d:"M425.6 464v409.6h172.8V464H425.6zM576 604.8h-64v41.6h64v44.8h-64v41.6h64v44.8h-64v44.8h-64v-44.8h64v-44.8h-64v-41.6h64v-44.8h-64v-41.6h64v-41.6h-64v-44.8h64v44.8h64v41.6z",fill:"#BC8585","p-id":2111}))};const fy=t=>{const{size:e,type:i}=Object.assign({},{size:40,type:"unknow"},t),n=gy[i]||gy.unknow;return r().createElement(n,{width:e,height:e})};var my=i(85553),vy=i(92679),wy=i.n(vy),by=i(80263),yy=i.n(by);var Ay=i(57325),Ey=i.n(Ay);function xy(){return xy=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},xy.apply(null,arguments)}function _y(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}const ky=["id","url","error","apis","loading","ttl","cacheName"],Cy=["paramsType","paramsName"],Sy=["data"],My=t=>e=>{var i;const n=Object.assign({},{loading:null,ttl:6e6,cacheName:"file-cache"},e),{id:s,error:o,apis:c,loading:d,ttl:u,cacheName:p}=n,g=_y(n,ky),{apis:f}=(0,a.usePreset)(),m=h()({},f,c);if(!s)return null;if(null==m||null==(i=m.file)||!i.getUrl)return console.warn("\u8bf7\u5728Global\u7ec4\u4ef6\u8bbe\u7f6epreset.apis.file.getUrl\u53c2\u6570"),null;const v=Object.assign({paramsType:"params",paramsName:"id"},m.file.getUrl),{paramsType:w,paramsName:b}=v,y=_y(v,Cy),A={},E=s.split("?")[0];return A[w]={[b]:E},r().createElement(l(),xy({},Object.assign({},y,A),{updateType:"refresh",error:o,loading:d,cache:p,ttl:u,render:e=>{let{data:i}=e,n=_y(e,Sy);return r().createElement(t,xy({},g,{id:E,data:i,fetchApi:n}))}}))},Ty=["data","children"],Py=(My(t=>{let{data:e,children:i}=t;return i(xy({url:e},_y(t,Ty)))}),(t,e)=>{const i=document.createElement("a"),n=new MouseEvent("click");i.download=e,i.target="_blank",i.href=t,i.dispatchEvent(n)}),Ly=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file",i=arguments.length>2?arguments[2]:void 0;if(!t)throw new Error((null==i?void 0:i.notFoundFile)||"\u672a\u83b7\u53d6\u5230\u4e0b\u8f7d\u7684\u6587\u4ef6\u4fe1\u606f");if("string"===typeof t&&/blob:http(s)?:/.test(t))return void Py(t,e);if("[object Blob]"===Object.prototype.toString.call(t)){const i=new Blob([t],{type:t.type});return void Py(URL.createObjectURL(i),e)}const n=(0,o.getAjax)(),{data:s,headers:r}=await n({url:t,responseType:"blob"}),a=null==r?void 0:r["content-disposition"];if(a){const t=a.match(/filename\*?=(?:UTF-8'')?([^;]+)/i);if(t&&t[1])e=decodeURIComponent(t[1].replace(/['"]/g,""));else{const t=a.match(/filename="?([^"]+)"?/i);t&&(e=t[1])}}Py(URL.createObjectURL(new Blob([s],{type:null==s?void 0:s.type})),e)},Ry=t=>{let{url:e,staticUrl:i}=t;return/^(blob:)?https?:\/\//.test(e)?e:i+e},Dy=t=>{let{url:e,staticUrl:i}=t;var n;const{apis:s}=(0,a.usePreset)(),r=i||(null==(n=s.file)?void 0:n.staticUrl)||"";return Ry({staticUrl:r,url:e})},Fy=["paramsType","paramsName"],Iy=["isLoading","data","error","refresh"],Ny=t=>{let{id:e,src:i,filename:n,staticUrl:r,apis:l,onError:c,onSuccess:h}=t;var u,p;const{message:g}=d.App.useApp(),{apis:f}=(0,a.usePreset)(),m=Object.assign({},f,l),v=r||(null==(u=m.file)?void 0:u.staticUrl)||"",[w,b]=(0,s.useState)(!1),y=Object.assign({paramsType:"params",paramsName:"id"},null==(p=m.file)?void 0:p.getUrl),{paramsType:A,paramsName:E}=y,_=_y(y,Fy),k={};k[A]={[E]:e};const C=(0,o.useFetch)(Object.assign({},_,k,{auto:!1})),{isLoading:S,data:M,error:T,refresh:P}=C,L=_y(C,Iy),R=(0,x.A)(c||g.error),D=(0,x.A)(h),F=(0,x.A)(t=>Ly(Ry({staticUrl:v,url:t}),n).then(D).catch(t=>{R(t.message)}));return(0,s.useEffect)(()=>{S||(T?R(T):M&&(b(!0),F(M).then(()=>{b(!1)})))},[S,T,M,R]),xy({},L,{isLoading:S||w,download:()=>i?F(i):P(e?k:{})})},Oy={unnamedDownloadFile:"\u672a\u547d\u540d\u4e0b\u8f7d\u6587\u4ef6",fileUpload:"\u4e0a\u4f20\u6587\u4ef6",uploadTips:"\u652f\u6301\u6269\u5c55\u540d{accept}\uff0c\u5355\u4e2a\u6587\u4ef6\u5927\u5c0f\u4e0d\u8d85\u8fc7{fileSize}M\uff0c\u6700\u591a\u4e0a\u4f20{maxLength}\u4e2a\u9644\u4ef6",maxLengthError:"\u4e0a\u4f20\u6587\u4ef6\u4e0d\u80fd\u8d85\u8fc7\u6700\u5927\u5141\u8bb8\u6570\u91cf{maxLength}",fileSizeError:"\u6587\u4ef6{filename}\u4e0d\u80fd\u8d85\u8fc7{fileSize}MB!",uploadError:"\u6587\u4ef6{filename}\u4e0a\u4f20\u9519\u8bef{error}",uploadAnomaly:"\u6587\u4ef6{filename}\u4e0a\u4f20\u5f02\u5e38{error}",fileLoadedError:"\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25",fileNotFoundError:"\u672a\u6307\u5b9a\u6587\u4ef6",pageNotFoundError:"\u672a\u6307\u5b9a\u9875\u9762",unSupportFileType:"\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u7c7b\u578b",unSupportFileTypeDescription:"\u7cfb\u7edf\u4e0d\u652f\u6301\u8be5\u6587\u4ef6\u7c7b\u578b\u9884\u89c8\uff0c\u8bf7\u4e0b\u8f7d\u5230\u672c\u5730\u540e\u8fdb\u884c\u9884\u89c8",uploading:"\u6b63\u5728\u4e0a\u4f20",unNamedDownloadFile:"\u672a\u547d\u540d\u4e0b\u8f7d\u6587\u4ef6",notFoundFile:"\u672a\u83b7\u53d6\u5230\u4e0b\u8f7d\u7684\u6587\u4ef6\u4fe1\u606f",downloadSuccess:"\u4e0b\u8f7d\u6210\u529f",pleaseSetApi:"\u8bf7\u5728Global\u7ec4\u4ef6\u8bbe\u7f6epreset.apis.file.getUrl\u53c2\u6570",filePreview:"\u6587\u4ef6\u9884\u89c8"},By=["id","src","filename","api","onSuccess","onError","onClick"],Wy=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),i=Object.assign({},{filename:e({id:"unnamedDownloadFile"})},t),{id:n,src:s,filename:a,api:o,onSuccess:l,onError:c,onClick:h}=i,p=_y(i,By),{isLoading:g,download:f}=Ny({id:n,src:s,filename:a,api:o,onError:c,onSuccess:l});return r().createElement(d.Button,xy({icon:r().createElement(u.A,null)},k()(p,["locale"]),{loading:g,onClick:function(){h&&h(...arguments),f()}}))});Wy.useDownload=Ny,Wy.download=Py,Wy.downloadBlobFile=Ly;var zy="_Cmp6z",jy="_lmC4r",Hy="_-jyU7",Uy="_lN9hC",Vy="_yaqrz",Gy="_SXsiw",qy="_15U-a",Xy="_tpRpL";const Yy=["className","url","maxWidth","ignoreContent"],Ky=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{let{data:e,apis:i,contentWindowUrl:n}=t;var o;const l=(0,s.useRef)(null),{apis:c}=(0,a.usePreset)(),{formatMessage:h}=(0,C.useIntl)(),d=Object.assign({},c,i),u=n||(null==(o=d.file)?void 0:o.contentWindowUrl)||"https://cdn.jsdelivr.net/npm/@kne/iframe-resizer@0.1.3/dist/contentWindow.js";return(0,s.useEffect)(()=>{const t=(new DOMParser).parseFromString(e,"text/html");t.querySelectorAll("script").forEach(t=>{t.parentElement.removeChild(t)});const i=document.createElement("script");i.src=u,t.head.appendChild(i);const n=document.createElement("style");n.innerText="html,body{height:auto!important;}body{pointer-events: none;background: #FFFFFF;}",t.head.appendChild(n),l.current.srcdoc=t.documentElement.outerHTML},[e]),(0,s.useEffect)(()=>{ct({checkOrigin:!1},l.current)},[]),r().createElement("iframe",{title:h({id:"filePreview"}),frameBorder:"0",width:"100%",ref:l})}),Qy=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),i=Object.assign({},t),{className:n,url:s,maxWidth:a,ignoreContent:o}=i,c=_y(i,Yy),h=r().createElement("iframe",{title:e({id:"filePreview"}),src:s,width:"100%",className:Xy});return r().createElement("div",{className:dt()(n,zy),style:{maxWidth:a}},o?h:r().createElement(l(),{url:s,transformResponse:t=>{let{data:e}=t;return{data:{code:200,results:e}}},showError:!1,error:h,render:t=>{let{data:e}=t;return r().createElement(Ky,xy({},c,{url:s,data:e}))}}))}),Zy=["url","filename","type"],Jy=t=>{var e;let{url:i,filename:n,type:s}=t,o=_y(t,Zy);const{apis:l}=(0,a.usePreset)(),c=Object.assign({},l,o.apis),h=Dy({staticUrl:o.staticUrl||(null==(e=c.file)?void 0:e.staticUrl),url:i}),d=s&&lA[s]||cA(n||h);return r().createElement(d,xy({},o,{url:h}))},$y=["url","apis","className"],tA=(0,s.memo)((0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{var e;const{formatMessage:i}=(0,C.useIntl)(),{url:n,apis:o,maxWidth:l,scale:c,rotate:h,className:u,pdfjsUrl:p}=Object.assign({},{autoSize:!0,renderTextLayer:!1,scale:100,rotate:0,maxWidth:1200},t),[g,f]=(0,s.useState)(0),{apis:m}=(0,a.usePreset)(),v=Object.assign({},m,o),w=p||(null==(e=v.file)?void 0:e.pdfjsUrl)||"https://cdn.jsdelivr.net/npm/pdfjs-dist@5.4.296";zc.workerSrc=w+"/build/pdf.worker.min.mjs";const b=(0,s.useMemo)(()=>({file:n,options:{standardFontDataUrl:w+"/standard_fonts/",cMapUrl:w+"/cmaps/",cMapPacked:!0}}),[w,n]),[y,A]=(0,s.useState)(l),E=(0,Hb.A)(()=>{E.current&&E.current.clientWidth&&A(Math.min(E.current.clientWidth,l))});return r().createElement("div",{ref:E,className:dt()(u,zy),style:{maxWidth:l}},r().createElement(Ab,xy({},b,{error:i({id:"fileLoadedError"}),loading:r().createElement("div",{className:jy},r().createElement(d.Spin,null)),noData:i({id:"fileNotFoundError"}),onLoadSuccess:t=>{let{numPages:e}=t;f(e)}}),r().createElement(d.Flex,{vertical:!0,gap:8},g>=1&&Array.from(new Array(g),(t,e)=>r().createElement(jb,{key:"page_".concat(e),className:"preview-item",scale:c/100,rotate:h,pageNumber:e+1,width:y,loading:null,renderAnnotationLayer:!1,renderTextLayer:!0,noData:i({id:"pageNotFoundError"})})))))})),eA=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{let{url:e,className:i,maxWidth:n}=t;const{formatMessage:a}=(0,C.useIntl)(),[l,c]=(0,s.useState)(""),[h,u]=(0,s.useState)(!0),[p,g]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(0,o.getAjax)()({url:e,method:"GET"}).then(t=>{let{data:e}=t;c(e),u(!1)},()=>{u(!1),g(!0)})},[e]),r().createElement("div",{className:dt()(i,zy),style:{maxWidth:n}},h?r().createElement("div",{className:jy},r().createElement(d.Spin,null)):null,r().createElement("div",{className:Hy},p?r().createElement("div",{className:Uy},a({id:"fileLoadedError"})):r().createElement("div",{className:Vy},l)))}),iA=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{let{maxWidth:e}=t;const{formatMessage:i}=(0,C.useIntl)();return r().createElement("div",{className:zy,style:{maxWidth:e}},r().createElement("div",{className:Hy},r().createElement(d.Result,{status:"500",title:i({id:"unSupportFileType"}),subTitle:i({id:"unSupportFileTypeDescription"})})))}),nA=["url","scale","rotate","className","maxWidth","origin"],sA=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{let{url:e,scale:i,rotate:n,className:a,maxWidth:o,origin:l}=t,c=_y(t,nA);const[h,u]=(0,s.useState)(!0),[p,g]=(0,s.useState)(!1),{formatMessage:f}=(0,C.useIntl)();return(0,s.useEffect)(()=>{const t=new Image;t.src=e;const i=()=>{u(!1)},n=()=>{u(!1),g(!0)};return t.addEventListener("load",i),t.addEventListener("error",n),()=>{t.removeEventListener("load",i),t.removeEventListener("error",n)}},[e,i,n]),l?r().createElement("img",xy({alt:f({id:"filePreview"})},c,{className:a,src:e})):r().createElement("div",{className:dt()(a,zy),style:{maxWidth:o}},h?r().createElement("div",{className:jy},r().createElement(d.Spin,null)):null,p?r().createElement("div",{className:Uy},f({id:"fileLoadedError"})):r().createElement("img",xy({alt:f({id:"filePreview"})},c,{src:e})))}),rA=["url","maxWidth"],aA=["url","maxWidth","origin","controls","getElement"],oA=t=>{const e=(t||"").split("?")[0].toLowerCase();return/.txt$/.test(e)?"txt":/.pdf$/.test(e)?"pdf":/.(png|jpg|jpeg)$/.test(e)?"image":/.(html|htm)$/.test(e)?"html":/.(doc|docx|xls|xlsx|ppt|pptx|csv)$/.test(e)?"office":/.(mp3|wav|ogg|aac)$/.test(e)?"audio":/.(mp4|avi|mov|mkv|flv)$/.test(e)?"video":"unknown"},lA={txt:eA,pdf:tA,image:sA,html:Qy,office:t=>{var e;let{url:i,apis:n,className:s}=t,o=_y(t,$y);const{apis:c}=(0,a.usePreset)(),h=Object.assign({},c,n);return r().createElement(l(),xy({},(null==(e=h.file)?void 0:e.previewOffice)||{loader:async()=>({data:[{url:"https://view.officeapps.live.com/op/embed.aspx?src=".concat(encodeURIComponent(i)),type:"html"}]})},{render:t=>{let{data:e}=t;const{data:i}=e;return i.map(t=>{let{url:e,type:i}=t;return r().createElement(Jy,xy({},o,{type:i,ignoreContent:!0,url:e,className:s,key:e}))})}}))},audio:t=>{let{url:e,maxWidth:i}=t,n=_y(t,rA);return r().createElement("div",{className:zy,style:{maxWidth:i}},r().createElement("div",{className:Gy},r().createElement("audio",xy({},n,{src:e,controls:!0}))))},video:t=>{let{url:e,maxWidth:i,origin:n,controls:a=!0,getElement:o}=t,l=_y(t,aA);const c=(0,s.useRef)(null),h=(0,x.A)(o);return(0,s.useEffect)(()=>{h(c.current)},[h]),n?r().createElement("video",xy({controls:a},l,{src:e,ref:c})):r().createElement("div",{className:zy,style:{maxWidth:i}},r().createElement("div",{className:qy},r().createElement("video",xy({controls:a},l,{src:e,ref:c}))))},unknown:iA},cA=t=>lA[oA(t)],hA=["data","id","staticUrl","className","fetchApi","filename","render"],dA=My(t=>{let{data:e,id:i,staticUrl:n,className:s,fetchApi:a,filename:o,render:l}=t,c=_y(t,hA);const h=Dy({staticUrl:n,url:e}),d=e&&cA(e)||o&&cA(o);return"function"===typeof l?l({data:e,id:i,staticUrl:n,className:s,fetchApi:a,filename:o,url:h,component:d}):r().createElement(d,xy({},c,{className:s,url:h}))}),uA=["id","src","originName","filename"],pA=t=>{let{id:e,src:i,originName:n,filename:s}=t,a=_y(t,uA);return i?r().createElement(Jy,xy({},a,{url:i,filename:s||n})):r().createElement(dA,xy({},a,{id:e,filename:s||n}))},gA=["content","onSuccess","onError","onBeforePrint","printProps","contentRef"],fA=t=>{let{onSuccess:e,onError:i,onBeforePrint:n,printProps:a,contentRef:o}=t,l=_y(t,gA);const[c,h]=(0,s.useState)(!1),u=(0,Ub.useReactToPrint)(xy({contentRef:o,bodyClass:document.body.getAttribute("class"),onBeforePrint:async function(){h(!0),n&&await n(...arguments)},onPrintError:function(){h(!1),i&&i(...arguments)},onAfterPrint:function(){h(!1),e&&e(...arguments)}},a));return r().createElement(d.Button,xy({},l,{onClick:()=>{h(!0),u()},loading:c}))};var mA=".file-modal-outer {\n min-height: 100px;\n}\n\n.file-title {\n margin-right: 30px;\n}\n\n.ellipse {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n word-break: break-all;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLm1vZHVsZXMuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGlCQUFpQjtBQUNuQjs7QUFFQTtFQUNFLGtCQUFrQjtBQUNwQjs7QUFFQTtFQUNFLGdCQUFnQjtFQUNoQix1QkFBdUI7RUFDdkIsb0JBQW9CO0VBQ3BCLHFCQUFxQjtFQUNyQiw0QkFBNEI7RUFDNUIscUJBQXFCO0FBQ3ZCIiwiZmlsZSI6InN0eWxlLm1vZHVsZXMuc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5maWxlLW1vZGFsLW91dGVyIHtcbiAgbWluLWhlaWdodDogMTAwcHg7XG59XG5cbi5maWxlLXRpdGxlIHtcbiAgbWFyZ2luLXJpZ2h0OiAzMHB4O1xufVxuXG4uZWxsaXBzZSB7XG4gIG92ZXJmbG93OiBoaWRkZW47XG4gIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICBkaXNwbGF5OiAtd2Via2l0LWJveDtcbiAgLXdlYmtpdC1saW5lLWNsYW1wOiAxO1xuICAtd2Via2l0LWJveC1vcmllbnQ6IHZlcnRpY2FsO1xuICB3b3JkLWJyZWFrOiBicmVhay1hbGw7XG59Il19 */";const vA=["title","filename","originName","openDownload","openPrint","id","src","apis"],wA=["renderModal"],bA=(0,C.createIntlProvider)("zh-CN",Oy,"react-file"),yA=t=>{const e=Object.assign({},{renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{renderModal:i}=e,n=(t=>{const e=Object.assign({},{footer:null,openDownload:!1,openPrint:!1},t),{title:i,filename:n,originName:a,openDownload:o,openPrint:l,id:c,src:h,apis:u}=e,p=_y(e,vA),[g,f]=Gb(p,{value:"open",default:"defaultOpen",onChange:"onOpenChange"}),{message:v}=d.App.useApp(),w=(0,s.useRef)();return xy({},p,{open:g,onOpenChange:f,onCancel:()=>{f(!1)},title:r().createElement(d.Space,{size:10,className:mA["file-title"]},r().createElement("span",{className:mA.ellipse},i||n||a),r().createElement("span",null,o&&r().createElement(bA,null,t=>{let{formatMessage:e}=t;return r().createElement(Wy,{className:"btn-no-padding",type:"link",id:c,src:h,apis:u,filename:n||a,onSuccess:()=>{v.success(e({id:"downloadSuccess"}))}})}),l&&["txt","pdf","image","html"].indexOf(oA(n||a))>-1&&r().createElement(fA,{contentRef:w,type:"link",icon:r().createElement(m,null)}))),children:r().createElement("div",{ref:w,className:mA["file-modal-outer"]},r().createElement(pA,{id:c,src:h,filename:n||a,apis:u}))})})(_y(e,wA));return Object.assign({},n,{renderModal:t=>i(Object.assign({},n,t))})},AA=t=>{let{params:e}=t;const{data:i}=e;return new Promise((t,e)=>{const n=new window.Image;n.src=i,n.addEventListener("load",()=>{t(i)}),n.addEventListener("error",t=>{e(t)})})};var EA="_H1zfc",xA="_BAe2W",_A="_9kK1I",kA="_Wwi2N";const CA=["id","src","alt","onClick","loading","error","className","apis","staticUrl"],SA=["id","src","alt","gender","loading","error","className","gap","icon","children","shape","size","width","height","defaultAvatar","apis","staticUrl"],MA=r().createElement(d.Skeleton.Avatar,{shape:"square",active:!0}),TA=r().createElement(Qb,null),PA=r().createElement(iy,null),LA=r().createElement(oy,null),RA=r().createElement(uy,null),DA=t=>{let{data:e,className:i,alt:n,innerLoading:s,loading:o,error:c,innerError:h,children:d,onClick:u,staticUrl:p}=t;var g;const{apis:f}=(0,a.usePreset)(),m=Object.assign({},f),v=Dy({staticUrl:p||(null==(g=m.file)?void 0:g.staticUrl),url:e});return r().createElement(l(),{loader:AA,params:{data:v},error:h||c,loading:s||o,render:t=>{let{data:e}=t;return"function"===typeof d?d({alt:n,className:dt()(i,xA),src:e}):r().createElement("img",{alt:n,className:dt()(i,xA),src:e,onClick:u})}})},FA=My(DA),IA=t=>{let{loading:e,error:i,src:n,id:s,alt:a,className:o,children:l,apis:c,onClick:h,staticUrl:d}=t;const u=(t,e)=>{const i=t.type;return!i&&t.render?t.render(Object.assign({},t.props,e)):r().createElement(i,Object.assign({},t.props,e))},p=e&&u(e,{className:_A}),g=i&&u(i,{className:kA});return s?r().createElement(FA,{alt:a,className:o,id:s,loading:p,innerLoading:p,error:g,innerError:g,apis:c,onClick:h},l):n?r().createElement(DA,{alt:a,className:o,staticUrl:d,data:n,loading:p,error:g,onClick:h},l):g},NA=t=>{const e=Object.assign({},{loading:MA,error:TA},t),{id:i,src:n,alt:s,onClick:a,loading:o,error:l,className:c,apis:h,staticUrl:d}=e,u=_y(e,CA);return r().createElement("div",xy({},u,{className:dt()(c,EA)}),IA({loading:o,error:l,src:n,id:i,alt:s,className:c,apis:h,onClick:a,staticUrl:d}))};NA.Avatar=t=>{const e=Object.assign({},{size:100,defaultAvatar:PA,error:TA,shape:"circle"},t),{id:i,src:n,alt:s,gender:a,loading:o,error:l,className:c,gap:h,icon:u,children:p,shape:g,size:f,width:m,height:v,defaultAvatar:w,apis:b,staticUrl:y}=e,A=_y(e,SA),E=(()=>{const t=m&&v?{style:{width:m,height:v}}:{size:f};let e=g;if(m&&m!==v&&(e="square"),i||n)return IA({loading:o||r().createElement(d.Skeleton.Avatar,{shape:e,active:!0}),staticUrl:y,error:l,src:n,defaultAvatar:w,id:i,alt:s,className:c,apis:b,children:i=>r().createElement(d.Avatar,xy({},i,{gap:h,shape:e},t))});if(a){const i=["F","female","f"].indexOf(a)>-1?LA:["M","male","m"].indexOf(a)>-1?RA:PA;return r().createElement(d.Avatar,xy({},A,{src:i,gap:h,shape:e},t))}return r().createElement(d.Avatar,xy({},A,{gap:h,icon:u,shape:e,size:f,src:w},t),p)})();return r().createElement("div",xy({},A,{className:dt()(c,EA),style:{width:m&&v?m:f,height:m&&v?v:f}}),E)};const OA=t=>{const{item:e,hasPreview:i,getPermission:n,apis:s,onEdit:a,onDelete:o,onPreview:l,renderModal:c}=Object.assign({},{hasPreview:!0,apis:{},getPermission:()=>!0,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{filename:h,id:u,src:p}=e,{onOpenChange:g,renderModal:f}=yA({apis:s,id:u,src:p,filename:h,renderModal:c});return r().createElement(d.Flex,{justify:"end"},i&&n("preview",e)&&r().createElement(r().Fragment,null,r().createElement(d.Button,{type:"text",icon:r().createElement(v.A,null),onClick:()=>{l?l(e):g(!0)}}),f()),n("edit",e)&&r().createElement(my.lV,{type:"text",icon:r().createElement(w.A,null),onClick:()=>a&&a(e)}),n("download",e)&&r().createElement(Wy,{type:"text",id:u,src:p,filename:h}),n("delete",e)&&r().createElement(my.ZF,{type:"text",icon:r().createElement(b.A,null),onClick:()=>o&&o(e)}))};var BA="_yRMtw",WA="_OivOI",zA="_doPR9",jA="_bLeUP",HA="_mZdoa";const UA=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),{className:i,dataSource:n,getPermission:s,infoItemRenders:a,onDelete:o,onEdit:l,apis:c,renderModal:h}=Object.assign({},{infoItemRenders:[t=>t.userName?r().createElement(d.Typography.Text,null,t.userName):null,t=>t.date?r().createElement(d.Typography.Text,null,yy()(t.date).format("YYYY-MM-DD HH:mm:ss")):null],getPermission:()=>!0,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t);return r().createElement(d.List,{className:i,dataSource:n.map((t,e)=>(t.index=e,t)),rowKey:t=>"item_".concat(t.uuid&&"uuid_".concat(t.uuid)||t.id&&"id_".concat(t.id)||t.src&&"src_".concat(t.src)),renderItem:t=>{const{type:i,filename:n}=t;return r().createElement(d.List.Item,{className:BA},r().createElement(d.Row,{justify:"space-between",wrap:!1,className:WA},r().createElement(d.Col,{flex:1},r().createElement("div",{className:zA}),r().createElement(d.Space,{className:"is-block",align:"start",size:4},r().createElement(fy,{type:wy()(null==n?void 0:n.split(".")),size:14}),n||"")),a&&a.map((e,n)=>r().createElement(d.Col,{span:e.span||4,key:n},"uploading"!==i&&("function"===typeof e?e:e.render)(t),r().createElement("div",{className:zA}))),r().createElement(d.Col,{className:HA},"uploading"!==i?r().createElement(OA,{getPermission:s,item:t,apis:c,onDelete:o,renderModal:h,onEdit:l}):r().createElement(d.Space,{className:jA},r().createElement(d.Spin,{size:"small"}),r().createElement(d.Typography.Link,null,e({id:"uploading"}))))))},bordered:!0})}),VA=t=>{const{locale:e}=(0,a.useContext)(),{formatMessage:i}=(0,C.createIntl)({locale:e,namespace:"react-file"}),{multiple:n,fileSize:r,maxLength:o,value:l,concurrentCount:c,onAdd:h,onError:u,onSave:p,onChange:g,onUpload:f}=Object.assign({},{concurrentCount:1,value:[]},t),{apis:m}=(0,a.usePreset)(),{message:v}=d.App.useApp(),[w,b]=(0,s.useState)([]),y=(0,s.useRef)(c),A=(0,s.useMemo)(()=>(t=>{const e=[];let i=0;const n=()=>{if(0!==e.length){if(i<t){const t=e.shift();i+=1,t().finally(()=>{i-=1,n()})}}else i=0};return t=>new Promise(i=>{e.push(()=>{const e=Promise.resolve().then(()=>t());return i(e),e}),n()})})(y.current),[]),E=(0,x.A)(async t=>{const e=o-l.length;1!==o&&!0===n&&t.length>e?v.error(i({id:"maxLengthError"},{maxLength:o})):await Promise.allSettled(t.map(async t=>{if(t.size>1024*r*1024)return void v.error(i({id:"fileSizeError"},{filename:t.name,fileSize:r}));const e=Ey()(),s=n=>{const s=n.message||i({id:"uploadError"},{filename:t.name,error:n.message?":"+n.message:""});v.error(s),u&&u({file:t,error:n,errMsg:s}),b(t=>{const i=t.slice(0),n=i.findIndex(t=>t.uuid===e);return n>-1&&i.splice(n,1),i})};try{var a;b(1===o||!0!==n?[{uuid:e,type:"uploading",filename:t.name}]:i=>{const n=i.slice(0);return n.unshift({uuid:e,type:"uploading",filename:t.name}),n}),h&&await Promise.resolve(h(t));const r=f||(null==(a=m.file)?void 0:a.upload),{data:l}=await A(()=>r({file:t}));if(0!==l.code)return void s(new Error(i({id:"uploadError"},{filename:t.name,error:l.msg?":"+l.msg:""})));const c=p?await Promise.resolve(p(l,t,e)):Object.assign({},l.data,{filename:l.data.filename||l.data.originName||t.name,id:l.data.id,uuid:e});b(t=>{const i=t.slice(0),n=i.findIndex(t=>t.uuid===e);return n>-1&&i.splice(n,1),i}),g(1===o||!0!==n?[c]:t=>{const e=(t||[]).slice(0);return e.push(c),e})}catch(l){s(l)}}))});return{fileList:w,onFileSelected:E}};var GA="_-hhpT",qA="_FyygJ",XA="_hBEXs",YA="_BMSEY";const KA=[".pdf",".jpg",".png",".jpeg",".doc",".docx",".xls",".xlsx",".html",".msg",".eml",".zip"],QA=["children","className","buttonText","accept","multiple","onChange"],ZA=["children"],JA=(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),i=(0,s.useRef)(null),n=Object.assign({},{accept:KA,buttonText:e({id:"fileUpload"}),children:t=>{let{children:e}=t,i=_y(t,ZA);return r().createElement(d.Button,xy({icon:r().createElement(A,null)},i),l,e)}},t),{children:a,className:o,buttonText:l,accept:c,multiple:h,onChange:u}=n,p=_y(n,QA);return a(xy({},p,{className:dt()(o,GA),children:!p.disabled&&r().createElement("input",{ref:i,type:"file",accept:c,multiple:h,className:qA,onChange:t=>{const e=[].slice.call(t.target.files,0);0!==e.length&&(i.current.setAttribute("type","text"),i.current.setAttribute("type","file"),u(e))}})}))}),$A=["className","fileSize","maxLength","multiple","size","accept","children","renderTips","showUploadList","onSave","ossUpload","getPermission","concurrentCount","apis","renderModal"];(0,C.createWithIntlProvider)("zh-CN",Oy,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),i=Object.assign({},{defaultValue:[],accept:KA,renderTips:t=>t,children:e({id:"fileUpload"}),multiple:!0,showUploadList:!0,maxLength:10,fileSize:30,concurrentCount:10,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{className:n,fileSize:s,maxLength:a,multiple:o,size:l,accept:c,children:h,renderTips:u,showUploadList:p,onSave:g,ossUpload:f,getPermission:m,concurrentCount:v,apis:w,renderModal:b}=i,y=_y(i,$A),[A,E]=Gb(y),x=A||[],{fileList:_,onFileSelected:S}=VA({multiple:o,onSave:g,ossUpload:f,fileSize:s,maxLength:a,value:x,onChange:E,concurrentCount:v});c.map(t=>t.replace(/^\./,"")).join("\u3001");const M=[...x,..._],T=u(e({id:"uploadTips"},{fileSize:s,maxLength:a,accept:c.map(t=>t.replace(/^\./,"")).join(",")}),{fileSize:s,maxLength:a,accept:c});return r().createElement(d.Flex,{vertical:!0,gap:8},r().createElement(d.Flex,{gap:8},r().createElement(JA,xy({},k()(y,["value","onChange"]),{size:l,multiple:o,accept:c,className:n,buttonText:h,onChange:S})),T&&r().createElement("div",{className:YA},T)),p&&M.length>0&&r().createElement(UA,{className:XA,dataSource:M,infoItemRenders:[],getPermission:m||(t=>["delete","preview"].indexOf(t)>-1),onDelete:t=>{const e=x.slice(0),i=e.indexOf(t);i>-1&&e.splice(i,1),E(e)},apis:w,renderModal:b}))})},43373(t,e,i){"use strict";i.d(e,{A:()=>m});var n=i(92099),s=i(48183),r=i(72367),a=i(50171),o=i(42912),l=i(74572),c=i(41705),h=i(94922),d=i.n(h),u=i(31035),p=i.n(u);function g(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var i,n=(0,l.A)(t);if(e){var s=(0,l.A)(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return(0,o.A)(this,i)}}var f=function(t){(0,a.A)(i,t);var e=g(i);function i(){var t;(0,n.A)(this,i);for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];return t=e.call.apply(e,[this].concat(a)),(0,c.A)((0,r.A)(t),"state",{error:null}),t}return(0,s.A)(i,[{key:"componentDidCatch",value:function(t){this.setState(function(){return{error:t}}),this.props.onError(t)}},{key:"render",value:function(){var t=this.props,e=t.errorComponent,i=t.errorRender;return this.state.error?e?d().createElement(e,{error:this.state.error}):i?i(this.state.error):(console.error(this.state.error),null):this.props.children}}]),i}(h.Component);(0,c.A)(f,"propTypes",{onError:p().func,children:p().node,errorComponent:p().elementType,errorRender:p().func}),(0,c.A)(f,"defaultProps",{onError:function(){}});const m=f},50805(t,e,i){"use strict";i.d(e,{A:()=>c});var n=i(94922),s=i(98771),r=i.n(s),a=i(95600),o=i.n(a),l=i(78678);const c=(t,e)=>{const i=(0,n.useRef)(null);i.current=Object.assign({},{time:500,isDebounce:!1},e);const s=(0,n.useRef)(null),a=(0,l.A)(t);return(0,n.useLayoutEffect)(()=>{const t=s.current,e=()=>window.requestAnimationFrame(()=>{t&&a(t)});e();const n=new ResizeObserver((i.current.isDebounce?o():r())(e,i.current.time));return t&&n.observe(t),()=>{n.disconnect()}},[a]),s}},52272(t){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},53986(t,e,i){"use strict";function n(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}i.d(e,{A:()=>n})},64579(t,e,i){var n=i(78913),s=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(s,""):t}},78678(t,e,i){"use strict";i.d(e,{A:()=>s});var n=i(94922);const s=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=(0,n.useRef)(t);return e||(i.current=t),(0,n.useCallback)(function(){return i.current&&i.current(...arguments)},[])}},78913(t){var e=/\s/;t.exports=function(t){for(var i=t.length;i--&&e.test(t.charAt(i)););return i}},85553(t,e,i){"use strict";i.d(e,{Ay:()=>N,ZF:()=>L,lV:()=>E});var n=i(94922),s=i.n(n),r=i(28833),a=i(78678),o=i(86340),l=i(89195),c=i(58612),h=i(54159),d=i.n(h),u=i(20274),p=(i(16052),i(50805)),g=i(26938),f=i.n(g),m=i(73075),v=i.n(m);function w(){return w=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},w.apply(null,arguments)}function b(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}const y=["onClick","children","loading"],A=t=>{const[e,i]=(0,n.useState)(!1),s=(0,a.A)(function(){return i(!0),Promise.resolve(t&&t(...arguments)).then(()=>{i(!1)}).catch(t=>{i(!1),console.error(t)})});return{isLoading:e,setIsLoading:i,callback:s}},E=t=>{let{onClick:e,children:i,loading:n}=t,a=b(t,y);const{isLoading:o,callback:l}=A(e);return s().createElement(r.Button,w({},a,{loading:n||o,onClick:l}),"function"===typeof i?i(n||o):i)};var x="_zIHFy",_="_R-IrF",k="_F1kMl",C="_Iee0d",S="_aGBVE",M="_0oW1K";const T={message:"\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f",confirm:"\u786e\u5b9a",delete:"\u5220\u9664",cancel:"\u53d6\u6d88",more:"\u66f4\u591a"},P=["title","message","isDelete","showCancel","cancelText","onCancel","isModal","okText","placement","children","onClick","getContainer","renderModal"],L=(0,u.createWithIntlProvider)("zh-CN",T,"button-group")(t=>{const{formatMessage:e}=(0,u.useIntl)(),i=Object.assign({},{isDelete:!0},t),{title:o,message:l,isDelete:h,showCancel:p,cancelText:g,onCancel:f,isModal:m,okText:v,placement:y,children:E,onClick:T,getContainer:L,renderModal:R}=i,D=b(i,P),[F,I]=(0,n.useState)(!1),{isLoading:N,callback:O}=A(T),B=(0,a.A)(()=>{I(!0)}),W=s().createElement(r.Flex,{className:k,vertical:!0,gap:8,onClick:t=>{t.stopPropagation()}},o&&s().createElement(r.Flex,{align:"flex-start",gap:8,className:C},h&&s().createElement(c.A,{className:"title-icon"}),o),s().createElement(r.Flex,{align:"flex-start",gap:8,className:d()(S,{[M]:o})},!o&&h?s().createElement(c.A,{className:"title-icon"}):null,l||e({id:"message"}))),z=()=>"function"===typeof E?E(w({},D,{onClick:B})):s().createElement(r.Button,w({},D,{loading:N,onClick:()=>{B()}}),E);if(m){const t={open:F,onCancel:()=>{I(!1),f&&f()},wrapClassName:_,okText:v||e(h?{id:"delete"}:{id:"confirm"}),cancelText:g||e({id:"cancel"}),onOk:t=>(I(!1),O(t)),closable:!1,okButtonProps:{danger:h},getContainer:L,children:W};return s().createElement(s().Fragment,null,"function"===typeof R?R(t):s().createElement(r.Modal,t),z())}return s().createElement(r.Popconfirm,{overlayClassName:d()(x),okButtonProps:{danger:h},title:W,open:F,getPopupContainer:L,onCancel:f,placement:y,showCancel:p,okText:v||e(h?{id:"delete"}:{id:"confirm"}),cancelText:g||e({id:"cancel"}),onOpenChange:I,onConfirm:t=>{O(t)}},z())}),R=v()(t=>{let{amountWidth:e,moreBtnWidth:i,buttonWidthList:n,spaceProps:s,compact:r}=t;const a=r?0:["small","middle","large"].indexOf(s.size)>-1?8*(["small","middle","large"].indexOf(s.size)+1):Number.isInteger(s.size)?s.size:8;let o=0,l=0;for(;e>=l+n[o]+o*a&&o<n.length;)l+=n[o],o+=1;for(;e<l+(o-1)*a+(o<n.length?i+a:0)&&o>0;)l-=n[o-1],o-=1;return o},t=>{let{amountWidth:e,moreBtnWidth:i,buttonWidthList:n,spaceProps:s,compact:r}=t;return"".concat(e).concat(i).concat(n.join(",")).concat(Object.values(s).join(",")).concat(r&&r.toString())});var D={"width-container":"_V58ju","hidden-container":"_XN3o6","hidden-inner":"_-depB","more-link-btn":"_Hh4Wb","menu-list":"_juFTd"};const F=["list","more","moreType","compact","showLength","getPopupContainer","trigger","itemClassName"],I=["className","confirm","buttonComponent","tooltipProps"],N=(0,u.createWithIntlProvider)("zh-CN",T,"button-group")(t=>{const{formatMessage:e}=(0,u.useIntl)(),i=Object.assign({},t),{list:c,more:h,moreType:g,compact:m,showLength:v,getPopupContainer:y,trigger:A,itemClassName:x}=i,_=b(i,F),k=(0,n.useMemo)(()=>c.filter(t=>!(null!=t&&t.hidden)),[c]),C=f()(_,["size","split","align","style"]),[S,M]=(0,n.useState)(k.length&&1),T=Number.isInteger(v)?v:S,P=(0,a.A)(()=>{const t=O.current,e=B.current,i=N.current;if(!t)return;const s=t.querySelectorAll(".button-group-item");if(!s)return;if(0===s.length)return;const r=i.clientWidth,a=e.clientWidth,o=[].map.call(s,t=>t.offsetWidth),l=R({amountWidth:r,moreBtnWidth:a,buttonWidthList:o,spaceProps:C,compact:m});(0,n.startTransition)(()=>{M(l)})}),N=(0,p.A)(P),O=(0,p.A)(P),B=(0,p.A)(P),W=k.slice(T),z=(t,e,i)=>{if("function"===typeof t)return t({key:e,className:d()("button-group-item",D["btn-item"],x)},{isDropdown:i});const{className:n,confirm:a,buttonComponent:o,tooltipProps:l}=t,c=b(t,I),h=a||c.message,u=o||(h?L:E),p=s().createElement(u,w({danger:h&&!1!==c.isDelete},Object.assign({},c,h&&(c.isModal||i)?{isModal:!0}:{},i?{type:"default"}:{}),{key:e,className:d()("button-group-item",n,x)}));return l?s().createElement(r.Tooltip,l,p):p},j=h||("link"===g?s().createElement(r.Button,{type:"link",className:d()("button-group-item",x,D["more-link-btn"])},s().createElement(l.A,{style:{fontSize:"16px"}})):s().createElement(r.Button,null,e({id:"more"}),s().createElement(o.A,null))),H=m?r.Space.Compact:r.Space;return s().createElement(s().Fragment,null,s().createElement("div",{className:D["width-container"],ref:N}),s().createElement("div",{className:D["hidden-container"]},s().createElement("div",{className:D["hidden-inner"],ref:B},j),s().createElement("div",{className:D["hidden-inner"],ref:O},s().createElement(H,C,k.map((t,e)=>s().createElement(n.Fragment,{key:e},z(t,e,!1)))))),s().createElement(H,C,k.slice(0,T).map((t,e)=>s().createElement(n.Fragment,{key:e},z(t,e,!1))),W.length>0&&s().createElement(r.Dropdown,{getPopupContainer:y,trigger:A,rootClassName:D["menu-list"],menu:{items:W.map((t,e)=>({key:e,label:z(t,e,!0)}))}},j)))})},93375(t,e,i){var n=i(36382);t.exports=function(){return n.Date.now()}},95600(t,e,i){var n=i(2316),s=i(93375),r=i(2899),a=Math.max,o=Math.min;t.exports=function(t,e,i){var l,c,h,d,u,p,g=0,f=!1,m=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function w(e){var i=l,n=c;return l=c=void 0,g=e,d=t.apply(n,i)}function b(t){var i=t-p;return void 0===p||i>=e||i<0||m&&t-g>=h}function y(){var t=s();if(b(t))return A(t);u=setTimeout(y,function(t){var i=e-(t-p);return m?o(i,h-(t-g)):i}(t))}function A(t){return u=void 0,v&&l?w(t):(l=c=void 0,d)}function E(){var t=s(),i=b(t);if(l=arguments,c=this,p=t,i){if(void 0===u)return function(t){return g=t,u=setTimeout(y,e),f?w(t):d}(p);if(m)return clearTimeout(u),u=setTimeout(y,e),w(p)}return void 0===u&&(u=setTimeout(y,e)),d}return e=r(e)||0,n(i)&&(f=!!i.leading,h=(m="maxWait"in i)?a(r(i.maxWait)||0,e):h,v="trailing"in i?!!i.trailing:v),E.cancel=function(){void 0!==u&&clearTimeout(u),g=0,l=p=c=u=void 0},E.flush=function(){return void 0===u?d:A(s())},E}},98677(t){"use strict";var e=function(){};t.exports=e},98771(t,e,i){var n=i(95600),s=i(2316);t.exports=function(t,e,i){var r=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return s(i)&&(r="leading"in i?!!i.leading:r,a="trailing"in i?!!i.trailing:a),n(t,e,{leading:r,maxWait:e,trailing:a})}}}]);
|
|
2
|
+
//# sourceMappingURL=803.59e2de29.chunk.js.map
|