@flarehr/apollo-workplace-policies 0.41.44 → 0.42.45

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.
@@ -6,4 +6,4 @@ var wi=Object.defineProperty;var Ai=(ee,te,ne)=>te in ee?wi(ee,te,{enumerable:!0
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var e=require$$0;function h(ee,te){return ee===te&&(ee!==0||1/ee===1/te)||ee!==ee&&te!==te}var k=typeof Object.is=="function"?Object.is:h,l$1=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(ee,te){var ne=te(),re=l$1({inst:{value:ne,getSnapshot:te}}),ie=re[0].inst,se=re[1];return n(function(){ie.value=ne,ie.getSnapshot=te,r$2(ie)&&se({inst:ie})},[ee,ne,te]),m(function(){return r$2(ie)&&se({inst:ie}),ee(function(){r$2(ie)&&se({inst:ie})})},[ee]),p(ne),ne}function r$2(ee){var te=ee.getSnapshot;ee=ee.value;try{var ne=te();return!k(ee,ne)}catch{return!0}}function t(ee,te){return te()}var u$1=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?t:q;useSyncExternalStoreShim_production_min.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u$1,shim.exports=useSyncExternalStoreShim_production_min;var shimExports=shim.exports;class Util_ElmishState$3{constructor(te,ne,re){this.arg=ne,this.dependencies=re;const ie=te(),se=[];let oe;const he=ProgramModule_init(ie)(this.arg);let ue=he[0],de=he[1];oe=[[ue,ae=>{se.push(ae)},!1,se],de],this.state=oe[0],this.cmd=oe[1],this.subscribe=ae=>{let le=!1;const Ae=isDisposable(this.state[0]);return ProgramModule_runWith(this.arg,ProgramModule_withSetState((_e,me)=>{const ve=this.state;this.state=[_e,me,!0,se],_e!==ve[0]&&ae()},ProgramModule_map((_e,me)=>{const ve=this.cmd;return this.cmd=Cmd_none(),[this.state[0],ve]},(_e,me,ve)=>_e(me)(this.state[0]),uncurry3(_e=>_e),uncurry3(_e=>_e),uncurry2(_e=>_e),_e=>[me=>_e[0](me)?!0:Ae&&le,me=>{const ve=me;isDisposable(ve)?disposeSafe(ve):_e[1](me)}],ie))),()=>{le=!0}}}}function Util_ElmishState$3_$ctor_Z29FF63CF(ee,te,ne){return new Util_ElmishState$3(ee,te,ne)}function Util_ElmishState$3__get_State(ee){return ee.state}function Util_ElmishState$3__get_Subscribe(ee){return ee.subscribe}function Util_ElmishState$3__IsOutdated_1954DBC6(ee,te,ne){return equals$2(ee.arg,te)?!equals$2(ee.dependencies,ne):!0}function React_useElmish_Z6C327F2E(ee,te,ne){const re=h$1(()=>Util_ElmishState$3_$ctor_Z29FF63CF(ee,te,ne)),ie=re[0];Util_ElmishState$3__IsOutdated_1954DBC6(ie,te,ne)&&re[1](Util_ElmishState$3_$ctor_Z29FF63CF(ee,te,ne));const se=shimExports.useSyncExternalStore(Util_ElmishState$3__get_Subscribe(ie),()=>Util_ElmishState$3__get_State(ie)),oe=se[2],he=se[3],ue=se[1];return p$1(()=>{if(oe&&he.length>0){let de=getEnumerator(he);try{for(;de["System.Collections.IEnumerator.MoveNext"]();){const ae=de["System.Collections.Generic.IEnumerator`1.get_Current"]();setTimeout(()=>{ue(ae)})}}finally{disposeSafe(de)}clear(he)}},[oe,he]),[se[0],ue]}const useEffectWithDeps=(ee,te)=>{p$1(()=>{const ne=ee();return()=>{ne.Dispose()}},te)},Interop_reactApi=Cn,ReactInterop_useEffectWithDeps=useEffectWithDeps;function React_createDisposable_3A5B6456(ee){return{Dispose(){ee()}}}function useReact_useEffectOnce_3A5B6456(ee){const te=Interop_reactApi.useRef(!1);useReact_useEffect_311B4086(()=>{te.current||(te.current=!0,ee())},[])}function useReact_useEffect_311B4086(ee,te){ReactInterop_useEffectWithDeps(ne=>(ee(),React_createDisposable_3A5B6456(()=>{})),te)}function useReact_useRef_1505(ee){return Interop_reactApi.useRef(ee)}function useFeliz_React__React_useState_Static_1505(ee){return Interop_reactApi.useState(ee)}class Deferred$1 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}function Deferred_inProgress(ee){return ee.tag===1}function notifyCompletion(ee){let te;te=new CustomEvent("step-completion",{bubbles:!0}),ee.dispatchEvent(te)}class AsyncOperationStatus$1 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Requested","Finished"]}}let Page$2=class extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Main","ReviewPolicy"]}};class State extends Record{constructor(te,ne,re,ie,se,oe,he){super(),this.Page=te,this.ReviewItemList=ne,this.GetInitStateStatus=re,this.PresentPoliciesStatus=ie,this.OpenPolicyStatus=se,this.AcceptPolicyStatus=oe,this.ContinueStatus=he}}class Msg extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["FetchReviewItemList","NavigatePage","PresentPolicies","OpenPolicy","AcceptPolicy","Continue","NotifyCompletion"]}}function StateModule_init(){return[new State(new Page$2(0,[]),empty$3(),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[])),singleton$2(ee=>{ee(new Msg(0,[new AsyncOperationStatus$1(0,[])]))})]}function StateModule_update(ee,te,ne){let re,ie;if(te.tag===1)return[new State(te.fields[0],ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(0,[]),ne.ContinueStatus),te.fields[0].tag===1?singleton$2(se=>{se(new Msg(3,[te.fields[0].fields[0],new AsyncOperationStatus$1(0,[])]))}):Cmd_none()];if(te.tag===2)return te.fields[1].tag===1?[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,new Deferred$1(2,[te.fields[1].fields[0]]),ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_none()]:[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,new Deferred$1(1,[]),ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},se=>BackendService__SendCommand_Z3B2D738(ee,se),new CommandTypeDto(0,[{PolicyIdentifierList:map$3(se=>se.Policy.Identifier,te.fields[0])}]),se=>{const oe=[te.fields[0],new AsyncOperationStatus$1(1,[se])];return new Msg(2,[oe[0],oe[1]])})];if(te.tag===3)return te.fields[1].tag===1?[new State(ne.Page,map$3(se=>equals$2(te.fields[0].Policy.Identifier,se.Policy.Identifier)?new PolicyReviewItemDto(se.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(se.Status,new PolicyReviewItemStatusDto(1,[]))):se,ne.ReviewItemList),ne.GetInitStateStatus,ne.PresentPoliciesStatus,new Deferred$1(2,[te.fields[1].fields[0]]),ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_none()]:[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,new Deferred$1(1,[]),ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},se=>BackendService__SendCommand_Z3B2D738(ee,se),new CommandTypeDto(1,[te.fields[0].Policy.Identifier]),se=>{const oe=[te.fields[0],new AsyncOperationStatus$1(1,[se])];return new Msg(3,[oe[0],oe[1]])})];if(te.tag===4)if(te.fields[1].tag===1){const se=map$3(oe=>equals$2(te.fields[0].Policy.Identifier,oe.Policy.Identifier)?new PolicyReviewItemDto(oe.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(oe.Status,new PolicyReviewItemStatusDto(2,[]))):oe,ne.ReviewItemList);return[new State((re=ne.Page,re.tag===1?(ie=re.fields[0],new Page$2(1,[new PolicyReviewItemDto(ie.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(ie.Status,new PolicyReviewItemStatusDto(2,[])))])):new Page$2(0,[])),se,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(2,[te.fields[1].fields[0]]),ne.ContinueStatus),te.fields[1].fields[0].tag===0?Cmd_ofEffect(oe=>{startImmediate(singleton.Delay(()=>singleton.Bind(sleep(1e3),()=>(oe(new Msg(1,[new Page$2(0,[])])),singleton.Zero()))))}):Cmd_none()]}else return[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(1,[]),ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},se=>BackendService__SendCommand_Z3B2D738(ee,se),new CommandTypeDto(2,[te.fields[0].Policy.Identifier]),se=>{const oe=[te.fields[0],new AsyncOperationStatus$1(1,[se])];return new Msg(4,[oe[0],oe[1]])})];else if(te.tag===5){if(te.fields[1].tag===1)return[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,new Deferred$1(2,[te.fields[1].fields[0]])),singleton$2(se=>{se(new Msg(6,[]))})];switch(ne.ContinueStatus.tag){case 0:case 2:case 3:return[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,new Deferred$1(1,[])),Cmd_OfAsyncWith_perform(oe=>{Cmd_OfAsync_start(oe)},oe=>BackendService__SendCommand_Z3B2D738(ee,oe),new CommandTypeDto(3,[{PolicyIdentifierList:map$3(oe=>oe.Policy.Identifier,te.fields[0])}]),oe=>{const he=[te.fields[0],new AsyncOperationStatus$1(1,[oe])];return new Msg(5,[he[0],he[1]])})];default:return[ne,Cmd_none()]}}else{if(te.tag===6)return notifyCompletion(document.querySelector("apollo-workplace-policies-app")),[ne,Cmd_none()];if(te.fields[0].tag===1){let se,oe;switch(te.fields[0].fields[0].tag===1||te.fields[0].fields[0].fields[0].tag===1?oe=1:oe=0,oe){case 0:{const ue=te.fields[0].fields[0].fields[0].fields[0];se=[ue.PolicyReviewList,singleton$2(de=>{de(new Msg(2,[ue.PolicyReviewList,new AsyncOperationStatus$1(0,[])]))})];break}case 1:{se=[void 0,Cmd_none()];break}}const he=se[0];return[new State(ne.Page,he==null?ne.ReviewItemList:he,new Deferred$1(2,[te.fields[0].fields[0]]),ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),se[1]]}else return[new State(ne.Page,ne.ReviewItemList,new Deferred$1(1,[]),ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},()=>BackendService__GetInitState(ee),void 0,se=>new Msg(0,[new AsyncOperationStatus$1(1,[se])]))]}}const scriptRel="modulepreload",assetsURL=function(ee){return"https://npm-cdn.flarehr.com/@flarehr/apollo-workplace-policies/dist/"+ee},seen={},__vitePreload=function(te,ne,re){return te()},TextLayer$1=':root{--react-pdf-text-layer: 1;--highlight-bg-color: rgba(180, 0, 170, 1);--highlight-selected-bg-color: rgba(0, 100, 0, 1)}@media screen and (forced-colors: active){:root{--highlight-bg-color: Highlight;--highlight-selected-bg-color: ButtonText}}[data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[data-main-rotation="270"]{transform:rotate(270deg) translate(-100%)}.textLayer{position:absolute;text-align:initial;top:0;right:0;bottom:0;left:0;overflow:hidden;line-height:1;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;z-index:2}.textLayer :is(span,br){color:transparent;position:absolute;white-space:pre;cursor:text;margin:0;transform-origin:0 0}.textLayer span.markedContent{top:0;height:0}.textLayer .highlight{margin:-1px;padding:1px;background-color:var(--highlight-bg-color);border-radius:4px}.textLayer .highlight.appended{position:initial}.textLayer .highlight.begin{border-radius:4px 0 0 4px}.textLayer .highlight.end{border-radius:0 4px 4px 0}.textLayer .highlight.middle{border-radius:0}.textLayer .highlight.selected{background-color:var(--highlight-selected-bg-color)}.textLayer br::-moz-selection{background:transparent}.textLayer br::selection{background:transparent}.textLayer .endOfContent{display:block;position:absolute;top:100%;right:0;bottom:0;left:0;z-index:-1;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.textLayer .endOfContent.active{top:0}\n',AnnotationLayer$1=":root{--react-pdf-annotation-layer: 1;--annotation-unfocused-field-background: url(\"data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>\");--input-focus-border-color: Highlight;--input-focus-outline: 1px solid Canvas;--input-unfocused-border-color: transparent;--input-disabled-border-color: transparent;--input-hover-border-color: black;--link-outline: none}@media screen and (forced-colors: active){:root{--input-focus-border-color: CanvasText;--input-unfocused-border-color: ActiveText;--input-disabled-border-color: GrayText;--input-hover-border-color: Highlight;--link-outline: 1.5px solid LinkText}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid selectedItem}.annotationLayer .linkAnnotation:hover{-webkit-backdrop-filter:invert(100%);backdrop-filter:invert(100%)}}.annotationLayer{position:absolute;top:0;left:0;pointer-events:none;transform-origin:0 0;z-index:3}.annotationLayer[data-main-rotation=\"90\"] .norotate{transform:rotate(270deg) translate(-100%)}.annotationLayer[data-main-rotation=\"180\"] .norotate{transform:rotate(180deg) translate(-100%,-100%)}.annotationLayer[data-main-rotation=\"270\"] .norotate{transform:rotate(90deg) translateY(-100%)}.annotationLayer canvas{position:absolute;width:100%;height:100%}.annotationLayer section{position:absolute;text-align:initial;pointer-events:auto;box-sizing:border-box;margin:0;transform-origin:0 0}.annotationLayer .linkAnnotation{outline:var(--link-outline)}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a:hover{opacity:.2;background:rgba(255,255,0,1);box-shadow:0 2px 10px #ff0}.annotationLayer .textAnnotation img{position:absolute;cursor:pointer;width:100%;height:100%;top:0;left:0}.annotationLayer .textWidgetAnnotation :is(input,textarea),.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{background-image:var(--annotation-unfocused-field-background);border:2px solid var(--input-unfocused-border-color);box-sizing:border-box;font:calc(9px * var(--scale-factor)) sans-serif;height:100%;margin:0;vertical-align:top;width:100%}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid red}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}.annotationLayer .textWidgetAnnotation textarea{resize:none}.annotationLayer .textWidgetAnnotation :is(input,textarea)[disabled],.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input[disabled]{background:none;border:2px solid var(--input-disabled-border-color);cursor:not-allowed}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:hover{border:2px solid var(--input-hover-border-color)}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation.checkBox input:hover{border-radius:2px}.annotationLayer .textWidgetAnnotation :is(input,textarea):focus,.annotationLayer .choiceWidgetAnnotation select:focus{background:none;border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) :focus{background-image:none;background-color:transparent}.annotationLayer .buttonWidgetAnnotation.checkBox :focus{border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.radioButton :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:CanvasText;content:\"\";display:block;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{height:80%;left:45%;width:1px}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:30%;top:20%;width:50%}.annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}.annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{-webkit-appearance:none;-moz-appearance:none;appearance:none}.annotationLayer .popupTriggerArea{height:100%;width:100%}.annotationLayer .fileAttachmentAnnotation .popupTriggerArea{position:absolute}.annotationLayer .popupWrapper{position:absolute;font-size:calc(9px * var(--scale-factor));width:100%;min-width:calc(180px * var(--scale-factor));pointer-events:none}.annotationLayer .popup{position:absolute;max-width:calc(180px * var(--scale-factor));background-color:#ff9;box-shadow:0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor)) #888;border-radius:calc(2px * var(--scale-factor));padding:calc(6px * var(--scale-factor));margin-left:calc(5px * var(--scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto}.annotationLayer .popup>*{font-size:calc(9px * var(--scale-factor))}.annotationLayer .popup h1{display:inline-block}.annotationLayer .popupDate{display:inline-block;margin-left:calc(5px * var(--scale-factor))}.annotationLayer .popupContent{border-top:1px solid rgba(51,51,51,1);margin-top:calc(2px * var(--scale-factor));padding-top:calc(2px * var(--scale-factor))}.annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--scale-factor))}.annotationLayer .highlightAnnotation,.annotationLayer .underlineAnnotation,.annotationLayer .squigglyAnnotation,.annotationLayer .strikeoutAnnotation,.annotationLayer .freeTextAnnotation,.annotationLayer .lineAnnotation svg line,.annotationLayer .squareAnnotation svg rect,.annotationLayer .circleAnnotation svg ellipse,.annotationLayer .polylineAnnotation svg polyline,.annotationLayer .polygonAnnotation svg polygon,.annotationLayer .caretAnnotation,.annotationLayer .inkAnnotation svg polyline,.annotationLayer .stampAnnotation,.annotationLayer .fileAttachmentAnnotation{cursor:pointer}.annotationLayer section svg{position:absolute;width:100%;height:100%;top:0;left:0}.annotationLayer .annotationTextContent{position:absolute;width:100%;height:100%;opacity:0;color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.annotationLayer .annotationTextContent span{width:100%;display:inline-block}\n",reactPdf=__vitePreload(()=>Promise.resolve().then(()=>index),void 0);function startImport(ee,te){startImmediate(singleton.Delay(()=>singleton.TryWith(singleton.Delay(()=>singleton.Bind(awaitPromise(reactPdf),ne=>{const re=ne;return re.pdfjs.GlobalWorkerOptions.workerSrc=new URL("https://npm-cdn.flarehr.com/@flarehr/apollo-workplace-policies/dist/assets/pdf.worker.min-feabdf30.js",self.location).toString(),ee(re),singleton.Zero()})),ne=>(te(),singleton.Zero()))))}const PdfCss_textLayer=(()=>toString$4(TextLayer$1))(),PdfCss_annotationLayer=(()=>toString$4(AnnotationLayer$1))(),PdfCss_all=PdfCss_textLayer+PdfCss_annotationLayer;class Document_Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["File","OnLoadSuccess","ClassName","OnItemClick","Children"]}}function Document_Component(ee,te){return Interop_reactApi.createElement(ee.Document,keyValueList(te,1))}class Page_Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["PageNumber","Width"]}}function Page_Component(ee,te){return Interop_reactApi.createElement(ee.Page,keyValueList(te,1))}class Thumbnail_Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Key","PageNumber","Width"]}}function Thumbnail_Component(ee,te){return Interop_reactApi.createElement(ee.Thumbnail,keyValueList(te,1))}const index$1='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.invisible{visibility:hidden}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.top-0{top:0}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.inline{display:inline}.flex{display:flex}.h-10{height:2.5rem}.h-20{height:5rem}.h-full{height:100%}.w-20{width:5rem}.w-\\[4\\.75rem\\]{width:4.75rem}.w-full{width:100%}.max-w-\\[560px\\]{max-width:560px}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.cursor-progress{cursor:progress}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-4{border-width:4px}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-primary-base{border-color:var(--fl-color-primary)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-primary-base{background-color:var(--fl-color-primary)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-1{padding:.25rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.align-bottom{vertical-align:bottom}.font-inter{font-family:Inter,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-8{line-height:2rem}.leading-tight{line-height:1.25}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-primary-base{color:var(--fl-color-primary)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline-offset-2{text-underline-offset:2px}.opacity-\\[0\\.07\\]{opacity:.07}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-black{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.ring-gray-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.ring-primary-base{--tw-ring-color: var(--fl-color-primary)}.ring-opacity-5{--tw-ring-opacity: .05}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:text-primary-base:hover{color:var(--fl-color-primary)}.hover\\:underline:hover{-webkit-text-decoration-line:underline;text-decoration-line:underline}.hover\\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\\:ring-primary-base:hover{--tw-ring-color: var(--fl-color-primary)}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-2:focus-visible{outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-primary-base:focus-visible{outline-color:var(--fl-color-primary)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:cursor-progress:disabled{cursor:progress}.disabled\\:border:disabled{border-width:1px}.disabled\\:border-gray-300:disabled{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.disabled\\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.disabled\\:text-gray-400:disabled{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\\:mr-2{margin-right:.5rem}.sm\\:mr-2\\.5{margin-right:.625rem}.sm\\:mt-0{margin-top:0}.sm\\:mt-10{margin-top:2.5rem}.sm\\:mt-6{margin-top:1.5rem}.sm\\:mt-\\[1px\\]{margin-top:1px}.sm\\:w-\\[12\\.5rem\\]{width:12.5rem}.sm\\:w-\\[35rem\\]{width:35rem}.sm\\:max-w-\\[57rem\\]{max-width:57rem}.sm\\:flex-row{flex-direction:row}.sm\\:p-5{padding:1.25rem}.sm\\:p-6{padding:1.5rem}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\\:py-16{padding-top:4rem;padding-bottom:4rem}.sm\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\\:py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.sm\\:py-20{padding-top:5rem;padding-bottom:5rem}.sm\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\\:text-base{font-size:1rem;line-height:1.5rem}.sm\\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\\:leading-6{line-height:1.5rem}.sm\\:leading-7{line-height:1.75rem}.sm\\:leading-8{line-height:2rem}.sm\\:leading-9{line-height:2.25rem}}@media (min-width: 768px){.md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\\:py-4{padding-top:1rem;padding-bottom:1rem}}@media (min-width: 1024px){.lg\\:visible{visibility:visible}}\n',css=(()=>toString$4(index$1))(),SvgCheck=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("g",{clipPath:"url(#clip0_3040_23717)"},y$1("path",{d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",fill:"currentColor"}),y$1("path",{d:"M6 12L10 16L18 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),y$1("defs",null,y$1("clipPath",{id:"clip0_3040_23717"},y$1("rect",{width:24,height:24,fill:"white"})))),SvgChevronLeft=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgChevronRight=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M9 6L15 12L9 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgDownload=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M4 16L4 17C4 18.6569 5.34315 20 7 20L17 20C18.6569 20 20 18.6569 20 17L20 16M16 12L12 16M12 16L8 12M12 16L12 4",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgFileNoAccess=ee=>y$1("svg",{width:33,height:32,viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("g",{id:"file-no-access 1"},y$1("g",{id:"Group"},y$1("path",{id:"Vector",d:"M29.5 1H3.5V31H29.5V1Z",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),y$1("path",{id:"Vector_2",d:"M11.5566 20.944L21.4406 11.06",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),y$1("path",{id:"Vector_3",d:"M16.5 23C20.366 23 23.5 19.866 23.5 16C23.5 12.134 20.366 9 16.5 9C12.634 9 9.5 12.134 9.5 16C9.5 19.866 12.634 23 16.5 23Z",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))),SvgFolderXmark=ee=>y$1("svg",{width:32,height:28,viewBox:"0 0 32 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M28 4C30.1875 4 32 5.8125 32 8V24C32 26.25 30.1875 28 28 28H4C1.75 28 0 26.25 0 24V4C0 1.8125 1.75 0 4 0H11.3125C12.375 0 13.375 0.4375 14.125 1.1875L17 4H28ZM30 24V8C30 6.9375 29.0625 6 28 6H16.125L12.75 2.625C12.375 2.25 11.875 2 11.3125 2H4C2.875 2 2 2.9375 2 4V24C2 25.125 2.875 26 4 26H28C29.0625 26 30 25.125 30 24ZM20.6875 11.3125C21.0625 11.6875 21.0625 12.375 20.6875 12.75L17.375 16L20.6875 19.3125C21.0625 19.6875 21.0625 20.375 20.6875 20.75C20.3125 21.125 19.625 21.125 19.25 20.75L16 17.4375L12.6875 20.75C12.3125 21.125 11.625 21.125 11.25 20.75C10.875 20.375 10.875 19.6875 11.25 19.3125L14.5625 16L11.25 12.75C10.875 12.375 10.875 11.6875 11.25 11.3125C11.625 10.9375 12.3125 10.9375 12.6875 11.3125L16 14.625L19.25 11.3125C19.625 10.9375 20.3125 10.9375 20.6875 11.3125Z",fill:"currentColor"})),SvgLaunch=ee=>y$1("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 4H15.5C15.6326 4 15.7597 4.05268 15.8535 4.14645C15.9473 4.24022 16 4.36739 16 4.5V9.5C15.9999 9.59894 15.9706 9.69565 15.9156 9.77789C15.8606 9.86013 15.7824 9.92421 15.691 9.962C15.6303 9.98677 15.5655 9.99967 15.5 10C15.4343 10.0001 15.3692 9.98729 15.3084 9.96223C15.2477 9.93718 15.1925 9.9004 15.146 9.854L13.354 8.061L10.707 10.707C10.6147 10.8025 10.5044 10.8787 10.3824 10.9311C10.2604 10.9835 10.1291 11.0111 9.99636 11.0123C9.86358 11.0134 9.7319 10.9881 9.609 10.9378C9.48611 10.8875 9.37446 10.8133 9.28056 10.7194C9.18667 10.6255 9.11242 10.5139 9.06214 10.391C9.01186 10.2681 8.98655 10.1364 8.98771 10.0036C8.98886 9.87082 9.01645 9.7396 9.06886 9.6176C9.12127 9.49559 9.19745 9.38525 9.29296 9.293L11.939 6.646L10.146 4.854C10.0759 4.78407 10.0281 4.6949 10.0087 4.59779C9.98935 4.50068 9.99926 4.40001 10.0372 4.30854C10.0751 4.21706 10.1393 4.13891 10.2217 4.08398C10.3041 4.02905 10.4009 3.99982 10.5 4ZM12 16H6C5.46957 16 4.96086 15.7893 4.58579 15.4142C4.21071 15.0391 4 14.5304 4 14V8C4 7.46957 4.21071 6.96086 4.58579 6.58579C4.96086 6.21071 5.46957 6 6 6H7C7.26522 6 7.51957 6.10536 7.70711 6.29289C7.89464 6.48043 8 6.73478 8 7C8 7.26522 7.89464 7.51957 7.70711 7.70711C7.51957 7.89464 7.26522 8 7 8H6V14H12V13C12 12.7348 12.1054 12.4804 12.2929 12.2929C12.4804 12.1054 12.7348 12 13 12C13.2652 12 13.5196 12.1054 13.7071 12.2929C13.8946 12.4804 14 12.7348 14 13V14C14 14.5304 13.7893 15.0391 13.4142 15.4142C13.0391 15.7893 12.5304 16 12 16Z",fill:"currentColor"})),SvgLoader=ee=>y$1("svg",{width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("g",{id:"Loader Mini"},y$1("path",{id:"Ellipse 2",d:"M18.5 10C18.5 14.4183 14.9183 18 10.5 18C6.08172 18 2.5 14.4183 2.5 10C2.5 5.58172 6.08172 2 10.5 2C14.9183 2 18.5 5.58172 18.5 10ZM4.49743 10C4.49743 13.3151 7.18487 16.0026 10.5 16.0026C13.8151 16.0026 16.5026 13.3151 16.5026 10C16.5026 6.68487 13.8151 3.99743 10.5 3.99743C7.18487 3.99743 4.49743 6.68487 4.49743 10Z",fill:"white",fillOpacity:.3}),y$1("path",{id:"Ellipse 2_2",d:"M10.5 3C10.5 2.44772 10.9494 1.99356 11.4974 2.06242C12.2053 2.15137 12.8996 2.3348 13.5615 2.60896C14.5321 3.011 15.414 3.60028 16.1569 4.34315C16.8997 5.08602 17.489 5.96793 17.891 6.93853C18.1652 7.60043 18.3486 8.29473 18.4376 9.0026C18.5064 9.55057 18.0523 10 17.5 10C16.9477 10 16.5085 9.54925 16.4169 9.00462C16.342 8.55939 16.2169 8.12298 16.0433 7.7039C15.7417 6.97595 15.2998 6.31451 14.7426 5.75736C14.1855 5.20021 13.5241 4.75825 12.7961 4.45672C12.377 4.28313 11.9406 4.15804 11.4954 4.08314C10.9508 3.99152 10.5 3.55228 10.5 3Z",fill:"white"}))),SvgMenu=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M4 6H20M4 12H20M4 18H20",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgMinus=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M18 12H6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgPlus=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M12 6V12M12 12V18M12 12H18M12 12L6 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));class Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Height","Width","ClassName"]}}function importSvg(ee,te){return Interop_reactApi.createElement(ee,keyValueList(te,1))}function check(ee){return importSvg(SvgCheck,ee)}function chevronLeft(ee){return importSvg(SvgChevronLeft,ee)}function chevronRight(ee){return importSvg(SvgChevronRight,ee)}function download(ee){return importSvg(SvgDownload,ee)}function fileNoAccess(ee){return importSvg(SvgFileNoAccess,ee)}function folderXmark(ee){return importSvg(SvgFolderXmark,ee)}function launch(ee){return importSvg(SvgLaunch,ee)}function loader(ee){return importSvg(SvgLoader,ee)}function menu(ee){return importSvg(SvgMenu,ee)}function minus(ee){return importSvg(SvgMinus,ee)}function plus(ee){return importSvg(SvgPlus,ee)}function getKey(ee){return ee.PolicyType.tag===1?"".concat(ee.PolicyId,"-C"):"".concat(ee.PolicyId,"-I")}function Component$5(ee){let te,ne,re;const ie=ee.item,se=ee.dispatch,oe=useFeliz_React__React_useState_Static_1505(!1),he=oe[1],ue=equals$2(ie.Status,new PolicyReviewItemStatusDto(2,[]));return y$1("div",createObj(ofArray$2([["key",getKey(ie.Policy.Identifier)],["onMouseEnter",de=>{he(!0)}],["onMouseLeave",de=>{he(!1)}],["onClick",de=>{se(new Msg(1,[new Page$2(1,[ie])]))}],["className",join(" ",toList(delay(()=>append(singleton$1("py-6 px-4 sm:px-6 shadow-sm rounded-lg text-left cursor-pointer"),delay(()=>singleton$1(ue?"ring-2 ring-primary-base":"ring-1 ring-gray-300 hover:ring-2 hover:ring-primary-base"))))))],(te=[y$1("div",createObj(ofArray$2([["className","flex justify-between"],(ne=[y$1("div",{className:"text-base leading-6 font-semibold text-gray-900 mr-4",children:ie.Policy.Title}),y$1("div",createObj(ofArray$2([["className",join(" ",toList(delay(()=>append(singleton$1("ml-2"),delay(()=>singleton$1(ue?"text-primary-base":"text-gray-400"))))))],(re=toList(delay(()=>singleton$1(ue?check(empty$3()):chevronRight(singleton$2(new Prop(2,[oe[0]?"text-primary-base":""])))))),["children",Interop_reactApi.Children.toArray(Array.from(re))])])))],["children",Interop_reactApi.Children.toArray(Array.from(ne))])]))),y$1("div",{className:"text-sm leading-5 font-normal text-gray-500 mt-2",children:ie.Policy.Description}),y$1("div",{className:"text-sm leading-5 font-medium mt-3 text-primary-base hover:underline underline-offset-2",children:"View document (PDF)"})],["children",Interop_reactApi.Children.toArray(Array.from(te))])])))}function canContinue(ee){return forAll(te=>equals$2(te.Status,new PolicyReviewItemStatusDto(2,[])),ee)}function title(ee){return y$1("div",{className:"text-gray-900 text-2xl sm:text-3xl leading-8 sm:leading-9 font-bold",children:ee})}function container(ee){let te;return y$1("div",createObj(ofArray$2([["className","w-full sm:w-[35rem] text-center bg-white mx-auto px-1 py-5 sm:py-16"],(te=toList(delay(()=>ee)),["children",Interop_reactApi.Children.toArray(Array.from(te))])])))}function noPoliciesConfigured(ee){let te,ne;return container([y$1("div",createObj(ofArray$2([["className","mb-4 mx-auto w-20 h-20 p-6 relative"],(te=[y$1("div",{className:"absolute top-0 left-0 w-full h-full bg-primary-base opacity-[0.07] rounded-full"}),folderXmark(singleton$2(new Prop(2,["text-primary-base"])))],["children",Interop_reactApi.Children.toArray(Array.from(te))])]))),title("No statements available"),y$1("div",{className:"text-center text-gray-600 text-lg font-normal leading-7 sm:leading-8 mt-4",children:"It looks like there are no statements for you to review from your employer at this time."}),y$1("button",createObj(ofArray$2([["type","button"],(ne="mt-8 sm:mt-10 mx-auto shadow-sm w-full sm:w-[12.5rem] h-10 px-4 py-2\n rounded-md flex justify-center items-center text-white text-base\n font-semibold leading-6 cursor-pointer bg-primary-base\n focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base",["className",ne]),["onClick",re=>{ee(new Msg(6,[]))}],["children","Continue"]])))])}function Component$4(ee,te,ne){let re,ie,se;return container([title("Employment information statements"),y$1("div",createObj(ofArray$2([["className","text-gray-600 text-base sm:text-lg font-normal leading-7 sm:leading-8 mt-4"],(re="Please review and accept the below information statement. They outline your entitlements and protections as an employee in Australia.",["children",re])]))),y$1("div",createObj(ofArray$2([["className","space-y-4 mt-8 sm:mt-10"],(ie=toList(delay(()=>map$3(oe=>y$1(Component$5,{dispatch:ne,item:oe}),ee))),["children",Interop_reactApi.Children.toArray(Array.from(ie))])]))),y$1("div",createObj(ofArray$2([["className","text-gray-900 text-sm font-normal leading-5 mt-4 sm:mt-6 text-left"],(se="As a new employee, your employer is required to give you a copy of the Fair Work Information Statements provided by the Fair Work Ombudsman, before, or as soon as possible after, you start your new job.",["children",se])]))),y$1("button",createObj(toList(delay(()=>{const oe=te.tag===1?!0:!canContinue(ee);return append(singleton$1(["disabled",oe]),delay(()=>append(singleton$1(["type","button"]),delay(()=>append(singleton$1(["className",join(" ",toList(delay(()=>append(singleton$1("mt-8 sm:mt-10 mx-auto shadow-sm w-full sm:w-[12.5rem] h-10 px-4 py-2\n rounded-md flex justify-center items-center text-white text-base\n font-semibold leading-6 cursor-pointer bg-primary-base\n focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base"),delay(()=>append(Deferred_inProgress(te)?singleton$1("cursor-progress"):empty$2(),delay(()=>!Deferred_inProgress(te)&&oe?singleton$1("disabled:text-gray-400 disabled:cursor-not-allowed\n disabled:border disabled:border-gray-300 disabled:bg-gray-100"):empty$2())))))))]),delay(()=>append(singleton$1(["onClick",he=>{ne(new Msg(5,[ee,new AsyncOperationStatus$1(0,[])]))}]),delay(()=>{let he;return singleton$1((he=toList(delay(()=>te.tag===1?singleton$1(loader(singleton$2(new Prop(2,["animate-spin"])))):singleton$1("Continue"))),["children",Interop_reactApi.Children.toArray(Array.from(he))]))}))))))))}))))])}function Component$3(ee){let te,ne,re,ie;return y$1("div",createObj(ofArray$2([(te="flex flex-col justify-center items-center w-full shadow rounded-lg ring-1 ring-black ring-opacity-5 bg-gray-100 py-10 px-4 sm:py-20",["className",te]),(ne=[fileNoAccess(empty$3()),y$1("h1",{className:"mt-4 text-gray-900 text-base leading-6 font-semibold",children:"Unable to load PDF"}),y$1("p",createObj(ofArray$2([["className","mt-2 text-gray-700 text-sm leading-5 font-normal max-w-[560px] text-center"],(re="It looks like we’re unable to load the PDF at this time. Download the document below to view the statement.",["children",re])]))),y$1("a",createObj(ofArray$2([(ie="mt-4 text-primary-base text-sm leading-5 font-medium cursor-pointer hover:underline underline-offset-2",["className",ie]),["href",PathDto__get_Value(ee.Path)],["download",ee.Name],["target","_blank"],["children","Download document (PDF)"]])))],["children",Interop_reactApi.Children.toArray(Array.from(ne))])])))}function Component$2(ee){let te,ne,re,ie,se,oe,he,ue;const de=ee.file,ae=ee.reactPdf,le=useFeliz_React__React_useState_Static_1505(!1),Ae=useFeliz_React__React_useState_Static_1505(!1),_e=Ae[0],me=Ae[1],ve=useFeliz_React__React_useState_Static_1505(1),Se=ve[0]|0,Te=useFeliz_React__React_useState_Static_1505(1),Pe=Te[1],Re=Te[0]|0,$e=useReact_useRef_1505(void 0);return y$1("div",createObj(ofArray$2([["ref",$e],(te="flex flex-col justify-center items-center w-full shadow rounded-lg ring-1 ring-black ring-opacity-5 bg-gray-100",["className",te]),(ne=[y$1("style",{children:[PdfCss_all]}),y$1("div",createObj(ofArray$2([["className","flex justify-between items-center py-4 px-4 md:py-3 w-full shadow-sm bg-white rounded-t-lg"],(re=[y$1("button",createObj(ofArray$2([["className","invisible lg:visible p-1 rounded-full hover:bg-gray-100"],["type","button"],["onClick",ye=>{me(!_e)}],["title","Menu"],(ie=[menu(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(ie))])]))),y$1("div",createObj(ofArray$2([["className","flex items-center"],(se=[y$1("button",createObj(ofArray$2([["className","p-1 rounded-full hover:bg-gray-100"],["type","button"],["disabled",Re<=1],["onClick",ye=>{Pe(Re-1)}],["title","Previous page"],(oe=[chevronLeft(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(oe))])]))),y$1("div",{className:"text-gray-900 text-sm font-normal leading-tight mx-4",children:"Page ".concat(Re," / ").concat(Se)}),y$1("button",createObj(ofArray$2([["className","p-1 rounded-full hover:bg-gray-100"],["type","button"],["disabled",Re>=Se],["onClick",ye=>{Pe(Re+1)}],["title","Next page"],(he=[chevronRight(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(he))])])))],["children",Interop_reactApi.Children.toArray(Array.from(se))])]))),y$1("a",createObj(ofArray$2([["className","p-1 rounded-full hover:bg-gray-100"],["href",PathDto__get_Value(de.Path)],["download",de.Name],["title","Download"],["target","_blank"],(ue=[download(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(ue))])])))],["children",Interop_reactApi.Children.toArray(Array.from(re))])]))),Document_Component(ae,ofArray$2([new Document_Prop(0,[PathDto__get_Value(de.Path)]),new Document_Prop(1,[ye=>{le[0]||(le[1](!0),ve[1](ye.numPages),me(value($e.current).clientWidth>=1024))}]),new Document_Prop(3,[ye=>{Pe(ye.pageNumber)}]),new Document_Prop(2,["flex py-2 md:py-4"]),new Document_Prop(4,[[y$1("div",createObj(toList(delay(()=>_e?append(singleton$1(["className","flex flex-col space-y-4 p-4"]),delay(()=>{let ye;return singleton$1((ye=toList(delay(()=>map$2(Ee=>{const Ne=ofArray$2([y$1("div",createObj(toList(delay(()=>append(Re===Ee?singleton$1(["className","border-4 border-primary-base rounded"]):empty$2(),delay(()=>{let Me;return singleton$1((Me=[Thumbnail_Component(ae,ofArray$2([new Thumbnail_Prop(0,["thumbnail-".concat(Ee)]),new Thumbnail_Prop(1,[Ee]),new Thumbnail_Prop(2,[100])]))],["children",Interop_reactApi.Children.toArray(Array.from(Me))]))})))))),y$1("div",{className:"mt-1 text-center text-xs text-gray-600",children:Ee})]);return y$1("div",{children:Interop_reactApi.Children.toArray(Array.from(Ne))})},rangeDouble(1,1,Se)))),["children",Interop_reactApi.Children.toArray(Array.from(ye))]))})):empty$2())))),Page_Component(ae,toList(delay(()=>append(singleton$1(new Page_Prop(0,[Re])),delay(()=>$e.current!=null?singleton$1(new Page_Prop(1,[min(comparePrimitives,value($e.current).clientWidth-32,768)])):empty$2())))))]])]))],["children",Interop_reactApi.Children.toArray(Array.from(ne))])])))}function Component$1(ee){let te,ne,re,ie;const se=ee.dispatch,oe=ee.reactPdf,he=ee.acceptPolicyStatus,ue=ee.policyReviewItem,de=useFeliz_React__React_useState_Static_1505(!1),ae=de[0],le=de[1];return y$1("div",createObj(ofArray$2([["className","w-full p-1 sm:p-5"],(te=[y$1("div",createObj(ofArray$2([["className","flex justify-between items-center"],(ne=toList(delay(()=>{let Ae;return append(singleton$1(y$1("div",createObj(ofArray$2([["className","flex items-start cursor-pointer text-gray-900 hover:text-primary-base"],["disabled",Deferred_inProgress(he)],["onClick",_e=>{se(new Msg(1,[new Page$2(0,[])]))}],(Ae=[chevronLeft(singleton$2(new Prop(2,["sm:mt-[1px]"]))),y$1("div",{className:"ml-1 mr-4 text-base sm:text-lg leading-6 sm:leading-7 font-semibold text-gray-900",children:ue.Policy.Title})],["children",Interop_reactApi.Children.toArray(Array.from(Ae))])])))),delay(()=>{let _e,me,ve;return ue.Status.tag===2?singleton$1(y$1("div",createObj(ofArray$2([["className","flex items-center flex-col-reverse sm:flex-row"],(_e=[y$1("span",{className:"mt-1 sm:mt-0 sm:mr-2.5 sm:py-2.5 text-sm leading-5 font-medium text-gray-500",children:"Accepted"}),check(singleton$2(new Prop(2,["text-primary-base"])))],["children",Interop_reactApi.Children.toArray(Array.from(_e))])])))):singleton$1(y$1("button",createObj(ofArray$2([["type","button"],["disabled",Deferred_inProgress(he)],(me="\n shadow-sm w-[4.75rem] h-10 px-3 py-2 rounded-md flex justify-center items-center text-white\n text-sm font-semibold leading-5 cursor-pointer disabled:cursor-progress bg-primary-base\n focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base\n ",["className",me]),["onClick",Se=>{se(new Msg(4,[ue,new AsyncOperationStatus$1(0,[])]))}],(ve=toList(delay(()=>he.tag===1?singleton$1(loader(singleton$2(new Prop(2,["animate-spin"])))):singleton$1("Accept"))),["children",Interop_reactApi.Children.toArray(Array.from(ve))])]))))}))})),["children",Interop_reactApi.Children.toArray(Array.from(ne))])]))),y$1("div",createObj(ofArray$2([["className","mt-4 sm:mt-6 mb-6"],(re=toList(delay(()=>oe==null?singleton$1(y$1(Component$3,ue.Policy.File)):singleton$1(y$1(Component$2,{reactPdf:oe,file:ue.Policy.File})))),["children",Interop_reactApi.Children.toArray(Array.from(re))])]))),y$1("div",createObj(ofArray$2([["className","p-4 sm:p-6 rounded-lg shadow-sm border border-gray-300"],(ie=toList(delay(()=>{let Ae;return append(singleton$1(y$1("div",createObj(ofArray$2([["className","flex justify-between cursor-pointer text-gray-400 hover:text-primary-base"],["onClick",_e=>{le(!ae)}],(Ae=toList(delay(()=>append(singleton$1(y$1("div",{className:"text-sm mr-4 sm:text-base leading-5 sm:leading-6 font-semibold text-gray-900",children:"About the ".concat(ue.Policy.Title)})),delay(()=>singleton$1(ae?minus(empty$3()):plus(empty$3())))))),["children",Interop_reactApi.Children.toArray(Array.from(Ae))])])))),delay(()=>{let _e,me,ve;return ae?singleton$1(y$1("div",createObj(ofArray$2([["className","mt-2 space-y-3 sm:max-w-[57rem]"],["onClick",Se=>{le(!ae)}],(_e=[y$1("div",{className:"text-sm font-normal leading-6 text-gray-900",children:ue.Policy.About.Copy}),y$1("a",createObj(ofArray$2([(me="text-sm font-medium leading-5 text-primary-base cursor-pointer hover:underline underline-offset-2 break-all",["className",me]),["target","_blank"],["rel","noopener"],["href",ue.Policy.About.Link],(ve=[ue.Policy.About.Link,launch(singleton$2(new Prop(2,["inline align-bottom"])))],["children",Interop_reactApi.Children.toArray(Array.from(ve))])])))],["children",Interop_reactApi.Children.toArray(Array.from(_e))])])))):empty$2()}))})),["children",Interop_reactApi.Children.toArray(Array.from(ie))])])))],["children",Interop_reactApi.Children.toArray(Array.from(te))])])))}function r$1(){return(r$1=Object.assign||function(ee){for(var te=1;te<arguments.length;te++){var ne=arguments[te];for(var re in ne)Object.prototype.hasOwnProperty.call(ne,re)&&(ee[re]=ne[re])}return ee}).apply(this,arguments)}function i(ee){this.getChildContext=function(){return ee.context};var te=ee.children,ne=function(re,ie){if(re==null)return{};var se,oe,he={},ue=Object.keys(re);for(oe=0;oe<ue.length;oe++)ie.indexOf(se=ue[oe])>=0||(he[se]=re[se]);return he}(ee,["context","children"]);return F$2(te,ne)}function a(){var ee=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(ee),this._vdom=y$1(i,r$1({},this._props,{context:ee.detail.context}),function te(ne,re){if(ne.nodeType===3)return ne.data;if(ne.nodeType!==1)return null;var ie=[],se={},oe=0,he=ne.attributes,ue=ne.childNodes;for(oe=he.length;oe--;)he[oe].name!=="slot"&&(se[he[oe].name]=he[oe].value,se[s(he[oe].name)]=he[oe].value);for(oe=ue.length;oe--;){var de=te(ue[oe],null),ae=ue[oe].slot;ae?se[ae]=y$1(u,{name:ae},de):ie[oe]=de}var le=re?y$1(u,null,ie):ie;return y$1(re||ne.nodeName.toLowerCase(),se,le)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?E$1:D$1)(this._vdom,this._root)}function s(ee){return ee.replace(/-(\w)/g,function(te,ne){return ne?ne.toUpperCase():""})}function c(ee,te,ne){if(this._vdom){var re={};re[ee]=ne=ne==null?void 0:ne,re[s(ee)]=ne,this._vdom=F$2(this._vdom,re),D$1(this._vdom,this._root)}}function l(){D$1(this._vdom=null,this._root)}function u(ee,te){var ne=this;return y$1("slot",r$1({},ee,{ref:function(re){re?(ne.ref=re,ne._listener||(ne._listener=function(ie){ie.stopPropagation(),ie.detail.context=te},re.addEventListener("_preact",ne._listener))):ne.ref.removeEventListener("_preact",ne._listener)}}))}function preact_custom_element(ee,te,ne,re){function ie(){var se=Reflect.construct(HTMLElement,[],ie);return se._vdomComponent=ee,se._root=re&&re.shadow?se.attachShadow({mode:"open"}):se,se}return(ie.prototype=Object.create(HTMLElement.prototype)).constructor=ie,ie.prototype.connectedCallback=a,ie.prototype.attributeChangedCallback=c,ie.prototype.disconnectedCallback=l,ne=ne||ee.observedAttributes||Object.keys(ee.propTypes||{}),ie.observedAttributes=ne,ne.forEach(function(se){Object.defineProperty(ie.prototype,se,{get:function(){return this._vdom.props[se]},set:function(oe){this._vdom?this.attributeChangedCallback(se,null,oe):(this._props||(this._props={}),this._props[se]=oe,this.connectedCallback());var he=typeof oe;oe!=null&&he!=="string"&&he!=="boolean"&&he!=="number"||this.setAttribute(se,oe)}})}),customElements.define(te||ee.tagName||ee.displayName||ee.name,ie)}function register(ee,te){preact_custom_element(ee,te,void 0,{shadow:!0})}class PdfModuleStatus extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Loading","Loaded"]}}function Component(ee){let te,ne;const re=BackendService_$ctor_Z384F8060(ee.backendUrl,ee.accessToken);ne=React_useElmish_Z6C327F2E(()=>ProgramModule_mkProgram(StateModule_init,(ae,le)=>StateModule_update(re,ae,le),(ae,le)=>{}),void 0,void 0);const ie=ne[0],se=ne[1],oe=useFeliz_React__React_useState_Static_1505(new PdfModuleStatus(0,[])),he=oe[1],ue=oe[0];useReact_useEffectOnce_3A5B6456(()=>{startImport(ae=>{he(new PdfModuleStatus(1,[ae]))},()=>{he(new PdfModuleStatus(1,[void 0]))})});const de=[y$1("style",{children:[css]}),y$1("div",createObj(ofArray$2([["className","font-inter"],(te=toList(delay(()=>{const ae=ie.GetInitStateStatus,le=ie.PresentPoliciesStatus;let Ae,_e;switch(ae.tag===3?(le.tag===3||le.tag===0||le.tag===1||le.fields[0].tag,Ae=0):ae.tag===0||ae.tag===1?le.tag===3?Ae=0:le.tag===0||le.tag===1?Ae=3:le.fields[0].tag===1?Ae=0:Ae=3:ae.fields[0].tag===0?le.tag===3?Ae=0:le.tag===0||le.tag===1?ae.fields[0].fields[0].tag===1?Ae=1:Ae=3:le.fields[0].tag===0?ae.fields[0].fields[0].tag===0?ue.tag===0?Ae=3:(Ae=2,_e=ue.fields[0]):Ae=1:Ae=0:Ae=0,Ae){case 0:return singleton$1(y$1("div",{children:["Oops, we've encountered an error"]}));case 1:return singleton$1(noPoliciesConfigured(se));case 2:{const me=ie.Page;return me.tag===1?singleton$1(y$1(Component$1,{policyReviewItem:me.fields[0],acceptPolicyStatus:ie.AcceptPolicyStatus,reactPdf:_e,dispatch:se})):singleton$1(Component$4(ie.ReviewItemList,ie.ContinueStatus,se))}case 3:return singleton$1(y$1("div",{children:["Please wait..."]}))}})),["children",Interop_reactApi.Children.toArray(Array.from(te))])])))];return y$1(k$3,{},...de)}register(ee=>y$1(Component,ee),"apollo-workplace-policies-app");function commonjsRequire(ee){throw new Error('Could not dynamically require "'+ee+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports){(function(te,ne){module.exports=te.pdfjsLib=ne()})(globalThis,()=>(()=>{var __webpack_modules__=[,(ee,te)=>{var Gt;Object.defineProperty(te,"__esModule",{value:!0}),te.VerbosityLevel=te.Util=te.UnknownErrorException=te.UnexpectedResponseException=te.TextRenderingMode=te.RenderingIntentFlag=te.PromiseCapability=te.PermissionFlag=te.PasswordResponses=te.PasswordException=te.PageActionEventType=te.OPS=te.MissingPDFException=te.MAX_IMAGE_SIZE_TO_CACHE=te.LINE_FACTOR=te.LINE_DESCENT_FACTOR=te.InvalidPDFException=te.ImageKind=te.IDENTITY_MATRIX=te.FormatError=te.FeatureTest=te.FONT_IDENTITY_MATRIX=te.DocumentActionEventType=te.CMapCompressionType=te.BaseException=te.BASELINE_FACTOR=te.AnnotationType=te.AnnotationReplyType=te.AnnotationPrefix=te.AnnotationMode=te.AnnotationFlag=te.AnnotationFieldFlag=te.AnnotationEditorType=te.AnnotationEditorPrefix=te.AnnotationEditorParamsType=te.AnnotationBorderStyleType=te.AnnotationActionEventType=te.AbortException=void 0,te.assert=ut,te.bytesToString=He,te.createValidAbsoluteUrl=wt,te.getModificationDate=Ct,te.getUuid=Vt,te.getVerbosityLevel=Xe,te.info=rt,te.isArrayBuffer=ft,te.isArrayEqual=Tt,te.isNodeJS=void 0,te.normalizeUnicode=zt,te.objectFromMap=ht,te.objectSize=ot,te.setVerbosityLevel=Ie,te.shadow=Et,te.string32=et,te.stringToBytes=it,te.stringToPDFString=gt,te.stringToUTF8String=tt,te.unreachable=Ge,te.utf8StringToString=nt,te.warn=lt;const ne=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");te.isNodeJS=ne;const re=[1,0,0,1,0,0];te.IDENTITY_MATRIX=re;const ie=[.001,0,0,.001,0,0];te.FONT_IDENTITY_MATRIX=ie;const se=1e7;te.MAX_IMAGE_SIZE_TO_CACHE=se;const oe=1.35;te.LINE_FACTOR=oe;const he=.35;te.LINE_DESCENT_FACTOR=he;const ue=he/oe;te.BASELINE_FACTOR=ue;const de={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};te.RenderingIntentFlag=de;const ae={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};te.AnnotationMode=ae;const le="pdfjs_internal_editor_";te.AnnotationEditorPrefix=le;const Ae={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};te.AnnotationEditorType=Ae;const _e={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};te.AnnotationEditorParamsType=_e;const me={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};te.PermissionFlag=me;const ve={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};te.TextRenderingMode=ve;const Se={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};te.ImageKind=Se;const Te={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};te.AnnotationType=Te;const Pe={GROUP:"Group",REPLY:"R"};te.AnnotationReplyType=Pe;const Re={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};te.AnnotationFlag=Re;const $e={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};te.AnnotationFieldFlag=$e;const ye={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};te.AnnotationBorderStyleType=ye;const Ee={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};te.AnnotationActionEventType=Ee;const Ne={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};te.DocumentActionEventType=Ne;const Me={O:"PageOpen",C:"PageClose"};te.PageActionEventType=Me;const we={ERRORS:0,WARNINGS:1,INFOS:5};te.VerbosityLevel=we;const Oe={NONE:0,BINARY:1};te.CMapCompressionType=Oe;const Fe={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};te.OPS=Fe;const Ve={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};te.PasswordResponses=Ve;let qe=we.WARNINGS;function Ie(dt){Number.isInteger(dt)&&(qe=dt)}function Xe(){return qe}function rt(dt){qe>=we.INFOS&&console.log("Info: ".concat(dt))}function lt(dt){qe>=we.WARNINGS&&console.log("Warning: ".concat(dt))}function Ge(dt){throw new Error(dt)}function ut(dt,Qe){dt||Ge(Qe)}function mt(dt){switch(dt==null?void 0:dt.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function wt(dt,Qe=null,Ye=null){if(!dt)return null;try{if(Ye&&typeof dt=="string"){if(Ye.addDefaultProtocol&&dt.startsWith("www.")){const St=dt.match(/\./g);(St==null?void 0:St.length)>=2&&(dt="http://".concat(dt))}if(Ye.tryConvertEncoding)try{dt=tt(dt)}catch{}}const yt=Qe?new URL(dt,Qe):new URL(dt);if(mt(yt))return yt}catch{}return null}function Et(dt,Qe,Ye,yt=!1){return Object.defineProperty(dt,Qe,{value:Ye,enumerable:!yt,configurable:!0,writable:!1}),Ye}const De=function(){function Qe(Ye,yt){this.constructor===Qe&&Ge("Cannot initialize BaseException."),this.message=Ye,this.name=yt}return Qe.prototype=new Error,Qe.constructor=Qe,Qe}();te.BaseException=De;class pe extends De{constructor(Qe,Ye){super(Qe,"PasswordException"),this.code=Ye}}te.PasswordException=pe;class be extends De{constructor(Qe,Ye){super(Qe,"UnknownErrorException"),this.details=Ye}}te.UnknownErrorException=be;class ge extends De{constructor(Qe){super(Qe,"InvalidPDFException")}}te.InvalidPDFException=ge;class Ce extends De{constructor(Qe){super(Qe,"MissingPDFException")}}te.MissingPDFException=Ce;class xe extends De{constructor(Qe,Ye){super(Qe,"UnexpectedResponseException"),this.status=Ye}}te.UnexpectedResponseException=xe;class Le extends De{constructor(Qe){super(Qe,"FormatError")}}te.FormatError=Le;class Be extends De{constructor(Qe){super(Qe,"AbortException")}}te.AbortException=Be;function He(dt){(typeof dt!="object"||(dt==null?void 0:dt.length)===void 0)&&Ge("Invalid argument for bytesToString");const Qe=dt.length,Ye=8192;if(Qe<Ye)return String.fromCharCode.apply(null,dt);const yt=[];for(let St=0;St<Qe;St+=Ye){const wn=Math.min(St+Ye,Qe),Qt=dt.subarray(St,wn);yt.push(String.fromCharCode.apply(null,Qt))}return yt.join("")}function it(dt){typeof dt!="string"&&Ge("Invalid argument for stringToBytes");const Qe=dt.length,Ye=new Uint8Array(Qe);for(let yt=0;yt<Qe;++yt)Ye[yt]=dt.charCodeAt(yt)&255;return Ye}function et(dt){return String.fromCharCode(dt>>24&255,dt>>16&255,dt>>8&255,dt&255)}function ot(dt){return Object.keys(dt).length}function ht(dt){const Qe=Object.create(null);for(const[Ye,yt]of dt)Qe[Ye]=yt;return Qe}function pt(){const dt=new Uint8Array(4);return dt[0]=1,new Uint32Array(dt.buffer,0,1)[0]===1}function ct(){try{return new Function(""),!0}catch{return!1}}class Pt{static get isLittleEndian(){return Et(this,"isLittleEndian",pt())}static get isEvalSupported(){return Et(this,"isEvalSupported",ct())}static get isOffscreenCanvasSupported(){return Et(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Et(this,"platform",{isWin:!1,isMac:!1}):Et(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var Qe,Ye;return Et(this,"isCSSRoundSupported",(Ye=(Qe=globalThis.CSS)==null?void 0:Qe.supports)==null?void 0:Ye.call(Qe,"width: round(1.5px, 1px)"))}}te.FeatureTest=Pt;const It=[...Array(256).keys()].map(dt=>dt.toString(16).padStart(2,"0"));class vt{static makeHexColor(Qe,Ye,yt){return"#".concat(It[Qe]).concat(It[Ye]).concat(It[yt])}static scaleMinMax(Qe,Ye){let yt;Qe[0]?(Qe[0]<0&&(yt=Ye[0],Ye[0]=Ye[1],Ye[1]=yt),Ye[0]*=Qe[0],Ye[1]*=Qe[0],Qe[3]<0&&(yt=Ye[2],Ye[2]=Ye[3],Ye[3]=yt),Ye[2]*=Qe[3],Ye[3]*=Qe[3]):(yt=Ye[0],Ye[0]=Ye[2],Ye[2]=yt,yt=Ye[1],Ye[1]=Ye[3],Ye[3]=yt,Qe[1]<0&&(yt=Ye[2],Ye[2]=Ye[3],Ye[3]=yt),Ye[2]*=Qe[1],Ye[3]*=Qe[1],Qe[2]<0&&(yt=Ye[0],Ye[0]=Ye[1],Ye[1]=yt),Ye[0]*=Qe[2],Ye[1]*=Qe[2]),Ye[0]+=Qe[4],Ye[1]+=Qe[4],Ye[2]+=Qe[5],Ye[3]+=Qe[5]}static transform(Qe,Ye){return[Qe[0]*Ye[0]+Qe[2]*Ye[1],Qe[1]*Ye[0]+Qe[3]*Ye[1],Qe[0]*Ye[2]+Qe[2]*Ye[3],Qe[1]*Ye[2]+Qe[3]*Ye[3],Qe[0]*Ye[4]+Qe[2]*Ye[5]+Qe[4],Qe[1]*Ye[4]+Qe[3]*Ye[5]+Qe[5]]}static applyTransform(Qe,Ye){const yt=Qe[0]*Ye[0]+Qe[1]*Ye[2]+Ye[4],St=Qe[0]*Ye[1]+Qe[1]*Ye[3]+Ye[5];return[yt,St]}static applyInverseTransform(Qe,Ye){const yt=Ye[0]*Ye[3]-Ye[1]*Ye[2],St=(Qe[0]*Ye[3]-Qe[1]*Ye[2]+Ye[2]*Ye[5]-Ye[4]*Ye[3])/yt,wn=(-Qe[0]*Ye[1]+Qe[1]*Ye[0]+Ye[4]*Ye[1]-Ye[5]*Ye[0])/yt;return[St,wn]}static getAxialAlignedBoundingBox(Qe,Ye){const yt=this.applyTransform(Qe,Ye),St=this.applyTransform(Qe.slice(2,4),Ye),wn=this.applyTransform([Qe[0],Qe[3]],Ye),Qt=this.applyTransform([Qe[2],Qe[1]],Ye);return[Math.min(yt[0],St[0],wn[0],Qt[0]),Math.min(yt[1],St[1],wn[1],Qt[1]),Math.max(yt[0],St[0],wn[0],Qt[0]),Math.max(yt[1],St[1],wn[1],Qt[1])]}static inverseTransform(Qe){const Ye=Qe[0]*Qe[3]-Qe[1]*Qe[2];return[Qe[3]/Ye,-Qe[1]/Ye,-Qe[2]/Ye,Qe[0]/Ye,(Qe[2]*Qe[5]-Qe[4]*Qe[3])/Ye,(Qe[4]*Qe[1]-Qe[5]*Qe[0])/Ye]}static singularValueDecompose2dScale(Qe){const Ye=[Qe[0],Qe[2],Qe[1],Qe[3]],yt=Qe[0]*Ye[0]+Qe[1]*Ye[2],St=Qe[0]*Ye[1]+Qe[1]*Ye[3],wn=Qe[2]*Ye[0]+Qe[3]*Ye[2],Qt=Qe[2]*Ye[1]+Qe[3]*Ye[3],Je=(yt+Qt)/2,At=Math.sqrt((yt+Qt)**2-4*(yt*Qt-wn*St))/2,Lt=Je+At||1,Rt=Je-At||1;return[Math.sqrt(Lt),Math.sqrt(Rt)]}static normalizeRect(Qe){const Ye=Qe.slice(0);return Qe[0]>Qe[2]&&(Ye[0]=Qe[2],Ye[2]=Qe[0]),Qe[1]>Qe[3]&&(Ye[1]=Qe[3],Ye[3]=Qe[1]),Ye}static intersect(Qe,Ye){const yt=Math.max(Math.min(Qe[0],Qe[2]),Math.min(Ye[0],Ye[2])),St=Math.min(Math.max(Qe[0],Qe[2]),Math.max(Ye[0],Ye[2]));if(yt>St)return null;const wn=Math.max(Math.min(Qe[1],Qe[3]),Math.min(Ye[1],Ye[3])),Qt=Math.min(Math.max(Qe[1],Qe[3]),Math.max(Ye[1],Ye[3]));return wn>Qt?null:[yt,wn,St,Qt]}static bezierBoundingBox(Qe,Ye,yt,St,wn,Qt,Je,At){const Lt=[],Rt=[[],[]];let Dt,Nt,Zt,bt,Kt,Ot,Ue,fe;for(let Ze=0;Ze<2;++Ze){if(Ze===0?(Nt=6*Qe-12*yt+6*wn,Dt=-3*Qe+9*yt-9*wn+3*Je,Zt=3*yt-3*Qe):(Nt=6*Ye-12*St+6*Qt,Dt=-3*Ye+9*St-9*Qt+3*At,Zt=3*St-3*Ye),Math.abs(Dt)<1e-12){if(Math.abs(Nt)<1e-12)continue;bt=-Zt/Nt,0<bt&&bt<1&&Lt.push(bt);continue}Ue=Nt*Nt-4*Zt*Dt,fe=Math.sqrt(Ue),!(Ue<0)&&(Kt=(-Nt+fe)/(2*Dt),0<Kt&&Kt<1&&Lt.push(Kt),Ot=(-Nt-fe)/(2*Dt),0<Ot&&Ot<1&&Lt.push(Ot))}let ke=Lt.length,je;const ze=ke;for(;ke--;)bt=Lt[ke],je=1-bt,Rt[0][ke]=je*je*je*Qe+3*je*je*bt*yt+3*je*bt*bt*wn+bt*bt*bt*Je,Rt[1][ke]=je*je*je*Ye+3*je*je*bt*St+3*je*bt*bt*Qt+bt*bt*bt*At;return Rt[0][ze]=Qe,Rt[1][ze]=Ye,Rt[0][ze+1]=Je,Rt[1][ze+1]=At,Rt[0].length=Rt[1].length=ze+2,[Math.min(...Rt[0]),Math.min(...Rt[1]),Math.max(...Rt[0]),Math.max(...Rt[1])]}}te.Util=vt;const kt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function gt(dt){if(dt[0]>="ï"){let Ye;if(dt[0]==="þ"&&dt[1]==="ÿ"?Ye="utf-16be":dt[0]==="ÿ"&&dt[1]==="þ"?Ye="utf-16le":dt[0]==="ï"&&dt[1]==="»"&&dt[2]==="¿"&&(Ye="utf-8"),Ye)try{const yt=new TextDecoder(Ye,{fatal:!0}),St=it(dt);return yt.decode(St)}catch(yt){lt('stringToPDFString: "'.concat(yt,'".'))}}const Qe=[];for(let Ye=0,yt=dt.length;Ye<yt;Ye++){const St=kt[dt.charCodeAt(Ye)];Qe.push(St?String.fromCharCode(St):dt.charAt(Ye))}return Qe.join("")}function tt(dt){return decodeURIComponent(escape(dt))}function nt(dt){return unescape(encodeURIComponent(dt))}function ft(dt){return typeof dt=="object"&&(dt==null?void 0:dt.byteLength)!==void 0}function Tt(dt,Qe){if(dt.length!==Qe.length)return!1;for(let Ye=0,yt=dt.length;Ye<yt;Ye++)if(dt[Ye]!==Qe[Ye])return!1;return!0}function Ct(dt=new Date){return[dt.getUTCFullYear().toString(),(dt.getUTCMonth()+1).toString().padStart(2,"0"),dt.getUTCDate().toString().padStart(2,"0"),dt.getUTCHours().toString().padStart(2,"0"),dt.getUTCMinutes().toString().padStart(2,"0"),dt.getUTCSeconds().toString().padStart(2,"0")].join("")}class Ht{constructor(){We(this,Gt,!1);this.promise=new Promise((Qe,Ye)=>{this.resolve=yt=>{st(this,Gt,!0),Qe(yt)},this.reject=yt=>{st(this,Gt,!0),Ye(yt)}})}get settled(){return ce(this,Gt)}}Gt=new WeakMap,te.PromiseCapability=Ht;let Wt=null,Ut=null;function zt(dt){return Wt||(Wt=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Ut=new Map([["ſt","ſt"]])),dt.replaceAll(Wt,(Qe,Ye,yt)=>Ye?Ye.normalize("NFKC"):Ut.get(yt))}function Vt(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const dt=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(dt);else for(let Qe=0;Qe<32;Qe++)dt[Qe]=Math.floor(Math.random()*255);return He(dt)}const jt="pdfjs_internal_id_";te.AnnotationPrefix=jt},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var ee,ne,re,ie,kn,oe,qn,ue,de,ae,le,Ae,_e,me,ve,Se,zn,Pe,Re,ar,ye,Ee;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(Me){var Ht,Wt;if(typeof Me=="string"||Me instanceof URL?Me={url:Me}:(0,_util.isArrayBuffer)(Me)&&(Me={data:Me}),typeof Me!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!Me.url&&!Me.data&&!Me.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const we=new PDFDocumentLoadingTask,{docId:Oe}=we,Fe=Me.url?getUrlProp(Me.url):null,Ve=Me.data?getDataProp(Me.data):null,qe=Me.httpHeaders||null,Ie=Me.withCredentials===!0,Xe=(Ht=Me.password)!=null?Ht:null,rt=Me.range instanceof PDFDataRangeTransport?Me.range:null,lt=Number.isInteger(Me.rangeChunkSize)&&Me.rangeChunkSize>0?Me.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Ge=Me.worker instanceof PDFWorker?Me.worker:null;const ut=Me.verbosity,mt=typeof Me.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(Me.docBaseUrl)?Me.docBaseUrl:null,wt=typeof Me.cMapUrl=="string"?Me.cMapUrl:null,Et=Me.cMapPacked!==!1,De=Me.CMapReaderFactory||DefaultCMapReaderFactory,pe=typeof Me.standardFontDataUrl=="string"?Me.standardFontDataUrl:null,be=Me.StandardFontDataFactory||DefaultStandardFontDataFactory,ge=Me.stopAtErrors!==!0,Ce=Number.isInteger(Me.maxImageSize)&&Me.maxImageSize>-1?Me.maxImageSize:-1,xe=Me.isEvalSupported!==!1,Le=typeof Me.isOffscreenCanvasSupported=="boolean"?Me.isOffscreenCanvasSupported:!_util.isNodeJS,Be=Number.isInteger(Me.canvasMaxAreaInBytes)?Me.canvasMaxAreaInBytes:-1,He=typeof Me.disableFontFace=="boolean"?Me.disableFontFace:_util.isNodeJS,it=Me.fontExtraProperties===!0,et=Me.enableXfa===!0,ot=Me.ownerDocument||globalThis.document,ht=Me.disableRange===!0,pt=Me.disableStream===!0,ct=Me.disableAutoFetch===!0,Pt=Me.pdfBug===!0,It=rt?rt.length:(Wt=Me.length)!=null?Wt:NaN,vt=typeof Me.useSystemFonts=="boolean"?Me.useSystemFonts:!_util.isNodeJS&&!He,kt=typeof Me.useWorkerFetch=="boolean"?Me.useWorkerFetch:De===_display_utils.DOMCMapReaderFactory&&be===_display_utils.DOMStandardFontDataFactory&&wt&&pe&&(0,_display_utils.isValidFetchUrl)(wt,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(pe,document.baseURI),gt=Me.canvasFactory||new DefaultCanvasFactory({ownerDocument:ot}),tt=Me.filterFactory||new DefaultFilterFactory({docId:Oe,ownerDocument:ot}),nt=null;(0,_util.setVerbosityLevel)(ut);const ft={canvasFactory:gt,filterFactory:tt};if(kt||(ft.cMapReaderFactory=new De({baseUrl:wt,isCompressed:Et}),ft.standardFontDataFactory=new be({baseUrl:pe})),!Ge){const Ut={verbosity:ut,port:_worker_options.GlobalWorkerOptions.workerPort};Ge=Ut.port?PDFWorker.fromPort(Ut):new PDFWorker(Ut),we._worker=Ge}const Tt={docId:Oe,apiVersion:"3.11.174",data:Ve,password:Xe,disableAutoFetch:ct,rangeChunkSize:lt,length:It,docBaseUrl:mt,enableXfa:et,evaluatorOptions:{maxImageSize:Ce,disableFontFace:He,ignoreErrors:ge,isEvalSupported:xe,isOffscreenCanvasSupported:Le,canvasMaxAreaInBytes:Be,fontExtraProperties:it,useSystemFonts:vt,cMapUrl:kt?wt:null,standardFontDataUrl:kt?pe:null}},Ct={ignoreErrors:ge,isEvalSupported:xe,disableFontFace:He,fontExtraProperties:it,enableXfa:et,ownerDocument:ot,disableAutoFetch:ct,pdfBug:Pt,styleElement:nt};return Ge.promise.then(function(){if(we.destroyed)throw new Error("Loading aborted");const Ut=_fetchDocument(Ge,Tt),zt=new Promise(function(Vt){let jt;rt?jt=new _transport_stream.PDFDataTransportStream({length:It,initialData:rt.initialData,progressiveDone:rt.progressiveDone,contentDispositionFilename:rt.contentDispositionFilename,disableRange:ht,disableStream:pt},rt):Ve||(jt=(dt=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(dt):(0,_display_utils.isValidFetchUrl)(dt.url)?new _displayFetch_stream.PDFFetchStream(dt):new _displayNetwork.PDFNetworkStream(dt))({url:Fe,length:It,httpHeaders:qe,withCredentials:Ie,rangeChunkSize:lt,disableRange:ht,disableStream:pt})),Vt(jt)});return Promise.all([Ut,zt]).then(function([Vt,jt]){if(we.destroyed)throw new Error("Loading aborted");const Gt=new _message_handler.MessageHandler(Oe,Vt,Ge.port),dt=new WorkerTransport(Gt,we,jt,Ct,ft);we._transport=dt,Gt.send("Ready",null)})}).catch(we._capability.reject),we}async function _fetchDocument(Me,we){if(Me.destroyed)throw new Error("Worker was destroyed");const Oe=await Me.messageHandler.sendWithPromise("GetDocRequest",we,we.data?[we.data.buffer]:null);if(Me.destroyed)throw new Error("Worker was destroyed");return Oe}function getUrlProp(Me){if(Me instanceof URL)return Me.href;try{return new URL(Me,window.location).href}catch{if(_util.isNodeJS&&typeof Me=="string")return Me}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(Me){if(_util.isNodeJS&&typeof Buffer<"u"&&Me instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(Me instanceof Uint8Array&&Me.byteLength===Me.buffer.byteLength)return Me;if(typeof Me=="string")return(0,_util.stringToBytes)(Me);if(typeof Me=="object"&&!isNaN(Me==null?void 0:Me.length)||(0,_util.isArrayBuffer)(Me))return new Uint8Array(Me);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const te=class te{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d".concat(Nn(te,ee)._++),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var we,Oe,Fe;this.destroyed=!0;try{(we=this._worker)!=null&&we.port&&(this._worker._pendingDestroy=!0),await((Oe=this._transport)==null?void 0:Oe.destroy())}catch(Ve){throw(Fe=this._worker)!=null&&Fe.port&&delete this._worker._pendingDestroy,Ve}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};ee=new WeakMap,We(te,ee,0);let PDFDocumentLoadingTask=te;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(we,Oe,Fe=!1,Ve=null){this.length=we,this.initialData=Oe,this.progressiveDone=Fe,this.contentDispositionFilename=Ve,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(we){this._rangeListeners.push(we)}addProgressListener(we){this._progressListeners.push(we)}addProgressiveReadListener(we){this._progressiveReadListeners.push(we)}addProgressiveDoneListener(we){this._progressiveDoneListeners.push(we)}onDataRange(we,Oe){for(const Fe of this._rangeListeners)Fe(we,Oe)}onDataProgress(we,Oe){this._readyCapability.promise.then(()=>{for(const Fe of this._progressListeners)Fe(we,Oe)})}onDataProgressiveRead(we){this._readyCapability.promise.then(()=>{for(const Oe of this._progressiveReadListeners)Oe(we)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const we of this._progressiveDoneListeners)we()})}transportReady(){this._readyCapability.resolve()}requestDataRange(we,Oe){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(we,Oe){this._pdfInfo=we,this._transport=Oe,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(Fe=>{if(!Fe)return Fe;const Ve=[];for(const qe in Fe)Ve.push(...Fe[qe]);return Ve}))})}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(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(we){return this._transport.getPage(we)}getPageIndex(we){return this._transport.getPageIndex(we)}getDestinations(){return this._transport.getDestinations()}getDestination(we){return this._transport.getDestination(we)}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(){return this._transport.getOptionalContentConfig()}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(we=!1){return this._transport.startCleanup(we||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}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()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(we,Oe,Fe,Ve=!1){We(this,ie);We(this,oe);We(this,ne,null);We(this,re,!1);this._pageIndex=we,this._pageInfo=Oe,this._transport=Fe,this._stats=Ve?new _display_utils.StatTimer:null,this._pdfBug=Ve,this.commonObjs=Fe.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:we,rotation:Oe=this.rotate,offsetX:Fe=0,offsetY:Ve=0,dontFlip:qe=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:we,rotation:Oe,offsetX:Fe,offsetY:Ve,dontFlip:qe})}getAnnotations({intent:we="display"}={}){const Oe=this._transport.getRenderingIntent(we);return this._transport.getAnnotations(this._pageIndex,Oe.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var we;return((we=this._transport._htmlForXfa)==null?void 0:we.children[this._pageIndex])||null}render({canvasContext:we,viewport:Oe,intent:Fe="display",annotationMode:Ve=_util.AnnotationMode.ENABLE,transform:qe=null,background:Ie=null,optionalContentConfigPromise:Xe=null,annotationCanvasMap:rt=null,pageColors:lt=null,printAnnotationStorage:Ge=null}){var be,ge;(be=this._stats)==null||be.time("Overall");const ut=this._transport.getRenderingIntent(Fe,Ve,Ge);st(this,re,!1),Ke(this,oe,qn).call(this),Xe||(Xe=this._transport.getOptionalContentConfig());let mt=this._intentStates.get(ut.cacheKey);mt||(mt=Object.create(null),this._intentStates.set(ut.cacheKey,mt)),mt.streamReaderCancelTimeout&&(clearTimeout(mt.streamReaderCancelTimeout),mt.streamReaderCancelTimeout=null);const wt=!!(ut.renderingIntent&_util.RenderingIntentFlag.PRINT);mt.displayReadyCapability||(mt.displayReadyCapability=new _util.PromiseCapability,mt.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(ge=this._stats)==null||ge.time("Page Request"),this._pumpOperatorList(ut));const Et=Ce=>{var xe,Le;mt.renderTasks.delete(De),(this._maybeCleanupAfterRender||wt)&&st(this,re,!0),Ke(this,ie,kn).call(this,!wt),Ce?(De.capability.reject(Ce),this._abortOperatorList({intentState:mt,reason:Ce instanceof Error?Ce:new Error(Ce)})):De.capability.resolve(),(xe=this._stats)==null||xe.timeEnd("Rendering"),(Le=this._stats)==null||Le.timeEnd("Overall")},De=new InternalRenderTask({callback:Et,params:{canvasContext:we,viewport:Oe,transform:qe,background:Ie},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:rt,operatorList:mt.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!wt,pdfBug:this._pdfBug,pageColors:lt});(mt.renderTasks||(mt.renderTasks=new Set)).add(De);const pe=De.task;return Promise.all([mt.displayReadyCapability.promise,Xe]).then(([Ce,xe])=>{var Le;if(this.destroyed){Et();return}(Le=this._stats)==null||Le.time("Rendering"),De.initializeGraphics({transparency:Ce,optionalContentConfig:xe}),De.operatorListChanged()}).catch(Et),pe}getOperatorList({intent:we="display",annotationMode:Oe=_util.AnnotationMode.ENABLE,printAnnotationStorage:Fe=null}={}){var rt;function Ve(){Ie.operatorList.lastChunk&&(Ie.opListReadCapability.resolve(Ie.operatorList),Ie.renderTasks.delete(Xe))}const qe=this._transport.getRenderingIntent(we,Oe,Fe,!0);let Ie=this._intentStates.get(qe.cacheKey);Ie||(Ie=Object.create(null),this._intentStates.set(qe.cacheKey,Ie));let Xe;return Ie.opListReadCapability||(Xe=Object.create(null),Xe.operatorListChanged=Ve,Ie.opListReadCapability=new _util.PromiseCapability,(Ie.renderTasks||(Ie.renderTasks=new Set)).add(Xe),Ie.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(rt=this._stats)==null||rt.time("Page Request"),this._pumpOperatorList(qe)),Ie.opListReadCapability.promise}streamTextContent({includeMarkedContent:we=!1,disableNormalization:Oe=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:we===!0,disableNormalization:Oe===!0},{highWaterMark:100,size(Ve){return Ve.items.length}})}getTextContent(we={}){if(this._transport._htmlForXfa)return this.getXfa().then(Fe=>_xfa_text.XfaText.textContent(Fe));const Oe=this.streamTextContent(we);return new Promise(function(Fe,Ve){function qe(){Ie.read().then(function({value:rt,done:lt}){if(lt){Fe(Xe);return}Object.assign(Xe.styles,rt.styles),Xe.items.push(...rt.items),qe()},Ve)}const Ie=Oe.getReader(),Xe={items:[],styles:Object.create(null)};qe()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const we=[];for(const Oe of this._intentStates.values())if(this._abortOperatorList({intentState:Oe,reason:new Error("Page was destroyed."),force:!0}),!Oe.opListReadCapability)for(const Fe of Oe.renderTasks)we.push(Fe.completed),Fe.cancel();return this.objs.clear(),st(this,re,!1),Ke(this,oe,qn).call(this),Promise.all(we)}cleanup(we=!1){st(this,re,!0);const Oe=Ke(this,ie,kn).call(this,!1);return we&&Oe&&this._stats&&(this._stats=new _display_utils.StatTimer),Oe}_startRenderPage(we,Oe){var Ve,qe;const Fe=this._intentStates.get(Oe);Fe&&((Ve=this._stats)==null||Ve.timeEnd("Page Request"),(qe=Fe.displayReadyCapability)==null||qe.resolve(we))}_renderPageChunk(we,Oe){for(let Fe=0,Ve=we.length;Fe<Ve;Fe++)Oe.operatorList.fnArray.push(we.fnArray[Fe]),Oe.operatorList.argsArray.push(we.argsArray[Fe]);Oe.operatorList.lastChunk=we.lastChunk,Oe.operatorList.separateAnnots=we.separateAnnots;for(const Fe of Oe.renderTasks)Fe.operatorListChanged();we.lastChunk&&Ke(this,ie,kn).call(this,!0)}_pumpOperatorList({renderingIntent:we,cacheKey:Oe,annotationStorageSerializable:Fe}){const{map:Ve,transfers:qe}=Fe,Xe=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:we,cacheKey:Oe,annotationStorage:Ve},qe).getReader(),rt=this._intentStates.get(Oe);rt.streamReader=Xe;const lt=()=>{Xe.read().then(({value:Ge,done:ut})=>{if(ut){rt.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(Ge,rt),lt())},Ge=>{if(rt.streamReader=null,!this._transport.destroyed){if(rt.operatorList){rt.operatorList.lastChunk=!0;for(const ut of rt.renderTasks)ut.operatorListChanged();Ke(this,ie,kn).call(this,!0)}if(rt.displayReadyCapability)rt.displayReadyCapability.reject(Ge);else if(rt.opListReadCapability)rt.opListReadCapability.reject(Ge);else throw Ge}})};lt()}_abortOperatorList({intentState:we,reason:Oe,force:Fe=!1}){if(we.streamReader){if(we.streamReaderCancelTimeout&&(clearTimeout(we.streamReaderCancelTimeout),we.streamReaderCancelTimeout=null),!Fe){if(we.renderTasks.size>0)return;if(Oe instanceof _display_utils.RenderingCancelledException){let Ve=RENDERING_CANCELLED_TIMEOUT;Oe.extraDelay>0&&Oe.extraDelay<1e3&&(Ve+=Oe.extraDelay),we.streamReaderCancelTimeout=setTimeout(()=>{we.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:we,reason:Oe,force:!0})},Ve);return}}if(we.streamReader.cancel(new _util.AbortException(Oe.message)).catch(()=>{}),we.streamReader=null,!this._transport.destroyed){for(const[Ve,qe]of this._intentStates)if(qe===we){this._intentStates.delete(Ve);break}this.cleanup()}}}get stats(){return this._stats}}ne=new WeakMap,re=new WeakMap,ie=new WeakSet,kn=function(we=!1){if(Ke(this,oe,qn).call(this),!ce(this,re)||this.destroyed)return!1;if(we)return st(this,ne,setTimeout(()=>{st(this,ne,null),Ke(this,ie,kn).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:Oe,operatorList:Fe}of this._intentStates.values())if(Oe.size>0||!Fe.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),st(this,re,!1),!0},oe=new WeakSet,qn=function(){ce(this,ne)&&(clearTimeout(ce(this,ne)),st(this,ne,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){We(this,ue,new Set);We(this,de,Promise.resolve())}postMessage(we,Oe){const Fe={data:structuredClone(we,Oe?{transfer:Oe}:null)};ce(this,de).then(()=>{for(const Ve of ce(this,ue))Ve.call(this,Fe)})}addEventListener(we,Oe){ce(this,ue).add(Oe)}removeEventListener(we,Oe){ce(this,ue).delete(Oe)}terminate(){ce(this,ue).clear()}}ue=new WeakMap,de=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const Me=(ae=document==null?void 0:document.currentScript)==null?void 0:ae.src;Me&&(PDFWorkerUtil.fallbackWorkerSrc=Me.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(Me,we){let Oe;try{if(Oe=new URL(Me),!Oe.origin||Oe.origin==="null")return!1}catch{return!1}const Fe=new URL(we,Oe);return Oe.origin===Fe.origin},PDFWorkerUtil.createCDNWrapper=function(Me){const we='importScripts("'.concat(Me,'");');return URL.createObjectURL(new Blob([we]))}}const _PDFWorker=class _PDFWorker{constructor({name:Me=null,port:we=null,verbosity:Oe=(0,_util.getVerbosityLevel)()}={}){var Fe;if(this.name=Me,this.destroyed=!1,this.verbosity=Oe,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,we){if((Fe=ce(_PDFWorker,le))!=null&&Fe.has(we))throw new Error("Cannot use more than one PDFWorker per port.");(ce(_PDFWorker,le)||st(_PDFWorker,le,new WeakMap)).set(we,this),this._initializeFromPort(we);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(Me){this._port=Me,this._messageHandler=new _message_handler.MessageHandler("main","worker",Me),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:Me}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,Me)||(Me=PDFWorkerUtil.createCDNWrapper(new URL(Me,window.location).href));const we=new Worker(Me),Oe=new _message_handler.MessageHandler("main","worker",we),Fe=()=>{we.removeEventListener("error",Ve),Oe.destroy(),we.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},Ve=()=>{this._webWorker||Fe()};we.addEventListener("error",Ve),Oe.on("test",Ie=>{if(we.removeEventListener("error",Ve),this.destroyed){Fe();return}Ie?(this._messageHandler=Oe,this._port=we,this._webWorker=we,this._readyCapability.resolve(),Oe.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),Oe.destroy(),we.terminate())}),Oe.on("ready",Ie=>{if(we.removeEventListener("error",Ve),this.destroyed){Fe();return}try{qe()}catch{this._setupFakeWorker()}});const qe=()=>{const Ie=new Uint8Array;Oe.send("test",Ie,[Ie.buffer])};qe();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(Me=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const we=new LoopbackPort;this._port=we;const Oe="fake".concat(PDFWorkerUtil.fakeWorkerId++),Fe=new _message_handler.MessageHandler(Oe+"_worker",Oe,we);Me.setup(Fe,we);const Ve=new _message_handler.MessageHandler(Oe,Oe+"_worker",we);this._messageHandler=Ve,this._readyCapability.resolve(),Ve.send("configure",{verbosity:this.verbosity})}).catch(Me=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(Me.message,'".')))})}destroy(){var Me;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(Me=ce(_PDFWorker,le))==null||Me.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(Me){var Oe;if(!(Me!=null&&Me.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const we=(Oe=ce(this,le))==null?void 0:Oe.get(Me.port);if(we){if(we._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return we}return new _PDFWorker(Me)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var Me;try{return((Me=globalThis.pdfjsWorker)==null?void 0:Me.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};le=new WeakMap,We(_PDFWorker,le,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(we,Oe,Fe,Ve,qe){We(this,Se);We(this,Ae,new Map);We(this,_e,new Map);We(this,me,new Map);We(this,ve,null);this.messageHandler=we,this.loadingTask=Oe,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:Ve.ownerDocument,styleElement:Ve.styleElement}),this._params=Ve,this.canvasFactory=qe.canvasFactory,this.filterFactory=qe.filterFactory,this.cMapReaderFactory=qe.cMapReaderFactory,this.standardFontDataFactory=qe.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=Fe,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(we,Oe=_util.AnnotationMode.ENABLE,Fe=null,Ve=!1){let qe=_util.RenderingIntentFlag.DISPLAY,Ie=_annotation_storage.SerializableEmpty;switch(we){case"any":qe=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":qe=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: ".concat(we))}switch(Oe){case _util.AnnotationMode.DISABLE:qe+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:qe+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:qe+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,Ie=(qe&_util.RenderingIntentFlag.PRINT&&Fe instanceof _annotation_storage.PrintAnnotationStorage?Fe:this.annotationStorage).serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: ".concat(Oe))}return Ve&&(qe+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:qe,cacheKey:"".concat(qe,"_").concat(Ie.hash),annotationStorageSerializable:Ie}}destroy(){var Fe;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(Fe=ce(this,ve))==null||Fe.reject(new Error("Worker was destroyed during onPassword callback"));const we=[];for(const Ve of ce(this,_e).values())we.push(Ve._destroy());ce(this,_e).clear(),ce(this,me).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Oe=this.messageHandler.sendWithPromise("Terminate",null);return we.push(Oe),Promise.all(we).then(()=>{var Ve;this.commonObjs.clear(),this.fontLoader.clear(),ce(this,Ae).clear(),this.filterFactory.destroy(),(Ve=this._networkStream)==null||Ve.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:we,loadingTask:Oe}=this;we.on("GetReader",(Fe,Ve)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=qe=>{this._lastProgress={loaded:qe.loaded,total:qe.total}},Ve.onPull=()=>{this._fullReader.read().then(function({value:qe,done:Ie}){if(Ie){Ve.close();return}(0,_util.assert)(qe instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),Ve.enqueue(new Uint8Array(qe),1,[qe])}).catch(qe=>{Ve.error(qe)})},Ve.onCancel=qe=>{this._fullReader.cancel(qe),Ve.ready.catch(Ie=>{if(!this.destroyed)throw Ie})}}),we.on("ReaderHeadersReady",Fe=>{const Ve=new _util.PromiseCapability,qe=this._fullReader;return qe.headersReady.then(()=>{var Ie;(!qe.isStreamingSupported||!qe.isRangeSupported)&&(this._lastProgress&&((Ie=Oe.onProgress)==null||Ie.call(Oe,this._lastProgress)),qe.onProgress=Xe=>{var rt;(rt=Oe.onProgress)==null||rt.call(Oe,{loaded:Xe.loaded,total:Xe.total})}),Ve.resolve({isStreamingSupported:qe.isStreamingSupported,isRangeSupported:qe.isRangeSupported,contentLength:qe.contentLength})},Ve.reject),Ve.promise}),we.on("GetRangeReader",(Fe,Ve)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const qe=this._networkStream.getRangeReader(Fe.begin,Fe.end);if(!qe){Ve.close();return}Ve.onPull=()=>{qe.read().then(function({value:Ie,done:Xe}){if(Xe){Ve.close();return}(0,_util.assert)(Ie instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),Ve.enqueue(new Uint8Array(Ie),1,[Ie])}).catch(Ie=>{Ve.error(Ie)})},Ve.onCancel=Ie=>{qe.cancel(Ie),Ve.ready.catch(Xe=>{if(!this.destroyed)throw Xe})}}),we.on("GetDoc",({pdfInfo:Fe})=>{this._numPages=Fe.numPages,this._htmlForXfa=Fe.htmlForXfa,delete Fe.htmlForXfa,Oe._capability.resolve(new PDFDocumentProxy(Fe,this))}),we.on("DocException",function(Fe){let Ve;switch(Fe.name){case"PasswordException":Ve=new _util.PasswordException(Fe.message,Fe.code);break;case"InvalidPDFException":Ve=new _util.InvalidPDFException(Fe.message);break;case"MissingPDFException":Ve=new _util.MissingPDFException(Fe.message);break;case"UnexpectedResponseException":Ve=new _util.UnexpectedResponseException(Fe.message,Fe.status);break;case"UnknownErrorException":Ve=new _util.UnknownErrorException(Fe.message,Fe.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Oe._capability.reject(Ve)}),we.on("PasswordRequest",Fe=>{if(st(this,ve,new _util.PromiseCapability),Oe.onPassword){const Ve=qe=>{qe instanceof Error?ce(this,ve).reject(qe):ce(this,ve).resolve({password:qe})};try{Oe.onPassword(Ve,Fe.code)}catch(qe){ce(this,ve).reject(qe)}}else ce(this,ve).reject(new _util.PasswordException(Fe.message,Fe.code));return ce(this,ve).promise}),we.on("DataLoaded",Fe=>{var Ve;(Ve=Oe.onProgress)==null||Ve.call(Oe,{loaded:Fe.length,total:Fe.length}),this.downloadInfoCapability.resolve(Fe)}),we.on("StartRenderPage",Fe=>{if(this.destroyed)return;ce(this,_e).get(Fe.pageIndex)._startRenderPage(Fe.transparency,Fe.cacheKey)}),we.on("commonobj",([Fe,Ve,qe])=>{var Ie;if(!this.destroyed&&!this.commonObjs.has(Fe))switch(Ve){case"Font":const Xe=this._params;if("error"in qe){const Ge=qe.error;(0,_util.warn)("Error during font loading: ".concat(Ge)),this.commonObjs.resolve(Fe,Ge);break}const rt=Xe.pdfBug&&((Ie=globalThis.FontInspector)!=null&&Ie.enabled)?(Ge,ut)=>globalThis.FontInspector.fontAdded(Ge,ut):null,lt=new _font_loader.FontFaceObject(qe,{isEvalSupported:Xe.isEvalSupported,disableFontFace:Xe.disableFontFace,ignoreErrors:Xe.ignoreErrors,inspectFont:rt});this.fontLoader.bind(lt).catch(Ge=>we.sendWithPromise("FontFallback",{id:Fe})).finally(()=>{!Xe.fontExtraProperties&&lt.data&&(lt.data=null),this.commonObjs.resolve(Fe,lt)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(Fe,qe);break;default:throw new Error("Got unknown common object type ".concat(Ve))}}),we.on("obj",([Fe,Ve,qe,Ie])=>{var rt;if(this.destroyed)return;const Xe=ce(this,_e).get(Ve);if(!Xe.objs.has(Fe))switch(qe){case"Image":if(Xe.objs.resolve(Fe,Ie),Ie){let lt;if(Ie.bitmap){const{width:Ge,height:ut}=Ie;lt=Ge*ut*4}else lt=((rt=Ie.data)==null?void 0:rt.length)||0;lt>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Xe._maybeCleanupAfterRender=!0)}break;case"Pattern":Xe.objs.resolve(Fe,Ie);break;default:throw new Error("Got unknown object type ".concat(qe))}}),we.on("DocProgress",Fe=>{var Ve;this.destroyed||(Ve=Oe.onProgress)==null||Ve.call(Oe,{loaded:Fe.loaded,total:Fe.total})}),we.on("FetchBuiltInCMap",Fe=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(Fe):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),we.on("FetchStandardFontData",Fe=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(Fe):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var Fe,Ve;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:we,transfers:Oe}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:we,filename:(Ve=(Fe=this._fullReader)==null?void 0:Fe.filename)!=null?Ve:null},Oe).finally(()=>{this.annotationStorage.resetModified()})}getPage(we){if(!Number.isInteger(we)||we<=0||we>this._numPages)return Promise.reject(new Error("Invalid page request."));const Oe=we-1,Fe=ce(this,me).get(Oe);if(Fe)return Fe;const Ve=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Oe}).then(qe=>{if(this.destroyed)throw new Error("Transport destroyed");const Ie=new PDFPageProxy(Oe,qe,this,this._params.pdfBug);return ce(this,_e).set(Oe,Ie),Ie});return ce(this,me).set(Oe,Ve),Ve}getPageIndex(we){return typeof we!="object"||we===null||!Number.isInteger(we.num)||we.num<0||!Number.isInteger(we.gen)||we.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:we.num,gen:we.gen})}getAnnotations(we,Oe){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:we,intent:Oe})}getFieldObjects(){return Ke(this,Se,zn).call(this,"GetFieldObjects")}hasJSActions(){return Ke(this,Se,zn).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(we){return typeof we!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:we})}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 Ke(this,Se,zn).call(this,"GetDocJSActions")}getPageJSActions(we){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:we})}getStructTree(we){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:we})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(we=>new _optional_content_config.OptionalContentConfig(we))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const we="GetMetadata",Oe=ce(this,Ae).get(we);if(Oe)return Oe;const Fe=this.messageHandler.sendWithPromise(we,null).then(Ve=>{var qe,Ie,Xe,rt;return{info:Ve[0],metadata:Ve[1]?new _metadata.Metadata(Ve[1]):null,contentDispositionFilename:(Ie=(qe=this._fullReader)==null?void 0:qe.filename)!=null?Ie:null,contentLength:(rt=(Xe=this._fullReader)==null?void 0:Xe.contentLength)!=null?rt:null}});return ce(this,Ae).set(we,Fe),Fe}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(we=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const Oe of ce(this,_e).values())if(!Oe.cleanup())throw new Error("startCleanup: Page ".concat(Oe.pageNumber," is currently rendering."));this.commonObjs.clear(),we||this.fontLoader.clear(),ce(this,Ae).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:we,enableXfa:Oe}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:we,enableXfa:Oe})}}Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakSet,zn=function(we,Oe=null){const Fe=ce(this,Ae).get(we);if(Fe)return Fe;const Ve=this.messageHandler.sendWithPromise(we,Oe);return ce(this,Ae).set(we,Ve),Ve};class PDFObjects{constructor(){We(this,Re);We(this,Pe,Object.create(null))}get(we,Oe=null){if(Oe){const Ve=Ke(this,Re,ar).call(this,we);return Ve.capability.promise.then(()=>Oe(Ve.data)),null}const Fe=ce(this,Pe)[we];if(!(Fe!=null&&Fe.capability.settled))throw new Error("Requesting object that isn't resolved yet ".concat(we,"."));return Fe.data}has(we){const Oe=ce(this,Pe)[we];return(Oe==null?void 0:Oe.capability.settled)||!1}resolve(we,Oe=null){const Fe=Ke(this,Re,ar).call(this,we);Fe.data=Oe,Fe.capability.resolve()}clear(){var we;for(const Oe in ce(this,Pe)){const{data:Fe}=ce(this,Pe)[Oe];(we=Fe==null?void 0:Fe.bitmap)==null||we.close()}st(this,Pe,Object.create(null))}}Pe=new WeakMap,Re=new WeakSet,ar=function(we){var Oe;return(Oe=ce(this,Pe))[we]||(Oe[we]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(we){We(this,ye,null);st(this,ye,we),this.onContinue=null}get promise(){return ce(this,ye).capability.promise}cancel(we=0){ce(this,ye).cancel(null,we)}get separateAnnots(){const{separateAnnots:we}=ce(this,ye).operatorList;if(!we)return!1;const{annotationCanvasMap:Oe}=ce(this,ye);return we.form||we.canvas&&(Oe==null?void 0:Oe.size)>0}}ye=new WeakMap,exports.RenderTask=RenderTask;const Ne=class Ne{constructor({callback:we,params:Oe,objs:Fe,commonObjs:Ve,annotationCanvasMap:qe,operatorList:Ie,pageIndex:Xe,canvasFactory:rt,filterFactory:lt,useRequestAnimationFrame:Ge=!1,pdfBug:ut=!1,pageColors:mt=null}){this.callback=we,this.params=Oe,this.objs=Fe,this.commonObjs=Ve,this.annotationCanvasMap=qe,this.operatorListIdx=null,this.operatorList=Ie,this._pageIndex=Xe,this.canvasFactory=rt,this.filterFactory=lt,this._pdfBug=ut,this.pageColors=mt,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=Ge===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(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=Oe.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:we=!1,optionalContentConfig:Oe}){var Xe,rt;if(this.cancelled)return;if(this._canvas){if(ce(Ne,Ee).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.");ce(Ne,Ee).add(this._canvas)}this._pdfBug&&((Xe=globalThis.StepperManager)!=null&&Xe.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:Fe,viewport:Ve,transform:qe,background:Ie}=this.params;this.gfx=new _canvas.CanvasGraphics(Fe,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:Oe},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:qe,viewport:Ve,transparency:we,background:Ie}),this.operatorListIdx=0,this.graphicsReady=!0,(rt=this.graphicsReadyCallback)==null||rt.call(this)}cancel(we=null,Oe=0){var Fe;this.running=!1,this.cancelled=!0,(Fe=this.gfx)==null||Fe.endDrawing(),ce(Ne,Ee).delete(this._canvas),this.callback(we||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),Oe))}operatorListChanged(){var we;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(we=this.stepper)==null||we.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{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(),ce(Ne,Ee).delete(this._canvas),this.callback())))}};Ee=new WeakMap,We(Ne,Ee,new WeakSet);let InternalRenderTask=Ne;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(ee,te,ne)=>{var de,ae,le,Hr,_e;Object.defineProperty(te,"__esModule",{value:!0}),te.SerializableEmpty=te.PrintAnnotationStorage=te.AnnotationStorage=void 0;var re=ne(1),ie=ne(4),se=ne(8);const oe=Object.freeze({map:null,hash:"",transfers:void 0});te.SerializableEmpty=oe;class he{constructor(){We(this,le);We(this,de,!1);We(this,ae,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(ve,Se){const Te=ce(this,ae).get(ve);return Te===void 0?Se:Object.assign(Se,Te)}getRawValue(ve){return ce(this,ae).get(ve)}remove(ve){if(ce(this,ae).delete(ve),ce(this,ae).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const Se of ce(this,ae).values())if(Se instanceof ie.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(ve,Se){const Te=ce(this,ae).get(ve);let Pe=!1;if(Te!==void 0)for(const[Re,$e]of Object.entries(Se))Te[Re]!==$e&&(Pe=!0,Te[Re]=$e);else Pe=!0,ce(this,ae).set(ve,Se);Pe&&Ke(this,le,Hr).call(this),Se instanceof ie.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(Se.constructor._type)}has(ve){return ce(this,ae).has(ve)}getAll(){return ce(this,ae).size>0?(0,re.objectFromMap)(ce(this,ae)):null}setAll(ve){for(const[Se,Te]of Object.entries(ve))this.setValue(Se,Te)}get size(){return ce(this,ae).size}resetModified(){ce(this,de)&&(st(this,de,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new ue(this)}get serializable(){if(ce(this,ae).size===0)return oe;const ve=new Map,Se=new se.MurmurHash3_64,Te=[],Pe=Object.create(null);let Re=!1;for(const[$e,ye]of ce(this,ae)){const Ee=ye instanceof ie.AnnotationEditor?ye.serialize(!1,Pe):ye;Ee&&(ve.set($e,Ee),Se.update("".concat($e,":").concat(JSON.stringify(Ee))),Re||(Re=!!Ee.bitmap))}if(Re)for(const $e of ve.values())$e.bitmap&&Te.push($e.bitmap);return ve.size>0?{map:ve,hash:Se.hexdigest(),transfers:Te}:oe}}de=new WeakMap,ae=new WeakMap,le=new WeakSet,Hr=function(){ce(this,de)||(st(this,de,!0),typeof this.onSetModified=="function"&&this.onSetModified())},te.AnnotationStorage=he;class ue extends he{constructor(Se){super();We(this,_e,void 0);const{map:Te,hash:Pe,transfers:Re}=Se.serializable,$e=structuredClone(Te,Re?{transfer:Re}:null);st(this,_e,{map:$e,hash:Pe,transfers:Re})}get print(){(0,re.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return ce(this,_e)}}_e=new WeakMap,te.PrintAnnotationStorage=ue},(ee,te,ne)=>{var ue,de,ae,le,Ae,_e,me,ve,Se,Te,Pe,Re,$e,ye,Ee,lr,Me,cr,Oe,ur,Ve,dr,Ie,Wr,rt,Vr,Ge,Gr,mt,hr,Et,qr;Object.defineProperty(te,"__esModule",{value:!0}),te.AnnotationEditor=void 0;var re=ne(5),ie=ne(1),se=ne(6);const pe=class pe{constructor(ge){We(this,Ee);We(this,Me);We(this,Ve);We(this,Ie);We(this,rt);We(this,Ge);We(this,mt);We(this,Et);We(this,ue,"");We(this,de,!1);We(this,ae,null);We(this,le,null);We(this,Ae,null);We(this,_e,!1);We(this,me,null);We(this,ve,this.focusin.bind(this));We(this,Se,this.focusout.bind(this));We(this,Te,!1);We(this,Pe,!1);We(this,Re,!1);An(this,"_initialOptions",Object.create(null));An(this,"_uiManager",null);An(this,"_focusEventsAllowed",!0);An(this,"_l10nPromise",null);We(this,$e,!1);We(this,ye,pe._zIndex++);this.constructor===pe&&(0,ie.unreachable)("Cannot initialize AnnotationEditor."),this.parent=ge.parent,this.id=ge.id,this.width=this.height=null,this.pageIndex=ge.parent.pageIndex,this.name=ge.name,this.div=null,this._uiManager=ge.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=ge.isCentered,this._structTreeParentId=null;const{rotation:Ce,rawDims:{pageWidth:xe,pageHeight:Le,pageX:Be,pageY:He}}=this.parent.viewport;this.rotation=Ce,this.pageRotation=(360+Ce-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[xe,Le],this.pageTranslation=[Be,He];const[it,et]=this.parentDimensions;this.x=ge.x/it,this.y=ge.y/et,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,ie.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(ge){const Ce=new he({id:ge.parent.getNextId(),parent:ge.parent,uiManager:ge._uiManager});Ce.annotationElementId=ge.annotationElementId,Ce.deleted=!0,Ce._uiManager.addToAnnotationStorage(Ce)}static initialize(ge,Ce=null){if(pe._l10nPromise||(pe._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(Le=>[Le,ge.get(Le)]))),Ce!=null&&Ce.strings)for(const Le of Ce.strings)pe._l10nPromise.set(Le,ge.get(Le));if(pe._borderLineWidth!==-1)return;const xe=getComputedStyle(document.documentElement);pe._borderLineWidth=parseFloat(xe.getPropertyValue("--outline-width"))||0}static updateDefaultParams(ge,Ce){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(ge){return!1}static paste(ge,Ce){(0,ie.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return ce(this,$e)}set _isDraggable(ge){var Ce;st(this,$e,ge),(Ce=this.div)==null||Ce.classList.toggle("draggable",ge)}center(){const[ge,Ce]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*Ce/(ge*2),this.y+=this.width*ge/(Ce*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*Ce/(ge*2),this.y-=this.width*ge/(Ce*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(ge){this._uiManager.addCommands(ge)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=ce(this,ye)}setParent(ge){ge!==null&&(this.pageIndex=ge.pageIndex,this.pageDimensions=ge.pageDimensions),this.parent=ge}focusin(ge){this._focusEventsAllowed&&(ce(this,Te)?st(this,Te,!1):this.parent.setSelected(this))}focusout(ge){var xe;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const Ce=ge.relatedTarget;Ce!=null&&Ce.closest("#".concat(this.id))||(ge.preventDefault(),(xe=this.parent)!=null&&xe.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(ge,Ce,xe,Le){const[Be,He]=this.parentDimensions;[xe,Le]=this.screenToPageTranslation(xe,Le),this.x=(ge+xe)/Be,this.y=(Ce+Le)/He,this.fixAndSetPosition()}translate(ge,Ce){Ke(this,Ee,lr).call(this,this.parentDimensions,ge,Ce)}translateInPage(ge,Ce){Ke(this,Ee,lr).call(this,this.pageDimensions,ge,Ce),this.div.scrollIntoView({block:"nearest"})}drag(ge,Ce){const[xe,Le]=this.parentDimensions;if(this.x+=ge/xe,this.y+=Ce/Le,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:ot,y:ht}=this.div.getBoundingClientRect();this.parent.findNewParent(this,ot,ht)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:Be,y:He}=this;const[it,et]=Ke(this,Me,cr).call(this);Be+=it,He+=et,this.div.style.left="".concat((100*Be).toFixed(2),"%"),this.div.style.top="".concat((100*He).toFixed(2),"%"),this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[ge,Ce]=this.pageDimensions;let{x:xe,y:Le,width:Be,height:He}=this;switch(Be*=ge,He*=Ce,xe*=ge,Le*=Ce,this.rotation){case 0:xe=Math.max(0,Math.min(ge-Be,xe)),Le=Math.max(0,Math.min(Ce-He,Le));break;case 90:xe=Math.max(0,Math.min(ge-He,xe)),Le=Math.min(Ce,Math.max(Be,Le));break;case 180:xe=Math.min(ge,Math.max(Be,xe)),Le=Math.min(Ce,Math.max(He,Le));break;case 270:xe=Math.min(ge,Math.max(He,xe)),Le=Math.max(0,Math.min(Ce-Be,Le));break}this.x=xe/=ge,this.y=Le/=Ce;const[it,et]=Ke(this,Me,cr).call(this);xe+=it,Le+=et;const{style:ot}=this.div;ot.left="".concat((100*xe).toFixed(2),"%"),ot.top="".concat((100*Le).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(ge,Ce){var xe;return Ke(xe=pe,Oe,ur).call(xe,ge,Ce,this.parentRotation)}pageTranslationToScreen(ge,Ce){var xe;return Ke(xe=pe,Oe,ur).call(xe,ge,Ce,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:ge,pageDimensions:[Ce,xe]}=this,Le=Ce*ge,Be=xe*ge;return ie.FeatureTest.isCSSRoundSupported?[Math.round(Le),Math.round(Be)]:[Le,Be]}setDims(ge,Ce){var Be;const[xe,Le]=this.parentDimensions;this.div.style.width="".concat((100*ge/xe).toFixed(2),"%"),ce(this,_e)||(this.div.style.height="".concat((100*Ce/Le).toFixed(2),"%")),(Be=ce(this,ae))==null||Be.classList.toggle("small",ge<pe.SMALL_EDITOR_SIZE||Ce<pe.SMALL_EDITOR_SIZE)}fixDims(){const{style:ge}=this.div,{height:Ce,width:xe}=ge,Le=xe.endsWith("%"),Be=!ce(this,_e)&&Ce.endsWith("%");if(Le&&Be)return;const[He,it]=this.parentDimensions;Le||(ge.width="".concat((100*parseFloat(xe)/He).toFixed(2),"%")),!ce(this,_e)&&!Be&&(ge.height="".concat((100*parseFloat(Ce)/it).toFixed(2),"%"))}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(ce(this,ae))return;const ge=st(this,ae,document.createElement("button"));ge.className="altText";const Ce=await pe._l10nPromise.get("editor_alt_text_button_label");ge.textContent=Ce,ge.setAttribute("aria-label",Ce),ge.tabIndex="0",ge.addEventListener("contextmenu",se.noContextMenu),ge.addEventListener("pointerdown",xe=>xe.stopPropagation()),ge.addEventListener("click",xe=>{xe.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),ge.addEventListener("keydown",xe=>{xe.target===ge&&xe.key==="Enter"&&(xe.preventDefault(),this._uiManager.editAltText(this))}),Ke(this,mt,hr).call(this),this.div.append(ge),pe.SMALL_EDITOR_SIZE||(pe.SMALL_EDITOR_SIZE=Math.min(128,Math.round(ge.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:ce(this,ue),decorative:ce(this,de)}}set altTextData({altText:ge,decorative:Ce}){ce(this,ue)===ge&&ce(this,de)===Ce||(st(this,ue,ge),st(this,de,Ce),Ke(this,mt,hr).call(this))}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.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",ce(this,ve)),this.div.addEventListener("focusout",ce(this,Se));const[ge,Ce]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth="".concat((100*Ce/ge).toFixed(2),"%"),this.div.style.maxHeight="".concat((100*ge/Ce).toFixed(2),"%"));const[xe,Le]=this.getInitialTranslation();return this.translate(xe,Le),(0,re.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(ge){const{isMac:Ce}=ie.FeatureTest.platform;if(ge.button!==0||ge.ctrlKey&&Ce){ge.preventDefault();return}st(this,Te,!0),Ke(this,Et,qr).call(this,ge)}moveInDOM(){var ge;(ge=this.parent)==null||ge.moveEditorInDOM(this)}_setParentAndPosition(ge,Ce,xe){ge.changeParent(this),this.x=Ce,this.y=xe,this.fixAndSetPosition()}getRect(ge,Ce){const xe=this.parentScale,[Le,Be]=this.pageDimensions,[He,it]=this.pageTranslation,et=ge/xe,ot=Ce/xe,ht=this.x*Le,pt=this.y*Be,ct=this.width*Le,Pt=this.height*Be;switch(this.rotation){case 0:return[ht+et+He,Be-pt-ot-Pt+it,ht+et+ct+He,Be-pt-ot+it];case 90:return[ht+ot+He,Be-pt+et+it,ht+ot+Pt+He,Be-pt+et+ct+it];case 180:return[ht-et-ct+He,Be-pt+ot+it,ht-et+He,Be-pt+ot+Pt+it];case 270:return[ht-ot-Pt+He,Be-pt-et-ct+it,ht-ot+He,Be-pt-et+it];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(ge,Ce){const[xe,Le,Be,He]=ge,it=Be-xe,et=He-Le;switch(this.rotation){case 0:return[xe,Ce-He,it,et];case 90:return[xe,Ce-Le,et,it];case 180:return[Be,Ce-Le,it,et];case 270:return[Be,Ce-He,et,it];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){st(this,Re,!0)}disableEditMode(){st(this,Re,!1)}isInEditMode(){return ce(this,Re)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var ge,Ce;(ge=this.div)==null||ge.addEventListener("focusin",ce(this,ve)),(Ce=this.div)==null||Ce.addEventListener("focusout",ce(this,Se))}serialize(ge=!1,Ce=null){(0,ie.unreachable)("An editor must be serializable")}static deserialize(ge,Ce,xe){const Le=new this.prototype.constructor({parent:Ce,id:Ce.getNextId(),uiManager:xe});Le.rotation=ge.rotation;const[Be,He]=Le.pageDimensions,[it,et,ot,ht]=Le.getRectInCurrentCoords(ge.rect,He);return Le.x=it/Be,Le.y=et/He,Le.width=ot/Be,Le.height=ht/He,Le}remove(){var ge;this.div.removeEventListener("focusin",ce(this,ve)),this.div.removeEventListener("focusout",ce(this,Se)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(ge=ce(this,ae))==null||ge.remove(),st(this,ae,null),st(this,le,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(Ke(this,Ie,Wr).call(this),ce(this,me).classList.remove("hidden"))}select(){var ge;this.makeResizable(),(ge=this.div)==null||ge.classList.add("selectedEditor")}unselect(){var ge,Ce,xe;(ge=ce(this,me))==null||ge.classList.add("hidden"),(Ce=this.div)==null||Ce.classList.remove("selectedEditor"),(xe=this.div)!=null&&xe.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(ge,Ce){}disableEditing(){ce(this,ae)&&(ce(this,ae).hidden=!0)}enableEditing(){ce(this,ae)&&(ce(this,ae).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return ce(this,Pe)}set isEditing(ge){st(this,Pe,ge),this.parent&&(ge?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(ge,Ce){st(this,_e,!0);const xe=ge/Ce,{style:Le}=this.div;Le.aspectRatio=xe,Le.height="auto"}static get MIN_SIZE(){return 16}};ue=new WeakMap,de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakMap,Pe=new WeakMap,Re=new WeakMap,$e=new WeakMap,ye=new WeakMap,Ee=new WeakSet,lr=function([ge,Ce],xe,Le){[xe,Le]=this.screenToPageTranslation(xe,Le),this.x+=xe/ge,this.y+=Le/Ce,this.fixAndSetPosition()},Me=new WeakSet,cr=function(){const[ge,Ce]=this.parentDimensions,{_borderLineWidth:xe}=pe,Le=xe/ge,Be=xe/Ce;switch(this.rotation){case 90:return[-Le,Be];case 180:return[Le,Be];case 270:return[Le,-Be];default:return[-Le,-Be]}},Oe=new WeakSet,ur=function(ge,Ce,xe){switch(xe){case 90:return[Ce,-ge];case 180:return[-ge,-Ce];case 270:return[-Ce,ge];default:return[ge,Ce]}},Ve=new WeakSet,dr=function(ge){switch(ge){case 90:{const[Ce,xe]=this.pageDimensions;return[0,-Ce/xe,xe/Ce,0]}case 180:return[-1,0,0,-1];case 270:{const[Ce,xe]=this.pageDimensions;return[0,Ce/xe,-xe/Ce,0]}default:return[1,0,0,1]}},Ie=new WeakSet,Wr=function(){if(ce(this,me))return;st(this,me,document.createElement("div")),ce(this,me).classList.add("resizers");const ge=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||ge.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const Ce of ge){const xe=document.createElement("div");ce(this,me).append(xe),xe.classList.add("resizer",Ce),xe.addEventListener("pointerdown",Ke(this,rt,Vr).bind(this,Ce)),xe.addEventListener("contextmenu",se.noContextMenu)}this.div.prepend(ce(this,me))},rt=new WeakSet,Vr=function(ge,Ce){Ce.preventDefault();const{isMac:xe}=ie.FeatureTest.platform;if(Ce.button!==0||Ce.ctrlKey&&xe)return;const Le=Ke(this,Ge,Gr).bind(this,ge),Be=this._isDraggable;this._isDraggable=!1;const He={passive:!0,capture:!0};window.addEventListener("pointermove",Le,He);const it=this.x,et=this.y,ot=this.width,ht=this.height,pt=this.parent.div.style.cursor,ct=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(Ce.target).cursor;const Pt=()=>{this._isDraggable=Be,window.removeEventListener("pointerup",Pt),window.removeEventListener("blur",Pt),window.removeEventListener("pointermove",Le,He),this.parent.div.style.cursor=pt,this.div.style.cursor=ct;const It=this.x,vt=this.y,kt=this.width,gt=this.height;It===it&&vt===et&&kt===ot&&gt===ht||this.addCommands({cmd:()=>{this.width=kt,this.height=gt,this.x=It,this.y=vt;const[tt,nt]=this.parentDimensions;this.setDims(tt*kt,nt*gt),this.fixAndSetPosition()},undo:()=>{this.width=ot,this.height=ht,this.x=it,this.y=et;const[tt,nt]=this.parentDimensions;this.setDims(tt*ot,nt*ht),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",Pt),window.addEventListener("blur",Pt)},Ge=new WeakSet,Gr=function(ge,Ce){const[xe,Le]=this.parentDimensions,Be=this.x,He=this.y,it=this.width,et=this.height,ot=pe.MIN_SIZE/xe,ht=pe.MIN_SIZE/Le,pt=yt=>Math.round(yt*1e4)/1e4,ct=Ke(this,Ve,dr).call(this,this.rotation),Pt=(yt,St)=>[ct[0]*yt+ct[2]*St,ct[1]*yt+ct[3]*St],It=Ke(this,Ve,dr).call(this,360-this.rotation),vt=(yt,St)=>[It[0]*yt+It[2]*St,It[1]*yt+It[3]*St];let kt,gt,tt=!1,nt=!1;switch(ge){case"topLeft":tt=!0,kt=(yt,St)=>[0,0],gt=(yt,St)=>[yt,St];break;case"topMiddle":kt=(yt,St)=>[yt/2,0],gt=(yt,St)=>[yt/2,St];break;case"topRight":tt=!0,kt=(yt,St)=>[yt,0],gt=(yt,St)=>[0,St];break;case"middleRight":nt=!0,kt=(yt,St)=>[yt,St/2],gt=(yt,St)=>[0,St/2];break;case"bottomRight":tt=!0,kt=(yt,St)=>[yt,St],gt=(yt,St)=>[0,0];break;case"bottomMiddle":kt=(yt,St)=>[yt/2,St],gt=(yt,St)=>[yt/2,0];break;case"bottomLeft":tt=!0,kt=(yt,St)=>[0,St],gt=(yt,St)=>[yt,0];break;case"middleLeft":nt=!0,kt=(yt,St)=>[0,St/2],gt=(yt,St)=>[yt,St/2];break}const ft=kt(it,et),Tt=gt(it,et);let Ct=Pt(...Tt);const Ht=pt(Be+Ct[0]),Wt=pt(He+Ct[1]);let Ut=1,zt=1,[Vt,jt]=this.screenToPageTranslation(Ce.movementX,Ce.movementY);if([Vt,jt]=vt(Vt/xe,jt/Le),tt){const yt=Math.hypot(it,et);Ut=zt=Math.max(Math.min(Math.hypot(Tt[0]-ft[0]-Vt,Tt[1]-ft[1]-jt)/yt,1/it,1/et),ot/it,ht/et)}else nt?Ut=Math.max(ot,Math.min(1,Math.abs(Tt[0]-ft[0]-Vt)))/it:zt=Math.max(ht,Math.min(1,Math.abs(Tt[1]-ft[1]-jt)))/et;const Gt=pt(it*Ut),dt=pt(et*zt);Ct=Pt(...gt(Gt,dt));const Qe=Ht-Ct[0],Ye=Wt-Ct[1];this.width=Gt,this.height=dt,this.x=Qe,this.y=Ye,this.setDims(xe*Gt,Le*dt),this.fixAndSetPosition()},mt=new WeakSet,hr=async function(){var xe;const ge=ce(this,ae);if(!ge)return;if(!ce(this,ue)&&!ce(this,de)){ge.classList.remove("done"),(xe=ce(this,le))==null||xe.remove();return}pe._l10nPromise.get("editor_alt_text_edit_button_label").then(Le=>{ge.setAttribute("aria-label",Le)});let Ce=ce(this,le);if(!Ce){st(this,le,Ce=document.createElement("span")),Ce.className="tooltip",Ce.setAttribute("role","tooltip");const Le=Ce.id="alt-text-tooltip-".concat(this.id);ge.setAttribute("aria-describedby",Le);const Be=100;ge.addEventListener("mouseenter",()=>{st(this,Ae,setTimeout(()=>{st(this,Ae,null),ce(this,le).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},Be))}),ge.addEventListener("mouseleave",()=>{var He;clearTimeout(ce(this,Ae)),st(this,Ae,null),(He=ce(this,le))==null||He.classList.remove("show")})}ge.classList.add("done"),Ce.innerText=ce(this,de)?await pe._l10nPromise.get("editor_alt_text_decorative_tooltip"):ce(this,ue),Ce.parentNode||ge.append(Ce)},Et=new WeakSet,qr=function(ge){if(!this._isDraggable)return;const Ce=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let xe,Le;Ce&&(xe={passive:!0,capture:!0},Le=He=>{const[it,et]=this.screenToPageTranslation(He.movementX,He.movementY);this._uiManager.dragSelectedEditors(it,et)},window.addEventListener("pointermove",Le,xe));const Be=()=>{if(window.removeEventListener("pointerup",Be),window.removeEventListener("blur",Be),Ce&&window.removeEventListener("pointermove",Le,xe),st(this,Te,!1),!this._uiManager.endDragSession()){const{isMac:He}=ie.FeatureTest.platform;ge.ctrlKey&&!He||ge.shiftKey||ge.metaKey&&He?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",Be),window.addEventListener("blur",Be)},We(pe,Oe),An(pe,"_borderLineWidth",-1),An(pe,"_colorManager",new re.ColorManager),An(pe,"_zIndex",1),An(pe,"SMALL_EDITOR_SIZE",0);let oe=pe;te.AnnotationEditor=oe;class he extends oe{constructor(ge){super(ge),this.annotationElementId=ge.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(ee,te,ne)=>{var _e,me,ve,Se,Te,fr,$e,ye,Ee,Ne,Me,zr,Fe,Ve,qe,Ie,Xe,rt,lt,Ge,ut,mt,wt,Et,De,pe,be,ge,Ce,xe,Le,Be,He,it,et,ot,ht,pt,ct,Pt,It,vt,kt,gt,tt,nt,ft,Xr,Ct,pr,Wt,gr,zt,Xn,jt,mr,dt,_r,Ye,Pn,St,Bn,Qt,Kr,At,Yr,Rt,yr,Nt,Un,bt,br;Object.defineProperty(te,"__esModule",{value:!0}),te.KeyboardManager=te.CommandManager=te.ColorManager=te.AnnotationEditorUIManager=void 0,te.bindEvents=se,te.opacityToHex=oe;var re=ne(1),ie=ne(6);function se(Ue,fe,ke){for(const je of ke)fe.addEventListener(je,Ue[je].bind(Ue))}function oe(Ue){return Math.round(Math.min(255,Math.max(1,255*Ue))).toString(16).padStart(2,"0")}class he{constructor(){We(this,_e,0)}getId(){return"".concat(re.AnnotationEditorPrefix).concat(Nn(this,_e)._++)}}_e=new WeakMap;const Re=class Re{constructor(){We(this,Te);We(this,me,(0,re.getUuid)());We(this,ve,0);We(this,Se,null)}static get _isSVGFittingCanvas(){const fe='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>',je=new OffscreenCanvas(1,3).getContext("2d"),ze=new Image;ze.src=fe;const Ze=ze.decode().then(()=>(je.drawImage(ze,0,0,1,1,0,0,1,3),new Uint32Array(je.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,re.shadow)(this,"_isSVGFittingCanvas",Ze)}async getFromFile(fe){const{lastModified:ke,name:je,size:ze,type:Ze}=fe;return Ke(this,Te,fr).call(this,"".concat(ke,"_").concat(je,"_").concat(ze,"_").concat(Ze),fe)}async getFromUrl(fe){return Ke(this,Te,fr).call(this,fe,fe)}async getFromId(fe){ce(this,Se)||st(this,Se,new Map);const ke=ce(this,Se).get(fe);return ke?ke.bitmap?(ke.refCounter+=1,ke):ke.file?this.getFromFile(ke.file):this.getFromUrl(ke.url):null}getSvgUrl(fe){const ke=ce(this,Se).get(fe);return ke!=null&&ke.isSvg?ke.svgUrl:null}deleteId(fe){ce(this,Se)||st(this,Se,new Map);const ke=ce(this,Se).get(fe);ke&&(ke.refCounter-=1,ke.refCounter===0&&(ke.bitmap=null))}isValidId(fe){return fe.startsWith("image_".concat(ce(this,me),"_"))}};me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakSet,fr=async function(fe,ke){ce(this,Se)||st(this,Se,new Map);let je=ce(this,Se).get(fe);if(je===null)return null;if(je!=null&&je.bitmap)return je.refCounter+=1,je;try{je||(je={bitmap:null,id:"image_".concat(ce(this,me),"_").concat(Nn(this,ve)._++),refCounter:0,isSvg:!1});let ze;if(typeof ke=="string"){je.url=ke;const Ze=await fetch(ke);if(!Ze.ok)throw new Error(Ze.statusText);ze=await Ze.blob()}else ze=je.file=ke;if(ze.type==="image/svg+xml"){const Ze=Re._isSVGFittingCanvas,at=new FileReader,_t=new Image,xt=new Promise((Ft,qt)=>{_t.onload=()=>{je.bitmap=_t,je.isSvg=!0,Ft()},at.onload=async()=>{const Mt=je.svgUrl=at.result;_t.src=await Ze?"".concat(Mt,"#svgView(preserveAspectRatio(none))"):Mt},_t.onerror=at.onerror=qt});at.readAsDataURL(ze),await xt}else je.bitmap=await createImageBitmap(ze);je.refCounter=1}catch(ze){console.error(ze),je=null}return ce(this,Se).set(fe,je),je&&ce(this,Se).set(je.id,je),je};let ue=Re;class de{constructor(fe=128){We(this,$e,[]);We(this,ye,!1);We(this,Ee,void 0);We(this,Ne,-1);st(this,Ee,fe)}add({cmd:fe,undo:ke,mustExec:je,type:ze=NaN,overwriteIfSameType:Ze=!1,keepUndo:at=!1}){if(je&&fe(),ce(this,ye))return;const _t={cmd:fe,undo:ke,type:ze};if(ce(this,Ne)===-1){ce(this,$e).length>0&&(ce(this,$e).length=0),st(this,Ne,0),ce(this,$e).push(_t);return}if(Ze&&ce(this,$e)[ce(this,Ne)].type===ze){at&&(_t.undo=ce(this,$e)[ce(this,Ne)].undo),ce(this,$e)[ce(this,Ne)]=_t;return}const xt=ce(this,Ne)+1;xt===ce(this,Ee)?ce(this,$e).splice(0,1):(st(this,Ne,xt),xt<ce(this,$e).length&&ce(this,$e).splice(xt)),ce(this,$e).push(_t)}undo(){ce(this,Ne)!==-1&&(st(this,ye,!0),ce(this,$e)[ce(this,Ne)].undo(),st(this,ye,!1),st(this,Ne,ce(this,Ne)-1))}redo(){ce(this,Ne)<ce(this,$e).length-1&&(st(this,Ne,ce(this,Ne)+1),st(this,ye,!0),ce(this,$e)[ce(this,Ne)].cmd(),st(this,ye,!1))}hasSomethingToUndo(){return ce(this,Ne)!==-1}hasSomethingToRedo(){return ce(this,Ne)<ce(this,$e).length-1}destroy(){st(this,$e,null)}}$e=new WeakMap,ye=new WeakMap,Ee=new WeakMap,Ne=new WeakMap,te.CommandManager=de;class ae{constructor(fe){We(this,Me);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:ke}=re.FeatureTest.platform;for(const[je,ze,Ze={}]of fe)for(const at of je){const _t=at.startsWith("mac+");ke&&_t?(this.callbacks.set(at.slice(4),{callback:ze,options:Ze}),this.allKeys.add(at.split("+").at(-1))):!ke&&!_t&&(this.callbacks.set(at,{callback:ze,options:Ze}),this.allKeys.add(at.split("+").at(-1)))}}exec(fe,ke){if(!this.allKeys.has(ke.key))return;const je=this.callbacks.get(Ke(this,Me,zr).call(this,ke));if(!je)return;const{callback:ze,options:{bubbles:Ze=!1,args:at=[],checker:_t=null}}=je;_t&&!_t(fe,ke)||(ze.bind(fe,...at)(),Ze||(ke.stopPropagation(),ke.preventDefault()))}}Me=new WeakSet,zr=function(fe){fe.altKey&&this.buffer.push("alt"),fe.ctrlKey&&this.buffer.push("ctrl"),fe.metaKey&&this.buffer.push("meta"),fe.shiftKey&&this.buffer.push("shift"),this.buffer.push(fe.key);const ke=this.buffer.join("+");return this.buffer.length=0,ke},te.KeyboardManager=ae;const Oe=class Oe{get _colors(){const fe=new Map([["CanvasText",null],["Canvas",null]]);return(0,ie.getColorValues)(fe),(0,re.shadow)(this,"_colors",fe)}convert(fe){const ke=(0,ie.getRGB)(fe);if(!window.matchMedia("(forced-colors: active)").matches)return ke;for(const[je,ze]of this._colors)if(ze.every((Ze,at)=>Ze===ke[at]))return Oe._colorsMapping.get(je);return ke}getHexCode(fe){const ke=this._colors.get(fe);return ke?re.Util.makeHexColor(...ke):fe}};An(Oe,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let le=Oe;te.ColorManager=le;const Ot=class Ot{constructor(fe,ke,je,ze,Ze,at){We(this,ft);We(this,Ct);We(this,Wt);We(this,zt);We(this,jt);We(this,dt);We(this,Ye);We(this,St);We(this,Qt);We(this,At);We(this,Rt);We(this,Nt);We(this,bt);We(this,Fe,null);We(this,Ve,new Map);We(this,qe,new Map);We(this,Ie,null);We(this,Xe,null);We(this,rt,new de);We(this,lt,0);We(this,Ge,new Set);We(this,ut,null);We(this,mt,null);We(this,wt,new Set);We(this,Et,null);We(this,De,new he);We(this,pe,!1);We(this,be,!1);We(this,ge,null);We(this,Ce,re.AnnotationEditorType.NONE);We(this,xe,new Set);We(this,Le,null);We(this,Be,this.blur.bind(this));We(this,He,this.focus.bind(this));We(this,it,this.copy.bind(this));We(this,et,this.cut.bind(this));We(this,ot,this.paste.bind(this));We(this,ht,this.keydown.bind(this));We(this,pt,this.onEditingAction.bind(this));We(this,ct,this.onPageChanging.bind(this));We(this,Pt,this.onScaleChanging.bind(this));We(this,It,this.onRotationChanging.bind(this));We(this,vt,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});We(this,kt,[0,0]);We(this,gt,null);We(this,tt,null);We(this,nt,null);st(this,tt,fe),st(this,nt,ke),st(this,Ie,je),this._eventBus=ze,this._eventBus._on("editingaction",ce(this,pt)),this._eventBus._on("pagechanging",ce(this,ct)),this._eventBus._on("scalechanging",ce(this,Pt)),this._eventBus._on("rotationchanging",ce(this,It)),st(this,Xe,Ze.annotationStorage),st(this,Et,Ze.filterFactory),st(this,Le,at),this.viewParameters={realScale:ie.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const fe=Ot.prototype,ke=Ze=>{const{activeElement:at}=document;return at&&ce(Ze,tt).contains(at)&&Ze.hasSomethingToControl()},je=this.TRANSLATE_SMALL,ze=this.TRANSLATE_BIG;return(0,re.shadow)(this,"_keyboardManager",new ae([[["ctrl+a","mac+meta+a"],fe.selectAll],[["ctrl+z","mac+meta+z"],fe.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],fe.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],fe.delete],[["Escape","mac+Escape"],fe.unselectAll],[["ArrowLeft","mac+ArrowLeft"],fe.translateSelectedEditors,{args:[-je,0],checker:ke}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],fe.translateSelectedEditors,{args:[-ze,0],checker:ke}],[["ArrowRight","mac+ArrowRight"],fe.translateSelectedEditors,{args:[je,0],checker:ke}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],fe.translateSelectedEditors,{args:[ze,0],checker:ke}],[["ArrowUp","mac+ArrowUp"],fe.translateSelectedEditors,{args:[0,-je],checker:ke}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],fe.translateSelectedEditors,{args:[0,-ze],checker:ke}],[["ArrowDown","mac+ArrowDown"],fe.translateSelectedEditors,{args:[0,je],checker:ke}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],fe.translateSelectedEditors,{args:[0,ze],checker:ke}]]))}destroy(){Ke(this,zt,Xn).call(this),Ke(this,Ct,pr).call(this),this._eventBus._off("editingaction",ce(this,pt)),this._eventBus._off("pagechanging",ce(this,ct)),this._eventBus._off("scalechanging",ce(this,Pt)),this._eventBus._off("rotationchanging",ce(this,It));for(const fe of ce(this,qe).values())fe.destroy();ce(this,qe).clear(),ce(this,Ve).clear(),ce(this,wt).clear(),st(this,Fe,null),ce(this,xe).clear(),ce(this,rt).destroy(),ce(this,Ie).destroy()}get hcmFilter(){return(0,re.shadow)(this,"hcmFilter",ce(this,Le)?ce(this,Et).addHCMFilter(ce(this,Le).foreground,ce(this,Le).background):"none")}get direction(){return(0,re.shadow)(this,"direction",getComputedStyle(ce(this,tt)).direction)}editAltText(fe){var ke;(ke=ce(this,Ie))==null||ke.editAltText(this,fe)}onPageChanging({pageNumber:fe}){st(this,lt,fe-1)}focusMainContainer(){ce(this,tt).focus()}findParent(fe,ke){for(const je of ce(this,qe).values()){const{x:ze,y:Ze,width:at,height:_t}=je.div.getBoundingClientRect();if(fe>=ze&&fe<=ze+at&&ke>=Ze&&ke<=Ze+_t)return je}return null}disableUserSelect(fe=!1){ce(this,nt).classList.toggle("noUserSelect",fe)}addShouldRescale(fe){ce(this,wt).add(fe)}removeShouldRescale(fe){ce(this,wt).delete(fe)}onScaleChanging({scale:fe}){this.commitOrRemove(),this.viewParameters.realScale=fe*ie.PixelsPerInch.PDF_TO_CSS_UNITS;for(const ke of ce(this,wt))ke.onScaleChanging()}onRotationChanging({pagesRotation:fe}){this.commitOrRemove(),this.viewParameters.rotation=fe}addToAnnotationStorage(fe){!fe.isEmpty()&&ce(this,Xe)&&!ce(this,Xe).has(fe.id)&&ce(this,Xe).setValue(fe.id,fe)}blur(){if(!this.hasSelection)return;const{activeElement:fe}=document;for(const ke of ce(this,xe))if(ke.div.contains(fe)){st(this,ge,[ke,fe]),ke._focusEventsAllowed=!1;break}}focus(){if(!ce(this,ge))return;const[fe,ke]=ce(this,ge);st(this,ge,null),ke.addEventListener("focusin",()=>{fe._focusEventsAllowed=!0},{once:!0}),ke.focus()}addEditListeners(){Ke(this,Wt,gr).call(this),Ke(this,jt,mr).call(this)}removeEditListeners(){Ke(this,zt,Xn).call(this),Ke(this,dt,_r).call(this)}copy(fe){var je;if(fe.preventDefault(),(je=ce(this,Fe))==null||je.commitOrRemove(),!this.hasSelection)return;const ke=[];for(const ze of ce(this,xe)){const Ze=ze.serialize(!0);Ze&&ke.push(Ze)}ke.length!==0&&fe.clipboardData.setData("application/pdfjs",JSON.stringify(ke))}cut(fe){this.copy(fe),this.delete()}paste(fe){fe.preventDefault();const{clipboardData:ke}=fe;for(const Ze of ke.items)for(const at of ce(this,mt))if(at.isHandlingMimeForPasting(Ze.type)){at.paste(Ze,this.currentLayer);return}let je=ke.getData("application/pdfjs");if(!je)return;try{je=JSON.parse(je)}catch(Ze){(0,re.warn)('paste: "'.concat(Ze.message,'".'));return}if(!Array.isArray(je))return;this.unselectAll();const ze=this.currentLayer;try{const Ze=[];for(const xt of je){const Ft=ze.deserialize(xt);if(!Ft)return;Ze.push(Ft)}const at=()=>{for(const xt of Ze)Ke(this,Rt,yr).call(this,xt);Ke(this,bt,br).call(this,Ze)},_t=()=>{for(const xt of Ze)xt.remove()};this.addCommands({cmd:at,undo:_t,mustExec:!0})}catch(Ze){(0,re.warn)('paste: "'.concat(Ze.message,'".'))}}keydown(fe){var ke;(ke=this.getActive())!=null&&ke.shouldGetKeyboardEvents()||Ot._keyboardManager.exec(this,fe)}onEditingAction(fe){["undo","redo","delete","selectAll"].includes(fe.name)&&this[fe.name]()}setEditingState(fe){fe?(Ke(this,ft,Xr).call(this),Ke(this,Wt,gr).call(this),Ke(this,jt,mr).call(this),Ke(this,Ye,Pn).call(this,{isEditing:ce(this,Ce)!==re.AnnotationEditorType.NONE,isEmpty:Ke(this,Nt,Un).call(this),hasSomethingToUndo:ce(this,rt).hasSomethingToUndo(),hasSomethingToRedo:ce(this,rt).hasSomethingToRedo(),hasSelectedEditor:!1})):(Ke(this,Ct,pr).call(this),Ke(this,zt,Xn).call(this),Ke(this,dt,_r).call(this),Ke(this,Ye,Pn).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(fe){if(!ce(this,mt)){st(this,mt,fe);for(const ke of ce(this,mt))Ke(this,St,Bn).call(this,ke.defaultPropertiesToUpdate)}}getId(){return ce(this,De).getId()}get currentLayer(){return ce(this,qe).get(ce(this,lt))}getLayer(fe){return ce(this,qe).get(fe)}get currentPageIndex(){return ce(this,lt)}addLayer(fe){ce(this,qe).set(fe.pageIndex,fe),ce(this,pe)?fe.enable():fe.disable()}removeLayer(fe){ce(this,qe).delete(fe.pageIndex)}updateMode(fe,ke=null){if(ce(this,Ce)!==fe){if(st(this,Ce,fe),fe===re.AnnotationEditorType.NONE){this.setEditingState(!1),Ke(this,At,Yr).call(this);return}this.setEditingState(!0),Ke(this,Qt,Kr).call(this),this.unselectAll();for(const je of ce(this,qe).values())je.updateMode(fe);if(ke){for(const je of ce(this,Ve).values())if(je.annotationElementId===ke){this.setSelected(je),je.enterInEditMode();break}}}}updateToolbar(fe){fe!==ce(this,Ce)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:fe})}updateParams(fe,ke){if(ce(this,mt)){if(fe===re.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(fe);return}for(const je of ce(this,xe))je.updateParams(fe,ke);for(const je of ce(this,mt))je.updateDefaultParams(fe,ke)}}enableWaiting(fe=!1){if(ce(this,be)!==fe){st(this,be,fe);for(const ke of ce(this,qe).values())fe?ke.disableClick():ke.enableClick(),ke.div.classList.toggle("waiting",fe)}}getEditors(fe){const ke=[];for(const je of ce(this,Ve).values())je.pageIndex===fe&&ke.push(je);return ke}getEditor(fe){return ce(this,Ve).get(fe)}addEditor(fe){ce(this,Ve).set(fe.id,fe)}removeEditor(fe){var ke;ce(this,Ve).delete(fe.id),this.unselect(fe),(!fe.annotationElementId||!ce(this,Ge).has(fe.annotationElementId))&&((ke=ce(this,Xe))==null||ke.remove(fe.id))}addDeletedAnnotationElement(fe){ce(this,Ge).add(fe.annotationElementId),fe.deleted=!0}isDeletedAnnotationElement(fe){return ce(this,Ge).has(fe)}removeDeletedAnnotationElement(fe){ce(this,Ge).delete(fe.annotationElementId),fe.deleted=!1}setActiveEditor(fe){ce(this,Fe)!==fe&&(st(this,Fe,fe),fe&&Ke(this,St,Bn).call(this,fe.propertiesToUpdate))}toggleSelected(fe){if(ce(this,xe).has(fe)){ce(this,xe).delete(fe),fe.unselect(),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:this.hasSelection});return}ce(this,xe).add(fe),fe.select(),Ke(this,St,Bn).call(this,fe.propertiesToUpdate),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:!0})}setSelected(fe){for(const ke of ce(this,xe))ke!==fe&&ke.unselect();ce(this,xe).clear(),ce(this,xe).add(fe),fe.select(),Ke(this,St,Bn).call(this,fe.propertiesToUpdate),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:!0})}isSelected(fe){return ce(this,xe).has(fe)}unselect(fe){fe.unselect(),ce(this,xe).delete(fe),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return ce(this,xe).size!==0}undo(){ce(this,rt).undo(),Ke(this,Ye,Pn).call(this,{hasSomethingToUndo:ce(this,rt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:Ke(this,Nt,Un).call(this)})}redo(){ce(this,rt).redo(),Ke(this,Ye,Pn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:ce(this,rt).hasSomethingToRedo(),isEmpty:Ke(this,Nt,Un).call(this)})}addCommands(fe){ce(this,rt).add(fe),Ke(this,Ye,Pn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:Ke(this,Nt,Un).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const fe=[...ce(this,xe)],ke=()=>{for(const ze of fe)ze.remove()},je=()=>{for(const ze of fe)Ke(this,Rt,yr).call(this,ze)};this.addCommands({cmd:ke,undo:je,mustExec:!0})}commitOrRemove(){var fe;(fe=ce(this,Fe))==null||fe.commitOrRemove()}hasSomethingToControl(){return ce(this,Fe)||this.hasSelection}selectAll(){for(const fe of ce(this,xe))fe.commit();Ke(this,bt,br).call(this,ce(this,Ve).values())}unselectAll(){if(ce(this,Fe)){ce(this,Fe).commitOrRemove();return}if(this.hasSelection){for(const fe of ce(this,xe))fe.unselect();ce(this,xe).clear(),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(fe,ke,je=!1){if(je||this.commitOrRemove(),!this.hasSelection)return;ce(this,kt)[0]+=fe,ce(this,kt)[1]+=ke;const[ze,Ze]=ce(this,kt),at=[...ce(this,xe)],_t=1e3;ce(this,gt)&&clearTimeout(ce(this,gt)),st(this,gt,setTimeout(()=>{st(this,gt,null),ce(this,kt)[0]=ce(this,kt)[1]=0,this.addCommands({cmd:()=>{for(const xt of at)ce(this,Ve).has(xt.id)&&xt.translateInPage(ze,Ze)},undo:()=>{for(const xt of at)ce(this,Ve).has(xt.id)&&xt.translateInPage(-ze,-Ze)},mustExec:!1})},_t));for(const xt of at)xt.translateInPage(fe,ke)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),st(this,ut,new Map);for(const fe of ce(this,xe))ce(this,ut).set(fe,{savedX:fe.x,savedY:fe.y,savedPageIndex:fe.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!ce(this,ut))return!1;this.disableUserSelect(!1);const fe=ce(this,ut);st(this,ut,null);let ke=!1;for(const[{x:ze,y:Ze,pageIndex:at},_t]of fe)_t.newX=ze,_t.newY=Ze,_t.newPageIndex=at,ke||(ke=ze!==_t.savedX||Ze!==_t.savedY||at!==_t.savedPageIndex);if(!ke)return!1;const je=(ze,Ze,at,_t)=>{if(ce(this,Ve).has(ze.id)){const xt=ce(this,qe).get(_t);xt?ze._setParentAndPosition(xt,Ze,at):(ze.pageIndex=_t,ze.x=Ze,ze.y=at)}};return this.addCommands({cmd:()=>{for(const[ze,{newX:Ze,newY:at,newPageIndex:_t}]of fe)je(ze,Ze,at,_t)},undo:()=>{for(const[ze,{savedX:Ze,savedY:at,savedPageIndex:_t}]of fe)je(ze,Ze,at,_t)},mustExec:!0}),!0}dragSelectedEditors(fe,ke){if(ce(this,ut))for(const je of ce(this,ut).keys())je.drag(fe,ke)}rebuild(fe){if(fe.parent===null){const ke=this.getLayer(fe.pageIndex);ke?(ke.changeParent(fe),ke.addOrRebuild(fe)):(this.addEditor(fe),this.addToAnnotationStorage(fe),fe.rebuild())}else fe.parent.addOrRebuild(fe)}isActive(fe){return ce(this,Fe)===fe}getActive(){return ce(this,Fe)}getMode(){return ce(this,Ce)}get imageManager(){return(0,re.shadow)(this,"imageManager",new ue)}};Fe=new WeakMap,Ve=new WeakMap,qe=new WeakMap,Ie=new WeakMap,Xe=new WeakMap,rt=new WeakMap,lt=new WeakMap,Ge=new WeakMap,ut=new WeakMap,mt=new WeakMap,wt=new WeakMap,Et=new WeakMap,De=new WeakMap,pe=new WeakMap,be=new WeakMap,ge=new WeakMap,Ce=new WeakMap,xe=new WeakMap,Le=new WeakMap,Be=new WeakMap,He=new WeakMap,it=new WeakMap,et=new WeakMap,ot=new WeakMap,ht=new WeakMap,pt=new WeakMap,ct=new WeakMap,Pt=new WeakMap,It=new WeakMap,vt=new WeakMap,kt=new WeakMap,gt=new WeakMap,tt=new WeakMap,nt=new WeakMap,ft=new WeakSet,Xr=function(){window.addEventListener("focus",ce(this,He)),window.addEventListener("blur",ce(this,Be))},Ct=new WeakSet,pr=function(){window.removeEventListener("focus",ce(this,He)),window.removeEventListener("blur",ce(this,Be))},Wt=new WeakSet,gr=function(){window.addEventListener("keydown",ce(this,ht),{capture:!0})},zt=new WeakSet,Xn=function(){window.removeEventListener("keydown",ce(this,ht),{capture:!0})},jt=new WeakSet,mr=function(){document.addEventListener("copy",ce(this,it)),document.addEventListener("cut",ce(this,et)),document.addEventListener("paste",ce(this,ot))},dt=new WeakSet,_r=function(){document.removeEventListener("copy",ce(this,it)),document.removeEventListener("cut",ce(this,et)),document.removeEventListener("paste",ce(this,ot))},Ye=new WeakSet,Pn=function(fe){Object.entries(fe).some(([je,ze])=>ce(this,vt)[je]!==ze)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(ce(this,vt),fe)})},St=new WeakSet,Bn=function(fe){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:fe})},Qt=new WeakSet,Kr=function(){if(!ce(this,pe)){st(this,pe,!0);for(const fe of ce(this,qe).values())fe.enable()}},At=new WeakSet,Yr=function(){if(this.unselectAll(),ce(this,pe)){st(this,pe,!1);for(const fe of ce(this,qe).values())fe.disable()}},Rt=new WeakSet,yr=function(fe){const ke=ce(this,qe).get(fe.pageIndex);ke?ke.addOrRebuild(fe):this.addEditor(fe)},Nt=new WeakSet,Un=function(){if(ce(this,Ve).size===0)return!0;if(ce(this,Ve).size===1)for(const fe of ce(this,Ve).values())return fe.isEmpty();return!1},bt=new WeakSet,br=function(fe){ce(this,xe).clear();for(const ke of fe)ke.isEmpty()||(ce(this,xe).add(ke),ke.select());Ke(this,Ye,Pn).call(this,{hasSelectedEditor:!0})},An(Ot,"TRANSLATE_SMALL",1),An(Ot,"TRANSLATE_BIG",10);let Ae=Ot;te.AnnotationEditorUIManager=Ae},(ee,te,ne)=>{var lt,Ge,ut,mt,wt,Et,De,pe,be,ge,Ce,xe,Ln,Be,In,it,Sr,ot,Kn,pt,Yn,Pt,jn,vt,Hn;Object.defineProperty(te,"__esModule",{value:!0}),te.StatTimer=te.RenderingCancelledException=te.PixelsPerInch=te.PageViewport=te.PDFDateString=te.DOMStandardFontDataFactory=te.DOMSVGFactory=te.DOMFilterFactory=te.DOMCanvasFactory=te.DOMCMapReaderFactory=void 0,te.deprecated=Ne,te.getColorValues=Ve,te.getCurrentTransform=qe,te.getCurrentTransformInverse=Ie,te.getFilenameFromUrl=Te,te.getPdfFilenameFromUrl=Pe,te.getRGB=Fe,te.getXfaPageViewport=Oe,te.isDataScheme=ve,te.isPdfFile=Se,te.isValidFetchUrl=$e,te.loadScript=Ee,te.noContextMenu=ye,te.setLayerDimensions=Xe;var re=ne(7),ie=ne(1);const se="http://www.w3.org/2000/svg",rt=class rt{};An(rt,"CSS",96),An(rt,"PDF",72),An(rt,"PDF_TO_CSS_UNITS",rt.CSS/rt.PDF);let oe=rt;te.PixelsPerInch=oe;class he extends re.BaseFilterFactory{constructor({docId:nt,ownerDocument:ft=globalThis.document}={}){super();We(this,xe);We(this,Be);We(this,it);We(this,ot);We(this,pt);We(this,Pt);We(this,vt);We(this,lt,void 0);We(this,Ge,void 0);We(this,ut,void 0);We(this,mt,void 0);We(this,wt,void 0);We(this,Et,void 0);We(this,De,void 0);We(this,pe,void 0);We(this,be,void 0);We(this,ge,void 0);We(this,Ce,0);st(this,ut,nt),st(this,mt,ft)}addFilter(nt){if(!nt)return"none";let ft=ce(this,xe,Ln).get(nt);if(ft)return ft;let Tt,Ct,Ht,Wt;if(nt.length===1){const jt=nt[0],Gt=new Array(256);for(let dt=0;dt<256;dt++)Gt[dt]=jt[dt]/255;Wt=Tt=Ct=Ht=Gt.join(",")}else{const[jt,Gt,dt]=nt,Qe=new Array(256),Ye=new Array(256),yt=new Array(256);for(let St=0;St<256;St++)Qe[St]=jt[St]/255,Ye[St]=Gt[St]/255,yt[St]=dt[St]/255;Tt=Qe.join(","),Ct=Ye.join(","),Ht=yt.join(","),Wt="".concat(Tt).concat(Ct).concat(Ht)}if(ft=ce(this,xe,Ln).get(Wt),ft)return ce(this,xe,Ln).set(nt,ft),ft;const Ut="g_".concat(ce(this,ut),"_transfer_map_").concat(Nn(this,Ce)._++),zt="url(#".concat(Ut,")");ce(this,xe,Ln).set(nt,zt),ce(this,xe,Ln).set(Wt,zt);const Vt=Ke(this,ot,Kn).call(this,Ut);return Ke(this,Pt,jn).call(this,Tt,Ct,Ht,Vt),zt}addHCMFilter(nt,ft){var Gt;const Tt="".concat(nt,"-").concat(ft);if(ce(this,Et)===Tt)return ce(this,De);if(st(this,Et,Tt),st(this,De,"none"),(Gt=ce(this,wt))==null||Gt.remove(),!nt||!ft)return ce(this,De);const Ct=Ke(this,vt,Hn).call(this,nt);nt=ie.Util.makeHexColor(...Ct);const Ht=Ke(this,vt,Hn).call(this,ft);if(ft=ie.Util.makeHexColor(...Ht),ce(this,Be,In).style.color="",nt==="#000000"&&ft==="#ffffff"||nt===ft)return ce(this,De);const Wt=new Array(256);for(let dt=0;dt<=255;dt++){const Qe=dt/255;Wt[dt]=Qe<=.03928?Qe/12.92:((Qe+.055)/1.055)**2.4}const Ut=Wt.join(","),zt="g_".concat(ce(this,ut),"_hcm_filter"),Vt=st(this,pe,Ke(this,ot,Kn).call(this,zt));Ke(this,Pt,jn).call(this,Ut,Ut,Ut,Vt),Ke(this,it,Sr).call(this,Vt);const jt=(dt,Qe)=>{const Ye=Ct[dt]/255,yt=Ht[dt]/255,St=new Array(Qe+1);for(let wn=0;wn<=Qe;wn++)St[wn]=Ye+wn/Qe*(yt-Ye);return St.join(",")};return Ke(this,Pt,jn).call(this,jt(0,5),jt(1,5),jt(2,5),Vt),st(this,De,"url(#".concat(zt,")")),ce(this,De)}addHighlightHCMFilter(nt,ft,Tt,Ct){var yt;const Ht="".concat(nt,"-").concat(ft,"-").concat(Tt,"-").concat(Ct);if(ce(this,be)===Ht)return ce(this,ge);if(st(this,be,Ht),st(this,ge,"none"),(yt=ce(this,pe))==null||yt.remove(),!nt||!ft)return ce(this,ge);const[Wt,Ut]=[nt,ft].map(Ke(this,vt,Hn).bind(this));let zt=Math.round(.2126*Wt[0]+.7152*Wt[1]+.0722*Wt[2]),Vt=Math.round(.2126*Ut[0]+.7152*Ut[1]+.0722*Ut[2]),[jt,Gt]=[Tt,Ct].map(Ke(this,vt,Hn).bind(this));Vt<zt&&([zt,Vt,jt,Gt]=[Vt,zt,Gt,jt]),ce(this,Be,In).style.color="";const dt=(St,wn,Qt)=>{const Je=new Array(256),At=(Vt-zt)/Qt,Lt=St/255,Rt=(wn-St)/(255*Qt);let Dt=0;for(let Nt=0;Nt<=Qt;Nt++){const Zt=Math.round(zt+Nt*At),bt=Lt+Nt*Rt;for(let Kt=Dt;Kt<=Zt;Kt++)Je[Kt]=bt;Dt=Zt+1}for(let Nt=Dt;Nt<256;Nt++)Je[Nt]=Je[Dt-1];return Je.join(",")},Qe="g_".concat(ce(this,ut),"_hcm_highlight_filter"),Ye=st(this,pe,Ke(this,ot,Kn).call(this,Qe));return Ke(this,it,Sr).call(this,Ye),Ke(this,Pt,jn).call(this,dt(jt[0],Gt[0],5),dt(jt[1],Gt[1],5),dt(jt[2],Gt[2],5),Ye),st(this,ge,"url(#".concat(Qe,")")),ce(this,ge)}destroy(nt=!1){nt&&(ce(this,De)||ce(this,ge))||(ce(this,Ge)&&(ce(this,Ge).parentNode.parentNode.remove(),st(this,Ge,null)),ce(this,lt)&&(ce(this,lt).clear(),st(this,lt,null)),st(this,Ce,0))}}lt=new WeakMap,Ge=new WeakMap,ut=new WeakMap,mt=new WeakMap,wt=new WeakMap,Et=new WeakMap,De=new WeakMap,pe=new WeakMap,be=new WeakMap,ge=new WeakMap,Ce=new WeakMap,xe=new WeakSet,Ln=function(){return ce(this,lt)||st(this,lt,new Map)},Be=new WeakSet,In=function(){if(!ce(this,Ge)){const nt=ce(this,mt).createElement("div"),{style:ft}=nt;ft.visibility="hidden",ft.contain="strict",ft.width=ft.height=0,ft.position="absolute",ft.top=ft.left=0,ft.zIndex=-1;const Tt=ce(this,mt).createElementNS(se,"svg");Tt.setAttribute("width",0),Tt.setAttribute("height",0),st(this,Ge,ce(this,mt).createElementNS(se,"defs")),nt.append(Tt),Tt.append(ce(this,Ge)),ce(this,mt).body.append(nt)}return ce(this,Ge)},it=new WeakSet,Sr=function(nt){const ft=ce(this,mt).createElementNS(se,"feColorMatrix");ft.setAttribute("type","matrix"),ft.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"),nt.append(ft)},ot=new WeakSet,Kn=function(nt){const ft=ce(this,mt).createElementNS(se,"filter");return ft.setAttribute("color-interpolation-filters","sRGB"),ft.setAttribute("id",nt),ce(this,Be,In).append(ft),ft},pt=new WeakSet,Yn=function(nt,ft,Tt){const Ct=ce(this,mt).createElementNS(se,ft);Ct.setAttribute("type","discrete"),Ct.setAttribute("tableValues",Tt),nt.append(Ct)},Pt=new WeakSet,jn=function(nt,ft,Tt,Ct){const Ht=ce(this,mt).createElementNS(se,"feComponentTransfer");Ct.append(Ht),Ke(this,pt,Yn).call(this,Ht,"feFuncR",nt),Ke(this,pt,Yn).call(this,Ht,"feFuncG",ft),Ke(this,pt,Yn).call(this,Ht,"feFuncB",Tt)},vt=new WeakSet,Hn=function(nt){return ce(this,Be,In).style.color=nt,Fe(getComputedStyle(ce(this,Be,In)).getPropertyValue("color"))},te.DOMFilterFactory=he;class ue extends re.BaseCanvasFactory{constructor({ownerDocument:tt=globalThis.document}={}){super(),this._document=tt}_createCanvas(tt,nt){const ft=this._document.createElement("canvas");return ft.width=tt,ft.height=nt,ft}}te.DOMCanvasFactory=ue;async function de(gt,tt=!1){if($e(gt,document.baseURI)){const nt=await fetch(gt);if(!nt.ok)throw new Error(nt.statusText);return tt?new Uint8Array(await nt.arrayBuffer()):(0,ie.stringToBytes)(await nt.text())}return new Promise((nt,ft)=>{const Tt=new XMLHttpRequest;Tt.open("GET",gt,!0),tt&&(Tt.responseType="arraybuffer"),Tt.onreadystatechange=()=>{if(Tt.readyState===XMLHttpRequest.DONE){if(Tt.status===200||Tt.status===0){let Ct;if(tt&&Tt.response?Ct=new Uint8Array(Tt.response):!tt&&Tt.responseText&&(Ct=(0,ie.stringToBytes)(Tt.responseText)),Ct){nt(Ct);return}}ft(new Error(Tt.statusText))}},Tt.send(null)})}class ae extends re.BaseCMapReaderFactory{_fetchData(tt,nt){return de(tt,this.isCompressed).then(ft=>({cMapData:ft,compressionType:nt}))}}te.DOMCMapReaderFactory=ae;class le extends re.BaseStandardFontDataFactory{_fetchData(tt){return de(tt,!0)}}te.DOMStandardFontDataFactory=le;class Ae extends re.BaseSVGFactory{_createSVG(tt){return document.createElementNS(se,tt)}}te.DOMSVGFactory=Ae;class _e{constructor({viewBox:tt,scale:nt,rotation:ft,offsetX:Tt=0,offsetY:Ct=0,dontFlip:Ht=!1}){this.viewBox=tt,this.scale=nt,this.rotation=ft,this.offsetX=Tt,this.offsetY=Ct;const Wt=(tt[2]+tt[0])/2,Ut=(tt[3]+tt[1])/2;let zt,Vt,jt,Gt;switch(ft%=360,ft<0&&(ft+=360),ft){case 180:zt=-1,Vt=0,jt=0,Gt=1;break;case 90:zt=0,Vt=1,jt=1,Gt=0;break;case 270:zt=0,Vt=-1,jt=-1,Gt=0;break;case 0:zt=1,Vt=0,jt=0,Gt=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Ht&&(jt=-jt,Gt=-Gt);let dt,Qe,Ye,yt;zt===0?(dt=Math.abs(Ut-tt[1])*nt+Tt,Qe=Math.abs(Wt-tt[0])*nt+Ct,Ye=(tt[3]-tt[1])*nt,yt=(tt[2]-tt[0])*nt):(dt=Math.abs(Wt-tt[0])*nt+Tt,Qe=Math.abs(Ut-tt[1])*nt+Ct,Ye=(tt[2]-tt[0])*nt,yt=(tt[3]-tt[1])*nt),this.transform=[zt*nt,Vt*nt,jt*nt,Gt*nt,dt-zt*nt*Wt-jt*nt*Ut,Qe-Vt*nt*Wt-Gt*nt*Ut],this.width=Ye,this.height=yt}get rawDims(){const{viewBox:tt}=this;return(0,ie.shadow)(this,"rawDims",{pageWidth:tt[2]-tt[0],pageHeight:tt[3]-tt[1],pageX:tt[0],pageY:tt[1]})}clone({scale:tt=this.scale,rotation:nt=this.rotation,offsetX:ft=this.offsetX,offsetY:Tt=this.offsetY,dontFlip:Ct=!1}={}){return new _e({viewBox:this.viewBox.slice(),scale:tt,rotation:nt,offsetX:ft,offsetY:Tt,dontFlip:Ct})}convertToViewportPoint(tt,nt){return ie.Util.applyTransform([tt,nt],this.transform)}convertToViewportRectangle(tt){const nt=ie.Util.applyTransform([tt[0],tt[1]],this.transform),ft=ie.Util.applyTransform([tt[2],tt[3]],this.transform);return[nt[0],nt[1],ft[0],ft[1]]}convertToPdfPoint(tt,nt){return ie.Util.applyInverseTransform([tt,nt],this.transform)}}te.PageViewport=_e;class me extends ie.BaseException{constructor(tt,nt=0){super(tt,"RenderingCancelledException"),this.extraDelay=nt}}te.RenderingCancelledException=me;function ve(gt){const tt=gt.length;let nt=0;for(;nt<tt&&gt[nt].trim()==="";)nt++;return gt.substring(nt,nt+5).toLowerCase()==="data:"}function Se(gt){return typeof gt=="string"&&/\.pdf$/i.test(gt)}function Te(gt,tt=!1){return tt||([gt]=gt.split(/[#?]/,1)),gt.substring(gt.lastIndexOf("/")+1)}function Pe(gt,tt="document.pdf"){if(typeof gt!="string")return tt;if(ve(gt))return(0,ie.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),tt;const nt=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,ft=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,Tt=nt.exec(gt);let Ct=ft.exec(Tt[1])||ft.exec(Tt[2])||ft.exec(Tt[3]);if(Ct&&(Ct=Ct[0],Ct.includes("%")))try{Ct=ft.exec(decodeURIComponent(Ct))[0]}catch{}return Ct||tt}class Re{constructor(){An(this,"started",Object.create(null));An(this,"times",[])}time(tt){tt in this.started&&(0,ie.warn)("Timer is already running for ".concat(tt)),this.started[tt]=Date.now()}timeEnd(tt){tt in this.started||(0,ie.warn)("Timer has not been started for ".concat(tt)),this.times.push({name:tt,start:this.started[tt],end:Date.now()}),delete this.started[tt]}toString(){const tt=[];let nt=0;for(const{name:ft}of this.times)nt=Math.max(ft.length,nt);for(const{name:ft,start:Tt,end:Ct}of this.times)tt.push("".concat(ft.padEnd(nt)," ").concat(Ct-Tt,"ms\n"));return tt.join("")}}te.StatTimer=Re;function $e(gt,tt){try{const{protocol:nt}=tt?new URL(gt,tt):new URL(gt);return nt==="http:"||nt==="https:"}catch{return!1}}function ye(gt){gt.preventDefault()}function Ee(gt,tt=!1){return new Promise((nt,ft)=>{const Tt=document.createElement("script");Tt.src=gt,Tt.onload=function(Ct){tt&&Tt.remove(),nt(Ct)},Tt.onerror=function(){ft(new Error("Cannot load script at: ".concat(Tt.src)))},(document.head||document.documentElement).append(Tt)})}function Ne(gt){console.log("Deprecated API usage: "+gt)}let Me;class we{static toDateObject(tt){if(!tt||typeof tt!="string")return null;Me||(Me=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const nt=Me.exec(tt);if(!nt)return null;const ft=parseInt(nt[1],10);let Tt=parseInt(nt[2],10);Tt=Tt>=1&&Tt<=12?Tt-1:0;let Ct=parseInt(nt[3],10);Ct=Ct>=1&&Ct<=31?Ct:1;let Ht=parseInt(nt[4],10);Ht=Ht>=0&&Ht<=23?Ht:0;let Wt=parseInt(nt[5],10);Wt=Wt>=0&&Wt<=59?Wt:0;let Ut=parseInt(nt[6],10);Ut=Ut>=0&&Ut<=59?Ut:0;const zt=nt[7]||"Z";let Vt=parseInt(nt[8],10);Vt=Vt>=0&&Vt<=23?Vt:0;let jt=parseInt(nt[9],10)||0;return jt=jt>=0&&jt<=59?jt:0,zt==="-"?(Ht+=Vt,Wt+=jt):zt==="+"&&(Ht-=Vt,Wt-=jt),new Date(Date.UTC(ft,Tt,Ct,Ht,Wt,Ut))}}te.PDFDateString=we;function Oe(gt,{scale:tt=1,rotation:nt=0}){const{width:ft,height:Tt}=gt.attributes.style,Ct=[0,0,parseInt(ft),parseInt(Tt)];return new _e({viewBox:Ct,scale:tt,rotation:nt})}function Fe(gt){if(gt.startsWith("#")){const tt=parseInt(gt.slice(1),16);return[(tt&16711680)>>16,(tt&65280)>>8,tt&255]}return gt.startsWith("rgb(")?gt.slice(4,-1).split(",").map(tt=>parseInt(tt)):gt.startsWith("rgba(")?gt.slice(5,-1).split(",").map(tt=>parseInt(tt)).slice(0,3):((0,ie.warn)('Not a valid color format: "'.concat(gt,'"')),[0,0,0])}function Ve(gt){const tt=document.createElement("span");tt.style.visibility="hidden",document.body.append(tt);for(const nt of gt.keys()){tt.style.color=nt;const ft=window.getComputedStyle(tt).color;gt.set(nt,Fe(ft))}tt.remove()}function qe(gt){const{a:tt,b:nt,c:ft,d:Tt,e:Ct,f:Ht}=gt.getTransform();return[tt,nt,ft,Tt,Ct,Ht]}function Ie(gt){const{a:tt,b:nt,c:ft,d:Tt,e:Ct,f:Ht}=gt.getTransform().invertSelf();return[tt,nt,ft,Tt,Ct,Ht]}function Xe(gt,tt,nt=!1,ft=!0){if(tt instanceof _e){const{pageWidth:Tt,pageHeight:Ct}=tt.rawDims,{style:Ht}=gt,Wt=ie.FeatureTest.isCSSRoundSupported,Ut="var(--scale-factor) * ".concat(Tt,"px"),zt="var(--scale-factor) * ".concat(Ct,"px"),Vt=Wt?"round(".concat(Ut,", 1px)"):"calc(".concat(Ut,")"),jt=Wt?"round(".concat(zt,", 1px)"):"calc(".concat(zt,")");!nt||tt.rotation%180===0?(Ht.width=Vt,Ht.height=jt):(Ht.width=jt,Ht.height=Vt)}ft&&gt.setAttribute("data-main-rotation",tt.rotation)}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.BaseStandardFontDataFactory=te.BaseSVGFactory=te.BaseFilterFactory=te.BaseCanvasFactory=te.BaseCMapReaderFactory=void 0;var re=ne(1);class ie{constructor(){this.constructor===ie&&(0,re.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(ae){return"none"}addHCMFilter(ae,le){return"none"}addHighlightHCMFilter(ae,le,Ae,_e){return"none"}destroy(ae=!1){}}te.BaseFilterFactory=ie;class se{constructor(){this.constructor===se&&(0,re.unreachable)("Cannot initialize BaseCanvasFactory.")}create(ae,le){if(ae<=0||le<=0)throw new Error("Invalid canvas size");const Ae=this._createCanvas(ae,le);return{canvas:Ae,context:Ae.getContext("2d")}}reset(ae,le,Ae){if(!ae.canvas)throw new Error("Canvas is not specified");if(le<=0||Ae<=0)throw new Error("Invalid canvas size");ae.canvas.width=le,ae.canvas.height=Ae}destroy(ae){if(!ae.canvas)throw new Error("Canvas is not specified");ae.canvas.width=0,ae.canvas.height=0,ae.canvas=null,ae.context=null}_createCanvas(ae,le){(0,re.unreachable)("Abstract method `_createCanvas` called.")}}te.BaseCanvasFactory=se;class oe{constructor({baseUrl:ae=null,isCompressed:le=!0}){this.constructor===oe&&(0,re.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=ae,this.isCompressed=le}async fetch({name:ae}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!ae)throw new Error("CMap name must be specified.");const le=this.baseUrl+ae+(this.isCompressed?".bcmap":""),Ae=this.isCompressed?re.CMapCompressionType.BINARY:re.CMapCompressionType.NONE;return this._fetchData(le,Ae).catch(_e=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(le))})}_fetchData(ae,le){(0,re.unreachable)("Abstract method `_fetchData` called.")}}te.BaseCMapReaderFactory=oe;class he{constructor({baseUrl:ae=null}){this.constructor===he&&(0,re.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=ae}async fetch({filename:ae}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!ae)throw new Error("Font filename must be specified.");const le="".concat(this.baseUrl).concat(ae);return this._fetchData(le).catch(Ae=>{throw new Error("Unable to load font data at: ".concat(le))})}_fetchData(ae){(0,re.unreachable)("Abstract method `_fetchData` called.")}}te.BaseStandardFontDataFactory=he;class ue{constructor(){this.constructor===ue&&(0,re.unreachable)("Cannot initialize BaseSVGFactory.")}create(ae,le,Ae=!1){if(ae<=0||le<=0)throw new Error("Invalid SVG dimensions");const _e=this._createSVG("svg:svg");return _e.setAttribute("version","1.1"),Ae||(_e.setAttribute("width","".concat(ae,"px")),_e.setAttribute("height","".concat(le,"px"))),_e.setAttribute("preserveAspectRatio","none"),_e.setAttribute("viewBox","0 0 ".concat(ae," ").concat(le)),_e}createElement(ae){if(typeof ae!="string")throw new Error("Invalid SVG element type");return this._createSVG(ae)}_createSVG(ae){(0,re.unreachable)("Abstract method `_createSVG` called.")}}te.BaseSVGFactory=ue},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.MurmurHash3_64=void 0;var re=ne(1);const ie=3285377520,se=4294901760,oe=65535;class he{constructor(de){this.h1=de?de&4294967295:ie,this.h2=de?de&4294967295:ie}update(de){let ae,le;if(typeof de=="string"){ae=new Uint8Array(de.length*2),le=0;for(let Ne=0,Me=de.length;Ne<Me;Ne++){const we=de.charCodeAt(Ne);we<=255?ae[le++]=we:(ae[le++]=we>>>8,ae[le++]=we&255)}}else if((0,re.isArrayBuffer)(de))ae=de.slice(),le=ae.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const Ae=le>>2,_e=le-Ae*4,me=new Uint32Array(ae.buffer,0,Ae);let ve=0,Se=0,Te=this.h1,Pe=this.h2;const Re=3432918353,$e=461845907,ye=Re&oe,Ee=$e&oe;for(let Ne=0;Ne<Ae;Ne++)Ne&1?(ve=me[Ne],ve=ve*Re&se|ve*ye&oe,ve=ve<<15|ve>>>17,ve=ve*$e&se|ve*Ee&oe,Te^=ve,Te=Te<<13|Te>>>19,Te=Te*5+3864292196):(Se=me[Ne],Se=Se*Re&se|Se*ye&oe,Se=Se<<15|Se>>>17,Se=Se*$e&se|Se*Ee&oe,Pe^=Se,Pe=Pe<<13|Pe>>>19,Pe=Pe*5+3864292196);switch(ve=0,_e){case 3:ve^=ae[Ae*4+2]<<16;case 2:ve^=ae[Ae*4+1]<<8;case 1:ve^=ae[Ae*4],ve=ve*Re&se|ve*ye&oe,ve=ve<<15|ve>>>17,ve=ve*$e&se|ve*Ee&oe,Ae&1?Te^=ve:Pe^=ve}this.h1=Te,this.h2=Pe}hexdigest(){let de=this.h1,ae=this.h2;return de^=ae>>>1,de=de*3981806797&se|de*36045&oe,ae=ae*4283543511&se|((ae<<16|de>>>16)*2950163797&se)>>>16,de^=ae>>>1,de=de*444984403&se|de*60499&oe,ae=ae*3301882366&se|((ae<<16|de>>>16)*3120437893&se)>>>16,de^=ae>>>1,(de>>>0).toString(16).padStart(8,"0")+(ae>>>0).toString(16).padStart(8,"0")}}te.MurmurHash3_64=he},(ee,te,ne)=>{var oe;Object.defineProperty(te,"__esModule",{value:!0}),te.FontLoader=te.FontFaceObject=void 0;var re=ne(1);class ie{constructor({ownerDocument:ue=globalThis.document,styleElement:de=null}){We(this,oe,new Set);this._document=ue,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(ue){this.nativeFontFaces.add(ue),this._document.fonts.add(ue)}removeNativeFontFace(ue){this.nativeFontFaces.delete(ue),this._document.fonts.delete(ue)}insertRule(ue){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const de=this.styleElement.sheet;de.insertRule(ue,de.cssRules.length)}clear(){for(const ue of this.nativeFontFaces)this._document.fonts.delete(ue);this.nativeFontFaces.clear(),ce(this,oe).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(ue){if(!(!ue||ce(this,oe).has(ue.loadedName))){if((0,re.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:de,src:ae,style:le}=ue,Ae=new FontFace(de,ae,le);this.addNativeFontFace(Ae);try{await Ae.load(),ce(this,oe).add(de)}catch{(0,re.warn)("Cannot load system font: ".concat(ue.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(Ae)}return}(0,re.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(ue){if(ue.attached||ue.missingFile&&!ue.systemFontInfo)return;if(ue.attached=!0,ue.systemFontInfo){await this.loadSystemFont(ue.systemFontInfo);return}if(this.isFontLoadingAPISupported){const ae=ue.createNativeFontFace();if(ae){this.addNativeFontFace(ae);try{await ae.loaded}catch(le){throw(0,re.warn)("Failed to load font '".concat(ae.family,"': '").concat(le,"'.")),ue.disableFontFace=!0,le}}return}const de=ue.createFontFaceRule();if(de){if(this.insertRule(de),this.isSyncFontLoadingSupported)return;await new Promise(ae=>{const le=this._queueLoadingCallback(ae);this._prepareFontLoadEvent(ue,le)})}}get isFontLoadingAPISupported(){var de;const ue=!!((de=this._document)!=null&&de.fonts);return(0,re.shadow)(this,"isFontLoadingAPISupported",ue)}get isSyncFontLoadingSupported(){let ue=!1;return(re.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(ue=!0),(0,re.shadow)(this,"isSyncFontLoadingSupported",ue)}_queueLoadingCallback(ue){function de(){for((0,re.assert)(!le.done,"completeRequest() cannot be called twice."),le.done=!0;ae.length>0&&ae[0].done;){const Ae=ae.shift();setTimeout(Ae.callback,0)}}const{loadingRequests:ae}=this,le={done:!1,complete:de,callback:ue};return ae.push(le),le}get _loadTestFont(){const ue=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,re.shadow)(this,"_loadTestFont",ue)}_prepareFontLoadEvent(ue,de){function ae(Fe,Ve){return Fe.charCodeAt(Ve)<<24|Fe.charCodeAt(Ve+1)<<16|Fe.charCodeAt(Ve+2)<<8|Fe.charCodeAt(Ve+3)&255}function le(Fe,Ve,qe,Ie){const Xe=Fe.substring(0,Ve),rt=Fe.substring(Ve+qe);return Xe+Ie+rt}let Ae,_e;const me=this._document.createElement("canvas");me.width=1,me.height=1;const ve=me.getContext("2d");let Se=0;function Te(Fe,Ve){if(++Se>30){(0,re.warn)("Load test font never loaded."),Ve();return}if(ve.font="30px "+Fe,ve.fillText(".",0,20),ve.getImageData(0,0,1,1).data[3]>0){Ve();return}setTimeout(Te.bind(null,Fe,Ve))}const Pe="lt".concat(Date.now()).concat(this.loadTestFontId++);let Re=this._loadTestFont;Re=le(Re,976,Pe.length,Pe);const ye=16,Ee=1482184792;let Ne=ae(Re,ye);for(Ae=0,_e=Pe.length-3;Ae<_e;Ae+=4)Ne=Ne-Ee+ae(Pe,Ae)|0;Ae<Pe.length&&(Ne=Ne-Ee+ae(Pe+"XXX",Ae)|0),Re=le(Re,ye,4,(0,re.string32)(Ne));const Me="url(data:font/opentype;base64,".concat(btoa(Re),");"),we='@font-face {font-family:"'.concat(Pe,'";src:').concat(Me,"}");this.insertRule(we);const Oe=this._document.createElement("div");Oe.style.visibility="hidden",Oe.style.width=Oe.style.height="10px",Oe.style.position="absolute",Oe.style.top=Oe.style.left="0px";for(const Fe of[ue.loadedName,Pe]){const Ve=this._document.createElement("span");Ve.textContent="Hi",Ve.style.fontFamily=Fe,Oe.append(Ve)}this._document.body.append(Oe),Te(Pe,()=>{Oe.remove(),de.complete()})}}oe=new WeakMap,te.FontLoader=ie;class se{constructor(ue,{isEvalSupported:de=!0,disableFontFace:ae=!1,ignoreErrors:le=!1,inspectFont:Ae=null}){this.compiledGlyphs=Object.create(null);for(const _e in ue)this[_e]=ue[_e];this.isEvalSupported=de!==!1,this.disableFontFace=ae===!0,this.ignoreErrors=le===!0,this._inspectFont=Ae}createNativeFontFace(){var de;if(!this.data||this.disableFontFace)return null;let ue;if(!this.cssFontInfo)ue=new FontFace(this.loadedName,this.data,{});else{const ae={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(ae.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),ue=new FontFace(this.cssFontInfo.fontFamily,this.data,ae)}return(de=this._inspectFont)==null||de.call(this,this),ue}createFontFaceRule(){var le;if(!this.data||this.disableFontFace)return null;const ue=(0,re.bytesToString)(this.data),de="url(data:".concat(this.mimetype,";base64,").concat(btoa(ue),");");let ae;if(!this.cssFontInfo)ae='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(de,"}");else{let Ae="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(Ae+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),ae='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(Ae,"src:").concat(de,"}")}return(le=this._inspectFont)==null||le.call(this,this,de),ae}getPathGenerator(ue,de){if(this.compiledGlyphs[de]!==void 0)return this.compiledGlyphs[de];let ae;try{ae=ue.get(this.loadedName+"_path_"+de)}catch(le){if(!this.ignoreErrors)throw le;return(0,re.warn)('getPathGenerator - ignoring character: "'.concat(le,'".')),this.compiledGlyphs[de]=function(Ae,_e){}}if(this.isEvalSupported&&re.FeatureTest.isEvalSupported){const le=[];for(const Ae of ae){const _e=Ae.args!==void 0?Ae.args.join(","):"";le.push("c.",Ae.cmd,"(",_e,");\n")}return this.compiledGlyphs[de]=new Function("c","size",le.join(""))}return this.compiledGlyphs[de]=function(le,Ae){for(const _e of ae)_e.cmd==="scale"&&(_e.args=[Ae,-Ae]),le[_e.cmd].apply(le,_e.args)}}}te.FontFaceObject=se},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.NodeStandardFontDataFactory=te.NodeFilterFactory=te.NodeCanvasFactory=te.NodeCMapReaderFactory=void 0;var re=ne(7);ne(1);const ie=function(de){return new Promise((ae,le)=>{require$$5.readFile(de,(_e,me)=>{if(_e||!me){le(new Error(_e));return}ae(new Uint8Array(me))})})};class se extends re.BaseFilterFactory{}te.NodeFilterFactory=se;class oe extends re.BaseCanvasFactory{_createCanvas(ae,le){return require$$5.createCanvas(ae,le)}}te.NodeCanvasFactory=oe;class he extends re.BaseCMapReaderFactory{_fetchData(ae,le){return ie(ae).then(Ae=>({cMapData:Ae,compressionType:le}))}}te.NodeCMapReaderFactory=he;class ue extends re.BaseStandardFontDataFactory{_fetchData(ae){return ie(ae)}}te.NodeStandardFontDataFactory=ue},(ee,te,ne)=>{var Ge,vr,mt,wr;Object.defineProperty(te,"__esModule",{value:!0}),te.CanvasGraphics=void 0;var re=ne(1),ie=ne(6),se=ne(12),oe=ne(13);const he=16,ue=100,de=4096,ae=15,le=10,Ae=1e3,_e=16;function me(De,pe){if(De._removeMirroring)throw new Error("Context is already forwarding operations.");De.__originalSave=De.save,De.__originalRestore=De.restore,De.__originalRotate=De.rotate,De.__originalScale=De.scale,De.__originalTranslate=De.translate,De.__originalTransform=De.transform,De.__originalSetTransform=De.setTransform,De.__originalResetTransform=De.resetTransform,De.__originalClip=De.clip,De.__originalMoveTo=De.moveTo,De.__originalLineTo=De.lineTo,De.__originalBezierCurveTo=De.bezierCurveTo,De.__originalRect=De.rect,De.__originalClosePath=De.closePath,De.__originalBeginPath=De.beginPath,De._removeMirroring=()=>{De.save=De.__originalSave,De.restore=De.__originalRestore,De.rotate=De.__originalRotate,De.scale=De.__originalScale,De.translate=De.__originalTranslate,De.transform=De.__originalTransform,De.setTransform=De.__originalSetTransform,De.resetTransform=De.__originalResetTransform,De.clip=De.__originalClip,De.moveTo=De.__originalMoveTo,De.lineTo=De.__originalLineTo,De.bezierCurveTo=De.__originalBezierCurveTo,De.rect=De.__originalRect,De.closePath=De.__originalClosePath,De.beginPath=De.__originalBeginPath,delete De._removeMirroring},De.save=function(){pe.save(),this.__originalSave()},De.restore=function(){pe.restore(),this.__originalRestore()},De.translate=function(ge,Ce){pe.translate(ge,Ce),this.__originalTranslate(ge,Ce)},De.scale=function(ge,Ce){pe.scale(ge,Ce),this.__originalScale(ge,Ce)},De.transform=function(ge,Ce,xe,Le,Be,He){pe.transform(ge,Ce,xe,Le,Be,He),this.__originalTransform(ge,Ce,xe,Le,Be,He)},De.setTransform=function(ge,Ce,xe,Le,Be,He){pe.setTransform(ge,Ce,xe,Le,Be,He),this.__originalSetTransform(ge,Ce,xe,Le,Be,He)},De.resetTransform=function(){pe.resetTransform(),this.__originalResetTransform()},De.rotate=function(ge){pe.rotate(ge),this.__originalRotate(ge)},De.clip=function(ge){pe.clip(ge),this.__originalClip(ge)},De.moveTo=function(be,ge){pe.moveTo(be,ge),this.__originalMoveTo(be,ge)},De.lineTo=function(be,ge){pe.lineTo(be,ge),this.__originalLineTo(be,ge)},De.bezierCurveTo=function(be,ge,Ce,xe,Le,Be){pe.bezierCurveTo(be,ge,Ce,xe,Le,Be),this.__originalBezierCurveTo(be,ge,Ce,xe,Le,Be)},De.rect=function(be,ge,Ce,xe){pe.rect(be,ge,Ce,xe),this.__originalRect(be,ge,Ce,xe)},De.closePath=function(){pe.closePath(),this.__originalClosePath()},De.beginPath=function(){pe.beginPath(),this.__originalBeginPath()}}class ve{constructor(pe){this.canvasFactory=pe,this.cache=Object.create(null)}getCanvas(pe,be,ge){let Ce;return this.cache[pe]!==void 0?(Ce=this.cache[pe],this.canvasFactory.reset(Ce,be,ge)):(Ce=this.canvasFactory.create(be,ge),this.cache[pe]=Ce),Ce}delete(pe){delete this.cache[pe]}clear(){for(const pe in this.cache){const be=this.cache[pe];this.canvasFactory.destroy(be),delete this.cache[pe]}}}function Se(De,pe,be,ge,Ce,xe,Le,Be,He,it){const[et,ot,ht,pt,ct,Pt]=(0,ie.getCurrentTransform)(De);if(ot===0&&ht===0){const kt=Le*et+ct,gt=Math.round(kt),tt=Be*pt+Pt,nt=Math.round(tt),ft=(Le+He)*et+ct,Tt=Math.abs(Math.round(ft)-gt)||1,Ct=(Be+it)*pt+Pt,Ht=Math.abs(Math.round(Ct)-nt)||1;return De.setTransform(Math.sign(et),0,0,Math.sign(pt),gt,nt),De.drawImage(pe,be,ge,Ce,xe,0,0,Tt,Ht),De.setTransform(et,ot,ht,pt,ct,Pt),[Tt,Ht]}if(et===0&&pt===0){const kt=Be*ht+ct,gt=Math.round(kt),tt=Le*ot+Pt,nt=Math.round(tt),ft=(Be+it)*ht+ct,Tt=Math.abs(Math.round(ft)-gt)||1,Ct=(Le+He)*ot+Pt,Ht=Math.abs(Math.round(Ct)-nt)||1;return De.setTransform(0,Math.sign(ot),Math.sign(ht),0,gt,nt),De.drawImage(pe,be,ge,Ce,xe,0,0,Ht,Tt),De.setTransform(et,ot,ht,pt,ct,Pt),[Ht,Tt]}De.drawImage(pe,be,ge,Ce,xe,Le,Be,He,it);const It=Math.hypot(et,ot),vt=Math.hypot(ht,pt);return[It*He,vt*it]}function Te(De){const{width:pe,height:be}=De;if(pe>Ae||be>Ae)return null;const ge=1e3,Ce=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),xe=pe+1;let Le=new Uint8Array(xe*(be+1)),Be,He,it;const et=pe+7&-8;let ot=new Uint8Array(et*be),ht=0;for(const vt of De.data){let kt=128;for(;kt>0;)ot[ht++]=vt&kt?0:255,kt>>=1}let pt=0;for(ht=0,ot[ht]!==0&&(Le[0]=1,++pt),He=1;He<pe;He++)ot[ht]!==ot[ht+1]&&(Le[He]=ot[ht]?2:1,++pt),ht++;for(ot[ht]!==0&&(Le[He]=2,++pt),Be=1;Be<be;Be++){ht=Be*et,it=Be*xe,ot[ht-et]!==ot[ht]&&(Le[it]=ot[ht]?1:8,++pt);let vt=(ot[ht]?4:0)+(ot[ht-et]?8:0);for(He=1;He<pe;He++)vt=(vt>>2)+(ot[ht+1]?4:0)+(ot[ht-et+1]?8:0),Ce[vt]&&(Le[it+He]=Ce[vt],++pt),ht++;if(ot[ht-et]!==ot[ht]&&(Le[it+He]=ot[ht]?2:4,++pt),pt>ge)return null}for(ht=et*(be-1),it=Be*xe,ot[ht]!==0&&(Le[it]=8,++pt),He=1;He<pe;He++)ot[ht]!==ot[ht+1]&&(Le[it+He]=ot[ht]?4:8,++pt),ht++;if(ot[ht]!==0&&(Le[it+He]=4,++pt),pt>ge)return null;const ct=new Int32Array([0,xe,-1,0,-xe,0,0,0,1]),Pt=new Path2D;for(Be=0;pt&&Be<=be;Be++){let vt=Be*xe;const kt=vt+pe;for(;vt<kt&&!Le[vt];)vt++;if(vt===kt)continue;Pt.moveTo(vt%xe,Be);const gt=vt;let tt=Le[vt];do{const nt=ct[tt];do vt+=nt;while(!Le[vt]);const ft=Le[vt];ft!==5&&ft!==10?(tt=ft,Le[vt]=0):(tt=ft&51*tt>>4,Le[vt]&=tt>>2|tt<<2),Pt.lineTo(vt%xe,vt/xe|0),Le[vt]||--pt}while(gt!==vt);--Be}return ot=null,Le=null,function(vt){vt.save(),vt.scale(1/pe,-1/be),vt.translate(0,-be),vt.fill(Pt),vt.beginPath(),vt.restore()}}class Pe{constructor(pe,be){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=re.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=re.FONT_IDENTITY_MATRIX,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=re.TextRenderingMode.FILL,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,pe,be])}clone(){const pe=Object.create(this);return pe.clipBox=this.clipBox.slice(),pe}setCurrentPoint(pe,be){this.x=pe,this.y=be}updatePathMinMax(pe,be,ge){[be,ge]=re.Util.applyTransform([be,ge],pe),this.minX=Math.min(this.minX,be),this.minY=Math.min(this.minY,ge),this.maxX=Math.max(this.maxX,be),this.maxY=Math.max(this.maxY,ge)}updateRectMinMax(pe,be){const ge=re.Util.applyTransform(be,pe),Ce=re.Util.applyTransform(be.slice(2),pe);this.minX=Math.min(this.minX,ge[0],Ce[0]),this.minY=Math.min(this.minY,ge[1],Ce[1]),this.maxX=Math.max(this.maxX,ge[0],Ce[0]),this.maxY=Math.max(this.maxY,ge[1],Ce[1])}updateScalingPathMinMax(pe,be){re.Util.scaleMinMax(pe,be),this.minX=Math.min(this.minX,be[0]),this.maxX=Math.max(this.maxX,be[1]),this.minY=Math.min(this.minY,be[2]),this.maxY=Math.max(this.maxY,be[3])}updateCurvePathMinMax(pe,be,ge,Ce,xe,Le,Be,He,it,et){const ot=re.Util.bezierBoundingBox(be,ge,Ce,xe,Le,Be,He,it);if(et){et[0]=Math.min(et[0],ot[0],ot[2]),et[1]=Math.max(et[1],ot[0],ot[2]),et[2]=Math.min(et[2],ot[1],ot[3]),et[3]=Math.max(et[3],ot[1],ot[3]);return}this.updateRectMinMax(pe,ot)}getPathBoundingBox(pe=se.PathType.FILL,be=null){const ge=[this.minX,this.minY,this.maxX,this.maxY];if(pe===se.PathType.STROKE){be||(0,re.unreachable)("Stroke bounding box must include transform.");const Ce=re.Util.singularValueDecompose2dScale(be),xe=Ce[0]*this.lineWidth/2,Le=Ce[1]*this.lineWidth/2;ge[0]-=xe,ge[1]-=Le,ge[2]+=xe,ge[3]+=Le}return ge}updateClipFromPath(){const pe=re.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(pe||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(pe){this.clipBox=pe,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(pe=se.PathType.FILL,be=null){return re.Util.intersect(this.clipBox,this.getPathBoundingBox(pe,be))}}function Re(De,pe){if(typeof ImageData<"u"&&pe instanceof ImageData){De.putImageData(pe,0,0);return}const be=pe.height,ge=pe.width,Ce=be%_e,xe=(be-Ce)/_e,Le=Ce===0?xe:xe+1,Be=De.createImageData(ge,_e);let He=0,it;const et=pe.data,ot=Be.data;let ht,pt,ct,Pt;if(pe.kind===re.ImageKind.GRAYSCALE_1BPP){const It=et.byteLength,vt=new Uint32Array(ot.buffer,0,ot.byteLength>>2),kt=vt.length,gt=ge+7>>3,tt=4294967295,nt=re.FeatureTest.isLittleEndian?4278190080:255;for(ht=0;ht<Le;ht++){for(ct=ht<xe?_e:Ce,it=0,pt=0;pt<ct;pt++){const ft=It-He;let Tt=0;const Ct=ft>gt?ge:ft*8-7,Ht=Ct&-8;let Wt=0,Ut=0;for(;Tt<Ht;Tt+=8)Ut=et[He++],vt[it++]=Ut&128?tt:nt,vt[it++]=Ut&64?tt:nt,vt[it++]=Ut&32?tt:nt,vt[it++]=Ut&16?tt:nt,vt[it++]=Ut&8?tt:nt,vt[it++]=Ut&4?tt:nt,vt[it++]=Ut&2?tt:nt,vt[it++]=Ut&1?tt:nt;for(;Tt<Ct;Tt++)Wt===0&&(Ut=et[He++],Wt=128),vt[it++]=Ut&Wt?tt:nt,Wt>>=1}for(;it<kt;)vt[it++]=0;De.putImageData(Be,0,ht*_e)}}else if(pe.kind===re.ImageKind.RGBA_32BPP){for(pt=0,Pt=ge*_e*4,ht=0;ht<xe;ht++)ot.set(et.subarray(He,He+Pt)),He+=Pt,De.putImageData(Be,0,pt),pt+=_e;ht<Le&&(Pt=ge*Ce*4,ot.set(et.subarray(He,He+Pt)),De.putImageData(Be,0,pt))}else if(pe.kind===re.ImageKind.RGB_24BPP)for(ct=_e,Pt=ge*ct,ht=0;ht<Le;ht++){for(ht>=xe&&(ct=Ce,Pt=ge*ct),it=0,pt=Pt;pt--;)ot[it++]=et[He++],ot[it++]=et[He++],ot[it++]=et[He++],ot[it++]=255;De.putImageData(Be,0,ht*_e)}else throw new Error("bad image kind: ".concat(pe.kind))}function $e(De,pe){if(pe.bitmap){De.drawImage(pe.bitmap,0,0);return}const be=pe.height,ge=pe.width,Ce=be%_e,xe=(be-Ce)/_e,Le=Ce===0?xe:xe+1,Be=De.createImageData(ge,_e);let He=0;const it=pe.data,et=Be.data;for(let ot=0;ot<Le;ot++){const ht=ot<xe?_e:Ce;({srcPos:He}=(0,oe.convertBlackAndWhiteToRGBA)({src:it,srcPos:He,dest:et,width:ge,height:ht,nonBlackColor:0})),De.putImageData(Be,0,ot*_e)}}function ye(De,pe){const be=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const ge of be)De[ge]!==void 0&&(pe[ge]=De[ge]);De.setLineDash!==void 0&&(pe.setLineDash(De.getLineDash()),pe.lineDashOffset=De.lineDashOffset)}function Ee(De){if(De.strokeStyle=De.fillStyle="#000000",De.fillRule="nonzero",De.globalAlpha=1,De.lineWidth=1,De.lineCap="butt",De.lineJoin="miter",De.miterLimit=10,De.globalCompositeOperation="source-over",De.font="10px sans-serif",De.setLineDash!==void 0&&(De.setLineDash([]),De.lineDashOffset=0),!re.isNodeJS){const{filter:pe}=De;pe!=="none"&&pe!==""&&(De.filter="none")}}function Ne(De,pe,be,ge){const Ce=De.length;for(let xe=3;xe<Ce;xe+=4){const Le=De[xe];if(Le===0)De[xe-3]=pe,De[xe-2]=be,De[xe-1]=ge;else if(Le<255){const Be=255-Le;De[xe-3]=De[xe-3]*Le+pe*Be>>8,De[xe-2]=De[xe-2]*Le+be*Be>>8,De[xe-1]=De[xe-1]*Le+ge*Be>>8}}}function Me(De,pe,be){const ge=De.length,Ce=1/255;for(let xe=3;xe<ge;xe+=4){const Le=be?be[De[xe]]:De[xe];pe[xe]=pe[xe]*Le*Ce|0}}function we(De,pe,be){const ge=De.length;for(let Ce=3;Ce<ge;Ce+=4){const xe=De[Ce-3]*77+De[Ce-2]*152+De[Ce-1]*28;pe[Ce]=be?pe[Ce]*be[xe>>8]>>8:pe[Ce]*xe>>16}}function Oe(De,pe,be,ge,Ce,xe,Le,Be,He,it,et){const ot=!!xe,ht=ot?xe[0]:0,pt=ot?xe[1]:0,ct=ot?xe[2]:0,Pt=Ce==="Luminosity"?we:Me,vt=Math.min(ge,Math.ceil(1048576/be));for(let kt=0;kt<ge;kt+=vt){const gt=Math.min(vt,ge-kt),tt=De.getImageData(Be-it,kt+(He-et),be,gt),nt=pe.getImageData(Be,kt+He,be,gt);ot&&Ne(tt.data,ht,pt,ct),Pt(tt.data,nt.data,Le),pe.putImageData(nt,Be,kt+He)}}function Fe(De,pe,be,ge){const Ce=ge[0],xe=ge[1],Le=ge[2]-Ce,Be=ge[3]-xe;Le===0||Be===0||(Oe(pe.context,be,Le,Be,pe.subtype,pe.backdrop,pe.transferMap,Ce,xe,pe.offsetX,pe.offsetY),De.save(),De.globalAlpha=1,De.globalCompositeOperation="source-over",De.setTransform(1,0,0,1,0,0),De.drawImage(be.canvas,0,0),De.restore())}function Ve(De,pe){const be=re.Util.singularValueDecompose2dScale(De);be[0]=Math.fround(be[0]),be[1]=Math.fround(be[1]);const ge=Math.fround((globalThis.devicePixelRatio||1)*ie.PixelsPerInch.PDF_TO_CSS_UNITS);return pe!==void 0?pe:be[0]<=ge||be[1]<=ge}const qe=["butt","round","square"],Ie=["miter","round","bevel"],Xe={},rt={},Et=class Et{constructor(pe,be,ge,Ce,xe,{optionalContentConfig:Le,markedContentStack:Be=null},He,it){We(this,Ge);We(this,mt);this.ctx=pe,this.current=new Pe(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=be,this.objs=ge,this.canvasFactory=Ce,this.filterFactory=xe,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=Be||[],this.optionalContentConfig=Le,this.cachedCanvases=new ve(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=He,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=it,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(pe,be=null){return typeof pe=="string"?pe.startsWith("g_")?this.commonObjs.get(pe):this.objs.get(pe):be}beginDrawing({transform:pe,viewport:be,transparency:ge=!1,background:Ce=null}){const xe=this.ctx.canvas.width,Le=this.ctx.canvas.height,Be=this.ctx.fillStyle;if(this.ctx.fillStyle=Ce||"#ffffff",this.ctx.fillRect(0,0,xe,Le),this.ctx.fillStyle=Be,ge){const He=this.cachedCanvases.getCanvas("transparent",xe,Le);this.compositeCtx=this.ctx,this.transparentCanvas=He.canvas,this.ctx=He.context,this.ctx.save(),this.ctx.transform(...(0,ie.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),Ee(this.ctx),pe&&(this.ctx.transform(...pe),this.outputScaleX=pe[0],this.outputScaleY=pe[0]),this.ctx.transform(...be.transform),this.viewportScale=be.scale,this.baseTransform=(0,ie.getCurrentTransform)(this.ctx)}executeOperatorList(pe,be,ge,Ce){const xe=pe.argsArray,Le=pe.fnArray;let Be=be||0;const He=xe.length;if(He===Be)return Be;const it=He-Be>le&&typeof ge=="function",et=it?Date.now()+ae:0;let ot=0;const ht=this.commonObjs,pt=this.objs;let ct;for(;;){if(Ce!==void 0&&Be===Ce.nextBreakPoint)return Ce.breakIt(Be,ge),Be;if(ct=Le[Be],ct!==re.OPS.dependency)this[ct].apply(this,xe[Be]);else for(const Pt of xe[Be]){const It=Pt.startsWith("g_")?ht:pt;if(!It.has(Pt))return It.get(Pt,ge),Be}if(Be++,Be===He)return Be;if(it&&++ot>le){if(Date.now()>et)return ge(),Be;ot=0}}}endDrawing(){Ke(this,Ge,vr).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const pe of this._cachedBitmapsMap.values()){for(const be of pe.values())typeof HTMLCanvasElement<"u"&&be instanceof HTMLCanvasElement&&(be.width=be.height=0);pe.clear()}this._cachedBitmapsMap.clear(),Ke(this,mt,wr).call(this)}_scaleImage(pe,be){const ge=pe.width,Ce=pe.height;let xe=Math.max(Math.hypot(be[0],be[1]),1),Le=Math.max(Math.hypot(be[2],be[3]),1),Be=ge,He=Ce,it="prescale1",et,ot;for(;xe>2&&Be>1||Le>2&&He>1;){let ht=Be,pt=He;xe>2&&Be>1&&(ht=Be>=16384?Math.floor(Be/2)-1||1:Math.ceil(Be/2),xe/=Be/ht),Le>2&&He>1&&(pt=He>=16384?Math.floor(He/2)-1||1:Math.ceil(He)/2,Le/=He/pt),et=this.cachedCanvases.getCanvas(it,ht,pt),ot=et.context,ot.clearRect(0,0,ht,pt),ot.drawImage(pe,0,0,Be,He,0,0,ht,pt),pe=et.canvas,Be=ht,He=pt,it=it==="prescale1"?"prescale2":"prescale1"}return{img:pe,paintWidth:Be,paintHeight:He}}_createMaskCanvas(pe){const be=this.ctx,{width:ge,height:Ce}=pe,xe=this.current.fillColor,Le=this.current.patternFill,Be=(0,ie.getCurrentTransform)(be);let He,it,et,ot;if((pe.bitmap||pe.data)&&pe.count>1){const Tt=pe.bitmap||pe.data.buffer;it=JSON.stringify(Le?Be:[Be.slice(0,4),xe]),He=this._cachedBitmapsMap.get(Tt),He||(He=new Map,this._cachedBitmapsMap.set(Tt,He));const Ct=He.get(it);if(Ct&&!Le){const Ht=Math.round(Math.min(Be[0],Be[2])+Be[4]),Wt=Math.round(Math.min(Be[1],Be[3])+Be[5]);return{canvas:Ct,offsetX:Ht,offsetY:Wt}}et=Ct}et||(ot=this.cachedCanvases.getCanvas("maskCanvas",ge,Ce),$e(ot.context,pe));let ht=re.Util.transform(Be,[1/ge,0,0,-1/Ce,0,0]);ht=re.Util.transform(ht,[1,0,0,1,0,-Ce]);const pt=re.Util.applyTransform([0,0],ht),ct=re.Util.applyTransform([ge,Ce],ht),Pt=re.Util.normalizeRect([pt[0],pt[1],ct[0],ct[1]]),It=Math.round(Pt[2]-Pt[0])||1,vt=Math.round(Pt[3]-Pt[1])||1,kt=this.cachedCanvases.getCanvas("fillCanvas",It,vt),gt=kt.context,tt=Math.min(pt[0],ct[0]),nt=Math.min(pt[1],ct[1]);gt.translate(-tt,-nt),gt.transform(...ht),et||(et=this._scaleImage(ot.canvas,(0,ie.getCurrentTransformInverse)(gt)),et=et.img,He&&Le&&He.set(it,et)),gt.imageSmoothingEnabled=Ve((0,ie.getCurrentTransform)(gt),pe.interpolate),Se(gt,et,0,0,et.width,et.height,0,0,ge,Ce),gt.globalCompositeOperation="source-in";const ft=re.Util.transform((0,ie.getCurrentTransformInverse)(gt),[1,0,0,1,-tt,-nt]);return gt.fillStyle=Le?xe.getPattern(be,this,ft,se.PathType.FILL):xe,gt.fillRect(0,0,ge,Ce),He&&!Le&&(this.cachedCanvases.delete("fillCanvas"),He.set(it,kt.canvas)),{canvas:kt.canvas,offsetX:Math.round(tt),offsetY:Math.round(nt)}}setLineWidth(pe){pe!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=pe,this.ctx.lineWidth=pe}setLineCap(pe){this.ctx.lineCap=qe[pe]}setLineJoin(pe){this.ctx.lineJoin=Ie[pe]}setMiterLimit(pe){this.ctx.miterLimit=pe}setDash(pe,be){const ge=this.ctx;ge.setLineDash!==void 0&&(ge.setLineDash(pe),ge.lineDashOffset=be)}setRenderingIntent(pe){}setFlatness(pe){}setGState(pe){for(const[be,ge]of pe)switch(be){case"LW":this.setLineWidth(ge);break;case"LC":this.setLineCap(ge);break;case"LJ":this.setLineJoin(ge);break;case"ML":this.setMiterLimit(ge);break;case"D":this.setDash(ge[0],ge[1]);break;case"RI":this.setRenderingIntent(ge);break;case"FL":this.setFlatness(ge);break;case"Font":this.setFont(ge[0],ge[1]);break;case"CA":this.current.strokeAlpha=ge;break;case"ca":this.current.fillAlpha=ge,this.ctx.globalAlpha=ge;break;case"BM":this.ctx.globalCompositeOperation=ge;break;case"SMask":this.current.activeSMask=ge?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(ge);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const pe=this.inSMaskMode;this.current.activeSMask&&!pe?this.beginSMaskMode():!this.current.activeSMask&&pe&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const pe=this.ctx.canvas.width,be=this.ctx.canvas.height,ge="smaskGroupAt"+this.groupLevel,Ce=this.cachedCanvases.getCanvas(ge,pe,be);this.suspendedCtx=this.ctx,this.ctx=Ce.context;const xe=this.ctx;xe.setTransform(...(0,ie.getCurrentTransform)(this.suspendedCtx)),ye(this.suspendedCtx,xe),me(xe,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(),ye(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(pe){if(!this.current.activeSMask)return;pe?(pe[0]=Math.floor(pe[0]),pe[1]=Math.floor(pe[1]),pe[2]=Math.ceil(pe[2]),pe[3]=Math.ceil(pe[3])):pe=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const be=this.current.activeSMask,ge=this.suspendedCtx;Fe(ge,be,this.ctx,pe),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()}save(){this.inSMaskMode?(ye(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const pe=this.current;this.stateStack.push(pe),this.current=pe.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),ye(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(pe,be,ge,Ce,xe,Le){this.ctx.transform(pe,be,ge,Ce,xe,Le),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(pe,be,ge){const Ce=this.ctx,xe=this.current;let Le=xe.x,Be=xe.y,He,it;const et=(0,ie.getCurrentTransform)(Ce),ot=et[0]===0&&et[3]===0||et[1]===0&&et[2]===0,ht=ot?ge.slice(0):null;for(let pt=0,ct=0,Pt=pe.length;pt<Pt;pt++)switch(pe[pt]|0){case re.OPS.rectangle:Le=be[ct++],Be=be[ct++];const It=be[ct++],vt=be[ct++],kt=Le+It,gt=Be+vt;Ce.moveTo(Le,Be),It===0||vt===0?Ce.lineTo(kt,gt):(Ce.lineTo(kt,Be),Ce.lineTo(kt,gt),Ce.lineTo(Le,gt)),ot||xe.updateRectMinMax(et,[Le,Be,kt,gt]),Ce.closePath();break;case re.OPS.moveTo:Le=be[ct++],Be=be[ct++],Ce.moveTo(Le,Be),ot||xe.updatePathMinMax(et,Le,Be);break;case re.OPS.lineTo:Le=be[ct++],Be=be[ct++],Ce.lineTo(Le,Be),ot||xe.updatePathMinMax(et,Le,Be);break;case re.OPS.curveTo:He=Le,it=Be,Le=be[ct+4],Be=be[ct+5],Ce.bezierCurveTo(be[ct],be[ct+1],be[ct+2],be[ct+3],Le,Be),xe.updateCurvePathMinMax(et,He,it,be[ct],be[ct+1],be[ct+2],be[ct+3],Le,Be,ht),ct+=6;break;case re.OPS.curveTo2:He=Le,it=Be,Ce.bezierCurveTo(Le,Be,be[ct],be[ct+1],be[ct+2],be[ct+3]),xe.updateCurvePathMinMax(et,He,it,Le,Be,be[ct],be[ct+1],be[ct+2],be[ct+3],ht),Le=be[ct+2],Be=be[ct+3],ct+=4;break;case re.OPS.curveTo3:He=Le,it=Be,Le=be[ct+2],Be=be[ct+3],Ce.bezierCurveTo(be[ct],be[ct+1],Le,Be,Le,Be),xe.updateCurvePathMinMax(et,He,it,be[ct],be[ct+1],Le,Be,Le,Be,ht),ct+=4;break;case re.OPS.closePath:Ce.closePath();break}ot&&xe.updateScalingPathMinMax(et,ht),xe.setCurrentPoint(Le,Be)}closePath(){this.ctx.closePath()}stroke(pe=!0){const be=this.ctx,ge=this.current.strokeColor;be.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof ge=="object"&&(ge!=null&&ge.getPattern)?(be.save(),be.strokeStyle=ge.getPattern(be,this,(0,ie.getCurrentTransformInverse)(be),se.PathType.STROKE),this.rescaleAndStroke(!1),be.restore()):this.rescaleAndStroke(!0)),pe&&this.consumePath(this.current.getClippedPathBoundingBox()),be.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(pe=!0){const be=this.ctx,ge=this.current.fillColor,Ce=this.current.patternFill;let xe=!1;Ce&&(be.save(),be.fillStyle=ge.getPattern(be,this,(0,ie.getCurrentTransformInverse)(be),se.PathType.FILL),xe=!0);const Le=this.current.getClippedPathBoundingBox();this.contentVisible&&Le!==null&&(this.pendingEOFill?(be.fill("evenodd"),this.pendingEOFill=!1):be.fill()),xe&&be.restore(),pe&&this.consumePath(Le)}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=Xe}eoClip(){this.pendingClip=rt}beginText(){this.current.textMatrix=re.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const pe=this.pendingTextPaths,be=this.ctx;if(pe===void 0){be.beginPath();return}be.save(),be.beginPath();for(const ge of pe)be.setTransform(...ge.transform),be.translate(ge.x,ge.y),ge.addToPath(be,ge.fontSize);be.restore(),be.clip(),be.beginPath(),delete this.pendingTextPaths}setCharSpacing(pe){this.current.charSpacing=pe}setWordSpacing(pe){this.current.wordSpacing=pe}setHScale(pe){this.current.textHScale=pe/100}setLeading(pe){this.current.leading=-pe}setFont(pe,be){var et;const ge=this.commonObjs.get(pe),Ce=this.current;if(!ge)throw new Error("Can't find font for ".concat(pe));if(Ce.fontMatrix=ge.fontMatrix||re.FONT_IDENTITY_MATRIX,(Ce.fontMatrix[0]===0||Ce.fontMatrix[3]===0)&&(0,re.warn)("Invalid font matrix for font "+pe),be<0?(be=-be,Ce.fontDirection=-1):Ce.fontDirection=1,this.current.font=ge,this.current.fontSize=be,ge.isType3Font)return;const xe=ge.loadedName||"sans-serif",Le=((et=ge.systemFontInfo)==null?void 0:et.css)||'"'.concat(xe,'", ').concat(ge.fallbackName);let Be="normal";ge.black?Be="900":ge.bold&&(Be="bold");const He=ge.italic?"italic":"normal";let it=be;be<he?it=he:be>ue&&(it=ue),this.current.fontSizeScale=be/it,this.ctx.font="".concat(He," ").concat(Be," ").concat(it,"px ").concat(Le)}setTextRenderingMode(pe){this.current.textRenderingMode=pe}setTextRise(pe){this.current.textRise=pe}moveText(pe,be){this.current.x=this.current.lineX+=pe,this.current.y=this.current.lineY+=be}setLeadingMoveText(pe,be){this.setLeading(-be),this.moveText(pe,be)}setTextMatrix(pe,be,ge,Ce,xe,Le){this.current.textMatrix=[pe,be,ge,Ce,xe,Le],this.current.textMatrixScale=Math.hypot(pe,be),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(pe,be,ge,Ce){const xe=this.ctx,Le=this.current,Be=Le.font,He=Le.textRenderingMode,it=Le.fontSize/Le.fontSizeScale,et=He&re.TextRenderingMode.FILL_STROKE_MASK,ot=!!(He&re.TextRenderingMode.ADD_TO_PATH_FLAG),ht=Le.patternFill&&!Be.missingFile;let pt;(Be.disableFontFace||ot||ht)&&(pt=Be.getPathGenerator(this.commonObjs,pe)),Be.disableFontFace||ht?(xe.save(),xe.translate(be,ge),xe.beginPath(),pt(xe,it),Ce&&xe.setTransform(...Ce),(et===re.TextRenderingMode.FILL||et===re.TextRenderingMode.FILL_STROKE)&&xe.fill(),(et===re.TextRenderingMode.STROKE||et===re.TextRenderingMode.FILL_STROKE)&&xe.stroke(),xe.restore()):((et===re.TextRenderingMode.FILL||et===re.TextRenderingMode.FILL_STROKE)&&xe.fillText(pe,be,ge),(et===re.TextRenderingMode.STROKE||et===re.TextRenderingMode.FILL_STROKE)&&xe.strokeText(pe,be,ge)),ot&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,ie.getCurrentTransform)(xe),x:be,y:ge,fontSize:it,addToPath:pt})}get isFontSubpixelAAEnabled(){const{context:pe}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);pe.scale(1.5,1),pe.fillText("I",0,10);const be=pe.getImageData(0,0,10,10).data;let ge=!1;for(let Ce=3;Ce<be.length;Ce+=4)if(be[Ce]>0&&be[Ce]<255){ge=!0;break}return(0,re.shadow)(this,"isFontSubpixelAAEnabled",ge)}showText(pe){const be=this.current,ge=be.font;if(ge.isType3Font)return this.showType3Text(pe);const Ce=be.fontSize;if(Ce===0)return;const xe=this.ctx,Le=be.fontSizeScale,Be=be.charSpacing,He=be.wordSpacing,it=be.fontDirection,et=be.textHScale*it,ot=pe.length,ht=ge.vertical,pt=ht?1:-1,ct=ge.defaultVMetrics,Pt=Ce*be.fontMatrix[0],It=be.textRenderingMode===re.TextRenderingMode.FILL&&!ge.disableFontFace&&!be.patternFill;xe.save(),xe.transform(...be.textMatrix),xe.translate(be.x,be.y+be.textRise),it>0?xe.scale(et,-1):xe.scale(et,1);let vt;if(be.patternFill){xe.save();const ft=be.fillColor.getPattern(xe,this,(0,ie.getCurrentTransformInverse)(xe),se.PathType.FILL);vt=(0,ie.getCurrentTransform)(xe),xe.restore(),xe.fillStyle=ft}let kt=be.lineWidth;const gt=be.textMatrixScale;if(gt===0||kt===0){const ft=be.textRenderingMode&re.TextRenderingMode.FILL_STROKE_MASK;(ft===re.TextRenderingMode.STROKE||ft===re.TextRenderingMode.FILL_STROKE)&&(kt=this.getSinglePixelWidth())}else kt/=gt;if(Le!==1&&(xe.scale(Le,Le),kt/=Le),xe.lineWidth=kt,ge.isInvalidPDFjsFont){const ft=[];let Tt=0;for(const Ct of pe)ft.push(Ct.unicode),Tt+=Ct.width;xe.fillText(ft.join(""),0,0),be.x+=Tt*Pt*et,xe.restore(),this.compose();return}let tt=0,nt;for(nt=0;nt<ot;++nt){const ft=pe[nt];if(typeof ft=="number"){tt+=pt*ft*Ce/1e3;continue}let Tt=!1;const Ct=(ft.isSpace?He:0)+Be,Ht=ft.fontChar,Wt=ft.accent;let Ut,zt,Vt=ft.width;if(ht){const Gt=ft.vmetric||ct,dt=-(ft.vmetric?Gt[1]:Vt*.5)*Pt,Qe=Gt[2]*Pt;Vt=Gt?-Gt[0]:Vt,Ut=dt/Le,zt=(tt+Qe)/Le}else Ut=tt/Le,zt=0;if(ge.remeasure&&Vt>0){const Gt=xe.measureText(Ht).width*1e3/Ce*Le;if(Vt<Gt&&this.isFontSubpixelAAEnabled){const dt=Vt/Gt;Tt=!0,xe.save(),xe.scale(dt,1),Ut/=dt}else Vt!==Gt&&(Ut+=(Vt-Gt)/2e3*Ce/Le)}if(this.contentVisible&&(ft.isInFont||ge.missingFile)){if(It&&!Wt)xe.fillText(Ht,Ut,zt);else if(this.paintChar(Ht,Ut,zt,vt),Wt){const Gt=Ut+Ce*Wt.offset.x/Le,dt=zt-Ce*Wt.offset.y/Le;this.paintChar(Wt.fontChar,Gt,dt,vt)}}const jt=ht?Vt*Pt-Ct*it:Vt*Pt+Ct*it;tt+=jt,Tt&&xe.restore()}ht?be.y-=tt:be.x+=tt*et,xe.restore(),this.compose()}showType3Text(pe){const be=this.ctx,ge=this.current,Ce=ge.font,xe=ge.fontSize,Le=ge.fontDirection,Be=Ce.vertical?1:-1,He=ge.charSpacing,it=ge.wordSpacing,et=ge.textHScale*Le,ot=ge.fontMatrix||re.FONT_IDENTITY_MATRIX,ht=pe.length,pt=ge.textRenderingMode===re.TextRenderingMode.INVISIBLE;let ct,Pt,It,vt;if(!(pt||xe===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,be.save(),be.transform(...ge.textMatrix),be.translate(ge.x,ge.y),be.scale(et,Le),ct=0;ct<ht;++ct){if(Pt=pe[ct],typeof Pt=="number"){vt=Be*Pt*xe/1e3,this.ctx.translate(vt,0),ge.x+=vt*et;continue}const kt=(Pt.isSpace?it:0)+He,gt=Ce.charProcOperatorList[Pt.operatorListId];if(!gt){(0,re.warn)('Type3 character "'.concat(Pt.operatorListId,'" is not available.'));continue}this.contentVisible&&(this.processingType3=Pt,this.save(),be.scale(xe,xe),be.transform(...ot),this.executeOperatorList(gt),this.restore()),It=re.Util.applyTransform([Pt.width,0],ot)[0]*xe+kt,be.translate(It,0),ge.x+=It*et}be.restore(),this.processingType3=null}}setCharWidth(pe,be){}setCharWidthAndBounds(pe,be,ge,Ce,xe,Le){this.ctx.rect(ge,Ce,xe-ge,Le-Ce),this.ctx.clip(),this.endPath()}getColorN_Pattern(pe){let be;if(pe[0]==="TilingPattern"){const ge=pe[1],Ce=this.baseTransform||(0,ie.getCurrentTransform)(this.ctx),xe={createCanvasGraphics:Le=>new Et(Le,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};be=new se.TilingPattern(pe,ge,this.ctx,xe,Ce)}else be=this._getPattern(pe[1],pe[2]);return be}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(pe,be,ge){const Ce=re.Util.makeHexColor(pe,be,ge);this.ctx.strokeStyle=Ce,this.current.strokeColor=Ce}setFillRGBColor(pe,be,ge){const Ce=re.Util.makeHexColor(pe,be,ge);this.ctx.fillStyle=Ce,this.current.fillColor=Ce,this.current.patternFill=!1}_getPattern(pe,be=null){let ge;return this.cachedPatterns.has(pe)?ge=this.cachedPatterns.get(pe):(ge=(0,se.getShadingPattern)(this.getObject(pe)),this.cachedPatterns.set(pe,ge)),be&&(ge.matrix=be),ge}shadingFill(pe){if(!this.contentVisible)return;const be=this.ctx;this.save();const ge=this._getPattern(pe);be.fillStyle=ge.getPattern(be,this,(0,ie.getCurrentTransformInverse)(be),se.PathType.SHADING);const Ce=(0,ie.getCurrentTransformInverse)(be);if(Ce){const{width:xe,height:Le}=be.canvas,[Be,He,it,et]=re.Util.getAxialAlignedBoundingBox([0,0,xe,Le],Ce);this.ctx.fillRect(Be,He,it-Be,et-He)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,re.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,re.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(pe,be){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(pe)&&pe.length===6&&this.transform(...pe),this.baseTransform=(0,ie.getCurrentTransform)(this.ctx),be)){const ge=be[2]-be[0],Ce=be[3]-be[1];this.ctx.rect(be[0],be[1],ge,Ce),this.current.updateRectMinMax((0,ie.getCurrentTransform)(this.ctx),be),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(pe){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const be=this.ctx;pe.isolated||(0,re.info)("TODO: Support non-isolated groups."),pe.knockout&&(0,re.warn)("Knockout groups not supported.");const ge=(0,ie.getCurrentTransform)(be);if(pe.matrix&&be.transform(...pe.matrix),!pe.bbox)throw new Error("Bounding box is required.");let Ce=re.Util.getAxialAlignedBoundingBox(pe.bbox,(0,ie.getCurrentTransform)(be));const xe=[0,0,be.canvas.width,be.canvas.height];Ce=re.Util.intersect(Ce,xe)||[0,0,0,0];const Le=Math.floor(Ce[0]),Be=Math.floor(Ce[1]);let He=Math.max(Math.ceil(Ce[2])-Le,1),it=Math.max(Math.ceil(Ce[3])-Be,1),et=1,ot=1;He>de&&(et=He/de,He=de),it>de&&(ot=it/de,it=de),this.current.startNewPathAndClipBox([0,0,He,it]);let ht="groupAt"+this.groupLevel;pe.smask&&(ht+="_smask_"+this.smaskCounter++%2);const pt=this.cachedCanvases.getCanvas(ht,He,it),ct=pt.context;ct.scale(1/et,1/ot),ct.translate(-Le,-Be),ct.transform(...ge),pe.smask?this.smaskStack.push({canvas:pt.canvas,context:ct,offsetX:Le,offsetY:Be,scaleX:et,scaleY:ot,subtype:pe.smask.subtype,backdrop:pe.smask.backdrop,transferMap:pe.smask.transferMap||null,startTransformInverse:null}):(be.setTransform(1,0,0,1,0,0),be.translate(Le,Be),be.scale(et,ot),be.save()),ye(be,ct),this.ctx=ct,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(be),this.groupLevel++}endGroup(pe){if(!this.contentVisible)return;this.groupLevel--;const be=this.ctx,ge=this.groupStack.pop();if(this.ctx=ge,this.ctx.imageSmoothingEnabled=!1,pe.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const Ce=(0,ie.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...Ce);const xe=re.Util.getAxialAlignedBoundingBox([0,0,be.canvas.width,be.canvas.height],Ce);this.ctx.drawImage(be.canvas,0,0),this.ctx.restore(),this.compose(xe)}}beginAnnotation(pe,be,ge,Ce,xe){if(Ke(this,Ge,vr).call(this),Ee(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(be)&&be.length===4){const Le=be[2]-be[0],Be=be[3]-be[1];if(xe&&this.annotationCanvasMap){ge=ge.slice(),ge[4]-=be[0],ge[5]-=be[1],be=be.slice(),be[0]=be[1]=0,be[2]=Le,be[3]=Be;const[He,it]=re.Util.singularValueDecompose2dScale((0,ie.getCurrentTransform)(this.ctx)),{viewportScale:et}=this,ot=Math.ceil(Le*this.outputScaleX*et),ht=Math.ceil(Be*this.outputScaleY*et);this.annotationCanvas=this.canvasFactory.create(ot,ht);const{canvas:pt,context:ct}=this.annotationCanvas;this.annotationCanvasMap.set(pe,pt),this.annotationCanvas.savedCtx=this.ctx,this.ctx=ct,this.ctx.save(),this.ctx.setTransform(He,0,0,-it,0,Be*it),Ee(this.ctx)}else Ee(this.ctx),this.ctx.rect(be[0],be[1],Le,Be),this.ctx.clip(),this.endPath()}this.current=new Pe(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...ge),this.transform(...Ce)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),Ke(this,mt,wr).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(pe){if(!this.contentVisible)return;const be=pe.count;pe=this.getObject(pe.data,pe),pe.count=be;const ge=this.ctx,Ce=this.processingType3;if(Ce&&(Ce.compiled===void 0&&(Ce.compiled=Te(pe)),Ce.compiled)){Ce.compiled(ge);return}const xe=this._createMaskCanvas(pe),Le=xe.canvas;ge.save(),ge.setTransform(1,0,0,1,0,0),ge.drawImage(Le,xe.offsetX,xe.offsetY),ge.restore(),this.compose()}paintImageMaskXObjectRepeat(pe,be,ge=0,Ce=0,xe,Le){if(!this.contentVisible)return;pe=this.getObject(pe.data,pe);const Be=this.ctx;Be.save();const He=(0,ie.getCurrentTransform)(Be);Be.transform(be,ge,Ce,xe,0,0);const it=this._createMaskCanvas(pe);Be.setTransform(1,0,0,1,it.offsetX-He[4],it.offsetY-He[5]);for(let et=0,ot=Le.length;et<ot;et+=2){const ht=re.Util.transform(He,[be,ge,Ce,xe,Le[et],Le[et+1]]),[pt,ct]=re.Util.applyTransform([0,0],ht);Be.drawImage(it.canvas,pt,ct)}Be.restore(),this.compose()}paintImageMaskXObjectGroup(pe){if(!this.contentVisible)return;const be=this.ctx,ge=this.current.fillColor,Ce=this.current.patternFill;for(const xe of pe){const{data:Le,width:Be,height:He,transform:it}=xe,et=this.cachedCanvases.getCanvas("maskCanvas",Be,He),ot=et.context;ot.save();const ht=this.getObject(Le,xe);$e(ot,ht),ot.globalCompositeOperation="source-in",ot.fillStyle=Ce?ge.getPattern(ot,this,(0,ie.getCurrentTransformInverse)(be),se.PathType.FILL):ge,ot.fillRect(0,0,Be,He),ot.restore(),be.save(),be.transform(...it),be.scale(1,-1),Se(be,et.canvas,0,0,Be,He,0,-1,1,1),be.restore()}this.compose()}paintImageXObject(pe){if(!this.contentVisible)return;const be=this.getObject(pe);if(!be){(0,re.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(be)}paintImageXObjectRepeat(pe,be,ge,Ce){if(!this.contentVisible)return;const xe=this.getObject(pe);if(!xe){(0,re.warn)("Dependent image isn't ready yet");return}const Le=xe.width,Be=xe.height,He=[];for(let it=0,et=Ce.length;it<et;it+=2)He.push({transform:[be,0,0,ge,Ce[it],Ce[it+1]],x:0,y:0,w:Le,h:Be});this.paintInlineImageXObjectGroup(xe,He)}applyTransferMapsToCanvas(pe){return this.current.transferMaps!=="none"&&(pe.filter=this.current.transferMaps,pe.drawImage(pe.canvas,0,0),pe.filter="none"),pe.canvas}applyTransferMapsToBitmap(pe){if(this.current.transferMaps==="none")return pe.bitmap;const{bitmap:be,width:ge,height:Ce}=pe,xe=this.cachedCanvases.getCanvas("inlineImage",ge,Ce),Le=xe.context;return Le.filter=this.current.transferMaps,Le.drawImage(be,0,0),Le.filter="none",xe.canvas}paintInlineImageXObject(pe){if(!this.contentVisible)return;const be=pe.width,ge=pe.height,Ce=this.ctx;if(this.save(),!re.isNodeJS){const{filter:Be}=Ce;Be!=="none"&&Be!==""&&(Ce.filter="none")}Ce.scale(1/be,-1/ge);let xe;if(pe.bitmap)xe=this.applyTransferMapsToBitmap(pe);else if(typeof HTMLElement=="function"&&pe instanceof HTMLElement||!pe.data)xe=pe;else{const He=this.cachedCanvases.getCanvas("inlineImage",be,ge).context;Re(He,pe),xe=this.applyTransferMapsToCanvas(He)}const Le=this._scaleImage(xe,(0,ie.getCurrentTransformInverse)(Ce));Ce.imageSmoothingEnabled=Ve((0,ie.getCurrentTransform)(Ce),pe.interpolate),Se(Ce,Le.img,0,0,Le.paintWidth,Le.paintHeight,0,-ge,be,ge),this.compose(),this.restore()}paintInlineImageXObjectGroup(pe,be){if(!this.contentVisible)return;const ge=this.ctx;let Ce;if(pe.bitmap)Ce=pe.bitmap;else{const xe=pe.width,Le=pe.height,He=this.cachedCanvases.getCanvas("inlineImage",xe,Le).context;Re(He,pe),Ce=this.applyTransferMapsToCanvas(He)}for(const xe of be)ge.save(),ge.transform(...xe.transform),ge.scale(1,-1),Se(ge,Ce,xe.x,xe.y,xe.w,xe.h,0,-1,1,1),ge.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(pe){}markPointProps(pe,be){}beginMarkedContent(pe){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(pe,be){pe==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(be)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(pe){const be=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(pe);const ge=this.ctx;this.pendingClip&&(be||(this.pendingClip===rt?ge.clip("evenodd"):ge.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),ge.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const pe=(0,ie.getCurrentTransform)(this.ctx);if(pe[1]===0&&pe[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(pe[0]),Math.abs(pe[3]));else{const be=Math.abs(pe[0]*pe[3]-pe[2]*pe[1]),ge=Math.hypot(pe[0],pe[2]),Ce=Math.hypot(pe[1],pe[3]);this._cachedGetSinglePixelWidth=Math.max(ge,Ce)/be}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:pe}=this.current,{a:be,b:ge,c:Ce,d:xe}=this.ctx.getTransform();let Le,Be;if(ge===0&&Ce===0){const He=Math.abs(be),it=Math.abs(xe);if(He===it)if(pe===0)Le=Be=1/He;else{const et=He*pe;Le=Be=et<1?1/et:1}else if(pe===0)Le=1/He,Be=1/it;else{const et=He*pe,ot=it*pe;Le=et<1?1/et:1,Be=ot<1?1/ot:1}}else{const He=Math.abs(be*xe-ge*Ce),it=Math.hypot(be,ge),et=Math.hypot(Ce,xe);if(pe===0)Le=et/He,Be=it/He;else{const ot=pe*He;Le=et>ot?et/ot:1,Be=it>ot?it/ot:1}}this._cachedScaleForStroking[0]=Le,this._cachedScaleForStroking[1]=Be}return this._cachedScaleForStroking}rescaleAndStroke(pe){const{ctx:be}=this,{lineWidth:ge}=this.current,[Ce,xe]=this.getScaleForStroking();if(be.lineWidth=ge||1,Ce===1&&xe===1){be.stroke();return}const Le=be.getLineDash();if(pe&&be.save(),be.scale(Ce,xe),Le.length>0){const Be=Math.max(Ce,xe);be.setLineDash(Le.map(He=>He/Be)),be.lineDashOffset/=Be}be.stroke(),pe&&be.restore()}isContentVisible(){for(let pe=this.markedContentStack.length-1;pe>=0;pe--)if(!this.markedContentStack[pe].visible)return!1;return!0}};Ge=new WeakSet,vr=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},mt=new WeakSet,wr=function(){if(this.pageColors){const pe=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(pe!=="none"){const be=this.ctx.filter;this.ctx.filter=pe,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=be}}};let lt=Et;te.CanvasGraphics=lt;for(const De in re.OPS)lt.prototype[De]!==void 0&&(lt.prototype[re.OPS[De]]=lt.prototype[De])},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.TilingPattern=te.PathType=void 0,te.getShadingPattern=_e;var re=ne(1),ie=ne(6);const se={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};te.PathType=se;function oe(Te,Pe){if(!Pe)return;const Re=Pe[2]-Pe[0],$e=Pe[3]-Pe[1],ye=new Path2D;ye.rect(Pe[0],Pe[1],Re,$e),Te.clip(ye)}class he{constructor(){this.constructor===he&&(0,re.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,re.unreachable)("Abstract method `getPattern` called.")}}class ue extends he{constructor(Pe){super(),this._type=Pe[1],this._bbox=Pe[2],this._colorStops=Pe[3],this._p0=Pe[4],this._p1=Pe[5],this._r0=Pe[6],this._r1=Pe[7],this.matrix=null}_createGradient(Pe){let Re;this._type==="axial"?Re=Pe.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(Re=Pe.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const $e of this._colorStops)Re.addColorStop($e[0],$e[1]);return Re}getPattern(Pe,Re,$e,ye){let Ee;if(ye===se.STROKE||ye===se.FILL){const Ne=Re.current.getClippedPathBoundingBox(ye,(0,ie.getCurrentTransform)(Pe))||[0,0,0,0],Me=Math.ceil(Ne[2]-Ne[0])||1,we=Math.ceil(Ne[3]-Ne[1])||1,Oe=Re.cachedCanvases.getCanvas("pattern",Me,we,!0),Fe=Oe.context;Fe.clearRect(0,0,Fe.canvas.width,Fe.canvas.height),Fe.beginPath(),Fe.rect(0,0,Fe.canvas.width,Fe.canvas.height),Fe.translate(-Ne[0],-Ne[1]),$e=re.Util.transform($e,[1,0,0,1,Ne[0],Ne[1]]),Fe.transform(...Re.baseTransform),this.matrix&&Fe.transform(...this.matrix),oe(Fe,this._bbox),Fe.fillStyle=this._createGradient(Fe),Fe.fill(),Ee=Pe.createPattern(Oe.canvas,"no-repeat");const Ve=new DOMMatrix($e);Ee.setTransform(Ve)}else oe(Pe,this._bbox),Ee=this._createGradient(Pe);return Ee}}function de(Te,Pe,Re,$e,ye,Ee,Ne,Me){const we=Pe.coords,Oe=Pe.colors,Fe=Te.data,Ve=Te.width*4;let qe;we[Re+1]>we[$e+1]&&(qe=Re,Re=$e,$e=qe,qe=Ee,Ee=Ne,Ne=qe),we[$e+1]>we[ye+1]&&(qe=$e,$e=ye,ye=qe,qe=Ne,Ne=Me,Me=qe),we[Re+1]>we[$e+1]&&(qe=Re,Re=$e,$e=qe,qe=Ee,Ee=Ne,Ne=qe);const Ie=(we[Re]+Pe.offsetX)*Pe.scaleX,Xe=(we[Re+1]+Pe.offsetY)*Pe.scaleY,rt=(we[$e]+Pe.offsetX)*Pe.scaleX,lt=(we[$e+1]+Pe.offsetY)*Pe.scaleY,Ge=(we[ye]+Pe.offsetX)*Pe.scaleX,ut=(we[ye+1]+Pe.offsetY)*Pe.scaleY;if(Xe>=ut)return;const mt=Oe[Ee],wt=Oe[Ee+1],Et=Oe[Ee+2],De=Oe[Ne],pe=Oe[Ne+1],be=Oe[Ne+2],ge=Oe[Me],Ce=Oe[Me+1],xe=Oe[Me+2],Le=Math.round(Xe),Be=Math.round(ut);let He,it,et,ot,ht,pt,ct,Pt;for(let It=Le;It<=Be;It++){if(It<lt){const nt=It<Xe?0:(Xe-It)/(Xe-lt);He=Ie-(Ie-rt)*nt,it=mt-(mt-De)*nt,et=wt-(wt-pe)*nt,ot=Et-(Et-be)*nt}else{let nt;It>ut?nt=1:lt===ut?nt=0:nt=(lt-It)/(lt-ut),He=rt-(rt-Ge)*nt,it=De-(De-ge)*nt,et=pe-(pe-Ce)*nt,ot=be-(be-xe)*nt}let vt;It<Xe?vt=0:It>ut?vt=1:vt=(Xe-It)/(Xe-ut),ht=Ie-(Ie-Ge)*vt,pt=mt-(mt-ge)*vt,ct=wt-(wt-Ce)*vt,Pt=Et-(Et-xe)*vt;const kt=Math.round(Math.min(He,ht)),gt=Math.round(Math.max(He,ht));let tt=Ve*It+kt*4;for(let nt=kt;nt<=gt;nt++)vt=(He-nt)/(He-ht),vt<0?vt=0:vt>1&&(vt=1),Fe[tt++]=it-(it-pt)*vt|0,Fe[tt++]=et-(et-ct)*vt|0,Fe[tt++]=ot-(ot-Pt)*vt|0,Fe[tt++]=255}}function ae(Te,Pe,Re){const $e=Pe.coords,ye=Pe.colors;let Ee,Ne;switch(Pe.type){case"lattice":const Me=Pe.verticesPerRow,we=Math.floor($e.length/Me)-1,Oe=Me-1;for(Ee=0;Ee<we;Ee++){let Fe=Ee*Me;for(let Ve=0;Ve<Oe;Ve++,Fe++)de(Te,Re,$e[Fe],$e[Fe+1],$e[Fe+Me],ye[Fe],ye[Fe+1],ye[Fe+Me]),de(Te,Re,$e[Fe+Me+1],$e[Fe+1],$e[Fe+Me],ye[Fe+Me+1],ye[Fe+1],ye[Fe+Me])}break;case"triangles":for(Ee=0,Ne=$e.length;Ee<Ne;Ee+=3)de(Te,Re,$e[Ee],$e[Ee+1],$e[Ee+2],ye[Ee],ye[Ee+1],ye[Ee+2]);break;default:throw new Error("illegal figure")}}class le extends he{constructor(Pe){super(),this._coords=Pe[2],this._colors=Pe[3],this._figures=Pe[4],this._bounds=Pe[5],this._bbox=Pe[7],this._background=Pe[8],this.matrix=null}_createMeshCanvas(Pe,Re,$e){const Me=Math.floor(this._bounds[0]),we=Math.floor(this._bounds[1]),Oe=Math.ceil(this._bounds[2])-Me,Fe=Math.ceil(this._bounds[3])-we,Ve=Math.min(Math.ceil(Math.abs(Oe*Pe[0]*1.1)),3e3),qe=Math.min(Math.ceil(Math.abs(Fe*Pe[1]*1.1)),3e3),Ie=Oe/Ve,Xe=Fe/qe,rt={coords:this._coords,colors:this._colors,offsetX:-Me,offsetY:-we,scaleX:1/Ie,scaleY:1/Xe},lt=Ve+2*2,Ge=qe+2*2,ut=$e.getCanvas("mesh",lt,Ge,!1),mt=ut.context,wt=mt.createImageData(Ve,qe);if(Re){const De=wt.data;for(let pe=0,be=De.length;pe<be;pe+=4)De[pe]=Re[0],De[pe+1]=Re[1],De[pe+2]=Re[2],De[pe+3]=255}for(const De of this._figures)ae(wt,De,rt);return mt.putImageData(wt,2,2),{canvas:ut.canvas,offsetX:Me-2*Ie,offsetY:we-2*Xe,scaleX:Ie,scaleY:Xe}}getPattern(Pe,Re,$e,ye){oe(Pe,this._bbox);let Ee;if(ye===se.SHADING)Ee=re.Util.singularValueDecompose2dScale((0,ie.getCurrentTransform)(Pe));else if(Ee=re.Util.singularValueDecompose2dScale(Re.baseTransform),this.matrix){const Me=re.Util.singularValueDecompose2dScale(this.matrix);Ee=[Ee[0]*Me[0],Ee[1]*Me[1]]}const Ne=this._createMeshCanvas(Ee,ye===se.SHADING?null:this._background,Re.cachedCanvases);return ye!==se.SHADING&&(Pe.setTransform(...Re.baseTransform),this.matrix&&Pe.transform(...this.matrix)),Pe.translate(Ne.offsetX,Ne.offsetY),Pe.scale(Ne.scaleX,Ne.scaleY),Pe.createPattern(Ne.canvas,"no-repeat")}}class Ae extends he{getPattern(){return"hotpink"}}function _e(Te){switch(Te[0]){case"RadialAxial":return new ue(Te);case"Mesh":return new le(Te);case"Dummy":return new Ae}throw new Error("Unknown IR type: ".concat(Te[0]))}const me={COLORED:1,UNCOLORED:2},Se=class Se{constructor(Pe,Re,$e,ye,Ee){this.operatorList=Pe[2],this.matrix=Pe[3]||[1,0,0,1,0,0],this.bbox=Pe[4],this.xstep=Pe[5],this.ystep=Pe[6],this.paintType=Pe[7],this.tilingType=Pe[8],this.color=Re,this.ctx=$e,this.canvasGraphicsFactory=ye,this.baseTransform=Ee}createPatternCanvas(Pe){const Re=this.operatorList,$e=this.bbox,ye=this.xstep,Ee=this.ystep,Ne=this.paintType,Me=this.tilingType,we=this.color,Oe=this.canvasGraphicsFactory;(0,re.info)("TilingType: "+Me);const Fe=$e[0],Ve=$e[1],qe=$e[2],Ie=$e[3],Xe=re.Util.singularValueDecompose2dScale(this.matrix),rt=re.Util.singularValueDecompose2dScale(this.baseTransform),lt=[Xe[0]*rt[0],Xe[1]*rt[1]],Ge=this.getSizeAndScale(ye,this.ctx.canvas.width,lt[0]),ut=this.getSizeAndScale(Ee,this.ctx.canvas.height,lt[1]),mt=Pe.cachedCanvases.getCanvas("pattern",Ge.size,ut.size,!0),wt=mt.context,Et=Oe.createCanvasGraphics(wt);Et.groupLevel=Pe.groupLevel,this.setFillAndStrokeStyleToContext(Et,Ne,we);let De=Fe,pe=Ve,be=qe,ge=Ie;return Fe<0&&(De=0,be+=Math.abs(Fe)),Ve<0&&(pe=0,ge+=Math.abs(Ve)),wt.translate(-(Ge.scale*De),-(ut.scale*pe)),Et.transform(Ge.scale,0,0,ut.scale,0,0),wt.save(),this.clipBbox(Et,De,pe,be,ge),Et.baseTransform=(0,ie.getCurrentTransform)(Et.ctx),Et.executeOperatorList(Re),Et.endDrawing(),{canvas:mt.canvas,scaleX:Ge.scale,scaleY:ut.scale,offsetX:De,offsetY:pe}}getSizeAndScale(Pe,Re,$e){Pe=Math.abs(Pe);const ye=Math.max(Se.MAX_PATTERN_SIZE,Re);let Ee=Math.ceil(Pe*$e);return Ee>=ye?Ee=ye:$e=Ee/Pe,{scale:$e,size:Ee}}clipBbox(Pe,Re,$e,ye,Ee){const Ne=ye-Re,Me=Ee-$e;Pe.ctx.rect(Re,$e,Ne,Me),Pe.current.updateRectMinMax((0,ie.getCurrentTransform)(Pe.ctx),[Re,$e,ye,Ee]),Pe.clip(),Pe.endPath()}setFillAndStrokeStyleToContext(Pe,Re,$e){const ye=Pe.ctx,Ee=Pe.current;switch(Re){case me.COLORED:const Ne=this.ctx;ye.fillStyle=Ne.fillStyle,ye.strokeStyle=Ne.strokeStyle,Ee.fillColor=Ne.fillStyle,Ee.strokeColor=Ne.strokeStyle;break;case me.UNCOLORED:const Me=re.Util.makeHexColor($e[0],$e[1],$e[2]);ye.fillStyle=Me,ye.strokeStyle=Me,Ee.fillColor=Me,Ee.strokeColor=Me;break;default:throw new re.FormatError("Unsupported paint type: ".concat(Re))}}getPattern(Pe,Re,$e,ye){let Ee=$e;ye!==se.SHADING&&(Ee=re.Util.transform(Ee,Re.baseTransform),this.matrix&&(Ee=re.Util.transform(Ee,this.matrix)));const Ne=this.createPatternCanvas(Re);let Me=new DOMMatrix(Ee);Me=Me.translate(Ne.offsetX,Ne.offsetY),Me=Me.scale(1/Ne.scaleX,1/Ne.scaleY);const we=Pe.createPattern(Ne.canvas,"repeat");return we.setTransform(Me),we}};An(Se,"MAX_PATTERN_SIZE",3e3);let ve=Se;te.TilingPattern=ve},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.convertBlackAndWhiteToRGBA=se,te.convertToRGBA=ie,te.grayToRGBA=he;var re=ne(1);function ie(ue){switch(ue.kind){case re.ImageKind.GRAYSCALE_1BPP:return se(ue);case re.ImageKind.RGB_24BPP:return oe(ue)}return null}function se({src:ue,srcPos:de=0,dest:ae,width:le,height:Ae,nonBlackColor:_e=4294967295,inverseDecode:me=!1}){const ve=re.FeatureTest.isLittleEndian?4278190080:255,[Se,Te]=me?[_e,ve]:[ve,_e],Pe=le>>3,Re=le&7,$e=ue.length;ae=new Uint32Array(ae.buffer);let ye=0;for(let Ee=0;Ee<Ae;Ee++){for(const Me=de+Pe;de<Me;de++){const we=de<$e?ue[de]:255;ae[ye++]=we&128?Te:Se,ae[ye++]=we&64?Te:Se,ae[ye++]=we&32?Te:Se,ae[ye++]=we&16?Te:Se,ae[ye++]=we&8?Te:Se,ae[ye++]=we&4?Te:Se,ae[ye++]=we&2?Te:Se,ae[ye++]=we&1?Te:Se}if(Re===0)continue;const Ne=de<$e?ue[de++]:255;for(let Me=0;Me<Re;Me++)ae[ye++]=Ne&1<<7-Me?Te:Se}return{srcPos:de,destPos:ye}}function oe({src:ue,srcPos:de=0,dest:ae,destPos:le=0,width:Ae,height:_e}){let me=0;const ve=ue.length>>2,Se=new Uint32Array(ue.buffer,de,ve);if(re.FeatureTest.isLittleEndian){for(;me<ve-2;me+=3,le+=4){const Te=Se[me],Pe=Se[me+1],Re=Se[me+2];ae[le]=Te|4278190080,ae[le+1]=Te>>>24|Pe<<8|4278190080,ae[le+2]=Pe>>>16|Re<<16|4278190080,ae[le+3]=Re>>>8|4278190080}for(let Te=me*4,Pe=ue.length;Te<Pe;Te+=3)ae[le++]=ue[Te]|ue[Te+1]<<8|ue[Te+2]<<16|4278190080}else{for(;me<ve-2;me+=3,le+=4){const Te=Se[me],Pe=Se[me+1],Re=Se[me+2];ae[le]=Te|255,ae[le+1]=Te<<24|Pe>>>8|255,ae[le+2]=Pe<<16|Re>>>16|255,ae[le+3]=Re<<8|255}for(let Te=me*4,Pe=ue.length;Te<Pe;Te+=3)ae[le++]=ue[Te]<<24|ue[Te+1]<<16|ue[Te+2]<<8|255}return{srcPos:de,destPos:le}}function he(ue,de){if(re.FeatureTest.isLittleEndian)for(let ae=0,le=ue.length;ae<le;ae++)de[ae]=ue[ae]*65793|4278190080;else for(let ae=0,le=ue.length;ae<le;ae++)de[ae]=ue[ae]*16843008|255}},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.GlobalWorkerOptions=void 0;const ne=Object.create(null);te.GlobalWorkerOptions=ne,ne.workerPort=null,ne.workerSrc=""},(ee,te,ne)=>{var ue,Zr,ae,Jr,Ae,Zn;Object.defineProperty(te,"__esModule",{value:!0}),te.MessageHandler=void 0;var re=ne(1);const ie={UNKNOWN:0,DATA:1,ERROR:2},se={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function oe(me){switch(me instanceof Error||typeof me=="object"&&me!==null||(0,re.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),me.name){case"AbortException":return new re.AbortException(me.message);case"MissingPDFException":return new re.MissingPDFException(me.message);case"PasswordException":return new re.PasswordException(me.message,me.code);case"UnexpectedResponseException":return new re.UnexpectedResponseException(me.message,me.status);case"UnknownErrorException":return new re.UnknownErrorException(me.message,me.details);default:return new re.UnknownErrorException(me.message,me.toString())}}class he{constructor(ve,Se,Te){We(this,ue);We(this,ae);We(this,Ae);this.sourceName=ve,this.targetName=Se,this.comObj=Te,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=Pe=>{const Re=Pe.data;if(Re.targetName!==this.sourceName)return;if(Re.stream){Ke(this,ae,Jr).call(this,Re);return}if(Re.callback){const ye=Re.callbackId,Ee=this.callbackCapabilities[ye];if(!Ee)throw new Error("Cannot resolve callback ".concat(ye));if(delete this.callbackCapabilities[ye],Re.callback===ie.DATA)Ee.resolve(Re.data);else if(Re.callback===ie.ERROR)Ee.reject(oe(Re.reason));else throw new Error("Unexpected callback case");return}const $e=this.actionHandler[Re.action];if(!$e)throw new Error("Unknown action from worker: ".concat(Re.action));if(Re.callbackId){const ye=this.sourceName,Ee=Re.sourceName;new Promise(function(Ne){Ne($e(Re.data))}).then(function(Ne){Te.postMessage({sourceName:ye,targetName:Ee,callback:ie.DATA,callbackId:Re.callbackId,data:Ne})},function(Ne){Te.postMessage({sourceName:ye,targetName:Ee,callback:ie.ERROR,callbackId:Re.callbackId,reason:oe(Ne)})});return}if(Re.streamId){Ke(this,ue,Zr).call(this,Re);return}$e(Re.data)},Te.addEventListener("message",this._onComObjOnMessage)}on(ve,Se){const Te=this.actionHandler;if(Te[ve])throw new Error('There is already an actionName called "'.concat(ve,'"'));Te[ve]=Se}send(ve,Se,Te){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:ve,data:Se},Te)}sendWithPromise(ve,Se,Te){const Pe=this.callbackId++,Re=new re.PromiseCapability;this.callbackCapabilities[Pe]=Re;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:ve,callbackId:Pe,data:Se},Te)}catch($e){Re.reject($e)}return Re.promise}sendWithStream(ve,Se,Te,Pe){const Re=this.streamId++,$e=this.sourceName,ye=this.targetName,Ee=this.comObj;return new ReadableStream({start:Ne=>{const Me=new re.PromiseCapability;return this.streamControllers[Re]={controller:Ne,startCall:Me,pullCall:null,cancelCall:null,isClosed:!1},Ee.postMessage({sourceName:$e,targetName:ye,action:ve,streamId:Re,data:Se,desiredSize:Ne.desiredSize},Pe),Me.promise},pull:Ne=>{const Me=new re.PromiseCapability;return this.streamControllers[Re].pullCall=Me,Ee.postMessage({sourceName:$e,targetName:ye,stream:se.PULL,streamId:Re,desiredSize:Ne.desiredSize}),Me.promise},cancel:Ne=>{(0,re.assert)(Ne instanceof Error,"cancel must have a valid reason");const Me=new re.PromiseCapability;return this.streamControllers[Re].cancelCall=Me,this.streamControllers[Re].isClosed=!0,Ee.postMessage({sourceName:$e,targetName:ye,stream:se.CANCEL,streamId:Re,reason:oe(Ne)}),Me.promise}},Te)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}ue=new WeakSet,Zr=function(ve){const Se=ve.streamId,Te=this.sourceName,Pe=ve.sourceName,Re=this.comObj,$e=this,ye=this.actionHandler[ve.action],Ee={enqueue(Ne,Me=1,we){if(this.isCancelled)return;const Oe=this.desiredSize;this.desiredSize-=Me,Oe>0&&this.desiredSize<=0&&(this.sinkCapability=new re.PromiseCapability,this.ready=this.sinkCapability.promise),Re.postMessage({sourceName:Te,targetName:Pe,stream:se.ENQUEUE,streamId:Se,chunk:Ne},we)},close(){this.isCancelled||(this.isCancelled=!0,Re.postMessage({sourceName:Te,targetName:Pe,stream:se.CLOSE,streamId:Se}),delete $e.streamSinks[Se])},error(Ne){(0,re.assert)(Ne instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,Re.postMessage({sourceName:Te,targetName:Pe,stream:se.ERROR,streamId:Se,reason:oe(Ne)}))},sinkCapability:new re.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:ve.desiredSize,ready:null};Ee.sinkCapability.resolve(),Ee.ready=Ee.sinkCapability.promise,this.streamSinks[Se]=Ee,new Promise(function(Ne){Ne(ye(ve.data,Ee))}).then(function(){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.START_COMPLETE,streamId:Se,success:!0})},function(Ne){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.START_COMPLETE,streamId:Se,reason:oe(Ne)})})},ae=new WeakSet,Jr=function(ve){const Se=ve.streamId,Te=this.sourceName,Pe=ve.sourceName,Re=this.comObj,$e=this.streamControllers[Se],ye=this.streamSinks[Se];switch(ve.stream){case se.START_COMPLETE:ve.success?$e.startCall.resolve():$e.startCall.reject(oe(ve.reason));break;case se.PULL_COMPLETE:ve.success?$e.pullCall.resolve():$e.pullCall.reject(oe(ve.reason));break;case se.PULL:if(!ye){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.PULL_COMPLETE,streamId:Se,success:!0});break}ye.desiredSize<=0&&ve.desiredSize>0&&ye.sinkCapability.resolve(),ye.desiredSize=ve.desiredSize,new Promise(function(Ee){var Ne;Ee((Ne=ye.onPull)==null?void 0:Ne.call(ye))}).then(function(){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.PULL_COMPLETE,streamId:Se,success:!0})},function(Ee){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.PULL_COMPLETE,streamId:Se,reason:oe(Ee)})});break;case se.ENQUEUE:if((0,re.assert)($e,"enqueue should have stream controller"),$e.isClosed)break;$e.controller.enqueue(ve.chunk);break;case se.CLOSE:if((0,re.assert)($e,"close should have stream controller"),$e.isClosed)break;$e.isClosed=!0,$e.controller.close(),Ke(this,Ae,Zn).call(this,$e,Se);break;case se.ERROR:(0,re.assert)($e,"error should have stream controller"),$e.controller.error(oe(ve.reason)),Ke(this,Ae,Zn).call(this,$e,Se);break;case se.CANCEL_COMPLETE:ve.success?$e.cancelCall.resolve():$e.cancelCall.reject(oe(ve.reason)),Ke(this,Ae,Zn).call(this,$e,Se);break;case se.CANCEL:if(!ye)break;new Promise(function(Ee){var Ne;Ee((Ne=ye.onCancel)==null?void 0:Ne.call(ye,oe(ve.reason)))}).then(function(){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.CANCEL_COMPLETE,streamId:Se,success:!0})},function(Ee){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.CANCEL_COMPLETE,streamId:Se,reason:oe(Ee)})}),ye.sinkCapability.reject(oe(ve.reason)),ye.isCancelled=!0,delete this.streamSinks[Se];break;default:throw new Error("Unexpected stream case")}},Ae=new WeakSet,Zn=async function(ve,Se){var Te,Pe,Re;await Promise.allSettled([(Te=ve.startCall)==null?void 0:Te.promise,(Pe=ve.pullCall)==null?void 0:Pe.promise,(Re=ve.cancelCall)==null?void 0:Re.promise]),delete this.streamControllers[Se]},te.MessageHandler=he},(ee,te,ne)=>{var se,oe;Object.defineProperty(te,"__esModule",{value:!0}),te.Metadata=void 0;var re=ne(1);class ie{constructor({parsedData:ue,rawData:de}){We(this,se,void 0);We(this,oe,void 0);st(this,se,ue),st(this,oe,de)}getRaw(){return ce(this,oe)}get(ue){var de;return(de=ce(this,se).get(ue))!=null?de:null}getAll(){return(0,re.objectFromMap)(ce(this,se))}has(ue){return ce(this,se).has(ue)}}se=new WeakMap,oe=new WeakMap,te.Metadata=ie},(ee,te,ne)=>{var ue,de,ae,le,Ae,_e,Ar;Object.defineProperty(te,"__esModule",{value:!0}),te.OptionalContentConfig=void 0;var re=ne(1),ie=ne(8);const se=Symbol("INTERNAL");class oe{constructor(Se,Te){We(this,ue,!0);this.name=Se,this.intent=Te}get visible(){return ce(this,ue)}_setVisible(Se,Te){Se!==se&&(0,re.unreachable)("Internal method `_setVisible` called."),st(this,ue,Te)}}ue=new WeakMap;class he{constructor(Se){We(this,_e);We(this,de,null);We(this,ae,new Map);We(this,le,null);We(this,Ae,null);if(this.name=null,this.creator=null,Se!==null){this.name=Se.name,this.creator=Se.creator,st(this,Ae,Se.order);for(const Te of Se.groups)ce(this,ae).set(Te.id,new oe(Te.name,Te.intent));if(Se.baseState==="OFF")for(const Te of ce(this,ae).values())Te._setVisible(se,!1);for(const Te of Se.on)ce(this,ae).get(Te)._setVisible(se,!0);for(const Te of Se.off)ce(this,ae).get(Te)._setVisible(se,!1);st(this,le,this.getHash())}}isVisible(Se){if(ce(this,ae).size===0)return!0;if(!Se)return(0,re.warn)("Optional content group not defined."),!0;if(Se.type==="OCG")return ce(this,ae).has(Se.id)?ce(this,ae).get(Se.id).visible:((0,re.warn)("Optional content group not found: ".concat(Se.id)),!0);if(Se.type==="OCMD"){if(Se.expression)return Ke(this,_e,Ar).call(this,Se.expression);if(!Se.policy||Se.policy==="AnyOn"){for(const Te of Se.ids){if(!ce(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(ce(this,ae).get(Te).visible)return!0}return!1}else if(Se.policy==="AllOn"){for(const Te of Se.ids){if(!ce(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(!ce(this,ae).get(Te).visible)return!1}return!0}else if(Se.policy==="AnyOff"){for(const Te of Se.ids){if(!ce(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(!ce(this,ae).get(Te).visible)return!0}return!1}else if(Se.policy==="AllOff"){for(const Te of Se.ids){if(!ce(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(ce(this,ae).get(Te).visible)return!1}return!0}return(0,re.warn)("Unknown optional content policy ".concat(Se.policy,".")),!0}return(0,re.warn)("Unknown group type ".concat(Se.type,".")),!0}setVisibility(Se,Te=!0){if(!ce(this,ae).has(Se)){(0,re.warn)("Optional content group not found: ".concat(Se));return}ce(this,ae).get(Se)._setVisible(se,!!Te),st(this,de,null)}get hasInitialVisibility(){return ce(this,le)===null||this.getHash()===ce(this,le)}getOrder(){return ce(this,ae).size?ce(this,Ae)?ce(this,Ae).slice():[...ce(this,ae).keys()]:null}getGroups(){return ce(this,ae).size>0?(0,re.objectFromMap)(ce(this,ae)):null}getGroup(Se){return ce(this,ae).get(Se)||null}getHash(){if(ce(this,de)!==null)return ce(this,de);const Se=new ie.MurmurHash3_64;for(const[Te,Pe]of ce(this,ae))Se.update("".concat(Te,":").concat(Pe.visible));return st(this,de,Se.hexdigest())}}de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakSet,Ar=function(Se){const Te=Se.length;if(Te<2)return!0;const Pe=Se[0];for(let Re=1;Re<Te;Re++){const $e=Se[Re];let ye;if(Array.isArray($e))ye=Ke(this,_e,Ar).call(this,$e);else if(ce(this,ae).has($e))ye=ce(this,ae).get($e).visible;else return(0,re.warn)("Optional content group not found: ".concat($e)),!0;switch(Pe){case"And":if(!ye)return!1;break;case"Or":if(ye)return!0;break;case"Not":return!ye;default:return!0}}return Pe==="And"},te.OptionalContentConfig=he},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFDataTransportStream=void 0;var re=ne(1),ie=ne(6);class se{constructor({length:de,initialData:ae,progressiveDone:le=!1,contentDispositionFilename:Ae=null,disableRange:_e=!1,disableStream:me=!1},ve){if((0,re.assert)(ve,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=le,this._contentDispositionFilename=Ae,(ae==null?void 0:ae.length)>0){const Se=ae instanceof Uint8Array&&ae.byteLength===ae.buffer.byteLength?ae.buffer:new Uint8Array(ae).buffer;this._queuedChunks.push(Se)}this._pdfDataRangeTransport=ve,this._isStreamingSupported=!me,this._isRangeSupported=!_e,this._contentLength=de,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((Se,Te)=>{this._onReceiveData({begin:Se,chunk:Te})}),this._pdfDataRangeTransport.addProgressListener((Se,Te)=>{this._onProgress({loaded:Se,total:Te})}),this._pdfDataRangeTransport.addProgressiveReadListener(Se=>{this._onReceiveData({chunk:Se})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:de,chunk:ae}){const le=ae instanceof Uint8Array&&ae.byteLength===ae.buffer.byteLength?ae.buffer:new Uint8Array(ae).buffer;if(de===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(le):this._queuedChunks.push(le);else{const Ae=this._rangeReaders.some(function(_e){return _e._begin!==de?!1:(_e._enqueue(le),!0)});(0,re.assert)(Ae,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var de,ae;return(ae=(de=this._fullRequestReader)==null?void 0:de._loaded)!=null?ae:0}_onProgress(de){var ae,le,Ae,_e;de.total===void 0?(le=(ae=this._rangeReaders[0])==null?void 0:ae.onProgress)==null||le.call(ae,{loaded:de.loaded}):(_e=(Ae=this._fullRequestReader)==null?void 0:Ae.onProgress)==null||_e.call(Ae,{loaded:de.loaded,total:de.total})}_onProgressiveDone(){var de;(de=this._fullRequestReader)==null||de.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(de){const ae=this._rangeReaders.indexOf(de);ae>=0&&this._rangeReaders.splice(ae,1)}getFullReader(){(0,re.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const de=this._queuedChunks;return this._queuedChunks=null,new oe(this,de,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(de,ae){if(ae<=this._progressiveDataLength)return null;const le=new he(this,de,ae);return this._pdfDataRangeTransport.requestDataRange(de,ae),this._rangeReaders.push(le),le}cancelAllRequests(de){var ae;(ae=this._fullRequestReader)==null||ae.cancel(de);for(const le of this._rangeReaders.slice(0))le.cancel(de);this._pdfDataRangeTransport.abort()}}te.PDFDataTransportStream=se;class oe{constructor(de,ae,le=!1,Ae=null){this._stream=de,this._done=le||!1,this._filename=(0,ie.isPdfFile)(Ae)?Ae:null,this._queuedChunks=ae||[],this._loaded=0;for(const _e of this._queuedChunks)this._loaded+=_e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),de._fullRequestReader=this,this.onProgress=null}_enqueue(de){this._done||(this._requests.length>0?this._requests.shift().resolve({value:de,done:!1}):this._queuedChunks.push(de),this._loaded+=de.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 de=new re.PromiseCapability;return this._requests.push(de),de.promise}cancel(de){this._done=!0;for(const ae of this._requests)ae.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class he{constructor(de,ae,le){this._stream=de,this._begin=ae,this._end=le,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(de){if(!this._done){if(this._requests.length===0)this._queuedChunk=de;else{this._requests.shift().resolve({value:de,done:!1});for(const le of this._requests)le.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 ae=this._queuedChunk;return this._queuedChunk=null,{value:ae,done:!1}}if(this._done)return{value:void 0,done:!0};const de=new re.PromiseCapability;return this._requests.push(de),de.promise}cancel(de){this._done=!0;for(const ae of this._requests)ae.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFFetchStream=void 0;var re=ne(1),ie=ne(20);function se(le,Ae,_e){return{method:"GET",headers:le,signal:_e.signal,mode:"cors",credentials:Ae?"include":"same-origin",redirect:"follow"}}function oe(le){const Ae=new Headers;for(const _e in le){const me=le[_e];me!==void 0&&Ae.append(_e,me)}return Ae}function he(le){return le instanceof Uint8Array?le.buffer:le instanceof ArrayBuffer?le:((0,re.warn)("getArrayBuffer - unexpected data format: ".concat(le)),new Uint8Array(le).buffer)}class ue{constructor(Ae){this.source=Ae,this.isHttp=/^https?:/i.test(Ae.url),this.httpHeaders=this.isHttp&&Ae.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var Ae,_e;return(_e=(Ae=this._fullRequestReader)==null?void 0:Ae._loaded)!=null?_e:0}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new de(this),this._fullRequestReader}getRangeReader(Ae,_e){if(_e<=this._progressiveDataLength)return null;const me=new ae(this,Ae,_e);return this._rangeRequestReaders.push(me),me}cancelAllRequests(Ae){var _e;(_e=this._fullRequestReader)==null||_e.cancel(Ae);for(const me of this._rangeRequestReaders.slice(0))me.cancel(Ae)}}te.PDFFetchStream=ue;class de{constructor(Ae){this._stream=Ae,this._reader=null,this._loaded=0,this._filename=null;const _e=Ae.source;this._withCredentials=_e.withCredentials||!1,this._contentLength=_e.length,this._headersCapability=new re.PromiseCapability,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=oe(this._stream.httpHeaders);const me=_e.url;fetch(me,se(this._headers,this._withCredentials,this._abortController)).then(ve=>{if(!(0,ie.validateResponseStatus)(ve.status))throw(0,ie.createResponseStatusError)(ve.status,me);this._reader=ve.body.getReader(),this._headersCapability.resolve();const Se=Re=>ve.headers.get(Re),{allowRangeRequests:Te,suggestedLength:Pe}=(0,ie.validateRangeRequestCapabilities)({getResponseHeader:Se,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=Te,this._contentLength=Pe||this._contentLength,this._filename=(0,ie.extractFilenameFromHeader)(Se),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new re.AbortException("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 me;await this._headersCapability.promise;const{value:Ae,done:_e}=await this._reader.read();return _e?{value:Ae,done:_e}:(this._loaded+=Ae.byteLength,(me=this.onProgress)==null||me.call(this,{loaded:this._loaded,total:this._contentLength}),{value:he(Ae),done:!1})}cancel(Ae){var _e;(_e=this._reader)==null||_e.cancel(Ae),this._abortController.abort()}}class ae{constructor(Ae,_e,me){this._stream=Ae,this._reader=null,this._loaded=0;const ve=Ae.source;this._withCredentials=ve.withCredentials||!1,this._readCapability=new re.PromiseCapability,this._isStreamingSupported=!ve.disableStream,this._abortController=new AbortController,this._headers=oe(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(_e,"-").concat(me-1));const Se=ve.url;fetch(Se,se(this._headers,this._withCredentials,this._abortController)).then(Te=>{if(!(0,ie.validateResponseStatus)(Te.status))throw(0,ie.createResponseStatusError)(Te.status,Se);this._readCapability.resolve(),this._reader=Te.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var me;await this._readCapability.promise;const{value:Ae,done:_e}=await this._reader.read();return _e?{value:Ae,done:_e}:(this._loaded+=Ae.byteLength,(me=this.onProgress)==null||me.call(this,{loaded:this._loaded}),{value:he(Ae),done:!1})}cancel(Ae){var _e;(_e=this._reader)==null||_e.cancel(Ae),this._abortController.abort()}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.createResponseStatusError=ue,te.extractFilenameFromHeader=he,te.validateRangeRequestCapabilities=oe,te.validateResponseStatus=de;var re=ne(1),ie=ne(21),se=ne(6);function oe({getResponseHeader:ae,isHttp:le,rangeChunkSize:Ae,disableRange:_e}){const me={allowRangeRequests:!1,suggestedLength:void 0},ve=parseInt(ae("Content-Length"),10);return!Number.isInteger(ve)||(me.suggestedLength=ve,ve<=2*Ae)||_e||!le||ae("Accept-Ranges")!=="bytes"||(ae("Content-Encoding")||"identity")!=="identity"||(me.allowRangeRequests=!0),me}function he(ae){const le=ae("Content-Disposition");if(le){let Ae=(0,ie.getFilenameFromContentDispositionHeader)(le);if(Ae.includes("%"))try{Ae=decodeURIComponent(Ae)}catch{}if((0,se.isPdfFile)(Ae))return Ae}return null}function ue(ae,le){return ae===404||ae===0&&le.startsWith("file:")?new re.MissingPDFException('Missing PDF "'+le+'".'):new re.UnexpectedResponseException("Unexpected server response (".concat(ae,') while retrieving PDF "').concat(le,'".'),ae)}function de(ae){return ae===200||ae===206}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.getFilenameFromContentDispositionHeader=ie;var re=ne(1);function ie(se){let oe=!0,he=ue("filename\\*","i").exec(se);if(he){he=he[1];let ve=Ae(he);return ve=unescape(ve),ve=_e(ve),ve=me(ve),ae(ve)}if(he=le(se),he){const ve=me(he);return ae(ve)}if(he=ue("filename","i").exec(se),he){he=he[1];let ve=Ae(he);return ve=me(ve),ae(ve)}function ue(ve,Se){return new RegExp("(?:^|;)\\s*"+ve+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',Se)}function de(ve,Se){if(ve){if(!/^[\x00-\xFF]+$/.test(Se))return Se;try{const Te=new TextDecoder(ve,{fatal:!0}),Pe=(0,re.stringToBytes)(Se);Se=Te.decode(Pe),oe=!1}catch{}}return Se}function ae(ve){return oe&&/[\x80-\xff]/.test(ve)&&(ve=de("utf-8",ve),oe&&(ve=de("iso-8859-1",ve))),ve}function le(ve){const Se=[];let Te;const Pe=ue("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(Te=Pe.exec(ve))!==null;){let[,$e,ye,Ee]=Te;if($e=parseInt($e,10),$e in Se){if($e===0)break;continue}Se[$e]=[ye,Ee]}const Re=[];for(let $e=0;$e<Se.length&&$e in Se;++$e){let[ye,Ee]=Se[$e];Ee=Ae(Ee),ye&&(Ee=unescape(Ee),$e===0&&(Ee=_e(Ee))),Re.push(Ee)}return Re.join("")}function Ae(ve){if(ve.startsWith('"')){const Se=ve.slice(1).split('\\"');for(let Te=0;Te<Se.length;++Te){const Pe=Se[Te].indexOf('"');Pe!==-1&&(Se[Te]=Se[Te].slice(0,Pe),Se.length=Te+1),Se[Te]=Se[Te].replaceAll(/\\(.)/g,"$1")}ve=Se.join('"')}return ve}function _e(ve){const Se=ve.indexOf("'");if(Se===-1)return ve;const Te=ve.slice(0,Se),Re=ve.slice(Se+1).replace(/^[^']*'/,"");return de(Te,Re)}function me(ve){return!ve.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(ve)?ve:ve.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(Se,Te,Pe,Re){if(Pe==="q"||Pe==="Q")return Re=Re.replaceAll("_"," "),Re=Re.replaceAll(/=([0-9a-fA-F]{2})/g,function($e,ye){return String.fromCharCode(parseInt(ye,16))}),de(Te,Re);try{Re=atob(Re)}catch{}return de(Te,Re)})}return""}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFNetworkStream=void 0;var re=ne(1),ie=ne(20);const se=200,oe=206;function he(Ae){const _e=Ae.response;return typeof _e!="string"?_e:(0,re.stringToBytes)(_e).buffer}class ue{constructor(_e,me={}){this.url=_e,this.isHttp=/^https?:/i.test(_e),this.httpHeaders=this.isHttp&&me.httpHeaders||Object.create(null),this.withCredentials=me.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(_e,me,ve){const Se={begin:_e,end:me};for(const Te in ve)Se[Te]=ve[Te];return this.request(Se)}requestFull(_e){return this.request(_e)}request(_e){const me=new XMLHttpRequest,ve=this.currXhrId++,Se=this.pendingRequests[ve]={xhr:me};me.open("GET",this.url),me.withCredentials=this.withCredentials;for(const Te in this.httpHeaders){const Pe=this.httpHeaders[Te];Pe!==void 0&&me.setRequestHeader(Te,Pe)}return this.isHttp&&"begin"in _e&&"end"in _e?(me.setRequestHeader("Range","bytes=".concat(_e.begin,"-").concat(_e.end-1)),Se.expectedStatus=oe):Se.expectedStatus=se,me.responseType="arraybuffer",_e.onError&&(me.onerror=function(Te){_e.onError(me.status)}),me.onreadystatechange=this.onStateChange.bind(this,ve),me.onprogress=this.onProgress.bind(this,ve),Se.onHeadersReceived=_e.onHeadersReceived,Se.onDone=_e.onDone,Se.onError=_e.onError,Se.onProgress=_e.onProgress,me.send(null),ve}onProgress(_e,me){var Se;const ve=this.pendingRequests[_e];ve&&((Se=ve.onProgress)==null||Se.call(ve,me))}onStateChange(_e,me){var $e,ye,Ee;const ve=this.pendingRequests[_e];if(!ve)return;const Se=ve.xhr;if(Se.readyState>=2&&ve.onHeadersReceived&&(ve.onHeadersReceived(),delete ve.onHeadersReceived),Se.readyState!==4||!(_e in this.pendingRequests))return;if(delete this.pendingRequests[_e],Se.status===0&&this.isHttp){($e=ve.onError)==null||$e.call(ve,Se.status);return}const Te=Se.status||se;if(!(Te===se&&ve.expectedStatus===oe)&&Te!==ve.expectedStatus){(ye=ve.onError)==null||ye.call(ve,Se.status);return}const Re=he(Se);if(Te===oe){const Ne=Se.getResponseHeader("Content-Range"),Me=/bytes (\d+)-(\d+)\/(\d+)/.exec(Ne);ve.onDone({begin:parseInt(Me[1],10),chunk:Re})}else Re?ve.onDone({begin:0,chunk:Re}):(Ee=ve.onError)==null||Ee.call(ve,Se.status)}getRequestXhr(_e){return this.pendingRequests[_e].xhr}isPendingRequest(_e){return _e in this.pendingRequests}abortRequest(_e){const me=this.pendingRequests[_e].xhr;delete this.pendingRequests[_e],me.abort()}}class de{constructor(_e){this._source=_e,this._manager=new ue(_e.url,{httpHeaders:_e.httpHeaders,withCredentials:_e.withCredentials}),this._rangeChunkSize=_e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(_e){const me=this._rangeRequestReaders.indexOf(_e);me>=0&&this._rangeRequestReaders.splice(me,1)}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new ae(this._manager,this._source),this._fullRequestReader}getRangeReader(_e,me){const ve=new le(this._manager,_e,me);return ve.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(ve),ve}cancelAllRequests(_e){var me;(me=this._fullRequestReader)==null||me.cancel(_e);for(const ve of this._rangeRequestReaders.slice(0))ve.cancel(_e)}}te.PDFNetworkStream=de;class ae{constructor(_e,me){this._manager=_e;const ve={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=me.url,this._fullRequestId=_e.requestFull(ve),this._headersReceivedCapability=new re.PromiseCapability,this._disableRange=me.disableRange||!1,this._contentLength=me.length,this._rangeChunkSize=me.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 _e=this._fullRequestId,me=this._manager.getRequestXhr(_e),ve=Pe=>me.getResponseHeader(Pe),{allowRangeRequests:Se,suggestedLength:Te}=(0,ie.validateRangeRequestCapabilities)({getResponseHeader:ve,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});Se&&(this._isRangeSupported=!0),this._contentLength=Te||this._contentLength,this._filename=(0,ie.extractFilenameFromHeader)(ve),this._isRangeSupported&&this._manager.abortRequest(_e),this._headersReceivedCapability.resolve()}_onDone(_e){if(_e&&(this._requests.length>0?this._requests.shift().resolve({value:_e.chunk,done:!1}):this._cachedChunks.push(_e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const me of this._requests)me.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(_e){this._storedError=(0,ie.createResponseStatusError)(_e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const me of this._requests)me.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(_e){var me;(me=this.onProgress)==null||me.call(this,{loaded:_e.loaded,total:_e.lengthComputable?_e.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 _e=new re.PromiseCapability;return this._requests.push(_e),_e.promise}cancel(_e){this._done=!0,this._headersReceivedCapability.reject(_e);for(const me of this._requests)me.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class le{constructor(_e,me,ve){this._manager=_e;const Se={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=_e.url,this._requestId=_e.requestRange(me,ve,Se),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var _e;(_e=this.onClosed)==null||_e.call(this,this)}_onDone(_e){const me=_e.chunk;this._requests.length>0?this._requests.shift().resolve({value:me,done:!1}):this._queuedChunk=me,this._done=!0;for(const ve of this._requests)ve.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(_e){this._storedError=(0,ie.createResponseStatusError)(_e,this._url);for(const me of this._requests)me.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(_e){var me;this.isStreamingSupported||(me=this.onProgress)==null||me.call(this,{loaded:_e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const me=this._queuedChunk;return this._queuedChunk=null,{value:me,done:!1}}if(this._done)return{value:void 0,done:!0};const _e=new re.PromiseCapability;return this._requests.push(_e),_e.promise}cancel(_e){this._done=!0;for(const me of this._requests)me.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFNodeStream=void 0;var re=ne(1),ie=ne(20);const se=/^file:\/\/\/[a-zA-Z]:\//;function oe(ve){const Se=require$$5,Te=Se.parse(ve);return Te.protocol==="file:"||Te.host?Te:/^[a-z]:[/\\]/i.test(ve)?Se.parse("file:///".concat(ve)):(Te.host||(Te.protocol="file:"),Te)}class he{constructor(Se){this.source=Se,this.url=oe(Se.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&Se.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var Se,Te;return(Te=(Se=this._fullRequestReader)==null?void 0:Se._loaded)!=null?Te:0}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new _e(this):new le(this),this._fullRequestReader}getRangeReader(Se,Te){if(Te<=this._progressiveDataLength)return null;const Pe=this.isFsUrl?new me(this,Se,Te):new Ae(this,Se,Te);return this._rangeRequestReaders.push(Pe),Pe}cancelAllRequests(Se){var Te;(Te=this._fullRequestReader)==null||Te.cancel(Se);for(const Pe of this._rangeRequestReaders.slice(0))Pe.cancel(Se)}}te.PDFNodeStream=he;class ue{constructor(Se){this._url=Se.url,this._done=!1,this._storedError=null,this.onProgress=null;const Te=Se.source;this._contentLength=Te.length,this._loaded=0,this._filename=null,this._disableRange=Te.disableRange||!1,this._rangeChunkSize=Te.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!Te.disableStream,this._isRangeSupported=!Te.disableRange,this._readableStream=null,this._readCapability=new re.PromiseCapability,this._headersCapability=new re.PromiseCapability}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 Pe;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Se=this._readableStream.read();return Se===null?(this._readCapability=new re.PromiseCapability,this.read()):(this._loaded+=Se.length,(Pe=this.onProgress)==null||Pe.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(Se).buffer,done:!1})}cancel(Se){if(!this._readableStream){this._error(Se);return}this._readableStream.destroy(Se)}_error(Se){this._storedError=Se,this._readCapability.resolve()}_setReadableStream(Se){this._readableStream=Se,Se.on("readable",()=>{this._readCapability.resolve()}),Se.on("end",()=>{Se.destroy(),this._done=!0,this._readCapability.resolve()}),Se.on("error",Te=>{this._error(Te)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new re.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class de{constructor(Se){this._url=Se.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new re.PromiseCapability;const Te=Se.source;this._isStreamingSupported=!Te.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var Pe;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Se=this._readableStream.read();return Se===null?(this._readCapability=new re.PromiseCapability,this.read()):(this._loaded+=Se.length,(Pe=this.onProgress)==null||Pe.call(this,{loaded:this._loaded}),{value:new Uint8Array(Se).buffer,done:!1})}cancel(Se){if(!this._readableStream){this._error(Se);return}this._readableStream.destroy(Se)}_error(Se){this._storedError=Se,this._readCapability.resolve()}_setReadableStream(Se){this._readableStream=Se,Se.on("readable",()=>{this._readCapability.resolve()}),Se.on("end",()=>{Se.destroy(),this._done=!0,this._readCapability.resolve()}),Se.on("error",Te=>{this._error(Te)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function ae(ve,Se){return{protocol:ve.protocol,auth:ve.auth,host:ve.hostname,port:ve.port,path:ve.path,method:"GET",headers:Se}}class le extends ue{constructor(Se){super(Se);const Te=Pe=>{if(Pe.statusCode===404){const Ee=new re.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=Ee,this._headersCapability.reject(Ee);return}this._headersCapability.resolve(),this._setReadableStream(Pe);const Re=Ee=>this._readableStream.headers[Ee.toLowerCase()],{allowRangeRequests:$e,suggestedLength:ye}=(0,ie.validateRangeRequestCapabilities)({getResponseHeader:Re,isHttp:Se.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=$e,this._contentLength=ye||this._contentLength,this._filename=(0,ie.extractFilenameFromHeader)(Re)};if(this._request=null,this._url.protocol==="http:"){const Pe=require$$5;this._request=Pe.request(ae(this._url,Se.httpHeaders),Te)}else{const Pe=require$$5;this._request=Pe.request(ae(this._url,Se.httpHeaders),Te)}this._request.on("error",Pe=>{this._storedError=Pe,this._headersCapability.reject(Pe)}),this._request.end()}}class Ae extends de{constructor(Se,Te,Pe){super(Se),this._httpHeaders={};for(const $e in Se.httpHeaders){const ye=Se.httpHeaders[$e];ye!==void 0&&(this._httpHeaders[$e]=ye)}this._httpHeaders.Range="bytes=".concat(Te,"-").concat(Pe-1);const Re=$e=>{if($e.statusCode===404){const ye=new re.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=ye;return}this._setReadableStream($e)};if(this._request=null,this._url.protocol==="http:"){const $e=require$$5;this._request=$e.request(ae(this._url,this._httpHeaders),Re)}else{const $e=require$$5;this._request=$e.request(ae(this._url,this._httpHeaders),Re)}this._request.on("error",$e=>{this._storedError=$e}),this._request.end()}}class _e extends ue{constructor(Se){super(Se);let Te=decodeURIComponent(this._url.path);se.test(this._url.href)&&(Te=Te.replace(/^\//,""));const Pe=require$$5;Pe.lstat(Te,(Re,$e)=>{if(Re){Re.code==="ENOENT"&&(Re=new re.MissingPDFException('Missing PDF "'.concat(Te,'".'))),this._storedError=Re,this._headersCapability.reject(Re);return}this._contentLength=$e.size,this._setReadableStream(Pe.createReadStream(Te)),this._headersCapability.resolve()})}}class me extends de{constructor(Se,Te,Pe){super(Se);let Re=decodeURIComponent(this._url.path);se.test(this._url.href)&&(Re=Re.replace(/^\//,""));const $e=require$$5;this._setReadableStream($e.createReadStream(Re,{start:Te,end:Pe-1}))}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.SVGGraphics=void 0;var re=ne(6),ie=ne(1);const se={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},oe="http://www.w3.org/XML/1998/namespace",he="http://www.w3.org/1999/xlink",ue=["butt","round","square"],de=["miter","round","bevel"],ae=function($e,ye="",Ee=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!Ee)return URL.createObjectURL(new Blob([$e],{type:ye}));const Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let Me="data:".concat(ye,";base64,");for(let we=0,Oe=$e.length;we<Oe;we+=3){const Fe=$e[we]&255,Ve=$e[we+1]&255,qe=$e[we+2]&255,Ie=Fe>>2,Xe=(Fe&3)<<4|Ve>>4,rt=we+1<Oe?(Ve&15)<<2|qe>>6:64,lt=we+2<Oe?qe&63:64;Me+=Ne[Ie]+Ne[Xe]+Ne[rt]+Ne[lt]}return Me},le=function(){const $e=new Uint8Array([137,80,78,71,13,10,26,10]),ye=12,Ee=new Int32Array(256);for(let qe=0;qe<256;qe++){let Ie=qe;for(let Xe=0;Xe<8;Xe++)Ie=Ie&1?3988292384^Ie>>1&2147483647:Ie>>1&2147483647;Ee[qe]=Ie}function Ne(qe,Ie,Xe){let rt=-1;for(let lt=Ie;lt<Xe;lt++){const Ge=(rt^qe[lt])&255,ut=Ee[Ge];rt=rt>>>8^ut}return rt^-1}function Me(qe,Ie,Xe,rt){let lt=rt;const Ge=Ie.length;Xe[lt]=Ge>>24&255,Xe[lt+1]=Ge>>16&255,Xe[lt+2]=Ge>>8&255,Xe[lt+3]=Ge&255,lt+=4,Xe[lt]=qe.charCodeAt(0)&255,Xe[lt+1]=qe.charCodeAt(1)&255,Xe[lt+2]=qe.charCodeAt(2)&255,Xe[lt+3]=qe.charCodeAt(3)&255,lt+=4,Xe.set(Ie,lt),lt+=Ie.length;const ut=Ne(Xe,rt+4,lt);Xe[lt]=ut>>24&255,Xe[lt+1]=ut>>16&255,Xe[lt+2]=ut>>8&255,Xe[lt+3]=ut&255}function we(qe,Ie,Xe){let rt=1,lt=0;for(let Ge=Ie;Ge<Xe;++Ge)rt=(rt+(qe[Ge]&255))%65521,lt=(lt+rt)%65521;return lt<<16|rt}function Oe(qe){if(!ie.isNodeJS)return Fe(qe);try{const Ie=parseInt(process.versions.node)>=8?qe:Buffer.from(qe),Xe=require$$5.deflateSync(Ie,{level:9});return Xe instanceof Uint8Array?Xe:new Uint8Array(Xe)}catch(Ie){(0,ie.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+Ie)}return Fe(qe)}function Fe(qe){let Ie=qe.length;const Xe=65535,rt=Math.ceil(Ie/Xe),lt=new Uint8Array(2+Ie+rt*5+4);let Ge=0;lt[Ge++]=120,lt[Ge++]=156;let ut=0;for(;Ie>Xe;)lt[Ge++]=0,lt[Ge++]=255,lt[Ge++]=255,lt[Ge++]=0,lt[Ge++]=0,lt.set(qe.subarray(ut,ut+Xe),Ge),Ge+=Xe,ut+=Xe,Ie-=Xe;lt[Ge++]=1,lt[Ge++]=Ie&255,lt[Ge++]=Ie>>8&255,lt[Ge++]=~Ie&65535&255,lt[Ge++]=(~Ie&65535)>>8&255,lt.set(qe.subarray(ut),Ge),Ge+=qe.length-ut;const mt=we(qe,0,qe.length);return lt[Ge++]=mt>>24&255,lt[Ge++]=mt>>16&255,lt[Ge++]=mt>>8&255,lt[Ge++]=mt&255,lt}function Ve(qe,Ie,Xe,rt){const lt=qe.width,Ge=qe.height;let ut,mt,wt;const Et=qe.data;switch(Ie){case ie.ImageKind.GRAYSCALE_1BPP:mt=0,ut=1,wt=lt+7>>3;break;case ie.ImageKind.RGB_24BPP:mt=2,ut=8,wt=lt*3;break;case ie.ImageKind.RGBA_32BPP:mt=6,ut=8,wt=lt*4;break;default:throw new Error("invalid format")}const De=new Uint8Array((1+wt)*Ge);let pe=0,be=0;for(let He=0;He<Ge;++He)De[pe++]=0,De.set(Et.subarray(be,be+wt),pe),be+=wt,pe+=wt;if(Ie===ie.ImageKind.GRAYSCALE_1BPP&&rt){pe=0;for(let He=0;He<Ge;He++){pe++;for(let it=0;it<wt;it++)De[pe++]^=255}}const ge=new Uint8Array([lt>>24&255,lt>>16&255,lt>>8&255,lt&255,Ge>>24&255,Ge>>16&255,Ge>>8&255,Ge&255,ut,mt,0,0,0]),Ce=Oe(De),xe=$e.length+ye*3+ge.length+Ce.length,Le=new Uint8Array(xe);let Be=0;return Le.set($e,Be),Be+=$e.length,Me("IHDR",ge,Le,Be),Be+=ye+ge.length,Me("IDATA",Ce,Le,Be),Be+=ye+Ce.length,Me("IEND",new Uint8Array(0),Le,Be),ae(Le,"image/png",Xe)}return function(Ie,Xe,rt){const lt=Ie.kind===void 0?ie.ImageKind.GRAYSCALE_1BPP:Ie.kind;return Ve(Ie,lt,Xe,rt)}}();class Ae{constructor(){this.fontSizeScale=1,this.fontWeight=se.fontWeight,this.fontSize=0,this.textMatrix=ie.IDENTITY_MATRIX,this.fontMatrix=ie.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=ie.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=se.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(ye,Ee){this.x=ye,this.y=Ee}}function _e($e){let ye=[];const Ee=[];for(const Ne of $e){if(Ne.fn==="save"){ye.push({fnId:92,fn:"group",items:[]}),Ee.push(ye),ye=ye.at(-1).items;continue}Ne.fn==="restore"?ye=Ee.pop():ye.push(Ne)}return ye}function me($e){if(Number.isInteger($e))return $e.toString();const ye=$e.toFixed(10);let Ee=ye.length-1;if(ye[Ee]!=="0")return ye;do Ee--;while(ye[Ee]==="0");return ye.substring(0,ye[Ee]==="."?Ee:Ee+1)}function ve($e){if($e[4]===0&&$e[5]===0){if($e[1]===0&&$e[2]===0)return $e[0]===1&&$e[3]===1?"":"scale(".concat(me($e[0])," ").concat(me($e[3]),")");if($e[0]===$e[3]&&$e[1]===-$e[2]){const ye=Math.acos($e[0])*180/Math.PI;return"rotate(".concat(me(ye),")")}}else if($e[0]===1&&$e[1]===0&&$e[2]===0&&$e[3]===1)return"translate(".concat(me($e[4])," ").concat(me($e[5]),")");return"matrix(".concat(me($e[0])," ").concat(me($e[1])," ").concat(me($e[2])," ").concat(me($e[3])," ").concat(me($e[4])," ")+"".concat(me($e[5]),")")}let Se=0,Te=0,Pe=0;class Re{constructor(ye,Ee,Ne=!1){(0,re.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new re.DOMSVGFactory,this.current=new Ae,this.transformMatrix=ie.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=ye,this.objs=Ee,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!Ne,this._operatorIdMapping=[];for(const Me in ie.OPS)this._operatorIdMapping[ie.OPS[Me]]=Me}getObject(ye,Ee=null){return typeof ye=="string"?ye.startsWith("g_")?this.commonObjs.get(ye):this.objs.get(ye):Ee}save(){this.transformStack.push(this.transformMatrix);const ye=this.current;this.extraStack.push(ye),this.current=ye.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(ye){this.save(),this.executeOpTree(ye),this.restore()}loadDependencies(ye){const Ee=ye.fnArray,Ne=ye.argsArray;for(let Me=0,we=Ee.length;Me<we;Me++)if(Ee[Me]===ie.OPS.dependency)for(const Oe of Ne[Me]){const Fe=Oe.startsWith("g_")?this.commonObjs:this.objs,Ve=new Promise(qe=>{Fe.get(Oe,qe)});this.current.dependencies.push(Ve)}return Promise.all(this.current.dependencies)}transform(ye,Ee,Ne,Me,we,Oe){const Fe=[ye,Ee,Ne,Me,we,Oe];this.transformMatrix=ie.Util.transform(this.transformMatrix,Fe),this.tgrp=null}getSVG(ye,Ee){this.viewport=Ee;const Ne=this._initialize(Ee);return this.loadDependencies(ye).then(()=>(this.transformMatrix=ie.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(ye)),Ne))}convertOpList(ye){const Ee=this._operatorIdMapping,Ne=ye.argsArray,Me=ye.fnArray,we=[];for(let Oe=0,Fe=Me.length;Oe<Fe;Oe++){const Ve=Me[Oe];we.push({fnId:Ve,fn:Ee[Ve],args:Ne[Oe]})}return _e(we)}executeOpTree(ye){for(const Ee of ye){const Ne=Ee.fn,Me=Ee.fnId,we=Ee.args;switch(Me|0){case ie.OPS.beginText:this.beginText();break;case ie.OPS.dependency:break;case ie.OPS.setLeading:this.setLeading(we);break;case ie.OPS.setLeadingMoveText:this.setLeadingMoveText(we[0],we[1]);break;case ie.OPS.setFont:this.setFont(we);break;case ie.OPS.showText:this.showText(we[0]);break;case ie.OPS.showSpacedText:this.showText(we[0]);break;case ie.OPS.endText:this.endText();break;case ie.OPS.moveText:this.moveText(we[0],we[1]);break;case ie.OPS.setCharSpacing:this.setCharSpacing(we[0]);break;case ie.OPS.setWordSpacing:this.setWordSpacing(we[0]);break;case ie.OPS.setHScale:this.setHScale(we[0]);break;case ie.OPS.setTextMatrix:this.setTextMatrix(we[0],we[1],we[2],we[3],we[4],we[5]);break;case ie.OPS.setTextRise:this.setTextRise(we[0]);break;case ie.OPS.setTextRenderingMode:this.setTextRenderingMode(we[0]);break;case ie.OPS.setLineWidth:this.setLineWidth(we[0]);break;case ie.OPS.setLineJoin:this.setLineJoin(we[0]);break;case ie.OPS.setLineCap:this.setLineCap(we[0]);break;case ie.OPS.setMiterLimit:this.setMiterLimit(we[0]);break;case ie.OPS.setFillRGBColor:this.setFillRGBColor(we[0],we[1],we[2]);break;case ie.OPS.setStrokeRGBColor:this.setStrokeRGBColor(we[0],we[1],we[2]);break;case ie.OPS.setStrokeColorN:this.setStrokeColorN(we);break;case ie.OPS.setFillColorN:this.setFillColorN(we);break;case ie.OPS.shadingFill:this.shadingFill(we[0]);break;case ie.OPS.setDash:this.setDash(we[0],we[1]);break;case ie.OPS.setRenderingIntent:this.setRenderingIntent(we[0]);break;case ie.OPS.setFlatness:this.setFlatness(we[0]);break;case ie.OPS.setGState:this.setGState(we[0]);break;case ie.OPS.fill:this.fill();break;case ie.OPS.eoFill:this.eoFill();break;case ie.OPS.stroke:this.stroke();break;case ie.OPS.fillStroke:this.fillStroke();break;case ie.OPS.eoFillStroke:this.eoFillStroke();break;case ie.OPS.clip:this.clip("nonzero");break;case ie.OPS.eoClip:this.clip("evenodd");break;case ie.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case ie.OPS.paintImageXObject:this.paintImageXObject(we[0]);break;case ie.OPS.paintInlineImageXObject:this.paintInlineImageXObject(we[0]);break;case ie.OPS.paintImageMaskXObject:this.paintImageMaskXObject(we[0]);break;case ie.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(we[0],we[1]);break;case ie.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case ie.OPS.closePath:this.closePath();break;case ie.OPS.closeStroke:this.closeStroke();break;case ie.OPS.closeFillStroke:this.closeFillStroke();break;case ie.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case ie.OPS.nextLine:this.nextLine();break;case ie.OPS.transform:this.transform(we[0],we[1],we[2],we[3],we[4],we[5]);break;case ie.OPS.constructPath:this.constructPath(we[0],we[1]);break;case ie.OPS.endPath:this.endPath();break;case 92:this.group(Ee.items);break;default:(0,ie.warn)("Unimplemented operator ".concat(Ne));break}}}setWordSpacing(ye){this.current.wordSpacing=ye}setCharSpacing(ye){this.current.charSpacing=ye}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(ye,Ee,Ne,Me,we,Oe){const Fe=this.current;Fe.textMatrix=Fe.lineMatrix=[ye,Ee,Ne,Me,we,Oe],Fe.textMatrixScale=Math.hypot(ye,Ee),Fe.x=Fe.lineX=0,Fe.y=Fe.lineY=0,Fe.xcoords=[],Fe.ycoords=[],Fe.tspan=this.svgFactory.createElement("svg:tspan"),Fe.tspan.setAttributeNS(null,"font-family",Fe.fontFamily),Fe.tspan.setAttributeNS(null,"font-size","".concat(me(Fe.fontSize),"px")),Fe.tspan.setAttributeNS(null,"y",me(-Fe.y)),Fe.txtElement=this.svgFactory.createElement("svg:text"),Fe.txtElement.append(Fe.tspan)}beginText(){const ye=this.current;ye.x=ye.lineX=0,ye.y=ye.lineY=0,ye.textMatrix=ie.IDENTITY_MATRIX,ye.lineMatrix=ie.IDENTITY_MATRIX,ye.textMatrixScale=1,ye.tspan=this.svgFactory.createElement("svg:tspan"),ye.txtElement=this.svgFactory.createElement("svg:text"),ye.txtgrp=this.svgFactory.createElement("svg:g"),ye.xcoords=[],ye.ycoords=[]}moveText(ye,Ee){const Ne=this.current;Ne.x=Ne.lineX+=ye,Ne.y=Ne.lineY+=Ee,Ne.xcoords=[],Ne.ycoords=[],Ne.tspan=this.svgFactory.createElement("svg:tspan"),Ne.tspan.setAttributeNS(null,"font-family",Ne.fontFamily),Ne.tspan.setAttributeNS(null,"font-size","".concat(me(Ne.fontSize),"px")),Ne.tspan.setAttributeNS(null,"y",me(-Ne.y))}showText(ye){const Ee=this.current,Ne=Ee.font,Me=Ee.fontSize;if(Me===0)return;const we=Ee.fontSizeScale,Oe=Ee.charSpacing,Fe=Ee.wordSpacing,Ve=Ee.fontDirection,qe=Ee.textHScale*Ve,Ie=Ne.vertical,Xe=Ie?1:-1,rt=Ne.defaultVMetrics,lt=Me*Ee.fontMatrix[0];let Ge=0;for(const wt of ye){if(wt===null){Ge+=Ve*Fe;continue}else if(typeof wt=="number"){Ge+=Xe*wt*Me/1e3;continue}const Et=(wt.isSpace?Fe:0)+Oe,De=wt.fontChar;let pe,be,ge=wt.width;if(Ie){let xe;const Le=wt.vmetric||rt;xe=wt.vmetric?Le[1]:ge*.5,xe=-xe*lt;const Be=Le[2]*lt;ge=Le?-Le[0]:ge,pe=xe/we,be=(Ge+Be)/we}else pe=Ge/we,be=0;(wt.isInFont||Ne.missingFile)&&(Ee.xcoords.push(Ee.x+pe),Ie&&Ee.ycoords.push(-Ee.y+be),Ee.tspan.textContent+=De);const Ce=Ie?ge*lt-Et*Ve:ge*lt+Et*Ve;Ge+=Ce}Ee.tspan.setAttributeNS(null,"x",Ee.xcoords.map(me).join(" ")),Ie?Ee.tspan.setAttributeNS(null,"y",Ee.ycoords.map(me).join(" ")):Ee.tspan.setAttributeNS(null,"y",me(-Ee.y)),Ie?Ee.y-=Ge:Ee.x+=Ge*qe,Ee.tspan.setAttributeNS(null,"font-family",Ee.fontFamily),Ee.tspan.setAttributeNS(null,"font-size","".concat(me(Ee.fontSize),"px")),Ee.fontStyle!==se.fontStyle&&Ee.tspan.setAttributeNS(null,"font-style",Ee.fontStyle),Ee.fontWeight!==se.fontWeight&&Ee.tspan.setAttributeNS(null,"font-weight",Ee.fontWeight);const ut=Ee.textRenderingMode&ie.TextRenderingMode.FILL_STROKE_MASK;if(ut===ie.TextRenderingMode.FILL||ut===ie.TextRenderingMode.FILL_STROKE?(Ee.fillColor!==se.fillColor&&Ee.tspan.setAttributeNS(null,"fill",Ee.fillColor),Ee.fillAlpha<1&&Ee.tspan.setAttributeNS(null,"fill-opacity",Ee.fillAlpha)):Ee.textRenderingMode===ie.TextRenderingMode.ADD_TO_PATH?Ee.tspan.setAttributeNS(null,"fill","transparent"):Ee.tspan.setAttributeNS(null,"fill","none"),ut===ie.TextRenderingMode.STROKE||ut===ie.TextRenderingMode.FILL_STROKE){const wt=1/(Ee.textMatrixScale||1);this._setStrokeAttributes(Ee.tspan,wt)}let mt=Ee.textMatrix;Ee.textRise!==0&&(mt=mt.slice(),mt[5]+=Ee.textRise),Ee.txtElement.setAttributeNS(null,"transform","".concat(ve(mt)," scale(").concat(me(qe),", -1)")),Ee.txtElement.setAttributeNS(oe,"xml:space","preserve"),Ee.txtElement.append(Ee.tspan),Ee.txtgrp.append(Ee.txtElement),this._ensureTransformGroup().append(Ee.txtElement)}setLeadingMoveText(ye,Ee){this.setLeading(-Ee),this.moveText(ye,Ee)}addFontStyle(ye){if(!ye.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const Ee=ae(ye.data,ye.mimetype,this.forceDataSchema);this.cssStyle.textContent+='@font-face { font-family: "'.concat(ye.loadedName,'";')+" src: url(".concat(Ee,"); }\n")}setFont(ye){const Ee=this.current,Ne=this.commonObjs.get(ye[0]);let Me=ye[1];Ee.font=Ne,this.embedFonts&&!Ne.missingFile&&!this.embeddedFonts[Ne.loadedName]&&(this.addFontStyle(Ne),this.embeddedFonts[Ne.loadedName]=Ne),Ee.fontMatrix=Ne.fontMatrix||ie.FONT_IDENTITY_MATRIX;let we="normal";Ne.black?we="900":Ne.bold&&(we="bold");const Oe=Ne.italic?"italic":"normal";Me<0?(Me=-Me,Ee.fontDirection=-1):Ee.fontDirection=1,Ee.fontSize=Me,Ee.fontFamily=Ne.loadedName,Ee.fontWeight=we,Ee.fontStyle=Oe,Ee.tspan=this.svgFactory.createElement("svg:tspan"),Ee.tspan.setAttributeNS(null,"y",me(-Ee.y)),Ee.xcoords=[],Ee.ycoords=[]}endText(){var Ee;const ye=this.current;ye.textRenderingMode&ie.TextRenderingMode.ADD_TO_PATH_FLAG&&((Ee=ye.txtElement)!=null&&Ee.hasChildNodes())&&(ye.element=ye.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(ye){ye>0&&(this.current.lineWidth=ye)}setLineCap(ye){this.current.lineCap=ue[ye]}setLineJoin(ye){this.current.lineJoin=de[ye]}setMiterLimit(ye){this.current.miterLimit=ye}setStrokeAlpha(ye){this.current.strokeAlpha=ye}setStrokeRGBColor(ye,Ee,Ne){this.current.strokeColor=ie.Util.makeHexColor(ye,Ee,Ne)}setFillAlpha(ye){this.current.fillAlpha=ye}setFillRGBColor(ye,Ee,Ne){this.current.fillColor=ie.Util.makeHexColor(ye,Ee,Ne),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(ye){this.current.strokeColor=this._makeColorN_Pattern(ye)}setFillColorN(ye){this.current.fillColor=this._makeColorN_Pattern(ye)}shadingFill(ye){const{width:Ee,height:Ne}=this.viewport,Me=ie.Util.inverseTransform(this.transformMatrix),[we,Oe,Fe,Ve]=ie.Util.getAxialAlignedBoundingBox([0,0,Ee,Ne],Me),qe=this.svgFactory.createElement("svg:rect");qe.setAttributeNS(null,"x",we),qe.setAttributeNS(null,"y",Oe),qe.setAttributeNS(null,"width",Fe-we),qe.setAttributeNS(null,"height",Ve-Oe),qe.setAttributeNS(null,"fill",this._makeShadingPattern(ye)),this.current.fillAlpha<1&&qe.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(qe)}_makeColorN_Pattern(ye){return ye[0]==="TilingPattern"?this._makeTilingPattern(ye):this._makeShadingPattern(ye)}_makeTilingPattern(ye){const Ee=ye[1],Ne=ye[2],Me=ye[3]||ie.IDENTITY_MATRIX,[we,Oe,Fe,Ve]=ye[4],qe=ye[5],Ie=ye[6],Xe=ye[7],rt="shading".concat(Pe++),[lt,Ge,ut,mt]=ie.Util.normalizeRect([...ie.Util.applyTransform([we,Oe],Me),...ie.Util.applyTransform([Fe,Ve],Me)]),[wt,Et]=ie.Util.singularValueDecompose2dScale(Me),De=qe*wt,pe=Ie*Et,be=this.svgFactory.createElement("svg:pattern");be.setAttributeNS(null,"id",rt),be.setAttributeNS(null,"patternUnits","userSpaceOnUse"),be.setAttributeNS(null,"width",De),be.setAttributeNS(null,"height",pe),be.setAttributeNS(null,"x","".concat(lt)),be.setAttributeNS(null,"y","".concat(Ge));const ge=this.svg,Ce=this.transformMatrix,xe=this.current.fillColor,Le=this.current.strokeColor,Be=this.svgFactory.create(ut-lt,mt-Ge);if(this.svg=Be,this.transformMatrix=Me,Xe===2){const He=ie.Util.makeHexColor(...Ee);this.current.fillColor=He,this.current.strokeColor=He}return this.executeOpTree(this.convertOpList(Ne)),this.svg=ge,this.transformMatrix=Ce,this.current.fillColor=xe,this.current.strokeColor=Le,be.append(Be.childNodes[0]),this.defs.append(be),"url(#".concat(rt,")")}_makeShadingPattern(ye){switch(typeof ye=="string"&&(ye=this.objs.get(ye)),ye[0]){case"RadialAxial":const Ee="shading".concat(Pe++),Ne=ye[3];let Me;switch(ye[1]){case"axial":const we=ye[4],Oe=ye[5];Me=this.svgFactory.createElement("svg:linearGradient"),Me.setAttributeNS(null,"id",Ee),Me.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),Me.setAttributeNS(null,"x1",we[0]),Me.setAttributeNS(null,"y1",we[1]),Me.setAttributeNS(null,"x2",Oe[0]),Me.setAttributeNS(null,"y2",Oe[1]);break;case"radial":const Fe=ye[4],Ve=ye[5],qe=ye[6],Ie=ye[7];Me=this.svgFactory.createElement("svg:radialGradient"),Me.setAttributeNS(null,"id",Ee),Me.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),Me.setAttributeNS(null,"cx",Ve[0]),Me.setAttributeNS(null,"cy",Ve[1]),Me.setAttributeNS(null,"r",Ie),Me.setAttributeNS(null,"fx",Fe[0]),Me.setAttributeNS(null,"fy",Fe[1]),Me.setAttributeNS(null,"fr",qe);break;default:throw new Error("Unknown RadialAxial type: ".concat(ye[1]))}for(const we of Ne){const Oe=this.svgFactory.createElement("svg:stop");Oe.setAttributeNS(null,"offset",we[0]),Oe.setAttributeNS(null,"stop-color",we[1]),Me.append(Oe)}return this.defs.append(Me),"url(#".concat(Ee,")");case"Mesh":return(0,ie.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(ye[0]))}}setDash(ye,Ee){this.current.dashArray=ye,this.current.dashPhase=Ee}constructPath(ye,Ee){const Ne=this.current;let Me=Ne.x,we=Ne.y,Oe=[],Fe=0;for(const Ve of ye)switch(Ve|0){case ie.OPS.rectangle:Me=Ee[Fe++],we=Ee[Fe++];const qe=Ee[Fe++],Ie=Ee[Fe++],Xe=Me+qe,rt=we+Ie;Oe.push("M",me(Me),me(we),"L",me(Xe),me(we),"L",me(Xe),me(rt),"L",me(Me),me(rt),"Z");break;case ie.OPS.moveTo:Me=Ee[Fe++],we=Ee[Fe++],Oe.push("M",me(Me),me(we));break;case ie.OPS.lineTo:Me=Ee[Fe++],we=Ee[Fe++],Oe.push("L",me(Me),me(we));break;case ie.OPS.curveTo:Me=Ee[Fe+4],we=Ee[Fe+5],Oe.push("C",me(Ee[Fe]),me(Ee[Fe+1]),me(Ee[Fe+2]),me(Ee[Fe+3]),me(Me),me(we)),Fe+=6;break;case ie.OPS.curveTo2:Oe.push("C",me(Me),me(we),me(Ee[Fe]),me(Ee[Fe+1]),me(Ee[Fe+2]),me(Ee[Fe+3])),Me=Ee[Fe+2],we=Ee[Fe+3],Fe+=4;break;case ie.OPS.curveTo3:Me=Ee[Fe+2],we=Ee[Fe+3],Oe.push("C",me(Ee[Fe]),me(Ee[Fe+1]),me(Me),me(we),me(Me),me(we)),Fe+=4;break;case ie.OPS.closePath:Oe.push("Z");break}Oe=Oe.join(" "),Ne.path&&ye.length>0&&ye[0]!==ie.OPS.rectangle&&ye[0]!==ie.OPS.moveTo?Oe=Ne.path.getAttributeNS(null,"d")+Oe:(Ne.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(Ne.path)),Ne.path.setAttributeNS(null,"d",Oe),Ne.path.setAttributeNS(null,"fill","none"),Ne.element=Ne.path,Ne.setCurrentPoint(Me,we)}endPath(){const ye=this.current;if(ye.path=null,!this.pendingClip)return;if(!ye.element){this.pendingClip=null;return}const Ee="clippath".concat(Se++),Ne=this.svgFactory.createElement("svg:clipPath");Ne.setAttributeNS(null,"id",Ee),Ne.setAttributeNS(null,"transform",ve(this.transformMatrix));const Me=ye.element.cloneNode(!0);if(this.pendingClip==="evenodd"?Me.setAttributeNS(null,"clip-rule","evenodd"):Me.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,Ne.append(Me),this.defs.append(Ne),ye.activeClipUrl){ye.clipGroup=null;for(const we of this.extraStack)we.clipGroup=null;Ne.setAttributeNS(null,"clip-path",ye.activeClipUrl)}ye.activeClipUrl="url(#".concat(Ee,")"),this.tgrp=null}clip(ye){this.pendingClip=ye}closePath(){const ye=this.current;if(ye.path){const Ee="".concat(ye.path.getAttributeNS(null,"d"),"Z");ye.path.setAttributeNS(null,"d",Ee)}}setLeading(ye){this.current.leading=-ye}setTextRise(ye){this.current.textRise=ye}setTextRenderingMode(ye){this.current.textRenderingMode=ye}setHScale(ye){this.current.textHScale=ye/100}setRenderingIntent(ye){}setFlatness(ye){}setGState(ye){for(const[Ee,Ne]of ye)switch(Ee){case"LW":this.setLineWidth(Ne);break;case"LC":this.setLineCap(Ne);break;case"LJ":this.setLineJoin(Ne);break;case"ML":this.setMiterLimit(Ne);break;case"D":this.setDash(Ne[0],Ne[1]);break;case"RI":this.setRenderingIntent(Ne);break;case"FL":this.setFlatness(Ne);break;case"Font":this.setFont(Ne);break;case"CA":this.setStrokeAlpha(Ne);break;case"ca":this.setFillAlpha(Ne);break;default:(0,ie.warn)("Unimplemented graphic state operator ".concat(Ee));break}}fill(){const ye=this.current;ye.element&&(ye.element.setAttributeNS(null,"fill",ye.fillColor),ye.element.setAttributeNS(null,"fill-opacity",ye.fillAlpha),this.endPath())}stroke(){const ye=this.current;ye.element&&(this._setStrokeAttributes(ye.element),ye.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(ye,Ee=1){const Ne=this.current;let Me=Ne.dashArray;Ee!==1&&Me.length>0&&(Me=Me.map(function(we){return Ee*we})),ye.setAttributeNS(null,"stroke",Ne.strokeColor),ye.setAttributeNS(null,"stroke-opacity",Ne.strokeAlpha),ye.setAttributeNS(null,"stroke-miterlimit",me(Ne.miterLimit)),ye.setAttributeNS(null,"stroke-linecap",Ne.lineCap),ye.setAttributeNS(null,"stroke-linejoin",Ne.lineJoin),ye.setAttributeNS(null,"stroke-width",me(Ee*Ne.lineWidth)+"px"),ye.setAttributeNS(null,"stroke-dasharray",Me.map(me).join(" ")),ye.setAttributeNS(null,"stroke-dashoffset",me(Ee*Ne.dashPhase)+"px")}eoFill(){var ye;(ye=this.current.element)==null||ye.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var ye;(ye=this.current.element)==null||ye.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const ye=this.svgFactory.createElement("svg:rect");ye.setAttributeNS(null,"x","0"),ye.setAttributeNS(null,"y","0"),ye.setAttributeNS(null,"width","1px"),ye.setAttributeNS(null,"height","1px"),ye.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(ye)}paintImageXObject(ye){const Ee=this.getObject(ye);if(!Ee){(0,ie.warn)("Dependent image with object ID ".concat(ye," is not ready yet"));return}this.paintInlineImageXObject(Ee)}paintInlineImageXObject(ye,Ee){const Ne=ye.width,Me=ye.height,we=le(ye,this.forceDataSchema,!!Ee),Oe=this.svgFactory.createElement("svg:rect");Oe.setAttributeNS(null,"x","0"),Oe.setAttributeNS(null,"y","0"),Oe.setAttributeNS(null,"width",me(Ne)),Oe.setAttributeNS(null,"height",me(Me)),this.current.element=Oe,this.clip("nonzero");const Fe=this.svgFactory.createElement("svg:image");Fe.setAttributeNS(he,"xlink:href",we),Fe.setAttributeNS(null,"x","0"),Fe.setAttributeNS(null,"y",me(-Me)),Fe.setAttributeNS(null,"width",me(Ne)+"px"),Fe.setAttributeNS(null,"height",me(Me)+"px"),Fe.setAttributeNS(null,"transform","scale(".concat(me(1/Ne)," ").concat(me(-1/Me),")")),Ee?Ee.append(Fe):this._ensureTransformGroup().append(Fe)}paintImageMaskXObject(ye){const Ee=this.getObject(ye.data,ye);if(Ee.bitmap){(0,ie.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const Ne=this.current,Me=Ee.width,we=Ee.height,Oe=Ne.fillColor;Ne.maskId="mask".concat(Te++);const Fe=this.svgFactory.createElement("svg:mask");Fe.setAttributeNS(null,"id",Ne.maskId);const Ve=this.svgFactory.createElement("svg:rect");Ve.setAttributeNS(null,"x","0"),Ve.setAttributeNS(null,"y","0"),Ve.setAttributeNS(null,"width",me(Me)),Ve.setAttributeNS(null,"height",me(we)),Ve.setAttributeNS(null,"fill",Oe),Ve.setAttributeNS(null,"mask","url(#".concat(Ne.maskId,")")),this.defs.append(Fe),this._ensureTransformGroup().append(Ve),this.paintInlineImageXObject(Ee,Fe)}paintFormXObjectBegin(ye,Ee){if(Array.isArray(ye)&&ye.length===6&&this.transform(ye[0],ye[1],ye[2],ye[3],ye[4],ye[5]),Ee){const Ne=Ee[2]-Ee[0],Me=Ee[3]-Ee[1],we=this.svgFactory.createElement("svg:rect");we.setAttributeNS(null,"x",Ee[0]),we.setAttributeNS(null,"y",Ee[1]),we.setAttributeNS(null,"width",me(Ne)),we.setAttributeNS(null,"height",me(Me)),this.current.element=we,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(ye){const Ee=this.svgFactory.create(ye.width,ye.height),Ne=this.svgFactory.createElement("svg:defs");Ee.append(Ne),this.defs=Ne;const Me=this.svgFactory.createElement("svg:g");return Me.setAttributeNS(null,"transform",ve(ye.transform)),Ee.append(Me),this.svg=Me,Ee}_ensureClipGroup(){if(!this.current.clipGroup){const ye=this.svgFactory.createElement("svg:g");ye.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(ye),this.current.clipGroup=ye}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",ve(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}te.SVGGraphics=Re},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.XfaText=void 0;class ne{static textContent(ie){const se=[],oe={items:se,styles:Object.create(null)};function he(ue){var le;if(!ue)return;let de=null;const ae=ue.name;if(ae==="#text")de=ue.value;else if(ne.shouldBuildText(ae))(le=ue==null?void 0:ue.attributes)!=null&&le.textContent?de=ue.attributes.textContent:ue.value&&(de=ue.value);else return;if(de!==null&&se.push({str:de}),!!ue.children)for(const Ae of ue.children)he(Ae)}return he(ie),oe}static shouldBuildText(ie){return!(ie==="textarea"||ie==="input"||ie==="option"||ie==="select")}}te.XfaText=ne},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.TextLayerRenderTask=void 0,te.renderTextLayer=ve,te.updateTextLayer=Se;var re=ne(1),ie=ne(6);const se=1e5,oe=30,he=.8,ue=new Map;function de(Te,Pe){let Re;if(Pe&&re.FeatureTest.isOffscreenCanvasSupported)Re=new OffscreenCanvas(Te,Te).getContext("2d",{alpha:!1});else{const $e=document.createElement("canvas");$e.width=$e.height=Te,Re=$e.getContext("2d",{alpha:!1})}return Re}function ae(Te,Pe){const Re=ue.get(Te);if(Re)return Re;const $e=de(oe,Pe);$e.font="".concat(oe,"px ").concat(Te);const ye=$e.measureText("");let Ee=ye.fontBoundingBoxAscent,Ne=Math.abs(ye.fontBoundingBoxDescent);if(Ee){const we=Ee/(Ee+Ne);return ue.set(Te,we),$e.canvas.width=$e.canvas.height=0,we}$e.strokeStyle="red",$e.clearRect(0,0,oe,oe),$e.strokeText("g",0,0);let Me=$e.getImageData(0,0,oe,oe).data;Ne=0;for(let we=Me.length-1-3;we>=0;we-=4)if(Me[we]>0){Ne=Math.ceil(we/4/oe);break}$e.clearRect(0,0,oe,oe),$e.strokeText("A",0,oe),Me=$e.getImageData(0,0,oe,oe).data,Ee=0;for(let we=0,Oe=Me.length;we<Oe;we+=4)if(Me[we]>0){Ee=oe-Math.floor(we/4/oe);break}if($e.canvas.width=$e.canvas.height=0,Ee){const we=Ee/(Ee+Ne);return ue.set(Te,we),we}return ue.set(Te,he),he}function le(Te,Pe,Re){const $e=document.createElement("span"),ye={angle:0,canvasWidth:0,hasText:Pe.str!=="",hasEOL:Pe.hasEOL,fontSize:0};Te._textDivs.push($e);const Ee=re.Util.transform(Te._transform,Pe.transform);let Ne=Math.atan2(Ee[1],Ee[0]);const Me=Re[Pe.fontName];Me.vertical&&(Ne+=Math.PI/2);const we=Math.hypot(Ee[2],Ee[3]),Oe=we*ae(Me.fontFamily,Te._isOffscreenCanvasSupported);let Fe,Ve;Ne===0?(Fe=Ee[4],Ve=Ee[5]-Oe):(Fe=Ee[4]+Oe*Math.sin(Ne),Ve=Ee[5]-Oe*Math.cos(Ne));const qe="calc(var(--scale-factor)*",Ie=$e.style;Te._container===Te._rootContainer?(Ie.left="".concat((100*Fe/Te._pageWidth).toFixed(2),"%"),Ie.top="".concat((100*Ve/Te._pageHeight).toFixed(2),"%")):(Ie.left="".concat(qe).concat(Fe.toFixed(2),"px)"),Ie.top="".concat(qe).concat(Ve.toFixed(2),"px)")),Ie.fontSize="".concat(qe).concat(we.toFixed(2),"px)"),Ie.fontFamily=Me.fontFamily,ye.fontSize=we,$e.setAttribute("role","presentation"),$e.textContent=Pe.str,$e.dir=Pe.dir,Te._fontInspectorEnabled&&($e.dataset.fontName=Pe.fontName),Ne!==0&&(ye.angle=Ne*(180/Math.PI));let Xe=!1;if(Pe.str.length>1)Xe=!0;else if(Pe.str!==" "&&Pe.transform[0]!==Pe.transform[3]){const rt=Math.abs(Pe.transform[0]),lt=Math.abs(Pe.transform[3]);rt!==lt&&Math.max(rt,lt)/Math.min(rt,lt)>1.5&&(Xe=!0)}Xe&&(ye.canvasWidth=Me.vertical?Pe.height:Pe.width),Te._textDivProperties.set($e,ye),Te._isReadableStream&&Te._layoutText($e)}function Ae(Te){const{div:Pe,scale:Re,properties:$e,ctx:ye,prevFontSize:Ee,prevFontFamily:Ne}=Te,{style:Me}=Pe;let we="";if($e.canvasWidth!==0&&$e.hasText){const{fontFamily:Oe}=Me,{canvasWidth:Fe,fontSize:Ve}=$e;(Ee!==Ve||Ne!==Oe)&&(ye.font="".concat(Ve*Re,"px ").concat(Oe),Te.prevFontSize=Ve,Te.prevFontFamily=Oe);const{width:qe}=ye.measureText(Pe.textContent);qe>0&&(we="scaleX(".concat(Fe*Re/qe,")"))}$e.angle!==0&&(we="rotate(".concat($e.angle,"deg) ").concat(we)),we.length>0&&(Me.transform=we)}function _e(Te){if(Te._canceled)return;const Pe=Te._textDivs,Re=Te._capability;if(Pe.length>se){Re.resolve();return}if(!Te._isReadableStream)for(const ye of Pe)Te._layoutText(ye);Re.resolve()}class me{constructor({textContentSource:Pe,container:Re,viewport:$e,textDivs:ye,textDivProperties:Ee,textContentItemsStr:Ne,isOffscreenCanvasSupported:Me}){var qe;this._textContentSource=Pe,this._isReadableStream=Pe instanceof ReadableStream,this._container=this._rootContainer=Re,this._textDivs=ye||[],this._textContentItemsStr=Ne||[],this._isOffscreenCanvasSupported=Me,this._fontInspectorEnabled=!!((qe=globalThis.FontInspector)!=null&&qe.enabled),this._reader=null,this._textDivProperties=Ee||new WeakMap,this._canceled=!1,this._capability=new re.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:$e.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:de(0,Me)};const{pageWidth:we,pageHeight:Oe,pageX:Fe,pageY:Ve}=$e.rawDims;this._transform=[1,0,0,-1,-Fe,Ve+Oe],this._pageWidth=we,this._pageHeight=Oe,(0,ie.setLayerDimensions)(Re,$e),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new re.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new re.AbortException("TextLayer task cancelled."))}_processItems(Pe,Re){for(const $e of Pe){if($e.str===void 0){if($e.type==="beginMarkedContentProps"||$e.type==="beginMarkedContent"){const ye=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),$e.id!==null&&this._container.setAttribute("id","".concat($e.id)),ye.append(this._container)}else $e.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push($e.str),le(this,$e,Re)}}_layoutText(Pe){const Re=this._layoutTextParams.properties=this._textDivProperties.get(Pe);if(this._layoutTextParams.div=Pe,Ae(this._layoutTextParams),Re.hasText&&this._container.append(Pe),Re.hasEOL){const $e=document.createElement("br");$e.setAttribute("role","presentation"),this._container.append($e)}}_render(){const Pe=new re.PromiseCapability;let Re=Object.create(null);if(this._isReadableStream){const $e=()=>{this._reader.read().then(({value:ye,done:Ee})=>{if(Ee){Pe.resolve();return}Object.assign(Re,ye.styles),this._processItems(ye.items,Re),$e()},Pe.reject)};this._reader=this._textContentSource.getReader(),$e()}else if(this._textContentSource){const{items:$e,styles:ye}=this._textContentSource;this._processItems($e,ye),Pe.resolve()}else throw new Error('No "textContentSource" parameter specified.');Pe.promise.then(()=>{Re=null,_e(this)},this._capability.reject)}}te.TextLayerRenderTask=me;function ve(Te){!Te.textContentSource&&(Te.textContent||Te.textContentStream)&&((0,ie.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),Te.textContentSource=Te.textContent||Te.textContentStream);const{container:Pe,viewport:Re}=Te,$e=getComputedStyle(Pe),ye=$e.getPropertyValue("visibility"),Ee=parseFloat($e.getPropertyValue("--scale-factor"));ye==="visible"&&(!Ee||Math.abs(Ee-Re.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const Ne=new me(Te);return Ne._render(),Ne}function Se({container:Te,viewport:Pe,textDivs:Re,textDivProperties:$e,isOffscreenCanvasSupported:ye,mustRotate:Ee=!0,mustRescale:Ne=!0}){if(Ee&&(0,ie.setLayerDimensions)(Te,{rotation:Pe.rotation}),Ne){const Me=de(0,ye),Oe={prevFontSize:null,prevFontFamily:null,div:null,scale:Pe.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:Me};for(const Fe of Re)Oe.properties=$e.get(Fe),Oe.div=Fe,Ae(Oe)}}},(ee,te,ne)=>{var ae,le,Ae,_e,me,ve,Se,Te,Pe,Re,$e,Er,Ee,Jn,Me,Tr,Oe,Cr;Object.defineProperty(te,"__esModule",{value:!0}),te.AnnotationEditorLayer=void 0;var re=ne(1),ie=ne(4),se=ne(28),oe=ne(33),he=ne(6),ue=ne(34);const Ve=class Ve{constructor({uiManager:Ie,pageIndex:Xe,div:rt,accessibilityManager:lt,annotationLayer:Ge,viewport:ut,l10n:mt}){We(this,$e);We(this,Ee);We(this,Me);We(this,Oe);We(this,ae,void 0);We(this,le,!1);We(this,Ae,null);We(this,_e,this.pointerup.bind(this));We(this,me,this.pointerdown.bind(this));We(this,ve,new Map);We(this,Se,!1);We(this,Te,!1);We(this,Pe,!1);We(this,Re,void 0);const wt=[se.FreeTextEditor,oe.InkEditor,ue.StampEditor];if(!Ve._initialized){Ve._initialized=!0;for(const Et of wt)Et.initialize(mt)}Ie.registerEditorTypes(wt),st(this,Re,Ie),this.pageIndex=Xe,this.div=rt,st(this,ae,lt),st(this,Ae,Ge),this.viewport=ut,ce(this,Re).addLayer(this)}get isEmpty(){return ce(this,ve).size===0}updateToolbar(Ie){ce(this,Re).updateToolbar(Ie)}updateMode(Ie=ce(this,Re).getMode()){Ke(this,Oe,Cr).call(this),Ie===re.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),Ie!==re.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",Ie===re.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",Ie===re.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",Ie===re.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(Ie){if(!Ie&&ce(this,Re).getMode()!==re.AnnotationEditorType.INK)return;if(!Ie){for(const rt of ce(this,ve).values())if(rt.isEmpty()){rt.setInBackground();return}}Ke(this,Ee,Jn).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(Ie){ce(this,Re).setEditingState(Ie)}addCommands(Ie){ce(this,Re).addCommands(Ie)}enable(){this.div.style.pointerEvents="auto";const Ie=new Set;for(const rt of ce(this,ve).values())rt.enableEditing(),rt.annotationElementId&&Ie.add(rt.annotationElementId);if(!ce(this,Ae))return;const Xe=ce(this,Ae).getEditableAnnotations();for(const rt of Xe){if(rt.hide(),ce(this,Re).isDeletedAnnotationElement(rt.data.id)||Ie.has(rt.data.id))continue;const lt=this.deserialize(rt);lt&&(this.addOrRebuild(lt),lt.enableEditing())}}disable(){var Xe;st(this,Pe,!0),this.div.style.pointerEvents="none";const Ie=new Set;for(const rt of ce(this,ve).values()){if(rt.disableEditing(),!rt.annotationElementId||rt.serialize()!==null){Ie.add(rt.annotationElementId);continue}(Xe=this.getEditableAnnotation(rt.annotationElementId))==null||Xe.show(),rt.remove()}if(ce(this,Ae)){const rt=ce(this,Ae).getEditableAnnotations();for(const lt of rt){const{id:Ge}=lt.data;Ie.has(Ge)||ce(this,Re).isDeletedAnnotationElement(Ge)||lt.show()}}Ke(this,Oe,Cr).call(this),this.isEmpty&&(this.div.hidden=!0),st(this,Pe,!1)}getEditableAnnotation(Ie){var Xe;return((Xe=ce(this,Ae))==null?void 0:Xe.getEditableAnnotation(Ie))||null}setActiveEditor(Ie){ce(this,Re).getActive()!==Ie&&ce(this,Re).setActiveEditor(Ie)}enableClick(){this.div.addEventListener("pointerdown",ce(this,me)),this.div.addEventListener("pointerup",ce(this,_e))}disableClick(){this.div.removeEventListener("pointerdown",ce(this,me)),this.div.removeEventListener("pointerup",ce(this,_e))}attach(Ie){ce(this,ve).set(Ie.id,Ie);const{annotationElementId:Xe}=Ie;Xe&&ce(this,Re).isDeletedAnnotationElement(Xe)&&ce(this,Re).removeDeletedAnnotationElement(Ie)}detach(Ie){var Xe;ce(this,ve).delete(Ie.id),(Xe=ce(this,ae))==null||Xe.removePointerInTextLayer(Ie.contentDiv),!ce(this,Pe)&&Ie.annotationElementId&&ce(this,Re).addDeletedAnnotationElement(Ie)}remove(Ie){this.detach(Ie),ce(this,Re).removeEditor(Ie),Ie.div.contains(document.activeElement)&&setTimeout(()=>{ce(this,Re).focusMainContainer()},0),Ie.div.remove(),Ie.isAttachedToDOM=!1,ce(this,Te)||this.addInkEditorIfNeeded(!1)}changeParent(Ie){var Xe;Ie.parent!==this&&(Ie.annotationElementId&&(ce(this,Re).addDeletedAnnotationElement(Ie.annotationElementId),ie.AnnotationEditor.deleteAnnotationElement(Ie),Ie.annotationElementId=null),this.attach(Ie),(Xe=Ie.parent)==null||Xe.detach(Ie),Ie.setParent(this),Ie.div&&Ie.isAttachedToDOM&&(Ie.div.remove(),this.div.append(Ie.div)))}add(Ie){if(this.changeParent(Ie),ce(this,Re).addEditor(Ie),this.attach(Ie),!Ie.isAttachedToDOM){const Xe=Ie.render();this.div.append(Xe),Ie.isAttachedToDOM=!0}Ie.fixAndSetPosition(),Ie.onceAdded(),ce(this,Re).addToAnnotationStorage(Ie)}moveEditorInDOM(Ie){var rt;if(!Ie.isAttachedToDOM)return;const{activeElement:Xe}=document;Ie.div.contains(Xe)&&(Ie._focusEventsAllowed=!1,setTimeout(()=>{Ie.div.contains(document.activeElement)?Ie._focusEventsAllowed=!0:(Ie.div.addEventListener("focusin",()=>{Ie._focusEventsAllowed=!0},{once:!0}),Xe.focus())},0)),Ie._structTreeParentId=(rt=ce(this,ae))==null?void 0:rt.moveElementInDOM(this.div,Ie.div,Ie.contentDiv,!0)}addOrRebuild(Ie){Ie.needsToBeRebuilt()?Ie.rebuild():this.add(Ie)}addUndoableEditor(Ie){const Xe=()=>Ie._uiManager.rebuild(Ie),rt=()=>{Ie.remove()};this.addCommands({cmd:Xe,undo:rt,mustExec:!1})}getNextId(){return ce(this,Re).getId()}pasteEditor(Ie,Xe){ce(this,Re).updateToolbar(Ie),ce(this,Re).updateMode(Ie);const{offsetX:rt,offsetY:lt}=Ke(this,Me,Tr).call(this),Ge=this.getNextId(),ut=Ke(this,$e,Er).call(this,{parent:this,id:Ge,x:rt,y:lt,uiManager:ce(this,Re),isCentered:!0,...Xe});ut&&this.add(ut)}deserialize(Ie){var Xe;switch((Xe=Ie.annotationType)!=null?Xe:Ie.annotationEditorType){case re.AnnotationEditorType.FREETEXT:return se.FreeTextEditor.deserialize(Ie,this,ce(this,Re));case re.AnnotationEditorType.INK:return oe.InkEditor.deserialize(Ie,this,ce(this,Re));case re.AnnotationEditorType.STAMP:return ue.StampEditor.deserialize(Ie,this,ce(this,Re))}return null}addNewEditor(){Ke(this,Ee,Jn).call(this,Ke(this,Me,Tr).call(this),!0)}setSelected(Ie){ce(this,Re).setSelected(Ie)}toggleSelected(Ie){ce(this,Re).toggleSelected(Ie)}isSelected(Ie){return ce(this,Re).isSelected(Ie)}unselect(Ie){ce(this,Re).unselect(Ie)}pointerup(Ie){const{isMac:Xe}=re.FeatureTest.platform;if(!(Ie.button!==0||Ie.ctrlKey&&Xe)&&Ie.target===this.div&&ce(this,Se)){if(st(this,Se,!1),!ce(this,le)){st(this,le,!0);return}if(ce(this,Re).getMode()===re.AnnotationEditorType.STAMP){ce(this,Re).unselectAll();return}Ke(this,Ee,Jn).call(this,Ie,!1)}}pointerdown(Ie){if(ce(this,Se)){st(this,Se,!1);return}const{isMac:Xe}=re.FeatureTest.platform;if(Ie.button!==0||Ie.ctrlKey&&Xe||Ie.target!==this.div)return;st(this,Se,!0);const rt=ce(this,Re).getActive();st(this,le,!rt||rt.isEmpty())}findNewParent(Ie,Xe,rt){const lt=ce(this,Re).findParent(Xe,rt);return lt===null||lt===this?!1:(lt.changeParent(Ie),!0)}destroy(){var Ie,Xe;((Ie=ce(this,Re).getActive())==null?void 0:Ie.parent)===this&&(ce(this,Re).commitOrRemove(),ce(this,Re).setActiveEditor(null));for(const rt of ce(this,ve).values())(Xe=ce(this,ae))==null||Xe.removePointerInTextLayer(rt.contentDiv),rt.setParent(null),rt.isAttachedToDOM=!1,rt.div.remove();this.div=null,ce(this,ve).clear(),ce(this,Re).removeLayer(this)}render({viewport:Ie}){this.viewport=Ie,(0,he.setLayerDimensions)(this.div,Ie);for(const Xe of ce(this,Re).getEditors(this.pageIndex))this.add(Xe);this.updateMode()}update({viewport:Ie}){ce(this,Re).commitOrRemove(),this.viewport=Ie,(0,he.setLayerDimensions)(this.div,{rotation:Ie.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:Ie,pageHeight:Xe}=this.viewport.rawDims;return[Ie,Xe]}};ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakMap,Pe=new WeakMap,Re=new WeakMap,$e=new WeakSet,Er=function(Ie){switch(ce(this,Re).getMode()){case re.AnnotationEditorType.FREETEXT:return new se.FreeTextEditor(Ie);case re.AnnotationEditorType.INK:return new oe.InkEditor(Ie);case re.AnnotationEditorType.STAMP:return new ue.StampEditor(Ie)}return null},Ee=new WeakSet,Jn=function(Ie,Xe){const rt=this.getNextId(),lt=Ke(this,$e,Er).call(this,{parent:this,id:rt,x:Ie.offsetX,y:Ie.offsetY,uiManager:ce(this,Re),isCentered:Xe});return lt&&this.add(lt),lt},Me=new WeakSet,Tr=function(){const{x:Ie,y:Xe,width:rt,height:lt}=this.div.getBoundingClientRect(),Ge=Math.max(0,Ie),ut=Math.max(0,Xe),mt=Math.min(window.innerWidth,Ie+rt),wt=Math.min(window.innerHeight,Xe+lt),Et=(Ge+mt)/2-Ie,De=(ut+wt)/2-Xe,[pe,be]=this.viewport.rotation%180===0?[Et,De]:[De,Et];return{offsetX:pe,offsetY:be}},Oe=new WeakSet,Cr=function(){st(this,Te,!0);for(const Ie of ce(this,ve).values())Ie.isEmpty()&&Ie.remove();st(this,Te,!1)},An(Ve,"_initialized",!1);let de=Ve;te.AnnotationEditorLayer=de},(ee,te,ne)=>{var ue,de,ae,le,Ae,_e,me,ve,Se,Te,Qr,Re,ei,ye,ti,Ne,Wn,we,xr,Fe,ni,qe,Pr;Object.defineProperty(te,"__esModule",{value:!0}),te.FreeTextEditor=void 0;var re=ne(1),ie=ne(5),se=ne(4),oe=ne(29);const Xe=class Xe extends se.AnnotationEditor{constructor(Ge){super({...Ge,name:"freeTextEditor"});We(this,Te);We(this,Re);We(this,ye);We(this,Ne);We(this,we);We(this,Fe);We(this,qe);We(this,ue,this.editorDivBlur.bind(this));We(this,de,this.editorDivFocus.bind(this));We(this,ae,this.editorDivInput.bind(this));We(this,le,this.editorDivKeydown.bind(this));We(this,Ae,void 0);We(this,_e,"");We(this,me,"".concat(this.id,"-editor"));We(this,ve,void 0);We(this,Se,null);st(this,Ae,Ge.color||Xe._defaultColor||se.AnnotationEditor._defaultLineColor),st(this,ve,Ge.fontSize||Xe._defaultFontSize)}static get _keyboardManager(){const Ge=Xe.prototype,ut=Et=>Et.isEmpty(),mt=ie.AnnotationEditorUIManager.TRANSLATE_SMALL,wt=ie.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,re.shadow)(this,"_keyboardManager",new ie.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],Ge.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],Ge.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],Ge._translateEmpty,{args:[-mt,0],checker:ut}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],Ge._translateEmpty,{args:[-wt,0],checker:ut}],[["ArrowRight","mac+ArrowRight"],Ge._translateEmpty,{args:[mt,0],checker:ut}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],Ge._translateEmpty,{args:[wt,0],checker:ut}],[["ArrowUp","mac+ArrowUp"],Ge._translateEmpty,{args:[0,-mt],checker:ut}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],Ge._translateEmpty,{args:[0,-wt],checker:ut}],[["ArrowDown","mac+ArrowDown"],Ge._translateEmpty,{args:[0,mt],checker:ut}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],Ge._translateEmpty,{args:[0,wt],checker:ut}]]))}static initialize(Ge){se.AnnotationEditor.initialize(Ge,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const ut=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(ut.getPropertyValue("--freetext-padding"))}static updateDefaultParams(Ge,ut){switch(Ge){case re.AnnotationEditorParamsType.FREETEXT_SIZE:Xe._defaultFontSize=ut;break;case re.AnnotationEditorParamsType.FREETEXT_COLOR:Xe._defaultColor=ut;break}}updateParams(Ge,ut){switch(Ge){case re.AnnotationEditorParamsType.FREETEXT_SIZE:Ke(this,Te,Qr).call(this,ut);break;case re.AnnotationEditorParamsType.FREETEXT_COLOR:Ke(this,Re,ei).call(this,ut);break}}static get defaultPropertiesToUpdate(){return[[re.AnnotationEditorParamsType.FREETEXT_SIZE,Xe._defaultFontSize],[re.AnnotationEditorParamsType.FREETEXT_COLOR,Xe._defaultColor||se.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[re.AnnotationEditorParamsType.FREETEXT_SIZE,ce(this,ve)],[re.AnnotationEditorParamsType.FREETEXT_COLOR,ce(this,Ae)]]}_translateEmpty(Ge,ut){this._uiManager.translateSelectedEditors(Ge,ut,!0)}getInitialTranslation(){const Ge=this.parentScale;return[-Xe._internalPadding*Ge,-(Xe._internalPadding+ce(this,ve))*Ge]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(re.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",ce(this,le)),this.editorDiv.addEventListener("focus",ce(this,de)),this.editorDiv.addEventListener("blur",ce(this,ue)),this.editorDiv.addEventListener("input",ce(this,ae)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",ce(this,me)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",ce(this,le)),this.editorDiv.removeEventListener("focus",ce(this,de)),this.editorDiv.removeEventListener("blur",ce(this,ue)),this.editorDiv.removeEventListener("input",ce(this,ae)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(Ge){this._focusEventsAllowed&&(super.focusin(Ge),Ge.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var Ge;if(this.width){Ke(this,qe,Pr).call(this);return}this.enableEditMode(),this.editorDiv.focus(),(Ge=this._initialOptions)!=null&&Ge.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 Ge=ce(this,_e),ut=st(this,_e,Ke(this,ye,ti).call(this).trimEnd());if(Ge===ut)return;const mt=wt=>{if(st(this,_e,wt),!wt){this.remove();return}Ke(this,we,xr).call(this),this._uiManager.rebuild(this),Ke(this,Ne,Wn).call(this)};this.addCommands({cmd:()=>{mt(ut)},undo:()=>{mt(Ge)},mustExec:!1}),Ke(this,Ne,Wn).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(Ge){this.enterInEditMode()}keydown(Ge){Ge.target===this.div&&Ge.key==="Enter"&&(this.enterInEditMode(),Ge.preventDefault())}editorDivKeydown(Ge){Xe._keyboardManager.exec(this,Ge)}editorDivFocus(Ge){this.isEditing=!0}editorDivBlur(Ge){this.isEditing=!1}editorDivInput(Ge){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 Ge,ut;this.width&&(Ge=this.x,ut=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",ce(this,me)),this.enableEditing(),se.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(wt=>{var Et;return(Et=this.editorDiv)==null?void 0:Et.setAttribute("aria-label",wt)}),se.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(wt=>{var Et;return(Et=this.editorDiv)==null?void 0:Et.setAttribute("default-content",wt)}),this.editorDiv.contentEditable=!0;const{style:mt}=this.editorDiv;if(mt.fontSize="calc(".concat(ce(this,ve),"px * var(--scale-factor))"),mt.color=ce(this,Ae),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,ie.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[wt,Et]=this.parentDimensions;if(this.annotationElementId){const{position:De}=ce(this,Se);let[pe,be]=this.getInitialTranslation();[pe,be]=this.pageTranslationToScreen(pe,be);const[ge,Ce]=this.pageDimensions,[xe,Le]=this.pageTranslation;let Be,He;switch(this.rotation){case 0:Be=Ge+(De[0]-xe)/ge,He=ut+this.height-(De[1]-Le)/Ce;break;case 90:Be=Ge+(De[0]-xe)/ge,He=ut-(De[1]-Le)/Ce,[pe,be]=[be,-pe];break;case 180:Be=Ge-this.width+(De[0]-xe)/ge,He=ut-(De[1]-Le)/Ce,[pe,be]=[-pe,-be];break;case 270:Be=Ge+(De[0]-xe-this.height*Ce)/ge,He=ut+(De[1]-Le-this.width*ge)/Ce,[pe,be]=[-be,pe];break}this.setAt(Be*wt,He*Et,pe,be)}else this.setAt(Ge*wt,ut*Et,this.width*wt,this.height*Et);Ke(this,we,xr).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(Ge,ut,mt){let wt=null;if(Ge instanceof oe.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:De,fontColor:pe},rect:be,rotation:ge,id:Ce},textContent:xe,textPosition:Le,parent:{page:{pageNumber:Be}}}=Ge;if(!xe||xe.length===0)return null;wt=Ge={annotationType:re.AnnotationEditorType.FREETEXT,color:Array.from(pe),fontSize:De,value:xe.join("\n"),position:Le,pageIndex:Be-1,rect:be,rotation:ge,id:Ce,deleted:!1}}const Et=super.deserialize(Ge,ut,mt);return st(Et,ve,Ge.fontSize),st(Et,Ae,re.Util.makeHexColor(...Ge.color)),st(Et,_e,Ge.value),Et.annotationElementId=Ge.id||null,st(Et,Se,wt),Et}serialize(Ge=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const ut=Xe._internalPadding*this.parentScale,mt=this.getRect(ut,ut),wt=se.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:ce(this,Ae)),Et={annotationType:re.AnnotationEditorType.FREETEXT,color:wt,fontSize:ce(this,ve),value:ce(this,_e),pageIndex:this.pageIndex,rect:mt,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return Ge?Et:this.annotationElementId&&!Ke(this,Fe,ni).call(this,Et)?null:(Et.id=this.annotationElementId,Et)}};ue=new WeakMap,de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakSet,Qr=function(Ge){const ut=wt=>{this.editorDiv.style.fontSize="calc(".concat(wt,"px * var(--scale-factor))"),this.translate(0,-(wt-ce(this,ve))*this.parentScale),st(this,ve,wt),Ke(this,Ne,Wn).call(this)},mt=ce(this,ve);this.addCommands({cmd:()=>{ut(Ge)},undo:()=>{ut(mt)},mustExec:!0,type:re.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},Re=new WeakSet,ei=function(Ge){const ut=ce(this,Ae);this.addCommands({cmd:()=>{st(this,Ae,this.editorDiv.style.color=Ge)},undo:()=>{st(this,Ae,this.editorDiv.style.color=ut)},mustExec:!0,type:re.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},ye=new WeakSet,ti=function(){const Ge=this.editorDiv.getElementsByTagName("div");if(Ge.length===0)return this.editorDiv.innerText;const ut=[];for(const mt of Ge)ut.push(mt.innerText.replace(/\r\n?|\n/,""));return ut.join("\n")},Ne=new WeakSet,Wn=function(){const[Ge,ut]=this.parentDimensions;let mt;if(this.isAttachedToDOM)mt=this.div.getBoundingClientRect();else{const{currentLayer:wt,div:Et}=this,De=Et.style.display;Et.style.display="hidden",wt.div.append(this.div),mt=Et.getBoundingClientRect(),Et.remove(),Et.style.display=De}this.rotation%180===this.parentRotation%180?(this.width=mt.width/Ge,this.height=mt.height/ut):(this.width=mt.height/Ge,this.height=mt.width/ut),this.fixAndSetPosition()},we=new WeakSet,xr=function(){if(this.editorDiv.replaceChildren(),!!ce(this,_e))for(const Ge of ce(this,_e).split("\n")){const ut=document.createElement("div");ut.append(Ge?document.createTextNode(Ge):document.createElement("br")),this.editorDiv.append(ut)}},Fe=new WeakSet,ni=function(Ge){const{value:ut,fontSize:mt,color:wt,rect:Et,pageIndex:De}=ce(this,Se);return Ge.value!==ut||Ge.fontSize!==mt||Ge.rect.some((pe,be)=>Math.abs(pe-Et[be])>=1)||Ge.color.some((pe,be)=>pe!==wt[be])||Ge.pageIndex!==De},qe=new WeakSet,Pr=function(Ge=!1){if(!this.annotationElementId)return;if(Ke(this,Ne,Wn).call(this),!Ge&&(this.width===0||this.height===0)){setTimeout(()=>Ke(this,qe,Pr).call(this,!0),0);return}const ut=Xe._internalPadding*this.parentScale;ce(this,Se).rect=this.getRect(ut,ut)},An(Xe,"_freeTextDefaultContent",""),An(Xe,"_internalPadding",0),An(Xe,"_defaultColor",null),An(Xe,"_defaultFontSize",10),An(Xe,"_type","freetext");let he=Xe;te.FreeTextEditor=he},(ee,te,ne)=>{var be,Ce,$n,Le,ri,He,it,et,ot,ht,pt,ct,Pt,It,vt,kt,gt,tt,nt,ft,Tt,Ct,Ht,ii,Ut,Qn,Vt,Rr,Gt,Fr,Qe,Ye,yt,St,wn,Qt,Je,Mr,Lt,Rt,Dt,Nt,si,bt,$r;Object.defineProperty(te,"__esModule",{value:!0}),te.StampAnnotationElement=te.InkAnnotationElement=te.FreeTextAnnotationElement=te.AnnotationLayer=void 0;var re=ne(1),ie=ne(6),se=ne(3),oe=ne(30),he=ne(31),ue=ne(32);const de=1e3,ae=9,le=new WeakSet;function Ae(Ot){return{width:Ot[2]-Ot[0],height:Ot[3]-Ot[1]}}class _e{static create(Ue){switch(Ue.data.annotationType){case re.AnnotationType.LINK:return new ve(Ue);case re.AnnotationType.TEXT:return new Se(Ue);case re.AnnotationType.WIDGET:switch(Ue.data.fieldType){case"Tx":return new Pe(Ue);case"Btn":return Ue.data.radioButton?new ye(Ue):Ue.data.checkBox?new $e(Ue):new Ee(Ue);case"Ch":return new Ne(Ue);case"Sig":return new Re(Ue)}return new Te(Ue);case re.AnnotationType.POPUP:return new Me(Ue);case re.AnnotationType.FREETEXT:return new Oe(Ue);case re.AnnotationType.LINE:return new Fe(Ue);case re.AnnotationType.SQUARE:return new Ve(Ue);case re.AnnotationType.CIRCLE:return new qe(Ue);case re.AnnotationType.POLYLINE:return new Ie(Ue);case re.AnnotationType.CARET:return new rt(Ue);case re.AnnotationType.INK:return new lt(Ue);case re.AnnotationType.POLYGON:return new Xe(Ue);case re.AnnotationType.HIGHLIGHT:return new Ge(Ue);case re.AnnotationType.UNDERLINE:return new ut(Ue);case re.AnnotationType.SQUIGGLY:return new mt(Ue);case re.AnnotationType.STRIKEOUT:return new wt(Ue);case re.AnnotationType.STAMP:return new Et(Ue);case re.AnnotationType.FILEATTACHMENT:return new De(Ue);default:return new me(Ue)}}}const ge=class ge{constructor(Ue,{isRenderable:fe=!1,ignoreBorder:ke=!1,createQuadrilaterals:je=!1}={}){We(this,be,!1);this.isRenderable=fe,this.data=Ue.data,this.layer=Ue.layer,this.linkService=Ue.linkService,this.downloadManager=Ue.downloadManager,this.imageResourcesPath=Ue.imageResourcesPath,this.renderForms=Ue.renderForms,this.svgFactory=Ue.svgFactory,this.annotationStorage=Ue.annotationStorage,this.enableScripting=Ue.enableScripting,this.hasJSActions=Ue.hasJSActions,this._fieldObjects=Ue.fieldObjects,this.parent=Ue.parent,fe&&(this.container=this._createContainer(ke)),je&&this._createQuadrilaterals()}static _hasPopupData({titleObj:Ue,contentsObj:fe,richText:ke}){return!!(Ue!=null&&Ue.str||fe!=null&&fe.str||ke!=null&&ke.str)}get hasPopupData(){return ge._hasPopupData(this.data)}_createContainer(Ue){const{data:fe,parent:{page:ke,viewport:je}}=this,ze=document.createElement("section");ze.setAttribute("data-annotation-id",fe.id),this instanceof Te||(ze.tabIndex=de),ze.style.zIndex=this.parent.zIndex++,this.data.popupRef&&ze.setAttribute("aria-haspopup","dialog"),fe.noRotate&&ze.classList.add("norotate");const{pageWidth:Ze,pageHeight:at,pageX:_t,pageY:xt}=je.rawDims;if(!fe.rect||this instanceof Me){const{rotation:Bt}=fe;return!fe.hasOwnCanvas&&Bt!==0&&this.setRotation(Bt,ze),ze}const{width:Ft,height:qt}=Ae(fe.rect),Mt=re.Util.normalizeRect([fe.rect[0],ke.view[3]-fe.rect[1]+ke.view[1],fe.rect[2],ke.view[3]-fe.rect[3]+ke.view[1]]);if(!Ue&&fe.borderStyle.width>0){ze.style.borderWidth="".concat(fe.borderStyle.width,"px");const Bt=fe.borderStyle.horizontalCornerRadius,Xt=fe.borderStyle.verticalCornerRadius;if(Bt>0||Xt>0){const Jt="calc(".concat(Bt,"px * var(--scale-factor)) / calc(").concat(Xt,"px * var(--scale-factor))");ze.style.borderRadius=Jt}else if(this instanceof ye){const Jt="calc(".concat(Ft,"px * var(--scale-factor)) / calc(").concat(qt,"px * var(--scale-factor))");ze.style.borderRadius=Jt}switch(fe.borderStyle.style){case re.AnnotationBorderStyleType.SOLID:ze.style.borderStyle="solid";break;case re.AnnotationBorderStyleType.DASHED:ze.style.borderStyle="dashed";break;case re.AnnotationBorderStyleType.BEVELED:(0,re.warn)("Unimplemented border style: beveled");break;case re.AnnotationBorderStyleType.INSET:(0,re.warn)("Unimplemented border style: inset");break;case re.AnnotationBorderStyleType.UNDERLINE:ze.style.borderBottomStyle="solid";break}const Yt=fe.borderColor||null;Yt?(st(this,be,!0),ze.style.borderColor=re.Util.makeHexColor(Yt[0]|0,Yt[1]|0,Yt[2]|0)):ze.style.borderWidth=0}ze.style.left="".concat(100*(Mt[0]-_t)/Ze,"%"),ze.style.top="".concat(100*(Mt[1]-xt)/at,"%");const{rotation:$t}=fe;return fe.hasOwnCanvas||$t===0?(ze.style.width="".concat(100*Ft/Ze,"%"),ze.style.height="".concat(100*qt/at,"%")):this.setRotation($t,ze),ze}setRotation(Ue,fe=this.container){if(!this.data.rect)return;const{pageWidth:ke,pageHeight:je}=this.parent.viewport.rawDims,{width:ze,height:Ze}=Ae(this.data.rect);let at,_t;Ue%180===0?(at=100*ze/ke,_t=100*Ze/je):(at=100*Ze/ke,_t=100*ze/je),fe.style.width="".concat(at,"%"),fe.style.height="".concat(_t,"%"),fe.setAttribute("data-main-rotation",(360-Ue)%360)}get _commonActions(){const Ue=(fe,ke,je)=>{const ze=je.detail[fe],Ze=ze[0],at=ze.slice(1);je.target.style[ke]=oe.ColorConverters["".concat(Ze,"_HTML")](at),this.annotationStorage.setValue(this.data.id,{[ke]:oe.ColorConverters["".concat(Ze,"_rgb")](at)})};return(0,re.shadow)(this,"_commonActions",{display:fe=>{const{display:ke}=fe.detail,je=ke%2===1;this.container.style.visibility=je?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:je,noPrint:ke===1||ke===2})},print:fe=>{this.annotationStorage.setValue(this.data.id,{noPrint:!fe.detail.print})},hidden:fe=>{const{hidden:ke}=fe.detail;this.container.style.visibility=ke?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:ke,noView:ke})},focus:fe=>{setTimeout(()=>fe.target.focus({preventScroll:!1}),0)},userName:fe=>{fe.target.title=fe.detail.userName},readonly:fe=>{fe.target.disabled=fe.detail.readonly},required:fe=>{this._setRequired(fe.target,fe.detail.required)},bgColor:fe=>{Ue("bgColor","backgroundColor",fe)},fillColor:fe=>{Ue("fillColor","backgroundColor",fe)},fgColor:fe=>{Ue("fgColor","color",fe)},textColor:fe=>{Ue("textColor","color",fe)},borderColor:fe=>{Ue("borderColor","borderColor",fe)},strokeColor:fe=>{Ue("strokeColor","borderColor",fe)},rotation:fe=>{const ke=fe.detail.rotation;this.setRotation(ke),this.annotationStorage.setValue(this.data.id,{rotation:ke})}})}_dispatchEventFromSandbox(Ue,fe){const ke=this._commonActions;for(const je of Object.keys(fe.detail)){const ze=Ue[je]||ke[je];ze==null||ze(fe)}}_setDefaultPropertiesFromJS(Ue){if(!this.enableScripting)return;const fe=this.annotationStorage.getRawValue(this.data.id);if(!fe)return;const ke=this._commonActions;for(const[je,ze]of Object.entries(fe)){const Ze=ke[je];if(Ze){const at={detail:{[je]:ze},target:Ue};Ze(at),delete fe[je]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:Ue}=this.data;if(!Ue)return;const[fe,ke,je,ze]=this.data.rect;if(Ue.length===1){const[,{x:Xt,y:Yt},{x:Jt,y:Tn}]=Ue[0];if(je===Xt&&ze===Yt&&fe===Jt&&ke===Tn)return}const{style:Ze}=this.container;let at;if(ce(this,be)){const{borderColor:Xt,borderWidth:Yt}=Ze;Ze.borderWidth=0,at=["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(Xt,'" stroke-width="').concat(Yt,'">')],this.container.classList.add("hasBorder")}const _t=je-fe,xt=ze-ke,{svgFactory:Ft}=this,qt=Ft.createElement("svg");qt.classList.add("quadrilateralsContainer"),qt.setAttribute("width",0),qt.setAttribute("height",0);const Mt=Ft.createElement("defs");qt.append(Mt);const $t=Ft.createElement("clipPath"),Bt="clippath_".concat(this.data.id);$t.setAttribute("id",Bt),$t.setAttribute("clipPathUnits","objectBoundingBox"),Mt.append($t);for(const[,{x:Xt,y:Yt},{x:Jt,y:Tn}]of Ue){const En=Ft.createElement("rect"),xn=(Jt-fe)/_t,Fn=(ze-Yt)/xt,Mn=(Xt-Jt)/_t,jr=(Yt-Tn)/xt;En.setAttribute("x",xn),En.setAttribute("y",Fn),En.setAttribute("width",Mn),En.setAttribute("height",jr),$t.append(En),at==null||at.push('<rect vector-effect="non-scaling-stroke" x="'.concat(xn,'" y="').concat(Fn,'" width="').concat(Mn,'" height="').concat(jr,'"/>'))}ce(this,be)&&(at.push("</g></svg>')"),Ze.backgroundImage=at.join("")),this.container.append(qt),this.container.style.clipPath="url(#".concat(Bt,")")}_createPopup(){const{container:Ue,data:fe}=this;Ue.setAttribute("aria-haspopup","dialog");const ke=new Me({data:{color:fe.color,titleObj:fe.titleObj,modificationDate:fe.modificationDate,contentsObj:fe.contentsObj,richText:fe.richText,parentRect:fe.rect,borderStyle:0,id:"popup_".concat(fe.id),rotation:fe.rotation},parent:this.parent,elements:[this]});this.parent.div.append(ke.render())}render(){(0,re.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(Ue,fe=null){const ke=[];if(this._fieldObjects){const je=this._fieldObjects[Ue];if(je)for(const{page:ze,id:Ze,exportValues:at}of je){if(ze===-1||Ze===fe)continue;const _t=typeof at=="string"?at:null,xt=document.querySelector('[data-element-id="'.concat(Ze,'"]'));if(xt&&!le.has(xt)){(0,re.warn)("_getElementsByName - element not allowed: ".concat(Ze));continue}ke.push({id:Ze,exportValue:_t,domElement:xt})}return ke}for(const je of document.getElementsByName(Ue)){const{exportValue:ze}=je,Ze=je.getAttribute("data-element-id");Ze!==fe&&le.has(je)&&ke.push({id:Ze,exportValue:ze,domElement:je})}return ke}show(){var Ue;this.container&&(this.container.hidden=!1),(Ue=this.popup)==null||Ue.maybeShow()}hide(){var Ue;this.container&&(this.container.hidden=!0),(Ue=this.popup)==null||Ue.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const Ue=this.getElementsToTriggerPopup();if(Array.isArray(Ue))for(const fe of Ue)fe.classList.add("highlightArea");else Ue.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:Ue,data:{id:fe}}=this;this.container.addEventListener("dblclick",()=>{var ke;(ke=this.linkService.eventBus)==null||ke.dispatch("switchannotationeditormode",{source:this,mode:Ue,editId:fe})})}};be=new WeakMap;let me=ge;class ve extends me{constructor(fe,ke=null){super(fe,{isRenderable:!0,ignoreBorder:!!(ke!=null&&ke.ignoreBorder),createQuadrilaterals:!0});We(this,Ce);We(this,Le);this.isTooltipOnly=fe.data.isTooltipOnly}render(){const{data:fe,linkService:ke}=this,je=document.createElement("a");je.setAttribute("data-element-id",fe.id);let ze=!1;return fe.url?(ke.addLinkAttributes(je,fe.url,fe.newWindow),ze=!0):fe.action?(this._bindNamedAction(je,fe.action),ze=!0):fe.attachment?(this._bindAttachment(je,fe.attachment),ze=!0):fe.setOCGState?(Ke(this,Le,ri).call(this,je,fe.setOCGState),ze=!0):fe.dest?(this._bindLink(je,fe.dest),ze=!0):(fe.actions&&(fe.actions.Action||fe.actions["Mouse Up"]||fe.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(je,fe),ze=!0),fe.resetForm?(this._bindResetFormAction(je,fe.resetForm),ze=!0):this.isTooltipOnly&&!ze&&(this._bindLink(je,""),ze=!0)),this.container.classList.add("linkAnnotation"),ze&&this.container.append(je),this.container}_bindLink(fe,ke){fe.href=this.linkService.getDestinationHash(ke),fe.onclick=()=>(ke&&this.linkService.goToDestination(ke),!1),(ke||ke==="")&&Ke(this,Ce,$n).call(this)}_bindNamedAction(fe,ke){fe.href=this.linkService.getAnchorUrl(""),fe.onclick=()=>(this.linkService.executeNamedAction(ke),!1),Ke(this,Ce,$n).call(this)}_bindAttachment(fe,ke){fe.href=this.linkService.getAnchorUrl(""),fe.onclick=()=>{var je;return(je=this.downloadManager)==null||je.openOrDownloadData(this.container,ke.content,ke.filename),!1},Ke(this,Ce,$n).call(this)}_bindJSAction(fe,ke){fe.href=this.linkService.getAnchorUrl("");const je=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const ze of Object.keys(ke.actions)){const Ze=je.get(ze);Ze&&(fe[Ze]=()=>{var at;return(at=this.linkService.eventBus)==null||at.dispatch("dispatcheventinsandbox",{source:this,detail:{id:ke.id,name:ze}}),!1})}fe.onclick||(fe.onclick=()=>!1),Ke(this,Ce,$n).call(this)}_bindResetFormAction(fe,ke){const je=fe.onclick;if(je||(fe.href=this.linkService.getAnchorUrl("")),Ke(this,Ce,$n).call(this),!this._fieldObjects){(0,re.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),je||(fe.onclick=()=>!1);return}fe.onclick=()=>{var qt;je==null||je();const{fields:ze,refs:Ze,include:at}=ke,_t=[];if(ze.length!==0||Ze.length!==0){const Mt=new Set(Ze);for(const $t of ze){const Bt=this._fieldObjects[$t]||[];for(const{id:Xt}of Bt)Mt.add(Xt)}for(const $t of Object.values(this._fieldObjects))for(const Bt of $t)Mt.has(Bt.id)===at&&_t.push(Bt)}else for(const Mt of Object.values(this._fieldObjects))_t.push(...Mt);const xt=this.annotationStorage,Ft=[];for(const Mt of _t){const{id:$t}=Mt;switch(Ft.push($t),Mt.type){case"text":{const Xt=Mt.defaultValue||"";xt.setValue($t,{value:Xt});break}case"checkbox":case"radiobutton":{const Xt=Mt.defaultValue===Mt.exportValues;xt.setValue($t,{value:Xt});break}case"combobox":case"listbox":{const Xt=Mt.defaultValue||"";xt.setValue($t,{value:Xt});break}default:continue}const Bt=document.querySelector('[data-element-id="'.concat($t,'"]'));if(Bt){if(!le.has(Bt)){(0,re.warn)("_bindResetFormAction - element not allowed: ".concat($t));continue}}else continue;Bt.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((qt=this.linkService.eventBus)==null||qt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:Ft,name:"ResetForm"}})),!1}}}Ce=new WeakSet,$n=function(){this.container.setAttribute("data-internal-link","")},Le=new WeakSet,ri=function(fe,ke){fe.href=this.linkService.getAnchorUrl(""),fe.onclick=()=>(this.linkService.executeSetOCGState(ke),!1),Ke(this,Ce,$n).call(this)};class Se extends me{constructor(Ue){super(Ue,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const Ue=document.createElement("img");return Ue.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",Ue.alt="[{{type}} Annotation]",Ue.dataset.l10nId="text_annotation_type",Ue.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(Ue),this.container}}class Te extends me{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(Ue){var fe;this.data.hasOwnCanvas&&(((fe=Ue.previousSibling)==null?void 0:fe.nodeName)==="CANVAS"&&(Ue.previousSibling.hidden=!0),Ue.hidden=!1)}_getKeyModifier(Ue){const{isWin:fe,isMac:ke}=re.FeatureTest.platform;return fe&&Ue.ctrlKey||ke&&Ue.metaKey}_setEventListener(Ue,fe,ke,je,ze){ke.includes("mouse")?Ue.addEventListener(ke,Ze=>{var at;(at=this.linkService.eventBus)==null||at.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:je,value:ze(Ze),shift:Ze.shiftKey,modifier:this._getKeyModifier(Ze)}})}):Ue.addEventListener(ke,Ze=>{var at;if(ke==="blur"){if(!fe.focused||!Ze.relatedTarget)return;fe.focused=!1}else if(ke==="focus"){if(fe.focused)return;fe.focused=!0}ze&&((at=this.linkService.eventBus)==null||at.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:je,value:ze(Ze)}}))})}_setEventListeners(Ue,fe,ke,je){var ze,Ze,at;for(const[_t,xt]of ke)(xt==="Action"||(ze=this.data.actions)!=null&&ze[xt])&&((xt==="Focus"||xt==="Blur")&&(fe||(fe={focused:!1})),this._setEventListener(Ue,fe,_t,xt,je),xt==="Focus"&&!((Ze=this.data.actions)!=null&&Ze.Blur)?this._setEventListener(Ue,fe,"blur","Blur",null):xt==="Blur"&&!((at=this.data.actions)!=null&&at.Focus)&&this._setEventListener(Ue,fe,"focus","Focus",null))}_setBackgroundColor(Ue){const fe=this.data.backgroundColor||null;Ue.style.backgroundColor=fe===null?"transparent":re.Util.makeHexColor(fe[0],fe[1],fe[2])}_setTextStyle(Ue){const fe=["left","center","right"],{fontColor:ke}=this.data.defaultAppearanceData,je=this.data.defaultAppearanceData.fontSize||ae,ze=Ue.style;let Ze;const at=2,_t=xt=>Math.round(10*xt)/10;if(this.data.multiLine){const xt=Math.abs(this.data.rect[3]-this.data.rect[1]-at),Ft=Math.round(xt/(re.LINE_FACTOR*je))||1,qt=xt/Ft;Ze=Math.min(je,_t(qt/re.LINE_FACTOR))}else{const xt=Math.abs(this.data.rect[3]-this.data.rect[1]-at);Ze=Math.min(je,_t(xt/re.LINE_FACTOR))}ze.fontSize="calc(".concat(Ze,"px * var(--scale-factor))"),ze.color=re.Util.makeHexColor(ke[0],ke[1],ke[2]),this.data.textAlignment!==null&&(ze.textAlign=fe[this.data.textAlignment])}_setRequired(Ue,fe){fe?Ue.setAttribute("required",!0):Ue.removeAttribute("required"),Ue.setAttribute("aria-required",fe)}}class Pe extends Te{constructor(Ue){const fe=Ue.renderForms||!Ue.data.hasAppearance&&!!Ue.data.fieldValue;super(Ue,{isRenderable:fe})}setPropertyOnSiblings(Ue,fe,ke,je){const ze=this.annotationStorage;for(const Ze of this._getElementsByName(Ue.name,Ue.id))Ze.domElement&&(Ze.domElement[fe]=ke),ze.setValue(Ze.id,{[je]:ke})}render(){var je,ze;const Ue=this.annotationStorage,fe=this.data.id;this.container.classList.add("textWidgetAnnotation");let ke=null;if(this.renderForms){const Ze=Ue.getValue(fe,{value:this.data.fieldValue});let at=Ze.value||"";const _t=Ue.getValue(fe,{charLimit:this.data.maxLen}).charLimit;_t&&at.length>_t&&(at=at.slice(0,_t));let xt=Ze.formattedValue||((je=this.data.textContent)==null?void 0:je.join("\n"))||null;xt&&this.data.comb&&(xt=xt.replaceAll(/\s+/g,""));const Ft={userValue:at,formattedValue:xt,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(ke=document.createElement("textarea"),ke.textContent=xt!=null?xt:at,this.data.doNotScroll&&(ke.style.overflowY="hidden")):(ke=document.createElement("input"),ke.type="text",ke.setAttribute("value",xt!=null?xt:at),this.data.doNotScroll&&(ke.style.overflowX="hidden")),this.data.hasOwnCanvas&&(ke.hidden=!0),le.add(ke),ke.setAttribute("data-element-id",fe),ke.disabled=this.data.readOnly,ke.name=this.data.fieldName,ke.tabIndex=de,this._setRequired(ke,this.data.required),_t&&(ke.maxLength=_t),ke.addEventListener("input",Mt=>{Ue.setValue(fe,{value:Mt.target.value}),this.setPropertyOnSiblings(ke,"value",Mt.target.value,"value"),Ft.formattedValue=null}),ke.addEventListener("resetform",Mt=>{var Bt;const $t=(Bt=this.data.defaultFieldValue)!=null?Bt:"";ke.value=Ft.userValue=$t,Ft.formattedValue=null});let qt=Mt=>{const{formattedValue:$t}=Ft;$t!=null&&(Mt.target.value=$t),Mt.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){ke.addEventListener("focus",$t=>{if(Ft.focused)return;const{target:Bt}=$t;Ft.userValue&&(Bt.value=Ft.userValue),Ft.lastCommittedValue=Bt.value,Ft.commitKey=1,Ft.focused=!0}),ke.addEventListener("updatefromsandbox",$t=>{this.showElementAndHideCanvas($t.target);const Bt={value(Xt){var Yt;Ft.userValue=(Yt=Xt.detail.value)!=null?Yt:"",Ue.setValue(fe,{value:Ft.userValue.toString()}),Xt.target.value=Ft.userValue},formattedValue(Xt){const{formattedValue:Yt}=Xt.detail;Ft.formattedValue=Yt,Yt!=null&&Xt.target!==document.activeElement&&(Xt.target.value=Yt),Ue.setValue(fe,{formattedValue:Yt})},selRange(Xt){Xt.target.setSelectionRange(...Xt.detail.selRange)},charLimit:Xt=>{var En;const{charLimit:Yt}=Xt.detail,{target:Jt}=Xt;if(Yt===0){Jt.removeAttribute("maxLength");return}Jt.setAttribute("maxLength",Yt);let Tn=Ft.userValue;!Tn||Tn.length<=Yt||(Tn=Tn.slice(0,Yt),Jt.value=Ft.userValue=Tn,Ue.setValue(fe,{value:Tn}),(En=this.linkService.eventBus)==null||En.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:Tn,willCommit:!0,commitKey:1,selStart:Jt.selectionStart,selEnd:Jt.selectionEnd}}))}};this._dispatchEventFromSandbox(Bt,$t)}),ke.addEventListener("keydown",$t=>{var Yt;Ft.commitKey=1;let Bt=-1;if($t.key==="Escape"?Bt=0:$t.key==="Enter"&&!this.data.multiLine?Bt=2:$t.key==="Tab"&&(Ft.commitKey=3),Bt===-1)return;const{value:Xt}=$t.target;Ft.lastCommittedValue!==Xt&&(Ft.lastCommittedValue=Xt,Ft.userValue=Xt,(Yt=this.linkService.eventBus)==null||Yt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:Xt,willCommit:!0,commitKey:Bt,selStart:$t.target.selectionStart,selEnd:$t.target.selectionEnd}}))});const Mt=qt;qt=null,ke.addEventListener("blur",$t=>{var Xt;if(!Ft.focused||!$t.relatedTarget)return;Ft.focused=!1;const{value:Bt}=$t.target;Ft.userValue=Bt,Ft.lastCommittedValue!==Bt&&((Xt=this.linkService.eventBus)==null||Xt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:Bt,willCommit:!0,commitKey:Ft.commitKey,selStart:$t.target.selectionStart,selEnd:$t.target.selectionEnd}})),Mt($t)}),(ze=this.data.actions)!=null&&ze.Keystroke&&ke.addEventListener("beforeinput",$t=>{var Fn;Ft.lastCommittedValue=null;const{data:Bt,target:Xt}=$t,{value:Yt,selectionStart:Jt,selectionEnd:Tn}=Xt;let En=Jt,xn=Tn;switch($t.inputType){case"deleteWordBackward":{const Mn=Yt.substring(0,Jt).match(/\w*[^\w]*$/);Mn&&(En-=Mn[0].length);break}case"deleteWordForward":{const Mn=Yt.substring(Jt).match(/^[^\w]*\w*/);Mn&&(xn+=Mn[0].length);break}case"deleteContentBackward":Jt===Tn&&(En-=1);break;case"deleteContentForward":Jt===Tn&&(xn+=1);break}$t.preventDefault(),(Fn=this.linkService.eventBus)==null||Fn.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:Yt,change:Bt||"",willCommit:!1,selStart:En,selEnd:xn}})}),this._setEventListeners(ke,Ft,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],$t=>$t.target.value)}if(qt&&ke.addEventListener("blur",qt),this.data.comb){const $t=(this.data.rect[2]-this.data.rect[0])/_t;ke.classList.add("comb"),ke.style.letterSpacing="calc(".concat($t,"px * var(--scale-factor) - 1ch)")}}else ke=document.createElement("div"),ke.textContent=this.data.fieldValue,ke.style.verticalAlign="middle",ke.style.display="table-cell";return this._setTextStyle(ke),this._setBackgroundColor(ke),this._setDefaultPropertiesFromJS(ke),this.container.append(ke),this.container}}class Re extends Te{constructor(Ue){super(Ue,{isRenderable:!!Ue.data.hasOwnCanvas})}}class $e extends Te{constructor(Ue){super(Ue,{isRenderable:Ue.renderForms})}render(){const Ue=this.annotationStorage,fe=this.data,ke=fe.id;let je=Ue.getValue(ke,{value:fe.exportValue===fe.fieldValue}).value;typeof je=="string"&&(je=je!=="Off",Ue.setValue(ke,{value:je})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const ze=document.createElement("input");return le.add(ze),ze.setAttribute("data-element-id",ke),ze.disabled=fe.readOnly,this._setRequired(ze,this.data.required),ze.type="checkbox",ze.name=fe.fieldName,je&&ze.setAttribute("checked",!0),ze.setAttribute("exportValue",fe.exportValue),ze.tabIndex=de,ze.addEventListener("change",Ze=>{const{name:at,checked:_t}=Ze.target;for(const xt of this._getElementsByName(at,ke)){const Ft=_t&&xt.exportValue===fe.exportValue;xt.domElement&&(xt.domElement.checked=Ft),Ue.setValue(xt.id,{value:Ft})}Ue.setValue(ke,{value:_t})}),ze.addEventListener("resetform",Ze=>{const at=fe.defaultFieldValue||"Off";Ze.target.checked=at===fe.exportValue}),this.enableScripting&&this.hasJSActions&&(ze.addEventListener("updatefromsandbox",Ze=>{const at={value(_t){_t.target.checked=_t.detail.value!=="Off",Ue.setValue(ke,{value:_t.target.checked})}};this._dispatchEventFromSandbox(at,Ze)}),this._setEventListeners(ze,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Ze=>Ze.target.checked)),this._setBackgroundColor(ze),this._setDefaultPropertiesFromJS(ze),this.container.append(ze),this.container}}class ye extends Te{constructor(Ue){super(Ue,{isRenderable:Ue.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const Ue=this.annotationStorage,fe=this.data,ke=fe.id;let je=Ue.getValue(ke,{value:fe.fieldValue===fe.buttonValue}).value;typeof je=="string"&&(je=je!==fe.buttonValue,Ue.setValue(ke,{value:je}));const ze=document.createElement("input");if(le.add(ze),ze.setAttribute("data-element-id",ke),ze.disabled=fe.readOnly,this._setRequired(ze,this.data.required),ze.type="radio",ze.name=fe.fieldName,je&&ze.setAttribute("checked",!0),ze.tabIndex=de,ze.addEventListener("change",Ze=>{const{name:at,checked:_t}=Ze.target;for(const xt of this._getElementsByName(at,ke))Ue.setValue(xt.id,{value:!1});Ue.setValue(ke,{value:_t})}),ze.addEventListener("resetform",Ze=>{const at=fe.defaultFieldValue;Ze.target.checked=at!=null&&at===fe.buttonValue}),this.enableScripting&&this.hasJSActions){const Ze=fe.buttonValue;ze.addEventListener("updatefromsandbox",at=>{const _t={value:xt=>{const Ft=Ze===xt.detail.value;for(const qt of this._getElementsByName(xt.target.name)){const Mt=Ft&&qt.id===ke;qt.domElement&&(qt.domElement.checked=Mt),Ue.setValue(qt.id,{value:Mt})}}};this._dispatchEventFromSandbox(_t,at)}),this._setEventListeners(ze,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],at=>at.target.checked)}return this._setBackgroundColor(ze),this._setDefaultPropertiesFromJS(ze),this.container.append(ze),this.container}}class Ee extends ve{constructor(Ue){super(Ue,{ignoreBorder:Ue.data.hasAppearance})}render(){const Ue=super.render();Ue.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(Ue.title=this.data.alternativeText);const fe=Ue.lastChild;return this.enableScripting&&this.hasJSActions&&fe&&(this._setDefaultPropertiesFromJS(fe),fe.addEventListener("updatefromsandbox",ke=>{this._dispatchEventFromSandbox({},ke)})),Ue}}class Ne extends Te{constructor(Ue){super(Ue,{isRenderable:Ue.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const Ue=this.annotationStorage,fe=this.data.id,ke=Ue.getValue(fe,{value:this.data.fieldValue}),je=document.createElement("select");le.add(je),je.setAttribute("data-element-id",fe),je.disabled=this.data.readOnly,this._setRequired(je,this.data.required),je.name=this.data.fieldName,je.tabIndex=de;let ze=this.data.combo&&this.data.options.length>0;this.data.combo||(je.size=this.data.options.length,this.data.multiSelect&&(je.multiple=!0)),je.addEventListener("resetform",Ft=>{const qt=this.data.defaultFieldValue;for(const Mt of je.options)Mt.selected=Mt.value===qt});for(const Ft of this.data.options){const qt=document.createElement("option");qt.textContent=Ft.displayValue,qt.value=Ft.exportValue,ke.value.includes(Ft.exportValue)&&(qt.setAttribute("selected",!0),ze=!1),je.append(qt)}let Ze=null;if(ze){const Ft=document.createElement("option");Ft.value=" ",Ft.setAttribute("hidden",!0),Ft.setAttribute("selected",!0),je.prepend(Ft),Ze=()=>{Ft.remove(),je.removeEventListener("input",Ze),Ze=null},je.addEventListener("input",Ze)}const at=Ft=>{const qt=Ft?"value":"textContent",{options:Mt,multiple:$t}=je;return $t?Array.prototype.filter.call(Mt,Bt=>Bt.selected).map(Bt=>Bt[qt]):Mt.selectedIndex===-1?null:Mt[Mt.selectedIndex][qt]};let _t=at(!1);const xt=Ft=>{const qt=Ft.target.options;return Array.prototype.map.call(qt,Mt=>({displayValue:Mt.textContent,exportValue:Mt.value}))};return this.enableScripting&&this.hasJSActions?(je.addEventListener("updatefromsandbox",Ft=>{const qt={value(Mt){Ze==null||Ze();const $t=Mt.detail.value,Bt=new Set(Array.isArray($t)?$t:[$t]);for(const Xt of je.options)Xt.selected=Bt.has(Xt.value);Ue.setValue(fe,{value:at(!0)}),_t=at(!1)},multipleSelection(Mt){je.multiple=!0},remove(Mt){const $t=je.options,Bt=Mt.detail.remove;$t[Bt].selected=!1,je.remove(Bt),$t.length>0&&Array.prototype.findIndex.call($t,Yt=>Yt.selected)===-1&&($t[0].selected=!0),Ue.setValue(fe,{value:at(!0),items:xt(Mt)}),_t=at(!1)},clear(Mt){for(;je.length!==0;)je.remove(0);Ue.setValue(fe,{value:null,items:[]}),_t=at(!1)},insert(Mt){const{index:$t,displayValue:Bt,exportValue:Xt}=Mt.detail.insert,Yt=je.children[$t],Jt=document.createElement("option");Jt.textContent=Bt,Jt.value=Xt,Yt?Yt.before(Jt):je.append(Jt),Ue.setValue(fe,{value:at(!0),items:xt(Mt)}),_t=at(!1)},items(Mt){const{items:$t}=Mt.detail;for(;je.length!==0;)je.remove(0);for(const Bt of $t){const{displayValue:Xt,exportValue:Yt}=Bt,Jt=document.createElement("option");Jt.textContent=Xt,Jt.value=Yt,je.append(Jt)}je.options.length>0&&(je.options[0].selected=!0),Ue.setValue(fe,{value:at(!0),items:xt(Mt)}),_t=at(!1)},indices(Mt){const $t=new Set(Mt.detail.indices);for(const Bt of Mt.target.options)Bt.selected=$t.has(Bt.index);Ue.setValue(fe,{value:at(!0)}),_t=at(!1)},editable(Mt){Mt.target.disabled=!Mt.detail.editable}};this._dispatchEventFromSandbox(qt,Ft)}),je.addEventListener("input",Ft=>{var Mt;const qt=at(!0);Ue.setValue(fe,{value:qt}),Ft.preventDefault(),(Mt=this.linkService.eventBus)==null||Mt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:_t,changeEx:qt,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(je,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],Ft=>Ft.target.value)):je.addEventListener("input",function(Ft){Ue.setValue(fe,{value:at(!0)})}),this.data.combo&&this._setTextStyle(je),this._setBackgroundColor(je),this._setDefaultPropertiesFromJS(je),this.container.append(je),this.container}}class Me extends me{constructor(Ue){const{data:fe,elements:ke}=Ue;super(Ue,{isRenderable:me._hasPopupData(fe)}),this.elements=ke}render(){this.container.classList.add("popupAnnotation");const Ue=new we({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}),fe=[];for(const ke of this.elements)ke.popup=Ue,fe.push(ke.data.id),ke.addHighlightArea();return this.container.setAttribute("aria-controls",fe.map(ke=>"".concat(re.AnnotationPrefix).concat(ke)).join(",")),this.container}}class we{constructor({container:Ue,color:fe,elements:ke,titleObj:je,modificationDate:ze,contentsObj:Ze,richText:at,parent:_t,rect:xt,parentRect:Ft,open:qt}){We(this,Ht);We(this,Ut);We(this,Vt);We(this,Gt);We(this,He,null);We(this,it,Ke(this,Ht,ii).bind(this));We(this,et,Ke(this,Gt,Fr).bind(this));We(this,ot,Ke(this,Vt,Rr).bind(this));We(this,ht,Ke(this,Ut,Qn).bind(this));We(this,pt,null);We(this,ct,null);We(this,Pt,null);We(this,It,null);We(this,vt,null);We(this,kt,null);We(this,gt,!1);We(this,tt,null);We(this,nt,null);We(this,ft,null);We(this,Tt,null);We(this,Ct,!1);var $t;st(this,ct,Ue),st(this,Tt,je),st(this,Pt,Ze),st(this,ft,at),st(this,vt,_t),st(this,pt,fe),st(this,nt,xt),st(this,kt,Ft),st(this,It,ke);const Mt=ie.PDFDateString.toDateObject(ze);Mt&&st(this,He,_t.l10n.get("annotation_date_string",{date:Mt.toLocaleDateString(),time:Mt.toLocaleTimeString()})),this.trigger=ke.flatMap(Bt=>Bt.getElementsToTriggerPopup());for(const Bt of this.trigger)Bt.addEventListener("click",ce(this,ht)),Bt.addEventListener("mouseenter",ce(this,ot)),Bt.addEventListener("mouseleave",ce(this,et)),Bt.classList.add("popupTriggerArea");for(const Bt of ke)($t=Bt.container)==null||$t.addEventListener("keydown",ce(this,it));ce(this,ct).hidden=!0,qt&&Ke(this,Ut,Qn).call(this)}render(){if(ce(this,tt))return;const{page:{view:Ue},viewport:{rawDims:{pageWidth:fe,pageHeight:ke,pageX:je,pageY:ze}}}=ce(this,vt),Ze=st(this,tt,document.createElement("div"));if(Ze.className="popup",ce(this,pt)){const En=Ze.style.outlineColor=re.Util.makeHexColor(...ce(this,pt));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?Ze.style.backgroundColor="color-mix(in srgb, ".concat(En," 30%, white)"):Ze.style.backgroundColor=re.Util.makeHexColor(...ce(this,pt).map(Fn=>Math.floor(.7*(255-Fn)+Fn)))}const at=document.createElement("span");at.className="header";const _t=document.createElement("h1");if(at.append(_t),{dir:_t.dir,str:_t.textContent}=ce(this,Tt),Ze.append(at),ce(this,He)){const En=document.createElement("span");En.classList.add("popupDate"),ce(this,He).then(xn=>{En.textContent=xn}),at.append(En)}const xt=ce(this,Pt),Ft=ce(this,ft);if(Ft!=null&&Ft.str&&(!(xt!=null&&xt.str)||xt.str===Ft.str))ue.XfaLayer.render({xfaHtml:Ft.html,intent:"richText",div:Ze}),Ze.lastChild.classList.add("richText","popupContent");else{const En=this._formatContents(xt);Ze.append(En)}let qt=!!ce(this,kt),Mt=qt?ce(this,kt):ce(this,nt);for(const En of ce(this,It))if(!Mt||re.Util.intersect(En.data.rect,Mt)!==null){Mt=En.data.rect,qt=!0;break}const $t=re.Util.normalizeRect([Mt[0],Ue[3]-Mt[1]+Ue[1],Mt[2],Ue[3]-Mt[3]+Ue[1]]),Bt=5,Xt=qt?Mt[2]-Mt[0]+Bt:0,Yt=$t[0]+Xt,Jt=$t[1],{style:Tn}=ce(this,ct);Tn.left="".concat(100*(Yt-je)/fe,"%"),Tn.top="".concat(100*(Jt-ze)/ke,"%"),ce(this,ct).append(Ze)}_formatContents({str:Ue,dir:fe}){const ke=document.createElement("p");ke.classList.add("popupContent"),ke.dir=fe;const je=Ue.split(/(?:\r\n?|\n)/);for(let ze=0,Ze=je.length;ze<Ze;++ze){const at=je[ze];ke.append(document.createTextNode(at)),ze<Ze-1&&ke.append(document.createElement("br"))}return ke}forceHide(){st(this,Ct,this.isVisible),ce(this,Ct)&&(ce(this,ct).hidden=!0)}maybeShow(){ce(this,Ct)&&(st(this,Ct,!1),ce(this,ct).hidden=!1)}get isVisible(){return ce(this,ct).hidden===!1}}He=new WeakMap,it=new WeakMap,et=new WeakMap,ot=new WeakMap,ht=new WeakMap,pt=new WeakMap,ct=new WeakMap,Pt=new WeakMap,It=new WeakMap,vt=new WeakMap,kt=new WeakMap,gt=new WeakMap,tt=new WeakMap,nt=new WeakMap,ft=new WeakMap,Tt=new WeakMap,Ct=new WeakMap,Ht=new WeakSet,ii=function(Ue){Ue.altKey||Ue.shiftKey||Ue.ctrlKey||Ue.metaKey||(Ue.key==="Enter"||Ue.key==="Escape"&&ce(this,gt))&&Ke(this,Ut,Qn).call(this)},Ut=new WeakSet,Qn=function(){st(this,gt,!ce(this,gt)),ce(this,gt)?(Ke(this,Vt,Rr).call(this),ce(this,ct).addEventListener("click",ce(this,ht)),ce(this,ct).addEventListener("keydown",ce(this,it))):(Ke(this,Gt,Fr).call(this),ce(this,ct).removeEventListener("click",ce(this,ht)),ce(this,ct).removeEventListener("keydown",ce(this,it)))},Vt=new WeakSet,Rr=function(){ce(this,tt)||this.render(),this.isVisible?ce(this,gt)&&ce(this,ct).classList.add("focused"):(ce(this,ct).hidden=!1,ce(this,ct).style.zIndex=parseInt(ce(this,ct).style.zIndex)+1e3)},Gt=new WeakSet,Fr=function(){ce(this,ct).classList.remove("focused"),!(ce(this,gt)||!this.isVisible)&&(ce(this,ct).hidden=!0,ce(this,ct).style.zIndex=parseInt(ce(this,ct).style.zIndex)-1e3)};class Oe extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0}),this.textContent=Ue.data.textContent,this.textPosition=Ue.data.textPosition,this.annotationEditorType=re.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const Ue=document.createElement("div");Ue.classList.add("annotationTextContent"),Ue.setAttribute("role","comment");for(const fe of this.textContent){const ke=document.createElement("span");ke.textContent=fe,Ue.append(ke)}this.container.append(Ue)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}te.FreeTextAnnotationElement=Oe;class Fe extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,Qe,null)}render(){this.container.classList.add("lineAnnotation");const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0),Ze=st(this,Qe,this.svgFactory.createElement("svg:line"));return Ze.setAttribute("x1",fe.rect[2]-fe.lineCoordinates[0]),Ze.setAttribute("y1",fe.rect[3]-fe.lineCoordinates[1]),Ze.setAttribute("x2",fe.rect[2]-fe.lineCoordinates[2]),Ze.setAttribute("y2",fe.rect[3]-fe.lineCoordinates[3]),Ze.setAttribute("stroke-width",fe.borderStyle.width||1),Ze.setAttribute("stroke","transparent"),Ze.setAttribute("fill","transparent"),ze.append(Ze),this.container.append(ze),!fe.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return ce(this,Qe)}addHighlightArea(){this.container.classList.add("highlightArea")}}Qe=new WeakMap;class Ve extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,Ye,null)}render(){this.container.classList.add("squareAnnotation");const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0),Ze=fe.borderStyle.width,at=st(this,Ye,this.svgFactory.createElement("svg:rect"));return at.setAttribute("x",Ze/2),at.setAttribute("y",Ze/2),at.setAttribute("width",ke-Ze),at.setAttribute("height",je-Ze),at.setAttribute("stroke-width",Ze||1),at.setAttribute("stroke","transparent"),at.setAttribute("fill","transparent"),ze.append(at),this.container.append(ze),!fe.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return ce(this,Ye)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ye=new WeakMap;class qe extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,yt,null)}render(){this.container.classList.add("circleAnnotation");const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0),Ze=fe.borderStyle.width,at=st(this,yt,this.svgFactory.createElement("svg:ellipse"));return at.setAttribute("cx",ke/2),at.setAttribute("cy",je/2),at.setAttribute("rx",ke/2-Ze/2),at.setAttribute("ry",je/2-Ze/2),at.setAttribute("stroke-width",Ze||1),at.setAttribute("stroke","transparent"),at.setAttribute("fill","transparent"),ze.append(at),this.container.append(ze),!fe.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return ce(this,yt)}addHighlightArea(){this.container.classList.add("highlightArea")}}yt=new WeakMap;class Ie extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,St,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0);let Ze=[];for(const _t of fe.vertices){const xt=_t.x-fe.rect[0],Ft=fe.rect[3]-_t.y;Ze.push(xt+","+Ft)}Ze=Ze.join(" ");const at=st(this,St,this.svgFactory.createElement(this.svgElementName));return at.setAttribute("points",Ze),at.setAttribute("stroke-width",fe.borderStyle.width||1),at.setAttribute("stroke","transparent"),at.setAttribute("fill","transparent"),ze.append(at),this.container.append(ze),!fe.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return ce(this,St)}addHighlightArea(){this.container.classList.add("highlightArea")}}St=new WeakMap;class Xe extends Ie{constructor(Ue){super(Ue),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class rt extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class lt extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,wn,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=re.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0);for(const Ze of fe.inkLists){let at=[];for(const xt of Ze){const Ft=xt.x-fe.rect[0],qt=fe.rect[3]-xt.y;at.push("".concat(Ft,",").concat(qt))}at=at.join(" ");const _t=this.svgFactory.createElement(this.svgElementName);ce(this,wn).push(_t),_t.setAttribute("points",at),_t.setAttribute("stroke-width",fe.borderStyle.width||1),_t.setAttribute("stroke","transparent"),_t.setAttribute("fill","transparent"),!fe.popupRef&&this.hasPopupData&&this._createPopup(),ze.append(_t)}return this.container.append(ze),this.container}getElementsToTriggerPopup(){return ce(this,wn)}addHighlightArea(){this.container.classList.add("highlightArea")}}wn=new WeakMap,te.InkAnnotationElement=lt;class Ge extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class ut extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class mt extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class wt extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class Et extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}te.StampAnnotationElement=Et;class De extends me{constructor(fe){var ze;super(fe,{isRenderable:!0});We(this,Je);We(this,Qt,null);const{filename:ke,content:je}=this.data.file;this.filename=(0,ie.getFilenameFromUrl)(ke,!0),this.content=je,(ze=this.linkService.eventBus)==null||ze.dispatch("fileattachmentannotation",{source:this,filename:ke,content:je})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:fe,data:ke}=this;let je;ke.hasAppearance||ke.fillAlpha===0?je=document.createElement("div"):(je=document.createElement("img"),je.src="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(ke.name)?"paperclip":"pushpin",".svg"),ke.fillAlpha&&ke.fillAlpha<1&&(je.style="filter: opacity(".concat(Math.round(ke.fillAlpha*100),"%);"))),je.addEventListener("dblclick",Ke(this,Je,Mr).bind(this)),st(this,Qt,je);const{isMac:ze}=re.FeatureTest.platform;return fe.addEventListener("keydown",Ze=>{Ze.key==="Enter"&&(ze?Ze.metaKey:Ze.ctrlKey)&&Ke(this,Je,Mr).call(this)}),!ke.popupRef&&this.hasPopupData?this._createPopup():je.classList.add("popupTriggerArea"),fe.append(je),fe}getElementsToTriggerPopup(){return ce(this,Qt)}addHighlightArea(){this.container.classList.add("highlightArea")}}Qt=new WeakMap,Je=new WeakSet,Mr=function(){var fe;(fe=this.downloadManager)==null||fe.openOrDownloadData(this.container,this.content,this.filename)};class pe{constructor({div:Ue,accessibilityManager:fe,annotationCanvasMap:ke,l10n:je,page:ze,viewport:Ze}){We(this,Nt);We(this,bt);We(this,Lt,null);We(this,Rt,null);We(this,Dt,new Map);this.div=Ue,st(this,Lt,fe),st(this,Rt,ke),this.l10n=je,this.page=ze,this.viewport=Ze,this.zIndex=0,this.l10n||(this.l10n=he.NullL10n)}async render(Ue){const{annotations:fe}=Ue,ke=this.div;(0,ie.setLayerDimensions)(ke,this.viewport);const je=new Map,ze={data:null,layer:ke,linkService:Ue.linkService,downloadManager:Ue.downloadManager,imageResourcesPath:Ue.imageResourcesPath||"",renderForms:Ue.renderForms!==!1,svgFactory:new ie.DOMSVGFactory,annotationStorage:Ue.annotationStorage||new se.AnnotationStorage,enableScripting:Ue.enableScripting===!0,hasJSActions:Ue.hasJSActions,fieldObjects:Ue.fieldObjects,parent:this,elements:null};for(const Ze of fe){if(Ze.noHTML)continue;const at=Ze.annotationType===re.AnnotationType.POPUP;if(at){const Ft=je.get(Ze.id);if(!Ft)continue;ze.elements=Ft}else{const{width:Ft,height:qt}=Ae(Ze.rect);if(Ft<=0||qt<=0)continue}ze.data=Ze;const _t=_e.create(ze);if(!_t.isRenderable)continue;if(!at&&Ze.popupRef){const Ft=je.get(Ze.popupRef);Ft?Ft.push(_t):je.set(Ze.popupRef,[_t])}_t.annotationEditorType>0&&ce(this,Dt).set(_t.data.id,_t);const xt=_t.render();Ze.hidden&&(xt.style.visibility="hidden"),Ke(this,Nt,si).call(this,xt,Ze.id)}Ke(this,bt,$r).call(this),await this.l10n.translate(ke)}update({viewport:Ue}){const fe=this.div;this.viewport=Ue,(0,ie.setLayerDimensions)(fe,{rotation:Ue.rotation}),Ke(this,bt,$r).call(this),fe.hidden=!1}getEditableAnnotations(){return Array.from(ce(this,Dt).values())}getEditableAnnotation(Ue){return ce(this,Dt).get(Ue)}}Lt=new WeakMap,Rt=new WeakMap,Dt=new WeakMap,Nt=new WeakSet,si=function(Ue,fe){var je;const ke=Ue.firstChild||Ue;ke.id="".concat(re.AnnotationPrefix).concat(fe),this.div.append(Ue),(je=ce(this,Lt))==null||je.moveElementInDOM(this.div,Ue,ke,!1)},bt=new WeakSet,$r=function(){if(!ce(this,Rt))return;const Ue=this.div;for(const[fe,ke]of ce(this,Rt)){const je=Ue.querySelector('[data-annotation-id="'.concat(fe,'"]'));if(!je)continue;const{firstChild:ze}=je;ze?ze.nodeName==="CANVAS"?ze.replaceWith(ke):ze.before(ke):je.append(ke)}ce(this,Rt).clear()},te.AnnotationLayer=pe},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.ColorConverters=void 0;function ne(se){return Math.floor(Math.max(0,Math.min(1,se))*255).toString(16).padStart(2,"0")}function re(se){return Math.max(0,Math.min(255,255*se))}class ie{static CMYK_G([oe,he,ue,de]){return["G",1-Math.min(1,.3*oe+.59*ue+.11*he+de)]}static G_CMYK([oe]){return["CMYK",0,0,0,1-oe]}static G_RGB([oe]){return["RGB",oe,oe,oe]}static G_rgb([oe]){return oe=re(oe),[oe,oe,oe]}static G_HTML([oe]){const he=ne(oe);return"#".concat(he).concat(he).concat(he)}static RGB_G([oe,he,ue]){return["G",.3*oe+.59*he+.11*ue]}static RGB_rgb(oe){return oe.map(re)}static RGB_HTML(oe){return"#".concat(oe.map(ne).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([oe,he,ue,de]){return["RGB",1-Math.min(1,oe+de),1-Math.min(1,ue+de),1-Math.min(1,he+de)]}static CMYK_rgb([oe,he,ue,de]){return[re(1-Math.min(1,oe+de)),re(1-Math.min(1,ue+de)),re(1-Math.min(1,he+de))]}static CMYK_HTML(oe){const he=this.CMYK_RGB(oe).slice(1);return this.RGB_HTML(he)}static RGB_CMYK([oe,he,ue]){const de=1-oe,ae=1-he,le=1-ue,Ae=Math.min(de,ae,le);return["CMYK",de,ae,le,Ae]}}te.ColorConverters=ie},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.NullL10n=void 0,te.getL10nFallback=re;const ne={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};ne.print_progress_percent="{{progress}}%";function re(oe,he){switch(oe){case"find_match_count":oe="find_match_count[".concat(he.total===1?"one":"other","]");break;case"find_match_count_limit":oe="find_match_count_limit[".concat(he.limit===1?"one":"other","]");break}return ne[oe]||""}function ie(oe,he){return he?oe.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(ue,de)=>de in he?he[de]:"{{"+de+"}}"):oe}const se={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(oe,he=null,ue=re(oe,he)){return ie(ue,he)},async translate(oe){}};te.NullL10n=se},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.XfaLayer=void 0;var re=ne(25);class ie{static setupStorage(oe,he,ue,de,ae){const le=de.getValue(he,{value:null});switch(ue.name){case"textarea":if(le.value!==null&&(oe.textContent=le.value),ae==="print")break;oe.addEventListener("input",Ae=>{de.setValue(he,{value:Ae.target.value})});break;case"input":if(ue.attributes.type==="radio"||ue.attributes.type==="checkbox"){if(le.value===ue.attributes.xfaOn?oe.setAttribute("checked",!0):le.value===ue.attributes.xfaOff&&oe.removeAttribute("checked"),ae==="print")break;oe.addEventListener("change",Ae=>{de.setValue(he,{value:Ae.target.checked?Ae.target.getAttribute("xfaOn"):Ae.target.getAttribute("xfaOff")})})}else{if(le.value!==null&&oe.setAttribute("value",le.value),ae==="print")break;oe.addEventListener("input",Ae=>{de.setValue(he,{value:Ae.target.value})})}break;case"select":if(le.value!==null){oe.setAttribute("value",le.value);for(const Ae of ue.children)Ae.attributes.value===le.value?Ae.attributes.selected=!0:Ae.attributes.hasOwnProperty("selected")&&delete Ae.attributes.selected}oe.addEventListener("input",Ae=>{const _e=Ae.target.options,me=_e.selectedIndex===-1?"":_e[_e.selectedIndex].value;de.setValue(he,{value:me})});break}}static setAttributes({html:oe,element:he,storage:ue=null,intent:de,linkService:ae}){const{attributes:le}=he,Ae=oe instanceof HTMLAnchorElement;le.type==="radio"&&(le.name="".concat(le.name,"-").concat(de));for(const[_e,me]of Object.entries(le))if(me!=null)switch(_e){case"class":me.length&&oe.setAttribute(_e,me.join(" "));break;case"dataId":break;case"id":oe.setAttribute("data-element-id",me);break;case"style":Object.assign(oe.style,me);break;case"textContent":oe.textContent=me;break;default:(!Ae||_e!=="href"&&_e!=="newWindow")&&oe.setAttribute(_e,me)}Ae&&ae.addLinkAttributes(oe,le.href,le.newWindow),ue&&le.dataId&&this.setupStorage(oe,le.dataId,he,ue)}static render(oe){var ve;const he=oe.annotationStorage,ue=oe.linkService,de=oe.xfaHtml,ae=oe.intent||"display",le=document.createElement(de.name);de.attributes&&this.setAttributes({html:le,element:de,intent:ae,linkService:ue});const Ae=[[de,-1,le]],_e=oe.div;if(_e.append(le),oe.viewport){const Se="matrix(".concat(oe.viewport.transform.join(","),")");_e.style.transform=Se}ae!=="richText"&&_e.setAttribute("class","xfaLayer xfaFont");const me=[];for(;Ae.length>0;){const[Se,Te,Pe]=Ae.at(-1);if(Te+1===Se.children.length){Ae.pop();continue}const Re=Se.children[++Ae.at(-1)[1]];if(Re===null)continue;const{name:$e}=Re;if($e==="#text"){const Ee=document.createTextNode(Re.value);me.push(Ee),Pe.append(Ee);continue}const ye=(ve=Re==null?void 0:Re.attributes)!=null&&ve.xmlns?document.createElementNS(Re.attributes.xmlns,$e):document.createElement($e);if(Pe.append(ye),Re.attributes&&this.setAttributes({html:ye,element:Re,storage:he,intent:ae,linkService:ue}),Re.children&&Re.children.length>0)Ae.push([Re,-1,ye]);else if(Re.value){const Ee=document.createTextNode(Re.value);re.XfaText.shouldBuildText($e)&&me.push(Ee),ye.append(Ee)}}for(const Se of _e.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))Se.setAttribute("readOnly",!0);return{textDivs:me}}static update(oe){const he="matrix(".concat(oe.viewport.transform.join(","),")");oe.div.style.transform=he,oe.div.hidden=!1}}te.XfaLayer=ie},(ee,te,ne)=>{var de,ae,le,Ae,_e,me,ve,Se,Te,Pe,Re,$e,ye,Ee,Ne,oi,we,ai,Fe,li,qe,ci,Xe,kr,lt,ui,ut,Lr,wt,di,De,hi,be,fi,Ce,pi,Le,gi,He,Rn,et,Ir,ht,er,ct,tr,It,On,kt,Or,tt,nr,ft,mi,Ct,Dr,Wt,_i,zt,yi,jt,Nr,dt,rr,Ye,Dn;Object.defineProperty(te,"__esModule",{value:!0}),te.InkEditor=void 0;var re=ne(1),ie=ne(4),se=ne(29),oe=ne(6),he=ne(5);const St=class St extends ie.AnnotationEditor{constructor(Je){super({...Je,name:"inkEditor"});We(this,Ne);We(this,we);We(this,Fe);We(this,qe);We(this,Xe);We(this,lt);We(this,ut);We(this,wt);We(this,De);We(this,be);We(this,Ce);We(this,Le);We(this,He);We(this,et);We(this,ht);We(this,ct);We(this,It);We(this,kt);We(this,tt);We(this,zt);We(this,jt);We(this,dt);We(this,Ye);We(this,de,0);We(this,ae,0);We(this,le,this.canvasPointermove.bind(this));We(this,Ae,this.canvasPointerleave.bind(this));We(this,_e,this.canvasPointerup.bind(this));We(this,me,this.canvasPointerdown.bind(this));We(this,ve,new Path2D);We(this,Se,!1);We(this,Te,!1);We(this,Pe,!1);We(this,Re,null);We(this,$e,0);We(this,ye,0);We(this,Ee,null);this.color=Je.color||null,this.thickness=Je.thickness||null,this.opacity=Je.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(Je){ie.AnnotationEditor.initialize(Je,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(Je,At){switch(Je){case re.AnnotationEditorParamsType.INK_THICKNESS:St._defaultThickness=At;break;case re.AnnotationEditorParamsType.INK_COLOR:St._defaultColor=At;break;case re.AnnotationEditorParamsType.INK_OPACITY:St._defaultOpacity=At/100;break}}updateParams(Je,At){switch(Je){case re.AnnotationEditorParamsType.INK_THICKNESS:Ke(this,Ne,oi).call(this,At);break;case re.AnnotationEditorParamsType.INK_COLOR:Ke(this,we,ai).call(this,At);break;case re.AnnotationEditorParamsType.INK_OPACITY:Ke(this,Fe,li).call(this,At);break}}static get defaultPropertiesToUpdate(){return[[re.AnnotationEditorParamsType.INK_THICKNESS,St._defaultThickness],[re.AnnotationEditorParamsType.INK_COLOR,St._defaultColor||ie.AnnotationEditor._defaultLineColor],[re.AnnotationEditorParamsType.INK_OPACITY,Math.round(St._defaultOpacity*100)]]}get propertiesToUpdate(){var Je;return[[re.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||St._defaultThickness],[re.AnnotationEditorParamsType.INK_COLOR,this.color||St._defaultColor||ie.AnnotationEditor._defaultLineColor],[re.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*((Je=this.opacity)!=null?Je:St._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(Ke(this,ht,er).call(this),Ke(this,ct,tr).call(this)),this.isAttachedToDOM||(this.parent.add(this),Ke(this,It,On).call(this)),Ke(this,Ye,Dn).call(this)))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,ce(this,Re).disconnect(),st(this,Re,null),super.remove())}setParent(Je){!this.parent&&Je?this._uiManager.removeShouldRescale(this):this.parent&&Je===null&&this._uiManager.addShouldRescale(this),super.setParent(Je)}onScaleChanging(){const[Je,At]=this.parentDimensions,Lt=this.width*Je,Rt=this.height*At;this.setDimensions(Lt,Rt)}enableEditMode(){ce(this,Se)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",ce(this,me)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",ce(this,me)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){ce(this,Se)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),st(this,Se,!0),this.div.classList.add("disabled"),Ke(this,Ye,Dn).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(Je){this._focusEventsAllowed&&(super.focusin(Je),this.enableEditMode())}canvasPointerdown(Je){Je.button!==0||!this.isInEditMode()||ce(this,Se)||(this.setInForeground(),Je.preventDefault(),Je.type!=="mouse"&&this.div.focus(),Ke(this,lt,ui).call(this,Je.offsetX,Je.offsetY))}canvasPointermove(Je){Je.preventDefault(),Ke(this,ut,Lr).call(this,Je.offsetX,Je.offsetY)}canvasPointerup(Je){Je.preventDefault(),Ke(this,et,Ir).call(this,Je)}canvasPointerleave(Je){Ke(this,et,Ir).call(this,Je)}get isResizable(){return!this.isEmpty()&&ce(this,Se)}render(){if(this.div)return this.div;let Je,At;this.width&&(Je=this.x,At=this.y),super.render(),ie.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(Zt=>{var bt;return(bt=this.div)==null?void 0:bt.setAttribute("aria-label",Zt)});const[Lt,Rt,Dt,Nt]=Ke(this,qe,ci).call(this);if(this.setAt(Lt,Rt,0,0),this.setDims(Dt,Nt),Ke(this,ht,er).call(this),this.width){const[Zt,bt]=this.parentDimensions;this.setAspectRatio(this.width*Zt,this.height*bt),this.setAt(Je*Zt,At*bt,this.width*Zt,this.height*bt),st(this,Pe,!0),Ke(this,It,On).call(this),this.setDims(this.width*Zt,this.height*bt),Ke(this,He,Rn).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return Ke(this,ct,tr).call(this),this.div}setDimensions(Je,At){const Lt=Math.round(Je),Rt=Math.round(At);if(ce(this,$e)===Lt&&ce(this,ye)===Rt)return;st(this,$e,Lt),st(this,ye,Rt),this.canvas.style.visibility="hidden";const[Dt,Nt]=this.parentDimensions;this.width=Je/Dt,this.height=At/Nt,this.fixAndSetPosition(),ce(this,Se)&&Ke(this,kt,Or).call(this,Je,At),Ke(this,It,On).call(this),Ke(this,He,Rn).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(Je,At,Lt){var ze,Ze,at;if(Je instanceof se.InkAnnotationElement)return null;const Rt=super.deserialize(Je,At,Lt);Rt.thickness=Je.thickness,Rt.color=re.Util.makeHexColor(...Je.color),Rt.opacity=Je.opacity;const[Dt,Nt]=Rt.pageDimensions,Zt=Rt.width*Dt,bt=Rt.height*Nt,Kt=Rt.parentScale,Ot=Je.thickness/2;st(Rt,Se,!0),st(Rt,$e,Math.round(Zt)),st(Rt,ye,Math.round(bt));const{paths:Ue,rect:fe,rotation:ke}=Je;for(let{bezier:_t}of Ue){_t=Ke(ze=St,Wt,_i).call(ze,_t,fe,ke);const xt=[];Rt.paths.push(xt);let Ft=Kt*(_t[0]-Ot),qt=Kt*(_t[1]-Ot);for(let $t=2,Bt=_t.length;$t<Bt;$t+=6){const Xt=Kt*(_t[$t]-Ot),Yt=Kt*(_t[$t+1]-Ot),Jt=Kt*(_t[$t+2]-Ot),Tn=Kt*(_t[$t+3]-Ot),En=Kt*(_t[$t+4]-Ot),xn=Kt*(_t[$t+5]-Ot);xt.push([[Ft,qt],[Xt,Yt],[Jt,Tn],[En,xn]]),Ft=En,qt=xn}const Mt=Ke(this,ft,mi).call(this,xt);Rt.bezierPath2D.push(Mt)}const je=Ke(Ze=Rt,jt,Nr).call(Ze);return st(Rt,ae,Math.max(ie.AnnotationEditor.MIN_SIZE,je[2]-je[0])),st(Rt,de,Math.max(ie.AnnotationEditor.MIN_SIZE,je[3]-je[1])),Ke(at=Rt,kt,Or).call(at,Zt,bt),Rt}serialize(){if(this.isEmpty())return null;const Je=this.getRect(0,0),At=ie.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:re.AnnotationEditorType.INK,color:At,thickness:this.thickness,opacity:this.opacity,paths:Ke(this,zt,yi).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,Je),pageIndex:this.pageIndex,rect:Je,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakMap,Pe=new WeakMap,Re=new WeakMap,$e=new WeakMap,ye=new WeakMap,Ee=new WeakMap,Ne=new WeakSet,oi=function(Je){const At=this.thickness;this.addCommands({cmd:()=>{this.thickness=Je,Ke(this,Ye,Dn).call(this)},undo:()=>{this.thickness=At,Ke(this,Ye,Dn).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},we=new WeakSet,ai=function(Je){const At=this.color;this.addCommands({cmd:()=>{this.color=Je,Ke(this,He,Rn).call(this)},undo:()=>{this.color=At,Ke(this,He,Rn).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Fe=new WeakSet,li=function(Je){Je/=100;const At=this.opacity;this.addCommands({cmd:()=>{this.opacity=Je,Ke(this,He,Rn).call(this)},undo:()=>{this.opacity=At,Ke(this,He,Rn).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},qe=new WeakSet,ci=function(){const{parentRotation:Je,parentDimensions:[At,Lt]}=this;switch(Je){case 90:return[0,Lt,Lt,At];case 180:return[At,Lt,At,Lt];case 270:return[At,0,Lt,At];default:return[0,0,At,Lt]}},Xe=new WeakSet,kr=function(){const{ctx:Je,color:At,opacity:Lt,thickness:Rt,parentScale:Dt,scaleFactor:Nt}=this;Je.lineWidth=Rt*Dt/Nt,Je.lineCap="round",Je.lineJoin="round",Je.miterLimit=10,Je.strokeStyle="".concat(At).concat((0,he.opacityToHex)(Lt))},lt=new WeakSet,ui=function(Je,At){var Lt;this.canvas.addEventListener("contextmenu",oe.noContextMenu),this.canvas.addEventListener("pointerleave",ce(this,Ae)),this.canvas.addEventListener("pointermove",ce(this,le)),this.canvas.addEventListener("pointerup",ce(this,_e)),this.canvas.removeEventListener("pointerdown",ce(this,me)),this.isEditing=!0,ce(this,Pe)||(st(this,Pe,!0),Ke(this,It,On).call(this),this.thickness||(this.thickness=St._defaultThickness),this.color||(this.color=St._defaultColor||ie.AnnotationEditor._defaultLineColor),(Lt=this.opacity)!=null||(this.opacity=St._defaultOpacity)),this.currentPath.push([Je,At]),st(this,Te,!1),Ke(this,Xe,kr).call(this),st(this,Ee,()=>{Ke(this,be,fi).call(this),ce(this,Ee)&&window.requestAnimationFrame(ce(this,Ee))}),window.requestAnimationFrame(ce(this,Ee))},ut=new WeakSet,Lr=function(Je,At){const[Lt,Rt]=this.currentPath.at(-1);if(this.currentPath.length>1&&Je===Lt&&At===Rt)return;const Dt=this.currentPath;let Nt=ce(this,ve);if(Dt.push([Je,At]),st(this,Te,!0),Dt.length<=2){Nt.moveTo(...Dt[0]),Nt.lineTo(Je,At);return}Dt.length===3&&(st(this,ve,Nt=new Path2D),Nt.moveTo(...Dt[0])),Ke(this,Ce,pi).call(this,Nt,...Dt.at(-3),...Dt.at(-2),Je,At)},wt=new WeakSet,di=function(){if(this.currentPath.length===0)return;const Je=this.currentPath.at(-1);ce(this,ve).lineTo(...Je)},De=new WeakSet,hi=function(Je,At){st(this,Ee,null),Je=Math.min(Math.max(Je,0),this.canvas.width),At=Math.min(Math.max(At,0),this.canvas.height),Ke(this,ut,Lr).call(this,Je,At),Ke(this,wt,di).call(this);let Lt;if(this.currentPath.length!==1)Lt=Ke(this,Le,gi).call(this);else{const bt=[Je,At];Lt=[[bt,bt.slice(),bt.slice(),bt]]}const Rt=ce(this,ve),Dt=this.currentPath;this.currentPath=[],st(this,ve,new Path2D);const Nt=()=>{this.allRawPaths.push(Dt),this.paths.push(Lt),this.bezierPath2D.push(Rt),this.rebuild()},Zt=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(Ke(this,ht,er).call(this),Ke(this,ct,tr).call(this)),Ke(this,Ye,Dn).call(this))};this.addCommands({cmd:Nt,undo:Zt,mustExec:!0})},be=new WeakSet,fi=function(){if(!ce(this,Te))return;st(this,Te,!1);const Je=Math.ceil(this.thickness*this.parentScale),At=this.currentPath.slice(-3),Lt=At.map(Nt=>Nt[0]),Rt=At.map(Nt=>Nt[1]);Math.min(...Lt)-Je,Math.max(...Lt)+Je,Math.min(...Rt)-Je,Math.max(...Rt)+Je;const{ctx:Dt}=this;Dt.save(),Dt.clearRect(0,0,this.canvas.width,this.canvas.height);for(const Nt of this.bezierPath2D)Dt.stroke(Nt);Dt.stroke(ce(this,ve)),Dt.restore()},Ce=new WeakSet,pi=function(Je,At,Lt,Rt,Dt,Nt,Zt){const bt=(At+Rt)/2,Kt=(Lt+Dt)/2,Ot=(Rt+Nt)/2,Ue=(Dt+Zt)/2;Je.bezierCurveTo(bt+2*(Rt-bt)/3,Kt+2*(Dt-Kt)/3,Ot+2*(Rt-Ot)/3,Ue+2*(Dt-Ue)/3,Ot,Ue)},Le=new WeakSet,gi=function(){const Je=this.currentPath;if(Je.length<=2)return[[Je[0],Je[0],Je.at(-1),Je.at(-1)]];const At=[];let Lt,[Rt,Dt]=Je[0];for(Lt=1;Lt<Je.length-2;Lt++){const[fe,ke]=Je[Lt],[je,ze]=Je[Lt+1],Ze=(fe+je)/2,at=(ke+ze)/2,_t=[Rt+2*(fe-Rt)/3,Dt+2*(ke-Dt)/3],xt=[Ze+2*(fe-Ze)/3,at+2*(ke-at)/3];At.push([[Rt,Dt],_t,xt,[Ze,at]]),[Rt,Dt]=[Ze,at]}const[Nt,Zt]=Je[Lt],[bt,Kt]=Je[Lt+1],Ot=[Rt+2*(Nt-Rt)/3,Dt+2*(Zt-Dt)/3],Ue=[bt+2*(Nt-bt)/3,Kt+2*(Zt-Kt)/3];return At.push([[Rt,Dt],Ot,Ue,[bt,Kt]]),At},He=new WeakSet,Rn=function(){if(this.isEmpty()){Ke(this,tt,nr).call(this);return}Ke(this,Xe,kr).call(this);const{canvas:Je,ctx:At}=this;At.setTransform(1,0,0,1,0,0),At.clearRect(0,0,Je.width,Je.height),Ke(this,tt,nr).call(this);for(const Lt of this.bezierPath2D)At.stroke(Lt)},et=new WeakSet,Ir=function(Je){this.canvas.removeEventListener("pointerleave",ce(this,Ae)),this.canvas.removeEventListener("pointermove",ce(this,le)),this.canvas.removeEventListener("pointerup",ce(this,_e)),this.canvas.addEventListener("pointerdown",ce(this,me)),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",oe.noContextMenu)},10),Ke(this,De,hi).call(this,Je.offsetX,Je.offsetY),this.addToAnnotationStorage(),this.setInBackground()},ht=new WeakSet,er=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",ie.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(Je=>{var At;return(At=this.canvas)==null?void 0:At.setAttribute("aria-label",Je)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},ct=new WeakSet,tr=function(){st(this,Re,new ResizeObserver(Je=>{const At=Je[0].contentRect;At.width&&At.height&&this.setDimensions(At.width,At.height)})),ce(this,Re).observe(this.div)},It=new WeakSet,On=function(){if(!ce(this,Pe))return;const[Je,At]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*Je),this.canvas.height=Math.ceil(this.height*At),Ke(this,tt,nr).call(this)},kt=new WeakSet,Or=function(Je,At){const Lt=Ke(this,dt,rr).call(this),Rt=(Je-Lt)/ce(this,ae),Dt=(At-Lt)/ce(this,de);this.scaleFactor=Math.min(Rt,Dt)},tt=new WeakSet,nr=function(){const Je=Ke(this,dt,rr).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+Je,this.translationY*this.scaleFactor+Je)},ft=new WeakSet,mi=function(Je){const At=new Path2D;for(let Lt=0,Rt=Je.length;Lt<Rt;Lt++){const[Dt,Nt,Zt,bt]=Je[Lt];Lt===0&&At.moveTo(...Dt),At.bezierCurveTo(Nt[0],Nt[1],Zt[0],Zt[1],bt[0],bt[1])}return At},Ct=new WeakSet,Dr=function(Je,At,Lt){const[Rt,Dt,Nt,Zt]=At;switch(Lt){case 0:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2)Je[bt]+=Rt,Je[bt+1]=Zt-Je[bt+1];break;case 90:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2){const Ot=Je[bt];Je[bt]=Je[bt+1]+Rt,Je[bt+1]=Ot+Dt}break;case 180:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2)Je[bt]=Nt-Je[bt],Je[bt+1]+=Dt;break;case 270:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2){const Ot=Je[bt];Je[bt]=Nt-Je[bt+1],Je[bt+1]=Zt-Ot}break;default:throw new Error("Invalid rotation")}return Je},Wt=new WeakSet,_i=function(Je,At,Lt){const[Rt,Dt,Nt,Zt]=At;switch(Lt){case 0:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2)Je[bt]-=Rt,Je[bt+1]=Zt-Je[bt+1];break;case 90:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2){const Ot=Je[bt];Je[bt]=Je[bt+1]-Dt,Je[bt+1]=Ot-Rt}break;case 180:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2)Je[bt]=Nt-Je[bt],Je[bt+1]-=Dt;break;case 270:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2){const Ot=Je[bt];Je[bt]=Zt-Je[bt+1],Je[bt+1]=Nt-Ot}break;default:throw new Error("Invalid rotation")}return Je},zt=new WeakSet,yi=function(Je,At,Lt,Rt){var Kt,Ot;const Dt=[],Nt=this.thickness/2,Zt=Je*At+Nt,bt=Je*Lt+Nt;for(const Ue of this.paths){const fe=[],ke=[];for(let je=0,ze=Ue.length;je<ze;je++){const[Ze,at,_t,xt]=Ue[je],Ft=Je*Ze[0]+Zt,qt=Je*Ze[1]+bt,Mt=Je*at[0]+Zt,$t=Je*at[1]+bt,Bt=Je*_t[0]+Zt,Xt=Je*_t[1]+bt,Yt=Je*xt[0]+Zt,Jt=Je*xt[1]+bt;je===0&&(fe.push(Ft,qt),ke.push(Ft,qt)),fe.push(Mt,$t,Bt,Xt,Yt,Jt),ke.push(Mt,$t),je===ze-1&&ke.push(Yt,Jt)}Dt.push({bezier:Ke(Kt=St,Ct,Dr).call(Kt,fe,Rt,this.rotation),points:Ke(Ot=St,Ct,Dr).call(Ot,ke,Rt,this.rotation)})}return Dt},jt=new WeakSet,Nr=function(){let Je=1/0,At=-1/0,Lt=1/0,Rt=-1/0;for(const Dt of this.paths)for(const[Nt,Zt,bt,Kt]of Dt){const Ot=re.Util.bezierBoundingBox(...Nt,...Zt,...bt,...Kt);Je=Math.min(Je,Ot[0]),Lt=Math.min(Lt,Ot[1]),At=Math.max(At,Ot[2]),Rt=Math.max(Rt,Ot[3])}return[Je,Lt,At,Rt]},dt=new WeakSet,rr=function(){return ce(this,Se)?Math.ceil(this.thickness*this.parentScale):0},Ye=new WeakSet,Dn=function(Je=!1){if(this.isEmpty())return;if(!ce(this,Se)){Ke(this,He,Rn).call(this);return}const At=Ke(this,jt,Nr).call(this),Lt=Ke(this,dt,rr).call(this);st(this,ae,Math.max(ie.AnnotationEditor.MIN_SIZE,At[2]-At[0])),st(this,de,Math.max(ie.AnnotationEditor.MIN_SIZE,At[3]-At[1]));const Rt=Math.ceil(Lt+ce(this,ae)*this.scaleFactor),Dt=Math.ceil(Lt+ce(this,de)*this.scaleFactor),[Nt,Zt]=this.parentDimensions;this.width=Rt/Nt,this.height=Dt/Zt,this.setAspectRatio(Rt,Dt);const bt=this.translationX,Kt=this.translationY;this.translationX=-At[0],this.translationY=-At[1],Ke(this,It,On).call(this),Ke(this,He,Rn).call(this),st(this,$e,Rt),st(this,ye,Dt),this.setDims(Rt,Dt);const Ot=Je?Lt/this.scaleFactor/2:0;this.translate(bt-this.translationX-Ot,Kt-this.translationY-Ot)},We(St,ft),We(St,Ct),We(St,Wt),An(St,"_defaultColor",null),An(St,"_defaultOpacity",1),An(St,"_defaultThickness",1),An(St,"_type","ink");let ue=St;te.InkEditor=ue},(ee,te,ne)=>{var ue,de,ae,le,Ae,_e,me,ve,Se,Te,Pe,Vn,$e,Gn,Ee,ir,Me,Br,Oe,bi,Ve,Si,Ie,Ur,rt,sr,Ge,vi;Object.defineProperty(te,"__esModule",{value:!0}),te.StampEditor=void 0;var re=ne(1),ie=ne(4),se=ne(6),oe=ne(29);const mt=class mt extends ie.AnnotationEditor{constructor(De){super({...De,name:"stampEditor"});We(this,Pe);We(this,$e);We(this,Ee);We(this,Me);We(this,Oe);We(this,Ve);We(this,Ie);We(this,rt);We(this,Ge);We(this,ue,null);We(this,de,null);We(this,ae,null);We(this,le,null);We(this,Ae,null);We(this,_e,null);We(this,me,null);We(this,ve,null);We(this,Se,!1);We(this,Te,!1);st(this,le,De.bitmapUrl),st(this,Ae,De.bitmapFile)}static initialize(De){ie.AnnotationEditor.initialize(De)}static get supportedTypes(){const De=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,re.shadow)(this,"supportedTypes",De.map(pe=>"image/".concat(pe)))}static get supportedTypesStr(){return(0,re.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(De){return this.supportedTypes.includes(De)}static paste(De,pe){pe.pasteEditor(re.AnnotationEditorType.STAMP,{bitmapFile:De.getAsFile()})}remove(){var De,pe;ce(this,de)&&(st(this,ue,null),this._uiManager.imageManager.deleteId(ce(this,de)),(De=ce(this,_e))==null||De.remove(),st(this,_e,null),(pe=ce(this,me))==null||pe.disconnect(),st(this,me,null)),super.remove()}rebuild(){if(!this.parent){ce(this,de)&&Ke(this,Ee,ir).call(this);return}super.rebuild(),this.div!==null&&(ce(this,de)&&Ke(this,Ee,ir).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(ce(this,ae)||ce(this,ue)||ce(this,le)||ce(this,Ae))}get isResizable(){return!0}render(){if(this.div)return this.div;let De,pe;if(this.width&&(De=this.x,pe=this.y),super.render(),this.div.hidden=!0,ce(this,ue)?Ke(this,Me,Br).call(this):Ke(this,Ee,ir).call(this),this.width){const[be,ge]=this.parentDimensions;this.setAt(De*be,pe*ge,this.width*be,this.height*ge)}return this.div}static deserialize(De,pe,be){if(De instanceof oe.StampAnnotationElement)return null;const ge=super.deserialize(De,pe,be),{rect:Ce,bitmapUrl:xe,bitmapId:Le,isSvg:Be,accessibilityData:He}=De;Le&&be.imageManager.isValidId(Le)?st(ge,de,Le):st(ge,le,xe),st(ge,Se,Be);const[it,et]=ge.pageDimensions;return ge.width=(Ce[2]-Ce[0])/it,ge.height=(Ce[3]-Ce[1])/et,He&&(ge.altTextData=He),ge}serialize(De=!1,pe=null){if(this.isEmpty())return null;const be={annotationType:re.AnnotationEditorType.STAMP,bitmapId:ce(this,de),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:ce(this,Se),structTreeParentId:this._structTreeParentId};if(De)return be.bitmapUrl=Ke(this,rt,sr).call(this,!0),be.accessibilityData=this.altTextData,be;const{decorative:ge,altText:Ce}=this.altTextData;if(!ge&&Ce&&(be.accessibilityData={type:"Figure",alt:Ce}),pe===null)return be;pe.stamps||(pe.stamps=new Map);const xe=ce(this,Se)?(be.rect[2]-be.rect[0])*(be.rect[3]-be.rect[1]):null;if(!pe.stamps.has(ce(this,de)))pe.stamps.set(ce(this,de),{area:xe,serialized:be}),be.bitmap=Ke(this,rt,sr).call(this,!1);else if(ce(this,Se)){const Le=pe.stamps.get(ce(this,de));xe>Le.area&&(Le.area=xe,Le.serialized.bitmap.close(),Le.serialized.bitmap=Ke(this,rt,sr).call(this,!1))}return be}};ue=new WeakMap,de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakMap,Pe=new WeakSet,Vn=function(De,pe=!1){if(!De){this.remove();return}st(this,ue,De.bitmap),pe||(st(this,de,De.id),st(this,Se,De.isSvg)),Ke(this,Me,Br).call(this)},$e=new WeakSet,Gn=function(){st(this,ae,null),this._uiManager.enableWaiting(!1),ce(this,_e)&&this.div.focus()},Ee=new WeakSet,ir=function(){if(ce(this,de)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(ce(this,de)).then(pe=>Ke(this,Pe,Vn).call(this,pe,!0)).finally(()=>Ke(this,$e,Gn).call(this));return}if(ce(this,le)){const pe=ce(this,le);st(this,le,null),this._uiManager.enableWaiting(!0),st(this,ae,this._uiManager.imageManager.getFromUrl(pe).then(be=>Ke(this,Pe,Vn).call(this,be)).finally(()=>Ke(this,$e,Gn).call(this)));return}if(ce(this,Ae)){const pe=ce(this,Ae);st(this,Ae,null),this._uiManager.enableWaiting(!0),st(this,ae,this._uiManager.imageManager.getFromFile(pe).then(be=>Ke(this,Pe,Vn).call(this,be)).finally(()=>Ke(this,$e,Gn).call(this)));return}const De=document.createElement("input");De.type="file",De.accept=mt.supportedTypesStr,st(this,ae,new Promise(pe=>{De.addEventListener("change",async()=>{if(!De.files||De.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const be=await this._uiManager.imageManager.getFromFile(De.files[0]);Ke(this,Pe,Vn).call(this,be)}pe()}),De.addEventListener("cancel",()=>{this.remove(),pe()})}).finally(()=>Ke(this,$e,Gn).call(this))),De.click()},Me=new WeakSet,Br=function(){const{div:De}=this;let{width:pe,height:be}=ce(this,ue);const[ge,Ce]=this.pageDimensions,xe=.75;if(this.width)pe=this.width*ge,be=this.height*Ce;else if(pe>xe*ge||be>xe*Ce){const it=Math.min(xe*ge/pe,xe*Ce/be);pe*=it,be*=it}const[Le,Be]=this.parentDimensions;this.setDims(pe*Le/ge,be*Be/Ce),this._uiManager.enableWaiting(!1);const He=st(this,_e,document.createElement("canvas"));De.append(He),De.hidden=!1,Ke(this,Ie,Ur).call(this,pe,be),Ke(this,Ge,vi).call(this),ce(this,Te)||(this.parent.addUndoableEditor(this),st(this,Te,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()},Oe=new WeakSet,bi=function(De,pe){var xe;const[be,ge]=this.parentDimensions;this.width=De/be,this.height=pe/ge,this.setDims(De,pe),(xe=this._initialOptions)!=null&&xe.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,ce(this,ve)!==null&&clearTimeout(ce(this,ve)),st(this,ve,setTimeout(()=>{st(this,ve,null),Ke(this,Ie,Ur).call(this,De,pe)},200))},Ve=new WeakSet,Si=function(De,pe){const{width:be,height:ge}=ce(this,ue);let Ce=be,xe=ge,Le=ce(this,ue);for(;Ce>2*De||xe>2*pe;){const Be=Ce,He=xe;Ce>2*De&&(Ce=Ce>=16384?Math.floor(Ce/2)-1:Math.ceil(Ce/2)),xe>2*pe&&(xe=xe>=16384?Math.floor(xe/2)-1:Math.ceil(xe/2));const it=new OffscreenCanvas(Ce,xe);it.getContext("2d").drawImage(Le,0,0,Be,He,0,0,Ce,xe),Le=it.transferToImageBitmap()}return Le},Ie=new WeakSet,Ur=function(De,pe){De=Math.ceil(De),pe=Math.ceil(pe);const be=ce(this,_e);if(!be||be.width===De&&be.height===pe)return;be.width=De,be.height=pe;const ge=ce(this,Se)?ce(this,ue):Ke(this,Ve,Si).call(this,De,pe),Ce=be.getContext("2d");Ce.filter=this._uiManager.hcmFilter,Ce.drawImage(ge,0,0,ge.width,ge.height,0,0,De,pe)},rt=new WeakSet,sr=function(De){if(De){if(ce(this,Se)){const ge=this._uiManager.imageManager.getSvgUrl(ce(this,de));if(ge)return ge}const pe=document.createElement("canvas");return{width:pe.width,height:pe.height}=ce(this,ue),pe.getContext("2d").drawImage(ce(this,ue),0,0),pe.toDataURL()}if(ce(this,Se)){const[pe,be]=this.pageDimensions,ge=Math.round(this.width*pe*se.PixelsPerInch.PDF_TO_CSS_UNITS),Ce=Math.round(this.height*be*se.PixelsPerInch.PDF_TO_CSS_UNITS),xe=new OffscreenCanvas(ge,Ce);return xe.getContext("2d").drawImage(ce(this,ue),0,0,ce(this,ue).width,ce(this,ue).height,0,0,ge,Ce),xe.transferToImageBitmap()}return structuredClone(ce(this,ue))},Ge=new WeakSet,vi=function(){st(this,me,new ResizeObserver(De=>{const pe=De[0].contentRect;pe.width&&pe.height&&Ke(this,Oe,bi).call(this,pe.width,pe.height)})),ce(this,me).observe(this.div)},An(mt,"_type","stamp");let he=mt;te.StampEditor=he}],__webpack_module_cache__={};function __w_pdfjs_require__(ee){var te=__webpack_module_cache__[ee];if(te!==void 0)return te.exports;var ne=__webpack_module_cache__[ee]={exports:{}};return __webpack_modules__[ee](ne,ne.exports,__w_pdfjs_require__),ne.exports}var __webpack_exports__={};return(()=>{var ee=__webpack_exports__;Object.defineProperty(ee,"__esModule",{value:!0}),Object.defineProperty(ee,"AbortException",{enumerable:!0,get:function(){return te.AbortException}}),Object.defineProperty(ee,"AnnotationEditorLayer",{enumerable:!0,get:function(){return se.AnnotationEditorLayer}}),Object.defineProperty(ee,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return te.AnnotationEditorParamsType}}),Object.defineProperty(ee,"AnnotationEditorType",{enumerable:!0,get:function(){return te.AnnotationEditorType}}),Object.defineProperty(ee,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return oe.AnnotationEditorUIManager}}),Object.defineProperty(ee,"AnnotationLayer",{enumerable:!0,get:function(){return he.AnnotationLayer}}),Object.defineProperty(ee,"AnnotationMode",{enumerable:!0,get:function(){return te.AnnotationMode}}),Object.defineProperty(ee,"CMapCompressionType",{enumerable:!0,get:function(){return te.CMapCompressionType}}),Object.defineProperty(ee,"DOMSVGFactory",{enumerable:!0,get:function(){return re.DOMSVGFactory}}),Object.defineProperty(ee,"FeatureTest",{enumerable:!0,get:function(){return te.FeatureTest}}),Object.defineProperty(ee,"GlobalWorkerOptions",{enumerable:!0,get:function(){return ue.GlobalWorkerOptions}}),Object.defineProperty(ee,"ImageKind",{enumerable:!0,get:function(){return te.ImageKind}}),Object.defineProperty(ee,"InvalidPDFException",{enumerable:!0,get:function(){return te.InvalidPDFException}}),Object.defineProperty(ee,"MissingPDFException",{enumerable:!0,get:function(){return te.MissingPDFException}}),Object.defineProperty(ee,"OPS",{enumerable:!0,get:function(){return te.OPS}}),Object.defineProperty(ee,"PDFDataRangeTransport",{enumerable:!0,get:function(){return ne.PDFDataRangeTransport}}),Object.defineProperty(ee,"PDFDateString",{enumerable:!0,get:function(){return re.PDFDateString}}),Object.defineProperty(ee,"PDFWorker",{enumerable:!0,get:function(){return ne.PDFWorker}}),Object.defineProperty(ee,"PasswordResponses",{enumerable:!0,get:function(){return te.PasswordResponses}}),Object.defineProperty(ee,"PermissionFlag",{enumerable:!0,get:function(){return te.PermissionFlag}}),Object.defineProperty(ee,"PixelsPerInch",{enumerable:!0,get:function(){return re.PixelsPerInch}}),Object.defineProperty(ee,"PromiseCapability",{enumerable:!0,get:function(){return te.PromiseCapability}}),Object.defineProperty(ee,"RenderingCancelledException",{enumerable:!0,get:function(){return re.RenderingCancelledException}}),Object.defineProperty(ee,"SVGGraphics",{enumerable:!0,get:function(){return ne.SVGGraphics}}),Object.defineProperty(ee,"UnexpectedResponseException",{enumerable:!0,get:function(){return te.UnexpectedResponseException}}),Object.defineProperty(ee,"Util",{enumerable:!0,get:function(){return te.Util}}),Object.defineProperty(ee,"VerbosityLevel",{enumerable:!0,get:function(){return te.VerbosityLevel}}),Object.defineProperty(ee,"XfaLayer",{enumerable:!0,get:function(){return de.XfaLayer}}),Object.defineProperty(ee,"build",{enumerable:!0,get:function(){return ne.build}}),Object.defineProperty(ee,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return te.createValidAbsoluteUrl}}),Object.defineProperty(ee,"getDocument",{enumerable:!0,get:function(){return ne.getDocument}}),Object.defineProperty(ee,"getFilenameFromUrl",{enumerable:!0,get:function(){return re.getFilenameFromUrl}}),Object.defineProperty(ee,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return re.getPdfFilenameFromUrl}}),Object.defineProperty(ee,"getXfaPageViewport",{enumerable:!0,get:function(){return re.getXfaPageViewport}}),Object.defineProperty(ee,"isDataScheme",{enumerable:!0,get:function(){return re.isDataScheme}}),Object.defineProperty(ee,"isPdfFile",{enumerable:!0,get:function(){return re.isPdfFile}}),Object.defineProperty(ee,"loadScript",{enumerable:!0,get:function(){return re.loadScript}}),Object.defineProperty(ee,"noContextMenu",{enumerable:!0,get:function(){return re.noContextMenu}}),Object.defineProperty(ee,"normalizeUnicode",{enumerable:!0,get:function(){return te.normalizeUnicode}}),Object.defineProperty(ee,"renderTextLayer",{enumerable:!0,get:function(){return ie.renderTextLayer}}),Object.defineProperty(ee,"setLayerDimensions",{enumerable:!0,get:function(){return re.setLayerDimensions}}),Object.defineProperty(ee,"shadow",{enumerable:!0,get:function(){return te.shadow}}),Object.defineProperty(ee,"updateTextLayer",{enumerable:!0,get:function(){return ie.updateTextLayer}}),Object.defineProperty(ee,"version",{enumerable:!0,get:function(){return ne.version}});var te=__w_pdfjs_require__(1),ne=__w_pdfjs_require__(2),re=__w_pdfjs_require__(6),ie=__w_pdfjs_require__(26),se=__w_pdfjs_require__(27),oe=__w_pdfjs_require__(5),he=__w_pdfjs_require__(29),ue=__w_pdfjs_require__(14),de=__w_pdfjs_require__(32)})(),__webpack_exports__})())})(pdf$1);var pdfExports=pdf$1.exports;const pdf=getDefaultExportFromCjs(pdfExports),pdfjsModule=_mergeNamespaces({__proto__:null,default:pdf},[pdfExports]),pdfjs="default"in pdfjsModule?pdf:pdfjsModule,pdfjs$1=pdfjs;var propTypes={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function ee(re,ie,se,oe,he,ue){if(ue!==ReactPropTypesSecret){var de=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 de.name="Invariant Violation",de}}ee.isRequired=ee;function te(){return ee}var ne={array:ee,bigint:ee,bool:ee,func:ee,number:ee,object:ee,string:ee,symbol:ee,any:ee,arrayOf:te,element:ee,elementType:ee,instanceOf:te,node:ee,objectOf:te,oneOf:te,oneOfType:te,shape:te,exact:te,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return ne.PropTypes=ne,ne};propTypes.exports=factoryWithThrowingShims();var propTypesExports=propTypes.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);var __spreadArray=globalThis&&globalThis.__spreadArray||function(ee,te,ne){if(ne||arguments.length===2)for(var re=0,ie=te.length,se;re<ie;re++)(se||!(re in te))&&(se||(se=Array.prototype.slice.call(te,0,re)),se[re]=te[re]);return ee.concat(se||Array.prototype.slice.call(te))},clipboardEvents=["onCopy","onCut","onPaste"],compositionEvents=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],focusEvents=["onFocus","onBlur"],formEvents=["onInput","onInvalid","onReset","onSubmit"],imageEvents=["onLoad","onError"],keyboardEvents=["onKeyDown","onKeyPress","onKeyUp"],mediaEvents=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],mouseEvents=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],dragEvents=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],selectionEvents=["onSelect"],touchEvents=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],pointerEvents=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],uiEvents=["onScroll"],wheelEvents=["onWheel"],animationEvents=["onAnimationStart","onAnimationEnd","onAnimationIteration"],transitionEvents=["onTransitionEnd"],otherEvents=["onToggle"],changeEvents=["onChange"],allEvents=__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],clipboardEvents,!0),compositionEvents,!0),focusEvents,!0),formEvents,!0),imageEvents,!0),keyboardEvents,!0),mediaEvents,!0),mouseEvents,!0),dragEvents,!0),selectionEvents,!0),touchEvents,!0),pointerEvents,!0),uiEvents,!0),wheelEvents,!0),animationEvents,!0),transitionEvents,!0),changeEvents,!0),otherEvents,!0);function makeEventProps(ee,te){var ne={};return allEvents.forEach(function(re){var ie=ee[re];ie&&(te?ne[re]=function(se){return ie(se,te(re))}:ne[re]=ie)}),ne}function makeCancellablePromise(ee){var te=!1,ne=new Promise(function(re,ie){ee.then(function(se){return!te&&re(se)}).catch(function(se){return!te&&ie(se)})});return{promise:ne,cancel:function(){te=!0}}}function r(ee){var te,ne,re="";if(typeof ee=="string"||typeof ee=="number")re+=ee;else if(typeof ee=="object")if(Array.isArray(ee))for(te=0;te<ee.length;te++)ee[te]&&(ne=r(ee[te]))&&(re&&(re+=" "),re+=ne);else for(te in ee)ee[te]&&(re&&(re+=" "),re+=te);return re}function clsx(){for(var ee,te,ne=0,re="";ne<arguments.length;)(ee=arguments[ne++])&&(te=r(ee))&&(re&&(re+=" "),re+=te);return re}var isProduction=!0,prefix="Invariant failed";function invariant(ee,te){if(!ee){if(isProduction)throw new Error(prefix);var ne=typeof te=="function"?te():te,re=ne?"".concat(prefix,": ").concat(ne):prefix;throw new Error(re)}}var warning=function(){},warning_1=warning;const warning$1=getDefaultExportFromCjs(warning_1);var has=Object.prototype.hasOwnProperty;function find(ee,te,ne){for(ne of ee.keys())if(dequal(ne,te))return ne}function dequal(ee,te){var ne,re,ie;if(ee===te)return!0;if(ee&&te&&(ne=ee.constructor)===te.constructor){if(ne===Date)return ee.getTime()===te.getTime();if(ne===RegExp)return ee.toString()===te.toString();if(ne===Array){if((re=ee.length)===te.length)for(;re--&&dequal(ee[re],te[re]););return re===-1}if(ne===Set){if(ee.size!==te.size)return!1;for(re of ee)if(ie=re,ie&&typeof ie=="object"&&(ie=find(te,ie),!ie)||!te.has(ie))return!1;return!0}if(ne===Map){if(ee.size!==te.size)return!1;for(re of ee)if(ie=re[0],ie&&typeof ie=="object"&&(ie=find(te,ie),!ie)||!dequal(re[1],te.get(ie)))return!1;return!0}if(ne===ArrayBuffer)ee=new Uint8Array(ee),te=new Uint8Array(te);else if(ne===DataView){if((re=ee.byteLength)===te.byteLength)for(;re--&&ee.getInt8(re)===te.getInt8(re););return re===-1}if(ArrayBuffer.isView(ee)){if((re=ee.byteLength)===te.byteLength)for(;re--&&ee[re]===te[re];);return re===-1}if(!ne||typeof ee=="object"){re=0;for(ne in ee)if(has.call(ee,ne)&&++re&&!has.call(te,ne)||!(ne in te)||!dequal(ee[ne],te[ne]))return!1;return Object.keys(te).length===re}}return ee!==ee&&te!==te}const DocumentContext=G$1(null);function Message({children:ee,type:te}){return Cn.createElement("div",{className:"react-pdf__message react-pdf__message--".concat(te)},ee)}const DEFAULT_LINK_REL="noopener noreferrer nofollow";class LinkService{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(te){this.pdfDocument=te}setViewer(te){this.pdfViewer=te}setExternalLinkRel(te){this.externalLinkRel=te}setExternalLinkTarget(te){this.externalLinkTarget=te}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return invariant(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(te){invariant(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=te}get rotation(){return 0}set rotation(te){}goToDestination(te){return new Promise(ne=>{invariant(this.pdfDocument,"PDF document not loaded."),invariant(te,"Destination is not specified."),typeof te=="string"?this.pdfDocument.getDestination(te).then(ne):Array.isArray(te)?ne(te):te.then(ne)}).then(ne=>{invariant(Array.isArray(ne),'"'.concat(ne,'" is not a valid destination array.'));const re=ne[0];new Promise(ie=>{invariant(this.pdfDocument,"PDF document not loaded."),re instanceof Object?this.pdfDocument.getPageIndex(re).then(se=>{ie(se)}).catch(()=>{invariant(!1,'"'.concat(re,'" is not a valid page reference.'))}):typeof re=="number"?ie(re):invariant(!1,'"'.concat(re,'" is not a valid destination reference.'))}).then(ie=>{const se=ie+1;invariant(this.pdfViewer,"PDF viewer is not initialized."),invariant(se>=1&&se<=this.pagesCount,'"'.concat(se,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({dest:ne,pageIndex:ie,pageNumber:se})})})}navigateTo(te){this.goToDestination(te)}goToPage(te){const ne=te-1;invariant(this.pdfViewer,"PDF viewer is not initialized."),invariant(te>=1&&te<=this.pagesCount,'"'.concat(te,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({pageIndex:ne,pageNumber:te})}addLinkAttributes(te,ne,re){te.href=ne,te.rel=this.externalLinkRel||DEFAULT_LINK_REL,te.target=re?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},PasswordResponses$1=PasswordResponses,isBrowser=typeof document<"u",isLocalFileSystem=isBrowser&&window.location.protocol==="file:";function isDefined(ee){return typeof ee<"u"}function isProvided(ee){return isDefined(ee)&&ee!==null}function isString(ee){return typeof ee=="string"}function isArrayBuffer(ee){return ee instanceof ArrayBuffer}function isBlob(ee){return invariant(isBrowser,"isBlob can only be used in a browser environment"),ee instanceof Blob}function isDataURI(ee){return isString(ee)&&/^data:/.test(ee)}function dataURItoByteString(ee){invariant(isDataURI(ee),"Invalid data URI.");const[te="",ne=""]=ee.split(",");return te.split(";").indexOf("base64")!==-1?atob(ne):unescape(ne)}function getDevicePixelRatio(){return isBrowser&&window.devicePixelRatio||1}const allowFileAccessFromFilesTip="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function displayCORSWarning(){warning$1(!isLocalFileSystem,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ".concat(allowFileAccessFromFilesTip))}function displayWorkerWarning(){warning$1(!isLocalFileSystem,"Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ".concat(allowFileAccessFromFilesTip))}function cancelRunningTask(ee){ee&&ee.cancel&&ee.cancel()}function makePageCallback(ee,te){return Object.defineProperty(ee,"width",{get(){return this.view[2]*te},configurable:!0}),Object.defineProperty(ee,"height",{get(){return this.view[3]*te},configurable:!0}),Object.defineProperty(ee,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(ee,"originalHeight",{get(){return this.view[3]},configurable:!0}),ee}function isCancelException(ee){return ee.name==="RenderingCancelledException"}function loadFromFile(ee){return new Promise((te,ne)=>{const re=new FileReader;re.onload=()=>{if(!re.result)return ne(new Error("Error while reading a file."));te(re.result)},re.onerror=ie=>{if(!ie.target)return ne(new Error("Error while reading a file."));const{error:se}=ie.target;if(!se)return ne(new Error("Error while reading a file."));switch(se.code){case se.NOT_FOUND_ERR:return ne(new Error("Error while reading a file: File not found."));case se.SECURITY_ERR:return ne(new Error("Error while reading a file: Security error."));case se.ABORT_ERR:return ne(new Error("Error while reading a file: Aborted."));default:return ne(new Error("Error while reading a file."))}},re.readAsArrayBuffer(ee)})}function reducer(ee,te){switch(te.type){case"RESOLVE":return{value:te.value,error:void 0};case"REJECT":return{value:!1,error:te.error};case"RESET":return{value:void 0,error:void 0};default:return ee}}function useResolver(){return s$1(reducer,{value:void 0,error:void 0})}const{PDFDataRangeTransport:PDFDataRangeTransport$1}=pdfjs$1,eventProps=(()=>{const ee={};return allEvents.forEach(te=>{ee[te]=PropTypes.func}),ee})(),isTypedArray=PropTypes.oneOfType([PropTypes.instanceOf(Int8Array),PropTypes.instanceOf(Uint8Array),PropTypes.instanceOf(Uint8ClampedArray),PropTypes.instanceOf(Int16Array),PropTypes.instanceOf(Uint16Array),PropTypes.instanceOf(Int32Array),PropTypes.instanceOf(Uint32Array),PropTypes.instanceOf(Float32Array),PropTypes.instanceOf(Float64Array)]),fileTypes=[PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.shape({data:PropTypes.oneOfType([PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.arrayOf(PropTypes.number.isRequired),isTypedArray]).isRequired}),PropTypes.shape({range:PropTypes.instanceOf(PDFDataRangeTransport$1).isRequired}),PropTypes.shape({url:PropTypes.string.isRequired})];typeof Blob<"u"&&fileTypes.push(PropTypes.instanceOf(Blob));const isClassName=PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)]),isFile=PropTypes.oneOfType(fileTypes);PropTypes.instanceOf(LinkService),PropTypes.oneOf(["_self","_blank","_parent","_top"]),PropTypes.shape({commonObjs:PropTypes.shape({}).isRequired,getAnnotations:PropTypes.func.isRequired,getTextContent:PropTypes.func.isRequired,getViewport:PropTypes.func.isRequired,render:PropTypes.func.isRequired});const isPageIndex=function ee(te,ne,re){const{[ne]:ie,pageNumber:se,pdf:oe}=te;if(!isDefined(oe))return null;if(isDefined(ie)){if(typeof ie!="number")return new Error("`".concat(ne,"` of type `").concat(typeof ie,"` supplied to `").concat(re,"`, expected `number`."));if(ie<0)return new Error("Expected `".concat(ne,"` to be greater or equal to 0."));const{numPages:he}=oe;if(ie+1>he)return new Error("Expected `".concat(ne,"` to be less or equal to ").concat(he-1,"."))}else if(!isDefined(se))return new Error("`".concat(ne,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(re,"`."));return null},isPageNumber=function ee(te,ne,re){const{[ne]:ie,pageIndex:se,pdf:oe}=te;if(!isDefined(oe))return null;if(isDefined(ie)){if(typeof ie!="number")return new Error("`".concat(ne,"` of type `").concat(typeof ie,"` supplied to `").concat(re,"`, expected `number`."));if(ie<1)return new Error("Expected `".concat(ne,"` to be greater or equal to 1."));const{numPages:he}=oe;if(ie>he)return new Error("Expected `".concat(ne,"` to be less or equal to ").concat(he,"."))}else if(!isDefined(se))return new Error("`".concat(ne,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(re,"`."));return null},isPdf=PropTypes.oneOfType([PropTypes.any,PropTypes.oneOf([!1])]),isRef=PropTypes.oneOfType([PropTypes.func,PropTypes.exact({current:PropTypes.any})]),isRenderMode=PropTypes.oneOf(["canvas","custom","none","svg"]),isRotate=PropTypes.oneOf([0,90,180,270]);var __awaiter$1=globalThis&&globalThis.__awaiter||function(ee,te,ne,re){function ie(se){return se instanceof ne?se:new ne(function(oe){oe(se)})}return new(ne||(ne=Promise))(function(se,oe){function he(ae){try{de(re.next(ae))}catch(le){oe(le)}}function ue(ae){try{de(re.throw(ae))}catch(le){oe(le)}}function de(ae){ae.done?se(ae.value):ie(ae.value).then(he,ue)}de((re=re.apply(ee,te||[])).next())})},__rest$4=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const{PDFDataRangeTransport}=pdfjs$1,defaultOnPassword=(ee,te)=>{switch(te){case PasswordResponses$1.NEED_PASSWORD:{const ne=prompt("Enter the password to open this PDF file.");ee(ne);break}case PasswordResponses$1.INCORRECT_PASSWORD:{const ne=prompt("Invalid password. Please try again.");ee(ne);break}}};function isParameterObject(ee){return typeof ee=="object"&&ee!==null&&("data"in ee||"range"in ee||"url"in ee)}const Document=k$1(function ee(te,ne){var{children:re,className:ie,error:se="Failed to load PDF file.",externalLinkRel:oe,externalLinkTarget:he,file:ue,inputRef:de,imageResourcesPath:ae,loading:le="Loading PDF…",noData:Ae="No PDF file specified.",onItemClick:_e,onLoadError:me,onLoadProgress:ve,onLoadSuccess:Se,onPassword:Te=defaultOnPassword,onSourceError:Pe,onSourceSuccess:Re,options:$e,renderMode:ye,rotate:Ee}=te,Ne=__rest$4(te,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[Me,we]=useResolver(),{value:Oe,error:Fe}=Me,[Ve,qe]=useResolver(),{value:Ie,error:Xe}=Ve,rt=_(new LinkService),lt=_([]),Ge=_(),ut=_();p$1(()=>{ue&&ue!==Ge.current&&isParameterObject(ue)&&(warning$1(!dequal(ue,Ge.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.'),Ge.current=ue)},[ue]),p$1(()=>{$e&&$e!==ut.current&&(warning$1(!dequal($e,ut.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.'),ut.current=$e)},[$e]);const mt=_({scrollPageIntoView:pt=>{const{dest:ct,pageNumber:Pt,pageIndex:It=Pt-1}=pt;if(_e){_e({dest:ct,pageIndex:It,pageNumber:Pt});return}const vt=lt.current[It];if(vt){vt.scrollIntoView();return}warning$1(!1,"An internal link leading to page ".concat(Pt," 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>."))}});A$1(ne,()=>({linkService:rt,pages:lt,viewer:mt}),[]);function wt(){Re&&Re()}function Et(){Fe&&(warning$1(!1,Fe.toString()),Pe&&Pe(Fe))}function De(){we({type:"RESET"})}p$1(De,[ue,we]);const pe=T$1(()=>__awaiter$1(this,void 0,void 0,function*(){if(!ue)return null;if(typeof ue=="string")return isDataURI(ue)?{data:dataURItoByteString(ue)}:(displayCORSWarning(),{url:ue});if(ue instanceof PDFDataRangeTransport)return{range:ue};if(isArrayBuffer(ue))return{data:ue};if(isBrowser&&isBlob(ue))return{data:yield loadFromFile(ue)};if(invariant(typeof ue=="object","Invalid parameter in file, need either Uint8Array, string or a parameter object"),invariant(isParameterObject(ue),"Invalid parameter object: need either .data, .range or .url"),"url"in ue&&typeof ue.url=="string"){if(isDataURI(ue.url)){const{url:pt}=ue,ct=__rest$4(ue,["url"]),Pt=dataURItoByteString(pt);return Object.assign({data:Pt},ct)}displayCORSWarning()}return ue}),[ue]);p$1(()=>{const pt=makeCancellablePromise(pe());return pt.promise.then(ct=>{we({type:"RESOLVE",value:ct})}).catch(ct=>{we({type:"REJECT",error:ct})}),()=>{cancelRunningTask(pt)}},[pe,we]),p$1(()=>{if(!(typeof Oe>"u")){if(Oe===!1){Et();return}wt()}},[Oe]);function be(){Ie&&(Se&&Se(Ie),lt.current=new Array(Ie.numPages),rt.current.setDocument(Ie))}function ge(){Xe&&(warning$1(!1,Xe.toString()),me&&me(Xe))}function Ce(){qe({type:"RESET"})}p$1(Ce,[qe,Oe]);function xe(){if(!Oe)return;const pt=Object.assign(Object.assign({},$e),{isEvalSupported:!1}),ct=Object.assign(Object.assign({},Oe),pt),Pt=pdfjs$1.getDocument(ct);ve&&(Pt.onProgress=ve),Te&&(Pt.onPassword=Te);const It=Pt;return It.promise.then(vt=>{qe({type:"RESOLVE",value:vt})}).catch(vt=>{It.destroyed||qe({type:"REJECT",error:vt})}),()=>{It.destroy()}}p$1(xe,[$e,qe,Oe]),p$1(()=>{if(!(typeof Ie>"u")){if(Ie===!1){ge();return}be()}},[Ie]);function Le(){rt.current.setViewer(mt.current),rt.current.setExternalLinkRel(oe),rt.current.setExternalLinkTarget(he)}p$1(Le,[oe,he]);function Be(pt,ct){lt.current[pt]=ct}function He(pt){delete lt.current[pt]}const it=F$1(()=>({imageResourcesPath:ae,linkService:rt.current,onItemClick:_e,pdf:Ie,registerPage:Be,renderMode:ye,rotate:Ee,unregisterPage:He}),[ae,_e,Ie,ye,Ee]),et=F$1(()=>makeEventProps(Ne,()=>Ie),[Ne,Ie]);function ot(){return Cn.createElement(DocumentContext.Provider,{value:it},re)}function ht(){return ue?Ie==null?Cn.createElement(Message,{type:"loading"},typeof le=="function"?le():le):Ie===!1?Cn.createElement(Message,{type:"error"},typeof se=="function"?se():se):ot():Cn.createElement(Message,{type:"no-data"},typeof Ae=="function"?Ae():Ae)}return Cn.createElement("div",Object.assign({className:clsx("react-pdf__Document",ie),ref:de,style:{"--scale-factor":"1"}},et),ht())}),isFunctionOrNode$1=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Document.propTypes=Object.assign(Object.assign({},eventProps),{children:PropTypes.node,className:isClassName,error:isFunctionOrNode$1,externalLinkRel:PropTypes.string,externalLinkTarget:PropTypes.oneOf(["_self","_blank","_parent","_top"]),file:isFile,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode$1,noData:isFunctionOrNode$1,onItemClick:PropTypes.func,onLoadError:PropTypes.func,onLoadProgress:PropTypes.func,onLoadSuccess:PropTypes.func,onPassword:PropTypes.func,onSourceError:PropTypes.func,onSourceSuccess:PropTypes.func,options:PropTypes.shape({canvasFactory:PropTypes.any,canvasMaxAreaInBytes:PropTypes.number,cMapPacked:PropTypes.bool,CMapReaderFactory:PropTypes.any,cMapUrl:PropTypes.string,disableAutoFetch:PropTypes.bool,disableFontFace:PropTypes.bool,disableRange:PropTypes.bool,disableStream:PropTypes.bool,docBaseUrl:PropTypes.string,enableXfa:PropTypes.bool,filterFactory:PropTypes.any,fontExtraProperties:PropTypes.bool,httpHeaders:PropTypes.object,isEvalSupported:PropTypes.bool,isOffscreenCanvasSupported:PropTypes.bool,length:PropTypes.number,maxImageSize:PropTypes.number,ownerDocument:PropTypes.any,password:PropTypes.string,pdfBug:PropTypes.bool,rangeChunkSize:PropTypes.number,StandardFontDataFactory:PropTypes.any,standardFontDataUrl:PropTypes.string,stopAtErrors:PropTypes.bool,useSystemFonts:PropTypes.bool,useWorkerFetch:PropTypes.bool,verbosity:PropTypes.number,withCredentials:PropTypes.bool,worker:PropTypes.any}),rotate:PropTypes.number});const Document$1=Document,OutlineContext=G$1(null);class Ref{constructor({num:te,gen:ne}){this.num=te,this.gen=ne}toString(){let te="".concat(this.num,"R");return this.gen!==0&&(te+=this.gen),te}}function useCachedValue(ee){const te=_(),ne=te.current;return isDefined(ne)?()=>ne:()=>{const re=ee();return te.current=re,re}}function useDocumentContext(){return q$2(DocumentContext)}function useOutlineContext(){return q$2(OutlineContext)}var __awaiter=globalThis&&globalThis.__awaiter||function(ee,te,ne,re){function ie(se){return se instanceof ne?se:new ne(function(oe){oe(se)})}return new(ne||(ne=Promise))(function(se,oe){function he(ae){try{de(re.next(ae))}catch(le){oe(le)}}function ue(ae){try{de(re.throw(ae))}catch(le){oe(le)}}function de(ae){ae.done?se(ae.value):ie(ae.value).then(he,ue)}de((re=re.apply(ee,te||[])).next())})},__rest$3=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};function OutlineItem(ee){const te=useDocumentContext(),ne=useOutlineContext();invariant(ne,"Unable to find Outline context.");const re=Object.assign(Object.assign(Object.assign({},te),ne),ee),{item:ie,linkService:se,onItemClick:oe,pdf:he}=re,ue=__rest$3(re,["item","linkService","onItemClick","pdf"]);invariant(he,"Attempted to load an outline, but no document was specified. Wrap <Outline /> in a <Document /> or pass explicit `pdf` prop.");const de=useCachedValue(()=>typeof ie.dest=="string"?he.getDestination(ie.dest):ie.dest),ae=useCachedValue(()=>__awaiter(this,void 0,void 0,function*(){const me=yield de();if(!me)throw new Error("Destination not found.");const[ve]=me;return he.getPageIndex(new Ref(ve))})),le=useCachedValue(()=>__awaiter(this,void 0,void 0,function*(){return(yield ae())+1}));function Ae(me){me.preventDefault(),invariant(oe||se,"Either onItemClick callback or linkService must be defined in order to navigate to an outline item."),oe?Promise.all([de(),ae(),le()]).then(([ve,Se,Te])=>{oe({dest:ve,pageIndex:Se,pageNumber:Te})}):se&&se.goToDestination(ie.dest)}function _e(){if(!ie.items||!ie.items.length)return null;const{items:me}=ie;return Cn.createElement("ul",null,me.map((ve,Se)=>Cn.createElement(OutlineItem,Object.assign({key:typeof ve.dest=="string"?ve.dest:Se,item:ve,pdf:he},ue))))}return Cn.createElement("li",null,Cn.createElement("a",{href:"#",onClick:Ae},ie.title),_e())}var __rest$2=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const Outline=function ee(te){const ne=useDocumentContext(),re=Object.assign(Object.assign({},ne),te),{className:ie,inputRef:se,onItemClick:oe,onLoadError:he,onLoadSuccess:ue,pdf:de}=re,ae=__rest$2(re,["className","inputRef","onItemClick","onLoadError","onLoadSuccess","pdf"]);invariant(de,"Attempted to load an outline, but no document was specified. Wrap <Outline /> in a <Document /> or pass explicit `pdf` prop.");const[le,Ae]=useResolver(),{value:_e,error:me}=le;function ve(){typeof _e>"u"||_e===!1||ue&&ue(_e)}function Se(){me&&(warning$1(!1,me.toString()),he&&he(me))}function Te(){Ae({type:"RESET"})}p$1(Te,[Ae,de]);function Pe(){if(!de)return;const Ee=makeCancellablePromise(de.getOutline()),Ne=Ee;return Ee.promise.then(Me=>{Ae({type:"RESOLVE",value:Me})}).catch(Me=>{Ae({type:"REJECT",error:Me})}),()=>cancelRunningTask(Ne)}p$1(Pe,[Ae,de]),p$1(()=>{if(_e!==void 0){if(_e===!1){Se();return}ve()}},[_e]);const Re=F$1(()=>({onItemClick:oe}),[oe]),$e=F$1(()=>makeEventProps(ae,()=>_e),[ae,_e]);if(!_e)return null;function ye(){return _e?Cn.createElement("ul",null,_e.map((Ee,Ne)=>Cn.createElement(OutlineItem,{key:typeof Ee.dest=="string"?Ee.dest:Ne,item:Ee,pdf:de}))):null}return Cn.createElement("div",Object.assign({className:clsx("react-pdf__Outline",ie),ref:se},$e),Cn.createElement(OutlineContext.Provider,{value:Re},ye()))};Outline.propTypes=Object.assign(Object.assign({},eventProps),{className:isClassName,inputRef:isRef,onItemClick:PropTypes.func,onLoadError:PropTypes.func,onLoadSuccess:PropTypes.func,pdf:isPdf});const Outline$1=Outline;function mergeRefs(){for(var ee=[],te=0;te<arguments.length;te++)ee[te]=arguments[te];var ne=ee.filter(Boolean);if(ne.length<=1){var re=ne[0];return re||null}return function(se){ne.forEach(function(oe){typeof oe=="function"?oe(se):oe&&(oe.current=se)})}}const PageContext=G$1(null),PDF_ROLE_TO_HTML_ROLE={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},HEADING_PATTERN=/^H(\d+)$/;function isPdfRole(ee){return ee in PDF_ROLE_TO_HTML_ROLE}function isStructTreeNode(ee){return"children"in ee}function isStructTreeNodeWithOnlyContentChild(ee){return isStructTreeNode(ee)?ee.children.length===1&&0 in ee.children&&"id"in ee.children[0]:!1}function getRoleAttributes(ee){const te={};if(isStructTreeNode(ee)){const{role:ne}=ee,re=ne.match(HEADING_PATTERN);if(re)te.role="heading",te["aria-level"]=Number(re[1]);else if(isPdfRole(ne)){const ie=PDF_ROLE_TO_HTML_ROLE[ne];ie&&(te.role=ie)}}return te}function getBaseAttributes(ee){const te={};if(isStructTreeNode(ee)){if(ee.alt!==void 0&&(te["aria-label"]=ee.alt),ee.lang!==void 0&&(te.lang=ee.lang),isStructTreeNodeWithOnlyContentChild(ee)){const[ne]=ee.children;if(ne){const re=getBaseAttributes(ne);return Object.assign(Object.assign({},te),re)}}}else"id"in ee&&(te["aria-owns"]=ee.id);return te}function getAttributes(ee){return ee?Object.assign(Object.assign({},getRoleAttributes(ee)),getBaseAttributes(ee)):null}function StructTreeItem({className:ee,node:te}){const ne=F$1(()=>getAttributes(te),[te]),re=F$1(()=>!isStructTreeNode(te)||isStructTreeNodeWithOnlyContentChild(te)?null:te.children.map((ie,se)=>Cn.createElement(StructTreeItem,{key:se,node:ie})),[te]);return Cn.createElement("span",Object.assign({className:ee},ne),re)}function usePageContext(){return q$2(PageContext)}function StructTree(){const ee=usePageContext();invariant(ee,"Unable to find Page context.");const{onGetStructTreeError:te,onGetStructTreeSuccess:ne}=ee,[re,ie]=useResolver(),{value:se,error:oe}=re,{customTextRenderer:he,page:ue}=ee;function de(){se&&ne&&ne(se)}function ae(){oe&&(warning$1(!1,oe.toString()),te&&te(oe))}function le(){ie({type:"RESET"})}p$1(le,[ie,ue]);function Ae(){if(he||!ue)return;const _e=makeCancellablePromise(ue.getStructTree()),me=_e;return _e.promise.then(ve=>{ie({type:"RESOLVE",value:ve})}).catch(ve=>{ie({type:"REJECT",error:ve})}),()=>cancelRunningTask(me)}return p$1(Ae,[he,ue,ie]),p$1(()=>{if(se!==void 0){if(se===!1){ae();return}de()}},[se]),se?Cn.createElement(StructTreeItem,{className:"react-pdf__Page__structTree structTree",node:se}):null}const ANNOTATION_MODE=pdfjs$1.AnnotationMode;function PageCanvas(ee){const te=usePageContext();invariant(te,"Unable to find Page context.");const ne=Object.assign(Object.assign({},te),ee),{_className:re,canvasBackground:ie,devicePixelRatio:se=getDevicePixelRatio(),onRenderError:oe,onRenderSuccess:he,page:ue,renderForms:de,renderTextLayer:ae,rotate:le,scale:Ae}=ne,{canvasRef:_e}=ee;invariant(ue,"Attempted to render page canvas, but no page was specified.");const me=_(null);function ve(){ue&&he&&he(makePageCallback(ue,Ae))}function Se(ye){isCancelException(ye)||(warning$1(!1,ye.toString()),oe&&oe(ye))}const Te=F$1(()=>ue.getViewport({scale:Ae*se,rotation:le}),[se,ue,le,Ae]),Pe=F$1(()=>ue.getViewport({scale:Ae,rotation:le}),[ue,le,Ae]);function Re(){if(!ue)return;ue.cleanup();const{current:ye}=me;if(!ye)return;ye.width=Te.width,ye.height=Te.height,ye.style.width="".concat(Math.floor(Pe.width),"px"),ye.style.height="".concat(Math.floor(Pe.height),"px"),ye.style.visibility="hidden";const Ee={annotationMode:de?ANNOTATION_MODE.ENABLE_FORMS:ANNOTATION_MODE.ENABLE,canvasContext:ye.getContext("2d",{alpha:!1}),viewport:Te};ie&&(Ee.background=ie);const Ne=ue.render(Ee),Me=Ne;return Ne.promise.then(()=>{ye.style.visibility="",ve()}).catch(Se),()=>cancelRunningTask(Me)}p$1(Re,[ie,me,se,ue,de,Te,Pe]);const $e=T$1(()=>{const{current:ye}=me;ye&&(ye.width=0,ye.height=0)},[me]);return p$1(()=>$e,[$e]),Cn.createElement("canvas",{className:"".concat(re,"__canvas"),dir:"ltr",ref:mergeRefs(_e,me),style:{display:"block",userSelect:"none"}},ae?Cn.createElement(StructTree,null):null)}function PageSVG(){const ee=usePageContext();invariant(ee,"Unable to find Page context.");const{_className:te,onRenderSuccess:ne,onRenderError:re,page:ie,rotate:se,scale:oe}=ee;invariant(ie,"Attempted to render page SVG, but no page was specified.");const[he,ue]=useResolver(),{value:de,error:ae}=he;function le(){ie&&ne&&ne(makePageCallback(ie,oe))}function Ae(){ae&&(isCancelException(ae)||(warning$1(!1,ae.toString()),re&&re(ae)))}const _e=F$1(()=>ie.getViewport({scale:oe,rotation:se}),[ie,se,oe]);function me(){ue({type:"RESET"})}p$1(me,[ie,ue,_e]);function ve(){if(!ie)return;const Re=makeCancellablePromise(ie.getOperatorList());return Re.promise.then($e=>{new pdfjs$1.SVGGraphics(ie.commonObjs,ie.objs).getSVG($e,_e).then(Ee=>{if(!(Ee instanceof SVGElement))throw new Error("getSVG returned unexpected result.");ue({type:"RESOLVE",value:Ee})}).catch(Ee=>{ue({type:"REJECT",error:Ee})})}).catch($e=>{ue({type:"REJECT",error:$e})}),()=>cancelRunningTask(Re)}p$1(ve,[ie,ue,_e]),p$1(()=>{if(de!==void 0){if(de===!1){Ae();return}le()}},[de]);function Se(Re){if(!Re||!de)return;Re.firstElementChild||Re.appendChild(de);const{width:$e,height:ye}=_e;de.setAttribute("width","".concat($e)),de.setAttribute("height","".concat(ye))}const{width:Te,height:Pe}=_e;return Cn.createElement("div",{className:"".concat(te,"__svg"),ref:Re=>Se(Re),style:{display:"block",backgroundColor:"white",overflow:"hidden",width:Te,height:Pe,userSelect:"none"}})}function isTextItem(ee){return"str"in ee}function TextLayer(){const ee=usePageContext();invariant(ee,"Unable to find Page context.");const{customTextRenderer:te,onGetTextError:ne,onGetTextSuccess:re,onRenderTextLayerError:ie,onRenderTextLayerSuccess:se,page:oe,pageIndex:he,pageNumber:ue,rotate:de,scale:ae}=ee;invariant(oe,"Attempted to load page text content, but no page was specified.");const[le,Ae]=useResolver(),{value:_e,error:me}=le,ve=_(null),Se=_();warning$1(parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10)===1,"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer");function Te(){_e&&re&&re(_e)}function Pe(){me&&(warning$1(!1,me.toString()),ne&&ne(me))}function Re(){Ae({type:"RESET"})}p$1(Re,[oe,Ae]);function $e(){if(!oe)return;const Fe=makeCancellablePromise(oe.getTextContent()),Ve=Fe;return Fe.promise.then(qe=>{Ae({type:"RESOLVE",value:qe})}).catch(qe=>{Ae({type:"REJECT",error:qe})}),()=>cancelRunningTask(Ve)}p$1($e,[oe,Ae]),p$1(()=>{if(_e!==void 0){if(_e===!1){Pe();return}Te()}},[_e]);const ye=T$1(()=>{se&&se()},[se]),Ee=T$1(Fe=>{warning$1(!1,Fe.toString()),ie&&ie(Fe)},[ie]);function Ne(){const Fe=Se.current;Fe&&Fe.classList.add("active")}function Me(){const Fe=Se.current;Fe&&Fe.classList.remove("active")}const we=F$1(()=>oe.getViewport({scale:ae,rotation:de}),[oe,de,ae]);function Oe(){if(!oe||!_e)return;const{current:Fe}=ve;if(!Fe)return;Fe.innerHTML="";const Ve=oe.streamTextContent({includeMarkedContent:!0}),qe={container:Fe,textContentSource:Ve,viewport:we},Ie=pdfjs$1.renderTextLayer(qe),Xe=Ie;return Ie.promise.then(()=>{const rt=document.createElement("div");rt.className="endOfContent",Fe.append(rt),Se.current=rt;const lt=Fe.querySelectorAll('[role="presentation"]');if(te){let Ge=0;_e.items.forEach((ut,mt)=>{if(!isTextItem(ut))return;const wt=lt[Ge];if(!wt)return;const Et=te(Object.assign({pageIndex:he,pageNumber:ue,itemIndex:mt},ut));wt.innerHTML=Et,Ge+=ut.str&&ut.hasEOL?2:1})}ye()}).catch(Ee),()=>cancelRunningTask(Xe)}return y(Oe,[te,Ee,ye,oe,he,ue,_e,we]),Cn.createElement("div",{className:clsx("react-pdf__Page__textContent","textLayer"),onMouseUp:Me,onMouseDown:Ne,ref:ve})}function AnnotationLayer(){const ee=useDocumentContext(),te=usePageContext();invariant(te,"Unable to find Page context.");const ne=Object.assign(Object.assign({},ee),te),{imageResourcesPath:re,linkService:ie,onGetAnnotationsError:se,onGetAnnotationsSuccess:oe,onRenderAnnotationLayerError:he,onRenderAnnotationLayerSuccess:ue,page:de,pdf:ae,renderForms:le,rotate:Ae,scale:_e=1}=ne;invariant(ae,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),invariant(de,"Attempted to load page annotations, but no page was specified."),invariant(ie,"Attempted to load page annotations, but no linkService was specified.");const[me,ve]=useResolver(),{value:Se,error:Te}=me,Pe=_(null);warning$1(parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function Re(){Se&&oe&&oe(Se)}function $e(){Te&&(warning$1(!1,Te.toString()),se&&se(Te))}function ye(){ve({type:"RESET"})}p$1(ye,[ve,de]);function Ee(){if(!de)return;const Fe=makeCancellablePromise(de.getAnnotations()),Ve=Fe;return Fe.promise.then(qe=>{ve({type:"RESOLVE",value:qe})}).catch(qe=>{ve({type:"REJECT",error:qe})}),()=>{cancelRunningTask(Ve)}}p$1(Ee,[ve,de,le]),p$1(()=>{if(Se!==void 0){if(Se===!1){$e();return}Re()}},[Se]);function Ne(){ue&&ue()}function Me(Fe){warning$1(!1,"".concat(Fe)),he&&he(Fe)}const we=F$1(()=>de.getViewport({scale:_e,rotation:Ae}),[de,Ae,_e]);function Oe(){if(!ae||!de||!ie||!Se)return;const{current:Fe}=Pe;if(!Fe)return;const Ve=we.clone({dontFlip:!0}),qe={accessibilityManager:null,annotationCanvasMap:null,div:Fe,l10n:null,page:de,viewport:Ve},Ie={annotations:Se,annotationStorage:ae.annotationStorage,div:Fe,downloadManager:null,imageResourcesPath:re,linkService:ie,page:de,renderForms:le,viewport:Ve};Fe.innerHTML="";try{new pdfjs$1.AnnotationLayer(qe).render(Ie),Ne()}catch(Xe){Me(Xe)}return()=>{}}return p$1(Oe,[Se,re,ie,de,le,we]),Cn.createElement("div",{className:clsx("react-pdf__Page__annotations","annotationLayer"),ref:Pe})}var __rest$1=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const defaultScale=1,Page=function ee(te){const ne=useDocumentContext(),re=Object.assign(Object.assign({},ne),te),{_className:ie="react-pdf__Page",_enableRegisterUnregisterPage:se=!0,canvasBackground:oe,canvasRef:he,children:ue,className:de,customRenderer:ae,customTextRenderer:le,devicePixelRatio:Ae,error:_e="Failed to load the page.",height:me,inputRef:ve,loading:Se="Loading page…",noData:Te="No page specified.",onGetAnnotationsError:Pe,onGetAnnotationsSuccess:Re,onGetStructTreeError:$e,onGetStructTreeSuccess:ye,onGetTextError:Ee,onGetTextSuccess:Ne,onLoadError:Me,onLoadSuccess:we,onRenderAnnotationLayerError:Oe,onRenderAnnotationLayerSuccess:Fe,onRenderError:Ve,onRenderSuccess:qe,onRenderTextLayerError:Ie,onRenderTextLayerSuccess:Xe,pageIndex:rt,pageNumber:lt,pdf:Ge,registerPage:ut,renderAnnotationLayer:mt=!0,renderForms:wt=!1,renderMode:Et="canvas",renderTextLayer:De=!0,rotate:pe,scale:be=defaultScale,unregisterPage:ge,width:Ce}=re,xe=__rest$1(re,["_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"]),[Le,Be]=useResolver(),{value:He,error:it}=Le,et=_(null);invariant(Ge,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const ot=isProvided(lt)?lt-1:rt!=null?rt:null,ht=lt!=null?lt:isProvided(rt)?rt+1:null,pt=pe!=null?pe:He?He.rotate:null,ct=F$1(()=>{if(!He)return null;let Vt=1;const jt=be!=null?be:defaultScale;if(Ce||me){const Gt=He.getViewport({scale:1,rotation:pt});Ce?Vt=Ce/Gt.width:me&&(Vt=me/Gt.height)}return jt*Vt},[me,He,pt,be,Ce]);function Pt(){return()=>{isProvided(ot)&&se&&ge&&ge(ot)}}p$1(Pt,[se,Ge,ot,ge]);function It(){if(we){if(!He||!ct)return;we(makePageCallback(He,ct))}if(se&&ut){if(!isProvided(ot)||!et.current)return;ut(ot,et.current)}}function vt(){it&&(warning$1(!1,it.toString()),Me&&Me(it))}function kt(){Be({type:"RESET"})}p$1(kt,[Be,Ge,ot]);function gt(){if(!Ge||!ht)return;const Vt=makeCancellablePromise(Ge.getPage(ht)),jt=Vt;return Vt.promise.then(Gt=>{Be({type:"RESOLVE",value:Gt})}).catch(Gt=>{Be({type:"REJECT",error:Gt})}),()=>cancelRunningTask(jt)}p$1(gt,[Be,Ge,ot,ht,ut]),p$1(()=>{if(He!==void 0){if(He===!1){vt();return}It()}},[He,ct]);const tt=F$1(()=>He&&isProvided(ot)&&ht&&isProvided(pt)&&isProvided(ct)?{_className:ie,canvasBackground:oe,customTextRenderer:le,devicePixelRatio:Ae,onGetAnnotationsError:Pe,onGetAnnotationsSuccess:Re,onGetStructTreeError:$e,onGetStructTreeSuccess:ye,onGetTextError:Ee,onGetTextSuccess:Ne,onRenderAnnotationLayerError:Oe,onRenderAnnotationLayerSuccess:Fe,onRenderError:Ve,onRenderSuccess:qe,onRenderTextLayerError:Ie,onRenderTextLayerSuccess:Xe,page:He,pageIndex:ot,pageNumber:ht,renderForms:wt,renderTextLayer:De,rotate:pt,scale:ct}:null,[ie,oe,le,Ae,Pe,Re,$e,ye,Ee,Ne,Oe,Fe,Ve,qe,Ie,Xe,He,ot,ht,wt,De,pt,ct]),nt=F$1(()=>makeEventProps(xe,()=>He&&(ct?makePageCallback(He,ct):void 0)),[xe,He,ct]),ft="".concat(ot,"@").concat(ct,"/").concat(pt),Tt="".concat(ot,"/").concat(pt);function Ct(){switch(Et){case"custom":return invariant(ae,'renderMode was set to "custom", but no customRenderer was passed.'),Cn.createElement(ae,{key:"".concat(ft,"_custom")});case"none":return null;case"svg":return Cn.createElement(PageSVG,{key:"".concat(Tt,"_svg")});case"canvas":default:return Cn.createElement(PageCanvas,{key:"".concat(ft,"_canvas"),canvasRef:he})}}function Ht(){return De?Cn.createElement(TextLayer,{key:"".concat(ft,"_text")}):null}function Wt(){return mt?Cn.createElement(AnnotationLayer,{key:"".concat(ft,"_annotations")}):null}function Ut(){return Cn.createElement(PageContext.Provider,{value:tt},Ct(),Ht(),Wt(),ue)}function zt(){return ht?Ge===null||He===void 0||He===null?Cn.createElement(Message,{type:"loading"},typeof Se=="function"?Se():Se):Ge===!1||He===!1?Cn.createElement(Message,{type:"error"},typeof _e=="function"?_e():_e):Ut():Cn.createElement(Message,{type:"no-data"},typeof Te=="function"?Te():Te)}return Cn.createElement("div",Object.assign({className:clsx(ie,de),"data-page-number":ht,ref:mergeRefs(ve,et),style:{"--scale-factor":"".concat(ct),backgroundColor:oe||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},nt),zt())},isFunctionOrNode=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Page.propTypes=Object.assign(Object.assign({},eventProps),{canvasBackground:PropTypes.string,canvasRef:isRef,children:PropTypes.node,className:isClassName,customRenderer:PropTypes.func,customTextRenderer:PropTypes.func,devicePixelRatio:PropTypes.number,error:isFunctionOrNode,height:PropTypes.number,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode,noData:isFunctionOrNode,onGetTextError:PropTypes.func,onGetTextSuccess:PropTypes.func,onLoadError:PropTypes.func,onLoadSuccess:PropTypes.func,onRenderError:PropTypes.func,onRenderSuccess:PropTypes.func,onRenderTextLayerError:PropTypes.func,onRenderTextLayerSuccess:PropTypes.func,pageIndex:isPageIndex,pageNumber:isPageNumber,pdf:isPdf,renderAnnotationLayer:PropTypes.bool,renderForms:PropTypes.bool,renderMode:isRenderMode,renderTextLayer:PropTypes.bool,rotate:isRotate,scale:PropTypes.number,width:PropTypes.number});const Page$1=Page;var __rest=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const Thumbnail=function ee(te){const ne=useDocumentContext(),re=Object.assign(Object.assign({},ne),te),{className:ie,linkService:se,onItemClick:oe,pageIndex:he,pageNumber:ue,pdf:de}=re;invariant(de,"Attempted to load a thumbnail, but no document was specified. Wrap <Thumbnail /> in a <Document /> or pass explicit `pdf` prop.");const ae=isProvided(ue)?ue-1:he!=null?he:null,le=ue!=null?ue:isProvided(he)?he+1:null;function Ae(me){me.preventDefault(),!(!isProvided(ae)||!le)&&(invariant(oe||se,"Either onItemClick callback or linkService must be defined in order to navigate to an outline item."),oe?oe({pageIndex:ae,pageNumber:le}):se&&se.goToPage(le))}const _e=__rest(te,["className","onItemClick"]);return Cn.createElement("a",{className:clsx("react-pdf__Thumbnail",ie),href:le?"#":void 0,onClick:Ae},Cn.createElement(Page$1,Object.assign({},_e,{_className:"react-pdf__Thumbnail__page",_enableRegisterUnregisterPage:!1,renderAnnotationLayer:!1,renderTextLayer:!1})))},Thumbnail$1=Thumbnail;displayWorkerWarning(),pdfjs$1.GlobalWorkerOptions.workerSrc="pdf.worker.js";const index=Object.freeze(Object.defineProperty({__proto__:null,Document:Document$1,Outline:Outline$1,Page:Page$1,PasswordResponses:PasswordResponses$1,Thumbnail:Thumbnail$1,pdfjs:pdfjs$1,useDocumentContext,useOutlineContext,usePageContext},Symbol.toStringTag,{value:"Module"}))})();
9
+ */var e=require$$0;function h(ee,te){return ee===te&&(ee!==0||1/ee===1/te)||ee!==ee&&te!==te}var k=typeof Object.is=="function"?Object.is:h,l$1=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(ee,te){var ne=te(),re=l$1({inst:{value:ne,getSnapshot:te}}),ie=re[0].inst,se=re[1];return n(function(){ie.value=ne,ie.getSnapshot=te,r$2(ie)&&se({inst:ie})},[ee,ne,te]),m(function(){return r$2(ie)&&se({inst:ie}),ee(function(){r$2(ie)&&se({inst:ie})})},[ee]),p(ne),ne}function r$2(ee){var te=ee.getSnapshot;ee=ee.value;try{var ne=te();return!k(ee,ne)}catch{return!0}}function t(ee,te){return te()}var u$1=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?t:q;useSyncExternalStoreShim_production_min.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u$1,shim.exports=useSyncExternalStoreShim_production_min;var shimExports=shim.exports;class Util_ElmishState$3{constructor(te,ne,re){this.arg=ne,this.dependencies=re;const ie=te(),se=[];let oe;const he=ProgramModule_init(ie)(this.arg);let ue=he[0],de=he[1];oe=[[ue,ae=>{se.push(ae)},!1,se],de],this.state=oe[0],this.cmd=oe[1],this.subscribe=ae=>{let le=!1;const Ae=isDisposable(this.state[0]);return ProgramModule_runWith(this.arg,ProgramModule_withSetState((_e,me)=>{const ve=this.state;this.state=[_e,me,!0,se],_e!==ve[0]&&ae()},ProgramModule_map((_e,me)=>{const ve=this.cmd;return this.cmd=Cmd_none(),[this.state[0],ve]},(_e,me,ve)=>_e(me)(this.state[0]),uncurry3(_e=>_e),uncurry3(_e=>_e),uncurry2(_e=>_e),_e=>[me=>_e[0](me)?!0:Ae&&le,me=>{const ve=me;isDisposable(ve)?disposeSafe(ve):_e[1](me)}],ie))),()=>{le=!0}}}}function Util_ElmishState$3_$ctor_Z29FF63CF(ee,te,ne){return new Util_ElmishState$3(ee,te,ne)}function Util_ElmishState$3__get_State(ee){return ee.state}function Util_ElmishState$3__get_Subscribe(ee){return ee.subscribe}function Util_ElmishState$3__IsOutdated_1954DBC6(ee,te,ne){return equals$2(ee.arg,te)?!equals$2(ee.dependencies,ne):!0}function React_useElmish_Z6C327F2E(ee,te,ne){const re=h$1(()=>Util_ElmishState$3_$ctor_Z29FF63CF(ee,te,ne)),ie=re[0];Util_ElmishState$3__IsOutdated_1954DBC6(ie,te,ne)&&re[1](Util_ElmishState$3_$ctor_Z29FF63CF(ee,te,ne));const se=shimExports.useSyncExternalStore(Util_ElmishState$3__get_Subscribe(ie),()=>Util_ElmishState$3__get_State(ie)),oe=se[2],he=se[3],ue=se[1];return p$1(()=>{if(oe&&he.length>0){let de=getEnumerator(he);try{for(;de["System.Collections.IEnumerator.MoveNext"]();){const ae=de["System.Collections.Generic.IEnumerator`1.get_Current"]();setTimeout(()=>{ue(ae)})}}finally{disposeSafe(de)}clear(he)}},[oe,he]),[se[0],ue]}const useEffectWithDeps=(ee,te)=>{p$1(()=>{const ne=ee();return()=>{ne.Dispose()}},te)},Interop_reactApi=Cn,ReactInterop_useEffectWithDeps=useEffectWithDeps;function React_createDisposable_3A5B6456(ee){return{Dispose(){ee()}}}function useReact_useEffectOnce_3A5B6456(ee){const te=Interop_reactApi.useRef(!1);useReact_useEffect_311B4086(()=>{te.current||(te.current=!0,ee())},[])}function useReact_useEffect_311B4086(ee,te){ReactInterop_useEffectWithDeps(ne=>(ee(),React_createDisposable_3A5B6456(()=>{})),te)}function useReact_useRef_1505(ee){return Interop_reactApi.useRef(ee)}function useFeliz_React__React_useState_Static_1505(ee){return Interop_reactApi.useState(ee)}class Deferred$1 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}function Deferred_inProgress(ee){return ee.tag===1}function notifyCompletion(ee){let te;te=new CustomEvent("step-completion",{bubbles:!0}),ee.dispatchEvent(te)}class AsyncOperationStatus$1 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Requested","Finished"]}}let Page$2=class extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Main","ReviewPolicy"]}};class State extends Record{constructor(te,ne,re,ie,se,oe,he){super(),this.Page=te,this.ReviewItemList=ne,this.GetInitStateStatus=re,this.PresentPoliciesStatus=ie,this.OpenPolicyStatus=se,this.AcceptPolicyStatus=oe,this.ContinueStatus=he}}class Msg extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["FetchReviewItemList","NavigatePage","PresentPolicies","OpenPolicy","AcceptPolicy","Continue","NotifyCompletion"]}}function StateModule_init(){return[new State(new Page$2(0,[]),empty$3(),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[])),singleton$2(ee=>{ee(new Msg(0,[new AsyncOperationStatus$1(0,[])]))})]}function StateModule_update(ee,te,ne){let re,ie;if(te.tag===1)return[new State(te.fields[0],ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(0,[]),ne.ContinueStatus),te.fields[0].tag===1?singleton$2(se=>{se(new Msg(3,[te.fields[0].fields[0],new AsyncOperationStatus$1(0,[])]))}):Cmd_none()];if(te.tag===2)return te.fields[1].tag===1?[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,new Deferred$1(2,[te.fields[1].fields[0]]),ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_none()]:[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,new Deferred$1(1,[]),ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},se=>BackendService__SendCommand_Z3B2D738(ee,se),new CommandTypeDto(0,[{PolicyIdentifierList:map$3(se=>se.Policy.Identifier,te.fields[0])}]),se=>{const oe=[te.fields[0],new AsyncOperationStatus$1(1,[se])];return new Msg(2,[oe[0],oe[1]])})];if(te.tag===3)return te.fields[1].tag===1?[new State(ne.Page,map$3(se=>equals$2(te.fields[0].Policy.Identifier,se.Policy.Identifier)?new PolicyReviewItemDto(se.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(se.Status,new PolicyReviewItemStatusDto(1,[]))):se,ne.ReviewItemList),ne.GetInitStateStatus,ne.PresentPoliciesStatus,new Deferred$1(2,[te.fields[1].fields[0]]),ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_none()]:[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,new Deferred$1(1,[]),ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},se=>BackendService__SendCommand_Z3B2D738(ee,se),new CommandTypeDto(1,[te.fields[0].Policy.Identifier]),se=>{const oe=[te.fields[0],new AsyncOperationStatus$1(1,[se])];return new Msg(3,[oe[0],oe[1]])})];if(te.tag===4)if(te.fields[1].tag===1){const se=map$3(oe=>equals$2(te.fields[0].Policy.Identifier,oe.Policy.Identifier)?new PolicyReviewItemDto(oe.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(oe.Status,new PolicyReviewItemStatusDto(2,[]))):oe,ne.ReviewItemList);return[new State((re=ne.Page,re.tag===1?(ie=re.fields[0],new Page$2(1,[new PolicyReviewItemDto(ie.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(ie.Status,new PolicyReviewItemStatusDto(2,[])))])):new Page$2(0,[])),se,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(2,[te.fields[1].fields[0]]),ne.ContinueStatus),te.fields[1].fields[0].tag===0?Cmd_ofEffect(oe=>{startImmediate(singleton.Delay(()=>singleton.Bind(sleep(1e3),()=>(oe(new Msg(1,[new Page$2(0,[])])),singleton.Zero()))))}):Cmd_none()]}else return[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(1,[]),ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},se=>BackendService__SendCommand_Z3B2D738(ee,se),new CommandTypeDto(2,[te.fields[0].Policy.Identifier]),se=>{const oe=[te.fields[0],new AsyncOperationStatus$1(1,[se])];return new Msg(4,[oe[0],oe[1]])})];else if(te.tag===5){if(te.fields[1].tag===1)return[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,new Deferred$1(2,[te.fields[1].fields[0]])),singleton$2(se=>{se(new Msg(6,[]))})];switch(ne.ContinueStatus.tag){case 0:case 2:case 3:return[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,new Deferred$1(1,[])),Cmd_OfAsyncWith_perform(oe=>{Cmd_OfAsync_start(oe)},oe=>BackendService__SendCommand_Z3B2D738(ee,oe),new CommandTypeDto(3,[{PolicyIdentifierList:map$3(oe=>oe.Policy.Identifier,te.fields[0])}]),oe=>{const he=[te.fields[0],new AsyncOperationStatus$1(1,[oe])];return new Msg(5,[he[0],he[1]])})];default:return[ne,Cmd_none()]}}else{if(te.tag===6)return notifyCompletion(document.querySelector("apollo-workplace-policies-app")),[ne,Cmd_none()];if(te.fields[0].tag===1){let se,oe;switch(te.fields[0].fields[0].tag===1||te.fields[0].fields[0].fields[0].tag===1?oe=1:oe=0,oe){case 0:{const ue=te.fields[0].fields[0].fields[0].fields[0];se=[ue.PolicyReviewList,singleton$2(de=>{de(new Msg(2,[ue.PolicyReviewList,new AsyncOperationStatus$1(0,[])]))})];break}case 1:{se=[void 0,Cmd_none()];break}}const he=se[0];return[new State(ne.Page,he==null?ne.ReviewItemList:he,new Deferred$1(2,[te.fields[0].fields[0]]),ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),se[1]]}else return[new State(ne.Page,ne.ReviewItemList,new Deferred$1(1,[]),ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},()=>BackendService__GetInitState(ee),void 0,se=>new Msg(0,[new AsyncOperationStatus$1(1,[se])]))]}}const scriptRel="modulepreload",assetsURL=function(ee){return"/workplace-policies/cdn/app/"+ee},seen={},__vitePreload=function(te,ne,re){return te()},TextLayer$1=':root{--react-pdf-text-layer: 1;--highlight-bg-color: rgba(180, 0, 170, 1);--highlight-selected-bg-color: rgba(0, 100, 0, 1)}@media screen and (forced-colors: active){:root{--highlight-bg-color: Highlight;--highlight-selected-bg-color: ButtonText}}[data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[data-main-rotation="270"]{transform:rotate(270deg) translate(-100%)}.textLayer{position:absolute;text-align:initial;top:0;right:0;bottom:0;left:0;overflow:hidden;line-height:1;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;z-index:2}.textLayer :is(span,br){color:transparent;position:absolute;white-space:pre;cursor:text;margin:0;transform-origin:0 0}.textLayer span.markedContent{top:0;height:0}.textLayer .highlight{margin:-1px;padding:1px;background-color:var(--highlight-bg-color);border-radius:4px}.textLayer .highlight.appended{position:initial}.textLayer .highlight.begin{border-radius:4px 0 0 4px}.textLayer .highlight.end{border-radius:0 4px 4px 0}.textLayer .highlight.middle{border-radius:0}.textLayer .highlight.selected{background-color:var(--highlight-selected-bg-color)}.textLayer br::-moz-selection{background:transparent}.textLayer br::selection{background:transparent}.textLayer .endOfContent{display:block;position:absolute;top:100%;right:0;bottom:0;left:0;z-index:-1;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.textLayer .endOfContent.active{top:0}\n',AnnotationLayer$1=":root{--react-pdf-annotation-layer: 1;--annotation-unfocused-field-background: url(\"data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>\");--input-focus-border-color: Highlight;--input-focus-outline: 1px solid Canvas;--input-unfocused-border-color: transparent;--input-disabled-border-color: transparent;--input-hover-border-color: black;--link-outline: none}@media screen and (forced-colors: active){:root{--input-focus-border-color: CanvasText;--input-unfocused-border-color: ActiveText;--input-disabled-border-color: GrayText;--input-hover-border-color: Highlight;--link-outline: 1.5px solid LinkText}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid selectedItem}.annotationLayer .linkAnnotation:hover{-webkit-backdrop-filter:invert(100%);backdrop-filter:invert(100%)}}.annotationLayer{position:absolute;top:0;left:0;pointer-events:none;transform-origin:0 0;z-index:3}.annotationLayer[data-main-rotation=\"90\"] .norotate{transform:rotate(270deg) translate(-100%)}.annotationLayer[data-main-rotation=\"180\"] .norotate{transform:rotate(180deg) translate(-100%,-100%)}.annotationLayer[data-main-rotation=\"270\"] .norotate{transform:rotate(90deg) translateY(-100%)}.annotationLayer canvas{position:absolute;width:100%;height:100%}.annotationLayer section{position:absolute;text-align:initial;pointer-events:auto;box-sizing:border-box;margin:0;transform-origin:0 0}.annotationLayer .linkAnnotation{outline:var(--link-outline)}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a:hover{opacity:.2;background:rgba(255,255,0,1);box-shadow:0 2px 10px #ff0}.annotationLayer .textAnnotation img{position:absolute;cursor:pointer;width:100%;height:100%;top:0;left:0}.annotationLayer .textWidgetAnnotation :is(input,textarea),.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{background-image:var(--annotation-unfocused-field-background);border:2px solid var(--input-unfocused-border-color);box-sizing:border-box;font:calc(9px * var(--scale-factor)) sans-serif;height:100%;margin:0;vertical-align:top;width:100%}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid red}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}.annotationLayer .textWidgetAnnotation textarea{resize:none}.annotationLayer .textWidgetAnnotation :is(input,textarea)[disabled],.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input[disabled]{background:none;border:2px solid var(--input-disabled-border-color);cursor:not-allowed}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:hover{border:2px solid var(--input-hover-border-color)}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation.checkBox input:hover{border-radius:2px}.annotationLayer .textWidgetAnnotation :is(input,textarea):focus,.annotationLayer .choiceWidgetAnnotation select:focus{background:none;border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) :focus{background-image:none;background-color:transparent}.annotationLayer .buttonWidgetAnnotation.checkBox :focus{border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.radioButton :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:CanvasText;content:\"\";display:block;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{height:80%;left:45%;width:1px}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:30%;top:20%;width:50%}.annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}.annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{-webkit-appearance:none;-moz-appearance:none;appearance:none}.annotationLayer .popupTriggerArea{height:100%;width:100%}.annotationLayer .fileAttachmentAnnotation .popupTriggerArea{position:absolute}.annotationLayer .popupWrapper{position:absolute;font-size:calc(9px * var(--scale-factor));width:100%;min-width:calc(180px * var(--scale-factor));pointer-events:none}.annotationLayer .popup{position:absolute;max-width:calc(180px * var(--scale-factor));background-color:#ff9;box-shadow:0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor)) #888;border-radius:calc(2px * var(--scale-factor));padding:calc(6px * var(--scale-factor));margin-left:calc(5px * var(--scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto}.annotationLayer .popup>*{font-size:calc(9px * var(--scale-factor))}.annotationLayer .popup h1{display:inline-block}.annotationLayer .popupDate{display:inline-block;margin-left:calc(5px * var(--scale-factor))}.annotationLayer .popupContent{border-top:1px solid rgba(51,51,51,1);margin-top:calc(2px * var(--scale-factor));padding-top:calc(2px * var(--scale-factor))}.annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--scale-factor))}.annotationLayer .highlightAnnotation,.annotationLayer .underlineAnnotation,.annotationLayer .squigglyAnnotation,.annotationLayer .strikeoutAnnotation,.annotationLayer .freeTextAnnotation,.annotationLayer .lineAnnotation svg line,.annotationLayer .squareAnnotation svg rect,.annotationLayer .circleAnnotation svg ellipse,.annotationLayer .polylineAnnotation svg polyline,.annotationLayer .polygonAnnotation svg polygon,.annotationLayer .caretAnnotation,.annotationLayer .inkAnnotation svg polyline,.annotationLayer .stampAnnotation,.annotationLayer .fileAttachmentAnnotation{cursor:pointer}.annotationLayer section svg{position:absolute;width:100%;height:100%;top:0;left:0}.annotationLayer .annotationTextContent{position:absolute;width:100%;height:100%;opacity:0;color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.annotationLayer .annotationTextContent span{width:100%;display:inline-block}\n",reactPdf=__vitePreload(()=>Promise.resolve().then(()=>index),void 0);function startImport(ee,te){startImmediate(singleton.Delay(()=>singleton.TryWith(singleton.Delay(()=>singleton.Bind(awaitPromise(reactPdf),ne=>{const re=ne;return re.pdfjs.GlobalWorkerOptions.workerSrc=new URL("/workplace-policies/cdn/app/assets/pdf.worker.min.js",self.location).toString(),ee(re),singleton.Zero()})),ne=>(te(),singleton.Zero()))))}const PdfCss_textLayer=(()=>toString$4(TextLayer$1))(),PdfCss_annotationLayer=(()=>toString$4(AnnotationLayer$1))(),PdfCss_all=PdfCss_textLayer+PdfCss_annotationLayer;class Document_Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["File","OnLoadSuccess","ClassName","OnItemClick","Children"]}}function Document_Component(ee,te){return Interop_reactApi.createElement(ee.Document,keyValueList(te,1))}class Page_Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["PageNumber","Width"]}}function Page_Component(ee,te){return Interop_reactApi.createElement(ee.Page,keyValueList(te,1))}class Thumbnail_Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Key","PageNumber","Width"]}}function Thumbnail_Component(ee,te){return Interop_reactApi.createElement(ee.Thumbnail,keyValueList(te,1))}const index$1='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.invisible{visibility:hidden}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.top-0{top:0}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.inline{display:inline}.flex{display:flex}.h-10{height:2.5rem}.h-20{height:5rem}.h-full{height:100%}.w-20{width:5rem}.w-\\[4\\.75rem\\]{width:4.75rem}.w-full{width:100%}.max-w-\\[560px\\]{max-width:560px}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.cursor-progress{cursor:progress}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-4{border-width:4px}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-primary-base{border-color:var(--fl-color-primary)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-primary-base{background-color:var(--fl-color-primary)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-1{padding:.25rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.align-bottom{vertical-align:bottom}.font-inter{font-family:Inter,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-8{line-height:2rem}.leading-tight{line-height:1.25}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-primary-base{color:var(--fl-color-primary)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline-offset-2{text-underline-offset:2px}.opacity-\\[0\\.07\\]{opacity:.07}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-black{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.ring-gray-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.ring-primary-base{--tw-ring-color: var(--fl-color-primary)}.ring-opacity-5{--tw-ring-opacity: .05}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:text-primary-base:hover{color:var(--fl-color-primary)}.hover\\:underline:hover{-webkit-text-decoration-line:underline;text-decoration-line:underline}.hover\\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\\:ring-primary-base:hover{--tw-ring-color: var(--fl-color-primary)}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-2:focus-visible{outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-primary-base:focus-visible{outline-color:var(--fl-color-primary)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:cursor-progress:disabled{cursor:progress}.disabled\\:border:disabled{border-width:1px}.disabled\\:border-gray-300:disabled{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.disabled\\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.disabled\\:text-gray-400:disabled{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\\:mr-2{margin-right:.5rem}.sm\\:mr-2\\.5{margin-right:.625rem}.sm\\:mt-0{margin-top:0}.sm\\:mt-10{margin-top:2.5rem}.sm\\:mt-6{margin-top:1.5rem}.sm\\:mt-\\[1px\\]{margin-top:1px}.sm\\:w-\\[12\\.5rem\\]{width:12.5rem}.sm\\:w-\\[35rem\\]{width:35rem}.sm\\:max-w-\\[57rem\\]{max-width:57rem}.sm\\:flex-row{flex-direction:row}.sm\\:p-5{padding:1.25rem}.sm\\:p-6{padding:1.5rem}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\\:py-16{padding-top:4rem;padding-bottom:4rem}.sm\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\\:py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.sm\\:py-20{padding-top:5rem;padding-bottom:5rem}.sm\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\\:text-base{font-size:1rem;line-height:1.5rem}.sm\\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\\:leading-6{line-height:1.5rem}.sm\\:leading-7{line-height:1.75rem}.sm\\:leading-8{line-height:2rem}.sm\\:leading-9{line-height:2.25rem}}@media (min-width: 768px){.md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\\:py-4{padding-top:1rem;padding-bottom:1rem}}@media (min-width: 1024px){.lg\\:visible{visibility:visible}}\n',css=(()=>toString$4(index$1))(),SvgCheck=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("g",{clipPath:"url(#clip0_3040_23717)"},y$1("path",{d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",fill:"currentColor"}),y$1("path",{d:"M6 12L10 16L18 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),y$1("defs",null,y$1("clipPath",{id:"clip0_3040_23717"},y$1("rect",{width:24,height:24,fill:"white"})))),SvgChevronLeft=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgChevronRight=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M9 6L15 12L9 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgDownload=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M4 16L4 17C4 18.6569 5.34315 20 7 20L17 20C18.6569 20 20 18.6569 20 17L20 16M16 12L12 16M12 16L8 12M12 16L12 4",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgFileNoAccess=ee=>y$1("svg",{width:33,height:32,viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("g",{id:"file-no-access 1"},y$1("g",{id:"Group"},y$1("path",{id:"Vector",d:"M29.5 1H3.5V31H29.5V1Z",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),y$1("path",{id:"Vector_2",d:"M11.5566 20.944L21.4406 11.06",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),y$1("path",{id:"Vector_3",d:"M16.5 23C20.366 23 23.5 19.866 23.5 16C23.5 12.134 20.366 9 16.5 9C12.634 9 9.5 12.134 9.5 16C9.5 19.866 12.634 23 16.5 23Z",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))),SvgFolderXmark=ee=>y$1("svg",{width:32,height:28,viewBox:"0 0 32 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M28 4C30.1875 4 32 5.8125 32 8V24C32 26.25 30.1875 28 28 28H4C1.75 28 0 26.25 0 24V4C0 1.8125 1.75 0 4 0H11.3125C12.375 0 13.375 0.4375 14.125 1.1875L17 4H28ZM30 24V8C30 6.9375 29.0625 6 28 6H16.125L12.75 2.625C12.375 2.25 11.875 2 11.3125 2H4C2.875 2 2 2.9375 2 4V24C2 25.125 2.875 26 4 26H28C29.0625 26 30 25.125 30 24ZM20.6875 11.3125C21.0625 11.6875 21.0625 12.375 20.6875 12.75L17.375 16L20.6875 19.3125C21.0625 19.6875 21.0625 20.375 20.6875 20.75C20.3125 21.125 19.625 21.125 19.25 20.75L16 17.4375L12.6875 20.75C12.3125 21.125 11.625 21.125 11.25 20.75C10.875 20.375 10.875 19.6875 11.25 19.3125L14.5625 16L11.25 12.75C10.875 12.375 10.875 11.6875 11.25 11.3125C11.625 10.9375 12.3125 10.9375 12.6875 11.3125L16 14.625L19.25 11.3125C19.625 10.9375 20.3125 10.9375 20.6875 11.3125Z",fill:"currentColor"})),SvgLaunch=ee=>y$1("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 4H15.5C15.6326 4 15.7597 4.05268 15.8535 4.14645C15.9473 4.24022 16 4.36739 16 4.5V9.5C15.9999 9.59894 15.9706 9.69565 15.9156 9.77789C15.8606 9.86013 15.7824 9.92421 15.691 9.962C15.6303 9.98677 15.5655 9.99967 15.5 10C15.4343 10.0001 15.3692 9.98729 15.3084 9.96223C15.2477 9.93718 15.1925 9.9004 15.146 9.854L13.354 8.061L10.707 10.707C10.6147 10.8025 10.5044 10.8787 10.3824 10.9311C10.2604 10.9835 10.1291 11.0111 9.99636 11.0123C9.86358 11.0134 9.7319 10.9881 9.609 10.9378C9.48611 10.8875 9.37446 10.8133 9.28056 10.7194C9.18667 10.6255 9.11242 10.5139 9.06214 10.391C9.01186 10.2681 8.98655 10.1364 8.98771 10.0036C8.98886 9.87082 9.01645 9.7396 9.06886 9.6176C9.12127 9.49559 9.19745 9.38525 9.29296 9.293L11.939 6.646L10.146 4.854C10.0759 4.78407 10.0281 4.6949 10.0087 4.59779C9.98935 4.50068 9.99926 4.40001 10.0372 4.30854C10.0751 4.21706 10.1393 4.13891 10.2217 4.08398C10.3041 4.02905 10.4009 3.99982 10.5 4ZM12 16H6C5.46957 16 4.96086 15.7893 4.58579 15.4142C4.21071 15.0391 4 14.5304 4 14V8C4 7.46957 4.21071 6.96086 4.58579 6.58579C4.96086 6.21071 5.46957 6 6 6H7C7.26522 6 7.51957 6.10536 7.70711 6.29289C7.89464 6.48043 8 6.73478 8 7C8 7.26522 7.89464 7.51957 7.70711 7.70711C7.51957 7.89464 7.26522 8 7 8H6V14H12V13C12 12.7348 12.1054 12.4804 12.2929 12.2929C12.4804 12.1054 12.7348 12 13 12C13.2652 12 13.5196 12.1054 13.7071 12.2929C13.8946 12.4804 14 12.7348 14 13V14C14 14.5304 13.7893 15.0391 13.4142 15.4142C13.0391 15.7893 12.5304 16 12 16Z",fill:"currentColor"})),SvgLoader=ee=>y$1("svg",{width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("g",{id:"Loader Mini"},y$1("path",{id:"Ellipse 2",d:"M18.5 10C18.5 14.4183 14.9183 18 10.5 18C6.08172 18 2.5 14.4183 2.5 10C2.5 5.58172 6.08172 2 10.5 2C14.9183 2 18.5 5.58172 18.5 10ZM4.49743 10C4.49743 13.3151 7.18487 16.0026 10.5 16.0026C13.8151 16.0026 16.5026 13.3151 16.5026 10C16.5026 6.68487 13.8151 3.99743 10.5 3.99743C7.18487 3.99743 4.49743 6.68487 4.49743 10Z",fill:"white",fillOpacity:.3}),y$1("path",{id:"Ellipse 2_2",d:"M10.5 3C10.5 2.44772 10.9494 1.99356 11.4974 2.06242C12.2053 2.15137 12.8996 2.3348 13.5615 2.60896C14.5321 3.011 15.414 3.60028 16.1569 4.34315C16.8997 5.08602 17.489 5.96793 17.891 6.93853C18.1652 7.60043 18.3486 8.29473 18.4376 9.0026C18.5064 9.55057 18.0523 10 17.5 10C16.9477 10 16.5085 9.54925 16.4169 9.00462C16.342 8.55939 16.2169 8.12298 16.0433 7.7039C15.7417 6.97595 15.2998 6.31451 14.7426 5.75736C14.1855 5.20021 13.5241 4.75825 12.7961 4.45672C12.377 4.28313 11.9406 4.15804 11.4954 4.08314C10.9508 3.99152 10.5 3.55228 10.5 3Z",fill:"white"}))),SvgMenu=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M4 6H20M4 12H20M4 18H20",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgMinus=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M18 12H6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgPlus=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M12 6V12M12 12V18M12 12H18M12 12L6 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));class Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Height","Width","ClassName"]}}function importSvg(ee,te){return Interop_reactApi.createElement(ee,keyValueList(te,1))}function check(ee){return importSvg(SvgCheck,ee)}function chevronLeft(ee){return importSvg(SvgChevronLeft,ee)}function chevronRight(ee){return importSvg(SvgChevronRight,ee)}function download(ee){return importSvg(SvgDownload,ee)}function fileNoAccess(ee){return importSvg(SvgFileNoAccess,ee)}function folderXmark(ee){return importSvg(SvgFolderXmark,ee)}function launch(ee){return importSvg(SvgLaunch,ee)}function loader(ee){return importSvg(SvgLoader,ee)}function menu(ee){return importSvg(SvgMenu,ee)}function minus(ee){return importSvg(SvgMinus,ee)}function plus(ee){return importSvg(SvgPlus,ee)}function getKey(ee){return ee.PolicyType.tag===1?"".concat(ee.PolicyId,"-C"):"".concat(ee.PolicyId,"-I")}function Component$5(ee){let te,ne,re;const ie=ee.item,se=ee.dispatch,oe=useFeliz_React__React_useState_Static_1505(!1),he=oe[1],ue=equals$2(ie.Status,new PolicyReviewItemStatusDto(2,[]));return y$1("div",createObj(ofArray$2([["key",getKey(ie.Policy.Identifier)],["onMouseEnter",de=>{he(!0)}],["onMouseLeave",de=>{he(!1)}],["onClick",de=>{se(new Msg(1,[new Page$2(1,[ie])]))}],["className",join(" ",toList(delay(()=>append(singleton$1("py-6 px-4 sm:px-6 shadow-sm rounded-lg text-left cursor-pointer"),delay(()=>singleton$1(ue?"ring-2 ring-primary-base":"ring-1 ring-gray-300 hover:ring-2 hover:ring-primary-base"))))))],(te=[y$1("div",createObj(ofArray$2([["className","flex justify-between"],(ne=[y$1("div",{className:"text-base leading-6 font-semibold text-gray-900 mr-4",children:ie.Policy.Title}),y$1("div",createObj(ofArray$2([["className",join(" ",toList(delay(()=>append(singleton$1("ml-2"),delay(()=>singleton$1(ue?"text-primary-base":"text-gray-400"))))))],(re=toList(delay(()=>singleton$1(ue?check(empty$3()):chevronRight(singleton$2(new Prop(2,[oe[0]?"text-primary-base":""])))))),["children",Interop_reactApi.Children.toArray(Array.from(re))])])))],["children",Interop_reactApi.Children.toArray(Array.from(ne))])]))),y$1("div",{className:"text-sm leading-5 font-normal text-gray-500 mt-2",children:ie.Policy.Description}),y$1("div",{className:"text-sm leading-5 font-medium mt-3 text-primary-base hover:underline underline-offset-2",children:"View document (PDF)"})],["children",Interop_reactApi.Children.toArray(Array.from(te))])])))}function canContinue(ee){return forAll(te=>equals$2(te.Status,new PolicyReviewItemStatusDto(2,[])),ee)}function title(ee){return y$1("div",{className:"text-gray-900 text-2xl sm:text-3xl leading-8 sm:leading-9 font-bold",children:ee})}function container(ee){let te;return y$1("div",createObj(ofArray$2([["className","w-full sm:w-[35rem] text-center bg-white mx-auto px-1 py-5 sm:py-16"],(te=toList(delay(()=>ee)),["children",Interop_reactApi.Children.toArray(Array.from(te))])])))}function noPoliciesConfigured(ee){let te,ne;return container([y$1("div",createObj(ofArray$2([["className","mb-4 mx-auto w-20 h-20 p-6 relative"],(te=[y$1("div",{className:"absolute top-0 left-0 w-full h-full bg-primary-base opacity-[0.07] rounded-full"}),folderXmark(singleton$2(new Prop(2,["text-primary-base"])))],["children",Interop_reactApi.Children.toArray(Array.from(te))])]))),title("No statements available"),y$1("div",{className:"text-center text-gray-600 text-lg font-normal leading-7 sm:leading-8 mt-4",children:"It looks like there are no statements for you to review from your employer at this time."}),y$1("button",createObj(ofArray$2([["type","button"],(ne="mt-8 sm:mt-10 mx-auto shadow-sm w-full sm:w-[12.5rem] h-10 px-4 py-2\n rounded-md flex justify-center items-center text-white text-base\n font-semibold leading-6 cursor-pointer bg-primary-base\n focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base",["className",ne]),["onClick",re=>{ee(new Msg(6,[]))}],["children","Continue"]])))])}function Component$4(ee,te,ne){let re,ie,se;return container([title("Employment information statements"),y$1("div",createObj(ofArray$2([["className","text-gray-600 text-base sm:text-lg font-normal leading-7 sm:leading-8 mt-4"],(re="Please review and accept the below information statement. They outline your entitlements and protections as an employee in Australia.",["children",re])]))),y$1("div",createObj(ofArray$2([["className","space-y-4 mt-8 sm:mt-10"],(ie=toList(delay(()=>map$3(oe=>y$1(Component$5,{dispatch:ne,item:oe}),ee))),["children",Interop_reactApi.Children.toArray(Array.from(ie))])]))),y$1("div",createObj(ofArray$2([["className","text-gray-900 text-sm font-normal leading-5 mt-4 sm:mt-6 text-left"],(se="As a new employee, your employer is required to give you a copy of the Fair Work Information Statements provided by the Fair Work Ombudsman, before, or as soon as possible after, you start your new job.",["children",se])]))),y$1("button",createObj(toList(delay(()=>{const oe=te.tag===1?!0:!canContinue(ee);return append(singleton$1(["disabled",oe]),delay(()=>append(singleton$1(["type","button"]),delay(()=>append(singleton$1(["className",join(" ",toList(delay(()=>append(singleton$1("mt-8 sm:mt-10 mx-auto shadow-sm w-full sm:w-[12.5rem] h-10 px-4 py-2\n rounded-md flex justify-center items-center text-white text-base\n font-semibold leading-6 cursor-pointer bg-primary-base\n focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base"),delay(()=>append(Deferred_inProgress(te)?singleton$1("cursor-progress"):empty$2(),delay(()=>!Deferred_inProgress(te)&&oe?singleton$1("disabled:text-gray-400 disabled:cursor-not-allowed\n disabled:border disabled:border-gray-300 disabled:bg-gray-100"):empty$2())))))))]),delay(()=>append(singleton$1(["onClick",he=>{ne(new Msg(5,[ee,new AsyncOperationStatus$1(0,[])]))}]),delay(()=>{let he;return singleton$1((he=toList(delay(()=>te.tag===1?singleton$1(loader(singleton$2(new Prop(2,["animate-spin"])))):singleton$1("Continue"))),["children",Interop_reactApi.Children.toArray(Array.from(he))]))}))))))))}))))])}function Component$3(ee){let te,ne,re,ie;return y$1("div",createObj(ofArray$2([(te="flex flex-col justify-center items-center w-full shadow rounded-lg ring-1 ring-black ring-opacity-5 bg-gray-100 py-10 px-4 sm:py-20",["className",te]),(ne=[fileNoAccess(empty$3()),y$1("h1",{className:"mt-4 text-gray-900 text-base leading-6 font-semibold",children:"Unable to load PDF"}),y$1("p",createObj(ofArray$2([["className","mt-2 text-gray-700 text-sm leading-5 font-normal max-w-[560px] text-center"],(re="It looks like we’re unable to load the PDF at this time. Download the document below to view the statement.",["children",re])]))),y$1("a",createObj(ofArray$2([(ie="mt-4 text-primary-base text-sm leading-5 font-medium cursor-pointer hover:underline underline-offset-2",["className",ie]),["href",PathDto__get_Value(ee.Path)],["download",ee.Name],["target","_blank"],["children","Download document (PDF)"]])))],["children",Interop_reactApi.Children.toArray(Array.from(ne))])])))}function Component$2(ee){let te,ne,re,ie,se,oe,he,ue;const de=ee.file,ae=ee.reactPdf,le=useFeliz_React__React_useState_Static_1505(!1),Ae=useFeliz_React__React_useState_Static_1505(!1),_e=Ae[0],me=Ae[1],ve=useFeliz_React__React_useState_Static_1505(1),Se=ve[0]|0,Te=useFeliz_React__React_useState_Static_1505(1),Pe=Te[1],Re=Te[0]|0,$e=useReact_useRef_1505(void 0);return y$1("div",createObj(ofArray$2([["ref",$e],(te="flex flex-col justify-center items-center w-full shadow rounded-lg ring-1 ring-black ring-opacity-5 bg-gray-100",["className",te]),(ne=[y$1("style",{children:[PdfCss_all]}),y$1("div",createObj(ofArray$2([["className","flex justify-between items-center py-4 px-4 md:py-3 w-full shadow-sm bg-white rounded-t-lg"],(re=[y$1("button",createObj(ofArray$2([["className","invisible lg:visible p-1 rounded-full hover:bg-gray-100"],["type","button"],["onClick",ye=>{me(!_e)}],["title","Menu"],(ie=[menu(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(ie))])]))),y$1("div",createObj(ofArray$2([["className","flex items-center"],(se=[y$1("button",createObj(ofArray$2([["className","p-1 rounded-full hover:bg-gray-100"],["type","button"],["disabled",Re<=1],["onClick",ye=>{Pe(Re-1)}],["title","Previous page"],(oe=[chevronLeft(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(oe))])]))),y$1("div",{className:"text-gray-900 text-sm font-normal leading-tight mx-4",children:"Page ".concat(Re," / ").concat(Se)}),y$1("button",createObj(ofArray$2([["className","p-1 rounded-full hover:bg-gray-100"],["type","button"],["disabled",Re>=Se],["onClick",ye=>{Pe(Re+1)}],["title","Next page"],(he=[chevronRight(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(he))])])))],["children",Interop_reactApi.Children.toArray(Array.from(se))])]))),y$1("a",createObj(ofArray$2([["className","p-1 rounded-full hover:bg-gray-100"],["href",PathDto__get_Value(de.Path)],["download",de.Name],["title","Download"],["target","_blank"],(ue=[download(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(ue))])])))],["children",Interop_reactApi.Children.toArray(Array.from(re))])]))),Document_Component(ae,ofArray$2([new Document_Prop(0,[PathDto__get_Value(de.Path)]),new Document_Prop(1,[ye=>{le[0]||(le[1](!0),ve[1](ye.numPages),me(value($e.current).clientWidth>=1024))}]),new Document_Prop(3,[ye=>{Pe(ye.pageNumber)}]),new Document_Prop(2,["flex py-2 md:py-4"]),new Document_Prop(4,[[y$1("div",createObj(toList(delay(()=>_e?append(singleton$1(["className","flex flex-col space-y-4 p-4"]),delay(()=>{let ye;return singleton$1((ye=toList(delay(()=>map$2(Ee=>{const Ne=ofArray$2([y$1("div",createObj(toList(delay(()=>append(Re===Ee?singleton$1(["className","border-4 border-primary-base rounded"]):empty$2(),delay(()=>{let Me;return singleton$1((Me=[Thumbnail_Component(ae,ofArray$2([new Thumbnail_Prop(0,["thumbnail-".concat(Ee)]),new Thumbnail_Prop(1,[Ee]),new Thumbnail_Prop(2,[100])]))],["children",Interop_reactApi.Children.toArray(Array.from(Me))]))})))))),y$1("div",{className:"mt-1 text-center text-xs text-gray-600",children:Ee})]);return y$1("div",{children:Interop_reactApi.Children.toArray(Array.from(Ne))})},rangeDouble(1,1,Se)))),["children",Interop_reactApi.Children.toArray(Array.from(ye))]))})):empty$2())))),Page_Component(ae,toList(delay(()=>append(singleton$1(new Page_Prop(0,[Re])),delay(()=>$e.current!=null?singleton$1(new Page_Prop(1,[min(comparePrimitives,value($e.current).clientWidth-32,768)])):empty$2())))))]])]))],["children",Interop_reactApi.Children.toArray(Array.from(ne))])])))}function Component$1(ee){let te,ne,re,ie;const se=ee.dispatch,oe=ee.reactPdf,he=ee.acceptPolicyStatus,ue=ee.policyReviewItem,de=useFeliz_React__React_useState_Static_1505(!1),ae=de[0],le=de[1];return y$1("div",createObj(ofArray$2([["className","w-full p-1 sm:p-5"],(te=[y$1("div",createObj(ofArray$2([["className","flex justify-between items-center"],(ne=toList(delay(()=>{let Ae;return append(singleton$1(y$1("div",createObj(ofArray$2([["className","flex items-start cursor-pointer text-gray-900 hover:text-primary-base"],["disabled",Deferred_inProgress(he)],["onClick",_e=>{se(new Msg(1,[new Page$2(0,[])]))}],(Ae=[chevronLeft(singleton$2(new Prop(2,["sm:mt-[1px]"]))),y$1("div",{className:"ml-1 mr-4 text-base sm:text-lg leading-6 sm:leading-7 font-semibold text-gray-900",children:ue.Policy.Title})],["children",Interop_reactApi.Children.toArray(Array.from(Ae))])])))),delay(()=>{let _e,me,ve;return ue.Status.tag===2?singleton$1(y$1("div",createObj(ofArray$2([["className","flex items-center flex-col-reverse sm:flex-row"],(_e=[y$1("span",{className:"mt-1 sm:mt-0 sm:mr-2.5 sm:py-2.5 text-sm leading-5 font-medium text-gray-500",children:"Accepted"}),check(singleton$2(new Prop(2,["text-primary-base"])))],["children",Interop_reactApi.Children.toArray(Array.from(_e))])])))):singleton$1(y$1("button",createObj(ofArray$2([["type","button"],["disabled",Deferred_inProgress(he)],(me="\n shadow-sm w-[4.75rem] h-10 px-3 py-2 rounded-md flex justify-center items-center text-white\n text-sm font-semibold leading-5 cursor-pointer disabled:cursor-progress bg-primary-base\n focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base\n ",["className",me]),["onClick",Se=>{se(new Msg(4,[ue,new AsyncOperationStatus$1(0,[])]))}],(ve=toList(delay(()=>he.tag===1?singleton$1(loader(singleton$2(new Prop(2,["animate-spin"])))):singleton$1("Accept"))),["children",Interop_reactApi.Children.toArray(Array.from(ve))])]))))}))})),["children",Interop_reactApi.Children.toArray(Array.from(ne))])]))),y$1("div",createObj(ofArray$2([["className","mt-4 sm:mt-6 mb-6"],(re=toList(delay(()=>oe==null?singleton$1(y$1(Component$3,ue.Policy.File)):singleton$1(y$1(Component$2,{reactPdf:oe,file:ue.Policy.File})))),["children",Interop_reactApi.Children.toArray(Array.from(re))])]))),y$1("div",createObj(ofArray$2([["className","p-4 sm:p-6 rounded-lg shadow-sm border border-gray-300"],(ie=toList(delay(()=>{let Ae;return append(singleton$1(y$1("div",createObj(ofArray$2([["className","flex justify-between cursor-pointer text-gray-400 hover:text-primary-base"],["onClick",_e=>{le(!ae)}],(Ae=toList(delay(()=>append(singleton$1(y$1("div",{className:"text-sm mr-4 sm:text-base leading-5 sm:leading-6 font-semibold text-gray-900",children:"About the ".concat(ue.Policy.Title)})),delay(()=>singleton$1(ae?minus(empty$3()):plus(empty$3())))))),["children",Interop_reactApi.Children.toArray(Array.from(Ae))])])))),delay(()=>{let _e,me,ve;return ae?singleton$1(y$1("div",createObj(ofArray$2([["className","mt-2 space-y-3 sm:max-w-[57rem]"],["onClick",Se=>{le(!ae)}],(_e=[y$1("div",{className:"text-sm font-normal leading-6 text-gray-900",children:ue.Policy.About.Copy}),y$1("a",createObj(ofArray$2([(me="text-sm font-medium leading-5 text-primary-base cursor-pointer hover:underline underline-offset-2 break-all",["className",me]),["target","_blank"],["rel","noopener"],["href",ue.Policy.About.Link],(ve=[ue.Policy.About.Link,launch(singleton$2(new Prop(2,["inline align-bottom"])))],["children",Interop_reactApi.Children.toArray(Array.from(ve))])])))],["children",Interop_reactApi.Children.toArray(Array.from(_e))])])))):empty$2()}))})),["children",Interop_reactApi.Children.toArray(Array.from(ie))])])))],["children",Interop_reactApi.Children.toArray(Array.from(te))])])))}function r$1(){return(r$1=Object.assign||function(ee){for(var te=1;te<arguments.length;te++){var ne=arguments[te];for(var re in ne)Object.prototype.hasOwnProperty.call(ne,re)&&(ee[re]=ne[re])}return ee}).apply(this,arguments)}function i(ee){this.getChildContext=function(){return ee.context};var te=ee.children,ne=function(re,ie){if(re==null)return{};var se,oe,he={},ue=Object.keys(re);for(oe=0;oe<ue.length;oe++)ie.indexOf(se=ue[oe])>=0||(he[se]=re[se]);return he}(ee,["context","children"]);return F$2(te,ne)}function a(){var ee=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(ee),this._vdom=y$1(i,r$1({},this._props,{context:ee.detail.context}),function te(ne,re){if(ne.nodeType===3)return ne.data;if(ne.nodeType!==1)return null;var ie=[],se={},oe=0,he=ne.attributes,ue=ne.childNodes;for(oe=he.length;oe--;)he[oe].name!=="slot"&&(se[he[oe].name]=he[oe].value,se[s(he[oe].name)]=he[oe].value);for(oe=ue.length;oe--;){var de=te(ue[oe],null),ae=ue[oe].slot;ae?se[ae]=y$1(u,{name:ae},de):ie[oe]=de}var le=re?y$1(u,null,ie):ie;return y$1(re||ne.nodeName.toLowerCase(),se,le)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?E$1:D$1)(this._vdom,this._root)}function s(ee){return ee.replace(/-(\w)/g,function(te,ne){return ne?ne.toUpperCase():""})}function c(ee,te,ne){if(this._vdom){var re={};re[ee]=ne=ne==null?void 0:ne,re[s(ee)]=ne,this._vdom=F$2(this._vdom,re),D$1(this._vdom,this._root)}}function l(){D$1(this._vdom=null,this._root)}function u(ee,te){var ne=this;return y$1("slot",r$1({},ee,{ref:function(re){re?(ne.ref=re,ne._listener||(ne._listener=function(ie){ie.stopPropagation(),ie.detail.context=te},re.addEventListener("_preact",ne._listener))):ne.ref.removeEventListener("_preact",ne._listener)}}))}function preact_custom_element(ee,te,ne,re){function ie(){var se=Reflect.construct(HTMLElement,[],ie);return se._vdomComponent=ee,se._root=re&&re.shadow?se.attachShadow({mode:"open"}):se,se}return(ie.prototype=Object.create(HTMLElement.prototype)).constructor=ie,ie.prototype.connectedCallback=a,ie.prototype.attributeChangedCallback=c,ie.prototype.disconnectedCallback=l,ne=ne||ee.observedAttributes||Object.keys(ee.propTypes||{}),ie.observedAttributes=ne,ne.forEach(function(se){Object.defineProperty(ie.prototype,se,{get:function(){return this._vdom.props[se]},set:function(oe){this._vdom?this.attributeChangedCallback(se,null,oe):(this._props||(this._props={}),this._props[se]=oe,this.connectedCallback());var he=typeof oe;oe!=null&&he!=="string"&&he!=="boolean"&&he!=="number"||this.setAttribute(se,oe)}})}),customElements.define(te||ee.tagName||ee.displayName||ee.name,ie)}function register(ee,te){preact_custom_element(ee,te,void 0,{shadow:!0})}class PdfModuleStatus extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Loading","Loaded"]}}function Component(ee){let te,ne;const re=BackendService_$ctor_Z384F8060(ee.backendUrl,ee.accessToken);ne=React_useElmish_Z6C327F2E(()=>ProgramModule_mkProgram(StateModule_init,(ae,le)=>StateModule_update(re,ae,le),(ae,le)=>{}),void 0,void 0);const ie=ne[0],se=ne[1],oe=useFeliz_React__React_useState_Static_1505(new PdfModuleStatus(0,[])),he=oe[1],ue=oe[0];useReact_useEffectOnce_3A5B6456(()=>{startImport(ae=>{he(new PdfModuleStatus(1,[ae]))},()=>{he(new PdfModuleStatus(1,[void 0]))})});const de=[y$1("style",{children:[css]}),y$1("div",createObj(ofArray$2([["className","font-inter"],(te=toList(delay(()=>{const ae=ie.GetInitStateStatus,le=ie.PresentPoliciesStatus;let Ae,_e;switch(ae.tag===3?(le.tag===3||le.tag===0||le.tag===1||le.fields[0].tag,Ae=0):ae.tag===0||ae.tag===1?le.tag===3?Ae=0:le.tag===0||le.tag===1?Ae=3:le.fields[0].tag===1?Ae=0:Ae=3:ae.fields[0].tag===0?le.tag===3?Ae=0:le.tag===0||le.tag===1?ae.fields[0].fields[0].tag===1?Ae=1:Ae=3:le.fields[0].tag===0?ae.fields[0].fields[0].tag===0?ue.tag===0?Ae=3:(Ae=2,_e=ue.fields[0]):Ae=1:Ae=0:Ae=0,Ae){case 0:return singleton$1(y$1("div",{children:["Oops, we've encountered an error"]}));case 1:return singleton$1(noPoliciesConfigured(se));case 2:{const me=ie.Page;return me.tag===1?singleton$1(y$1(Component$1,{policyReviewItem:me.fields[0],acceptPolicyStatus:ie.AcceptPolicyStatus,reactPdf:_e,dispatch:se})):singleton$1(Component$4(ie.ReviewItemList,ie.ContinueStatus,se))}case 3:return singleton$1(y$1("div",{children:["Please wait..."]}))}})),["children",Interop_reactApi.Children.toArray(Array.from(te))])])))];return y$1(k$3,{},...de)}register(ee=>y$1(Component,ee),"apollo-workplace-policies-app");function commonjsRequire(ee){throw new Error('Could not dynamically require "'+ee+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports){(function(te,ne){module.exports=te.pdfjsLib=ne()})(globalThis,()=>(()=>{var __webpack_modules__=[,(ee,te)=>{var Gt;Object.defineProperty(te,"__esModule",{value:!0}),te.VerbosityLevel=te.Util=te.UnknownErrorException=te.UnexpectedResponseException=te.TextRenderingMode=te.RenderingIntentFlag=te.PromiseCapability=te.PermissionFlag=te.PasswordResponses=te.PasswordException=te.PageActionEventType=te.OPS=te.MissingPDFException=te.MAX_IMAGE_SIZE_TO_CACHE=te.LINE_FACTOR=te.LINE_DESCENT_FACTOR=te.InvalidPDFException=te.ImageKind=te.IDENTITY_MATRIX=te.FormatError=te.FeatureTest=te.FONT_IDENTITY_MATRIX=te.DocumentActionEventType=te.CMapCompressionType=te.BaseException=te.BASELINE_FACTOR=te.AnnotationType=te.AnnotationReplyType=te.AnnotationPrefix=te.AnnotationMode=te.AnnotationFlag=te.AnnotationFieldFlag=te.AnnotationEditorType=te.AnnotationEditorPrefix=te.AnnotationEditorParamsType=te.AnnotationBorderStyleType=te.AnnotationActionEventType=te.AbortException=void 0,te.assert=ut,te.bytesToString=He,te.createValidAbsoluteUrl=wt,te.getModificationDate=Ct,te.getUuid=Vt,te.getVerbosityLevel=Xe,te.info=rt,te.isArrayBuffer=ft,te.isArrayEqual=Tt,te.isNodeJS=void 0,te.normalizeUnicode=zt,te.objectFromMap=ht,te.objectSize=ot,te.setVerbosityLevel=Ie,te.shadow=Et,te.string32=et,te.stringToBytes=it,te.stringToPDFString=gt,te.stringToUTF8String=tt,te.unreachable=Ge,te.utf8StringToString=nt,te.warn=lt;const ne=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");te.isNodeJS=ne;const re=[1,0,0,1,0,0];te.IDENTITY_MATRIX=re;const ie=[.001,0,0,.001,0,0];te.FONT_IDENTITY_MATRIX=ie;const se=1e7;te.MAX_IMAGE_SIZE_TO_CACHE=se;const oe=1.35;te.LINE_FACTOR=oe;const he=.35;te.LINE_DESCENT_FACTOR=he;const ue=he/oe;te.BASELINE_FACTOR=ue;const de={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};te.RenderingIntentFlag=de;const ae={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};te.AnnotationMode=ae;const le="pdfjs_internal_editor_";te.AnnotationEditorPrefix=le;const Ae={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};te.AnnotationEditorType=Ae;const _e={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};te.AnnotationEditorParamsType=_e;const me={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};te.PermissionFlag=me;const ve={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};te.TextRenderingMode=ve;const Se={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};te.ImageKind=Se;const Te={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};te.AnnotationType=Te;const Pe={GROUP:"Group",REPLY:"R"};te.AnnotationReplyType=Pe;const Re={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};te.AnnotationFlag=Re;const $e={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};te.AnnotationFieldFlag=$e;const ye={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};te.AnnotationBorderStyleType=ye;const Ee={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};te.AnnotationActionEventType=Ee;const Ne={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};te.DocumentActionEventType=Ne;const Me={O:"PageOpen",C:"PageClose"};te.PageActionEventType=Me;const we={ERRORS:0,WARNINGS:1,INFOS:5};te.VerbosityLevel=we;const Oe={NONE:0,BINARY:1};te.CMapCompressionType=Oe;const Fe={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};te.OPS=Fe;const Ve={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};te.PasswordResponses=Ve;let qe=we.WARNINGS;function Ie(dt){Number.isInteger(dt)&&(qe=dt)}function Xe(){return qe}function rt(dt){qe>=we.INFOS&&console.log("Info: ".concat(dt))}function lt(dt){qe>=we.WARNINGS&&console.log("Warning: ".concat(dt))}function Ge(dt){throw new Error(dt)}function ut(dt,Qe){dt||Ge(Qe)}function mt(dt){switch(dt==null?void 0:dt.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function wt(dt,Qe=null,Ye=null){if(!dt)return null;try{if(Ye&&typeof dt=="string"){if(Ye.addDefaultProtocol&&dt.startsWith("www.")){const St=dt.match(/\./g);(St==null?void 0:St.length)>=2&&(dt="http://".concat(dt))}if(Ye.tryConvertEncoding)try{dt=tt(dt)}catch{}}const yt=Qe?new URL(dt,Qe):new URL(dt);if(mt(yt))return yt}catch{}return null}function Et(dt,Qe,Ye,yt=!1){return Object.defineProperty(dt,Qe,{value:Ye,enumerable:!yt,configurable:!0,writable:!1}),Ye}const De=function(){function Qe(Ye,yt){this.constructor===Qe&&Ge("Cannot initialize BaseException."),this.message=Ye,this.name=yt}return Qe.prototype=new Error,Qe.constructor=Qe,Qe}();te.BaseException=De;class pe extends De{constructor(Qe,Ye){super(Qe,"PasswordException"),this.code=Ye}}te.PasswordException=pe;class be extends De{constructor(Qe,Ye){super(Qe,"UnknownErrorException"),this.details=Ye}}te.UnknownErrorException=be;class ge extends De{constructor(Qe){super(Qe,"InvalidPDFException")}}te.InvalidPDFException=ge;class Ce extends De{constructor(Qe){super(Qe,"MissingPDFException")}}te.MissingPDFException=Ce;class xe extends De{constructor(Qe,Ye){super(Qe,"UnexpectedResponseException"),this.status=Ye}}te.UnexpectedResponseException=xe;class Le extends De{constructor(Qe){super(Qe,"FormatError")}}te.FormatError=Le;class Be extends De{constructor(Qe){super(Qe,"AbortException")}}te.AbortException=Be;function He(dt){(typeof dt!="object"||(dt==null?void 0:dt.length)===void 0)&&Ge("Invalid argument for bytesToString");const Qe=dt.length,Ye=8192;if(Qe<Ye)return String.fromCharCode.apply(null,dt);const yt=[];for(let St=0;St<Qe;St+=Ye){const wn=Math.min(St+Ye,Qe),Qt=dt.subarray(St,wn);yt.push(String.fromCharCode.apply(null,Qt))}return yt.join("")}function it(dt){typeof dt!="string"&&Ge("Invalid argument for stringToBytes");const Qe=dt.length,Ye=new Uint8Array(Qe);for(let yt=0;yt<Qe;++yt)Ye[yt]=dt.charCodeAt(yt)&255;return Ye}function et(dt){return String.fromCharCode(dt>>24&255,dt>>16&255,dt>>8&255,dt&255)}function ot(dt){return Object.keys(dt).length}function ht(dt){const Qe=Object.create(null);for(const[Ye,yt]of dt)Qe[Ye]=yt;return Qe}function pt(){const dt=new Uint8Array(4);return dt[0]=1,new Uint32Array(dt.buffer,0,1)[0]===1}function ct(){try{return new Function(""),!0}catch{return!1}}class Pt{static get isLittleEndian(){return Et(this,"isLittleEndian",pt())}static get isEvalSupported(){return Et(this,"isEvalSupported",ct())}static get isOffscreenCanvasSupported(){return Et(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Et(this,"platform",{isWin:!1,isMac:!1}):Et(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var Qe,Ye;return Et(this,"isCSSRoundSupported",(Ye=(Qe=globalThis.CSS)==null?void 0:Qe.supports)==null?void 0:Ye.call(Qe,"width: round(1.5px, 1px)"))}}te.FeatureTest=Pt;const It=[...Array(256).keys()].map(dt=>dt.toString(16).padStart(2,"0"));class vt{static makeHexColor(Qe,Ye,yt){return"#".concat(It[Qe]).concat(It[Ye]).concat(It[yt])}static scaleMinMax(Qe,Ye){let yt;Qe[0]?(Qe[0]<0&&(yt=Ye[0],Ye[0]=Ye[1],Ye[1]=yt),Ye[0]*=Qe[0],Ye[1]*=Qe[0],Qe[3]<0&&(yt=Ye[2],Ye[2]=Ye[3],Ye[3]=yt),Ye[2]*=Qe[3],Ye[3]*=Qe[3]):(yt=Ye[0],Ye[0]=Ye[2],Ye[2]=yt,yt=Ye[1],Ye[1]=Ye[3],Ye[3]=yt,Qe[1]<0&&(yt=Ye[2],Ye[2]=Ye[3],Ye[3]=yt),Ye[2]*=Qe[1],Ye[3]*=Qe[1],Qe[2]<0&&(yt=Ye[0],Ye[0]=Ye[1],Ye[1]=yt),Ye[0]*=Qe[2],Ye[1]*=Qe[2]),Ye[0]+=Qe[4],Ye[1]+=Qe[4],Ye[2]+=Qe[5],Ye[3]+=Qe[5]}static transform(Qe,Ye){return[Qe[0]*Ye[0]+Qe[2]*Ye[1],Qe[1]*Ye[0]+Qe[3]*Ye[1],Qe[0]*Ye[2]+Qe[2]*Ye[3],Qe[1]*Ye[2]+Qe[3]*Ye[3],Qe[0]*Ye[4]+Qe[2]*Ye[5]+Qe[4],Qe[1]*Ye[4]+Qe[3]*Ye[5]+Qe[5]]}static applyTransform(Qe,Ye){const yt=Qe[0]*Ye[0]+Qe[1]*Ye[2]+Ye[4],St=Qe[0]*Ye[1]+Qe[1]*Ye[3]+Ye[5];return[yt,St]}static applyInverseTransform(Qe,Ye){const yt=Ye[0]*Ye[3]-Ye[1]*Ye[2],St=(Qe[0]*Ye[3]-Qe[1]*Ye[2]+Ye[2]*Ye[5]-Ye[4]*Ye[3])/yt,wn=(-Qe[0]*Ye[1]+Qe[1]*Ye[0]+Ye[4]*Ye[1]-Ye[5]*Ye[0])/yt;return[St,wn]}static getAxialAlignedBoundingBox(Qe,Ye){const yt=this.applyTransform(Qe,Ye),St=this.applyTransform(Qe.slice(2,4),Ye),wn=this.applyTransform([Qe[0],Qe[3]],Ye),Qt=this.applyTransform([Qe[2],Qe[1]],Ye);return[Math.min(yt[0],St[0],wn[0],Qt[0]),Math.min(yt[1],St[1],wn[1],Qt[1]),Math.max(yt[0],St[0],wn[0],Qt[0]),Math.max(yt[1],St[1],wn[1],Qt[1])]}static inverseTransform(Qe){const Ye=Qe[0]*Qe[3]-Qe[1]*Qe[2];return[Qe[3]/Ye,-Qe[1]/Ye,-Qe[2]/Ye,Qe[0]/Ye,(Qe[2]*Qe[5]-Qe[4]*Qe[3])/Ye,(Qe[4]*Qe[1]-Qe[5]*Qe[0])/Ye]}static singularValueDecompose2dScale(Qe){const Ye=[Qe[0],Qe[2],Qe[1],Qe[3]],yt=Qe[0]*Ye[0]+Qe[1]*Ye[2],St=Qe[0]*Ye[1]+Qe[1]*Ye[3],wn=Qe[2]*Ye[0]+Qe[3]*Ye[2],Qt=Qe[2]*Ye[1]+Qe[3]*Ye[3],Je=(yt+Qt)/2,At=Math.sqrt((yt+Qt)**2-4*(yt*Qt-wn*St))/2,Lt=Je+At||1,Rt=Je-At||1;return[Math.sqrt(Lt),Math.sqrt(Rt)]}static normalizeRect(Qe){const Ye=Qe.slice(0);return Qe[0]>Qe[2]&&(Ye[0]=Qe[2],Ye[2]=Qe[0]),Qe[1]>Qe[3]&&(Ye[1]=Qe[3],Ye[3]=Qe[1]),Ye}static intersect(Qe,Ye){const yt=Math.max(Math.min(Qe[0],Qe[2]),Math.min(Ye[0],Ye[2])),St=Math.min(Math.max(Qe[0],Qe[2]),Math.max(Ye[0],Ye[2]));if(yt>St)return null;const wn=Math.max(Math.min(Qe[1],Qe[3]),Math.min(Ye[1],Ye[3])),Qt=Math.min(Math.max(Qe[1],Qe[3]),Math.max(Ye[1],Ye[3]));return wn>Qt?null:[yt,wn,St,Qt]}static bezierBoundingBox(Qe,Ye,yt,St,wn,Qt,Je,At){const Lt=[],Rt=[[],[]];let Dt,Nt,Zt,bt,Kt,Ot,Ue,fe;for(let Ze=0;Ze<2;++Ze){if(Ze===0?(Nt=6*Qe-12*yt+6*wn,Dt=-3*Qe+9*yt-9*wn+3*Je,Zt=3*yt-3*Qe):(Nt=6*Ye-12*St+6*Qt,Dt=-3*Ye+9*St-9*Qt+3*At,Zt=3*St-3*Ye),Math.abs(Dt)<1e-12){if(Math.abs(Nt)<1e-12)continue;bt=-Zt/Nt,0<bt&&bt<1&&Lt.push(bt);continue}Ue=Nt*Nt-4*Zt*Dt,fe=Math.sqrt(Ue),!(Ue<0)&&(Kt=(-Nt+fe)/(2*Dt),0<Kt&&Kt<1&&Lt.push(Kt),Ot=(-Nt-fe)/(2*Dt),0<Ot&&Ot<1&&Lt.push(Ot))}let ke=Lt.length,je;const ze=ke;for(;ke--;)bt=Lt[ke],je=1-bt,Rt[0][ke]=je*je*je*Qe+3*je*je*bt*yt+3*je*bt*bt*wn+bt*bt*bt*Je,Rt[1][ke]=je*je*je*Ye+3*je*je*bt*St+3*je*bt*bt*Qt+bt*bt*bt*At;return Rt[0][ze]=Qe,Rt[1][ze]=Ye,Rt[0][ze+1]=Je,Rt[1][ze+1]=At,Rt[0].length=Rt[1].length=ze+2,[Math.min(...Rt[0]),Math.min(...Rt[1]),Math.max(...Rt[0]),Math.max(...Rt[1])]}}te.Util=vt;const kt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function gt(dt){if(dt[0]>="ï"){let Ye;if(dt[0]==="þ"&&dt[1]==="ÿ"?Ye="utf-16be":dt[0]==="ÿ"&&dt[1]==="þ"?Ye="utf-16le":dt[0]==="ï"&&dt[1]==="»"&&dt[2]==="¿"&&(Ye="utf-8"),Ye)try{const yt=new TextDecoder(Ye,{fatal:!0}),St=it(dt);return yt.decode(St)}catch(yt){lt('stringToPDFString: "'.concat(yt,'".'))}}const Qe=[];for(let Ye=0,yt=dt.length;Ye<yt;Ye++){const St=kt[dt.charCodeAt(Ye)];Qe.push(St?String.fromCharCode(St):dt.charAt(Ye))}return Qe.join("")}function tt(dt){return decodeURIComponent(escape(dt))}function nt(dt){return unescape(encodeURIComponent(dt))}function ft(dt){return typeof dt=="object"&&(dt==null?void 0:dt.byteLength)!==void 0}function Tt(dt,Qe){if(dt.length!==Qe.length)return!1;for(let Ye=0,yt=dt.length;Ye<yt;Ye++)if(dt[Ye]!==Qe[Ye])return!1;return!0}function Ct(dt=new Date){return[dt.getUTCFullYear().toString(),(dt.getUTCMonth()+1).toString().padStart(2,"0"),dt.getUTCDate().toString().padStart(2,"0"),dt.getUTCHours().toString().padStart(2,"0"),dt.getUTCMinutes().toString().padStart(2,"0"),dt.getUTCSeconds().toString().padStart(2,"0")].join("")}class Ht{constructor(){We(this,Gt,!1);this.promise=new Promise((Qe,Ye)=>{this.resolve=yt=>{st(this,Gt,!0),Qe(yt)},this.reject=yt=>{st(this,Gt,!0),Ye(yt)}})}get settled(){return ce(this,Gt)}}Gt=new WeakMap,te.PromiseCapability=Ht;let Wt=null,Ut=null;function zt(dt){return Wt||(Wt=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Ut=new Map([["ſt","ſt"]])),dt.replaceAll(Wt,(Qe,Ye,yt)=>Ye?Ye.normalize("NFKC"):Ut.get(yt))}function Vt(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const dt=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(dt);else for(let Qe=0;Qe<32;Qe++)dt[Qe]=Math.floor(Math.random()*255);return He(dt)}const jt="pdfjs_internal_id_";te.AnnotationPrefix=jt},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var ee,ne,re,ie,kn,oe,qn,ue,de,ae,le,Ae,_e,me,ve,Se,zn,Pe,Re,ar,ye,Ee;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(Me){var Ht,Wt;if(typeof Me=="string"||Me instanceof URL?Me={url:Me}:(0,_util.isArrayBuffer)(Me)&&(Me={data:Me}),typeof Me!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!Me.url&&!Me.data&&!Me.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const we=new PDFDocumentLoadingTask,{docId:Oe}=we,Fe=Me.url?getUrlProp(Me.url):null,Ve=Me.data?getDataProp(Me.data):null,qe=Me.httpHeaders||null,Ie=Me.withCredentials===!0,Xe=(Ht=Me.password)!=null?Ht:null,rt=Me.range instanceof PDFDataRangeTransport?Me.range:null,lt=Number.isInteger(Me.rangeChunkSize)&&Me.rangeChunkSize>0?Me.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Ge=Me.worker instanceof PDFWorker?Me.worker:null;const ut=Me.verbosity,mt=typeof Me.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(Me.docBaseUrl)?Me.docBaseUrl:null,wt=typeof Me.cMapUrl=="string"?Me.cMapUrl:null,Et=Me.cMapPacked!==!1,De=Me.CMapReaderFactory||DefaultCMapReaderFactory,pe=typeof Me.standardFontDataUrl=="string"?Me.standardFontDataUrl:null,be=Me.StandardFontDataFactory||DefaultStandardFontDataFactory,ge=Me.stopAtErrors!==!0,Ce=Number.isInteger(Me.maxImageSize)&&Me.maxImageSize>-1?Me.maxImageSize:-1,xe=Me.isEvalSupported!==!1,Le=typeof Me.isOffscreenCanvasSupported=="boolean"?Me.isOffscreenCanvasSupported:!_util.isNodeJS,Be=Number.isInteger(Me.canvasMaxAreaInBytes)?Me.canvasMaxAreaInBytes:-1,He=typeof Me.disableFontFace=="boolean"?Me.disableFontFace:_util.isNodeJS,it=Me.fontExtraProperties===!0,et=Me.enableXfa===!0,ot=Me.ownerDocument||globalThis.document,ht=Me.disableRange===!0,pt=Me.disableStream===!0,ct=Me.disableAutoFetch===!0,Pt=Me.pdfBug===!0,It=rt?rt.length:(Wt=Me.length)!=null?Wt:NaN,vt=typeof Me.useSystemFonts=="boolean"?Me.useSystemFonts:!_util.isNodeJS&&!He,kt=typeof Me.useWorkerFetch=="boolean"?Me.useWorkerFetch:De===_display_utils.DOMCMapReaderFactory&&be===_display_utils.DOMStandardFontDataFactory&&wt&&pe&&(0,_display_utils.isValidFetchUrl)(wt,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(pe,document.baseURI),gt=Me.canvasFactory||new DefaultCanvasFactory({ownerDocument:ot}),tt=Me.filterFactory||new DefaultFilterFactory({docId:Oe,ownerDocument:ot}),nt=null;(0,_util.setVerbosityLevel)(ut);const ft={canvasFactory:gt,filterFactory:tt};if(kt||(ft.cMapReaderFactory=new De({baseUrl:wt,isCompressed:Et}),ft.standardFontDataFactory=new be({baseUrl:pe})),!Ge){const Ut={verbosity:ut,port:_worker_options.GlobalWorkerOptions.workerPort};Ge=Ut.port?PDFWorker.fromPort(Ut):new PDFWorker(Ut),we._worker=Ge}const Tt={docId:Oe,apiVersion:"3.11.174",data:Ve,password:Xe,disableAutoFetch:ct,rangeChunkSize:lt,length:It,docBaseUrl:mt,enableXfa:et,evaluatorOptions:{maxImageSize:Ce,disableFontFace:He,ignoreErrors:ge,isEvalSupported:xe,isOffscreenCanvasSupported:Le,canvasMaxAreaInBytes:Be,fontExtraProperties:it,useSystemFonts:vt,cMapUrl:kt?wt:null,standardFontDataUrl:kt?pe:null}},Ct={ignoreErrors:ge,isEvalSupported:xe,disableFontFace:He,fontExtraProperties:it,enableXfa:et,ownerDocument:ot,disableAutoFetch:ct,pdfBug:Pt,styleElement:nt};return Ge.promise.then(function(){if(we.destroyed)throw new Error("Loading aborted");const Ut=_fetchDocument(Ge,Tt),zt=new Promise(function(Vt){let jt;rt?jt=new _transport_stream.PDFDataTransportStream({length:It,initialData:rt.initialData,progressiveDone:rt.progressiveDone,contentDispositionFilename:rt.contentDispositionFilename,disableRange:ht,disableStream:pt},rt):Ve||(jt=(dt=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(dt):(0,_display_utils.isValidFetchUrl)(dt.url)?new _displayFetch_stream.PDFFetchStream(dt):new _displayNetwork.PDFNetworkStream(dt))({url:Fe,length:It,httpHeaders:qe,withCredentials:Ie,rangeChunkSize:lt,disableRange:ht,disableStream:pt})),Vt(jt)});return Promise.all([Ut,zt]).then(function([Vt,jt]){if(we.destroyed)throw new Error("Loading aborted");const Gt=new _message_handler.MessageHandler(Oe,Vt,Ge.port),dt=new WorkerTransport(Gt,we,jt,Ct,ft);we._transport=dt,Gt.send("Ready",null)})}).catch(we._capability.reject),we}async function _fetchDocument(Me,we){if(Me.destroyed)throw new Error("Worker was destroyed");const Oe=await Me.messageHandler.sendWithPromise("GetDocRequest",we,we.data?[we.data.buffer]:null);if(Me.destroyed)throw new Error("Worker was destroyed");return Oe}function getUrlProp(Me){if(Me instanceof URL)return Me.href;try{return new URL(Me,window.location).href}catch{if(_util.isNodeJS&&typeof Me=="string")return Me}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(Me){if(_util.isNodeJS&&typeof Buffer<"u"&&Me instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(Me instanceof Uint8Array&&Me.byteLength===Me.buffer.byteLength)return Me;if(typeof Me=="string")return(0,_util.stringToBytes)(Me);if(typeof Me=="object"&&!isNaN(Me==null?void 0:Me.length)||(0,_util.isArrayBuffer)(Me))return new Uint8Array(Me);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const te=class te{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d".concat(Nn(te,ee)._++),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var we,Oe,Fe;this.destroyed=!0;try{(we=this._worker)!=null&&we.port&&(this._worker._pendingDestroy=!0),await((Oe=this._transport)==null?void 0:Oe.destroy())}catch(Ve){throw(Fe=this._worker)!=null&&Fe.port&&delete this._worker._pendingDestroy,Ve}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};ee=new WeakMap,We(te,ee,0);let PDFDocumentLoadingTask=te;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(we,Oe,Fe=!1,Ve=null){this.length=we,this.initialData=Oe,this.progressiveDone=Fe,this.contentDispositionFilename=Ve,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(we){this._rangeListeners.push(we)}addProgressListener(we){this._progressListeners.push(we)}addProgressiveReadListener(we){this._progressiveReadListeners.push(we)}addProgressiveDoneListener(we){this._progressiveDoneListeners.push(we)}onDataRange(we,Oe){for(const Fe of this._rangeListeners)Fe(we,Oe)}onDataProgress(we,Oe){this._readyCapability.promise.then(()=>{for(const Fe of this._progressListeners)Fe(we,Oe)})}onDataProgressiveRead(we){this._readyCapability.promise.then(()=>{for(const Oe of this._progressiveReadListeners)Oe(we)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const we of this._progressiveDoneListeners)we()})}transportReady(){this._readyCapability.resolve()}requestDataRange(we,Oe){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(we,Oe){this._pdfInfo=we,this._transport=Oe,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(Fe=>{if(!Fe)return Fe;const Ve=[];for(const qe in Fe)Ve.push(...Fe[qe]);return Ve}))})}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(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(we){return this._transport.getPage(we)}getPageIndex(we){return this._transport.getPageIndex(we)}getDestinations(){return this._transport.getDestinations()}getDestination(we){return this._transport.getDestination(we)}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(){return this._transport.getOptionalContentConfig()}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(we=!1){return this._transport.startCleanup(we||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}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()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(we,Oe,Fe,Ve=!1){We(this,ie);We(this,oe);We(this,ne,null);We(this,re,!1);this._pageIndex=we,this._pageInfo=Oe,this._transport=Fe,this._stats=Ve?new _display_utils.StatTimer:null,this._pdfBug=Ve,this.commonObjs=Fe.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:we,rotation:Oe=this.rotate,offsetX:Fe=0,offsetY:Ve=0,dontFlip:qe=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:we,rotation:Oe,offsetX:Fe,offsetY:Ve,dontFlip:qe})}getAnnotations({intent:we="display"}={}){const Oe=this._transport.getRenderingIntent(we);return this._transport.getAnnotations(this._pageIndex,Oe.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var we;return((we=this._transport._htmlForXfa)==null?void 0:we.children[this._pageIndex])||null}render({canvasContext:we,viewport:Oe,intent:Fe="display",annotationMode:Ve=_util.AnnotationMode.ENABLE,transform:qe=null,background:Ie=null,optionalContentConfigPromise:Xe=null,annotationCanvasMap:rt=null,pageColors:lt=null,printAnnotationStorage:Ge=null}){var be,ge;(be=this._stats)==null||be.time("Overall");const ut=this._transport.getRenderingIntent(Fe,Ve,Ge);st(this,re,!1),Ke(this,oe,qn).call(this),Xe||(Xe=this._transport.getOptionalContentConfig());let mt=this._intentStates.get(ut.cacheKey);mt||(mt=Object.create(null),this._intentStates.set(ut.cacheKey,mt)),mt.streamReaderCancelTimeout&&(clearTimeout(mt.streamReaderCancelTimeout),mt.streamReaderCancelTimeout=null);const wt=!!(ut.renderingIntent&_util.RenderingIntentFlag.PRINT);mt.displayReadyCapability||(mt.displayReadyCapability=new _util.PromiseCapability,mt.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(ge=this._stats)==null||ge.time("Page Request"),this._pumpOperatorList(ut));const Et=Ce=>{var xe,Le;mt.renderTasks.delete(De),(this._maybeCleanupAfterRender||wt)&&st(this,re,!0),Ke(this,ie,kn).call(this,!wt),Ce?(De.capability.reject(Ce),this._abortOperatorList({intentState:mt,reason:Ce instanceof Error?Ce:new Error(Ce)})):De.capability.resolve(),(xe=this._stats)==null||xe.timeEnd("Rendering"),(Le=this._stats)==null||Le.timeEnd("Overall")},De=new InternalRenderTask({callback:Et,params:{canvasContext:we,viewport:Oe,transform:qe,background:Ie},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:rt,operatorList:mt.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!wt,pdfBug:this._pdfBug,pageColors:lt});(mt.renderTasks||(mt.renderTasks=new Set)).add(De);const pe=De.task;return Promise.all([mt.displayReadyCapability.promise,Xe]).then(([Ce,xe])=>{var Le;if(this.destroyed){Et();return}(Le=this._stats)==null||Le.time("Rendering"),De.initializeGraphics({transparency:Ce,optionalContentConfig:xe}),De.operatorListChanged()}).catch(Et),pe}getOperatorList({intent:we="display",annotationMode:Oe=_util.AnnotationMode.ENABLE,printAnnotationStorage:Fe=null}={}){var rt;function Ve(){Ie.operatorList.lastChunk&&(Ie.opListReadCapability.resolve(Ie.operatorList),Ie.renderTasks.delete(Xe))}const qe=this._transport.getRenderingIntent(we,Oe,Fe,!0);let Ie=this._intentStates.get(qe.cacheKey);Ie||(Ie=Object.create(null),this._intentStates.set(qe.cacheKey,Ie));let Xe;return Ie.opListReadCapability||(Xe=Object.create(null),Xe.operatorListChanged=Ve,Ie.opListReadCapability=new _util.PromiseCapability,(Ie.renderTasks||(Ie.renderTasks=new Set)).add(Xe),Ie.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(rt=this._stats)==null||rt.time("Page Request"),this._pumpOperatorList(qe)),Ie.opListReadCapability.promise}streamTextContent({includeMarkedContent:we=!1,disableNormalization:Oe=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:we===!0,disableNormalization:Oe===!0},{highWaterMark:100,size(Ve){return Ve.items.length}})}getTextContent(we={}){if(this._transport._htmlForXfa)return this.getXfa().then(Fe=>_xfa_text.XfaText.textContent(Fe));const Oe=this.streamTextContent(we);return new Promise(function(Fe,Ve){function qe(){Ie.read().then(function({value:rt,done:lt}){if(lt){Fe(Xe);return}Object.assign(Xe.styles,rt.styles),Xe.items.push(...rt.items),qe()},Ve)}const Ie=Oe.getReader(),Xe={items:[],styles:Object.create(null)};qe()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const we=[];for(const Oe of this._intentStates.values())if(this._abortOperatorList({intentState:Oe,reason:new Error("Page was destroyed."),force:!0}),!Oe.opListReadCapability)for(const Fe of Oe.renderTasks)we.push(Fe.completed),Fe.cancel();return this.objs.clear(),st(this,re,!1),Ke(this,oe,qn).call(this),Promise.all(we)}cleanup(we=!1){st(this,re,!0);const Oe=Ke(this,ie,kn).call(this,!1);return we&&Oe&&this._stats&&(this._stats=new _display_utils.StatTimer),Oe}_startRenderPage(we,Oe){var Ve,qe;const Fe=this._intentStates.get(Oe);Fe&&((Ve=this._stats)==null||Ve.timeEnd("Page Request"),(qe=Fe.displayReadyCapability)==null||qe.resolve(we))}_renderPageChunk(we,Oe){for(let Fe=0,Ve=we.length;Fe<Ve;Fe++)Oe.operatorList.fnArray.push(we.fnArray[Fe]),Oe.operatorList.argsArray.push(we.argsArray[Fe]);Oe.operatorList.lastChunk=we.lastChunk,Oe.operatorList.separateAnnots=we.separateAnnots;for(const Fe of Oe.renderTasks)Fe.operatorListChanged();we.lastChunk&&Ke(this,ie,kn).call(this,!0)}_pumpOperatorList({renderingIntent:we,cacheKey:Oe,annotationStorageSerializable:Fe}){const{map:Ve,transfers:qe}=Fe,Xe=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:we,cacheKey:Oe,annotationStorage:Ve},qe).getReader(),rt=this._intentStates.get(Oe);rt.streamReader=Xe;const lt=()=>{Xe.read().then(({value:Ge,done:ut})=>{if(ut){rt.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(Ge,rt),lt())},Ge=>{if(rt.streamReader=null,!this._transport.destroyed){if(rt.operatorList){rt.operatorList.lastChunk=!0;for(const ut of rt.renderTasks)ut.operatorListChanged();Ke(this,ie,kn).call(this,!0)}if(rt.displayReadyCapability)rt.displayReadyCapability.reject(Ge);else if(rt.opListReadCapability)rt.opListReadCapability.reject(Ge);else throw Ge}})};lt()}_abortOperatorList({intentState:we,reason:Oe,force:Fe=!1}){if(we.streamReader){if(we.streamReaderCancelTimeout&&(clearTimeout(we.streamReaderCancelTimeout),we.streamReaderCancelTimeout=null),!Fe){if(we.renderTasks.size>0)return;if(Oe instanceof _display_utils.RenderingCancelledException){let Ve=RENDERING_CANCELLED_TIMEOUT;Oe.extraDelay>0&&Oe.extraDelay<1e3&&(Ve+=Oe.extraDelay),we.streamReaderCancelTimeout=setTimeout(()=>{we.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:we,reason:Oe,force:!0})},Ve);return}}if(we.streamReader.cancel(new _util.AbortException(Oe.message)).catch(()=>{}),we.streamReader=null,!this._transport.destroyed){for(const[Ve,qe]of this._intentStates)if(qe===we){this._intentStates.delete(Ve);break}this.cleanup()}}}get stats(){return this._stats}}ne=new WeakMap,re=new WeakMap,ie=new WeakSet,kn=function(we=!1){if(Ke(this,oe,qn).call(this),!ce(this,re)||this.destroyed)return!1;if(we)return st(this,ne,setTimeout(()=>{st(this,ne,null),Ke(this,ie,kn).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:Oe,operatorList:Fe}of this._intentStates.values())if(Oe.size>0||!Fe.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),st(this,re,!1),!0},oe=new WeakSet,qn=function(){ce(this,ne)&&(clearTimeout(ce(this,ne)),st(this,ne,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){We(this,ue,new Set);We(this,de,Promise.resolve())}postMessage(we,Oe){const Fe={data:structuredClone(we,Oe?{transfer:Oe}:null)};ce(this,de).then(()=>{for(const Ve of ce(this,ue))Ve.call(this,Fe)})}addEventListener(we,Oe){ce(this,ue).add(Oe)}removeEventListener(we,Oe){ce(this,ue).delete(Oe)}terminate(){ce(this,ue).clear()}}ue=new WeakMap,de=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const Me=(ae=document==null?void 0:document.currentScript)==null?void 0:ae.src;Me&&(PDFWorkerUtil.fallbackWorkerSrc=Me.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(Me,we){let Oe;try{if(Oe=new URL(Me),!Oe.origin||Oe.origin==="null")return!1}catch{return!1}const Fe=new URL(we,Oe);return Oe.origin===Fe.origin},PDFWorkerUtil.createCDNWrapper=function(Me){const we='importScripts("'.concat(Me,'");');return URL.createObjectURL(new Blob([we]))}}const _PDFWorker=class _PDFWorker{constructor({name:Me=null,port:we=null,verbosity:Oe=(0,_util.getVerbosityLevel)()}={}){var Fe;if(this.name=Me,this.destroyed=!1,this.verbosity=Oe,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,we){if((Fe=ce(_PDFWorker,le))!=null&&Fe.has(we))throw new Error("Cannot use more than one PDFWorker per port.");(ce(_PDFWorker,le)||st(_PDFWorker,le,new WeakMap)).set(we,this),this._initializeFromPort(we);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(Me){this._port=Me,this._messageHandler=new _message_handler.MessageHandler("main","worker",Me),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:Me}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,Me)||(Me=PDFWorkerUtil.createCDNWrapper(new URL(Me,window.location).href));const we=new Worker(Me),Oe=new _message_handler.MessageHandler("main","worker",we),Fe=()=>{we.removeEventListener("error",Ve),Oe.destroy(),we.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},Ve=()=>{this._webWorker||Fe()};we.addEventListener("error",Ve),Oe.on("test",Ie=>{if(we.removeEventListener("error",Ve),this.destroyed){Fe();return}Ie?(this._messageHandler=Oe,this._port=we,this._webWorker=we,this._readyCapability.resolve(),Oe.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),Oe.destroy(),we.terminate())}),Oe.on("ready",Ie=>{if(we.removeEventListener("error",Ve),this.destroyed){Fe();return}try{qe()}catch{this._setupFakeWorker()}});const qe=()=>{const Ie=new Uint8Array;Oe.send("test",Ie,[Ie.buffer])};qe();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(Me=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const we=new LoopbackPort;this._port=we;const Oe="fake".concat(PDFWorkerUtil.fakeWorkerId++),Fe=new _message_handler.MessageHandler(Oe+"_worker",Oe,we);Me.setup(Fe,we);const Ve=new _message_handler.MessageHandler(Oe,Oe+"_worker",we);this._messageHandler=Ve,this._readyCapability.resolve(),Ve.send("configure",{verbosity:this.verbosity})}).catch(Me=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(Me.message,'".')))})}destroy(){var Me;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(Me=ce(_PDFWorker,le))==null||Me.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(Me){var Oe;if(!(Me!=null&&Me.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const we=(Oe=ce(this,le))==null?void 0:Oe.get(Me.port);if(we){if(we._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return we}return new _PDFWorker(Me)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var Me;try{return((Me=globalThis.pdfjsWorker)==null?void 0:Me.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};le=new WeakMap,We(_PDFWorker,le,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(we,Oe,Fe,Ve,qe){We(this,Se);We(this,Ae,new Map);We(this,_e,new Map);We(this,me,new Map);We(this,ve,null);this.messageHandler=we,this.loadingTask=Oe,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:Ve.ownerDocument,styleElement:Ve.styleElement}),this._params=Ve,this.canvasFactory=qe.canvasFactory,this.filterFactory=qe.filterFactory,this.cMapReaderFactory=qe.cMapReaderFactory,this.standardFontDataFactory=qe.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=Fe,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(we,Oe=_util.AnnotationMode.ENABLE,Fe=null,Ve=!1){let qe=_util.RenderingIntentFlag.DISPLAY,Ie=_annotation_storage.SerializableEmpty;switch(we){case"any":qe=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":qe=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: ".concat(we))}switch(Oe){case _util.AnnotationMode.DISABLE:qe+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:qe+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:qe+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,Ie=(qe&_util.RenderingIntentFlag.PRINT&&Fe instanceof _annotation_storage.PrintAnnotationStorage?Fe:this.annotationStorage).serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: ".concat(Oe))}return Ve&&(qe+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:qe,cacheKey:"".concat(qe,"_").concat(Ie.hash),annotationStorageSerializable:Ie}}destroy(){var Fe;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(Fe=ce(this,ve))==null||Fe.reject(new Error("Worker was destroyed during onPassword callback"));const we=[];for(const Ve of ce(this,_e).values())we.push(Ve._destroy());ce(this,_e).clear(),ce(this,me).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Oe=this.messageHandler.sendWithPromise("Terminate",null);return we.push(Oe),Promise.all(we).then(()=>{var Ve;this.commonObjs.clear(),this.fontLoader.clear(),ce(this,Ae).clear(),this.filterFactory.destroy(),(Ve=this._networkStream)==null||Ve.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:we,loadingTask:Oe}=this;we.on("GetReader",(Fe,Ve)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=qe=>{this._lastProgress={loaded:qe.loaded,total:qe.total}},Ve.onPull=()=>{this._fullReader.read().then(function({value:qe,done:Ie}){if(Ie){Ve.close();return}(0,_util.assert)(qe instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),Ve.enqueue(new Uint8Array(qe),1,[qe])}).catch(qe=>{Ve.error(qe)})},Ve.onCancel=qe=>{this._fullReader.cancel(qe),Ve.ready.catch(Ie=>{if(!this.destroyed)throw Ie})}}),we.on("ReaderHeadersReady",Fe=>{const Ve=new _util.PromiseCapability,qe=this._fullReader;return qe.headersReady.then(()=>{var Ie;(!qe.isStreamingSupported||!qe.isRangeSupported)&&(this._lastProgress&&((Ie=Oe.onProgress)==null||Ie.call(Oe,this._lastProgress)),qe.onProgress=Xe=>{var rt;(rt=Oe.onProgress)==null||rt.call(Oe,{loaded:Xe.loaded,total:Xe.total})}),Ve.resolve({isStreamingSupported:qe.isStreamingSupported,isRangeSupported:qe.isRangeSupported,contentLength:qe.contentLength})},Ve.reject),Ve.promise}),we.on("GetRangeReader",(Fe,Ve)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const qe=this._networkStream.getRangeReader(Fe.begin,Fe.end);if(!qe){Ve.close();return}Ve.onPull=()=>{qe.read().then(function({value:Ie,done:Xe}){if(Xe){Ve.close();return}(0,_util.assert)(Ie instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),Ve.enqueue(new Uint8Array(Ie),1,[Ie])}).catch(Ie=>{Ve.error(Ie)})},Ve.onCancel=Ie=>{qe.cancel(Ie),Ve.ready.catch(Xe=>{if(!this.destroyed)throw Xe})}}),we.on("GetDoc",({pdfInfo:Fe})=>{this._numPages=Fe.numPages,this._htmlForXfa=Fe.htmlForXfa,delete Fe.htmlForXfa,Oe._capability.resolve(new PDFDocumentProxy(Fe,this))}),we.on("DocException",function(Fe){let Ve;switch(Fe.name){case"PasswordException":Ve=new _util.PasswordException(Fe.message,Fe.code);break;case"InvalidPDFException":Ve=new _util.InvalidPDFException(Fe.message);break;case"MissingPDFException":Ve=new _util.MissingPDFException(Fe.message);break;case"UnexpectedResponseException":Ve=new _util.UnexpectedResponseException(Fe.message,Fe.status);break;case"UnknownErrorException":Ve=new _util.UnknownErrorException(Fe.message,Fe.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Oe._capability.reject(Ve)}),we.on("PasswordRequest",Fe=>{if(st(this,ve,new _util.PromiseCapability),Oe.onPassword){const Ve=qe=>{qe instanceof Error?ce(this,ve).reject(qe):ce(this,ve).resolve({password:qe})};try{Oe.onPassword(Ve,Fe.code)}catch(qe){ce(this,ve).reject(qe)}}else ce(this,ve).reject(new _util.PasswordException(Fe.message,Fe.code));return ce(this,ve).promise}),we.on("DataLoaded",Fe=>{var Ve;(Ve=Oe.onProgress)==null||Ve.call(Oe,{loaded:Fe.length,total:Fe.length}),this.downloadInfoCapability.resolve(Fe)}),we.on("StartRenderPage",Fe=>{if(this.destroyed)return;ce(this,_e).get(Fe.pageIndex)._startRenderPage(Fe.transparency,Fe.cacheKey)}),we.on("commonobj",([Fe,Ve,qe])=>{var Ie;if(!this.destroyed&&!this.commonObjs.has(Fe))switch(Ve){case"Font":const Xe=this._params;if("error"in qe){const Ge=qe.error;(0,_util.warn)("Error during font loading: ".concat(Ge)),this.commonObjs.resolve(Fe,Ge);break}const rt=Xe.pdfBug&&((Ie=globalThis.FontInspector)!=null&&Ie.enabled)?(Ge,ut)=>globalThis.FontInspector.fontAdded(Ge,ut):null,lt=new _font_loader.FontFaceObject(qe,{isEvalSupported:Xe.isEvalSupported,disableFontFace:Xe.disableFontFace,ignoreErrors:Xe.ignoreErrors,inspectFont:rt});this.fontLoader.bind(lt).catch(Ge=>we.sendWithPromise("FontFallback",{id:Fe})).finally(()=>{!Xe.fontExtraProperties&&lt.data&&(lt.data=null),this.commonObjs.resolve(Fe,lt)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(Fe,qe);break;default:throw new Error("Got unknown common object type ".concat(Ve))}}),we.on("obj",([Fe,Ve,qe,Ie])=>{var rt;if(this.destroyed)return;const Xe=ce(this,_e).get(Ve);if(!Xe.objs.has(Fe))switch(qe){case"Image":if(Xe.objs.resolve(Fe,Ie),Ie){let lt;if(Ie.bitmap){const{width:Ge,height:ut}=Ie;lt=Ge*ut*4}else lt=((rt=Ie.data)==null?void 0:rt.length)||0;lt>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Xe._maybeCleanupAfterRender=!0)}break;case"Pattern":Xe.objs.resolve(Fe,Ie);break;default:throw new Error("Got unknown object type ".concat(qe))}}),we.on("DocProgress",Fe=>{var Ve;this.destroyed||(Ve=Oe.onProgress)==null||Ve.call(Oe,{loaded:Fe.loaded,total:Fe.total})}),we.on("FetchBuiltInCMap",Fe=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(Fe):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),we.on("FetchStandardFontData",Fe=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(Fe):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var Fe,Ve;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:we,transfers:Oe}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:we,filename:(Ve=(Fe=this._fullReader)==null?void 0:Fe.filename)!=null?Ve:null},Oe).finally(()=>{this.annotationStorage.resetModified()})}getPage(we){if(!Number.isInteger(we)||we<=0||we>this._numPages)return Promise.reject(new Error("Invalid page request."));const Oe=we-1,Fe=ce(this,me).get(Oe);if(Fe)return Fe;const Ve=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Oe}).then(qe=>{if(this.destroyed)throw new Error("Transport destroyed");const Ie=new PDFPageProxy(Oe,qe,this,this._params.pdfBug);return ce(this,_e).set(Oe,Ie),Ie});return ce(this,me).set(Oe,Ve),Ve}getPageIndex(we){return typeof we!="object"||we===null||!Number.isInteger(we.num)||we.num<0||!Number.isInteger(we.gen)||we.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:we.num,gen:we.gen})}getAnnotations(we,Oe){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:we,intent:Oe})}getFieldObjects(){return Ke(this,Se,zn).call(this,"GetFieldObjects")}hasJSActions(){return Ke(this,Se,zn).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(we){return typeof we!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:we})}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 Ke(this,Se,zn).call(this,"GetDocJSActions")}getPageJSActions(we){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:we})}getStructTree(we){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:we})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(we=>new _optional_content_config.OptionalContentConfig(we))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const we="GetMetadata",Oe=ce(this,Ae).get(we);if(Oe)return Oe;const Fe=this.messageHandler.sendWithPromise(we,null).then(Ve=>{var qe,Ie,Xe,rt;return{info:Ve[0],metadata:Ve[1]?new _metadata.Metadata(Ve[1]):null,contentDispositionFilename:(Ie=(qe=this._fullReader)==null?void 0:qe.filename)!=null?Ie:null,contentLength:(rt=(Xe=this._fullReader)==null?void 0:Xe.contentLength)!=null?rt:null}});return ce(this,Ae).set(we,Fe),Fe}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(we=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const Oe of ce(this,_e).values())if(!Oe.cleanup())throw new Error("startCleanup: Page ".concat(Oe.pageNumber," is currently rendering."));this.commonObjs.clear(),we||this.fontLoader.clear(),ce(this,Ae).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:we,enableXfa:Oe}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:we,enableXfa:Oe})}}Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakSet,zn=function(we,Oe=null){const Fe=ce(this,Ae).get(we);if(Fe)return Fe;const Ve=this.messageHandler.sendWithPromise(we,Oe);return ce(this,Ae).set(we,Ve),Ve};class PDFObjects{constructor(){We(this,Re);We(this,Pe,Object.create(null))}get(we,Oe=null){if(Oe){const Ve=Ke(this,Re,ar).call(this,we);return Ve.capability.promise.then(()=>Oe(Ve.data)),null}const Fe=ce(this,Pe)[we];if(!(Fe!=null&&Fe.capability.settled))throw new Error("Requesting object that isn't resolved yet ".concat(we,"."));return Fe.data}has(we){const Oe=ce(this,Pe)[we];return(Oe==null?void 0:Oe.capability.settled)||!1}resolve(we,Oe=null){const Fe=Ke(this,Re,ar).call(this,we);Fe.data=Oe,Fe.capability.resolve()}clear(){var we;for(const Oe in ce(this,Pe)){const{data:Fe}=ce(this,Pe)[Oe];(we=Fe==null?void 0:Fe.bitmap)==null||we.close()}st(this,Pe,Object.create(null))}}Pe=new WeakMap,Re=new WeakSet,ar=function(we){var Oe;return(Oe=ce(this,Pe))[we]||(Oe[we]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(we){We(this,ye,null);st(this,ye,we),this.onContinue=null}get promise(){return ce(this,ye).capability.promise}cancel(we=0){ce(this,ye).cancel(null,we)}get separateAnnots(){const{separateAnnots:we}=ce(this,ye).operatorList;if(!we)return!1;const{annotationCanvasMap:Oe}=ce(this,ye);return we.form||we.canvas&&(Oe==null?void 0:Oe.size)>0}}ye=new WeakMap,exports.RenderTask=RenderTask;const Ne=class Ne{constructor({callback:we,params:Oe,objs:Fe,commonObjs:Ve,annotationCanvasMap:qe,operatorList:Ie,pageIndex:Xe,canvasFactory:rt,filterFactory:lt,useRequestAnimationFrame:Ge=!1,pdfBug:ut=!1,pageColors:mt=null}){this.callback=we,this.params=Oe,this.objs=Fe,this.commonObjs=Ve,this.annotationCanvasMap=qe,this.operatorListIdx=null,this.operatorList=Ie,this._pageIndex=Xe,this.canvasFactory=rt,this.filterFactory=lt,this._pdfBug=ut,this.pageColors=mt,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=Ge===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(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=Oe.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:we=!1,optionalContentConfig:Oe}){var Xe,rt;if(this.cancelled)return;if(this._canvas){if(ce(Ne,Ee).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.");ce(Ne,Ee).add(this._canvas)}this._pdfBug&&((Xe=globalThis.StepperManager)!=null&&Xe.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:Fe,viewport:Ve,transform:qe,background:Ie}=this.params;this.gfx=new _canvas.CanvasGraphics(Fe,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:Oe},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:qe,viewport:Ve,transparency:we,background:Ie}),this.operatorListIdx=0,this.graphicsReady=!0,(rt=this.graphicsReadyCallback)==null||rt.call(this)}cancel(we=null,Oe=0){var Fe;this.running=!1,this.cancelled=!0,(Fe=this.gfx)==null||Fe.endDrawing(),ce(Ne,Ee).delete(this._canvas),this.callback(we||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),Oe))}operatorListChanged(){var we;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(we=this.stepper)==null||we.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{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(),ce(Ne,Ee).delete(this._canvas),this.callback())))}};Ee=new WeakMap,We(Ne,Ee,new WeakSet);let InternalRenderTask=Ne;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(ee,te,ne)=>{var de,ae,le,Hr,_e;Object.defineProperty(te,"__esModule",{value:!0}),te.SerializableEmpty=te.PrintAnnotationStorage=te.AnnotationStorage=void 0;var re=ne(1),ie=ne(4),se=ne(8);const oe=Object.freeze({map:null,hash:"",transfers:void 0});te.SerializableEmpty=oe;class he{constructor(){We(this,le);We(this,de,!1);We(this,ae,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(ve,Se){const Te=ce(this,ae).get(ve);return Te===void 0?Se:Object.assign(Se,Te)}getRawValue(ve){return ce(this,ae).get(ve)}remove(ve){if(ce(this,ae).delete(ve),ce(this,ae).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const Se of ce(this,ae).values())if(Se instanceof ie.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(ve,Se){const Te=ce(this,ae).get(ve);let Pe=!1;if(Te!==void 0)for(const[Re,$e]of Object.entries(Se))Te[Re]!==$e&&(Pe=!0,Te[Re]=$e);else Pe=!0,ce(this,ae).set(ve,Se);Pe&&Ke(this,le,Hr).call(this),Se instanceof ie.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(Se.constructor._type)}has(ve){return ce(this,ae).has(ve)}getAll(){return ce(this,ae).size>0?(0,re.objectFromMap)(ce(this,ae)):null}setAll(ve){for(const[Se,Te]of Object.entries(ve))this.setValue(Se,Te)}get size(){return ce(this,ae).size}resetModified(){ce(this,de)&&(st(this,de,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new ue(this)}get serializable(){if(ce(this,ae).size===0)return oe;const ve=new Map,Se=new se.MurmurHash3_64,Te=[],Pe=Object.create(null);let Re=!1;for(const[$e,ye]of ce(this,ae)){const Ee=ye instanceof ie.AnnotationEditor?ye.serialize(!1,Pe):ye;Ee&&(ve.set($e,Ee),Se.update("".concat($e,":").concat(JSON.stringify(Ee))),Re||(Re=!!Ee.bitmap))}if(Re)for(const $e of ve.values())$e.bitmap&&Te.push($e.bitmap);return ve.size>0?{map:ve,hash:Se.hexdigest(),transfers:Te}:oe}}de=new WeakMap,ae=new WeakMap,le=new WeakSet,Hr=function(){ce(this,de)||(st(this,de,!0),typeof this.onSetModified=="function"&&this.onSetModified())},te.AnnotationStorage=he;class ue extends he{constructor(Se){super();We(this,_e,void 0);const{map:Te,hash:Pe,transfers:Re}=Se.serializable,$e=structuredClone(Te,Re?{transfer:Re}:null);st(this,_e,{map:$e,hash:Pe,transfers:Re})}get print(){(0,re.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return ce(this,_e)}}_e=new WeakMap,te.PrintAnnotationStorage=ue},(ee,te,ne)=>{var ue,de,ae,le,Ae,_e,me,ve,Se,Te,Pe,Re,$e,ye,Ee,lr,Me,cr,Oe,ur,Ve,dr,Ie,Wr,rt,Vr,Ge,Gr,mt,hr,Et,qr;Object.defineProperty(te,"__esModule",{value:!0}),te.AnnotationEditor=void 0;var re=ne(5),ie=ne(1),se=ne(6);const pe=class pe{constructor(ge){We(this,Ee);We(this,Me);We(this,Ve);We(this,Ie);We(this,rt);We(this,Ge);We(this,mt);We(this,Et);We(this,ue,"");We(this,de,!1);We(this,ae,null);We(this,le,null);We(this,Ae,null);We(this,_e,!1);We(this,me,null);We(this,ve,this.focusin.bind(this));We(this,Se,this.focusout.bind(this));We(this,Te,!1);We(this,Pe,!1);We(this,Re,!1);An(this,"_initialOptions",Object.create(null));An(this,"_uiManager",null);An(this,"_focusEventsAllowed",!0);An(this,"_l10nPromise",null);We(this,$e,!1);We(this,ye,pe._zIndex++);this.constructor===pe&&(0,ie.unreachable)("Cannot initialize AnnotationEditor."),this.parent=ge.parent,this.id=ge.id,this.width=this.height=null,this.pageIndex=ge.parent.pageIndex,this.name=ge.name,this.div=null,this._uiManager=ge.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=ge.isCentered,this._structTreeParentId=null;const{rotation:Ce,rawDims:{pageWidth:xe,pageHeight:Le,pageX:Be,pageY:He}}=this.parent.viewport;this.rotation=Ce,this.pageRotation=(360+Ce-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[xe,Le],this.pageTranslation=[Be,He];const[it,et]=this.parentDimensions;this.x=ge.x/it,this.y=ge.y/et,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,ie.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(ge){const Ce=new he({id:ge.parent.getNextId(),parent:ge.parent,uiManager:ge._uiManager});Ce.annotationElementId=ge.annotationElementId,Ce.deleted=!0,Ce._uiManager.addToAnnotationStorage(Ce)}static initialize(ge,Ce=null){if(pe._l10nPromise||(pe._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(Le=>[Le,ge.get(Le)]))),Ce!=null&&Ce.strings)for(const Le of Ce.strings)pe._l10nPromise.set(Le,ge.get(Le));if(pe._borderLineWidth!==-1)return;const xe=getComputedStyle(document.documentElement);pe._borderLineWidth=parseFloat(xe.getPropertyValue("--outline-width"))||0}static updateDefaultParams(ge,Ce){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(ge){return!1}static paste(ge,Ce){(0,ie.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return ce(this,$e)}set _isDraggable(ge){var Ce;st(this,$e,ge),(Ce=this.div)==null||Ce.classList.toggle("draggable",ge)}center(){const[ge,Ce]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*Ce/(ge*2),this.y+=this.width*ge/(Ce*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*Ce/(ge*2),this.y-=this.width*ge/(Ce*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(ge){this._uiManager.addCommands(ge)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=ce(this,ye)}setParent(ge){ge!==null&&(this.pageIndex=ge.pageIndex,this.pageDimensions=ge.pageDimensions),this.parent=ge}focusin(ge){this._focusEventsAllowed&&(ce(this,Te)?st(this,Te,!1):this.parent.setSelected(this))}focusout(ge){var xe;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const Ce=ge.relatedTarget;Ce!=null&&Ce.closest("#".concat(this.id))||(ge.preventDefault(),(xe=this.parent)!=null&&xe.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(ge,Ce,xe,Le){const[Be,He]=this.parentDimensions;[xe,Le]=this.screenToPageTranslation(xe,Le),this.x=(ge+xe)/Be,this.y=(Ce+Le)/He,this.fixAndSetPosition()}translate(ge,Ce){Ke(this,Ee,lr).call(this,this.parentDimensions,ge,Ce)}translateInPage(ge,Ce){Ke(this,Ee,lr).call(this,this.pageDimensions,ge,Ce),this.div.scrollIntoView({block:"nearest"})}drag(ge,Ce){const[xe,Le]=this.parentDimensions;if(this.x+=ge/xe,this.y+=Ce/Le,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:ot,y:ht}=this.div.getBoundingClientRect();this.parent.findNewParent(this,ot,ht)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:Be,y:He}=this;const[it,et]=Ke(this,Me,cr).call(this);Be+=it,He+=et,this.div.style.left="".concat((100*Be).toFixed(2),"%"),this.div.style.top="".concat((100*He).toFixed(2),"%"),this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[ge,Ce]=this.pageDimensions;let{x:xe,y:Le,width:Be,height:He}=this;switch(Be*=ge,He*=Ce,xe*=ge,Le*=Ce,this.rotation){case 0:xe=Math.max(0,Math.min(ge-Be,xe)),Le=Math.max(0,Math.min(Ce-He,Le));break;case 90:xe=Math.max(0,Math.min(ge-He,xe)),Le=Math.min(Ce,Math.max(Be,Le));break;case 180:xe=Math.min(ge,Math.max(Be,xe)),Le=Math.min(Ce,Math.max(He,Le));break;case 270:xe=Math.min(ge,Math.max(He,xe)),Le=Math.max(0,Math.min(Ce-Be,Le));break}this.x=xe/=ge,this.y=Le/=Ce;const[it,et]=Ke(this,Me,cr).call(this);xe+=it,Le+=et;const{style:ot}=this.div;ot.left="".concat((100*xe).toFixed(2),"%"),ot.top="".concat((100*Le).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(ge,Ce){var xe;return Ke(xe=pe,Oe,ur).call(xe,ge,Ce,this.parentRotation)}pageTranslationToScreen(ge,Ce){var xe;return Ke(xe=pe,Oe,ur).call(xe,ge,Ce,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:ge,pageDimensions:[Ce,xe]}=this,Le=Ce*ge,Be=xe*ge;return ie.FeatureTest.isCSSRoundSupported?[Math.round(Le),Math.round(Be)]:[Le,Be]}setDims(ge,Ce){var Be;const[xe,Le]=this.parentDimensions;this.div.style.width="".concat((100*ge/xe).toFixed(2),"%"),ce(this,_e)||(this.div.style.height="".concat((100*Ce/Le).toFixed(2),"%")),(Be=ce(this,ae))==null||Be.classList.toggle("small",ge<pe.SMALL_EDITOR_SIZE||Ce<pe.SMALL_EDITOR_SIZE)}fixDims(){const{style:ge}=this.div,{height:Ce,width:xe}=ge,Le=xe.endsWith("%"),Be=!ce(this,_e)&&Ce.endsWith("%");if(Le&&Be)return;const[He,it]=this.parentDimensions;Le||(ge.width="".concat((100*parseFloat(xe)/He).toFixed(2),"%")),!ce(this,_e)&&!Be&&(ge.height="".concat((100*parseFloat(Ce)/it).toFixed(2),"%"))}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(ce(this,ae))return;const ge=st(this,ae,document.createElement("button"));ge.className="altText";const Ce=await pe._l10nPromise.get("editor_alt_text_button_label");ge.textContent=Ce,ge.setAttribute("aria-label",Ce),ge.tabIndex="0",ge.addEventListener("contextmenu",se.noContextMenu),ge.addEventListener("pointerdown",xe=>xe.stopPropagation()),ge.addEventListener("click",xe=>{xe.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),ge.addEventListener("keydown",xe=>{xe.target===ge&&xe.key==="Enter"&&(xe.preventDefault(),this._uiManager.editAltText(this))}),Ke(this,mt,hr).call(this),this.div.append(ge),pe.SMALL_EDITOR_SIZE||(pe.SMALL_EDITOR_SIZE=Math.min(128,Math.round(ge.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:ce(this,ue),decorative:ce(this,de)}}set altTextData({altText:ge,decorative:Ce}){ce(this,ue)===ge&&ce(this,de)===Ce||(st(this,ue,ge),st(this,de,Ce),Ke(this,mt,hr).call(this))}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.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",ce(this,ve)),this.div.addEventListener("focusout",ce(this,Se));const[ge,Ce]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth="".concat((100*Ce/ge).toFixed(2),"%"),this.div.style.maxHeight="".concat((100*ge/Ce).toFixed(2),"%"));const[xe,Le]=this.getInitialTranslation();return this.translate(xe,Le),(0,re.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(ge){const{isMac:Ce}=ie.FeatureTest.platform;if(ge.button!==0||ge.ctrlKey&&Ce){ge.preventDefault();return}st(this,Te,!0),Ke(this,Et,qr).call(this,ge)}moveInDOM(){var ge;(ge=this.parent)==null||ge.moveEditorInDOM(this)}_setParentAndPosition(ge,Ce,xe){ge.changeParent(this),this.x=Ce,this.y=xe,this.fixAndSetPosition()}getRect(ge,Ce){const xe=this.parentScale,[Le,Be]=this.pageDimensions,[He,it]=this.pageTranslation,et=ge/xe,ot=Ce/xe,ht=this.x*Le,pt=this.y*Be,ct=this.width*Le,Pt=this.height*Be;switch(this.rotation){case 0:return[ht+et+He,Be-pt-ot-Pt+it,ht+et+ct+He,Be-pt-ot+it];case 90:return[ht+ot+He,Be-pt+et+it,ht+ot+Pt+He,Be-pt+et+ct+it];case 180:return[ht-et-ct+He,Be-pt+ot+it,ht-et+He,Be-pt+ot+Pt+it];case 270:return[ht-ot-Pt+He,Be-pt-et-ct+it,ht-ot+He,Be-pt-et+it];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(ge,Ce){const[xe,Le,Be,He]=ge,it=Be-xe,et=He-Le;switch(this.rotation){case 0:return[xe,Ce-He,it,et];case 90:return[xe,Ce-Le,et,it];case 180:return[Be,Ce-Le,it,et];case 270:return[Be,Ce-He,et,it];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){st(this,Re,!0)}disableEditMode(){st(this,Re,!1)}isInEditMode(){return ce(this,Re)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var ge,Ce;(ge=this.div)==null||ge.addEventListener("focusin",ce(this,ve)),(Ce=this.div)==null||Ce.addEventListener("focusout",ce(this,Se))}serialize(ge=!1,Ce=null){(0,ie.unreachable)("An editor must be serializable")}static deserialize(ge,Ce,xe){const Le=new this.prototype.constructor({parent:Ce,id:Ce.getNextId(),uiManager:xe});Le.rotation=ge.rotation;const[Be,He]=Le.pageDimensions,[it,et,ot,ht]=Le.getRectInCurrentCoords(ge.rect,He);return Le.x=it/Be,Le.y=et/He,Le.width=ot/Be,Le.height=ht/He,Le}remove(){var ge;this.div.removeEventListener("focusin",ce(this,ve)),this.div.removeEventListener("focusout",ce(this,Se)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(ge=ce(this,ae))==null||ge.remove(),st(this,ae,null),st(this,le,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(Ke(this,Ie,Wr).call(this),ce(this,me).classList.remove("hidden"))}select(){var ge;this.makeResizable(),(ge=this.div)==null||ge.classList.add("selectedEditor")}unselect(){var ge,Ce,xe;(ge=ce(this,me))==null||ge.classList.add("hidden"),(Ce=this.div)==null||Ce.classList.remove("selectedEditor"),(xe=this.div)!=null&&xe.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(ge,Ce){}disableEditing(){ce(this,ae)&&(ce(this,ae).hidden=!0)}enableEditing(){ce(this,ae)&&(ce(this,ae).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return ce(this,Pe)}set isEditing(ge){st(this,Pe,ge),this.parent&&(ge?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(ge,Ce){st(this,_e,!0);const xe=ge/Ce,{style:Le}=this.div;Le.aspectRatio=xe,Le.height="auto"}static get MIN_SIZE(){return 16}};ue=new WeakMap,de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakMap,Pe=new WeakMap,Re=new WeakMap,$e=new WeakMap,ye=new WeakMap,Ee=new WeakSet,lr=function([ge,Ce],xe,Le){[xe,Le]=this.screenToPageTranslation(xe,Le),this.x+=xe/ge,this.y+=Le/Ce,this.fixAndSetPosition()},Me=new WeakSet,cr=function(){const[ge,Ce]=this.parentDimensions,{_borderLineWidth:xe}=pe,Le=xe/ge,Be=xe/Ce;switch(this.rotation){case 90:return[-Le,Be];case 180:return[Le,Be];case 270:return[Le,-Be];default:return[-Le,-Be]}},Oe=new WeakSet,ur=function(ge,Ce,xe){switch(xe){case 90:return[Ce,-ge];case 180:return[-ge,-Ce];case 270:return[-Ce,ge];default:return[ge,Ce]}},Ve=new WeakSet,dr=function(ge){switch(ge){case 90:{const[Ce,xe]=this.pageDimensions;return[0,-Ce/xe,xe/Ce,0]}case 180:return[-1,0,0,-1];case 270:{const[Ce,xe]=this.pageDimensions;return[0,Ce/xe,-xe/Ce,0]}default:return[1,0,0,1]}},Ie=new WeakSet,Wr=function(){if(ce(this,me))return;st(this,me,document.createElement("div")),ce(this,me).classList.add("resizers");const ge=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||ge.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const Ce of ge){const xe=document.createElement("div");ce(this,me).append(xe),xe.classList.add("resizer",Ce),xe.addEventListener("pointerdown",Ke(this,rt,Vr).bind(this,Ce)),xe.addEventListener("contextmenu",se.noContextMenu)}this.div.prepend(ce(this,me))},rt=new WeakSet,Vr=function(ge,Ce){Ce.preventDefault();const{isMac:xe}=ie.FeatureTest.platform;if(Ce.button!==0||Ce.ctrlKey&&xe)return;const Le=Ke(this,Ge,Gr).bind(this,ge),Be=this._isDraggable;this._isDraggable=!1;const He={passive:!0,capture:!0};window.addEventListener("pointermove",Le,He);const it=this.x,et=this.y,ot=this.width,ht=this.height,pt=this.parent.div.style.cursor,ct=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(Ce.target).cursor;const Pt=()=>{this._isDraggable=Be,window.removeEventListener("pointerup",Pt),window.removeEventListener("blur",Pt),window.removeEventListener("pointermove",Le,He),this.parent.div.style.cursor=pt,this.div.style.cursor=ct;const It=this.x,vt=this.y,kt=this.width,gt=this.height;It===it&&vt===et&&kt===ot&&gt===ht||this.addCommands({cmd:()=>{this.width=kt,this.height=gt,this.x=It,this.y=vt;const[tt,nt]=this.parentDimensions;this.setDims(tt*kt,nt*gt),this.fixAndSetPosition()},undo:()=>{this.width=ot,this.height=ht,this.x=it,this.y=et;const[tt,nt]=this.parentDimensions;this.setDims(tt*ot,nt*ht),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",Pt),window.addEventListener("blur",Pt)},Ge=new WeakSet,Gr=function(ge,Ce){const[xe,Le]=this.parentDimensions,Be=this.x,He=this.y,it=this.width,et=this.height,ot=pe.MIN_SIZE/xe,ht=pe.MIN_SIZE/Le,pt=yt=>Math.round(yt*1e4)/1e4,ct=Ke(this,Ve,dr).call(this,this.rotation),Pt=(yt,St)=>[ct[0]*yt+ct[2]*St,ct[1]*yt+ct[3]*St],It=Ke(this,Ve,dr).call(this,360-this.rotation),vt=(yt,St)=>[It[0]*yt+It[2]*St,It[1]*yt+It[3]*St];let kt,gt,tt=!1,nt=!1;switch(ge){case"topLeft":tt=!0,kt=(yt,St)=>[0,0],gt=(yt,St)=>[yt,St];break;case"topMiddle":kt=(yt,St)=>[yt/2,0],gt=(yt,St)=>[yt/2,St];break;case"topRight":tt=!0,kt=(yt,St)=>[yt,0],gt=(yt,St)=>[0,St];break;case"middleRight":nt=!0,kt=(yt,St)=>[yt,St/2],gt=(yt,St)=>[0,St/2];break;case"bottomRight":tt=!0,kt=(yt,St)=>[yt,St],gt=(yt,St)=>[0,0];break;case"bottomMiddle":kt=(yt,St)=>[yt/2,St],gt=(yt,St)=>[yt/2,0];break;case"bottomLeft":tt=!0,kt=(yt,St)=>[0,St],gt=(yt,St)=>[yt,0];break;case"middleLeft":nt=!0,kt=(yt,St)=>[0,St/2],gt=(yt,St)=>[yt,St/2];break}const ft=kt(it,et),Tt=gt(it,et);let Ct=Pt(...Tt);const Ht=pt(Be+Ct[0]),Wt=pt(He+Ct[1]);let Ut=1,zt=1,[Vt,jt]=this.screenToPageTranslation(Ce.movementX,Ce.movementY);if([Vt,jt]=vt(Vt/xe,jt/Le),tt){const yt=Math.hypot(it,et);Ut=zt=Math.max(Math.min(Math.hypot(Tt[0]-ft[0]-Vt,Tt[1]-ft[1]-jt)/yt,1/it,1/et),ot/it,ht/et)}else nt?Ut=Math.max(ot,Math.min(1,Math.abs(Tt[0]-ft[0]-Vt)))/it:zt=Math.max(ht,Math.min(1,Math.abs(Tt[1]-ft[1]-jt)))/et;const Gt=pt(it*Ut),dt=pt(et*zt);Ct=Pt(...gt(Gt,dt));const Qe=Ht-Ct[0],Ye=Wt-Ct[1];this.width=Gt,this.height=dt,this.x=Qe,this.y=Ye,this.setDims(xe*Gt,Le*dt),this.fixAndSetPosition()},mt=new WeakSet,hr=async function(){var xe;const ge=ce(this,ae);if(!ge)return;if(!ce(this,ue)&&!ce(this,de)){ge.classList.remove("done"),(xe=ce(this,le))==null||xe.remove();return}pe._l10nPromise.get("editor_alt_text_edit_button_label").then(Le=>{ge.setAttribute("aria-label",Le)});let Ce=ce(this,le);if(!Ce){st(this,le,Ce=document.createElement("span")),Ce.className="tooltip",Ce.setAttribute("role","tooltip");const Le=Ce.id="alt-text-tooltip-".concat(this.id);ge.setAttribute("aria-describedby",Le);const Be=100;ge.addEventListener("mouseenter",()=>{st(this,Ae,setTimeout(()=>{st(this,Ae,null),ce(this,le).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},Be))}),ge.addEventListener("mouseleave",()=>{var He;clearTimeout(ce(this,Ae)),st(this,Ae,null),(He=ce(this,le))==null||He.classList.remove("show")})}ge.classList.add("done"),Ce.innerText=ce(this,de)?await pe._l10nPromise.get("editor_alt_text_decorative_tooltip"):ce(this,ue),Ce.parentNode||ge.append(Ce)},Et=new WeakSet,qr=function(ge){if(!this._isDraggable)return;const Ce=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let xe,Le;Ce&&(xe={passive:!0,capture:!0},Le=He=>{const[it,et]=this.screenToPageTranslation(He.movementX,He.movementY);this._uiManager.dragSelectedEditors(it,et)},window.addEventListener("pointermove",Le,xe));const Be=()=>{if(window.removeEventListener("pointerup",Be),window.removeEventListener("blur",Be),Ce&&window.removeEventListener("pointermove",Le,xe),st(this,Te,!1),!this._uiManager.endDragSession()){const{isMac:He}=ie.FeatureTest.platform;ge.ctrlKey&&!He||ge.shiftKey||ge.metaKey&&He?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",Be),window.addEventListener("blur",Be)},We(pe,Oe),An(pe,"_borderLineWidth",-1),An(pe,"_colorManager",new re.ColorManager),An(pe,"_zIndex",1),An(pe,"SMALL_EDITOR_SIZE",0);let oe=pe;te.AnnotationEditor=oe;class he extends oe{constructor(ge){super(ge),this.annotationElementId=ge.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(ee,te,ne)=>{var _e,me,ve,Se,Te,fr,$e,ye,Ee,Ne,Me,zr,Fe,Ve,qe,Ie,Xe,rt,lt,Ge,ut,mt,wt,Et,De,pe,be,ge,Ce,xe,Le,Be,He,it,et,ot,ht,pt,ct,Pt,It,vt,kt,gt,tt,nt,ft,Xr,Ct,pr,Wt,gr,zt,Xn,jt,mr,dt,_r,Ye,Pn,St,Bn,Qt,Kr,At,Yr,Rt,yr,Nt,Un,bt,br;Object.defineProperty(te,"__esModule",{value:!0}),te.KeyboardManager=te.CommandManager=te.ColorManager=te.AnnotationEditorUIManager=void 0,te.bindEvents=se,te.opacityToHex=oe;var re=ne(1),ie=ne(6);function se(Ue,fe,ke){for(const je of ke)fe.addEventListener(je,Ue[je].bind(Ue))}function oe(Ue){return Math.round(Math.min(255,Math.max(1,255*Ue))).toString(16).padStart(2,"0")}class he{constructor(){We(this,_e,0)}getId(){return"".concat(re.AnnotationEditorPrefix).concat(Nn(this,_e)._++)}}_e=new WeakMap;const Re=class Re{constructor(){We(this,Te);We(this,me,(0,re.getUuid)());We(this,ve,0);We(this,Se,null)}static get _isSVGFittingCanvas(){const fe='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>',je=new OffscreenCanvas(1,3).getContext("2d"),ze=new Image;ze.src=fe;const Ze=ze.decode().then(()=>(je.drawImage(ze,0,0,1,1,0,0,1,3),new Uint32Array(je.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,re.shadow)(this,"_isSVGFittingCanvas",Ze)}async getFromFile(fe){const{lastModified:ke,name:je,size:ze,type:Ze}=fe;return Ke(this,Te,fr).call(this,"".concat(ke,"_").concat(je,"_").concat(ze,"_").concat(Ze),fe)}async getFromUrl(fe){return Ke(this,Te,fr).call(this,fe,fe)}async getFromId(fe){ce(this,Se)||st(this,Se,new Map);const ke=ce(this,Se).get(fe);return ke?ke.bitmap?(ke.refCounter+=1,ke):ke.file?this.getFromFile(ke.file):this.getFromUrl(ke.url):null}getSvgUrl(fe){const ke=ce(this,Se).get(fe);return ke!=null&&ke.isSvg?ke.svgUrl:null}deleteId(fe){ce(this,Se)||st(this,Se,new Map);const ke=ce(this,Se).get(fe);ke&&(ke.refCounter-=1,ke.refCounter===0&&(ke.bitmap=null))}isValidId(fe){return fe.startsWith("image_".concat(ce(this,me),"_"))}};me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakSet,fr=async function(fe,ke){ce(this,Se)||st(this,Se,new Map);let je=ce(this,Se).get(fe);if(je===null)return null;if(je!=null&&je.bitmap)return je.refCounter+=1,je;try{je||(je={bitmap:null,id:"image_".concat(ce(this,me),"_").concat(Nn(this,ve)._++),refCounter:0,isSvg:!1});let ze;if(typeof ke=="string"){je.url=ke;const Ze=await fetch(ke);if(!Ze.ok)throw new Error(Ze.statusText);ze=await Ze.blob()}else ze=je.file=ke;if(ze.type==="image/svg+xml"){const Ze=Re._isSVGFittingCanvas,at=new FileReader,_t=new Image,xt=new Promise((Ft,qt)=>{_t.onload=()=>{je.bitmap=_t,je.isSvg=!0,Ft()},at.onload=async()=>{const Mt=je.svgUrl=at.result;_t.src=await Ze?"".concat(Mt,"#svgView(preserveAspectRatio(none))"):Mt},_t.onerror=at.onerror=qt});at.readAsDataURL(ze),await xt}else je.bitmap=await createImageBitmap(ze);je.refCounter=1}catch(ze){console.error(ze),je=null}return ce(this,Se).set(fe,je),je&&ce(this,Se).set(je.id,je),je};let ue=Re;class de{constructor(fe=128){We(this,$e,[]);We(this,ye,!1);We(this,Ee,void 0);We(this,Ne,-1);st(this,Ee,fe)}add({cmd:fe,undo:ke,mustExec:je,type:ze=NaN,overwriteIfSameType:Ze=!1,keepUndo:at=!1}){if(je&&fe(),ce(this,ye))return;const _t={cmd:fe,undo:ke,type:ze};if(ce(this,Ne)===-1){ce(this,$e).length>0&&(ce(this,$e).length=0),st(this,Ne,0),ce(this,$e).push(_t);return}if(Ze&&ce(this,$e)[ce(this,Ne)].type===ze){at&&(_t.undo=ce(this,$e)[ce(this,Ne)].undo),ce(this,$e)[ce(this,Ne)]=_t;return}const xt=ce(this,Ne)+1;xt===ce(this,Ee)?ce(this,$e).splice(0,1):(st(this,Ne,xt),xt<ce(this,$e).length&&ce(this,$e).splice(xt)),ce(this,$e).push(_t)}undo(){ce(this,Ne)!==-1&&(st(this,ye,!0),ce(this,$e)[ce(this,Ne)].undo(),st(this,ye,!1),st(this,Ne,ce(this,Ne)-1))}redo(){ce(this,Ne)<ce(this,$e).length-1&&(st(this,Ne,ce(this,Ne)+1),st(this,ye,!0),ce(this,$e)[ce(this,Ne)].cmd(),st(this,ye,!1))}hasSomethingToUndo(){return ce(this,Ne)!==-1}hasSomethingToRedo(){return ce(this,Ne)<ce(this,$e).length-1}destroy(){st(this,$e,null)}}$e=new WeakMap,ye=new WeakMap,Ee=new WeakMap,Ne=new WeakMap,te.CommandManager=de;class ae{constructor(fe){We(this,Me);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:ke}=re.FeatureTest.platform;for(const[je,ze,Ze={}]of fe)for(const at of je){const _t=at.startsWith("mac+");ke&&_t?(this.callbacks.set(at.slice(4),{callback:ze,options:Ze}),this.allKeys.add(at.split("+").at(-1))):!ke&&!_t&&(this.callbacks.set(at,{callback:ze,options:Ze}),this.allKeys.add(at.split("+").at(-1)))}}exec(fe,ke){if(!this.allKeys.has(ke.key))return;const je=this.callbacks.get(Ke(this,Me,zr).call(this,ke));if(!je)return;const{callback:ze,options:{bubbles:Ze=!1,args:at=[],checker:_t=null}}=je;_t&&!_t(fe,ke)||(ze.bind(fe,...at)(),Ze||(ke.stopPropagation(),ke.preventDefault()))}}Me=new WeakSet,zr=function(fe){fe.altKey&&this.buffer.push("alt"),fe.ctrlKey&&this.buffer.push("ctrl"),fe.metaKey&&this.buffer.push("meta"),fe.shiftKey&&this.buffer.push("shift"),this.buffer.push(fe.key);const ke=this.buffer.join("+");return this.buffer.length=0,ke},te.KeyboardManager=ae;const Oe=class Oe{get _colors(){const fe=new Map([["CanvasText",null],["Canvas",null]]);return(0,ie.getColorValues)(fe),(0,re.shadow)(this,"_colors",fe)}convert(fe){const ke=(0,ie.getRGB)(fe);if(!window.matchMedia("(forced-colors: active)").matches)return ke;for(const[je,ze]of this._colors)if(ze.every((Ze,at)=>Ze===ke[at]))return Oe._colorsMapping.get(je);return ke}getHexCode(fe){const ke=this._colors.get(fe);return ke?re.Util.makeHexColor(...ke):fe}};An(Oe,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let le=Oe;te.ColorManager=le;const Ot=class Ot{constructor(fe,ke,je,ze,Ze,at){We(this,ft);We(this,Ct);We(this,Wt);We(this,zt);We(this,jt);We(this,dt);We(this,Ye);We(this,St);We(this,Qt);We(this,At);We(this,Rt);We(this,Nt);We(this,bt);We(this,Fe,null);We(this,Ve,new Map);We(this,qe,new Map);We(this,Ie,null);We(this,Xe,null);We(this,rt,new de);We(this,lt,0);We(this,Ge,new Set);We(this,ut,null);We(this,mt,null);We(this,wt,new Set);We(this,Et,null);We(this,De,new he);We(this,pe,!1);We(this,be,!1);We(this,ge,null);We(this,Ce,re.AnnotationEditorType.NONE);We(this,xe,new Set);We(this,Le,null);We(this,Be,this.blur.bind(this));We(this,He,this.focus.bind(this));We(this,it,this.copy.bind(this));We(this,et,this.cut.bind(this));We(this,ot,this.paste.bind(this));We(this,ht,this.keydown.bind(this));We(this,pt,this.onEditingAction.bind(this));We(this,ct,this.onPageChanging.bind(this));We(this,Pt,this.onScaleChanging.bind(this));We(this,It,this.onRotationChanging.bind(this));We(this,vt,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});We(this,kt,[0,0]);We(this,gt,null);We(this,tt,null);We(this,nt,null);st(this,tt,fe),st(this,nt,ke),st(this,Ie,je),this._eventBus=ze,this._eventBus._on("editingaction",ce(this,pt)),this._eventBus._on("pagechanging",ce(this,ct)),this._eventBus._on("scalechanging",ce(this,Pt)),this._eventBus._on("rotationchanging",ce(this,It)),st(this,Xe,Ze.annotationStorage),st(this,Et,Ze.filterFactory),st(this,Le,at),this.viewParameters={realScale:ie.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const fe=Ot.prototype,ke=Ze=>{const{activeElement:at}=document;return at&&ce(Ze,tt).contains(at)&&Ze.hasSomethingToControl()},je=this.TRANSLATE_SMALL,ze=this.TRANSLATE_BIG;return(0,re.shadow)(this,"_keyboardManager",new ae([[["ctrl+a","mac+meta+a"],fe.selectAll],[["ctrl+z","mac+meta+z"],fe.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],fe.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],fe.delete],[["Escape","mac+Escape"],fe.unselectAll],[["ArrowLeft","mac+ArrowLeft"],fe.translateSelectedEditors,{args:[-je,0],checker:ke}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],fe.translateSelectedEditors,{args:[-ze,0],checker:ke}],[["ArrowRight","mac+ArrowRight"],fe.translateSelectedEditors,{args:[je,0],checker:ke}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],fe.translateSelectedEditors,{args:[ze,0],checker:ke}],[["ArrowUp","mac+ArrowUp"],fe.translateSelectedEditors,{args:[0,-je],checker:ke}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],fe.translateSelectedEditors,{args:[0,-ze],checker:ke}],[["ArrowDown","mac+ArrowDown"],fe.translateSelectedEditors,{args:[0,je],checker:ke}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],fe.translateSelectedEditors,{args:[0,ze],checker:ke}]]))}destroy(){Ke(this,zt,Xn).call(this),Ke(this,Ct,pr).call(this),this._eventBus._off("editingaction",ce(this,pt)),this._eventBus._off("pagechanging",ce(this,ct)),this._eventBus._off("scalechanging",ce(this,Pt)),this._eventBus._off("rotationchanging",ce(this,It));for(const fe of ce(this,qe).values())fe.destroy();ce(this,qe).clear(),ce(this,Ve).clear(),ce(this,wt).clear(),st(this,Fe,null),ce(this,xe).clear(),ce(this,rt).destroy(),ce(this,Ie).destroy()}get hcmFilter(){return(0,re.shadow)(this,"hcmFilter",ce(this,Le)?ce(this,Et).addHCMFilter(ce(this,Le).foreground,ce(this,Le).background):"none")}get direction(){return(0,re.shadow)(this,"direction",getComputedStyle(ce(this,tt)).direction)}editAltText(fe){var ke;(ke=ce(this,Ie))==null||ke.editAltText(this,fe)}onPageChanging({pageNumber:fe}){st(this,lt,fe-1)}focusMainContainer(){ce(this,tt).focus()}findParent(fe,ke){for(const je of ce(this,qe).values()){const{x:ze,y:Ze,width:at,height:_t}=je.div.getBoundingClientRect();if(fe>=ze&&fe<=ze+at&&ke>=Ze&&ke<=Ze+_t)return je}return null}disableUserSelect(fe=!1){ce(this,nt).classList.toggle("noUserSelect",fe)}addShouldRescale(fe){ce(this,wt).add(fe)}removeShouldRescale(fe){ce(this,wt).delete(fe)}onScaleChanging({scale:fe}){this.commitOrRemove(),this.viewParameters.realScale=fe*ie.PixelsPerInch.PDF_TO_CSS_UNITS;for(const ke of ce(this,wt))ke.onScaleChanging()}onRotationChanging({pagesRotation:fe}){this.commitOrRemove(),this.viewParameters.rotation=fe}addToAnnotationStorage(fe){!fe.isEmpty()&&ce(this,Xe)&&!ce(this,Xe).has(fe.id)&&ce(this,Xe).setValue(fe.id,fe)}blur(){if(!this.hasSelection)return;const{activeElement:fe}=document;for(const ke of ce(this,xe))if(ke.div.contains(fe)){st(this,ge,[ke,fe]),ke._focusEventsAllowed=!1;break}}focus(){if(!ce(this,ge))return;const[fe,ke]=ce(this,ge);st(this,ge,null),ke.addEventListener("focusin",()=>{fe._focusEventsAllowed=!0},{once:!0}),ke.focus()}addEditListeners(){Ke(this,Wt,gr).call(this),Ke(this,jt,mr).call(this)}removeEditListeners(){Ke(this,zt,Xn).call(this),Ke(this,dt,_r).call(this)}copy(fe){var je;if(fe.preventDefault(),(je=ce(this,Fe))==null||je.commitOrRemove(),!this.hasSelection)return;const ke=[];for(const ze of ce(this,xe)){const Ze=ze.serialize(!0);Ze&&ke.push(Ze)}ke.length!==0&&fe.clipboardData.setData("application/pdfjs",JSON.stringify(ke))}cut(fe){this.copy(fe),this.delete()}paste(fe){fe.preventDefault();const{clipboardData:ke}=fe;for(const Ze of ke.items)for(const at of ce(this,mt))if(at.isHandlingMimeForPasting(Ze.type)){at.paste(Ze,this.currentLayer);return}let je=ke.getData("application/pdfjs");if(!je)return;try{je=JSON.parse(je)}catch(Ze){(0,re.warn)('paste: "'.concat(Ze.message,'".'));return}if(!Array.isArray(je))return;this.unselectAll();const ze=this.currentLayer;try{const Ze=[];for(const xt of je){const Ft=ze.deserialize(xt);if(!Ft)return;Ze.push(Ft)}const at=()=>{for(const xt of Ze)Ke(this,Rt,yr).call(this,xt);Ke(this,bt,br).call(this,Ze)},_t=()=>{for(const xt of Ze)xt.remove()};this.addCommands({cmd:at,undo:_t,mustExec:!0})}catch(Ze){(0,re.warn)('paste: "'.concat(Ze.message,'".'))}}keydown(fe){var ke;(ke=this.getActive())!=null&&ke.shouldGetKeyboardEvents()||Ot._keyboardManager.exec(this,fe)}onEditingAction(fe){["undo","redo","delete","selectAll"].includes(fe.name)&&this[fe.name]()}setEditingState(fe){fe?(Ke(this,ft,Xr).call(this),Ke(this,Wt,gr).call(this),Ke(this,jt,mr).call(this),Ke(this,Ye,Pn).call(this,{isEditing:ce(this,Ce)!==re.AnnotationEditorType.NONE,isEmpty:Ke(this,Nt,Un).call(this),hasSomethingToUndo:ce(this,rt).hasSomethingToUndo(),hasSomethingToRedo:ce(this,rt).hasSomethingToRedo(),hasSelectedEditor:!1})):(Ke(this,Ct,pr).call(this),Ke(this,zt,Xn).call(this),Ke(this,dt,_r).call(this),Ke(this,Ye,Pn).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(fe){if(!ce(this,mt)){st(this,mt,fe);for(const ke of ce(this,mt))Ke(this,St,Bn).call(this,ke.defaultPropertiesToUpdate)}}getId(){return ce(this,De).getId()}get currentLayer(){return ce(this,qe).get(ce(this,lt))}getLayer(fe){return ce(this,qe).get(fe)}get currentPageIndex(){return ce(this,lt)}addLayer(fe){ce(this,qe).set(fe.pageIndex,fe),ce(this,pe)?fe.enable():fe.disable()}removeLayer(fe){ce(this,qe).delete(fe.pageIndex)}updateMode(fe,ke=null){if(ce(this,Ce)!==fe){if(st(this,Ce,fe),fe===re.AnnotationEditorType.NONE){this.setEditingState(!1),Ke(this,At,Yr).call(this);return}this.setEditingState(!0),Ke(this,Qt,Kr).call(this),this.unselectAll();for(const je of ce(this,qe).values())je.updateMode(fe);if(ke){for(const je of ce(this,Ve).values())if(je.annotationElementId===ke){this.setSelected(je),je.enterInEditMode();break}}}}updateToolbar(fe){fe!==ce(this,Ce)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:fe})}updateParams(fe,ke){if(ce(this,mt)){if(fe===re.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(fe);return}for(const je of ce(this,xe))je.updateParams(fe,ke);for(const je of ce(this,mt))je.updateDefaultParams(fe,ke)}}enableWaiting(fe=!1){if(ce(this,be)!==fe){st(this,be,fe);for(const ke of ce(this,qe).values())fe?ke.disableClick():ke.enableClick(),ke.div.classList.toggle("waiting",fe)}}getEditors(fe){const ke=[];for(const je of ce(this,Ve).values())je.pageIndex===fe&&ke.push(je);return ke}getEditor(fe){return ce(this,Ve).get(fe)}addEditor(fe){ce(this,Ve).set(fe.id,fe)}removeEditor(fe){var ke;ce(this,Ve).delete(fe.id),this.unselect(fe),(!fe.annotationElementId||!ce(this,Ge).has(fe.annotationElementId))&&((ke=ce(this,Xe))==null||ke.remove(fe.id))}addDeletedAnnotationElement(fe){ce(this,Ge).add(fe.annotationElementId),fe.deleted=!0}isDeletedAnnotationElement(fe){return ce(this,Ge).has(fe)}removeDeletedAnnotationElement(fe){ce(this,Ge).delete(fe.annotationElementId),fe.deleted=!1}setActiveEditor(fe){ce(this,Fe)!==fe&&(st(this,Fe,fe),fe&&Ke(this,St,Bn).call(this,fe.propertiesToUpdate))}toggleSelected(fe){if(ce(this,xe).has(fe)){ce(this,xe).delete(fe),fe.unselect(),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:this.hasSelection});return}ce(this,xe).add(fe),fe.select(),Ke(this,St,Bn).call(this,fe.propertiesToUpdate),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:!0})}setSelected(fe){for(const ke of ce(this,xe))ke!==fe&&ke.unselect();ce(this,xe).clear(),ce(this,xe).add(fe),fe.select(),Ke(this,St,Bn).call(this,fe.propertiesToUpdate),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:!0})}isSelected(fe){return ce(this,xe).has(fe)}unselect(fe){fe.unselect(),ce(this,xe).delete(fe),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return ce(this,xe).size!==0}undo(){ce(this,rt).undo(),Ke(this,Ye,Pn).call(this,{hasSomethingToUndo:ce(this,rt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:Ke(this,Nt,Un).call(this)})}redo(){ce(this,rt).redo(),Ke(this,Ye,Pn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:ce(this,rt).hasSomethingToRedo(),isEmpty:Ke(this,Nt,Un).call(this)})}addCommands(fe){ce(this,rt).add(fe),Ke(this,Ye,Pn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:Ke(this,Nt,Un).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const fe=[...ce(this,xe)],ke=()=>{for(const ze of fe)ze.remove()},je=()=>{for(const ze of fe)Ke(this,Rt,yr).call(this,ze)};this.addCommands({cmd:ke,undo:je,mustExec:!0})}commitOrRemove(){var fe;(fe=ce(this,Fe))==null||fe.commitOrRemove()}hasSomethingToControl(){return ce(this,Fe)||this.hasSelection}selectAll(){for(const fe of ce(this,xe))fe.commit();Ke(this,bt,br).call(this,ce(this,Ve).values())}unselectAll(){if(ce(this,Fe)){ce(this,Fe).commitOrRemove();return}if(this.hasSelection){for(const fe of ce(this,xe))fe.unselect();ce(this,xe).clear(),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(fe,ke,je=!1){if(je||this.commitOrRemove(),!this.hasSelection)return;ce(this,kt)[0]+=fe,ce(this,kt)[1]+=ke;const[ze,Ze]=ce(this,kt),at=[...ce(this,xe)],_t=1e3;ce(this,gt)&&clearTimeout(ce(this,gt)),st(this,gt,setTimeout(()=>{st(this,gt,null),ce(this,kt)[0]=ce(this,kt)[1]=0,this.addCommands({cmd:()=>{for(const xt of at)ce(this,Ve).has(xt.id)&&xt.translateInPage(ze,Ze)},undo:()=>{for(const xt of at)ce(this,Ve).has(xt.id)&&xt.translateInPage(-ze,-Ze)},mustExec:!1})},_t));for(const xt of at)xt.translateInPage(fe,ke)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),st(this,ut,new Map);for(const fe of ce(this,xe))ce(this,ut).set(fe,{savedX:fe.x,savedY:fe.y,savedPageIndex:fe.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!ce(this,ut))return!1;this.disableUserSelect(!1);const fe=ce(this,ut);st(this,ut,null);let ke=!1;for(const[{x:ze,y:Ze,pageIndex:at},_t]of fe)_t.newX=ze,_t.newY=Ze,_t.newPageIndex=at,ke||(ke=ze!==_t.savedX||Ze!==_t.savedY||at!==_t.savedPageIndex);if(!ke)return!1;const je=(ze,Ze,at,_t)=>{if(ce(this,Ve).has(ze.id)){const xt=ce(this,qe).get(_t);xt?ze._setParentAndPosition(xt,Ze,at):(ze.pageIndex=_t,ze.x=Ze,ze.y=at)}};return this.addCommands({cmd:()=>{for(const[ze,{newX:Ze,newY:at,newPageIndex:_t}]of fe)je(ze,Ze,at,_t)},undo:()=>{for(const[ze,{savedX:Ze,savedY:at,savedPageIndex:_t}]of fe)je(ze,Ze,at,_t)},mustExec:!0}),!0}dragSelectedEditors(fe,ke){if(ce(this,ut))for(const je of ce(this,ut).keys())je.drag(fe,ke)}rebuild(fe){if(fe.parent===null){const ke=this.getLayer(fe.pageIndex);ke?(ke.changeParent(fe),ke.addOrRebuild(fe)):(this.addEditor(fe),this.addToAnnotationStorage(fe),fe.rebuild())}else fe.parent.addOrRebuild(fe)}isActive(fe){return ce(this,Fe)===fe}getActive(){return ce(this,Fe)}getMode(){return ce(this,Ce)}get imageManager(){return(0,re.shadow)(this,"imageManager",new ue)}};Fe=new WeakMap,Ve=new WeakMap,qe=new WeakMap,Ie=new WeakMap,Xe=new WeakMap,rt=new WeakMap,lt=new WeakMap,Ge=new WeakMap,ut=new WeakMap,mt=new WeakMap,wt=new WeakMap,Et=new WeakMap,De=new WeakMap,pe=new WeakMap,be=new WeakMap,ge=new WeakMap,Ce=new WeakMap,xe=new WeakMap,Le=new WeakMap,Be=new WeakMap,He=new WeakMap,it=new WeakMap,et=new WeakMap,ot=new WeakMap,ht=new WeakMap,pt=new WeakMap,ct=new WeakMap,Pt=new WeakMap,It=new WeakMap,vt=new WeakMap,kt=new WeakMap,gt=new WeakMap,tt=new WeakMap,nt=new WeakMap,ft=new WeakSet,Xr=function(){window.addEventListener("focus",ce(this,He)),window.addEventListener("blur",ce(this,Be))},Ct=new WeakSet,pr=function(){window.removeEventListener("focus",ce(this,He)),window.removeEventListener("blur",ce(this,Be))},Wt=new WeakSet,gr=function(){window.addEventListener("keydown",ce(this,ht),{capture:!0})},zt=new WeakSet,Xn=function(){window.removeEventListener("keydown",ce(this,ht),{capture:!0})},jt=new WeakSet,mr=function(){document.addEventListener("copy",ce(this,it)),document.addEventListener("cut",ce(this,et)),document.addEventListener("paste",ce(this,ot))},dt=new WeakSet,_r=function(){document.removeEventListener("copy",ce(this,it)),document.removeEventListener("cut",ce(this,et)),document.removeEventListener("paste",ce(this,ot))},Ye=new WeakSet,Pn=function(fe){Object.entries(fe).some(([je,ze])=>ce(this,vt)[je]!==ze)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(ce(this,vt),fe)})},St=new WeakSet,Bn=function(fe){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:fe})},Qt=new WeakSet,Kr=function(){if(!ce(this,pe)){st(this,pe,!0);for(const fe of ce(this,qe).values())fe.enable()}},At=new WeakSet,Yr=function(){if(this.unselectAll(),ce(this,pe)){st(this,pe,!1);for(const fe of ce(this,qe).values())fe.disable()}},Rt=new WeakSet,yr=function(fe){const ke=ce(this,qe).get(fe.pageIndex);ke?ke.addOrRebuild(fe):this.addEditor(fe)},Nt=new WeakSet,Un=function(){if(ce(this,Ve).size===0)return!0;if(ce(this,Ve).size===1)for(const fe of ce(this,Ve).values())return fe.isEmpty();return!1},bt=new WeakSet,br=function(fe){ce(this,xe).clear();for(const ke of fe)ke.isEmpty()||(ce(this,xe).add(ke),ke.select());Ke(this,Ye,Pn).call(this,{hasSelectedEditor:!0})},An(Ot,"TRANSLATE_SMALL",1),An(Ot,"TRANSLATE_BIG",10);let Ae=Ot;te.AnnotationEditorUIManager=Ae},(ee,te,ne)=>{var lt,Ge,ut,mt,wt,Et,De,pe,be,ge,Ce,xe,Ln,Be,In,it,Sr,ot,Kn,pt,Yn,Pt,jn,vt,Hn;Object.defineProperty(te,"__esModule",{value:!0}),te.StatTimer=te.RenderingCancelledException=te.PixelsPerInch=te.PageViewport=te.PDFDateString=te.DOMStandardFontDataFactory=te.DOMSVGFactory=te.DOMFilterFactory=te.DOMCanvasFactory=te.DOMCMapReaderFactory=void 0,te.deprecated=Ne,te.getColorValues=Ve,te.getCurrentTransform=qe,te.getCurrentTransformInverse=Ie,te.getFilenameFromUrl=Te,te.getPdfFilenameFromUrl=Pe,te.getRGB=Fe,te.getXfaPageViewport=Oe,te.isDataScheme=ve,te.isPdfFile=Se,te.isValidFetchUrl=$e,te.loadScript=Ee,te.noContextMenu=ye,te.setLayerDimensions=Xe;var re=ne(7),ie=ne(1);const se="http://www.w3.org/2000/svg",rt=class rt{};An(rt,"CSS",96),An(rt,"PDF",72),An(rt,"PDF_TO_CSS_UNITS",rt.CSS/rt.PDF);let oe=rt;te.PixelsPerInch=oe;class he extends re.BaseFilterFactory{constructor({docId:nt,ownerDocument:ft=globalThis.document}={}){super();We(this,xe);We(this,Be);We(this,it);We(this,ot);We(this,pt);We(this,Pt);We(this,vt);We(this,lt,void 0);We(this,Ge,void 0);We(this,ut,void 0);We(this,mt,void 0);We(this,wt,void 0);We(this,Et,void 0);We(this,De,void 0);We(this,pe,void 0);We(this,be,void 0);We(this,ge,void 0);We(this,Ce,0);st(this,ut,nt),st(this,mt,ft)}addFilter(nt){if(!nt)return"none";let ft=ce(this,xe,Ln).get(nt);if(ft)return ft;let Tt,Ct,Ht,Wt;if(nt.length===1){const jt=nt[0],Gt=new Array(256);for(let dt=0;dt<256;dt++)Gt[dt]=jt[dt]/255;Wt=Tt=Ct=Ht=Gt.join(",")}else{const[jt,Gt,dt]=nt,Qe=new Array(256),Ye=new Array(256),yt=new Array(256);for(let St=0;St<256;St++)Qe[St]=jt[St]/255,Ye[St]=Gt[St]/255,yt[St]=dt[St]/255;Tt=Qe.join(","),Ct=Ye.join(","),Ht=yt.join(","),Wt="".concat(Tt).concat(Ct).concat(Ht)}if(ft=ce(this,xe,Ln).get(Wt),ft)return ce(this,xe,Ln).set(nt,ft),ft;const Ut="g_".concat(ce(this,ut),"_transfer_map_").concat(Nn(this,Ce)._++),zt="url(#".concat(Ut,")");ce(this,xe,Ln).set(nt,zt),ce(this,xe,Ln).set(Wt,zt);const Vt=Ke(this,ot,Kn).call(this,Ut);return Ke(this,Pt,jn).call(this,Tt,Ct,Ht,Vt),zt}addHCMFilter(nt,ft){var Gt;const Tt="".concat(nt,"-").concat(ft);if(ce(this,Et)===Tt)return ce(this,De);if(st(this,Et,Tt),st(this,De,"none"),(Gt=ce(this,wt))==null||Gt.remove(),!nt||!ft)return ce(this,De);const Ct=Ke(this,vt,Hn).call(this,nt);nt=ie.Util.makeHexColor(...Ct);const Ht=Ke(this,vt,Hn).call(this,ft);if(ft=ie.Util.makeHexColor(...Ht),ce(this,Be,In).style.color="",nt==="#000000"&&ft==="#ffffff"||nt===ft)return ce(this,De);const Wt=new Array(256);for(let dt=0;dt<=255;dt++){const Qe=dt/255;Wt[dt]=Qe<=.03928?Qe/12.92:((Qe+.055)/1.055)**2.4}const Ut=Wt.join(","),zt="g_".concat(ce(this,ut),"_hcm_filter"),Vt=st(this,pe,Ke(this,ot,Kn).call(this,zt));Ke(this,Pt,jn).call(this,Ut,Ut,Ut,Vt),Ke(this,it,Sr).call(this,Vt);const jt=(dt,Qe)=>{const Ye=Ct[dt]/255,yt=Ht[dt]/255,St=new Array(Qe+1);for(let wn=0;wn<=Qe;wn++)St[wn]=Ye+wn/Qe*(yt-Ye);return St.join(",")};return Ke(this,Pt,jn).call(this,jt(0,5),jt(1,5),jt(2,5),Vt),st(this,De,"url(#".concat(zt,")")),ce(this,De)}addHighlightHCMFilter(nt,ft,Tt,Ct){var yt;const Ht="".concat(nt,"-").concat(ft,"-").concat(Tt,"-").concat(Ct);if(ce(this,be)===Ht)return ce(this,ge);if(st(this,be,Ht),st(this,ge,"none"),(yt=ce(this,pe))==null||yt.remove(),!nt||!ft)return ce(this,ge);const[Wt,Ut]=[nt,ft].map(Ke(this,vt,Hn).bind(this));let zt=Math.round(.2126*Wt[0]+.7152*Wt[1]+.0722*Wt[2]),Vt=Math.round(.2126*Ut[0]+.7152*Ut[1]+.0722*Ut[2]),[jt,Gt]=[Tt,Ct].map(Ke(this,vt,Hn).bind(this));Vt<zt&&([zt,Vt,jt,Gt]=[Vt,zt,Gt,jt]),ce(this,Be,In).style.color="";const dt=(St,wn,Qt)=>{const Je=new Array(256),At=(Vt-zt)/Qt,Lt=St/255,Rt=(wn-St)/(255*Qt);let Dt=0;for(let Nt=0;Nt<=Qt;Nt++){const Zt=Math.round(zt+Nt*At),bt=Lt+Nt*Rt;for(let Kt=Dt;Kt<=Zt;Kt++)Je[Kt]=bt;Dt=Zt+1}for(let Nt=Dt;Nt<256;Nt++)Je[Nt]=Je[Dt-1];return Je.join(",")},Qe="g_".concat(ce(this,ut),"_hcm_highlight_filter"),Ye=st(this,pe,Ke(this,ot,Kn).call(this,Qe));return Ke(this,it,Sr).call(this,Ye),Ke(this,Pt,jn).call(this,dt(jt[0],Gt[0],5),dt(jt[1],Gt[1],5),dt(jt[2],Gt[2],5),Ye),st(this,ge,"url(#".concat(Qe,")")),ce(this,ge)}destroy(nt=!1){nt&&(ce(this,De)||ce(this,ge))||(ce(this,Ge)&&(ce(this,Ge).parentNode.parentNode.remove(),st(this,Ge,null)),ce(this,lt)&&(ce(this,lt).clear(),st(this,lt,null)),st(this,Ce,0))}}lt=new WeakMap,Ge=new WeakMap,ut=new WeakMap,mt=new WeakMap,wt=new WeakMap,Et=new WeakMap,De=new WeakMap,pe=new WeakMap,be=new WeakMap,ge=new WeakMap,Ce=new WeakMap,xe=new WeakSet,Ln=function(){return ce(this,lt)||st(this,lt,new Map)},Be=new WeakSet,In=function(){if(!ce(this,Ge)){const nt=ce(this,mt).createElement("div"),{style:ft}=nt;ft.visibility="hidden",ft.contain="strict",ft.width=ft.height=0,ft.position="absolute",ft.top=ft.left=0,ft.zIndex=-1;const Tt=ce(this,mt).createElementNS(se,"svg");Tt.setAttribute("width",0),Tt.setAttribute("height",0),st(this,Ge,ce(this,mt).createElementNS(se,"defs")),nt.append(Tt),Tt.append(ce(this,Ge)),ce(this,mt).body.append(nt)}return ce(this,Ge)},it=new WeakSet,Sr=function(nt){const ft=ce(this,mt).createElementNS(se,"feColorMatrix");ft.setAttribute("type","matrix"),ft.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"),nt.append(ft)},ot=new WeakSet,Kn=function(nt){const ft=ce(this,mt).createElementNS(se,"filter");return ft.setAttribute("color-interpolation-filters","sRGB"),ft.setAttribute("id",nt),ce(this,Be,In).append(ft),ft},pt=new WeakSet,Yn=function(nt,ft,Tt){const Ct=ce(this,mt).createElementNS(se,ft);Ct.setAttribute("type","discrete"),Ct.setAttribute("tableValues",Tt),nt.append(Ct)},Pt=new WeakSet,jn=function(nt,ft,Tt,Ct){const Ht=ce(this,mt).createElementNS(se,"feComponentTransfer");Ct.append(Ht),Ke(this,pt,Yn).call(this,Ht,"feFuncR",nt),Ke(this,pt,Yn).call(this,Ht,"feFuncG",ft),Ke(this,pt,Yn).call(this,Ht,"feFuncB",Tt)},vt=new WeakSet,Hn=function(nt){return ce(this,Be,In).style.color=nt,Fe(getComputedStyle(ce(this,Be,In)).getPropertyValue("color"))},te.DOMFilterFactory=he;class ue extends re.BaseCanvasFactory{constructor({ownerDocument:tt=globalThis.document}={}){super(),this._document=tt}_createCanvas(tt,nt){const ft=this._document.createElement("canvas");return ft.width=tt,ft.height=nt,ft}}te.DOMCanvasFactory=ue;async function de(gt,tt=!1){if($e(gt,document.baseURI)){const nt=await fetch(gt);if(!nt.ok)throw new Error(nt.statusText);return tt?new Uint8Array(await nt.arrayBuffer()):(0,ie.stringToBytes)(await nt.text())}return new Promise((nt,ft)=>{const Tt=new XMLHttpRequest;Tt.open("GET",gt,!0),tt&&(Tt.responseType="arraybuffer"),Tt.onreadystatechange=()=>{if(Tt.readyState===XMLHttpRequest.DONE){if(Tt.status===200||Tt.status===0){let Ct;if(tt&&Tt.response?Ct=new Uint8Array(Tt.response):!tt&&Tt.responseText&&(Ct=(0,ie.stringToBytes)(Tt.responseText)),Ct){nt(Ct);return}}ft(new Error(Tt.statusText))}},Tt.send(null)})}class ae extends re.BaseCMapReaderFactory{_fetchData(tt,nt){return de(tt,this.isCompressed).then(ft=>({cMapData:ft,compressionType:nt}))}}te.DOMCMapReaderFactory=ae;class le extends re.BaseStandardFontDataFactory{_fetchData(tt){return de(tt,!0)}}te.DOMStandardFontDataFactory=le;class Ae extends re.BaseSVGFactory{_createSVG(tt){return document.createElementNS(se,tt)}}te.DOMSVGFactory=Ae;class _e{constructor({viewBox:tt,scale:nt,rotation:ft,offsetX:Tt=0,offsetY:Ct=0,dontFlip:Ht=!1}){this.viewBox=tt,this.scale=nt,this.rotation=ft,this.offsetX=Tt,this.offsetY=Ct;const Wt=(tt[2]+tt[0])/2,Ut=(tt[3]+tt[1])/2;let zt,Vt,jt,Gt;switch(ft%=360,ft<0&&(ft+=360),ft){case 180:zt=-1,Vt=0,jt=0,Gt=1;break;case 90:zt=0,Vt=1,jt=1,Gt=0;break;case 270:zt=0,Vt=-1,jt=-1,Gt=0;break;case 0:zt=1,Vt=0,jt=0,Gt=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Ht&&(jt=-jt,Gt=-Gt);let dt,Qe,Ye,yt;zt===0?(dt=Math.abs(Ut-tt[1])*nt+Tt,Qe=Math.abs(Wt-tt[0])*nt+Ct,Ye=(tt[3]-tt[1])*nt,yt=(tt[2]-tt[0])*nt):(dt=Math.abs(Wt-tt[0])*nt+Tt,Qe=Math.abs(Ut-tt[1])*nt+Ct,Ye=(tt[2]-tt[0])*nt,yt=(tt[3]-tt[1])*nt),this.transform=[zt*nt,Vt*nt,jt*nt,Gt*nt,dt-zt*nt*Wt-jt*nt*Ut,Qe-Vt*nt*Wt-Gt*nt*Ut],this.width=Ye,this.height=yt}get rawDims(){const{viewBox:tt}=this;return(0,ie.shadow)(this,"rawDims",{pageWidth:tt[2]-tt[0],pageHeight:tt[3]-tt[1],pageX:tt[0],pageY:tt[1]})}clone({scale:tt=this.scale,rotation:nt=this.rotation,offsetX:ft=this.offsetX,offsetY:Tt=this.offsetY,dontFlip:Ct=!1}={}){return new _e({viewBox:this.viewBox.slice(),scale:tt,rotation:nt,offsetX:ft,offsetY:Tt,dontFlip:Ct})}convertToViewportPoint(tt,nt){return ie.Util.applyTransform([tt,nt],this.transform)}convertToViewportRectangle(tt){const nt=ie.Util.applyTransform([tt[0],tt[1]],this.transform),ft=ie.Util.applyTransform([tt[2],tt[3]],this.transform);return[nt[0],nt[1],ft[0],ft[1]]}convertToPdfPoint(tt,nt){return ie.Util.applyInverseTransform([tt,nt],this.transform)}}te.PageViewport=_e;class me extends ie.BaseException{constructor(tt,nt=0){super(tt,"RenderingCancelledException"),this.extraDelay=nt}}te.RenderingCancelledException=me;function ve(gt){const tt=gt.length;let nt=0;for(;nt<tt&&gt[nt].trim()==="";)nt++;return gt.substring(nt,nt+5).toLowerCase()==="data:"}function Se(gt){return typeof gt=="string"&&/\.pdf$/i.test(gt)}function Te(gt,tt=!1){return tt||([gt]=gt.split(/[#?]/,1)),gt.substring(gt.lastIndexOf("/")+1)}function Pe(gt,tt="document.pdf"){if(typeof gt!="string")return tt;if(ve(gt))return(0,ie.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),tt;const nt=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,ft=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,Tt=nt.exec(gt);let Ct=ft.exec(Tt[1])||ft.exec(Tt[2])||ft.exec(Tt[3]);if(Ct&&(Ct=Ct[0],Ct.includes("%")))try{Ct=ft.exec(decodeURIComponent(Ct))[0]}catch{}return Ct||tt}class Re{constructor(){An(this,"started",Object.create(null));An(this,"times",[])}time(tt){tt in this.started&&(0,ie.warn)("Timer is already running for ".concat(tt)),this.started[tt]=Date.now()}timeEnd(tt){tt in this.started||(0,ie.warn)("Timer has not been started for ".concat(tt)),this.times.push({name:tt,start:this.started[tt],end:Date.now()}),delete this.started[tt]}toString(){const tt=[];let nt=0;for(const{name:ft}of this.times)nt=Math.max(ft.length,nt);for(const{name:ft,start:Tt,end:Ct}of this.times)tt.push("".concat(ft.padEnd(nt)," ").concat(Ct-Tt,"ms\n"));return tt.join("")}}te.StatTimer=Re;function $e(gt,tt){try{const{protocol:nt}=tt?new URL(gt,tt):new URL(gt);return nt==="http:"||nt==="https:"}catch{return!1}}function ye(gt){gt.preventDefault()}function Ee(gt,tt=!1){return new Promise((nt,ft)=>{const Tt=document.createElement("script");Tt.src=gt,Tt.onload=function(Ct){tt&&Tt.remove(),nt(Ct)},Tt.onerror=function(){ft(new Error("Cannot load script at: ".concat(Tt.src)))},(document.head||document.documentElement).append(Tt)})}function Ne(gt){console.log("Deprecated API usage: "+gt)}let Me;class we{static toDateObject(tt){if(!tt||typeof tt!="string")return null;Me||(Me=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const nt=Me.exec(tt);if(!nt)return null;const ft=parseInt(nt[1],10);let Tt=parseInt(nt[2],10);Tt=Tt>=1&&Tt<=12?Tt-1:0;let Ct=parseInt(nt[3],10);Ct=Ct>=1&&Ct<=31?Ct:1;let Ht=parseInt(nt[4],10);Ht=Ht>=0&&Ht<=23?Ht:0;let Wt=parseInt(nt[5],10);Wt=Wt>=0&&Wt<=59?Wt:0;let Ut=parseInt(nt[6],10);Ut=Ut>=0&&Ut<=59?Ut:0;const zt=nt[7]||"Z";let Vt=parseInt(nt[8],10);Vt=Vt>=0&&Vt<=23?Vt:0;let jt=parseInt(nt[9],10)||0;return jt=jt>=0&&jt<=59?jt:0,zt==="-"?(Ht+=Vt,Wt+=jt):zt==="+"&&(Ht-=Vt,Wt-=jt),new Date(Date.UTC(ft,Tt,Ct,Ht,Wt,Ut))}}te.PDFDateString=we;function Oe(gt,{scale:tt=1,rotation:nt=0}){const{width:ft,height:Tt}=gt.attributes.style,Ct=[0,0,parseInt(ft),parseInt(Tt)];return new _e({viewBox:Ct,scale:tt,rotation:nt})}function Fe(gt){if(gt.startsWith("#")){const tt=parseInt(gt.slice(1),16);return[(tt&16711680)>>16,(tt&65280)>>8,tt&255]}return gt.startsWith("rgb(")?gt.slice(4,-1).split(",").map(tt=>parseInt(tt)):gt.startsWith("rgba(")?gt.slice(5,-1).split(",").map(tt=>parseInt(tt)).slice(0,3):((0,ie.warn)('Not a valid color format: "'.concat(gt,'"')),[0,0,0])}function Ve(gt){const tt=document.createElement("span");tt.style.visibility="hidden",document.body.append(tt);for(const nt of gt.keys()){tt.style.color=nt;const ft=window.getComputedStyle(tt).color;gt.set(nt,Fe(ft))}tt.remove()}function qe(gt){const{a:tt,b:nt,c:ft,d:Tt,e:Ct,f:Ht}=gt.getTransform();return[tt,nt,ft,Tt,Ct,Ht]}function Ie(gt){const{a:tt,b:nt,c:ft,d:Tt,e:Ct,f:Ht}=gt.getTransform().invertSelf();return[tt,nt,ft,Tt,Ct,Ht]}function Xe(gt,tt,nt=!1,ft=!0){if(tt instanceof _e){const{pageWidth:Tt,pageHeight:Ct}=tt.rawDims,{style:Ht}=gt,Wt=ie.FeatureTest.isCSSRoundSupported,Ut="var(--scale-factor) * ".concat(Tt,"px"),zt="var(--scale-factor) * ".concat(Ct,"px"),Vt=Wt?"round(".concat(Ut,", 1px)"):"calc(".concat(Ut,")"),jt=Wt?"round(".concat(zt,", 1px)"):"calc(".concat(zt,")");!nt||tt.rotation%180===0?(Ht.width=Vt,Ht.height=jt):(Ht.width=jt,Ht.height=Vt)}ft&&gt.setAttribute("data-main-rotation",tt.rotation)}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.BaseStandardFontDataFactory=te.BaseSVGFactory=te.BaseFilterFactory=te.BaseCanvasFactory=te.BaseCMapReaderFactory=void 0;var re=ne(1);class ie{constructor(){this.constructor===ie&&(0,re.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(ae){return"none"}addHCMFilter(ae,le){return"none"}addHighlightHCMFilter(ae,le,Ae,_e){return"none"}destroy(ae=!1){}}te.BaseFilterFactory=ie;class se{constructor(){this.constructor===se&&(0,re.unreachable)("Cannot initialize BaseCanvasFactory.")}create(ae,le){if(ae<=0||le<=0)throw new Error("Invalid canvas size");const Ae=this._createCanvas(ae,le);return{canvas:Ae,context:Ae.getContext("2d")}}reset(ae,le,Ae){if(!ae.canvas)throw new Error("Canvas is not specified");if(le<=0||Ae<=0)throw new Error("Invalid canvas size");ae.canvas.width=le,ae.canvas.height=Ae}destroy(ae){if(!ae.canvas)throw new Error("Canvas is not specified");ae.canvas.width=0,ae.canvas.height=0,ae.canvas=null,ae.context=null}_createCanvas(ae,le){(0,re.unreachable)("Abstract method `_createCanvas` called.")}}te.BaseCanvasFactory=se;class oe{constructor({baseUrl:ae=null,isCompressed:le=!0}){this.constructor===oe&&(0,re.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=ae,this.isCompressed=le}async fetch({name:ae}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!ae)throw new Error("CMap name must be specified.");const le=this.baseUrl+ae+(this.isCompressed?".bcmap":""),Ae=this.isCompressed?re.CMapCompressionType.BINARY:re.CMapCompressionType.NONE;return this._fetchData(le,Ae).catch(_e=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(le))})}_fetchData(ae,le){(0,re.unreachable)("Abstract method `_fetchData` called.")}}te.BaseCMapReaderFactory=oe;class he{constructor({baseUrl:ae=null}){this.constructor===he&&(0,re.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=ae}async fetch({filename:ae}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!ae)throw new Error("Font filename must be specified.");const le="".concat(this.baseUrl).concat(ae);return this._fetchData(le).catch(Ae=>{throw new Error("Unable to load font data at: ".concat(le))})}_fetchData(ae){(0,re.unreachable)("Abstract method `_fetchData` called.")}}te.BaseStandardFontDataFactory=he;class ue{constructor(){this.constructor===ue&&(0,re.unreachable)("Cannot initialize BaseSVGFactory.")}create(ae,le,Ae=!1){if(ae<=0||le<=0)throw new Error("Invalid SVG dimensions");const _e=this._createSVG("svg:svg");return _e.setAttribute("version","1.1"),Ae||(_e.setAttribute("width","".concat(ae,"px")),_e.setAttribute("height","".concat(le,"px"))),_e.setAttribute("preserveAspectRatio","none"),_e.setAttribute("viewBox","0 0 ".concat(ae," ").concat(le)),_e}createElement(ae){if(typeof ae!="string")throw new Error("Invalid SVG element type");return this._createSVG(ae)}_createSVG(ae){(0,re.unreachable)("Abstract method `_createSVG` called.")}}te.BaseSVGFactory=ue},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.MurmurHash3_64=void 0;var re=ne(1);const ie=3285377520,se=4294901760,oe=65535;class he{constructor(de){this.h1=de?de&4294967295:ie,this.h2=de?de&4294967295:ie}update(de){let ae,le;if(typeof de=="string"){ae=new Uint8Array(de.length*2),le=0;for(let Ne=0,Me=de.length;Ne<Me;Ne++){const we=de.charCodeAt(Ne);we<=255?ae[le++]=we:(ae[le++]=we>>>8,ae[le++]=we&255)}}else if((0,re.isArrayBuffer)(de))ae=de.slice(),le=ae.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const Ae=le>>2,_e=le-Ae*4,me=new Uint32Array(ae.buffer,0,Ae);let ve=0,Se=0,Te=this.h1,Pe=this.h2;const Re=3432918353,$e=461845907,ye=Re&oe,Ee=$e&oe;for(let Ne=0;Ne<Ae;Ne++)Ne&1?(ve=me[Ne],ve=ve*Re&se|ve*ye&oe,ve=ve<<15|ve>>>17,ve=ve*$e&se|ve*Ee&oe,Te^=ve,Te=Te<<13|Te>>>19,Te=Te*5+3864292196):(Se=me[Ne],Se=Se*Re&se|Se*ye&oe,Se=Se<<15|Se>>>17,Se=Se*$e&se|Se*Ee&oe,Pe^=Se,Pe=Pe<<13|Pe>>>19,Pe=Pe*5+3864292196);switch(ve=0,_e){case 3:ve^=ae[Ae*4+2]<<16;case 2:ve^=ae[Ae*4+1]<<8;case 1:ve^=ae[Ae*4],ve=ve*Re&se|ve*ye&oe,ve=ve<<15|ve>>>17,ve=ve*$e&se|ve*Ee&oe,Ae&1?Te^=ve:Pe^=ve}this.h1=Te,this.h2=Pe}hexdigest(){let de=this.h1,ae=this.h2;return de^=ae>>>1,de=de*3981806797&se|de*36045&oe,ae=ae*4283543511&se|((ae<<16|de>>>16)*2950163797&se)>>>16,de^=ae>>>1,de=de*444984403&se|de*60499&oe,ae=ae*3301882366&se|((ae<<16|de>>>16)*3120437893&se)>>>16,de^=ae>>>1,(de>>>0).toString(16).padStart(8,"0")+(ae>>>0).toString(16).padStart(8,"0")}}te.MurmurHash3_64=he},(ee,te,ne)=>{var oe;Object.defineProperty(te,"__esModule",{value:!0}),te.FontLoader=te.FontFaceObject=void 0;var re=ne(1);class ie{constructor({ownerDocument:ue=globalThis.document,styleElement:de=null}){We(this,oe,new Set);this._document=ue,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(ue){this.nativeFontFaces.add(ue),this._document.fonts.add(ue)}removeNativeFontFace(ue){this.nativeFontFaces.delete(ue),this._document.fonts.delete(ue)}insertRule(ue){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const de=this.styleElement.sheet;de.insertRule(ue,de.cssRules.length)}clear(){for(const ue of this.nativeFontFaces)this._document.fonts.delete(ue);this.nativeFontFaces.clear(),ce(this,oe).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(ue){if(!(!ue||ce(this,oe).has(ue.loadedName))){if((0,re.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:de,src:ae,style:le}=ue,Ae=new FontFace(de,ae,le);this.addNativeFontFace(Ae);try{await Ae.load(),ce(this,oe).add(de)}catch{(0,re.warn)("Cannot load system font: ".concat(ue.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(Ae)}return}(0,re.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(ue){if(ue.attached||ue.missingFile&&!ue.systemFontInfo)return;if(ue.attached=!0,ue.systemFontInfo){await this.loadSystemFont(ue.systemFontInfo);return}if(this.isFontLoadingAPISupported){const ae=ue.createNativeFontFace();if(ae){this.addNativeFontFace(ae);try{await ae.loaded}catch(le){throw(0,re.warn)("Failed to load font '".concat(ae.family,"': '").concat(le,"'.")),ue.disableFontFace=!0,le}}return}const de=ue.createFontFaceRule();if(de){if(this.insertRule(de),this.isSyncFontLoadingSupported)return;await new Promise(ae=>{const le=this._queueLoadingCallback(ae);this._prepareFontLoadEvent(ue,le)})}}get isFontLoadingAPISupported(){var de;const ue=!!((de=this._document)!=null&&de.fonts);return(0,re.shadow)(this,"isFontLoadingAPISupported",ue)}get isSyncFontLoadingSupported(){let ue=!1;return(re.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(ue=!0),(0,re.shadow)(this,"isSyncFontLoadingSupported",ue)}_queueLoadingCallback(ue){function de(){for((0,re.assert)(!le.done,"completeRequest() cannot be called twice."),le.done=!0;ae.length>0&&ae[0].done;){const Ae=ae.shift();setTimeout(Ae.callback,0)}}const{loadingRequests:ae}=this,le={done:!1,complete:de,callback:ue};return ae.push(le),le}get _loadTestFont(){const ue=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,re.shadow)(this,"_loadTestFont",ue)}_prepareFontLoadEvent(ue,de){function ae(Fe,Ve){return Fe.charCodeAt(Ve)<<24|Fe.charCodeAt(Ve+1)<<16|Fe.charCodeAt(Ve+2)<<8|Fe.charCodeAt(Ve+3)&255}function le(Fe,Ve,qe,Ie){const Xe=Fe.substring(0,Ve),rt=Fe.substring(Ve+qe);return Xe+Ie+rt}let Ae,_e;const me=this._document.createElement("canvas");me.width=1,me.height=1;const ve=me.getContext("2d");let Se=0;function Te(Fe,Ve){if(++Se>30){(0,re.warn)("Load test font never loaded."),Ve();return}if(ve.font="30px "+Fe,ve.fillText(".",0,20),ve.getImageData(0,0,1,1).data[3]>0){Ve();return}setTimeout(Te.bind(null,Fe,Ve))}const Pe="lt".concat(Date.now()).concat(this.loadTestFontId++);let Re=this._loadTestFont;Re=le(Re,976,Pe.length,Pe);const ye=16,Ee=1482184792;let Ne=ae(Re,ye);for(Ae=0,_e=Pe.length-3;Ae<_e;Ae+=4)Ne=Ne-Ee+ae(Pe,Ae)|0;Ae<Pe.length&&(Ne=Ne-Ee+ae(Pe+"XXX",Ae)|0),Re=le(Re,ye,4,(0,re.string32)(Ne));const Me="url(data:font/opentype;base64,".concat(btoa(Re),");"),we='@font-face {font-family:"'.concat(Pe,'";src:').concat(Me,"}");this.insertRule(we);const Oe=this._document.createElement("div");Oe.style.visibility="hidden",Oe.style.width=Oe.style.height="10px",Oe.style.position="absolute",Oe.style.top=Oe.style.left="0px";for(const Fe of[ue.loadedName,Pe]){const Ve=this._document.createElement("span");Ve.textContent="Hi",Ve.style.fontFamily=Fe,Oe.append(Ve)}this._document.body.append(Oe),Te(Pe,()=>{Oe.remove(),de.complete()})}}oe=new WeakMap,te.FontLoader=ie;class se{constructor(ue,{isEvalSupported:de=!0,disableFontFace:ae=!1,ignoreErrors:le=!1,inspectFont:Ae=null}){this.compiledGlyphs=Object.create(null);for(const _e in ue)this[_e]=ue[_e];this.isEvalSupported=de!==!1,this.disableFontFace=ae===!0,this.ignoreErrors=le===!0,this._inspectFont=Ae}createNativeFontFace(){var de;if(!this.data||this.disableFontFace)return null;let ue;if(!this.cssFontInfo)ue=new FontFace(this.loadedName,this.data,{});else{const ae={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(ae.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),ue=new FontFace(this.cssFontInfo.fontFamily,this.data,ae)}return(de=this._inspectFont)==null||de.call(this,this),ue}createFontFaceRule(){var le;if(!this.data||this.disableFontFace)return null;const ue=(0,re.bytesToString)(this.data),de="url(data:".concat(this.mimetype,";base64,").concat(btoa(ue),");");let ae;if(!this.cssFontInfo)ae='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(de,"}");else{let Ae="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(Ae+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),ae='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(Ae,"src:").concat(de,"}")}return(le=this._inspectFont)==null||le.call(this,this,de),ae}getPathGenerator(ue,de){if(this.compiledGlyphs[de]!==void 0)return this.compiledGlyphs[de];let ae;try{ae=ue.get(this.loadedName+"_path_"+de)}catch(le){if(!this.ignoreErrors)throw le;return(0,re.warn)('getPathGenerator - ignoring character: "'.concat(le,'".')),this.compiledGlyphs[de]=function(Ae,_e){}}if(this.isEvalSupported&&re.FeatureTest.isEvalSupported){const le=[];for(const Ae of ae){const _e=Ae.args!==void 0?Ae.args.join(","):"";le.push("c.",Ae.cmd,"(",_e,");\n")}return this.compiledGlyphs[de]=new Function("c","size",le.join(""))}return this.compiledGlyphs[de]=function(le,Ae){for(const _e of ae)_e.cmd==="scale"&&(_e.args=[Ae,-Ae]),le[_e.cmd].apply(le,_e.args)}}}te.FontFaceObject=se},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.NodeStandardFontDataFactory=te.NodeFilterFactory=te.NodeCanvasFactory=te.NodeCMapReaderFactory=void 0;var re=ne(7);ne(1);const ie=function(de){return new Promise((ae,le)=>{require$$5.readFile(de,(_e,me)=>{if(_e||!me){le(new Error(_e));return}ae(new Uint8Array(me))})})};class se extends re.BaseFilterFactory{}te.NodeFilterFactory=se;class oe extends re.BaseCanvasFactory{_createCanvas(ae,le){return require$$5.createCanvas(ae,le)}}te.NodeCanvasFactory=oe;class he extends re.BaseCMapReaderFactory{_fetchData(ae,le){return ie(ae).then(Ae=>({cMapData:Ae,compressionType:le}))}}te.NodeCMapReaderFactory=he;class ue extends re.BaseStandardFontDataFactory{_fetchData(ae){return ie(ae)}}te.NodeStandardFontDataFactory=ue},(ee,te,ne)=>{var Ge,vr,mt,wr;Object.defineProperty(te,"__esModule",{value:!0}),te.CanvasGraphics=void 0;var re=ne(1),ie=ne(6),se=ne(12),oe=ne(13);const he=16,ue=100,de=4096,ae=15,le=10,Ae=1e3,_e=16;function me(De,pe){if(De._removeMirroring)throw new Error("Context is already forwarding operations.");De.__originalSave=De.save,De.__originalRestore=De.restore,De.__originalRotate=De.rotate,De.__originalScale=De.scale,De.__originalTranslate=De.translate,De.__originalTransform=De.transform,De.__originalSetTransform=De.setTransform,De.__originalResetTransform=De.resetTransform,De.__originalClip=De.clip,De.__originalMoveTo=De.moveTo,De.__originalLineTo=De.lineTo,De.__originalBezierCurveTo=De.bezierCurveTo,De.__originalRect=De.rect,De.__originalClosePath=De.closePath,De.__originalBeginPath=De.beginPath,De._removeMirroring=()=>{De.save=De.__originalSave,De.restore=De.__originalRestore,De.rotate=De.__originalRotate,De.scale=De.__originalScale,De.translate=De.__originalTranslate,De.transform=De.__originalTransform,De.setTransform=De.__originalSetTransform,De.resetTransform=De.__originalResetTransform,De.clip=De.__originalClip,De.moveTo=De.__originalMoveTo,De.lineTo=De.__originalLineTo,De.bezierCurveTo=De.__originalBezierCurveTo,De.rect=De.__originalRect,De.closePath=De.__originalClosePath,De.beginPath=De.__originalBeginPath,delete De._removeMirroring},De.save=function(){pe.save(),this.__originalSave()},De.restore=function(){pe.restore(),this.__originalRestore()},De.translate=function(ge,Ce){pe.translate(ge,Ce),this.__originalTranslate(ge,Ce)},De.scale=function(ge,Ce){pe.scale(ge,Ce),this.__originalScale(ge,Ce)},De.transform=function(ge,Ce,xe,Le,Be,He){pe.transform(ge,Ce,xe,Le,Be,He),this.__originalTransform(ge,Ce,xe,Le,Be,He)},De.setTransform=function(ge,Ce,xe,Le,Be,He){pe.setTransform(ge,Ce,xe,Le,Be,He),this.__originalSetTransform(ge,Ce,xe,Le,Be,He)},De.resetTransform=function(){pe.resetTransform(),this.__originalResetTransform()},De.rotate=function(ge){pe.rotate(ge),this.__originalRotate(ge)},De.clip=function(ge){pe.clip(ge),this.__originalClip(ge)},De.moveTo=function(be,ge){pe.moveTo(be,ge),this.__originalMoveTo(be,ge)},De.lineTo=function(be,ge){pe.lineTo(be,ge),this.__originalLineTo(be,ge)},De.bezierCurveTo=function(be,ge,Ce,xe,Le,Be){pe.bezierCurveTo(be,ge,Ce,xe,Le,Be),this.__originalBezierCurveTo(be,ge,Ce,xe,Le,Be)},De.rect=function(be,ge,Ce,xe){pe.rect(be,ge,Ce,xe),this.__originalRect(be,ge,Ce,xe)},De.closePath=function(){pe.closePath(),this.__originalClosePath()},De.beginPath=function(){pe.beginPath(),this.__originalBeginPath()}}class ve{constructor(pe){this.canvasFactory=pe,this.cache=Object.create(null)}getCanvas(pe,be,ge){let Ce;return this.cache[pe]!==void 0?(Ce=this.cache[pe],this.canvasFactory.reset(Ce,be,ge)):(Ce=this.canvasFactory.create(be,ge),this.cache[pe]=Ce),Ce}delete(pe){delete this.cache[pe]}clear(){for(const pe in this.cache){const be=this.cache[pe];this.canvasFactory.destroy(be),delete this.cache[pe]}}}function Se(De,pe,be,ge,Ce,xe,Le,Be,He,it){const[et,ot,ht,pt,ct,Pt]=(0,ie.getCurrentTransform)(De);if(ot===0&&ht===0){const kt=Le*et+ct,gt=Math.round(kt),tt=Be*pt+Pt,nt=Math.round(tt),ft=(Le+He)*et+ct,Tt=Math.abs(Math.round(ft)-gt)||1,Ct=(Be+it)*pt+Pt,Ht=Math.abs(Math.round(Ct)-nt)||1;return De.setTransform(Math.sign(et),0,0,Math.sign(pt),gt,nt),De.drawImage(pe,be,ge,Ce,xe,0,0,Tt,Ht),De.setTransform(et,ot,ht,pt,ct,Pt),[Tt,Ht]}if(et===0&&pt===0){const kt=Be*ht+ct,gt=Math.round(kt),tt=Le*ot+Pt,nt=Math.round(tt),ft=(Be+it)*ht+ct,Tt=Math.abs(Math.round(ft)-gt)||1,Ct=(Le+He)*ot+Pt,Ht=Math.abs(Math.round(Ct)-nt)||1;return De.setTransform(0,Math.sign(ot),Math.sign(ht),0,gt,nt),De.drawImage(pe,be,ge,Ce,xe,0,0,Ht,Tt),De.setTransform(et,ot,ht,pt,ct,Pt),[Ht,Tt]}De.drawImage(pe,be,ge,Ce,xe,Le,Be,He,it);const It=Math.hypot(et,ot),vt=Math.hypot(ht,pt);return[It*He,vt*it]}function Te(De){const{width:pe,height:be}=De;if(pe>Ae||be>Ae)return null;const ge=1e3,Ce=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),xe=pe+1;let Le=new Uint8Array(xe*(be+1)),Be,He,it;const et=pe+7&-8;let ot=new Uint8Array(et*be),ht=0;for(const vt of De.data){let kt=128;for(;kt>0;)ot[ht++]=vt&kt?0:255,kt>>=1}let pt=0;for(ht=0,ot[ht]!==0&&(Le[0]=1,++pt),He=1;He<pe;He++)ot[ht]!==ot[ht+1]&&(Le[He]=ot[ht]?2:1,++pt),ht++;for(ot[ht]!==0&&(Le[He]=2,++pt),Be=1;Be<be;Be++){ht=Be*et,it=Be*xe,ot[ht-et]!==ot[ht]&&(Le[it]=ot[ht]?1:8,++pt);let vt=(ot[ht]?4:0)+(ot[ht-et]?8:0);for(He=1;He<pe;He++)vt=(vt>>2)+(ot[ht+1]?4:0)+(ot[ht-et+1]?8:0),Ce[vt]&&(Le[it+He]=Ce[vt],++pt),ht++;if(ot[ht-et]!==ot[ht]&&(Le[it+He]=ot[ht]?2:4,++pt),pt>ge)return null}for(ht=et*(be-1),it=Be*xe,ot[ht]!==0&&(Le[it]=8,++pt),He=1;He<pe;He++)ot[ht]!==ot[ht+1]&&(Le[it+He]=ot[ht]?4:8,++pt),ht++;if(ot[ht]!==0&&(Le[it+He]=4,++pt),pt>ge)return null;const ct=new Int32Array([0,xe,-1,0,-xe,0,0,0,1]),Pt=new Path2D;for(Be=0;pt&&Be<=be;Be++){let vt=Be*xe;const kt=vt+pe;for(;vt<kt&&!Le[vt];)vt++;if(vt===kt)continue;Pt.moveTo(vt%xe,Be);const gt=vt;let tt=Le[vt];do{const nt=ct[tt];do vt+=nt;while(!Le[vt]);const ft=Le[vt];ft!==5&&ft!==10?(tt=ft,Le[vt]=0):(tt=ft&51*tt>>4,Le[vt]&=tt>>2|tt<<2),Pt.lineTo(vt%xe,vt/xe|0),Le[vt]||--pt}while(gt!==vt);--Be}return ot=null,Le=null,function(vt){vt.save(),vt.scale(1/pe,-1/be),vt.translate(0,-be),vt.fill(Pt),vt.beginPath(),vt.restore()}}class Pe{constructor(pe,be){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=re.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=re.FONT_IDENTITY_MATRIX,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=re.TextRenderingMode.FILL,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,pe,be])}clone(){const pe=Object.create(this);return pe.clipBox=this.clipBox.slice(),pe}setCurrentPoint(pe,be){this.x=pe,this.y=be}updatePathMinMax(pe,be,ge){[be,ge]=re.Util.applyTransform([be,ge],pe),this.minX=Math.min(this.minX,be),this.minY=Math.min(this.minY,ge),this.maxX=Math.max(this.maxX,be),this.maxY=Math.max(this.maxY,ge)}updateRectMinMax(pe,be){const ge=re.Util.applyTransform(be,pe),Ce=re.Util.applyTransform(be.slice(2),pe);this.minX=Math.min(this.minX,ge[0],Ce[0]),this.minY=Math.min(this.minY,ge[1],Ce[1]),this.maxX=Math.max(this.maxX,ge[0],Ce[0]),this.maxY=Math.max(this.maxY,ge[1],Ce[1])}updateScalingPathMinMax(pe,be){re.Util.scaleMinMax(pe,be),this.minX=Math.min(this.minX,be[0]),this.maxX=Math.max(this.maxX,be[1]),this.minY=Math.min(this.minY,be[2]),this.maxY=Math.max(this.maxY,be[3])}updateCurvePathMinMax(pe,be,ge,Ce,xe,Le,Be,He,it,et){const ot=re.Util.bezierBoundingBox(be,ge,Ce,xe,Le,Be,He,it);if(et){et[0]=Math.min(et[0],ot[0],ot[2]),et[1]=Math.max(et[1],ot[0],ot[2]),et[2]=Math.min(et[2],ot[1],ot[3]),et[3]=Math.max(et[3],ot[1],ot[3]);return}this.updateRectMinMax(pe,ot)}getPathBoundingBox(pe=se.PathType.FILL,be=null){const ge=[this.minX,this.minY,this.maxX,this.maxY];if(pe===se.PathType.STROKE){be||(0,re.unreachable)("Stroke bounding box must include transform.");const Ce=re.Util.singularValueDecompose2dScale(be),xe=Ce[0]*this.lineWidth/2,Le=Ce[1]*this.lineWidth/2;ge[0]-=xe,ge[1]-=Le,ge[2]+=xe,ge[3]+=Le}return ge}updateClipFromPath(){const pe=re.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(pe||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(pe){this.clipBox=pe,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(pe=se.PathType.FILL,be=null){return re.Util.intersect(this.clipBox,this.getPathBoundingBox(pe,be))}}function Re(De,pe){if(typeof ImageData<"u"&&pe instanceof ImageData){De.putImageData(pe,0,0);return}const be=pe.height,ge=pe.width,Ce=be%_e,xe=(be-Ce)/_e,Le=Ce===0?xe:xe+1,Be=De.createImageData(ge,_e);let He=0,it;const et=pe.data,ot=Be.data;let ht,pt,ct,Pt;if(pe.kind===re.ImageKind.GRAYSCALE_1BPP){const It=et.byteLength,vt=new Uint32Array(ot.buffer,0,ot.byteLength>>2),kt=vt.length,gt=ge+7>>3,tt=4294967295,nt=re.FeatureTest.isLittleEndian?4278190080:255;for(ht=0;ht<Le;ht++){for(ct=ht<xe?_e:Ce,it=0,pt=0;pt<ct;pt++){const ft=It-He;let Tt=0;const Ct=ft>gt?ge:ft*8-7,Ht=Ct&-8;let Wt=0,Ut=0;for(;Tt<Ht;Tt+=8)Ut=et[He++],vt[it++]=Ut&128?tt:nt,vt[it++]=Ut&64?tt:nt,vt[it++]=Ut&32?tt:nt,vt[it++]=Ut&16?tt:nt,vt[it++]=Ut&8?tt:nt,vt[it++]=Ut&4?tt:nt,vt[it++]=Ut&2?tt:nt,vt[it++]=Ut&1?tt:nt;for(;Tt<Ct;Tt++)Wt===0&&(Ut=et[He++],Wt=128),vt[it++]=Ut&Wt?tt:nt,Wt>>=1}for(;it<kt;)vt[it++]=0;De.putImageData(Be,0,ht*_e)}}else if(pe.kind===re.ImageKind.RGBA_32BPP){for(pt=0,Pt=ge*_e*4,ht=0;ht<xe;ht++)ot.set(et.subarray(He,He+Pt)),He+=Pt,De.putImageData(Be,0,pt),pt+=_e;ht<Le&&(Pt=ge*Ce*4,ot.set(et.subarray(He,He+Pt)),De.putImageData(Be,0,pt))}else if(pe.kind===re.ImageKind.RGB_24BPP)for(ct=_e,Pt=ge*ct,ht=0;ht<Le;ht++){for(ht>=xe&&(ct=Ce,Pt=ge*ct),it=0,pt=Pt;pt--;)ot[it++]=et[He++],ot[it++]=et[He++],ot[it++]=et[He++],ot[it++]=255;De.putImageData(Be,0,ht*_e)}else throw new Error("bad image kind: ".concat(pe.kind))}function $e(De,pe){if(pe.bitmap){De.drawImage(pe.bitmap,0,0);return}const be=pe.height,ge=pe.width,Ce=be%_e,xe=(be-Ce)/_e,Le=Ce===0?xe:xe+1,Be=De.createImageData(ge,_e);let He=0;const it=pe.data,et=Be.data;for(let ot=0;ot<Le;ot++){const ht=ot<xe?_e:Ce;({srcPos:He}=(0,oe.convertBlackAndWhiteToRGBA)({src:it,srcPos:He,dest:et,width:ge,height:ht,nonBlackColor:0})),De.putImageData(Be,0,ot*_e)}}function ye(De,pe){const be=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const ge of be)De[ge]!==void 0&&(pe[ge]=De[ge]);De.setLineDash!==void 0&&(pe.setLineDash(De.getLineDash()),pe.lineDashOffset=De.lineDashOffset)}function Ee(De){if(De.strokeStyle=De.fillStyle="#000000",De.fillRule="nonzero",De.globalAlpha=1,De.lineWidth=1,De.lineCap="butt",De.lineJoin="miter",De.miterLimit=10,De.globalCompositeOperation="source-over",De.font="10px sans-serif",De.setLineDash!==void 0&&(De.setLineDash([]),De.lineDashOffset=0),!re.isNodeJS){const{filter:pe}=De;pe!=="none"&&pe!==""&&(De.filter="none")}}function Ne(De,pe,be,ge){const Ce=De.length;for(let xe=3;xe<Ce;xe+=4){const Le=De[xe];if(Le===0)De[xe-3]=pe,De[xe-2]=be,De[xe-1]=ge;else if(Le<255){const Be=255-Le;De[xe-3]=De[xe-3]*Le+pe*Be>>8,De[xe-2]=De[xe-2]*Le+be*Be>>8,De[xe-1]=De[xe-1]*Le+ge*Be>>8}}}function Me(De,pe,be){const ge=De.length,Ce=1/255;for(let xe=3;xe<ge;xe+=4){const Le=be?be[De[xe]]:De[xe];pe[xe]=pe[xe]*Le*Ce|0}}function we(De,pe,be){const ge=De.length;for(let Ce=3;Ce<ge;Ce+=4){const xe=De[Ce-3]*77+De[Ce-2]*152+De[Ce-1]*28;pe[Ce]=be?pe[Ce]*be[xe>>8]>>8:pe[Ce]*xe>>16}}function Oe(De,pe,be,ge,Ce,xe,Le,Be,He,it,et){const ot=!!xe,ht=ot?xe[0]:0,pt=ot?xe[1]:0,ct=ot?xe[2]:0,Pt=Ce==="Luminosity"?we:Me,vt=Math.min(ge,Math.ceil(1048576/be));for(let kt=0;kt<ge;kt+=vt){const gt=Math.min(vt,ge-kt),tt=De.getImageData(Be-it,kt+(He-et),be,gt),nt=pe.getImageData(Be,kt+He,be,gt);ot&&Ne(tt.data,ht,pt,ct),Pt(tt.data,nt.data,Le),pe.putImageData(nt,Be,kt+He)}}function Fe(De,pe,be,ge){const Ce=ge[0],xe=ge[1],Le=ge[2]-Ce,Be=ge[3]-xe;Le===0||Be===0||(Oe(pe.context,be,Le,Be,pe.subtype,pe.backdrop,pe.transferMap,Ce,xe,pe.offsetX,pe.offsetY),De.save(),De.globalAlpha=1,De.globalCompositeOperation="source-over",De.setTransform(1,0,0,1,0,0),De.drawImage(be.canvas,0,0),De.restore())}function Ve(De,pe){const be=re.Util.singularValueDecompose2dScale(De);be[0]=Math.fround(be[0]),be[1]=Math.fround(be[1]);const ge=Math.fround((globalThis.devicePixelRatio||1)*ie.PixelsPerInch.PDF_TO_CSS_UNITS);return pe!==void 0?pe:be[0]<=ge||be[1]<=ge}const qe=["butt","round","square"],Ie=["miter","round","bevel"],Xe={},rt={},Et=class Et{constructor(pe,be,ge,Ce,xe,{optionalContentConfig:Le,markedContentStack:Be=null},He,it){We(this,Ge);We(this,mt);this.ctx=pe,this.current=new Pe(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=be,this.objs=ge,this.canvasFactory=Ce,this.filterFactory=xe,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=Be||[],this.optionalContentConfig=Le,this.cachedCanvases=new ve(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=He,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=it,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(pe,be=null){return typeof pe=="string"?pe.startsWith("g_")?this.commonObjs.get(pe):this.objs.get(pe):be}beginDrawing({transform:pe,viewport:be,transparency:ge=!1,background:Ce=null}){const xe=this.ctx.canvas.width,Le=this.ctx.canvas.height,Be=this.ctx.fillStyle;if(this.ctx.fillStyle=Ce||"#ffffff",this.ctx.fillRect(0,0,xe,Le),this.ctx.fillStyle=Be,ge){const He=this.cachedCanvases.getCanvas("transparent",xe,Le);this.compositeCtx=this.ctx,this.transparentCanvas=He.canvas,this.ctx=He.context,this.ctx.save(),this.ctx.transform(...(0,ie.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),Ee(this.ctx),pe&&(this.ctx.transform(...pe),this.outputScaleX=pe[0],this.outputScaleY=pe[0]),this.ctx.transform(...be.transform),this.viewportScale=be.scale,this.baseTransform=(0,ie.getCurrentTransform)(this.ctx)}executeOperatorList(pe,be,ge,Ce){const xe=pe.argsArray,Le=pe.fnArray;let Be=be||0;const He=xe.length;if(He===Be)return Be;const it=He-Be>le&&typeof ge=="function",et=it?Date.now()+ae:0;let ot=0;const ht=this.commonObjs,pt=this.objs;let ct;for(;;){if(Ce!==void 0&&Be===Ce.nextBreakPoint)return Ce.breakIt(Be,ge),Be;if(ct=Le[Be],ct!==re.OPS.dependency)this[ct].apply(this,xe[Be]);else for(const Pt of xe[Be]){const It=Pt.startsWith("g_")?ht:pt;if(!It.has(Pt))return It.get(Pt,ge),Be}if(Be++,Be===He)return Be;if(it&&++ot>le){if(Date.now()>et)return ge(),Be;ot=0}}}endDrawing(){Ke(this,Ge,vr).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const pe of this._cachedBitmapsMap.values()){for(const be of pe.values())typeof HTMLCanvasElement<"u"&&be instanceof HTMLCanvasElement&&(be.width=be.height=0);pe.clear()}this._cachedBitmapsMap.clear(),Ke(this,mt,wr).call(this)}_scaleImage(pe,be){const ge=pe.width,Ce=pe.height;let xe=Math.max(Math.hypot(be[0],be[1]),1),Le=Math.max(Math.hypot(be[2],be[3]),1),Be=ge,He=Ce,it="prescale1",et,ot;for(;xe>2&&Be>1||Le>2&&He>1;){let ht=Be,pt=He;xe>2&&Be>1&&(ht=Be>=16384?Math.floor(Be/2)-1||1:Math.ceil(Be/2),xe/=Be/ht),Le>2&&He>1&&(pt=He>=16384?Math.floor(He/2)-1||1:Math.ceil(He)/2,Le/=He/pt),et=this.cachedCanvases.getCanvas(it,ht,pt),ot=et.context,ot.clearRect(0,0,ht,pt),ot.drawImage(pe,0,0,Be,He,0,0,ht,pt),pe=et.canvas,Be=ht,He=pt,it=it==="prescale1"?"prescale2":"prescale1"}return{img:pe,paintWidth:Be,paintHeight:He}}_createMaskCanvas(pe){const be=this.ctx,{width:ge,height:Ce}=pe,xe=this.current.fillColor,Le=this.current.patternFill,Be=(0,ie.getCurrentTransform)(be);let He,it,et,ot;if((pe.bitmap||pe.data)&&pe.count>1){const Tt=pe.bitmap||pe.data.buffer;it=JSON.stringify(Le?Be:[Be.slice(0,4),xe]),He=this._cachedBitmapsMap.get(Tt),He||(He=new Map,this._cachedBitmapsMap.set(Tt,He));const Ct=He.get(it);if(Ct&&!Le){const Ht=Math.round(Math.min(Be[0],Be[2])+Be[4]),Wt=Math.round(Math.min(Be[1],Be[3])+Be[5]);return{canvas:Ct,offsetX:Ht,offsetY:Wt}}et=Ct}et||(ot=this.cachedCanvases.getCanvas("maskCanvas",ge,Ce),$e(ot.context,pe));let ht=re.Util.transform(Be,[1/ge,0,0,-1/Ce,0,0]);ht=re.Util.transform(ht,[1,0,0,1,0,-Ce]);const pt=re.Util.applyTransform([0,0],ht),ct=re.Util.applyTransform([ge,Ce],ht),Pt=re.Util.normalizeRect([pt[0],pt[1],ct[0],ct[1]]),It=Math.round(Pt[2]-Pt[0])||1,vt=Math.round(Pt[3]-Pt[1])||1,kt=this.cachedCanvases.getCanvas("fillCanvas",It,vt),gt=kt.context,tt=Math.min(pt[0],ct[0]),nt=Math.min(pt[1],ct[1]);gt.translate(-tt,-nt),gt.transform(...ht),et||(et=this._scaleImage(ot.canvas,(0,ie.getCurrentTransformInverse)(gt)),et=et.img,He&&Le&&He.set(it,et)),gt.imageSmoothingEnabled=Ve((0,ie.getCurrentTransform)(gt),pe.interpolate),Se(gt,et,0,0,et.width,et.height,0,0,ge,Ce),gt.globalCompositeOperation="source-in";const ft=re.Util.transform((0,ie.getCurrentTransformInverse)(gt),[1,0,0,1,-tt,-nt]);return gt.fillStyle=Le?xe.getPattern(be,this,ft,se.PathType.FILL):xe,gt.fillRect(0,0,ge,Ce),He&&!Le&&(this.cachedCanvases.delete("fillCanvas"),He.set(it,kt.canvas)),{canvas:kt.canvas,offsetX:Math.round(tt),offsetY:Math.round(nt)}}setLineWidth(pe){pe!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=pe,this.ctx.lineWidth=pe}setLineCap(pe){this.ctx.lineCap=qe[pe]}setLineJoin(pe){this.ctx.lineJoin=Ie[pe]}setMiterLimit(pe){this.ctx.miterLimit=pe}setDash(pe,be){const ge=this.ctx;ge.setLineDash!==void 0&&(ge.setLineDash(pe),ge.lineDashOffset=be)}setRenderingIntent(pe){}setFlatness(pe){}setGState(pe){for(const[be,ge]of pe)switch(be){case"LW":this.setLineWidth(ge);break;case"LC":this.setLineCap(ge);break;case"LJ":this.setLineJoin(ge);break;case"ML":this.setMiterLimit(ge);break;case"D":this.setDash(ge[0],ge[1]);break;case"RI":this.setRenderingIntent(ge);break;case"FL":this.setFlatness(ge);break;case"Font":this.setFont(ge[0],ge[1]);break;case"CA":this.current.strokeAlpha=ge;break;case"ca":this.current.fillAlpha=ge,this.ctx.globalAlpha=ge;break;case"BM":this.ctx.globalCompositeOperation=ge;break;case"SMask":this.current.activeSMask=ge?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(ge);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const pe=this.inSMaskMode;this.current.activeSMask&&!pe?this.beginSMaskMode():!this.current.activeSMask&&pe&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const pe=this.ctx.canvas.width,be=this.ctx.canvas.height,ge="smaskGroupAt"+this.groupLevel,Ce=this.cachedCanvases.getCanvas(ge,pe,be);this.suspendedCtx=this.ctx,this.ctx=Ce.context;const xe=this.ctx;xe.setTransform(...(0,ie.getCurrentTransform)(this.suspendedCtx)),ye(this.suspendedCtx,xe),me(xe,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(),ye(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(pe){if(!this.current.activeSMask)return;pe?(pe[0]=Math.floor(pe[0]),pe[1]=Math.floor(pe[1]),pe[2]=Math.ceil(pe[2]),pe[3]=Math.ceil(pe[3])):pe=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const be=this.current.activeSMask,ge=this.suspendedCtx;Fe(ge,be,this.ctx,pe),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()}save(){this.inSMaskMode?(ye(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const pe=this.current;this.stateStack.push(pe),this.current=pe.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),ye(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(pe,be,ge,Ce,xe,Le){this.ctx.transform(pe,be,ge,Ce,xe,Le),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(pe,be,ge){const Ce=this.ctx,xe=this.current;let Le=xe.x,Be=xe.y,He,it;const et=(0,ie.getCurrentTransform)(Ce),ot=et[0]===0&&et[3]===0||et[1]===0&&et[2]===0,ht=ot?ge.slice(0):null;for(let pt=0,ct=0,Pt=pe.length;pt<Pt;pt++)switch(pe[pt]|0){case re.OPS.rectangle:Le=be[ct++],Be=be[ct++];const It=be[ct++],vt=be[ct++],kt=Le+It,gt=Be+vt;Ce.moveTo(Le,Be),It===0||vt===0?Ce.lineTo(kt,gt):(Ce.lineTo(kt,Be),Ce.lineTo(kt,gt),Ce.lineTo(Le,gt)),ot||xe.updateRectMinMax(et,[Le,Be,kt,gt]),Ce.closePath();break;case re.OPS.moveTo:Le=be[ct++],Be=be[ct++],Ce.moveTo(Le,Be),ot||xe.updatePathMinMax(et,Le,Be);break;case re.OPS.lineTo:Le=be[ct++],Be=be[ct++],Ce.lineTo(Le,Be),ot||xe.updatePathMinMax(et,Le,Be);break;case re.OPS.curveTo:He=Le,it=Be,Le=be[ct+4],Be=be[ct+5],Ce.bezierCurveTo(be[ct],be[ct+1],be[ct+2],be[ct+3],Le,Be),xe.updateCurvePathMinMax(et,He,it,be[ct],be[ct+1],be[ct+2],be[ct+3],Le,Be,ht),ct+=6;break;case re.OPS.curveTo2:He=Le,it=Be,Ce.bezierCurveTo(Le,Be,be[ct],be[ct+1],be[ct+2],be[ct+3]),xe.updateCurvePathMinMax(et,He,it,Le,Be,be[ct],be[ct+1],be[ct+2],be[ct+3],ht),Le=be[ct+2],Be=be[ct+3],ct+=4;break;case re.OPS.curveTo3:He=Le,it=Be,Le=be[ct+2],Be=be[ct+3],Ce.bezierCurveTo(be[ct],be[ct+1],Le,Be,Le,Be),xe.updateCurvePathMinMax(et,He,it,be[ct],be[ct+1],Le,Be,Le,Be,ht),ct+=4;break;case re.OPS.closePath:Ce.closePath();break}ot&&xe.updateScalingPathMinMax(et,ht),xe.setCurrentPoint(Le,Be)}closePath(){this.ctx.closePath()}stroke(pe=!0){const be=this.ctx,ge=this.current.strokeColor;be.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof ge=="object"&&(ge!=null&&ge.getPattern)?(be.save(),be.strokeStyle=ge.getPattern(be,this,(0,ie.getCurrentTransformInverse)(be),se.PathType.STROKE),this.rescaleAndStroke(!1),be.restore()):this.rescaleAndStroke(!0)),pe&&this.consumePath(this.current.getClippedPathBoundingBox()),be.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(pe=!0){const be=this.ctx,ge=this.current.fillColor,Ce=this.current.patternFill;let xe=!1;Ce&&(be.save(),be.fillStyle=ge.getPattern(be,this,(0,ie.getCurrentTransformInverse)(be),se.PathType.FILL),xe=!0);const Le=this.current.getClippedPathBoundingBox();this.contentVisible&&Le!==null&&(this.pendingEOFill?(be.fill("evenodd"),this.pendingEOFill=!1):be.fill()),xe&&be.restore(),pe&&this.consumePath(Le)}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=Xe}eoClip(){this.pendingClip=rt}beginText(){this.current.textMatrix=re.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const pe=this.pendingTextPaths,be=this.ctx;if(pe===void 0){be.beginPath();return}be.save(),be.beginPath();for(const ge of pe)be.setTransform(...ge.transform),be.translate(ge.x,ge.y),ge.addToPath(be,ge.fontSize);be.restore(),be.clip(),be.beginPath(),delete this.pendingTextPaths}setCharSpacing(pe){this.current.charSpacing=pe}setWordSpacing(pe){this.current.wordSpacing=pe}setHScale(pe){this.current.textHScale=pe/100}setLeading(pe){this.current.leading=-pe}setFont(pe,be){var et;const ge=this.commonObjs.get(pe),Ce=this.current;if(!ge)throw new Error("Can't find font for ".concat(pe));if(Ce.fontMatrix=ge.fontMatrix||re.FONT_IDENTITY_MATRIX,(Ce.fontMatrix[0]===0||Ce.fontMatrix[3]===0)&&(0,re.warn)("Invalid font matrix for font "+pe),be<0?(be=-be,Ce.fontDirection=-1):Ce.fontDirection=1,this.current.font=ge,this.current.fontSize=be,ge.isType3Font)return;const xe=ge.loadedName||"sans-serif",Le=((et=ge.systemFontInfo)==null?void 0:et.css)||'"'.concat(xe,'", ').concat(ge.fallbackName);let Be="normal";ge.black?Be="900":ge.bold&&(Be="bold");const He=ge.italic?"italic":"normal";let it=be;be<he?it=he:be>ue&&(it=ue),this.current.fontSizeScale=be/it,this.ctx.font="".concat(He," ").concat(Be," ").concat(it,"px ").concat(Le)}setTextRenderingMode(pe){this.current.textRenderingMode=pe}setTextRise(pe){this.current.textRise=pe}moveText(pe,be){this.current.x=this.current.lineX+=pe,this.current.y=this.current.lineY+=be}setLeadingMoveText(pe,be){this.setLeading(-be),this.moveText(pe,be)}setTextMatrix(pe,be,ge,Ce,xe,Le){this.current.textMatrix=[pe,be,ge,Ce,xe,Le],this.current.textMatrixScale=Math.hypot(pe,be),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(pe,be,ge,Ce){const xe=this.ctx,Le=this.current,Be=Le.font,He=Le.textRenderingMode,it=Le.fontSize/Le.fontSizeScale,et=He&re.TextRenderingMode.FILL_STROKE_MASK,ot=!!(He&re.TextRenderingMode.ADD_TO_PATH_FLAG),ht=Le.patternFill&&!Be.missingFile;let pt;(Be.disableFontFace||ot||ht)&&(pt=Be.getPathGenerator(this.commonObjs,pe)),Be.disableFontFace||ht?(xe.save(),xe.translate(be,ge),xe.beginPath(),pt(xe,it),Ce&&xe.setTransform(...Ce),(et===re.TextRenderingMode.FILL||et===re.TextRenderingMode.FILL_STROKE)&&xe.fill(),(et===re.TextRenderingMode.STROKE||et===re.TextRenderingMode.FILL_STROKE)&&xe.stroke(),xe.restore()):((et===re.TextRenderingMode.FILL||et===re.TextRenderingMode.FILL_STROKE)&&xe.fillText(pe,be,ge),(et===re.TextRenderingMode.STROKE||et===re.TextRenderingMode.FILL_STROKE)&&xe.strokeText(pe,be,ge)),ot&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,ie.getCurrentTransform)(xe),x:be,y:ge,fontSize:it,addToPath:pt})}get isFontSubpixelAAEnabled(){const{context:pe}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);pe.scale(1.5,1),pe.fillText("I",0,10);const be=pe.getImageData(0,0,10,10).data;let ge=!1;for(let Ce=3;Ce<be.length;Ce+=4)if(be[Ce]>0&&be[Ce]<255){ge=!0;break}return(0,re.shadow)(this,"isFontSubpixelAAEnabled",ge)}showText(pe){const be=this.current,ge=be.font;if(ge.isType3Font)return this.showType3Text(pe);const Ce=be.fontSize;if(Ce===0)return;const xe=this.ctx,Le=be.fontSizeScale,Be=be.charSpacing,He=be.wordSpacing,it=be.fontDirection,et=be.textHScale*it,ot=pe.length,ht=ge.vertical,pt=ht?1:-1,ct=ge.defaultVMetrics,Pt=Ce*be.fontMatrix[0],It=be.textRenderingMode===re.TextRenderingMode.FILL&&!ge.disableFontFace&&!be.patternFill;xe.save(),xe.transform(...be.textMatrix),xe.translate(be.x,be.y+be.textRise),it>0?xe.scale(et,-1):xe.scale(et,1);let vt;if(be.patternFill){xe.save();const ft=be.fillColor.getPattern(xe,this,(0,ie.getCurrentTransformInverse)(xe),se.PathType.FILL);vt=(0,ie.getCurrentTransform)(xe),xe.restore(),xe.fillStyle=ft}let kt=be.lineWidth;const gt=be.textMatrixScale;if(gt===0||kt===0){const ft=be.textRenderingMode&re.TextRenderingMode.FILL_STROKE_MASK;(ft===re.TextRenderingMode.STROKE||ft===re.TextRenderingMode.FILL_STROKE)&&(kt=this.getSinglePixelWidth())}else kt/=gt;if(Le!==1&&(xe.scale(Le,Le),kt/=Le),xe.lineWidth=kt,ge.isInvalidPDFjsFont){const ft=[];let Tt=0;for(const Ct of pe)ft.push(Ct.unicode),Tt+=Ct.width;xe.fillText(ft.join(""),0,0),be.x+=Tt*Pt*et,xe.restore(),this.compose();return}let tt=0,nt;for(nt=0;nt<ot;++nt){const ft=pe[nt];if(typeof ft=="number"){tt+=pt*ft*Ce/1e3;continue}let Tt=!1;const Ct=(ft.isSpace?He:0)+Be,Ht=ft.fontChar,Wt=ft.accent;let Ut,zt,Vt=ft.width;if(ht){const Gt=ft.vmetric||ct,dt=-(ft.vmetric?Gt[1]:Vt*.5)*Pt,Qe=Gt[2]*Pt;Vt=Gt?-Gt[0]:Vt,Ut=dt/Le,zt=(tt+Qe)/Le}else Ut=tt/Le,zt=0;if(ge.remeasure&&Vt>0){const Gt=xe.measureText(Ht).width*1e3/Ce*Le;if(Vt<Gt&&this.isFontSubpixelAAEnabled){const dt=Vt/Gt;Tt=!0,xe.save(),xe.scale(dt,1),Ut/=dt}else Vt!==Gt&&(Ut+=(Vt-Gt)/2e3*Ce/Le)}if(this.contentVisible&&(ft.isInFont||ge.missingFile)){if(It&&!Wt)xe.fillText(Ht,Ut,zt);else if(this.paintChar(Ht,Ut,zt,vt),Wt){const Gt=Ut+Ce*Wt.offset.x/Le,dt=zt-Ce*Wt.offset.y/Le;this.paintChar(Wt.fontChar,Gt,dt,vt)}}const jt=ht?Vt*Pt-Ct*it:Vt*Pt+Ct*it;tt+=jt,Tt&&xe.restore()}ht?be.y-=tt:be.x+=tt*et,xe.restore(),this.compose()}showType3Text(pe){const be=this.ctx,ge=this.current,Ce=ge.font,xe=ge.fontSize,Le=ge.fontDirection,Be=Ce.vertical?1:-1,He=ge.charSpacing,it=ge.wordSpacing,et=ge.textHScale*Le,ot=ge.fontMatrix||re.FONT_IDENTITY_MATRIX,ht=pe.length,pt=ge.textRenderingMode===re.TextRenderingMode.INVISIBLE;let ct,Pt,It,vt;if(!(pt||xe===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,be.save(),be.transform(...ge.textMatrix),be.translate(ge.x,ge.y),be.scale(et,Le),ct=0;ct<ht;++ct){if(Pt=pe[ct],typeof Pt=="number"){vt=Be*Pt*xe/1e3,this.ctx.translate(vt,0),ge.x+=vt*et;continue}const kt=(Pt.isSpace?it:0)+He,gt=Ce.charProcOperatorList[Pt.operatorListId];if(!gt){(0,re.warn)('Type3 character "'.concat(Pt.operatorListId,'" is not available.'));continue}this.contentVisible&&(this.processingType3=Pt,this.save(),be.scale(xe,xe),be.transform(...ot),this.executeOperatorList(gt),this.restore()),It=re.Util.applyTransform([Pt.width,0],ot)[0]*xe+kt,be.translate(It,0),ge.x+=It*et}be.restore(),this.processingType3=null}}setCharWidth(pe,be){}setCharWidthAndBounds(pe,be,ge,Ce,xe,Le){this.ctx.rect(ge,Ce,xe-ge,Le-Ce),this.ctx.clip(),this.endPath()}getColorN_Pattern(pe){let be;if(pe[0]==="TilingPattern"){const ge=pe[1],Ce=this.baseTransform||(0,ie.getCurrentTransform)(this.ctx),xe={createCanvasGraphics:Le=>new Et(Le,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};be=new se.TilingPattern(pe,ge,this.ctx,xe,Ce)}else be=this._getPattern(pe[1],pe[2]);return be}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(pe,be,ge){const Ce=re.Util.makeHexColor(pe,be,ge);this.ctx.strokeStyle=Ce,this.current.strokeColor=Ce}setFillRGBColor(pe,be,ge){const Ce=re.Util.makeHexColor(pe,be,ge);this.ctx.fillStyle=Ce,this.current.fillColor=Ce,this.current.patternFill=!1}_getPattern(pe,be=null){let ge;return this.cachedPatterns.has(pe)?ge=this.cachedPatterns.get(pe):(ge=(0,se.getShadingPattern)(this.getObject(pe)),this.cachedPatterns.set(pe,ge)),be&&(ge.matrix=be),ge}shadingFill(pe){if(!this.contentVisible)return;const be=this.ctx;this.save();const ge=this._getPattern(pe);be.fillStyle=ge.getPattern(be,this,(0,ie.getCurrentTransformInverse)(be),se.PathType.SHADING);const Ce=(0,ie.getCurrentTransformInverse)(be);if(Ce){const{width:xe,height:Le}=be.canvas,[Be,He,it,et]=re.Util.getAxialAlignedBoundingBox([0,0,xe,Le],Ce);this.ctx.fillRect(Be,He,it-Be,et-He)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,re.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,re.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(pe,be){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(pe)&&pe.length===6&&this.transform(...pe),this.baseTransform=(0,ie.getCurrentTransform)(this.ctx),be)){const ge=be[2]-be[0],Ce=be[3]-be[1];this.ctx.rect(be[0],be[1],ge,Ce),this.current.updateRectMinMax((0,ie.getCurrentTransform)(this.ctx),be),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(pe){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const be=this.ctx;pe.isolated||(0,re.info)("TODO: Support non-isolated groups."),pe.knockout&&(0,re.warn)("Knockout groups not supported.");const ge=(0,ie.getCurrentTransform)(be);if(pe.matrix&&be.transform(...pe.matrix),!pe.bbox)throw new Error("Bounding box is required.");let Ce=re.Util.getAxialAlignedBoundingBox(pe.bbox,(0,ie.getCurrentTransform)(be));const xe=[0,0,be.canvas.width,be.canvas.height];Ce=re.Util.intersect(Ce,xe)||[0,0,0,0];const Le=Math.floor(Ce[0]),Be=Math.floor(Ce[1]);let He=Math.max(Math.ceil(Ce[2])-Le,1),it=Math.max(Math.ceil(Ce[3])-Be,1),et=1,ot=1;He>de&&(et=He/de,He=de),it>de&&(ot=it/de,it=de),this.current.startNewPathAndClipBox([0,0,He,it]);let ht="groupAt"+this.groupLevel;pe.smask&&(ht+="_smask_"+this.smaskCounter++%2);const pt=this.cachedCanvases.getCanvas(ht,He,it),ct=pt.context;ct.scale(1/et,1/ot),ct.translate(-Le,-Be),ct.transform(...ge),pe.smask?this.smaskStack.push({canvas:pt.canvas,context:ct,offsetX:Le,offsetY:Be,scaleX:et,scaleY:ot,subtype:pe.smask.subtype,backdrop:pe.smask.backdrop,transferMap:pe.smask.transferMap||null,startTransformInverse:null}):(be.setTransform(1,0,0,1,0,0),be.translate(Le,Be),be.scale(et,ot),be.save()),ye(be,ct),this.ctx=ct,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(be),this.groupLevel++}endGroup(pe){if(!this.contentVisible)return;this.groupLevel--;const be=this.ctx,ge=this.groupStack.pop();if(this.ctx=ge,this.ctx.imageSmoothingEnabled=!1,pe.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const Ce=(0,ie.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...Ce);const xe=re.Util.getAxialAlignedBoundingBox([0,0,be.canvas.width,be.canvas.height],Ce);this.ctx.drawImage(be.canvas,0,0),this.ctx.restore(),this.compose(xe)}}beginAnnotation(pe,be,ge,Ce,xe){if(Ke(this,Ge,vr).call(this),Ee(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(be)&&be.length===4){const Le=be[2]-be[0],Be=be[3]-be[1];if(xe&&this.annotationCanvasMap){ge=ge.slice(),ge[4]-=be[0],ge[5]-=be[1],be=be.slice(),be[0]=be[1]=0,be[2]=Le,be[3]=Be;const[He,it]=re.Util.singularValueDecompose2dScale((0,ie.getCurrentTransform)(this.ctx)),{viewportScale:et}=this,ot=Math.ceil(Le*this.outputScaleX*et),ht=Math.ceil(Be*this.outputScaleY*et);this.annotationCanvas=this.canvasFactory.create(ot,ht);const{canvas:pt,context:ct}=this.annotationCanvas;this.annotationCanvasMap.set(pe,pt),this.annotationCanvas.savedCtx=this.ctx,this.ctx=ct,this.ctx.save(),this.ctx.setTransform(He,0,0,-it,0,Be*it),Ee(this.ctx)}else Ee(this.ctx),this.ctx.rect(be[0],be[1],Le,Be),this.ctx.clip(),this.endPath()}this.current=new Pe(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...ge),this.transform(...Ce)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),Ke(this,mt,wr).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(pe){if(!this.contentVisible)return;const be=pe.count;pe=this.getObject(pe.data,pe),pe.count=be;const ge=this.ctx,Ce=this.processingType3;if(Ce&&(Ce.compiled===void 0&&(Ce.compiled=Te(pe)),Ce.compiled)){Ce.compiled(ge);return}const xe=this._createMaskCanvas(pe),Le=xe.canvas;ge.save(),ge.setTransform(1,0,0,1,0,0),ge.drawImage(Le,xe.offsetX,xe.offsetY),ge.restore(),this.compose()}paintImageMaskXObjectRepeat(pe,be,ge=0,Ce=0,xe,Le){if(!this.contentVisible)return;pe=this.getObject(pe.data,pe);const Be=this.ctx;Be.save();const He=(0,ie.getCurrentTransform)(Be);Be.transform(be,ge,Ce,xe,0,0);const it=this._createMaskCanvas(pe);Be.setTransform(1,0,0,1,it.offsetX-He[4],it.offsetY-He[5]);for(let et=0,ot=Le.length;et<ot;et+=2){const ht=re.Util.transform(He,[be,ge,Ce,xe,Le[et],Le[et+1]]),[pt,ct]=re.Util.applyTransform([0,0],ht);Be.drawImage(it.canvas,pt,ct)}Be.restore(),this.compose()}paintImageMaskXObjectGroup(pe){if(!this.contentVisible)return;const be=this.ctx,ge=this.current.fillColor,Ce=this.current.patternFill;for(const xe of pe){const{data:Le,width:Be,height:He,transform:it}=xe,et=this.cachedCanvases.getCanvas("maskCanvas",Be,He),ot=et.context;ot.save();const ht=this.getObject(Le,xe);$e(ot,ht),ot.globalCompositeOperation="source-in",ot.fillStyle=Ce?ge.getPattern(ot,this,(0,ie.getCurrentTransformInverse)(be),se.PathType.FILL):ge,ot.fillRect(0,0,Be,He),ot.restore(),be.save(),be.transform(...it),be.scale(1,-1),Se(be,et.canvas,0,0,Be,He,0,-1,1,1),be.restore()}this.compose()}paintImageXObject(pe){if(!this.contentVisible)return;const be=this.getObject(pe);if(!be){(0,re.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(be)}paintImageXObjectRepeat(pe,be,ge,Ce){if(!this.contentVisible)return;const xe=this.getObject(pe);if(!xe){(0,re.warn)("Dependent image isn't ready yet");return}const Le=xe.width,Be=xe.height,He=[];for(let it=0,et=Ce.length;it<et;it+=2)He.push({transform:[be,0,0,ge,Ce[it],Ce[it+1]],x:0,y:0,w:Le,h:Be});this.paintInlineImageXObjectGroup(xe,He)}applyTransferMapsToCanvas(pe){return this.current.transferMaps!=="none"&&(pe.filter=this.current.transferMaps,pe.drawImage(pe.canvas,0,0),pe.filter="none"),pe.canvas}applyTransferMapsToBitmap(pe){if(this.current.transferMaps==="none")return pe.bitmap;const{bitmap:be,width:ge,height:Ce}=pe,xe=this.cachedCanvases.getCanvas("inlineImage",ge,Ce),Le=xe.context;return Le.filter=this.current.transferMaps,Le.drawImage(be,0,0),Le.filter="none",xe.canvas}paintInlineImageXObject(pe){if(!this.contentVisible)return;const be=pe.width,ge=pe.height,Ce=this.ctx;if(this.save(),!re.isNodeJS){const{filter:Be}=Ce;Be!=="none"&&Be!==""&&(Ce.filter="none")}Ce.scale(1/be,-1/ge);let xe;if(pe.bitmap)xe=this.applyTransferMapsToBitmap(pe);else if(typeof HTMLElement=="function"&&pe instanceof HTMLElement||!pe.data)xe=pe;else{const He=this.cachedCanvases.getCanvas("inlineImage",be,ge).context;Re(He,pe),xe=this.applyTransferMapsToCanvas(He)}const Le=this._scaleImage(xe,(0,ie.getCurrentTransformInverse)(Ce));Ce.imageSmoothingEnabled=Ve((0,ie.getCurrentTransform)(Ce),pe.interpolate),Se(Ce,Le.img,0,0,Le.paintWidth,Le.paintHeight,0,-ge,be,ge),this.compose(),this.restore()}paintInlineImageXObjectGroup(pe,be){if(!this.contentVisible)return;const ge=this.ctx;let Ce;if(pe.bitmap)Ce=pe.bitmap;else{const xe=pe.width,Le=pe.height,He=this.cachedCanvases.getCanvas("inlineImage",xe,Le).context;Re(He,pe),Ce=this.applyTransferMapsToCanvas(He)}for(const xe of be)ge.save(),ge.transform(...xe.transform),ge.scale(1,-1),Se(ge,Ce,xe.x,xe.y,xe.w,xe.h,0,-1,1,1),ge.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(pe){}markPointProps(pe,be){}beginMarkedContent(pe){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(pe,be){pe==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(be)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(pe){const be=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(pe);const ge=this.ctx;this.pendingClip&&(be||(this.pendingClip===rt?ge.clip("evenodd"):ge.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),ge.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const pe=(0,ie.getCurrentTransform)(this.ctx);if(pe[1]===0&&pe[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(pe[0]),Math.abs(pe[3]));else{const be=Math.abs(pe[0]*pe[3]-pe[2]*pe[1]),ge=Math.hypot(pe[0],pe[2]),Ce=Math.hypot(pe[1],pe[3]);this._cachedGetSinglePixelWidth=Math.max(ge,Ce)/be}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:pe}=this.current,{a:be,b:ge,c:Ce,d:xe}=this.ctx.getTransform();let Le,Be;if(ge===0&&Ce===0){const He=Math.abs(be),it=Math.abs(xe);if(He===it)if(pe===0)Le=Be=1/He;else{const et=He*pe;Le=Be=et<1?1/et:1}else if(pe===0)Le=1/He,Be=1/it;else{const et=He*pe,ot=it*pe;Le=et<1?1/et:1,Be=ot<1?1/ot:1}}else{const He=Math.abs(be*xe-ge*Ce),it=Math.hypot(be,ge),et=Math.hypot(Ce,xe);if(pe===0)Le=et/He,Be=it/He;else{const ot=pe*He;Le=et>ot?et/ot:1,Be=it>ot?it/ot:1}}this._cachedScaleForStroking[0]=Le,this._cachedScaleForStroking[1]=Be}return this._cachedScaleForStroking}rescaleAndStroke(pe){const{ctx:be}=this,{lineWidth:ge}=this.current,[Ce,xe]=this.getScaleForStroking();if(be.lineWidth=ge||1,Ce===1&&xe===1){be.stroke();return}const Le=be.getLineDash();if(pe&&be.save(),be.scale(Ce,xe),Le.length>0){const Be=Math.max(Ce,xe);be.setLineDash(Le.map(He=>He/Be)),be.lineDashOffset/=Be}be.stroke(),pe&&be.restore()}isContentVisible(){for(let pe=this.markedContentStack.length-1;pe>=0;pe--)if(!this.markedContentStack[pe].visible)return!1;return!0}};Ge=new WeakSet,vr=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},mt=new WeakSet,wr=function(){if(this.pageColors){const pe=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(pe!=="none"){const be=this.ctx.filter;this.ctx.filter=pe,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=be}}};let lt=Et;te.CanvasGraphics=lt;for(const De in re.OPS)lt.prototype[De]!==void 0&&(lt.prototype[re.OPS[De]]=lt.prototype[De])},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.TilingPattern=te.PathType=void 0,te.getShadingPattern=_e;var re=ne(1),ie=ne(6);const se={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};te.PathType=se;function oe(Te,Pe){if(!Pe)return;const Re=Pe[2]-Pe[0],$e=Pe[3]-Pe[1],ye=new Path2D;ye.rect(Pe[0],Pe[1],Re,$e),Te.clip(ye)}class he{constructor(){this.constructor===he&&(0,re.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,re.unreachable)("Abstract method `getPattern` called.")}}class ue extends he{constructor(Pe){super(),this._type=Pe[1],this._bbox=Pe[2],this._colorStops=Pe[3],this._p0=Pe[4],this._p1=Pe[5],this._r0=Pe[6],this._r1=Pe[7],this.matrix=null}_createGradient(Pe){let Re;this._type==="axial"?Re=Pe.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(Re=Pe.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const $e of this._colorStops)Re.addColorStop($e[0],$e[1]);return Re}getPattern(Pe,Re,$e,ye){let Ee;if(ye===se.STROKE||ye===se.FILL){const Ne=Re.current.getClippedPathBoundingBox(ye,(0,ie.getCurrentTransform)(Pe))||[0,0,0,0],Me=Math.ceil(Ne[2]-Ne[0])||1,we=Math.ceil(Ne[3]-Ne[1])||1,Oe=Re.cachedCanvases.getCanvas("pattern",Me,we,!0),Fe=Oe.context;Fe.clearRect(0,0,Fe.canvas.width,Fe.canvas.height),Fe.beginPath(),Fe.rect(0,0,Fe.canvas.width,Fe.canvas.height),Fe.translate(-Ne[0],-Ne[1]),$e=re.Util.transform($e,[1,0,0,1,Ne[0],Ne[1]]),Fe.transform(...Re.baseTransform),this.matrix&&Fe.transform(...this.matrix),oe(Fe,this._bbox),Fe.fillStyle=this._createGradient(Fe),Fe.fill(),Ee=Pe.createPattern(Oe.canvas,"no-repeat");const Ve=new DOMMatrix($e);Ee.setTransform(Ve)}else oe(Pe,this._bbox),Ee=this._createGradient(Pe);return Ee}}function de(Te,Pe,Re,$e,ye,Ee,Ne,Me){const we=Pe.coords,Oe=Pe.colors,Fe=Te.data,Ve=Te.width*4;let qe;we[Re+1]>we[$e+1]&&(qe=Re,Re=$e,$e=qe,qe=Ee,Ee=Ne,Ne=qe),we[$e+1]>we[ye+1]&&(qe=$e,$e=ye,ye=qe,qe=Ne,Ne=Me,Me=qe),we[Re+1]>we[$e+1]&&(qe=Re,Re=$e,$e=qe,qe=Ee,Ee=Ne,Ne=qe);const Ie=(we[Re]+Pe.offsetX)*Pe.scaleX,Xe=(we[Re+1]+Pe.offsetY)*Pe.scaleY,rt=(we[$e]+Pe.offsetX)*Pe.scaleX,lt=(we[$e+1]+Pe.offsetY)*Pe.scaleY,Ge=(we[ye]+Pe.offsetX)*Pe.scaleX,ut=(we[ye+1]+Pe.offsetY)*Pe.scaleY;if(Xe>=ut)return;const mt=Oe[Ee],wt=Oe[Ee+1],Et=Oe[Ee+2],De=Oe[Ne],pe=Oe[Ne+1],be=Oe[Ne+2],ge=Oe[Me],Ce=Oe[Me+1],xe=Oe[Me+2],Le=Math.round(Xe),Be=Math.round(ut);let He,it,et,ot,ht,pt,ct,Pt;for(let It=Le;It<=Be;It++){if(It<lt){const nt=It<Xe?0:(Xe-It)/(Xe-lt);He=Ie-(Ie-rt)*nt,it=mt-(mt-De)*nt,et=wt-(wt-pe)*nt,ot=Et-(Et-be)*nt}else{let nt;It>ut?nt=1:lt===ut?nt=0:nt=(lt-It)/(lt-ut),He=rt-(rt-Ge)*nt,it=De-(De-ge)*nt,et=pe-(pe-Ce)*nt,ot=be-(be-xe)*nt}let vt;It<Xe?vt=0:It>ut?vt=1:vt=(Xe-It)/(Xe-ut),ht=Ie-(Ie-Ge)*vt,pt=mt-(mt-ge)*vt,ct=wt-(wt-Ce)*vt,Pt=Et-(Et-xe)*vt;const kt=Math.round(Math.min(He,ht)),gt=Math.round(Math.max(He,ht));let tt=Ve*It+kt*4;for(let nt=kt;nt<=gt;nt++)vt=(He-nt)/(He-ht),vt<0?vt=0:vt>1&&(vt=1),Fe[tt++]=it-(it-pt)*vt|0,Fe[tt++]=et-(et-ct)*vt|0,Fe[tt++]=ot-(ot-Pt)*vt|0,Fe[tt++]=255}}function ae(Te,Pe,Re){const $e=Pe.coords,ye=Pe.colors;let Ee,Ne;switch(Pe.type){case"lattice":const Me=Pe.verticesPerRow,we=Math.floor($e.length/Me)-1,Oe=Me-1;for(Ee=0;Ee<we;Ee++){let Fe=Ee*Me;for(let Ve=0;Ve<Oe;Ve++,Fe++)de(Te,Re,$e[Fe],$e[Fe+1],$e[Fe+Me],ye[Fe],ye[Fe+1],ye[Fe+Me]),de(Te,Re,$e[Fe+Me+1],$e[Fe+1],$e[Fe+Me],ye[Fe+Me+1],ye[Fe+1],ye[Fe+Me])}break;case"triangles":for(Ee=0,Ne=$e.length;Ee<Ne;Ee+=3)de(Te,Re,$e[Ee],$e[Ee+1],$e[Ee+2],ye[Ee],ye[Ee+1],ye[Ee+2]);break;default:throw new Error("illegal figure")}}class le extends he{constructor(Pe){super(),this._coords=Pe[2],this._colors=Pe[3],this._figures=Pe[4],this._bounds=Pe[5],this._bbox=Pe[7],this._background=Pe[8],this.matrix=null}_createMeshCanvas(Pe,Re,$e){const Me=Math.floor(this._bounds[0]),we=Math.floor(this._bounds[1]),Oe=Math.ceil(this._bounds[2])-Me,Fe=Math.ceil(this._bounds[3])-we,Ve=Math.min(Math.ceil(Math.abs(Oe*Pe[0]*1.1)),3e3),qe=Math.min(Math.ceil(Math.abs(Fe*Pe[1]*1.1)),3e3),Ie=Oe/Ve,Xe=Fe/qe,rt={coords:this._coords,colors:this._colors,offsetX:-Me,offsetY:-we,scaleX:1/Ie,scaleY:1/Xe},lt=Ve+2*2,Ge=qe+2*2,ut=$e.getCanvas("mesh",lt,Ge,!1),mt=ut.context,wt=mt.createImageData(Ve,qe);if(Re){const De=wt.data;for(let pe=0,be=De.length;pe<be;pe+=4)De[pe]=Re[0],De[pe+1]=Re[1],De[pe+2]=Re[2],De[pe+3]=255}for(const De of this._figures)ae(wt,De,rt);return mt.putImageData(wt,2,2),{canvas:ut.canvas,offsetX:Me-2*Ie,offsetY:we-2*Xe,scaleX:Ie,scaleY:Xe}}getPattern(Pe,Re,$e,ye){oe(Pe,this._bbox);let Ee;if(ye===se.SHADING)Ee=re.Util.singularValueDecompose2dScale((0,ie.getCurrentTransform)(Pe));else if(Ee=re.Util.singularValueDecompose2dScale(Re.baseTransform),this.matrix){const Me=re.Util.singularValueDecompose2dScale(this.matrix);Ee=[Ee[0]*Me[0],Ee[1]*Me[1]]}const Ne=this._createMeshCanvas(Ee,ye===se.SHADING?null:this._background,Re.cachedCanvases);return ye!==se.SHADING&&(Pe.setTransform(...Re.baseTransform),this.matrix&&Pe.transform(...this.matrix)),Pe.translate(Ne.offsetX,Ne.offsetY),Pe.scale(Ne.scaleX,Ne.scaleY),Pe.createPattern(Ne.canvas,"no-repeat")}}class Ae extends he{getPattern(){return"hotpink"}}function _e(Te){switch(Te[0]){case"RadialAxial":return new ue(Te);case"Mesh":return new le(Te);case"Dummy":return new Ae}throw new Error("Unknown IR type: ".concat(Te[0]))}const me={COLORED:1,UNCOLORED:2},Se=class Se{constructor(Pe,Re,$e,ye,Ee){this.operatorList=Pe[2],this.matrix=Pe[3]||[1,0,0,1,0,0],this.bbox=Pe[4],this.xstep=Pe[5],this.ystep=Pe[6],this.paintType=Pe[7],this.tilingType=Pe[8],this.color=Re,this.ctx=$e,this.canvasGraphicsFactory=ye,this.baseTransform=Ee}createPatternCanvas(Pe){const Re=this.operatorList,$e=this.bbox,ye=this.xstep,Ee=this.ystep,Ne=this.paintType,Me=this.tilingType,we=this.color,Oe=this.canvasGraphicsFactory;(0,re.info)("TilingType: "+Me);const Fe=$e[0],Ve=$e[1],qe=$e[2],Ie=$e[3],Xe=re.Util.singularValueDecompose2dScale(this.matrix),rt=re.Util.singularValueDecompose2dScale(this.baseTransform),lt=[Xe[0]*rt[0],Xe[1]*rt[1]],Ge=this.getSizeAndScale(ye,this.ctx.canvas.width,lt[0]),ut=this.getSizeAndScale(Ee,this.ctx.canvas.height,lt[1]),mt=Pe.cachedCanvases.getCanvas("pattern",Ge.size,ut.size,!0),wt=mt.context,Et=Oe.createCanvasGraphics(wt);Et.groupLevel=Pe.groupLevel,this.setFillAndStrokeStyleToContext(Et,Ne,we);let De=Fe,pe=Ve,be=qe,ge=Ie;return Fe<0&&(De=0,be+=Math.abs(Fe)),Ve<0&&(pe=0,ge+=Math.abs(Ve)),wt.translate(-(Ge.scale*De),-(ut.scale*pe)),Et.transform(Ge.scale,0,0,ut.scale,0,0),wt.save(),this.clipBbox(Et,De,pe,be,ge),Et.baseTransform=(0,ie.getCurrentTransform)(Et.ctx),Et.executeOperatorList(Re),Et.endDrawing(),{canvas:mt.canvas,scaleX:Ge.scale,scaleY:ut.scale,offsetX:De,offsetY:pe}}getSizeAndScale(Pe,Re,$e){Pe=Math.abs(Pe);const ye=Math.max(Se.MAX_PATTERN_SIZE,Re);let Ee=Math.ceil(Pe*$e);return Ee>=ye?Ee=ye:$e=Ee/Pe,{scale:$e,size:Ee}}clipBbox(Pe,Re,$e,ye,Ee){const Ne=ye-Re,Me=Ee-$e;Pe.ctx.rect(Re,$e,Ne,Me),Pe.current.updateRectMinMax((0,ie.getCurrentTransform)(Pe.ctx),[Re,$e,ye,Ee]),Pe.clip(),Pe.endPath()}setFillAndStrokeStyleToContext(Pe,Re,$e){const ye=Pe.ctx,Ee=Pe.current;switch(Re){case me.COLORED:const Ne=this.ctx;ye.fillStyle=Ne.fillStyle,ye.strokeStyle=Ne.strokeStyle,Ee.fillColor=Ne.fillStyle,Ee.strokeColor=Ne.strokeStyle;break;case me.UNCOLORED:const Me=re.Util.makeHexColor($e[0],$e[1],$e[2]);ye.fillStyle=Me,ye.strokeStyle=Me,Ee.fillColor=Me,Ee.strokeColor=Me;break;default:throw new re.FormatError("Unsupported paint type: ".concat(Re))}}getPattern(Pe,Re,$e,ye){let Ee=$e;ye!==se.SHADING&&(Ee=re.Util.transform(Ee,Re.baseTransform),this.matrix&&(Ee=re.Util.transform(Ee,this.matrix)));const Ne=this.createPatternCanvas(Re);let Me=new DOMMatrix(Ee);Me=Me.translate(Ne.offsetX,Ne.offsetY),Me=Me.scale(1/Ne.scaleX,1/Ne.scaleY);const we=Pe.createPattern(Ne.canvas,"repeat");return we.setTransform(Me),we}};An(Se,"MAX_PATTERN_SIZE",3e3);let ve=Se;te.TilingPattern=ve},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.convertBlackAndWhiteToRGBA=se,te.convertToRGBA=ie,te.grayToRGBA=he;var re=ne(1);function ie(ue){switch(ue.kind){case re.ImageKind.GRAYSCALE_1BPP:return se(ue);case re.ImageKind.RGB_24BPP:return oe(ue)}return null}function se({src:ue,srcPos:de=0,dest:ae,width:le,height:Ae,nonBlackColor:_e=4294967295,inverseDecode:me=!1}){const ve=re.FeatureTest.isLittleEndian?4278190080:255,[Se,Te]=me?[_e,ve]:[ve,_e],Pe=le>>3,Re=le&7,$e=ue.length;ae=new Uint32Array(ae.buffer);let ye=0;for(let Ee=0;Ee<Ae;Ee++){for(const Me=de+Pe;de<Me;de++){const we=de<$e?ue[de]:255;ae[ye++]=we&128?Te:Se,ae[ye++]=we&64?Te:Se,ae[ye++]=we&32?Te:Se,ae[ye++]=we&16?Te:Se,ae[ye++]=we&8?Te:Se,ae[ye++]=we&4?Te:Se,ae[ye++]=we&2?Te:Se,ae[ye++]=we&1?Te:Se}if(Re===0)continue;const Ne=de<$e?ue[de++]:255;for(let Me=0;Me<Re;Me++)ae[ye++]=Ne&1<<7-Me?Te:Se}return{srcPos:de,destPos:ye}}function oe({src:ue,srcPos:de=0,dest:ae,destPos:le=0,width:Ae,height:_e}){let me=0;const ve=ue.length>>2,Se=new Uint32Array(ue.buffer,de,ve);if(re.FeatureTest.isLittleEndian){for(;me<ve-2;me+=3,le+=4){const Te=Se[me],Pe=Se[me+1],Re=Se[me+2];ae[le]=Te|4278190080,ae[le+1]=Te>>>24|Pe<<8|4278190080,ae[le+2]=Pe>>>16|Re<<16|4278190080,ae[le+3]=Re>>>8|4278190080}for(let Te=me*4,Pe=ue.length;Te<Pe;Te+=3)ae[le++]=ue[Te]|ue[Te+1]<<8|ue[Te+2]<<16|4278190080}else{for(;me<ve-2;me+=3,le+=4){const Te=Se[me],Pe=Se[me+1],Re=Se[me+2];ae[le]=Te|255,ae[le+1]=Te<<24|Pe>>>8|255,ae[le+2]=Pe<<16|Re>>>16|255,ae[le+3]=Re<<8|255}for(let Te=me*4,Pe=ue.length;Te<Pe;Te+=3)ae[le++]=ue[Te]<<24|ue[Te+1]<<16|ue[Te+2]<<8|255}return{srcPos:de,destPos:le}}function he(ue,de){if(re.FeatureTest.isLittleEndian)for(let ae=0,le=ue.length;ae<le;ae++)de[ae]=ue[ae]*65793|4278190080;else for(let ae=0,le=ue.length;ae<le;ae++)de[ae]=ue[ae]*16843008|255}},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.GlobalWorkerOptions=void 0;const ne=Object.create(null);te.GlobalWorkerOptions=ne,ne.workerPort=null,ne.workerSrc=""},(ee,te,ne)=>{var ue,Zr,ae,Jr,Ae,Zn;Object.defineProperty(te,"__esModule",{value:!0}),te.MessageHandler=void 0;var re=ne(1);const ie={UNKNOWN:0,DATA:1,ERROR:2},se={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function oe(me){switch(me instanceof Error||typeof me=="object"&&me!==null||(0,re.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),me.name){case"AbortException":return new re.AbortException(me.message);case"MissingPDFException":return new re.MissingPDFException(me.message);case"PasswordException":return new re.PasswordException(me.message,me.code);case"UnexpectedResponseException":return new re.UnexpectedResponseException(me.message,me.status);case"UnknownErrorException":return new re.UnknownErrorException(me.message,me.details);default:return new re.UnknownErrorException(me.message,me.toString())}}class he{constructor(ve,Se,Te){We(this,ue);We(this,ae);We(this,Ae);this.sourceName=ve,this.targetName=Se,this.comObj=Te,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=Pe=>{const Re=Pe.data;if(Re.targetName!==this.sourceName)return;if(Re.stream){Ke(this,ae,Jr).call(this,Re);return}if(Re.callback){const ye=Re.callbackId,Ee=this.callbackCapabilities[ye];if(!Ee)throw new Error("Cannot resolve callback ".concat(ye));if(delete this.callbackCapabilities[ye],Re.callback===ie.DATA)Ee.resolve(Re.data);else if(Re.callback===ie.ERROR)Ee.reject(oe(Re.reason));else throw new Error("Unexpected callback case");return}const $e=this.actionHandler[Re.action];if(!$e)throw new Error("Unknown action from worker: ".concat(Re.action));if(Re.callbackId){const ye=this.sourceName,Ee=Re.sourceName;new Promise(function(Ne){Ne($e(Re.data))}).then(function(Ne){Te.postMessage({sourceName:ye,targetName:Ee,callback:ie.DATA,callbackId:Re.callbackId,data:Ne})},function(Ne){Te.postMessage({sourceName:ye,targetName:Ee,callback:ie.ERROR,callbackId:Re.callbackId,reason:oe(Ne)})});return}if(Re.streamId){Ke(this,ue,Zr).call(this,Re);return}$e(Re.data)},Te.addEventListener("message",this._onComObjOnMessage)}on(ve,Se){const Te=this.actionHandler;if(Te[ve])throw new Error('There is already an actionName called "'.concat(ve,'"'));Te[ve]=Se}send(ve,Se,Te){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:ve,data:Se},Te)}sendWithPromise(ve,Se,Te){const Pe=this.callbackId++,Re=new re.PromiseCapability;this.callbackCapabilities[Pe]=Re;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:ve,callbackId:Pe,data:Se},Te)}catch($e){Re.reject($e)}return Re.promise}sendWithStream(ve,Se,Te,Pe){const Re=this.streamId++,$e=this.sourceName,ye=this.targetName,Ee=this.comObj;return new ReadableStream({start:Ne=>{const Me=new re.PromiseCapability;return this.streamControllers[Re]={controller:Ne,startCall:Me,pullCall:null,cancelCall:null,isClosed:!1},Ee.postMessage({sourceName:$e,targetName:ye,action:ve,streamId:Re,data:Se,desiredSize:Ne.desiredSize},Pe),Me.promise},pull:Ne=>{const Me=new re.PromiseCapability;return this.streamControllers[Re].pullCall=Me,Ee.postMessage({sourceName:$e,targetName:ye,stream:se.PULL,streamId:Re,desiredSize:Ne.desiredSize}),Me.promise},cancel:Ne=>{(0,re.assert)(Ne instanceof Error,"cancel must have a valid reason");const Me=new re.PromiseCapability;return this.streamControllers[Re].cancelCall=Me,this.streamControllers[Re].isClosed=!0,Ee.postMessage({sourceName:$e,targetName:ye,stream:se.CANCEL,streamId:Re,reason:oe(Ne)}),Me.promise}},Te)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}ue=new WeakSet,Zr=function(ve){const Se=ve.streamId,Te=this.sourceName,Pe=ve.sourceName,Re=this.comObj,$e=this,ye=this.actionHandler[ve.action],Ee={enqueue(Ne,Me=1,we){if(this.isCancelled)return;const Oe=this.desiredSize;this.desiredSize-=Me,Oe>0&&this.desiredSize<=0&&(this.sinkCapability=new re.PromiseCapability,this.ready=this.sinkCapability.promise),Re.postMessage({sourceName:Te,targetName:Pe,stream:se.ENQUEUE,streamId:Se,chunk:Ne},we)},close(){this.isCancelled||(this.isCancelled=!0,Re.postMessage({sourceName:Te,targetName:Pe,stream:se.CLOSE,streamId:Se}),delete $e.streamSinks[Se])},error(Ne){(0,re.assert)(Ne instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,Re.postMessage({sourceName:Te,targetName:Pe,stream:se.ERROR,streamId:Se,reason:oe(Ne)}))},sinkCapability:new re.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:ve.desiredSize,ready:null};Ee.sinkCapability.resolve(),Ee.ready=Ee.sinkCapability.promise,this.streamSinks[Se]=Ee,new Promise(function(Ne){Ne(ye(ve.data,Ee))}).then(function(){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.START_COMPLETE,streamId:Se,success:!0})},function(Ne){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.START_COMPLETE,streamId:Se,reason:oe(Ne)})})},ae=new WeakSet,Jr=function(ve){const Se=ve.streamId,Te=this.sourceName,Pe=ve.sourceName,Re=this.comObj,$e=this.streamControllers[Se],ye=this.streamSinks[Se];switch(ve.stream){case se.START_COMPLETE:ve.success?$e.startCall.resolve():$e.startCall.reject(oe(ve.reason));break;case se.PULL_COMPLETE:ve.success?$e.pullCall.resolve():$e.pullCall.reject(oe(ve.reason));break;case se.PULL:if(!ye){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.PULL_COMPLETE,streamId:Se,success:!0});break}ye.desiredSize<=0&&ve.desiredSize>0&&ye.sinkCapability.resolve(),ye.desiredSize=ve.desiredSize,new Promise(function(Ee){var Ne;Ee((Ne=ye.onPull)==null?void 0:Ne.call(ye))}).then(function(){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.PULL_COMPLETE,streamId:Se,success:!0})},function(Ee){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.PULL_COMPLETE,streamId:Se,reason:oe(Ee)})});break;case se.ENQUEUE:if((0,re.assert)($e,"enqueue should have stream controller"),$e.isClosed)break;$e.controller.enqueue(ve.chunk);break;case se.CLOSE:if((0,re.assert)($e,"close should have stream controller"),$e.isClosed)break;$e.isClosed=!0,$e.controller.close(),Ke(this,Ae,Zn).call(this,$e,Se);break;case se.ERROR:(0,re.assert)($e,"error should have stream controller"),$e.controller.error(oe(ve.reason)),Ke(this,Ae,Zn).call(this,$e,Se);break;case se.CANCEL_COMPLETE:ve.success?$e.cancelCall.resolve():$e.cancelCall.reject(oe(ve.reason)),Ke(this,Ae,Zn).call(this,$e,Se);break;case se.CANCEL:if(!ye)break;new Promise(function(Ee){var Ne;Ee((Ne=ye.onCancel)==null?void 0:Ne.call(ye,oe(ve.reason)))}).then(function(){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.CANCEL_COMPLETE,streamId:Se,success:!0})},function(Ee){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.CANCEL_COMPLETE,streamId:Se,reason:oe(Ee)})}),ye.sinkCapability.reject(oe(ve.reason)),ye.isCancelled=!0,delete this.streamSinks[Se];break;default:throw new Error("Unexpected stream case")}},Ae=new WeakSet,Zn=async function(ve,Se){var Te,Pe,Re;await Promise.allSettled([(Te=ve.startCall)==null?void 0:Te.promise,(Pe=ve.pullCall)==null?void 0:Pe.promise,(Re=ve.cancelCall)==null?void 0:Re.promise]),delete this.streamControllers[Se]},te.MessageHandler=he},(ee,te,ne)=>{var se,oe;Object.defineProperty(te,"__esModule",{value:!0}),te.Metadata=void 0;var re=ne(1);class ie{constructor({parsedData:ue,rawData:de}){We(this,se,void 0);We(this,oe,void 0);st(this,se,ue),st(this,oe,de)}getRaw(){return ce(this,oe)}get(ue){var de;return(de=ce(this,se).get(ue))!=null?de:null}getAll(){return(0,re.objectFromMap)(ce(this,se))}has(ue){return ce(this,se).has(ue)}}se=new WeakMap,oe=new WeakMap,te.Metadata=ie},(ee,te,ne)=>{var ue,de,ae,le,Ae,_e,Ar;Object.defineProperty(te,"__esModule",{value:!0}),te.OptionalContentConfig=void 0;var re=ne(1),ie=ne(8);const se=Symbol("INTERNAL");class oe{constructor(Se,Te){We(this,ue,!0);this.name=Se,this.intent=Te}get visible(){return ce(this,ue)}_setVisible(Se,Te){Se!==se&&(0,re.unreachable)("Internal method `_setVisible` called."),st(this,ue,Te)}}ue=new WeakMap;class he{constructor(Se){We(this,_e);We(this,de,null);We(this,ae,new Map);We(this,le,null);We(this,Ae,null);if(this.name=null,this.creator=null,Se!==null){this.name=Se.name,this.creator=Se.creator,st(this,Ae,Se.order);for(const Te of Se.groups)ce(this,ae).set(Te.id,new oe(Te.name,Te.intent));if(Se.baseState==="OFF")for(const Te of ce(this,ae).values())Te._setVisible(se,!1);for(const Te of Se.on)ce(this,ae).get(Te)._setVisible(se,!0);for(const Te of Se.off)ce(this,ae).get(Te)._setVisible(se,!1);st(this,le,this.getHash())}}isVisible(Se){if(ce(this,ae).size===0)return!0;if(!Se)return(0,re.warn)("Optional content group not defined."),!0;if(Se.type==="OCG")return ce(this,ae).has(Se.id)?ce(this,ae).get(Se.id).visible:((0,re.warn)("Optional content group not found: ".concat(Se.id)),!0);if(Se.type==="OCMD"){if(Se.expression)return Ke(this,_e,Ar).call(this,Se.expression);if(!Se.policy||Se.policy==="AnyOn"){for(const Te of Se.ids){if(!ce(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(ce(this,ae).get(Te).visible)return!0}return!1}else if(Se.policy==="AllOn"){for(const Te of Se.ids){if(!ce(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(!ce(this,ae).get(Te).visible)return!1}return!0}else if(Se.policy==="AnyOff"){for(const Te of Se.ids){if(!ce(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(!ce(this,ae).get(Te).visible)return!0}return!1}else if(Se.policy==="AllOff"){for(const Te of Se.ids){if(!ce(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(ce(this,ae).get(Te).visible)return!1}return!0}return(0,re.warn)("Unknown optional content policy ".concat(Se.policy,".")),!0}return(0,re.warn)("Unknown group type ".concat(Se.type,".")),!0}setVisibility(Se,Te=!0){if(!ce(this,ae).has(Se)){(0,re.warn)("Optional content group not found: ".concat(Se));return}ce(this,ae).get(Se)._setVisible(se,!!Te),st(this,de,null)}get hasInitialVisibility(){return ce(this,le)===null||this.getHash()===ce(this,le)}getOrder(){return ce(this,ae).size?ce(this,Ae)?ce(this,Ae).slice():[...ce(this,ae).keys()]:null}getGroups(){return ce(this,ae).size>0?(0,re.objectFromMap)(ce(this,ae)):null}getGroup(Se){return ce(this,ae).get(Se)||null}getHash(){if(ce(this,de)!==null)return ce(this,de);const Se=new ie.MurmurHash3_64;for(const[Te,Pe]of ce(this,ae))Se.update("".concat(Te,":").concat(Pe.visible));return st(this,de,Se.hexdigest())}}de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakSet,Ar=function(Se){const Te=Se.length;if(Te<2)return!0;const Pe=Se[0];for(let Re=1;Re<Te;Re++){const $e=Se[Re];let ye;if(Array.isArray($e))ye=Ke(this,_e,Ar).call(this,$e);else if(ce(this,ae).has($e))ye=ce(this,ae).get($e).visible;else return(0,re.warn)("Optional content group not found: ".concat($e)),!0;switch(Pe){case"And":if(!ye)return!1;break;case"Or":if(ye)return!0;break;case"Not":return!ye;default:return!0}}return Pe==="And"},te.OptionalContentConfig=he},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFDataTransportStream=void 0;var re=ne(1),ie=ne(6);class se{constructor({length:de,initialData:ae,progressiveDone:le=!1,contentDispositionFilename:Ae=null,disableRange:_e=!1,disableStream:me=!1},ve){if((0,re.assert)(ve,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=le,this._contentDispositionFilename=Ae,(ae==null?void 0:ae.length)>0){const Se=ae instanceof Uint8Array&&ae.byteLength===ae.buffer.byteLength?ae.buffer:new Uint8Array(ae).buffer;this._queuedChunks.push(Se)}this._pdfDataRangeTransport=ve,this._isStreamingSupported=!me,this._isRangeSupported=!_e,this._contentLength=de,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((Se,Te)=>{this._onReceiveData({begin:Se,chunk:Te})}),this._pdfDataRangeTransport.addProgressListener((Se,Te)=>{this._onProgress({loaded:Se,total:Te})}),this._pdfDataRangeTransport.addProgressiveReadListener(Se=>{this._onReceiveData({chunk:Se})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:de,chunk:ae}){const le=ae instanceof Uint8Array&&ae.byteLength===ae.buffer.byteLength?ae.buffer:new Uint8Array(ae).buffer;if(de===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(le):this._queuedChunks.push(le);else{const Ae=this._rangeReaders.some(function(_e){return _e._begin!==de?!1:(_e._enqueue(le),!0)});(0,re.assert)(Ae,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var de,ae;return(ae=(de=this._fullRequestReader)==null?void 0:de._loaded)!=null?ae:0}_onProgress(de){var ae,le,Ae,_e;de.total===void 0?(le=(ae=this._rangeReaders[0])==null?void 0:ae.onProgress)==null||le.call(ae,{loaded:de.loaded}):(_e=(Ae=this._fullRequestReader)==null?void 0:Ae.onProgress)==null||_e.call(Ae,{loaded:de.loaded,total:de.total})}_onProgressiveDone(){var de;(de=this._fullRequestReader)==null||de.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(de){const ae=this._rangeReaders.indexOf(de);ae>=0&&this._rangeReaders.splice(ae,1)}getFullReader(){(0,re.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const de=this._queuedChunks;return this._queuedChunks=null,new oe(this,de,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(de,ae){if(ae<=this._progressiveDataLength)return null;const le=new he(this,de,ae);return this._pdfDataRangeTransport.requestDataRange(de,ae),this._rangeReaders.push(le),le}cancelAllRequests(de){var ae;(ae=this._fullRequestReader)==null||ae.cancel(de);for(const le of this._rangeReaders.slice(0))le.cancel(de);this._pdfDataRangeTransport.abort()}}te.PDFDataTransportStream=se;class oe{constructor(de,ae,le=!1,Ae=null){this._stream=de,this._done=le||!1,this._filename=(0,ie.isPdfFile)(Ae)?Ae:null,this._queuedChunks=ae||[],this._loaded=0;for(const _e of this._queuedChunks)this._loaded+=_e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),de._fullRequestReader=this,this.onProgress=null}_enqueue(de){this._done||(this._requests.length>0?this._requests.shift().resolve({value:de,done:!1}):this._queuedChunks.push(de),this._loaded+=de.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 de=new re.PromiseCapability;return this._requests.push(de),de.promise}cancel(de){this._done=!0;for(const ae of this._requests)ae.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class he{constructor(de,ae,le){this._stream=de,this._begin=ae,this._end=le,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(de){if(!this._done){if(this._requests.length===0)this._queuedChunk=de;else{this._requests.shift().resolve({value:de,done:!1});for(const le of this._requests)le.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 ae=this._queuedChunk;return this._queuedChunk=null,{value:ae,done:!1}}if(this._done)return{value:void 0,done:!0};const de=new re.PromiseCapability;return this._requests.push(de),de.promise}cancel(de){this._done=!0;for(const ae of this._requests)ae.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFFetchStream=void 0;var re=ne(1),ie=ne(20);function se(le,Ae,_e){return{method:"GET",headers:le,signal:_e.signal,mode:"cors",credentials:Ae?"include":"same-origin",redirect:"follow"}}function oe(le){const Ae=new Headers;for(const _e in le){const me=le[_e];me!==void 0&&Ae.append(_e,me)}return Ae}function he(le){return le instanceof Uint8Array?le.buffer:le instanceof ArrayBuffer?le:((0,re.warn)("getArrayBuffer - unexpected data format: ".concat(le)),new Uint8Array(le).buffer)}class ue{constructor(Ae){this.source=Ae,this.isHttp=/^https?:/i.test(Ae.url),this.httpHeaders=this.isHttp&&Ae.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var Ae,_e;return(_e=(Ae=this._fullRequestReader)==null?void 0:Ae._loaded)!=null?_e:0}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new de(this),this._fullRequestReader}getRangeReader(Ae,_e){if(_e<=this._progressiveDataLength)return null;const me=new ae(this,Ae,_e);return this._rangeRequestReaders.push(me),me}cancelAllRequests(Ae){var _e;(_e=this._fullRequestReader)==null||_e.cancel(Ae);for(const me of this._rangeRequestReaders.slice(0))me.cancel(Ae)}}te.PDFFetchStream=ue;class de{constructor(Ae){this._stream=Ae,this._reader=null,this._loaded=0,this._filename=null;const _e=Ae.source;this._withCredentials=_e.withCredentials||!1,this._contentLength=_e.length,this._headersCapability=new re.PromiseCapability,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=oe(this._stream.httpHeaders);const me=_e.url;fetch(me,se(this._headers,this._withCredentials,this._abortController)).then(ve=>{if(!(0,ie.validateResponseStatus)(ve.status))throw(0,ie.createResponseStatusError)(ve.status,me);this._reader=ve.body.getReader(),this._headersCapability.resolve();const Se=Re=>ve.headers.get(Re),{allowRangeRequests:Te,suggestedLength:Pe}=(0,ie.validateRangeRequestCapabilities)({getResponseHeader:Se,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=Te,this._contentLength=Pe||this._contentLength,this._filename=(0,ie.extractFilenameFromHeader)(Se),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new re.AbortException("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 me;await this._headersCapability.promise;const{value:Ae,done:_e}=await this._reader.read();return _e?{value:Ae,done:_e}:(this._loaded+=Ae.byteLength,(me=this.onProgress)==null||me.call(this,{loaded:this._loaded,total:this._contentLength}),{value:he(Ae),done:!1})}cancel(Ae){var _e;(_e=this._reader)==null||_e.cancel(Ae),this._abortController.abort()}}class ae{constructor(Ae,_e,me){this._stream=Ae,this._reader=null,this._loaded=0;const ve=Ae.source;this._withCredentials=ve.withCredentials||!1,this._readCapability=new re.PromiseCapability,this._isStreamingSupported=!ve.disableStream,this._abortController=new AbortController,this._headers=oe(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(_e,"-").concat(me-1));const Se=ve.url;fetch(Se,se(this._headers,this._withCredentials,this._abortController)).then(Te=>{if(!(0,ie.validateResponseStatus)(Te.status))throw(0,ie.createResponseStatusError)(Te.status,Se);this._readCapability.resolve(),this._reader=Te.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var me;await this._readCapability.promise;const{value:Ae,done:_e}=await this._reader.read();return _e?{value:Ae,done:_e}:(this._loaded+=Ae.byteLength,(me=this.onProgress)==null||me.call(this,{loaded:this._loaded}),{value:he(Ae),done:!1})}cancel(Ae){var _e;(_e=this._reader)==null||_e.cancel(Ae),this._abortController.abort()}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.createResponseStatusError=ue,te.extractFilenameFromHeader=he,te.validateRangeRequestCapabilities=oe,te.validateResponseStatus=de;var re=ne(1),ie=ne(21),se=ne(6);function oe({getResponseHeader:ae,isHttp:le,rangeChunkSize:Ae,disableRange:_e}){const me={allowRangeRequests:!1,suggestedLength:void 0},ve=parseInt(ae("Content-Length"),10);return!Number.isInteger(ve)||(me.suggestedLength=ve,ve<=2*Ae)||_e||!le||ae("Accept-Ranges")!=="bytes"||(ae("Content-Encoding")||"identity")!=="identity"||(me.allowRangeRequests=!0),me}function he(ae){const le=ae("Content-Disposition");if(le){let Ae=(0,ie.getFilenameFromContentDispositionHeader)(le);if(Ae.includes("%"))try{Ae=decodeURIComponent(Ae)}catch{}if((0,se.isPdfFile)(Ae))return Ae}return null}function ue(ae,le){return ae===404||ae===0&&le.startsWith("file:")?new re.MissingPDFException('Missing PDF "'+le+'".'):new re.UnexpectedResponseException("Unexpected server response (".concat(ae,') while retrieving PDF "').concat(le,'".'),ae)}function de(ae){return ae===200||ae===206}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.getFilenameFromContentDispositionHeader=ie;var re=ne(1);function ie(se){let oe=!0,he=ue("filename\\*","i").exec(se);if(he){he=he[1];let ve=Ae(he);return ve=unescape(ve),ve=_e(ve),ve=me(ve),ae(ve)}if(he=le(se),he){const ve=me(he);return ae(ve)}if(he=ue("filename","i").exec(se),he){he=he[1];let ve=Ae(he);return ve=me(ve),ae(ve)}function ue(ve,Se){return new RegExp("(?:^|;)\\s*"+ve+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',Se)}function de(ve,Se){if(ve){if(!/^[\x00-\xFF]+$/.test(Se))return Se;try{const Te=new TextDecoder(ve,{fatal:!0}),Pe=(0,re.stringToBytes)(Se);Se=Te.decode(Pe),oe=!1}catch{}}return Se}function ae(ve){return oe&&/[\x80-\xff]/.test(ve)&&(ve=de("utf-8",ve),oe&&(ve=de("iso-8859-1",ve))),ve}function le(ve){const Se=[];let Te;const Pe=ue("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(Te=Pe.exec(ve))!==null;){let[,$e,ye,Ee]=Te;if($e=parseInt($e,10),$e in Se){if($e===0)break;continue}Se[$e]=[ye,Ee]}const Re=[];for(let $e=0;$e<Se.length&&$e in Se;++$e){let[ye,Ee]=Se[$e];Ee=Ae(Ee),ye&&(Ee=unescape(Ee),$e===0&&(Ee=_e(Ee))),Re.push(Ee)}return Re.join("")}function Ae(ve){if(ve.startsWith('"')){const Se=ve.slice(1).split('\\"');for(let Te=0;Te<Se.length;++Te){const Pe=Se[Te].indexOf('"');Pe!==-1&&(Se[Te]=Se[Te].slice(0,Pe),Se.length=Te+1),Se[Te]=Se[Te].replaceAll(/\\(.)/g,"$1")}ve=Se.join('"')}return ve}function _e(ve){const Se=ve.indexOf("'");if(Se===-1)return ve;const Te=ve.slice(0,Se),Re=ve.slice(Se+1).replace(/^[^']*'/,"");return de(Te,Re)}function me(ve){return!ve.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(ve)?ve:ve.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(Se,Te,Pe,Re){if(Pe==="q"||Pe==="Q")return Re=Re.replaceAll("_"," "),Re=Re.replaceAll(/=([0-9a-fA-F]{2})/g,function($e,ye){return String.fromCharCode(parseInt(ye,16))}),de(Te,Re);try{Re=atob(Re)}catch{}return de(Te,Re)})}return""}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFNetworkStream=void 0;var re=ne(1),ie=ne(20);const se=200,oe=206;function he(Ae){const _e=Ae.response;return typeof _e!="string"?_e:(0,re.stringToBytes)(_e).buffer}class ue{constructor(_e,me={}){this.url=_e,this.isHttp=/^https?:/i.test(_e),this.httpHeaders=this.isHttp&&me.httpHeaders||Object.create(null),this.withCredentials=me.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(_e,me,ve){const Se={begin:_e,end:me};for(const Te in ve)Se[Te]=ve[Te];return this.request(Se)}requestFull(_e){return this.request(_e)}request(_e){const me=new XMLHttpRequest,ve=this.currXhrId++,Se=this.pendingRequests[ve]={xhr:me};me.open("GET",this.url),me.withCredentials=this.withCredentials;for(const Te in this.httpHeaders){const Pe=this.httpHeaders[Te];Pe!==void 0&&me.setRequestHeader(Te,Pe)}return this.isHttp&&"begin"in _e&&"end"in _e?(me.setRequestHeader("Range","bytes=".concat(_e.begin,"-").concat(_e.end-1)),Se.expectedStatus=oe):Se.expectedStatus=se,me.responseType="arraybuffer",_e.onError&&(me.onerror=function(Te){_e.onError(me.status)}),me.onreadystatechange=this.onStateChange.bind(this,ve),me.onprogress=this.onProgress.bind(this,ve),Se.onHeadersReceived=_e.onHeadersReceived,Se.onDone=_e.onDone,Se.onError=_e.onError,Se.onProgress=_e.onProgress,me.send(null),ve}onProgress(_e,me){var Se;const ve=this.pendingRequests[_e];ve&&((Se=ve.onProgress)==null||Se.call(ve,me))}onStateChange(_e,me){var $e,ye,Ee;const ve=this.pendingRequests[_e];if(!ve)return;const Se=ve.xhr;if(Se.readyState>=2&&ve.onHeadersReceived&&(ve.onHeadersReceived(),delete ve.onHeadersReceived),Se.readyState!==4||!(_e in this.pendingRequests))return;if(delete this.pendingRequests[_e],Se.status===0&&this.isHttp){($e=ve.onError)==null||$e.call(ve,Se.status);return}const Te=Se.status||se;if(!(Te===se&&ve.expectedStatus===oe)&&Te!==ve.expectedStatus){(ye=ve.onError)==null||ye.call(ve,Se.status);return}const Re=he(Se);if(Te===oe){const Ne=Se.getResponseHeader("Content-Range"),Me=/bytes (\d+)-(\d+)\/(\d+)/.exec(Ne);ve.onDone({begin:parseInt(Me[1],10),chunk:Re})}else Re?ve.onDone({begin:0,chunk:Re}):(Ee=ve.onError)==null||Ee.call(ve,Se.status)}getRequestXhr(_e){return this.pendingRequests[_e].xhr}isPendingRequest(_e){return _e in this.pendingRequests}abortRequest(_e){const me=this.pendingRequests[_e].xhr;delete this.pendingRequests[_e],me.abort()}}class de{constructor(_e){this._source=_e,this._manager=new ue(_e.url,{httpHeaders:_e.httpHeaders,withCredentials:_e.withCredentials}),this._rangeChunkSize=_e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(_e){const me=this._rangeRequestReaders.indexOf(_e);me>=0&&this._rangeRequestReaders.splice(me,1)}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new ae(this._manager,this._source),this._fullRequestReader}getRangeReader(_e,me){const ve=new le(this._manager,_e,me);return ve.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(ve),ve}cancelAllRequests(_e){var me;(me=this._fullRequestReader)==null||me.cancel(_e);for(const ve of this._rangeRequestReaders.slice(0))ve.cancel(_e)}}te.PDFNetworkStream=de;class ae{constructor(_e,me){this._manager=_e;const ve={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=me.url,this._fullRequestId=_e.requestFull(ve),this._headersReceivedCapability=new re.PromiseCapability,this._disableRange=me.disableRange||!1,this._contentLength=me.length,this._rangeChunkSize=me.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 _e=this._fullRequestId,me=this._manager.getRequestXhr(_e),ve=Pe=>me.getResponseHeader(Pe),{allowRangeRequests:Se,suggestedLength:Te}=(0,ie.validateRangeRequestCapabilities)({getResponseHeader:ve,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});Se&&(this._isRangeSupported=!0),this._contentLength=Te||this._contentLength,this._filename=(0,ie.extractFilenameFromHeader)(ve),this._isRangeSupported&&this._manager.abortRequest(_e),this._headersReceivedCapability.resolve()}_onDone(_e){if(_e&&(this._requests.length>0?this._requests.shift().resolve({value:_e.chunk,done:!1}):this._cachedChunks.push(_e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const me of this._requests)me.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(_e){this._storedError=(0,ie.createResponseStatusError)(_e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const me of this._requests)me.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(_e){var me;(me=this.onProgress)==null||me.call(this,{loaded:_e.loaded,total:_e.lengthComputable?_e.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 _e=new re.PromiseCapability;return this._requests.push(_e),_e.promise}cancel(_e){this._done=!0,this._headersReceivedCapability.reject(_e);for(const me of this._requests)me.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class le{constructor(_e,me,ve){this._manager=_e;const Se={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=_e.url,this._requestId=_e.requestRange(me,ve,Se),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var _e;(_e=this.onClosed)==null||_e.call(this,this)}_onDone(_e){const me=_e.chunk;this._requests.length>0?this._requests.shift().resolve({value:me,done:!1}):this._queuedChunk=me,this._done=!0;for(const ve of this._requests)ve.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(_e){this._storedError=(0,ie.createResponseStatusError)(_e,this._url);for(const me of this._requests)me.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(_e){var me;this.isStreamingSupported||(me=this.onProgress)==null||me.call(this,{loaded:_e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const me=this._queuedChunk;return this._queuedChunk=null,{value:me,done:!1}}if(this._done)return{value:void 0,done:!0};const _e=new re.PromiseCapability;return this._requests.push(_e),_e.promise}cancel(_e){this._done=!0;for(const me of this._requests)me.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFNodeStream=void 0;var re=ne(1),ie=ne(20);const se=/^file:\/\/\/[a-zA-Z]:\//;function oe(ve){const Se=require$$5,Te=Se.parse(ve);return Te.protocol==="file:"||Te.host?Te:/^[a-z]:[/\\]/i.test(ve)?Se.parse("file:///".concat(ve)):(Te.host||(Te.protocol="file:"),Te)}class he{constructor(Se){this.source=Se,this.url=oe(Se.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&Se.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var Se,Te;return(Te=(Se=this._fullRequestReader)==null?void 0:Se._loaded)!=null?Te:0}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new _e(this):new le(this),this._fullRequestReader}getRangeReader(Se,Te){if(Te<=this._progressiveDataLength)return null;const Pe=this.isFsUrl?new me(this,Se,Te):new Ae(this,Se,Te);return this._rangeRequestReaders.push(Pe),Pe}cancelAllRequests(Se){var Te;(Te=this._fullRequestReader)==null||Te.cancel(Se);for(const Pe of this._rangeRequestReaders.slice(0))Pe.cancel(Se)}}te.PDFNodeStream=he;class ue{constructor(Se){this._url=Se.url,this._done=!1,this._storedError=null,this.onProgress=null;const Te=Se.source;this._contentLength=Te.length,this._loaded=0,this._filename=null,this._disableRange=Te.disableRange||!1,this._rangeChunkSize=Te.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!Te.disableStream,this._isRangeSupported=!Te.disableRange,this._readableStream=null,this._readCapability=new re.PromiseCapability,this._headersCapability=new re.PromiseCapability}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 Pe;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Se=this._readableStream.read();return Se===null?(this._readCapability=new re.PromiseCapability,this.read()):(this._loaded+=Se.length,(Pe=this.onProgress)==null||Pe.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(Se).buffer,done:!1})}cancel(Se){if(!this._readableStream){this._error(Se);return}this._readableStream.destroy(Se)}_error(Se){this._storedError=Se,this._readCapability.resolve()}_setReadableStream(Se){this._readableStream=Se,Se.on("readable",()=>{this._readCapability.resolve()}),Se.on("end",()=>{Se.destroy(),this._done=!0,this._readCapability.resolve()}),Se.on("error",Te=>{this._error(Te)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new re.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class de{constructor(Se){this._url=Se.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new re.PromiseCapability;const Te=Se.source;this._isStreamingSupported=!Te.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var Pe;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Se=this._readableStream.read();return Se===null?(this._readCapability=new re.PromiseCapability,this.read()):(this._loaded+=Se.length,(Pe=this.onProgress)==null||Pe.call(this,{loaded:this._loaded}),{value:new Uint8Array(Se).buffer,done:!1})}cancel(Se){if(!this._readableStream){this._error(Se);return}this._readableStream.destroy(Se)}_error(Se){this._storedError=Se,this._readCapability.resolve()}_setReadableStream(Se){this._readableStream=Se,Se.on("readable",()=>{this._readCapability.resolve()}),Se.on("end",()=>{Se.destroy(),this._done=!0,this._readCapability.resolve()}),Se.on("error",Te=>{this._error(Te)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function ae(ve,Se){return{protocol:ve.protocol,auth:ve.auth,host:ve.hostname,port:ve.port,path:ve.path,method:"GET",headers:Se}}class le extends ue{constructor(Se){super(Se);const Te=Pe=>{if(Pe.statusCode===404){const Ee=new re.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=Ee,this._headersCapability.reject(Ee);return}this._headersCapability.resolve(),this._setReadableStream(Pe);const Re=Ee=>this._readableStream.headers[Ee.toLowerCase()],{allowRangeRequests:$e,suggestedLength:ye}=(0,ie.validateRangeRequestCapabilities)({getResponseHeader:Re,isHttp:Se.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=$e,this._contentLength=ye||this._contentLength,this._filename=(0,ie.extractFilenameFromHeader)(Re)};if(this._request=null,this._url.protocol==="http:"){const Pe=require$$5;this._request=Pe.request(ae(this._url,Se.httpHeaders),Te)}else{const Pe=require$$5;this._request=Pe.request(ae(this._url,Se.httpHeaders),Te)}this._request.on("error",Pe=>{this._storedError=Pe,this._headersCapability.reject(Pe)}),this._request.end()}}class Ae extends de{constructor(Se,Te,Pe){super(Se),this._httpHeaders={};for(const $e in Se.httpHeaders){const ye=Se.httpHeaders[$e];ye!==void 0&&(this._httpHeaders[$e]=ye)}this._httpHeaders.Range="bytes=".concat(Te,"-").concat(Pe-1);const Re=$e=>{if($e.statusCode===404){const ye=new re.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=ye;return}this._setReadableStream($e)};if(this._request=null,this._url.protocol==="http:"){const $e=require$$5;this._request=$e.request(ae(this._url,this._httpHeaders),Re)}else{const $e=require$$5;this._request=$e.request(ae(this._url,this._httpHeaders),Re)}this._request.on("error",$e=>{this._storedError=$e}),this._request.end()}}class _e extends ue{constructor(Se){super(Se);let Te=decodeURIComponent(this._url.path);se.test(this._url.href)&&(Te=Te.replace(/^\//,""));const Pe=require$$5;Pe.lstat(Te,(Re,$e)=>{if(Re){Re.code==="ENOENT"&&(Re=new re.MissingPDFException('Missing PDF "'.concat(Te,'".'))),this._storedError=Re,this._headersCapability.reject(Re);return}this._contentLength=$e.size,this._setReadableStream(Pe.createReadStream(Te)),this._headersCapability.resolve()})}}class me extends de{constructor(Se,Te,Pe){super(Se);let Re=decodeURIComponent(this._url.path);se.test(this._url.href)&&(Re=Re.replace(/^\//,""));const $e=require$$5;this._setReadableStream($e.createReadStream(Re,{start:Te,end:Pe-1}))}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.SVGGraphics=void 0;var re=ne(6),ie=ne(1);const se={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},oe="http://www.w3.org/XML/1998/namespace",he="http://www.w3.org/1999/xlink",ue=["butt","round","square"],de=["miter","round","bevel"],ae=function($e,ye="",Ee=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!Ee)return URL.createObjectURL(new Blob([$e],{type:ye}));const Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let Me="data:".concat(ye,";base64,");for(let we=0,Oe=$e.length;we<Oe;we+=3){const Fe=$e[we]&255,Ve=$e[we+1]&255,qe=$e[we+2]&255,Ie=Fe>>2,Xe=(Fe&3)<<4|Ve>>4,rt=we+1<Oe?(Ve&15)<<2|qe>>6:64,lt=we+2<Oe?qe&63:64;Me+=Ne[Ie]+Ne[Xe]+Ne[rt]+Ne[lt]}return Me},le=function(){const $e=new Uint8Array([137,80,78,71,13,10,26,10]),ye=12,Ee=new Int32Array(256);for(let qe=0;qe<256;qe++){let Ie=qe;for(let Xe=0;Xe<8;Xe++)Ie=Ie&1?3988292384^Ie>>1&2147483647:Ie>>1&2147483647;Ee[qe]=Ie}function Ne(qe,Ie,Xe){let rt=-1;for(let lt=Ie;lt<Xe;lt++){const Ge=(rt^qe[lt])&255,ut=Ee[Ge];rt=rt>>>8^ut}return rt^-1}function Me(qe,Ie,Xe,rt){let lt=rt;const Ge=Ie.length;Xe[lt]=Ge>>24&255,Xe[lt+1]=Ge>>16&255,Xe[lt+2]=Ge>>8&255,Xe[lt+3]=Ge&255,lt+=4,Xe[lt]=qe.charCodeAt(0)&255,Xe[lt+1]=qe.charCodeAt(1)&255,Xe[lt+2]=qe.charCodeAt(2)&255,Xe[lt+3]=qe.charCodeAt(3)&255,lt+=4,Xe.set(Ie,lt),lt+=Ie.length;const ut=Ne(Xe,rt+4,lt);Xe[lt]=ut>>24&255,Xe[lt+1]=ut>>16&255,Xe[lt+2]=ut>>8&255,Xe[lt+3]=ut&255}function we(qe,Ie,Xe){let rt=1,lt=0;for(let Ge=Ie;Ge<Xe;++Ge)rt=(rt+(qe[Ge]&255))%65521,lt=(lt+rt)%65521;return lt<<16|rt}function Oe(qe){if(!ie.isNodeJS)return Fe(qe);try{const Ie=parseInt(process.versions.node)>=8?qe:Buffer.from(qe),Xe=require$$5.deflateSync(Ie,{level:9});return Xe instanceof Uint8Array?Xe:new Uint8Array(Xe)}catch(Ie){(0,ie.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+Ie)}return Fe(qe)}function Fe(qe){let Ie=qe.length;const Xe=65535,rt=Math.ceil(Ie/Xe),lt=new Uint8Array(2+Ie+rt*5+4);let Ge=0;lt[Ge++]=120,lt[Ge++]=156;let ut=0;for(;Ie>Xe;)lt[Ge++]=0,lt[Ge++]=255,lt[Ge++]=255,lt[Ge++]=0,lt[Ge++]=0,lt.set(qe.subarray(ut,ut+Xe),Ge),Ge+=Xe,ut+=Xe,Ie-=Xe;lt[Ge++]=1,lt[Ge++]=Ie&255,lt[Ge++]=Ie>>8&255,lt[Ge++]=~Ie&65535&255,lt[Ge++]=(~Ie&65535)>>8&255,lt.set(qe.subarray(ut),Ge),Ge+=qe.length-ut;const mt=we(qe,0,qe.length);return lt[Ge++]=mt>>24&255,lt[Ge++]=mt>>16&255,lt[Ge++]=mt>>8&255,lt[Ge++]=mt&255,lt}function Ve(qe,Ie,Xe,rt){const lt=qe.width,Ge=qe.height;let ut,mt,wt;const Et=qe.data;switch(Ie){case ie.ImageKind.GRAYSCALE_1BPP:mt=0,ut=1,wt=lt+7>>3;break;case ie.ImageKind.RGB_24BPP:mt=2,ut=8,wt=lt*3;break;case ie.ImageKind.RGBA_32BPP:mt=6,ut=8,wt=lt*4;break;default:throw new Error("invalid format")}const De=new Uint8Array((1+wt)*Ge);let pe=0,be=0;for(let He=0;He<Ge;++He)De[pe++]=0,De.set(Et.subarray(be,be+wt),pe),be+=wt,pe+=wt;if(Ie===ie.ImageKind.GRAYSCALE_1BPP&&rt){pe=0;for(let He=0;He<Ge;He++){pe++;for(let it=0;it<wt;it++)De[pe++]^=255}}const ge=new Uint8Array([lt>>24&255,lt>>16&255,lt>>8&255,lt&255,Ge>>24&255,Ge>>16&255,Ge>>8&255,Ge&255,ut,mt,0,0,0]),Ce=Oe(De),xe=$e.length+ye*3+ge.length+Ce.length,Le=new Uint8Array(xe);let Be=0;return Le.set($e,Be),Be+=$e.length,Me("IHDR",ge,Le,Be),Be+=ye+ge.length,Me("IDATA",Ce,Le,Be),Be+=ye+Ce.length,Me("IEND",new Uint8Array(0),Le,Be),ae(Le,"image/png",Xe)}return function(Ie,Xe,rt){const lt=Ie.kind===void 0?ie.ImageKind.GRAYSCALE_1BPP:Ie.kind;return Ve(Ie,lt,Xe,rt)}}();class Ae{constructor(){this.fontSizeScale=1,this.fontWeight=se.fontWeight,this.fontSize=0,this.textMatrix=ie.IDENTITY_MATRIX,this.fontMatrix=ie.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=ie.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=se.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(ye,Ee){this.x=ye,this.y=Ee}}function _e($e){let ye=[];const Ee=[];for(const Ne of $e){if(Ne.fn==="save"){ye.push({fnId:92,fn:"group",items:[]}),Ee.push(ye),ye=ye.at(-1).items;continue}Ne.fn==="restore"?ye=Ee.pop():ye.push(Ne)}return ye}function me($e){if(Number.isInteger($e))return $e.toString();const ye=$e.toFixed(10);let Ee=ye.length-1;if(ye[Ee]!=="0")return ye;do Ee--;while(ye[Ee]==="0");return ye.substring(0,ye[Ee]==="."?Ee:Ee+1)}function ve($e){if($e[4]===0&&$e[5]===0){if($e[1]===0&&$e[2]===0)return $e[0]===1&&$e[3]===1?"":"scale(".concat(me($e[0])," ").concat(me($e[3]),")");if($e[0]===$e[3]&&$e[1]===-$e[2]){const ye=Math.acos($e[0])*180/Math.PI;return"rotate(".concat(me(ye),")")}}else if($e[0]===1&&$e[1]===0&&$e[2]===0&&$e[3]===1)return"translate(".concat(me($e[4])," ").concat(me($e[5]),")");return"matrix(".concat(me($e[0])," ").concat(me($e[1])," ").concat(me($e[2])," ").concat(me($e[3])," ").concat(me($e[4])," ")+"".concat(me($e[5]),")")}let Se=0,Te=0,Pe=0;class Re{constructor(ye,Ee,Ne=!1){(0,re.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new re.DOMSVGFactory,this.current=new Ae,this.transformMatrix=ie.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=ye,this.objs=Ee,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!Ne,this._operatorIdMapping=[];for(const Me in ie.OPS)this._operatorIdMapping[ie.OPS[Me]]=Me}getObject(ye,Ee=null){return typeof ye=="string"?ye.startsWith("g_")?this.commonObjs.get(ye):this.objs.get(ye):Ee}save(){this.transformStack.push(this.transformMatrix);const ye=this.current;this.extraStack.push(ye),this.current=ye.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(ye){this.save(),this.executeOpTree(ye),this.restore()}loadDependencies(ye){const Ee=ye.fnArray,Ne=ye.argsArray;for(let Me=0,we=Ee.length;Me<we;Me++)if(Ee[Me]===ie.OPS.dependency)for(const Oe of Ne[Me]){const Fe=Oe.startsWith("g_")?this.commonObjs:this.objs,Ve=new Promise(qe=>{Fe.get(Oe,qe)});this.current.dependencies.push(Ve)}return Promise.all(this.current.dependencies)}transform(ye,Ee,Ne,Me,we,Oe){const Fe=[ye,Ee,Ne,Me,we,Oe];this.transformMatrix=ie.Util.transform(this.transformMatrix,Fe),this.tgrp=null}getSVG(ye,Ee){this.viewport=Ee;const Ne=this._initialize(Ee);return this.loadDependencies(ye).then(()=>(this.transformMatrix=ie.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(ye)),Ne))}convertOpList(ye){const Ee=this._operatorIdMapping,Ne=ye.argsArray,Me=ye.fnArray,we=[];for(let Oe=0,Fe=Me.length;Oe<Fe;Oe++){const Ve=Me[Oe];we.push({fnId:Ve,fn:Ee[Ve],args:Ne[Oe]})}return _e(we)}executeOpTree(ye){for(const Ee of ye){const Ne=Ee.fn,Me=Ee.fnId,we=Ee.args;switch(Me|0){case ie.OPS.beginText:this.beginText();break;case ie.OPS.dependency:break;case ie.OPS.setLeading:this.setLeading(we);break;case ie.OPS.setLeadingMoveText:this.setLeadingMoveText(we[0],we[1]);break;case ie.OPS.setFont:this.setFont(we);break;case ie.OPS.showText:this.showText(we[0]);break;case ie.OPS.showSpacedText:this.showText(we[0]);break;case ie.OPS.endText:this.endText();break;case ie.OPS.moveText:this.moveText(we[0],we[1]);break;case ie.OPS.setCharSpacing:this.setCharSpacing(we[0]);break;case ie.OPS.setWordSpacing:this.setWordSpacing(we[0]);break;case ie.OPS.setHScale:this.setHScale(we[0]);break;case ie.OPS.setTextMatrix:this.setTextMatrix(we[0],we[1],we[2],we[3],we[4],we[5]);break;case ie.OPS.setTextRise:this.setTextRise(we[0]);break;case ie.OPS.setTextRenderingMode:this.setTextRenderingMode(we[0]);break;case ie.OPS.setLineWidth:this.setLineWidth(we[0]);break;case ie.OPS.setLineJoin:this.setLineJoin(we[0]);break;case ie.OPS.setLineCap:this.setLineCap(we[0]);break;case ie.OPS.setMiterLimit:this.setMiterLimit(we[0]);break;case ie.OPS.setFillRGBColor:this.setFillRGBColor(we[0],we[1],we[2]);break;case ie.OPS.setStrokeRGBColor:this.setStrokeRGBColor(we[0],we[1],we[2]);break;case ie.OPS.setStrokeColorN:this.setStrokeColorN(we);break;case ie.OPS.setFillColorN:this.setFillColorN(we);break;case ie.OPS.shadingFill:this.shadingFill(we[0]);break;case ie.OPS.setDash:this.setDash(we[0],we[1]);break;case ie.OPS.setRenderingIntent:this.setRenderingIntent(we[0]);break;case ie.OPS.setFlatness:this.setFlatness(we[0]);break;case ie.OPS.setGState:this.setGState(we[0]);break;case ie.OPS.fill:this.fill();break;case ie.OPS.eoFill:this.eoFill();break;case ie.OPS.stroke:this.stroke();break;case ie.OPS.fillStroke:this.fillStroke();break;case ie.OPS.eoFillStroke:this.eoFillStroke();break;case ie.OPS.clip:this.clip("nonzero");break;case ie.OPS.eoClip:this.clip("evenodd");break;case ie.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case ie.OPS.paintImageXObject:this.paintImageXObject(we[0]);break;case ie.OPS.paintInlineImageXObject:this.paintInlineImageXObject(we[0]);break;case ie.OPS.paintImageMaskXObject:this.paintImageMaskXObject(we[0]);break;case ie.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(we[0],we[1]);break;case ie.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case ie.OPS.closePath:this.closePath();break;case ie.OPS.closeStroke:this.closeStroke();break;case ie.OPS.closeFillStroke:this.closeFillStroke();break;case ie.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case ie.OPS.nextLine:this.nextLine();break;case ie.OPS.transform:this.transform(we[0],we[1],we[2],we[3],we[4],we[5]);break;case ie.OPS.constructPath:this.constructPath(we[0],we[1]);break;case ie.OPS.endPath:this.endPath();break;case 92:this.group(Ee.items);break;default:(0,ie.warn)("Unimplemented operator ".concat(Ne));break}}}setWordSpacing(ye){this.current.wordSpacing=ye}setCharSpacing(ye){this.current.charSpacing=ye}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(ye,Ee,Ne,Me,we,Oe){const Fe=this.current;Fe.textMatrix=Fe.lineMatrix=[ye,Ee,Ne,Me,we,Oe],Fe.textMatrixScale=Math.hypot(ye,Ee),Fe.x=Fe.lineX=0,Fe.y=Fe.lineY=0,Fe.xcoords=[],Fe.ycoords=[],Fe.tspan=this.svgFactory.createElement("svg:tspan"),Fe.tspan.setAttributeNS(null,"font-family",Fe.fontFamily),Fe.tspan.setAttributeNS(null,"font-size","".concat(me(Fe.fontSize),"px")),Fe.tspan.setAttributeNS(null,"y",me(-Fe.y)),Fe.txtElement=this.svgFactory.createElement("svg:text"),Fe.txtElement.append(Fe.tspan)}beginText(){const ye=this.current;ye.x=ye.lineX=0,ye.y=ye.lineY=0,ye.textMatrix=ie.IDENTITY_MATRIX,ye.lineMatrix=ie.IDENTITY_MATRIX,ye.textMatrixScale=1,ye.tspan=this.svgFactory.createElement("svg:tspan"),ye.txtElement=this.svgFactory.createElement("svg:text"),ye.txtgrp=this.svgFactory.createElement("svg:g"),ye.xcoords=[],ye.ycoords=[]}moveText(ye,Ee){const Ne=this.current;Ne.x=Ne.lineX+=ye,Ne.y=Ne.lineY+=Ee,Ne.xcoords=[],Ne.ycoords=[],Ne.tspan=this.svgFactory.createElement("svg:tspan"),Ne.tspan.setAttributeNS(null,"font-family",Ne.fontFamily),Ne.tspan.setAttributeNS(null,"font-size","".concat(me(Ne.fontSize),"px")),Ne.tspan.setAttributeNS(null,"y",me(-Ne.y))}showText(ye){const Ee=this.current,Ne=Ee.font,Me=Ee.fontSize;if(Me===0)return;const we=Ee.fontSizeScale,Oe=Ee.charSpacing,Fe=Ee.wordSpacing,Ve=Ee.fontDirection,qe=Ee.textHScale*Ve,Ie=Ne.vertical,Xe=Ie?1:-1,rt=Ne.defaultVMetrics,lt=Me*Ee.fontMatrix[0];let Ge=0;for(const wt of ye){if(wt===null){Ge+=Ve*Fe;continue}else if(typeof wt=="number"){Ge+=Xe*wt*Me/1e3;continue}const Et=(wt.isSpace?Fe:0)+Oe,De=wt.fontChar;let pe,be,ge=wt.width;if(Ie){let xe;const Le=wt.vmetric||rt;xe=wt.vmetric?Le[1]:ge*.5,xe=-xe*lt;const Be=Le[2]*lt;ge=Le?-Le[0]:ge,pe=xe/we,be=(Ge+Be)/we}else pe=Ge/we,be=0;(wt.isInFont||Ne.missingFile)&&(Ee.xcoords.push(Ee.x+pe),Ie&&Ee.ycoords.push(-Ee.y+be),Ee.tspan.textContent+=De);const Ce=Ie?ge*lt-Et*Ve:ge*lt+Et*Ve;Ge+=Ce}Ee.tspan.setAttributeNS(null,"x",Ee.xcoords.map(me).join(" ")),Ie?Ee.tspan.setAttributeNS(null,"y",Ee.ycoords.map(me).join(" ")):Ee.tspan.setAttributeNS(null,"y",me(-Ee.y)),Ie?Ee.y-=Ge:Ee.x+=Ge*qe,Ee.tspan.setAttributeNS(null,"font-family",Ee.fontFamily),Ee.tspan.setAttributeNS(null,"font-size","".concat(me(Ee.fontSize),"px")),Ee.fontStyle!==se.fontStyle&&Ee.tspan.setAttributeNS(null,"font-style",Ee.fontStyle),Ee.fontWeight!==se.fontWeight&&Ee.tspan.setAttributeNS(null,"font-weight",Ee.fontWeight);const ut=Ee.textRenderingMode&ie.TextRenderingMode.FILL_STROKE_MASK;if(ut===ie.TextRenderingMode.FILL||ut===ie.TextRenderingMode.FILL_STROKE?(Ee.fillColor!==se.fillColor&&Ee.tspan.setAttributeNS(null,"fill",Ee.fillColor),Ee.fillAlpha<1&&Ee.tspan.setAttributeNS(null,"fill-opacity",Ee.fillAlpha)):Ee.textRenderingMode===ie.TextRenderingMode.ADD_TO_PATH?Ee.tspan.setAttributeNS(null,"fill","transparent"):Ee.tspan.setAttributeNS(null,"fill","none"),ut===ie.TextRenderingMode.STROKE||ut===ie.TextRenderingMode.FILL_STROKE){const wt=1/(Ee.textMatrixScale||1);this._setStrokeAttributes(Ee.tspan,wt)}let mt=Ee.textMatrix;Ee.textRise!==0&&(mt=mt.slice(),mt[5]+=Ee.textRise),Ee.txtElement.setAttributeNS(null,"transform","".concat(ve(mt)," scale(").concat(me(qe),", -1)")),Ee.txtElement.setAttributeNS(oe,"xml:space","preserve"),Ee.txtElement.append(Ee.tspan),Ee.txtgrp.append(Ee.txtElement),this._ensureTransformGroup().append(Ee.txtElement)}setLeadingMoveText(ye,Ee){this.setLeading(-Ee),this.moveText(ye,Ee)}addFontStyle(ye){if(!ye.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const Ee=ae(ye.data,ye.mimetype,this.forceDataSchema);this.cssStyle.textContent+='@font-face { font-family: "'.concat(ye.loadedName,'";')+" src: url(".concat(Ee,"); }\n")}setFont(ye){const Ee=this.current,Ne=this.commonObjs.get(ye[0]);let Me=ye[1];Ee.font=Ne,this.embedFonts&&!Ne.missingFile&&!this.embeddedFonts[Ne.loadedName]&&(this.addFontStyle(Ne),this.embeddedFonts[Ne.loadedName]=Ne),Ee.fontMatrix=Ne.fontMatrix||ie.FONT_IDENTITY_MATRIX;let we="normal";Ne.black?we="900":Ne.bold&&(we="bold");const Oe=Ne.italic?"italic":"normal";Me<0?(Me=-Me,Ee.fontDirection=-1):Ee.fontDirection=1,Ee.fontSize=Me,Ee.fontFamily=Ne.loadedName,Ee.fontWeight=we,Ee.fontStyle=Oe,Ee.tspan=this.svgFactory.createElement("svg:tspan"),Ee.tspan.setAttributeNS(null,"y",me(-Ee.y)),Ee.xcoords=[],Ee.ycoords=[]}endText(){var Ee;const ye=this.current;ye.textRenderingMode&ie.TextRenderingMode.ADD_TO_PATH_FLAG&&((Ee=ye.txtElement)!=null&&Ee.hasChildNodes())&&(ye.element=ye.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(ye){ye>0&&(this.current.lineWidth=ye)}setLineCap(ye){this.current.lineCap=ue[ye]}setLineJoin(ye){this.current.lineJoin=de[ye]}setMiterLimit(ye){this.current.miterLimit=ye}setStrokeAlpha(ye){this.current.strokeAlpha=ye}setStrokeRGBColor(ye,Ee,Ne){this.current.strokeColor=ie.Util.makeHexColor(ye,Ee,Ne)}setFillAlpha(ye){this.current.fillAlpha=ye}setFillRGBColor(ye,Ee,Ne){this.current.fillColor=ie.Util.makeHexColor(ye,Ee,Ne),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(ye){this.current.strokeColor=this._makeColorN_Pattern(ye)}setFillColorN(ye){this.current.fillColor=this._makeColorN_Pattern(ye)}shadingFill(ye){const{width:Ee,height:Ne}=this.viewport,Me=ie.Util.inverseTransform(this.transformMatrix),[we,Oe,Fe,Ve]=ie.Util.getAxialAlignedBoundingBox([0,0,Ee,Ne],Me),qe=this.svgFactory.createElement("svg:rect");qe.setAttributeNS(null,"x",we),qe.setAttributeNS(null,"y",Oe),qe.setAttributeNS(null,"width",Fe-we),qe.setAttributeNS(null,"height",Ve-Oe),qe.setAttributeNS(null,"fill",this._makeShadingPattern(ye)),this.current.fillAlpha<1&&qe.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(qe)}_makeColorN_Pattern(ye){return ye[0]==="TilingPattern"?this._makeTilingPattern(ye):this._makeShadingPattern(ye)}_makeTilingPattern(ye){const Ee=ye[1],Ne=ye[2],Me=ye[3]||ie.IDENTITY_MATRIX,[we,Oe,Fe,Ve]=ye[4],qe=ye[5],Ie=ye[6],Xe=ye[7],rt="shading".concat(Pe++),[lt,Ge,ut,mt]=ie.Util.normalizeRect([...ie.Util.applyTransform([we,Oe],Me),...ie.Util.applyTransform([Fe,Ve],Me)]),[wt,Et]=ie.Util.singularValueDecompose2dScale(Me),De=qe*wt,pe=Ie*Et,be=this.svgFactory.createElement("svg:pattern");be.setAttributeNS(null,"id",rt),be.setAttributeNS(null,"patternUnits","userSpaceOnUse"),be.setAttributeNS(null,"width",De),be.setAttributeNS(null,"height",pe),be.setAttributeNS(null,"x","".concat(lt)),be.setAttributeNS(null,"y","".concat(Ge));const ge=this.svg,Ce=this.transformMatrix,xe=this.current.fillColor,Le=this.current.strokeColor,Be=this.svgFactory.create(ut-lt,mt-Ge);if(this.svg=Be,this.transformMatrix=Me,Xe===2){const He=ie.Util.makeHexColor(...Ee);this.current.fillColor=He,this.current.strokeColor=He}return this.executeOpTree(this.convertOpList(Ne)),this.svg=ge,this.transformMatrix=Ce,this.current.fillColor=xe,this.current.strokeColor=Le,be.append(Be.childNodes[0]),this.defs.append(be),"url(#".concat(rt,")")}_makeShadingPattern(ye){switch(typeof ye=="string"&&(ye=this.objs.get(ye)),ye[0]){case"RadialAxial":const Ee="shading".concat(Pe++),Ne=ye[3];let Me;switch(ye[1]){case"axial":const we=ye[4],Oe=ye[5];Me=this.svgFactory.createElement("svg:linearGradient"),Me.setAttributeNS(null,"id",Ee),Me.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),Me.setAttributeNS(null,"x1",we[0]),Me.setAttributeNS(null,"y1",we[1]),Me.setAttributeNS(null,"x2",Oe[0]),Me.setAttributeNS(null,"y2",Oe[1]);break;case"radial":const Fe=ye[4],Ve=ye[5],qe=ye[6],Ie=ye[7];Me=this.svgFactory.createElement("svg:radialGradient"),Me.setAttributeNS(null,"id",Ee),Me.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),Me.setAttributeNS(null,"cx",Ve[0]),Me.setAttributeNS(null,"cy",Ve[1]),Me.setAttributeNS(null,"r",Ie),Me.setAttributeNS(null,"fx",Fe[0]),Me.setAttributeNS(null,"fy",Fe[1]),Me.setAttributeNS(null,"fr",qe);break;default:throw new Error("Unknown RadialAxial type: ".concat(ye[1]))}for(const we of Ne){const Oe=this.svgFactory.createElement("svg:stop");Oe.setAttributeNS(null,"offset",we[0]),Oe.setAttributeNS(null,"stop-color",we[1]),Me.append(Oe)}return this.defs.append(Me),"url(#".concat(Ee,")");case"Mesh":return(0,ie.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(ye[0]))}}setDash(ye,Ee){this.current.dashArray=ye,this.current.dashPhase=Ee}constructPath(ye,Ee){const Ne=this.current;let Me=Ne.x,we=Ne.y,Oe=[],Fe=0;for(const Ve of ye)switch(Ve|0){case ie.OPS.rectangle:Me=Ee[Fe++],we=Ee[Fe++];const qe=Ee[Fe++],Ie=Ee[Fe++],Xe=Me+qe,rt=we+Ie;Oe.push("M",me(Me),me(we),"L",me(Xe),me(we),"L",me(Xe),me(rt),"L",me(Me),me(rt),"Z");break;case ie.OPS.moveTo:Me=Ee[Fe++],we=Ee[Fe++],Oe.push("M",me(Me),me(we));break;case ie.OPS.lineTo:Me=Ee[Fe++],we=Ee[Fe++],Oe.push("L",me(Me),me(we));break;case ie.OPS.curveTo:Me=Ee[Fe+4],we=Ee[Fe+5],Oe.push("C",me(Ee[Fe]),me(Ee[Fe+1]),me(Ee[Fe+2]),me(Ee[Fe+3]),me(Me),me(we)),Fe+=6;break;case ie.OPS.curveTo2:Oe.push("C",me(Me),me(we),me(Ee[Fe]),me(Ee[Fe+1]),me(Ee[Fe+2]),me(Ee[Fe+3])),Me=Ee[Fe+2],we=Ee[Fe+3],Fe+=4;break;case ie.OPS.curveTo3:Me=Ee[Fe+2],we=Ee[Fe+3],Oe.push("C",me(Ee[Fe]),me(Ee[Fe+1]),me(Me),me(we),me(Me),me(we)),Fe+=4;break;case ie.OPS.closePath:Oe.push("Z");break}Oe=Oe.join(" "),Ne.path&&ye.length>0&&ye[0]!==ie.OPS.rectangle&&ye[0]!==ie.OPS.moveTo?Oe=Ne.path.getAttributeNS(null,"d")+Oe:(Ne.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(Ne.path)),Ne.path.setAttributeNS(null,"d",Oe),Ne.path.setAttributeNS(null,"fill","none"),Ne.element=Ne.path,Ne.setCurrentPoint(Me,we)}endPath(){const ye=this.current;if(ye.path=null,!this.pendingClip)return;if(!ye.element){this.pendingClip=null;return}const Ee="clippath".concat(Se++),Ne=this.svgFactory.createElement("svg:clipPath");Ne.setAttributeNS(null,"id",Ee),Ne.setAttributeNS(null,"transform",ve(this.transformMatrix));const Me=ye.element.cloneNode(!0);if(this.pendingClip==="evenodd"?Me.setAttributeNS(null,"clip-rule","evenodd"):Me.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,Ne.append(Me),this.defs.append(Ne),ye.activeClipUrl){ye.clipGroup=null;for(const we of this.extraStack)we.clipGroup=null;Ne.setAttributeNS(null,"clip-path",ye.activeClipUrl)}ye.activeClipUrl="url(#".concat(Ee,")"),this.tgrp=null}clip(ye){this.pendingClip=ye}closePath(){const ye=this.current;if(ye.path){const Ee="".concat(ye.path.getAttributeNS(null,"d"),"Z");ye.path.setAttributeNS(null,"d",Ee)}}setLeading(ye){this.current.leading=-ye}setTextRise(ye){this.current.textRise=ye}setTextRenderingMode(ye){this.current.textRenderingMode=ye}setHScale(ye){this.current.textHScale=ye/100}setRenderingIntent(ye){}setFlatness(ye){}setGState(ye){for(const[Ee,Ne]of ye)switch(Ee){case"LW":this.setLineWidth(Ne);break;case"LC":this.setLineCap(Ne);break;case"LJ":this.setLineJoin(Ne);break;case"ML":this.setMiterLimit(Ne);break;case"D":this.setDash(Ne[0],Ne[1]);break;case"RI":this.setRenderingIntent(Ne);break;case"FL":this.setFlatness(Ne);break;case"Font":this.setFont(Ne);break;case"CA":this.setStrokeAlpha(Ne);break;case"ca":this.setFillAlpha(Ne);break;default:(0,ie.warn)("Unimplemented graphic state operator ".concat(Ee));break}}fill(){const ye=this.current;ye.element&&(ye.element.setAttributeNS(null,"fill",ye.fillColor),ye.element.setAttributeNS(null,"fill-opacity",ye.fillAlpha),this.endPath())}stroke(){const ye=this.current;ye.element&&(this._setStrokeAttributes(ye.element),ye.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(ye,Ee=1){const Ne=this.current;let Me=Ne.dashArray;Ee!==1&&Me.length>0&&(Me=Me.map(function(we){return Ee*we})),ye.setAttributeNS(null,"stroke",Ne.strokeColor),ye.setAttributeNS(null,"stroke-opacity",Ne.strokeAlpha),ye.setAttributeNS(null,"stroke-miterlimit",me(Ne.miterLimit)),ye.setAttributeNS(null,"stroke-linecap",Ne.lineCap),ye.setAttributeNS(null,"stroke-linejoin",Ne.lineJoin),ye.setAttributeNS(null,"stroke-width",me(Ee*Ne.lineWidth)+"px"),ye.setAttributeNS(null,"stroke-dasharray",Me.map(me).join(" ")),ye.setAttributeNS(null,"stroke-dashoffset",me(Ee*Ne.dashPhase)+"px")}eoFill(){var ye;(ye=this.current.element)==null||ye.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var ye;(ye=this.current.element)==null||ye.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const ye=this.svgFactory.createElement("svg:rect");ye.setAttributeNS(null,"x","0"),ye.setAttributeNS(null,"y","0"),ye.setAttributeNS(null,"width","1px"),ye.setAttributeNS(null,"height","1px"),ye.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(ye)}paintImageXObject(ye){const Ee=this.getObject(ye);if(!Ee){(0,ie.warn)("Dependent image with object ID ".concat(ye," is not ready yet"));return}this.paintInlineImageXObject(Ee)}paintInlineImageXObject(ye,Ee){const Ne=ye.width,Me=ye.height,we=le(ye,this.forceDataSchema,!!Ee),Oe=this.svgFactory.createElement("svg:rect");Oe.setAttributeNS(null,"x","0"),Oe.setAttributeNS(null,"y","0"),Oe.setAttributeNS(null,"width",me(Ne)),Oe.setAttributeNS(null,"height",me(Me)),this.current.element=Oe,this.clip("nonzero");const Fe=this.svgFactory.createElement("svg:image");Fe.setAttributeNS(he,"xlink:href",we),Fe.setAttributeNS(null,"x","0"),Fe.setAttributeNS(null,"y",me(-Me)),Fe.setAttributeNS(null,"width",me(Ne)+"px"),Fe.setAttributeNS(null,"height",me(Me)+"px"),Fe.setAttributeNS(null,"transform","scale(".concat(me(1/Ne)," ").concat(me(-1/Me),")")),Ee?Ee.append(Fe):this._ensureTransformGroup().append(Fe)}paintImageMaskXObject(ye){const Ee=this.getObject(ye.data,ye);if(Ee.bitmap){(0,ie.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const Ne=this.current,Me=Ee.width,we=Ee.height,Oe=Ne.fillColor;Ne.maskId="mask".concat(Te++);const Fe=this.svgFactory.createElement("svg:mask");Fe.setAttributeNS(null,"id",Ne.maskId);const Ve=this.svgFactory.createElement("svg:rect");Ve.setAttributeNS(null,"x","0"),Ve.setAttributeNS(null,"y","0"),Ve.setAttributeNS(null,"width",me(Me)),Ve.setAttributeNS(null,"height",me(we)),Ve.setAttributeNS(null,"fill",Oe),Ve.setAttributeNS(null,"mask","url(#".concat(Ne.maskId,")")),this.defs.append(Fe),this._ensureTransformGroup().append(Ve),this.paintInlineImageXObject(Ee,Fe)}paintFormXObjectBegin(ye,Ee){if(Array.isArray(ye)&&ye.length===6&&this.transform(ye[0],ye[1],ye[2],ye[3],ye[4],ye[5]),Ee){const Ne=Ee[2]-Ee[0],Me=Ee[3]-Ee[1],we=this.svgFactory.createElement("svg:rect");we.setAttributeNS(null,"x",Ee[0]),we.setAttributeNS(null,"y",Ee[1]),we.setAttributeNS(null,"width",me(Ne)),we.setAttributeNS(null,"height",me(Me)),this.current.element=we,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(ye){const Ee=this.svgFactory.create(ye.width,ye.height),Ne=this.svgFactory.createElement("svg:defs");Ee.append(Ne),this.defs=Ne;const Me=this.svgFactory.createElement("svg:g");return Me.setAttributeNS(null,"transform",ve(ye.transform)),Ee.append(Me),this.svg=Me,Ee}_ensureClipGroup(){if(!this.current.clipGroup){const ye=this.svgFactory.createElement("svg:g");ye.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(ye),this.current.clipGroup=ye}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",ve(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}te.SVGGraphics=Re},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.XfaText=void 0;class ne{static textContent(ie){const se=[],oe={items:se,styles:Object.create(null)};function he(ue){var le;if(!ue)return;let de=null;const ae=ue.name;if(ae==="#text")de=ue.value;else if(ne.shouldBuildText(ae))(le=ue==null?void 0:ue.attributes)!=null&&le.textContent?de=ue.attributes.textContent:ue.value&&(de=ue.value);else return;if(de!==null&&se.push({str:de}),!!ue.children)for(const Ae of ue.children)he(Ae)}return he(ie),oe}static shouldBuildText(ie){return!(ie==="textarea"||ie==="input"||ie==="option"||ie==="select")}}te.XfaText=ne},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.TextLayerRenderTask=void 0,te.renderTextLayer=ve,te.updateTextLayer=Se;var re=ne(1),ie=ne(6);const se=1e5,oe=30,he=.8,ue=new Map;function de(Te,Pe){let Re;if(Pe&&re.FeatureTest.isOffscreenCanvasSupported)Re=new OffscreenCanvas(Te,Te).getContext("2d",{alpha:!1});else{const $e=document.createElement("canvas");$e.width=$e.height=Te,Re=$e.getContext("2d",{alpha:!1})}return Re}function ae(Te,Pe){const Re=ue.get(Te);if(Re)return Re;const $e=de(oe,Pe);$e.font="".concat(oe,"px ").concat(Te);const ye=$e.measureText("");let Ee=ye.fontBoundingBoxAscent,Ne=Math.abs(ye.fontBoundingBoxDescent);if(Ee){const we=Ee/(Ee+Ne);return ue.set(Te,we),$e.canvas.width=$e.canvas.height=0,we}$e.strokeStyle="red",$e.clearRect(0,0,oe,oe),$e.strokeText("g",0,0);let Me=$e.getImageData(0,0,oe,oe).data;Ne=0;for(let we=Me.length-1-3;we>=0;we-=4)if(Me[we]>0){Ne=Math.ceil(we/4/oe);break}$e.clearRect(0,0,oe,oe),$e.strokeText("A",0,oe),Me=$e.getImageData(0,0,oe,oe).data,Ee=0;for(let we=0,Oe=Me.length;we<Oe;we+=4)if(Me[we]>0){Ee=oe-Math.floor(we/4/oe);break}if($e.canvas.width=$e.canvas.height=0,Ee){const we=Ee/(Ee+Ne);return ue.set(Te,we),we}return ue.set(Te,he),he}function le(Te,Pe,Re){const $e=document.createElement("span"),ye={angle:0,canvasWidth:0,hasText:Pe.str!=="",hasEOL:Pe.hasEOL,fontSize:0};Te._textDivs.push($e);const Ee=re.Util.transform(Te._transform,Pe.transform);let Ne=Math.atan2(Ee[1],Ee[0]);const Me=Re[Pe.fontName];Me.vertical&&(Ne+=Math.PI/2);const we=Math.hypot(Ee[2],Ee[3]),Oe=we*ae(Me.fontFamily,Te._isOffscreenCanvasSupported);let Fe,Ve;Ne===0?(Fe=Ee[4],Ve=Ee[5]-Oe):(Fe=Ee[4]+Oe*Math.sin(Ne),Ve=Ee[5]-Oe*Math.cos(Ne));const qe="calc(var(--scale-factor)*",Ie=$e.style;Te._container===Te._rootContainer?(Ie.left="".concat((100*Fe/Te._pageWidth).toFixed(2),"%"),Ie.top="".concat((100*Ve/Te._pageHeight).toFixed(2),"%")):(Ie.left="".concat(qe).concat(Fe.toFixed(2),"px)"),Ie.top="".concat(qe).concat(Ve.toFixed(2),"px)")),Ie.fontSize="".concat(qe).concat(we.toFixed(2),"px)"),Ie.fontFamily=Me.fontFamily,ye.fontSize=we,$e.setAttribute("role","presentation"),$e.textContent=Pe.str,$e.dir=Pe.dir,Te._fontInspectorEnabled&&($e.dataset.fontName=Pe.fontName),Ne!==0&&(ye.angle=Ne*(180/Math.PI));let Xe=!1;if(Pe.str.length>1)Xe=!0;else if(Pe.str!==" "&&Pe.transform[0]!==Pe.transform[3]){const rt=Math.abs(Pe.transform[0]),lt=Math.abs(Pe.transform[3]);rt!==lt&&Math.max(rt,lt)/Math.min(rt,lt)>1.5&&(Xe=!0)}Xe&&(ye.canvasWidth=Me.vertical?Pe.height:Pe.width),Te._textDivProperties.set($e,ye),Te._isReadableStream&&Te._layoutText($e)}function Ae(Te){const{div:Pe,scale:Re,properties:$e,ctx:ye,prevFontSize:Ee,prevFontFamily:Ne}=Te,{style:Me}=Pe;let we="";if($e.canvasWidth!==0&&$e.hasText){const{fontFamily:Oe}=Me,{canvasWidth:Fe,fontSize:Ve}=$e;(Ee!==Ve||Ne!==Oe)&&(ye.font="".concat(Ve*Re,"px ").concat(Oe),Te.prevFontSize=Ve,Te.prevFontFamily=Oe);const{width:qe}=ye.measureText(Pe.textContent);qe>0&&(we="scaleX(".concat(Fe*Re/qe,")"))}$e.angle!==0&&(we="rotate(".concat($e.angle,"deg) ").concat(we)),we.length>0&&(Me.transform=we)}function _e(Te){if(Te._canceled)return;const Pe=Te._textDivs,Re=Te._capability;if(Pe.length>se){Re.resolve();return}if(!Te._isReadableStream)for(const ye of Pe)Te._layoutText(ye);Re.resolve()}class me{constructor({textContentSource:Pe,container:Re,viewport:$e,textDivs:ye,textDivProperties:Ee,textContentItemsStr:Ne,isOffscreenCanvasSupported:Me}){var qe;this._textContentSource=Pe,this._isReadableStream=Pe instanceof ReadableStream,this._container=this._rootContainer=Re,this._textDivs=ye||[],this._textContentItemsStr=Ne||[],this._isOffscreenCanvasSupported=Me,this._fontInspectorEnabled=!!((qe=globalThis.FontInspector)!=null&&qe.enabled),this._reader=null,this._textDivProperties=Ee||new WeakMap,this._canceled=!1,this._capability=new re.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:$e.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:de(0,Me)};const{pageWidth:we,pageHeight:Oe,pageX:Fe,pageY:Ve}=$e.rawDims;this._transform=[1,0,0,-1,-Fe,Ve+Oe],this._pageWidth=we,this._pageHeight=Oe,(0,ie.setLayerDimensions)(Re,$e),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new re.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new re.AbortException("TextLayer task cancelled."))}_processItems(Pe,Re){for(const $e of Pe){if($e.str===void 0){if($e.type==="beginMarkedContentProps"||$e.type==="beginMarkedContent"){const ye=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),$e.id!==null&&this._container.setAttribute("id","".concat($e.id)),ye.append(this._container)}else $e.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push($e.str),le(this,$e,Re)}}_layoutText(Pe){const Re=this._layoutTextParams.properties=this._textDivProperties.get(Pe);if(this._layoutTextParams.div=Pe,Ae(this._layoutTextParams),Re.hasText&&this._container.append(Pe),Re.hasEOL){const $e=document.createElement("br");$e.setAttribute("role","presentation"),this._container.append($e)}}_render(){const Pe=new re.PromiseCapability;let Re=Object.create(null);if(this._isReadableStream){const $e=()=>{this._reader.read().then(({value:ye,done:Ee})=>{if(Ee){Pe.resolve();return}Object.assign(Re,ye.styles),this._processItems(ye.items,Re),$e()},Pe.reject)};this._reader=this._textContentSource.getReader(),$e()}else if(this._textContentSource){const{items:$e,styles:ye}=this._textContentSource;this._processItems($e,ye),Pe.resolve()}else throw new Error('No "textContentSource" parameter specified.');Pe.promise.then(()=>{Re=null,_e(this)},this._capability.reject)}}te.TextLayerRenderTask=me;function ve(Te){!Te.textContentSource&&(Te.textContent||Te.textContentStream)&&((0,ie.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),Te.textContentSource=Te.textContent||Te.textContentStream);const{container:Pe,viewport:Re}=Te,$e=getComputedStyle(Pe),ye=$e.getPropertyValue("visibility"),Ee=parseFloat($e.getPropertyValue("--scale-factor"));ye==="visible"&&(!Ee||Math.abs(Ee-Re.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const Ne=new me(Te);return Ne._render(),Ne}function Se({container:Te,viewport:Pe,textDivs:Re,textDivProperties:$e,isOffscreenCanvasSupported:ye,mustRotate:Ee=!0,mustRescale:Ne=!0}){if(Ee&&(0,ie.setLayerDimensions)(Te,{rotation:Pe.rotation}),Ne){const Me=de(0,ye),Oe={prevFontSize:null,prevFontFamily:null,div:null,scale:Pe.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:Me};for(const Fe of Re)Oe.properties=$e.get(Fe),Oe.div=Fe,Ae(Oe)}}},(ee,te,ne)=>{var ae,le,Ae,_e,me,ve,Se,Te,Pe,Re,$e,Er,Ee,Jn,Me,Tr,Oe,Cr;Object.defineProperty(te,"__esModule",{value:!0}),te.AnnotationEditorLayer=void 0;var re=ne(1),ie=ne(4),se=ne(28),oe=ne(33),he=ne(6),ue=ne(34);const Ve=class Ve{constructor({uiManager:Ie,pageIndex:Xe,div:rt,accessibilityManager:lt,annotationLayer:Ge,viewport:ut,l10n:mt}){We(this,$e);We(this,Ee);We(this,Me);We(this,Oe);We(this,ae,void 0);We(this,le,!1);We(this,Ae,null);We(this,_e,this.pointerup.bind(this));We(this,me,this.pointerdown.bind(this));We(this,ve,new Map);We(this,Se,!1);We(this,Te,!1);We(this,Pe,!1);We(this,Re,void 0);const wt=[se.FreeTextEditor,oe.InkEditor,ue.StampEditor];if(!Ve._initialized){Ve._initialized=!0;for(const Et of wt)Et.initialize(mt)}Ie.registerEditorTypes(wt),st(this,Re,Ie),this.pageIndex=Xe,this.div=rt,st(this,ae,lt),st(this,Ae,Ge),this.viewport=ut,ce(this,Re).addLayer(this)}get isEmpty(){return ce(this,ve).size===0}updateToolbar(Ie){ce(this,Re).updateToolbar(Ie)}updateMode(Ie=ce(this,Re).getMode()){Ke(this,Oe,Cr).call(this),Ie===re.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),Ie!==re.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",Ie===re.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",Ie===re.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",Ie===re.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(Ie){if(!Ie&&ce(this,Re).getMode()!==re.AnnotationEditorType.INK)return;if(!Ie){for(const rt of ce(this,ve).values())if(rt.isEmpty()){rt.setInBackground();return}}Ke(this,Ee,Jn).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(Ie){ce(this,Re).setEditingState(Ie)}addCommands(Ie){ce(this,Re).addCommands(Ie)}enable(){this.div.style.pointerEvents="auto";const Ie=new Set;for(const rt of ce(this,ve).values())rt.enableEditing(),rt.annotationElementId&&Ie.add(rt.annotationElementId);if(!ce(this,Ae))return;const Xe=ce(this,Ae).getEditableAnnotations();for(const rt of Xe){if(rt.hide(),ce(this,Re).isDeletedAnnotationElement(rt.data.id)||Ie.has(rt.data.id))continue;const lt=this.deserialize(rt);lt&&(this.addOrRebuild(lt),lt.enableEditing())}}disable(){var Xe;st(this,Pe,!0),this.div.style.pointerEvents="none";const Ie=new Set;for(const rt of ce(this,ve).values()){if(rt.disableEditing(),!rt.annotationElementId||rt.serialize()!==null){Ie.add(rt.annotationElementId);continue}(Xe=this.getEditableAnnotation(rt.annotationElementId))==null||Xe.show(),rt.remove()}if(ce(this,Ae)){const rt=ce(this,Ae).getEditableAnnotations();for(const lt of rt){const{id:Ge}=lt.data;Ie.has(Ge)||ce(this,Re).isDeletedAnnotationElement(Ge)||lt.show()}}Ke(this,Oe,Cr).call(this),this.isEmpty&&(this.div.hidden=!0),st(this,Pe,!1)}getEditableAnnotation(Ie){var Xe;return((Xe=ce(this,Ae))==null?void 0:Xe.getEditableAnnotation(Ie))||null}setActiveEditor(Ie){ce(this,Re).getActive()!==Ie&&ce(this,Re).setActiveEditor(Ie)}enableClick(){this.div.addEventListener("pointerdown",ce(this,me)),this.div.addEventListener("pointerup",ce(this,_e))}disableClick(){this.div.removeEventListener("pointerdown",ce(this,me)),this.div.removeEventListener("pointerup",ce(this,_e))}attach(Ie){ce(this,ve).set(Ie.id,Ie);const{annotationElementId:Xe}=Ie;Xe&&ce(this,Re).isDeletedAnnotationElement(Xe)&&ce(this,Re).removeDeletedAnnotationElement(Ie)}detach(Ie){var Xe;ce(this,ve).delete(Ie.id),(Xe=ce(this,ae))==null||Xe.removePointerInTextLayer(Ie.contentDiv),!ce(this,Pe)&&Ie.annotationElementId&&ce(this,Re).addDeletedAnnotationElement(Ie)}remove(Ie){this.detach(Ie),ce(this,Re).removeEditor(Ie),Ie.div.contains(document.activeElement)&&setTimeout(()=>{ce(this,Re).focusMainContainer()},0),Ie.div.remove(),Ie.isAttachedToDOM=!1,ce(this,Te)||this.addInkEditorIfNeeded(!1)}changeParent(Ie){var Xe;Ie.parent!==this&&(Ie.annotationElementId&&(ce(this,Re).addDeletedAnnotationElement(Ie.annotationElementId),ie.AnnotationEditor.deleteAnnotationElement(Ie),Ie.annotationElementId=null),this.attach(Ie),(Xe=Ie.parent)==null||Xe.detach(Ie),Ie.setParent(this),Ie.div&&Ie.isAttachedToDOM&&(Ie.div.remove(),this.div.append(Ie.div)))}add(Ie){if(this.changeParent(Ie),ce(this,Re).addEditor(Ie),this.attach(Ie),!Ie.isAttachedToDOM){const Xe=Ie.render();this.div.append(Xe),Ie.isAttachedToDOM=!0}Ie.fixAndSetPosition(),Ie.onceAdded(),ce(this,Re).addToAnnotationStorage(Ie)}moveEditorInDOM(Ie){var rt;if(!Ie.isAttachedToDOM)return;const{activeElement:Xe}=document;Ie.div.contains(Xe)&&(Ie._focusEventsAllowed=!1,setTimeout(()=>{Ie.div.contains(document.activeElement)?Ie._focusEventsAllowed=!0:(Ie.div.addEventListener("focusin",()=>{Ie._focusEventsAllowed=!0},{once:!0}),Xe.focus())},0)),Ie._structTreeParentId=(rt=ce(this,ae))==null?void 0:rt.moveElementInDOM(this.div,Ie.div,Ie.contentDiv,!0)}addOrRebuild(Ie){Ie.needsToBeRebuilt()?Ie.rebuild():this.add(Ie)}addUndoableEditor(Ie){const Xe=()=>Ie._uiManager.rebuild(Ie),rt=()=>{Ie.remove()};this.addCommands({cmd:Xe,undo:rt,mustExec:!1})}getNextId(){return ce(this,Re).getId()}pasteEditor(Ie,Xe){ce(this,Re).updateToolbar(Ie),ce(this,Re).updateMode(Ie);const{offsetX:rt,offsetY:lt}=Ke(this,Me,Tr).call(this),Ge=this.getNextId(),ut=Ke(this,$e,Er).call(this,{parent:this,id:Ge,x:rt,y:lt,uiManager:ce(this,Re),isCentered:!0,...Xe});ut&&this.add(ut)}deserialize(Ie){var Xe;switch((Xe=Ie.annotationType)!=null?Xe:Ie.annotationEditorType){case re.AnnotationEditorType.FREETEXT:return se.FreeTextEditor.deserialize(Ie,this,ce(this,Re));case re.AnnotationEditorType.INK:return oe.InkEditor.deserialize(Ie,this,ce(this,Re));case re.AnnotationEditorType.STAMP:return ue.StampEditor.deserialize(Ie,this,ce(this,Re))}return null}addNewEditor(){Ke(this,Ee,Jn).call(this,Ke(this,Me,Tr).call(this),!0)}setSelected(Ie){ce(this,Re).setSelected(Ie)}toggleSelected(Ie){ce(this,Re).toggleSelected(Ie)}isSelected(Ie){return ce(this,Re).isSelected(Ie)}unselect(Ie){ce(this,Re).unselect(Ie)}pointerup(Ie){const{isMac:Xe}=re.FeatureTest.platform;if(!(Ie.button!==0||Ie.ctrlKey&&Xe)&&Ie.target===this.div&&ce(this,Se)){if(st(this,Se,!1),!ce(this,le)){st(this,le,!0);return}if(ce(this,Re).getMode()===re.AnnotationEditorType.STAMP){ce(this,Re).unselectAll();return}Ke(this,Ee,Jn).call(this,Ie,!1)}}pointerdown(Ie){if(ce(this,Se)){st(this,Se,!1);return}const{isMac:Xe}=re.FeatureTest.platform;if(Ie.button!==0||Ie.ctrlKey&&Xe||Ie.target!==this.div)return;st(this,Se,!0);const rt=ce(this,Re).getActive();st(this,le,!rt||rt.isEmpty())}findNewParent(Ie,Xe,rt){const lt=ce(this,Re).findParent(Xe,rt);return lt===null||lt===this?!1:(lt.changeParent(Ie),!0)}destroy(){var Ie,Xe;((Ie=ce(this,Re).getActive())==null?void 0:Ie.parent)===this&&(ce(this,Re).commitOrRemove(),ce(this,Re).setActiveEditor(null));for(const rt of ce(this,ve).values())(Xe=ce(this,ae))==null||Xe.removePointerInTextLayer(rt.contentDiv),rt.setParent(null),rt.isAttachedToDOM=!1,rt.div.remove();this.div=null,ce(this,ve).clear(),ce(this,Re).removeLayer(this)}render({viewport:Ie}){this.viewport=Ie,(0,he.setLayerDimensions)(this.div,Ie);for(const Xe of ce(this,Re).getEditors(this.pageIndex))this.add(Xe);this.updateMode()}update({viewport:Ie}){ce(this,Re).commitOrRemove(),this.viewport=Ie,(0,he.setLayerDimensions)(this.div,{rotation:Ie.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:Ie,pageHeight:Xe}=this.viewport.rawDims;return[Ie,Xe]}};ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakMap,Pe=new WeakMap,Re=new WeakMap,$e=new WeakSet,Er=function(Ie){switch(ce(this,Re).getMode()){case re.AnnotationEditorType.FREETEXT:return new se.FreeTextEditor(Ie);case re.AnnotationEditorType.INK:return new oe.InkEditor(Ie);case re.AnnotationEditorType.STAMP:return new ue.StampEditor(Ie)}return null},Ee=new WeakSet,Jn=function(Ie,Xe){const rt=this.getNextId(),lt=Ke(this,$e,Er).call(this,{parent:this,id:rt,x:Ie.offsetX,y:Ie.offsetY,uiManager:ce(this,Re),isCentered:Xe});return lt&&this.add(lt),lt},Me=new WeakSet,Tr=function(){const{x:Ie,y:Xe,width:rt,height:lt}=this.div.getBoundingClientRect(),Ge=Math.max(0,Ie),ut=Math.max(0,Xe),mt=Math.min(window.innerWidth,Ie+rt),wt=Math.min(window.innerHeight,Xe+lt),Et=(Ge+mt)/2-Ie,De=(ut+wt)/2-Xe,[pe,be]=this.viewport.rotation%180===0?[Et,De]:[De,Et];return{offsetX:pe,offsetY:be}},Oe=new WeakSet,Cr=function(){st(this,Te,!0);for(const Ie of ce(this,ve).values())Ie.isEmpty()&&Ie.remove();st(this,Te,!1)},An(Ve,"_initialized",!1);let de=Ve;te.AnnotationEditorLayer=de},(ee,te,ne)=>{var ue,de,ae,le,Ae,_e,me,ve,Se,Te,Qr,Re,ei,ye,ti,Ne,Wn,we,xr,Fe,ni,qe,Pr;Object.defineProperty(te,"__esModule",{value:!0}),te.FreeTextEditor=void 0;var re=ne(1),ie=ne(5),se=ne(4),oe=ne(29);const Xe=class Xe extends se.AnnotationEditor{constructor(Ge){super({...Ge,name:"freeTextEditor"});We(this,Te);We(this,Re);We(this,ye);We(this,Ne);We(this,we);We(this,Fe);We(this,qe);We(this,ue,this.editorDivBlur.bind(this));We(this,de,this.editorDivFocus.bind(this));We(this,ae,this.editorDivInput.bind(this));We(this,le,this.editorDivKeydown.bind(this));We(this,Ae,void 0);We(this,_e,"");We(this,me,"".concat(this.id,"-editor"));We(this,ve,void 0);We(this,Se,null);st(this,Ae,Ge.color||Xe._defaultColor||se.AnnotationEditor._defaultLineColor),st(this,ve,Ge.fontSize||Xe._defaultFontSize)}static get _keyboardManager(){const Ge=Xe.prototype,ut=Et=>Et.isEmpty(),mt=ie.AnnotationEditorUIManager.TRANSLATE_SMALL,wt=ie.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,re.shadow)(this,"_keyboardManager",new ie.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],Ge.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],Ge.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],Ge._translateEmpty,{args:[-mt,0],checker:ut}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],Ge._translateEmpty,{args:[-wt,0],checker:ut}],[["ArrowRight","mac+ArrowRight"],Ge._translateEmpty,{args:[mt,0],checker:ut}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],Ge._translateEmpty,{args:[wt,0],checker:ut}],[["ArrowUp","mac+ArrowUp"],Ge._translateEmpty,{args:[0,-mt],checker:ut}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],Ge._translateEmpty,{args:[0,-wt],checker:ut}],[["ArrowDown","mac+ArrowDown"],Ge._translateEmpty,{args:[0,mt],checker:ut}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],Ge._translateEmpty,{args:[0,wt],checker:ut}]]))}static initialize(Ge){se.AnnotationEditor.initialize(Ge,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const ut=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(ut.getPropertyValue("--freetext-padding"))}static updateDefaultParams(Ge,ut){switch(Ge){case re.AnnotationEditorParamsType.FREETEXT_SIZE:Xe._defaultFontSize=ut;break;case re.AnnotationEditorParamsType.FREETEXT_COLOR:Xe._defaultColor=ut;break}}updateParams(Ge,ut){switch(Ge){case re.AnnotationEditorParamsType.FREETEXT_SIZE:Ke(this,Te,Qr).call(this,ut);break;case re.AnnotationEditorParamsType.FREETEXT_COLOR:Ke(this,Re,ei).call(this,ut);break}}static get defaultPropertiesToUpdate(){return[[re.AnnotationEditorParamsType.FREETEXT_SIZE,Xe._defaultFontSize],[re.AnnotationEditorParamsType.FREETEXT_COLOR,Xe._defaultColor||se.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[re.AnnotationEditorParamsType.FREETEXT_SIZE,ce(this,ve)],[re.AnnotationEditorParamsType.FREETEXT_COLOR,ce(this,Ae)]]}_translateEmpty(Ge,ut){this._uiManager.translateSelectedEditors(Ge,ut,!0)}getInitialTranslation(){const Ge=this.parentScale;return[-Xe._internalPadding*Ge,-(Xe._internalPadding+ce(this,ve))*Ge]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(re.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",ce(this,le)),this.editorDiv.addEventListener("focus",ce(this,de)),this.editorDiv.addEventListener("blur",ce(this,ue)),this.editorDiv.addEventListener("input",ce(this,ae)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",ce(this,me)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",ce(this,le)),this.editorDiv.removeEventListener("focus",ce(this,de)),this.editorDiv.removeEventListener("blur",ce(this,ue)),this.editorDiv.removeEventListener("input",ce(this,ae)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(Ge){this._focusEventsAllowed&&(super.focusin(Ge),Ge.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var Ge;if(this.width){Ke(this,qe,Pr).call(this);return}this.enableEditMode(),this.editorDiv.focus(),(Ge=this._initialOptions)!=null&&Ge.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 Ge=ce(this,_e),ut=st(this,_e,Ke(this,ye,ti).call(this).trimEnd());if(Ge===ut)return;const mt=wt=>{if(st(this,_e,wt),!wt){this.remove();return}Ke(this,we,xr).call(this),this._uiManager.rebuild(this),Ke(this,Ne,Wn).call(this)};this.addCommands({cmd:()=>{mt(ut)},undo:()=>{mt(Ge)},mustExec:!1}),Ke(this,Ne,Wn).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(Ge){this.enterInEditMode()}keydown(Ge){Ge.target===this.div&&Ge.key==="Enter"&&(this.enterInEditMode(),Ge.preventDefault())}editorDivKeydown(Ge){Xe._keyboardManager.exec(this,Ge)}editorDivFocus(Ge){this.isEditing=!0}editorDivBlur(Ge){this.isEditing=!1}editorDivInput(Ge){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 Ge,ut;this.width&&(Ge=this.x,ut=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",ce(this,me)),this.enableEditing(),se.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(wt=>{var Et;return(Et=this.editorDiv)==null?void 0:Et.setAttribute("aria-label",wt)}),se.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(wt=>{var Et;return(Et=this.editorDiv)==null?void 0:Et.setAttribute("default-content",wt)}),this.editorDiv.contentEditable=!0;const{style:mt}=this.editorDiv;if(mt.fontSize="calc(".concat(ce(this,ve),"px * var(--scale-factor))"),mt.color=ce(this,Ae),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,ie.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[wt,Et]=this.parentDimensions;if(this.annotationElementId){const{position:De}=ce(this,Se);let[pe,be]=this.getInitialTranslation();[pe,be]=this.pageTranslationToScreen(pe,be);const[ge,Ce]=this.pageDimensions,[xe,Le]=this.pageTranslation;let Be,He;switch(this.rotation){case 0:Be=Ge+(De[0]-xe)/ge,He=ut+this.height-(De[1]-Le)/Ce;break;case 90:Be=Ge+(De[0]-xe)/ge,He=ut-(De[1]-Le)/Ce,[pe,be]=[be,-pe];break;case 180:Be=Ge-this.width+(De[0]-xe)/ge,He=ut-(De[1]-Le)/Ce,[pe,be]=[-pe,-be];break;case 270:Be=Ge+(De[0]-xe-this.height*Ce)/ge,He=ut+(De[1]-Le-this.width*ge)/Ce,[pe,be]=[-be,pe];break}this.setAt(Be*wt,He*Et,pe,be)}else this.setAt(Ge*wt,ut*Et,this.width*wt,this.height*Et);Ke(this,we,xr).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(Ge,ut,mt){let wt=null;if(Ge instanceof oe.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:De,fontColor:pe},rect:be,rotation:ge,id:Ce},textContent:xe,textPosition:Le,parent:{page:{pageNumber:Be}}}=Ge;if(!xe||xe.length===0)return null;wt=Ge={annotationType:re.AnnotationEditorType.FREETEXT,color:Array.from(pe),fontSize:De,value:xe.join("\n"),position:Le,pageIndex:Be-1,rect:be,rotation:ge,id:Ce,deleted:!1}}const Et=super.deserialize(Ge,ut,mt);return st(Et,ve,Ge.fontSize),st(Et,Ae,re.Util.makeHexColor(...Ge.color)),st(Et,_e,Ge.value),Et.annotationElementId=Ge.id||null,st(Et,Se,wt),Et}serialize(Ge=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const ut=Xe._internalPadding*this.parentScale,mt=this.getRect(ut,ut),wt=se.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:ce(this,Ae)),Et={annotationType:re.AnnotationEditorType.FREETEXT,color:wt,fontSize:ce(this,ve),value:ce(this,_e),pageIndex:this.pageIndex,rect:mt,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return Ge?Et:this.annotationElementId&&!Ke(this,Fe,ni).call(this,Et)?null:(Et.id=this.annotationElementId,Et)}};ue=new WeakMap,de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakSet,Qr=function(Ge){const ut=wt=>{this.editorDiv.style.fontSize="calc(".concat(wt,"px * var(--scale-factor))"),this.translate(0,-(wt-ce(this,ve))*this.parentScale),st(this,ve,wt),Ke(this,Ne,Wn).call(this)},mt=ce(this,ve);this.addCommands({cmd:()=>{ut(Ge)},undo:()=>{ut(mt)},mustExec:!0,type:re.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},Re=new WeakSet,ei=function(Ge){const ut=ce(this,Ae);this.addCommands({cmd:()=>{st(this,Ae,this.editorDiv.style.color=Ge)},undo:()=>{st(this,Ae,this.editorDiv.style.color=ut)},mustExec:!0,type:re.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},ye=new WeakSet,ti=function(){const Ge=this.editorDiv.getElementsByTagName("div");if(Ge.length===0)return this.editorDiv.innerText;const ut=[];for(const mt of Ge)ut.push(mt.innerText.replace(/\r\n?|\n/,""));return ut.join("\n")},Ne=new WeakSet,Wn=function(){const[Ge,ut]=this.parentDimensions;let mt;if(this.isAttachedToDOM)mt=this.div.getBoundingClientRect();else{const{currentLayer:wt,div:Et}=this,De=Et.style.display;Et.style.display="hidden",wt.div.append(this.div),mt=Et.getBoundingClientRect(),Et.remove(),Et.style.display=De}this.rotation%180===this.parentRotation%180?(this.width=mt.width/Ge,this.height=mt.height/ut):(this.width=mt.height/Ge,this.height=mt.width/ut),this.fixAndSetPosition()},we=new WeakSet,xr=function(){if(this.editorDiv.replaceChildren(),!!ce(this,_e))for(const Ge of ce(this,_e).split("\n")){const ut=document.createElement("div");ut.append(Ge?document.createTextNode(Ge):document.createElement("br")),this.editorDiv.append(ut)}},Fe=new WeakSet,ni=function(Ge){const{value:ut,fontSize:mt,color:wt,rect:Et,pageIndex:De}=ce(this,Se);return Ge.value!==ut||Ge.fontSize!==mt||Ge.rect.some((pe,be)=>Math.abs(pe-Et[be])>=1)||Ge.color.some((pe,be)=>pe!==wt[be])||Ge.pageIndex!==De},qe=new WeakSet,Pr=function(Ge=!1){if(!this.annotationElementId)return;if(Ke(this,Ne,Wn).call(this),!Ge&&(this.width===0||this.height===0)){setTimeout(()=>Ke(this,qe,Pr).call(this,!0),0);return}const ut=Xe._internalPadding*this.parentScale;ce(this,Se).rect=this.getRect(ut,ut)},An(Xe,"_freeTextDefaultContent",""),An(Xe,"_internalPadding",0),An(Xe,"_defaultColor",null),An(Xe,"_defaultFontSize",10),An(Xe,"_type","freetext");let he=Xe;te.FreeTextEditor=he},(ee,te,ne)=>{var be,Ce,$n,Le,ri,He,it,et,ot,ht,pt,ct,Pt,It,vt,kt,gt,tt,nt,ft,Tt,Ct,Ht,ii,Ut,Qn,Vt,Rr,Gt,Fr,Qe,Ye,yt,St,wn,Qt,Je,Mr,Lt,Rt,Dt,Nt,si,bt,$r;Object.defineProperty(te,"__esModule",{value:!0}),te.StampAnnotationElement=te.InkAnnotationElement=te.FreeTextAnnotationElement=te.AnnotationLayer=void 0;var re=ne(1),ie=ne(6),se=ne(3),oe=ne(30),he=ne(31),ue=ne(32);const de=1e3,ae=9,le=new WeakSet;function Ae(Ot){return{width:Ot[2]-Ot[0],height:Ot[3]-Ot[1]}}class _e{static create(Ue){switch(Ue.data.annotationType){case re.AnnotationType.LINK:return new ve(Ue);case re.AnnotationType.TEXT:return new Se(Ue);case re.AnnotationType.WIDGET:switch(Ue.data.fieldType){case"Tx":return new Pe(Ue);case"Btn":return Ue.data.radioButton?new ye(Ue):Ue.data.checkBox?new $e(Ue):new Ee(Ue);case"Ch":return new Ne(Ue);case"Sig":return new Re(Ue)}return new Te(Ue);case re.AnnotationType.POPUP:return new Me(Ue);case re.AnnotationType.FREETEXT:return new Oe(Ue);case re.AnnotationType.LINE:return new Fe(Ue);case re.AnnotationType.SQUARE:return new Ve(Ue);case re.AnnotationType.CIRCLE:return new qe(Ue);case re.AnnotationType.POLYLINE:return new Ie(Ue);case re.AnnotationType.CARET:return new rt(Ue);case re.AnnotationType.INK:return new lt(Ue);case re.AnnotationType.POLYGON:return new Xe(Ue);case re.AnnotationType.HIGHLIGHT:return new Ge(Ue);case re.AnnotationType.UNDERLINE:return new ut(Ue);case re.AnnotationType.SQUIGGLY:return new mt(Ue);case re.AnnotationType.STRIKEOUT:return new wt(Ue);case re.AnnotationType.STAMP:return new Et(Ue);case re.AnnotationType.FILEATTACHMENT:return new De(Ue);default:return new me(Ue)}}}const ge=class ge{constructor(Ue,{isRenderable:fe=!1,ignoreBorder:ke=!1,createQuadrilaterals:je=!1}={}){We(this,be,!1);this.isRenderable=fe,this.data=Ue.data,this.layer=Ue.layer,this.linkService=Ue.linkService,this.downloadManager=Ue.downloadManager,this.imageResourcesPath=Ue.imageResourcesPath,this.renderForms=Ue.renderForms,this.svgFactory=Ue.svgFactory,this.annotationStorage=Ue.annotationStorage,this.enableScripting=Ue.enableScripting,this.hasJSActions=Ue.hasJSActions,this._fieldObjects=Ue.fieldObjects,this.parent=Ue.parent,fe&&(this.container=this._createContainer(ke)),je&&this._createQuadrilaterals()}static _hasPopupData({titleObj:Ue,contentsObj:fe,richText:ke}){return!!(Ue!=null&&Ue.str||fe!=null&&fe.str||ke!=null&&ke.str)}get hasPopupData(){return ge._hasPopupData(this.data)}_createContainer(Ue){const{data:fe,parent:{page:ke,viewport:je}}=this,ze=document.createElement("section");ze.setAttribute("data-annotation-id",fe.id),this instanceof Te||(ze.tabIndex=de),ze.style.zIndex=this.parent.zIndex++,this.data.popupRef&&ze.setAttribute("aria-haspopup","dialog"),fe.noRotate&&ze.classList.add("norotate");const{pageWidth:Ze,pageHeight:at,pageX:_t,pageY:xt}=je.rawDims;if(!fe.rect||this instanceof Me){const{rotation:Bt}=fe;return!fe.hasOwnCanvas&&Bt!==0&&this.setRotation(Bt,ze),ze}const{width:Ft,height:qt}=Ae(fe.rect),Mt=re.Util.normalizeRect([fe.rect[0],ke.view[3]-fe.rect[1]+ke.view[1],fe.rect[2],ke.view[3]-fe.rect[3]+ke.view[1]]);if(!Ue&&fe.borderStyle.width>0){ze.style.borderWidth="".concat(fe.borderStyle.width,"px");const Bt=fe.borderStyle.horizontalCornerRadius,Xt=fe.borderStyle.verticalCornerRadius;if(Bt>0||Xt>0){const Jt="calc(".concat(Bt,"px * var(--scale-factor)) / calc(").concat(Xt,"px * var(--scale-factor))");ze.style.borderRadius=Jt}else if(this instanceof ye){const Jt="calc(".concat(Ft,"px * var(--scale-factor)) / calc(").concat(qt,"px * var(--scale-factor))");ze.style.borderRadius=Jt}switch(fe.borderStyle.style){case re.AnnotationBorderStyleType.SOLID:ze.style.borderStyle="solid";break;case re.AnnotationBorderStyleType.DASHED:ze.style.borderStyle="dashed";break;case re.AnnotationBorderStyleType.BEVELED:(0,re.warn)("Unimplemented border style: beveled");break;case re.AnnotationBorderStyleType.INSET:(0,re.warn)("Unimplemented border style: inset");break;case re.AnnotationBorderStyleType.UNDERLINE:ze.style.borderBottomStyle="solid";break}const Yt=fe.borderColor||null;Yt?(st(this,be,!0),ze.style.borderColor=re.Util.makeHexColor(Yt[0]|0,Yt[1]|0,Yt[2]|0)):ze.style.borderWidth=0}ze.style.left="".concat(100*(Mt[0]-_t)/Ze,"%"),ze.style.top="".concat(100*(Mt[1]-xt)/at,"%");const{rotation:$t}=fe;return fe.hasOwnCanvas||$t===0?(ze.style.width="".concat(100*Ft/Ze,"%"),ze.style.height="".concat(100*qt/at,"%")):this.setRotation($t,ze),ze}setRotation(Ue,fe=this.container){if(!this.data.rect)return;const{pageWidth:ke,pageHeight:je}=this.parent.viewport.rawDims,{width:ze,height:Ze}=Ae(this.data.rect);let at,_t;Ue%180===0?(at=100*ze/ke,_t=100*Ze/je):(at=100*Ze/ke,_t=100*ze/je),fe.style.width="".concat(at,"%"),fe.style.height="".concat(_t,"%"),fe.setAttribute("data-main-rotation",(360-Ue)%360)}get _commonActions(){const Ue=(fe,ke,je)=>{const ze=je.detail[fe],Ze=ze[0],at=ze.slice(1);je.target.style[ke]=oe.ColorConverters["".concat(Ze,"_HTML")](at),this.annotationStorage.setValue(this.data.id,{[ke]:oe.ColorConverters["".concat(Ze,"_rgb")](at)})};return(0,re.shadow)(this,"_commonActions",{display:fe=>{const{display:ke}=fe.detail,je=ke%2===1;this.container.style.visibility=je?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:je,noPrint:ke===1||ke===2})},print:fe=>{this.annotationStorage.setValue(this.data.id,{noPrint:!fe.detail.print})},hidden:fe=>{const{hidden:ke}=fe.detail;this.container.style.visibility=ke?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:ke,noView:ke})},focus:fe=>{setTimeout(()=>fe.target.focus({preventScroll:!1}),0)},userName:fe=>{fe.target.title=fe.detail.userName},readonly:fe=>{fe.target.disabled=fe.detail.readonly},required:fe=>{this._setRequired(fe.target,fe.detail.required)},bgColor:fe=>{Ue("bgColor","backgroundColor",fe)},fillColor:fe=>{Ue("fillColor","backgroundColor",fe)},fgColor:fe=>{Ue("fgColor","color",fe)},textColor:fe=>{Ue("textColor","color",fe)},borderColor:fe=>{Ue("borderColor","borderColor",fe)},strokeColor:fe=>{Ue("strokeColor","borderColor",fe)},rotation:fe=>{const ke=fe.detail.rotation;this.setRotation(ke),this.annotationStorage.setValue(this.data.id,{rotation:ke})}})}_dispatchEventFromSandbox(Ue,fe){const ke=this._commonActions;for(const je of Object.keys(fe.detail)){const ze=Ue[je]||ke[je];ze==null||ze(fe)}}_setDefaultPropertiesFromJS(Ue){if(!this.enableScripting)return;const fe=this.annotationStorage.getRawValue(this.data.id);if(!fe)return;const ke=this._commonActions;for(const[je,ze]of Object.entries(fe)){const Ze=ke[je];if(Ze){const at={detail:{[je]:ze},target:Ue};Ze(at),delete fe[je]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:Ue}=this.data;if(!Ue)return;const[fe,ke,je,ze]=this.data.rect;if(Ue.length===1){const[,{x:Xt,y:Yt},{x:Jt,y:Tn}]=Ue[0];if(je===Xt&&ze===Yt&&fe===Jt&&ke===Tn)return}const{style:Ze}=this.container;let at;if(ce(this,be)){const{borderColor:Xt,borderWidth:Yt}=Ze;Ze.borderWidth=0,at=["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(Xt,'" stroke-width="').concat(Yt,'">')],this.container.classList.add("hasBorder")}const _t=je-fe,xt=ze-ke,{svgFactory:Ft}=this,qt=Ft.createElement("svg");qt.classList.add("quadrilateralsContainer"),qt.setAttribute("width",0),qt.setAttribute("height",0);const Mt=Ft.createElement("defs");qt.append(Mt);const $t=Ft.createElement("clipPath"),Bt="clippath_".concat(this.data.id);$t.setAttribute("id",Bt),$t.setAttribute("clipPathUnits","objectBoundingBox"),Mt.append($t);for(const[,{x:Xt,y:Yt},{x:Jt,y:Tn}]of Ue){const En=Ft.createElement("rect"),xn=(Jt-fe)/_t,Fn=(ze-Yt)/xt,Mn=(Xt-Jt)/_t,jr=(Yt-Tn)/xt;En.setAttribute("x",xn),En.setAttribute("y",Fn),En.setAttribute("width",Mn),En.setAttribute("height",jr),$t.append(En),at==null||at.push('<rect vector-effect="non-scaling-stroke" x="'.concat(xn,'" y="').concat(Fn,'" width="').concat(Mn,'" height="').concat(jr,'"/>'))}ce(this,be)&&(at.push("</g></svg>')"),Ze.backgroundImage=at.join("")),this.container.append(qt),this.container.style.clipPath="url(#".concat(Bt,")")}_createPopup(){const{container:Ue,data:fe}=this;Ue.setAttribute("aria-haspopup","dialog");const ke=new Me({data:{color:fe.color,titleObj:fe.titleObj,modificationDate:fe.modificationDate,contentsObj:fe.contentsObj,richText:fe.richText,parentRect:fe.rect,borderStyle:0,id:"popup_".concat(fe.id),rotation:fe.rotation},parent:this.parent,elements:[this]});this.parent.div.append(ke.render())}render(){(0,re.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(Ue,fe=null){const ke=[];if(this._fieldObjects){const je=this._fieldObjects[Ue];if(je)for(const{page:ze,id:Ze,exportValues:at}of je){if(ze===-1||Ze===fe)continue;const _t=typeof at=="string"?at:null,xt=document.querySelector('[data-element-id="'.concat(Ze,'"]'));if(xt&&!le.has(xt)){(0,re.warn)("_getElementsByName - element not allowed: ".concat(Ze));continue}ke.push({id:Ze,exportValue:_t,domElement:xt})}return ke}for(const je of document.getElementsByName(Ue)){const{exportValue:ze}=je,Ze=je.getAttribute("data-element-id");Ze!==fe&&le.has(je)&&ke.push({id:Ze,exportValue:ze,domElement:je})}return ke}show(){var Ue;this.container&&(this.container.hidden=!1),(Ue=this.popup)==null||Ue.maybeShow()}hide(){var Ue;this.container&&(this.container.hidden=!0),(Ue=this.popup)==null||Ue.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const Ue=this.getElementsToTriggerPopup();if(Array.isArray(Ue))for(const fe of Ue)fe.classList.add("highlightArea");else Ue.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:Ue,data:{id:fe}}=this;this.container.addEventListener("dblclick",()=>{var ke;(ke=this.linkService.eventBus)==null||ke.dispatch("switchannotationeditormode",{source:this,mode:Ue,editId:fe})})}};be=new WeakMap;let me=ge;class ve extends me{constructor(fe,ke=null){super(fe,{isRenderable:!0,ignoreBorder:!!(ke!=null&&ke.ignoreBorder),createQuadrilaterals:!0});We(this,Ce);We(this,Le);this.isTooltipOnly=fe.data.isTooltipOnly}render(){const{data:fe,linkService:ke}=this,je=document.createElement("a");je.setAttribute("data-element-id",fe.id);let ze=!1;return fe.url?(ke.addLinkAttributes(je,fe.url,fe.newWindow),ze=!0):fe.action?(this._bindNamedAction(je,fe.action),ze=!0):fe.attachment?(this._bindAttachment(je,fe.attachment),ze=!0):fe.setOCGState?(Ke(this,Le,ri).call(this,je,fe.setOCGState),ze=!0):fe.dest?(this._bindLink(je,fe.dest),ze=!0):(fe.actions&&(fe.actions.Action||fe.actions["Mouse Up"]||fe.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(je,fe),ze=!0),fe.resetForm?(this._bindResetFormAction(je,fe.resetForm),ze=!0):this.isTooltipOnly&&!ze&&(this._bindLink(je,""),ze=!0)),this.container.classList.add("linkAnnotation"),ze&&this.container.append(je),this.container}_bindLink(fe,ke){fe.href=this.linkService.getDestinationHash(ke),fe.onclick=()=>(ke&&this.linkService.goToDestination(ke),!1),(ke||ke==="")&&Ke(this,Ce,$n).call(this)}_bindNamedAction(fe,ke){fe.href=this.linkService.getAnchorUrl(""),fe.onclick=()=>(this.linkService.executeNamedAction(ke),!1),Ke(this,Ce,$n).call(this)}_bindAttachment(fe,ke){fe.href=this.linkService.getAnchorUrl(""),fe.onclick=()=>{var je;return(je=this.downloadManager)==null||je.openOrDownloadData(this.container,ke.content,ke.filename),!1},Ke(this,Ce,$n).call(this)}_bindJSAction(fe,ke){fe.href=this.linkService.getAnchorUrl("");const je=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const ze of Object.keys(ke.actions)){const Ze=je.get(ze);Ze&&(fe[Ze]=()=>{var at;return(at=this.linkService.eventBus)==null||at.dispatch("dispatcheventinsandbox",{source:this,detail:{id:ke.id,name:ze}}),!1})}fe.onclick||(fe.onclick=()=>!1),Ke(this,Ce,$n).call(this)}_bindResetFormAction(fe,ke){const je=fe.onclick;if(je||(fe.href=this.linkService.getAnchorUrl("")),Ke(this,Ce,$n).call(this),!this._fieldObjects){(0,re.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),je||(fe.onclick=()=>!1);return}fe.onclick=()=>{var qt;je==null||je();const{fields:ze,refs:Ze,include:at}=ke,_t=[];if(ze.length!==0||Ze.length!==0){const Mt=new Set(Ze);for(const $t of ze){const Bt=this._fieldObjects[$t]||[];for(const{id:Xt}of Bt)Mt.add(Xt)}for(const $t of Object.values(this._fieldObjects))for(const Bt of $t)Mt.has(Bt.id)===at&&_t.push(Bt)}else for(const Mt of Object.values(this._fieldObjects))_t.push(...Mt);const xt=this.annotationStorage,Ft=[];for(const Mt of _t){const{id:$t}=Mt;switch(Ft.push($t),Mt.type){case"text":{const Xt=Mt.defaultValue||"";xt.setValue($t,{value:Xt});break}case"checkbox":case"radiobutton":{const Xt=Mt.defaultValue===Mt.exportValues;xt.setValue($t,{value:Xt});break}case"combobox":case"listbox":{const Xt=Mt.defaultValue||"";xt.setValue($t,{value:Xt});break}default:continue}const Bt=document.querySelector('[data-element-id="'.concat($t,'"]'));if(Bt){if(!le.has(Bt)){(0,re.warn)("_bindResetFormAction - element not allowed: ".concat($t));continue}}else continue;Bt.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((qt=this.linkService.eventBus)==null||qt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:Ft,name:"ResetForm"}})),!1}}}Ce=new WeakSet,$n=function(){this.container.setAttribute("data-internal-link","")},Le=new WeakSet,ri=function(fe,ke){fe.href=this.linkService.getAnchorUrl(""),fe.onclick=()=>(this.linkService.executeSetOCGState(ke),!1),Ke(this,Ce,$n).call(this)};class Se extends me{constructor(Ue){super(Ue,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const Ue=document.createElement("img");return Ue.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",Ue.alt="[{{type}} Annotation]",Ue.dataset.l10nId="text_annotation_type",Ue.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(Ue),this.container}}class Te extends me{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(Ue){var fe;this.data.hasOwnCanvas&&(((fe=Ue.previousSibling)==null?void 0:fe.nodeName)==="CANVAS"&&(Ue.previousSibling.hidden=!0),Ue.hidden=!1)}_getKeyModifier(Ue){const{isWin:fe,isMac:ke}=re.FeatureTest.platform;return fe&&Ue.ctrlKey||ke&&Ue.metaKey}_setEventListener(Ue,fe,ke,je,ze){ke.includes("mouse")?Ue.addEventListener(ke,Ze=>{var at;(at=this.linkService.eventBus)==null||at.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:je,value:ze(Ze),shift:Ze.shiftKey,modifier:this._getKeyModifier(Ze)}})}):Ue.addEventListener(ke,Ze=>{var at;if(ke==="blur"){if(!fe.focused||!Ze.relatedTarget)return;fe.focused=!1}else if(ke==="focus"){if(fe.focused)return;fe.focused=!0}ze&&((at=this.linkService.eventBus)==null||at.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:je,value:ze(Ze)}}))})}_setEventListeners(Ue,fe,ke,je){var ze,Ze,at;for(const[_t,xt]of ke)(xt==="Action"||(ze=this.data.actions)!=null&&ze[xt])&&((xt==="Focus"||xt==="Blur")&&(fe||(fe={focused:!1})),this._setEventListener(Ue,fe,_t,xt,je),xt==="Focus"&&!((Ze=this.data.actions)!=null&&Ze.Blur)?this._setEventListener(Ue,fe,"blur","Blur",null):xt==="Blur"&&!((at=this.data.actions)!=null&&at.Focus)&&this._setEventListener(Ue,fe,"focus","Focus",null))}_setBackgroundColor(Ue){const fe=this.data.backgroundColor||null;Ue.style.backgroundColor=fe===null?"transparent":re.Util.makeHexColor(fe[0],fe[1],fe[2])}_setTextStyle(Ue){const fe=["left","center","right"],{fontColor:ke}=this.data.defaultAppearanceData,je=this.data.defaultAppearanceData.fontSize||ae,ze=Ue.style;let Ze;const at=2,_t=xt=>Math.round(10*xt)/10;if(this.data.multiLine){const xt=Math.abs(this.data.rect[3]-this.data.rect[1]-at),Ft=Math.round(xt/(re.LINE_FACTOR*je))||1,qt=xt/Ft;Ze=Math.min(je,_t(qt/re.LINE_FACTOR))}else{const xt=Math.abs(this.data.rect[3]-this.data.rect[1]-at);Ze=Math.min(je,_t(xt/re.LINE_FACTOR))}ze.fontSize="calc(".concat(Ze,"px * var(--scale-factor))"),ze.color=re.Util.makeHexColor(ke[0],ke[1],ke[2]),this.data.textAlignment!==null&&(ze.textAlign=fe[this.data.textAlignment])}_setRequired(Ue,fe){fe?Ue.setAttribute("required",!0):Ue.removeAttribute("required"),Ue.setAttribute("aria-required",fe)}}class Pe extends Te{constructor(Ue){const fe=Ue.renderForms||!Ue.data.hasAppearance&&!!Ue.data.fieldValue;super(Ue,{isRenderable:fe})}setPropertyOnSiblings(Ue,fe,ke,je){const ze=this.annotationStorage;for(const Ze of this._getElementsByName(Ue.name,Ue.id))Ze.domElement&&(Ze.domElement[fe]=ke),ze.setValue(Ze.id,{[je]:ke})}render(){var je,ze;const Ue=this.annotationStorage,fe=this.data.id;this.container.classList.add("textWidgetAnnotation");let ke=null;if(this.renderForms){const Ze=Ue.getValue(fe,{value:this.data.fieldValue});let at=Ze.value||"";const _t=Ue.getValue(fe,{charLimit:this.data.maxLen}).charLimit;_t&&at.length>_t&&(at=at.slice(0,_t));let xt=Ze.formattedValue||((je=this.data.textContent)==null?void 0:je.join("\n"))||null;xt&&this.data.comb&&(xt=xt.replaceAll(/\s+/g,""));const Ft={userValue:at,formattedValue:xt,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(ke=document.createElement("textarea"),ke.textContent=xt!=null?xt:at,this.data.doNotScroll&&(ke.style.overflowY="hidden")):(ke=document.createElement("input"),ke.type="text",ke.setAttribute("value",xt!=null?xt:at),this.data.doNotScroll&&(ke.style.overflowX="hidden")),this.data.hasOwnCanvas&&(ke.hidden=!0),le.add(ke),ke.setAttribute("data-element-id",fe),ke.disabled=this.data.readOnly,ke.name=this.data.fieldName,ke.tabIndex=de,this._setRequired(ke,this.data.required),_t&&(ke.maxLength=_t),ke.addEventListener("input",Mt=>{Ue.setValue(fe,{value:Mt.target.value}),this.setPropertyOnSiblings(ke,"value",Mt.target.value,"value"),Ft.formattedValue=null}),ke.addEventListener("resetform",Mt=>{var Bt;const $t=(Bt=this.data.defaultFieldValue)!=null?Bt:"";ke.value=Ft.userValue=$t,Ft.formattedValue=null});let qt=Mt=>{const{formattedValue:$t}=Ft;$t!=null&&(Mt.target.value=$t),Mt.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){ke.addEventListener("focus",$t=>{if(Ft.focused)return;const{target:Bt}=$t;Ft.userValue&&(Bt.value=Ft.userValue),Ft.lastCommittedValue=Bt.value,Ft.commitKey=1,Ft.focused=!0}),ke.addEventListener("updatefromsandbox",$t=>{this.showElementAndHideCanvas($t.target);const Bt={value(Xt){var Yt;Ft.userValue=(Yt=Xt.detail.value)!=null?Yt:"",Ue.setValue(fe,{value:Ft.userValue.toString()}),Xt.target.value=Ft.userValue},formattedValue(Xt){const{formattedValue:Yt}=Xt.detail;Ft.formattedValue=Yt,Yt!=null&&Xt.target!==document.activeElement&&(Xt.target.value=Yt),Ue.setValue(fe,{formattedValue:Yt})},selRange(Xt){Xt.target.setSelectionRange(...Xt.detail.selRange)},charLimit:Xt=>{var En;const{charLimit:Yt}=Xt.detail,{target:Jt}=Xt;if(Yt===0){Jt.removeAttribute("maxLength");return}Jt.setAttribute("maxLength",Yt);let Tn=Ft.userValue;!Tn||Tn.length<=Yt||(Tn=Tn.slice(0,Yt),Jt.value=Ft.userValue=Tn,Ue.setValue(fe,{value:Tn}),(En=this.linkService.eventBus)==null||En.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:Tn,willCommit:!0,commitKey:1,selStart:Jt.selectionStart,selEnd:Jt.selectionEnd}}))}};this._dispatchEventFromSandbox(Bt,$t)}),ke.addEventListener("keydown",$t=>{var Yt;Ft.commitKey=1;let Bt=-1;if($t.key==="Escape"?Bt=0:$t.key==="Enter"&&!this.data.multiLine?Bt=2:$t.key==="Tab"&&(Ft.commitKey=3),Bt===-1)return;const{value:Xt}=$t.target;Ft.lastCommittedValue!==Xt&&(Ft.lastCommittedValue=Xt,Ft.userValue=Xt,(Yt=this.linkService.eventBus)==null||Yt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:Xt,willCommit:!0,commitKey:Bt,selStart:$t.target.selectionStart,selEnd:$t.target.selectionEnd}}))});const Mt=qt;qt=null,ke.addEventListener("blur",$t=>{var Xt;if(!Ft.focused||!$t.relatedTarget)return;Ft.focused=!1;const{value:Bt}=$t.target;Ft.userValue=Bt,Ft.lastCommittedValue!==Bt&&((Xt=this.linkService.eventBus)==null||Xt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:Bt,willCommit:!0,commitKey:Ft.commitKey,selStart:$t.target.selectionStart,selEnd:$t.target.selectionEnd}})),Mt($t)}),(ze=this.data.actions)!=null&&ze.Keystroke&&ke.addEventListener("beforeinput",$t=>{var Fn;Ft.lastCommittedValue=null;const{data:Bt,target:Xt}=$t,{value:Yt,selectionStart:Jt,selectionEnd:Tn}=Xt;let En=Jt,xn=Tn;switch($t.inputType){case"deleteWordBackward":{const Mn=Yt.substring(0,Jt).match(/\w*[^\w]*$/);Mn&&(En-=Mn[0].length);break}case"deleteWordForward":{const Mn=Yt.substring(Jt).match(/^[^\w]*\w*/);Mn&&(xn+=Mn[0].length);break}case"deleteContentBackward":Jt===Tn&&(En-=1);break;case"deleteContentForward":Jt===Tn&&(xn+=1);break}$t.preventDefault(),(Fn=this.linkService.eventBus)==null||Fn.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:Yt,change:Bt||"",willCommit:!1,selStart:En,selEnd:xn}})}),this._setEventListeners(ke,Ft,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],$t=>$t.target.value)}if(qt&&ke.addEventListener("blur",qt),this.data.comb){const $t=(this.data.rect[2]-this.data.rect[0])/_t;ke.classList.add("comb"),ke.style.letterSpacing="calc(".concat($t,"px * var(--scale-factor) - 1ch)")}}else ke=document.createElement("div"),ke.textContent=this.data.fieldValue,ke.style.verticalAlign="middle",ke.style.display="table-cell";return this._setTextStyle(ke),this._setBackgroundColor(ke),this._setDefaultPropertiesFromJS(ke),this.container.append(ke),this.container}}class Re extends Te{constructor(Ue){super(Ue,{isRenderable:!!Ue.data.hasOwnCanvas})}}class $e extends Te{constructor(Ue){super(Ue,{isRenderable:Ue.renderForms})}render(){const Ue=this.annotationStorage,fe=this.data,ke=fe.id;let je=Ue.getValue(ke,{value:fe.exportValue===fe.fieldValue}).value;typeof je=="string"&&(je=je!=="Off",Ue.setValue(ke,{value:je})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const ze=document.createElement("input");return le.add(ze),ze.setAttribute("data-element-id",ke),ze.disabled=fe.readOnly,this._setRequired(ze,this.data.required),ze.type="checkbox",ze.name=fe.fieldName,je&&ze.setAttribute("checked",!0),ze.setAttribute("exportValue",fe.exportValue),ze.tabIndex=de,ze.addEventListener("change",Ze=>{const{name:at,checked:_t}=Ze.target;for(const xt of this._getElementsByName(at,ke)){const Ft=_t&&xt.exportValue===fe.exportValue;xt.domElement&&(xt.domElement.checked=Ft),Ue.setValue(xt.id,{value:Ft})}Ue.setValue(ke,{value:_t})}),ze.addEventListener("resetform",Ze=>{const at=fe.defaultFieldValue||"Off";Ze.target.checked=at===fe.exportValue}),this.enableScripting&&this.hasJSActions&&(ze.addEventListener("updatefromsandbox",Ze=>{const at={value(_t){_t.target.checked=_t.detail.value!=="Off",Ue.setValue(ke,{value:_t.target.checked})}};this._dispatchEventFromSandbox(at,Ze)}),this._setEventListeners(ze,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Ze=>Ze.target.checked)),this._setBackgroundColor(ze),this._setDefaultPropertiesFromJS(ze),this.container.append(ze),this.container}}class ye extends Te{constructor(Ue){super(Ue,{isRenderable:Ue.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const Ue=this.annotationStorage,fe=this.data,ke=fe.id;let je=Ue.getValue(ke,{value:fe.fieldValue===fe.buttonValue}).value;typeof je=="string"&&(je=je!==fe.buttonValue,Ue.setValue(ke,{value:je}));const ze=document.createElement("input");if(le.add(ze),ze.setAttribute("data-element-id",ke),ze.disabled=fe.readOnly,this._setRequired(ze,this.data.required),ze.type="radio",ze.name=fe.fieldName,je&&ze.setAttribute("checked",!0),ze.tabIndex=de,ze.addEventListener("change",Ze=>{const{name:at,checked:_t}=Ze.target;for(const xt of this._getElementsByName(at,ke))Ue.setValue(xt.id,{value:!1});Ue.setValue(ke,{value:_t})}),ze.addEventListener("resetform",Ze=>{const at=fe.defaultFieldValue;Ze.target.checked=at!=null&&at===fe.buttonValue}),this.enableScripting&&this.hasJSActions){const Ze=fe.buttonValue;ze.addEventListener("updatefromsandbox",at=>{const _t={value:xt=>{const Ft=Ze===xt.detail.value;for(const qt of this._getElementsByName(xt.target.name)){const Mt=Ft&&qt.id===ke;qt.domElement&&(qt.domElement.checked=Mt),Ue.setValue(qt.id,{value:Mt})}}};this._dispatchEventFromSandbox(_t,at)}),this._setEventListeners(ze,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],at=>at.target.checked)}return this._setBackgroundColor(ze),this._setDefaultPropertiesFromJS(ze),this.container.append(ze),this.container}}class Ee extends ve{constructor(Ue){super(Ue,{ignoreBorder:Ue.data.hasAppearance})}render(){const Ue=super.render();Ue.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(Ue.title=this.data.alternativeText);const fe=Ue.lastChild;return this.enableScripting&&this.hasJSActions&&fe&&(this._setDefaultPropertiesFromJS(fe),fe.addEventListener("updatefromsandbox",ke=>{this._dispatchEventFromSandbox({},ke)})),Ue}}class Ne extends Te{constructor(Ue){super(Ue,{isRenderable:Ue.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const Ue=this.annotationStorage,fe=this.data.id,ke=Ue.getValue(fe,{value:this.data.fieldValue}),je=document.createElement("select");le.add(je),je.setAttribute("data-element-id",fe),je.disabled=this.data.readOnly,this._setRequired(je,this.data.required),je.name=this.data.fieldName,je.tabIndex=de;let ze=this.data.combo&&this.data.options.length>0;this.data.combo||(je.size=this.data.options.length,this.data.multiSelect&&(je.multiple=!0)),je.addEventListener("resetform",Ft=>{const qt=this.data.defaultFieldValue;for(const Mt of je.options)Mt.selected=Mt.value===qt});for(const Ft of this.data.options){const qt=document.createElement("option");qt.textContent=Ft.displayValue,qt.value=Ft.exportValue,ke.value.includes(Ft.exportValue)&&(qt.setAttribute("selected",!0),ze=!1),je.append(qt)}let Ze=null;if(ze){const Ft=document.createElement("option");Ft.value=" ",Ft.setAttribute("hidden",!0),Ft.setAttribute("selected",!0),je.prepend(Ft),Ze=()=>{Ft.remove(),je.removeEventListener("input",Ze),Ze=null},je.addEventListener("input",Ze)}const at=Ft=>{const qt=Ft?"value":"textContent",{options:Mt,multiple:$t}=je;return $t?Array.prototype.filter.call(Mt,Bt=>Bt.selected).map(Bt=>Bt[qt]):Mt.selectedIndex===-1?null:Mt[Mt.selectedIndex][qt]};let _t=at(!1);const xt=Ft=>{const qt=Ft.target.options;return Array.prototype.map.call(qt,Mt=>({displayValue:Mt.textContent,exportValue:Mt.value}))};return this.enableScripting&&this.hasJSActions?(je.addEventListener("updatefromsandbox",Ft=>{const qt={value(Mt){Ze==null||Ze();const $t=Mt.detail.value,Bt=new Set(Array.isArray($t)?$t:[$t]);for(const Xt of je.options)Xt.selected=Bt.has(Xt.value);Ue.setValue(fe,{value:at(!0)}),_t=at(!1)},multipleSelection(Mt){je.multiple=!0},remove(Mt){const $t=je.options,Bt=Mt.detail.remove;$t[Bt].selected=!1,je.remove(Bt),$t.length>0&&Array.prototype.findIndex.call($t,Yt=>Yt.selected)===-1&&($t[0].selected=!0),Ue.setValue(fe,{value:at(!0),items:xt(Mt)}),_t=at(!1)},clear(Mt){for(;je.length!==0;)je.remove(0);Ue.setValue(fe,{value:null,items:[]}),_t=at(!1)},insert(Mt){const{index:$t,displayValue:Bt,exportValue:Xt}=Mt.detail.insert,Yt=je.children[$t],Jt=document.createElement("option");Jt.textContent=Bt,Jt.value=Xt,Yt?Yt.before(Jt):je.append(Jt),Ue.setValue(fe,{value:at(!0),items:xt(Mt)}),_t=at(!1)},items(Mt){const{items:$t}=Mt.detail;for(;je.length!==0;)je.remove(0);for(const Bt of $t){const{displayValue:Xt,exportValue:Yt}=Bt,Jt=document.createElement("option");Jt.textContent=Xt,Jt.value=Yt,je.append(Jt)}je.options.length>0&&(je.options[0].selected=!0),Ue.setValue(fe,{value:at(!0),items:xt(Mt)}),_t=at(!1)},indices(Mt){const $t=new Set(Mt.detail.indices);for(const Bt of Mt.target.options)Bt.selected=$t.has(Bt.index);Ue.setValue(fe,{value:at(!0)}),_t=at(!1)},editable(Mt){Mt.target.disabled=!Mt.detail.editable}};this._dispatchEventFromSandbox(qt,Ft)}),je.addEventListener("input",Ft=>{var Mt;const qt=at(!0);Ue.setValue(fe,{value:qt}),Ft.preventDefault(),(Mt=this.linkService.eventBus)==null||Mt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:_t,changeEx:qt,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(je,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],Ft=>Ft.target.value)):je.addEventListener("input",function(Ft){Ue.setValue(fe,{value:at(!0)})}),this.data.combo&&this._setTextStyle(je),this._setBackgroundColor(je),this._setDefaultPropertiesFromJS(je),this.container.append(je),this.container}}class Me extends me{constructor(Ue){const{data:fe,elements:ke}=Ue;super(Ue,{isRenderable:me._hasPopupData(fe)}),this.elements=ke}render(){this.container.classList.add("popupAnnotation");const Ue=new we({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}),fe=[];for(const ke of this.elements)ke.popup=Ue,fe.push(ke.data.id),ke.addHighlightArea();return this.container.setAttribute("aria-controls",fe.map(ke=>"".concat(re.AnnotationPrefix).concat(ke)).join(",")),this.container}}class we{constructor({container:Ue,color:fe,elements:ke,titleObj:je,modificationDate:ze,contentsObj:Ze,richText:at,parent:_t,rect:xt,parentRect:Ft,open:qt}){We(this,Ht);We(this,Ut);We(this,Vt);We(this,Gt);We(this,He,null);We(this,it,Ke(this,Ht,ii).bind(this));We(this,et,Ke(this,Gt,Fr).bind(this));We(this,ot,Ke(this,Vt,Rr).bind(this));We(this,ht,Ke(this,Ut,Qn).bind(this));We(this,pt,null);We(this,ct,null);We(this,Pt,null);We(this,It,null);We(this,vt,null);We(this,kt,null);We(this,gt,!1);We(this,tt,null);We(this,nt,null);We(this,ft,null);We(this,Tt,null);We(this,Ct,!1);var $t;st(this,ct,Ue),st(this,Tt,je),st(this,Pt,Ze),st(this,ft,at),st(this,vt,_t),st(this,pt,fe),st(this,nt,xt),st(this,kt,Ft),st(this,It,ke);const Mt=ie.PDFDateString.toDateObject(ze);Mt&&st(this,He,_t.l10n.get("annotation_date_string",{date:Mt.toLocaleDateString(),time:Mt.toLocaleTimeString()})),this.trigger=ke.flatMap(Bt=>Bt.getElementsToTriggerPopup());for(const Bt of this.trigger)Bt.addEventListener("click",ce(this,ht)),Bt.addEventListener("mouseenter",ce(this,ot)),Bt.addEventListener("mouseleave",ce(this,et)),Bt.classList.add("popupTriggerArea");for(const Bt of ke)($t=Bt.container)==null||$t.addEventListener("keydown",ce(this,it));ce(this,ct).hidden=!0,qt&&Ke(this,Ut,Qn).call(this)}render(){if(ce(this,tt))return;const{page:{view:Ue},viewport:{rawDims:{pageWidth:fe,pageHeight:ke,pageX:je,pageY:ze}}}=ce(this,vt),Ze=st(this,tt,document.createElement("div"));if(Ze.className="popup",ce(this,pt)){const En=Ze.style.outlineColor=re.Util.makeHexColor(...ce(this,pt));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?Ze.style.backgroundColor="color-mix(in srgb, ".concat(En," 30%, white)"):Ze.style.backgroundColor=re.Util.makeHexColor(...ce(this,pt).map(Fn=>Math.floor(.7*(255-Fn)+Fn)))}const at=document.createElement("span");at.className="header";const _t=document.createElement("h1");if(at.append(_t),{dir:_t.dir,str:_t.textContent}=ce(this,Tt),Ze.append(at),ce(this,He)){const En=document.createElement("span");En.classList.add("popupDate"),ce(this,He).then(xn=>{En.textContent=xn}),at.append(En)}const xt=ce(this,Pt),Ft=ce(this,ft);if(Ft!=null&&Ft.str&&(!(xt!=null&&xt.str)||xt.str===Ft.str))ue.XfaLayer.render({xfaHtml:Ft.html,intent:"richText",div:Ze}),Ze.lastChild.classList.add("richText","popupContent");else{const En=this._formatContents(xt);Ze.append(En)}let qt=!!ce(this,kt),Mt=qt?ce(this,kt):ce(this,nt);for(const En of ce(this,It))if(!Mt||re.Util.intersect(En.data.rect,Mt)!==null){Mt=En.data.rect,qt=!0;break}const $t=re.Util.normalizeRect([Mt[0],Ue[3]-Mt[1]+Ue[1],Mt[2],Ue[3]-Mt[3]+Ue[1]]),Bt=5,Xt=qt?Mt[2]-Mt[0]+Bt:0,Yt=$t[0]+Xt,Jt=$t[1],{style:Tn}=ce(this,ct);Tn.left="".concat(100*(Yt-je)/fe,"%"),Tn.top="".concat(100*(Jt-ze)/ke,"%"),ce(this,ct).append(Ze)}_formatContents({str:Ue,dir:fe}){const ke=document.createElement("p");ke.classList.add("popupContent"),ke.dir=fe;const je=Ue.split(/(?:\r\n?|\n)/);for(let ze=0,Ze=je.length;ze<Ze;++ze){const at=je[ze];ke.append(document.createTextNode(at)),ze<Ze-1&&ke.append(document.createElement("br"))}return ke}forceHide(){st(this,Ct,this.isVisible),ce(this,Ct)&&(ce(this,ct).hidden=!0)}maybeShow(){ce(this,Ct)&&(st(this,Ct,!1),ce(this,ct).hidden=!1)}get isVisible(){return ce(this,ct).hidden===!1}}He=new WeakMap,it=new WeakMap,et=new WeakMap,ot=new WeakMap,ht=new WeakMap,pt=new WeakMap,ct=new WeakMap,Pt=new WeakMap,It=new WeakMap,vt=new WeakMap,kt=new WeakMap,gt=new WeakMap,tt=new WeakMap,nt=new WeakMap,ft=new WeakMap,Tt=new WeakMap,Ct=new WeakMap,Ht=new WeakSet,ii=function(Ue){Ue.altKey||Ue.shiftKey||Ue.ctrlKey||Ue.metaKey||(Ue.key==="Enter"||Ue.key==="Escape"&&ce(this,gt))&&Ke(this,Ut,Qn).call(this)},Ut=new WeakSet,Qn=function(){st(this,gt,!ce(this,gt)),ce(this,gt)?(Ke(this,Vt,Rr).call(this),ce(this,ct).addEventListener("click",ce(this,ht)),ce(this,ct).addEventListener("keydown",ce(this,it))):(Ke(this,Gt,Fr).call(this),ce(this,ct).removeEventListener("click",ce(this,ht)),ce(this,ct).removeEventListener("keydown",ce(this,it)))},Vt=new WeakSet,Rr=function(){ce(this,tt)||this.render(),this.isVisible?ce(this,gt)&&ce(this,ct).classList.add("focused"):(ce(this,ct).hidden=!1,ce(this,ct).style.zIndex=parseInt(ce(this,ct).style.zIndex)+1e3)},Gt=new WeakSet,Fr=function(){ce(this,ct).classList.remove("focused"),!(ce(this,gt)||!this.isVisible)&&(ce(this,ct).hidden=!0,ce(this,ct).style.zIndex=parseInt(ce(this,ct).style.zIndex)-1e3)};class Oe extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0}),this.textContent=Ue.data.textContent,this.textPosition=Ue.data.textPosition,this.annotationEditorType=re.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const Ue=document.createElement("div");Ue.classList.add("annotationTextContent"),Ue.setAttribute("role","comment");for(const fe of this.textContent){const ke=document.createElement("span");ke.textContent=fe,Ue.append(ke)}this.container.append(Ue)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}te.FreeTextAnnotationElement=Oe;class Fe extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,Qe,null)}render(){this.container.classList.add("lineAnnotation");const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0),Ze=st(this,Qe,this.svgFactory.createElement("svg:line"));return Ze.setAttribute("x1",fe.rect[2]-fe.lineCoordinates[0]),Ze.setAttribute("y1",fe.rect[3]-fe.lineCoordinates[1]),Ze.setAttribute("x2",fe.rect[2]-fe.lineCoordinates[2]),Ze.setAttribute("y2",fe.rect[3]-fe.lineCoordinates[3]),Ze.setAttribute("stroke-width",fe.borderStyle.width||1),Ze.setAttribute("stroke","transparent"),Ze.setAttribute("fill","transparent"),ze.append(Ze),this.container.append(ze),!fe.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return ce(this,Qe)}addHighlightArea(){this.container.classList.add("highlightArea")}}Qe=new WeakMap;class Ve extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,Ye,null)}render(){this.container.classList.add("squareAnnotation");const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0),Ze=fe.borderStyle.width,at=st(this,Ye,this.svgFactory.createElement("svg:rect"));return at.setAttribute("x",Ze/2),at.setAttribute("y",Ze/2),at.setAttribute("width",ke-Ze),at.setAttribute("height",je-Ze),at.setAttribute("stroke-width",Ze||1),at.setAttribute("stroke","transparent"),at.setAttribute("fill","transparent"),ze.append(at),this.container.append(ze),!fe.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return ce(this,Ye)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ye=new WeakMap;class qe extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,yt,null)}render(){this.container.classList.add("circleAnnotation");const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0),Ze=fe.borderStyle.width,at=st(this,yt,this.svgFactory.createElement("svg:ellipse"));return at.setAttribute("cx",ke/2),at.setAttribute("cy",je/2),at.setAttribute("rx",ke/2-Ze/2),at.setAttribute("ry",je/2-Ze/2),at.setAttribute("stroke-width",Ze||1),at.setAttribute("stroke","transparent"),at.setAttribute("fill","transparent"),ze.append(at),this.container.append(ze),!fe.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return ce(this,yt)}addHighlightArea(){this.container.classList.add("highlightArea")}}yt=new WeakMap;class Ie extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,St,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0);let Ze=[];for(const _t of fe.vertices){const xt=_t.x-fe.rect[0],Ft=fe.rect[3]-_t.y;Ze.push(xt+","+Ft)}Ze=Ze.join(" ");const at=st(this,St,this.svgFactory.createElement(this.svgElementName));return at.setAttribute("points",Ze),at.setAttribute("stroke-width",fe.borderStyle.width||1),at.setAttribute("stroke","transparent"),at.setAttribute("fill","transparent"),ze.append(at),this.container.append(ze),!fe.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return ce(this,St)}addHighlightArea(){this.container.classList.add("highlightArea")}}St=new WeakMap;class Xe extends Ie{constructor(Ue){super(Ue),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class rt extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class lt extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,wn,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=re.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0);for(const Ze of fe.inkLists){let at=[];for(const xt of Ze){const Ft=xt.x-fe.rect[0],qt=fe.rect[3]-xt.y;at.push("".concat(Ft,",").concat(qt))}at=at.join(" ");const _t=this.svgFactory.createElement(this.svgElementName);ce(this,wn).push(_t),_t.setAttribute("points",at),_t.setAttribute("stroke-width",fe.borderStyle.width||1),_t.setAttribute("stroke","transparent"),_t.setAttribute("fill","transparent"),!fe.popupRef&&this.hasPopupData&&this._createPopup(),ze.append(_t)}return this.container.append(ze),this.container}getElementsToTriggerPopup(){return ce(this,wn)}addHighlightArea(){this.container.classList.add("highlightArea")}}wn=new WeakMap,te.InkAnnotationElement=lt;class Ge extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class ut extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class mt extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class wt extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class Et extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}te.StampAnnotationElement=Et;class De extends me{constructor(fe){var ze;super(fe,{isRenderable:!0});We(this,Je);We(this,Qt,null);const{filename:ke,content:je}=this.data.file;this.filename=(0,ie.getFilenameFromUrl)(ke,!0),this.content=je,(ze=this.linkService.eventBus)==null||ze.dispatch("fileattachmentannotation",{source:this,filename:ke,content:je})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:fe,data:ke}=this;let je;ke.hasAppearance||ke.fillAlpha===0?je=document.createElement("div"):(je=document.createElement("img"),je.src="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(ke.name)?"paperclip":"pushpin",".svg"),ke.fillAlpha&&ke.fillAlpha<1&&(je.style="filter: opacity(".concat(Math.round(ke.fillAlpha*100),"%);"))),je.addEventListener("dblclick",Ke(this,Je,Mr).bind(this)),st(this,Qt,je);const{isMac:ze}=re.FeatureTest.platform;return fe.addEventListener("keydown",Ze=>{Ze.key==="Enter"&&(ze?Ze.metaKey:Ze.ctrlKey)&&Ke(this,Je,Mr).call(this)}),!ke.popupRef&&this.hasPopupData?this._createPopup():je.classList.add("popupTriggerArea"),fe.append(je),fe}getElementsToTriggerPopup(){return ce(this,Qt)}addHighlightArea(){this.container.classList.add("highlightArea")}}Qt=new WeakMap,Je=new WeakSet,Mr=function(){var fe;(fe=this.downloadManager)==null||fe.openOrDownloadData(this.container,this.content,this.filename)};class pe{constructor({div:Ue,accessibilityManager:fe,annotationCanvasMap:ke,l10n:je,page:ze,viewport:Ze}){We(this,Nt);We(this,bt);We(this,Lt,null);We(this,Rt,null);We(this,Dt,new Map);this.div=Ue,st(this,Lt,fe),st(this,Rt,ke),this.l10n=je,this.page=ze,this.viewport=Ze,this.zIndex=0,this.l10n||(this.l10n=he.NullL10n)}async render(Ue){const{annotations:fe}=Ue,ke=this.div;(0,ie.setLayerDimensions)(ke,this.viewport);const je=new Map,ze={data:null,layer:ke,linkService:Ue.linkService,downloadManager:Ue.downloadManager,imageResourcesPath:Ue.imageResourcesPath||"",renderForms:Ue.renderForms!==!1,svgFactory:new ie.DOMSVGFactory,annotationStorage:Ue.annotationStorage||new se.AnnotationStorage,enableScripting:Ue.enableScripting===!0,hasJSActions:Ue.hasJSActions,fieldObjects:Ue.fieldObjects,parent:this,elements:null};for(const Ze of fe){if(Ze.noHTML)continue;const at=Ze.annotationType===re.AnnotationType.POPUP;if(at){const Ft=je.get(Ze.id);if(!Ft)continue;ze.elements=Ft}else{const{width:Ft,height:qt}=Ae(Ze.rect);if(Ft<=0||qt<=0)continue}ze.data=Ze;const _t=_e.create(ze);if(!_t.isRenderable)continue;if(!at&&Ze.popupRef){const Ft=je.get(Ze.popupRef);Ft?Ft.push(_t):je.set(Ze.popupRef,[_t])}_t.annotationEditorType>0&&ce(this,Dt).set(_t.data.id,_t);const xt=_t.render();Ze.hidden&&(xt.style.visibility="hidden"),Ke(this,Nt,si).call(this,xt,Ze.id)}Ke(this,bt,$r).call(this),await this.l10n.translate(ke)}update({viewport:Ue}){const fe=this.div;this.viewport=Ue,(0,ie.setLayerDimensions)(fe,{rotation:Ue.rotation}),Ke(this,bt,$r).call(this),fe.hidden=!1}getEditableAnnotations(){return Array.from(ce(this,Dt).values())}getEditableAnnotation(Ue){return ce(this,Dt).get(Ue)}}Lt=new WeakMap,Rt=new WeakMap,Dt=new WeakMap,Nt=new WeakSet,si=function(Ue,fe){var je;const ke=Ue.firstChild||Ue;ke.id="".concat(re.AnnotationPrefix).concat(fe),this.div.append(Ue),(je=ce(this,Lt))==null||je.moveElementInDOM(this.div,Ue,ke,!1)},bt=new WeakSet,$r=function(){if(!ce(this,Rt))return;const Ue=this.div;for(const[fe,ke]of ce(this,Rt)){const je=Ue.querySelector('[data-annotation-id="'.concat(fe,'"]'));if(!je)continue;const{firstChild:ze}=je;ze?ze.nodeName==="CANVAS"?ze.replaceWith(ke):ze.before(ke):je.append(ke)}ce(this,Rt).clear()},te.AnnotationLayer=pe},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.ColorConverters=void 0;function ne(se){return Math.floor(Math.max(0,Math.min(1,se))*255).toString(16).padStart(2,"0")}function re(se){return Math.max(0,Math.min(255,255*se))}class ie{static CMYK_G([oe,he,ue,de]){return["G",1-Math.min(1,.3*oe+.59*ue+.11*he+de)]}static G_CMYK([oe]){return["CMYK",0,0,0,1-oe]}static G_RGB([oe]){return["RGB",oe,oe,oe]}static G_rgb([oe]){return oe=re(oe),[oe,oe,oe]}static G_HTML([oe]){const he=ne(oe);return"#".concat(he).concat(he).concat(he)}static RGB_G([oe,he,ue]){return["G",.3*oe+.59*he+.11*ue]}static RGB_rgb(oe){return oe.map(re)}static RGB_HTML(oe){return"#".concat(oe.map(ne).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([oe,he,ue,de]){return["RGB",1-Math.min(1,oe+de),1-Math.min(1,ue+de),1-Math.min(1,he+de)]}static CMYK_rgb([oe,he,ue,de]){return[re(1-Math.min(1,oe+de)),re(1-Math.min(1,ue+de)),re(1-Math.min(1,he+de))]}static CMYK_HTML(oe){const he=this.CMYK_RGB(oe).slice(1);return this.RGB_HTML(he)}static RGB_CMYK([oe,he,ue]){const de=1-oe,ae=1-he,le=1-ue,Ae=Math.min(de,ae,le);return["CMYK",de,ae,le,Ae]}}te.ColorConverters=ie},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.NullL10n=void 0,te.getL10nFallback=re;const ne={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};ne.print_progress_percent="{{progress}}%";function re(oe,he){switch(oe){case"find_match_count":oe="find_match_count[".concat(he.total===1?"one":"other","]");break;case"find_match_count_limit":oe="find_match_count_limit[".concat(he.limit===1?"one":"other","]");break}return ne[oe]||""}function ie(oe,he){return he?oe.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(ue,de)=>de in he?he[de]:"{{"+de+"}}"):oe}const se={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(oe,he=null,ue=re(oe,he)){return ie(ue,he)},async translate(oe){}};te.NullL10n=se},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.XfaLayer=void 0;var re=ne(25);class ie{static setupStorage(oe,he,ue,de,ae){const le=de.getValue(he,{value:null});switch(ue.name){case"textarea":if(le.value!==null&&(oe.textContent=le.value),ae==="print")break;oe.addEventListener("input",Ae=>{de.setValue(he,{value:Ae.target.value})});break;case"input":if(ue.attributes.type==="radio"||ue.attributes.type==="checkbox"){if(le.value===ue.attributes.xfaOn?oe.setAttribute("checked",!0):le.value===ue.attributes.xfaOff&&oe.removeAttribute("checked"),ae==="print")break;oe.addEventListener("change",Ae=>{de.setValue(he,{value:Ae.target.checked?Ae.target.getAttribute("xfaOn"):Ae.target.getAttribute("xfaOff")})})}else{if(le.value!==null&&oe.setAttribute("value",le.value),ae==="print")break;oe.addEventListener("input",Ae=>{de.setValue(he,{value:Ae.target.value})})}break;case"select":if(le.value!==null){oe.setAttribute("value",le.value);for(const Ae of ue.children)Ae.attributes.value===le.value?Ae.attributes.selected=!0:Ae.attributes.hasOwnProperty("selected")&&delete Ae.attributes.selected}oe.addEventListener("input",Ae=>{const _e=Ae.target.options,me=_e.selectedIndex===-1?"":_e[_e.selectedIndex].value;de.setValue(he,{value:me})});break}}static setAttributes({html:oe,element:he,storage:ue=null,intent:de,linkService:ae}){const{attributes:le}=he,Ae=oe instanceof HTMLAnchorElement;le.type==="radio"&&(le.name="".concat(le.name,"-").concat(de));for(const[_e,me]of Object.entries(le))if(me!=null)switch(_e){case"class":me.length&&oe.setAttribute(_e,me.join(" "));break;case"dataId":break;case"id":oe.setAttribute("data-element-id",me);break;case"style":Object.assign(oe.style,me);break;case"textContent":oe.textContent=me;break;default:(!Ae||_e!=="href"&&_e!=="newWindow")&&oe.setAttribute(_e,me)}Ae&&ae.addLinkAttributes(oe,le.href,le.newWindow),ue&&le.dataId&&this.setupStorage(oe,le.dataId,he,ue)}static render(oe){var ve;const he=oe.annotationStorage,ue=oe.linkService,de=oe.xfaHtml,ae=oe.intent||"display",le=document.createElement(de.name);de.attributes&&this.setAttributes({html:le,element:de,intent:ae,linkService:ue});const Ae=[[de,-1,le]],_e=oe.div;if(_e.append(le),oe.viewport){const Se="matrix(".concat(oe.viewport.transform.join(","),")");_e.style.transform=Se}ae!=="richText"&&_e.setAttribute("class","xfaLayer xfaFont");const me=[];for(;Ae.length>0;){const[Se,Te,Pe]=Ae.at(-1);if(Te+1===Se.children.length){Ae.pop();continue}const Re=Se.children[++Ae.at(-1)[1]];if(Re===null)continue;const{name:$e}=Re;if($e==="#text"){const Ee=document.createTextNode(Re.value);me.push(Ee),Pe.append(Ee);continue}const ye=(ve=Re==null?void 0:Re.attributes)!=null&&ve.xmlns?document.createElementNS(Re.attributes.xmlns,$e):document.createElement($e);if(Pe.append(ye),Re.attributes&&this.setAttributes({html:ye,element:Re,storage:he,intent:ae,linkService:ue}),Re.children&&Re.children.length>0)Ae.push([Re,-1,ye]);else if(Re.value){const Ee=document.createTextNode(Re.value);re.XfaText.shouldBuildText($e)&&me.push(Ee),ye.append(Ee)}}for(const Se of _e.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))Se.setAttribute("readOnly",!0);return{textDivs:me}}static update(oe){const he="matrix(".concat(oe.viewport.transform.join(","),")");oe.div.style.transform=he,oe.div.hidden=!1}}te.XfaLayer=ie},(ee,te,ne)=>{var de,ae,le,Ae,_e,me,ve,Se,Te,Pe,Re,$e,ye,Ee,Ne,oi,we,ai,Fe,li,qe,ci,Xe,kr,lt,ui,ut,Lr,wt,di,De,hi,be,fi,Ce,pi,Le,gi,He,Rn,et,Ir,ht,er,ct,tr,It,On,kt,Or,tt,nr,ft,mi,Ct,Dr,Wt,_i,zt,yi,jt,Nr,dt,rr,Ye,Dn;Object.defineProperty(te,"__esModule",{value:!0}),te.InkEditor=void 0;var re=ne(1),ie=ne(4),se=ne(29),oe=ne(6),he=ne(5);const St=class St extends ie.AnnotationEditor{constructor(Je){super({...Je,name:"inkEditor"});We(this,Ne);We(this,we);We(this,Fe);We(this,qe);We(this,Xe);We(this,lt);We(this,ut);We(this,wt);We(this,De);We(this,be);We(this,Ce);We(this,Le);We(this,He);We(this,et);We(this,ht);We(this,ct);We(this,It);We(this,kt);We(this,tt);We(this,zt);We(this,jt);We(this,dt);We(this,Ye);We(this,de,0);We(this,ae,0);We(this,le,this.canvasPointermove.bind(this));We(this,Ae,this.canvasPointerleave.bind(this));We(this,_e,this.canvasPointerup.bind(this));We(this,me,this.canvasPointerdown.bind(this));We(this,ve,new Path2D);We(this,Se,!1);We(this,Te,!1);We(this,Pe,!1);We(this,Re,null);We(this,$e,0);We(this,ye,0);We(this,Ee,null);this.color=Je.color||null,this.thickness=Je.thickness||null,this.opacity=Je.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(Je){ie.AnnotationEditor.initialize(Je,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(Je,At){switch(Je){case re.AnnotationEditorParamsType.INK_THICKNESS:St._defaultThickness=At;break;case re.AnnotationEditorParamsType.INK_COLOR:St._defaultColor=At;break;case re.AnnotationEditorParamsType.INK_OPACITY:St._defaultOpacity=At/100;break}}updateParams(Je,At){switch(Je){case re.AnnotationEditorParamsType.INK_THICKNESS:Ke(this,Ne,oi).call(this,At);break;case re.AnnotationEditorParamsType.INK_COLOR:Ke(this,we,ai).call(this,At);break;case re.AnnotationEditorParamsType.INK_OPACITY:Ke(this,Fe,li).call(this,At);break}}static get defaultPropertiesToUpdate(){return[[re.AnnotationEditorParamsType.INK_THICKNESS,St._defaultThickness],[re.AnnotationEditorParamsType.INK_COLOR,St._defaultColor||ie.AnnotationEditor._defaultLineColor],[re.AnnotationEditorParamsType.INK_OPACITY,Math.round(St._defaultOpacity*100)]]}get propertiesToUpdate(){var Je;return[[re.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||St._defaultThickness],[re.AnnotationEditorParamsType.INK_COLOR,this.color||St._defaultColor||ie.AnnotationEditor._defaultLineColor],[re.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*((Je=this.opacity)!=null?Je:St._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(Ke(this,ht,er).call(this),Ke(this,ct,tr).call(this)),this.isAttachedToDOM||(this.parent.add(this),Ke(this,It,On).call(this)),Ke(this,Ye,Dn).call(this)))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,ce(this,Re).disconnect(),st(this,Re,null),super.remove())}setParent(Je){!this.parent&&Je?this._uiManager.removeShouldRescale(this):this.parent&&Je===null&&this._uiManager.addShouldRescale(this),super.setParent(Je)}onScaleChanging(){const[Je,At]=this.parentDimensions,Lt=this.width*Je,Rt=this.height*At;this.setDimensions(Lt,Rt)}enableEditMode(){ce(this,Se)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",ce(this,me)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",ce(this,me)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){ce(this,Se)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),st(this,Se,!0),this.div.classList.add("disabled"),Ke(this,Ye,Dn).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(Je){this._focusEventsAllowed&&(super.focusin(Je),this.enableEditMode())}canvasPointerdown(Je){Je.button!==0||!this.isInEditMode()||ce(this,Se)||(this.setInForeground(),Je.preventDefault(),Je.type!=="mouse"&&this.div.focus(),Ke(this,lt,ui).call(this,Je.offsetX,Je.offsetY))}canvasPointermove(Je){Je.preventDefault(),Ke(this,ut,Lr).call(this,Je.offsetX,Je.offsetY)}canvasPointerup(Je){Je.preventDefault(),Ke(this,et,Ir).call(this,Je)}canvasPointerleave(Je){Ke(this,et,Ir).call(this,Je)}get isResizable(){return!this.isEmpty()&&ce(this,Se)}render(){if(this.div)return this.div;let Je,At;this.width&&(Je=this.x,At=this.y),super.render(),ie.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(Zt=>{var bt;return(bt=this.div)==null?void 0:bt.setAttribute("aria-label",Zt)});const[Lt,Rt,Dt,Nt]=Ke(this,qe,ci).call(this);if(this.setAt(Lt,Rt,0,0),this.setDims(Dt,Nt),Ke(this,ht,er).call(this),this.width){const[Zt,bt]=this.parentDimensions;this.setAspectRatio(this.width*Zt,this.height*bt),this.setAt(Je*Zt,At*bt,this.width*Zt,this.height*bt),st(this,Pe,!0),Ke(this,It,On).call(this),this.setDims(this.width*Zt,this.height*bt),Ke(this,He,Rn).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return Ke(this,ct,tr).call(this),this.div}setDimensions(Je,At){const Lt=Math.round(Je),Rt=Math.round(At);if(ce(this,$e)===Lt&&ce(this,ye)===Rt)return;st(this,$e,Lt),st(this,ye,Rt),this.canvas.style.visibility="hidden";const[Dt,Nt]=this.parentDimensions;this.width=Je/Dt,this.height=At/Nt,this.fixAndSetPosition(),ce(this,Se)&&Ke(this,kt,Or).call(this,Je,At),Ke(this,It,On).call(this),Ke(this,He,Rn).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(Je,At,Lt){var ze,Ze,at;if(Je instanceof se.InkAnnotationElement)return null;const Rt=super.deserialize(Je,At,Lt);Rt.thickness=Je.thickness,Rt.color=re.Util.makeHexColor(...Je.color),Rt.opacity=Je.opacity;const[Dt,Nt]=Rt.pageDimensions,Zt=Rt.width*Dt,bt=Rt.height*Nt,Kt=Rt.parentScale,Ot=Je.thickness/2;st(Rt,Se,!0),st(Rt,$e,Math.round(Zt)),st(Rt,ye,Math.round(bt));const{paths:Ue,rect:fe,rotation:ke}=Je;for(let{bezier:_t}of Ue){_t=Ke(ze=St,Wt,_i).call(ze,_t,fe,ke);const xt=[];Rt.paths.push(xt);let Ft=Kt*(_t[0]-Ot),qt=Kt*(_t[1]-Ot);for(let $t=2,Bt=_t.length;$t<Bt;$t+=6){const Xt=Kt*(_t[$t]-Ot),Yt=Kt*(_t[$t+1]-Ot),Jt=Kt*(_t[$t+2]-Ot),Tn=Kt*(_t[$t+3]-Ot),En=Kt*(_t[$t+4]-Ot),xn=Kt*(_t[$t+5]-Ot);xt.push([[Ft,qt],[Xt,Yt],[Jt,Tn],[En,xn]]),Ft=En,qt=xn}const Mt=Ke(this,ft,mi).call(this,xt);Rt.bezierPath2D.push(Mt)}const je=Ke(Ze=Rt,jt,Nr).call(Ze);return st(Rt,ae,Math.max(ie.AnnotationEditor.MIN_SIZE,je[2]-je[0])),st(Rt,de,Math.max(ie.AnnotationEditor.MIN_SIZE,je[3]-je[1])),Ke(at=Rt,kt,Or).call(at,Zt,bt),Rt}serialize(){if(this.isEmpty())return null;const Je=this.getRect(0,0),At=ie.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:re.AnnotationEditorType.INK,color:At,thickness:this.thickness,opacity:this.opacity,paths:Ke(this,zt,yi).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,Je),pageIndex:this.pageIndex,rect:Je,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakMap,Pe=new WeakMap,Re=new WeakMap,$e=new WeakMap,ye=new WeakMap,Ee=new WeakMap,Ne=new WeakSet,oi=function(Je){const At=this.thickness;this.addCommands({cmd:()=>{this.thickness=Je,Ke(this,Ye,Dn).call(this)},undo:()=>{this.thickness=At,Ke(this,Ye,Dn).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},we=new WeakSet,ai=function(Je){const At=this.color;this.addCommands({cmd:()=>{this.color=Je,Ke(this,He,Rn).call(this)},undo:()=>{this.color=At,Ke(this,He,Rn).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Fe=new WeakSet,li=function(Je){Je/=100;const At=this.opacity;this.addCommands({cmd:()=>{this.opacity=Je,Ke(this,He,Rn).call(this)},undo:()=>{this.opacity=At,Ke(this,He,Rn).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},qe=new WeakSet,ci=function(){const{parentRotation:Je,parentDimensions:[At,Lt]}=this;switch(Je){case 90:return[0,Lt,Lt,At];case 180:return[At,Lt,At,Lt];case 270:return[At,0,Lt,At];default:return[0,0,At,Lt]}},Xe=new WeakSet,kr=function(){const{ctx:Je,color:At,opacity:Lt,thickness:Rt,parentScale:Dt,scaleFactor:Nt}=this;Je.lineWidth=Rt*Dt/Nt,Je.lineCap="round",Je.lineJoin="round",Je.miterLimit=10,Je.strokeStyle="".concat(At).concat((0,he.opacityToHex)(Lt))},lt=new WeakSet,ui=function(Je,At){var Lt;this.canvas.addEventListener("contextmenu",oe.noContextMenu),this.canvas.addEventListener("pointerleave",ce(this,Ae)),this.canvas.addEventListener("pointermove",ce(this,le)),this.canvas.addEventListener("pointerup",ce(this,_e)),this.canvas.removeEventListener("pointerdown",ce(this,me)),this.isEditing=!0,ce(this,Pe)||(st(this,Pe,!0),Ke(this,It,On).call(this),this.thickness||(this.thickness=St._defaultThickness),this.color||(this.color=St._defaultColor||ie.AnnotationEditor._defaultLineColor),(Lt=this.opacity)!=null||(this.opacity=St._defaultOpacity)),this.currentPath.push([Je,At]),st(this,Te,!1),Ke(this,Xe,kr).call(this),st(this,Ee,()=>{Ke(this,be,fi).call(this),ce(this,Ee)&&window.requestAnimationFrame(ce(this,Ee))}),window.requestAnimationFrame(ce(this,Ee))},ut=new WeakSet,Lr=function(Je,At){const[Lt,Rt]=this.currentPath.at(-1);if(this.currentPath.length>1&&Je===Lt&&At===Rt)return;const Dt=this.currentPath;let Nt=ce(this,ve);if(Dt.push([Je,At]),st(this,Te,!0),Dt.length<=2){Nt.moveTo(...Dt[0]),Nt.lineTo(Je,At);return}Dt.length===3&&(st(this,ve,Nt=new Path2D),Nt.moveTo(...Dt[0])),Ke(this,Ce,pi).call(this,Nt,...Dt.at(-3),...Dt.at(-2),Je,At)},wt=new WeakSet,di=function(){if(this.currentPath.length===0)return;const Je=this.currentPath.at(-1);ce(this,ve).lineTo(...Je)},De=new WeakSet,hi=function(Je,At){st(this,Ee,null),Je=Math.min(Math.max(Je,0),this.canvas.width),At=Math.min(Math.max(At,0),this.canvas.height),Ke(this,ut,Lr).call(this,Je,At),Ke(this,wt,di).call(this);let Lt;if(this.currentPath.length!==1)Lt=Ke(this,Le,gi).call(this);else{const bt=[Je,At];Lt=[[bt,bt.slice(),bt.slice(),bt]]}const Rt=ce(this,ve),Dt=this.currentPath;this.currentPath=[],st(this,ve,new Path2D);const Nt=()=>{this.allRawPaths.push(Dt),this.paths.push(Lt),this.bezierPath2D.push(Rt),this.rebuild()},Zt=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(Ke(this,ht,er).call(this),Ke(this,ct,tr).call(this)),Ke(this,Ye,Dn).call(this))};this.addCommands({cmd:Nt,undo:Zt,mustExec:!0})},be=new WeakSet,fi=function(){if(!ce(this,Te))return;st(this,Te,!1);const Je=Math.ceil(this.thickness*this.parentScale),At=this.currentPath.slice(-3),Lt=At.map(Nt=>Nt[0]),Rt=At.map(Nt=>Nt[1]);Math.min(...Lt)-Je,Math.max(...Lt)+Je,Math.min(...Rt)-Je,Math.max(...Rt)+Je;const{ctx:Dt}=this;Dt.save(),Dt.clearRect(0,0,this.canvas.width,this.canvas.height);for(const Nt of this.bezierPath2D)Dt.stroke(Nt);Dt.stroke(ce(this,ve)),Dt.restore()},Ce=new WeakSet,pi=function(Je,At,Lt,Rt,Dt,Nt,Zt){const bt=(At+Rt)/2,Kt=(Lt+Dt)/2,Ot=(Rt+Nt)/2,Ue=(Dt+Zt)/2;Je.bezierCurveTo(bt+2*(Rt-bt)/3,Kt+2*(Dt-Kt)/3,Ot+2*(Rt-Ot)/3,Ue+2*(Dt-Ue)/3,Ot,Ue)},Le=new WeakSet,gi=function(){const Je=this.currentPath;if(Je.length<=2)return[[Je[0],Je[0],Je.at(-1),Je.at(-1)]];const At=[];let Lt,[Rt,Dt]=Je[0];for(Lt=1;Lt<Je.length-2;Lt++){const[fe,ke]=Je[Lt],[je,ze]=Je[Lt+1],Ze=(fe+je)/2,at=(ke+ze)/2,_t=[Rt+2*(fe-Rt)/3,Dt+2*(ke-Dt)/3],xt=[Ze+2*(fe-Ze)/3,at+2*(ke-at)/3];At.push([[Rt,Dt],_t,xt,[Ze,at]]),[Rt,Dt]=[Ze,at]}const[Nt,Zt]=Je[Lt],[bt,Kt]=Je[Lt+1],Ot=[Rt+2*(Nt-Rt)/3,Dt+2*(Zt-Dt)/3],Ue=[bt+2*(Nt-bt)/3,Kt+2*(Zt-Kt)/3];return At.push([[Rt,Dt],Ot,Ue,[bt,Kt]]),At},He=new WeakSet,Rn=function(){if(this.isEmpty()){Ke(this,tt,nr).call(this);return}Ke(this,Xe,kr).call(this);const{canvas:Je,ctx:At}=this;At.setTransform(1,0,0,1,0,0),At.clearRect(0,0,Je.width,Je.height),Ke(this,tt,nr).call(this);for(const Lt of this.bezierPath2D)At.stroke(Lt)},et=new WeakSet,Ir=function(Je){this.canvas.removeEventListener("pointerleave",ce(this,Ae)),this.canvas.removeEventListener("pointermove",ce(this,le)),this.canvas.removeEventListener("pointerup",ce(this,_e)),this.canvas.addEventListener("pointerdown",ce(this,me)),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",oe.noContextMenu)},10),Ke(this,De,hi).call(this,Je.offsetX,Je.offsetY),this.addToAnnotationStorage(),this.setInBackground()},ht=new WeakSet,er=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",ie.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(Je=>{var At;return(At=this.canvas)==null?void 0:At.setAttribute("aria-label",Je)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},ct=new WeakSet,tr=function(){st(this,Re,new ResizeObserver(Je=>{const At=Je[0].contentRect;At.width&&At.height&&this.setDimensions(At.width,At.height)})),ce(this,Re).observe(this.div)},It=new WeakSet,On=function(){if(!ce(this,Pe))return;const[Je,At]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*Je),this.canvas.height=Math.ceil(this.height*At),Ke(this,tt,nr).call(this)},kt=new WeakSet,Or=function(Je,At){const Lt=Ke(this,dt,rr).call(this),Rt=(Je-Lt)/ce(this,ae),Dt=(At-Lt)/ce(this,de);this.scaleFactor=Math.min(Rt,Dt)},tt=new WeakSet,nr=function(){const Je=Ke(this,dt,rr).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+Je,this.translationY*this.scaleFactor+Je)},ft=new WeakSet,mi=function(Je){const At=new Path2D;for(let Lt=0,Rt=Je.length;Lt<Rt;Lt++){const[Dt,Nt,Zt,bt]=Je[Lt];Lt===0&&At.moveTo(...Dt),At.bezierCurveTo(Nt[0],Nt[1],Zt[0],Zt[1],bt[0],bt[1])}return At},Ct=new WeakSet,Dr=function(Je,At,Lt){const[Rt,Dt,Nt,Zt]=At;switch(Lt){case 0:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2)Je[bt]+=Rt,Je[bt+1]=Zt-Je[bt+1];break;case 90:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2){const Ot=Je[bt];Je[bt]=Je[bt+1]+Rt,Je[bt+1]=Ot+Dt}break;case 180:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2)Je[bt]=Nt-Je[bt],Je[bt+1]+=Dt;break;case 270:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2){const Ot=Je[bt];Je[bt]=Nt-Je[bt+1],Je[bt+1]=Zt-Ot}break;default:throw new Error("Invalid rotation")}return Je},Wt=new WeakSet,_i=function(Je,At,Lt){const[Rt,Dt,Nt,Zt]=At;switch(Lt){case 0:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2)Je[bt]-=Rt,Je[bt+1]=Zt-Je[bt+1];break;case 90:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2){const Ot=Je[bt];Je[bt]=Je[bt+1]-Dt,Je[bt+1]=Ot-Rt}break;case 180:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2)Je[bt]=Nt-Je[bt],Je[bt+1]-=Dt;break;case 270:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2){const Ot=Je[bt];Je[bt]=Zt-Je[bt+1],Je[bt+1]=Nt-Ot}break;default:throw new Error("Invalid rotation")}return Je},zt=new WeakSet,yi=function(Je,At,Lt,Rt){var Kt,Ot;const Dt=[],Nt=this.thickness/2,Zt=Je*At+Nt,bt=Je*Lt+Nt;for(const Ue of this.paths){const fe=[],ke=[];for(let je=0,ze=Ue.length;je<ze;je++){const[Ze,at,_t,xt]=Ue[je],Ft=Je*Ze[0]+Zt,qt=Je*Ze[1]+bt,Mt=Je*at[0]+Zt,$t=Je*at[1]+bt,Bt=Je*_t[0]+Zt,Xt=Je*_t[1]+bt,Yt=Je*xt[0]+Zt,Jt=Je*xt[1]+bt;je===0&&(fe.push(Ft,qt),ke.push(Ft,qt)),fe.push(Mt,$t,Bt,Xt,Yt,Jt),ke.push(Mt,$t),je===ze-1&&ke.push(Yt,Jt)}Dt.push({bezier:Ke(Kt=St,Ct,Dr).call(Kt,fe,Rt,this.rotation),points:Ke(Ot=St,Ct,Dr).call(Ot,ke,Rt,this.rotation)})}return Dt},jt=new WeakSet,Nr=function(){let Je=1/0,At=-1/0,Lt=1/0,Rt=-1/0;for(const Dt of this.paths)for(const[Nt,Zt,bt,Kt]of Dt){const Ot=re.Util.bezierBoundingBox(...Nt,...Zt,...bt,...Kt);Je=Math.min(Je,Ot[0]),Lt=Math.min(Lt,Ot[1]),At=Math.max(At,Ot[2]),Rt=Math.max(Rt,Ot[3])}return[Je,Lt,At,Rt]},dt=new WeakSet,rr=function(){return ce(this,Se)?Math.ceil(this.thickness*this.parentScale):0},Ye=new WeakSet,Dn=function(Je=!1){if(this.isEmpty())return;if(!ce(this,Se)){Ke(this,He,Rn).call(this);return}const At=Ke(this,jt,Nr).call(this),Lt=Ke(this,dt,rr).call(this);st(this,ae,Math.max(ie.AnnotationEditor.MIN_SIZE,At[2]-At[0])),st(this,de,Math.max(ie.AnnotationEditor.MIN_SIZE,At[3]-At[1]));const Rt=Math.ceil(Lt+ce(this,ae)*this.scaleFactor),Dt=Math.ceil(Lt+ce(this,de)*this.scaleFactor),[Nt,Zt]=this.parentDimensions;this.width=Rt/Nt,this.height=Dt/Zt,this.setAspectRatio(Rt,Dt);const bt=this.translationX,Kt=this.translationY;this.translationX=-At[0],this.translationY=-At[1],Ke(this,It,On).call(this),Ke(this,He,Rn).call(this),st(this,$e,Rt),st(this,ye,Dt),this.setDims(Rt,Dt);const Ot=Je?Lt/this.scaleFactor/2:0;this.translate(bt-this.translationX-Ot,Kt-this.translationY-Ot)},We(St,ft),We(St,Ct),We(St,Wt),An(St,"_defaultColor",null),An(St,"_defaultOpacity",1),An(St,"_defaultThickness",1),An(St,"_type","ink");let ue=St;te.InkEditor=ue},(ee,te,ne)=>{var ue,de,ae,le,Ae,_e,me,ve,Se,Te,Pe,Vn,$e,Gn,Ee,ir,Me,Br,Oe,bi,Ve,Si,Ie,Ur,rt,sr,Ge,vi;Object.defineProperty(te,"__esModule",{value:!0}),te.StampEditor=void 0;var re=ne(1),ie=ne(4),se=ne(6),oe=ne(29);const mt=class mt extends ie.AnnotationEditor{constructor(De){super({...De,name:"stampEditor"});We(this,Pe);We(this,$e);We(this,Ee);We(this,Me);We(this,Oe);We(this,Ve);We(this,Ie);We(this,rt);We(this,Ge);We(this,ue,null);We(this,de,null);We(this,ae,null);We(this,le,null);We(this,Ae,null);We(this,_e,null);We(this,me,null);We(this,ve,null);We(this,Se,!1);We(this,Te,!1);st(this,le,De.bitmapUrl),st(this,Ae,De.bitmapFile)}static initialize(De){ie.AnnotationEditor.initialize(De)}static get supportedTypes(){const De=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,re.shadow)(this,"supportedTypes",De.map(pe=>"image/".concat(pe)))}static get supportedTypesStr(){return(0,re.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(De){return this.supportedTypes.includes(De)}static paste(De,pe){pe.pasteEditor(re.AnnotationEditorType.STAMP,{bitmapFile:De.getAsFile()})}remove(){var De,pe;ce(this,de)&&(st(this,ue,null),this._uiManager.imageManager.deleteId(ce(this,de)),(De=ce(this,_e))==null||De.remove(),st(this,_e,null),(pe=ce(this,me))==null||pe.disconnect(),st(this,me,null)),super.remove()}rebuild(){if(!this.parent){ce(this,de)&&Ke(this,Ee,ir).call(this);return}super.rebuild(),this.div!==null&&(ce(this,de)&&Ke(this,Ee,ir).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(ce(this,ae)||ce(this,ue)||ce(this,le)||ce(this,Ae))}get isResizable(){return!0}render(){if(this.div)return this.div;let De,pe;if(this.width&&(De=this.x,pe=this.y),super.render(),this.div.hidden=!0,ce(this,ue)?Ke(this,Me,Br).call(this):Ke(this,Ee,ir).call(this),this.width){const[be,ge]=this.parentDimensions;this.setAt(De*be,pe*ge,this.width*be,this.height*ge)}return this.div}static deserialize(De,pe,be){if(De instanceof oe.StampAnnotationElement)return null;const ge=super.deserialize(De,pe,be),{rect:Ce,bitmapUrl:xe,bitmapId:Le,isSvg:Be,accessibilityData:He}=De;Le&&be.imageManager.isValidId(Le)?st(ge,de,Le):st(ge,le,xe),st(ge,Se,Be);const[it,et]=ge.pageDimensions;return ge.width=(Ce[2]-Ce[0])/it,ge.height=(Ce[3]-Ce[1])/et,He&&(ge.altTextData=He),ge}serialize(De=!1,pe=null){if(this.isEmpty())return null;const be={annotationType:re.AnnotationEditorType.STAMP,bitmapId:ce(this,de),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:ce(this,Se),structTreeParentId:this._structTreeParentId};if(De)return be.bitmapUrl=Ke(this,rt,sr).call(this,!0),be.accessibilityData=this.altTextData,be;const{decorative:ge,altText:Ce}=this.altTextData;if(!ge&&Ce&&(be.accessibilityData={type:"Figure",alt:Ce}),pe===null)return be;pe.stamps||(pe.stamps=new Map);const xe=ce(this,Se)?(be.rect[2]-be.rect[0])*(be.rect[3]-be.rect[1]):null;if(!pe.stamps.has(ce(this,de)))pe.stamps.set(ce(this,de),{area:xe,serialized:be}),be.bitmap=Ke(this,rt,sr).call(this,!1);else if(ce(this,Se)){const Le=pe.stamps.get(ce(this,de));xe>Le.area&&(Le.area=xe,Le.serialized.bitmap.close(),Le.serialized.bitmap=Ke(this,rt,sr).call(this,!1))}return be}};ue=new WeakMap,de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakMap,Pe=new WeakSet,Vn=function(De,pe=!1){if(!De){this.remove();return}st(this,ue,De.bitmap),pe||(st(this,de,De.id),st(this,Se,De.isSvg)),Ke(this,Me,Br).call(this)},$e=new WeakSet,Gn=function(){st(this,ae,null),this._uiManager.enableWaiting(!1),ce(this,_e)&&this.div.focus()},Ee=new WeakSet,ir=function(){if(ce(this,de)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(ce(this,de)).then(pe=>Ke(this,Pe,Vn).call(this,pe,!0)).finally(()=>Ke(this,$e,Gn).call(this));return}if(ce(this,le)){const pe=ce(this,le);st(this,le,null),this._uiManager.enableWaiting(!0),st(this,ae,this._uiManager.imageManager.getFromUrl(pe).then(be=>Ke(this,Pe,Vn).call(this,be)).finally(()=>Ke(this,$e,Gn).call(this)));return}if(ce(this,Ae)){const pe=ce(this,Ae);st(this,Ae,null),this._uiManager.enableWaiting(!0),st(this,ae,this._uiManager.imageManager.getFromFile(pe).then(be=>Ke(this,Pe,Vn).call(this,be)).finally(()=>Ke(this,$e,Gn).call(this)));return}const De=document.createElement("input");De.type="file",De.accept=mt.supportedTypesStr,st(this,ae,new Promise(pe=>{De.addEventListener("change",async()=>{if(!De.files||De.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const be=await this._uiManager.imageManager.getFromFile(De.files[0]);Ke(this,Pe,Vn).call(this,be)}pe()}),De.addEventListener("cancel",()=>{this.remove(),pe()})}).finally(()=>Ke(this,$e,Gn).call(this))),De.click()},Me=new WeakSet,Br=function(){const{div:De}=this;let{width:pe,height:be}=ce(this,ue);const[ge,Ce]=this.pageDimensions,xe=.75;if(this.width)pe=this.width*ge,be=this.height*Ce;else if(pe>xe*ge||be>xe*Ce){const it=Math.min(xe*ge/pe,xe*Ce/be);pe*=it,be*=it}const[Le,Be]=this.parentDimensions;this.setDims(pe*Le/ge,be*Be/Ce),this._uiManager.enableWaiting(!1);const He=st(this,_e,document.createElement("canvas"));De.append(He),De.hidden=!1,Ke(this,Ie,Ur).call(this,pe,be),Ke(this,Ge,vi).call(this),ce(this,Te)||(this.parent.addUndoableEditor(this),st(this,Te,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()},Oe=new WeakSet,bi=function(De,pe){var xe;const[be,ge]=this.parentDimensions;this.width=De/be,this.height=pe/ge,this.setDims(De,pe),(xe=this._initialOptions)!=null&&xe.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,ce(this,ve)!==null&&clearTimeout(ce(this,ve)),st(this,ve,setTimeout(()=>{st(this,ve,null),Ke(this,Ie,Ur).call(this,De,pe)},200))},Ve=new WeakSet,Si=function(De,pe){const{width:be,height:ge}=ce(this,ue);let Ce=be,xe=ge,Le=ce(this,ue);for(;Ce>2*De||xe>2*pe;){const Be=Ce,He=xe;Ce>2*De&&(Ce=Ce>=16384?Math.floor(Ce/2)-1:Math.ceil(Ce/2)),xe>2*pe&&(xe=xe>=16384?Math.floor(xe/2)-1:Math.ceil(xe/2));const it=new OffscreenCanvas(Ce,xe);it.getContext("2d").drawImage(Le,0,0,Be,He,0,0,Ce,xe),Le=it.transferToImageBitmap()}return Le},Ie=new WeakSet,Ur=function(De,pe){De=Math.ceil(De),pe=Math.ceil(pe);const be=ce(this,_e);if(!be||be.width===De&&be.height===pe)return;be.width=De,be.height=pe;const ge=ce(this,Se)?ce(this,ue):Ke(this,Ve,Si).call(this,De,pe),Ce=be.getContext("2d");Ce.filter=this._uiManager.hcmFilter,Ce.drawImage(ge,0,0,ge.width,ge.height,0,0,De,pe)},rt=new WeakSet,sr=function(De){if(De){if(ce(this,Se)){const ge=this._uiManager.imageManager.getSvgUrl(ce(this,de));if(ge)return ge}const pe=document.createElement("canvas");return{width:pe.width,height:pe.height}=ce(this,ue),pe.getContext("2d").drawImage(ce(this,ue),0,0),pe.toDataURL()}if(ce(this,Se)){const[pe,be]=this.pageDimensions,ge=Math.round(this.width*pe*se.PixelsPerInch.PDF_TO_CSS_UNITS),Ce=Math.round(this.height*be*se.PixelsPerInch.PDF_TO_CSS_UNITS),xe=new OffscreenCanvas(ge,Ce);return xe.getContext("2d").drawImage(ce(this,ue),0,0,ce(this,ue).width,ce(this,ue).height,0,0,ge,Ce),xe.transferToImageBitmap()}return structuredClone(ce(this,ue))},Ge=new WeakSet,vi=function(){st(this,me,new ResizeObserver(De=>{const pe=De[0].contentRect;pe.width&&pe.height&&Ke(this,Oe,bi).call(this,pe.width,pe.height)})),ce(this,me).observe(this.div)},An(mt,"_type","stamp");let he=mt;te.StampEditor=he}],__webpack_module_cache__={};function __w_pdfjs_require__(ee){var te=__webpack_module_cache__[ee];if(te!==void 0)return te.exports;var ne=__webpack_module_cache__[ee]={exports:{}};return __webpack_modules__[ee](ne,ne.exports,__w_pdfjs_require__),ne.exports}var __webpack_exports__={};return(()=>{var ee=__webpack_exports__;Object.defineProperty(ee,"__esModule",{value:!0}),Object.defineProperty(ee,"AbortException",{enumerable:!0,get:function(){return te.AbortException}}),Object.defineProperty(ee,"AnnotationEditorLayer",{enumerable:!0,get:function(){return se.AnnotationEditorLayer}}),Object.defineProperty(ee,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return te.AnnotationEditorParamsType}}),Object.defineProperty(ee,"AnnotationEditorType",{enumerable:!0,get:function(){return te.AnnotationEditorType}}),Object.defineProperty(ee,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return oe.AnnotationEditorUIManager}}),Object.defineProperty(ee,"AnnotationLayer",{enumerable:!0,get:function(){return he.AnnotationLayer}}),Object.defineProperty(ee,"AnnotationMode",{enumerable:!0,get:function(){return te.AnnotationMode}}),Object.defineProperty(ee,"CMapCompressionType",{enumerable:!0,get:function(){return te.CMapCompressionType}}),Object.defineProperty(ee,"DOMSVGFactory",{enumerable:!0,get:function(){return re.DOMSVGFactory}}),Object.defineProperty(ee,"FeatureTest",{enumerable:!0,get:function(){return te.FeatureTest}}),Object.defineProperty(ee,"GlobalWorkerOptions",{enumerable:!0,get:function(){return ue.GlobalWorkerOptions}}),Object.defineProperty(ee,"ImageKind",{enumerable:!0,get:function(){return te.ImageKind}}),Object.defineProperty(ee,"InvalidPDFException",{enumerable:!0,get:function(){return te.InvalidPDFException}}),Object.defineProperty(ee,"MissingPDFException",{enumerable:!0,get:function(){return te.MissingPDFException}}),Object.defineProperty(ee,"OPS",{enumerable:!0,get:function(){return te.OPS}}),Object.defineProperty(ee,"PDFDataRangeTransport",{enumerable:!0,get:function(){return ne.PDFDataRangeTransport}}),Object.defineProperty(ee,"PDFDateString",{enumerable:!0,get:function(){return re.PDFDateString}}),Object.defineProperty(ee,"PDFWorker",{enumerable:!0,get:function(){return ne.PDFWorker}}),Object.defineProperty(ee,"PasswordResponses",{enumerable:!0,get:function(){return te.PasswordResponses}}),Object.defineProperty(ee,"PermissionFlag",{enumerable:!0,get:function(){return te.PermissionFlag}}),Object.defineProperty(ee,"PixelsPerInch",{enumerable:!0,get:function(){return re.PixelsPerInch}}),Object.defineProperty(ee,"PromiseCapability",{enumerable:!0,get:function(){return te.PromiseCapability}}),Object.defineProperty(ee,"RenderingCancelledException",{enumerable:!0,get:function(){return re.RenderingCancelledException}}),Object.defineProperty(ee,"SVGGraphics",{enumerable:!0,get:function(){return ne.SVGGraphics}}),Object.defineProperty(ee,"UnexpectedResponseException",{enumerable:!0,get:function(){return te.UnexpectedResponseException}}),Object.defineProperty(ee,"Util",{enumerable:!0,get:function(){return te.Util}}),Object.defineProperty(ee,"VerbosityLevel",{enumerable:!0,get:function(){return te.VerbosityLevel}}),Object.defineProperty(ee,"XfaLayer",{enumerable:!0,get:function(){return de.XfaLayer}}),Object.defineProperty(ee,"build",{enumerable:!0,get:function(){return ne.build}}),Object.defineProperty(ee,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return te.createValidAbsoluteUrl}}),Object.defineProperty(ee,"getDocument",{enumerable:!0,get:function(){return ne.getDocument}}),Object.defineProperty(ee,"getFilenameFromUrl",{enumerable:!0,get:function(){return re.getFilenameFromUrl}}),Object.defineProperty(ee,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return re.getPdfFilenameFromUrl}}),Object.defineProperty(ee,"getXfaPageViewport",{enumerable:!0,get:function(){return re.getXfaPageViewport}}),Object.defineProperty(ee,"isDataScheme",{enumerable:!0,get:function(){return re.isDataScheme}}),Object.defineProperty(ee,"isPdfFile",{enumerable:!0,get:function(){return re.isPdfFile}}),Object.defineProperty(ee,"loadScript",{enumerable:!0,get:function(){return re.loadScript}}),Object.defineProperty(ee,"noContextMenu",{enumerable:!0,get:function(){return re.noContextMenu}}),Object.defineProperty(ee,"normalizeUnicode",{enumerable:!0,get:function(){return te.normalizeUnicode}}),Object.defineProperty(ee,"renderTextLayer",{enumerable:!0,get:function(){return ie.renderTextLayer}}),Object.defineProperty(ee,"setLayerDimensions",{enumerable:!0,get:function(){return re.setLayerDimensions}}),Object.defineProperty(ee,"shadow",{enumerable:!0,get:function(){return te.shadow}}),Object.defineProperty(ee,"updateTextLayer",{enumerable:!0,get:function(){return ie.updateTextLayer}}),Object.defineProperty(ee,"version",{enumerable:!0,get:function(){return ne.version}});var te=__w_pdfjs_require__(1),ne=__w_pdfjs_require__(2),re=__w_pdfjs_require__(6),ie=__w_pdfjs_require__(26),se=__w_pdfjs_require__(27),oe=__w_pdfjs_require__(5),he=__w_pdfjs_require__(29),ue=__w_pdfjs_require__(14),de=__w_pdfjs_require__(32)})(),__webpack_exports__})())})(pdf$1);var pdfExports=pdf$1.exports;const pdf=getDefaultExportFromCjs(pdfExports),pdfjsModule=_mergeNamespaces({__proto__:null,default:pdf},[pdfExports]),pdfjs="default"in pdfjsModule?pdf:pdfjsModule,pdfjs$1=pdfjs;var propTypes={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function ee(re,ie,se,oe,he,ue){if(ue!==ReactPropTypesSecret){var de=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 de.name="Invariant Violation",de}}ee.isRequired=ee;function te(){return ee}var ne={array:ee,bigint:ee,bool:ee,func:ee,number:ee,object:ee,string:ee,symbol:ee,any:ee,arrayOf:te,element:ee,elementType:ee,instanceOf:te,node:ee,objectOf:te,oneOf:te,oneOfType:te,shape:te,exact:te,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return ne.PropTypes=ne,ne};propTypes.exports=factoryWithThrowingShims();var propTypesExports=propTypes.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);var __spreadArray=globalThis&&globalThis.__spreadArray||function(ee,te,ne){if(ne||arguments.length===2)for(var re=0,ie=te.length,se;re<ie;re++)(se||!(re in te))&&(se||(se=Array.prototype.slice.call(te,0,re)),se[re]=te[re]);return ee.concat(se||Array.prototype.slice.call(te))},clipboardEvents=["onCopy","onCut","onPaste"],compositionEvents=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],focusEvents=["onFocus","onBlur"],formEvents=["onInput","onInvalid","onReset","onSubmit"],imageEvents=["onLoad","onError"],keyboardEvents=["onKeyDown","onKeyPress","onKeyUp"],mediaEvents=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],mouseEvents=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],dragEvents=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],selectionEvents=["onSelect"],touchEvents=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],pointerEvents=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],uiEvents=["onScroll"],wheelEvents=["onWheel"],animationEvents=["onAnimationStart","onAnimationEnd","onAnimationIteration"],transitionEvents=["onTransitionEnd"],otherEvents=["onToggle"],changeEvents=["onChange"],allEvents=__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],clipboardEvents,!0),compositionEvents,!0),focusEvents,!0),formEvents,!0),imageEvents,!0),keyboardEvents,!0),mediaEvents,!0),mouseEvents,!0),dragEvents,!0),selectionEvents,!0),touchEvents,!0),pointerEvents,!0),uiEvents,!0),wheelEvents,!0),animationEvents,!0),transitionEvents,!0),changeEvents,!0),otherEvents,!0);function makeEventProps(ee,te){var ne={};return allEvents.forEach(function(re){var ie=ee[re];ie&&(te?ne[re]=function(se){return ie(se,te(re))}:ne[re]=ie)}),ne}function makeCancellablePromise(ee){var te=!1,ne=new Promise(function(re,ie){ee.then(function(se){return!te&&re(se)}).catch(function(se){return!te&&ie(se)})});return{promise:ne,cancel:function(){te=!0}}}function r(ee){var te,ne,re="";if(typeof ee=="string"||typeof ee=="number")re+=ee;else if(typeof ee=="object")if(Array.isArray(ee))for(te=0;te<ee.length;te++)ee[te]&&(ne=r(ee[te]))&&(re&&(re+=" "),re+=ne);else for(te in ee)ee[te]&&(re&&(re+=" "),re+=te);return re}function clsx(){for(var ee,te,ne=0,re="";ne<arguments.length;)(ee=arguments[ne++])&&(te=r(ee))&&(re&&(re+=" "),re+=te);return re}var isProduction=!0,prefix="Invariant failed";function invariant(ee,te){if(!ee){if(isProduction)throw new Error(prefix);var ne=typeof te=="function"?te():te,re=ne?"".concat(prefix,": ").concat(ne):prefix;throw new Error(re)}}var warning=function(){},warning_1=warning;const warning$1=getDefaultExportFromCjs(warning_1);var has=Object.prototype.hasOwnProperty;function find(ee,te,ne){for(ne of ee.keys())if(dequal(ne,te))return ne}function dequal(ee,te){var ne,re,ie;if(ee===te)return!0;if(ee&&te&&(ne=ee.constructor)===te.constructor){if(ne===Date)return ee.getTime()===te.getTime();if(ne===RegExp)return ee.toString()===te.toString();if(ne===Array){if((re=ee.length)===te.length)for(;re--&&dequal(ee[re],te[re]););return re===-1}if(ne===Set){if(ee.size!==te.size)return!1;for(re of ee)if(ie=re,ie&&typeof ie=="object"&&(ie=find(te,ie),!ie)||!te.has(ie))return!1;return!0}if(ne===Map){if(ee.size!==te.size)return!1;for(re of ee)if(ie=re[0],ie&&typeof ie=="object"&&(ie=find(te,ie),!ie)||!dequal(re[1],te.get(ie)))return!1;return!0}if(ne===ArrayBuffer)ee=new Uint8Array(ee),te=new Uint8Array(te);else if(ne===DataView){if((re=ee.byteLength)===te.byteLength)for(;re--&&ee.getInt8(re)===te.getInt8(re););return re===-1}if(ArrayBuffer.isView(ee)){if((re=ee.byteLength)===te.byteLength)for(;re--&&ee[re]===te[re];);return re===-1}if(!ne||typeof ee=="object"){re=0;for(ne in ee)if(has.call(ee,ne)&&++re&&!has.call(te,ne)||!(ne in te)||!dequal(ee[ne],te[ne]))return!1;return Object.keys(te).length===re}}return ee!==ee&&te!==te}const DocumentContext=G$1(null);function Message({children:ee,type:te}){return Cn.createElement("div",{className:"react-pdf__message react-pdf__message--".concat(te)},ee)}const DEFAULT_LINK_REL="noopener noreferrer nofollow";class LinkService{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(te){this.pdfDocument=te}setViewer(te){this.pdfViewer=te}setExternalLinkRel(te){this.externalLinkRel=te}setExternalLinkTarget(te){this.externalLinkTarget=te}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return invariant(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(te){invariant(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=te}get rotation(){return 0}set rotation(te){}goToDestination(te){return new Promise(ne=>{invariant(this.pdfDocument,"PDF document not loaded."),invariant(te,"Destination is not specified."),typeof te=="string"?this.pdfDocument.getDestination(te).then(ne):Array.isArray(te)?ne(te):te.then(ne)}).then(ne=>{invariant(Array.isArray(ne),'"'.concat(ne,'" is not a valid destination array.'));const re=ne[0];new Promise(ie=>{invariant(this.pdfDocument,"PDF document not loaded."),re instanceof Object?this.pdfDocument.getPageIndex(re).then(se=>{ie(se)}).catch(()=>{invariant(!1,'"'.concat(re,'" is not a valid page reference.'))}):typeof re=="number"?ie(re):invariant(!1,'"'.concat(re,'" is not a valid destination reference.'))}).then(ie=>{const se=ie+1;invariant(this.pdfViewer,"PDF viewer is not initialized."),invariant(se>=1&&se<=this.pagesCount,'"'.concat(se,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({dest:ne,pageIndex:ie,pageNumber:se})})})}navigateTo(te){this.goToDestination(te)}goToPage(te){const ne=te-1;invariant(this.pdfViewer,"PDF viewer is not initialized."),invariant(te>=1&&te<=this.pagesCount,'"'.concat(te,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({pageIndex:ne,pageNumber:te})}addLinkAttributes(te,ne,re){te.href=ne,te.rel=this.externalLinkRel||DEFAULT_LINK_REL,te.target=re?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},PasswordResponses$1=PasswordResponses,isBrowser=typeof document<"u",isLocalFileSystem=isBrowser&&window.location.protocol==="file:";function isDefined(ee){return typeof ee<"u"}function isProvided(ee){return isDefined(ee)&&ee!==null}function isString(ee){return typeof ee=="string"}function isArrayBuffer(ee){return ee instanceof ArrayBuffer}function isBlob(ee){return invariant(isBrowser,"isBlob can only be used in a browser environment"),ee instanceof Blob}function isDataURI(ee){return isString(ee)&&/^data:/.test(ee)}function dataURItoByteString(ee){invariant(isDataURI(ee),"Invalid data URI.");const[te="",ne=""]=ee.split(",");return te.split(";").indexOf("base64")!==-1?atob(ne):unescape(ne)}function getDevicePixelRatio(){return isBrowser&&window.devicePixelRatio||1}const allowFileAccessFromFilesTip="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function displayCORSWarning(){warning$1(!isLocalFileSystem,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ".concat(allowFileAccessFromFilesTip))}function displayWorkerWarning(){warning$1(!isLocalFileSystem,"Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ".concat(allowFileAccessFromFilesTip))}function cancelRunningTask(ee){ee&&ee.cancel&&ee.cancel()}function makePageCallback(ee,te){return Object.defineProperty(ee,"width",{get(){return this.view[2]*te},configurable:!0}),Object.defineProperty(ee,"height",{get(){return this.view[3]*te},configurable:!0}),Object.defineProperty(ee,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(ee,"originalHeight",{get(){return this.view[3]},configurable:!0}),ee}function isCancelException(ee){return ee.name==="RenderingCancelledException"}function loadFromFile(ee){return new Promise((te,ne)=>{const re=new FileReader;re.onload=()=>{if(!re.result)return ne(new Error("Error while reading a file."));te(re.result)},re.onerror=ie=>{if(!ie.target)return ne(new Error("Error while reading a file."));const{error:se}=ie.target;if(!se)return ne(new Error("Error while reading a file."));switch(se.code){case se.NOT_FOUND_ERR:return ne(new Error("Error while reading a file: File not found."));case se.SECURITY_ERR:return ne(new Error("Error while reading a file: Security error."));case se.ABORT_ERR:return ne(new Error("Error while reading a file: Aborted."));default:return ne(new Error("Error while reading a file."))}},re.readAsArrayBuffer(ee)})}function reducer(ee,te){switch(te.type){case"RESOLVE":return{value:te.value,error:void 0};case"REJECT":return{value:!1,error:te.error};case"RESET":return{value:void 0,error:void 0};default:return ee}}function useResolver(){return s$1(reducer,{value:void 0,error:void 0})}const{PDFDataRangeTransport:PDFDataRangeTransport$1}=pdfjs$1,eventProps=(()=>{const ee={};return allEvents.forEach(te=>{ee[te]=PropTypes.func}),ee})(),isTypedArray=PropTypes.oneOfType([PropTypes.instanceOf(Int8Array),PropTypes.instanceOf(Uint8Array),PropTypes.instanceOf(Uint8ClampedArray),PropTypes.instanceOf(Int16Array),PropTypes.instanceOf(Uint16Array),PropTypes.instanceOf(Int32Array),PropTypes.instanceOf(Uint32Array),PropTypes.instanceOf(Float32Array),PropTypes.instanceOf(Float64Array)]),fileTypes=[PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.shape({data:PropTypes.oneOfType([PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.arrayOf(PropTypes.number.isRequired),isTypedArray]).isRequired}),PropTypes.shape({range:PropTypes.instanceOf(PDFDataRangeTransport$1).isRequired}),PropTypes.shape({url:PropTypes.string.isRequired})];typeof Blob<"u"&&fileTypes.push(PropTypes.instanceOf(Blob));const isClassName=PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)]),isFile=PropTypes.oneOfType(fileTypes);PropTypes.instanceOf(LinkService),PropTypes.oneOf(["_self","_blank","_parent","_top"]),PropTypes.shape({commonObjs:PropTypes.shape({}).isRequired,getAnnotations:PropTypes.func.isRequired,getTextContent:PropTypes.func.isRequired,getViewport:PropTypes.func.isRequired,render:PropTypes.func.isRequired});const isPageIndex=function ee(te,ne,re){const{[ne]:ie,pageNumber:se,pdf:oe}=te;if(!isDefined(oe))return null;if(isDefined(ie)){if(typeof ie!="number")return new Error("`".concat(ne,"` of type `").concat(typeof ie,"` supplied to `").concat(re,"`, expected `number`."));if(ie<0)return new Error("Expected `".concat(ne,"` to be greater or equal to 0."));const{numPages:he}=oe;if(ie+1>he)return new Error("Expected `".concat(ne,"` to be less or equal to ").concat(he-1,"."))}else if(!isDefined(se))return new Error("`".concat(ne,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(re,"`."));return null},isPageNumber=function ee(te,ne,re){const{[ne]:ie,pageIndex:se,pdf:oe}=te;if(!isDefined(oe))return null;if(isDefined(ie)){if(typeof ie!="number")return new Error("`".concat(ne,"` of type `").concat(typeof ie,"` supplied to `").concat(re,"`, expected `number`."));if(ie<1)return new Error("Expected `".concat(ne,"` to be greater or equal to 1."));const{numPages:he}=oe;if(ie>he)return new Error("Expected `".concat(ne,"` to be less or equal to ").concat(he,"."))}else if(!isDefined(se))return new Error("`".concat(ne,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(re,"`."));return null},isPdf=PropTypes.oneOfType([PropTypes.any,PropTypes.oneOf([!1])]),isRef=PropTypes.oneOfType([PropTypes.func,PropTypes.exact({current:PropTypes.any})]),isRenderMode=PropTypes.oneOf(["canvas","custom","none","svg"]),isRotate=PropTypes.oneOf([0,90,180,270]);var __awaiter$1=globalThis&&globalThis.__awaiter||function(ee,te,ne,re){function ie(se){return se instanceof ne?se:new ne(function(oe){oe(se)})}return new(ne||(ne=Promise))(function(se,oe){function he(ae){try{de(re.next(ae))}catch(le){oe(le)}}function ue(ae){try{de(re.throw(ae))}catch(le){oe(le)}}function de(ae){ae.done?se(ae.value):ie(ae.value).then(he,ue)}de((re=re.apply(ee,te||[])).next())})},__rest$4=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const{PDFDataRangeTransport}=pdfjs$1,defaultOnPassword=(ee,te)=>{switch(te){case PasswordResponses$1.NEED_PASSWORD:{const ne=prompt("Enter the password to open this PDF file.");ee(ne);break}case PasswordResponses$1.INCORRECT_PASSWORD:{const ne=prompt("Invalid password. Please try again.");ee(ne);break}}};function isParameterObject(ee){return typeof ee=="object"&&ee!==null&&("data"in ee||"range"in ee||"url"in ee)}const Document=k$1(function ee(te,ne){var{children:re,className:ie,error:se="Failed to load PDF file.",externalLinkRel:oe,externalLinkTarget:he,file:ue,inputRef:de,imageResourcesPath:ae,loading:le="Loading PDF…",noData:Ae="No PDF file specified.",onItemClick:_e,onLoadError:me,onLoadProgress:ve,onLoadSuccess:Se,onPassword:Te=defaultOnPassword,onSourceError:Pe,onSourceSuccess:Re,options:$e,renderMode:ye,rotate:Ee}=te,Ne=__rest$4(te,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[Me,we]=useResolver(),{value:Oe,error:Fe}=Me,[Ve,qe]=useResolver(),{value:Ie,error:Xe}=Ve,rt=_(new LinkService),lt=_([]),Ge=_(),ut=_();p$1(()=>{ue&&ue!==Ge.current&&isParameterObject(ue)&&(warning$1(!dequal(ue,Ge.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.'),Ge.current=ue)},[ue]),p$1(()=>{$e&&$e!==ut.current&&(warning$1(!dequal($e,ut.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.'),ut.current=$e)},[$e]);const mt=_({scrollPageIntoView:pt=>{const{dest:ct,pageNumber:Pt,pageIndex:It=Pt-1}=pt;if(_e){_e({dest:ct,pageIndex:It,pageNumber:Pt});return}const vt=lt.current[It];if(vt){vt.scrollIntoView();return}warning$1(!1,"An internal link leading to page ".concat(Pt," 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>."))}});A$1(ne,()=>({linkService:rt,pages:lt,viewer:mt}),[]);function wt(){Re&&Re()}function Et(){Fe&&(warning$1(!1,Fe.toString()),Pe&&Pe(Fe))}function De(){we({type:"RESET"})}p$1(De,[ue,we]);const pe=T$1(()=>__awaiter$1(this,void 0,void 0,function*(){if(!ue)return null;if(typeof ue=="string")return isDataURI(ue)?{data:dataURItoByteString(ue)}:(displayCORSWarning(),{url:ue});if(ue instanceof PDFDataRangeTransport)return{range:ue};if(isArrayBuffer(ue))return{data:ue};if(isBrowser&&isBlob(ue))return{data:yield loadFromFile(ue)};if(invariant(typeof ue=="object","Invalid parameter in file, need either Uint8Array, string or a parameter object"),invariant(isParameterObject(ue),"Invalid parameter object: need either .data, .range or .url"),"url"in ue&&typeof ue.url=="string"){if(isDataURI(ue.url)){const{url:pt}=ue,ct=__rest$4(ue,["url"]),Pt=dataURItoByteString(pt);return Object.assign({data:Pt},ct)}displayCORSWarning()}return ue}),[ue]);p$1(()=>{const pt=makeCancellablePromise(pe());return pt.promise.then(ct=>{we({type:"RESOLVE",value:ct})}).catch(ct=>{we({type:"REJECT",error:ct})}),()=>{cancelRunningTask(pt)}},[pe,we]),p$1(()=>{if(!(typeof Oe>"u")){if(Oe===!1){Et();return}wt()}},[Oe]);function be(){Ie&&(Se&&Se(Ie),lt.current=new Array(Ie.numPages),rt.current.setDocument(Ie))}function ge(){Xe&&(warning$1(!1,Xe.toString()),me&&me(Xe))}function Ce(){qe({type:"RESET"})}p$1(Ce,[qe,Oe]);function xe(){if(!Oe)return;const pt=Object.assign(Object.assign({},$e),{isEvalSupported:!1}),ct=Object.assign(Object.assign({},Oe),pt),Pt=pdfjs$1.getDocument(ct);ve&&(Pt.onProgress=ve),Te&&(Pt.onPassword=Te);const It=Pt;return It.promise.then(vt=>{qe({type:"RESOLVE",value:vt})}).catch(vt=>{It.destroyed||qe({type:"REJECT",error:vt})}),()=>{It.destroy()}}p$1(xe,[$e,qe,Oe]),p$1(()=>{if(!(typeof Ie>"u")){if(Ie===!1){ge();return}be()}},[Ie]);function Le(){rt.current.setViewer(mt.current),rt.current.setExternalLinkRel(oe),rt.current.setExternalLinkTarget(he)}p$1(Le,[oe,he]);function Be(pt,ct){lt.current[pt]=ct}function He(pt){delete lt.current[pt]}const it=F$1(()=>({imageResourcesPath:ae,linkService:rt.current,onItemClick:_e,pdf:Ie,registerPage:Be,renderMode:ye,rotate:Ee,unregisterPage:He}),[ae,_e,Ie,ye,Ee]),et=F$1(()=>makeEventProps(Ne,()=>Ie),[Ne,Ie]);function ot(){return Cn.createElement(DocumentContext.Provider,{value:it},re)}function ht(){return ue?Ie==null?Cn.createElement(Message,{type:"loading"},typeof le=="function"?le():le):Ie===!1?Cn.createElement(Message,{type:"error"},typeof se=="function"?se():se):ot():Cn.createElement(Message,{type:"no-data"},typeof Ae=="function"?Ae():Ae)}return Cn.createElement("div",Object.assign({className:clsx("react-pdf__Document",ie),ref:de,style:{"--scale-factor":"1"}},et),ht())}),isFunctionOrNode$1=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Document.propTypes=Object.assign(Object.assign({},eventProps),{children:PropTypes.node,className:isClassName,error:isFunctionOrNode$1,externalLinkRel:PropTypes.string,externalLinkTarget:PropTypes.oneOf(["_self","_blank","_parent","_top"]),file:isFile,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode$1,noData:isFunctionOrNode$1,onItemClick:PropTypes.func,onLoadError:PropTypes.func,onLoadProgress:PropTypes.func,onLoadSuccess:PropTypes.func,onPassword:PropTypes.func,onSourceError:PropTypes.func,onSourceSuccess:PropTypes.func,options:PropTypes.shape({canvasFactory:PropTypes.any,canvasMaxAreaInBytes:PropTypes.number,cMapPacked:PropTypes.bool,CMapReaderFactory:PropTypes.any,cMapUrl:PropTypes.string,disableAutoFetch:PropTypes.bool,disableFontFace:PropTypes.bool,disableRange:PropTypes.bool,disableStream:PropTypes.bool,docBaseUrl:PropTypes.string,enableXfa:PropTypes.bool,filterFactory:PropTypes.any,fontExtraProperties:PropTypes.bool,httpHeaders:PropTypes.object,isEvalSupported:PropTypes.bool,isOffscreenCanvasSupported:PropTypes.bool,length:PropTypes.number,maxImageSize:PropTypes.number,ownerDocument:PropTypes.any,password:PropTypes.string,pdfBug:PropTypes.bool,rangeChunkSize:PropTypes.number,StandardFontDataFactory:PropTypes.any,standardFontDataUrl:PropTypes.string,stopAtErrors:PropTypes.bool,useSystemFonts:PropTypes.bool,useWorkerFetch:PropTypes.bool,verbosity:PropTypes.number,withCredentials:PropTypes.bool,worker:PropTypes.any}),rotate:PropTypes.number});const Document$1=Document,OutlineContext=G$1(null);class Ref{constructor({num:te,gen:ne}){this.num=te,this.gen=ne}toString(){let te="".concat(this.num,"R");return this.gen!==0&&(te+=this.gen),te}}function useCachedValue(ee){const te=_(),ne=te.current;return isDefined(ne)?()=>ne:()=>{const re=ee();return te.current=re,re}}function useDocumentContext(){return q$2(DocumentContext)}function useOutlineContext(){return q$2(OutlineContext)}var __awaiter=globalThis&&globalThis.__awaiter||function(ee,te,ne,re){function ie(se){return se instanceof ne?se:new ne(function(oe){oe(se)})}return new(ne||(ne=Promise))(function(se,oe){function he(ae){try{de(re.next(ae))}catch(le){oe(le)}}function ue(ae){try{de(re.throw(ae))}catch(le){oe(le)}}function de(ae){ae.done?se(ae.value):ie(ae.value).then(he,ue)}de((re=re.apply(ee,te||[])).next())})},__rest$3=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};function OutlineItem(ee){const te=useDocumentContext(),ne=useOutlineContext();invariant(ne,"Unable to find Outline context.");const re=Object.assign(Object.assign(Object.assign({},te),ne),ee),{item:ie,linkService:se,onItemClick:oe,pdf:he}=re,ue=__rest$3(re,["item","linkService","onItemClick","pdf"]);invariant(he,"Attempted to load an outline, but no document was specified. Wrap <Outline /> in a <Document /> or pass explicit `pdf` prop.");const de=useCachedValue(()=>typeof ie.dest=="string"?he.getDestination(ie.dest):ie.dest),ae=useCachedValue(()=>__awaiter(this,void 0,void 0,function*(){const me=yield de();if(!me)throw new Error("Destination not found.");const[ve]=me;return he.getPageIndex(new Ref(ve))})),le=useCachedValue(()=>__awaiter(this,void 0,void 0,function*(){return(yield ae())+1}));function Ae(me){me.preventDefault(),invariant(oe||se,"Either onItemClick callback or linkService must be defined in order to navigate to an outline item."),oe?Promise.all([de(),ae(),le()]).then(([ve,Se,Te])=>{oe({dest:ve,pageIndex:Se,pageNumber:Te})}):se&&se.goToDestination(ie.dest)}function _e(){if(!ie.items||!ie.items.length)return null;const{items:me}=ie;return Cn.createElement("ul",null,me.map((ve,Se)=>Cn.createElement(OutlineItem,Object.assign({key:typeof ve.dest=="string"?ve.dest:Se,item:ve,pdf:he},ue))))}return Cn.createElement("li",null,Cn.createElement("a",{href:"#",onClick:Ae},ie.title),_e())}var __rest$2=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const Outline=function ee(te){const ne=useDocumentContext(),re=Object.assign(Object.assign({},ne),te),{className:ie,inputRef:se,onItemClick:oe,onLoadError:he,onLoadSuccess:ue,pdf:de}=re,ae=__rest$2(re,["className","inputRef","onItemClick","onLoadError","onLoadSuccess","pdf"]);invariant(de,"Attempted to load an outline, but no document was specified. Wrap <Outline /> in a <Document /> or pass explicit `pdf` prop.");const[le,Ae]=useResolver(),{value:_e,error:me}=le;function ve(){typeof _e>"u"||_e===!1||ue&&ue(_e)}function Se(){me&&(warning$1(!1,me.toString()),he&&he(me))}function Te(){Ae({type:"RESET"})}p$1(Te,[Ae,de]);function Pe(){if(!de)return;const Ee=makeCancellablePromise(de.getOutline()),Ne=Ee;return Ee.promise.then(Me=>{Ae({type:"RESOLVE",value:Me})}).catch(Me=>{Ae({type:"REJECT",error:Me})}),()=>cancelRunningTask(Ne)}p$1(Pe,[Ae,de]),p$1(()=>{if(_e!==void 0){if(_e===!1){Se();return}ve()}},[_e]);const Re=F$1(()=>({onItemClick:oe}),[oe]),$e=F$1(()=>makeEventProps(ae,()=>_e),[ae,_e]);if(!_e)return null;function ye(){return _e?Cn.createElement("ul",null,_e.map((Ee,Ne)=>Cn.createElement(OutlineItem,{key:typeof Ee.dest=="string"?Ee.dest:Ne,item:Ee,pdf:de}))):null}return Cn.createElement("div",Object.assign({className:clsx("react-pdf__Outline",ie),ref:se},$e),Cn.createElement(OutlineContext.Provider,{value:Re},ye()))};Outline.propTypes=Object.assign(Object.assign({},eventProps),{className:isClassName,inputRef:isRef,onItemClick:PropTypes.func,onLoadError:PropTypes.func,onLoadSuccess:PropTypes.func,pdf:isPdf});const Outline$1=Outline;function mergeRefs(){for(var ee=[],te=0;te<arguments.length;te++)ee[te]=arguments[te];var ne=ee.filter(Boolean);if(ne.length<=1){var re=ne[0];return re||null}return function(se){ne.forEach(function(oe){typeof oe=="function"?oe(se):oe&&(oe.current=se)})}}const PageContext=G$1(null),PDF_ROLE_TO_HTML_ROLE={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},HEADING_PATTERN=/^H(\d+)$/;function isPdfRole(ee){return ee in PDF_ROLE_TO_HTML_ROLE}function isStructTreeNode(ee){return"children"in ee}function isStructTreeNodeWithOnlyContentChild(ee){return isStructTreeNode(ee)?ee.children.length===1&&0 in ee.children&&"id"in ee.children[0]:!1}function getRoleAttributes(ee){const te={};if(isStructTreeNode(ee)){const{role:ne}=ee,re=ne.match(HEADING_PATTERN);if(re)te.role="heading",te["aria-level"]=Number(re[1]);else if(isPdfRole(ne)){const ie=PDF_ROLE_TO_HTML_ROLE[ne];ie&&(te.role=ie)}}return te}function getBaseAttributes(ee){const te={};if(isStructTreeNode(ee)){if(ee.alt!==void 0&&(te["aria-label"]=ee.alt),ee.lang!==void 0&&(te.lang=ee.lang),isStructTreeNodeWithOnlyContentChild(ee)){const[ne]=ee.children;if(ne){const re=getBaseAttributes(ne);return Object.assign(Object.assign({},te),re)}}}else"id"in ee&&(te["aria-owns"]=ee.id);return te}function getAttributes(ee){return ee?Object.assign(Object.assign({},getRoleAttributes(ee)),getBaseAttributes(ee)):null}function StructTreeItem({className:ee,node:te}){const ne=F$1(()=>getAttributes(te),[te]),re=F$1(()=>!isStructTreeNode(te)||isStructTreeNodeWithOnlyContentChild(te)?null:te.children.map((ie,se)=>Cn.createElement(StructTreeItem,{key:se,node:ie})),[te]);return Cn.createElement("span",Object.assign({className:ee},ne),re)}function usePageContext(){return q$2(PageContext)}function StructTree(){const ee=usePageContext();invariant(ee,"Unable to find Page context.");const{onGetStructTreeError:te,onGetStructTreeSuccess:ne}=ee,[re,ie]=useResolver(),{value:se,error:oe}=re,{customTextRenderer:he,page:ue}=ee;function de(){se&&ne&&ne(se)}function ae(){oe&&(warning$1(!1,oe.toString()),te&&te(oe))}function le(){ie({type:"RESET"})}p$1(le,[ie,ue]);function Ae(){if(he||!ue)return;const _e=makeCancellablePromise(ue.getStructTree()),me=_e;return _e.promise.then(ve=>{ie({type:"RESOLVE",value:ve})}).catch(ve=>{ie({type:"REJECT",error:ve})}),()=>cancelRunningTask(me)}return p$1(Ae,[he,ue,ie]),p$1(()=>{if(se!==void 0){if(se===!1){ae();return}de()}},[se]),se?Cn.createElement(StructTreeItem,{className:"react-pdf__Page__structTree structTree",node:se}):null}const ANNOTATION_MODE=pdfjs$1.AnnotationMode;function PageCanvas(ee){const te=usePageContext();invariant(te,"Unable to find Page context.");const ne=Object.assign(Object.assign({},te),ee),{_className:re,canvasBackground:ie,devicePixelRatio:se=getDevicePixelRatio(),onRenderError:oe,onRenderSuccess:he,page:ue,renderForms:de,renderTextLayer:ae,rotate:le,scale:Ae}=ne,{canvasRef:_e}=ee;invariant(ue,"Attempted to render page canvas, but no page was specified.");const me=_(null);function ve(){ue&&he&&he(makePageCallback(ue,Ae))}function Se(ye){isCancelException(ye)||(warning$1(!1,ye.toString()),oe&&oe(ye))}const Te=F$1(()=>ue.getViewport({scale:Ae*se,rotation:le}),[se,ue,le,Ae]),Pe=F$1(()=>ue.getViewport({scale:Ae,rotation:le}),[ue,le,Ae]);function Re(){if(!ue)return;ue.cleanup();const{current:ye}=me;if(!ye)return;ye.width=Te.width,ye.height=Te.height,ye.style.width="".concat(Math.floor(Pe.width),"px"),ye.style.height="".concat(Math.floor(Pe.height),"px"),ye.style.visibility="hidden";const Ee={annotationMode:de?ANNOTATION_MODE.ENABLE_FORMS:ANNOTATION_MODE.ENABLE,canvasContext:ye.getContext("2d",{alpha:!1}),viewport:Te};ie&&(Ee.background=ie);const Ne=ue.render(Ee),Me=Ne;return Ne.promise.then(()=>{ye.style.visibility="",ve()}).catch(Se),()=>cancelRunningTask(Me)}p$1(Re,[ie,me,se,ue,de,Te,Pe]);const $e=T$1(()=>{const{current:ye}=me;ye&&(ye.width=0,ye.height=0)},[me]);return p$1(()=>$e,[$e]),Cn.createElement("canvas",{className:"".concat(re,"__canvas"),dir:"ltr",ref:mergeRefs(_e,me),style:{display:"block",userSelect:"none"}},ae?Cn.createElement(StructTree,null):null)}function PageSVG(){const ee=usePageContext();invariant(ee,"Unable to find Page context.");const{_className:te,onRenderSuccess:ne,onRenderError:re,page:ie,rotate:se,scale:oe}=ee;invariant(ie,"Attempted to render page SVG, but no page was specified.");const[he,ue]=useResolver(),{value:de,error:ae}=he;function le(){ie&&ne&&ne(makePageCallback(ie,oe))}function Ae(){ae&&(isCancelException(ae)||(warning$1(!1,ae.toString()),re&&re(ae)))}const _e=F$1(()=>ie.getViewport({scale:oe,rotation:se}),[ie,se,oe]);function me(){ue({type:"RESET"})}p$1(me,[ie,ue,_e]);function ve(){if(!ie)return;const Re=makeCancellablePromise(ie.getOperatorList());return Re.promise.then($e=>{new pdfjs$1.SVGGraphics(ie.commonObjs,ie.objs).getSVG($e,_e).then(Ee=>{if(!(Ee instanceof SVGElement))throw new Error("getSVG returned unexpected result.");ue({type:"RESOLVE",value:Ee})}).catch(Ee=>{ue({type:"REJECT",error:Ee})})}).catch($e=>{ue({type:"REJECT",error:$e})}),()=>cancelRunningTask(Re)}p$1(ve,[ie,ue,_e]),p$1(()=>{if(de!==void 0){if(de===!1){Ae();return}le()}},[de]);function Se(Re){if(!Re||!de)return;Re.firstElementChild||Re.appendChild(de);const{width:$e,height:ye}=_e;de.setAttribute("width","".concat($e)),de.setAttribute("height","".concat(ye))}const{width:Te,height:Pe}=_e;return Cn.createElement("div",{className:"".concat(te,"__svg"),ref:Re=>Se(Re),style:{display:"block",backgroundColor:"white",overflow:"hidden",width:Te,height:Pe,userSelect:"none"}})}function isTextItem(ee){return"str"in ee}function TextLayer(){const ee=usePageContext();invariant(ee,"Unable to find Page context.");const{customTextRenderer:te,onGetTextError:ne,onGetTextSuccess:re,onRenderTextLayerError:ie,onRenderTextLayerSuccess:se,page:oe,pageIndex:he,pageNumber:ue,rotate:de,scale:ae}=ee;invariant(oe,"Attempted to load page text content, but no page was specified.");const[le,Ae]=useResolver(),{value:_e,error:me}=le,ve=_(null),Se=_();warning$1(parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10)===1,"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer");function Te(){_e&&re&&re(_e)}function Pe(){me&&(warning$1(!1,me.toString()),ne&&ne(me))}function Re(){Ae({type:"RESET"})}p$1(Re,[oe,Ae]);function $e(){if(!oe)return;const Fe=makeCancellablePromise(oe.getTextContent()),Ve=Fe;return Fe.promise.then(qe=>{Ae({type:"RESOLVE",value:qe})}).catch(qe=>{Ae({type:"REJECT",error:qe})}),()=>cancelRunningTask(Ve)}p$1($e,[oe,Ae]),p$1(()=>{if(_e!==void 0){if(_e===!1){Pe();return}Te()}},[_e]);const ye=T$1(()=>{se&&se()},[se]),Ee=T$1(Fe=>{warning$1(!1,Fe.toString()),ie&&ie(Fe)},[ie]);function Ne(){const Fe=Se.current;Fe&&Fe.classList.add("active")}function Me(){const Fe=Se.current;Fe&&Fe.classList.remove("active")}const we=F$1(()=>oe.getViewport({scale:ae,rotation:de}),[oe,de,ae]);function Oe(){if(!oe||!_e)return;const{current:Fe}=ve;if(!Fe)return;Fe.innerHTML="";const Ve=oe.streamTextContent({includeMarkedContent:!0}),qe={container:Fe,textContentSource:Ve,viewport:we},Ie=pdfjs$1.renderTextLayer(qe),Xe=Ie;return Ie.promise.then(()=>{const rt=document.createElement("div");rt.className="endOfContent",Fe.append(rt),Se.current=rt;const lt=Fe.querySelectorAll('[role="presentation"]');if(te){let Ge=0;_e.items.forEach((ut,mt)=>{if(!isTextItem(ut))return;const wt=lt[Ge];if(!wt)return;const Et=te(Object.assign({pageIndex:he,pageNumber:ue,itemIndex:mt},ut));wt.innerHTML=Et,Ge+=ut.str&&ut.hasEOL?2:1})}ye()}).catch(Ee),()=>cancelRunningTask(Xe)}return y(Oe,[te,Ee,ye,oe,he,ue,_e,we]),Cn.createElement("div",{className:clsx("react-pdf__Page__textContent","textLayer"),onMouseUp:Me,onMouseDown:Ne,ref:ve})}function AnnotationLayer(){const ee=useDocumentContext(),te=usePageContext();invariant(te,"Unable to find Page context.");const ne=Object.assign(Object.assign({},ee),te),{imageResourcesPath:re,linkService:ie,onGetAnnotationsError:se,onGetAnnotationsSuccess:oe,onRenderAnnotationLayerError:he,onRenderAnnotationLayerSuccess:ue,page:de,pdf:ae,renderForms:le,rotate:Ae,scale:_e=1}=ne;invariant(ae,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),invariant(de,"Attempted to load page annotations, but no page was specified."),invariant(ie,"Attempted to load page annotations, but no linkService was specified.");const[me,ve]=useResolver(),{value:Se,error:Te}=me,Pe=_(null);warning$1(parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function Re(){Se&&oe&&oe(Se)}function $e(){Te&&(warning$1(!1,Te.toString()),se&&se(Te))}function ye(){ve({type:"RESET"})}p$1(ye,[ve,de]);function Ee(){if(!de)return;const Fe=makeCancellablePromise(de.getAnnotations()),Ve=Fe;return Fe.promise.then(qe=>{ve({type:"RESOLVE",value:qe})}).catch(qe=>{ve({type:"REJECT",error:qe})}),()=>{cancelRunningTask(Ve)}}p$1(Ee,[ve,de,le]),p$1(()=>{if(Se!==void 0){if(Se===!1){$e();return}Re()}},[Se]);function Ne(){ue&&ue()}function Me(Fe){warning$1(!1,"".concat(Fe)),he&&he(Fe)}const we=F$1(()=>de.getViewport({scale:_e,rotation:Ae}),[de,Ae,_e]);function Oe(){if(!ae||!de||!ie||!Se)return;const{current:Fe}=Pe;if(!Fe)return;const Ve=we.clone({dontFlip:!0}),qe={accessibilityManager:null,annotationCanvasMap:null,div:Fe,l10n:null,page:de,viewport:Ve},Ie={annotations:Se,annotationStorage:ae.annotationStorage,div:Fe,downloadManager:null,imageResourcesPath:re,linkService:ie,page:de,renderForms:le,viewport:Ve};Fe.innerHTML="";try{new pdfjs$1.AnnotationLayer(qe).render(Ie),Ne()}catch(Xe){Me(Xe)}return()=>{}}return p$1(Oe,[Se,re,ie,de,le,we]),Cn.createElement("div",{className:clsx("react-pdf__Page__annotations","annotationLayer"),ref:Pe})}var __rest$1=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const defaultScale=1,Page=function ee(te){const ne=useDocumentContext(),re=Object.assign(Object.assign({},ne),te),{_className:ie="react-pdf__Page",_enableRegisterUnregisterPage:se=!0,canvasBackground:oe,canvasRef:he,children:ue,className:de,customRenderer:ae,customTextRenderer:le,devicePixelRatio:Ae,error:_e="Failed to load the page.",height:me,inputRef:ve,loading:Se="Loading page…",noData:Te="No page specified.",onGetAnnotationsError:Pe,onGetAnnotationsSuccess:Re,onGetStructTreeError:$e,onGetStructTreeSuccess:ye,onGetTextError:Ee,onGetTextSuccess:Ne,onLoadError:Me,onLoadSuccess:we,onRenderAnnotationLayerError:Oe,onRenderAnnotationLayerSuccess:Fe,onRenderError:Ve,onRenderSuccess:qe,onRenderTextLayerError:Ie,onRenderTextLayerSuccess:Xe,pageIndex:rt,pageNumber:lt,pdf:Ge,registerPage:ut,renderAnnotationLayer:mt=!0,renderForms:wt=!1,renderMode:Et="canvas",renderTextLayer:De=!0,rotate:pe,scale:be=defaultScale,unregisterPage:ge,width:Ce}=re,xe=__rest$1(re,["_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"]),[Le,Be]=useResolver(),{value:He,error:it}=Le,et=_(null);invariant(Ge,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const ot=isProvided(lt)?lt-1:rt!=null?rt:null,ht=lt!=null?lt:isProvided(rt)?rt+1:null,pt=pe!=null?pe:He?He.rotate:null,ct=F$1(()=>{if(!He)return null;let Vt=1;const jt=be!=null?be:defaultScale;if(Ce||me){const Gt=He.getViewport({scale:1,rotation:pt});Ce?Vt=Ce/Gt.width:me&&(Vt=me/Gt.height)}return jt*Vt},[me,He,pt,be,Ce]);function Pt(){return()=>{isProvided(ot)&&se&&ge&&ge(ot)}}p$1(Pt,[se,Ge,ot,ge]);function It(){if(we){if(!He||!ct)return;we(makePageCallback(He,ct))}if(se&&ut){if(!isProvided(ot)||!et.current)return;ut(ot,et.current)}}function vt(){it&&(warning$1(!1,it.toString()),Me&&Me(it))}function kt(){Be({type:"RESET"})}p$1(kt,[Be,Ge,ot]);function gt(){if(!Ge||!ht)return;const Vt=makeCancellablePromise(Ge.getPage(ht)),jt=Vt;return Vt.promise.then(Gt=>{Be({type:"RESOLVE",value:Gt})}).catch(Gt=>{Be({type:"REJECT",error:Gt})}),()=>cancelRunningTask(jt)}p$1(gt,[Be,Ge,ot,ht,ut]),p$1(()=>{if(He!==void 0){if(He===!1){vt();return}It()}},[He,ct]);const tt=F$1(()=>He&&isProvided(ot)&&ht&&isProvided(pt)&&isProvided(ct)?{_className:ie,canvasBackground:oe,customTextRenderer:le,devicePixelRatio:Ae,onGetAnnotationsError:Pe,onGetAnnotationsSuccess:Re,onGetStructTreeError:$e,onGetStructTreeSuccess:ye,onGetTextError:Ee,onGetTextSuccess:Ne,onRenderAnnotationLayerError:Oe,onRenderAnnotationLayerSuccess:Fe,onRenderError:Ve,onRenderSuccess:qe,onRenderTextLayerError:Ie,onRenderTextLayerSuccess:Xe,page:He,pageIndex:ot,pageNumber:ht,renderForms:wt,renderTextLayer:De,rotate:pt,scale:ct}:null,[ie,oe,le,Ae,Pe,Re,$e,ye,Ee,Ne,Oe,Fe,Ve,qe,Ie,Xe,He,ot,ht,wt,De,pt,ct]),nt=F$1(()=>makeEventProps(xe,()=>He&&(ct?makePageCallback(He,ct):void 0)),[xe,He,ct]),ft="".concat(ot,"@").concat(ct,"/").concat(pt),Tt="".concat(ot,"/").concat(pt);function Ct(){switch(Et){case"custom":return invariant(ae,'renderMode was set to "custom", but no customRenderer was passed.'),Cn.createElement(ae,{key:"".concat(ft,"_custom")});case"none":return null;case"svg":return Cn.createElement(PageSVG,{key:"".concat(Tt,"_svg")});case"canvas":default:return Cn.createElement(PageCanvas,{key:"".concat(ft,"_canvas"),canvasRef:he})}}function Ht(){return De?Cn.createElement(TextLayer,{key:"".concat(ft,"_text")}):null}function Wt(){return mt?Cn.createElement(AnnotationLayer,{key:"".concat(ft,"_annotations")}):null}function Ut(){return Cn.createElement(PageContext.Provider,{value:tt},Ct(),Ht(),Wt(),ue)}function zt(){return ht?Ge===null||He===void 0||He===null?Cn.createElement(Message,{type:"loading"},typeof Se=="function"?Se():Se):Ge===!1||He===!1?Cn.createElement(Message,{type:"error"},typeof _e=="function"?_e():_e):Ut():Cn.createElement(Message,{type:"no-data"},typeof Te=="function"?Te():Te)}return Cn.createElement("div",Object.assign({className:clsx(ie,de),"data-page-number":ht,ref:mergeRefs(ve,et),style:{"--scale-factor":"".concat(ct),backgroundColor:oe||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},nt),zt())},isFunctionOrNode=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Page.propTypes=Object.assign(Object.assign({},eventProps),{canvasBackground:PropTypes.string,canvasRef:isRef,children:PropTypes.node,className:isClassName,customRenderer:PropTypes.func,customTextRenderer:PropTypes.func,devicePixelRatio:PropTypes.number,error:isFunctionOrNode,height:PropTypes.number,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode,noData:isFunctionOrNode,onGetTextError:PropTypes.func,onGetTextSuccess:PropTypes.func,onLoadError:PropTypes.func,onLoadSuccess:PropTypes.func,onRenderError:PropTypes.func,onRenderSuccess:PropTypes.func,onRenderTextLayerError:PropTypes.func,onRenderTextLayerSuccess:PropTypes.func,pageIndex:isPageIndex,pageNumber:isPageNumber,pdf:isPdf,renderAnnotationLayer:PropTypes.bool,renderForms:PropTypes.bool,renderMode:isRenderMode,renderTextLayer:PropTypes.bool,rotate:isRotate,scale:PropTypes.number,width:PropTypes.number});const Page$1=Page;var __rest=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const Thumbnail=function ee(te){const ne=useDocumentContext(),re=Object.assign(Object.assign({},ne),te),{className:ie,linkService:se,onItemClick:oe,pageIndex:he,pageNumber:ue,pdf:de}=re;invariant(de,"Attempted to load a thumbnail, but no document was specified. Wrap <Thumbnail /> in a <Document /> or pass explicit `pdf` prop.");const ae=isProvided(ue)?ue-1:he!=null?he:null,le=ue!=null?ue:isProvided(he)?he+1:null;function Ae(me){me.preventDefault(),!(!isProvided(ae)||!le)&&(invariant(oe||se,"Either onItemClick callback or linkService must be defined in order to navigate to an outline item."),oe?oe({pageIndex:ae,pageNumber:le}):se&&se.goToPage(le))}const _e=__rest(te,["className","onItemClick"]);return Cn.createElement("a",{className:clsx("react-pdf__Thumbnail",ie),href:le?"#":void 0,onClick:Ae},Cn.createElement(Page$1,Object.assign({},_e,{_className:"react-pdf__Thumbnail__page",_enableRegisterUnregisterPage:!1,renderAnnotationLayer:!1,renderTextLayer:!1})))},Thumbnail$1=Thumbnail;displayWorkerWarning(),pdfjs$1.GlobalWorkerOptions.workerSrc="pdf.worker.js";const index=Object.freeze(Object.defineProperty({__proto__:null,Document:Document$1,Outline:Outline$1,Page:Page$1,PasswordResponses:PasswordResponses$1,Thumbnail:Thumbnail$1,pdfjs:pdfjs$1,useDocumentContext,useOutlineContext,usePageContext},Symbol.toStringTag,{value:"Module"}))})();