@kne-components/system-layout 0.1.0-alpha.7 → 0.1.0-alpha.9

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.
Files changed (48) hide show
  1. package/build/asset-manifest.json +24 -28
  2. package/build/index.html +1 -1
  3. package/build/remoteEntry.js +1 -1
  4. package/build/remoteEntry.js.map +1 -1
  5. package/build/static/css/709.bf10b296.chunk.css +2 -0
  6. package/build/static/css/709.bf10b296.chunk.css.map +1 -0
  7. package/build/static/css/769.bf10b296.chunk.css +2 -0
  8. package/build/static/css/769.bf10b296.chunk.css.map +1 -0
  9. package/build/static/css/{830.4f75ba1f.chunk.css → 830.bdb4f248.chunk.css} +2 -2
  10. package/build/static/css/830.bdb4f248.chunk.css.map +1 -0
  11. package/build/static/css/{857.4f8228f0.chunk.css → 857.ebcd631f.chunk.css} +2 -2
  12. package/build/static/css/857.ebcd631f.chunk.css.map +1 -0
  13. package/build/static/js/709.ab0a5f70.chunk.js +3 -0
  14. package/build/static/js/{858.e43870a2.chunk.js.map → 709.ab0a5f70.chunk.js.map} +1 -1
  15. package/build/static/js/825.2fa59c9c.chunk.js +2 -0
  16. package/build/static/js/825.2fa59c9c.chunk.js.map +1 -0
  17. package/build/static/js/{830.ad33defe.chunk.js → 830.99b2c270.chunk.js} +3 -3
  18. package/build/static/js/{830.ad33defe.chunk.js.map → 830.99b2c270.chunk.js.map} +1 -1
  19. package/build/static/js/{857.8cc41258.chunk.js → 857.0b79f8fe.chunk.js} +2 -2
  20. package/build/static/js/{857.8cc41258.chunk.js.map → 857.0b79f8fe.chunk.js.map} +1 -1
  21. package/build/static/js/869.d738e35d.chunk.js +2 -0
  22. package/build/static/js/869.d738e35d.chunk.js.map +1 -0
  23. package/build/static/js/948.bf1acd82.chunk.js +2 -0
  24. package/build/static/js/948.bf1acd82.chunk.js.map +1 -0
  25. package/build/static/js/main.54bf2f60.js +2 -0
  26. package/build/static/js/main.54bf2f60.js.map +1 -0
  27. package/package.json +1 -1
  28. package/build/static/css/830.4f75ba1f.chunk.css.map +0 -1
  29. package/build/static/css/857.4f8228f0.chunk.css.map +0 -1
  30. package/build/static/css/858.27f88d24.chunk.css +0 -2
  31. package/build/static/css/858.27f88d24.chunk.css.map +0 -1
  32. package/build/static/css/86.27f88d24.chunk.css +0 -2
  33. package/build/static/css/86.27f88d24.chunk.css.map +0 -1
  34. package/build/static/js/123.12193506.chunk.js +0 -1
  35. package/build/static/js/395.232bb262.chunk.js +0 -1
  36. package/build/static/js/673.4c0ef899.chunk.js +0 -1
  37. package/build/static/js/688.21aefaa7.chunk.js +0 -1
  38. package/build/static/js/700.b8b651f4.chunk.js +0 -2
  39. package/build/static/js/700.b8b651f4.chunk.js.map +0 -1
  40. package/build/static/js/84.bc968424.chunk.js +0 -2
  41. package/build/static/js/84.bc968424.chunk.js.map +0 -1
  42. package/build/static/js/858.e43870a2.chunk.js +0 -3
  43. package/build/static/js/948.6a686184.chunk.js +0 -2
  44. package/build/static/js/948.6a686184.chunk.js.map +0 -1
  45. package/build/static/js/main.0043c2cc.js +0 -2
  46. package/build/static/js/main.0043c2cc.js.map +0 -1
  47. /package/build/static/js/{830.ad33defe.chunk.js.LICENSE.txt → 709.ab0a5f70.chunk.js.LICENSE.txt} +0 -0
  48. /package/build/static/js/{858.e43870a2.chunk.js.LICENSE.txt → 830.99b2c270.chunk.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- (self.webpackChunk_kne_components_system_layout=self.webpackChunk_kne_components_system_layout||[]).push([[700],{913:(t,e,i)=>{"use strict";i.d(e,{_V:()=>mb});var n={};i.r(n),i.d(n,{dU:()=>gg,ng:()=>mg,EA:()=>vg,Tm:()=>bg,D6:()=>wg,YE:()=>yg});var s=i(94922),a=i.n(s),r=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 f={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 g=i(52199);const m=s.forwardRef(function(t,e){return s.createElement(g.A,(0,p.A)({},t,{ref:e,icon:f}))});var v=i(56859),b=i(15032),w=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(g.A,(0,p.A)({},t,{ref:e,icon:y}))});var E,x=i(78678),_=i(10238),k=i.n(_),C=i(20274),M=0,S=!1,L=!1,T="[iFrameSizer]",R=null,F=window.requestAnimationFrame,P=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),I={},N=null,D=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(){V("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function O(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function W(t,e,i){t.addEventListener(e,i,!1)}function z(t,e,i){t.removeEventListener(e,i,!1)}function B(t){return T+"["+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 H(t){return I[t]?I[t].log:S}function j(t,e){U("log",t,e,H(t))}function V(t,e){U("warn",t,e,!0)}function U(t,e,i,n){!0===n&&"object"===typeof window.console&&console[t](B(e),i)}function G(t){function e(){s("Height"),s("Width"),tt(function(){$(p),Q(f),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(I[f]["max"+t]),i=Number(I[f]["min"+t]),n=t.toLowerCase(),s=Number(p[n]);j(f,"Checking "+n+" is in range "+i+"-"+e),s<i&&(s=i,j(f,"Set "+n+" to min value")),s>e&&(s=e,j(f,"Set "+n+" to max value")),p[n]=""+s}function a(t){return u.slice(u.indexOf(":")+7+t)}function r(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,at[s=e]||(at[s]=setTimeout(function(){at[s]=null,i()},n))}function o(t){var e=t.getBoundingClientRect();return K(f),{x:Math.floor(Number(e.left)+Number(R.x)),y:Math.floor(Number(e.top)+Number(R.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};j(f,"Reposition requested from iFrame (offset x:"+e.x+" y:"+e.y+")"),window.top===window.self?(R=i,c(),j(f,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(t?"Offset":"")](i.x,i.y):V(f,"Unable to scroll to requested position, window.parentIFrame not found")}function c(){!1===d("onScroll",R)?Z():Q(f)}function h(t){var e={};if(0===Number(p.width)&&0===Number(p.height)){var i=a(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(f,t,e)}var u=t.data,p={},f=null;"[iFrameResizerChild]Ready"===u?function(){for(var t in I)et("iFrame requested init",it(t),I[t].iframe,t)}():T===(""+u).slice(0,13)&&u.slice(13).split(":")[0]in I?(p=function(){var t=u.slice(13).split(":"),e=t[1]?parseInt(t[1],10):0,s=I[t[0]]&&I[t[0]].iframe,a=getComputedStyle(s);return{iframe:s,id:t[0],height:e+i(a)+n(a),width:t[2],type:t[3]}}(),f=p.id,I[f]&&(I[f].loaded=!0),!function(){var t=p.type in{true:1,false:1,undefined:1};return t&&j(f,"Ignoring init message from meta parent page"),t}()&&function(t){var e=!0;return I[t]||(e=!1,V(p.type+" No settings for "+t+". Message was: "+u)),e}(f)&&(j(f,"Received: "+u),function(){var t=!0;return null===p.iframe&&(V(f,"IFrame ("+p.id+") not found"),t=!1),t}()&&function(){var e=t.origin,i=I[f]&&I[f].checkOrigin;if(i&&""+e!=="null"&&!(i.constructor===Array?function(){var t=0,n=!1;for(j(f,"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=I[f]&&I[f].remoteHost;return j(f,"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(I[f]&&I[f].firstRun&&I[f]&&(I[f].firstRun=!1),p.type){case"close":Y(p.iframe);break;case"message":t=a(6),j(f,"onMessage passed: {iframe: "+p.iframe.id+", message: "+t+"}"),d("onMessage",{iframe:p.iframe,message:JSON.parse(t)}),j(f,"--");break;case"mouseenter":h("onMouseEnter");break;case"mouseleave":h("onMouseLeave");break;case"autoResize":I[f].autoResize=JSON.parse(a(9));break;case"scrollTo":l(!1);break;case"scrollToOffset":l(!0);break;case"pageInfo":r(I[f]&&I[f].iframe,f),function(){function t(t,n){function s(){I[i]?r(I[i].iframe,i):e()}["scroll","resize"].forEach(function(e){j(i,t+e+" listener for sendPageInfo"),n(window,e,s)})}function e(){t("Remove ",z)}var i=f;t("Add ",W),I[i]&&(I[i].stopPageInfo=e)}();break;case"pageInfoStop":I[f]&&I[f].stopPageInfo&&(I[f].stopPageInfo(),delete I[f].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);j(f,"Moving to in page link (#"+e+") at x: "+t.x+" y: "+t.y),R={x:t.x,y:t.y},c(),j(f,"--")}():window.top===window.self?j(f,"In page link #"+e+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(e):j(f,"In page link #"+e+" not found and window.parentIFrame not found")}(a(9));break;case"reset":J(p);break;case"init":e(),d("onInit",p.iframe);break;default:0===Number(p.width)&&0===Number(p.height)?V("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){U("info",t,e,H(t))}(f,"Ignored: "+u)}function q(t,e,i){var n=null,s=null;if(I[t]){if("function"!==typeof(n=I[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 I[e]}function Y(t){var e=t.id;if(!1!==q(e,"onClose",e)){j(e,"Removing iFrame: "+e);try{t.parentNode&&t.parentNode.removeChild(t)}catch(i){V(i)}q(e,"onClosed",e),j(e,"--"),X(t),E&&(E.disconnect(),E=null)}else j(e,"Close iframe cancelled by onClose event")}function K(t){null===R&&j(t,"Get page position: "+(R={x:void 0===window.pageXOffset?document.documentElement.scrollLeft:window.pageXOffset,y:void 0===window.pageYOffset?document.documentElement.scrollTop:window.pageYOffset}).x+","+R.y)}function Q(t){null!==R&&(window.scrollTo(R.x,R.y),j(t,"Set page position: "+R.x+","+R.y),Z())}function Z(){R=null}function J(t){j(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){L||"0"!==t[e]||(L=!0,j(n,"Hidden iFrame detected, creating visibility listener"),function(){function t(){function t(t){function e(e){return"0px"===(I[t]&&I[t].iframe.style[e])}function i(t){return null!==t.offsetParent}I[t]&&i(I[t].iframe)&&(e("height")||e("width"))&&et("Visibility change","resize",I[t].iframe,t)}Object.keys(I).forEach(function(e){t(e)})}function e(e){j("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",j(t.id,"IFrame ("+n+") "+e+" set to "+t[e]+"px")):j("undefined","messageData id not set")}(i),e(i)}var n=t.iframe.id;I[n]&&(I[n].sizeHeight&&i("height"),I[n].sizeWidth&&i("width"))}function tt(t,e,i){i!==e.type&&F&&!window.jasmine?(j(e.id,"Requesting animation frame"),F(t)):t()}function et(t,e,i,n,s){var a=!1;n=n||i.id,I[n]&&(i&&"contentWindow"in i&&null!==i.contentWindow?function(){var s=I[n]&&I[n].targetOrigin;j(n,"["+t+"] Sending msg to iframe["+n+"] ("+e+") targetOrigin: "+s),i.contentWindow.postMessage(T+e,s)}():V(n,"["+t+"] IFrame("+n+") not found"),s&&I[n]&&I[n].warningTimeout&&(I[n].msgTimeout=setTimeout(function(){!I[n]||I[n].loaded||a||(a=!0,V(n,"IFrame has not responded within "+I[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."))},I[n].warningTimeout)))}function it(t){return t+":"+I[t].bodyMarginV1+":"+I[t].sizeWidth+":"+I[t].log+":"+I[t].interval+":"+I[t].enablePublicMethods+":"+I[t].autoResize+":"+I[t].bodyMargin+":"+I[t].heightCalculationMethod+":"+I[t].bodyBackground+":"+I[t].bodyPadding+":"+I[t].tolerance+":"+I[t].inPageLinks+":"+I[t].resizeFrom+":"+I[t].widthCalculationMethod+":"+I[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],V(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||D.id+M++;return null!==document.getElementById(t)&&(t+=M++),t}(),S=(e||{}).log,j(i,"Added missing iframe ID: "+i+" ("+t.src+")")),i}(t.id);n in I&&"iFrameResizer"in t?V(n,"Ignored iFrame, already setup."):(!function(e){var s;e=e||{},I[n]=Object.create(null),I[n].iframe=t,I[n].firstRun=!0,I[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 D)Object.prototype.hasOwnProperty.call(D,e)&&(I[n][e]=Object.prototype.hasOwnProperty.call(t,e)?t[e]:D[e])}(e),I[n]&&(I[n].targetOrigin=!0===I[n].checkOrigin?""===(s=I[n].remoteHost)||null!==s.match(/^(about:blank|javascript:|file:\/\/)/)?"*":s:"*")}(e),function(){switch(j(n,"IFrame scrolling "+(I[n]&&I[n].scrolling?"enabled":"disabled")+" for "+n),t.style.overflow=!1===(I[n]&&I[n].scrolling)?"hidden":"auto",I[n]&&I[n].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=I[n]?I[n].scrolling:"no"}}(),function(){function e(e){var i=I[n][e];1/0!==i&&0!==i&&(t.style[e]="number"===typeof i?i+"px":i,j(n,"Set "+e+" = "+t.style[e]))}function i(t){if(I[n]["min"+t]>I[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(I[n]&&I[n].bodyMargin)&&"0"!==(I[n]&&I[n].bodyMargin)||(I[n].bodyMarginV1=I[n].bodyMargin,I[n].bodyMargin=I[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)),W(t,"load",function(){et("iFrame.onload",e,t,void 0,!0),function(){var e=I[n]&&I[n].firstRun,i=I[n]&&I[n].heightCalculationMethod in P;!e&&i&&J({iframe:t,height:0,width:0,type:"init"})}()}),et("init",e,t,void 0,!0)}(it(n)),I[n]&&(I[n].iframe.iFrameResizer={close:Y.bind(null,I[n].iframe),removeListeners:X.bind(null,I[n].iframe),resize:et.bind(null,"Window resize","resize",I[n].iframe),moveToAnchor:function(t){et("Move to anchor","moveToAnchor:"+t,I[n].iframe,n)},sendMessage:function(t){et("Send Message","message:"+(t=JSON.stringify(t)),I[n].iframe,n)}}))}function st(t,e){null===N&&(N=setTimeout(function(){N=null,t()},e))}var at={};function rt(){"hidden"!==document.visibilityState&&(j("document","Trigger event: Visibility change"),st(function(){ot("Tab Visible","resize")},16))}function ot(t,e){Object.keys(I).forEach(function(i){(function(t){return I[t]&&"parent"===I[t].resizeFrom&&I[t].autoResize&&!I[t].firstRun})(i)&&et(t,e,I[i].iframe,i)})}function lt(){W(window,"message",G),W(window,"resize",function(){var t;j("window","Trigger event: "+(t="resize")),st(function(){ot("Window "+t,"resize")},16)}),W(document,"visibilitychange",rt),W(document,"-webkit-visibilitychange",rt)}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&&!F;t+=1)F=window[e[t]+"RequestAnimationFrame"];F?F=F.bind(window):j("setup","RequestAnimationFrame not supported")}(),lt(),function(i,n){switch(e=[],function(t){t&&t.enablePublicMethods&&V("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),ut=i(89379);function pt(t,e,i){e||(e=[]);var n=e.length++;return Object.defineProperty({},"_",{set:function(s){e[n]=s,t.apply(i,e)}})}var ft=i(53986);function gt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mt(t,e){gt(t,e),e.add(t)}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 bt(t,e,i){return i(vt(t,e))}var wt=i(64467);function yt(t,e,i){gt(t,e),e.set(t,i)}function At(t,e){return t.get(vt(t,e))}function Et(t,e,i){return t.set(vt(t,e),i),i}const xt=["textContentSource","container","viewport"];var _t,kt,Ct,Mt,St,Lt,Tt,Rt,Ft,Pt,It,Nt,Dt={d:(t,e)=>{for(var i in e)Dt.o(e,i)&&!Dt.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Ot=globalThis.pdfjsLib={};Dt.d(Ot,{AbortException:()=>Ke,AnnotationEditorLayer:()=>$f,AnnotationEditorParamsType:()=>Zt,AnnotationEditorType:()=>Qt,AnnotationEditorUIManager:()=>js,AnnotationLayer:()=>hd,AnnotationMode:()=>Kt,CMapCompressionType:()=>Te,ColorPicker:()=>Wu,DOMSVGFactory:()=>qi,DrawLayer:()=>dg,FeatureTest:()=>$e,GlobalWorkerOptions:()=>to,ImageKind:()=>ae,InvalidPDFException:()=>Ge,MissingPDFException:()=>qe,OPS:()=>Re,Outliner:()=>zd,PDFDataRangeTransport:()=>Zl,PDFDateString:()=>an,PDFWorker:()=>hc,PasswordResponses:()=>Fe,PermissionFlag:()=>Jt,PixelsPerInch:()=>_i,RenderingCancelledException:()=>Yi,TextLayer:()=>Sl,UnexpectedResponseException:()=>Xe,Util:()=>ei,VerbosityLevel:()=>Le,XfaLayer:()=>Oc,build:()=>Pc,createValidAbsoluteUrl:()=>Be,fetchData:()=>Vi,getDocument:()=>Xl,getFilenameFromUrl:()=>Zi,getPdfFilenameFromUrl:()=>Ji,getXfaPageViewport:()=>rn,isDataScheme:()=>Ki,isPdfFile:()=>Qi,noContextMenu:()=>en,normalizeUnicode:()=>ri,renderTextLayer:()=>zl,setLayerDimensions:()=>hn,shadow:()=>He,updateTextLayer:()=>Bl,version:()=>Fc});const Wt="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),zt=[1,0,0,1,0,0],Bt=[.001,0,0,.001,0,0],Ht=1.35,jt=1,Vt=2,Ut=4,Gt=16,qt=32,Xt=64,Yt=256,Kt={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Qt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},Zt={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},Jt={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},$t=0,te=1,ee=2,ie=3,ne=3,se=4,ae={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},re=1,oe=2,le=3,ce=4,he=5,de=6,ue=7,pe=8,fe=9,ge=10,me=11,ve=12,be=13,we=14,ye=15,Ae=16,Ee=17,xe=20,_e=1,ke=2,Ce=3,Me=4,Se=5,Le={ERRORS:0,WARNINGS:1,INFOS:5},Te={NONE:0,BINARY:1},Re={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},Fe={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Pe=Le.WARNINGS;function Ie(t){Number.isInteger(t)&&(Pe=t)}function Ne(){return Pe}function De(t){Pe>=Le.INFOS&&console.log("Info: ".concat(t))}function Oe(t){Pe>=Le.WARNINGS&&console.log("Warning: ".concat(t))}function We(t){throw new Error(t)}function ze(t,e){t||We(e)}function Be(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;try{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(n){}}const s=e?new URL(t,e):new URL(t);if(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}}(s))return s}catch(s){}return null}function He(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 je=function(){function t(e,i){this.constructor===t&&We("Cannot initialize BaseException."),this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class Ve extends je{constructor(t,e){super(t,"PasswordException"),this.code=e}}class Ue extends je{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Ge extends je{constructor(t){super(t,"InvalidPDFException")}}class qe extends je{constructor(t){super(t,"MissingPDFException")}}class Xe extends je{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class Ye extends je{constructor(t){super(t,"FormatError")}}class Ke extends je{constructor(t){super(t,"AbortException")}}function Qe(t){"object"===typeof t&&void 0!==(null===t||void 0===t?void 0:t.length)||We("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 a=Math.min(s+i,e),r=t.subarray(s,a);n.push(String.fromCharCode.apply(null,r))}return n.join("")}function Ze(t){"string"!==typeof t&&We("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let n=0;n<e;++n)i[n]=255&t.charCodeAt(n);return i}function Je(t){const e=Object.create(null);for(const[i,n]of t)e[i]=n;return e}class $e{static get isLittleEndian(){return He(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return He(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return He(this,"isOffscreenCanvasSupported","undefined"!==typeof OffscreenCanvas)}static get platform(){var t;return"undefined"!==typeof navigator&&"string"===typeof(null===(t=navigator)||void 0===t?void 0:t.platform)?He(this,"platform",{isMac:navigator.platform.includes("Mac")}):He(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var t,e;return He(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 ti=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class ei{static makeHexColor(t,e,i){return"#".concat(ti[t]).concat(ti[e]).concat(ti[i])}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){const i=this.applyTransform(t,e),n=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),a=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],n[0],s[0],a[0]),Math.min(i[1],n[1],s[1],a[1]),Math.max(i[0],n[0],s[0],a[0]),Math.max(i[1],n[1],s[1],a[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],n=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],a=t[2]*e[1]+t[3]*e[3],r=(i+a)/2,o=Math.sqrt((i+a)**2-4*(i*a-s*n))/2,l=r+o||1,c=r-o||1;return[Math.sqrt(l),Math.sqrt(c)]}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])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>a?null:[i,s,n,a]}static bezierBoundingBox(t,e,i,n,s,a,r,o,l){return l?(l[0]=Math.min(l[0],t,r),l[1]=Math.min(l[1],e,o),l[2]=Math.max(l[2],t,r),l[3]=Math.max(l[3],e,o)):l=[Math.min(t,r),Math.min(e,o),Math.max(t,r),Math.max(e,o)],vt(ei,this,ni).call(this,t,i,s,r,e,n,a,o,3*(3*(i-s)-t+r),6*(t-2*i+s),3*(i-t),l),vt(ei,this,ni).call(this,t,i,s,r,e,n,a,o,3*(3*(n-a)-e+o),6*(e-2*n+a),3*(n-e),l),l}}function ii(t,e,i,n,s,a,r,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,f=h*(h*(h*s+3*l*a)+3*d*r)+u*o;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],f),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],f)}function ni(t,e,i,n,s,a,r,o,l,c,h,d){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&vt(_t,this,ii).call(this,t,e,i,n,s,a,r,o,-h/c,d));const u=c**2-4*h*l;if(u<0)return;const p=Math.sqrt(u),f=2*l;vt(_t,this,ii).call(this,t,e,i,n,s,a,r,o,(-c+p)/f,d),vt(_t,this,ii).call(this,t,e,i,n,s,a,r,o,(-c-p)/f,d)}_t=ei;let si=null,ai=null;function ri(t){return si||(si=/([\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,ai=new Map([["\ufb05","\u017ft"]])),t.replaceAll(si,(t,e,i)=>e?e.normalize("NFKC"):ai.get(i))}const oi="pdfjs_internal_id_",li=0,ci=1,hi=2,di=3,ui=4,pi=5,fi=6,gi=7,mi=8;class vi{constructor(){this.constructor===vi&&We("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,n,s){return"none"}destroy(){}}var bi=new WeakMap;class wi{constructor(){let{enableHWA:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};yt(this,bi,!1),this.constructor===wi&&We("Cannot initialize BaseCanvasFactory."),Et(bi,this,t)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!At(bi,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){We("Abstract method `_createCanvas` called.")}}class yi{constructor(t){let{baseUrl:e=null,isCompressed:i=!0}=t;this.constructor===yi&&We("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=i}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const i=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?Te.BINARY:Te.NONE;return this._fetchData(i,n).catch(t=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(i))})}_fetchData(t,e){We("Abstract method `_fetchData` called.")}}class Ai{constructor(t){let{baseUrl:e=null}=t;this.constructor===Ai&&We("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, 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._fetchData(i).catch(t=>{throw new Error("Unable to load font data at: ".concat(i))})}_fetchData(t){We("Abstract method `_fetchData` called.")}}class Ei{constructor(){this.constructor===Ei&&We("Cannot initialize BaseSVGFactory.")}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){We("Abstract method `_createSVG` called.")}}const xi="http://www.w3.org/2000/svg";class _i{}kt=_i,(0,wt.A)(_i,"CSS",96),(0,wt.A)(_i,"PDF",72),(0,wt.A)(_i,"PDF_TO_CSS_UNITS",kt.CSS/kt.PDF);var ki=new WeakMap,Ci=new WeakMap,Mi=new WeakMap,Si=new WeakMap,Li=new WeakMap,Ti=new WeakMap,Ri=new WeakSet;function Fi(t){return At(ki,t)||Et(ki,t,new Map)}function Pi(t){return At(Li,t)||Et(Li,t,new Map)}function Ii(t){if(!At(Ci,t)){const e=At(Si,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=At(Si,t).createElementNS(xi,"svg");n.setAttribute("width",0),n.setAttribute("height",0),Et(Ci,t,At(Si,t).createElementNS(xi,"defs")),e.append(n),n.append(At(Ci,t)),At(Si,t).body.append(e)}return At(Ci,t)}function Ni(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),a=new Array(256),r=new Array(256);for(let o=0;o<256;o++)s[o]=e[o]/255,a[o]=i[o]/255,r[o]=n[o]/255;return[s.join(","),a.join(","),r.join(",")]}function Di(t){const e=At(Si,this).createElementNS(xi,"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 Oi(t){const e=At(Si,this).createElementNS(xi,"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 Wi(t){const e=At(Si,this).createElementNS(xi,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),bt(Ri,this,Ii).append(e),e}function zi(t,e,i){const n=At(Si,this).createElementNS(xi,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}function Bi(t,e,i,n){const s=At(Si,this).createElementNS(xi,"feComponentTransfer");n.append(s),vt(Ri,this,zi).call(this,s,"feFuncR",t),vt(Ri,this,zi).call(this,s,"feFuncG",e),vt(Ri,this,zi).call(this,s,"feFuncB",i)}function Hi(t,e){const i=At(Si,this).createElementNS(xi,"feComponentTransfer");e.append(i),vt(Ri,this,zi).call(this,i,"feFuncA",t)}function ji(t){return bt(Ri,this,Ii).style.color=t,on(getComputedStyle(bt(Ri,this,Ii)).getPropertyValue("color"))}async function Vi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";if(tn(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)})}class Ui extends yi{_fetchData(t,e){return Vi(t,this.isCompressed?"arraybuffer":"text").then(t=>({cMapData:t instanceof ArrayBuffer?new Uint8Array(t):Ze(t),compressionType:e}))}}class Gi extends Ai{_fetchData(t){return Vi(t,"arraybuffer").then(t=>new Uint8Array(t))}}class qi extends Ei{_createSVG(t){return document.createElementNS(xi,t)}}class Xi{constructor(t){let{viewBox:e,scale:i,rotation:n,offsetX:s=0,offsetY:a=0,dontFlip:r=!1}=t;this.viewBox=e,this.scale=i,this.rotation=n,this.offsetX=s,this.offsetY=a;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,h,d,u,p,f,g,m;switch(n%=360,n<0&&(n+=360),n){case 180:c=-1,h=0,d=0,u=1;break;case 90:c=0,h=1,d=1,u=0;break;case 270:c=0,h=-1,d=-1,u=0;break;case 0:c=1,h=0,d=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}r&&(d=-d,u=-u),0===c?(p=Math.abs(l-e[1])*i+s,f=Math.abs(o-e[0])*i+a,g=(e[3]-e[1])*i,m=(e[2]-e[0])*i):(p=Math.abs(o-e[0])*i+s,f=Math.abs(l-e[1])*i+a,g=(e[2]-e[0])*i,m=(e[3]-e[1])*i),this.transform=[c*i,h*i,d*i,u*i,p-c*i*o-d*i*l,f-h*i*o-u*i*l],this.width=g,this.height=m}get rawDims(){const{viewBox:t}=this;return He(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 Xi({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){return ei.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=ei.applyTransform([t[0],t[1]],this.transform),i=ei.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return ei.applyInverseTransform([t,e],this.transform)}}class Yi extends je{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function Ki(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function Qi(t){return"string"===typeof t&&/\.pdf$/i.test(t)}function Zi(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function Ji(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(Ki(t))return Oe('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let s=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(s&&(s=s[0],s.includes("%")))try{s=i.exec(decodeURIComponent(s))[0]}catch(a){}return s||e}class $i{constructor(){(0,wt.A)(this,"started",Object.create(null)),(0,wt.A)(this,"times",[])}time(t){t in this.started&&Oe("Timer is already running for ".concat(t)),this.started[t]=Date.now()}timeEnd(t){t in this.started||Oe("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 tn(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch(i){return!1}}function en(t){t.preventDefault()}function nn(t){console.log("Deprecated API usage: "+t)}let sn;class an{static toDateObject(t){if(!t||"string"!==typeof t)return null;sn||(sn=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=sn.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 a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let r=parseInt(e[5],10);r=r>=0&&r<=59?r: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?(a+=c,r+=h):"+"===l&&(a-=c,r-=h),new Date(Date.UTC(i,n,s,a,r,o))}}function rn(t,e){let{scale:i=1,rotation:n=0}=e;const{width:s,height:a}=t.attributes.style,r=[0,0,parseInt(s),parseInt(a)];return new Xi({viewBox:r,scale:i,rotation:n})}function on(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):(Oe('Not a valid color format: "'.concat(t,'"')),[0,0,0])}function ln(t){const{a:e,b:i,c:n,d:s,e:a,f:r}=t.getTransform();return[e,i,n,s,a,r]}function cn(t){const{a:e,b:i,c:n,d:s,e:a,f:r}=t.getTransform().invertSelf();return[e,i,n,s,a,r]}function hn(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 Xi){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:a}=t,r=$e.isCSSRoundSupported,o="var(--scale-factor) * ".concat(n,"px"),l="var(--scale-factor) * ".concat(s,"px"),c=r?"round(".concat(o,", 1px)"):"calc(".concat(o,")"),h=r?"round(".concat(l,", 1px)"):"calc(".concat(l,")");i&&e.rotation%180!==0?(a.width=h,a.height=c):(a.width=c,a.height=h)}n&&t.setAttribute("data-main-rotation",e.rotation)}var dn=new WeakMap,un=new WeakMap,pn=new WeakMap,fn=new WeakMap,gn=new WeakSet;class mn{constructor(t){mt(this,gn),yt(this,dn,null),yt(this,un,null),yt(this,pn,void 0),yt(this,fn,null),Et(pn,this,t)}render(){const t=Et(dn,this,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const e=At(pn,this)._uiManager._signal;t.addEventListener("contextmenu",en,{signal:e}),t.addEventListener("pointerdown",vn,{signal:e});const i=Et(fn,this,document.createElement("div"));i.className="buttons",t.append(i);const n=At(pn,this).toolbarPosition;if(n){const{style:e}=t,i="ltr"===At(pn,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 vt(gn,this,An).call(this),t}hide(){var t;At(dn,this).classList.add("hidden"),null===(t=At(un,this))||void 0===t||t.hideDropdown()}show(){At(dn,this).classList.remove("hidden")}addAltTextButton(t){vt(gn,this,yn).call(this,t),At(fn,this).prepend(t,bt(gn,this,En))}addColorPicker(t){Et(un,this,t);const e=t.renderButton();vt(gn,this,yn).call(this,e),At(fn,this).prepend(e,bt(gn,this,En))}remove(){var t;At(dn,this).remove(),null===(t=At(un,this))||void 0===t||t.destroy(),Et(un,this,null)}}function vn(t){t.stopPropagation()}function bn(t){At(pn,this)._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}function wn(t){At(pn,this)._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}function yn(t){const e=At(pn,this)._uiManager._signal;t.addEventListener("focusin",vt(gn,this,bn).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",vt(gn,this,wn).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",en,{signal:e})}function An(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-editor-remove-".concat(At(pn,this).editorType,"-button")),vt(gn,this,yn).call(this,t),t.addEventListener("click",t=>{At(pn,this)._uiManager.delete()},{signal:At(pn,this)._uiManager._signal}),At(fn,this).append(t)}function En(t){const e=document.createElement("div");return e.className="divider",e}var xn=new WeakMap,_n=new WeakMap,kn=new WeakMap,Cn=new WeakSet;class Mn{constructor(t){mt(this,Cn),yt(this,xn,null),yt(this,_n,null),yt(this,kn,void 0),Et(kn,this,t)}show(t,e,i){const[n,s]=vt(Cn,this,Ln).call(this,e,i),{style:a}=At(_n,this)||Et(_n,this,vt(Cn,this,Sn).call(this));t.append(At(_n,this)),a.insetInlineEnd="".concat(100*n,"%"),a.top="calc(".concat(100*s,"% + var(--editor-toolbar-vert-offset))")}hide(){At(_n,this).remove()}}function Sn(){const t=Et(_n,this,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",en,{signal:At(kn,this)._signal});const e=Et(xn,this,document.createElement("div"));return e.className="buttons",t.append(e),vt(Cn,this,Tn).call(this),t}function Ln(t,e){let i=0,n=0;for(const s of t){const t=s.y+s.height;if(t<i)continue;const a=s.x+(e?s.width:0);t>i?(n=a,i=t):e?a>n&&(n=a):a<n&&(n=a)}return[e?1-n:n,i]}function Tn(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=At(kn,this)._signal;t.addEventListener("contextmenu",en,{signal:i}),t.addEventListener("click",()=>{At(kn,this).highlightSelection("floating_button")},{signal:i}),At(xn,this).append(t)}function Rn(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}var Fn=new WeakMap;class Pn{constructor(){yt(this,Fn,0)}get id(){var t,e;return"".concat("pdfjs_internal_editor_").concat((Et(Fn,this,(t=At(Fn,this),e=t++,t)),e))}}var In=new WeakMap,Nn=new WeakMap,Dn=new WeakMap,On=new WeakSet;class Wn{constructor(){mt(this,On),yt(this,In,function(){var t,e;if("undefined"!==typeof crypto&&"function"===typeof(null===(t=crypto)||void 0===t?void 0:t.randomUUID))return crypto.randomUUID();const i=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof(null===(e=crypto)||void 0===e?void 0:e.getRandomValues))crypto.getRandomValues(i);else for(let n=0;n<32;n++)i[n]=Math.floor(255*Math.random());return Qe(i)}()),yt(this,Nn,0),yt(this,Dn,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 He(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(On,this,zn).call(this,"".concat(e,"_").concat(i,"_").concat(n,"_").concat(s),t)}async getFromUrl(t){return vt(On,this,zn).call(this,t,t)}async getFromId(t){At(Dn,this)||Et(Dn,this,new Map);const e=At(Dn,this).get(t);return e?e.bitmap?(e.refCounter+=1,e):e.file?this.getFromFile(e.file):this.getFromUrl(e.url):null}getSvgUrl(t){const e=At(Dn,this).get(t);return null!==e&&void 0!==e&&e.isSvg?e.svgUrl:null}deleteId(t){At(Dn,this)||Et(Dn,this,new Map);const e=At(Dn,this).get(t);e&&(e.refCounter-=1,0===e.refCounter&&(e.bitmap=null))}isValidId(t){return t.startsWith("image_".concat(At(In,this),"_"))}}async function zn(t,e){var i;At(Dn,this)||Et(Dn,this,new Map);let n=At(Dn,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,a;let t;if(n||(n={bitmap:null,id:"image_".concat(At(In,this),"_").concat((Et(Nn,this,(s=At(Nn,this),a=s++,s)),a)),refCounter:0,isSvg:!1}),"string"===typeof e?(n.url=e,t=await Vi(e,"blob")):t=n.file=e,"image/svg+xml"===t.type){const e=Ct._isSVGFittingCanvas,i=new FileReader,s=new Image,a=new Promise((t,a)=>{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=a});i.readAsDataURL(t),await a}else n.bitmap=await createImageBitmap(t);n.refCounter=1}catch(r){console.error(r),n=null}return At(Dn,this).set(t,n),n&&At(Dn,this).set(n.id,n),n}Ct=Wn;var Bn=new WeakMap,Hn=new WeakMap,jn=new WeakMap,Vn=new WeakMap;class Un{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;yt(this,Bn,[]),yt(this,Hn,!1),yt(this,jn,void 0),yt(this,Vn,-1),Et(jn,this,t)}add(t){let{cmd:e,undo:i,post:n,mustExec:s,type:a=NaN,overwriteIfSameType:r=!1,keepUndo:o=!1}=t;if(s&&e(),At(Hn,this))return;const l={cmd:e,undo:i,post:n,type:a};if(-1===At(Vn,this))return At(Bn,this).length>0&&(At(Bn,this).length=0),Et(Vn,this,0),void At(Bn,this).push(l);if(r&&At(Bn,this)[At(Vn,this)].type===a)return o&&(l.undo=At(Bn,this)[At(Vn,this)].undo),void(At(Bn,this)[At(Vn,this)]=l);const c=At(Vn,this)+1;c===At(jn,this)?At(Bn,this).splice(0,1):(Et(Vn,this,c),c<At(Bn,this).length&&At(Bn,this).splice(c)),At(Bn,this).push(l)}undo(){if(-1===At(Vn,this))return;Et(Hn,this,!0);const{undo:t,post:e}=At(Bn,this)[At(Vn,this)];t(),null===e||void 0===e||e(),Et(Hn,this,!1),Et(Vn,this,At(Vn,this)-1)}redo(){if(At(Vn,this)<At(Bn,this).length-1){Et(Vn,this,At(Vn,this)+1),Et(Hn,this,!0);const{cmd:t,post:e}=At(Bn,this)[At(Vn,this)];t(),null===e||void 0===e||e(),Et(Hn,this,!1)}}hasSomethingToUndo(){return-1!==At(Vn,this)}hasSomethingToRedo(){return At(Vn,this)<At(Bn,this).length-1}destroy(){Et(Bn,this,null)}}var Gn=new WeakSet;class qn{constructor(t){mt(this,Gn),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=$e.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(Gn,this,Xn).call(this,e));if(!i)return;const{callback:n,options:{bubbles:s=!1,args:a=[],checker:r=null}}=i;r&&!r(t,e)||(n.bind(t,...a,e)(),s||(e.stopPropagation(),e.preventDefault()))}}function Xn(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 Yn{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,on(n))}e.remove()}(t),He(this,"_colors",t)}convert(t){const e=on(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 Yn._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?ei.makeHexColor(...e):t}}(0,wt.A)(Yn,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var 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,as=new WeakMap,rs=new WeakMap,os=new WeakMap,ls=new WeakMap,cs=new WeakMap,hs=new WeakMap,ds=new WeakMap,us=new WeakMap,ps=new WeakMap,fs=new WeakMap,gs=new WeakMap,ms=new WeakMap,vs=new WeakMap,bs=new WeakMap,ws=new WeakMap,ys=new WeakMap,As=new WeakMap,Es=new WeakMap,xs=new WeakMap,_s=new WeakMap,ks=new WeakMap,Cs=new WeakMap,Ms=new WeakMap,Ss=new WeakMap,Ls=new WeakMap,Ts=new WeakMap,Rs=new WeakMap,Fs=new WeakMap,Ps=new WeakMap,Is=new WeakMap,Ns=new WeakMap,Ds=new WeakMap,Os=new WeakMap,Ws=new WeakMap,zs=new WeakMap,Bs=new WeakMap,Hs=new WeakSet;class js{static get _keyboardManager(){const t=js.prototype,e=t=>At(zs,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 He(this,"_keyboardManager",new qn([[["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)&&At(zs,t).contains(i)&&!t.isEnterHandled}}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&At(zs,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,a,r,o,l){mt(this,Hs),yt(this,Kn,new AbortController),yt(this,Qn,null),yt(this,Zn,new Map),yt(this,Jn,new Map),yt(this,$n,null),yt(this,ts,null),yt(this,es,null),yt(this,is,new Un),yt(this,ns,0),yt(this,ss,new Set),yt(this,as,null),yt(this,rs,null),yt(this,os,new Set),yt(this,ls,!1),yt(this,cs,null),yt(this,hs,null),yt(this,ds,null),yt(this,us,!1),yt(this,ps,null),yt(this,fs,new Pn),yt(this,gs,!1),yt(this,ms,!1),yt(this,vs,null),yt(this,bs,null),yt(this,ws,null),yt(this,ys,Qt.NONE),yt(this,As,new Set),yt(this,Es,null),yt(this,xs,null),yt(this,_s,null),yt(this,ks,this.blur.bind(this)),yt(this,Cs,this.focus.bind(this)),yt(this,Ms,this.copy.bind(this)),yt(this,Ss,this.cut.bind(this)),yt(this,Ls,this.paste.bind(this)),yt(this,Ts,this.keydown.bind(this)),yt(this,Rs,this.keyup.bind(this)),yt(this,Fs,this.onEditingAction.bind(this)),yt(this,Ps,this.onPageChanging.bind(this)),yt(this,Is,this.onScaleChanging.bind(this)),yt(this,Ns,this.onRotationChanging.bind(this)),yt(this,Ds,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),yt(this,Os,[0,0]),yt(this,Ws,null),yt(this,zs,null),yt(this,Bs,null),this._signal=At(Kn,this).signal,Et(zs,this,t),Et(Bs,this,e),Et($n,this,i),this._eventBus=n,this._eventBus._on("editingaction",At(Fs,this)),this._eventBus._on("pagechanging",At(Ps,this)),this._eventBus._on("scalechanging",At(Is,this)),this._eventBus._on("rotationchanging",At(Ns,this)),vt(Hs,this,Xs).call(this),vt(Hs,this,ta).call(this),vt(Hs,this,Qs).call(this),Et(ts,this,s.annotationStorage),Et(cs,this,s.filterFactory),Et(xs,this,a),Et(ds,this,r||null),Et(ls,this,o),Et(ws,this,l||null),this.viewParameters={realScale:_i.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){var t,e,i;null===(t=At(Kn,this))||void 0===t||t.abort(),Et(Kn,this,null),this._signal=null,this._eventBus._off("editingaction",At(Fs,this)),this._eventBus._off("pagechanging",At(Ps,this)),this._eventBus._off("scalechanging",At(Is,this)),this._eventBus._off("rotationchanging",At(Ns,this));for(const n of At(Jn,this).values())n.destroy();At(Jn,this).clear(),At(Zn,this).clear(),At(os,this).clear(),Et(Qn,this,null),At(As,this).clear(),At(is,this).destroy(),null===(e=At($n,this))||void 0===e||e.destroy(),null===(i=At(ps,this))||void 0===i||i.hide(),Et(ps,this,null),At(hs,this)&&(clearTimeout(At(hs,this)),Et(hs,this,null)),At(Ws,this)&&(clearTimeout(At(Ws,this)),Et(Ws,this,null))}async mlGuess(t){var e;return(null===(e=At(ws,this))||void 0===e?void 0:e.guess(t))||null}get hasMLManager(){return!!At(ws,this)}get hcmFilter(){return He(this,"hcmFilter",At(xs,this)?At(cs,this).addHCMFilter(At(xs,this).foreground,At(xs,this).background):"none")}get direction(){return He(this,"direction",getComputedStyle(At(zs,this)).direction)}get highlightColors(){return He(this,"highlightColors",At(ds,this)?new Map(At(ds,this).split(",").map(t=>t.split("=").map(t=>t.trim()))):null)}get highlightColorNames(){return He(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){Et(bs,this,t)}editAltText(t){var e;null===(e=At($n,this))||void 0===e||e.editAltText(this,t)}onPageChanging(t){let{pageNumber:e}=t;Et(ns,this,e-1)}focusMainContainer(){At(zs,this).focus()}findParent(t,e){for(const i of At(Jn,this).values()){const{x:n,y:s,width:a,height:r}=i.div.getBoundingClientRect();if(t>=n&&t<=n+a&&e>=s&&e<=s+r)return i}return null}disableUserSelect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];At(Bs,this).classList.toggle("noUserSelect",t)}addShouldRescale(t){At(os,this).add(t)}removeShouldRescale(t){At(os,this).delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove(),this.viewParameters.realScale=e*_i.PDF_TO_CSS_UNITS;for(const i of At(os,this))i.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]:"";const e=document.getSelection();if(!e||e.isCollapsed)return;const{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:a}=e,r=e.toString(),o=vt(Hs,this,Vs).call(this,e).closest(".textLayer"),l=this.getSelectionBoxes(o);if(l){e.empty(),At(ys,this)===Qt.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:Qt.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const e of At(Jn,this).values())if(e.hasTextLayer(o)){e.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:l,anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:a,text:r});break}}}addToAnnotationStorage(t){t.isEmpty()||!At(ts,this)||At(ts,this).has(t.id)||At(ts,this).setValue(t.id,t)}blur(){if(this.isShiftKeyDown=!1,At(us,this)&&(Et(us,this,!1),vt(Hs,this,qs).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of At(As,this))if(e.div.contains(t)){Et(vs,this,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!At(vs,this))return;const[t,e]=At(vs,this);Et(vs,this,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){vt(Hs,this,Qs).call(this),vt(Hs,this,Js).call(this)}removeEditListeners(){vt(Hs,this,Zs).call(this),vt(Hs,this,$s).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of At(rs,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 At(rs,this))if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){var e;if(t.preventDefault(),null===(e=At(Qn,this))||void 0===e||e.commitOrRemove(),!this.hasSelection)return;const i=[];for(const n of At(As,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()}paste(t){t.preventDefault();const{clipboardData:e}=t;for(const a of e.items)for(const t of At(rs,this))if(t.isHandlingMimeForPasting(a.type))return void t.paste(a,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(s){return void Oe('paste: "'.concat(s.message,'".'))}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const t=[];for(const a of i){const e=n.deserialize(a);if(!e)return;t.push(e)}const e=()=>{for(const e of t)vt(Hs,this,aa).call(this,e);vt(Hs,this,la).call(this,t)},s=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:s,mustExec:!0})}catch(s){Oe('paste: "'.concat(s.message,'".'))}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),At(ys,this)===Qt.NONE||this.isEditorHandlingKeyboard||js._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,At(us,this)&&(Et(us,this,!1),vt(Hs,this,qs).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")}}setEditingState(t){t?(vt(Hs,this,Ys).call(this),vt(Hs,this,Js).call(this),vt(Hs,this,ea).call(this,{isEditing:At(ys,this)!==Qt.NONE,isEmpty:vt(Hs,this,oa).call(this),hasSomethingToUndo:At(is,this).hasSomethingToUndo(),hasSomethingToRedo:At(is,this).hasSomethingToRedo(),hasSelectedEditor:!1})):(vt(Hs,this,Ks).call(this),vt(Hs,this,$s).call(this),vt(Hs,this,ea).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!At(rs,this)){Et(rs,this,t);for(const t of At(rs,this))vt(Hs,this,ia).call(this,t.defaultPropertiesToUpdate)}}getId(){return At(fs,this).id}get currentLayer(){return At(Jn,this).get(At(ns,this))}getLayer(t){return At(Jn,this).get(t)}get currentPageIndex(){return At(ns,this)}addLayer(t){At(Jn,this).set(t.pageIndex,t),At(gs,this)?t.enable():t.disable()}removeLayer(t){At(Jn,this).delete(t.pageIndex)}updateMode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(At(ys,this)!==t){if(Et(ys,this,t),t===Qt.NONE)return this.setEditingState(!1),void vt(Hs,this,sa).call(this);this.setEditingState(!0),vt(Hs,this,na).call(this),this.unselectAll();for(const e of At(Jn,this).values())e.updateMode(t);if(e||!i){if(e)for(const t of At(Zn,this).values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}else this.addNewEditorFromKeyboard()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==At(ys,this)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){var i;if(At(rs,this)){switch(t){case Zt.CREATE:return void this.currentLayer.addNewEditor();case Zt.HIGHLIGHT_DEFAULT_COLOR:null===(i=At(bs,this))||void 0===i||i.updateColor(e);break;case Zt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(At(_s,this)||Et(_s,this,new Map)).set(t,e),this.showAllEditors("highlight",e)}for(const i of At(As,this))i.updateParams(t,e);for(const i of At(rs,this))i.updateDefaultParams(t,e)}}showAllEditors(t,e){var i,n;for(const s of At(Zn,this).values())s.editorType===t&&s.show(e);(null===(i=null===(n=At(_s,this))||void 0===n?void 0:n.get(Zt.HIGHLIGHT_SHOW_ALL))||void 0===i||i)!==e&&vt(Hs,this,ia).call(this,[[Zt.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(At(ms,this)!==t){Et(ms,this,t);for(const e of At(Jn,this).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}getEditors(t){const e=[];for(const i of At(Zn,this).values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return At(Zn,this).get(t)}addEditor(t){At(Zn,this).set(t.id,t)}removeEditor(t){var e;(t.div.contains(document.activeElement)&&(At(hs,this)&&clearTimeout(At(hs,this)),Et(hs,this,setTimeout(()=>{this.focusMainContainer(),Et(hs,this,null)},0))),At(Zn,this).delete(t.id),this.unselect(t),t.annotationElementId&&At(ss,this).has(t.annotationElementId))||(null===(e=At(ts,this))||void 0===e||e.remove(t.id))}addDeletedAnnotationElement(t){At(ss,this).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return At(ss,this).has(t)}removeDeletedAnnotationElement(t){At(ss,this).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){At(Qn,this)!==t&&(Et(Qn,this,t),t&&vt(Hs,this,ia).call(this,t.propertiesToUpdate))}updateUI(t){bt(Hs,this,ra)===t&&vt(Hs,this,ia).call(this,t.propertiesToUpdate)}toggleSelected(t){if(At(As,this).has(t))return At(As,this).delete(t),t.unselect(),void vt(Hs,this,ea).call(this,{hasSelectedEditor:this.hasSelection});At(As,this).add(t),t.select(),vt(Hs,this,ia).call(this,t.propertiesToUpdate),vt(Hs,this,ea).call(this,{hasSelectedEditor:!0})}setSelected(t){for(const e of At(As,this))e!==t&&e.unselect();At(As,this).clear(),At(As,this).add(t),t.select(),vt(Hs,this,ia).call(this,t.propertiesToUpdate),vt(Hs,this,ea).call(this,{hasSelectedEditor:!0})}isSelected(t){return At(As,this).has(t)}get firstSelectedEditor(){return At(As,this).values().next().value}unselect(t){t.unselect(),At(As,this).delete(t),vt(Hs,this,ea).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==At(As,this).size}get isEnterHandled(){return 1===At(As,this).size&&this.firstSelectedEditor.isEnterHandled}undo(){At(is,this).undo(),vt(Hs,this,ea).call(this,{hasSomethingToUndo:At(is,this).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:vt(Hs,this,oa).call(this)})}redo(){At(is,this).redo(),vt(Hs,this,ea).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:At(is,this).hasSomethingToRedo(),isEmpty:vt(Hs,this,oa).call(this)})}addCommands(t){At(is,this).add(t),vt(Hs,this,ea).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:vt(Hs,this,oa).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...At(As,this)];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)vt(Hs,this,aa).call(this,e)},mustExec:!0})}commitOrRemove(){var t;null===(t=At(Qn,this))||void 0===t||t.commitOrRemove()}hasSomethingToControl(){return At(Qn,this)||this.hasSelection}selectAll(){for(const t of At(As,this))t.commit();vt(Hs,this,la).call(this,At(Zn,this).values())}unselectAll(){if((!At(Qn,this)||(At(Qn,this).commitOrRemove(),At(ys,this)===Qt.NONE))&&this.hasSelection){for(const t of At(As,this))t.unselect();At(As,this).clear(),vt(Hs,this,ea).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;At(Os,this)[0]+=t,At(Os,this)[1]+=e;const[i,n]=At(Os,this),s=[...At(As,this)];At(Ws,this)&&clearTimeout(At(Ws,this)),Et(Ws,this,setTimeout(()=>{Et(Ws,this,null),At(Os,this)[0]=At(Os,this)[1]=0,this.addCommands({cmd:()=>{for(const t of s)At(Zn,this).has(t.id)&&t.translateInPage(i,n)},undo:()=>{for(const t of s)At(Zn,this).has(t.id)&&t.translateInPage(-i,-n)},mustExec:!1})},1e3));for(const a of s)a.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),Et(as,this,new Map);for(const t of At(As,this))At(as,this).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!At(as,this))return!1;this.disableUserSelect(!1);const t=At(as,this);Et(as,this,null);let e=!1;for(const[{x:n,y:s,pageIndex:a},r]of t)r.newX=n,r.newY=s,r.newPageIndex=a,e||(e=n!==r.savedX||s!==r.savedY||a!==r.savedPageIndex);if(!e)return!1;const i=(t,e,i,n)=>{if(At(Zn,this).has(t.id)){const s=At(Jn,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:a}]of t)i(e,n,s,a)},undo:()=>{for(const[e,{savedX:n,savedY:s,savedPageIndex:a}]of t)i(e,n,s,a)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(At(as,this))for(const i of At(as,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===At(As,this).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return At(Qn,this)===t}getActive(){return At(Qn,this)}getMode(){return At(ys,this)}get imageManager(){return He(this,"imageManager",new Wn)}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:a}=t.getBoundingClientRect();let r;switch(t.getAttribute("data-main-rotation")){case"90":r=(t,e,r,o)=>({x:(e-n)/a,y:1-(t+r-i)/s,width:o/a,height:r/s});break;case"180":r=(t,e,r,o)=>({x:1-(t+r-i)/s,y:1-(e+o-n)/a,width:r/s,height:o/a});break;case"270":r=(t,e,r,o)=>({x:1-(e+o-n)/a,y:(t-i)/s,width:o/a,height:r/s});break;default:r=(t,e,r,o)=>({x:(t-i)/s,y:(e-n)/a,width:r/s,height:o/a})}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(r(e,i,n,s))}return 0===o.length?null:o}addChangedExistingAnnotation(t){let{annotationElementId:e,id:i}=t;(At(es,this)||Et(es,this,new Map)).set(e,i)}removeChangedExistingAnnotation(t){var e;let{annotationElementId:i}=t;null===(e=At(es,this))||void 0===e||e.delete(i)}renderAnnotationElement(t){var e;const i=null===(e=At(es,this))||void 0===e?void 0:e.get(t.data.id);if(!i)return;const n=At(ts,this).getRawValue(i);n&&(At(ys,this)!==Qt.NONE||n.hasBeenModified)&&n.renderAnnotationElement(t)}}function Vs(t){let{anchorNode:e}=t;return e.nodeType===Node.TEXT_NODE?e.parentElement:e}function Us(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=vt(Hs,this,Vs).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(At(ps,this)||Et(ps,this,new Mn(this)),At(ps,this).show(e,i,"ltr"===this.direction))}function Gs(){var t;const e=document.getSelection();if(!e||e.isCollapsed){var i;if(At(Es,this))null===(i=At(ps,this))||void 0===i||i.hide(),Et(Es,this,null),vt(Hs,this,ea).call(this,{hasSelectedText:!1});return}const{anchorNode:n}=e;if(n===At(Es,this))return;var s;if(vt(Hs,this,Vs).call(this,e).closest(".textLayer")){if(null===(t=At(ps,this))||void 0===t||t.hide(),Et(Es,this,n),vt(Hs,this,ea).call(this,{hasSelectedText:!0}),(At(ys,this)===Qt.HIGHLIGHT||At(ys,this)===Qt.NONE)&&(At(ys,this)===Qt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),Et(us,this,this.isShiftKeyDown),!this.isShiftKeyDown)){const t=this._signal,e=t=>{"pointerup"===t.type&&0!==t.button||(window.removeEventListener("pointerup",e),window.removeEventListener("blur",e),"pointerup"===t.type&&vt(Hs,this,qs).call(this,"main_toolbar"))};window.addEventListener("pointerup",e,{signal:t}),window.addEventListener("blur",e,{signal:t})}}else At(Es,this)&&(null===(s=At(ps,this))||void 0===s||s.hide(),Et(Es,this,null),vt(Hs,this,ea).call(this,{hasSelectedText:!1}))}function qs(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";At(ys,this)===Qt.HIGHLIGHT?this.highlightSelection(t):At(ls,this)&&vt(Hs,this,Us).call(this)}function Xs(){document.addEventListener("selectionchange",vt(Hs,this,Gs).bind(this),{signal:this._signal})}function Ys(){const t=this._signal;window.addEventListener("focus",At(Cs,this),{signal:t}),window.addEventListener("blur",At(ks,this),{signal:t})}function Ks(){window.removeEventListener("focus",At(Cs,this)),window.removeEventListener("blur",At(ks,this))}function Qs(){const t=this._signal;window.addEventListener("keydown",At(Ts,this),{signal:t}),window.addEventListener("keyup",At(Rs,this),{signal:t})}function Zs(){window.removeEventListener("keydown",At(Ts,this)),window.removeEventListener("keyup",At(Rs,this))}function Js(){const t=this._signal;document.addEventListener("copy",At(Ms,this),{signal:t}),document.addEventListener("cut",At(Ss,this),{signal:t}),document.addEventListener("paste",At(Ls,this),{signal:t})}function $s(){document.removeEventListener("copy",At(Ms,this)),document.removeEventListener("cut",At(Ss,this)),document.removeEventListener("paste",At(Ls,this))}function ta(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}function ea(t){Object.entries(t).some(t=>{let[e,i]=t;return At(Ds,this)[e]!==i})&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(At(Ds,this),t)}),At(ys,this)===Qt.HIGHLIGHT&&!1===t.hasSelectedEditor&&vt(Hs,this,ia).call(this,[[Zt.HIGHLIGHT_FREE,!0]]))}function ia(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}function na(){if(!At(gs,this)){Et(gs,this,!0);for(const t of At(Jn,this).values())t.enable();for(const t of At(Zn,this).values())t.enable()}}function sa(){if(this.unselectAll(),At(gs,this)){Et(gs,this,!1);for(const t of At(Jn,this).values())t.disable();for(const t of At(Zn,this).values())t.disable()}}function aa(t){const e=At(Jn,this).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}function ra(t){let e=null;for(e of At(As,t));return e}function oa(){if(0===At(Zn,this).size)return!0;if(1===At(Zn,this).size)for(const t of At(Zn,this).values())return t.isEmpty();return!1}function la(t){for(const e of At(As,this))e.unselect();At(As,this).clear();for(const e of t)e.isEmpty()||(At(As,this).add(e),e.select());vt(Hs,this,ea).call(this,{hasSelectedEditor:this.hasSelection})}(0,wt.A)(js,"TRANSLATE_SMALL",1),(0,wt.A)(js,"TRANSLATE_BIG",10);var ca=new WeakMap,ha=new WeakMap,da=new WeakMap,ua=new WeakMap,pa=new WeakMap,fa=new WeakMap,ga=new WeakMap,ma=new WeakSet;class va{constructor(t){mt(this,ma),yt(this,ca,""),yt(this,ha,!1),yt(this,da,null),yt(this,ua,null),yt(this,pa,null),yt(this,fa,!1),yt(this,ga,null),Et(ga,this,t)}static initialize(t){va._l10nPromise||(va._l10nPromise=t)}async render(){const t=Et(da,this,document.createElement("button"));t.className="altText";const e=await va._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0";const i=At(ga,this)._uiManager._signal;t.addEventListener("contextmenu",en,{signal:i}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const n=t=>{t.preventDefault(),At(ga,this)._uiManager.editAltText(At(ga,this))};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(Et(fa,this,!0),n(e))},{signal:i}),await vt(ma,this,ba).call(this),t}finish(){At(da,this)&&(At(da,this).focus({focusVisible:At(fa,this)}),Et(fa,this,!1))}isEmpty(){return!At(ca,this)&&!At(ha,this)}get data(){return{altText:At(ca,this),decorative:At(ha,this)}}set data(t){let{altText:e,decorative:i}=t;At(ca,this)===e&&At(ha,this)===i||(Et(ca,this,e),Et(ha,this,i),vt(ma,this,ba).call(this))}toggle(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];At(da,this)&&(!t&&At(pa,this)&&(clearTimeout(At(pa,this)),Et(pa,this,null)),At(da,this).disabled=!t)}destroy(){var t;null===(t=At(da,this))||void 0===t||t.remove(),Et(da,this,null),Et(ua,this,null)}}async function ba(){const t=At(da,this);if(!t)return;var e;if(!At(ca,this)&&!At(ha,this))return t.classList.remove("done"),void(null===(e=At(ua,this))||void 0===e||e.remove());t.classList.add("done"),Mt._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(e=>{t.setAttribute("aria-label",e)});let i=At(ua,this);if(!i){Et(ua,this,i=document.createElement("span")),i.className="tooltip",i.setAttribute("role","tooltip");const e=i.id="alt-text-tooltip-".concat(At(ga,this).id);t.setAttribute("aria-describedby",e);const n=100,s=At(ga,this)._uiManager._signal;s.addEventListener("abort",()=>{clearTimeout(At(pa,this)),Et(pa,this,null)},{once:!0}),t.addEventListener("mouseenter",()=>{Et(pa,this,setTimeout(()=>{Et(pa,this,null),At(ua,this).classList.add("show"),At(ga,this)._reportTelemetry({action:"alt_text_tooltip"})},n))},{signal:s}),t.addEventListener("mouseleave",()=>{var t;At(pa,this)&&(clearTimeout(At(pa,this)),Et(pa,this,null)),null===(t=At(ua,this))||void 0===t||t.classList.remove("show")},{signal:s})}i.innerText=At(ha,this)?await Mt._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):At(ca,this),i.parentNode||t.append(i);const n=At(ga,this).getImageForAltText();null===n||void 0===n||n.setAttribute("aria-describedby",i.id)}Mt=va,(0,wt.A)(va,"_l10nPromise",null);var wa=new WeakMap,ya=new WeakMap,Aa=new WeakMap,Ea=new WeakMap,xa=new WeakMap,_a=new WeakMap,ka=new WeakMap,Ca=new WeakMap,Ma=new WeakMap,Sa=new WeakMap,La=new WeakMap,Ta=new WeakMap,Ra=new WeakMap,Fa=new WeakMap,Pa=new WeakMap,Ia=new WeakMap,Na=new WeakMap,Da=new WeakMap,Oa=new WeakMap,Wa=new WeakMap,za=new WeakMap,Ba=new WeakMap,Ha=new WeakSet;class ja{static get _resizerKeyboardManager(){const t=ja.prototype._resizeWithKeyboard,e=js.TRANSLATE_SMALL,i=js.TRANSLATE_BIG;return He(this,"_resizerKeyboardManager",new qn([[["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"],ja.prototype._stopResizingWithKeyboard]]))}constructor(t){mt(this,Ha),yt(this,wa,null),yt(this,ya,null),yt(this,Aa,null),yt(this,Ea,!1),yt(this,xa,!1),yt(this,_a,null),yt(this,ka,null),yt(this,Ca,this.focusin.bind(this)),yt(this,Ma,this.focusout.bind(this)),yt(this,Sa,null),yt(this,La,""),yt(this,Ta,!1),yt(this,Ra,null),yt(this,Fa,!1),yt(this,Pa,!1),yt(this,Ia,!1),yt(this,Na,null),yt(this,Da,0),yt(this,Oa,0),yt(this,Wa,null),(0,wt.A)(this,"_initialOptions",Object.create(null)),(0,wt.A)(this,"_isVisible",!0),(0,wt.A)(this,"_uiManager",null),(0,wt.A)(this,"_focusEventsAllowed",!0),(0,wt.A)(this,"_l10nPromise",null),yt(this,za,!1),yt(this,Ba,ja._zIndex++),this.constructor===ja&&We("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:s,pageY:a}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[s,a];const[r,o]=this.parentDimensions;this.x=t.x/r,this.y=t.y/o,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return He(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new nr({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e,i){if(ja._l10nPromise||(ja._l10nPromise=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(e=>[e,t.get(e.replaceAll(/([A-Z])/g,t=>"-".concat(t.toLowerCase())))]))),null!==i&&void 0!==i&&i.strings)for(const s of i.strings)ja._l10nPromise.set(s,t.get(s));if(-1!==ja._borderLineWidth)return;const n=getComputedStyle(document.documentElement);ja._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){We("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return At(za,this)}set _isDraggable(t){var e;Et(za,this,t),null===(e=this.div)||void 0===e||e.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=At(Ba,this)}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):vt(Ha,this,ir).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&(At(Ta,this)?Et(Ta,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.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,n){const[s,a]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(t+i)/s,this.y=(e+n)/a,this.fixAndSetPosition()}translate(t,e){vt(Ha,this,Va).call(this,this.parentDimensions,t,e)}translateInPage(t,e){At(Ra,this)||Et(Ra,this,[this.x,this.y]),vt(Ha,this,Va).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){At(Ra,this)||Et(Ra,this,[this.x,this.y]);const[i,n]=this.parentDimensions;if(this.x+=t/i,this.y+=e/n,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:s,y:a}=this;const[r,o]=this.getBaseTranslation();s+=r,a+=o,this.div.style.left="".concat((100*s).toFixed(2),"%"),this.div.style.top="".concat((100*a).toFixed(2),"%"),this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!At(Ra,this)&&(At(Ra,this)[0]!==this.x||At(Ra,this)[1]!==this.y)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=ja,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[e,i]=this.pageDimensions;let{x:n,y:s,width:a,height:r}=this;if(a*=e,r*=i,n*=e,s*=i,this._mustFixPosition)switch(t){case 0:n=Math.max(0,Math.min(e-a,n)),s=Math.max(0,Math.min(i-r,s));break;case 90:n=Math.max(0,Math.min(e-r,n)),s=Math.min(i,Math.max(a,s));break;case 180:n=Math.min(e,Math.max(a,n)),s=Math.min(i,Math.max(r,s));break;case 270:n=Math.min(e,Math.max(r,n)),s=Math.max(0,Math.min(i-a,s))}this.x=n/=e,this.y=s/=i;const[o,l]=this.getBaseTranslation();n+=o,s+=l;const{style:c}=this.div;c.left="".concat((100*n).toFixed(2),"%"),c.top="".concat((100*s).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(t,e){return Ua.call(ja,t,e,this.parentRotation)}pageTranslationToScreen(t,e){return Ua.call(ja,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this,n=e*t,s=i*t;return $e.isCSSRoundSupported?[Math.round(n),Math.round(s)]:[n,s]}setDims(t,e){const[i,n]=this.parentDimensions;this.div.style.width="".concat((100*t/i).toFixed(2),"%"),At(xa,this)||(this.div.style.height="".concat((100*e/n).toFixed(2),"%"))}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,n=i.endsWith("%"),s=!At(xa,this)&&e.endsWith("%");if(n&&s)return;const[a,r]=this.parentDimensions;n||(t.width="".concat((100*parseFloat(i)/a).toFixed(2),"%")),At(xa,this)||s||(t.height="".concat((100*parseFloat(e)/r).toFixed(2),"%"))}getInitialTranslation(){return[0,0]}altTextFinish(){var t;null===(t=At(Aa,this))||void 0===t||t.finish()}async addEditToolbar(){return At(Sa,this)||At(Pa,this)||(Et(Sa,this,new mn(this)),this.div.append(At(Sa,this).render()),At(Aa,this)&&At(Sa,this).addAltTextButton(await At(Aa,this).render())),At(Sa,this)}removeEditToolbar(){var t;At(Sa,this)&&(At(Sa,this).remove(),Et(Sa,this,null),null===(t=At(Aa,this))||void 0===t||t.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){At(Aa,this)||(va.initialize(ja._l10nPromise),Et(Aa,this,new va(this)),At(wa,this)&&(At(Aa,this).data=At(wa,this),Et(wa,this,null)),await this.addEditToolbar())}get altTextData(){var t;return null===(t=At(Aa,this))||void 0===t?void 0:t.data}set altTextData(t){At(Aa,this)&&(At(Aa,this).data=t)}hasAltText(){var t;return!(null!==(t=At(Aa,this))&&void 0!==t&&t.isEmpty())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=At(Ea,this)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",At(Ca,this),{signal:t}),this.div.addEventListener("focusout",At(Ma,this),{signal:t});const[e,i]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth="".concat((100*i/e).toFixed(2),"%"),this.div.style.maxHeight="".concat((100*e/i).toFixed(2),"%"));const[n,s]=this.getInitialTranslation();return this.translate(n,s),Rn(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=$e.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(Et(Ta,this,!0),this._isDraggable?vt(Ha,this,Za).call(this,t):vt(Ha,this,Qa).call(this,t))}moveInDOM(){At(Na,this)&&clearTimeout(At(Na,this)),Et(Na,this,setTimeout(()=>{var t;Et(Na,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()}getRect(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.rotation;const n=this.parentScale,[s,a]=this.pageDimensions,[r,o]=this.pageTranslation,l=t/n,c=e/n,h=this.x*s,d=this.y*a,u=this.width*s,p=this.height*a;switch(i){case 0:return[h+l+r,a-d-c-p+o,h+l+u+r,a-d-c+o];case 90:return[h+c+r,a-d+l+o,h+c+p+r,a-d+l+u+o];case 180:return[h-l-u+r,a-d+c+o,h-l+r,a-d+c+p+o];case 270:return[h-c-p+r,a-d-l-u+o,h-c+r,a-d-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,s,a]=t,r=s-i,o=a-n;switch(this.rotation){case 0:return[i,e-a,r,o];case 90:return[i,e-n,o,r];case 180:return[s,e-n,r,o];case 270:return[s,e-a,o,r];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){Et(Pa,this,!0)}disableEditMode(){Et(Pa,this,!1)}isInEditMode(){return At(Pa,this)}shouldGetKeyboardEvents(){return At(Ia,this)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t,e;const i=this._uiManager._signal;null===(t=this.div)||void 0===t||t.addEventListener("focusin",At(Ca,this),{signal:i}),null===(e=this.div)||void 0===e||e.addEventListener("focusout",At(Ma,this),{signal:i})}rotate(t){}serialize(){We("An editor must be serializable")}static deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});n.rotation=t.rotation,Et(wa,n,t.accessibilityData);const[s,a]=n.pageDimensions,[r,o,l,c]=n.getRectInCurrentCoords(t.rect,a);return n.x=r/s,n.y=o/a,n.width=l/s,n.height=c/a,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.div.removeEventListener("focusin",At(Ca,this)),this.div.removeEventListener("focusout",At(Ma,this)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),At(Na,this)&&(clearTimeout(At(Na,this)),Et(Na,this,null)),vt(Ha,this,ir).call(this),this.removeEditToolbar(),At(Wa,this)){for(const t of At(Wa,this).values())clearTimeout(t);Et(Wa,this,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(vt(Ha,this,qa).call(this),At(_a,this).classList.remove("hidden"),Rn(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),Et(ka,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=At(_a,this).children;if(!At(ya,this)){Et(ya,this,Array.from(e));const t=vt(Ha,this,Ja).bind(this),i=vt(Ha,this,$a).bind(this),n=this._uiManager._signal;for(const e of At(ya,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(Ha,this,tr).bind(this,s),{signal:n}),ja._l10nPromise.get("pdfjs-editor-resizer-label-".concat(s)).then(t=>e.setAttribute("aria-label",t))}}const i=At(ya,this)[0];let n=0;for(const a of e){if(a===i)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*(At(ya,this).length/4);if(s!==n){if(s<n)for(let e=0;e<n-s;e++)At(_a,this).append(At(_a,this).firstChild);else if(s>n)for(let e=0;e<s-n;e++)At(_a,this).firstChild.before(At(_a,this).lastChild);let t=0;for(const i of e){const e=At(ya,this)[t++].getAttribute("data-resizer-name");ja._l10nPromise.get("pdfjs-editor-resizer-label-".concat(e)).then(t=>i.setAttribute("aria-label",t))}}vt(Ha,this,er).call(this,0),Et(Ia,this,!0),At(_a,this).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){At(Ia,this)&&vt(Ha,this,Ka).call(this,At(La,this),{movementX:t,movementY:e})}_stopResizingWithKeyboard(){vt(Ha,this,ir).call(this),this.div.focus()}select(){var t,e;this.makeResizable(),null===(t=this.div)||void 0===t||t.classList.add("selectedEditor"),At(Sa,this)?null===(e=At(Sa,this))||void 0===e||e.show():this.addEditToolbar().then(()=>{var t,e;null!==(t=this.div)&&void 0!==t&&t.classList.contains("selectedEditor")&&(null===(e=At(Sa,this))||void 0===e||e.show())})}unselect(){var t,e,i,n;null===(t=At(_a,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=At(Sa,this))||void 0===n||n.hide()}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return At(Fa,this)}set isEditing(t){Et(Fa,this,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){Et(xa,this,!0);const i=t/e,{style:n}=this.div;n.aspectRatio=i,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){At(Wa,this)||Et(Wa,this,new Map);const{action:e}=t;let i=At(Wa,this).get(e);return i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),At(Wa,this).delete(e),0===At(Wa,this).size&&Et(Wa,this,null)},ja._telemetryTimeout),void At(Wa,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),Et(Ea,this,!1)}disable(){this.div&&(this.div.tabIndex=-1),Et(Ea,this,!0)}renderAnnotationElement(t){let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.before(e)}}else e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){const{firstChild:e}=t.container;"DIV"===e.nodeName&&e.classList.contains("annotationContent")&&e.remove()}}function Va(t,e,i){let[n,s]=t;[e,i]=this.screenToPageTranslation(e,i),this.x+=e/n,this.y+=i/s,this.fixAndSetPosition()}function Ua(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 Ga(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 qa(){if(At(_a,this))return;Et(_a,this,document.createElement("div")),At(_a,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");At(_a,this).append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",vt(Ha,this,Xa).bind(this,i),{signal:e}),t.addEventListener("contextmenu",en,{signal:e}),t.tabIndex=-1}this.div.prepend(At(_a,this))}function Xa(t,e){var i;e.preventDefault();const{isMac:n}=$e.platform;if(0!==e.button||e.ctrlKey&&n)return;null===(i=At(Aa,this))||void 0===i||i.toggle(!1);const s=vt(Ha,this,Ka).bind(this,t),a=this._isDraggable;this._isDraggable=!1;const r=this._uiManager._signal,o={passive:!0,capture:!0,signal:r};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",s,o),window.addEventListener("contextmenu",en,{signal:r});const l=this.x,c=this.y,h=this.width,d=this.height,u=this.parent.div.style.cursor,p=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const f=()=>{var t;this.parent.togglePointerEvents(!0),null===(t=At(Aa,this))||void 0===t||t.toggle(!0),this._isDraggable=a,window.removeEventListener("pointerup",f),window.removeEventListener("blur",f),window.removeEventListener("pointermove",s,o),window.removeEventListener("contextmenu",en),this.parent.div.style.cursor=u,this.div.style.cursor=p,vt(Ha,this,Ya).call(this,l,c,h,d)};window.addEventListener("pointerup",f,{signal:r}),window.addEventListener("blur",f,{signal:r})}function Ya(t,e,i,n){const s=this.x,a=this.y,r=this.width,o=this.height;s===t&&a===e&&r===i&&o===n||this.addCommands({cmd:()=>{this.width=r,this.height=o,this.x=s,this.y=a;const[t,e]=this.parentDimensions;this.setDims(t*r,e*o),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=n,this.x=t,this.y=e;const[s,a]=this.parentDimensions;this.setDims(s*i,a*n),this.fixAndSetPosition()},mustExec:!0})}function Ka(t,e){const[i,n]=this.parentDimensions,s=this.x,a=this.y,r=this.width,o=this.height,l=St.MIN_SIZE/i,c=St.MIN_SIZE/n,h=t=>Math.round(1e4*t)/1e4,d=vt(Ha,this,Ga).call(this,this.rotation),u=(t,e)=>[d[0]*t+d[2]*e,d[1]*t+d[3]*e],p=vt(Ha,this,Ga).call(this,360-this.rotation);let f,g,m=!1,v=!1;switch(t){case"topLeft":m=!0,f=(t,e)=>[0,0],g=(t,e)=>[t,e];break;case"topMiddle":f=(t,e)=>[t/2,0],g=(t,e)=>[t/2,e];break;case"topRight":m=!0,f=(t,e)=>[t,0],g=(t,e)=>[0,e];break;case"middleRight":v=!0,f=(t,e)=>[t,e/2],g=(t,e)=>[0,e/2];break;case"bottomRight":m=!0,f=(t,e)=>[t,e],g=(t,e)=>[0,0];break;case"bottomMiddle":f=(t,e)=>[t/2,e],g=(t,e)=>[t/2,0];break;case"bottomLeft":m=!0,f=(t,e)=>[0,e],g=(t,e)=>[t,0];break;case"middleLeft":v=!0,f=(t,e)=>[0,e/2],g=(t,e)=>[t,e/2]}const b=f(r,o),w=g(r,o);let y=u(...w);const A=h(s+y[0]),E=h(a+y[1]);let x=1,_=1,[k,C]=this.screenToPageTranslation(e.movementX,e.movementY);var M,S;if([k,C]=(M=k/i,S=C/n,[p[0]*M+p[2]*S,p[1]*M+p[3]*S]),m){const t=Math.hypot(r,o);x=_=Math.max(Math.min(Math.hypot(w[0]-b[0]-k,w[1]-b[1]-C)/t,1/r,1/o),l/r,c/o)}else v?x=Math.max(l,Math.min(1,Math.abs(w[0]-b[0]-k)))/r:_=Math.max(c,Math.min(1,Math.abs(w[1]-b[1]-C)))/o;const L=h(r*x),T=h(o*_);y=u(...g(L,T));const R=A-y[0],F=E-y[1];this.width=L,this.height=T,this.x=R,this.y=F,this.setDims(i*L,n*T),this.fixAndSetPosition()}function Qa(t){const{isMac:e}=$e.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}function Za(t){const e=this._uiManager.isSelected(this);let i,n;this._uiManager.setUpDragSession();const s=this._uiManager._signal;e&&(this.div.classList.add("moving"),i={passive:!0,capture:!0,signal:s},Et(Da,this,t.clientX),Et(Oa,this,t.clientY),n=t=>{const{clientX:e,clientY:i}=t,[n,s]=this.screenToPageTranslation(e-At(Da,this),i-At(Oa,this));Et(Da,this,e),Et(Oa,this,i),this._uiManager.dragSelectedEditors(n,s)},window.addEventListener("pointermove",n,i));const a=()=>{window.removeEventListener("pointerup",a),window.removeEventListener("blur",a),e&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",n,i)),Et(Ta,this,!1),this._uiManager.endDragSession()||vt(Ha,this,Qa).call(this,t)};window.addEventListener("pointerup",a,{signal:s}),window.addEventListener("blur",a,{signal:s})}function Ja(t){St._resizerKeyboardManager.exec(this,t)}function $a(t){var e;At(Ia,this)&&(null===(e=t.relatedTarget)||void 0===e?void 0:e.parentNode)!==At(_a,this)&&vt(Ha,this,ir).call(this)}function tr(t){Et(La,this,At(Ia,this)?t:"")}function er(t){if(At(ya,this))for(const e of At(ya,this))e.tabIndex=t}function ir(){if(Et(Ia,this,!1),vt(Ha,this,er).call(this,-1),At(ka,this)){const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=At(ka,this);vt(Ha,this,Ya).call(this,t,e,i,n),Et(ka,this,null)}}St=ja,(0,wt.A)(ja,"_borderLineWidth",-1),(0,wt.A)(ja,"_colorManager",new Yn),(0,wt.A)(ja,"_zIndex",1),(0,wt.A)(ja,"_telemetryTimeout",1e3);class nr extends ja{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const sr=3285377520,ar=4294901760,rr=65535;class or{constructor(t){this.h1=t?4294967295&t:sr,this.h2=t?4294967295&t:sr}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,a=new Uint32Array(e.buffer,0,n);let r=0,o=0,l=this.h1,c=this.h2;const h=3432918353,d=461845907,u=11601,p=13715;for(let f=0;f<n;f++)1&f?(r=a[f],r=r*h&ar|r*u&rr,r=r<<15|r>>>17,r=r*d&ar|r*p&rr,l^=r,l=l<<13|l>>>19,l=5*l+3864292196):(o=a[f],o=o*h&ar|o*u&rr,o=o<<15|o>>>17,o=o*d&ar|o*p&rr,c^=o,c=c<<13|c>>>19,c=5*c+3864292196);switch(r=0,s){case 3:r^=e[4*n+2]<<16;case 2:r^=e[4*n+1]<<8;case 1:r^=e[4*n],r=r*h&ar|r*u&rr,r=r<<15|r>>>17,r=r*d&ar|r*p&rr,1&n?l^=r:c^=r}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&ar|36045*t&rr,e=4283543511*e&ar|(2950163797*(e<<16|t>>>16)&ar)>>>16,t^=e>>>1,t=444984403*t&ar|60499*t&rr,e=3301882366*e&ar|(3120437893*(e<<16|t>>>16)&ar)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const lr=Object.freeze({map:null,hash:"",transfer:void 0});var cr=new WeakMap,hr=new WeakMap,dr=new WeakSet;class ur{constructor(){mt(this,dr),yt(this,cr,!1),yt(this,hr,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=At(hr,this).get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return At(hr,this).get(t)}remove(t){if(At(hr,this).delete(t),0===At(hr,this).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const t of At(hr,this).values())if(t instanceof ja)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=At(hr,this).get(t);let n=!1;if(void 0!==i)for(const[s,a]of Object.entries(e))i[s]!==a&&(n=!0,i[s]=a);else n=!0,At(hr,this).set(t,e);n&&vt(dr,this,pr).call(this),e instanceof ja&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return At(hr,this).has(t)}getAll(){return At(hr,this).size>0?Je(At(hr,this)):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return At(hr,this).size}resetModified(){At(cr,this)&&(Et(cr,this,!1),"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new gr(this)}get serializable(){if(0===At(hr,this).size)return lr;const t=new Map,e=new or,i=[],n=Object.create(null);let s=!1;for(const[a,r]of At(hr,this)){const i=r instanceof ja?r.serialize(!1,n):r;i&&(t.set(a,i),e.update("".concat(a,":").concat(JSON.stringify(i))),s||(s=!!i.bitmap))}if(s)for(const a of t.values())a.bitmap&&i.push(a.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:lr}get editorStats(){let t=null;const e=new Map;for(const s of At(hr,this).values()){var i;if(!(s instanceof ja))continue;const a=s.telemetryFinalData;if(!a)continue;const{type:r}=a;e.has(r)||e.set(r,Object.getPrototypeOf(s).constructor),t||(t=Object.create(null));const o=(i=t)[r]||(i[r]=new Map);for(const[t,e]of Object.entries(a)){var n;if("type"===t)continue;let i=o.get(t);i||(i=new Map,o.set(t,i));const s=null!==(n=i.get(e))&&void 0!==n?n:0;i.set(e,s+1)}}for(const[s,a]of e)t[s]=a.computeTelemetryFinalData(t[s]);return t}}function pr(){At(cr,this)||(Et(cr,this,!0),"function"===typeof this.onSetModified&&this.onSetModified())}var fr=new WeakMap;class gr extends ur{constructor(t){super(),yt(this,fr,void 0);const{map:e,hash:i,transfer:n}=t.serializable,s=structuredClone(e,n?{transfer:n}:null);Et(fr,this,{map:s,hash:i,transfer:n})}get print(){We("Should not call PrintAnnotationStorage.print")}get serializable(){return At(fr,this)}}var mr=new WeakMap;class vr{constructor(t){let{ownerDocument:e=globalThis.document,styleElement:i=null}=t;yt(this,mr,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(),At(mr,this).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){let{systemFontInfo:e,_inspectFont:i}=t;if(e&&!At(mr,this).has(e.loadedName)){if(ze(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:s,style:a}=e,r=new FontFace(t,s,a);this.addNativeFontFace(r);try{await r.load(),At(mr,this).add(t),null===i||void 0===i||i(e)}catch(n){Oe("Cannot load system font: ".concat(e.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(r)}return}We("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 Oe("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 He(this,"isFontLoadingAPISupported",!(null===(t=this._document)||void 0===t||!t.fonts))}get isSyncFontLoadingSupported(){var t;let e=!1;return(Wt||"undefined"!==typeof navigator&&"string"===typeof(null===(t=navigator)||void 0===t?void 0:t.userAgent)&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),He(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(ze(!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 He(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,a;const r=this._document.createElement("canvas");r.width=1,r.height=1;const o=r.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,a=c.length-3;s<a;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 f="url(data:font/opentype;base64,".concat(btoa(h),");"),g='@font-face {font-family:"'.concat(c,'";src:').concat(f,"}");this.insertRule(g);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 Oe("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()})}}class br{constructor(t,e){let{disableFontFace:i=!1,inspectFont:n=null}=e;this.compiledGlyphs=Object.create(null);for(const s in t)this[s]=t[s];this.disableFontFace=!0===i,this._inspectFont=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=Qe(this.data),i="url(data:".concat(this.mimetype,";base64,").concat(btoa(e),");");let n;if(this.cssFontInfo){let t="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(t+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),n='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(t,"src:").concat(i,"}")}else n='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(i,"}");return null===(t=this._inspectFont)||void 0===t||t.call(this,this,i),n}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(s){Oe('getPathGenerator - ignoring character: "'.concat(s,'".'))}if(!Array.isArray(i)||0===i.length)return this.compiledGlyphs[e]=function(t,e){};const n=[];for(let a=0,r=i.length;a<r;)switch(i[a++]){case li:{const[t,e,s,r,o,l]=i.slice(a,a+6);n.push(i=>i.bezierCurveTo(t,e,s,r,o,l)),a+=6}break;case ci:{const[t,e]=i.slice(a,a+2);n.push(i=>i.moveTo(t,e)),a+=2}break;case hi:{const[t,e]=i.slice(a,a+2);n.push(i=>i.lineTo(t,e)),a+=2}break;case di:{const[t,e,s,r]=i.slice(a,a+4);n.push(i=>i.quadraticCurveTo(t,e,s,r)),a+=4}break;case ui:n.push(t=>t.restore());break;case pi:n.push(t=>t.save());break;case fi:ze(2===n.length,"Scale command is only valid at the third position.");break;case gi:{const[t,e,s,r,o,l]=i.slice(a,a+6);n.push(i=>i.transform(t,e,s,r,o,l)),a+=6}break;case mi:{const[t,e]=i.slice(a,a+2);n.push(i=>i.translate(t,e)),a+=2}}return this.compiledGlyphs[e]=function(t,e){n[0](t),n[1](t),t.scale(e,-e);for(let i=2,s=n.length;i<s;i++)n[i](t)}}}if(Wt){var wr=Promise.withResolvers(),yr=null;(async()=>{const t=await i.e(673).then(i.t.bind(i,21673,19)),e=await i.e(688).then(i.t.bind(i,42688,19)),n=await i.e(123).then(i.t.bind(i,40504,19)),s=await i.e(395).then(i.t.bind(i,79395,19));return new Map(Object.entries({fs:t,http:e,https:n,url:s,canvas:undefined,path2d:undefined}))})().then(t=>{yr=t,wr.resolve()},t=>{Oe("loadPackages: ".concat(t)),yr=new Map,wr.resolve()})}class Ar{static get promise(){return wr.promise}static get(t){var e;return null===(e=yr)||void 0===e?void 0:e.get(t)}}const Er=function(t){return Ar.get("fs").promises.readFile(t).then(t=>new Uint8Array(t))};const xr="Fill",_r="Stroke",kr="Shading";function Cr(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 Mr{constructor(){this.constructor===Mr&&We("Cannot initialize BaseShadingPattern.")}getPattern(){We("Abstract method `getPattern` called.")}}class Sr extends Mr{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===_r||n===xr){const a=e.current.getClippedPathBoundingBox(n,ln(t))||[0,0,0,0],r=Math.ceil(a[2]-a[0])||1,o=Math.ceil(a[3]-a[1])||1,l=e.cachedCanvases.getCanvas("pattern",r,o,!0),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(-a[0],-a[1]),i=ei.transform(i,[1,0,0,1,a[0],a[1]]),c.transform(...e.baseTransform),this.matrix&&c.transform(...this.matrix),Cr(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 Cr(t,this._bbox),s=this._createGradient(t);return s}}function Lr(t,e,i,n,s,a,r,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=a,a=r,r=u),l[n+1]>l[s+1]&&(u=n,n=s,s=u,u=r,r=o,o=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=a,a=r,r=u);const p=(l[i]+e.offsetX)*e.scaleX,f=(l[i+1]+e.offsetY)*e.scaleY,g=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,v=(l[s]+e.offsetX)*e.scaleX,b=(l[s+1]+e.offsetY)*e.scaleY;if(f>=b)return;const w=c[a],y=c[a+1],A=c[a+2],E=c[r],x=c[r+1],_=c[r+2],k=c[o],C=c[o+1],M=c[o+2],S=Math.round(f),L=Math.round(b);let T,R,F,P,I,N,D,O;for(let W=S;W<=L;W++){if(W<m){const t=W<f?0:(f-W)/(f-m);T=p-(p-g)*t,R=w-(w-E)*t,F=y-(y-x)*t,P=A-(A-_)*t}else{let t;t=W>b?1:m===b?0:(m-W)/(m-b),T=g-(g-v)*t,R=E-(E-k)*t,F=x-(x-C)*t,P=_-(_-M)*t}let t;t=W<f?0:W>b?1:(f-W)/(f-b),I=p-(p-v)*t,N=w-(w-k)*t,D=y-(y-C)*t,O=A-(A-M)*t;const e=Math.round(Math.min(T,I)),i=Math.round(Math.max(T,I));let n=d*W+4*e;for(let s=e;s<=i;s++)t=(T-s)/(T-I),t<0?t=0:t>1&&(t=1),h[n++]=R-(R-N)*t|0,h[n++]=F-(F-D)*t|0,h[n++]=P-(P-O)*t|0,h[n++]=255}}function Tr(t,e,i){const n=e.coords,s=e.colors;let a,r;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,c=o-1;for(a=0;a<l;a++){let e=a*o;for(let a=0;a<c;a++,e++)Lr(t,i,n[e],n[e+1],n[e+o],s[e],s[e+1],s[e+o]),Lr(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(a=0,r=n.length;a<r;a+=3)Lr(t,i,n[a],n[a+1],n[a+2],s[a],s[a+1],s[a+2]);break;default:throw new Error("illegal figure")}}class Rr extends Mr{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,i){const n=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-n,r=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(a*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(r*t[1]*1.1)),3e3),c=a/o,h=r/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-s,scaleX:1/c,scaleY:1/h},u=o+4,p=l+4,f=i.getCanvas("mesh",u,p,!1),g=f.context,m=g.createImageData(o,l);if(e){const t=m.data;for(let i=0,n=t.length;i<n;i+=4)t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=255}for(const v of this._figures)Tr(m,v,d);g.putImageData(m,2,2);return{canvas:f.canvas,offsetX:n-2*c,offsetY:s-2*h,scaleX:c,scaleY:h}}getPattern(t,e,i,n){let s;if(Cr(t,this._bbox),n===kr)s=ei.singularValueDecompose2dScale(ln(t));else if(s=ei.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=ei.singularValueDecompose2dScale(this.matrix);s=[s[0]*t[0],s[1]*t[1]]}const a=this._createMeshCanvas(s,n===kr?null:this._background,e.cachedCanvases);return n!==kr&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(a.offsetX,a.offsetY),t.scale(a.scaleX,a.scaleY),t.createPattern(a.canvas,"no-repeat")}}class Fr extends Mr{getPattern(){return"hotpink"}}const Pr=1,Ir=2;class Nr{constructor(t,e,i,n,s){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=i,this.canvasGraphicsFactory=n,this.baseTransform=s}createPatternCanvas(t){const e=this.operatorList,i=this.bbox,n=this.xstep,s=this.ystep,a=this.paintType,r=this.tilingType,o=this.color,l=this.canvasGraphicsFactory;De("TilingType: "+r);const c=i[0],h=i[1],d=i[2],u=i[3],p=ei.singularValueDecompose2dScale(this.matrix),f=ei.singularValueDecompose2dScale(this.baseTransform),g=[p[0]*f[0],p[1]*f[1]],m=this.getSizeAndScale(n,this.ctx.canvas.width,g[0]),v=this.getSizeAndScale(s,this.ctx.canvas.height,g[1]),b=t.cachedCanvases.getCanvas("pattern",m.size,v.size,!0),w=b.context,y=l.createCanvasGraphics(w);y.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(y,a,o);let A=c,E=h,x=d,_=u;return c<0&&(A=0,x+=Math.abs(c)),h<0&&(E=0,_+=Math.abs(h)),w.translate(-m.scale*A,-v.scale*E),y.transform(m.scale,0,0,v.scale,0,0),w.save(),this.clipBbox(y,A,E,x,_),y.baseTransform=ln(y.ctx),y.executeOperatorList(e),y.endDrawing(),{canvas:b.canvas,scaleX:m.scale,scaleY:v.scale,offsetX:A,offsetY:E}}getSizeAndScale(t,e,i){t=Math.abs(t);const n=Math.max(Nr.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 a=n-e,r=s-i;t.ctx.rect(e,i,a,r),t.current.updateRectMinMax(ln(t.ctx),[e,i,n,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case Pr:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case Ir:const a=ei.makeHexColor(i[0],i[1],i[2]);n.fillStyle=a,n.strokeStyle=a,s.fillColor=a,s.strokeColor=a;break;default:throw new Ye("Unsupported paint type: ".concat(e))}}getPattern(t,e,i,n){let s=i;n!==kr&&(s=ei.transform(s,e.baseTransform),this.matrix&&(s=ei.transform(s,this.matrix)));const a=this.createPatternCanvas(e);let r=new DOMMatrix(s);r=r.translate(a.offsetX,a.offsetY),r=r.scale(1/a.scaleX,1/a.scaleY);const o=t.createPattern(a.canvas,"repeat");return o.setTransform(r),o}}function Dr(t){let{src:e,srcPos:i=0,dest:n,width:s,height:a,nonBlackColor:r=4294967295,inverseDecode:o=!1}=t;const l=$e.isLittleEndian?4278190080:255,[c,h]=o?[r,l]:[l,r],d=s>>3,u=7&s,p=e.length;n=new Uint32Array(n.buffer);let f=0;for(let g=0;g<a;g++){for(const s=i+d;i<s;i++){const t=i<p?e[i]:255;n[f++]=128&t?h:c,n[f++]=64&t?h:c,n[f++]=32&t?h:c,n[f++]=16&t?h:c,n[f++]=8&t?h:c,n[f++]=4&t?h:c,n[f++]=2&t?h:c,n[f++]=1&t?h:c}if(0===u)continue;const t=i<p?e[i++]:255;for(let e=0;e<u;e++)n[f++]=t&1<<7-e?h:c}return{srcPos:i,destPos:f}}(0,wt.A)(Nr,"MAX_PATTERN_SIZE",3e3);const Or=16;class Wr{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 zr(t,e,i,n,s,a,r,o,l,c){const[h,d,u,p,f,g]=ln(t);if(0===d&&0===u){const m=r*h+f,v=Math.round(m),b=o*p+g,w=Math.round(b),y=(r+l)*h+f,A=Math.abs(Math.round(y)-v)||1,E=(o+c)*p+g,x=Math.abs(Math.round(E)-w)||1;return t.setTransform(Math.sign(h),0,0,Math.sign(p),v,w),t.drawImage(e,i,n,s,a,0,0,A,x),t.setTransform(h,d,u,p,f,g),[A,x]}if(0===h&&0===p){const m=o*u+f,v=Math.round(m),b=r*d+g,w=Math.round(b),y=(o+c)*u+f,A=Math.abs(Math.round(y)-v)||1,E=(r+l)*d+g,x=Math.abs(Math.round(E)-w)||1;return t.setTransform(0,Math.sign(d),Math.sign(u),0,v,w),t.drawImage(e,i,n,s,a,0,0,x,A),t.setTransform(h,d,u,p,f,g),[x,A]}t.drawImage(e,i,n,s,a,r,o,l,c);return[Math.hypot(h,d)*l,Math.hypot(u,p)*c]}class Br{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=zt,this.textMatrixScale=1,this.fontMatrix=Bt,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=$t,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,i){[e,i]=ei.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){const i=ei.applyTransform(e,t),n=ei.applyTransform(e.slice(2),t),s=ei.applyTransform([e[0],e[3]],t),a=ei.applyTransform([e[2],e[1]],t);this.minX=Math.min(this.minX,i[0],n[0],s[0],a[0]),this.minY=Math.min(this.minY,i[1],n[1],s[1],a[1]),this.maxX=Math.max(this.maxX,i[0],n[0],s[0],a[0]),this.maxY=Math.max(this.maxY,i[1],n[1],s[1],a[1])}updateScalingPathMinMax(t,e){ei.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.minY=Math.min(this.minY,e[1]),this.maxX=Math.max(this.maxX,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,i,n,s,a,r,o,l,c){const h=ei.bezierBoundingBox(e,i,n,s,a,r,o,l,c);c||this.updateRectMinMax(t,h)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xr,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===_r){e||We("Stroke bounding box must include transform.");const t=ei.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,s=t[1]*this.lineWidth/2;i[0]-=n,i[1]-=s,i[2]+=n,i[3]+=s}return i}updateClipFromPath(){const t=ei.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xr,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return ei.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function Hr(t,e){if("undefined"!==typeof ImageData&&e instanceof ImageData)return void t.putImageData(e,0,0);const i=e.height,n=e.width,s=i%Or,a=(i-s)/Or,r=0===s?a:a+1,o=t.createImageData(n,Or);let l,c=0;const h=e.data,d=o.data;let u,p,f,g;if(e.kind===ae.GRAYSCALE_1BPP){const e=h.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),g=i.length,m=n+7>>3,v=4294967295,b=$e.isLittleEndian?4278190080:255;for(u=0;u<r;u++){for(f=u<a?Or:s,l=0,p=0;p<f;p++){const t=e-c;let s=0;const a=t>m?n:8*t-7,r=-8&a;let o=0,d=0;for(;s<r;s+=8)d=h[c++],i[l++]=128&d?v:b,i[l++]=64&d?v:b,i[l++]=32&d?v:b,i[l++]=16&d?v:b,i[l++]=8&d?v:b,i[l++]=4&d?v:b,i[l++]=2&d?v:b,i[l++]=1&d?v:b;for(;s<a;s++)0===o&&(d=h[c++],o=128),i[l++]=d&o?v:b,o>>=1}for(;l<g;)i[l++]=0;t.putImageData(o,0,u*Or)}}else if(e.kind===ae.RGBA_32BPP){for(p=0,g=n*Or*4,u=0;u<a;u++)d.set(h.subarray(c,c+g)),c+=g,t.putImageData(o,0,p),p+=Or;u<r&&(g=n*s*4,d.set(h.subarray(c,c+g)),t.putImageData(o,0,p))}else{if(e.kind!==ae.RGB_24BPP)throw new Error("bad image kind: ".concat(e.kind));for(f=Or,g=n*f,u=0;u<r;u++){for(u>=a&&(f=s,g=n*f),l=0,p=g;p--;)d[l++]=h[c++],d[l++]=h[c++],d[l++]=h[c++],d[l++]=255;t.putImageData(o,0,u*Or)}}}function jr(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%Or,a=(i-s)/Or,r=0===s?a:a+1,o=t.createImageData(n,Or);let l=0;const c=e.data,h=o.data;for(let d=0;d<r;d++){const e=d<a?Or:s;({srcPos:l}=Dr({src:c,srcPos:l,dest:h,width:n,height:e,nonBlackColor:0})),t.putImageData(o,0,d*Or)}}function Vr(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 Ur(t){if(t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0),!Wt){const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function Gr(t,e){if(e)return!0;const i=ei.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*_i.PDF_TO_CSS_UNITS);return i[0]<=n&&i[1]<=n}const qr=["butt","round","square"],Xr=["miter","round","bevel"],Yr={},Kr={};var Qr=new WeakSet;class Zr{constructor(t,e,i,n,s,a,r,o){let{optionalContentConfig:l,markedContentStack:c=null}=a;mt(this,Qr),this.ctx=t,this.current=new Br(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.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=c||[],this.optionalContentConfig=l,this.cachedCanvases=new Wr(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=r,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=o,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing(t){let{transform:e,viewport:i,transparency:n=!1,background:s=null}=t;const a=this.ctx.canvas.width,r=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,a,r),this.ctx.fillStyle=o,n){const t=this.cachedCanvases.getCanvas("transparent",a,r);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...ln(this.compositeCtx))}this.ctx.save(),Ur(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=ln(this.ctx)}executeOperatorList(t,e,i,n){const s=t.argsArray,a=t.fnArray;let r=e||0;const o=s.length;if(o===r)return r;const l=o-r>10&&"function"===typeof i,c=l?Date.now()+15:0;let h=0;const d=this.commonObjs,u=this.objs;let p;for(;;){if(void 0!==n&&r===n.nextBreakPoint)return n.breakIt(r,i),r;if(p=a[r],p!==Re.dependency)this[p].apply(this,s[r]);else for(const t of s[r]){const e=t.startsWith("g_")?d:u;if(!e.has(t))return e.get(t,i),r}if(r++,r===o)return r;if(l&&++h>10){if(Date.now()>c)return i(),r;h=0}}}endDrawing(){vt(Qr,this,Jr).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(Qr,this,$r).call(this)}_scaleImage(t,e){const i=t.width,n=t.height;let s,a,r=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=i,c=n,h="prescale1";for(;r>2&&l>1||o>2&&c>1;){let e=l,i=c;r>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),r/=l/e),o>2&&c>1&&(i=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/i),s=this.cachedCanvases.getCanvas(h,e,i),a=s.context,a.clearRect(0,0,e,i),a.drawImage(t,0,0,l,c,0,0,e,i),t=s.canvas,l=e,c=i,h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,s=this.current.fillColor,a=this.current.patternFill,r=ln(e);let o,l,c,h;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;l=JSON.stringify(a?r:[r.slice(0,4),s]),o=this._cachedBitmapsMap.get(e),o||(o=new Map,this._cachedBitmapsMap.set(e,o));const i=o.get(l);if(i&&!a){return{canvas:i,offsetX:Math.round(Math.min(r[0],r[2])+r[4]),offsetY:Math.round(Math.min(r[1],r[3])+r[5])}}c=i}c||(h=this.cachedCanvases.getCanvas("maskCanvas",i,n),jr(h.context,t));let d=ei.transform(r,[1/i,0,0,-1/n,0,0]);d=ei.transform(d,[1,0,0,1,0,-n]);const[u,p,f,g]=ei.getAxialAlignedBoundingBox([0,0,i,n],d),m=Math.round(f-u)||1,v=Math.round(g-p)||1,b=this.cachedCanvases.getCanvas("fillCanvas",m,v),w=b.context,y=u,A=p;w.translate(-y,-A),w.transform(...d),c||(c=this._scaleImage(h.canvas,cn(w)),c=c.img,o&&a&&o.set(l,c)),w.imageSmoothingEnabled=Gr(ln(w),t.interpolate),zr(w,c,0,0,c.width,c.height,0,0,i,n),w.globalCompositeOperation="source-in";const E=ei.transform(cn(w),[1,0,0,1,-y,-A]);return w.fillStyle=a?s.getPattern(e,this,E,xr):s,w.fillRect(0,0,i,n),o&&!a&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,b.canvas)),{canvas:b.canvas,offsetX:Math.round(y),offsetY:Math.round(A)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=qr[t]}setLineJoin(t){this.ctx.lineJoin=Xr[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx,this.ctx=n.context;const s=this.ctx;s.setTransform(...ln(this.suspendedCtx)),Vr(this.suspendedCtx,s),function(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,n,s,a,r){e.transform(t,i,n,s,a,r),this.__originalTransform(t,i,n,s,a,r)},t.setTransform=function(t,i,n,s,a,r){e.setTransform(t,i,n,s,a,r),this.__originalSetTransform(t,i,n,s,a,r)},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,a,r){e.bezierCurveTo(t,i,n,s,a,r),this.__originalBezierCurveTo(t,i,n,s,a,r)},t.rect=function(t,i,n,s){e.rect(t,i,n,s),this.__originalRect(t,i,n,s)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Vr(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],a=n[1],r=n[2]-s,o=n[3]-a;0!==r&&0!==o&&(this.genericComposeSMask(e.context,i,r,o,e.subtype,e.backdrop,e.transferMap,s,a,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,a,r,o,l,c,h){let d=t.canvas,u=o-c,p=l-h;if(a)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),a.some(t=>0!==t)&&(e.globalCompositeOperation="destination-atop",e.fillStyle=ei.makeHexColor(...a),e.fillRect(0,0,i,n),e.globalCompositeOperation="source-over"),d=t.canvas,u=p=0}else if(a.some(t=>0!==t)){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const e=new Path2D;e.rect(u,p,i,n),t.clip(e),t.globalCompositeOperation="destination-atop",t.fillStyle=ei.makeHexColor(...a),t.fillRect(u,p,i,n),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),"Alpha"===s&&r?e.filter=this.filterFactory.addAlphaFilter(r):"Luminosity"===s&&(e.filter=this.filterFactory.addLuminosityFilter(r));const f=new Path2D;f.rect(o,l,i,n),e.clip(f),e.globalCompositeOperation="destination-in",e.drawImage(d,u,p,i,n,o,l,i,n),e.restore()}save(){this.inSMaskMode?(Vr(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),Vr(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,n,s,a){this.ctx.transform(t,e,i,n,s,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){const n=this.ctx,s=this.current;let a,r,o=s.x,l=s.y;const c=ln(n),h=0===c[0]&&0===c[3]||0===c[1]&&0===c[2],d=h?i.slice(0):null;for(let u=0,p=0,f=t.length;u<f;u++)switch(0|t[u]){case Re.rectangle:o=e[p++],l=e[p++];const t=e[p++],i=e[p++],u=o+t,f=l+i;n.moveTo(o,l),0===t||0===i?n.lineTo(u,f):(n.lineTo(u,l),n.lineTo(u,f),n.lineTo(o,f)),h||s.updateRectMinMax(c,[o,l,u,f]),n.closePath();break;case Re.moveTo:o=e[p++],l=e[p++],n.moveTo(o,l),h||s.updatePathMinMax(c,o,l);break;case Re.lineTo:o=e[p++],l=e[p++],n.lineTo(o,l),h||s.updatePathMinMax(c,o,l);break;case Re.curveTo:a=o,r=l,o=e[p+4],l=e[p+5],n.bezierCurveTo(e[p],e[p+1],e[p+2],e[p+3],o,l),s.updateCurvePathMinMax(c,a,r,e[p],e[p+1],e[p+2],e[p+3],o,l,d),p+=6;break;case Re.curveTo2:a=o,r=l,n.bezierCurveTo(o,l,e[p],e[p+1],e[p+2],e[p+3]),s.updateCurvePathMinMax(c,a,r,o,l,e[p],e[p+1],e[p+2],e[p+3],d),o=e[p+2],l=e[p+3],p+=4;break;case Re.curveTo3:a=o,r=l,o=e[p+2],l=e[p+3],n.bezierCurveTo(e[p],e[p+1],o,l,o,l),s.updateCurvePathMinMax(c,a,r,e[p],e[p+1],o,l,o,l,d),p+=4;break;case Re.closePath:n.closePath()}h&&s.updateScalingPathMinMax(c,d),s.setCurrentPoint(o,l)}closePath(){this.ctx.closePath()}stroke(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"===typeof i&&null!==i&&void 0!==i&&i.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,cn(e),_r),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,i=this.current.fillColor;let n=!1;this.current.patternFill&&(e.save(),e.fillStyle=i.getPattern(e,this,cn(e),xr),n=!0);const s=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==s&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),n&&e.restore(),t&&this.consumePath(s)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=Yr}eoClip(){this.pendingClip=Kr}beginText(){this.current.textMatrix=zt,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(const i of t)e.setTransform(...i.transform),e.translate(i.x,i.y),i.addToPath(e,i.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){var i;const n=this.commonObjs.get(t),s=this.current;if(!n)throw new Error("Can't find font for ".concat(t));if(s.fontMatrix=n.fontMatrix||Bt,0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||Oe("Invalid font matrix for font "+t),e<0?(e=-e,s.fontDirection=-1):s.fontDirection=1,this.current.font=n,this.current.fontSize=e,n.isType3Font)return;const a=n.loadedName||"sans-serif",r=(null===(i=n.systemFontInfo)||void 0===i?void 0:i.css)||'"'.concat(a,'", ').concat(n.fallbackName);let o="normal";n.black?o="900":n.bold&&(o="bold");const l=n.italic?"italic":"normal";let c=e;e<16?c=16:e>100&&(c=100),this.current.fontSizeScale=e/c,this.ctx.font="".concat(l," ").concat(o," ").concat(c,"px ").concat(r)}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,n,s,a){this.current.textMatrix=[t,e,i,n,s,a],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,n){const s=this.ctx,a=this.current,r=a.font,o=a.textRenderingMode,l=a.fontSize/a.fontSizeScale,c=o&ne,h=!!(o&se),d=a.patternFill&&!r.missingFile;let u;if((r.disableFontFace||h||d)&&(u=r.getPathGenerator(this.commonObjs,t)),r.disableFontFace||d?(s.save(),s.translate(e,i),s.beginPath(),u(s,l),n&&s.setTransform(...n),c!==$t&&c!==ee||s.fill(),c!==te&&c!==ee||s.stroke(),s.restore()):(c!==$t&&c!==ee||s.fillText(t,e,i),c!==te&&c!==ee||s.strokeText(t,e,i)),h){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:ln(s),x:e,y:i,fontSize:l,addToPath:u})}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let n=3;n<e.length;n+=4)if(e[n]>0&&e[n]<255){i=!0;break}return He(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const s=this.ctx,a=e.fontSizeScale,r=e.charSpacing,o=e.wordSpacing,l=e.fontDirection,c=e.textHScale*l,h=t.length,d=i.vertical,u=d?1:-1,p=i.defaultVMetrics,f=n*e.fontMatrix[0],g=e.textRenderingMode===$t&&!i.disableFontFace&&!e.patternFill;let m;if(s.save(),s.transform(...e.textMatrix),s.translate(e.x,e.y+e.textRise),l>0?s.scale(c,-1):s.scale(c,1),e.patternFill){s.save();const t=e.fillColor.getPattern(s,this,cn(s),xr);m=ln(s),s.restore(),s.fillStyle=t}let v=e.lineWidth;const b=e.textMatrixScale;if(0===b||0===v){const t=e.textRenderingMode&ne;t!==te&&t!==ee||(v=this.getSinglePixelWidth())}else v/=b;if(1!==a&&(s.scale(a,a),v/=a),s.lineWidth=v,i.isInvalidPDFjsFont){const i=[];let n=0;for(const e of t)i.push(e.unicode),n+=e.width;return s.fillText(i.join(""),0,0),e.x+=n*f*c,s.restore(),void this.compose()}let w,y=0;for(w=0;w<h;++w){const e=t[w];if("number"===typeof e){y+=u*e*n/1e3;continue}let c=!1;const h=(e.isSpace?o:0)+r,v=e.fontChar,b=e.accent;let A,E,x=e.width;if(d){const t=e.vmetric||p,i=-(e.vmetric?t[1]:.5*x)*f,n=t[2]*f;x=t?-t[0]:x,A=i/a,E=(y+n)/a}else A=y/a,E=0;if(i.remeasure&&x>0){const t=1e3*s.measureText(v).width/n*a;if(x<t&&this.isFontSubpixelAAEnabled){const e=x/t;c=!0,s.save(),s.scale(e,1),A/=e}else x!==t&&(A+=(x-t)/2e3*n/a)}if(this.contentVisible&&(e.isInFont||i.missingFile))if(g&&!b)s.fillText(v,A,E);else if(this.paintChar(v,A,E,m),b){const t=A+n*b.offset.x/a,e=E-n*b.offset.y/a;this.paintChar(b.fontChar,t,e,m)}y+=d?x*f-h*l:x*f+h*l,c&&s.restore()}d?e.y-=y:e.x+=y*c,s.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,n=i.font,s=i.fontSize,a=i.fontDirection,r=n.vertical?1:-1,o=i.charSpacing,l=i.wordSpacing,c=i.textHScale*a,h=i.fontMatrix||Bt,d=t.length;let u,p,f,g;if(!(i.textRenderingMode===ie)&&0!==s){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...i.textMatrix),e.translate(i.x,i.y),e.scale(c,a),u=0;u<d;++u){if(p=t[u],"number"===typeof p){g=r*p*s/1e3,this.ctx.translate(g,0),i.x+=g*c;continue}const a=(p.isSpace?l:0)+o,d=n.charProcOperatorList[p.operatorListId];if(!d){Oe('Type3 character "'.concat(p.operatorListId,'" is not available.'));continue}this.contentVisible&&(this.processingType3=p,this.save(),e.scale(s,s),e.transform(...h),this.executeOperatorList(d),this.restore());f=ei.applyTransform([p.width,0],h)[0]*s+a,e.translate(f,0),i.x+=f*c}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,n,s,a){this.ctx.rect(i,n,s-i,a-n),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const i=t[1],n=this.baseTransform||ln(this.ctx),s={createCanvasGraphics:t=>new Zr(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new Nr(t,i,this.ctx,s,n)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,i){const n=ei.makeHexColor(t,e,i);this.ctx.strokeStyle=n,this.current.strokeColor=n}setFillRGBColor(t,e,i){const n=ei.makeHexColor(t,e,i);this.ctx.fillStyle=n,this.current.fillColor=n,this.current.patternFill=!1}_getPattern(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=function(t){switch(t[0]){case"RadialAxial":return new Sr(t);case"Mesh":return new Rr(t);case"Dummy":return new Fr}throw new Error("Unknown IR type: ".concat(t[0]))}(this.getObject(t)),this.cachedPatterns.set(t,e)),i&&(e.matrix=i),e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,cn(e),kr);const n=cn(e);if(n){const{width:t,height:i}=e.canvas,[s,a,r,o]=ei.getAxialAlignedBoundingBox([0,0,t,i],n);this.ctx.fillRect(s,a,r-s,o-a)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){We("Should not call beginInlineImage")}beginImageData(){We("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=ln(this.ctx),e)){const t=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],t,i),this.current.updateRectMinMax(ln(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||De("TODO: Support non-isolated groups."),t.knockout&&Oe("Knockout groups not supported.");const i=ln(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let n=ei.getAxialAlignedBoundingBox(t.bbox,ln(e));const s=[0,0,e.canvas.width,e.canvas.height];n=ei.intersect(n,s)||[0,0,0,0];const a=Math.floor(n[0]),r=Math.floor(n[1]),o=Math.max(Math.ceil(n[2])-a,1),l=Math.max(Math.ceil(n[3])-r,1);this.current.startNewPathAndClipBox([0,0,o,l]);let c="groupAt"+this.groupLevel;t.smask&&(c+="_smask_"+this.smaskCounter++%2);const h=this.cachedCanvases.getCanvas(c,o,l),d=h.context;d.translate(-a,-r),d.transform(...i),t.smask?this.smaskStack.push({canvas:h.canvas,context:d,offsetX:a,offsetY:r,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(a,r),e.save()),Vr(e,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=ln(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const i=ei.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,n,s){if(vt(Qr,this,Jr).call(this),Ur(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const n=e[2]-e[0],a=e[3]-e[1];if(s&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=n,e[3]=a;const[s,r]=ei.singularValueDecompose2dScale(ln(this.ctx)),{viewportScale:o}=this,l=Math.ceil(n*this.outputScaleX*o),c=Math.ceil(a*this.outputScaleY*o);this.annotationCanvas=this.canvasFactory.create(l,c);const{canvas:h,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(t,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(s,0,0,-r,0,a*r),Ur(this.ctx)}else Ur(this.ctx),this.ctx.rect(e[0],e[1],n,a),this.ctx.clip(),this.endPath()}this.current=new Br(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),vt(Qr,this,$r).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const i=this.ctx,n=this.processingType3;if(n&&(void 0===n.compiled&&(n.compiled=function(t){const{width:e,height:i}=t;if(e>1e3||i>1e3)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let a,r,o,l=new Uint8Array(s*(i+1));const c=e+7&-8;let h=new Uint8Array(c*i),d=0;for(const g of t.data){let t=128;for(;t>0;)h[d++]=g&t?0:255,t>>=1}let u=0;for(d=0,0!==h[d]&&(l[0]=1,++u),r=1;r<e;r++)h[d]!==h[d+1]&&(l[r]=h[d]?2:1,++u),d++;for(0!==h[d]&&(l[r]=2,++u),a=1;a<i;a++){d=a*c,o=a*s,h[d-c]!==h[d]&&(l[o]=h[d]?1:8,++u);let t=(h[d]?4:0)+(h[d-c]?8:0);for(r=1;r<e;r++)t=(t>>2)+(h[d+1]?4:0)+(h[d-c+1]?8:0),n[t]&&(l[o+r]=n[t],++u),d++;if(h[d-c]!==h[d]&&(l[o+r]=h[d]?2:4,++u),u>1e3)return null}for(d=c*(i-1),o=a*s,0!==h[d]&&(l[o]=8,++u),r=1;r<e;r++)h[d]!==h[d+1]&&(l[o+r]=h[d]?4:8,++u),d++;if(0!==h[d]&&(l[o+r]=4,++u),u>1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),f=new Path2D;for(a=0;u&&a<=i;a++){let t=a*s;const i=t+e;for(;t<i&&!l[t];)t++;if(t===i)continue;f.moveTo(t%s,a);const n=t;let r=l[t];do{const e=p[r];do{t+=e}while(!l[t]);const i=l[t];5!==i&&10!==i?(r=i,l[t]=0):(r=i&51*r>>4,l[t]&=r>>2|r<<2),f.lineTo(t%s,t/s|0),l[t]||--u}while(n!==t);--a}return h=null,l=null,function(t){t.save(),t.scale(1/e,-1/i),t.translate(0,-i),t.fill(f),t.beginPath(),t.restore()}}(t)),n.compiled))return void n.compiled(i);const s=this._createMaskCanvas(t),a=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(a,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const r=this.ctx;r.save();const o=ln(r);r.transform(e,i,n,s,0,0);const l=this._createMaskCanvas(t);r.setTransform(1,0,0,1,l.offsetX-o[4],l.offsetY-o[5]);for(let c=0,h=a.length;c<h;c+=2){const t=ei.transform(o,[e,i,n,s,a[c],a[c+1]]),[h,d]=ei.applyTransform([0,0],t);r.drawImage(l.canvas,h,d)}r.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,n=this.current.patternFill;for(const s of t){const{data:t,width:a,height:r,transform:o}=s,l=this.cachedCanvases.getCanvas("maskCanvas",a,r),c=l.context;c.save();jr(c,this.getObject(t,s)),c.globalCompositeOperation="source-in",c.fillStyle=n?i.getPattern(c,this,cn(e),xr):i,c.fillRect(0,0,a,r),c.restore(),e.save(),e.transform(...o),e.scale(1,-1),zr(e,l.canvas,0,0,a,r,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):Oe("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;const s=this.getObject(t);if(!s)return void Oe("Dependent image isn't ready yet");const a=s.width,r=s.height,o=[];for(let l=0,c=n.length;l<c;l+=2)o.push({transform:[e,0,0,i,n[l],n[l+1]],x:0,y:0,w:a,h:r});this.paintInlineImageXObjectGroup(s,o)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:i,height:n}=t,s=this.cachedCanvases.getCanvas("inlineImage",i,n),a=s.context;return a.filter=this.current.transferMaps,a.drawImage(e,0,0),a.filter="none",s.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,n=this.ctx;if(this.save(),!Wt){const{filter:t}=n;"none"!==t&&""!==t&&(n.filter="none")}let s;if(n.scale(1/e,-1/i),t.bitmap)s=this.applyTransferMapsToBitmap(t);else if("function"===typeof HTMLElement&&t instanceof HTMLElement||!t.data)s=t;else{const n=this.cachedCanvases.getCanvas("inlineImage",e,i).context;Hr(n,t),s=this.applyTransferMapsToCanvas(n)}const a=this._scaleImage(s,cn(n));n.imageSmoothingEnabled=Gr(ln(n),t.interpolate),zr(n,a.img,0,0,a.paintWidth,a.paintHeight,0,-i,e,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx;let n;if(t.bitmap)n=t.bitmap;else{const e=t.width,i=t.height,s=this.cachedCanvases.getCanvas("inlineImage",e,i).context;Hr(s,t),n=this.applyTransferMapsToCanvas(s)}for(const s of e)i.save(),i.transform(...s.transform),i.scale(1,-1),zr(i,n,s.x,s.y,s.w,s.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(e||(this.pendingClip===Kr?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=ln(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 a,r;if(0===i&&0===n){const i=Math.abs(e),n=Math.abs(s);if(i===n)if(0===t)a=r=1/i;else{const e=i*t;a=r=e<1?1/e:1}else if(0===t)a=1/i,r=1/n;else{const e=i*t,s=n*t;a=e<1?1/e:1,r=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)a=c/o,r=l/o;else{const e=t*o;a=c>e?c/e:1,r=l>e?l/e:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=r}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:i}=this.current,[n,s]=this.getScaleForStroking();if(e.lineWidth=i||1,1===n&&1===s)return void e.stroke();const a=e.getLineDash();if(t&&e.save(),e.scale(n,s),a.length>0){const t=Math.max(n,s);e.setLineDash(a.map(e=>e/t)),e.lineDashOffset/=t}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}function Jr(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}function $r(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}for(const Ib in Re)void 0!==Zr.prototype[Ib]&&(Zr.prototype[Re[Ib]]=Zr.prototype[Ib]);class to{static get workerPort(){return vt(to,this,eo)._}static set workerPort(t){if(!("undefined"!==typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");eo._=vt(to,this,t)}static get workerSrc(){return vt(to,this,io)._}static set workerSrc(t){if("string"!==typeof t)throw new Error("Invalid `workerSrc` type.");io._=vt(to,this,t)}}var eo={_:null},io={_:""};const no=1,so=2,ao=1,ro=2,oo=3,lo=4,co=5,ho=6,uo=7,po=8;function fo(t){switch(t instanceof Error||"object"===typeof t&&null!==t||We('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new Ke(t.message);case"MissingPDFException":return new qe(t.message);case"PasswordException":return new Ve(t.message,t.code);case"UnexpectedResponseException":return new Xe(t.message,t.status);case"UnknownErrorException":return new Ue(t.message,t.details);default:return new Ue(t.message,t.toString())}}var go=new WeakSet;class mo{constructor(t,e,i){mt(this,go),this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream)return void vt(go,this,bo).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===no)i.resolve(e.data);else{if(e.callback!==so)throw new Error("Unexpected callback case");i.reject(fo(e.reason))}return}const n=this.actionHandler[e.action];if(!n)throw new Error("Unknown action from worker: ".concat(e.action));if(e.callbackId){const t=this.sourceName,s=e.sourceName;return void new Promise(function(t){t(n(e.data))}).then(function(n){i.postMessage({sourceName:t,targetName:s,callback:no,callbackId:e.callbackId,data:n})},function(n){i.postMessage({sourceName:t,targetName:s,callback:so,callbackId:e.callbackId,reason:fo(n)})})}e.streamId?vt(go,this,vo).call(this,e):n(e.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error('There is already an actionName called "'.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(a){s.reject(a)}return s.promise}sendWithStream(t,e,i,n){const s=this.streamId++,a=this.sourceName,r=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:a,targetName:r,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:a,targetName:r,stream:ho,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{ze(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:a,targetName:r,stream:ao,streamId:s,reason:fo(t)}),e.promise}},i)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}function vo(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,a=this,r=this.actionHandler[t.action],o={enqueue(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=a,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:n,stream:lo,streamId:e,chunk:t},r)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:oo,streamId:e}),delete a.streamSinks[e])},error(t){ze(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:co,streamId:e,reason:fo(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,new Promise(function(e){e(r(t.data,o))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:po,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:po,streamId:e,reason:fo(t)})})}function bo(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,a=this.streamControllers[e],r=this.streamSinks[e];switch(t.stream){case po:t.success?a.startCall.resolve():a.startCall.reject(fo(t.reason));break;case uo:t.success?a.pullCall.resolve():a.pullCall.reject(fo(t.reason));break;case ho:if(!r){s.postMessage({sourceName:i,targetName:n,stream:uo,streamId:e,success:!0});break}r.desiredSize<=0&&t.desiredSize>0&&r.sinkCapability.resolve(),r.desiredSize=t.desiredSize,new Promise(function(t){var e;t(null===(e=r.onPull)||void 0===e?void 0:e.call(r))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:uo,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:uo,streamId:e,reason:fo(t)})});break;case lo:if(ze(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(t.chunk);break;case oo:if(ze(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),vt(go,this,wo).call(this,a,e);break;case co:ze(a,"error should have stream controller"),a.controller.error(fo(t.reason)),vt(go,this,wo).call(this,a,e);break;case ro:t.success?a.cancelCall.resolve():a.cancelCall.reject(fo(t.reason)),vt(go,this,wo).call(this,a,e);break;case ao:if(!r)break;new Promise(function(e){var i;e(null===(i=r.onCancel)||void 0===i?void 0:i.call(r,fo(t.reason)))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:ro,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:ro,streamId:e,reason:fo(t)})}),r.sinkCapability.reject(fo(t.reason)),r.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async function wo(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 yo=new WeakMap,Ao=new WeakMap;class Eo{constructor(t){let{parsedData:e,rawData:i}=t;yt(this,yo,void 0),yt(this,Ao,void 0),Et(yo,this,e),Et(Ao,this,i)}getRaw(){return At(Ao,this)}get(t){var e;return null!==(e=At(yo,this).get(t))&&void 0!==e?e:null}getAll(){return Je(At(yo,this))}has(t){return At(yo,this).has(t)}}const xo=Symbol("INTERNAL");var _o=new WeakMap,ko=new WeakMap,Co=new WeakMap,Mo=new WeakMap;class So{constructor(t,e){let{name:i,intent:n,usage:s}=e;yt(this,_o,!1),yt(this,ko,!1),yt(this,Co,!1),yt(this,Mo,!0),Et(_o,this,!!(t&Vt)),Et(ko,this,!!(t&Ut)),this.name=i,this.intent=n,this.usage=s}get visible(){if(At(Co,this))return At(Mo,this);if(!At(Mo,this))return!1;const{print:t,view:e}=this.usage;return At(_o,this)?"OFF"!==(null===e||void 0===e?void 0:e.viewState):!At(ko,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!==xo&&We("Internal method `_setVisible` called."),Et(Co,this,i),Et(Mo,this,e)}}var Lo=new WeakMap,To=new WeakMap,Ro=new WeakMap,Fo=new WeakMap,Po=new WeakSet;class Io{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vt;if(mt(this,Po),yt(this,Lo,null),yt(this,To,new Map),yt(this,Ro,null),yt(this,Fo,null),this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,Et(Fo,this,t.order);for(const i of t.groups)At(To,this).set(i.id,new So(e,i));if("OFF"===t.baseState)for(const t of At(To,this).values())t._setVisible(xo,!1);for(const e of t.on)At(To,this).get(e)._setVisible(xo,!0);for(const e of t.off)At(To,this).get(e)._setVisible(xo,!1);Et(Ro,this,this.getHash())}}isVisible(t){if(0===At(To,this).size)return!0;if(!t)return De("Optional content group not defined."),!0;if("OCG"===t.type)return At(To,this).has(t.id)?At(To,this).get(t.id).visible:(Oe("Optional content group not found: ".concat(t.id)),!0);if("OCMD"===t.type){if(t.expression)return vt(Po,this,No).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!At(To,this).has(e))return Oe("Optional content group not found: ".concat(e)),!0;if(At(To,this).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!At(To,this).has(e))return Oe("Optional content group not found: ".concat(e)),!0;if(!At(To,this).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!At(To,this).has(e))return Oe("Optional content group not found: ".concat(e)),!0;if(!At(To,this).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!At(To,this).has(e))return Oe("Optional content group not found: ".concat(e)),!0;if(At(To,this).get(e).visible)return!1}return!0}return Oe("Unknown optional content policy ".concat(t.policy,".")),!0}return Oe("Unknown group type ".concat(t.type,".")),!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=At(To,this).get(t);i?(i._setVisible(xo,!!e,!0),Et(Lo,this,null)):Oe("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=At(To,this).get(s);if(t)switch(e){case"ON":t._setVisible(xo,!0);break;case"OFF":t._setVisible(xo,!1);break;case"Toggle":t._setVisible(xo,!t.visible)}}Et(Lo,this,null)}get hasInitialVisibility(){return null===At(Ro,this)||this.getHash()===At(Ro,this)}getOrder(){return At(To,this).size?At(Fo,this)?At(Fo,this).slice():[...At(To,this).keys()]:null}getGroups(){return At(To,this).size>0?Je(At(To,this)):null}getGroup(t){return At(To,this).get(t)||null}getHash(){if(null!==At(Lo,this))return At(Lo,this);const t=new or;for(const[e,i]of At(To,this))t.update("".concat(e,":").concat(i.visible));return Et(Lo,this,t.hexdigest())}}function No(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(Po,this,No).call(this,e);else{if(!At(To,this).has(e))return Oe("Optional content group not found: ".concat(e)),!0;s=At(To,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 Do{constructor(t,e){let{disableRange:i=!1,disableStream:n=!1}=e;ze(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:a,progressiveDone:r,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=r,this._contentDispositionFilename=o,(null===a||void 0===a?void 0:a.length)>0){const t=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).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{ze(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(){ze(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Oo(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Wo(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 Oo{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=Qi(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 Wo{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 zo(t){let{getResponseHeader:e,isHttp:i,rangeChunkSize:n,disableRange:s}=t;const a={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(e("Content-Length"),10);if(!Number.isInteger(r))return a;if(a.suggestedLength=r,r<=2*n)return a;if(s||!i)return a;if("bytes"!==e("Accept-Ranges"))return a;return"identity"!==(e("Content-Encoding")||"identity")||(a.allowRangeRequests=!0),a}function Bo(t){const e=t("Content-Disposition");if(e){let t=function(t){let e=!0,i=n("filename\\*","i").exec(t);if(i){i=i[1];let t=r(i);return t=unescape(t),t=o(t),t=l(t),a(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 a=[];for(let n=0;n<e.length&&n in e;++n){let[t,i]=e[n];i=r(i),t&&(i=unescape(i),0===n&&(i=o(i))),a.push(i)}return a.join("")}(t),i)return a(l(i));if(i=n("filename","i").exec(t),i){i=i[1];let t=r(i);return t=l(t),a(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=Ze(i);i=n.decode(s),e=!1}catch(n){}}return i}function a(t){return e&&/[\x80-\xff]/.test(t)&&(t=s("utf-8",t),e&&(t=s("iso-8859-1",t))),t}function r(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(a){}return s(e,n)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(i){}if(Qi(t))return t}return null}function Ho(t,e){return 404===t||0===t&&e.startsWith("file:")?new qe('Missing PDF "'+e+'".'):new Xe("Unexpected server response (".concat(t,') while retrieving PDF "').concat(e,'".'),t)}function jo(t){return 200===t||206===t}function Vo(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Uo(t){const e=new Headers;for(const i in t){const n=t[i];void 0!==n&&e.append(i,n)}return e}function Go(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(Oe("getArrayBuffer - unexpected data format: ".concat(t)),new Uint8Array(t).buffer)}class qo{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return ze(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Xo(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Yo(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 Xo{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._headers=Uo(this._stream.httpHeaders);const i=e.url;fetch(i,Vo(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!jo(t.status))throw Ho(t.status,i);this._reader=t.body.getReader(),this._headersCapability.resolve();const e=e=>t.headers.get(e),{allowRangeRequests:n,suggestedLength:s}=zo({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=Bo(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Ke("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:Go(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class Yo{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const n=t.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController,this._headers=Uo(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(e,"-").concat(i-1));const s=n.url;fetch(s,Vo(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!jo(t.status))throw Ho(t.status,s);this._readCapability.resolve(),this._reader=t.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded}),{value:Go(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class Ko{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,i){const n={begin:t,end:e};for(const s in i)n[s]=i[s];return this.request(n)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const s in this.httpHeaders){const t=this.httpHeaders[s];void 0!==t&&e.setRequestHeader(s,t)}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",t.onError&&(e.onerror=function(i){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=t.onHeadersReceived,n.onDone=t.onDone,n.onError=t.onError,n.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){var i;const n=this.pendingRequests[t];n&&(null===(i=n.onProgress)||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;var s;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void(null===(s=i.onError)||void 0===s||s.call(i,n.status));const a=n.status||200;var r;if(!(200===a&&206===i.expectedStatus)&&a!==i.expectedStatus)return void(null===(r=i.onError)||void 0===r||r.call(i,n.status));const o=function(t){const e=t.response;return"string"!==typeof e?e:Ze(e).buffer}(n);if(206===a){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:o})}else if(o)i.onDone({begin:0,chunk:o});else{var l;null===(l=i.onError)||void 0===l||l.call(i,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 Qo{constructor(t){this._source=t,this._manager=new Ko(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return ze(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new Zo(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new Jo(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 Zo{constructor(t,e){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(i),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),i=t=>e.getResponseHeader(t),{allowRangeRequests:n,suggestedLength:s}=zo({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=Bo(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.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=Ho(t,this._url),this._headersReceivedCapability.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._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const 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 Jo{constructor(t,e,i){this._manager=t;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,n),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var t;null===(t=this.onClosed)||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){this._storedError=Ho(t,this._url);for(const e of this._requests)e.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 $o=/^file:\/\/\/[a-zA-Z]:\//;class tl{constructor(t){this.source=t,this.url=function(t){const e=Ar.get("url"),i=e.parse(t);return"file:"===i.protocol||i.host?i:/^[a-z]:[/\\]/i.test(t)?e.parse("file:///".concat(t)):(i.host||(i.protocol="file:"),i)}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return ze(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new rl(this):new sl(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new ol(this,t,e):new al(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 el{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();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 Ke("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class il{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();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)}}function nl(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class sl extends el{constructor(t){super(t);const e=e=>{if(404===e.statusCode){const t=new qe('Missing PDF "'.concat(this._url,'".'));return this._storedError=t,void this._headersCapability.reject(t)}this._headersCapability.resolve(),this._setReadableStream(e);const i=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:n,suggestedLength:s}=zo({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=Bo(i)};if(this._request=null,"http:"===this._url.protocol){const i=Ar.get("http");this._request=i.request(nl(this._url,t.httpHeaders),e)}else{const i=Ar.get("https");this._request=i.request(nl(this._url,t.httpHeaders),e)}this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class al extends il{constructor(t,e,i){super(t),this._httpHeaders={};for(const s in t.httpHeaders){const e=t.httpHeaders[s];void 0!==e&&(this._httpHeaders[s]=e)}this._httpHeaders.Range="bytes=".concat(e,"-").concat(i-1);const n=t=>{if(404===t.statusCode){const t=new qe('Missing PDF "'.concat(this._url,'".'));return void(this._storedError=t)}this._setReadableStream(t)};if(this._request=null,"http:"===this._url.protocol){const t=Ar.get("http");this._request=t.request(nl(this._url,this._httpHeaders),n)}else{const t=Ar.get("https");this._request=t.request(nl(this._url,this._httpHeaders),n)}this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class rl extends el{constructor(t){super(t);let e=decodeURIComponent(this._url.path);$o.test(this._url.href)&&(e=e.replace(/^\//,""));const i=Ar.get("fs");i.promises.lstat(e).then(t=>{this._contentLength=t.size,this._setReadableStream(i.createReadStream(e)),this._headersCapability.resolve()},t=>{"ENOENT"===t.code&&(t=new qe('Missing PDF "'.concat(e,'".'))),this._storedError=t,this._headersCapability.reject(t)})}}class ol extends il{constructor(t,e,i){super(t);let n=decodeURIComponent(this._url.path);$o.test(this._url.href)&&(n=n.replace(/^\//,""));const s=Ar.get("fs");this._setReadableStream(s.createReadStream(n,{start:e,end:i-1}))}}const ll=30;var cl=new WeakMap,hl=new WeakMap,dl=new WeakMap,ul=new WeakMap,pl=new WeakMap,fl=new WeakMap,gl=new WeakMap,ml=new WeakMap,vl=new WeakMap,bl=new WeakMap,wl=new WeakMap,yl=new WeakMap,Al=new WeakMap,El=new WeakMap,xl=new WeakMap,_l=new WeakMap,kl=new WeakMap,Cl=new WeakMap,Ml=new WeakSet;class Sl{constructor(t){var e;let{textContentSource:i,container:n,viewport:s}=t;if(mt(this,Ml),yt(this,cl,Promise.withResolvers()),yt(this,hl,null),yt(this,dl,!1),yt(this,ul,!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled)),yt(this,pl,null),yt(this,fl,null),yt(this,gl,0),yt(this,ml,0),yt(this,vl,null),yt(this,bl,null),yt(this,wl,0),yt(this,yl,0),yt(this,Al,Object.create(null)),yt(this,El,[]),yt(this,xl,null),yt(this,_l,[]),yt(this,kl,new WeakMap),yt(this,Cl,null),i instanceof ReadableStream)Et(xl,this,i);else{if("object"!==typeof i)throw new Error('No "textContentSource" parameter specified.');Et(xl,this,new ReadableStream({start(t){t.enqueue(i),t.close()}}))}Et(hl,this,Et(bl,this,n)),Et(yl,this,s.scale*(globalThis.devicePixelRatio||1)),Et(wl,this,s.rotation),Et(fl,this,{prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null});const{pageWidth:a,pageHeight:r,pageX:o,pageY:l}=s.rawDims;Et(Cl,this,[1,0,0,-1,-o,l+r]),Et(ml,this,a),Et(gl,this,r),Pl.call(Sl),hn(n,s),At(cl,this).promise.catch(()=>{}).then(()=>{Wl._.delete(this),Et(fl,this,null),Et(Al,this,null)})}render(){const t=()=>{At(vl,this).read().then(e=>{var i;let{value:n,done:s}=e;s?At(cl,this).resolve():(null!==(i=At(pl,this))&&void 0!==i||Et(pl,this,n.lang),Object.assign(At(Al,this),n.styles),vt(Ml,this,Ll).call(this,n.items),t())},At(cl,this).reject)};return Et(vl,this,At(xl,this).getReader()),Wl._.add(this),t(),At(cl,this).promise}update(t){let{viewport:e,onBefore:i=null}=t;const n=e.scale*(globalThis.devicePixelRatio||1),s=e.rotation;if(s!==At(wl,this)&&(null===i||void 0===i||i(),Et(wl,this,s),hn(At(bl,this),{rotation:s})),n!==At(yl,this)){null===i||void 0===i||i(),Et(yl,this,n);const t={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:Fl.call(Sl,At(pl,this))};for(const e of At(_l,this))t.properties=At(kl,this).get(e),t.div=e,vt(Ml,this,Rl).call(this,t)}}cancel(){var t;const e=new Ke("TextLayer task cancelled.");null===(t=At(vl,this))||void 0===t||t.cancel(e).catch(()=>{}),Et(vl,this,null),At(cl,this).reject(e)}get textDivs(){return At(_l,this)}get textContentItemsStr(){return At(El,this)}static cleanup(){if(!(vt(Sl,this,Wl)._.size>0)){vt(Sl,this,Nl)._.clear();for(const{canvas:t}of vt(Sl,this,Dl)._.values())t.remove();vt(Sl,this,Dl)._.clear()}}}function Ll(t){var e,i;if(At(dl,this))return;null!==(i=(e=At(fl,this)).ctx)&&void 0!==i||(e.ctx=Fl.call(Lt,At(pl,this)));const n=At(_l,this),s=At(El,this);for(const a of t){if(n.length>1e5)return Oe("Ignoring additional textDivs for performance reasons."),void Et(dl,this,!0);if(void 0!==a.str)s.push(a.str),vt(Ml,this,Tl).call(this,a);else if("beginMarkedContentProps"===a.type||"beginMarkedContent"===a.type){const t=At(hl,this);Et(hl,this,document.createElement("span")),At(hl,this).classList.add("markedContent"),null!==a.id&&At(hl,this).setAttribute("id","".concat(a.id)),t.append(At(hl,this))}else"endMarkedContent"===a.type&&Et(hl,this,At(hl,this).parentNode)}}function Tl(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};At(_l,this).push(e);const n=ei.transform(At(Cl,this),t.transform);let s=Math.atan2(n[1],n[0]);const a=At(Al,this)[t.fontName];a.vertical&&(s+=Math.PI/2);const r=At(ul,this)&&a.fontSubstitution||a.fontFamily,o=Math.hypot(n[2],n[3]),l=o*Il.call(Lt,r,At(pl,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(--scale-factor)*",u=e.style;At(hl,this)===At(bl,this)?(u.left="".concat((100*c/At(ml,this)).toFixed(2),"%"),u.top="".concat((100*h/At(gl,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((Ol._*o).toFixed(2),"px)"),u.fontFamily=r,i.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,At(ul,this)&&(e.dataset.fontName=a.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=a.vertical?t.height:t.width),At(kl,this).set(e,i),At(fl,this).div=e,At(fl,this).properties=i,vt(Ml,this,Rl).call(this,At(fl,this)),i.hasText&&At(hl,this).append(e),i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),At(hl,this).append(t)}}function Rl(t){const{div:e,properties:i,ctx:n,prevFontSize:s,prevFontFamily:a}=t,{style:r}=e;let o="";if(Ol._>1&&(o="scale(".concat(1/Ol._,")")),0!==i.canvasWidth&&i.hasText){const{fontFamily:l}=r,{canvasWidth:c,fontSize:h}=i;s===h&&a===l||(n.font="".concat(h*At(yl,this),"px ").concat(l),t.prevFontSize=h,t.prevFontFamily=l);const{width:d}=n.measureText(e.textContent);d>0&&(o="scaleX(".concat(c*At(yl,this)/d,") ").concat(o))}0!==i.angle&&(o="rotate(".concat(i.angle,"deg) ").concat(o)),o.length>0&&(r.transform=o)}function Fl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=vt(Lt,this,Dl)._.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(Lt,this,Dl)._.set(t,e)}return e}function Pl(){if(null!==vt(Lt,this,Ol)._)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),Ol._=vt(Lt,this,t.getBoundingClientRect().height),t.remove()}function Il(t,e){const i=vt(Lt,this,Nl)._.get(t);if(i)return i;const n=vt(Lt,this,Fl).call(this,e),s=n.font;n.canvas.width=n.canvas.height=ll,n.font="".concat(ll,"px ").concat(t);const a=n.measureText("");let r=a.fontBoundingBoxAscent,o=Math.abs(a.fontBoundingBoxDescent);if(r){const e=r/(r+o);return vt(Lt,this,Nl)._.set(t,e),n.canvas.width=n.canvas.height=0,n.font=s,e}n.strokeStyle="red",n.clearRect(0,0,ll,ll),n.strokeText("g",0,0);let l=n.getImageData(0,0,ll,ll).data;o=0;for(let h=l.length-1-3;h>=0;h-=4)if(l[h]>0){o=Math.ceil(h/4/ll);break}n.clearRect(0,0,ll,ll),n.strokeText("A",0,ll),l=n.getImageData(0,0,ll,ll).data,r=0;for(let h=0,d=l.length;h<d;h+=4)if(l[h]>0){r=ll-Math.floor(h/4/ll);break}n.canvas.width=n.canvas.height=0,n.font=s;const c=r?r/(r+o):.8;return vt(Lt,this,Nl)._.set(t,c),c}Lt=Sl;var Nl={_:new Map},Dl={_:new Map},Ol={_:null},Wl={_:new Set};function zl(){nn("`renderTextLayer`, please use `TextLayer` instead.");const t=arguments[0],{textContentSource:e,container:i,viewport:n}=t,s=(0,ft.A)(t,xt),a=Object.keys(s);a.length>0&&Oe("Ignoring `renderTextLayer` parameters: "+a.join(", "));const r=new Sl({textContentSource:e,container:i,viewport:n}),{textDivs:o,textContentItemsStr:l}=r;return{promise:r.render(),textDivs:o,textContentItemsStr:l}}function Bl(){nn("`updateTextLayer`, please use `TextLayer` instead.")}class Hl{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 a=i.name;if("#text"===a)s=i.value;else{if(!Hl.shouldBuildText(a))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)}}const jl=65536,Vl=Wt?class extends wi{_createCanvas(t,e){return Ar.get("canvas").createCanvas(t,e)}}:class extends wi{constructor(){let{ownerDocument:t=globalThis.document,enableHWA:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}},Ul=Wt?class extends yi{_fetchData(t,e){return Er(t).then(t=>({cMapData:t,compressionType:e}))}}:Ui,Gl=Wt?class extends vi{}:class extends vi{constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),mt(this,Ri),yt(this,ki,void 0),yt(this,Ci,void 0),yt(this,Mi,void 0),yt(this,Si,void 0),yt(this,Li,void 0),yt(this,Ti,0),Et(Mi,this,t),Et(Si,this,e)}addFilter(t){var e,i;if(!t)return"none";let n=bt(Ri,this,Fi).get(t);if(n)return n;const[s,a,r]=vt(Ri,this,Ni).call(this,t),o=1===t.length?s:"".concat(s).concat(a).concat(r);if(n=bt(Ri,this,Fi).get(o),n)return bt(Ri,this,Fi).set(t,n),n;const l="g_".concat(At(Mi,this),"_transfer_map_").concat((Et(Ti,this,(e=At(Ti,this),i=e++,e)),i)),c="url(#".concat(l,")");bt(Ri,this,Fi).set(t,c),bt(Ri,this,Fi).set(o,c);const h=vt(Ri,this,Wi).call(this,l);return vt(Ri,this,Bi).call(this,s,a,r,h),c}addHCMFilter(t,e){var i;const n="".concat(t,"-").concat(e),s="base";let a=bt(Ri,this,Pi).get(s);if((null===(i=a)||void 0===i?void 0:i.key)===n)return a.url;var r;a?(null===(r=a.filter)||void 0===r||r.remove(),a.key=n,a.url="none",a.filter=null):(a={key:n,url:"none",filter:null},bt(Ri,this,Pi).set(s,a));if(!t||!e)return a.url;const o=vt(Ri,this,ji).call(this,t);t=ei.makeHexColor(...o);const l=vt(Ri,this,ji).call(this,e);if(e=ei.makeHexColor(...l),bt(Ri,this,Ii).style.color="","#000000"===t&&"#ffffff"===e||t===e)return a.url;const c=new Array(256);for(let f=0;f<=255;f++){const t=f/255;c[f]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const h=c.join(","),d="g_".concat(At(Mi,this),"_hcm_filter"),u=a.filter=vt(Ri,this,Wi).call(this,d);vt(Ri,this,Bi).call(this,h,h,h,u),vt(Ri,this,Oi).call(this,u);const p=(t,e)=>{const i=o[t]/255,n=l[t]/255,s=new Array(e+1);for(let a=0;a<=e;a++)s[a]=i+a/e*(n-i);return s.join(",")};return vt(Ri,this,Bi).call(this,p(0,5),p(1,5),p(2,5),u),a.url="url(#".concat(d,")"),a.url}addAlphaFilter(t){var e,i;let n=bt(Ri,this,Fi).get(t);if(n)return n;const[s]=vt(Ri,this,Ni).call(this,[t]),a="alpha_".concat(s);if(n=bt(Ri,this,Fi).get(a),n)return bt(Ri,this,Fi).set(t,n),n;const r="g_".concat(At(Mi,this),"_alpha_map_").concat((Et(Ti,this,(e=At(Ti,this),i=e++,e)),i)),o="url(#".concat(r,")");bt(Ri,this,Fi).set(t,o),bt(Ri,this,Fi).set(a,o);const l=vt(Ri,this,Wi).call(this,r);return vt(Ri,this,Hi).call(this,s,l),o}addLuminosityFilter(t){var e,i;let n,s,a=bt(Ri,this,Fi).get(t||"luminosity");if(a)return a;if(t?([n]=vt(Ri,this,Ni).call(this,[t]),s="luminosity_".concat(n)):s="luminosity",a=bt(Ri,this,Fi).get(s),a)return bt(Ri,this,Fi).set(t,a),a;const r="g_".concat(At(Mi,this),"_luminosity_map_").concat((Et(Ti,this,(e=At(Ti,this),i=e++,e)),i)),o="url(#".concat(r,")");bt(Ri,this,Fi).set(t,o),bt(Ri,this,Fi).set(s,o);const l=vt(Ri,this,Wi).call(this,r);return vt(Ri,this,Di).call(this,l),t&&vt(Ri,this,Hi).call(this,n,l),o}addHighlightHCMFilter(t,e,i,n,s){var a;const r="".concat(e,"-").concat(i,"-").concat(n,"-").concat(s);let o=bt(Ri,this,Pi).get(t);if((null===(a=o)||void 0===a?void 0:a.key)===r)return o.url;var l;o?(null===(l=o.filter)||void 0===l||l.remove(),o.key=r,o.url="none",o.filter=null):(o={key:r,url:"none",filter:null},bt(Ri,this,Pi).set(t,o));if(!e||!i)return o.url;const[c,h]=[e,i].map(vt(Ri,this,ji).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,f]=[n,s].map(vt(Ri,this,ji).bind(this));u<d&&([d,u,p,f]=[u,d,f,p]),bt(Ri,this,Ii).style.color="";const g=(t,e,i)=>{const n=new Array(256),s=(u-d)/i,a=t/255,r=(e-t)/(255*i);let o=0;for(let l=0;l<=i;l++){const t=Math.round(d+l*s),e=a+l*r;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(At(Mi,this),"_hcm_").concat(t,"_filter"),v=o.filter=vt(Ri,this,Wi).call(this,m);return vt(Ri,this,Oi).call(this,v),vt(Ri,this,Bi).call(this,g(p[0],f[0],5),g(p[1],f[1],5),g(p[2],f[2],5),v),o.url="url(#".concat(m,")"),o.url}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&0!==bt(Ri,this,Pi).size||(At(Ci,this)&&(At(Ci,this).parentNode.parentNode.remove(),Et(Ci,this,null)),At(ki,this)&&(At(ki,this).clear(),Et(ki,this,null)),Et(Ti,this,0))}},ql=Wt?class extends Ai{_fetchData(t){return Er(t)}}:Gi;function Xl(){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 Kl,{docId:s}=n,a=i.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch(e){if(Wt&&"string"===typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(i.url):null,r=i.data?function(t){if(Wt&&"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 Ze(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 Zl?i.range:null,d=Number.isInteger(i.rangeChunkSize)&&i.rangeChunkSize>0?i.rangeChunkSize:jl;let u=i.worker instanceof hc?i.worker:null;const p=i.verbosity,f="string"!==typeof i.docBaseUrl||Ki(i.docBaseUrl)?null:i.docBaseUrl,g="string"===typeof i.cMapUrl?i.cMapUrl:null,m=!1!==i.cMapPacked,v=i.CMapReaderFactory||Ul,b="string"===typeof i.standardFontDataUrl?i.standardFontDataUrl:null,w=i.StandardFontDataFactory||ql,y=!0!==i.stopAtErrors,A=Number.isInteger(i.maxImageSize)&&i.maxImageSize>-1?i.maxImageSize:-1,E=!1!==i.isEvalSupported,x="boolean"===typeof i.isOffscreenCanvasSupported?i.isOffscreenCanvasSupported:!Wt,_=Number.isInteger(i.canvasMaxAreaInBytes)?i.canvasMaxAreaInBytes:-1,k="boolean"===typeof i.disableFontFace?i.disableFontFace:Wt,C=!0===i.fontExtraProperties,M=!0===i.enableXfa,S=i.ownerDocument||globalThis.document,L=!0===i.disableRange,T=!0===i.disableStream,R=!0===i.disableAutoFetch,F=!0===i.pdfBug,P=!0===i.enableHWA,I=h?h.length:null!==(e=i.length)&&void 0!==e?e:NaN,N="boolean"===typeof i.useSystemFonts?i.useSystemFonts:!Wt&&!k,D="boolean"===typeof i.useWorkerFetch?i.useWorkerFetch:v===Ui&&w===Gi&&g&&b&&tn(g,document.baseURI)&&tn(b,document.baseURI),O=i.canvasFactory||new Vl({ownerDocument:S,enableHWA:P}),W=i.filterFactory||new Gl({docId:s,ownerDocument:S});Ie(p);const z={canvasFactory:O,filterFactory:W};if(D||(z.cMapReaderFactory=new v({baseUrl:g,isCompressed:m}),z.standardFontDataFactory=new w({baseUrl:b})),!u){const t={verbosity:p,port:to.workerPort};u=t.port?hc.fromPort(t):new hc(t),n._worker=u}const B={docId:s,apiVersion:"4.4.168",data:r,password:c,disableAutoFetch:R,rangeChunkSize:d,length:I,docBaseUrl:f,enableXfa:M,evaluatorOptions:{maxImageSize:A,disableFontFace:k,ignoreErrors:y,isEvalSupported:E,isOffscreenCanvasSupported:x,canvasMaxAreaInBytes:_,fontExtraProperties:C,useSystemFonts:N,cMapUrl:D?g:null,standardFontDataUrl:D?b:null}},H={disableFontFace:k,fontExtraProperties:C,ownerDocument:S,pdfBug:F,styleElement:null,loadingParams:{disableAutoFetch:R,enableXfa:M}};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",B,r?[r.buffer]:null);let e;if(h)e=new Do(h,{disableRange:L,disableStream:T});else if(!r){if(!a)throw new Error("getDocument - no `url` parameter provided.");e=(t=>{if(Wt){return function(){return"undefined"!==typeof fetch&&"undefined"!==typeof Response&&"body"in Response.prototype}()&&tn(t.url)?new qo(t):new tl(t)}return tn(t.url)?new qo(t):new Qo(t)})({url:a,length:I,httpHeaders:o,withCredentials:l,rangeChunkSize:d,disableRange:L,disableStream:T})}return t.then(t=>{if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const i=new mo(s,t,u.port),a=new yc(i,n,e,H,z);n._transport=a,i.send("Ready",null)})}).catch(n._capability.reject),n}function Yl(t){return"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}class Kl{constructor(){var t,e;this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d".concat((Ql._=(t=Ql._,e=t++,t),e)),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{var t,e;null!==(t=this._worker)&&void 0!==t&&t.port&&(this._worker._pendingDestroy=!0),await(null===(e=this._transport)||void 0===e?void 0:e.destroy())}catch(n){var i;throw null!==(i=this._worker)&&void 0!==i&&i.port&&delete this._worker._pendingDestroy,n}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}var Ql={_:0};class Zl{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.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then(()=>{for(const i of this._progressListeners)i(t,e)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const e of this._progressiveReadListeners)e(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){We("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class Jl{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return He(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){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 $l=new WeakMap,tc=new WeakMap,ec=new WeakSet;class ic{constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];mt(this,ec),yt(this,$l,null),yt(this,tc,!1),this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new $i:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new kc,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){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 Xi({viewBox:this.view,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 He(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;let{canvasContext:n,viewport:s,intent:a="display",annotationMode:r=Kt.ENABLE,transform:o=null,background:l=null,optionalContentConfigPromise:c=null,annotationCanvasMap:h=null,pageColors:d=null,printAnnotationStorage:u=null}=t;null===(e=this._stats)||void 0===e||e.time("Overall");const p=this._transport.getRenderingIntent(a,r,u),{renderingIntent:f,cacheKey:g}=p;Et(tc,this,!1),vt(ec,this,sc).call(this),c||(c=this._transport.getOptionalContentConfig(f));let m=this._intentStates.get(g);m||(m=Object.create(null),this._intentStates.set(g,m)),m.streamReaderCancelTimeout&&(clearTimeout(m.streamReaderCancelTimeout),m.streamReaderCancelTimeout=null);const v=!!(f&Ut);var b;m.displayReadyCapability||(m.displayReadyCapability=Promise.withResolvers(),m.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(b=this._stats)||void 0===b||b.time("Page Request"),this._pumpOperatorList(p));const w=t=>{var e;(m.renderTasks.delete(y),(this._maybeCleanupAfterRender||v)&&Et(tc,this,!0),vt(ec,this,nc).call(this,!v),t?(y.capability.reject(t),this._abortOperatorList({intentState:m,reason:t instanceof Error?t:new Error(t)})):y.capability.resolve(),this._stats)&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),null!==(e=globalThis.Stats)&&void 0!==e&&e.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},y=new Tc({callback:w,params:{canvasContext:n,viewport:s,transform:o,background:l},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:m.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:d});((i=m).renderTasks||(i.renderTasks=new Set)).add(y);const A=y.task;return Promise.all([m.displayReadyCapability.promise,c]).then(t=>{var e;let[i,n]=t;if(this.destroyed)w();else{if(null===(e=this._stats)||void 0===e||e.time("Rendering"),!(n.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");y.initializeGraphics({transparency:i,optionalContentConfig:n}),y.operatorListChanged()}}).catch(w),A}getOperatorList(){let{intent:t="display",annotationMode:e=Kt.ENABLE,printAnnotationStorage:i=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=this._transport.getRenderingIntent(t,e,i,!0);let s,a=this._intentStates.get(n.cacheKey);var r,o;(a||(a=Object.create(null),this._intentStates.set(n.cacheKey,a)),a.opListReadCapability)||(s=Object.create(null),s.operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(s))},a.opListReadCapability=Promise.withResolvers(),((r=a).renderTasks||(r.renderTasks=new Set)).add(s),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(o=this._stats)||void 0===o||o.time("Page Request"),this._pumpOperatorList(n));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=>Hl.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:a,done:r}=i;r?t(s):(null!==(n=s.lang)&&void 0!==n||(s.lang=a.lang),Object.assign(s.styles,a.styles),s.items.push(...a.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(),Et(tc,this,!1),vt(ec,this,sc).call(this),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Et(tc,this,!0);const e=vt(ec,this,nc).call(this,!1);return t&&e&&this._stats&&(this._stats=new $i),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(ec,this,nc).call(this,!0)}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:i,annotationStorageSerializable:n}=t;const{map:s,transfer:a}=n,r=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:s},a).getReader(),o=this._intentStates.get(i);o.streamReader=r;const l=()=>{r.read().then(t=>{let{value:e,done:i}=t;i?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,o),l())},t=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const t of o.renderTasks)t.operatorListChanged();vt(ec,this,nc).call(this,!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}})};l()}_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 Yi){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 Ke(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 nc(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(vt(ec,this,sc).call(this),!At(tc,this)||this.destroyed)return!1;if(t)return Et($l,this,setTimeout(()=>{Et($l,this,null),vt(ec,this,nc).call(this,!1)},5e3)),!1;for(const{renderTasks:e,operatorList:i}of this._intentStates.values())if(e.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),Et(tc,this,!1),!0}function sc(){At($l,this)&&(clearTimeout(At($l,this)),Et($l,this,null))}var ac=new WeakMap,rc=new WeakMap;class oc{constructor(){yt(this,ac,new Set),yt(this,rc,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};At(rc,this).then(()=>{for(const t of At(ac,this))t.call(this,i)})}addEventListener(t,e){At(ac,this).add(e)}removeEventListener(t,e){At(ac,this).delete(e)}terminate(){At(ac,this).clear()}}const lc={isWorkerDisabled:!1,fakeWorkerId:0};Wt&&(lc.isWorkerDisabled=!0,to.workerSrc||(to.workerSrc="./pdf.worker.mjs")),lc.isSameOrigin=function(t,e){let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch(s){return!1}const n=new URL(e,i);return i.origin===n.origin},lc.createCDNWrapper=function(t){const e='await import("'.concat(t,'");');return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};var cc=new WeakSet;class hc{constructor(){let{name:t=null,port:e=null,verbosity:i=Ne()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(mt(this,cc),this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){var n;if(null!==(n=pc._)&&void 0!==n&&n.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(pc._||(pc._=new WeakMap)).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return Wt?Promise.all([Ar.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new mo("main","worker",t),this._messageHandler.on("ready",function(){}),vt(cc,this,dc).call(this)}_initialize(){if(lc.isWorkerDisabled||uc(hc))return void this._setupFakeWorker();let{workerSrc:t}=hc;try{lc.isSameOrigin(window.location.href,t)||(t=lc.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new mo("main","worker",e),n=()=>{s.abort(),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=new AbortController;e.addEventListener("error",()=>{this._webWorker||n()},{signal:s.signal}),i.on("test",t=>{s.abort(),!this.destroyed&&t?(this._messageHandler=i,this._port=e,this._webWorker=e,vt(cc,this,dc).call(this)):n()}),i.on("ready",t=>{if(s.abort(),this.destroyed)n();else try{a()}catch(e){this._setupFakeWorker()}});const a=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void a()}catch(e){De("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){lc.isWorkerDisabled||(Oe("Setting up fake worker."),lc.isWorkerDisabled=!0),hc._setupFakeWorkerGlobal.then(t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new oc;this._port=e;const i="fake".concat(lc.fakeWorkerId++),n=new mo(i+"_worker",i,e);t.setup(n,e),this._messageHandler=new mo(i,i+"_worker",e),vt(cc,this,dc).call(this)}).catch(t=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))})}destroy(){var t;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null===(t=pc._)||void 0===t||t.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){var e;if(null===t||void 0===t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const i=null===(e=vt(hc,this,pc)._)||void 0===e?void 0:e.get(t.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new hc(t)}static get workerSrc(){if(to.workerSrc)return to.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return He(this,"_setupFakeWorkerGlobal",(async()=>{if(bt(hc,this,uc))return bt(hc,this,uc);return(await i(59169)(this.workerSrc)).WorkerMessageHandler})())}}function dc(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}function uc(t){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch(i){return null}}var pc={_:void 0},fc=new WeakMap,gc=new WeakMap,mc=new WeakMap,vc=new WeakMap,bc=new WeakMap,wc=new WeakSet;class yc{constructor(t,e,i,n,s){mt(this,wc),yt(this,fc,new Map),yt(this,gc,new Map),yt(this,mc,new Map),yt(this,vc,new Map),yt(this,bc,null),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new kc,this.fontLoader=new vr({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.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return He(this,"annotationStorage",new ur)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kt.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=Vt,a=lr;switch(t){case"any":s=jt;break;case"display":break;case"print":s=Ut;break;default:Oe("getRenderingIntent - invalid intent: ".concat(t))}switch(e){case Kt.DISABLE:s+=Xt;break;case Kt.ENABLE:break;case Kt.ENABLE_FORMS:s+=Gt;break;case Kt.ENABLE_STORAGE:s+=qt;a=(s&Ut&&i instanceof gr?i:this.annotationStorage).serializable;break;default:Oe("getRenderingIntent - invalid annotationMode: ".concat(e))}return n&&(s+=Yt),{renderingIntent:s,cacheKey:"".concat(s,"_").concat(a.hash),annotationStorageSerializable:a}}destroy(){var t;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null===(t=At(bc,this))||void 0===t||t.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const n of At(gc,this).values())e.push(n._destroy());At(gc,this).clear(),At(mc,this).clear(),At(vc,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;this.commonObjs.clear(),this.fontLoader.clear(),At(fc,this).clear(),this.filterFactory.destroy(),Sl.cleanup(),null===(t=this._networkStream)||void 0===t||t.cancelAllRequests(new Ke("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(t,e)=>{ze(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():(ze(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",t=>{const i=Promise.withResolvers(),n=this._fullReader;return n.headersReady.then(()=>{if(!n.isStreamingSupported||!n.isRangeSupported){var t;if(this._lastProgress)null===(t=e.onProgress)||void 0===t||t.call(e,this._lastProgress);n.onProgress=t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})}}i.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})},i.reject),i.promise}),t.on("GetRangeReader",(t,e)=>{ze(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():(ze(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 Jl(i,this))}),t.on("DocException",function(t){let i;switch(t.name){case"PasswordException":i=new Ve(t.message,t.code);break;case"InvalidPDFException":i=new Ge(t.message);break;case"MissingPDFException":i=new qe(t.message);break;case"UnexpectedResponseException":i=new Xe(t.message,t.status);break;case"UnknownErrorException":i=new Ue(t.message,t.details);break;default:We("DocException - expected a valid Error.")}e._capability.reject(i)}),t.on("PasswordRequest",t=>{if(Et(bc,this,Promise.withResolvers()),e.onPassword){const n=t=>{t instanceof Error?At(bc,this).reject(t):At(bc,this).resolve({password:t})};try{e.onPassword(n,t.code)}catch(i){At(bc,this).reject(i)}}else At(bc,this).reject(new Ve(t.message,t.code));return At(bc,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;At(gc,this).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",e=>{var i;let[n,s,a]=e;if(this.destroyed)return null;if(this.commonObjs.has(n))return null;switch(s){case"Font":const{disableFontFace:e,fontExtraProperties:r,pdfBug:o}=this._params;if("error"in a){const t=a.error;Oe("Error during font loading: ".concat(t)),this.commonObjs.resolve(n,t);break}const l=o&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,c=new br(a,{disableFontFace:e,inspectFont:l});this.fontLoader.bind(c).catch(()=>t.sendWithPromise("FontFallback",{id:n})).finally(()=>{!r&&c.data&&(c.data=null),this.commonObjs.resolve(n,c)});break;case"CopyLocalImage":const{imageRef:h}=a;ze(h,"The imageRef must be defined.");for(const t of At(gc,this).values())for(const[,e]of t.objs)if((null===e||void 0===e?void 0:e.ref)===h)return e.dataLen?(this.commonObjs.resolve(n,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,a);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 a=At(gc,this).get(i);var r;if(!a.objs.has(e))if(0!==a._intentStates.size)switch(n){case"Image":a.objs.resolve(e,s),(null===s||void 0===s?void 0:s.dataLen)>1e7&&(a._maybeCleanupAfterRender=!0);break;case"Pattern":a.objs.resolve(e,s);break;default:throw new Error("Got unknown object type ".concat(n))}else null===s||void 0===s||null===(r=s.bitmap)||void 0===r||r.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("FetchBuiltInCMap",t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),t.on("FetchStandardFontData",t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t,e;this.annotationStorage.size<=0&&Oe("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=At(mc,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&&At(vc,this).set(i.refStr,t);const n=new ic(e,i,this,this._params.pdfBug);return At(gc,this).set(e,n),n});return At(mc,this).set(e,n),n}getPageIndex(t){return Yl(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(wc,this,Ac).call(this,"GetFieldObjects")}hasJSActions(){return vt(wc,this,Ac).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!==typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return vt(wc,this,Ac).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(wc,this,Ac).call(this,"GetOptionalContentConfig").then(e=>new Io(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=At(fc,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 Eo(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 At(fc,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 At(gc,this).values()){if(!t.cleanup())throw new Error("startCleanup: Page ".concat(t.pageNumber," is currently rendering."))}this.commonObjs.clear(),t||this.fontLoader.clear(),At(fc,this).clear(),this.filterFactory.destroy(!0),Sl.cleanup()}}cachedPageNumber(t){var e;if(!Yl(t))return null;const i=0===t.gen?"".concat(t.num,"R"):"".concat(t.num,"R").concat(t.gen);return null!==(e=At(vc,this).get(i))&&void 0!==e?e:null}}function Ac(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=At(fc,this).get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return At(fc,this).set(t,n),n}const Ec=Symbol("INITIAL_DATA");var xc=new WeakMap,_c=new WeakSet;class kc{constructor(){mt(this,_c),yt(this,xc,Object.create(null))}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=vt(_c,this,Cc).call(this,t);return i.promise.then(()=>e(i.data)),null}const i=At(xc,this)[t];if(!i||i.data===Ec)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}has(t){const e=At(xc,this)[t];return!!e&&e.data!==Ec}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=vt(_c,this,Cc).call(this,t);i.data=e,i.resolve()}clear(){for(const e in At(xc,this)){var t;const{data:i}=At(xc,this)[e];null===i||void 0===i||null===(t=i.bitmap)||void 0===t||t.close()}Et(xc,this,Object.create(null))}*[Symbol.iterator](){for(const t in At(xc,this)){const{data:e}=At(xc,this)[t];e!==Ec&&(yield[t,e])}}}function Cc(t){var e;return(e=At(xc,this))[t]||(e[t]=(0,ut.A)((0,ut.A)({},Promise.withResolvers()),{},{data:Ec}))}var Mc=new WeakMap;class Sc{constructor(t){yt(this,Mc,null),Et(Mc,this,t),this.onContinue=null}get promise(){return At(Mc,this).capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;At(Mc,this).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=At(Mc,this).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=At(Mc,this);return t.form||t.canvas&&(null===e||void 0===e?void 0:e.size)>0}}var Lc=new WeakMap;class Tc{constructor(t){let{callback:e,params:i,objs:n,commonObjs:s,annotationCanvasMap:a,operatorList:r,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:u=null}=t;yt(this,Lc,null),this.callback=e,this.params=i,this.objs=n,this.commonObjs=s,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=r,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 Sc(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.canvasContext.canvas}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(Rc._.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.");Rc._.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{canvasContext:a,viewport:r,transform:o,background:l}=this.params;this.gfx=new Zr(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:s},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:r,transparency:n,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,null===(i=this.graphicsReadyCallback)||void 0===i||i.call(this)}cancel(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=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(),At(Lc,this)&&(window.cancelAnimationFrame(At(Lc,this)),Et(Lc,this,null)),Rc._.delete(this._canvas),this.callback(e||new Yi("Rendering cancelled, page ".concat(this._pageIndex+1),i))}operatorListChanged(){var t;this.graphicsReady?(null===(t=this.stepper)||void 0===t||t.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?Et(Lc,this,window.requestAnimationFrame(()=>{Et(Lc,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.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),Rc._.delete(this._canvas),this.callback())))}}var Rc={_:new WeakSet};const Fc="4.4.168",Pc="19fbc8998";function Ic(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function Nc(t){return Math.max(0,Math.min(255,255*t))}class Dc{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=Nc(e),[e,e,e]}static G_HTML(t){let[e]=t;const i=Ic(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(Nc)}static RGB_HTML(t){return"#".concat(t.map(Ic).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[Nc(1-Math.min(1,e+s)),Nc(1-Math.min(1,n+s)),Nc(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,a=1-i,r=1-n;return["CMYK",s,a,r,Math.min(s,a,r)]}}class Oc{static setupStorage(t,e,i,n,s){const a=n.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==a.value&&(t.textContent=a.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(a.value===i.attributes.xfaOn?t.setAttribute("checked",!0):a.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!==a.value&&t.setAttribute("value",a.value),"print"===s)break;t.addEventListener("input",t=>{n.setValue(e,{value:t.target.value})})}break;case"select":if(null!==a.value){t.setAttribute("value",a.value);for(const t of i.children)t.attributes.value===a.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:a}=t;const{attributes:r}=i,o=e instanceof HTMLAnchorElement;"radio"===r.type&&(r.name="".concat(r.name,"-").concat(s));for(const[l,c]of Object.entries(r))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&&a.addLinkAttributes(e,r.href,r.newWindow),n&&r.dataId&&this.setupStorage(e,r.dataId,i,n)}static render(t){const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,s=t.intent||"display",a=document.createElement(n.name);n.attributes&&this.setAttributes({html:a,element:n,intent:s,linkService:i});const r="richText"!==s,o=t.div;if(o.append(a),t.viewport){const e="matrix(".concat(t.viewport.transform.join(","),")");o.style.transform=e}r&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const t=document.createTextNode(n.value);a.append(t),r&&Hl.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const c=[[n,-1,a]];for(;c.length>0;){var h,d;const[t,n,a]=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),a.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(a.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);r&&Hl.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 Wc=1e3,zc=new WeakSet;function Bc(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class Hc{static create(t){switch(t.data.annotationType){case oe:return new Kc(t);case re:return new $c(t);case xe:switch(t.data.fieldType){case"Tx":return new eh(t);case"Btn":return t.data.radioButton?new sh(t):t.data.checkBox?new nh(t):new ah(t);case"Ch":return new rh(t);case"Sig":return new ih(t)}return new th(t);case Ae:return new oh(t);case le:return new Wh(t);case ce:return new Bh(t);case he:return new jh(t);case de:return new Uh(t);case pe:return new qh(t);case we:return new Yh(t);case ye:return new Qh(t);case ue:return new Xh(t);case fe:return new Zh(t);case ge:return new Jh(t);case me:return new $h(t);case ve:return new td(t);case be:return new ed(t);case Ee:return new sd(t);default:return new qc(t)}}}var jc=new WeakMap,Vc=new WeakMap,Uc=new WeakMap,Gc=new WeakSet;class qc{constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};mt(this,Gc),yt(this,jc,null),yt(this,Vc,!1),yt(this,Uc,null),this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData(t){let{titleObj:e,contentsObj:i,richText:n}=t;return!!(null!==e&&void 0!==e&&e.str||null!==i&&void 0!==i&&i.str||null!==n&&void 0!==n&&n.str)}get hasPopupData(){return qc._hasPopupData(this.data)}updateEdited(t){var e;if(!this.container)return;At(jc,this)||Et(jc,this,{rect:this.data.rect.slice(0)});const{rect:i}=t;i&&vt(Gc,this,Xc).call(this,i),null===(e=At(Uc,this))||void 0===e||e.popup.updateEdited(t)}resetEdited(){var t;At(jc,this)&&(vt(Gc,this,Xc).call(this,At(jc,this).rect),null===(t=At(Uc,this))||void 0===t||t.popup.resetEdited(),Et(jc,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 th||(s.tabIndex=Wc);const{style:a}=s;if(a.zIndex=this.parent.zIndex++,e.popupRef&&s.setAttribute("aria-haspopup","dialog"),e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof oh){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,s),s}const{width:r,height:o}=Bc(e.rect);if(!t&&e.borderStyle.width>0){a.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(--scale-factor)) / calc(").concat(i,"px * var(--scale-factor))");a.borderRadius=e}else if(this instanceof sh){const t="calc(".concat(r,"px * var(--scale-factor)) / calc(").concat(o,"px * var(--scale-factor))");a.borderRadius=t}switch(e.borderStyle.style){case _e:a.borderStyle="solid";break;case ke:a.borderStyle="dashed";break;case Ce:Oe("Unimplemented border style: beveled");break;case Me:Oe("Unimplemented border style: inset");break;case Se:a.borderBottomStyle="solid"}const n=e.borderColor||null;n?(Et(Vc,this,!0),a.borderColor=ei.makeHexColor(0|n[0],0|n[1],0|n[2])):a.borderWidth=0}const l=ei.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;a.left="".concat(100*(l[0]-d)/c,"%"),a.top="".concat(100*(l[1]-u)/h,"%");const{rotation:p}=e;return e.hasOwnCanvas||0===p?(a.width="".concat(100*r/c,"%"),a.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,{width:s,height:a}=Bc(this.data.rect);let r,o;t%180===0?(r=100*s/i,o=100*a/n):(r=100*a/i,o=100*s/n),e.style.width="".concat(r,"%"),e.style.height="".concat(o,"%"),e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,i)=>{const n=i.detail[t],s=n[0],a=n.slice(1);i.target.style[e]=Dc["".concat(s,"_HTML")](a),this.annotationStorage.setValue(this.data.id,{[e]:Dc["".concat(s,"_rgb")](a)})};return He(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 a=i[n];if(a){a({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[a,r,o,l]=t.subarray(2,6);if(n===a&&s===r&&e===o&&i===l)return}const{style:a}=this.container;let r;if(At(Vc,this)){const{borderColor:t,borderWidth:e}=a;a.borderWidth=0,r=["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);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 g=2,m=t.length;g<m;g+=8){var f;const i=t[g],n=t[g+1],a=t[g+2],h=t[g+3],d=c.createElement("rect"),p=(a-e)/o,m=(s-n)/l,v=(i-a)/o,b=(n-h)/l;d.setAttribute("x",p),d.setAttribute("y",m),d.setAttribute("width",v),d.setAttribute("height",b),u.append(d),null===(f=r)||void 0===f||f.push('<rect vector-effect="non-scaling-stroke" x="'.concat(p,'" y="').concat(m,'" width="').concat(v,'" height="').concat(b,'"/>'))}At(Vc,this)&&(r.push("</g></svg>')"),a.backgroundImage=r.join("")),this.container.append(h),this.container.style.clipPath="url(#".concat(p,")")}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const i=Et(Uc,this,new oh({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_".concat(e.id),rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(i.render())}render(){We("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:a}of n){if(-1===t)continue;if(s===e)continue;const n="string"===typeof a?a:null,r=document.querySelector('[data-element-id="'.concat(s,'"]'));!r||zc.has(r)?i.push({id:s,exportValue:n,domElement:r}):Oe("_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&&(zc.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")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{var i;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})})}}function Xc(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:a,pageX:r,pageY:o}}}}=this;null===i||void 0===i||i.splice(0,4,...t);const{width:l,height:c}=Bc(t);e.left="".concat(100*(t[0]-r)/s,"%"),e.top="".concat(100*(a-t[3]+o)/a,"%"),0===n?(e.width="".concat(100*l/s,"%"),e.height="".concat(100*c/a,"%")):this.setRotation(n)}var Yc=new WeakSet;class Kc extends qc{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}),mt(this,Yc),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let n=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),n=!0):t.action?(this._bindNamedAction(i,t.action),n=!0):t.attachment?(vt(Yc,this,Zc).call(this,i,t.attachment,t.attachmentDest),n=!0):t.setOCGState?(vt(Yc,this,Jc).call(this,i,t.setOCGState),n=!0):t.dest?(this._bindLink(i,t.dest),n=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),n=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(i),this.container}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&vt(Yc,this,Qc).call(this)}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),vt(Yc,this,Qc).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})}t.onclick||(t.onclick=()=>!1),vt(Yc,this,Qc).call(this)}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),vt(Yc,this,Qc).call(this),!this._fieldObjects)return Oe('_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,a=[];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&&a.push(i)}else for(const e of Object.values(this._fieldObjects))a.push(...e);const r=this.annotationStorage,o=[];for(const e of a){const{id:t}=e;switch(o.push(t),e.type){case"text":{const i=e.defaultValue||"";r.setValue(t,{value:i});break}case"checkbox":case"radiobutton":{const i=e.defaultValue===e.exportValues;r.setValue(t,{value:i});break}case"combobox":case"listbox":{const i=e.defaultValue||"";r.setValue(t,{value:i});break}default:continue}const i=document.querySelector('[data-element-id="'.concat(t,'"]'));i&&(zc.has(i)?i.dispatchEvent(new Event("resetform")):Oe("_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 Qc(){this.container.setAttribute("data-internal-link","")}function Zc(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>{var t;return null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(e.content,e.filename,i),!1},vt(Yc,this,Qc).call(this)}function Jc(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),vt(Yc,this,Qc).call(this)}class $c extends qc{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 th extends qc{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 $e.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 a;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===(a=this.linkService.eventBus)||void 0===a||a.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,a,r;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!==(a=this.data.actions)&&void 0!==a&&a.Blur?"Blur"!==l||null!==(r=this.data.actions)&&void 0!==r&&r.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":ei.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 a;const r=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(Ht*n))||1);a=Math.min(n,r(e/Ht))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(n,r(t/Ht))}s.fontSize="calc(".concat(a,"px * var(--scale-factor))"),s.color=ei.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 eh extends th{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 a of this._getElementsByName(t.name,t.id))a.domElement&&(a.domElement[e]=i),s.setValue(a.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 a=t.getValue(e,{value:this.data.fieldValue});let r=a.value||"";const o=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;o&&r.length>o&&(r=r.slice(0,o));let l=a.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:r,formattedValue:l,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=null!==l&&void 0!==l?l:r,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",null!==l&&void 0!==l?l:r),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),zc.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=Wc,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 h=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;c.userValue&&(i.value=c.userValue),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:"",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),t.setValue(e,{formattedValue:n})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{var n;const{charLimit:s}=i.detail,{target:a}=i;if(0===s)return void a.removeAttribute("maxLength");a.setAttribute("maxLength",s);let r=c.userValue;!r||r.length<=s||(r=r.slice(0,s),a.value=c.userValue=r,t.setValue(e,{value:r}),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:a.selectionStart,selEnd:a.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=h;h=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{value:s}=t.target;var a;(c.userValue=s,c.lastCommittedValue!==s)&&(null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,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:a,selectionStart:r,selectionEnd:o}=s;let l=r,h=o;switch(t.inputType){case"deleteWordBackward":{const t=a.substring(0,r).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=a.substring(r).match(/^[^\w]*\w*/);t&&(h+=t[0].length);break}case"deleteContentBackward":r===o&&(l-=1);break;case"deleteContentForward":r===o&&(h+=1)}t.preventDefault(),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,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(h&&i.addEventListener("blur",h),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(--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 ih extends th{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class nh extends th{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 zc.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=Wc,s.addEventListener("change",n=>{const{name:s,checked:a}=n.target;for(const r of this._getElementsByName(s,i)){const i=a&&r.exportValue===e.exportValue;r.domElement&&(r.domElement.checked=i),t.setValue(r.id,{value:i})}t.setValue(i,{value:a})}),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 sh extends th{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 a of this._getElementsByName(e.fieldName,i))t.setValue(a.id,{value:!1});const s=document.createElement("input");if(zc.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=Wc,s.addEventListener("change",e=>{const{name:n,checked:s}=e.target;for(const a of this._getElementsByName(n,i))t.setValue(a.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 ah extends Kc{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 rh extends th{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");zc.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=Wc;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 a=null;if(s){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),n.prepend(t),a=()=>{t.remove(),n.removeEventListener("input",a),a=null},n.addEventListener("input",a)}const r=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=r(!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=a)||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:r(!0)}),o=r(!1)},multipleSelection(t){n.multiple=!0},remove(i){const s=n.options,a=i.detail.remove;if(s[a].selected=!1,n.remove(a),s.length>0){-1===Array.prototype.findIndex.call(s,t=>t.selected)&&(s[0].selected=!0)}t.setValue(e,{value:r(!0),items:l(i)}),o=r(!1)},clear(i){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]}),o=r(!1)},insert(i){const{index:s,displayValue:a,exportValue:c}=i.detail.insert,h=n.children[s],d=document.createElement("option");d.textContent=a,d.value=c,h?h.before(d):n.append(d),t.setValue(e,{value:r(!0),items:l(i)}),o=r(!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:r(!0),items:l(i)}),o=r(!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:r(!0)}),o=r(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(s,i)}),n.addEventListener("input",i=>{var n;const s=r(!0),a=r(!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:a,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:r(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class oh extends qc{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:qc._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new Sh({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(const i of this.elements)i.popup=t,e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map(t=>"".concat(oi).concat(t)).join(",")),this.container}}var lh=new WeakMap,ch=new WeakMap,hh=new WeakMap,dh=new WeakMap,uh=new WeakMap,ph=new WeakMap,fh=new WeakMap,gh=new WeakMap,mh=new WeakMap,vh=new WeakMap,bh=new WeakMap,wh=new WeakMap,yh=new WeakMap,Ah=new WeakMap,Eh=new WeakMap,xh=new WeakMap,_h=new WeakMap,kh=new WeakMap,Ch=new WeakMap,Mh=new WeakSet;class Sh{constructor(t){let{container:e,color:i,elements:n,titleObj:s,modificationDate:a,contentsObj:r,richText:o,parent:l,rect:c,parentRect:h,open:d}=t;mt(this,Mh),yt(this,lh,vt(Mh,this,Ph).bind(this)),yt(this,ch,vt(Mh,this,Oh).bind(this)),yt(this,hh,vt(Mh,this,Dh).bind(this)),yt(this,dh,vt(Mh,this,Nh).bind(this)),yt(this,uh,null),yt(this,ph,null),yt(this,fh,null),yt(this,gh,null),yt(this,mh,null),yt(this,vh,null),yt(this,bh,null),yt(this,wh,!1),yt(this,yh,null),yt(this,Ah,null),yt(this,Eh,null),yt(this,xh,null),yt(this,_h,null),yt(this,kh,null),yt(this,Ch,!1),Et(ph,this,e),Et(_h,this,s),Et(fh,this,r),Et(xh,this,o),Et(vh,this,l),Et(uh,this,i),Et(Eh,this,c),Et(bh,this,h),Et(mh,this,n),Et(gh,this,an.toDateObject(a)),this.trigger=n.flatMap(t=>t.getElementsToTriggerPopup());for(const p of this.trigger)p.addEventListener("click",At(dh,this)),p.addEventListener("mouseenter",At(hh,this)),p.addEventListener("mouseleave",At(ch,this)),p.classList.add("popupTriggerArea");for(const p of n){var u;null===(u=p.container)||void 0===u||u.addEventListener("keydown",At(lh,this))}At(ph,this).hidden=!0,d&&vt(Mh,this,Nh).call(this)}render(){if(At(yh,this))return;const t=Et(yh,this,document.createElement("div"));if(t.className="popup",At(uh,this)){const e=t.style.outlineColor=ei.makeHexColor(...At(uh,this));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))t.style.backgroundColor="color-mix(in srgb, ".concat(e," 30%, white)");else{const e=.7;t.style.backgroundColor=ei.makeHexColor(...At(uh,this).map(t=>Math.floor(e*(255-t)+t)))}}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),({dir:i.dir,str:i.textContent}=At(_h,this)),t.append(e),At(gh,this)){const t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),t.setAttribute("data-l10n-args",JSON.stringify({date:At(gh,this).toLocaleDateString(),time:At(gh,this).toLocaleTimeString()})),e.append(t)}const n=bt(Mh,this,Lh);if(n)Oc.render({xfaHtml:n,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const e=this._formatContents(At(fh,this));t.append(e)}At(ph,this).append(t)}_formatContents(t){let{str:e,dir:i}=t;const n=document.createElement("p");n.classList.add("popupContent"),n.dir=i;const s=e.split(/(?:\r\n?|\n)/);for(let a=0,r=s.length;a<r;++a){const t=s[a];n.append(document.createTextNode(t)),a<r-1&&n.append(document.createElement("br"))}return n}updateEdited(t){var e;let{rect:i,popupContent:n}=t;At(kh,this)||Et(kh,this,{contentsObj:At(fh,this),richText:At(xh,this)}),i&&Et(Ah,this,null),n&&(Et(xh,this,vt(Mh,this,Fh).call(this,n)),Et(fh,this,null)),null===(e=At(yh,this))||void 0===e||e.remove(),Et(yh,this,null)}resetEdited(){var t;At(kh,this)&&(({contentsObj:pt(Et,[fh,this])._,richText:pt(Et,[xh,this])._}=At(kh,this)),Et(kh,this,null),null===(t=At(yh,this))||void 0===t||t.remove(),Et(yh,this,null),Et(Ah,this,null))}forceHide(){Et(Ch,this,this.isVisible),At(Ch,this)&&(At(ph,this).hidden=!0)}maybeShow(){At(Ch,this)&&(At(yh,this)||vt(Mh,this,Dh).call(this),Et(Ch,this,!1),At(ph,this).hidden=!1)}get isVisible(){return!1===At(ph,this).hidden}}function Lh(t){const e=At(xh,t),i=At(fh,t);return null===e||void 0===e||!e.str||null!==i&&void 0!==i&&i.str&&i.str!==e.str?null:At(xh,t).html||null}function Th(t){var e;return(null===(e=bt(Mh,t,Lh))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.fontSize)||0}function Rh(t){var e;return(null===(e=bt(Mh,t,Lh))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.color)||null}function Fh(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:bt(Mh,this,Rh),fontSize:bt(Mh,this,Th)?"calc(".concat(bt(Mh,this,Th),"px * var(--scale-factor))"):""}};for(const s of t.split("\n"))e.push({name:"span",value:s,attributes:n});return i}function Ph(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&At(wh,this))&&vt(Mh,this,Nh).call(this)}function Ih(){if(null!==At(Ah,this))return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:s}}}=At(vh,this);let a=!!At(bh,this),r=At(a?bh:Eh,this);for(const u of At(mh,this))if(!r||null!==ei.intersect(u.data.rect,r)){r=u.data.rect,a=!0;break}const o=ei.normalizeRect([r[0],t[3]-r[1]+t[1],r[2],t[3]-r[3]+t[1]]),l=a?r[2]-r[0]+5:0,c=o[0]+l,h=o[1];Et(Ah,this,[100*(c-n)/e,100*(h-s)/i]);const{style:d}=At(ph,this);d.left="".concat(At(Ah,this)[0],"%"),d.top="".concat(At(Ah,this)[1],"%")}function Nh(){Et(wh,this,!At(wh,this)),At(wh,this)?(vt(Mh,this,Dh).call(this),At(ph,this).addEventListener("click",At(dh,this)),At(ph,this).addEventListener("keydown",At(lh,this))):(vt(Mh,this,Oh).call(this),At(ph,this).removeEventListener("click",At(dh,this)),At(ph,this).removeEventListener("keydown",At(lh,this)))}function Dh(){At(yh,this)||this.render(),this.isVisible?At(wh,this)&&At(ph,this).classList.add("focused"):(vt(Mh,this,Ih).call(this),At(ph,this).hidden=!1,At(ph,this).style.zIndex=parseInt(At(ph,this).style.zIndex)+1e3)}function Oh(){At(ph,this).classList.remove("focused"),!At(wh,this)&&this.isVisible&&(At(ph,this).hidden=!0,At(ph,this).style.zIndex=parseInt(At(ph,this).style.zIndex)-1e3)}class Wh extends qc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Qt.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}var zh=new WeakMap;class Bh extends qc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),yt(this,zh,null)}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:i}=Bc(t.rect),n=this.svgFactory.create(e,i,!0),s=Et(zh,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 At(zh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Hh=new WeakMap;class jh extends qc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),yt(this,Hh,null)}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:i}=Bc(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,a=Et(Hh,this,this.svgFactory.createElement("svg:rect"));return a.setAttribute("x",s/2),a.setAttribute("y",s/2),a.setAttribute("width",e-s),a.setAttribute("height",i-s),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),n.append(a),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return At(Hh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Vh=new WeakMap;class Uh extends qc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),yt(this,Vh,null)}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:i}=Bc(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,a=Et(Vh,this,this.svgFactory.createElement("svg:ellipse"));return a.setAttribute("cx",e/2),a.setAttribute("cy",i/2),a.setAttribute("rx",e/2-s/2),a.setAttribute("ry",i/2-s/2),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),n.append(a),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return At(Vh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Gh=new WeakMap;class qh extends qc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),yt(this,Gh,null),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:i,popupRef:n}}=this;if(!e)return this.container;const{width:s,height:a}=Bc(t),r=this.svgFactory.create(s,a,!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=Et(Gh,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"),r.append(l),this.container.append(r),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return At(Gh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class Xh extends qh{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Yh extends qc{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 Kh=new WeakMap;class Qh extends qc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),yt(this,Kh,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=Qt.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:e,borderStyle:i,popupRef:n}}=this,{width:s,height:a}=Bc(t),r=this.svgFactory.create(s,a,!0);for(const o of e){let e=[];for(let i=0,n=o.length;i<n;i+=2){const n=o[i]-t[0],s=t[3]-o[i+1];e.push("".concat(n,",").concat(s))}e=e.join(" ");const s=this.svgFactory.createElement(this.svgElementName);At(Kh,this).push(s),s.setAttribute("points",e),s.setAttribute("stroke-width",i.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),!n&&this.hasPopupData&&this._createPopup(),r.append(s)}return this.container.append(r),this.container}getElementsToTriggerPopup(){return At(Kh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class Zh extends qc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class Jh extends qc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class $h extends qc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class td extends qc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class ed extends qc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var id=new WeakMap,nd=new WeakSet;class sd extends qc{constructor(t){var e;super(t,{isRenderable:!0}),mt(this,nd),yt(this,id,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,ut.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(nd,this,ad).bind(this)),Et(id,this,i);const{isMac:n}=$e.platform;return t.addEventListener("keydown",t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&vt(nd,this,ad).call(this)}),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return At(id,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function ad(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.content,this.filename)}var rd=new WeakMap,od=new WeakMap,ld=new WeakMap,cd=new WeakSet;class hd{constructor(t){let{div:e,accessibilityManager:i,annotationCanvasMap:n,annotationEditorUIManager:s,page:a,viewport:r}=t;mt(this,cd),yt(this,rd,null),yt(this,od,null),yt(this,ld,new Map),this.div=e,Et(rd,this,i),Et(od,this,n),this.page=a,this.viewport=r,this.zIndex=0,this._annotationEditorUIManager=s}async render(t){const{annotations:e}=t,i=this.div;hn(i,this.viewport);const n=new Map,s={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new qi,annotationStorage:t.annotationStorage||new ur,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const r of e){if(r.noHTML)continue;const t=r.annotationType===Ae;if(t){const t=n.get(r.id);if(!t)continue;s.elements=t}else{const{width:t,height:e}=Bc(r.rect);if(t<=0||e<=0)continue}s.data=r;const e=Hc.create(s);if(!e.isRenderable)continue;if(!t&&r.popupRef){const t=n.get(r.popupRef);t?t.push(e):n.set(r.popupRef,[e])}const i=e.render();var a;if(r.hidden&&(i.style.visibility="hidden"),vt(cd,this,dd).call(this,i,r.id),e.annotationEditorType>0)At(ld,this).set(e.data.id,e),null===(a=this._annotationEditorUIManager)||void 0===a||a.renderAnnotationElement(e)}vt(cd,this,ud).call(this)}update(t){let{viewport:e}=t;const i=this.div;this.viewport=e,hn(i,{rotation:e.rotation}),vt(cd,this,ud).call(this),i.hidden=!1}getEditableAnnotations(){return Array.from(At(ld,this).values())}getEditableAnnotation(t){return At(ld,this).get(t)}}function dd(t,e){var i;const n=t.firstChild||t;n.id="".concat(oi).concat(e),this.div.append(t),null===(i=At(rd,this))||void 0===i||i.moveElementInDOM(this.div,t,n,!1)}function ud(){if(!At(od,this))return;const t=this.div;for(const[e,i]of At(od,this)){const n=t.querySelector('[data-annotation-id="'.concat(e,'"]'));if(!n)continue;i.className="annotationContent";const{firstChild:s}=n;s?"CANVAS"===s.nodeName?s.replaceWith(i):s.classList.contains("annotationContent")?s.after(i):s.before(i):n.append(i)}At(od,this).clear()}const pd=/\r\n?|\n/g;var fd=new WeakMap,gd=new WeakMap,md=new WeakMap,vd=new WeakMap,bd=new WeakMap,wd=new WeakMap,yd=new WeakMap,Ad=new WeakMap,Ed=new WeakMap,xd=new WeakMap,_d=new WeakSet;class kd extends ja{static get _keyboardManager(){const t=kd.prototype,e=t=>t.isEmpty(),i=js.TRANSLATE_SMALL,n=js.TRANSLATE_BIG;return He(this,"_keyboardManager",new qn([[["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,ut.A)((0,ut.A)({},t),{},{name:"freeTextEditor"})),mt(this,_d),yt(this,fd,this.editorDivBlur.bind(this)),yt(this,gd,this.editorDivFocus.bind(this)),yt(this,md,this.editorDivInput.bind(this)),yt(this,vd,this.editorDivKeydown.bind(this)),yt(this,bd,this.editorDivPaste.bind(this)),yt(this,wd,void 0),yt(this,yd,""),yt(this,Ad,"".concat(this.id,"-editor")),yt(this,Ed,void 0),yt(this,xd,null),Et(wd,this,t.color||kd._defaultColor||ja._defaultLineColor),Et(Ed,this,t.fontSize||kd._defaultFontSize)}static initialize(t,e){ja.initialize(t,e,{strings:["pdfjs-free-text-default-content"]});const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case Zt.FREETEXT_SIZE:kd._defaultFontSize=e;break;case Zt.FREETEXT_COLOR:kd._defaultColor=e}}updateParams(t,e){switch(t){case Zt.FREETEXT_SIZE:vt(_d,this,Cd).call(this,e);break;case Zt.FREETEXT_COLOR:vt(_d,this,Md).call(this,e)}}static get defaultPropertiesToUpdate(){return[[Zt.FREETEXT_SIZE,kd._defaultFontSize],[Zt.FREETEXT_COLOR,kd._defaultColor||ja._defaultLineColor]]}get propertiesToUpdate(){return[[Zt.FREETEXT_SIZE,At(Ed,this)],[Zt.FREETEXT_COLOR,At(wd,this)]]}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-kd._internalPadding*t,-(kd._internalPadding+At(Ed,this))*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(Qt.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant");const t=this._uiManager._signal;this.editorDiv.addEventListener("keydown",At(vd,this),{signal:t}),this.editorDiv.addEventListener("focus",At(gd,this),{signal:t}),this.editorDiv.addEventListener("blur",At(fd,this),{signal:t}),this.editorDiv.addEventListener("input",At(md,this),{signal:t}),this.editorDiv.addEventListener("paste",At(bd,this),{signal:t})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",At(Ad,this)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",At(vd,this)),this.editorDiv.removeEventListener("focus",At(gd,this)),this.editorDiv.removeEventListener("blur",At(fd,this)),this.editorDiv.removeEventListener("input",At(md,this)),this.editorDiv.removeEventListener("paste",At(bd,this)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var t;this.width||(this.enableEditMode(),this.editorDiv.focus(),null!==(t=this._initialOptions)&&void 0!==t&&t.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=At(yd,this),e=Et(yd,this,vt(_d,this,Sd).call(this).trimEnd());if(t===e)return;const i=t=>{Et(yd,this,t),t?(vt(_d,this,Rd).call(this),this._uiManager.rebuild(this),vt(_d,this,Ld).call(this)):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),vt(_d,this,Ld).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){kd._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",At(Ad,this)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),ja._l10nPromise.get("pdfjs-free-text-default-content").then(t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("default-content",t)}),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize="calc(".concat(At(Ed,this),"px * var(--scale-factor))"),i.color=At(wd,this),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),Rn(this,this.div,["dblclick","keydown"]),this.width){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:s}=At(xd,this);let[a,r]=this.getInitialTranslation();[a,r]=this.pageTranslationToScreen(a,r);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,[a,r]=[r,-a];break;case 180:d=t-this.width+(s[0]-c)/o,u=e-(s[1]-h)/l,[a,r]=[-a,-r];break;case 270:d=t+(s[0]-c-this.height*l)/o,u=e+(s[1]-h-this.width*o)/l,[a,r]=[-r,a]}this.setAt(d*i,u*n,a,r)}else this.setAt(t*i,e*n,this.width*i,this.height*n);vt(_d,this,Rd).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=Pd.call(kd,e.getData("text")||"").replaceAll(pd,"\n");if(!n)return;const s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();const a=s.getRangeAt(0);if(!n.includes("\n"))return a.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void s.collapseToStart();const{startContainer:r,startOffset:o}=a,l=[],c=[];if(r.nodeType===Node.TEXT_NODE){const t=r.parentElement;if(c.push(r.nodeValue.slice(o).replaceAll(pd,"")),t!==this.editorDiv){let e=l;for(const i of this.editorDiv.childNodes)i!==t?e.push(Td.call(kd,i)):e=c}l.push(r.nodeValue.slice(0,o).replaceAll(pd,""))}else if(r===this.editorDiv){let t=l,e=0;for(const i of this.editorDiv.childNodes)e++===o&&(t=c),t.push(Td.call(kd,i))}Et(yd,this,"".concat(l.join("\n")).concat(n).concat(c.join("\n"))),vt(_d,this,Rd).call(this);const h=new Range;let d=l.reduce((t,e)=>t+e.length,0);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}static deserialize(t,e,i){let n=null;if(t instanceof Wh){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:s,rotation:a,id:r},textContent:o,textPosition:l,parent:{page:{pageNumber:c}}}=t;if(!o||0===o.length)return null;n=t={annotationType:Qt.FREETEXT,color:Array.from(i),fontSize:e,value:o.join("\n"),position:l,pageIndex:c-1,rect:s.slice(0),rotation:a,id:r,deleted:!1}}const s=super.deserialize(t,e,i);return Et(Ed,s,t.fontSize),Et(wd,s,ei.makeHexColor(...t.color)),Et(yd,s,Pd.call(kd,t.value)),s.annotationElementId=t.id||null,Et(xd,s,n),s}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const e=kd._internalPadding*this.parentScale,i=this.getRect(e,e),n=ja._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:At(wd,this)),s={annotationType:Qt.FREETEXT,color:n,fontSize:At(Ed,this),value:vt(_d,this,Fd).call(this),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?s:this.annotationElementId&&!vt(_d,this,Id).call(this,s)?null:(s.id=this.annotationElementId,s)}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(this.deleted)return e;const{style:i}=e;i.fontSize="calc(".concat(At(Ed,this),"px * var(--scale-factor))"),i.color=At(wd,this),e.replaceChildren();for(const s of At(yd,this).split("\n")){const t=document.createElement("div");t.append(s?document.createTextNode(s):document.createElement("br")),e.append(t)}const n=kd._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(n,n),popupContent:At(yd,this)}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}function Cd(t){const e=t=>{this.editorDiv.style.fontSize="calc(".concat(t,"px * var(--scale-factor))"),this.translate(0,-(t-At(Ed,this))*this.parentScale),Et(Ed,this,t),vt(_d,this,Ld).call(this)},i=At(Ed,this);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Zt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function Md(t){const e=t=>{Et(wd,this,this.editorDiv.style.color=t)},i=At(wd,this);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Zt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function Sd(){const t=[];this.editorDiv.normalize();for(const e of this.editorDiv.childNodes)t.push(Td.call(Tt,e));return t.join("\n")}function Ld(){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 Td(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(pd,"")}function Rd(){if(this.editorDiv.replaceChildren(),At(yd,this))for(const t of At(yd,this).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}function Fd(){return At(yd,this).replaceAll("\xa0"," ")}function Pd(t){return t.replaceAll(" ","\xa0")}function Id(t){const{value:e,fontSize:i,color:n,pageIndex:s}=At(xd,this);return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some((t,e)=>t!==n[e])||t.pageIndex!==s}Tt=kd,(0,wt.A)(kd,"_freeTextDefaultContent",""),(0,wt.A)(kd,"_internalPadding",0),(0,wt.A)(kd,"_defaultColor",null),(0,wt.A)(kd,"_defaultFontSize",10),(0,wt.A)(kd,"_type","freetext"),(0,wt.A)(kd,"_editorType",Qt.FREETEXT);var Nd=new WeakMap,Dd=new WeakMap,Od=new WeakMap,Wd=new WeakSet;class zd{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];mt(this,Wd),yt(this,Nd,void 0),yt(this,Dd,[]),yt(this,Od,[]);let s=1/0,a=-1/0,r=1/0,o=-1/0;const l=10**-4;for(const{x:g,y:m,width:v,height:b}of t){const t=Math.floor((g-e)/l)*l,i=Math.ceil((g+v+e)/l)*l,n=Math.floor((m-e)/l)*l,c=Math.ceil((m+b+e)/l)*l,h=[t,n,c,!0],d=[i,n,c,!1];At(Dd,this).push(h,d),s=Math.min(s,t),a=Math.max(a,i),r=Math.min(r,n),o=Math.max(o,c)}const c=a-s+2*i,h=o-r+2*i,d=s-i,u=r-i,p=At(Dd,this).at(n?-1:-2),f=[p[0],p[2]];for(const g of At(Dd,this)){const[t,e,i]=g;g[0]=(t-d)/c,g[1]=(e-u)/h,g[2]=(i-u)/h}Et(Nd,this,{x:d,y:u,width:c,height:h,lastPoint:f})}getOutlines(){At(Dd,this).sort((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const t=[];for(const e of At(Dd,this))e[3]?(t.push(...vt(Wd,this,Ud).call(this,e)),vt(Wd,this,jd).call(this,e)):(vt(Wd,this,Vd).call(this,e),t.push(...vt(Wd,this,Ud).call(this,e)));return vt(Wd,this,Bd).call(this,t)}}function Bd(t){const e=[],i=new Set;for(const a of t){const[t,i,n]=a;e.push([t,i,a],[t,n,a])}e.sort((t,e)=>t[1]-e[1]||t[0]-e[0]);for(let a=0,r=e.length;a<r;a+=2){const t=e[a][2],n=e[a+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,a,r,o,l]=t;i.delete(t);let c=e,h=a;for(s=[e,r],n.push(s);;){let t;if(i.has(o))t=o;else{if(!i.has(l))break;t=l}i.delete(t),[e,a,r,o,l]=t,c!==e&&(s.push(c,h,e,h===a?a:r),c=e),h=h===a?r:a}s.push(c,h)}return new Yd(n,At(Nd,this))}function Hd(t){const e=At(Od,this);let i=0,n=e.length-1;for(;i<=n;){const s=i+n>>1,a=e[s][0];if(a===t)return s;a<t?i=s+1:n=s-1}return n+1}function jd(t){let[,e,i]=t;const n=vt(Wd,this,Hd).call(this,e);At(Od,this).splice(n,0,[e,i])}function Vd(t){let[,e,i]=t;const n=vt(Wd,this,Hd).call(this,e);for(let s=n;s<At(Od,this).length;s++){const[t,n]=At(Od,this)[s];if(t!==e)break;if(t===e&&n===i)return void At(Od,this).splice(s,1)}for(let s=n-1;s>=0;s--){const[t,n]=At(Od,this)[s];if(t!==e)break;if(t===e&&n===i)return void At(Od,this).splice(s,1)}}function Ud(t){const[e,i,n]=t,s=[[e,i,n]],a=vt(Wd,this,Hd).call(this,n);for(let r=0;r<a;r++){const[t,i]=At(Od,this)[r];for(let n=0,a=s.length;n<a;n++){const[,r,o]=s[n];if(!(i<=r||o<=t))if(r>=t)if(o>i)s[n][1]=i;else{if(1===a)return[];s.splice(n,1),n--,a--}else s[n][2]=t,o>i&&s.push([e,i,o])}}return s}class Gd{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(t,e){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof Au}}var qd=new WeakMap,Xd=new WeakMap;class Yd extends Gd{constructor(t,e){super(),yt(this,qd,void 0),yt(this,Xd,void 0),Et(Xd,this,t),Et(qd,this,e)}toSVGPath(){const t=[];for(const e of At(Xd,this)){let[i,n]=e;t.push("M".concat(i," ").concat(n));for(let s=2;s<e.length;s+=2){const a=e[s],r=e[s+1];a===i?(t.push("V".concat(r)),n=r):r===n&&(t.push("H".concat(a)),i=a)}t.push("Z")}return t.join(" ")}serialize(t,e){let[i,n,s,a]=t;const r=[],o=s-i,l=a-n;for(const c of At(Xd,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]=a-c[e+1]*l;r.push(t)}return r}get box(){return At(qd,this)}}var Kd=new WeakMap,Qd=new WeakMap,Zd=new WeakMap,Jd=new WeakMap,$d=new WeakMap,tu=new WeakMap,eu=new WeakMap,iu=new WeakMap,nu=new WeakMap,su=new WeakMap,au=new WeakMap,ru=new WeakMap,ou=new WeakMap,lu=new WeakSet;class cu{constructor(t,e,i,n,s){let{x:a,y:r}=t,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;mt(this,lu),yt(this,Kd,void 0),yt(this,Qd,[]),yt(this,Zd,void 0),yt(this,Jd,void 0),yt(this,$d,[]),yt(this,tu,new Float64Array(18)),yt(this,eu,void 0),yt(this,iu,void 0),yt(this,nu,void 0),yt(this,su,void 0),yt(this,au,void 0),yt(this,ru,void 0),yt(this,ou,[]),Et(Kd,this,e),Et(ru,this,n*i),Et(Jd,this,s),At(tu,this).set([NaN,NaN,NaN,NaN,a,r],6),Et(Zd,this,o),Et(su,this,du._*i),Et(nu,this,uu._*i),Et(au,this,i),At(ou,this).push(a,r)}get free(){return!0}isEmpty(){return isNaN(At(tu,this)[8])}add(t){var e;let{x:i,y:n}=t;Et(eu,this,i),Et(iu,this,n);const[s,a,r,o]=At(Kd,this);let[l,c,h,d]=At(tu,this).subarray(8,12);const u=i-h,p=n-d,f=Math.hypot(u,p);if(f<At(nu,this))return!1;const g=f-At(su,this),m=g/f,v=m*u,b=m*p;let w=l,y=c;l=h,c=d,h+=v,d+=b,null===(e=At(ou,this))||void 0===e||e.push(i,n);const A=v/g,E=-b/g*At(ru,this),x=A*At(ru,this);if(At(tu,this).set(At(tu,this).subarray(2,8),0),At(tu,this).set([h+E,d+x],4),At(tu,this).set(At(tu,this).subarray(14,18),12),At(tu,this).set([h-E,d-x],16),isNaN(At(tu,this)[6]))return 0===At($d,this).length&&(At(tu,this).set([l+E,c+x],2),At($d,this).push(NaN,NaN,NaN,NaN,(l+E-s)/r,(c+x-a)/o),At(tu,this).set([l-E,c-x],14),At(Qd,this).push(NaN,NaN,NaN,NaN,(l-E-s)/r,(c-x-a)/o)),At(tu,this).set([w,y,l,c,h,d],6),!this.isEmpty();At(tu,this).set([w,y,l,c,h,d],6);return Math.abs(Math.atan2(y-c,w-l)-Math.atan2(b,v))<Math.PI/2?([l,c,h,d]=At(tu,this).subarray(2,6),At($d,this).push(NaN,NaN,NaN,NaN,((l+h)/2-s)/r,((c+d)/2-a)/o),[l,c,w,y]=At(tu,this).subarray(14,18),At(Qd,this).push(NaN,NaN,NaN,NaN,((w+l)/2-s)/r,((y+c)/2-a)/o),!0):([w,y,l,c,h,d]=At(tu,this).subarray(0,6),At($d,this).push(((w+5*l)/6-s)/r,((y+5*c)/6-a)/o,((5*l+h)/6-s)/r,((5*c+d)/6-a)/o,((l+h)/2-s)/r,((c+d)/2-a)/o),[h,d,l,c,w,y]=At(tu,this).subarray(12,18),At(Qd,this).push(((w+5*l)/6-s)/r,((y+5*c)/6-a)/o,((5*l+h)/6-s)/r,((5*c+d)/6-a)/o,((l+h)/2-s)/r,((c+d)/2-a)/o),!0)}toSVGPath(){if(this.isEmpty())return"";const t=At($d,this),e=At(Qd,this),i=At(tu,this).subarray(4,6),n=At(tu,this).subarray(16,18),[s,a,r,o]=At(Kd,this),[l,c,h,d]=vt(lu,this,hu).call(this);if(isNaN(At(tu,this)[6])&&!this.isEmpty())return"M".concat((At(tu,this)[2]-s)/r," ").concat((At(tu,this)[3]-a)/o," L").concat((At(tu,this)[4]-s)/r," ").concat((At(tu,this)[5]-a)/o," L").concat(l," ").concat(c," L").concat(h," ").concat(d," L").concat((At(tu,this)[16]-s)/r," ").concat((At(tu,this)[17]-a)/o," L").concat((At(tu,this)[14]-s)/r," ").concat((At(tu,this)[15]-a)/o," Z");const u=[];u.push("M".concat(t[4]," ").concat(t[5]));for(let p=6;p<t.length;p+=6)isNaN(t[p])?u.push("L".concat(t[p+4]," ").concat(t[p+5])):u.push("C".concat(t[p]," ").concat(t[p+1]," ").concat(t[p+2]," ").concat(t[p+3]," ").concat(t[p+4]," ").concat(t[p+5]));u.push("L".concat((i[0]-s)/r," ").concat((i[1]-a)/o," L").concat(l," ").concat(c," L").concat(h," ").concat(d," L").concat((n[0]-s)/r," ").concat((n[1]-a)/o));for(let p=e.length-6;p>=6;p-=6)isNaN(e[p])?u.push("L".concat(e[p+4]," ").concat(e[p+5])):u.push("C".concat(e[p]," ").concat(e[p+1]," ").concat(e[p+2]," ").concat(e[p+3]," ").concat(e[p+4]," ").concat(e[p+5]));return u.push("L".concat(e[4]," ").concat(e[5]," Z")),u.join(" ")}getOutlines(){var t,e;const i=At($d,this),n=At(Qd,this),s=At(tu,this),a=s.subarray(4,6),r=s.subarray(16,18),[o,l,c,h]=At(Kd,this),d=new Float64Array((null!==(t=null===(e=At(ou,this))||void 0===e?void 0:e.length)&&void 0!==t?t:0)+2);for(let b=0,w=d.length-2;b<w;b+=2)d[b]=(At(ou,this)[b]-o)/c,d[b+1]=(At(ou,this)[b+1]-l)/h;d[d.length-2]=(At(eu,this)-o)/c,d[d.length-1]=(At(iu,this)-l)/h;const[u,p,f,g]=vt(lu,this,hu).call(this);if(isNaN(s[6])&&!this.isEmpty()){const t=new Float64Array(36);return t.set([NaN,NaN,NaN,NaN,(s[2]-o)/c,(s[3]-l)/h,NaN,NaN,NaN,NaN,(s[4]-o)/c,(s[5]-l)/h,NaN,NaN,NaN,NaN,u,p,NaN,NaN,NaN,NaN,f,g,NaN,NaN,NaN,NaN,(s[16]-o)/c,(s[17]-l)/h,NaN,NaN,NaN,NaN,(s[14]-o)/c,(s[15]-l)/h],0),new Au(t,d,At(Kd,this),At(au,this),At(Zd,this),At(Jd,this))}const m=new Float64Array(At($d,this).length+24+At(Qd,this).length);let v=i.length;for(let b=0;b<v;b+=2)isNaN(i[b])?m[b]=m[b+1]=NaN:(m[b]=i[b],m[b+1]=i[b+1]);m.set([NaN,NaN,NaN,NaN,(a[0]-o)/c,(a[1]-l)/h,NaN,NaN,NaN,NaN,u,p,NaN,NaN,NaN,NaN,f,g,NaN,NaN,NaN,NaN,(r[0]-o)/c,(r[1]-l)/h],v),v+=24;for(let b=n.length-6;b>=6;b-=6)for(let t=0;t<6;t+=2)isNaN(n[b+t])?(m[v]=m[v+1]=NaN,v+=2):(m[v]=n[b+t],m[v+1]=n[b+t+1],v+=2);return m.set([NaN,NaN,NaN,NaN,n[4],n[5]],v),new Au(m,d,At(Kd,this),At(au,this),At(Zd,this),At(Jd,this))}}function hu(){const t=At(tu,this).subarray(4,6),e=At(tu,this).subarray(16,18),[i,n,s,a]=At(Kd,this);return[(At(eu,this)+(t[0]-e[0])/2-i)/s,(At(iu,this)+(t[1]-e[1])/2-n)/a,(At(eu,this)+(e[0]-t[0])/2-i)/s,(At(iu,this)+(e[1]-t[1])/2-n)/a]}var du={_:8},uu={_:du._+2},pu=new WeakMap,fu=new WeakMap,gu=new WeakMap,mu=new WeakMap,vu=new WeakMap,bu=new WeakMap,wu=new WeakMap,yu=new WeakSet;class Au extends Gd{constructor(t,e,i,n,s,a){super(),mt(this,yu),yt(this,pu,void 0),yt(this,fu,null),yt(this,gu,void 0),yt(this,mu,void 0),yt(this,vu,void 0),yt(this,bu,void 0),yt(this,wu,void 0),Et(wu,this,t),Et(vu,this,e),Et(pu,this,i),Et(bu,this,n),Et(gu,this,s),Et(mu,this,a),vt(yu,this,_u).call(this,a);const{x:r,y:o,width:l,height:c}=At(fu,this);for(let h=0,d=t.length;h<d;h+=2)t[h]=(t[h]-r)/l,t[h+1]=(t[h+1]-o)/c;for(let h=0,d=e.length;h<d;h+=2)e[h]=(e[h]-r)/l,e[h+1]=(e[h+1]-o)/c}toSVGPath(){const t=["M".concat(At(wu,this)[4]," ").concat(At(wu,this)[5])];for(let e=6,i=At(wu,this).length;e<i;e+=6)isNaN(At(wu,this)[e])?t.push("L".concat(At(wu,this)[e+4]," ").concat(At(wu,this)[e+5])):t.push("C".concat(At(wu,this)[e]," ").concat(At(wu,this)[e+1]," ").concat(At(wu,this)[e+2]," ").concat(At(wu,this)[e+3]," ").concat(At(wu,this)[e+4]," ").concat(At(wu,this)[e+5]));return t.push("Z"),t.join(" ")}serialize(t,e){let[i,n,s,a]=t;const r=s-i,o=a-n;let l,c;switch(e){case 0:l=vt(yu,this,Eu).call(this,At(wu,this),i,a,r,-o),c=vt(yu,this,Eu).call(this,At(vu,this),i,a,r,-o);break;case 90:l=vt(yu,this,xu).call(this,At(wu,this),i,n,r,o),c=vt(yu,this,xu).call(this,At(vu,this),i,n,r,o);break;case 180:l=vt(yu,this,Eu).call(this,At(wu,this),s,n,-r,o),c=vt(yu,this,Eu).call(this,At(vu,this),s,n,-r,o);break;case 270:l=vt(yu,this,xu).call(this,At(wu,this),s,a,-r,-o),c=vt(yu,this,xu).call(this,At(vu,this),s,a,-r,-o)}return{outline:Array.from(l),points:[Array.from(c)]}}get box(){return At(fu,this)}getNewOutline(t,e){const{x:i,y:n,width:s,height:a}=At(fu,this),[r,o,l,c]=At(pu,this),h=s*l,d=a*c,u=i*l+r,p=n*c+o,f=new cu({x:At(vu,this)[0]*h+u,y:At(vu,this)[1]*d+p},At(pu,this),At(bu,this),t,At(mu,this),null!==e&&void 0!==e?e:At(gu,this));for(let g=2;g<At(vu,this).length;g+=2)f.add({x:At(vu,this)[g]*h+u,y:At(vu,this)[g+1]*d+p});return f.getOutlines()}}function Eu(t,e,i,n,s){const a=new Float64Array(t.length);for(let r=0,o=t.length;r<o;r+=2)a[r]=e+t[r]*n,a[r+1]=i+t[r+1]*s;return a}function xu(t,e,i,n,s){const a=new Float64Array(t.length);for(let r=0,o=t.length;r<o;r+=2)a[r]=e+t[r+1]*n,a[r+1]=i+t[r]*s;return a}function _u(t){const e=At(wu,this);let i=e[4],n=e[5],s=i,a=n,r=i,o=n,l=i,c=n;const h=t?Math.max:Math.min;for(let g=6,m=e.length;g<m;g+=6){if(isNaN(e[g]))s=Math.min(s,e[g+4]),a=Math.min(a,e[g+5]),r=Math.max(r,e[g+4]),o=Math.max(o,e[g+5]),c<e[g+5]?(l=e[g+4],c=e[g+5]):c===e[g+5]&&(l=h(l,e[g+4]));else{const t=ei.bezierBoundingBox(i,n,...e.slice(g,g+6));s=Math.min(s,t[0]),a=Math.min(a,t[1]),r=Math.max(r,t[2]),o=Math.max(o,t[3]),c<t[3]?(l=t[2],c=t[3]):c===t[3]&&(l=h(l,t[2]))}i=e[g+4],n=e[g+5]}const d=s-At(gu,this),u=a-At(gu,this),p=r-s+2*At(gu,this),f=o-a+2*At(gu,this);Et(fu,this,{x:d,y:u,width:p,height:f,lastPoint:[l,c]})}var ku=new WeakMap,Cu=new WeakMap,Mu=new WeakMap,Su=new WeakMap,Lu=new WeakMap,Tu=new WeakMap,Ru=new WeakMap,Fu=new WeakMap,Pu=new WeakMap,Iu=new WeakMap,Nu=new WeakMap,Du=new WeakMap,Ou=new WeakSet;class Wu{static get _keyboardManager(){return He(this,"_keyboardManager",new qn([[["Escape","mac+Escape"],Wu.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Wu.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Wu.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Wu.prototype._moveToPrevious],[["Home","mac+Home"],Wu.prototype._moveToBeginning],[["End","mac+End"],Wu.prototype._moveToEnd]]))}constructor(t){var e;let{editor:i=null,uiManager:n=null}=t;mt(this,Ou),yt(this,ku,vt(Ou,this,Hu).bind(this)),yt(this,Cu,vt(Ou,this,Vu).bind(this)),yt(this,Mu,null),yt(this,Su,null),yt(this,Lu,void 0),yt(this,Tu,null),yt(this,Ru,!1),yt(this,Fu,!1),yt(this,Pu,null),yt(this,Iu,void 0),yt(this,Nu,null),yt(this,Du,void 0),i?(Et(Fu,this,!1),Et(Du,this,Zt.HIGHLIGHT_COLOR),Et(Pu,this,i)):(Et(Fu,this,!0),Et(Du,this,Zt.HIGHLIGHT_DEFAULT_COLOR)),Et(Nu,this,(null===i||void 0===i?void 0:i._uiManager)||n),Et(Iu,this,At(Nu,this)._eventBus),Et(Lu,this,(null===i||void 0===i?void 0:i.color)||(null===(e=At(Nu,this))||void 0===e?void 0:e.highlightColors.values().next().value)||"#FFFF98")}renderButton(){const t=Et(Mu,this,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const e=At(Nu,this)._signal;t.addEventListener("click",vt(Ou,this,ju).bind(this),{signal:e}),t.addEventListener("keydown",At(ku,this),{signal:e});const i=Et(Su,this,document.createElement("span"));return i.className="swatch",i.setAttribute("aria-hidden",!0),i.style.backgroundColor=At(Lu,this),t.append(i),t}renderMainDropdown(){const t=Et(Tu,this,vt(Ou,this,zu).call(this));return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}_colorSelectFromKeyboard(t){if(t.target===At(Mu,this))return void vt(Ou,this,ju).call(this,t);const e=t.target.getAttribute("data-color");e&&vt(Ou,this,Bu).call(this,e,t)}_moveToNext(t){var e,i;bt(Ou,this,Uu)?t.target!==At(Mu,this)?null===(e=t.target.nextSibling)||void 0===e||e.focus():null===(i=At(Tu,this).firstChild)||void 0===i||i.focus():vt(Ou,this,ju).call(this,t)}_moveToPrevious(t){var e,i;t.target!==(null===(e=At(Tu,this))||void 0===e?void 0:e.firstChild)&&t.target!==At(Mu,this)?(bt(Ou,this,Uu)||vt(Ou,this,ju).call(this,t),null===(i=t.target.previousSibling)||void 0===i||i.focus()):bt(Ou,this,Uu)&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){var e;bt(Ou,this,Uu)?null===(e=At(Tu,this).firstChild)||void 0===e||e.focus():vt(Ou,this,ju).call(this,t)}_moveToEnd(t){var e;bt(Ou,this,Uu)?null===(e=At(Tu,this).lastChild)||void 0===e||e.focus():vt(Ou,this,ju).call(this,t)}hideDropdown(){var t;null===(t=At(Tu,this))||void 0===t||t.classList.add("hidden"),window.removeEventListener("pointerdown",At(Cu,this))}_hideDropdownFromKeyboard(){var t;At(Fu,this)||(bt(Ou,this,Uu)?(this.hideDropdown(),At(Mu,this).focus({preventScroll:!0,focusVisible:At(Ru,this)})):null===(t=At(Pu,this))||void 0===t||t.unselect())}updateColor(t){if(At(Su,this)&&(At(Su,this).style.backgroundColor=t),!At(Tu,this))return;const e=At(Nu,this).highlightColors.values();for(const i of At(Tu,this).children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){var t,e;null===(t=At(Mu,this))||void 0===t||t.remove(),Et(Mu,this,null),Et(Su,this,null),null===(e=At(Tu,this))||void 0===e||e.remove(),Et(Tu,this,null)}}function zu(){const t=document.createElement("div"),e=At(Nu,this)._signal;t.addEventListener("contextmenu",en,{signal:e}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[i,n]of At(Nu,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","pdfjs-editor-colorpicker-".concat(i));const a=document.createElement("span");s.append(a),a.className="swatch",a.style.backgroundColor=n,s.setAttribute("aria-selected",n===At(Lu,this)),s.addEventListener("click",vt(Ou,this,Bu).bind(this,n),{signal:e}),t.append(s)}return t.addEventListener("keydown",At(ku,this),{signal:e}),t}function Bu(t,e){e.stopPropagation(),At(Iu,this).dispatch("switchannotationeditorparams",{source:this,type:At(Du,this),value:t})}function Hu(t){Rt._keyboardManager.exec(this,t)}function ju(t){if(bt(Ou,this,Uu))return void this.hideDropdown();if(Et(Ru,this,0===t.detail),window.addEventListener("pointerdown",At(Cu,this),{signal:At(Nu,this)._signal}),At(Tu,this))return void At(Tu,this).classList.remove("hidden");const e=Et(Tu,this,vt(Ou,this,zu).call(this));At(Mu,this).append(e)}function Vu(t){var e;null!==(e=At(Tu,this))&&void 0!==e&&e.contains(t.target)||this.hideDropdown()}function Uu(t){return At(Tu,t)&&!At(Tu,t).classList.contains("hidden")}Rt=Wu;var Gu=new WeakMap,qu=new WeakMap,Xu=new WeakMap,Yu=new WeakMap,Ku=new WeakMap,Qu=new WeakMap,Zu=new WeakMap,Ju=new WeakMap,$u=new WeakMap,tp=new WeakMap,ep=new WeakMap,ip=new WeakMap,np=new WeakMap,sp=new WeakMap,ap=new WeakMap,rp=new WeakMap,op=new WeakMap,lp=new WeakMap,cp=new WeakMap,hp=new WeakSet;class dp extends ja{static get _keyboardManager(){const t=dp.prototype;return He(this,"_keyboardManager",new qn([[["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,ut.A)((0,ut.A)({},t),{},{name:"highlightEditor"})),mt(this,hp),yt(this,Gu,null),yt(this,qu,0),yt(this,Xu,void 0),yt(this,Yu,null),yt(this,Ku,null),yt(this,Qu,null),yt(this,Zu,null),yt(this,Ju,0),yt(this,$u,null),yt(this,tp,null),yt(this,ep,null),yt(this,ip,!1),yt(this,np,vt(hp,this,yp).bind(this)),yt(this,sp,null),yt(this,ap,void 0),yt(this,rp,null),yt(this,op,""),yt(this,lp,void 0),yt(this,cp,""),this.color=t.color||dp._defaultColor,Et(lp,this,t.thickness||dp._defaultThickness),Et(ap,this,t.opacity||dp._defaultOpacity),Et(Xu,this,t.boxes||null),Et(cp,this,t.methodOfCreation||""),Et(op,this,t.text||""),this._isDraggable=!1,t.highlightId>-1?(Et(ip,this,!0),vt(hp,this,pp).call(this,t),vt(hp,this,bp).call(this)):(Et(Gu,this,t.anchorNode),Et(qu,this,t.anchorOffset),Et(Zu,this,t.focusNode),Et(Ju,this,t.focusOffset),vt(hp,this,up).call(this),vt(hp,this,bp).call(this),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:At(ip,this)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:At(lp,this),methodOfCreation:At(cp,this)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,e){var i;ja.initialize(t,e),dp._defaultColor||(dp._defaultColor=(null===(i=e.highlightColors)||void 0===i?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(t,e){switch(t){case Zt.HIGHLIGHT_DEFAULT_COLOR:dp._defaultColor=e;break;case Zt.HIGHLIGHT_THICKNESS:dp._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return At(sp,this)}updateParams(t,e){switch(t){case Zt.HIGHLIGHT_COLOR:vt(hp,this,fp).call(this,e);break;case Zt.HIGHLIGHT_THICKNESS:vt(hp,this,gp).call(this,e)}}static get defaultPropertiesToUpdate(){return[[Zt.HIGHLIGHT_DEFAULT_COLOR,dp._defaultColor],[Zt.HIGHLIGHT_THICKNESS,dp._defaultThickness]]}get propertiesToUpdate(){return[[Zt.HIGHLIGHT_COLOR,this.color||dp._defaultColor],[Zt.HIGHLIGHT_THICKNESS,At(lp,this)||dp._defaultThickness],[Zt.HIGHLIGHT_FREE,At(ip,this)]]}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(Et(Ku,this,new Wu({editor:this})),t.addColorPicker(At(Ku,this))),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(vt(hp,this,Ep).call(this))}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,vt(hp,this,Ep).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){vt(hp,this,vp).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(vt(hp,this,bp).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;if(this.parent&&!t)vt(hp,this,vp).call(this);else if(t){var i;vt(hp,this,bp).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;At(ip,this)?(t=(t-this.rotation+360)%360,i=wp.call(dp,At(tp,this).box,t)):i=wp.call(dp,this,t),e.rotate(At(ep,this),t),e.rotate(At(rp,this),t),e.updateBox(At(ep,this),i),e.updateBox(At(rp,this),wp.call(dp,At(Qu,this).box,t))}render(){if(this.div)return this.div;const t=super.render();At(op,this)&&(t.setAttribute("aria-label",At(op,this)),t.setAttribute("role","mark")),At(ip,this)?t.classList.add("free"):this.div.addEventListener("keydown",At(np,this),{signal:this._uiManager._signal});const e=Et($u,this,document.createElement("div"));t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=At(Yu,this);const[i,n]=this.parentDimensions;return this.setDims(this.width*i,this.height*n),Rn(this,At($u,this),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.parent.drawLayer.addClass(At(rp,this),"hovered")}pointerleave(){this.parent.drawLayer.removeClass(At(rp,this),"hovered")}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:vt(hp,this,Ap).call(this,!0);break;case 1:case 3:vt(hp,this,Ap).call(this,!1)}}select(){var t,e;super.select(),At(rp,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.removeClass(At(rp,this),"hovered"),null===(e=this.parent)||void 0===e||e.drawLayer.addClass(At(rp,this),"selected"))}unselect(){var t;super.unselect(),At(rp,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.removeClass(At(rp,this),"selected"),At(ip,this)||vt(hp,this,Ap).call(this,!1))}get _mustFixPosition(){return!At(ip,this)}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;super.show(t),this.parent&&(this.parent.drawLayer.show(At(ep,this),t),this.parent.drawLayer.show(At(rp,this),t))}static startHighlighting(t,e,i){let{target:n,x:s,y:a}=i;const{x:r,y:o,width:l,height:c}=n.getBoundingClientRect(),h=e=>{vt(dp,this,kp).call(this,t,e)},d=t._signal,u={capture:!0,passive:!1,signal:d},p=t=>{t.preventDefault(),t.stopPropagation()},f=e=>{n.removeEventListener("pointermove",h),window.removeEventListener("blur",f),window.removeEventListener("pointerup",f),window.removeEventListener("pointerdown",p,u),window.removeEventListener("contextmenu",en),vt(dp,this,Cp).call(this,t,e)};window.addEventListener("blur",f,{signal:d}),window.addEventListener("pointerup",f,{signal:d}),window.addEventListener("pointerdown",p,u),window.addEventListener("contextmenu",en,{signal:d}),n.addEventListener("pointermove",h,{signal:d}),this._freeHighlight=new cu({x:s,y:a},[r,o,l,c],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static deserialize(t,e,i){const n=super.deserialize(t,e,i),{rect:[s,a,r,o],color:l,quadPoints:c}=t;n.color=ei.makeHexColor(...l),Et(ap,n,t.opacity);const[h,d]=n.pageDimensions;n.width=(r-s)/h,n.height=(o-a)/d;const u=Et(Xu,n,[]);for(let p=0;p<c.length;p+=8)u.push({x:(c[4]-r)/h,y:(o-(1-c[p+5]))/d,width:(c[p+2]-c[p])/h,height:(c[p+5]-c[p+1])/d});return vt(hp,n,up).call(n),n}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty()||t)return null;const e=this.getRect(0,0),i=ja._colorManager.convert(this.color);return{annotationType:Qt.HIGHLIGHT,color:i,opacity:At(ap,this),thickness:At(lp,this),quadPoints:vt(hp,this,xp).call(this),outlines:vt(hp,this,_p).call(this,e),pageIndex:this.pageIndex,rect:e,rotation:vt(hp,this,Ep).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}}function up(){const t=new zd(At(Xu,this),.001);Et(tp,this,t.getOutlines()),({x:this.x,y:this.y,width:this.width,height:this.height}=At(tp,this).box);const e=new zd(At(Xu,this),.0025,.001,"ltr"===this._uiManager.direction);Et(Qu,this,e.getOutlines());const{lastPoint:i}=At(Qu,this).box;Et(sp,this,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])}function pp(t){let{highlightOutlines:e,highlightId:i,clipPathId:n}=t;Et(tp,this,e);if(Et(Qu,this,e.getNewOutline(At(lp,this)/2+1.5,.0025)),i>=0)Et(ep,this,i),Et(Yu,this,n),this.parent.drawLayer.finalizeLine(i,e),Et(rp,this,this.parent.drawLayer.highlightOutline(At(Qu,this)));else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(At(ep,this),e),this.parent.drawLayer.updateBox(At(ep,this),wp.call(Ft,At(tp,this).box,(t-this.rotation+360)%360)),this.parent.drawLayer.updateLine(At(rp,this),At(Qu,this)),this.parent.drawLayer.updateBox(At(rp,this),wp.call(Ft,At(Qu,this).box,t))}const{x:s,y:a,width:r,height:o}=e.box;switch(this.rotation){case 0:this.x=s,this.y=a,this.width=r,this.height=o;break;case 90:{const[t,e]=this.parentDimensions;this.x=a,this.y=1-s,this.width=r*e/t,this.height=o*t/e;break}case 180:this.x=1-s,this.y=1-a,this.width=r,this.height=o;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-a,this.y=s,this.width=r*e/t,this.height=o*t/e;break}}const{lastPoint:l}=At(Qu,this).box;Et(sp,this,[(l[0]-s)/r,(l[1]-a)/o])}function fp(t){const e=t=>{var e,i;this.color=t,null===(e=this.parent)||void 0===e||e.drawLayer.changeColor(At(ep,this),t),null===(i=At(Ku,this))||void 0===i||i.updateColor(t)},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Zt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}function gp(t){const e=At(lp,this),i=t=>{Et(lp,this,t),vt(hp,this,mp).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:Zt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}function mp(t){if(!At(ip,this))return;vt(hp,this,pp).call(this,{highlightOutlines:At(tp,this).getNewOutline(t/2)}),this.fixAndSetPosition();const[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)}function vp(){null!==At(ep,this)&&this.parent&&(this.parent.drawLayer.remove(At(ep,this)),Et(ep,this,null),this.parent.drawLayer.remove(At(rp,this)),Et(rp,this,null))}function bp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null===At(ep,this)&&(({id:pt(Et,[ep,this])._,clipPathId:pt(Et,[Yu,this])._}=t.drawLayer.highlight(At(tp,this),this.color,At(ap,this))),Et(rp,this,t.drawLayer.highlightOutline(At(Qu,this))),At($u,this)&&(At($u,this).style.clipPath=At(Yu,this)))}function wp(t,e){let{x:i,y:n,width:s,height:a}=t;switch(e){case 90:return{x:1-n-a,y:i,width:a,height:s};case 180:return{x:1-i-s,y:1-n-a,width:s,height:a};case 270:return{x:n,y:1-i-s,width:a,height:s}}return{x:i,y:n,width:s,height:a}}function yp(t){Ft._keyboardManager.exec(this,t)}function Ap(t){if(!At(Gu,this))return;const e=window.getSelection();t?e.setPosition(At(Gu,this),At(qu,this)):e.setPosition(At(Zu,this),At(Ju,this))}function Ep(){return At(ip,this)?this.rotation:0}function xp(){if(At(ip,this))return null;const[t,e]=this.pageDimensions,i=At(Xu,this),n=new Float32Array(8*i.length);let s=0;for(const{x:a,y:r,width:o,height:l}of i){const i=a*t,c=(1-r-l)*e;n[s]=n[s+4]=i,n[s+1]=n[s+3]=c,n[s+2]=n[s+6]=i+o*t,n[s+5]=n[s+7]=c+l*e,s+=8}return n}function _p(t){return At(tp,this).serialize(t,vt(hp,this,Ep).call(this))}function kp(t,e){this._freeHighlight.add(e)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}function Cp(t,e){this._freeHighlight.isEmpty()?t.drawLayer.removeFreeHighlight(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}Ft=dp,(0,wt.A)(dp,"_defaultColor",null),(0,wt.A)(dp,"_defaultOpacity",1),(0,wt.A)(dp,"_defaultThickness",12),(0,wt.A)(dp,"_l10nPromise",void 0),(0,wt.A)(dp,"_type","highlight"),(0,wt.A)(dp,"_editorType",Qt.HIGHLIGHT),(0,wt.A)(dp,"_freeHighlightId",-1),(0,wt.A)(dp,"_freeHighlight",null),(0,wt.A)(dp,"_freeHighlightClipId","");var Mp=new WeakMap,Sp=new WeakMap,Lp=new WeakMap,Tp=new WeakMap,Rp=new WeakMap,Fp=new WeakMap,Pp=new WeakMap,Ip=new WeakMap,Np=new WeakMap,Dp=new WeakMap,Op=new WeakMap,Wp=new WeakMap,zp=new WeakMap,Bp=new WeakMap,Hp=new WeakMap,jp=new WeakSet;class Vp extends ja{constructor(t){super((0,ut.A)((0,ut.A)({},t),{},{name:"inkEditor"})),mt(this,jp),yt(this,Mp,0),yt(this,Sp,0),yt(this,Lp,this.canvasPointermove.bind(this)),yt(this,Tp,this.canvasPointerleave.bind(this)),yt(this,Rp,this.canvasPointerup.bind(this)),yt(this,Fp,this.canvasPointerdown.bind(this)),yt(this,Pp,null),yt(this,Ip,new Path2D),yt(this,Np,!1),yt(this,Dp,!1),yt(this,Op,!1),yt(this,Wp,null),yt(this,zp,0),yt(this,Bp,0),yt(this,Hp,null),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t,e){ja.initialize(t,e)}static updateDefaultParams(t,e){switch(t){case Zt.INK_THICKNESS:Vp._defaultThickness=e;break;case Zt.INK_COLOR:Vp._defaultColor=e;break;case Zt.INK_OPACITY:Vp._defaultOpacity=e/100}}updateParams(t,e){switch(t){case Zt.INK_THICKNESS:vt(jp,this,Up).call(this,e);break;case Zt.INK_COLOR:vt(jp,this,Gp).call(this,e);break;case Zt.INK_OPACITY:vt(jp,this,qp).call(this,e)}}static get defaultPropertiesToUpdate(){return[[Zt.INK_THICKNESS,Vp._defaultThickness],[Zt.INK_COLOR,Vp._defaultColor||ja._defaultLineColor],[Zt.INK_OPACITY,Math.round(100*Vp._defaultOpacity)]]}get propertiesToUpdate(){var t;return[[Zt.INK_THICKNESS,this.thickness||Vp._defaultThickness],[Zt.INK_COLOR,this.color||Vp._defaultColor||ja._defaultLineColor],[Zt.INK_OPACITY,Math.round(100*(null!==(t=this.opacity)&&void 0!==t?t:Vp._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(vt(jp,this,af).call(this),vt(jp,this,rf).call(this)),this.isAttachedToDOM||(this.parent.add(this),vt(jp,this,of).call(this)),vt(jp,this,mf).call(this)))}remove(){var t;null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,At(Pp,this)&&(clearTimeout(At(Pp,this)),Et(Pp,this,null)),null===(t=At(Wp,this))||void 0===t||t.disconnect(),Et(Wp,this,null),super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,i=this.width*t,n=this.height*e;this.setDimensions(i,n)}enableEditMode(){At(Np,this)||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",At(Fp,this),{signal:this._uiManager._signal}))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",At(Fp,this)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){At(Np,this)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),Et(Np,this,!0),this.div.classList.add("disabled"),vt(jp,this,mf).call(this,!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!At(Np,this)&&(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),vt(jp,this,Kp).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),vt(jp,this,Qp).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),vt(jp,this,sf).call(this,t)}canvasPointerleave(t){vt(jp,this,sf).call(this,t)}get isResizable(){return!this.isEmpty()&&At(Np,this)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,n,s,a]=vt(jp,this,Xp).call(this);if(this.setAt(i,n,0,0),this.setDims(s,a),vt(jp,this,af).call(this),this.width){const[i,n]=this.parentDimensions;this.setAspectRatio(this.width*i,this.height*n),this.setAt(t*i,e*n,this.width*i,this.height*n),Et(Op,this,!0),vt(jp,this,of).call(this),this.setDims(this.width*i,this.height*n),vt(jp,this,nf).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return vt(jp,this,rf).call(this),this.div}setDimensions(t,e){const i=Math.round(t),n=Math.round(e);if(At(zp,this)===i&&At(Bp,this)===n)return;Et(zp,this,i),Et(Bp,this,n),this.canvas.style.visibility="hidden";const[s,a]=this.parentDimensions;this.width=t/s,this.height=e/a,this.fixAndSetPosition(),At(Np,this)&&vt(jp,this,lf).call(this,t,e),vt(jp,this,of).call(this),vt(jp,this,nf).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(t,e,i){if(t instanceof Qh)return null;const n=super.deserialize(t,e,i);n.thickness=t.thickness,n.color=ei.makeHexColor(...t.color),n.opacity=t.opacity;const[s,a]=n.pageDimensions,r=n.width*s,o=n.height*a,l=n.parentScale,c=t.thickness/2;Et(Np,n,!0),Et(zp,n,Math.round(r)),Et(Bp,n,Math.round(o));const{paths:h,rect:d,rotation:u}=t;for(let{bezier:f}of h){f=uf.call(Vp,f,d,u);const t=[];n.paths.push(t);let e=l*(f[0]-c),i=l*(f[1]-c);for(let n=2,a=f.length;n<a;n+=6){const s=l*(f[n]-c),a=l*(f[n+1]-c),r=l*(f[n+2]-c),o=l*(f[n+3]-c),h=l*(f[n+4]-c),d=l*(f[n+5]-c);t.push([[e,i],[s,a],[r,o],[h,d]]),e=h,i=d}const s=vt(Vp,this,hf).call(this,t);n.bezierPath2D.push(s)}const p=vt(jp,n,ff).call(n);return Et(Sp,n,Math.max(ja.MIN_SIZE,p[2]-p[0])),Et(Mp,n,Math.max(ja.MIN_SIZE,p[3]-p[1])),vt(jp,n,lf).call(n,r,o),n}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=ja._colorManager.convert(this.ctx.strokeStyle);return{annotationType:Qt.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:vt(jp,this,pf).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}function Up(t){const e=t=>{this.thickness=t,vt(jp,this,mf).call(this)},i=this.thickness;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Zt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function Gp(t){const e=t=>{this.color=t,vt(jp,this,nf).call(this)},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Zt.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function qp(t){const e=t=>{this.opacity=t,vt(jp,this,nf).call(this)};t/=100;const i=this.opacity;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Zt.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function Xp(){const{parentRotation:t,parentDimensions:[e,i]}=this;switch(t){case 90:return[0,i,i,e];case 180:return[e,i,e,i];case 270:return[e,0,i,e];default:return[0,0,e,i]}}function Yp(){const{ctx:t,color:e,opacity:i,thickness:n,parentScale:s,scaleFactor:a}=this;t.lineWidth=n*s/a,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle="".concat(e).concat(function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}(i))}function Kp(t,e){const i=this._uiManager._signal;var n;(this.canvas.addEventListener("contextmenu",en,{signal:i}),this.canvas.addEventListener("pointerleave",At(Tp,this),{signal:i}),this.canvas.addEventListener("pointermove",At(Lp,this),{signal:i}),this.canvas.addEventListener("pointerup",At(Rp,this),{signal:i}),this.canvas.removeEventListener("pointerdown",At(Fp,this)),this.isEditing=!0,At(Op,this))||(Et(Op,this,!0),vt(jp,this,of).call(this),this.thickness||(this.thickness=Pt._defaultThickness),this.color||(this.color=Pt._defaultColor||ja._defaultLineColor),null!==(n=this.opacity)&&void 0!==n||(this.opacity=Pt._defaultOpacity));this.currentPath.push([t,e]),Et(Dp,this,!1),vt(jp,this,Yp).call(this),Et(Hp,this,()=>{vt(jp,this,$p).call(this),At(Hp,this)&&window.requestAnimationFrame(At(Hp,this))}),window.requestAnimationFrame(At(Hp,this))}function Qp(t,e){const[i,n]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&e===n)return;const s=this.currentPath;let a=At(Ip,this);if(s.push([t,e]),Et(Dp,this,!0),s.length<=2)return a.moveTo(...s[0]),void a.lineTo(t,e);3===s.length&&(Et(Ip,this,a=new Path2D),a.moveTo(...s[0])),vt(jp,this,tf).call(this,a,...s.at(-3),...s.at(-2),t,e)}function Zp(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);At(Ip,this).lineTo(...t)}function Jp(t,e){let i;if(Et(Hp,this,null),t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),vt(jp,this,Qp).call(this,t,e),vt(jp,this,Zp).call(this),1!==this.currentPath.length)i=vt(jp,this,ef).call(this);else{const n=[t,e];i=[[n,n.slice(),n.slice(),n]]}const n=At(Ip,this),s=this.currentPath;this.currentPath=[],Et(Ip,this,new Path2D);this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(n),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(vt(jp,this,af).call(this),vt(jp,this,rf).call(this)),vt(jp,this,mf).call(this))},mustExec:!0})}function $p(){if(!At(Dp,this))return;Et(Dp,this,!1);const t=Math.ceil(this.thickness*this.parentScale),e=this.currentPath.slice(-3),i=e.map(t=>t[0]),n=e.map(t=>t[1]),{ctx:s}=(Math.min(...i),Math.max(...i),Math.min(...n),Math.max(...n),this);s.save(),s.clearRect(0,0,this.canvas.width,this.canvas.height);for(const a of this.bezierPath2D)s.stroke(a);s.stroke(At(Ip,this)),s.restore()}function tf(t,e,i,n,s,a,r){const o=(e+n)/2,l=(i+s)/2,c=(n+a)/2,h=(s+r)/2;t.bezierCurveTo(o+2*(n-o)/3,l+2*(s-l)/3,c+2*(n-c)/3,h+2*(s-h)/3,c,h)}function ef(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let i,[n,s]=t[0];for(i=1;i<t.length-2;i++){const[a,r]=t[i],[o,l]=t[i+1],c=(a+o)/2,h=(r+l)/2,d=[n+2*(a-n)/3,s+2*(r-s)/3],u=[c+2*(a-c)/3,h+2*(r-h)/3];e.push([[n,s],d,u,[c,h]]),[n,s]=[c,h]}const[a,r]=t[i],[o,l]=t[i+1],c=[n+2*(a-n)/3,s+2*(r-s)/3],h=[o+2*(a-o)/3,l+2*(r-l)/3];return e.push([[n,s],c,h,[o,l]]),e}function nf(){if(this.isEmpty())return void vt(jp,this,cf).call(this);vt(jp,this,Yp).call(this);const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),vt(jp,this,cf).call(this);for(const i of this.bezierPath2D)e.stroke(i)}function sf(t){this.canvas.removeEventListener("pointerleave",At(Tp,this)),this.canvas.removeEventListener("pointermove",At(Lp,this)),this.canvas.removeEventListener("pointerup",At(Rp,this)),this.canvas.addEventListener("pointerdown",At(Fp,this),{signal:this._uiManager._signal}),At(Pp,this)&&clearTimeout(At(Pp,this)),Et(Pp,this,setTimeout(()=>{Et(Pp,this,null),this.canvas.removeEventListener("contextmenu",en)},10)),vt(jp,this,Jp).call(this,t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}function af(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}function rf(){Et(Wp,this,new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)})),At(Wp,this).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;null===(t=At(Wp,this))||void 0===t||t.disconnect(),Et(Wp,this,null)},{once:!0})}function of(){if(!At(Op,this))return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),vt(jp,this,cf).call(this)}function lf(t,e){const i=vt(jp,this,gf).call(this),n=(t-i)/At(Sp,this),s=(e-i)/At(Mp,this);this.scaleFactor=Math.min(n,s)}function cf(){const t=vt(jp,this,gf).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}function hf(t){const e=new Path2D;for(let i=0,n=t.length;i<n;i++){const[n,s,a,r]=t[i];0===i&&e.moveTo(...n),e.bezierCurveTo(s[0],s[1],a[0],a[1],r[0],r[1])}return e}function df(t,e,i){const[n,s,a,r]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]+=n,t[e+1]=r-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]+n,t[e+1]=i+s}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=a-t[e],t[e+1]+=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=a-t[e+1],t[e+1]=r-i}break;default:throw new Error("Invalid rotation")}return t}function uf(t,e,i){const[n,s,a,r]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]-=n,t[e+1]=r-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]-s,t[e+1]=i-n}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=a-t[e],t[e+1]-=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=r-t[e+1],t[e+1]=a-i}break;default:throw new Error("Invalid rotation")}return t}function pf(t,e,i,n){const s=[],a=this.thickness/2,r=t*e+a,o=t*i+a;for(const l of this.paths){const e=[],i=[];for(let n=0,s=l.length;n<s;n++){const[a,c,h,d]=l[n];if(a[0]===d[0]&&a[1]===d[1]&&1===s){const n=t*a[0]+r,s=t*a[1]+o;e.push(n,s),i.push(n,s);break}const u=t*a[0]+r,p=t*a[1]+o,f=t*c[0]+r,g=t*c[1]+o,m=t*h[0]+r,v=t*h[1]+o,b=t*d[0]+r,w=t*d[1]+o;0===n&&(e.push(u,p),i.push(u,p)),e.push(f,g,m,v,b,w),i.push(f,g),n===s-1&&i.push(b,w)}s.push({bezier:df.call(Pt,e,n,this.rotation),points:df.call(Pt,i,n,this.rotation)})}return s}function ff(){let t=1/0,e=-1/0,i=1/0,n=-1/0;for(const s of this.paths)for(const[a,r,o,l]of s){const s=ei.bezierBoundingBox(...a,...r,...o,...l);t=Math.min(t,s[0]),i=Math.min(i,s[1]),e=Math.max(e,s[2]),n=Math.max(n,s[3])}return[t,i,e,n]}function gf(){return At(Np,this)?Math.ceil(this.thickness*this.parentScale):0}function mf(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!At(Np,this))return void vt(jp,this,nf).call(this);const e=vt(jp,this,ff).call(this),i=vt(jp,this,gf).call(this);Et(Sp,this,Math.max(ja.MIN_SIZE,e[2]-e[0])),Et(Mp,this,Math.max(ja.MIN_SIZE,e[3]-e[1]));const n=Math.ceil(i+At(Sp,this)*this.scaleFactor),s=Math.ceil(i+At(Mp,this)*this.scaleFactor),[a,r]=this.parentDimensions;this.width=n/a,this.height=s/r,this.setAspectRatio(n,s);const o=this.translationX,l=this.translationY;this.translationX=-e[0],this.translationY=-e[1],vt(jp,this,of).call(this),vt(jp,this,nf).call(this),Et(zp,this,n),Et(Bp,this,s),this.setDims(n,s);const c=t?i/this.scaleFactor/2:0;this.translate(o-this.translationX-c,l-this.translationY-c)}Pt=Vp,(0,wt.A)(Vp,"_defaultColor",null),(0,wt.A)(Vp,"_defaultOpacity",1),(0,wt.A)(Vp,"_defaultThickness",1),(0,wt.A)(Vp,"_type","ink"),(0,wt.A)(Vp,"_editorType",Qt.INK);var vf=new WeakMap,bf=new WeakMap,wf=new WeakMap,yf=new WeakMap,Af=new WeakMap,Ef=new WeakMap,xf=new WeakMap,_f=new WeakMap,kf=new WeakMap,Cf=new WeakMap,Mf=new WeakMap,Sf=new WeakSet;class Lf extends ja{constructor(t){super((0,ut.A)((0,ut.A)({},t),{},{name:"stampEditor"})),mt(this,Sf),yt(this,vf,null),yt(this,bf,null),yt(this,wf,null),yt(this,yf,null),yt(this,Af,null),yt(this,Ef,""),yt(this,xf,null),yt(this,_f,null),yt(this,kf,null),yt(this,Cf,!1),yt(this,Mf,!1),Et(yf,this,t.bitmapUrl),Et(Af,this,t.bitmapFile)}static initialize(t,e){ja.initialize(t,e)}static get supportedTypes(){return He(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(t=>"image/".concat(t)))}static get supportedTypesStr(){return He(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(Qt.STAMP,{bitmapFile:t.getAsFile()})}remove(){var t,e;At(bf,this)&&(Et(vf,this,null),this._uiManager.imageManager.deleteId(At(bf,this)),null===(t=At(xf,this))||void 0===t||t.remove(),Et(xf,this,null),null===(e=At(_f,this))||void 0===e||e.disconnect(),Et(_f,this,null),At(kf,this)&&(clearTimeout(At(kf,this)),Et(kf,this,null)));super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(At(bf,this)&&null===At(xf,this)&&vt(Sf,this,Ff).call(this),this.isAttachedToDOM||this.parent.add(this))):At(bf,this)&&vt(Sf,this,Ff).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(At(wf,this)||At(vf,this)||At(yf,this)||At(Af,this)||At(bf,this))}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),At(vf,this)?vt(Sf,this,Pf).call(this):vt(Sf,this,Ff).call(this),this.width){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n)}return this.div}getImageForAltText(){return At(xf,this)}static deserialize(t,e,i){if(t instanceof ed)return null;const n=super.deserialize(t,e,i),{rect:s,bitmapUrl:a,bitmapId:r,isSvg:o,accessibilityData:l}=t;r&&i.imageManager.isValidId(r)?Et(bf,n,r):Et(yf,n,a),Et(Cf,n,o);const[c,h]=n.pageDimensions;return n.width=(s[2]-s[0])/c,n.height=(s[3]-s[1])/h,l&&(n.altTextData=l),n}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;const i={annotationType:Qt.STAMP,bitmapId:At(bf,this),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:At(Cf,this),structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=vt(Sf,this,Of).call(this,!0),i.accessibilityData=this.altTextData,i;const{decorative:n,altText:s}=this.altTextData;if(!n&&s&&(i.accessibilityData={type:"Figure",alt:s}),null===e)return i;e.stamps||(e.stamps=new Map);const a=At(Cf,this)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(At(bf,this))){if(At(Cf,this)){const t=e.stamps.get(At(bf,this));a>t.area&&(t.area=a,t.serialized.bitmap.close(),t.serialized.bitmap=vt(Sf,this,Of).call(this,!1))}}else e.stamps.set(At(bf,this),{area:a,serialized:i}),i.bitmap=vt(Sf,this,Of).call(this,!1);return i}}function Tf(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?(Et(vf,this,t.bitmap),e||(Et(bf,this,t.id),Et(Cf,this,t.isSvg)),t.file&&Et(Ef,this,t.file.name),vt(Sf,this,Pf).call(this)):this.remove()}function Rf(){Et(wf,this,null),this._uiManager.enableWaiting(!1),At(xf,this)&&this.div.focus()}function Ff(){if(At(bf,this))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(At(bf,this)).then(t=>vt(Sf,this,Tf).call(this,t,!0)).finally(()=>vt(Sf,this,Rf).call(this));if(At(yf,this)){const t=At(yf,this);return Et(yf,this,null),this._uiManager.enableWaiting(!0),void Et(wf,this,this._uiManager.imageManager.getFromUrl(t).then(t=>vt(Sf,this,Tf).call(this,t)).finally(()=>vt(Sf,this,Rf).call(this)))}if(At(Af,this)){const t=At(Af,this);return Et(Af,this,null),this._uiManager.enableWaiting(!0),void Et(wf,this,this._uiManager.imageManager.getFromFile(t).then(t=>vt(Sf,this,Tf).call(this,t)).finally(()=>vt(Sf,this,Rf).call(this)))}const t=document.createElement("input");t.type="file",t.accept=It.supportedTypesStr;const e=this._uiManager._signal;Et(wf,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]);vt(Sf,this,Tf).call(this,e)}else this.remove();i()},{signal:e}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:e})}).finally(()=>vt(Sf,this,Rf).call(this))),t.click()}function Pf(){const{div:t}=this;let{width:e,height:i}=At(vf,this);const[n,s]=this.pageDimensions,a=.75;if(this.width)e=this.width*n,i=this.height*s;else if(e>a*n||i>a*s){const t=Math.min(a*n/e,a*s/i);e*=t,i*=t}const[r,o]=this.parentDimensions;this.setDims(e*r/n,i*o/s),this._uiManager.enableWaiting(!1);const l=Et(xf,this,document.createElement("canvas"));t.append(l),t.hidden=!1,vt(Sf,this,Df).call(this,e,i),vt(Sf,this,Wf).call(this),At(Mf,this)||(this.parent.addUndoableEditor(this),Et(Mf,this,!0)),this._reportTelemetry({action:"inserted_image"}),At(Ef,this)&&l.setAttribute("aria-label",At(Ef,this))}function If(t,e){var i;const[n,s]=this.parentDimensions;this.width=t/n,this.height=e/s,this.setDims(t,e),null!==(i=this._initialOptions)&&void 0!==i&&i.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==At(kf,this)&&clearTimeout(At(kf,this));Et(kf,this,setTimeout(()=>{Et(kf,this,null),vt(Sf,this,Df).call(this,t,e)},200))}function Nf(t,e){const{width:i,height:n}=At(vf,this);let s=i,a=n,r=At(vf,this);for(;s>2*t||a>2*e;){const i=s,n=a;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));const o=new OffscreenCanvas(s,a);o.getContext("2d").drawImage(r,0,0,i,n,0,0,s,a),r=o.transferToImageBitmap()}return r}function Df(t,e){t=Math.ceil(t),e=Math.ceil(e);const i=At(xf,this);if(!i||i.width===t&&i.height===e)return;i.width=t,i.height=e;const n=At(Cf,this)?At(vf,this):vt(Sf,this,Nf).call(this,t,e);if(this._uiManager.hasMLManager&&!this.hasAltText()){const i=new OffscreenCanvas(t,e).getContext("2d");i.drawImage(n,0,0,n.width,n.height,0,0,t,e),this._uiManager.mlGuess({service:"image-to-text",request:{data:i.getImageData(0,0,t,e).data,width:t,height:e,channels:4}}).then(t=>{const e=(null===t||void 0===t?void 0:t.output)||"";this.parent&&e&&!this.hasAltText()&&(this.altTextData={altText:e,decorative:!1})})}const s=i.getContext("2d");s.filter=this._uiManager.hcmFilter,s.drawImage(n,0,0,n.width,n.height,0,0,t,e)}function Of(t){if(t){if(At(Cf,this)){const t=this._uiManager.imageManager.getSvgUrl(At(bf,this));if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=At(vf,this));return t.getContext("2d").drawImage(At(vf,this),0,0),t.toDataURL()}if(At(Cf,this)){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*_i.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*_i.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,n);return s.getContext("2d").drawImage(At(vf,this),0,0,At(vf,this).width,At(vf,this).height,0,0,i,n),s.transferToImageBitmap()}return structuredClone(At(vf,this))}function Wf(){this._uiManager._signal&&(Et(_f,this,new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&vt(Sf,this,If).call(this,e.width,e.height)})),At(_f,this).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;null===(t=At(_f,this))||void 0===t||t.disconnect(),Et(_f,this,null)},{once:!0}))}It=Lf,(0,wt.A)(Lf,"_type","stamp"),(0,wt.A)(Lf,"_editorType",Qt.STAMP);var zf=new WeakMap,Bf=new WeakMap,Hf=new WeakMap,jf=new WeakMap,Vf=new WeakMap,Uf=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 WeakSet;class $f{constructor(t){let{uiManager:e,pageIndex:i,div:n,accessibilityManager:s,annotationLayer:a,drawLayer:r,textLayer:o,viewport:l,l10n:c}=t;mt(this,Jf),yt(this,zf,void 0),yt(this,Bf,!1),yt(this,Hf,null),yt(this,jf,null),yt(this,Vf,null),yt(this,Uf,null),yt(this,Gf,null),yt(this,qf,new Map),yt(this,Xf,!1),yt(this,Yf,!1),yt(this,Kf,!1),yt(this,Qf,null),yt(this,Zf,void 0);const h=[...ag._.values()];if(!$f._initialized){$f._initialized=!0;for(const t of h)t.initialize(c,e)}e.registerEditorTypes(h),Et(Zf,this,e),this.pageIndex=i,this.div=n,Et(zf,this,s),Et(Hf,this,a),this.viewport=l,Et(Qf,this,o),this.drawLayer=r,At(Zf,this).addLayer(this)}get isEmpty(){return 0===At(qf,this).size}get isInvisible(){return this.isEmpty&&At(Zf,this).getMode()===Qt.NONE}updateToolbar(t){At(Zf,this).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:At(Zf,this).getMode();switch(vt(Jf,this,sg).call(this),t){case Qt.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case Qt.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case Qt.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;for(const i of ag._.values())e.toggle("".concat(i._type,"Editing"),t===i._editorType);this.div.hidden=!1}hasTextLayer(t){var e;return t===(null===(e=At(Qf,this))||void 0===e?void 0:e.div)}addInkEditorIfNeeded(t){if(At(Zf,this).getMode()!==Qt.INK)return;if(!t)for(const e of At(qf,this).values())if(e.isEmpty())return void e.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(t){At(Zf,this).setEditingState(t)}addCommands(t){At(Zf,this).addCommands(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=At(Hf,this))||void 0===t||t.div.classList.toggle("disabled",!e)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const i of At(qf,this).values())i.enableEditing(),i.show(!0),i.annotationElementId&&(At(Zf,this).removeChangedExistingAnnotation(i),t.add(i.annotationElementId));if(!At(Hf,this))return;const e=At(Hf,this).getEditableAnnotations();for(const i of e){if(i.hide(),At(Zf,this).isDeletedAnnotationElement(i.data.id))continue;if(t.has(i.data.id))continue;const e=this.deserialize(i);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){Et(Kf,this,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,e=new Map;for(const s of At(qf,this).values()){var i;s.disableEditing(),s.annotationElementId&&(null===s.serialize()?(e.set(s.annotationElementId,s),null===(i=this.getEditableAnnotation(s.annotationElementId))||void 0===i||i.show(),s.remove()):t.set(s.annotationElementId,s))}if(At(Hf,this)){const i=At(Hf,this).getEditableAnnotations();for(const n of i){const{id:i}=n.data;if(At(Zf,this).isDeletedAnnotationElement(i))continue;let s=e.get(i);s?(s.resetAnnotationElement(n),s.show(!1),n.show()):(s=t.get(i),s&&(At(Zf,this).addChangedExistingAnnotation(s),s.renderAnnotationElement(n),s.show(!1)),n.show())}}vt(Jf,this,sg).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:n}=this.div;for(const s of ag._.values())n.remove("".concat(s._type,"Editing"));this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),Et(Kf,this,!1)}getEditableAnnotation(t){var e;return(null===(e=At(Hf,this))||void 0===e?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){At(Zf,this).getActive()!==t&&At(Zf,this).setActiveEditor(t)}enableTextSelection(){var t;this.div.tabIndex=-1,null!==(t=At(Qf,this))&&void 0!==t&&t.div&&!At(Uf,this)&&(Et(Uf,this,vt(Jf,this,tg).bind(this)),At(Qf,this).div.addEventListener("pointerdown",At(Uf,this),{signal:At(Zf,this)._signal}),At(Qf,this).div.classList.add("highlighting"))}disableTextSelection(){var t;this.div.tabIndex=0,null!==(t=At(Qf,this))&&void 0!==t&&t.div&&At(Uf,this)&&(At(Qf,this).div.removeEventListener("pointerdown",At(Uf,this)),Et(Uf,this,null),At(Qf,this).div.classList.remove("highlighting"))}enableClick(){if(At(Vf,this))return;const t=At(Zf,this)._signal;Et(Vf,this,this.pointerdown.bind(this)),Et(jf,this,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",At(Vf,this),{signal:t}),this.div.addEventListener("pointerup",At(jf,this),{signal:t})}disableClick(){At(Vf,this)&&(this.div.removeEventListener("pointerdown",At(Vf,this)),this.div.removeEventListener("pointerup",At(jf,this)),Et(Vf,this,null),Et(jf,this,null))}attach(t){At(qf,this).set(t.id,t);const{annotationElementId:e}=t;e&&At(Zf,this).isDeletedAnnotationElement(e)&&At(Zf,this).removeDeletedAnnotationElement(t)}detach(t){var e;At(qf,this).delete(t.id),null===(e=At(zf,this))||void 0===e||e.removePointerInTextLayer(t.contentDiv),!At(Kf,this)&&t.annotationElementId&&At(Zf,this).addDeletedAnnotationElement(t)}remove(t){this.detach(t),At(Zf,this).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,At(Yf,this)||this.addInkEditorIfNeeded(!1)}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(At(Zf,this).addDeletedAnnotationElement(t.annotationElementId),ja.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),At(Zf,this).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),At(Zf,this).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var e;if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!At(Gf,this)&&(t._focusEventsAllowed=!1,Et(Gf,this,setTimeout(()=>{Et(Gf,this,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:At(Zf,this)._signal}),i.focus())},0))),t._structTreeParentId=null===(e=At(zf,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})}getNextId(){return At(Zf,this).getId()}get _signal(){return At(Zf,this)._signal}canCreateNewEmptyEditor(){var t;return null===(t=bt(Jf,this,eg))||void 0===t?void 0:t.canCreateNewEmptyEditor()}pasteEditor(t,e){At(Zf,this).updateToolbar(t),At(Zf,this).updateMode(t);const{offsetX:i,offsetY:n}=vt(Jf,this,ng).call(this),s=this.getNextId(),a=vt(Jf,this,ig).call(this,(0,ut.A)({parent:this,id:s,x:i,y:n,uiManager:At(Zf,this),isCentered:!0},e));a&&this.add(a)}deserialize(t){var e,i;return(null===(e=ag._.get(null!==(i=t.annotationType)&&void 0!==i?i:t.annotationEditorType))||void 0===e?void 0:e.deserialize(t,this,At(Zf,this)))||null}createAndAddNewEditor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.getNextId(),s=vt(Jf,this,ig).call(this,(0,ut.A)({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:At(Zf,this),isCentered:e},i));return s&&this.add(s),s}addNewEditor(){this.createAndAddNewEditor(vt(Jf,this,ng).call(this),!0)}setSelected(t){At(Zf,this).setSelected(t)}toggleSelected(t){At(Zf,this).toggleSelected(t)}isSelected(t){return At(Zf,this).isSelected(t)}unselect(t){At(Zf,this).unselect(t)}pointerup(t){const{isMac:e}=$e.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&At(Xf,this)&&(Et(Xf,this,!1),At(Bf,this)?At(Zf,this).getMode()!==Qt.STAMP?this.createAndAddNewEditor(t,!1):At(Zf,this).unselectAll():Et(Bf,this,!0))}pointerdown(t){if(At(Zf,this).getMode()===Qt.HIGHLIGHT&&this.enableTextSelection(),At(Xf,this))return void Et(Xf,this,!1);const{isMac:e}=$e.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;Et(Xf,this,!0);const i=At(Zf,this).getActive();Et(Bf,this,!i||i.isEmpty())}findNewParent(t,e,i){const n=At(Zf,this).findParent(e,i);return null!==n&&n!==this&&(n.changeParent(t),!0)}destroy(){var t;(null===(t=At(Zf,this).getActive())||void 0===t?void 0:t.parent)===this&&(At(Zf,this).commitOrRemove(),At(Zf,this).setActiveEditor(null)),At(Gf,this)&&(clearTimeout(At(Gf,this)),Et(Gf,this,null));for(const i of At(qf,this).values()){var e;null===(e=At(zf,this))||void 0===e||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove()}this.div=null,At(qf,this).clear(),At(Zf,this).removeLayer(this)}render(t){let{viewport:e}=t;this.viewport=e,hn(this.div,e);for(const i of At(Zf,this).getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update(t){let{viewport:e}=t;At(Zf,this).commitOrRemove(),vt(Jf,this,sg).call(this);const i=this.viewport.rotation,n=e.rotation;if(this.viewport=e,hn(this.div,{rotation:n}),i!==n)for(const s of At(qf,this).values())s.rotate(n);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return At(Zf,this).viewParameters.realScale}}function tg(t){if(At(Zf,this).unselectAll(),t.target===At(Qf,this).div){const{isMac:e}=$e.platform;if(0!==t.button||t.ctrlKey&&e)return;At(Zf,this).showAllEditors("highlight",!0,!0),At(Qf,this).div.classList.add("free"),dp.startHighlighting(this,"ltr"===At(Zf,this).direction,t),At(Qf,this).div.addEventListener("pointerup",()=>{At(Qf,this).div.classList.remove("free")},{once:!0,signal:At(Zf,this)._signal}),t.preventDefault()}}function eg(t){return ag._.get(At(Zf,t).getMode())}function ig(t){const e=bt(Jf,this,eg);return e?new e.prototype.constructor(t):null}function ng(){const{x:t,y:e,width:i,height:n}=this.div.getBoundingClientRect(),s=Math.max(0,t),a=Math.max(0,e),r=(s+Math.min(window.innerWidth,t+i))/2-t,o=(a+Math.min(window.innerHeight,e+n))/2-e,[l,c]=this.viewport.rotation%180===0?[r,o]:[o,r];return{offsetX:l,offsetY:c}}function sg(){Et(Yf,this,!0);for(const t of At(qf,this).values())t.isEmpty()&&t.remove();Et(Yf,this,!1)}(0,wt.A)($f,"_initialized",!1);var ag={_:new Map([kd,Vp,Lf,dp].map(t=>[t._editorType,t]))},rg=new WeakMap,og=new WeakMap,lg=new WeakMap,cg=new WeakMap,hg=new WeakSet;class dg{constructor(t){let{pageIndex:e}=t;mt(this,hg),yt(this,rg,null),yt(this,og,0),yt(this,lg,new Map),yt(this,cg,new Map),this.pageIndex=e}setParent(t){if(At(rg,this)){if(At(rg,this)!==t){if(At(lg,this).size>0)for(const e of At(lg,this).values())e.remove(),t.append(e);Et(rg,this,t)}}else Et(rg,this,t)}static get _svgFactory(){return He(this,"_svgFactory",new qi)}highlight(t,e,i){var n,s;let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=(Et(og,this,(n=At(og,this),s=n++,n)),s),o=vt(hg,this,pg).call(this,t.box);o.classList.add("highlight"),t.free&&o.classList.add("free");const l=dg._svgFactory.createElement("defs");o.append(l);const c=dg._svgFactory.createElement("path");l.append(c);const h="path_p".concat(this.pageIndex,"_").concat(r);c.setAttribute("id",h),c.setAttribute("d",t.toSVGPath()),a&&At(cg,this).set(r,c);const d=vt(hg,this,fg).call(this,l,h),u=dg._svgFactory.createElement("use");return o.append(u),o.setAttribute("fill",e),o.setAttribute("fill-opacity",i),u.setAttribute("href","#".concat(h)),At(lg,this).set(r,o),{id:r,clipPathId:"url(#".concat(d,")")}}highlightOutline(t){var e,i;const n=(Et(og,this,(e=At(og,this),i=e++,e)),i),s=vt(hg,this,pg).call(this,t.box);s.classList.add("highlightOutline");const a=dg._svgFactory.createElement("defs");s.append(a);const r=dg._svgFactory.createElement("path");a.append(r);const o="path_p".concat(this.pageIndex,"_").concat(n);let l;if(r.setAttribute("id",o),r.setAttribute("d",t.toSVGPath()),r.setAttribute("vector-effect","non-scaling-stroke"),t.free){s.classList.add("free");const t=dg._svgFactory.createElement("mask");a.append(t),l="mask_p".concat(this.pageIndex,"_").concat(n),t.setAttribute("id",l),t.setAttribute("maskUnits","objectBoundingBox");const e=dg._svgFactory.createElement("rect");t.append(e),e.setAttribute("width","1"),e.setAttribute("height","1"),e.setAttribute("fill","white");const i=dg._svgFactory.createElement("use");t.append(i),i.setAttribute("href","#".concat(o)),i.setAttribute("stroke","none"),i.setAttribute("fill","black"),i.setAttribute("fill-rule","nonzero"),i.classList.add("mask")}const c=dg._svgFactory.createElement("use");s.append(c),c.setAttribute("href","#".concat(o)),l&&c.setAttribute("mask","url(#".concat(l,")"));const h=c.cloneNode();return s.append(h),c.classList.add("mainOutline"),h.classList.add("secondaryOutline"),At(lg,this).set(n,s),n}finalizeLine(t,e){const i=At(cg,this).get(t);At(cg,this).delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}updateLine(t,e){At(lg,this).get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}removeFreeHighlight(t){this.remove(t),At(cg,this).delete(t)}updatePath(t,e){At(cg,this).get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){ug.call(dg,At(lg,this).get(t),e)}show(t,e){At(lg,this).get(t).classList.toggle("hidden",!e)}rotate(t,e){At(lg,this).get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){At(lg,this).get(t).setAttribute("fill",e)}changeOpacity(t,e){At(lg,this).get(t).setAttribute("fill-opacity",e)}addClass(t,e){At(lg,this).get(t).classList.add(e)}removeClass(t,e){At(lg,this).get(t).classList.remove(e)}remove(t){null!==At(rg,this)&&(At(lg,this).get(t).remove(),At(lg,this).delete(t))}destroy(){Et(rg,this,null);for(const t of At(lg,this).values())t.remove();At(lg,this).clear()}}function ug(t){let{x:e=0,y:i=0,width:n=1,height:s=1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{style:a}=t;a.top="".concat(100*i,"%"),a.left="".concat(100*e,"%"),a.width="".concat(100*n,"%"),a.height="".concat(100*s,"%")}function pg(t){const e=Nt._svgFactory.create(1,1,!0);return At(rg,this).append(e),e.setAttribute("aria-hidden",!0),ug.call(Nt,e,t),e}function fg(t,e){const i=Nt._svgFactory.createElement("clipPath");t.append(i);const n="clip_".concat(e);i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=Nt._svgFactory.createElement("use");return i.append(s),s.setAttribute("href","#".concat(e)),s.classList.add("clip"),n}Nt=dg;var gg=Ot.AnnotationLayer,mg=Ot.AnnotationMode,vg=Ot.GlobalWorkerOptions,bg=Ot.PDFDataRangeTransport,wg=Ot.TextLayer,yg=Ot.getDocument,Ag=i(89261),Eg=function(t,e,i){if(i||2===arguments.length)for(var n,s=0,a=e.length;s<a;s++)!n&&s in e||(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))},xg=Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg([],["onCopy","onCut","onPaste"],!0),["onCompositionEnd","onCompositionStart","onCompositionUpdate"],!0),["onFocus","onBlur"],!0),["onInput","onInvalid","onReset","onSubmit"],!0),["onLoad","onError"],!0),["onKeyDown","onKeyPress","onKeyUp"],!0),["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],!0),["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],!0),["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],!0),["onSelect"],!0),["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],!0),["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],!0),["onScroll"],!0),["onWheel"],!0),["onAnimationStart","onAnimationEnd","onAnimationIteration"],!0),["onTransitionEnd"],!0),["onChange"],!0),["onToggle"],!0);function _g(t,e){var i={};return xg.forEach(function(n){var s=t[n];s&&(i[n]=e?function(t){return s(t,e(n))}:s)}),i}function kg(t){var e=!1;return{promise:new Promise(function(i,n){t.then(function(t){return!e&&i(t)}).catch(function(t){return!e&&n(t)})}),cancel:function(){e=!0}}}function Cg(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=Cg(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}const Mg=function(){for(var t,e,i=0,n="",s=arguments.length;i<s;i++)(t=arguments[i])&&(e=Cg(t))&&(n&&(n+=" "),n+=e);return n};var Sg="Invariant failed";function Lg(t,e){if(!t)throw new Error(Sg)}var Tg=i(98677),Rg=Object.prototype.hasOwnProperty;function Fg(t,e,i){for(i of t.keys())if(Pg(i,e))return i}function Pg(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--&&Pg(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=Fg(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=Fg(e,s)))return!1;if(!Pg(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(Rg.call(t,i)&&++n&&!Rg.call(e,i))return!1;if(!(i in e)||!Pg(t[i],e[i]))return!1}return Object.keys(e).length===n}}return t!==t&&e!==e}const Ig=(0,s.createContext)(null);function Ng(t){let{children:e,type:i}=t;return(0,Ag.jsx)("div",{className:"react-pdf__message react-pdf__message--".concat(i),children:e})}class Dg{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(t){this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setExternalLinkRel(t){this.externalLinkRel=t}setExternalLinkTarget(t){this.externalLinkTarget=t}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return Lg(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(t){Lg(this.pdfViewer),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise(e=>{Lg(this.pdfDocument),Lg(t),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)}).then(t=>{Lg(Array.isArray(t),'"'.concat(t,'" is not a valid destination array.'));const e=t[0];new Promise(t=>{Lg(this.pdfDocument),e instanceof Object?this.pdfDocument.getPageIndex(e).then(e=>{t(e)}).catch(()=>{Lg(!1,'"'.concat(e,'" is not a valid page reference.'))}):"number"===typeof e?t(e):Lg(!1,'"'.concat(e,'" is not a valid destination reference.'))}).then(e=>{const i=e+1;Lg(this.pdfViewer),Lg(i>=1&&i<=this.pagesCount,'"'.concat(i,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:i})})})}navigateTo(t){this.goToDestination(t)}goToPage(t){const e=t-1;Lg(this.pdfViewer),Lg(t>=1&&t<=this.pagesCount,'"'.concat(t,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}addLinkAttributes(t,e,i){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=i?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const Og={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},Wg="undefined"!==typeof window,zg=Wg&&"file:"===window.location.protocol;function Bg(t){return function(t){return"undefined"!==typeof t}(t)&&null!==t}function Hg(t){return function(t){return"string"===typeof t}(t)&&/^data:/.test(t)}function jg(t){Lg(Hg(t));const[e="",i=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(i):unescape(i)}function Vg(){return Wg&&window.devicePixelRatio||1}const Ug="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function Gg(){Tg(!zg,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ".concat(Ug))}function qg(t){(null===t||void 0===t?void 0:t.cancel)&&t.cancel()}function Xg(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}function Yg(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 Kg(){return(0,s.useReducer)(Yg,{value:void 0,error:void 0})}var Qg=function(t,e,i,n){return new(i||(i=Promise))(function(s,a){function r(t){try{l(n.next(t))}catch(e){a(e)}}function o(t){try{l(n.throw(t))}catch(e){a(e)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(r,o)}l((n=n.apply(t,e||[])).next())})},Zg=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const{Tm:Jg}=n,$g=(t,e)=>{switch(e){case Og.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case Og.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function tm(t){return"object"===typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const em=(0,s.forwardRef)(function(t,e){var{children:i,className:n,error:a="Failed to load PDF file.",externalLinkRel:r,externalLinkTarget:o,file:l,inputRef:c,imageResourcesPath:h,loading:d="Loading PDF\u2026",noData:u="No PDF file specified.",onItemClick:p,onLoadError:f,onLoadProgress:g,onLoadSuccess:m,onPassword:v=$g,onSourceError:b,onSourceSuccess:w,options:y,renderMode:A,rotate:E}=t,x=Zg(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[_,k]=Kg(),{value:C,error:M}=_,[S,L]=Kg(),{value:T,error:R}=S,F=(0,s.useRef)(new Dg),P=(0,s.useRef)([]),I=(0,s.useRef)(void 0),N=(0,s.useRef)(void 0);l&&l!==I.current&&tm(l)&&(Tg(!Pg(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&&(Tg(!Pg(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 D=(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=P.current[n];s?s.scrollIntoView():Tg(!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:F,pages:P,viewer:D}),[]),(0,s.useEffect)(function(){k({type:"RESET"})},[l,k]);const O=(0,s.useCallback)(()=>Qg(this,void 0,void 0,function*(){if(!l)return null;if("string"===typeof l){if(Hg(l)){return{data:jg(l)}}return Gg(),{url:l}}if(l instanceof Jg)return{range:l};if(l instanceof ArrayBuffer)return{data:l};if(Wg&&function(t){return Lg(Wg),t instanceof Blob}(l)){const t=yield 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(Lg("object"===typeof l),Lg(tm(l)),"url"in l&&"string"===typeof l.url){if(Hg(l.url)){const{url:t}=l,e=Zg(l,["url"]),i=jg(t);return Object.assign({data:i},e)}Gg()}return l}),[l]);(0,s.useEffect)(()=>{const t=kg(O());return t.promise.then(t=>{k({type:"RESOLVE",value:t})}).catch(t=>{k({type:"REJECT",error:t})}),()=>{qg(t)}},[O,k]),(0,s.useEffect)(()=>{"undefined"!==typeof C&&(!1!==C?w&&w():M&&(Tg(!1,M.toString()),b&&b(M)))},[C]),(0,s.useEffect)(function(){L({type:"RESET"})},[L,C]),(0,s.useEffect)(function(){if(!C)return;const t=y?Object.assign(Object.assign({},C),y):C,e=yg(t);g&&(e.onProgress=g),v&&(e.onPassword=v);const i=e,n=i.promise.then(t=>{L({type:"RESOLVE",value:t})}).catch(t=>{i.destroyed||L({type:"REJECT",error:t})});return()=>{n.finally(()=>i.destroy())}},[y,L,C]),(0,s.useEffect)(()=>{"undefined"!==typeof T&&(!1!==T?T&&(m&&m(T),P.current=new Array(T.numPages),F.current.setDocument(T)):R&&(Tg(!1,R.toString()),f&&f(R)))},[T]),(0,s.useEffect)(function(){F.current.setViewer(D.current),F.current.setExternalLinkRel(r),F.current.setExternalLinkTarget(o)},[r,o]);const W=(0,s.useCallback)((t,e)=>{P.current[t]=e},[]),z=(0,s.useCallback)(t=>{delete P.current[t]},[]),B=(0,s.useMemo)(()=>({imageResourcesPath:h,linkService:F.current,onItemClick:p,pdf:T,registerPage:W,renderMode:A,rotate:E,unregisterPage:z}),[h,p,T,W,A,E,z]),H=(0,s.useMemo)(()=>_g(x,()=>T),[x,T]);return(0,Ag.jsx)("div",Object.assign({className:Mg("react-pdf__Document",n),ref:c,style:{"--scale-factor":"1"}},H,{children:l?void 0===T||null===T?(0,Ag.jsx)(Ng,{type:"loading",children:"function"===typeof d?d():d}):!1===T?(0,Ag.jsx)(Ng,{type:"error",children:"function"===typeof a?a():a}):(0,Ag.jsx)(Ig.Provider,{value:B,children:i}):(0,Ag.jsx)(Ng,{type:"no-data",children:"function"===typeof u?u():u})}))});function im(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=t.filter(Boolean);return i.length<=1?i[0]||null:function(t){i.forEach(function(e){"function"===typeof e?e(t):e&&(e.current=t)})}}const nm=(0,s.createContext)(null),sm={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},am=/^H(\d+)$/;function rm(t){return"children"in t}function om(t){return!!rm(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function lm(t){const e={};if(rm(t)){const{role:i}=t,n=i.match(am);if(n)e.role="heading",e["aria-level"]=Number(n[1]);else if(function(t){return t in sm}(i)){const t=sm[i];t&&(e.role=t)}}return e}function cm(t){const e={};if(rm(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),om(t)){const[i]=t.children;if(i){const t=cm(i);return Object.assign(Object.assign({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function hm(t){return t?Object.assign(Object.assign({},lm(t)),cm(t)):null}function dm(t){let{className:e,node:i}=t;const n=(0,s.useMemo)(()=>hm(i),[i]),a=(0,s.useMemo)(()=>rm(i)?om(i)?null:i.children.map((t,e)=>(0,Ag.jsx)(dm,{node:t},e)):null,[i]);return(0,Ag.jsx)("span",Object.assign({className:e},n,{children:a}))}function um(){return(0,s.useContext)(nm)}function pm(){const t=um();Lg(t);const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[n,a]=Kg(),{value:r,error:o}=n,{customTextRenderer:l,page:c}=t;return(0,s.useEffect)(function(){a({type:"RESET"})},[a,c]),(0,s.useEffect)(function(){if(l)return;if(!c)return;const t=kg(c.getStructTree()),e=t;return t.promise.then(t=>{a({type:"RESOLVE",value:t})}).catch(t=>{a({type:"REJECT",error:t})}),()=>qg(e)},[l,c,a]),(0,s.useEffect)(()=>{void 0!==r&&(!1!==r?r&&i&&i(r):o&&(Tg(!1,o.toString()),e&&e(o)))},[r]),r?(0,Ag.jsx)(dm,{className:"react-pdf__Page__structTree structTree",node:r}):null}const fm=mg;function gm(t){const e=um();Lg(e);const i=Object.assign(Object.assign({},e),t),{_className:n,canvasBackground:a,devicePixelRatio:r=Vg(),onRenderError:o,onRenderSuccess:l,page:c,renderForms:h,renderTextLayer:d,rotate:u,scale:p}=i,{canvasRef:f}=t;Lg(c);const g=(0,s.useRef)(null);function m(t){(function(t){return"RenderingCancelledException"===t.name})(t)||(Tg(!1,t.toString()),o&&o(t))}const v=(0,s.useMemo)(()=>c.getViewport({scale:p*r,rotation:u}),[r,c,u,p]),b=(0,s.useMemo)(()=>c.getViewport({scale:p,rotation:u}),[c,u,p]);(0,s.useEffect)(function(){if(!c)return;c.cleanup();const{current:t}=g;if(!t)return;t.width=v.width,t.height=v.height,t.style.width="".concat(Math.floor(b.width),"px"),t.style.height="".concat(Math.floor(b.height),"px"),t.style.visibility="hidden";const e={annotationMode:h?fm.ENABLE_FORMS:fm.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:v};a&&(e.background=a);const i=c.render(e),n=i;return i.promise.then(()=>{t.style.visibility="",c&&l&&l(Xg(c,p))}).catch(m),()=>qg(n)},[a,c,h,v,b]);const w=(0,s.useCallback)(()=>{const{current:t}=g;t&&(t.width=0,t.height=0)},[]);return(0,s.useEffect)(()=>w,[w]),(0,Ag.jsx)("canvas",{className:"".concat(n,"__canvas"),dir:"ltr",ref:im(f,g),style:{display:"block",userSelect:"none"},children:d?(0,Ag.jsx)(pm,{}):null})}function mm(){const t=um();Lg(t);const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:n,onRenderTextLayerError:a,onRenderTextLayerSuccess:r,page:o,pageIndex:l,pageNumber:c,rotate:h,scale:d}=t;Lg(o);const[u,p]=Kg(),{value:f,error:g}=u,m=(0,s.useRef)(null),v=(0,s.useRef)(void 0);Tg(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=kg(o.getTextContent()),e=t;return t.promise.then(t=>{p({type:"RESOLVE",value:t})}).catch(t=>{p({type:"REJECT",error:t})}),()=>qg(e)},[o,p]),(0,s.useEffect)(()=>{void 0!==f&&(!1!==f?f&&n&&n(f):g&&(Tg(!1,g.toString()),i&&i(g)))},[f]);const b=(0,s.useCallback)(()=>{r&&r()},[r]),w=(0,s.useCallback)(t=>{Tg(!1,t.toString()),a&&a(t)},[a]);const y=(0,s.useMemo)(()=>o.getViewport({scale:d,rotation:h}),[o,h,d]);return(0,s.useLayoutEffect)(function(){if(!o||!f)return;const{current:t}=m;if(!t)return;t.innerHTML="";const i=o.streamTextContent({includeMarkedContent:!0}),n=new wg({container:t,textContentSource:i,viewport:y}),s=n;return n.render().then(()=>{const i=document.createElement("div");i.className="endOfContent",t.append(i),v.current=i;const n=t.querySelectorAll('[role="presentation"]');if(e){let t=0;f.items.forEach((i,s)=>{if(!function(t){return"str"in t}(i))return;const a=n[t];if(!a)return;const r=e(Object.assign({pageIndex:l,pageNumber:c,itemIndex:s},i));a.innerHTML=r,t+=i.str&&i.hasEOL?2:1})}b()}).catch(w),()=>qg(s)},[e,w,b,o,l,c,f,y]),(0,Ag.jsx)("div",{className:Mg("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=v.current;t&&t.classList.remove("active")},onMouseDown:function(){const t=v.current;t&&t.classList.add("active")},ref:m})}function vm(){return(0,s.useContext)(Ig)}function bm(){const t=vm(),e=um();Lg(e);const i=Object.assign(Object.assign({},t),e),{imageResourcesPath:n,linkService:a,onGetAnnotationsError:r,onGetAnnotationsSuccess:o,onRenderAnnotationLayerError:l,onRenderAnnotationLayerSuccess:c,page:h,pdf:d,renderForms:u,rotate:p,scale:f=1}=i;Lg(d),Lg(h),Lg(a);const[g,m]=Kg(),{value:v,error:b}=g,w=(0,s.useRef)(null);Tg(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=kg(h.getAnnotations()),e=t;return t.promise.then(t=>{m({type:"RESOLVE",value:t})}).catch(t=>{m({type:"REJECT",error:t})}),()=>{qg(e)}},[m,h]),(0,s.useEffect)(()=>{void 0!==v&&(!1!==v?v&&o&&o(v):b&&(Tg(!1,b.toString()),r&&r(b)))},[v]);const y=(0,s.useMemo)(()=>h.getViewport({scale:f,rotation:p}),[h,p,f]);return(0,s.useEffect)(function(){if(!d||!h||!a||!v)return;const{current:t}=w;if(!t)return;const e=y.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:t,l10n:null,page:h,viewport:e},s={annotations:v,annotationStorage:d.annotationStorage,div:t,imageResourcesPath:n,linkService:a,page:h,renderForms:u,viewport:e};t.innerHTML="";try{new gg(i).render(s),c&&c()}catch(r){!function(t){Tg(!1,"".concat(t)),l&&l(t)}(r)}return()=>{}},[v,n,a,h,d,u,y]),(0,Ag.jsx)("div",{className:Mg("react-pdf__Page__annotations","annotationLayer"),ref:w})}var wm=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const ym=1;function Am(t){const e=vm(),i=Object.assign(Object.assign({},e),t),{_className:n="react-pdf__Page",_enableRegisterUnregisterPage:a=!0,canvasBackground:r,canvasRef:o,children:l,className:c,customRenderer:h,customTextRenderer:d,devicePixelRatio:u,error:p="Failed to load the page.",height:f,inputRef:g,loading:m="Loading page\u2026",noData:v="No page specified.",onGetAnnotationsError:b,onGetAnnotationsSuccess:w,onGetStructTreeError:y,onGetStructTreeSuccess:A,onGetTextError:E,onGetTextSuccess:x,onLoadError:_,onLoadSuccess:k,onRenderAnnotationLayerError:C,onRenderAnnotationLayerSuccess:M,onRenderError:S,onRenderSuccess:L,onRenderTextLayerError:T,onRenderTextLayerSuccess:R,pageIndex:F,pageNumber:P,pdf:I,registerPage:N,renderAnnotationLayer:D=!0,renderForms:O=!1,renderMode:W="canvas",renderTextLayer:z=!0,rotate:B,scale:H=ym,unregisterPage:j,width:V}=i,U=wm(i,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[G,q]=Kg(),{value:X,error:Y}=G,K=(0,s.useRef)(null);Lg(I);const Q=Bg(P)?P-1:null!==F&&void 0!==F?F:null,Z=null!==P&&void 0!==P?P:Bg(F)?F+1:null,J=null!==B&&void 0!==B?B:X?X.rotate:null,$=(0,s.useMemo)(()=>{if(!X)return null;let t=1;const e=null!==H&&void 0!==H?H:ym;if(V||f){const e=X.getViewport({scale:1,rotation:J});V?t=V/e.width:f&&(t=f/e.height)}return e*t},[f,X,J,H,V]);(0,s.useEffect)(function(){return()=>{Bg(Q)&&a&&j&&j(Q)}},[a,I,Q,j]),(0,s.useEffect)(function(){q({type:"RESET"})},[q,I,Q]),(0,s.useEffect)(function(){if(!I||!Z)return;const t=kg(I.getPage(Z)),e=t;return t.promise.then(t=>{q({type:"RESOLVE",value:t})}).catch(t=>{q({type:"REJECT",error:t})}),()=>qg(e)},[q,I,Z]),(0,s.useEffect)(()=>{void 0!==X&&(!1!==X?function(){if(k){if(!X||!$)return;k(Xg(X,$))}if(a&&N){if(!Bg(Q)||!K.current)return;N(Q,K.current)}}():Y&&(Tg(!1,Y.toString()),_&&_(Y)))},[X,$]);const tt=(0,s.useMemo)(()=>X&&Bg(Q)&&Z&&Bg(J)&&Bg($)?{_className:n,canvasBackground:r,customTextRenderer:d,devicePixelRatio:u,onGetAnnotationsError:b,onGetAnnotationsSuccess:w,onGetStructTreeError:y,onGetStructTreeSuccess:A,onGetTextError:E,onGetTextSuccess:x,onRenderAnnotationLayerError:C,onRenderAnnotationLayerSuccess:M,onRenderError:S,onRenderSuccess:L,onRenderTextLayerError:T,onRenderTextLayerSuccess:R,page:X,pageIndex:Q,pageNumber:Z,renderForms:O,renderTextLayer:z,rotate:J,scale:$}:null,[n,r,d,u,b,w,y,A,E,x,C,M,S,L,T,R,X,Q,Z,O,z,J,$]),et=(0,s.useMemo)(()=>_g(U,()=>X?$?Xg(X,$):void 0:X),[U,X,$]),it="".concat(Q,"@").concat($,"/").concat(J);function nt(){switch(W){case"custom":return Lg(h),(0,Ag.jsx)(h,{},"".concat(it,"_custom"));case"none":return null;default:return(0,Ag.jsx)(gm,{canvasRef:o},"".concat(it,"_canvas"))}}return(0,Ag.jsx)("div",Object.assign({className:Mg(n,c),"data-page-number":Z,ref:im(g,K),style:{"--scale-factor":"".concat($),backgroundColor:r||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},et,{children:Z?null===I||void 0===X||null===X?(0,Ag.jsx)(Ng,{type:"loading",children:"function"===typeof m?m():m}):!1===I||!1===X?(0,Ag.jsx)(Ng,{type:"error",children:"function"===typeof p?p():p}):(0,Ag.jsxs)(nm.Provider,{value:tt,children:[nt(),z?(0,Ag.jsx)(mm,{},"".concat(it,"_text")):null,D?(0,Ag.jsx)(bm,{},"".concat(it,"_annotations")):null,l]}):(0,Ag.jsx)(Ng,{type:"no-data",children:"function"===typeof v?v():v})}))}var Em=i(50805),xm=i(15747),_m=i(67346);const km=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]),a=(0,_m.A)(n,2),r=a[0],o=a[1],l=i.current?t[e.value]:r;return[l,(0,x.A)(function(n){for(var s="function"===typeof n?l=n(l):n,a=arguments.length,r=new Array(a>1?a-1:0),c=1;c<a;c++)r[c-1]=arguments[c];t[e.onChange]&&t[e.onChange].apply(t,[s].concat(r)),i.current||o(s)})]};var Cm;const Mm=["title","titleId"];function Sm(){return Sm=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},Sm.apply(null,arguments)}function Lm(t,e){let{title:i,titleId:n}=t,a=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 a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)i=a[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,Mm);return s.createElement("svg",Sm({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},a),i?s.createElement("title",{id:n},i):null,Cm||(Cm=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 Tm=s.forwardRef(Lm);i.p;var Rm,Fm;const Pm=["title","titleId"];function Im(){return Im=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},Im.apply(null,arguments)}function Nm(t,e){let{title:i,titleId:n}=t,a=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 a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)i=a[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,Pm);return s.createElement("svg",Im({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},a),void 0===i?s.createElement("title",{id:n},"\u7f16\u7ec4 10"):i?s.createElement("title",{id:n},i):null,Rm||(Rm=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%"})))),Fm||(Fm=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 Dm=s.forwardRef(Nm);i.p;var Om;const Wm=["title","titleId"];function zm(){return zm=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},zm.apply(null,arguments)}function Bm(t,e){let{title:i,titleId:n}=t,a=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 a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)i=a[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,Wm);return s.createElement("svg",zm({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},a),void 0===i?s.createElement("title",{id:n},"\u5934\u50cf-\u5973"):i?s.createElement("title",{id:n},i):null,Om||(Om=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 Hm=s.forwardRef(Bm);i.p;var jm;const Vm=["title","titleId"];function Um(){return Um=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},Um.apply(null,arguments)}function Gm(t,e){let{title:i,titleId:n}=t,a=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 a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)i=a[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,Vm);return s.createElement("svg",Um({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},a),void 0===i?s.createElement("title",{id:n},"\u5934\u50cf-\u7537"):i?s.createElement("title",{id:n},i):null,jm||(jm=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 qm=s.forwardRef(Gm);i.p;function Xm(){return Xm=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},Xm.apply(this,arguments)}var Ym={doc:t=>s.createElement("svg",Xm({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",Xm({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",Xm({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",Xm({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",Xm({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",Xm({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",Xm({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",Xm({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",Xm({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",Xm({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",Xm({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",Xm({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",Xm({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",Xm({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",Xm({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",Xm({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",Xm({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 Km=t=>{const{size:e,type:i}=Object.assign({},{size:40,type:"unknow"},t),n=Ym[i]||Ym.unknow;return a().createElement(n,{width:e,height:e})};var Qm=i(85553),Zm=i(92679),Jm=i.n(Zm),$m=i(80263),tv=i.n($m);var ev=i(57325),iv=i.n(ev);function nv(){return nv=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},nv.apply(null,arguments)}function sv(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 av=["id","url","error","apis","loading","ttl","cacheName"],rv=["paramsType","paramsName"],ov=["data"],lv=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,f=sv(n,av),{apis:g}=(0,r.usePreset)(),m=h()({},g,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:b,paramsName:w}=v,y=sv(v,rv),A={},E=s.split("?")[0];return A[b]={[w]:E},a().createElement(l(),nv({},Object.assign({},y,A),{updateType:"refresh",error:o,loading:d,cache:p,ttl:u,render:e=>{let{data:i}=e,n=sv(e,ov);return a().createElement(t,nv({},f,{id:E,data:i,fetchApi:n}))}}))},cv=["data","children"],hv=(lv(t=>{let{data:e,children:i}=t;return i(nv({url:e},sv(t,cv)))}),(t,e)=>{const i=document.createElement("a"),n=new MouseEvent("click");i.download=e,i.target="_blank",i.href=t,i.dispatchEvent(n)}),dv=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 hv(t,e);if("[object Blob]"===Object.prototype.toString.call(t)){const i=new Blob([t],{type:t.type});return void hv(URL.createObjectURL(i),e)}const n=(0,o.getAjax)(),{data:s,headers:a}=await n({url:t,responseType:"blob"}),r=null==a?void 0:a["content-disposition"];if(r){const t=r.match(/filename\*?=(?:UTF-8'')?([^;]+)/i);if(t&&t[1])e=decodeURIComponent(t[1].replace(/['"]/g,""));else{const t=r.match(/filename="?([^"]+)"?/i);t&&(e=t[1])}}hv(URL.createObjectURL(new Blob([s],{type:null==s?void 0:s.type})),e)},uv=t=>{let{url:e,staticUrl:i}=t;return/^(blob:)?https?:\/\//.test(e)?e:i+e},pv=t=>{let{url:e,staticUrl:i}=t;var n;const{apis:s}=(0,r.usePreset)(),a=i||(null==(n=s.file)?void 0:n.staticUrl)||"";return uv({staticUrl:a,url:e})},fv=["paramsType","paramsName"],gv=["isLoading","data","error","refresh"],mv=t=>{let{id:e,src:i,filename:n,staticUrl:a,apis:l,onError:c,onSuccess:h}=t;var u,p;const{message:f}=d.App.useApp(),{apis:g}=(0,r.usePreset)(),m=Object.assign({},g,l),v=a||(null==(u=m.file)?void 0:u.staticUrl)||"",[b,w]=(0,s.useState)(!1),y=Object.assign({paramsType:"params",paramsName:"id"},null==(p=m.file)?void 0:p.getUrl),{paramsType:A,paramsName:E}=y,_=sv(y,fv),k={};k[A]={[E]:e};const C=(0,o.useFetch)(Object.assign({},_,k,{auto:!1})),{isLoading:M,data:S,error:L,refresh:T}=C,R=sv(C,gv),F=(0,x.A)(c||f.error),P=(0,x.A)(h),I=(0,x.A)(t=>dv(uv({staticUrl:v,url:t}),n).then(P).catch(t=>{F(t.message)}));return(0,s.useEffect)(()=>{M||(L?F(L):S&&(w(!0),I(S).then(()=>{w(!1)})))},[M,L,S,F]),nv({},R,{isLoading:M||b,download:()=>i?I(i):T(e?k:{})})},vv={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"},bv=["id","src","filename","api","onSuccess","onError","onClick"],wv=(0,C.createWithIntlProvider)("zh-CN",vv,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),i=Object.assign({},{filename:e({id:"unnamedDownloadFile"})},t),{id:n,src:s,filename:r,api:o,onSuccess:l,onError:c,onClick:h}=i,p=sv(i,bv),{isLoading:f,download:g}=mv({id:n,src:s,filename:r,api:o,onError:c,onSuccess:l});return a().createElement(d.Button,nv({icon:a().createElement(u.A,null)},k()(p,["locale"]),{loading:f,onClick:function(){h&&h(...arguments),g()}}))});wv.useDownload=mv,wv.download=hv,wv.downloadBlobFile=dv;var yv="_Cmp6z",Av="_lmC4r",Ev="_-jyU7",xv="_lN9hC",_v="_yaqrz",kv="_SXsiw",Cv="_15U-a",Mv="_tpRpL";const Sv=["className","url","maxWidth","ignoreContent"],Lv=(0,C.createWithIntlProvider)("zh-CN",vv,"react-file")(t=>{let{data:e,apis:i,contentWindowUrl:n}=t;var o;const l=(0,s.useRef)(null),{apis:c}=(0,r.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)},[]),a().createElement("iframe",{title:h({id:"filePreview"}),frameBorder:"0",width:"100%",ref:l})}),Tv=(0,C.createWithIntlProvider)("zh-CN",vv,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),i=Object.assign({},t),{className:n,url:s,maxWidth:r,ignoreContent:o}=i,c=sv(i,Sv),h=a().createElement("iframe",{title:e({id:"filePreview"}),src:s,width:"100%",className:Mv});return a().createElement("div",{className:dt()(n,yv),style:{maxWidth:r}},o?h:a().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 a().createElement(Lv,nv({},c,{url:s,data:e}))}}))}),Rv=["url","filename","type"],Fv=t=>{var e;let{url:i,filename:n,type:s}=t,o=sv(t,Rv);const{apis:l}=(0,r.usePreset)(),c=Object.assign({},l,o.apis),h=pv({staticUrl:o.staticUrl||(null==(e=c.file)?void 0:e.staticUrl),url:i}),d=s&&jv[s]||Vv(n||h);return a().createElement(d,nv({},o,{url:h}))},Pv=["url","apis","className"],Iv=(0,s.memo)((0,C.createWithIntlProvider)("zh-CN",vv,"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),[f,g]=(0,s.useState)(0),{apis:m}=(0,r.usePreset)(),v=Object.assign({},m,o),b=p||(null==(e=v.file)?void 0:e.pdfjsUrl)||"https://cdn.jsdelivr.net/npm/pdfjs-dist@4.4.168";vg.workerSrc=b+"/build/pdf.worker.min.mjs";const w=(0,s.useMemo)(()=>({file:n,options:{standardFontDataUrl:b+"/standard_fonts/",cMapUrl:b+"/cmaps/",cMapPacked:!0}}),[b,n]),[y,A]=(0,s.useState)(l),E=(0,Em.A)(()=>{E.current&&E.current.clientWidth&&A(Math.min(E.current.clientWidth,l))});return a().createElement("div",{ref:E,className:dt()(u,yv),style:{maxWidth:l}},a().createElement(em,nv({},w,{error:i({id:"fileLoadedError"}),loading:a().createElement("div",{className:Av},a().createElement(d.Spin,null)),noData:i({id:"fileNotFoundError"}),onLoadSuccess:t=>{let{numPages:e}=t;g(e)}}),a().createElement(d.Flex,{vertical:!0,gap:8},f>=1&&Array.from(new Array(f),(t,e)=>a().createElement(Am,{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"})})))))})),Nv=(0,C.createWithIntlProvider)("zh-CN",vv,"react-file")(t=>{let{url:e,className:i,maxWidth:n}=t;const{formatMessage:r}=(0,C.useIntl)(),[l,c]=(0,s.useState)(""),[h,u]=(0,s.useState)(!0),[p,f]=(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),f(!0)})},[e]),a().createElement("div",{className:dt()(i,yv),style:{maxWidth:n}},h?a().createElement("div",{className:Av},a().createElement(d.Spin,null)):null,a().createElement("div",{className:Ev},p?a().createElement("div",{className:xv},r({id:"fileLoadedError"})):a().createElement("div",{className:_v},l)))}),Dv=(0,C.createWithIntlProvider)("zh-CN",vv,"react-file")(t=>{let{maxWidth:e}=t;const{formatMessage:i}=(0,C.useIntl)();return a().createElement("div",{className:yv,style:{maxWidth:e}},a().createElement("div",{className:Ev},a().createElement(d.Result,{status:"500",title:i({id:"unSupportFileType"}),subTitle:i({id:"unSupportFileTypeDescription"})})))}),Ov=["url","scale","rotate","className","maxWidth","origin"],Wv=(0,C.createWithIntlProvider)("zh-CN",vv,"react-file")(t=>{let{url:e,scale:i,rotate:n,className:r,maxWidth:o,origin:l}=t,c=sv(t,Ov);const[h,u]=(0,s.useState)(!0),[p,f]=(0,s.useState)(!1),{formatMessage:g}=(0,C.useIntl)();return(0,s.useEffect)(()=>{const t=new Image;t.src=e;const i=()=>{u(!1)},n=()=>{u(!1),f(!0)};return t.addEventListener("load",i),t.addEventListener("error",n),()=>{t.removeEventListener("load",i),t.removeEventListener("error",n)}},[e,i,n]),l?a().createElement("img",nv({alt:g({id:"filePreview"})},c,{className:r,src:e})):a().createElement("div",{className:dt()(r,yv),style:{maxWidth:o}},h?a().createElement("div",{className:Av},a().createElement(d.Spin,null)):null,p?a().createElement("div",{className:xv},g({id:"fileLoadedError"})):a().createElement("img",nv({alt:g({id:"filePreview"})},c,{src:e})))}),zv=["url","maxWidth"],Bv=["url","maxWidth","origin","controls","getElement"],Hv=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"},jv={txt:Nv,pdf:Iv,image:Wv,html:Tv,office:t=>{var e;let{url:i,apis:n,className:s}=t,o=sv(t,Pv);const{apis:c}=(0,r.usePreset)(),h=Object.assign({},c,n);return a().createElement(l(),nv({},(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 a().createElement(Fv,nv({},o,{type:i,ignoreContent:!0,url:e,className:s,key:e}))})}}))},audio:t=>{let{url:e,maxWidth:i}=t,n=sv(t,zv);return a().createElement("div",{className:yv,style:{maxWidth:i}},a().createElement("div",{className:kv},a().createElement("audio",nv({},n,{src:e,controls:!0}))))},video:t=>{let{url:e,maxWidth:i,origin:n,controls:r=!0,getElement:o}=t,l=sv(t,Bv);const c=(0,s.useRef)(null),h=(0,x.A)(o);return(0,s.useEffect)(()=>{h(c.current)},[h]),n?a().createElement("video",nv({controls:r},l,{src:e,ref:c})):a().createElement("div",{className:yv,style:{maxWidth:i}},a().createElement("div",{className:Cv},a().createElement("video",nv({controls:r},l,{src:e,ref:c}))))},unknown:Dv},Vv=t=>jv[Hv(t)],Uv=["data","id","staticUrl","className","fetchApi","filename","render"],Gv=lv(t=>{let{data:e,id:i,staticUrl:n,className:s,fetchApi:r,filename:o,render:l}=t,c=sv(t,Uv);const h=pv({staticUrl:n,url:e}),d=e&&Vv(e)||o&&Vv(o);return"function"===typeof l?l({data:e,id:i,staticUrl:n,className:s,fetchApi:r,filename:o,url:h,component:d}):a().createElement(d,nv({},c,{className:s,url:h}))}),qv=["id","src","originName","filename"],Xv=t=>{let{id:e,src:i,originName:n,filename:s}=t,r=sv(t,qv);return i?a().createElement(Fv,nv({},r,{url:i,filename:s||n})):a().createElement(Gv,nv({},r,{id:e,filename:s||n}))},Yv=["content","onSuccess","onError","onBeforePrint","printProps","contentRef"],Kv=t=>{let{onSuccess:e,onError:i,onBeforePrint:n,printProps:r,contentRef:o}=t,l=sv(t,Yv);const[c,h]=(0,s.useState)(!1),u=(0,xm.useReactToPrint)(nv({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)}},r));return a().createElement(d.Button,nv({},l,{onClick:()=>{h(!0),u()},loading:c}))};var Qv=".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 Zv=["title","filename","originName","openDownload","openPrint","id","src","apis"],Jv=["renderModal"],$v=(0,C.createIntlProvider)("zh-CN",vv,"react-file"),tb=t=>{const e=Object.assign({},{renderModal:t=>a().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:r,openDownload:o,openPrint:l,id:c,src:h,apis:u}=e,p=sv(e,Zv),[f,g]=km(p,{value:"open",default:"defaultOpen",onChange:"onOpenChange"}),{message:v}=d.App.useApp(),b=(0,s.useRef)();return nv({},p,{open:f,onOpenChange:g,onCancel:()=>{g(!1)},title:a().createElement(d.Space,{size:10,className:Qv["file-title"]},a().createElement("span",{className:Qv.ellipse},i||n||r),a().createElement("span",null,o&&a().createElement($v,null,t=>{let{formatMessage:e}=t;return a().createElement(wv,{className:"btn-no-padding",type:"link",id:c,src:h,apis:u,filename:n||r,onSuccess:()=>{v.success(e({id:"downloadSuccess"}))}})}),l&&["txt","pdf","image","html"].indexOf(Hv(n||r))>-1&&a().createElement(Kv,{contentRef:b,type:"link",icon:a().createElement(m,null)}))),children:a().createElement("div",{ref:b,className:Qv["file-modal-outer"]},a().createElement(Xv,{id:c,src:h,filename:n||r,apis:u}))})})(sv(e,Jv));return Object.assign({},n,{renderModal:t=>i(Object.assign({},n,t))})},eb=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 ib="_H1zfc",nb="_BAe2W",sb="_9kK1I",ab="_Wwi2N";const rb=["id","src","alt","onClick","loading","error","className","apis","staticUrl"],ob=["id","src","alt","gender","loading","error","className","gap","icon","children","shape","size","width","height","defaultAvatar","apis","staticUrl"],lb=a().createElement(d.Skeleton.Avatar,{shape:"square",active:!0}),cb=a().createElement(Tm,null),hb=a().createElement(Dm,null),db=a().createElement(Hm,null),ub=a().createElement(qm,null),pb=t=>{let{data:e,className:i,alt:n,innerLoading:s,loading:o,error:c,innerError:h,children:d,onClick:u,staticUrl:p}=t;var f;const{apis:g}=(0,r.usePreset)(),m=Object.assign({},g),v=pv({staticUrl:p||(null==(f=m.file)?void 0:f.staticUrl),url:e});return a().createElement(l(),{loader:eb,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,nb),src:e}):a().createElement("img",{alt:n,className:dt()(i,nb),src:e,onClick:u})}})},fb=lv(pb),gb=t=>{let{loading:e,error:i,src:n,id:s,alt:r,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)):a().createElement(i,Object.assign({},t.props,e))},p=e&&u(e,{className:sb}),f=i&&u(i,{className:ab});return n?a().createElement(pb,{alt:r,className:o,staticUrl:d,data:n,loading:p,error:f,onClick:h},l):s?a().createElement(fb,{alt:r,className:o,id:s,loading:p,innerLoading:p,error:f,innerError:f,apis:c,onClick:h},l):f},mb=t=>{const e=Object.assign({},{loading:lb,error:cb},t),{id:i,src:n,alt:s,onClick:r,loading:o,error:l,className:c,apis:h,staticUrl:d}=e,u=sv(e,rb);return a().createElement("div",nv({},u,{className:dt()(c,ib)}),gb({loading:o,error:l,src:n,id:i,alt:s,className:c,apis:h,onClick:r,staticUrl:d}))};mb.Avatar=t=>{const e=Object.assign({},{size:100,defaultAvatar:hb,error:cb,shape:"circle"},t),{id:i,src:n,alt:s,gender:r,loading:o,error:l,className:c,gap:h,icon:u,children:p,shape:f,size:g,width:m,height:v,defaultAvatar:b,apis:w,staticUrl:y}=e,A=sv(e,ob),E=(()=>{const t=m&&v?{style:{width:m,height:v}}:{size:g};let e=f;if(m&&m!==v&&(e="square"),i||n)return gb({loading:o||a().createElement(d.Skeleton.Avatar,{shape:e,active:!0}),staticUrl:y,error:l,src:n,defaultAvatar:b,id:i,alt:s,className:c,apis:w,children:i=>a().createElement(d.Avatar,nv({},i,{gap:h,shape:e},t))});if(r){const i=["F","female","f"].indexOf(r)>-1?db:["M","male","m"].indexOf(r)>-1?ub:hb;return a().createElement(d.Avatar,nv({},A,{src:i,gap:h,shape:e},t))}return a().createElement(d.Avatar,nv({},A,{gap:h,icon:u,shape:e,size:g,src:b},t),p)})();return a().createElement("div",nv({},A,{className:dt()(c,ib),style:{width:m&&v?m:g,height:m&&v?v:g}}),E)};const vb=t=>{const{item:e,hasPreview:i,getPermission:n,apis:s,onEdit:r,onDelete:o,onPreview:l,renderModal:c}=Object.assign({},{hasPreview:!0,apis:{},getPermission:()=>!0,renderModal:t=>a().createElement(d.Modal,Object.assign({},t))},t),{filename:h,id:u,src:p}=e,{onOpenChange:f,renderModal:g}=tb({apis:s,id:u,src:p,filename:h,renderModal:c});return a().createElement(d.Flex,{justify:"end"},i&&n("preview",e)&&a().createElement(a().Fragment,null,a().createElement(d.Button,{type:"text",icon:a().createElement(v.A,null),onClick:()=>{l?l(e):f(!0)}}),g()),n("edit",e)&&a().createElement(Qm.lV,{type:"text",icon:a().createElement(b.A,null),onClick:()=>r&&r(e)}),n("download",e)&&a().createElement(wv,{type:"text",id:u,src:p,filename:h}),n("delete",e)&&a().createElement(Qm.ZF,{type:"text",icon:a().createElement(w.A,null),onClick:()=>o&&o(e)}))};var bb="_yRMtw",wb="_OivOI",yb="_doPR9",Ab="_bLeUP",Eb="_mZdoa";const xb=(0,C.createWithIntlProvider)("zh-CN",vv,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),{className:i,dataSource:n,getPermission:s,infoItemRenders:r,onDelete:o,onEdit:l,apis:c,renderModal:h}=Object.assign({},{infoItemRenders:[t=>t.userName?a().createElement(d.Typography.Text,null,t.userName):null,t=>t.date?a().createElement(d.Typography.Text,null,tv()(t.date).format("YYYY-MM-DD HH:mm:ss")):null],getPermission:()=>!0,renderModal:t=>a().createElement(d.Modal,Object.assign({},t))},t);return a().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 a().createElement(d.List.Item,{className:bb},a().createElement(d.Row,{justify:"space-between",wrap:!1,className:wb},a().createElement(d.Col,{flex:1},a().createElement("div",{className:yb}),a().createElement(d.Space,{className:"is-block",align:"start",size:4},a().createElement(Km,{type:Jm()(null==n?void 0:n.split(".")),size:14}),n||"")),r&&r.map((e,n)=>a().createElement(d.Col,{span:e.span||4,key:n},"uploading"!==i&&("function"===typeof e?e:e.render)(t),a().createElement("div",{className:yb}))),a().createElement(d.Col,{className:Eb},"uploading"!==i?a().createElement(vb,{getPermission:s,item:t,apis:c,onDelete:o,renderModal:h,onEdit:l}):a().createElement(d.Space,{className:Ab},a().createElement(d.Spin,{size:"small"}),a().createElement(d.Typography.Link,null,e({id:"uploading"}))))))},bordered:!0})}),_b=t=>{const{locale:e}=(0,r.useContext)(),{formatMessage:i}=(0,C.createIntl)({locale:e,namespace:"react-file"}),{multiple:n,fileSize:a,maxLength:o,value:l,concurrentCount:c,onAdd:h,onError:u,onSave:p,onChange:f,onUpload:g}=Object.assign({},{concurrentCount:1,value:[]},t),{apis:m}=(0,r.usePreset)(),{message:v}=d.App.useApp(),[b,w]=(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*a*1024)return void v.error(i({id:"fileSizeError"},{filename:t.name,fileSize:a}));const e=iv()(),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}),w(t=>{const i=t.slice(0),n=i.findIndex(t=>t.uuid===e);return n>-1&&i.splice(n,1),i})};try{var r;w(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 a=g||(null==(r=m.file)?void 0:r.upload),{data:l}=await A(()=>a({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});w(t=>{const i=t.slice(0),n=i.findIndex(t=>t.uuid===e);return n>-1&&i.splice(n,1),i}),f(1===o||!0!==n?[c]:t=>{const e=(t||[]).slice(0);return e.push(c),e})}catch(l){s(l)}}))});return{fileList:b,onFileSelected:E}};var kb="_-hhpT",Cb="_FyygJ",Mb="_hBEXs",Sb="_BMSEY";const Lb=[".pdf",".jpg",".png",".jpeg",".doc",".docx",".xls",".xlsx",".html",".msg",".eml",".zip"],Tb=["children","className","buttonText","accept","multiple","onChange"],Rb=["children"],Fb=(0,C.createWithIntlProvider)("zh-CN",vv,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),i=(0,s.useRef)(null),n=Object.assign({},{accept:Lb,buttonText:e({id:"fileUpload"}),children:t=>{let{children:e}=t,i=sv(t,Rb);return a().createElement(d.Button,nv({icon:a().createElement(A,null)},i),l,e)}},t),{children:r,className:o,buttonText:l,accept:c,multiple:h,onChange:u}=n,p=sv(n,Tb);return r(nv({},p,{className:dt()(o,kb),children:!p.disabled&&a().createElement("input",{ref:i,type:"file",accept:c,multiple:h,className:Cb,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))}})}))}),Pb=["className","fileSize","maxLength","multiple","size","accept","children","renderTips","showUploadList","onSave","ossUpload","getPermission","concurrentCount","apis","renderModal"];(0,C.createWithIntlProvider)("zh-CN",vv,"react-file")(t=>{const{formatMessage:e}=(0,C.useIntl)(),i=Object.assign({},{defaultValue:[],accept:Lb,renderTips:t=>t,children:e({id:"fileUpload"}),multiple:!0,showUploadList:!0,maxLength:10,fileSize:30,concurrentCount:10,renderModal:t=>a().createElement(d.Modal,Object.assign({},t))},t),{className:n,fileSize:s,maxLength:r,multiple:o,size:l,accept:c,children:h,renderTips:u,showUploadList:p,onSave:f,ossUpload:g,getPermission:m,concurrentCount:v,apis:b,renderModal:w}=i,y=sv(i,Pb),[A,E]=km(y),x=A||[],{fileList:_,onFileSelected:M}=_b({multiple:o,onSave:f,ossUpload:g,fileSize:s,maxLength:r,value:x,onChange:E,concurrentCount:v});c.map(t=>t.replace(/^\./,"")).join("\u3001");const S=[...x,..._],L=u(e({id:"uploadTips"},{fileSize:s,maxLength:r,accept:c.map(t=>t.replace(/^\./,"")).join(",")}),{fileSize:s,maxLength:r,accept:c});return a().createElement(d.Flex,{vertical:!0,gap:8},a().createElement(d.Flex,{gap:8},a().createElement(Fb,nv({},k()(y,["value","onChange"]),{size:l,multiple:o,accept:c,className:n,buttonText:h,onChange:M})),L&&a().createElement("div",{className:Sb},L)),p&&S.length>0&&a().createElement(xb,{className:Mb,dataSource:S,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:b,renderModal:w}))})},1251:()=>{},2899:(t,e,i)=>{var n=i(64579),s=i(2316),a=i(90931),r=/^[-+]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(a(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):r.test(t)?NaN:+t}},4167:(t,e,i)=>{"use strict";var n=i(52272);function s(){}function a(){}a.resetWarningCache=s,t.exports=function(){function t(t,e,i,s,a,r){if(r!==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:a,resetWarningCache:s};return i.PropTypes=i,i}},15747:function(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 a=e[n]={exports:{}};return t[n](a,a.exports,i),a.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 g}});var a=i(155);const r="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(r);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:a,print:r,suppressErrors:h}=e;setTimeout(()=>{var e,d;if(t.contentWindow){function u(){null==n||n(),l(a)}if(t.contentWindow.focus(),r)r(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:"",f=t.ownerDocument.title;i&&(t.ownerDocument.title=i,t.contentDocument&&(t.contentDocument.title=i)),t.contentWindow.print(),i&&(t.ownerDocument.title=f,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 a=0;a<n.length;a++){const t=n[a],e=s[a],r=t.shadowRoot;if(null!==r){const t=e.attachShadow({mode:r.mode});t.innerHTML=r.innerHTML,u(r,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 f(t,e,i,n){var s,a,r,l,d;const{contentNode:f,clonedContentNode:g,clonedImgNodes:m,clonedVideoNodes:v,numResourcesToLoad:b,originalCanvasNodes:w}=i,{bodyClass:y,fonts:A,ignoreGlobalStyles:E,pageStyle:x,nonce:_,suppressErrors:k,copyShadowRoots:C}=n;t.onload=null;const M=null!==(s=t.contentDocument)&&void 0!==s?s:null===(a=t.contentWindow)||void 0===a?void 0:a.document;if(M){const i=M.body.appendChild(g);C&&u(f,i,!!k),A&&((null===(r=t.contentDocument)||void 0===r?void 0:r.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=M.createElement("style");_&&(s.setAttribute("nonce",_),M.head.setAttribute("nonce",_)),s.appendChild(M.createTextNode(n)),M.head.appendChild(s),y&&M.body.classList.add(...y.split(" "));const a=M.querySelectorAll("canvas");for(let t=0;t<w.length;++t){const e=w[t],i=a[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,a,r)=>{e(i,["Error loading <img>",i,"Error",r])},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,a,r,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,a,r)=>{e(i,["Error loading video",i,"Error",r])},i.onstalled=()=>{e(i,["Loading video stalled, skipping",i])}):e(i,["Error loading video, `src` is empty",i])}const h="select",b=f.querySelectorAll(h),S=M.querySelectorAll(h);for(let t=0;t<b.length;t++)S[t].value=b[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=M.createElement(s.tagName),i=s.sheet;if(i){let a="";try{const t=i.cssRules.length;for(let e=0;e<t;++e)"string"==typeof i.cssRules[e].cssText&&(a+="".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(M.createTextNode(a)),M.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=M.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,a,r)=>{e(t,["Failed to load",t,"Error:",r])},_&&t.setAttribute("nonce",_),M.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===b&&h(t,n)}function g(t){let{bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:g,onBeforePrint:m,onPrintError:v,pageStyle:b,preserveAfterPrint:w,print:y,printIframeProps:A,suppressErrors:E}=t;const x=(0,a.useCallback)(t=>{function a(){const a={bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:g,onBeforePrint:m,onPrintError:v,pageStyle:b,preserveAfterPrint:w,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=r,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:a}=e,r=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:a});if(!r)return;const l=r.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:r,clonedContentNode:l,clonedImgNodes:h,clonedVideoNodes:d,numResourcesToLoad:(s?0:c.length)+h.length+d.length+u,originalCanvasNodes:r.querySelectorAll("canvas")}}(t,a);if(!c)return void o({messages:["There is nothing to print"],suppressErrors:E});const x=function(t,e,i){const{suppressErrors:n}=t,s=[],a=[];return function(r,l){s.includes(r)?o({level:"debug",messages:["Tried to mark a resource that has already been handled",r],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}),a.push(r)):s.push(r),s.length+a.length===e&&h(i,t))}}(a,c.numResourcesToLoad,l);!function(t,e,i,n){t.onload=()=>{f(t,e,i,n)},document.body.appendChild(t)}(l,x,c,a)}l(w,!0),m?m().then(()=>{a()}).catch(t=>{null==v||v("onBeforePrint",c(t))}):a()},[e,i,n,s,d,u,p,g,m,v,b,w,y,E]);return x}return s}())},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 a="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;var r="object"==typeof self&&self&&self.Object===Object&&self;const o=a||r||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 f=Object.prototype,g=f.hasOwnProperty,m=f.toString,v=p?p.toStringTag:void 0;const b=function(t){var e=g.call(t,v),i=t[v];try{t[v]=void 0;var n=!0}catch(a){}var s=m.call(t);return n&&(e?t[v]=i:delete t[v]),s};var w=Object.prototype.toString;const y=function(t){return w.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)?b(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,M=/^0o[0-7]+$/i,S=parseInt;const L=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||M.test(t)?S(t.slice(2),i?2:8):k.test(t)?NaN:+t};var T=Math.max,R=Math.min;const F=function(t,e,i){var n,a,r,o,c,h,d=0,u=!1,p=!1,f=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var i=n,s=a;return n=a=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>=r}function v(){var t=l();if(m(t))return b(t);c=setTimeout(v,function(t){var i=e-(t-h);return p?R(i,r-(t-d)):i}(t))}function b(t){return c=void 0,f&&n?g(t):(n=a=void 0,o)}function w(){var t=l(),i=m(t);if(n=arguments,a=this,h=t,i){if(void 0===c)return function(t){return d=t,c=setTimeout(v,e),u?g(t):o}(h);if(p)return clearTimeout(c),c=setTimeout(v,e),g(h)}return void 0===c&&(c=setTimeout(v,e)),o}return e=L(e)||0,s(i)&&(u=!!i.leading,r=(p="maxWait"in i)?T(L(i.maxWait)||0,e):r,f="trailing"in i?!!i.trailing:f),w.cancel=function(){void 0!==c&&clearTimeout(c),d=0,n=h=a=c=void 0},w.flush=function(){return void 0===c?o:b(l())},w};const P=function(t,e,i){var n=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return s(i)&&(n="leading"in i?!!i.leading:n,a="trailing"in i?!!i.trailing:a),F(t,e,{leading:n,maxWait:e,trailing:a})};var I=function(){return I=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},I.apply(this,arguments)};function N(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView:window}function D(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 W(t,e){var i;t&&(i=t.classList).add.apply(i,e.split(" "))}function z(t,e){t&&e.split(" ").forEach(function(e){t.classList.remove(e)})}function B(t){return".".concat(t.split(" ").join("."))}var H=!("undefined"===typeof window||!window.document||!window.document.createElement),j=Object.freeze({__proto__:null,addClasses:W,canUseDOM:H,classNamesToQuery:B,getElementDocument:D,getElementWindow:N,getOptions:O,removeClasses:z}),V=null,U=null;function G(){if(null===V){if("undefined"===typeof document)return V=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),V=i}return V}H&&window.addEventListener("resize",function(){U!==window.devicePixelRatio&&(U=window.devicePixelRatio,V=null)});var q=N,X=D,Y=O,K=W,Q=z,Z=B,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,a,r,o,l,c,h,d,u,p;if(n.draggedAxis&&n.contentWrapperEl){var f=n.axis[n.draggedAxis].track,g=null!==(s=null===(i=f.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!==(r=null===(a=n.contentWrapperEl)||void 0===a?void 0:a[n.axis[n.draggedAxis].scrollSizeAttr])&&void 0!==r?r:0,b=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 w=("y"===n.draggedAxis?e.pageY:e.pageX)-(null!==(h=null===(c=f.rect)||void 0===c?void 0:c[n.axis[n.draggedAxis].offsetAttr])&&void 0!==h?h:0)-n.axis[n.draggedAxis].dragOffset,y=(w="x"===n.draggedAxis&&n.isRtl?(null!==(u=null===(d=f.rect)||void 0===d?void 0:d[n.axis[n.draggedAxis].sizeAttr])&&void 0!==u?u:0)-m.size-w:w)/(g-m.size)*(v-b);"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=I(I({},t.defaultOptions),i),this.classNames=I(I({},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=P(this._onMouseMove,64),this.onWindowResize=F(this._onWindowResize,64,{leading:!0}),this.onStopScrolling=F(this._onStopScrolling,this.stopScrollDelay),this.onMouseEntered=F(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),a=t.getOffset(n);i.scrollLeft=-999;var r=t.getOffset(n);return document.body.removeChild(i),t.rtlHelpers={isScrollOriginAtZero:s.left!==a.left,isScrollingToNegative:a.left!==r.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(){H&&(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,a=this.elStyles.overflowX,r=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"!==a&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==r&&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],a=null!==(i=null===(e=this.axis[t].track.el)||void 0===e?void 0:e[this.axis[t].offsetSizeAttr])&&void 0!==i?i:0,r=a/s;return n=Math.max(~~(r*a),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 a=this.axis[e].scrollbar;if(this.axis[e].isOverflowing&&this.contentWrapperEl&&a.el&&this.elStyles){var r=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/(r-l),d=~~((o-a.size)*h);d="x"===e&&this.isRtl?-d+(o-a.size):d,a.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),a=this.axis[e].scrollbar,r="y"===e?t.pageY:t.pageX;this.axis[e].dragOffset=r-((null===(i=a.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,a,r=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!==(a=null===(s=this.elStyles)||void 0===s?void 0:s[this.axis[e].sizeAttr])&&void 0!==a?a:"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,f=function(){r.contentWrapperEl&&(-1===u?d>p&&(d-=40,r.contentWrapperEl[r.axis[e].scrollOffsetAttr]=d,l.requestAnimationFrame(f)):d<p&&(d+=40,r.contentWrapperEl[r.axis[e].scrollOffsetAttr]=d,l.requestAnimationFrame(f)))};f()}},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=j,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,a=void 0===s?{}:s,r=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(r).forEach(function(t){Object.prototype.hasOwnProperty.call(J.defaultOptions,t)?h[t]=r[t]:d[t]=r[t]});var u=$($({},J.defaultOptions.classNames),h.classNames),p=$($({},a),{className:"".concat(u.contentWrapper).concat(a.className?" ".concat(a.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:a}=JSON.parse(e);if(a&&Date.now()>a)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)}}},43373:(t,e,i)=>{"use strict";i.d(e,{A:()=>m});var n=i(92099),s=i(48183),a=i(72367),r=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 f(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 g=function(t){(0,r.A)(i,t);var e=f(i);function i(){var t;(0,n.A)(this,i);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return t=e.call.apply(e,[this].concat(r)),(0,c.A)((0,a.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)(g,"propTypes",{onError:p().func,children:p().node,errorComponent:p().elementType,errorRender:p().func}),(0,c.A)(g,"defaultProps",{onError:function(){}});const m=g},50379:()=>{},50805:(t,e,i)=>{"use strict";i.d(e,{A:()=>c});var n=i(94922),s=i(98771),a=i.n(s),r=i(95600),o=i.n(r),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),r=(0,l.A)(t);return(0,n.useLayoutEffect)(()=>{const t=s.current,e=()=>window.requestAnimationFrame(()=>{t&&r(t)});e();const n=new ResizeObserver((i.current.isDebounce?o():a())(e,i.current.time));return t&&n.observe(t),()=>{n.disconnect()}},[r]),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 a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)i=a[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:()=>D,ZF:()=>R,lV:()=>E});var n=i(94922),s=i.n(n),a=i(28833),r=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)),f=i(26938),g=i.n(f),m=i(73075),v=i.n(m);function b(){return b=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},b.apply(null,arguments)}function w(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,r.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,r=w(t,y);const{isLoading:o,callback:l}=A(e);return s().createElement(a.Button,b({},r,{loading:n||o,onClick:l}),"function"===typeof i?i(n||o):i)};var x="_zIHFy",_="_R-IrF",k="_F1kMl",C="_Iee0d",M="_aGBVE",S="_0oW1K";const L={message:"\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f",confirm:"\u786e\u5b9a",delete:"\u5220\u9664",cancel:"\u53d6\u6d88",more:"\u66f4\u591a"},T=["title","message","isDelete","showCancel","cancelText","onCancel","isModal","okText","placement","children","onClick","getContainer","renderModal"],R=(0,u.createWithIntlProvider)("zh-CN",L,"button-group")(t=>{const{formatMessage:e}=(0,u.useIntl)(),i=Object.assign({},{isDelete:!0},t),{title:o,message:l,isDelete:h,showCancel:p,cancelText:f,onCancel:g,isModal:m,okText:v,placement:y,children:E,onClick:L,getContainer:R,renderModal:F}=i,P=w(i,T),[I,N]=(0,n.useState)(!1),{isLoading:D,callback:O}=A(L),W=(0,r.A)(()=>{N(!0)}),z=s().createElement(a.Flex,{className:k,vertical:!0,gap:8,onClick:t=>{t.stopPropagation()}},o&&s().createElement(a.Flex,{align:"flex-start",gap:8,className:C},h&&s().createElement(c.A,{className:"title-icon"}),o),s().createElement(a.Flex,{align:"flex-start",gap:8,className:d()(M,{[S]:o})},!o&&h?s().createElement(c.A,{className:"title-icon"}):null,l||e({id:"message"}))),B=()=>"function"===typeof E?E(b({},P,{onClick:W})):s().createElement(a.Button,b({},P,{loading:D,onClick:()=>{W()}}),E);if(m){const t={open:I,onCancel:()=>{N(!1),g&&g()},wrapClassName:_,okText:v||e(h?{id:"delete"}:{id:"confirm"}),cancelText:f||e({id:"cancel"}),onOk:t=>(N(!1),O(t)),closable:!1,okButtonProps:{danger:h},getContainer:R,children:z};return s().createElement(s().Fragment,null,"function"===typeof F?F(t):s().createElement(a.Modal,t),B())}return s().createElement(a.Popconfirm,{overlayClassName:d()(x),okButtonProps:{danger:h},title:z,open:I,getPopupContainer:R,onCancel:g,placement:y,showCancel:p,okText:v||e(h?{id:"delete"}:{id:"confirm"}),cancelText:f||e({id:"cancel"}),onOpenChange:N,onConfirm:t=>{O(t)}},B())}),F=v()(t=>{let{amountWidth:e,moreBtnWidth:i,buttonWidthList:n,spaceProps:s,compact:a}=t;const r=a?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*r&&o<n.length;)l+=n[o],o+=1;for(;e<l+(o-1)*r+(o<n.length?i+r:0)&&o>0;)l-=n[o-1],o-=1;return o},t=>{let{amountWidth:e,moreBtnWidth:i,buttonWidthList:n,spaceProps:s,compact:a}=t;return"".concat(e).concat(i).concat(n.join(",")).concat(Object.values(s).join(",")).concat(a&&a.toString())});var P={"width-container":"_V58ju","hidden-container":"_XN3o6","hidden-inner":"_-depB","more-link-btn":"_Hh4Wb","menu-list":"_juFTd"};const I=["list","more","moreType","compact","showLength","getPopupContainer","trigger","itemClassName"],N=["className","confirm","buttonComponent","tooltipProps"],D=(0,u.createWithIntlProvider)("zh-CN",L,"button-group")(t=>{const{formatMessage:e}=(0,u.useIntl)(),i=Object.assign({},t),{list:c,more:h,moreType:f,compact:m,showLength:v,getPopupContainer:y,trigger:A,itemClassName:x}=i,_=w(i,I),k=(0,n.useMemo)(()=>c.filter(t=>!(null!=t&&t.hidden)),[c]),C=g()(_,["size","split","align","style"]),[M,S]=(0,n.useState)(k.length&&1),L=Number.isInteger(v)?v:M,T=(0,r.A)(()=>{const t=O.current,e=W.current,i=D.current;if(!t)return;const s=t.querySelectorAll(".button-group-item");if(!s)return;if(0===s.length)return;const a=i.clientWidth,r=e.clientWidth,o=[].map.call(s,t=>t.offsetWidth),l=F({amountWidth:a,moreBtnWidth:r,buttonWidthList:o,spaceProps:C,compact:m});(0,n.startTransition)(()=>{S(l)})}),D=(0,p.A)(T),O=(0,p.A)(T),W=(0,p.A)(T),z=k.slice(L),B=(t,e,i)=>{if("function"===typeof t)return t({key:e,className:d()("button-group-item",P["btn-item"],x)},{isDropdown:i});const{className:n,confirm:r,buttonComponent:o,tooltipProps:l}=t,c=w(t,N),h=r||c.message,u=o||(h?R:E),p=s().createElement(u,b({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(a.Tooltip,l,p):p},H=h||("link"===f?s().createElement(a.Button,{type:"link",className:d()("button-group-item",x,P["more-link-btn"])},s().createElement(l.A,{style:{fontSize:"16px"}})):s().createElement(a.Button,null,e({id:"more"}),s().createElement(o.A,null))),j=m?a.Space.Compact:a.Space;return s().createElement(s().Fragment,null,s().createElement("div",{className:P["width-container"],ref:D}),s().createElement("div",{className:P["hidden-container"]},s().createElement("div",{className:P["hidden-inner"],ref:W},H),s().createElement("div",{className:P["hidden-inner"],ref:O},s().createElement(j,C,k.map((t,e)=>s().createElement(n.Fragment,{key:e},B(t,e,!1)))))),s().createElement(j,C,k.slice(0,L).map((t,e)=>s().createElement(n.Fragment,{key:e},B(t,e,!1))),z.length>0&&s().createElement(a.Dropdown,{getPopupContainer:y,trigger:A,rootClassName:P["menu-list"],menu:{items:z.map((t,e)=>({key:e,label:B(t,e,!0)}))}},H)))})},89796:(t,e,i)=>{"use strict";i.d(e,{A:()=>f});var n=i(94922),s=i.n(n),a=i(78678),r=i(50805),o=i(54159),l=i.n(o);function c(){return c=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},c.apply(null,arguments)}var h="_AIhaC",d="_dM14d",u="_fJgX2";const p=["className","children","responsiveBorder","dpi","scale","blur","contrast","brightness","saturate"],f=t=>{let{className:e,children:i,responsiveBorder:o=!0,dpi:f=1.2,scale:g=1,blur:m=.25,contrast:v=1.2,brightness:b=1.05,saturate:w=1.1}=t,y=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,p);const A=(0,n.useId)().replace(/[#:]/g,"-"),[E,x]=(0,n.useState)({x:0,y:0}),[_,k]=(0,n.useState)(null),C=(0,r.A)(t=>{if(!(t.clientWidth>0&&t.clientHeight>0))return;k({width:t.clientWidth,height:t.clientHeight});const e=window.getComputedStyle(t);t.querySelectorAll(".".concat(d)).forEach(t=>{t.style.borderRadius=e.borderRadius})}),M=(0,n.useRef)(null),S=(0,n.useRef)(null),L=(0,a.A)(t=>{const e=C.current.getBoundingClientRect(),i=e.left+e.width/2,n=e.top+e.height/2;x({x:(t.clientX-i)/e.width*100,y:(t.clientY-n)/e.height*100})});(0,n.useEffect)(()=>(document.body.addEventListener("mousemove",L),document.body.addEventListener("touchstart",L),()=>{document.body.removeEventListener("mousemove",L),document.body.removeEventListener("touchstart",L)}),[L]),(0,n.useEffect)(()=>{if(!(_&&_.width>0&&_.height>0))return;const t=f,e=document.createElement("canvas"),i=e.getContext("2d"),n=Math.round(_.width*t),s=Math.round(_.height*t);e.width=n,e.height=s;const a=new Uint8ClampedArray(n*s*4),r=(t,e,i,n,s)=>{const a=Math.abs(t)-i+s,r=Math.abs(e)-n+s;return Math.min(Math.max(a,r),0)+((t,e)=>Math.sqrt(t*t+e*e))(Math.max(a,0),Math.max(r,0))-s},o=(t,e,i)=>(i=Math.max(0,Math.min(1,(i-t)/(e-t))))*i*(3-2*i),l=t=>{const e=t.x-.5,i=t.y-.5,n=r(e,i,.3,.2,.6),s=o(.8,0,n-.15),a=o(0,1,s);return{type:"t",x:e*a+.5,y:i*a+.5}};let c=0;const h=[];for(let u=0;u<a.length;u+=4){const t=u/4%n,e=~~(u/4/n),i=l({x:t/n,y:e/s}),a=i.x*n-t,r=i.y*s-e;c=Math.max(c,Math.abs(a),Math.abs(r)),h.push(a,r)}c*=2;let d=0;for(let u=0;u<a.length;u+=4){const t=h[d++]/c+.5,e=h[d++]/c+.5;a[u]=255*t,a[u+1]=255*e,a[u+2]=0,a[u+3]=255}i.putImageData(new ImageData(a,n,s),0,0),M.current.setAttribute("href",e.toDataURL()),S.current.setAttribute("scale",g*c/t)},[_,f,g]);const T=(t,e)=>"linear-gradient(\n ".concat(135+1.2*E.x,"deg,\n rgba(255, 255, 255, 0.0) 0%,\n rgba(255, 255, 255, ").concat(t+.008*Math.abs(E.x),") ").concat(Math.max(10,33+.3*E.y),"%,\n rgba(255, 255, 255, ").concat(e+.012*Math.abs(E.x),") ").concat(Math.min(90,66+.4*E.y),"%,\n rgba(255, 255, 255, 0.0) 100%\n )");return s().createElement(n.Fragment,null,s().createElement("div",c({},y,{ref:C,className:l()(h,e),style:{backdropFilter:"url(#liquid-glass-".concat(A,"_filter) blur(").concat(m,"px) contrast(").concat(v,") brightness(").concat(b,") saturate(").concat(w,")")},onMouseMove:L,onTouchStart:L}),o&&s().createElement(s().Fragment,null,s().createElement("div",{className:d,style:{opacity:.2,mixBlendMode:"screen",background:T(.12,.4)}}),s().createElement("div",{className:d,style:{opacity:.8,mixBlendMode:"overlay",background:T(.32,.6)}})),i),s().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"0",height:"0",className:u},s().createElement("defs",null,s().createElement("filter",{id:"liquid-glass-".concat(A,"_filter"),filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",x:"0",y:"0",width:(null==_?void 0:_.width)||0,height:(null==_?void 0:_.height)||0},s().createElement("feImage",{ref:M,id:"liquid-glass-".concat(A,"_map"),width:(null==_?void 0:_.width)||0,height:(null==_?void 0:_.height)||0}),s().createElement("feDisplacementMap",{ref:S,in:"SourceGraphic",in2:"liquid-glass-".concat(A,"_map"),xChannelSelector:"R",yChannelSelector:"G"})))))}},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),a=i(2899),r=Math.max,o=Math.min;t.exports=function(t,e,i){var l,c,h,d,u,p,f=0,g=!1,m=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function b(e){var i=l,n=c;return l=c=void 0,f=e,d=t.apply(n,i)}function w(t){var i=t-p;return void 0===p||i>=e||i<0||m&&t-f>=h}function y(){var t=s();if(w(t))return A(t);u=setTimeout(y,function(t){var i=e-(t-p);return m?o(i,h-(t-f)):i}(t))}function A(t){return u=void 0,v&&l?b(t):(l=c=void 0,d)}function E(){var t=s(),i=w(t);if(l=arguments,c=this,p=t,i){if(void 0===u)return function(t){return f=t,u=setTimeout(y,e),g?b(t):d}(p);if(m)return clearTimeout(u),u=setTimeout(y,e),b(p)}return void 0===u&&(u=setTimeout(y,e)),d}return e=a(e)||0,n(i)&&(g=!!i.leading,h=(m="maxWait"in i)?r(a(i.maxWait)||0,e):h,v="trailing"in i?!!i.trailing:v),E.cancel=function(){void 0!==u&&clearTimeout(u),f=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 a=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return s(i)&&(a="leading"in i?!!i.leading:a,r="trailing"in i?!!i.trailing:r),n(t,e,{leading:a,maxWait:e,trailing:r})}}}]);
2
- //# sourceMappingURL=700.b8b651f4.chunk.js.map