@bimdata/viewer 2.7.0-beta.6 → 2.7.0
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.
|
@@ -5502,7 +5502,7 @@ void main() {
|
|
|
5502
5502
|
--bimdata-local-context-width: ${r.width}px;
|
|
5503
5503
|
--bimdata-local-context-center-width: ${r.centerWidth}px;
|
|
5504
5504
|
--bimdata-local-context-resolution: ${r.resolution};
|
|
5505
|
-
`),onMouseenter:e[0]||(e[0]=(...A)=>r.onMouseEnter&&r.onMouseEnter(...A)),onMouseleave:e[1]||(e[1]=(...A)=>r.onMouseLeave&&r.onMouseLeave(...A))},[L(s,{ref:"modalManagerTemplateRef"},null,512),B("div",uRi,[r.windowPlugins.leftSidePanel?(P(),te(a,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):ve("",!0),B("div",ARi,[(P(!0),O(It,null,Kt(r.windowPlugins.free,A=>(P(),te(l,{key:A.name,class:Se({"window-container__content__center__viewer":A.isViewer}),plugin:A},null,8,["class","plugin"]))),128)),L(c,{position:"left",plugins:r.windowPlugins.leftButtonColumn},null,8,["plugins"]),L(c,{position:"right",plugins:r.windowPlugins.rightButtonColumn},null,8,["plugins"])]),r.windowPlugins.rightSidePanel?(P(),te(a,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):ve("",!0)]),r.loading?(P(),O("div",hRi,[r.spinner&&r.spinner.component?(P(),te(Eo(r.spinner.component),Xc(Oa({key:0},r.spinner.props)),null,16)):(P(),te(d,{key:1,size:"20px",border:"3px"}))])):ve("",!0),r.layoutSettingsDisplayed?(P(),O("div",pRi,[L(u)])):ve("",!0)],36)}const fRi=K(dRi,[["render",gRi]]);let mRi=class{constructor(t=!0){const e=sDi(Nse,null,{resizable:t});e.registerContent("default",fRi),this.settings=kl({edit:!1,swap:!1,full:!1}),this.areas=e}get resizable(){return this.areas.resizable}set resizable(t){this.areas.resizable=t}apply(t=null){this.areas.layout=t?aDi(t):null}copy(t,e=!0){return lDi(this.areas.layout,t,e)}open({ratio:t,direction:e,insertAfter:i,windowName:r=null,windowState:o=null,localContextId:n=null}={}){const s=r?{options:{windowName:r,windowState:o}}:null;return n===null?this.areas.splitLayout(t,e,i,s):this.areas.split(n,t,e,i,s)}swap(t,e){return this.areas.swap(t,e)}close(t){return this.areas.delete(t)}compare(t,e){var i,r;if(!t&&!e)return!0;if(!t||!e)return!1;if(typeof t=="string"&&typeof e=="string")return t===e;if(typeof t=="string"||typeof e=="string")return!1;if(t.windowName&&e.windowName){if(t.windowName!==e.windowName)return!1;const o=new Set((i=t.windowState)==null?void 0:i.modelIds),n=new Set((r=e.windowState)==null?void 0:r.modelIds);return o.size===n.size&&[...o].every(s=>n.has(s))}return t.windowName||e.windowName||t.direction!==e.direction||t.children.length!==e.children.length?!1:t.children.every((o,n)=>this.compare(o,e.children[n]))}};const vRi="@bimdata/viewer",CRi="module",yRi="2.7.0-beta.6",wRi="A customizable BIM viewer.",bRi=["bim","viewer","bimdata","ifc","bcf"],IRi="./index.d.ts",BRi="BIMData.io",ERi="https://developers.bimdata.io/viewer/index.html",xRi={email:"support@bimdata.io"},kRi=["last 2 chrome version","last 2 firefox version"],MRi="dist/bimdata-viewer.esm.min.js",SRi="dist/bimdata-viewer.esm.min.js",QRi={dev:"vite -c build/vite.config.dev.js",build:"node scripts/build.mjs","build:prod":"vite build -c build/vite.config.prod.js && esbuild dist/bimdata-viewer.esm.min.js --minify --outfile=dist/bimdata-viewer.esm.min.js --allow-overwrite","build:offline":"vite build -c build/vite.config.offline.js && esbuild dist/bimdata-viewer.offline.esm.min.js --minify --outfile=dist/bimdata-viewer.offline.esm.min.js --allow-overwrite","build:runtime":"vite build -c build/vite.config.runtime.js && esbuild dist/bimdata-viewer.runtime.esm.min.js --minify --outfile=dist/bimdata-viewer.runtime.esm.min.js --allow-overwrite","build:split":"vite build -c build/vite.config.split.js && esbuild dist/bimdata-viewer.split.esm.min.js --minify --outfile=dist/bimdata-viewer.split.esm.min.js --allow-overwrite","build:umd":"vite build -c build/vite.config.umd.js && esbuild dist/bimdata-viewer.umd.cjs --minify --outfile=dist/bimdata-viewer.umd.min.cjs","cy:run":"cypress run","cy:open":"cypress open",prebuild:"rm -rf dist",prepublishOnly:"npm run build","semantic-release":"semantic-release",serve:"http-server -c-1 --silent",test:"npm run test:unit & npm run build & npm run test:e2e","test:unit":"jest","test:e2e":"start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:run","test:e2e-dev":"start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:open",version:"echo $npm_package_version",ts:"tsc"},PRi=["dist/*","types/*","CHANGELOG.md","README.md","package.json","package-lock.json","index.d.ts"],DRi={"@babel/preset-env":"^7.26.0","@bimdata/2d-engine":"2.6.1","@bimdata/areas-next":"0.1.15","@bimdata/bcf-components":"6.4.4","@bimdata/components":"1.7.2","@bimdata/design-system":"2.2.1-beta.7","@bimdata/typescript-fetch-api-client":"10.17.2","@eslint/eslintrc":"^3.2.0","@eslint/js":"^9.15.0","@photo-sphere-viewer/core":"^5.11.1","@rollup/plugin-alias":"5.1.1","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^28.0.1","@rollup/plugin-image":"^3.0.3","@rollup/plugin-replace":"^6.0.1","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^13.0.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.1","@semantic-release/npm":"^12.0.1","@semantic-release/release-notes-generator":"^14.0.1","@vitejs/plugin-vue":"5.2.1","@vue/vue3-jest":"^29.2.6","@xeokit/xeokit-sdk":"git+https://git@github.com/Amoki/xeokit-sdk.git#f81ebaeda39e03d96f75785b257378e420416e0d","@zip.js/zip.js":"^2.7.53",async:"^3.2.6",autoprefixer:"^10.4.20","babel-core":"^7.0.0-bridge.0","babel-jest":"^29.7.0","conventional-changelog-eslint":"^6.0.0",cypress:"^13.16.0",esbuild:"^0.25.0",eslint:"9.15.0","eslint-config-prettier":"9.1.0","eslint-plugin-cypress":"4.1.0","eslint-plugin-jest":"28.9.0","eslint-plugin-prettier":"5.2.1","eslint-plugin-vue":"9.31.0","form-data":"^4.0.1",globals:"^15.12.0","html-to-image":"^1.11.11",html2canvas:"1.4.1","http-server":"^14.1.1",jest:"^29.7.0","jest-environment-jsdom":"^29.7.0","jest-extended":"^4.0.2",jspdf:"^2.5.2",lodash:"^4.17.21","node-fetch":"^3.3.2","pdfjs-dist":"^4.8.69",postcss:"^8.4.49",prettier:"^3.4.1",querystring:"^0.2.1","sass-embedded":"^1.81.0","semantic-release":"^24.2.0",sinon:"^19.0.2","start-server-and-test":"^2.0.8",vite:"6.0.11","vite-plugin-css-injected-by-js":"^3.5.2",vue:"3.5.13","vue-eslint-parser":"^9.4.3","vue-i18n":"^10.0.4"},RRi={name:vRi,type:CRi,version:yRi,description:wRi,keywords:bRi,types:IRi,author:BRi,homepage:ERi,bugs:xRi,browserslist:kRi,main:MRi,module:SRi,scripts:QRi,files:PRi,devDependencies:DRi};class LRi{constructor({plugins:e,api:i,ui:r,locale:o="fr"}){this.pluginManager=new wMi(e),this.windowManager=new IMi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new lPi(i),this.globalContext=new cOe(this),this.state=BPi(this),this.shortcutManager=JDe(this.state),this.uiSettings=r||{},this.i18n=new aOe(o),this._contextMenu=null,this.layout=new mRi(this.uiSettings.resizable!==!1),this.localContext=null,window.$viewer=this}get version(){return RRi.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||zDe}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function TRi(t,e={}){e.backgroundColor&&(t.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&t.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&t.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&t.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&t.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&t.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&t.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&t.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&t.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&t.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&t.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&t.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&t.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&t.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&t.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&t.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&t.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&t.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&t.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&t.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&t.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&t.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&t.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&t.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&t.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&t.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&t.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&t.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&t.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&t.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),t.style.setProperty("--areas-background-color","transparent")}const FRi=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),A9=Object.freeze({READ:"read",WRITE:"write"});function rEe(t){const e={};return t.forEach(i=>{const[r,o]=i.split(":");e[r]?e[r].push(o):e[r]=[o]}),e}const NRi={token_scopes:[],usable_scopes:[],user_role:25};function oEe(t=NRi){var e,i,r,o,n,s;const a=rEe(t.token_scopes),l=rEe(t.usable_scopes);return{...Bue(t),tokenScopes:a,usableScopes:l,userRole:FRi[t.user_role],user:t.user?Bue(t.user):null,hasBcfReadPermission:((e=l.bcf)==null?void 0:e.includes(A9.READ))??!1,hasBcfWritePermission:((i=l.bcf)==null?void 0:i.includes(A9.WRITE))??!1,hasModelReadPermission:((r=l.model)==null?void 0:r.includes(A9.READ))??!1,hasModelWritePermission:((o=l.model)==null?void 0:o.includes(A9.WRITE))??!1,hasDocReadPermission:((n=l.document)==null?void 0:n.includes(A9.READ))??!1,hasDocWritePermission:((s=l.document)==null?void 0:s.includes(A9.WRITE))??!1}}const URi={BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{goBackButton:"Zur\xFCck",title:"BCF-Parameter",text:"Erstellen, f\xFCllen und listen Sie die BCF-Einstellungen auf, die Sie f\xFCr dieses Projekt haben m\xF6chten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"F\xFCgen Sie Fragen hinzu, um zugeh\xF6rige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorit\xE4t",PriorityNotDefined:"Keine Priorit\xE4t",PriorityTitle:"Priorit\xE4ten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorit\xE4t:",noPriority:"Keine",assignedTo:"Zugewiesen an :",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte w\xE4hlen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"F\xFCgen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"F\xE4lligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Best\xE4tigen",updateButton:"\xC4nderungen \xFCbernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte \xC4nderungen.",cancelButton:"\xC4nderungen verwerfen",continueButton:"\xC4nderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis"},BcfTopicOverview:{openViewer:"Im Viewer \xF6ffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"F\xE4lligkeitsdatum",noDueDate:"Kein F\xE4lligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorit\xE4t",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar ver\xF6ffentlichen",deleteText:"Sie l\xF6schen jetzt {Name}",deleteBcfButton:"Dieses BCF l\xF6schen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE4t",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Ver\xF6ffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar l\xF6schen?",deleteButton:"L\xF6schen",takeSnapshot:"Mach einen Schnappschuss"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzuf\xFCgen",cancelButton:"Abbrechen",validateButton:"Best\xE4tigen",deleteExtensionText:"Diesen Parameter l\xF6schen",deleteButton:"L\xF6schen",title:{Priority:"Priorit\xE4ten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorit\xE4t hinzuf\xFCgen",Label:"Ein neues Etikett hinzuf\xFCgen",Status:"Einen neuen Status hinzuf\xFCgen",Type:"Einen neuen Typ hinzuf\xFCgen",Stage:"Eine neue Phase hinzuf\xFCgen"},text:{Priority:"Liste der Priorit\xE4ten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}},_Ri={BcfComponents:URi},ORi={BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{goBackButton:"Back",title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority: ",noPriority:"None",assignedTo:"Assigned to: ",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}},HRi={BcfComponents:ORi},GRi={BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creaci\xF3n"},BcfSettings:{goBackButton:"Volver",title:"Par\xE1metros del BCF",text:"Cree, rellene y enumere los par\xE1metros del BCF que desea tener en este proyecto",validateButton:"Validar los par\xE1metros del BCF"},BcfStatistics:{emptyText:"A\xF1ada preguntas para ver las estad\xEDsticas asociadas aqu\xED.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad :",noPriority:"Sin",assignedTo:"Asignado a :",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotaci\xF3n",annotationButtonTooltip:"Actualmente este tema no posee ning\xFAn punto de vista",addPictureButton:"A\xF1adir una imagen",titlePlaceholder:"T\xEDtulo *",titleErrorMessage:"Falta el t\xEDtulo",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripci\xF3n",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Est\xE1 a punto de salir de la edici\xF3n del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotograf\xEDa",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ning\xFAn modelo listo para la visualizaci\xF3n",elements:"{count} Elementos",noElements:"Ning\xFAn elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripci\xF3n",noDescriptionProvided:"No hay descripci\xF3n",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Informaci\xF3n",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Est\xE1s a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"T\xEDtulo",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"\xBFBorrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"a\xF1adir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuraci\xF3n",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"A\xF1adir una nueva prioridad",Label:"A\xF1adir una nueva etiqueta",Status:"A\xF1adir un nuevo estado",Type:"A\xF1adir un nuevo tipo",Stage:"A\xF1adir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}},jRi={BcfComponents:GRi},VRi={BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorit\xE9",statusLabel:"Statut",assignedToLabel:"Assign\xE9 \xE0",creatorsLabel:"Cr\xE9\xE9 par",tagsLabel:"Tags",resetButton:"R\xE9initialiser",searchButton:"Rechercher",undefined:"Non d\xE9fini",datePlaceholder:"Date de cr\xE9ation"},BcfSettings:{goBackButton:"Retour",title:"Param\xE8tres BCF",text:"Cr\xE9ez, renseignez et listez les param\xE8tres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les param\xE8tres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associ\xE9es ici.",issues:"probl\xE8mes",extension:{Priority:"Priorit\xE9",PriorityNotDefined:"Aucune priorit\xE9",PriorityTitle:"Priorit\xE9s",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorit\xE9 : ",noPriority:"Aucune",assignedTo:"Assign\xE9 \xE0 : ",elements:"{n} \xC9lements",notSpecified:"Non d\xE9fini",see:"Voir"},BcfTopicCreationCard:{text:"Cr\xE9er un nouveau topic BCF",createBcfSideTitle:"Signaler un probl\xE8me"},BcfTopicForm:{dragDropImageText:"Veuillez s\xE9lectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne poss\xE8de actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",dueDateLabel:"Date d'\xE9ch\xE9ance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous \xEAtes sur le point de quitter l'\xE9dition de l'issue {name} mais il y'a des modifications non enregistr\xE9es.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un probl\xE8me",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de r\xE9sultat"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun mod\xE8le pr\xEAt pour une visualisation",elements:"{count} \xC9lements",noElements:"Aucun \xE9l\xE9ment concern\xE9",type:"Type",noTypeSpecified:"Pas de type sp\xE9cifi\xE9",description:"Description",noDescriptionProvided:"Pas de description renseign\xE9e",assignedTo:"Assign\xE9 \xE0",notAssigned:"Non assign\xE9",dueDate:"\xC9ch\xE9ance",noDueDate:"Pas de date d'\xE9ch\xE9ance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut sp\xE9cifi\xE9",stage:"Phase",noStageProvided:"Pas de phase renseign\xE9e",priority:"Priorit\xE9",priorityNotDefined:"Non d\xE9fini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous \xEAtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE9",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un \xE9l\xE9ment",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce param\xE8tre",deleteButton:"Supprimer",title:{Priority:"Priorit\xE9s",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorit\xE9",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorit\xE9s",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}},qRi={BcfComponents:VRi},zRi={BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorit\xE0",statusLabel:"Stato",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{goBackButton:"Indietro",title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorit\xE0",PriorityNotDefined:"Nessuna priorit\xE0",PriorityTitle:"Priorit\xE0",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorit\xE0:",noPriority:"Nessuno",assignedTo:"Assegnato a:",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorit\xE0",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE0",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorit\xE0",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorit\xE0",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorit\xE0",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}},KRi={BcfComponents:zRi},JRi={de:_Ri,en:HRi,es:jRi,fr:qRi,it:KRi},YRi=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(r){t?vo.setup({apiClient:t,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),i?Object.entries(JRi).forEach(([o,n])=>{i.global.mergeLocaleMessage(o,n)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(Mqe).forEach(([o,n])=>{r.component(o,n)})}}),WRi={title:"Building Maker",back:"Zur\xFCck",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"L\xF6schen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",input:"Name des Geb\xE4udes",error:"Ung\xFCltiger Name",createButton:"Erstellen",updateButton:"Best\xE4tigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Best\xE4tigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ung\xFCltiger Name",cancelButton:"Abbrechen",submitButton:"Best\xE4tigen"}},ZRi={creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gel\xF6scht",newFileSuccess:"Datei hinzugef\xFCgt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gel\xF6scht",nameInputErrorMessage:"Ung\xFCltiger name",cancel:"Abbrechen",submit:"Best\xE4tigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"L\xF6schen",deleteTitle:"Dateien l\xF6schen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endg\xFCltig zu l\xF6schen"},XRi={BuildingMaker:WRi,FileManager:ZRi},$Ri={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},eLi={title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},tLi={creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},iLi={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},rLi={title:"Photosphere Building"},oLi={BIMDataComponents:$Ri,BuildingMaker:eLi,FileManager:tLi,MetaBuildingStructure:iLi,PhotosphereBuilding:rLi},nLi={title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",input:"Nombre del edificio",error:"Nombre no v\xE1lido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no v\xE1lido",cancelButton:"Anular",submitButton:"Validar"}},sLi={creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta est\xE1 vac\xEDa",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inv\xE1lida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Est\xE1 a punto de eliminar permanentemente los siguientes archivos / carpetas"},aLi={BuildingMaker:nLi,FileManager:sLi},lLi={t:{back:"Retour",cancel:"Annuler",create:"Cr\xE9er",delete:"Supprimer",download:"T\xE9l\xE9charger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"\xC9tage",validate:"Valider"}},cLi={title:"Building Maker",list:{text:"Cr\xE9ez et \xE9ditez les \xE9tages puis t\xE9l\xE9chagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du b\xE2timent",error:"Nom invalide"},view:{addStorey:"Ajouter un \xC9tage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel \xE9tage",input:"Nom",error:"Nom invalide"}},dLi={creationFormTitle:"Cr\xE9er un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier cr\xE9\xE9",renameFolderSuccess:"Dossier renomm\xE9",deleteFolderSuccess:"Dossier supprim\xE9",newFileSuccess:"Fichier ajout\xE9",renameFileSuccess:"Fichier renomm\xE9",deleteFileSuccess:"Fichier supprim\xE9",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous \xEAtes sur le point de supprimer d\xE9finitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"S\xE9lectionner une page"},uLi={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},ALi={title:"Photosph\xE8re Building"},hLi={BIMDataComponents:lLi,BuildingMaker:cLi,FileManager:dLi,MetaBuildingStructure:uLi,PhotosphereBuilding:ALi},pLi={title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},gLi={creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella \xE8 vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"},fLi={BuildingMaker:pLi,FileManager:gLi},mLi={de:XRi,en:oLi,es:aLi,fr:hLi,it:fLi},vLi=({i18nPlugin:t}={})=>({install(e){t?Object.entries(mLi).forEach(([i,r])=>{t.global.mergeLocaleMessage(i,r)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(Jmi).forEach(([i,r])=>{e.component(i,r)})}}),CLi={beforeMount(t,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);t.clickAwayHandler=i=>{(i.path||i.composedPath&&i.composedPath()).find(r=>r===t)||e.value()},window.addEventListener("mousedown",t.clickAwayHandler,!0)},unmounted(t){window.removeEventListener("mousedown",t.clickAwayHandler,!0),delete t.clickAwayHandler}},yLi=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:cA,BIMDataClickInputAway:CLi},Symbol.toStringTag,{value:"Module"})),wLi=t=>({install(e){Object.entries(l4t).forEach(([i,r])=>{e.component(i,r)}),Object.entries(yLi).forEach(([i,r])=>e.directive(i.split("BIMData")[1],r))}}),bLi={name:"LiWrapper",render(){return En("li",this.$slots.default())}};function ILi(t,e){var i=new Set([]);return t.forEach(r=>{e.has(r)||i.add(r)}),i}const UA=ia("id"),BLi=({contextMenu:t,objects:e=[],state:i=t.$viewer.state,pictos:r})=>[{name:"selectAll",get group(){return t.groupPositions.select},position:1,get label(){return t.$t("context_menu.select_all")},get picto(){return r.get(this.name)},execute:()=>i.selectObjects(e.filter(Zu(mr("visible"),Kg("selected"))).map(UA)),predicate:()=>e.some(Zu(mr("visible"),Kg("selected")))},{name:"deselectAll",get group(){return t.groupPositions.select},position:2,get label(){return t.$t("context_menu.deselect_all")},get picto(){return r.get(this.name)},execute:()=>i.deselectObjects(e.filter(mr("selected")).map(UA)),predicate:()=>e.some(mr("selected"))},{name:"selectSimilar",get group(){return t.groupPositions.select},position:3,get label(){return t.$t("context_menu.select_similar")},get picto(){return r.get(this.name)},execute(){const o=e.filter(n=>n.visible&&n.type===this.selectedObject.type&&n.id!==this.selectedObject.id).map(UA);i.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(Zu(mr("visible"),mr("selected")));return o.length===1&&o[0].type!==void 0?(this.selectedObject=o[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return t.$t("context_menu.reverse_selection")},get group(){return t.groupPositions.select},position:4,execute:()=>{const o=new Set(e.filter(mr("selected")).map(UA)),n=new Set(e.filter(mr("visible")).map(UA));i.selectObjects(Array.from(ILi(n,o)),{exclusive:!0})},predicate:()=>e.some(Zu(Kg("selected"),mr("visible")))&&e.some(Zu(mr("selected"),mr("visible")))},{name:"showAll",get group(){return t.groupPositions.visibility},position:1,get label(){return t.$t("context_menu.show_all")},get picto(){return r.get(this.name)},execute:()=>i.showObjects(e.filter(Kg("visible")).map(UA)),predicate:()=>e.some(Kg("visible"))},{name:"hide",get group(){return t.groupPositions.visibility},position:2,get label(){return t.$t("context_menu.hide")},get picto(){return r.get(this.name)},objectsToHide:null,execute(){const o=this.objectsToHide.filter(mr("selected"));o.length>0&&i.deselectObjects(o.map(UA)),i.hideObjects(this.objectsToHide.map(UA))},predicate(){return this.objectsToHide=e.filter(Zu(mr("selected"),mr("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return t.groupPositions.visibility},position:3,get label(){return t.$t("context_menu.hide_all")},execute:()=>{const o=e.filter(mr("visible"));o.some(mr("selected"))&&i.deselectObjects(o.filter(mr("selected")).map(UA)),i.hideObjects(o.map(UA))},predicate:()=>e.some(mr("visible"))}].filter(o=>o.predicate()),ELi={components:{LiWrapper:bLi},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(t){t?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(t){t.key==="Escape"&&this.away()},setPosition(t){const e=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=t.clientX-e.left,this.top=t.clientY-e.top,this.left+this.width>e.width&&(this.left=this.left-this.width),t.clientY>e.top+e.height/2?(this.bottom=e.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(t={}){let e=null;if((!t.execute||typeof t.execute!="function")&!t.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),t.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return t.id=this.nextCommandId++,t},open(t){this.currentCommands=[],this.setPosition(t),this.originEvent=t,t.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async t=>{if(typeof t.predicate=="function"){const e=t.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(t);else if(typeof e?.then=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const i=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,i===!0&&this.currentCommands.push(t))}}else this.currentCommands.push(t)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:t=[],state:e=this.$viewer.state,context:i=null}){const r=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(o=>r.set(o.name,o.key)),BLi({contextMenu:this,objects:t,state:e,pictos:r})},executeCommand(t){if(t.execute&&(t.execute(this.originEvent),this.displayed=!1),t.component&&!t.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const t=new Map;this.currentCommands.forEach(i=>{(i.group===null||i.group===void 0)&&(i.group=0),t.has(i.group)?t.get(i.group).push(i):t.set(i.group,[i])}),t.forEach(i=>i.sort((r,o)=>(r.position=r.position||0,o.position=o.position||0,r.position-o.position)));const e=[...t.keys()].sort((i,r)=>i-r).map(i=>t.get(i)).flat();this.currentCommands=e},isGroupIntersection(t){if(t===0)return!1;const e=this.currentCommands[t-1],i=this.currentCommands[t];return e.group<i.group},registerContextCommand(t){const e=this.typeCheckCommand(t);return this.contextCommands.push(e),t.id},registerCommand(t){const e=this.typeCheckCommand(t);return this.registeredCommands.push(e),t.id},unregisterCommand(t){return this.registeredCommands.find(e=>e.id===t)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==t),!0):!1},preventDefault(){this.defaultPrevented=!0}}},xLi={key:0,class:"separator"},kLi={class:"menu-text"},MLi={key:1,class:"menu-picto"},SLi={key:0,class:"context-menu__spinner"};function QLi(t,e,i,r,o,n){const s=R("BIMDataIconChevron"),a=R("LiWrapper"),l=R("BIMDataSpinner"),c=Zi("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?Lt((P(),O("ul",{key:0,class:"bimdata-list context-menu",style:xe(n.position)},[(P(!0),O(It,null,Kt(o.currentCommands,(d,u)=>(P(),te(a,{key:d.label,class:"context-menu__element",onClick:A=>n.executeCommand(d)},{default:z(()=>[n.isGroupIntersection(u)?(P(),O("div",xLi)):ve("",!0),B("div",kLi,$(d.label),1),!d.component&&d.picto?(P(),O("span",MLi,$(d.picto),1)):d.component?(P(),te(s,{key:2,size:"xxs",class:"fill-primary"})):ve("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(P(),O("li",SLi,[L(l)])):ve("",!0)],4)),[[c,n.away]]):ve("",!0)}const PLi=K(ELi,[["render",QLi],["__scopeId","data-v-5b87d4a3"]]),DLi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=Tt("$viewer"),e=kl(new Map),i=o=>{if(!o.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(o.name))throw new Error(`[Viewer Header] Content with name ${o.name} already exists`);e.set(o.name,o)},r=o=>e.has(o)?(e.delete(o),!0):!1;return{logo:t.uiSettings.bimdataLogo!==!1,version:t.uiSettings.version!==!1?t.version:null,headerContent:e,headerRightContentComponents:At(()=>Array.from(e.values()).filter(o=>o.position==="right").sort((o,n)=>o.order-n.order).map(o=>o.component)),headerLeftContentComponents:At(()=>Array.from(e.values()).filter(o=>o.position==="left").sort((o,n)=>o.order-n.order).map(o=>o.component)),addContent:i,removeContent:r}}},RLi={class:"viewer-header"},LLi={class:"viewer-header__content"},TLi={class:"viewer-header__content__left"},FLi={class:"viewer-header__content__right"},NLi={key:0,class:"m-l-6 flex items-center"},ULi={key:1,class:"viewer-header__version"};function _Li(t,e,i,r,o,n){const s=R("BIMDataIllustration");return Lt((P(),O("div",RLi,[B("div",LLi,[B("div",TLi,[(P(!0),O(It,null,Kt(r.headerLeftContentComponents,a=>(P(),te(Eo(a),{key:a.name}))),128))]),B("div",FLi,[(P(!0),O(It,null,Kt(r.headerRightContentComponents,a=>(P(),te(Eo(a),{key:a.name}))),128))])]),r.logo||r.version?(P(),O("div",NLi,[r.logo?(P(),te(s,{key:0,name:"logo",width:"30px",height:"30px"})):ve("",!0),r.version?(P(),O("div",ULi,$(r.version),1)):ve("",!0)])):ve("",!0)],512)),[[gi,i.visible]])}const OLi=K(DLi,[["render",_Li],["__scopeId","data-v-5c9ea6b6"]]),HLi={emits:["resize"],setup(t,{emit:e}){return{onResizerMousedown:i=>{i.preventDefault();let r=i.clientX;const o=s=>{s.preventDefault();const a=s.clientX-r;r=s.clientX,e("resize",a)},n=s=>{s.preventDefault(),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n)}}}},GLi={class:"bimdata-separator"};function jLi(t,e,i,r,o,n){return P(),O("div",GLi,[e[1]||(e[1]=B("div",{class:"bimdata-separator__line"},null,-1)),B("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>r.onResizerMousedown&&r.onResizerMousedown(...s))},null,32)])}const VLi=K(HLi,[["render",jLi],["__scopeId","data-v-79a3b3af"]]),qLi={components:{Separator:VLi},props:{position:{type:String,required:!0,validator(t){return["left","right"].includes(t)}},sidePanel:{type:Object,required:!0,validator(t){if(t.width&&(typeof t.width!="number"||t.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof t.width}`),!1;const e=typeof t?.component=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(t){const e=Ve(null),i=Ve(t.sidePanel.width??400),r=(o,n=1)=>{const s=i.value+o*n;i.value=Math.max(0,s)};return Ht(()=>t.sidePanel,()=>{Object.defineProperty(t.sidePanel,"width",{get(){return i.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}i.value=o}}),Object.defineProperty(t.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:i,onResize:r}}},zLi={class:"bimdata-global-side-panel__component"};function KLi(t,e,i,r,o,n){const s=R("Separator");return P(),O("div",{class:"bimdata-global-side-panel",style:xe(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(P(),te(s,{key:0,onResize:e[0]||(e[0]=a=>r.onResize(a,-1))})):ve("",!0),B("div",zLi,[(P(),te(Eo(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(P(),te(s,{key:1,onResize:e[1]||(e[1]=a=>r.onResize(a))})):ve("",!0)],4)}const JLi=K(qLi,[["render",KLi],["__scopeId","data-v-82d0d4cb"]]),YLi={name:"BimdataViewer",components:{ContextMenu:PLi,ViewerHeader:OLi,ModalManager:eEe,GlobalSidePanel:JLi},setup(){const t=Tt("$viewer"),{globalContext:e,shortcutManager:i}=t;uo(()=>{i&&i.destroy(),e.hub.clear()}),Er(()=>{t.pluginManager.runPluginsScripts(t)});const r=At(()=>{var h;return t.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||((h=e.localContexts[0].window)==null?void 0:h.logoAndVersion))}),o=At(()=>{var h;return t.uiSettings.version!==!1&&(e.localContexts.length!==1||(h=e.localContexts[0].window)!=null&&h.logoAndVersion)?t.version:null}),n=At(()=>e.leftSidePanel),s=At(()=>e.rightSidePanel),a=At(()=>{var h;const g=t.uiSettings.header!==!1,p=e.localContexts.length===1&&((h=e.localContexts[0].window)==null?void 0:h.header)===!1,m=!!(n.value||s.value);return g&&(!p||m)}),l=t.uiSettings.contextMenu!==!1,c=Ve(null);function d(h){l&&c.value.open(h)}function u(){t.shortcutManager.active=!0}function A(){t.shortcutManager.active=!1}return{Layout:t.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:A,isHeaderVisible:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:o,version:t.version,loading:At(()=>e.loading),spinner:At(()=>e.spinner),leftSidePanel:n,rightSidePanel:s}}},WLi={key:1,class:"global-spinner",style:{"z-index":"3"}},ZLi={key:2,class:"viewer__logo"},XLi={key:1,class:"version m-t-6"};function $Li(t,e,i,r,o,n){const s=R("ModalManager"),a=R("ContextMenu"),l=R("ViewerHeader"),c=R("GlobalSidePanel"),d=R("BIMDataSpinner"),u=R("BIMDataIllustration");return P(),O("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...A)=>r.onContextMenu&&r.onContextMenu(...A)),onMouseenter:e[1]||(e[1]=(...A)=>r.onMouseenter&&r.onMouseenter(...A)),onMouseleave:e[2]||(e[2]=(...A)=>r.onMouseleave&&r.onMouseleave(...A))},[L(s,{ref:"modalManagerTemplateRef"},null,512),r.contextMenuEnabled?(P(),te(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):ve("",!0),L(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),B("div",{class:"bimdata-viewer__content",style:xe(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(P(),te(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):ve("",!0),(P(),te(Eo(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(P(),te(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):ve("",!0)],4),r.loading?(P(),O("div",WLi,[r.spinner&&r.spinner.component?(P(),te(Eo(r.spinner.component),Xc(Oa({key:0},r.spinner.props)),null,16)):(P(),te(d,{key:1,size:"40px",border:"5px"}))])):ve("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(P(),O("div",ZLi,[r.bimdataLogoOnSingleWindow?(P(),te(u,{key:0,name:"logo"})):ve("",!0),r.viewerVersionOnSingleWindow?(P(),O("div",XLi,$(r.version),1)):ve("",!0)])):ve("",!0)],544)}const eTi=K(YLi,[["render",$Li]]),tTi=["src"],iTi={class:"bimdata-models__header"},rTi={key:0,class:"bimdata-models__header__loader"},oTi={class:"bimdata-models__header__picto"},nTi={class:"bimdata-models__header__name"},sTi={key:0,class:"bimdata-models__header__name--empty"},aTi={key:1,class:"bimdata-models__header__name--empty"},lTi={key:3},cTi=["onMousemove","onClick"],nEe={__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=Tt("$viewer"),r=Ve(),o=Ve(0),n=Ve(0),s=Ve(),a=mo([]),l=Ve(!1),c=At(()=>i.localContext.loadedModels),d=At(()=>i.localContext.loadedModelIds),u=At(()=>i.localContext.loadingModelIds),A=At(()=>i.localContext.multiModel),h=At(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(b=>c.value.find(E=>{var x;return((x=E.document)==null?void 0:x.head_id)!=null&&E.document.head_id===b.document.id})??b)),g=b=>d.value.includes(b),p=b=>u.value.includes(b),m=At(()=>{var b;const{x:E,y:x}=((b=s.value)==null?void 0:b.getBoundingClientRect())??{x:0,y:0};return`top:${n.value-x}px; left:${o.value-E}px;`}),f=b=>{!A.value&&g(b.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(b.id)?i.localContext.unloadModels([b.id]):i.localContext.loadModels([b.id]))},v=b=>{switch(b){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},C=(b,E)=>{b!=null&&b.viewer_360_file&&(o.value=E.clientX,n.value=E.clientY),r.value=b?.viewer_360_file},y=async b=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,b)).filter(E=>i.state.models.some(x=>x.archived)||!E.archived).sort(W0("updated_at",!1))}catch(E){console.error("[Models] Cannot get project models. Error: ",E)}finally{l.value=!1}return[]},w=b=>{var E;return((E=b.children)==null?void 0:E.some(x=>g(x.id)))??!1};return y(i.localContext.modelTypes).then(b=>{a.value=b}),(b,E)=>{const x=R("BIMDataSpinner"),M=R("BIMDataIconModel3D"),k=R("BIMDataTextbox"),S=R("BIMDataCheckbox"),D=R("BIMDataRadio"),T=R("BIMDataIcon"),U=R("BIMDataDropdownList");return P(),O("div",{ref_key:"templateRef",ref:s,class:Se(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[r.value?(P(),O("div",{key:0,class:"bimdata-models__preview",style:xe(m.value)},[B("img",{src:r.value},null,8,tTi)],4)):ve("",!0),L(U,{style:xe(`--bimdata-models-width: ${t.width};`),width:t.width,list:h.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:h.value.length===0,onElementClick:f},{header:z(({isOpen:G})=>[B("div",iTi,[l.value||u.value.length>0?(P(),O("div",rTi,[L(x)])):(P(),O(It,{key:1},[B("div",oTi,[L(M)]),B("div",{class:Se(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[B("span",null,$(d.value.length),1)],2),B("div",nTi,[h.value.length===0?(P(),O("span",sTi,$(b.$t("model.no_model")),1)):d.value.length===0?(P(),O("span",aTi,$(b.$t("model.no_loaded_model")),1)):d.value.length===1?(P(),te(k,{key:2,text:c.value[0].name,tooltip:!G},null,8,["text","tooltip"])):d.value.length>1?(P(),O("span",lTi,$(b.$t("model.selected_models")),1)):ve("",!0)])],64))])]),element:z(({element:G,close:N})=>[B("div",{class:"bimdata-models__model",onMousemove:H=>t.preview&&C(G,H),onMouseout:E[0]||(E[0]=H=>t.preview&&C()),onClick:()=>{!A.value&&!g(G.id)&&N()}},[A.value?(P(),te(S,{key:0,"model-value":g(G.id)||w(G),disabled:G.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(P(),te(D,{key:1,"model-value":g(G.id)||w(G),disabled:G.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),L(T,{margin:"0 calc(var(--spacing-unit) / 2)",name:v(G.status),size:"xs",class:Se({"fill-success":G.status==="C","fill-high":G.status==="E"})},null,8,["name","class"]),L(k,{class:Se({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":G.status!=="C"||u.value.length>0}),text:G.name,width:`calc(100% -
|
|
5505
|
+
`),onMouseenter:e[0]||(e[0]=(...A)=>r.onMouseEnter&&r.onMouseEnter(...A)),onMouseleave:e[1]||(e[1]=(...A)=>r.onMouseLeave&&r.onMouseLeave(...A))},[L(s,{ref:"modalManagerTemplateRef"},null,512),B("div",uRi,[r.windowPlugins.leftSidePanel?(P(),te(a,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):ve("",!0),B("div",ARi,[(P(!0),O(It,null,Kt(r.windowPlugins.free,A=>(P(),te(l,{key:A.name,class:Se({"window-container__content__center__viewer":A.isViewer}),plugin:A},null,8,["class","plugin"]))),128)),L(c,{position:"left",plugins:r.windowPlugins.leftButtonColumn},null,8,["plugins"]),L(c,{position:"right",plugins:r.windowPlugins.rightButtonColumn},null,8,["plugins"])]),r.windowPlugins.rightSidePanel?(P(),te(a,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):ve("",!0)]),r.loading?(P(),O("div",hRi,[r.spinner&&r.spinner.component?(P(),te(Eo(r.spinner.component),Xc(Oa({key:0},r.spinner.props)),null,16)):(P(),te(d,{key:1,size:"20px",border:"3px"}))])):ve("",!0),r.layoutSettingsDisplayed?(P(),O("div",pRi,[L(u)])):ve("",!0)],36)}const fRi=K(dRi,[["render",gRi]]);let mRi=class{constructor(t=!0){const e=sDi(Nse,null,{resizable:t});e.registerContent("default",fRi),this.settings=kl({edit:!1,swap:!1,full:!1}),this.areas=e}get resizable(){return this.areas.resizable}set resizable(t){this.areas.resizable=t}apply(t=null){this.areas.layout=t?aDi(t):null}copy(t,e=!0){return lDi(this.areas.layout,t,e)}open({ratio:t,direction:e,insertAfter:i,windowName:r=null,windowState:o=null,localContextId:n=null}={}){const s=r?{options:{windowName:r,windowState:o}}:null;return n===null?this.areas.splitLayout(t,e,i,s):this.areas.split(n,t,e,i,s)}swap(t,e){return this.areas.swap(t,e)}close(t){return this.areas.delete(t)}compare(t,e){var i,r;if(!t&&!e)return!0;if(!t||!e)return!1;if(typeof t=="string"&&typeof e=="string")return t===e;if(typeof t=="string"||typeof e=="string")return!1;if(t.windowName&&e.windowName){if(t.windowName!==e.windowName)return!1;const o=new Set((i=t.windowState)==null?void 0:i.modelIds),n=new Set((r=e.windowState)==null?void 0:r.modelIds);return o.size===n.size&&[...o].every(s=>n.has(s))}return t.windowName||e.windowName||t.direction!==e.direction||t.children.length!==e.children.length?!1:t.children.every((o,n)=>this.compare(o,e.children[n]))}};const vRi="@bimdata/viewer",CRi="module",yRi="2.7.0",wRi="A customizable BIM viewer.",bRi=["bim","viewer","bimdata","ifc","bcf"],IRi="./index.d.ts",BRi="BIMData.io",ERi="https://developers.bimdata.io/viewer/index.html",xRi={email:"support@bimdata.io"},kRi=["last 2 chrome version","last 2 firefox version"],MRi="dist/bimdata-viewer.esm.min.js",SRi="dist/bimdata-viewer.esm.min.js",QRi={dev:"vite -c build/vite.config.dev.js",build:"node scripts/build.mjs","build:prod":"vite build -c build/vite.config.prod.js && esbuild dist/bimdata-viewer.esm.min.js --minify --outfile=dist/bimdata-viewer.esm.min.js --allow-overwrite","build:offline":"vite build -c build/vite.config.offline.js && esbuild dist/bimdata-viewer.offline.esm.min.js --minify --outfile=dist/bimdata-viewer.offline.esm.min.js --allow-overwrite","build:runtime":"vite build -c build/vite.config.runtime.js && esbuild dist/bimdata-viewer.runtime.esm.min.js --minify --outfile=dist/bimdata-viewer.runtime.esm.min.js --allow-overwrite","build:split":"vite build -c build/vite.config.split.js && esbuild dist/bimdata-viewer.split.esm.min.js --minify --outfile=dist/bimdata-viewer.split.esm.min.js --allow-overwrite","build:umd":"vite build -c build/vite.config.umd.js && esbuild dist/bimdata-viewer.umd.cjs --minify --outfile=dist/bimdata-viewer.umd.min.cjs","cy:run":"cypress run","cy:open":"cypress open",prebuild:"rm -rf dist",prepublishOnly:"npm run build","semantic-release":"semantic-release",serve:"http-server -c-1 --silent",test:"npm run test:unit & npm run build & npm run test:e2e","test:unit":"jest","test:e2e":"start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:run","test:e2e-dev":"start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:open",version:"echo $npm_package_version",ts:"tsc"},PRi=["dist/*","types/*","CHANGELOG.md","README.md","package.json","package-lock.json","index.d.ts"],DRi={"@babel/preset-env":"^7.26.0","@bimdata/2d-engine":"2.6.1","@bimdata/areas-next":"0.1.15","@bimdata/bcf-components":"6.4.4","@bimdata/components":"1.7.2","@bimdata/design-system":"2.2.1-beta.7","@bimdata/typescript-fetch-api-client":"10.17.2","@eslint/eslintrc":"^3.2.0","@eslint/js":"^9.15.0","@photo-sphere-viewer/core":"^5.11.1","@rollup/plugin-alias":"5.1.1","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^28.0.1","@rollup/plugin-image":"^3.0.3","@rollup/plugin-replace":"^6.0.1","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^13.0.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.1","@semantic-release/npm":"^12.0.1","@semantic-release/release-notes-generator":"^14.0.1","@vitejs/plugin-vue":"5.2.1","@vue/vue3-jest":"^29.2.6","@xeokit/xeokit-sdk":"git+https://git@github.com/Amoki/xeokit-sdk.git#f81ebaeda39e03d96f75785b257378e420416e0d","@zip.js/zip.js":"^2.7.53",async:"^3.2.6",autoprefixer:"^10.4.20","babel-core":"^7.0.0-bridge.0","babel-jest":"^29.7.0","conventional-changelog-eslint":"^6.0.0",cypress:"^13.16.0",esbuild:"^0.25.0",eslint:"9.15.0","eslint-config-prettier":"9.1.0","eslint-plugin-cypress":"4.1.0","eslint-plugin-jest":"28.9.0","eslint-plugin-prettier":"5.2.1","eslint-plugin-vue":"9.31.0","form-data":"^4.0.1",globals:"^15.12.0","html-to-image":"^1.11.11",html2canvas:"1.4.1","http-server":"^14.1.1",jest:"^29.7.0","jest-environment-jsdom":"^29.7.0","jest-extended":"^4.0.2",jspdf:"^2.5.2",lodash:"^4.17.21","node-fetch":"^3.3.2","pdfjs-dist":"^4.8.69",postcss:"^8.4.49",prettier:"^3.4.1",querystring:"^0.2.1","sass-embedded":"^1.81.0","semantic-release":"^24.2.0",sinon:"^19.0.2","start-server-and-test":"^2.0.8",vite:"6.0.11","vite-plugin-css-injected-by-js":"^3.5.2",vue:"3.5.13","vue-eslint-parser":"^9.4.3","vue-i18n":"^10.0.4"},RRi={name:vRi,type:CRi,version:yRi,description:wRi,keywords:bRi,types:IRi,author:BRi,homepage:ERi,bugs:xRi,browserslist:kRi,main:MRi,module:SRi,scripts:QRi,files:PRi,devDependencies:DRi};class LRi{constructor({plugins:e,api:i,ui:r,locale:o="fr"}){this.pluginManager=new wMi(e),this.windowManager=new IMi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new lPi(i),this.globalContext=new cOe(this),this.state=BPi(this),this.shortcutManager=JDe(this.state),this.uiSettings=r||{},this.i18n=new aOe(o),this._contextMenu=null,this.layout=new mRi(this.uiSettings.resizable!==!1),this.localContext=null,window.$viewer=this}get version(){return RRi.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||zDe}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function TRi(t,e={}){e.backgroundColor&&(t.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&t.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&t.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&t.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&t.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&t.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&t.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&t.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&t.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&t.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&t.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&t.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&t.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&t.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&t.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&t.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&t.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&t.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&t.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&t.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&t.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&t.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&t.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&t.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&t.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&t.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&t.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&t.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&t.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&t.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),t.style.setProperty("--areas-background-color","transparent")}const FRi=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),A9=Object.freeze({READ:"read",WRITE:"write"});function rEe(t){const e={};return t.forEach(i=>{const[r,o]=i.split(":");e[r]?e[r].push(o):e[r]=[o]}),e}const NRi={token_scopes:[],usable_scopes:[],user_role:25};function oEe(t=NRi){var e,i,r,o,n,s;const a=rEe(t.token_scopes),l=rEe(t.usable_scopes);return{...Bue(t),tokenScopes:a,usableScopes:l,userRole:FRi[t.user_role],user:t.user?Bue(t.user):null,hasBcfReadPermission:((e=l.bcf)==null?void 0:e.includes(A9.READ))??!1,hasBcfWritePermission:((i=l.bcf)==null?void 0:i.includes(A9.WRITE))??!1,hasModelReadPermission:((r=l.model)==null?void 0:r.includes(A9.READ))??!1,hasModelWritePermission:((o=l.model)==null?void 0:o.includes(A9.WRITE))??!1,hasDocReadPermission:((n=l.document)==null?void 0:n.includes(A9.READ))??!1,hasDocWritePermission:((s=l.document)==null?void 0:s.includes(A9.WRITE))??!1}}const URi={BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{goBackButton:"Zur\xFCck",title:"BCF-Parameter",text:"Erstellen, f\xFCllen und listen Sie die BCF-Einstellungen auf, die Sie f\xFCr dieses Projekt haben m\xF6chten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"F\xFCgen Sie Fragen hinzu, um zugeh\xF6rige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorit\xE4t",PriorityNotDefined:"Keine Priorit\xE4t",PriorityTitle:"Priorit\xE4ten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorit\xE4t:",noPriority:"Keine",assignedTo:"Zugewiesen an :",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte w\xE4hlen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"F\xFCgen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"F\xE4lligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Best\xE4tigen",updateButton:"\xC4nderungen \xFCbernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte \xC4nderungen.",cancelButton:"\xC4nderungen verwerfen",continueButton:"\xC4nderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis"},BcfTopicOverview:{openViewer:"Im Viewer \xF6ffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"F\xE4lligkeitsdatum",noDueDate:"Kein F\xE4lligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorit\xE4t",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar ver\xF6ffentlichen",deleteText:"Sie l\xF6schen jetzt {Name}",deleteBcfButton:"Dieses BCF l\xF6schen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE4t",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Ver\xF6ffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar l\xF6schen?",deleteButton:"L\xF6schen",takeSnapshot:"Mach einen Schnappschuss"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzuf\xFCgen",cancelButton:"Abbrechen",validateButton:"Best\xE4tigen",deleteExtensionText:"Diesen Parameter l\xF6schen",deleteButton:"L\xF6schen",title:{Priority:"Priorit\xE4ten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorit\xE4t hinzuf\xFCgen",Label:"Ein neues Etikett hinzuf\xFCgen",Status:"Einen neuen Status hinzuf\xFCgen",Type:"Einen neuen Typ hinzuf\xFCgen",Stage:"Eine neue Phase hinzuf\xFCgen"},text:{Priority:"Liste der Priorit\xE4ten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}},_Ri={BcfComponents:URi},ORi={BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{goBackButton:"Back",title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority: ",noPriority:"None",assignedTo:"Assigned to: ",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}},HRi={BcfComponents:ORi},GRi={BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creaci\xF3n"},BcfSettings:{goBackButton:"Volver",title:"Par\xE1metros del BCF",text:"Cree, rellene y enumere los par\xE1metros del BCF que desea tener en este proyecto",validateButton:"Validar los par\xE1metros del BCF"},BcfStatistics:{emptyText:"A\xF1ada preguntas para ver las estad\xEDsticas asociadas aqu\xED.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad :",noPriority:"Sin",assignedTo:"Asignado a :",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotaci\xF3n",annotationButtonTooltip:"Actualmente este tema no posee ning\xFAn punto de vista",addPictureButton:"A\xF1adir una imagen",titlePlaceholder:"T\xEDtulo *",titleErrorMessage:"Falta el t\xEDtulo",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripci\xF3n",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Est\xE1 a punto de salir de la edici\xF3n del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotograf\xEDa",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ning\xFAn modelo listo para la visualizaci\xF3n",elements:"{count} Elementos",noElements:"Ning\xFAn elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripci\xF3n",noDescriptionProvided:"No hay descripci\xF3n",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Informaci\xF3n",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Est\xE1s a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"T\xEDtulo",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"\xBFBorrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"a\xF1adir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuraci\xF3n",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"A\xF1adir una nueva prioridad",Label:"A\xF1adir una nueva etiqueta",Status:"A\xF1adir un nuevo estado",Type:"A\xF1adir un nuevo tipo",Stage:"A\xF1adir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}},jRi={BcfComponents:GRi},VRi={BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorit\xE9",statusLabel:"Statut",assignedToLabel:"Assign\xE9 \xE0",creatorsLabel:"Cr\xE9\xE9 par",tagsLabel:"Tags",resetButton:"R\xE9initialiser",searchButton:"Rechercher",undefined:"Non d\xE9fini",datePlaceholder:"Date de cr\xE9ation"},BcfSettings:{goBackButton:"Retour",title:"Param\xE8tres BCF",text:"Cr\xE9ez, renseignez et listez les param\xE8tres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les param\xE8tres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associ\xE9es ici.",issues:"probl\xE8mes",extension:{Priority:"Priorit\xE9",PriorityNotDefined:"Aucune priorit\xE9",PriorityTitle:"Priorit\xE9s",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorit\xE9 : ",noPriority:"Aucune",assignedTo:"Assign\xE9 \xE0 : ",elements:"{n} \xC9lements",notSpecified:"Non d\xE9fini",see:"Voir"},BcfTopicCreationCard:{text:"Cr\xE9er un nouveau topic BCF",createBcfSideTitle:"Signaler un probl\xE8me"},BcfTopicForm:{dragDropImageText:"Veuillez s\xE9lectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne poss\xE8de actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",dueDateLabel:"Date d'\xE9ch\xE9ance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous \xEAtes sur le point de quitter l'\xE9dition de l'issue {name} mais il y'a des modifications non enregistr\xE9es.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un probl\xE8me",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de r\xE9sultat"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun mod\xE8le pr\xEAt pour une visualisation",elements:"{count} \xC9lements",noElements:"Aucun \xE9l\xE9ment concern\xE9",type:"Type",noTypeSpecified:"Pas de type sp\xE9cifi\xE9",description:"Description",noDescriptionProvided:"Pas de description renseign\xE9e",assignedTo:"Assign\xE9 \xE0",notAssigned:"Non assign\xE9",dueDate:"\xC9ch\xE9ance",noDueDate:"Pas de date d'\xE9ch\xE9ance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut sp\xE9cifi\xE9",stage:"Phase",noStageProvided:"Pas de phase renseign\xE9e",priority:"Priorit\xE9",priorityNotDefined:"Non d\xE9fini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous \xEAtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE9",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un \xE9l\xE9ment",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce param\xE8tre",deleteButton:"Supprimer",title:{Priority:"Priorit\xE9s",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorit\xE9",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorit\xE9s",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}},qRi={BcfComponents:VRi},zRi={BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorit\xE0",statusLabel:"Stato",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{goBackButton:"Indietro",title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorit\xE0",PriorityNotDefined:"Nessuna priorit\xE0",PriorityTitle:"Priorit\xE0",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorit\xE0:",noPriority:"Nessuno",assignedTo:"Assegnato a:",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorit\xE0",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE0",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorit\xE0",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorit\xE0",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorit\xE0",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}},KRi={BcfComponents:zRi},JRi={de:_Ri,en:HRi,es:jRi,fr:qRi,it:KRi},YRi=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(r){t?vo.setup({apiClient:t,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),i?Object.entries(JRi).forEach(([o,n])=>{i.global.mergeLocaleMessage(o,n)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(Mqe).forEach(([o,n])=>{r.component(o,n)})}}),WRi={title:"Building Maker",back:"Zur\xFCck",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"L\xF6schen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",input:"Name des Geb\xE4udes",error:"Ung\xFCltiger Name",createButton:"Erstellen",updateButton:"Best\xE4tigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Best\xE4tigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ung\xFCltiger Name",cancelButton:"Abbrechen",submitButton:"Best\xE4tigen"}},ZRi={creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gel\xF6scht",newFileSuccess:"Datei hinzugef\xFCgt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gel\xF6scht",nameInputErrorMessage:"Ung\xFCltiger name",cancel:"Abbrechen",submit:"Best\xE4tigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"L\xF6schen",deleteTitle:"Dateien l\xF6schen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endg\xFCltig zu l\xF6schen"},XRi={BuildingMaker:WRi,FileManager:ZRi},$Ri={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},eLi={title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},tLi={creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},iLi={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},rLi={title:"Photosphere Building"},oLi={BIMDataComponents:$Ri,BuildingMaker:eLi,FileManager:tLi,MetaBuildingStructure:iLi,PhotosphereBuilding:rLi},nLi={title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",input:"Nombre del edificio",error:"Nombre no v\xE1lido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no v\xE1lido",cancelButton:"Anular",submitButton:"Validar"}},sLi={creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta est\xE1 vac\xEDa",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inv\xE1lida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Est\xE1 a punto de eliminar permanentemente los siguientes archivos / carpetas"},aLi={BuildingMaker:nLi,FileManager:sLi},lLi={t:{back:"Retour",cancel:"Annuler",create:"Cr\xE9er",delete:"Supprimer",download:"T\xE9l\xE9charger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"\xC9tage",validate:"Valider"}},cLi={title:"Building Maker",list:{text:"Cr\xE9ez et \xE9ditez les \xE9tages puis t\xE9l\xE9chagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du b\xE2timent",error:"Nom invalide"},view:{addStorey:"Ajouter un \xC9tage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel \xE9tage",input:"Nom",error:"Nom invalide"}},dLi={creationFormTitle:"Cr\xE9er un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier cr\xE9\xE9",renameFolderSuccess:"Dossier renomm\xE9",deleteFolderSuccess:"Dossier supprim\xE9",newFileSuccess:"Fichier ajout\xE9",renameFileSuccess:"Fichier renomm\xE9",deleteFileSuccess:"Fichier supprim\xE9",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous \xEAtes sur le point de supprimer d\xE9finitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"S\xE9lectionner une page"},uLi={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},ALi={title:"Photosph\xE8re Building"},hLi={BIMDataComponents:lLi,BuildingMaker:cLi,FileManager:dLi,MetaBuildingStructure:uLi,PhotosphereBuilding:ALi},pLi={title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},gLi={creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella \xE8 vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"},fLi={BuildingMaker:pLi,FileManager:gLi},mLi={de:XRi,en:oLi,es:aLi,fr:hLi,it:fLi},vLi=({i18nPlugin:t}={})=>({install(e){t?Object.entries(mLi).forEach(([i,r])=>{t.global.mergeLocaleMessage(i,r)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(Jmi).forEach(([i,r])=>{e.component(i,r)})}}),CLi={beforeMount(t,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);t.clickAwayHandler=i=>{(i.path||i.composedPath&&i.composedPath()).find(r=>r===t)||e.value()},window.addEventListener("mousedown",t.clickAwayHandler,!0)},unmounted(t){window.removeEventListener("mousedown",t.clickAwayHandler,!0),delete t.clickAwayHandler}},yLi=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:cA,BIMDataClickInputAway:CLi},Symbol.toStringTag,{value:"Module"})),wLi=t=>({install(e){Object.entries(l4t).forEach(([i,r])=>{e.component(i,r)}),Object.entries(yLi).forEach(([i,r])=>e.directive(i.split("BIMData")[1],r))}}),bLi={name:"LiWrapper",render(){return En("li",this.$slots.default())}};function ILi(t,e){var i=new Set([]);return t.forEach(r=>{e.has(r)||i.add(r)}),i}const UA=ia("id"),BLi=({contextMenu:t,objects:e=[],state:i=t.$viewer.state,pictos:r})=>[{name:"selectAll",get group(){return t.groupPositions.select},position:1,get label(){return t.$t("context_menu.select_all")},get picto(){return r.get(this.name)},execute:()=>i.selectObjects(e.filter(Zu(mr("visible"),Kg("selected"))).map(UA)),predicate:()=>e.some(Zu(mr("visible"),Kg("selected")))},{name:"deselectAll",get group(){return t.groupPositions.select},position:2,get label(){return t.$t("context_menu.deselect_all")},get picto(){return r.get(this.name)},execute:()=>i.deselectObjects(e.filter(mr("selected")).map(UA)),predicate:()=>e.some(mr("selected"))},{name:"selectSimilar",get group(){return t.groupPositions.select},position:3,get label(){return t.$t("context_menu.select_similar")},get picto(){return r.get(this.name)},execute(){const o=e.filter(n=>n.visible&&n.type===this.selectedObject.type&&n.id!==this.selectedObject.id).map(UA);i.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(Zu(mr("visible"),mr("selected")));return o.length===1&&o[0].type!==void 0?(this.selectedObject=o[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return t.$t("context_menu.reverse_selection")},get group(){return t.groupPositions.select},position:4,execute:()=>{const o=new Set(e.filter(mr("selected")).map(UA)),n=new Set(e.filter(mr("visible")).map(UA));i.selectObjects(Array.from(ILi(n,o)),{exclusive:!0})},predicate:()=>e.some(Zu(Kg("selected"),mr("visible")))&&e.some(Zu(mr("selected"),mr("visible")))},{name:"showAll",get group(){return t.groupPositions.visibility},position:1,get label(){return t.$t("context_menu.show_all")},get picto(){return r.get(this.name)},execute:()=>i.showObjects(e.filter(Kg("visible")).map(UA)),predicate:()=>e.some(Kg("visible"))},{name:"hide",get group(){return t.groupPositions.visibility},position:2,get label(){return t.$t("context_menu.hide")},get picto(){return r.get(this.name)},objectsToHide:null,execute(){const o=this.objectsToHide.filter(mr("selected"));o.length>0&&i.deselectObjects(o.map(UA)),i.hideObjects(this.objectsToHide.map(UA))},predicate(){return this.objectsToHide=e.filter(Zu(mr("selected"),mr("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return t.groupPositions.visibility},position:3,get label(){return t.$t("context_menu.hide_all")},execute:()=>{const o=e.filter(mr("visible"));o.some(mr("selected"))&&i.deselectObjects(o.filter(mr("selected")).map(UA)),i.hideObjects(o.map(UA))},predicate:()=>e.some(mr("visible"))}].filter(o=>o.predicate()),ELi={components:{LiWrapper:bLi},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(t){t?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(t){t.key==="Escape"&&this.away()},setPosition(t){const e=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=t.clientX-e.left,this.top=t.clientY-e.top,this.left+this.width>e.width&&(this.left=this.left-this.width),t.clientY>e.top+e.height/2?(this.bottom=e.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(t={}){let e=null;if((!t.execute||typeof t.execute!="function")&!t.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),t.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return t.id=this.nextCommandId++,t},open(t){this.currentCommands=[],this.setPosition(t),this.originEvent=t,t.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async t=>{if(typeof t.predicate=="function"){const e=t.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(t);else if(typeof e?.then=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const i=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,i===!0&&this.currentCommands.push(t))}}else this.currentCommands.push(t)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:t=[],state:e=this.$viewer.state,context:i=null}){const r=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(o=>r.set(o.name,o.key)),BLi({contextMenu:this,objects:t,state:e,pictos:r})},executeCommand(t){if(t.execute&&(t.execute(this.originEvent),this.displayed=!1),t.component&&!t.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const t=new Map;this.currentCommands.forEach(i=>{(i.group===null||i.group===void 0)&&(i.group=0),t.has(i.group)?t.get(i.group).push(i):t.set(i.group,[i])}),t.forEach(i=>i.sort((r,o)=>(r.position=r.position||0,o.position=o.position||0,r.position-o.position)));const e=[...t.keys()].sort((i,r)=>i-r).map(i=>t.get(i)).flat();this.currentCommands=e},isGroupIntersection(t){if(t===0)return!1;const e=this.currentCommands[t-1],i=this.currentCommands[t];return e.group<i.group},registerContextCommand(t){const e=this.typeCheckCommand(t);return this.contextCommands.push(e),t.id},registerCommand(t){const e=this.typeCheckCommand(t);return this.registeredCommands.push(e),t.id},unregisterCommand(t){return this.registeredCommands.find(e=>e.id===t)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==t),!0):!1},preventDefault(){this.defaultPrevented=!0}}},xLi={key:0,class:"separator"},kLi={class:"menu-text"},MLi={key:1,class:"menu-picto"},SLi={key:0,class:"context-menu__spinner"};function QLi(t,e,i,r,o,n){const s=R("BIMDataIconChevron"),a=R("LiWrapper"),l=R("BIMDataSpinner"),c=Zi("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?Lt((P(),O("ul",{key:0,class:"bimdata-list context-menu",style:xe(n.position)},[(P(!0),O(It,null,Kt(o.currentCommands,(d,u)=>(P(),te(a,{key:d.label,class:"context-menu__element",onClick:A=>n.executeCommand(d)},{default:z(()=>[n.isGroupIntersection(u)?(P(),O("div",xLi)):ve("",!0),B("div",kLi,$(d.label),1),!d.component&&d.picto?(P(),O("span",MLi,$(d.picto),1)):d.component?(P(),te(s,{key:2,size:"xxs",class:"fill-primary"})):ve("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(P(),O("li",SLi,[L(l)])):ve("",!0)],4)),[[c,n.away]]):ve("",!0)}const PLi=K(ELi,[["render",QLi],["__scopeId","data-v-5b87d4a3"]]),DLi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=Tt("$viewer"),e=kl(new Map),i=o=>{if(!o.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(o.name))throw new Error(`[Viewer Header] Content with name ${o.name} already exists`);e.set(o.name,o)},r=o=>e.has(o)?(e.delete(o),!0):!1;return{logo:t.uiSettings.bimdataLogo!==!1,version:t.uiSettings.version!==!1?t.version:null,headerContent:e,headerRightContentComponents:At(()=>Array.from(e.values()).filter(o=>o.position==="right").sort((o,n)=>o.order-n.order).map(o=>o.component)),headerLeftContentComponents:At(()=>Array.from(e.values()).filter(o=>o.position==="left").sort((o,n)=>o.order-n.order).map(o=>o.component)),addContent:i,removeContent:r}}},RLi={class:"viewer-header"},LLi={class:"viewer-header__content"},TLi={class:"viewer-header__content__left"},FLi={class:"viewer-header__content__right"},NLi={key:0,class:"m-l-6 flex items-center"},ULi={key:1,class:"viewer-header__version"};function _Li(t,e,i,r,o,n){const s=R("BIMDataIllustration");return Lt((P(),O("div",RLi,[B("div",LLi,[B("div",TLi,[(P(!0),O(It,null,Kt(r.headerLeftContentComponents,a=>(P(),te(Eo(a),{key:a.name}))),128))]),B("div",FLi,[(P(!0),O(It,null,Kt(r.headerRightContentComponents,a=>(P(),te(Eo(a),{key:a.name}))),128))])]),r.logo||r.version?(P(),O("div",NLi,[r.logo?(P(),te(s,{key:0,name:"logo",width:"30px",height:"30px"})):ve("",!0),r.version?(P(),O("div",ULi,$(r.version),1)):ve("",!0)])):ve("",!0)],512)),[[gi,i.visible]])}const OLi=K(DLi,[["render",_Li],["__scopeId","data-v-5c9ea6b6"]]),HLi={emits:["resize"],setup(t,{emit:e}){return{onResizerMousedown:i=>{i.preventDefault();let r=i.clientX;const o=s=>{s.preventDefault();const a=s.clientX-r;r=s.clientX,e("resize",a)},n=s=>{s.preventDefault(),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n)}}}},GLi={class:"bimdata-separator"};function jLi(t,e,i,r,o,n){return P(),O("div",GLi,[e[1]||(e[1]=B("div",{class:"bimdata-separator__line"},null,-1)),B("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>r.onResizerMousedown&&r.onResizerMousedown(...s))},null,32)])}const VLi=K(HLi,[["render",jLi],["__scopeId","data-v-79a3b3af"]]),qLi={components:{Separator:VLi},props:{position:{type:String,required:!0,validator(t){return["left","right"].includes(t)}},sidePanel:{type:Object,required:!0,validator(t){if(t.width&&(typeof t.width!="number"||t.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof t.width}`),!1;const e=typeof t?.component=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(t){const e=Ve(null),i=Ve(t.sidePanel.width??400),r=(o,n=1)=>{const s=i.value+o*n;i.value=Math.max(0,s)};return Ht(()=>t.sidePanel,()=>{Object.defineProperty(t.sidePanel,"width",{get(){return i.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}i.value=o}}),Object.defineProperty(t.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:i,onResize:r}}},zLi={class:"bimdata-global-side-panel__component"};function KLi(t,e,i,r,o,n){const s=R("Separator");return P(),O("div",{class:"bimdata-global-side-panel",style:xe(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(P(),te(s,{key:0,onResize:e[0]||(e[0]=a=>r.onResize(a,-1))})):ve("",!0),B("div",zLi,[(P(),te(Eo(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(P(),te(s,{key:1,onResize:e[1]||(e[1]=a=>r.onResize(a))})):ve("",!0)],4)}const JLi=K(qLi,[["render",KLi],["__scopeId","data-v-82d0d4cb"]]),YLi={name:"BimdataViewer",components:{ContextMenu:PLi,ViewerHeader:OLi,ModalManager:eEe,GlobalSidePanel:JLi},setup(){const t=Tt("$viewer"),{globalContext:e,shortcutManager:i}=t;uo(()=>{i&&i.destroy(),e.hub.clear()}),Er(()=>{t.pluginManager.runPluginsScripts(t)});const r=At(()=>{var h;return t.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||((h=e.localContexts[0].window)==null?void 0:h.logoAndVersion))}),o=At(()=>{var h;return t.uiSettings.version!==!1&&(e.localContexts.length!==1||(h=e.localContexts[0].window)!=null&&h.logoAndVersion)?t.version:null}),n=At(()=>e.leftSidePanel),s=At(()=>e.rightSidePanel),a=At(()=>{var h;const g=t.uiSettings.header!==!1,p=e.localContexts.length===1&&((h=e.localContexts[0].window)==null?void 0:h.header)===!1,m=!!(n.value||s.value);return g&&(!p||m)}),l=t.uiSettings.contextMenu!==!1,c=Ve(null);function d(h){l&&c.value.open(h)}function u(){t.shortcutManager.active=!0}function A(){t.shortcutManager.active=!1}return{Layout:t.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:A,isHeaderVisible:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:o,version:t.version,loading:At(()=>e.loading),spinner:At(()=>e.spinner),leftSidePanel:n,rightSidePanel:s}}},WLi={key:1,class:"global-spinner",style:{"z-index":"3"}},ZLi={key:2,class:"viewer__logo"},XLi={key:1,class:"version m-t-6"};function $Li(t,e,i,r,o,n){const s=R("ModalManager"),a=R("ContextMenu"),l=R("ViewerHeader"),c=R("GlobalSidePanel"),d=R("BIMDataSpinner"),u=R("BIMDataIllustration");return P(),O("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...A)=>r.onContextMenu&&r.onContextMenu(...A)),onMouseenter:e[1]||(e[1]=(...A)=>r.onMouseenter&&r.onMouseenter(...A)),onMouseleave:e[2]||(e[2]=(...A)=>r.onMouseleave&&r.onMouseleave(...A))},[L(s,{ref:"modalManagerTemplateRef"},null,512),r.contextMenuEnabled?(P(),te(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):ve("",!0),L(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),B("div",{class:"bimdata-viewer__content",style:xe(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(P(),te(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):ve("",!0),(P(),te(Eo(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(P(),te(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):ve("",!0)],4),r.loading?(P(),O("div",WLi,[r.spinner&&r.spinner.component?(P(),te(Eo(r.spinner.component),Xc(Oa({key:0},r.spinner.props)),null,16)):(P(),te(d,{key:1,size:"40px",border:"5px"}))])):ve("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(P(),O("div",ZLi,[r.bimdataLogoOnSingleWindow?(P(),te(u,{key:0,name:"logo"})):ve("",!0),r.viewerVersionOnSingleWindow?(P(),O("div",XLi,$(r.version),1)):ve("",!0)])):ve("",!0)],544)}const eTi=K(YLi,[["render",$Li]]),tTi=["src"],iTi={class:"bimdata-models__header"},rTi={key:0,class:"bimdata-models__header__loader"},oTi={class:"bimdata-models__header__picto"},nTi={class:"bimdata-models__header__name"},sTi={key:0,class:"bimdata-models__header__name--empty"},aTi={key:1,class:"bimdata-models__header__name--empty"},lTi={key:3},cTi=["onMousemove","onClick"],nEe={__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=Tt("$viewer"),r=Ve(),o=Ve(0),n=Ve(0),s=Ve(),a=mo([]),l=Ve(!1),c=At(()=>i.localContext.loadedModels),d=At(()=>i.localContext.loadedModelIds),u=At(()=>i.localContext.loadingModelIds),A=At(()=>i.localContext.multiModel),h=At(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(b=>c.value.find(E=>{var x;return((x=E.document)==null?void 0:x.head_id)!=null&&E.document.head_id===b.document.id})??b)),g=b=>d.value.includes(b),p=b=>u.value.includes(b),m=At(()=>{var b;const{x:E,y:x}=((b=s.value)==null?void 0:b.getBoundingClientRect())??{x:0,y:0};return`top:${n.value-x}px; left:${o.value-E}px;`}),f=b=>{!A.value&&g(b.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(b.id)?i.localContext.unloadModels([b.id]):i.localContext.loadModels([b.id]))},v=b=>{switch(b){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},C=(b,E)=>{b!=null&&b.viewer_360_file&&(o.value=E.clientX,n.value=E.clientY),r.value=b?.viewer_360_file},y=async b=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,b)).filter(E=>i.state.models.some(x=>x.archived)||!E.archived).sort(W0("updated_at",!1))}catch(E){console.error("[Models] Cannot get project models. Error: ",E)}finally{l.value=!1}return[]},w=b=>{var E;return((E=b.children)==null?void 0:E.some(x=>g(x.id)))??!1};return y(i.localContext.modelTypes).then(b=>{a.value=b}),(b,E)=>{const x=R("BIMDataSpinner"),M=R("BIMDataIconModel3D"),k=R("BIMDataTextbox"),S=R("BIMDataCheckbox"),D=R("BIMDataRadio"),T=R("BIMDataIcon"),U=R("BIMDataDropdownList");return P(),O("div",{ref_key:"templateRef",ref:s,class:Se(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[r.value?(P(),O("div",{key:0,class:"bimdata-models__preview",style:xe(m.value)},[B("img",{src:r.value},null,8,tTi)],4)):ve("",!0),L(U,{style:xe(`--bimdata-models-width: ${t.width};`),width:t.width,list:h.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:h.value.length===0,onElementClick:f},{header:z(({isOpen:G})=>[B("div",iTi,[l.value||u.value.length>0?(P(),O("div",rTi,[L(x)])):(P(),O(It,{key:1},[B("div",oTi,[L(M)]),B("div",{class:Se(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[B("span",null,$(d.value.length),1)],2),B("div",nTi,[h.value.length===0?(P(),O("span",sTi,$(b.$t("model.no_model")),1)):d.value.length===0?(P(),O("span",aTi,$(b.$t("model.no_loaded_model")),1)):d.value.length===1?(P(),te(k,{key:2,text:c.value[0].name,tooltip:!G},null,8,["text","tooltip"])):d.value.length>1?(P(),O("span",lTi,$(b.$t("model.selected_models")),1)):ve("",!0)])],64))])]),element:z(({element:G,close:N})=>[B("div",{class:"bimdata-models__model",onMousemove:H=>t.preview&&C(G,H),onMouseout:E[0]||(E[0]=H=>t.preview&&C()),onClick:()=>{!A.value&&!g(G.id)&&N()}},[A.value?(P(),te(S,{key:0,"model-value":g(G.id)||w(G),disabled:G.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(P(),te(D,{key:1,"model-value":g(G.id)||w(G),disabled:G.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),L(T,{margin:"0 calc(var(--spacing-unit) / 2)",name:v(G.status),size:"xs",class:Se({"fill-success":G.status==="C","fill-high":G.status==="E"})},null,8,["name","class"]),L(k,{class:Se({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":G.status!=="C"||u.value.length>0}),text:G.name,width:`calc(100% -
|
|
5506
5506
|
${A.value?13:23}px - 2 * 6px - 16px)`},null,8,["class","text","width"]),G.document&&!G.document.is_head_version?(P(),te(T,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):ve("",!0)],40,cTi),p(G.id)?(P(),te(x,{key:0,class:"bimdata-models__model__spinner"})):ve("",!0)]),_:1},8,["style","width","list","loading","disabled"])],2)}}},dTi={data(){return{shown:!1}},mounted(){setTimeout(()=>{this.shown=!0},500)}};function uTi(t,e,i,r,o,n){const s=R("BIMDataIllustration");return P(),O("div",{class:"bimdata__no-model",style:xe({"--no-model--opacity":o.shown?1:0})},[L(s,{name:"emptyViewer",x:"90",y:"90"}),B("span",null,$(t.$t("model.select_model")),1)],4)}const sEe=K(dTi,[["render",uTi],["__scopeId","data-v-5ffd9bc0"]]);window.BIMDataViewerVue=Nse;class ATi{constructor(e={}){var i,r;const{api:o={},ui:n}=e;this.uiCfg=n,o.apiUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `apiUrl` not set, use 'https://api.bimdata.io' by default."),o.apiUrl="https://api.bimdata.io"),o.archiveUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `archiveUrl` not set, use 'https://archive.bimdata.io' by default."),o.archiveUrl="https://archive.bimdata.io"),o.pdfBackendUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `pdfBackendUrl` not set, use 'https://pdf-backend.bimdata.io' by default."),o.pdfBackendUrl="https://pdf-backend.bimdata.io"),o.ifcIds&&(console.warn("[BIMData Viewer] DEPRECATED - Viewer config - please use the `modelIds` property instead of `ifcIds`."),o.modelIds===void 0&&(o.modelIds=o.ifcIds)),o.modelIds||(o.modelIds=[]),(i=o.offline)!=null&&i.dataFile&&(o.offline.data=o.offline.dataFile),this.$viewer=new LRi(e),(r=o.offline)!=null&&r.enabled?this.$viewer.api.enableOfflineMode(o.offline.data,o.offline.options).then(()=>this.state.loadModels(o.modelIds)):(this.$viewer.globalContext.loadingProcessStart(),this.state.loadModels(o.modelIds).finally(()=>this.$viewer.globalContext.loadingProcessEnd())),this.vueApp=null}get state(){return this.$viewer.state}get api(){return this.$viewer.api}async mount(e,i="3d"){var r;const{$viewer:o}=this;await o.api.ready;try{const u=await o.api.apiClient.collaborationApi.checkProjectAccess(o.api.cloudId,o.api.projectId);o.api.permissions=oEe(u)}catch{o.api.permissions=oEe()}const n=this.api.accessToken,{i18n:s}=o;s.registerTranslations(o.pluginManager.pluginTranslations),o.layout.apply(i);const a={i18n:s.i18nVuePlugin,data(){return{accessToken:n}},render(){return En(eTi,{style:"height: 100%"})}},l=U7(a).use(s.i18nVuePlugin).use(wLi()).use(vLi({i18nPlugin:s.i18nVuePlugin})).use(YRi({apiClient:o.api.apiClient,i18nPlugin:s.i18nVuePlugin}));l.provide("$viewer",o),l.component("BIMDataModelLoader",nEe),l.component("BIMDataNoModelWindowPlaceHolder",sEe),l.component("BIMDataStoreySelector",kj),l.component("ModelsLoader",nEe),l.component("NoModelWindowPlaceHolder",sEe);const c=e instanceof HTMLElement?e:document.querySelector(e);c&&(c.style.height="100%");const d=l.mount(e);return d.$viewer=o,TRi(d.$el,(r=this.uiCfg)==null?void 0:r.style),typeof window<"u"&&(window.bimdataViewer=d),this.vueApp=l,d}destroy(){var e;(e=this.vueApp)==null||e.unmount()}setLocale(e){if(!$se.includes(e))throw new Error(`Viewer available locales are ${$se.join(", ")}.`);this.$viewer.i18n.locale=e}registerPlugin(e){this.$viewer.registerPlugin(e)}registerWindow(e){return this.$viewer.windowManager.registerWindow(e)}unregisterWindow(e){return this.$viewer.windowManager.unregisterWindow(e)}setAccessToken(e){this.api.accessToken=e}async loadModels(e){this.$viewer.globalContext.loadingProcessStart();const i=await this.state.loadModels(e);return this.$viewer.globalContext.loadingProcessEnd(),i}loadIfcs(e){return console.warn("[BIMData Viewer] DEPRECATED - Viewer - please use the loadModels method instead of loadIfcs."),this.loadModels(e)}}const aEe=(t={})=>new ATi(t);window.makeBIMDataViewer=aEe;var Nb={};Nb.d=(t,e)=>{for(var i in e)Nb.o(e,i)&&!Nb.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},Nb.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Hi=globalThis.pdfjsLib={};Nb.d(Hi,{AbortException:()=>C2,AnnotationEditorLayer:()=>kNi,AnnotationEditorParamsType:()=>Cr,AnnotationEditorType:()=>$i,AnnotationEditorUIManager:()=>eI,AnnotationLayer:()=>gNi,AnnotationMode:()=>Vp,ColorPicker:()=>uke,DOMSVGFactory:()=>fX,DrawLayer:()=>MNi,FeatureTest:()=>al,GlobalWorkerOptions:()=>eg,ImageKind:()=>ZD,InvalidPDFException:()=>cEe,MissingPDFException:()=>_b,OPS:()=>Iu,OutputScale:()=>kZ,PDFDataRangeTransport:()=>Mxe,PDFDateString:()=>EZ,PDFWorker:()=>nL,PasswordResponses:()=>fTi,PermissionFlag:()=>gTi,PixelsPerInch:()=>p9,RenderingCancelledException:()=>IZ,TextLayer:()=>uX,UnexpectedResponseException:()=>tR,Util:()=>Ci,VerbosityLevel:()=>XD,XfaLayer:()=>Rxe,build:()=>JFi,createValidAbsoluteUrl:()=>yTi,fetchData:()=>oR,getDocument:()=>NFi,getFilenameFromUrl:()=>STi,getPdfFilenameFromUrl:()=>QTi,getXfaPageViewport:()=>PTi,isDataScheme:()=>nR,isPdfFile:()=>BZ,noContextMenu:()=>Bu,normalizeUnicode:()=>xTi,setLayerDimensions:()=>w2,shadow:()=>cr,stopEvent:()=>Eu,version:()=>KFi});const sl=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),lEe=[1,0,0,1,0,0],hZ=[.001,0,0,.001,0,0],hTi=1e7,pZ=1.35,Lc={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Vp={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},pTi="pdfjs_internal_editor_",$i={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},Cr={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35,DRAW_STEP:41},gTi={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},fa={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},ZD={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},os={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},Ub={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},XD={ERRORS:0,WARNINGS:1,INFOS:5},Iu={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93},fTi={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let $D=XD.WARNINGS;function mTi(t){Number.isInteger(t)&&($D=t)}function vTi(){return $D}function eR(t){$D>=XD.INFOS&&console.log(`Info: ${t}`)}function ir(t){$D>=XD.WARNINGS&&console.log(`Warning: ${t}`)}function no(t){throw new Error(t)}function Gn(t,e){t||no(e)}function CTi(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function yTi(t,e=null,i=null){if(!t)return null;try{if(i&&typeof t=="string"){if(i.addDefaultProtocol&&t.startsWith("www.")){const o=t.match(/\./g);o?.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=ETi(t)}catch{}}const r=e?new URL(t,e):new URL(t);if(CTi(r))return r}catch{}return null}function cr(t,e,i,r=!1){return Object.defineProperty(t,e,{value:i,enumerable:!r,configurable:!0,writable:!1}),i}const qp=function(){function t(e,i){this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();let gZ=class extends qp{constructor(t,e){super(t,"PasswordException"),this.code=e}},fZ=class extends qp{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},cEe=class extends qp{constructor(t){super(t,"InvalidPDFException")}},_b=class extends qp{constructor(t){super(t,"MissingPDFException")}},tR=class extends qp{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}},wTi=class extends qp{constructor(t){super(t,"FormatError")}},C2=class extends qp{constructor(t){super(t,"AbortException")}};function dEe(t){(typeof t!="object"||t?.length===void 0)&&no("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const r=[];for(let o=0;o<e;o+=i){const n=Math.min(o+i,e),s=t.subarray(o,n);r.push(String.fromCharCode.apply(null,s))}return r.join("")}function iR(t){typeof t!="string"&&no("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let r=0;r<e;++r)i[r]=t.charCodeAt(r)&255;return i}function bTi(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function mZ(t){const e=Object.create(null);for(const[i,r]of t)e[i]=r;return e}function ITi(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}function BTi(){try{return new Function(""),!0}catch{return!1}}class al{static get isLittleEndian(){return cr(this,"isLittleEndian",ITi())}static get isEvalSupported(){return cr(this,"isEvalSupported",BTi())}static get isOffscreenCanvasSupported(){return cr(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return cr(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){return typeof navigator<"u"&&typeof navigator?.platform=="string"?cr(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:typeof navigator?.userAgent=="string"&&navigator.userAgent.includes("Firefox")}):cr(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){var e,i;return cr(this,"isCSSRoundSupported",(i=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:i.call(e,"width: round(1.5px, 1px)"))}}const vZ=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));var y2,CZ,rR,yZ;let Ci=(CZ=class{static makeHexColor(t,e,i){return`#${vZ[t]}${vZ[e]}${vZ[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){const i=t[0]*e[0]+t[1]*e[2]+e[4],r=t[0]*e[1]+t[1]*e[3]+e[5];return[i,r]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2],r=(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,o=(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i;return[r,o]}static getAxialAlignedBoundingBox(t,e){const i=this.applyTransform(t,e),r=this.applyTransform(t.slice(2,4),e),o=this.applyTransform([t[0],t[3]],e),n=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],r[0],o[0],n[0]),Math.min(i[1],r[1],o[1],n[1]),Math.max(i[0],r[0],o[0],n[0]),Math.max(i[1],r[1],o[1],n[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],r=t[0]*e[1]+t[1]*e[3],o=t[2]*e[0]+t[3]*e[2],n=t[2]*e[1]+t[3]*e[3],s=(i+n)/2,a=Math.sqrt((i+n)**2-4*(i*n-o*r))/2,l=s+a||1,c=s-a||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),r=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>r)return null;const o=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),n=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return o>n?null:[i,o,r,n]}static bezierBoundingBox(t,e,i,r,o,n,s,a,l){return l?(l[0]=Math.min(l[0],t,s),l[1]=Math.min(l[1],e,a),l[2]=Math.max(l[2],t,s),l[3]=Math.max(l[3],e,a)):l=[Math.min(t,s),Math.min(e,a),Math.max(t,s),Math.max(e,a)],ne(this,y2,yZ).call(this,t,i,o,s,e,r,n,a,3*(-t+3*(i-o)+s),6*(t-2*i+o),3*(i-t),l),ne(this,y2,yZ).call(this,t,i,o,s,e,r,n,a,3*(-e+3*(r-n)+a),6*(e-2*r+n),3*(r-e),l),l}},y2=new WeakSet,rR=function(t,e,i,r,o,n,s,a,l,c){if(l<=0||l>=1)return;const d=1-l,u=l*l,A=u*l,h=d*(d*(d*t+3*l*e)+3*u*i)+A*r,g=d*(d*(d*o+3*l*n)+3*u*s)+A*a;c[0]=Math.min(c[0],h),c[1]=Math.min(c[1],g),c[2]=Math.max(c[2],h),c[3]=Math.max(c[3],g)},yZ=function(t,e,i,r,o,n,s,a,l,c,d,u){if(Math.abs(l)<1e-12){Math.abs(c)>=1e-12&&ne(this,y2,rR).call(this,t,e,i,r,o,n,s,a,-d/c,u);return}const A=c**2-4*d*l;if(A<0)return;const h=Math.sqrt(A),g=2*l;ne(this,y2,rR).call(this,t,e,i,r,o,n,s,a,(-c+h)/g,u),ne(this,y2,rR).call(this,t,e,i,r,o,n,s,a,(-c-h)/g,u)},Ae(CZ,y2),CZ);function ETi(t){return decodeURIComponent(escape(t))}let wZ=null,uEe=null;function xTi(t){return wZ||(wZ=/([\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,uEe=new Map([["\uFB05","\u017Ft"]])),t.replaceAll(wZ,(e,i,r)=>i?i.normalize("NFKC"):uEe.get(r))}function kTi(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),dEe(t)}const bZ="pdfjs_internal_id_",x1={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8};function MTi(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(dEe(t))}const k1="http://www.w3.org/2000/svg",h9=class{};ii(h9,"CSS",96),ii(h9,"PDF",72),ii(h9,"PDF_TO_CSS_UNITS",h9.CSS/h9.PDF);let p9=h9;async function oR(t,e="text"){if(Ob(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise((i,r)=>{const o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType=e,o.onreadystatechange=()=>{if(o.readyState===XMLHttpRequest.DONE){if(o.status===200||o.status===0){switch(e){case"arraybuffer":case"blob":case"json":i(o.response);return}i(o.responseText);return}r(new Error(o.statusText))}},o.send(null)})}class xE{constructor({viewBox:e,scale:i,rotation:r,offsetX:o=0,offsetY:n=0,dontFlip:s=!1}){this.viewBox=e,this.scale=i,this.rotation=r,this.offsetX=o,this.offsetY=n;const a=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,d,u,A;switch(r%=360,r<0&&(r+=360),r){case 180:c=-1,d=0,u=0,A=1;break;case 90:c=0,d=1,u=1,A=0;break;case 270:c=0,d=-1,u=-1,A=0;break;case 0:c=1,d=0,u=0,A=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}s&&(u=-u,A=-A);let h,g,p,m;c===0?(h=Math.abs(l-e[1])*i+o,g=Math.abs(a-e[0])*i+n,p=(e[3]-e[1])*i,m=(e[2]-e[0])*i):(h=Math.abs(a-e[0])*i+o,g=Math.abs(l-e[1])*i+n,p=(e[2]-e[0])*i,m=(e[3]-e[1])*i),this.transform=[c*i,d*i,u*i,A*i,h-c*i*a-u*i*l,g-d*i*a-A*i*l],this.width=p,this.height=m}get rawDims(){const{viewBox:e}=this;return cr(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:i=this.rotation,offsetX:r=this.offsetX,offsetY:o=this.offsetY,dontFlip:n=!1}={}){return new xE({viewBox:this.viewBox.slice(),scale:e,rotation:i,offsetX:r,offsetY:o,dontFlip:n})}convertToViewportPoint(e,i){return Ci.applyTransform([e,i],this.transform)}convertToViewportRectangle(e){const i=Ci.applyTransform([e[0],e[1]],this.transform),r=Ci.applyTransform([e[2],e[3]],this.transform);return[i[0],i[1],r[0],r[1]]}convertToPdfPoint(e,i){return Ci.applyInverseTransform([e,i],this.transform)}}class IZ extends qp{constructor(e,i=0){super(e,"RenderingCancelledException"),this.extraDelay=i}}function nR(t){const e=t.length;let i=0;for(;i<e&&t[i].trim()==="";)i++;return t.substring(i,i+5).toLowerCase()==="data:"}function BZ(t){return typeof t=="string"&&/\.pdf$/i.test(t)}function STi(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function QTi(t,e="document.pdf"){if(typeof t!="string")return e;if(nR(t))return ir('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,o=i.exec(t);let n=r.exec(o[1])||r.exec(o[2])||r.exec(o[3]);if(n&&(n=n[0],n.includes("%")))try{n=r.exec(decodeURIComponent(n))[0]}catch{}return n||e}class AEe{constructor(){ii(this,"started",Object.create(null)),ii(this,"times",[])}time(e){e in this.started&&ir(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||ir(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let i=0;for(const{name:r}of this.times)i=Math.max(r.length,i);for(const{name:r,start:o,end:n}of this.times)e.push(`${r.padEnd(i)} ${n-o}ms
|
|
5507
5507
|
`);return e.join("")}}function Ob(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return i==="http:"||i==="https:"}catch{return!1}}function Bu(t){t.preventDefault()}function Eu(t){t.preventDefault(),t.stopPropagation()}function hEe(t){console.log("Deprecated API usage: "+t)}var Hb;class EZ{static toDateObject(e){if(!e||typeof e!="string")return null;Q(this,Hb)||oe(this,Hb,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const i=Q(this,Hb).exec(e);if(!i)return null;const r=parseInt(i[1],10);let o=parseInt(i[2],10);o=o>=1&&o<=12?o-1:0;let n=parseInt(i[3],10);n=n>=1&&n<=31?n:1;let s=parseInt(i[4],10);s=s>=0&&s<=23?s:0;let a=parseInt(i[5],10);a=a>=0&&a<=59?a:0;let l=parseInt(i[6],10);l=l>=0&&l<=59?l:0;const c=i[7]||"Z";let d=parseInt(i[8],10);d=d>=0&&d<=23?d:0;let u=parseInt(i[9],10)||0;return u=u>=0&&u<=59?u:0,c==="-"?(s+=d,a+=u):c==="+"&&(s-=d,a-=u),new Date(Date.UTC(r,o,n,s,a,l))}}Hb=new WeakMap,Ae(EZ,Hb);function PTi(t,{scale:e=1,rotation:i=0}){const{width:r,height:o}=t.attributes.style,n=[0,0,parseInt(r),parseInt(o)];return new xE({viewBox:n,scale:e,rotation:i})}function xZ(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(ir(`Not a valid color format: "${t}"`),[0,0,0])}function DTi(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const i of t.keys()){e.style.color=i;const r=window.getComputedStyle(e).color;t.set(i,xZ(r))}e.remove()}function Vo(t){const{a:e,b:i,c:r,d:o,e:n,f:s}=t.getTransform();return[e,i,r,o,n,s]}function _A(t){const{a:e,b:i,c:r,d:o,e:n,f:s}=t.getTransform().invertSelf();return[e,i,r,o,n,s]}function w2(t,e,i=!1,r=!0){if(e instanceof xE){const{pageWidth:o,pageHeight:n}=e.rawDims,{style:s}=t,a=al.isCSSRoundSupported,l=`var(--scale-factor) * ${o}px`,c=`var(--scale-factor) * ${n}px`,d=a?`round(down, ${l}, var(--scale-round-x, 1px))`:`calc(${l})`,u=a?`round(down, ${c}, var(--scale-round-y, 1px))`:`calc(${c})`;!i||e.rotation%180===0?(s.width=d,s.height=u):(s.width=u,s.height=d)}r&&t.setAttribute("data-main-rotation",e.rotation)}class kZ{constructor(){const e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}}var b2,g9,OA,f9,sR,Gb,MZ,pEe,HA,gEe,fEe,aR,mEe,SZ;const lR=class qF{constructor(e){Ae(this,HA),Ae(this,b2,null),Ae(this,g9,null),Ae(this,OA),Ae(this,f9,null),Ae(this,sR,null),oe(this,OA,e),Q(qF,Gb)||oe(qF,Gb,Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button"}))}render(){const e=oe(this,b2,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const i=Q(this,OA)._uiManager._signal;e.addEventListener("contextmenu",Bu,{signal:i}),e.addEventListener("pointerdown",ne(qF,MZ,pEe),{signal:i});const r=oe(this,f9,document.createElement("div"));r.className="buttons",e.append(r);const o=Q(this,OA).toolbarPosition;if(o){const{style:n}=e,s=Q(this,OA)._uiManager.direction==="ltr"?1-o[0]:o[0];n.insetInlineEnd=`${100*s}%`,n.top=`calc(${100*o[1]}% + var(--editor-toolbar-vert-offset))`}return ne(this,HA,mEe).call(this),e}get div(){return Q(this,b2)}hide(){var e;Q(this,b2).classList.add("hidden"),(e=Q(this,g9))==null||e.hideDropdown()}show(){var e;Q(this,b2).classList.remove("hidden"),(e=Q(this,sR))==null||e.shown()}async addAltText(e){const i=await e.render();ne(this,HA,aR).call(this,i),Q(this,f9).prepend(i,Q(this,HA,SZ)),oe(this,sR,e)}addColorPicker(e){oe(this,g9,e);const i=e.renderButton();ne(this,HA,aR).call(this,i),Q(this,f9).prepend(i,Q(this,HA,SZ))}remove(){var e;Q(this,b2).remove(),(e=Q(this,g9))==null||e.destroy(),oe(this,g9,null)}};b2=new WeakMap,g9=new WeakMap,OA=new WeakMap,f9=new WeakMap,sR=new WeakMap,Gb=new WeakMap,MZ=new WeakSet,pEe=function(t){t.stopPropagation()},HA=new WeakSet,gEe=function(t){Q(this,OA)._focusEventsAllowed=!1,Eu(t)},fEe=function(t){Q(this,OA)._focusEventsAllowed=!0,Eu(t)},aR=function(t){const e=Q(this,OA)._uiManager._signal;t.addEventListener("focusin",ne(this,HA,gEe).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",ne(this,HA,fEe).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",Bu,{signal:e})},mEe=function(){const{editorType:t,_uiManager:e}=Q(this,OA),i=document.createElement("button");i.className="delete",i.tabIndex=0,i.setAttribute("data-l10n-id",Q(lR,Gb)[t]),ne(this,HA,aR).call(this,i),i.addEventListener("click",r=>{e.delete()},{signal:e._signal}),Q(this,f9).append(i)},SZ=function(){const t=document.createElement("div");return t.className="divider",t},Ae(lR,MZ),Ae(lR,Gb,null);let RTi=lR;var cR,I2,m9,jb,vEe,CEe,yEe;class LTi{constructor(e){Ae(this,jb),Ae(this,cR,null),Ae(this,I2,null),Ae(this,m9),oe(this,m9,e)}show(e,i,r){const[o,n]=ne(this,jb,CEe).call(this,i,r),{style:s}=Q(this,I2)||oe(this,I2,ne(this,jb,vEe).call(this));e.append(Q(this,I2)),s.insetInlineEnd=`${100*o}%`,s.top=`calc(${100*n}% + var(--editor-toolbar-vert-offset))`}hide(){Q(this,I2).remove()}}cR=new WeakMap,I2=new WeakMap,m9=new WeakMap,jb=new WeakSet,vEe=function(){const t=oe(this,I2,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",Bu,{signal:Q(this,m9)._signal});const e=oe(this,cR,document.createElement("div"));return e.className="buttons",t.append(e),ne(this,jb,yEe).call(this),t},CEe=function(t,e){let i=0,r=0;for(const o of t){const n=o.y+o.height;if(n<i)continue;const s=o.x+(e?o.width:0);if(n>i){r=s,i=n;continue}e?s>r&&(r=s):s<r&&(r=s)}return[e?1-r:r,i]},yEe=function(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=Q(this,m9)._signal;t.addEventListener("contextmenu",Bu,{signal:i}),t.addEventListener("click",()=>{Q(this,m9).highlightSelection("floating_button")},{signal:i}),Q(this,cR).append(t)};function dR(t,e,i){for(const r of i)e.addEventListener(r,t[r].bind(t))}var QZ;class TTi{constructor(){Ae(this,QZ,0)}get id(){return`${pTi}${Il(this,QZ)._++}`}}QZ=new WeakMap;var Vb,uR,ns,qb,AR;const wEe=class{constructor(){Ae(this,qb),Ae(this,Vb,kTi()),Ae(this,uR,0),Ae(this,ns,null)}static get _isSVGFittingCanvas(){const e='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>',i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),r=new Image;r.src=e;const o=r.decode().then(()=>(i.drawImage(r,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return cr(this,"_isSVGFittingCanvas",o)}async getFromFile(e){const{lastModified:i,name:r,size:o,type:n}=e;return ne(this,qb,AR).call(this,`${i}_${r}_${o}_${n}`,e)}async getFromUrl(e){return ne(this,qb,AR).call(this,e,e)}async getFromBlob(e,i){const r=await i;return ne(this,qb,AR).call(this,e,r)}async getFromId(e){Q(this,ns)||oe(this,ns,new Map);const i=Q(this,ns).get(e);if(!i)return null;if(i.bitmap)return i.refCounter+=1,i;if(i.file)return this.getFromFile(i.file);if(i.blobPromise){const{blobPromise:r}=i;return delete i.blobPromise,this.getFromBlob(i.id,r)}return this.getFromUrl(i.url)}getFromCanvas(e,i){Q(this,ns)||oe(this,ns,new Map);let r=Q(this,ns).get(e);if(r!=null&&r.bitmap)return r.refCounter+=1,r;const o=new OffscreenCanvas(i.width,i.height);return o.getContext("2d").drawImage(i,0,0),r={bitmap:o.transferToImageBitmap(),id:`image_${Q(this,Vb)}_${Il(this,uR)._++}`,refCounter:1,isSvg:!1},Q(this,ns).set(e,r),Q(this,ns).set(r.id,r),r}getSvgUrl(e){const i=Q(this,ns).get(e);return i!=null&&i.isSvg?i.svgUrl:null}deleteId(e){var i;Q(this,ns)||oe(this,ns,new Map);const r=Q(this,ns).get(e);if(!r||(r.refCounter-=1,r.refCounter!==0))return;const{bitmap:o}=r;if(!r.url&&!r.file){const n=new OffscreenCanvas(o.width,o.height);n.getContext("bitmaprenderer").transferFromImageBitmap(o),r.blobPromise=n.convertToBlob()}(i=o.close)==null||i.call(o),r.bitmap=null}isValidId(e){return e.startsWith(`image_${Q(this,Vb)}_`)}};Vb=new WeakMap,uR=new WeakMap,ns=new WeakMap,qb=new WeakSet,AR=async function(t,e){Q(this,ns)||oe(this,ns,new Map);let i=Q(this,ns).get(t);if(i===null)return null;if(i!=null&&i.bitmap)return i.refCounter+=1,i;try{i||(i={bitmap:null,id:`image_${Q(this,Vb)}_${Il(this,uR)._++}`,refCounter:0,isSvg:!1});let r;if(typeof e=="string"?(i.url=e,r=await oR(e,"blob")):e instanceof File?r=i.file=e:e instanceof Blob&&(r=e),r.type==="image/svg+xml"){const o=wEe._isSVGFittingCanvas,n=new FileReader,s=new Image,a=new Promise((l,c)=>{s.onload=()=>{i.bitmap=s,i.isSvg=!0,l()},n.onload=async()=>{const d=i.svgUrl=n.result;s.src=await o?`${d}#svgView(preserveAspectRatio(none))`:d},s.onerror=n.onerror=c});n.readAsDataURL(r),await a}else i.bitmap=await createImageBitmap(r);i.refCounter=1}catch(r){ir(r),i=null}return Q(this,ns).set(t,i),i&&Q(this,ns).set(i.id,i),i};let FTi=wEe;var jn,B2,hR,qo;class NTi{constructor(e=128){Ae(this,jn,[]),Ae(this,B2,!1),Ae(this,hR),Ae(this,qo,-1),oe(this,hR,e)}add({cmd:e,undo:i,post:r,mustExec:o,type:n=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}){if(o&&e(),Q(this,B2))return;const l={cmd:e,undo:i,post:r,type:n};if(Q(this,qo)===-1){Q(this,jn).length>0&&(Q(this,jn).length=0),oe(this,qo,0),Q(this,jn).push(l);return}if(s&&Q(this,jn)[Q(this,qo)].type===n){a&&(l.undo=Q(this,jn)[Q(this,qo)].undo),Q(this,jn)[Q(this,qo)]=l;return}const c=Q(this,qo)+1;c===Q(this,hR)?Q(this,jn).splice(0,1):(oe(this,qo,c),c<Q(this,jn).length&&Q(this,jn).splice(c)),Q(this,jn).push(l)}undo(){if(Q(this,qo)===-1)return;oe(this,B2,!0);const{undo:e,post:i}=Q(this,jn)[Q(this,qo)];e(),i?.(),oe(this,B2,!1),oe(this,qo,Q(this,qo)-1)}redo(){if(Q(this,qo)<Q(this,jn).length-1){oe(this,qo,Q(this,qo)+1),oe(this,B2,!0);const{cmd:e,post:i}=Q(this,jn)[Q(this,qo)];e(),i?.(),oe(this,B2,!1)}}hasSomethingToUndo(){return Q(this,qo)!==-1}hasSomethingToRedo(){return Q(this,qo)<Q(this,jn).length-1}cleanType(e){if(Q(this,qo)!==-1){for(let i=Q(this,qo);i>=0;i--)if(Q(this,jn)[i].type!==e){Q(this,jn).splice(i+1,Q(this,qo)-i),oe(this,qo,i);return}Q(this,jn).length=0,oe(this,qo,-1)}}destroy(){oe(this,jn,null)}}jn=new WeakMap,B2=new WeakMap,hR=new WeakMap,qo=new WeakMap;var PZ,bEe;class zb{constructor(e){Ae(this,PZ),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:i}=al.platform;for(const[r,o,n={}]of e)for(const s of r){const a=s.startsWith("mac+");i&&a?(this.callbacks.set(s.slice(4),{callback:o,options:n}),this.allKeys.add(s.split("+").at(-1))):!i&&!a&&(this.callbacks.set(s,{callback:o,options:n}),this.allKeys.add(s.split("+").at(-1)))}}exec(e,i){if(!this.allKeys.has(i.key))return;const r=this.callbacks.get(ne(this,PZ,bEe).call(this,i));if(!r)return;const{callback:o,options:{bubbles:n=!1,args:s=[],checker:a=null}}=r;a&&!a(e,i)||(o.bind(e,...s,i)(),n||Eu(i))}}PZ=new WeakSet,bEe=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e};const IEe=class pDe{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return DTi(e),cr(this,"_colors",e)}convert(e){const i=xZ(e);if(!window.matchMedia("(forced-colors: active)").matches)return i;for(const[r,o]of this._colors)if(o.every((n,s)=>n===i[s]))return pDe._colorsMapping.get(r);return i}getHexCode(e){const i=this._colors.get(e);return i?Ci.makeHexColor(...i):e}};ii(IEe,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let UTi=IEe;var Kb,wd,bs,ma,Jb,zp,v9,xu,E2,Yb,C9,M1,GA,y9,pR,gR,Wb,fR,S1,x2,Zb,k2,jA,DZ,M2,mR,S2,w9,vR,CR,Hs,so,Kp,b9,Xb,yR,Q2,Q1,Jp,wR,ku,wi,bR,RZ,BEe,EEe,IR,xEe,kEe,MEe,LZ,SEe,TZ,FZ,QEe,ll,P1,PEe,DEe,NZ,REe,$b,UZ;const _Z=class ete{constructor(e,i,r,o,n,s,a,l,c,d,u){Ae(this,wi),Ae(this,Kb,new AbortController),Ae(this,wd,null),Ae(this,bs,new Map),Ae(this,ma,new Map),Ae(this,Jb,null),Ae(this,zp,null),Ae(this,v9,null),Ae(this,xu,new NTi),Ae(this,E2,null),Ae(this,Yb,0),Ae(this,C9,new Set),Ae(this,M1,null),Ae(this,GA,null),Ae(this,y9,new Set),Ae(this,pR,!1),Ae(this,gR,!1),Ae(this,Wb,!1),Ae(this,fR,null),Ae(this,S1,null),Ae(this,x2,null),Ae(this,Zb,null),Ae(this,k2,!1),Ae(this,jA,null),Ae(this,DZ,new TTi),Ae(this,M2,!1),Ae(this,mR,!1),Ae(this,S2,null),Ae(this,w9,null),Ae(this,vR,null),Ae(this,CR,null),Ae(this,Hs,$i.NONE),Ae(this,so,new Set),Ae(this,Kp,null),Ae(this,b9,null),Ae(this,Xb,null),Ae(this,yR,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),Ae(this,Q2,[0,0]),Ae(this,Q1,null),Ae(this,Jp,null),Ae(this,wR,null),Ae(this,ku,null);const A=this._signal=Q(this,Kb).signal;oe(this,Jp,e),oe(this,wR,i),oe(this,Jb,r),this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:A}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:A}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:A}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:A}),o._on("setpreference",this.onSetPreference.bind(this),{signal:A}),o._on("switchannotationeditorparams",h=>this.updateParams(h.type,h.value),{signal:A}),ne(this,wi,xEe).call(this),ne(this,wi,QEe).call(this),ne(this,wi,LZ).call(this),oe(this,zp,n.annotationStorage),oe(this,fR,n.filterFactory),oe(this,b9,s),oe(this,Zb,a||null),oe(this,pR,l),oe(this,gR,c),oe(this,Wb,d),oe(this,CR,u||null),this.viewParameters={realScale:p9.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}static get _keyboardManager(){const e=ete.prototype,i=s=>Q(s,Jp).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&s.hasSomethingToControl(),r=(s,{target:a})=>{if(a instanceof HTMLInputElement){const{type:l}=a;return l!=="text"&&l!=="number"}return!0},o=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return cr(this,"_keyboardManager",new zb([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],e.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:r}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&Q(s,Jp).contains(a)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&Q(s,Jp).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-o,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-n,0],checker:i}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[o,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[n,0],checker:i}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-o],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-n],checker:i}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,o],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,n],checker:i}]]))}destroy(){var e,i,r,o;(e=Q(this,ku))==null||e.resolve(),oe(this,ku,null),(i=Q(this,Kb))==null||i.abort(),oe(this,Kb,null),this._signal=null;for(const n of Q(this,ma).values())n.destroy();Q(this,ma).clear(),Q(this,bs).clear(),Q(this,y9).clear(),oe(this,wd,null),Q(this,so).clear(),Q(this,xu).destroy(),(r=Q(this,Jb))==null||r.destroy(),(o=Q(this,jA))==null||o.hide(),oe(this,jA,null),Q(this,S1)&&(clearTimeout(Q(this,S1)),oe(this,S1,null)),Q(this,Q1)&&(clearTimeout(Q(this,Q1)),oe(this,Q1,null))}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return Q(this,CR)}get useNewAltTextFlow(){return Q(this,gR)}get useNewAltTextWhenAddingImage(){return Q(this,Wb)}get hcmFilter(){return cr(this,"hcmFilter",Q(this,b9)?Q(this,fR).addHCMFilter(Q(this,b9).foreground,Q(this,b9).background):"none")}get direction(){return cr(this,"direction",getComputedStyle(Q(this,Jp)).direction)}get highlightColors(){return cr(this,"highlightColors",Q(this,Zb)?new Map(Q(this,Zb).split(",").map(e=>e.split("=").map(i=>i.trim()))):null)}get highlightColorNames(){return cr(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setMainHighlightColorPicker(e){oe(this,vR,e)}editAltText(e,i=!1){var r;(r=Q(this,Jb))==null||r.editAltText(this,e,i)}switchToMode(e,i){this._eventBus.on("annotationeditormodechanged",i,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,i){this._eventBus.dispatch("setpreference",{source:this,name:e,value:i})}onSetPreference({name:e,value:i}){switch(e){case"enableNewAltTextWhenAddingImage":oe(this,Wb,i);break}}onPageChanging({pageNumber:e}){oe(this,Yb,e-1)}focusMainContainer(){Q(this,Jp).focus()}findParent(e,i){for(const r of Q(this,ma).values()){const{x:o,y:n,width:s,height:a}=r.div.getBoundingClientRect();if(e>=o&&e<=o+s&&i>=n&&i<=n+a)return r}return null}disableUserSelect(e=!1){Q(this,wR).classList.toggle("noUserSelect",e)}addShouldRescale(e){Q(this,y9).add(e)}removeShouldRescale(e){Q(this,y9).delete(e)}onScaleChanging({scale:e}){var i;this.commitOrRemove(),this.viewParameters.realScale=e*p9.PDF_TO_CSS_UNITS;for(const r of Q(this,y9))r.onScaleChanging();(i=this.currentLayer)==null||i.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e=""){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:r,anchorOffset:o,focusNode:n,focusOffset:s}=i,a=i.toString(),l=ne(this,wi,bR).call(this,i).closest(".textLayer"),c=this.getSelectionBoxes(l);if(!c)return;i.empty();const d=ne(this,wi,RZ).call(this,l),u=Q(this,Hs)===$i.NONE,A=()=>{d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:c,anchorNode:r,anchorOffset:o,focusNode:n,focusOffset:s,text:a}),u&&this.showAllEditors("highlight",!0,!0)};if(u){this.switchToMode($i.HIGHLIGHT,A);return}A()}addToAnnotationStorage(e){!e.isEmpty()&&Q(this,zp)&&!Q(this,zp).has(e.id)&&Q(this,zp).setValue(e.id,e)}blur(){if(this.isShiftKeyDown=!1,Q(this,k2)&&(oe(this,k2,!1),ne(this,wi,IR).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const i of Q(this,so))if(i.div.contains(e)){oe(this,w9,[i,e]),i._focusEventsAllowed=!1;break}}focus(){if(!Q(this,w9))return;const[e,i]=Q(this,w9);oe(this,w9,null),i.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),i.focus()}addEditListeners(){ne(this,wi,LZ).call(this),ne(this,wi,TZ).call(this)}removeEditListeners(){ne(this,wi,SEe).call(this),ne(this,wi,FZ).call(this)}dragOver(e){for(const{type:i}of e.dataTransfer.items)for(const r of Q(this,GA))if(r.isHandlingMimeForPasting(i)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const i of e.dataTransfer.items)for(const r of Q(this,GA))if(r.isHandlingMimeForPasting(i.type)){r.paste(i,this.currentLayer),e.preventDefault();return}}copy(e){var i;if(e.preventDefault(),(i=Q(this,wd))==null||i.commitOrRemove(),!this.hasSelection)return;const r=[];for(const o of Q(this,so)){const n=o.serialize(!0);n&&r.push(n)}r.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(r))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:i}=e;for(const n of i.items)for(const s of Q(this,GA))if(s.isHandlingMimeForPasting(n.type)){s.paste(n,this.currentLayer);return}let r=i.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(n){ir(`paste: "${n.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const o=this.currentLayer;try{const n=[];for(const l of r){const c=await o.deserialize(l);if(!c)return;n.push(c)}const s=()=>{for(const l of n)ne(this,wi,NZ).call(this,l);ne(this,wi,UZ).call(this,n)},a=()=>{for(const l of n)l.remove()};this.addCommands({cmd:s,undo:a,mustExec:!0})}catch(n){ir(`paste: "${n.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),Q(this,Hs)!==$i.NONE&&!this.isEditorHandlingKeyboard&&ete._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,Q(this,k2)&&(oe(this,k2,!1),ne(this,wi,IR).call(this,"main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}setEditingState(e){e?(ne(this,wi,kEe).call(this),ne(this,wi,TZ).call(this),ne(this,wi,ll).call(this,{isEditing:Q(this,Hs)!==$i.NONE,isEmpty:ne(this,wi,$b).call(this),hasSomethingToUndo:Q(this,xu).hasSomethingToUndo(),hasSomethingToRedo:Q(this,xu).hasSomethingToRedo(),hasSelectedEditor:!1})):(ne(this,wi,MEe).call(this),ne(this,wi,FZ).call(this),ne(this,wi,ll).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!Q(this,GA)){oe(this,GA,e);for(const i of Q(this,GA))ne(this,wi,P1).call(this,i.defaultPropertiesToUpdate)}}getId(){return Q(this,DZ).id}get currentLayer(){return Q(this,ma).get(Q(this,Yb))}getLayer(e){return Q(this,ma).get(e)}get currentPageIndex(){return Q(this,Yb)}addLayer(e){Q(this,ma).set(e.pageIndex,e),Q(this,M2)?e.enable():e.disable()}removeLayer(e){Q(this,ma).delete(e.pageIndex)}async updateMode(e,i=null,r=!1){if(Q(this,Hs)!==e&&!(Q(this,ku)&&(await Q(this,ku).promise,!Q(this,ku)))){if(oe(this,ku,Promise.withResolvers()),oe(this,Hs,e),e===$i.NONE){this.setEditingState(!1),ne(this,wi,DEe).call(this),Q(this,ku).resolve();return}this.setEditingState(!0),await ne(this,wi,PEe).call(this),this.unselectAll();for(const o of Q(this,ma).values())o.updateMode(e);if(!i){r&&this.addNewEditorFromKeyboard(),Q(this,ku).resolve();return}for(const o of Q(this,bs).values())o.annotationElementId===i?(this.setSelected(o),o.enterInEditMode()):o.unselect();Q(this,ku).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==Q(this,Hs)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,i){var r;if(Q(this,GA)){switch(e){case Cr.CREATE:this.currentLayer.addNewEditor();return;case Cr.HIGHLIGHT_DEFAULT_COLOR:(r=Q(this,vR))==null||r.updateColor(i);break;case Cr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(Q(this,Xb)||oe(this,Xb,new Map)).set(e,i),this.showAllEditors("highlight",i);break}for(const o of Q(this,so))o.updateParams(e,i);for(const o of Q(this,GA))o.updateDefaultParams(e,i)}}showAllEditors(e,i,r=!1){var o;for(const n of Q(this,bs).values())n.editorType===e&&n.show(i);(((o=Q(this,Xb))==null?void 0:o.get(Cr.HIGHLIGHT_SHOW_ALL))??!0)!==i&&ne(this,wi,P1).call(this,[[Cr.HIGHLIGHT_SHOW_ALL,i]])}enableWaiting(e=!1){if(Q(this,mR)!==e){oe(this,mR,e);for(const i of Q(this,ma).values())e?i.disableClick():i.enableClick(),i.div.classList.toggle("waiting",e)}}getEditors(e){const i=[];for(const r of Q(this,bs).values())r.pageIndex===e&&i.push(r);return i}getEditor(e){return Q(this,bs).get(e)}addEditor(e){Q(this,bs).set(e.id,e)}removeEditor(e){var i;e.div.contains(document.activeElement)&&(Q(this,S1)&&clearTimeout(Q(this,S1)),oe(this,S1,setTimeout(()=>{this.focusMainContainer(),oe(this,S1,null)},0))),Q(this,bs).delete(e.id),this.unselect(e),(!e.annotationElementId||!Q(this,C9).has(e.annotationElementId))&&((i=Q(this,zp))==null||i.remove(e.id))}addDeletedAnnotationElement(e){Q(this,C9).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return Q(this,C9).has(e)}removeDeletedAnnotationElement(e){Q(this,C9).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){Q(this,wd)!==e&&(oe(this,wd,e),e&&ne(this,wi,P1).call(this,e.propertiesToUpdate))}updateUI(e){Q(this,wi,REe)===e&&ne(this,wi,P1).call(this,e.propertiesToUpdate)}updateUIForDefaultProperties(e){ne(this,wi,P1).call(this,e.defaultPropertiesToUpdate)}toggleSelected(e){if(Q(this,so).has(e)){Q(this,so).delete(e),e.unselect(),ne(this,wi,ll).call(this,{hasSelectedEditor:this.hasSelection});return}Q(this,so).add(e),e.select(),ne(this,wi,P1).call(this,e.propertiesToUpdate),ne(this,wi,ll).call(this,{hasSelectedEditor:!0})}setSelected(e){var i;(i=this.currentLayer)==null||i.commitOrRemove();for(const r of Q(this,so))r!==e&&r.unselect();Q(this,so).clear(),Q(this,so).add(e),e.select(),ne(this,wi,P1).call(this,e.propertiesToUpdate),ne(this,wi,ll).call(this,{hasSelectedEditor:!0})}isSelected(e){return Q(this,so).has(e)}get firstSelectedEditor(){return Q(this,so).values().next().value}unselect(e){e.unselect(),Q(this,so).delete(e),ne(this,wi,ll).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return Q(this,so).size!==0}get isEnterHandled(){return Q(this,so).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){Q(this,xu).undo(),ne(this,wi,ll).call(this,{hasSomethingToUndo:Q(this,xu).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:ne(this,wi,$b).call(this)})}redo(){Q(this,xu).redo(),ne(this,wi,ll).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:Q(this,xu).hasSomethingToRedo(),isEmpty:ne(this,wi,$b).call(this)})}addCommands(e){Q(this,xu).add(e),ne(this,wi,ll).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:ne(this,wi,$b).call(this)})}cleanUndoStack(e){Q(this,xu).cleanType(e)}delete(){var e;this.commitOrRemove();const i=(e=this.currentLayer)==null?void 0:e.endDrawingSession(!0);if(!this.hasSelection&&!i)return;const r=i?[i]:[...Q(this,so)],o=()=>{for(const s of r)s.remove()},n=()=>{for(const s of r)ne(this,wi,NZ).call(this,s)};this.addCommands({cmd:o,undo:n,mustExec:!0})}commitOrRemove(){var e;(e=Q(this,wd))==null||e.commitOrRemove()}hasSomethingToControl(){return Q(this,wd)||this.hasSelection}selectAll(){for(const e of Q(this,so))e.commit();ne(this,wi,UZ).call(this,Q(this,bs).values())}unselectAll(){var e;if(!(Q(this,wd)&&(Q(this,wd).commitOrRemove(),Q(this,Hs)!==$i.NONE))&&!((e=this.currentLayer)!=null&&e.commitOrRemove())&&this.hasSelection){for(const i of Q(this,so))i.unselect();Q(this,so).clear(),ne(this,wi,ll).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,i,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;Q(this,Q2)[0]+=e,Q(this,Q2)[1]+=i;const[o,n]=Q(this,Q2),s=[...Q(this,so)];Q(this,Q1)&&clearTimeout(Q(this,Q1)),oe(this,Q1,setTimeout(()=>{oe(this,Q1,null),Q(this,Q2)[0]=Q(this,Q2)[1]=0,this.addCommands({cmd:()=>{for(const l of s)Q(this,bs).has(l.id)&&l.translateInPage(o,n)},undo:()=>{for(const l of s)Q(this,bs).has(l.id)&&l.translateInPage(-o,-n)},mustExec:!1})},1e3));for(const l of s)l.translateInPage(e,i)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),oe(this,M1,new Map);for(const e of Q(this,so))Q(this,M1).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!Q(this,M1))return!1;this.disableUserSelect(!1);const e=Q(this,M1);oe(this,M1,null);let i=!1;for(const[{x:o,y:n,pageIndex:s},a]of e)a.newX=o,a.newY=n,a.newPageIndex=s,i||(i=o!==a.savedX||n!==a.savedY||s!==a.savedPageIndex);if(!i)return!1;const r=(o,n,s,a)=>{if(Q(this,bs).has(o.id)){const l=Q(this,ma).get(a);l?o._setParentAndPosition(l,n,s):(o.pageIndex=a,o.x=n,o.y=s)}};return this.addCommands({cmd:()=>{for(const[o,{newX:n,newY:s,newPageIndex:a}]of e)r(o,n,s,a)},undo:()=>{for(const[o,{savedX:n,savedY:s,savedPageIndex:a}]of e)r(o,n,s,a)},mustExec:!0}),!0}dragSelectedEditors(e,i){if(Q(this,M1))for(const r of Q(this,M1).keys())r.drag(e,i)}rebuild(e){if(e.parent===null){const i=this.getLayer(e.pageIndex);i?(i.changeParent(e),i.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){var e;return((e=this.getActive())==null?void 0:e.shouldGetKeyboardEvents())||Q(this,so).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return Q(this,wd)===e}getActive(){return Q(this,wd)}getMode(){return Q(this,Hs)}get imageManager(){return cr(this,"imageManager",new FTi)}getSelectionBoxes(e){if(!e)return null;const i=document.getSelection();for(let c=0,d=i.rangeCount;c<d;c++)if(!e.contains(i.getRangeAt(c).commonAncestorContainer))return null;const{x:r,y:o,width:n,height:s}=e.getBoundingClientRect();let a;switch(e.getAttribute("data-main-rotation")){case"90":a=(c,d,u,A)=>({x:(d-o)/s,y:1-(c+u-r)/n,width:A/s,height:u/n});break;case"180":a=(c,d,u,A)=>({x:1-(c+u-r)/n,y:1-(d+A-o)/s,width:u/n,height:A/s});break;case"270":a=(c,d,u,A)=>({x:1-(d+A-o)/s,y:(c-r)/n,width:A/s,height:u/n});break;default:a=(c,d,u,A)=>({x:(c-r)/n,y:(d-o)/s,width:u/n,height:A/s});break}const l=[];for(let c=0,d=i.rangeCount;c<d;c++){const u=i.getRangeAt(c);if(!u.collapsed)for(const{x:A,y:h,width:g,height:p}of u.getClientRects())g===0||p===0||l.push(a(A,h,g,p))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:i}){(Q(this,v9)||oe(this,v9,new Map)).set(e,i)}removeChangedExistingAnnotation({annotationElementId:e}){var i;(i=Q(this,v9))==null||i.delete(e)}renderAnnotationElement(e){var i;const r=(i=Q(this,v9))==null?void 0:i.get(e.data.id);if(!r)return;const o=Q(this,zp).getRawValue(r);o&&(Q(this,Hs)===$i.NONE&&!o.hasBeenModified||o.renderAnnotationElement(e))}};Kb=new WeakMap,wd=new WeakMap,bs=new WeakMap,ma=new WeakMap,Jb=new WeakMap,zp=new WeakMap,v9=new WeakMap,xu=new WeakMap,E2=new WeakMap,Yb=new WeakMap,C9=new WeakMap,M1=new WeakMap,GA=new WeakMap,y9=new WeakMap,pR=new WeakMap,gR=new WeakMap,Wb=new WeakMap,fR=new WeakMap,S1=new WeakMap,x2=new WeakMap,Zb=new WeakMap,k2=new WeakMap,jA=new WeakMap,DZ=new WeakMap,M2=new WeakMap,mR=new WeakMap,S2=new WeakMap,w9=new WeakMap,vR=new WeakMap,CR=new WeakMap,Hs=new WeakMap,so=new WeakMap,Kp=new WeakMap,b9=new WeakMap,Xb=new WeakMap,yR=new WeakMap,Q2=new WeakMap,Q1=new WeakMap,Jp=new WeakMap,wR=new WeakMap,ku=new WeakMap,wi=new WeakSet,bR=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},RZ=function(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of Q(this,ma).values())if(i.hasTextLayer(t))return i;return null},BEe=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=ne(this,wi,bR).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(Q(this,jA)||oe(this,jA,new LTi(this)),Q(this,jA).show(e,i,this.direction==="ltr"))},EEe=function(){var t,e,i;const r=document.getSelection();if(!r||r.isCollapsed){Q(this,Kp)&&((t=Q(this,jA))==null||t.hide(),oe(this,Kp,null),ne(this,wi,ll).call(this,{hasSelectedText:!1}));return}const{anchorNode:o}=r;if(o===Q(this,Kp))return;const n=ne(this,wi,bR).call(this,r).closest(".textLayer");if(!n){Q(this,Kp)&&((e=Q(this,jA))==null||e.hide(),oe(this,Kp,null),ne(this,wi,ll).call(this,{hasSelectedText:!1}));return}if((i=Q(this,jA))==null||i.hide(),oe(this,Kp,o),ne(this,wi,ll).call(this,{hasSelectedText:!0}),!(Q(this,Hs)!==$i.HIGHLIGHT&&Q(this,Hs)!==$i.NONE)&&(Q(this,Hs)===$i.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),oe(this,k2,this.isShiftKeyDown),!this.isShiftKeyDown)){const s=Q(this,Hs)===$i.HIGHLIGHT?ne(this,wi,RZ).call(this,n):null;s?.toggleDrawing();const a=new AbortController,l=this.combinedSignal(a),c=d=>{d.type==="pointerup"&&d.button!==0||(a.abort(),s?.toggleDrawing(!0),d.type==="pointerup"&&ne(this,wi,IR).call(this,"main_toolbar"))};window.addEventListener("pointerup",c,{signal:l}),window.addEventListener("blur",c,{signal:l})}},IR=function(t=""){Q(this,Hs)===$i.HIGHLIGHT?this.highlightSelection(t):Q(this,pR)&&ne(this,wi,BEe).call(this)},xEe=function(){document.addEventListener("selectionchange",ne(this,wi,EEe).bind(this),{signal:this._signal})},kEe=function(){if(Q(this,x2))return;oe(this,x2,new AbortController);const t=this.combinedSignal(Q(this,x2));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},MEe=function(){var t;(t=Q(this,x2))==null||t.abort(),oe(this,x2,null)},LZ=function(){if(Q(this,S2))return;oe(this,S2,new AbortController);const t=this.combinedSignal(Q(this,S2));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},SEe=function(){var t;(t=Q(this,S2))==null||t.abort(),oe(this,S2,null)},TZ=function(){if(Q(this,E2))return;oe(this,E2,new AbortController);const t=this.combinedSignal(Q(this,E2));document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})},FZ=function(){var t;(t=Q(this,E2))==null||t.abort(),oe(this,E2,null)},QEe=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},ll=function(t){Object.entries(t).some(([e,i])=>Q(this,yR)[e]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(Q(this,yR),t)}),Q(this,Hs)===$i.HIGHLIGHT&&t.hasSelectedEditor===!1&&ne(this,wi,P1).call(this,[[Cr.HIGHLIGHT_FREE,!0]]))},P1=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},PEe=async function(){if(!Q(this,M2)){oe(this,M2,!0);const t=[];for(const e of Q(this,ma).values())t.push(e.enable());await Promise.all(t);for(const e of Q(this,bs).values())e.enable()}},DEe=function(){if(this.unselectAll(),Q(this,M2)){oe(this,M2,!1);for(const t of Q(this,ma).values())t.disable();for(const t of Q(this,bs).values())t.disable()}},NZ=function(t){const e=Q(this,ma).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},REe=function(){let t=null;for(t of Q(this,so));return t},$b=function(){if(Q(this,bs).size===0)return!0;if(Q(this,bs).size===1)for(const t of Q(this,bs).values())return t.isEmpty();return!1},UZ=function(t){for(const e of Q(this,so))e.unselect();Q(this,so).clear();for(const e of t)e.isEmpty()||(Q(this,so).add(e),e.select());ne(this,wi,ll).call(this,{hasSelectedEditor:this.hasSelection})},ii(_Z,"TRANSLATE_SMALL",1),ii(_Z,"TRANSLATE_BIG",10);let eI=_Z;var Gs,D1,VA,tI,R1,bd,iI,L1,Tc,Yp,I9,T1,Wp,F1,rI,BR;const oI=class Hg{constructor(e){Ae(this,F1),Ae(this,Gs,null),Ae(this,D1,!1),Ae(this,VA,null),Ae(this,tI,null),Ae(this,R1,null),Ae(this,bd,null),Ae(this,iI,!1),Ae(this,L1,null),Ae(this,Tc,null),Ae(this,Yp,null),Ae(this,I9,null),Ae(this,T1,!1),oe(this,Tc,e),oe(this,T1,e._uiManager.useNewAltTextFlow),Q(Hg,Wp)||oe(Hg,Wp,Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(e){Hg._l10n??(Hg._l10n=e)}async render(){const e=oe(this,VA,document.createElement("button"));e.className="altText",e.tabIndex="0";const i=oe(this,tI,document.createElement("span"));e.append(i),Q(this,T1)?(e.classList.add("new"),e.setAttribute("data-l10n-id",Q(Hg,Wp).missing),i.setAttribute("data-l10n-id",Q(Hg,Wp)["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=Q(this,Tc)._uiManager._signal;e.addEventListener("contextmenu",Bu,{signal:r}),e.addEventListener("pointerdown",n=>n.stopPropagation(),{signal:r});const o=n=>{n.preventDefault(),Q(this,Tc)._uiManager.editAltText(Q(this,Tc)),Q(this,T1)&&Q(this,Tc)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:Q(this,F1,rI)}})};return e.addEventListener("click",o,{capture:!0,signal:r}),e.addEventListener("keydown",n=>{n.target===e&&n.key==="Enter"&&(oe(this,iI,!0),o(n))},{signal:r}),await ne(this,F1,BR).call(this),e}finish(){Q(this,VA)&&(Q(this,VA).focus({focusVisible:Q(this,iI)}),oe(this,iI,!1))}isEmpty(){return Q(this,T1)?Q(this,Gs)===null:!Q(this,Gs)&&!Q(this,D1)}hasData(){return Q(this,T1)?Q(this,Gs)!==null||!!Q(this,Yp):this.isEmpty()}get guessedText(){return Q(this,Yp)}async setGuessedText(e){Q(this,Gs)===null&&(oe(this,Yp,e),oe(this,I9,await Hg._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),ne(this,F1,BR).call(this))}toggleAltTextBadge(e=!1){var i;if(!Q(this,T1)||Q(this,Gs)){(i=Q(this,L1))==null||i.remove(),oe(this,L1,null);return}if(!Q(this,L1)){const r=oe(this,L1,document.createElement("div"));r.className="noAltTextBadge",Q(this,Tc).div.append(r)}Q(this,L1).classList.toggle("hidden",!e)}serialize(e){let i=Q(this,Gs);return!e&&Q(this,Yp)===i&&(i=Q(this,I9)),{altText:i,decorative:Q(this,D1),guessedText:Q(this,Yp),textWithDisclaimer:Q(this,I9)}}get data(){return{altText:Q(this,Gs),decorative:Q(this,D1)}}set data({altText:e,decorative:i,guessedText:r,textWithDisclaimer:o,cancel:n=!1}){r&&(oe(this,Yp,r),oe(this,I9,o)),!(Q(this,Gs)===e&&Q(this,D1)===i)&&(n||(oe(this,Gs,e),oe(this,D1,i)),ne(this,F1,BR).call(this))}toggle(e=!1){Q(this,VA)&&(!e&&Q(this,bd)&&(clearTimeout(Q(this,bd)),oe(this,bd,null)),Q(this,VA).disabled=!e)}shown(){Q(this,Tc)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:Q(this,F1,rI)}})}destroy(){var e,i;(e=Q(this,VA))==null||e.remove(),oe(this,VA,null),oe(this,tI,null),oe(this,R1,null),(i=Q(this,L1))==null||i.remove(),oe(this,L1,null)}};Gs=new WeakMap,D1=new WeakMap,VA=new WeakMap,tI=new WeakMap,R1=new WeakMap,bd=new WeakMap,iI=new WeakMap,L1=new WeakMap,Tc=new WeakMap,Yp=new WeakMap,I9=new WeakMap,T1=new WeakMap,Wp=new WeakMap,F1=new WeakSet,rI=function(){return Q(this,Gs)&&"added"||Q(this,Gs)===null&&this.guessedText&&"review"||"missing"},BR=async function(){var t,e,i;const r=Q(this,VA);if(!r)return;if(Q(this,T1)){if(r.classList.toggle("done",!!Q(this,Gs)),r.setAttribute("data-l10n-id",Q(oI,Wp)[Q(this,F1,rI)]),(t=Q(this,tI))==null||t.setAttribute("data-l10n-id",Q(oI,Wp)[`${Q(this,F1,rI)}-label`]),!Q(this,Gs)){(e=Q(this,R1))==null||e.remove();return}}else{if(!Q(this,Gs)&&!Q(this,D1)){r.classList.remove("done"),(i=Q(this,R1))==null||i.remove();return}r.classList.add("done"),r.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let o=Q(this,R1);if(!o){oe(this,R1,o=document.createElement("span")),o.className="tooltip",o.setAttribute("role","tooltip"),o.id=`alt-text-tooltip-${Q(this,Tc).id}`;const s=100,a=Q(this,Tc)._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(Q(this,bd)),oe(this,bd,null)},{once:!0}),r.addEventListener("mouseenter",()=>{oe(this,bd,setTimeout(()=>{oe(this,bd,null),Q(this,R1).classList.add("show"),Q(this,Tc)._reportTelemetry({action:"alt_text_tooltip"})},s))},{signal:a}),r.addEventListener("mouseleave",()=>{var l;Q(this,bd)&&(clearTimeout(Q(this,bd)),oe(this,bd,null)),(l=Q(this,R1))==null||l.classList.remove("show")},{signal:a})}Q(this,D1)?o.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(o.removeAttribute("data-l10n-id"),o.textContent=Q(this,Gs)),o.parentNode||r.append(o);const n=Q(this,Tc).getImageForAltText();n?.setAttribute("aria-describedby",o.id)},Ae(oI,Wp,null),ii(oI,"_l10n",null);let LEe=oI;var B9,qA,An,nI,P2,ER,E9,va,x9,D2,R2,xR,k9,N1,kR,M9,Zp,U1,sI,aI,Id,MR,OZ,ao,HZ,SR,GZ,jZ,TEe,FEe,VZ,qZ,zZ,KZ,NEe,JZ,UEe,_Ee,OEe,YZ,lI;const Mu=class ea{constructor(e){Ae(this,ao),Ae(this,B9,null),Ae(this,qA,null),Ae(this,An,null),Ae(this,nI,!1),Ae(this,P2,null),Ae(this,ER,""),Ae(this,E9,!1),Ae(this,va,null),Ae(this,x9,null),Ae(this,D2,null),Ae(this,R2,null),Ae(this,xR,""),Ae(this,k9,!1),Ae(this,N1,null),Ae(this,kR,!1),Ae(this,M9,!1),Ae(this,Zp,!1),Ae(this,U1,null),Ae(this,sI,0),Ae(this,aI,0),Ae(this,Id,null),ii(this,"_editToolbar",null),ii(this,"_initialOptions",Object.create(null)),ii(this,"_initialData",null),ii(this,"_isVisible",!0),ii(this,"_uiManager",null),ii(this,"_focusEventsAllowed",!0),Ae(this,MR,!1),Ae(this,OZ,ea._zIndex++),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:i,rawDims:{pageWidth:r,pageHeight:o,pageX:n,pageY:s}}=this.parent.viewport;this.rotation=i,this.pageRotation=(360+i-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,o],this.pageTranslation=[n,s];const[a,l]=this.parentDimensions;this.x=e.x/a,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const e=ea.prototype._resizeWithKeyboard,i=eI.TRANSLATE_SMALL,r=eI.TRANSLATE_BIG;return cr(this,"_resizerKeyboardManager",new zb([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-i,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[i,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-i]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,i]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],ea.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get isDrawer(){return!1}static get _defaultLineColor(){return cr(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const i=new _Ti({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});i.annotationElementId=e.annotationElementId,i.deleted=!0,i._uiManager.addToAnnotationStorage(i)}static initialize(e,i){if(ea._l10n??(ea._l10n=e),ea._l10nResizer||(ea._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),ea._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);ea._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,i){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,i){no("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return Q(this,MR)}set _isDraggable(e){var i;oe(this,MR,e),(i=this.div)==null||i.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,i]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*i/(e*2),this.y+=this.width*e/(i*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*i/(e*2),this.y-=this.width*e/(i*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=Q(this,OZ)}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):ne(this,ao,lI).call(this),this.parent=e}focusin(e){this._focusEventsAllowed&&(Q(this,k9)?oe(this,k9,!1):this.parent.setSelected(this))}focusout(e){var i;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const r=e.relatedTarget;r!=null&&r.closest(`#${this.id}`)||(e.preventDefault(),(i=this.parent)!=null&&i.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,i,r,o){const[n,s]=this.parentDimensions;[r,o]=this.screenToPageTranslation(r,o),this.x=(e+r)/n,this.y=(i+o)/s,this.fixAndSetPosition()}translate(e,i){ne(this,ao,HZ).call(this,this.parentDimensions,e,i)}translateInPage(e,i){Q(this,N1)||oe(this,N1,[this.x,this.y]),ne(this,ao,HZ).call(this,this.pageDimensions,e,i),this.div.scrollIntoView({block:"nearest"})}drag(e,i){Q(this,N1)||oe(this,N1,[this.x,this.y]);const{div:r,parentDimensions:[o,n]}=this;if(this.x+=e/o,this.y+=i/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:A}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,A)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:a}=this;const[l,c]=this.getBaseTranslation();s+=l,a+=c;const{style:d}=r;d.left=`${(100*s).toFixed(2)}%`,d.top=`${(100*a).toFixed(2)}%`,this._onTranslating(s,a),r.scrollIntoView({block:"nearest"})}_onTranslating(e,i){}_onTranslated(e,i){}get _hasBeenMoved(){return!!Q(this,N1)&&(Q(this,N1)[0]!==this.x||Q(this,N1)[1]!==this.y)}getBaseTranslation(){const[e,i]=this.parentDimensions,{_borderLineWidth:r}=ea,o=r/e,n=r/i;switch(this.rotation){case 90:return[-o,n];case 180:return[o,n];case 270:return[o,-n];default:return[-o,-n]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:i},pageDimensions:[r,o]}=this;let{x:n,y:s,width:a,height:l}=this;if(a*=r,l*=o,n*=r,s*=o,this._mustFixPosition)switch(e){case 0:n=Math.max(0,Math.min(r-a,n)),s=Math.max(0,Math.min(o-l,s));break;case 90:n=Math.max(0,Math.min(r-l,n)),s=Math.min(o,Math.max(a,s));break;case 180:n=Math.min(r,Math.max(a,n)),s=Math.min(o,Math.max(l,s));break;case 270:n=Math.min(r,Math.max(l,n)),s=Math.max(0,Math.min(o-a,s));break}this.x=n/=r,this.y=s/=o;const[c,d]=this.getBaseTranslation();n+=c,s+=d,i.left=`${(100*n).toFixed(2)}%`,i.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,i){var r;return ne(r=ea,SR,GZ).call(r,e,i,this.parentRotation)}pageTranslationToScreen(e,i){var r;return ne(r=ea,SR,GZ).call(r,e,i,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[i,r]}=this;return[i*e,r*e]}setDims(e,i){const[r,o]=this.parentDimensions,{style:n}=this.div;n.width=`${(100*e/r).toFixed(2)}%`,Q(this,E9)||(n.height=`${(100*i/o).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:i,width:r}=e,o=r.endsWith("%"),n=!Q(this,E9)&&i.endsWith("%");if(o&&n)return;const[s,a]=this.parentDimensions;o||(e.width=`${(100*parseFloat(r)/s).toFixed(2)}%`),!Q(this,E9)&&!n&&(e.height=`${(100*parseFloat(i)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}_onResized(){}_onResizing(){}altTextFinish(){var e;(e=Q(this,An))==null||e.finish()}async addEditToolbar(){return this._editToolbar||Q(this,M9)?this._editToolbar:(this._editToolbar=new RTi(this),this.div.append(this._editToolbar.render()),Q(this,An)&&await this._editToolbar.addAltText(Q(this,An)),this._editToolbar)}removeEditToolbar(){var e;this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,(e=Q(this,An))==null||e.destroy())}addContainer(e){var i;const r=(i=this._editToolbar)==null?void 0:i.div;r?r.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){Q(this,An)||(LEe.initialize(ea._l10n),oe(this,An,new LEe(this)),Q(this,B9)&&(Q(this,An).data=Q(this,B9),oe(this,B9,null)),await this.addEditToolbar())}get altTextData(){var e;return(e=Q(this,An))==null?void 0:e.data}set altTextData(e){Q(this,An)&&(Q(this,An).data=e)}get guessedAltText(){var e;return(e=Q(this,An))==null?void 0:e.guessedText}async setGuessedAltText(e){var i;await((i=Q(this,An))==null?void 0:i.setGuessedText(e))}serializeAltText(e){var i;return(i=Q(this,An))==null?void 0:i.serialize(e)}hasAltText(){return!!Q(this,An)&&!Q(this,An).isEmpty()}hasAltTextData(){var e;return((e=Q(this,An))==null?void 0:e.hasData())??!1}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=Q(this,nI)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),ne(this,ao,JZ).call(this);const[e,i]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*i/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/i).toFixed(2)}%`);const[r,o]=this.getInitialTranslation();return this.translate(r,o),dR(this,this.div,["pointerdown"]),this.div}pointerdown(e){const{isMac:i}=al.platform;if(e.button!==0||e.ctrlKey&&i){e.preventDefault();return}if(oe(this,k9,!0),this._isDraggable){ne(this,ao,NEe).call(this,e);return}ne(this,ao,KZ).call(this,e)}get isSelected(){return this._uiManager.isSelected(this)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){Q(this,U1)&&clearTimeout(Q(this,U1)),oe(this,U1,setTimeout(()=>{var e;oe(this,U1,null),(e=this.parent)==null||e.moveEditorInDOM(this)},0))}_setParentAndPosition(e,i,r){e.changeParent(this),this.x=i,this.y=r,this.fixAndSetPosition(),this._onTranslated()}getRect(e,i,r=this.rotation){const o=this.parentScale,[n,s]=this.pageDimensions,[a,l]=this.pageTranslation,c=e/o,d=i/o,u=this.x*n,A=this.y*s,h=this.width*n,g=this.height*s;switch(r){case 0:return[u+c+a,s-A-d-g+l,u+c+h+a,s-A-d+l];case 90:return[u+d+a,s-A+c+l,u+d+g+a,s-A+c+h+l];case 180:return[u-c-h+a,s-A+d+l,u-c+a,s-A+d+g+l];case 270:return[u-d-g+a,s-A-c-h+l,u-d+a,s-A-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,i){const[r,o,n,s]=e,a=n-r,l=s-o;switch(this.rotation){case 0:return[r,i-s,a,l];case 90:return[r,i-o,l,a];case 180:return[n,i-o,a,l];case 270:return[n,i-s,l,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){oe(this,M9,!0)}disableEditMode(){oe(this,M9,!1)}isInEditMode(){return Q(this,M9)}shouldGetKeyboardEvents(){return Q(this,Zp)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){ne(this,ao,JZ).call(this)}rotate(e){}resize(){}serializeDeleted(){var e;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:((e=this._initialData)==null?void 0:e.popupRef)||""}}serialize(e=!1,i=null){no("An editor must be serializable")}static async deserialize(e,i,r){const o=new this.prototype.constructor({parent:i,id:i.getNextId(),uiManager:r});o.rotation=e.rotation,oe(o,B9,e.accessibilityData);const[n,s]=o.pageDimensions,[a,l,c,d]=o.getRectInCurrentCoords(e.rect,s);return o.x=a/n,o.y=l/s,o.width=c/n,o.height=d/s,o}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var e;if((e=Q(this,R2))==null||e.abort(),oe(this,R2,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),Q(this,U1)&&(clearTimeout(Q(this,U1)),oe(this,U1,null)),ne(this,ao,lI).call(this),this.removeEditToolbar(),Q(this,Id)){for(const i of Q(this,Id).values())clearTimeout(i);oe(this,Id,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(ne(this,ao,TEe).call(this),Q(this,va).classList.remove("hidden"),dR(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),oe(this,D2,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const i=Q(this,va).children;if(!Q(this,qA)){oe(this,qA,Array.from(i));const s=ne(this,ao,UEe).bind(this),a=ne(this,ao,_Ee).bind(this),l=this._uiManager._signal;for(const c of Q(this,qA)){const d=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",s,{signal:l}),c.addEventListener("blur",a,{signal:l}),c.addEventListener("focus",ne(this,ao,OEe).bind(this,d),{signal:l}),c.setAttribute("data-l10n-id",ea._l10nResizer[d])}}const r=Q(this,qA)[0];let o=0;for(const s of i){if(s===r)break;o++}const n=(360-this.rotation+this.parentRotation)%360/90*(Q(this,qA).length/4);if(n!==o){if(n<o)for(let a=0;a<o-n;a++)Q(this,va).append(Q(this,va).firstChild);else if(n>o)for(let a=0;a<n-o;a++)Q(this,va).firstChild.before(Q(this,va).lastChild);let s=0;for(const a of i){const l=Q(this,qA)[s++].getAttribute("data-resizer-name");a.setAttribute("data-l10n-id",ea._l10nResizer[l])}}ne(this,ao,YZ).call(this,0),oe(this,Zp,!0),Q(this,va).firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,i){Q(this,Zp)&&ne(this,ao,zZ).call(this,Q(this,xR),{deltaX:e,deltaY:i,fromKeyboard:!0})}_stopResizingWithKeyboard(){ne(this,ao,lI).call(this),this.div.focus()}select(){var e,i,r;if(this.makeResizable(),(e=this.div)==null||e.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var o,n;(o=this.div)!=null&&o.classList.contains("selectedEditor")&&((n=this._editToolbar)==null||n.show())});return}(i=this._editToolbar)==null||i.show(),(r=Q(this,An))==null||r.toggleAltTextBadge(!1)}unselect(){var e,i,r,o,n;(e=Q(this,va))==null||e.classList.add("hidden"),(i=this.div)==null||i.classList.remove("selectedEditor"),(r=this.div)!=null&&r.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(o=this._editToolbar)==null||o.hide(),(n=Q(this,An))==null||n.toggleAltTextBadge(!0)}updateParams(e,i){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return Q(this,kR)}set isEditing(e){oe(this,kR,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,i){oe(this,E9,!0);const r=e/i,{style:o}=this.div;o.aspectRatio=r,o.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,i=!1){if(i){Q(this,Id)||oe(this,Id,new Map);const{action:r}=e;let o=Q(this,Id).get(r);o&&clearTimeout(o),o=setTimeout(()=>{this._reportTelemetry(e),Q(this,Id).delete(r),Q(this,Id).size===0&&oe(this,Id,null)},ea._telemetryTimeout),Q(this,Id).set(r,o);return}e.type||(e.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),oe(this,nI,!1)}disable(){this.div&&(this.div.tabIndex=-1),oe(this,nI,!0)}renderAnnotationElement(e){let i=e.container.querySelector(".annotationContent");if(!i)i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),e.container.prepend(i);else if(i.nodeName==="CANVAS"){const r=i;i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),r.before(i)}return i}resetAnnotationElement(e){const{firstChild:i}=e.container;i?.nodeName==="DIV"&&i.classList.contains("annotationContent")&&i.remove()}};B9=new WeakMap,qA=new WeakMap,An=new WeakMap,nI=new WeakMap,P2=new WeakMap,ER=new WeakMap,E9=new WeakMap,va=new WeakMap,x9=new WeakMap,D2=new WeakMap,R2=new WeakMap,xR=new WeakMap,k9=new WeakMap,N1=new WeakMap,kR=new WeakMap,M9=new WeakMap,Zp=new WeakMap,U1=new WeakMap,sI=new WeakMap,aI=new WeakMap,Id=new WeakMap,MR=new WeakMap,OZ=new WeakMap,ao=new WeakSet,HZ=function([t,e],i,r){[i,r]=this.screenToPageTranslation(i,r),this.x+=i/t,this.y+=r/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},SR=new WeakSet,GZ=function(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}},jZ=function(t){switch(t){case 90:{const[e,i]=this.pageDimensions;return[0,-e/i,i/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,i]=this.pageDimensions;return[0,e/i,-i/e,0]}default:return[1,0,0,1]}},TEe=function(){if(Q(this,va))return;oe(this,va,document.createElement("div")),Q(this,va).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const r=document.createElement("div");Q(this,va).append(r),r.classList.add("resizer",i),r.setAttribute("data-resizer-name",i),r.addEventListener("pointerdown",ne(this,ao,FEe).bind(this,i),{signal:e}),r.addEventListener("contextmenu",Bu,{signal:e}),r.tabIndex=-1}this.div.prepend(Q(this,va))},FEe=function(t,e){var i;e.preventDefault();const{isMac:r}=al.platform;if(e.button!==0||e.ctrlKey&&r)return;(i=Q(this,An))==null||i.toggle(!1);const o=this._isDraggable;this._isDraggable=!1,oe(this,x9,[e.screenX,e.screenY]);const n=new AbortController,s=this._uiManager.combinedSignal(n);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",ne(this,ao,zZ).bind(this,t),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",Eu,{passive:!1,signal:s}),window.addEventListener("contextmenu",Bu,{signal:s}),oe(this,D2,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const a=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const c=()=>{var d;n.abort(),this.parent.togglePointerEvents(!0),(d=Q(this,An))==null||d.toggle(!0),this._isDraggable=o,this.parent.div.style.cursor=a,this.div.style.cursor=l,ne(this,ao,qZ).call(this)};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})},VZ=function(t,e,i,r){this.width=i,this.height=r,this.x=t,this.y=e;const[o,n]=this.parentDimensions;this.setDims(o*i,n*r),this.fixAndSetPosition(),this._onResized()},qZ=function(){if(!Q(this,D2))return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:r}=Q(this,D2);oe(this,D2,null);const o=this.x,n=this.y,s=this.width,a=this.height;o===t&&n===e&&s===i&&a===r||this.addCommands({cmd:ne(this,ao,VZ).bind(this,o,n,s,a),undo:ne(this,ao,VZ).bind(this,t,e,i,r),mustExec:!0})},zZ=function(t,e){const[i,r]=this.parentDimensions,o=this.x,n=this.y,s=this.width,a=this.height,l=Mu.MIN_SIZE/i,c=Mu.MIN_SIZE/r,d=N=>Math.round(N*1e4)/1e4,u=ne(this,ao,jZ).call(this,this.rotation),A=(N,H)=>[u[0]*N+u[2]*H,u[1]*N+u[3]*H],h=ne(this,ao,jZ).call(this,360-this.rotation),g=(N,H)=>[h[0]*N+h[2]*H,h[1]*N+h[3]*H];let p,m,f=!1,v=!1;switch(t){case"topLeft":f=!0,p=(N,H)=>[0,0],m=(N,H)=>[N,H];break;case"topMiddle":p=(N,H)=>[N/2,0],m=(N,H)=>[N/2,H];break;case"topRight":f=!0,p=(N,H)=>[N,0],m=(N,H)=>[0,H];break;case"middleRight":v=!0,p=(N,H)=>[N,H/2],m=(N,H)=>[0,H/2];break;case"bottomRight":f=!0,p=(N,H)=>[N,H],m=(N,H)=>[0,0];break;case"bottomMiddle":p=(N,H)=>[N/2,H],m=(N,H)=>[N/2,0];break;case"bottomLeft":f=!0,p=(N,H)=>[0,H],m=(N,H)=>[N,0];break;case"middleLeft":v=!0,p=(N,H)=>[0,H/2],m=(N,H)=>[N,H/2];break}const C=p(s,a),y=m(s,a);let w=A(...y);const b=d(o+w[0]),E=d(n+w[1]);let x=1,M=1,k,S;if(e.fromKeyboard)({deltaX:k,deltaY:S}=e);else{const{screenX:N,screenY:H}=e,[Y,re]=Q(this,x9);[k,S]=this.screenToPageTranslation(N-Y,H-re),Q(this,x9)[0]=N,Q(this,x9)[1]=H}if([k,S]=g(k/i,S/r),f){const N=Math.hypot(s,a);x=M=Math.max(Math.min(Math.hypot(y[0]-C[0]-k,y[1]-C[1]-S)/N,1/s,1/a),l/s,c/a)}else v?x=Math.max(l,Math.min(1,Math.abs(y[0]-C[0]-k)))/s:M=Math.max(c,Math.min(1,Math.abs(y[1]-C[1]-S)))/a;const D=d(s*x),T=d(a*M);w=A(...m(D,T));const U=b-w[0],G=E-w[1];this.width=D,this.height=T,this.x=U,this.y=G,this.setDims(i*D,r*T),this.fixAndSetPosition(),this._onResizing()},KZ=function(t){const{isMac:e}=al.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},NEe=function(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();const i=new AbortController,r=this._uiManager.combinedSignal(i),o={capture:!0,passive:!1,signal:r},n=a=>{i.abort(),oe(this,P2,null),oe(this,k9,!1),this._uiManager.endDragSession()||ne(this,ao,KZ).call(this,a)};e&&(oe(this,sI,t.clientX),oe(this,aI,t.clientY),oe(this,P2,t.pointerId),oe(this,ER,t.pointerType),window.addEventListener("pointermove",a=>{const{clientX:l,clientY:c,pointerId:d}=a;if(d!==Q(this,P2)){Eu(a);return}const[u,A]=this.screenToPageTranslation(l-Q(this,sI),c-Q(this,aI));oe(this,sI,l),oe(this,aI,c),this._uiManager.dragSelectedEditors(u,A)},o),window.addEventListener("touchmove",Eu,o),window.addEventListener("pointerdown",a=>{a.isPrimary&&a.pointerType===Q(this,ER)&&n(a),Eu(a)},o)),this._onStartDragging();const s=a=>{if(!Q(this,P2)||Q(this,P2)===a.pointerId){n(a),this._onStopDragging();return}Eu(a)};window.addEventListener("pointerup",s,{signal:r}),window.addEventListener("blur",s,{signal:r})},JZ=function(){if(Q(this,R2)||!this.div)return;oe(this,R2,new AbortController);const t=this._uiManager.combinedSignal(Q(this,R2));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},UEe=function(t){Mu._resizerKeyboardManager.exec(this,t)},_Ee=function(t){var e;Q(this,Zp)&&((e=t.relatedTarget)==null?void 0:e.parentNode)!==Q(this,va)&&ne(this,ao,lI).call(this)},OEe=function(t){oe(this,xR,Q(this,Zp)?t:"")},YZ=function(t){if(Q(this,qA))for(const e of Q(this,qA))e.tabIndex=t},lI=function(){oe(this,Zp,!1),ne(this,ao,YZ).call(this,-1),ne(this,ao,qZ).call(this)},Ae(Mu,SR),ii(Mu,"_l10n",null),ii(Mu,"_l10nResizer",null),ii(Mu,"_borderLineWidth",-1),ii(Mu,"_colorManager",new UTi),ii(Mu,"_zIndex",1),ii(Mu,"_telemetryTimeout",1e3);let Rn=Mu;class _Ti extends Rn{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const HEe=3285377520,Bd=4294901760,zA=65535;let GEe=class{constructor(t){this.h1=t?t&4294967295:HEe,this.h2=t?t&4294967295:HEe}update(t){let e,i;if(typeof t=="string"){e=new Uint8Array(t.length*2),i=0;for(let g=0,p=t.length;g<p;g++){const m=t.charCodeAt(g);m<=255?e[i++]=m:(e[i++]=m>>>8,e[i++]=m&255)}}else if(ArrayBuffer.isView(t))e=t.slice(),i=e.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const r=i>>2,o=i-r*4,n=new Uint32Array(e.buffer,0,r);let s=0,a=0,l=this.h1,c=this.h2;const d=3432918353,u=461845907,A=d&zA,h=u&zA;for(let g=0;g<r;g++)g&1?(s=n[g],s=s*d&Bd|s*A&zA,s=s<<15|s>>>17,s=s*u&Bd|s*h&zA,l^=s,l=l<<13|l>>>19,l=l*5+3864292196):(a=n[g],a=a*d&Bd|a*A&zA,a=a<<15|a>>>17,a=a*u&Bd|a*h&zA,c^=a,c=c<<13|c>>>19,c=c*5+3864292196);switch(s=0,o){case 3:s^=e[r*4+2]<<16;case 2:s^=e[r*4+1]<<8;case 1:s^=e[r*4],s=s*d&Bd|s*A&zA,s=s<<15|s>>>17,s=s*u&Bd|s*h&zA,r&1?l^=s:c^=s}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&Bd|t*36045&zA,e=e*4283543511&Bd|((e<<16|t>>>16)*2950163797&Bd)>>>16,t^=e>>>1,t=t*444984403&Bd|t*60499&zA,e=e*3301882366&Bd|((e<<16|t>>>16)*3120437893&Bd)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}};const WZ=Object.freeze({map:null,hash:"",transfer:void 0});var S9,Q9,js,ZZ,jEe;class XZ{constructor(){Ae(this,ZZ),Ae(this,S9,!1),Ae(this,Q9,null),Ae(this,js,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,i){const r=Q(this,js).get(e);return r===void 0?i:Object.assign(i,r)}getRawValue(e){return Q(this,js).get(e)}remove(e){if(Q(this,js).delete(e),Q(this,js).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const i of Q(this,js).values())if(i instanceof Rn)return;this.onAnnotationEditor(null)}}setValue(e,i){const r=Q(this,js).get(e);let o=!1;if(r!==void 0)for(const[n,s]of Object.entries(i))r[n]!==s&&(o=!0,r[n]=s);else o=!0,Q(this,js).set(e,i);o&&ne(this,ZZ,jEe).call(this),i instanceof Rn&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(i.constructor._type)}has(e){return Q(this,js).has(e)}getAll(){return Q(this,js).size>0?mZ(Q(this,js)):null}setAll(e){for(const[i,r]of Object.entries(e))this.setValue(i,r)}get size(){return Q(this,js).size}resetModified(){Q(this,S9)&&(oe(this,S9,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new VEe(this)}get serializable(){if(Q(this,js).size===0)return WZ;const e=new Map,i=new GEe,r=[],o=Object.create(null);let n=!1;for(const[s,a]of Q(this,js)){const l=a instanceof Rn?a.serialize(!1,o):a;l&&(e.set(s,l),i.update(`${s}:${JSON.stringify(l)}`),n||(n=!!l.bitmap))}if(n)for(const s of e.values())s.bitmap&&r.push(s.bitmap);return e.size>0?{map:e,hash:i.hexdigest(),transfer:r}:WZ}get editorStats(){let e=null;const i=new Map;for(const r of Q(this,js).values()){if(!(r instanceof Rn))continue;const o=r.telemetryFinalData;if(!o)continue;const{type:n}=o;i.has(n)||i.set(n,Object.getPrototypeOf(r).constructor),e||(e=Object.create(null));const s=e[n]||(e[n]=new Map);for(const[a,l]of Object.entries(o)){if(a==="type")continue;let c=s.get(a);c||(c=new Map,s.set(a,c));const d=c.get(l)??0;c.set(l,d+1)}}for(const[r,o]of i)e[r]=o.computeTelemetryFinalData(e[r]);return e}resetModifiedIds(){oe(this,Q9,null)}get modifiedIds(){if(Q(this,Q9))return Q(this,Q9);const e=[];for(const i of Q(this,js).values())!(i instanceof Rn)||!i.annotationElementId||!i.serialize()||e.push(i.annotationElementId);return oe(this,Q9,{ids:new Set(e),hash:e.join(",")})}}S9=new WeakMap,Q9=new WeakMap,js=new WeakMap,ZZ=new WeakSet,jEe=function(){Q(this,S9)||(oe(this,S9,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var QR;class VEe extends XZ{constructor(e){super(),Ae(this,QR);const{map:i,hash:r,transfer:o}=e.serializable,n=structuredClone(i,o?{transfer:o}:null);oe(this,QR,{map:n,hash:r,transfer:o})}get print(){no("Should not call PrintAnnotationStorage.print")}get serializable(){return Q(this,QR)}get modifiedIds(){return cr(this,"modifiedIds",{ids:new Set,hash:""})}}QR=new WeakMap;var cI;class OTi{constructor({ownerDocument:e=globalThis.document,styleElement:i=null}){Ae(this,cI,new Set),this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const i=this.styleElement.sheet;i.insertRule(e,i.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),Q(this,cI).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:i}){if(!(!e||Q(this,cI).has(e.loadedName))){if(Gn(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:r,src:o,style:n}=e,s=new FontFace(r,o,n);this.addNativeFontFace(s);try{await s.load(),Q(this,cI).add(r),i?.(e)}catch{ir(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(s)}return}no("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const r=e.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(o){throw ir(`Failed to load font '${r.family}': '${o}'.`),e.disableFontFace=!0,o}}return}const i=e.createFontFaceRule();if(i){if(this.insertRule(i),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const o=this._queueLoadingCallback(r);this._prepareFontLoadEvent(e,o)})}}get isFontLoadingAPISupported(){var e;const i=!!((e=this._document)!=null&&e.fonts);return cr(this,"isFontLoadingAPISupported",i)}get isSyncFontLoadingSupported(){let e=!1;return(sl||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),cr(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){function i(){for(Gn(!o.done,"completeRequest() cannot be called twice."),o.done=!0;r.length>0&&r[0].done;){const n=r.shift();setTimeout(n.callback,0)}}const{loadingRequests:r}=this,o={done:!1,complete:i,callback:e};return r.push(o),o}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return cr(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,i){function r(C,y){return C.charCodeAt(y)<<24|C.charCodeAt(y+1)<<16|C.charCodeAt(y+2)<<8|C.charCodeAt(y+3)&255}function o(C,y,w,b){const E=C.substring(0,y),x=C.substring(y+w);return E+b+x}let n,s;const a=this._document.createElement("canvas");a.width=1,a.height=1;const l=a.getContext("2d");let c=0;function d(C,y){if(++c>30){ir("Load test font never loaded."),y();return}if(l.font="30px "+C,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){y();return}setTimeout(d.bind(null,C,y))}const u=`lt${Date.now()}${this.loadTestFontId++}`;let A=this._loadTestFont;A=o(A,976,u.length,u);const h=16,g=1482184792;let p=r(A,h);for(n=0,s=u.length-3;n<s;n+=4)p=p-g+r(u,n)|0;n<u.length&&(p=p-g+r(u+"XXX",n)|0),A=o(A,h,4,bTi(p));const m=`url(data:font/opentype;base64,${btoa(A)});`,f=`@font-face {font-family:"${u}";src:${m}}`;this.insertRule(f);const v=this._document.createElement("div");v.style.visibility="hidden",v.style.width=v.style.height="10px",v.style.position="absolute",v.style.top=v.style.left="0px";for(const C of[e.loadedName,u]){const y=this._document.createElement("span");y.textContent="Hi",y.style.fontFamily=C,v.append(y)}this._document.body.append(v),d(u,()=>{v.remove(),i.complete()})}}cI=new WeakMap;class HTi{constructor(e,{disableFontFace:i=!1,inspectFont:r=null}){this.compiledGlyphs=Object.create(null);for(const o in e)this[o]=e[o];this.disableFontFace=i===!0,this._inspectFont=r}createNativeFontFace(){var e;if(!this.data||this.disableFontFace)return null;let i;if(!this.cssFontInfo)i=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),i=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return(e=this._inspectFont)==null||e.call(this,this),i}createFontFaceRule(){var e;if(!this.data||this.disableFontFace)return null;const i=`url(data:${this.mimetype};base64,${MTi(this.data)});`;let r;if(!this.cssFontInfo)r=`@font-face {font-family:"${this.loadedName}";src:${i}}`;else{let o=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(o+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),r=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${o}src:${i}}`}return(e=this._inspectFont)==null||e.call(this,this,i),r}getPathGenerator(e,i){if(this.compiledGlyphs[i]!==void 0)return this.compiledGlyphs[i];let r;try{r=e.get(this.loadedName+"_path_"+i)}catch(n){ir(`getPathGenerator - ignoring character: "${n}".`)}if(!Array.isArray(r)||r.length===0)return this.compiledGlyphs[i]=function(n,s){};const o=[];for(let n=0,s=r.length;n<s;)switch(r[n++]){case x1.BEZIER_CURVE_TO:{const[a,l,c,d,u,A]=r.slice(n,n+6);o.push(h=>h.bezierCurveTo(a,l,c,d,u,A)),n+=6}break;case x1.MOVE_TO:{const[a,l]=r.slice(n,n+2);o.push(c=>c.moveTo(a,l)),n+=2}break;case x1.LINE_TO:{const[a,l]=r.slice(n,n+2);o.push(c=>c.lineTo(a,l)),n+=2}break;case x1.QUADRATIC_CURVE_TO:{const[a,l,c,d]=r.slice(n,n+4);o.push(u=>u.quadraticCurveTo(a,l,c,d)),n+=4}break;case x1.RESTORE:o.push(a=>a.restore());break;case x1.SAVE:o.push(a=>a.save());break;case x1.SCALE:Gn(o.length===2,"Scale command is only valid at the third position.");break;case x1.TRANSFORM:{const[a,l,c,d,u,A]=r.slice(n,n+6);o.push(h=>h.transform(a,l,c,d,u,A)),n+=6}break;case x1.TRANSLATE:{const[a,l]=r.slice(n,n+2);o.push(c=>c.translate(a,l)),n+=2}break}return o.push(n=>n.closePath()),this.compiledGlyphs[i]=function(n,s){o[0](n),o[1](n),n.scale(s,-s);for(let a=2,l=o.length;a<l;a++)o[a](n)}}}var PR;class qEe{constructor({enableHWA:e=!1}){Ae(this,PR,!1),oe(this,PR,e)}create(e,i){if(e<=0||i<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(e,i);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!Q(this,PR)})}}reset(e,i,r){if(!e.canvas)throw new Error("Canvas is not specified");if(i<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=i,e.canvas.height=r}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,i){no("Abstract method `_createCanvas` called.")}}PR=new WeakMap;class GTi extends qEe{constructor({ownerDocument:e=globalThis.document,enableHWA:i=!1}){super({enableHWA:i}),this._document=e}_createCanvas(e,i){const r=this._document.createElement("canvas");return r.width=e,r.height=i,r}}class zEe{constructor({baseUrl:e=null,isCompressed:i=!0}){this.baseUrl=e,this.isCompressed=i}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const i=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(i).then(r=>({cMapData:r,isCompressed:this.isCompressed})).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)})}async _fetch(e){no("Abstract method `_fetch` called.")}}class KEe extends zEe{async _fetch(e){const i=await oR(e,this.isCompressed?"arraybuffer":"text");return i instanceof ArrayBuffer?new Uint8Array(i):iR(i)}}class JEe{addFilter(e){return"none"}addHCMFilter(e,i){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,i,r,o,n){return"none"}destroy(e=!1){}}var P9,D9,Xp,$p,cl,L2,R9,bi,Ca,dI,L9,DR,T9,YEe,$Z,F9,uI,AI,eX,hI;class jTi extends JEe{constructor({docId:e,ownerDocument:i=globalThis.document}){super(),Ae(this,bi),Ae(this,P9),Ae(this,D9),Ae(this,Xp),Ae(this,$p),Ae(this,cl),Ae(this,L2),Ae(this,R9,0),oe(this,$p,e),oe(this,cl,i)}addFilter(e){if(!e)return"none";let i=Q(this,bi,Ca).get(e);if(i)return i;const[r,o,n]=ne(this,bi,DR).call(this,e),s=e.length===1?r:`${r}${o}${n}`;if(i=Q(this,bi,Ca).get(s),i)return Q(this,bi,Ca).set(e,i),i;const a=`g_${Q(this,$p)}_transfer_map_${Il(this,R9)._++}`,l=ne(this,bi,T9).call(this,a);Q(this,bi,Ca).set(e,l),Q(this,bi,Ca).set(s,l);const c=ne(this,bi,F9).call(this,a);return ne(this,bi,AI).call(this,r,o,n,c),l}addHCMFilter(e,i){var r;const o=`${e}-${i}`,n="base";let s=Q(this,bi,dI).get(n);if(s?.key===o||(s?((r=s.filter)==null||r.remove(),s.key=o,s.url="none",s.filter=null):(s={key:o,url:"none",filter:null},Q(this,bi,dI).set(n,s)),!e||!i))return s.url;const a=ne(this,bi,hI).call(this,e);e=Ci.makeHexColor(...a);const l=ne(this,bi,hI).call(this,i);if(i=Ci.makeHexColor(...l),Q(this,bi,L9).style.color="",e==="#000000"&&i==="#ffffff"||e===i)return s.url;const c=new Array(256);for(let g=0;g<=255;g++){const p=g/255;c[g]=p<=.03928?p/12.92:((p+.055)/1.055)**2.4}const d=c.join(","),u=`g_${Q(this,$p)}_hcm_filter`,A=s.filter=ne(this,bi,F9).call(this,u);ne(this,bi,AI).call(this,d,d,d,A),ne(this,bi,$Z).call(this,A);const h=(g,p)=>{const m=a[g]/255,f=l[g]/255,v=new Array(p+1);for(let C=0;C<=p;C++)v[C]=m+C/p*(f-m);return v.join(",")};return ne(this,bi,AI).call(this,h(0,5),h(1,5),h(2,5),A),s.url=ne(this,bi,T9).call(this,u),s.url}addAlphaFilter(e){let i=Q(this,bi,Ca).get(e);if(i)return i;const[r]=ne(this,bi,DR).call(this,[e]),o=`alpha_${r}`;if(i=Q(this,bi,Ca).get(o),i)return Q(this,bi,Ca).set(e,i),i;const n=`g_${Q(this,$p)}_alpha_map_${Il(this,R9)._++}`,s=ne(this,bi,T9).call(this,n);Q(this,bi,Ca).set(e,s),Q(this,bi,Ca).set(o,s);const a=ne(this,bi,F9).call(this,n);return ne(this,bi,eX).call(this,r,a),s}addLuminosityFilter(e){let i=Q(this,bi,Ca).get(e||"luminosity");if(i)return i;let r,o;if(e?([r]=ne(this,bi,DR).call(this,[e]),o=`luminosity_${r}`):o="luminosity",i=Q(this,bi,Ca).get(o),i)return Q(this,bi,Ca).set(e,i),i;const n=`g_${Q(this,$p)}_luminosity_map_${Il(this,R9)._++}`,s=ne(this,bi,T9).call(this,n);Q(this,bi,Ca).set(e,s),Q(this,bi,Ca).set(o,s);const a=ne(this,bi,F9).call(this,n);return ne(this,bi,YEe).call(this,a),e&&ne(this,bi,eX).call(this,r,a),s}addHighlightHCMFilter(e,i,r,o,n){var s;const a=`${i}-${r}-${o}-${n}`;let l=Q(this,bi,dI).get(e);if(l?.key===a||(l?((s=l.filter)==null||s.remove(),l.key=a,l.url="none",l.filter=null):(l={key:a,url:"none",filter:null},Q(this,bi,dI).set(e,l)),!i||!r))return l.url;const[c,d]=[i,r].map(ne(this,bi,hI).bind(this));let u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),A=Math.round(.2126*d[0]+.7152*d[1]+.0722*d[2]),[h,g]=[o,n].map(ne(this,bi,hI).bind(this));A<u&&([u,A,h,g]=[A,u,g,h]),Q(this,bi,L9).style.color="";const p=(v,C,y)=>{const w=new Array(256),b=(A-u)/y,E=v/255,x=(C-v)/(255*y);let M=0;for(let k=0;k<=y;k++){const S=Math.round(u+k*b),D=E+k*x;for(let T=M;T<=S;T++)w[T]=D;M=S+1}for(let k=M;k<256;k++)w[k]=w[M-1];return w.join(",")},m=`g_${Q(this,$p)}_hcm_${e}_filter`,f=l.filter=ne(this,bi,F9).call(this,m);return ne(this,bi,$Z).call(this,f),ne(this,bi,AI).call(this,p(h[0],g[0],5),p(h[1],g[1],5),p(h[2],g[2],5),f),l.url=ne(this,bi,T9).call(this,m),l.url}destroy(e=!1){var i,r,o,n;e&&(i=Q(this,L2))!=null&&i.size||((r=Q(this,Xp))==null||r.parentNode.parentNode.remove(),oe(this,Xp,null),(o=Q(this,D9))==null||o.clear(),oe(this,D9,null),(n=Q(this,L2))==null||n.clear(),oe(this,L2,null),oe(this,R9,0))}}P9=new WeakMap,D9=new WeakMap,Xp=new WeakMap,$p=new WeakMap,cl=new WeakMap,L2=new WeakMap,R9=new WeakMap,bi=new WeakSet,Ca=function(){return Q(this,D9)||oe(this,D9,new Map)},dI=function(){return Q(this,L2)||oe(this,L2,new Map)},L9=function(){if(!Q(this,Xp)){const t=Q(this,cl).createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const i=Q(this,cl).createElementNS(k1,"svg");i.setAttribute("width",0),i.setAttribute("height",0),oe(this,Xp,Q(this,cl).createElementNS(k1,"defs")),t.append(i),i.append(Q(this,Xp)),Q(this,cl).body.append(t)}return Q(this,Xp)},DR=function(t){if(t.length===1){const a=t[0],l=new Array(256);for(let d=0;d<256;d++)l[d]=a[d]/255;const c=l.join(",");return[c,c,c]}const[e,i,r]=t,o=new Array(256),n=new Array(256),s=new Array(256);for(let a=0;a<256;a++)o[a]=e[a]/255,n[a]=i[a]/255,s[a]=r[a]/255;return[o.join(","),n.join(","),s.join(",")]},T9=function(t){if(Q(this,P9)===void 0){oe(this,P9,"");const e=Q(this,cl).URL;e!==Q(this,cl).baseURI&&(nR(e)?ir('#createUrl: ignore "data:"-URL for performance reasons.'):oe(this,P9,e.split("#",1)[0]))}return`url(${Q(this,P9)}#${t})`},YEe=function(t){const e=Q(this,cl).createElementNS(k1,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)},$Z=function(t){const e=Q(this,cl).createElementNS(k1,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)},F9=function(t){const e=Q(this,cl).createElementNS(k1,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),Q(this,bi,L9).append(e),e},uI=function(t,e,i){const r=Q(this,cl).createElementNS(k1,e);r.setAttribute("type","discrete"),r.setAttribute("tableValues",i),t.append(r)},AI=function(t,e,i,r){const o=Q(this,cl).createElementNS(k1,"feComponentTransfer");r.append(o),ne(this,bi,uI).call(this,o,"feFuncR",t),ne(this,bi,uI).call(this,o,"feFuncG",e),ne(this,bi,uI).call(this,o,"feFuncB",i)},eX=function(t,e){const i=Q(this,cl).createElementNS(k1,"feComponentTransfer");e.append(i),ne(this,bi,uI).call(this,i,"feFuncA",t)},hI=function(t){return Q(this,bi,L9).style.color=t,xZ(getComputedStyle(Q(this,bi,L9)).getPropertyValue("color"))};class WEe{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${e}`;return this._fetch(i).catch(r=>{throw new Error(`Unable to load font data at: ${i}`)})}async _fetch(e){no("Abstract method `_fetch` called.")}}class ZEe extends WEe{async _fetch(e){const i=await oR(e,"arraybuffer");return new Uint8Array(i)}}async function XEe(t){const e=await process.getBuiltinModule("fs").promises.readFile(t);return new Uint8Array(e)}class VTi extends JEe{}class qTi extends qEe{_createCanvas(e,i){return process.getBuiltinModule("module").createRequire("file:///home/runner/work/pdf.js/pdf.js/src/display/node_utils.js")("@napi-rs/canvas").createCanvas(e,i)}}class zTi extends zEe{async _fetch(e){return XEe(e)}}class KTi extends WEe{async _fetch(e){return XEe(e)}}const ya={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function tX(t,e){if(!e)return;const i=e[2]-e[0],r=e[3]-e[1],o=new Path2D;o.rect(e[0],e[1],i,r),t.clip(o)}class iX{getPattern(){no("Abstract method `getPattern` called.")}}class JTi extends iX{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let i;this._type==="axial"?i=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(i=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const r of this._colorStops)i.addColorStop(r[0],r[1]);return i}getPattern(e,i,r,o){let n;if(o===ya.STROKE||o===ya.FILL){const s=i.current.getClippedPathBoundingBox(o,Vo(e))||[0,0,0,0],a=Math.ceil(s[2]-s[0])||1,l=Math.ceil(s[3]-s[1])||1,c=i.cachedCanvases.getCanvas("pattern",a,l),d=c.context;d.clearRect(0,0,d.canvas.width,d.canvas.height),d.beginPath(),d.rect(0,0,d.canvas.width,d.canvas.height),d.translate(-s[0],-s[1]),r=Ci.transform(r,[1,0,0,1,s[0],s[1]]),d.transform(...i.baseTransform),this.matrix&&d.transform(...this.matrix),tX(d,this._bbox),d.fillStyle=this._createGradient(d),d.fill(),n=e.createPattern(c.canvas,"no-repeat");const u=new DOMMatrix(r);n.setTransform(u)}else tX(e,this._bbox),n=this._createGradient(e);return n}}function rX(t,e,i,r,o,n,s,a){const l=e.coords,c=e.colors,d=t.data,u=t.width*4;let A;l[i+1]>l[r+1]&&(A=i,i=r,r=A,A=n,n=s,s=A),l[r+1]>l[o+1]&&(A=r,r=o,o=A,A=s,s=a,a=A),l[i+1]>l[r+1]&&(A=i,i=r,r=A,A=n,n=s,s=A);const h=(l[i]+e.offsetX)*e.scaleX,g=(l[i+1]+e.offsetY)*e.scaleY,p=(l[r]+e.offsetX)*e.scaleX,m=(l[r+1]+e.offsetY)*e.scaleY,f=(l[o]+e.offsetX)*e.scaleX,v=(l[o+1]+e.offsetY)*e.scaleY;if(g>=v)return;const C=c[n],y=c[n+1],w=c[n+2],b=c[s],E=c[s+1],x=c[s+2],M=c[a],k=c[a+1],S=c[a+2],D=Math.round(g),T=Math.round(v);let U,G,N,H,Y,re,ue,Me;for(let me=D;me<=T;me++){if(me<m){const X=me<g?0:(g-me)/(g-m);U=h-(h-p)*X,G=C-(C-b)*X,N=y-(y-E)*X,H=w-(w-x)*X}else{let X;me>v?X=1:m===v?X=0:X=(m-me)/(m-v),U=p-(p-f)*X,G=b-(b-M)*X,N=E-(E-k)*X,H=x-(x-S)*X}let ke;me<g?ke=0:me>v?ke=1:ke=(g-me)/(g-v),Y=h-(h-f)*ke,re=C-(C-M)*ke,ue=y-(y-k)*ke,Me=w-(w-S)*ke;const he=Math.round(Math.min(U,Y)),Le=Math.round(Math.max(U,Y));let Be=u*me+he*4;for(let X=he;X<=Le;X++)ke=(U-X)/(U-Y),ke<0?ke=0:ke>1&&(ke=1),d[Be++]=G-(G-re)*ke|0,d[Be++]=N-(N-ue)*ke|0,d[Be++]=H-(H-Me)*ke|0,d[Be++]=255}}function YTi(t,e,i){const r=e.coords,o=e.colors;let n,s;switch(e.type){case"lattice":const a=e.verticesPerRow,l=Math.floor(r.length/a)-1,c=a-1;for(n=0;n<l;n++){let d=n*a;for(let u=0;u<c;u++,d++)rX(t,i,r[d],r[d+1],r[d+a],o[d],o[d+1],o[d+a]),rX(t,i,r[d+a+1],r[d+1],r[d+a],o[d+a+1],o[d+1],o[d+a])}break;case"triangles":for(n=0,s=r.length;n<s;n+=3)rX(t,i,r[n],r[n+1],r[n+2],o[n],o[n+1],o[n+2]);break;default:throw new Error("illegal figure")}}class WTi extends iX{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(e,i,r){const o=Math.floor(this._bounds[0]),n=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-o,a=Math.ceil(this._bounds[3])-n,l=Math.min(Math.ceil(Math.abs(s*e[0]*1.1)),3e3),c=Math.min(Math.ceil(Math.abs(a*e[1]*1.1)),3e3),d=s/l,u=a/c,A={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-n,scaleX:1/d,scaleY:1/u},h=l+2*2,g=c+2*2,p=r.getCanvas("mesh",h,g),m=p.context,f=m.createImageData(l,c);if(i){const v=f.data;for(let C=0,y=v.length;C<y;C+=4)v[C]=i[0],v[C+1]=i[1],v[C+2]=i[2],v[C+3]=255}for(const v of this._figures)YTi(f,v,A);return m.putImageData(f,2,2),{canvas:p.canvas,offsetX:o-2*d,offsetY:n-2*u,scaleX:d,scaleY:u}}getPattern(e,i,r,o){tX(e,this._bbox);let n;if(o===ya.SHADING)n=Ci.singularValueDecompose2dScale(Vo(e));else if(n=Ci.singularValueDecompose2dScale(i.baseTransform),this.matrix){const a=Ci.singularValueDecompose2dScale(this.matrix);n=[n[0]*a[0],n[1]*a[1]]}const s=this._createMeshCanvas(n,o===ya.SHADING?null:this._background,i.cachedCanvases);return o!==ya.SHADING&&(e.setTransform(...i.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(s.offsetX,s.offsetY),e.scale(s.scaleX,s.scaleY),e.createPattern(s.canvas,"no-repeat")}}class ZTi extends iX{getPattern(){return"hotpink"}}function XTi(t){switch(t[0]){case"RadialAxial":return new JTi(t);case"Mesh":return new WTi(t);case"Dummy":return new ZTi}throw new Error(`Unknown IR type: ${t[0]}`)}const $Ee={COLORED:1,UNCOLORED:2},exe=class gDe{constructor(e,i,r,o,n){this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=i,this.ctx=r,this.canvasGraphicsFactory=o,this.baseTransform=n}createPatternCanvas(e){const{bbox:i,operatorList:r,paintType:o,tilingType:n,color:s,canvasGraphicsFactory:a}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),eR("TilingType: "+n);const d=i[0],u=i[1],A=i[2],h=i[3],g=A-d,p=h-u,m=Ci.singularValueDecompose2dScale(this.matrix),f=Ci.singularValueDecompose2dScale(this.baseTransform),v=m[0]*f[0],C=m[1]*f[1];let y=g,w=p,b=!1,E=!1;const x=Math.ceil(l*v),M=Math.ceil(c*C),k=Math.ceil(g*v),S=Math.ceil(p*C);x>=k?y=l:b=!0,M>=S?w=c:E=!0;const D=this.getSizeAndScale(y,this.ctx.canvas.width,v),T=this.getSizeAndScale(w,this.ctx.canvas.height,C),U=e.cachedCanvases.getCanvas("pattern",D.size,T.size),G=U.context,N=a.createCanvasGraphics(G);if(N.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(N,o,s),G.translate(-D.scale*d,-T.scale*u),N.transform(D.scale,0,0,T.scale,0,0),G.save(),this.clipBbox(N,d,u,A,h),N.baseTransform=Vo(N.ctx),N.executeOperatorList(r),N.endDrawing(),G.restore(),b||E){const H=U.canvas;b&&(y=l),E&&(w=c);const Y=this.getSizeAndScale(y,this.ctx.canvas.width,v),re=this.getSizeAndScale(w,this.ctx.canvas.height,C),ue=Y.size,Me=re.size,me=e.cachedCanvases.getCanvas("pattern-workaround",ue,Me),ke=me.context,he=b?Math.floor(g/l):0,Le=E?Math.floor(p/c):0;for(let Be=0;Be<=he;Be++)for(let X=0;X<=Le;X++)ke.drawImage(H,ue*Be,Me*X,ue,Me,0,0,ue,Me);return{canvas:me.canvas,scaleX:Y.scale,scaleY:re.scale,offsetX:d,offsetY:u}}return{canvas:U.canvas,scaleX:D.scale,scaleY:T.scale,offsetX:d,offsetY:u}}getSizeAndScale(e,i,r){const o=Math.max(gDe.MAX_PATTERN_SIZE,i);let n=Math.ceil(e*r);return n>=o?n=o:r=n/e,{scale:r,size:n}}clipBbox(e,i,r,o,n){const s=o-i,a=n-r;e.ctx.rect(i,r,s,a),e.current.updateRectMinMax(Vo(e.ctx),[i,r,o,n]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,i,r){const o=e.ctx,n=e.current;switch(i){case $Ee.COLORED:const s=this.ctx;o.fillStyle=s.fillStyle,o.strokeStyle=s.strokeStyle,n.fillColor=s.fillStyle,n.strokeColor=s.strokeStyle;break;case $Ee.UNCOLORED:const a=Ci.makeHexColor(r[0],r[1],r[2]);o.fillStyle=a,o.strokeStyle=a,n.fillColor=a,n.strokeColor=a;break;default:throw new wTi(`Unsupported paint type: ${i}`)}}getPattern(e,i,r,o){let n=r;o!==ya.SHADING&&(n=Ci.transform(n,i.baseTransform),this.matrix&&(n=Ci.transform(n,this.matrix)));const s=this.createPatternCanvas(i);let a=new DOMMatrix(n);a=a.translate(s.offsetX,s.offsetY),a=a.scale(1/s.scaleX,1/s.scaleY);const l=e.createPattern(s.canvas,"repeat");return l.setTransform(a),l}};ii(exe,"MAX_PATTERN_SIZE",3e3);let $Ti=exe;function eFi({src:t,srcPos:e=0,dest:i,width:r,height:o,nonBlackColor:n=4294967295,inverseDecode:s=!1}){const a=al.isLittleEndian?4278190080:255,[l,c]=s?[n,a]:[a,n],d=r>>3,u=r&7,A=t.length;i=new Uint32Array(i.buffer);let h=0;for(let g=0;g<o;g++){for(const m=e+d;e<m;e++){const f=e<A?t[e]:255;i[h++]=f&128?c:l,i[h++]=f&64?c:l,i[h++]=f&32?c:l,i[h++]=f&16?c:l,i[h++]=f&8?c:l,i[h++]=f&4?c:l,i[h++]=f&2?c:l,i[h++]=f&1?c:l}if(u===0)continue;const p=e<A?t[e++]:255;for(let m=0;m<u;m++)i[h++]=p&1<<7-m?c:l}return{srcPos:e,destPos:h}}const txe=16,ixe=100,tFi=15,rxe=10,oxe=1e3,Jl=16;function iFi(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(i,r){e.translate(i,r),this.__originalTranslate(i,r)},t.scale=function(i,r){e.scale(i,r),this.__originalScale(i,r)},t.transform=function(i,r,o,n,s,a){e.transform(i,r,o,n,s,a),this.__originalTransform(i,r,o,n,s,a)},t.setTransform=function(i,r,o,n,s,a){e.setTransform(i,r,o,n,s,a),this.__originalSetTransform(i,r,o,n,s,a)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(i){e.rotate(i),this.__originalRotate(i)},t.clip=function(i){e.clip(i),this.__originalClip(i)},t.moveTo=function(i,r){e.moveTo(i,r),this.__originalMoveTo(i,r)},t.lineTo=function(i,r){e.lineTo(i,r),this.__originalLineTo(i,r)},t.bezierCurveTo=function(i,r,o,n,s,a){e.bezierCurveTo(i,r,o,n,s,a),this.__originalBezierCurveTo(i,r,o,n,s,a)},t.rect=function(i,r,o,n){e.rect(i,r,o,n),this.__originalRect(i,r,o,n)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class rFi{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,i,r){let o;return this.cache[e]!==void 0?(o=this.cache[e],this.canvasFactory.reset(o,i,r)):(o=this.canvasFactory.create(i,r),this.cache[e]=o),o}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const i=this.cache[e];this.canvasFactory.destroy(i),delete this.cache[e]}}}function RR(t,e,i,r,o,n,s,a,l,c){const[d,u,A,h,g,p]=Vo(t);if(u===0&&A===0){const v=s*d+g,C=Math.round(v),y=a*h+p,w=Math.round(y),b=(s+l)*d+g,E=Math.abs(Math.round(b)-C)||1,x=(a+c)*h+p,M=Math.abs(Math.round(x)-w)||1;return t.setTransform(Math.sign(d),0,0,Math.sign(h),C,w),t.drawImage(e,i,r,o,n,0,0,E,M),t.setTransform(d,u,A,h,g,p),[E,M]}if(d===0&&h===0){const v=a*A+g,C=Math.round(v),y=s*u+p,w=Math.round(y),b=(a+c)*A+g,E=Math.abs(Math.round(b)-C)||1,x=(s+l)*u+p,M=Math.abs(Math.round(x)-w)||1;return t.setTransform(0,Math.sign(u),Math.sign(A),0,C,w),t.drawImage(e,i,r,o,n,0,0,M,E),t.setTransform(d,u,A,h,g,p),[M,E]}t.drawImage(e,i,r,o,n,s,a,l,c);const m=Math.hypot(d,u),f=Math.hypot(A,h);return[m*l,f*c]}function oFi(t){const{width:e,height:i}=t;if(e>oxe||i>oxe)return null;const r=1e3,o=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),n=e+1;let s=new Uint8Array(n*(i+1)),a,l,c;const d=e+7&-8;let u=new Uint8Array(d*i),A=0;for(const m of t.data){let f=128;for(;f>0;)u[A++]=m&f?0:255,f>>=1}let h=0;for(A=0,u[A]!==0&&(s[0]=1,++h),l=1;l<e;l++)u[A]!==u[A+1]&&(s[l]=u[A]?2:1,++h),A++;for(u[A]!==0&&(s[l]=2,++h),a=1;a<i;a++){A=a*d,c=a*n,u[A-d]!==u[A]&&(s[c]=u[A]?1:8,++h);let m=(u[A]?4:0)+(u[A-d]?8:0);for(l=1;l<e;l++)m=(m>>2)+(u[A+1]?4:0)+(u[A-d+1]?8:0),o[m]&&(s[c+l]=o[m],++h),A++;if(u[A-d]!==u[A]&&(s[c+l]=u[A]?2:4,++h),h>r)return null}for(A=d*(i-1),c=a*n,u[A]!==0&&(s[c]=8,++h),l=1;l<e;l++)u[A]!==u[A+1]&&(s[c+l]=u[A]?4:8,++h),A++;if(u[A]!==0&&(s[c+l]=4,++h),h>r)return null;const g=new Int32Array([0,n,-1,0,-n,0,0,0,1]),p=new Path2D;for(a=0;h&&a<=i;a++){let m=a*n;const f=m+e;for(;m<f&&!s[m];)m++;if(m===f)continue;p.moveTo(m%n,a);const v=m;let C=s[m];do{const y=g[C];do m+=y;while(!s[m]);const w=s[m];w!==5&&w!==10?(C=w,s[m]=0):(C=w&51*C>>4,s[m]&=C>>2|C<<2),p.lineTo(m%n,m/n|0),s[m]||--h}while(v!==m);--a}return u=null,s=null,function(m){m.save(),m.scale(1/e,-1/i),m.translate(0,-i),m.fill(p),m.beginPath(),m.restore()}}class nxe{constructor(e,i){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=lEe,this.textMatrixScale=1,this.fontMatrix=hZ,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=fa.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.patternStroke=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,i])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,i){this.x=e,this.y=i}updatePathMinMax(e,i,r){[i,r]=Ci.applyTransform([i,r],e),this.minX=Math.min(this.minX,i),this.minY=Math.min(this.minY,r),this.maxX=Math.max(this.maxX,i),this.maxY=Math.max(this.maxY,r)}updateRectMinMax(e,i){const r=Ci.applyTransform(i,e),o=Ci.applyTransform(i.slice(2),e),n=Ci.applyTransform([i[0],i[3]],e),s=Ci.applyTransform([i[2],i[1]],e);this.minX=Math.min(this.minX,r[0],o[0],n[0],s[0]),this.minY=Math.min(this.minY,r[1],o[1],n[1],s[1]),this.maxX=Math.max(this.maxX,r[0],o[0],n[0],s[0]),this.maxY=Math.max(this.maxY,r[1],o[1],n[1],s[1])}updateScalingPathMinMax(e,i){Ci.scaleMinMax(e,i),this.minX=Math.min(this.minX,i[0]),this.minY=Math.min(this.minY,i[1]),this.maxX=Math.max(this.maxX,i[2]),this.maxY=Math.max(this.maxY,i[3])}updateCurvePathMinMax(e,i,r,o,n,s,a,l,c,d){const u=Ci.bezierBoundingBox(i,r,o,n,s,a,l,c,d);d||this.updateRectMinMax(e,u)}getPathBoundingBox(e=ya.FILL,i=null){const r=[this.minX,this.minY,this.maxX,this.maxY];if(e===ya.STROKE){i||no("Stroke bounding box must include transform.");const o=Ci.singularValueDecompose2dScale(i),n=o[0]*this.lineWidth/2,s=o[1]*this.lineWidth/2;r[0]-=n,r[1]-=s,r[2]+=n,r[3]+=s}return r}updateClipFromPath(){const e=Ci.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=ya.FILL,i=null){return Ci.intersect(this.clipBox,this.getPathBoundingBox(e,i))}}function sxe(t,e){if(e instanceof ImageData){t.putImageData(e,0,0);return}const i=e.height,r=e.width,o=i%Jl,n=(i-o)/Jl,s=o===0?n:n+1,a=t.createImageData(r,Jl);let l=0,c;const d=e.data,u=a.data;let A,h,g,p;if(e.kind===ZD.GRAYSCALE_1BPP){const m=d.byteLength,f=new Uint32Array(u.buffer,0,u.byteLength>>2),v=f.length,C=r+7>>3,y=4294967295,w=al.isLittleEndian?4278190080:255;for(A=0;A<s;A++){for(g=A<n?Jl:o,c=0,h=0;h<g;h++){const b=m-l;let E=0;const x=b>C?r:b*8-7,M=x&-8;let k=0,S=0;for(;E<M;E+=8)S=d[l++],f[c++]=S&128?y:w,f[c++]=S&64?y:w,f[c++]=S&32?y:w,f[c++]=S&16?y:w,f[c++]=S&8?y:w,f[c++]=S&4?y:w,f[c++]=S&2?y:w,f[c++]=S&1?y:w;for(;E<x;E++)k===0&&(S=d[l++],k=128),f[c++]=S&k?y:w,k>>=1}for(;c<v;)f[c++]=0;t.putImageData(a,0,A*Jl)}}else if(e.kind===ZD.RGBA_32BPP){for(h=0,p=r*Jl*4,A=0;A<n;A++)u.set(d.subarray(l,l+p)),l+=p,t.putImageData(a,0,h),h+=Jl;A<s&&(p=r*o*4,u.set(d.subarray(l,l+p)),t.putImageData(a,0,h))}else if(e.kind===ZD.RGB_24BPP)for(g=Jl,p=r*g,A=0;A<s;A++){for(A>=n&&(g=o,p=r*g),c=0,h=p;h--;)u[c++]=d[l++],u[c++]=d[l++],u[c++]=d[l++],u[c++]=255;t.putImageData(a,0,A*Jl)}else throw new Error(`bad image kind: ${e.kind}`)}function axe(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const i=e.height,r=e.width,o=i%Jl,n=(i-o)/Jl,s=o===0?n:n+1,a=t.createImageData(r,Jl);let l=0;const c=e.data,d=a.data;for(let u=0;u<s;u++){const A=u<n?Jl:o;({srcPos:l}=eFi({src:c,srcPos:l,dest:d,width:r,height:A,nonBlackColor:0})),t.putImageData(a,0,u*Jl)}}function pI(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of i)t[r]!==void 0&&(e[r]=t[r]);t.setLineDash!==void 0&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function LR(t){if(t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",t.setLineDash!==void 0&&(t.setLineDash([]),t.lineDashOffset=0),!sl){const{filter:e}=t;e!=="none"&&e!==""&&(t.filter="none")}}function lxe(t,e){if(e)return!0;const i=Ci.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const r=Math.fround((globalThis.devicePixelRatio||1)*p9.PDF_TO_CSS_UNITS);return i[0]<=r&&i[1]<=r}const nFi=["butt","round","square"],sFi=["miter","round","bevel"],aFi={},cxe={};var N9,oX,nX;const lFi=class fDe{constructor(e,i,r,o,n,{optionalContentConfig:s,markedContentStack:a=null},l,c){Ae(this,N9),this.ctx=e,this.current=new nxe(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=i,this.objs=r,this.canvasFactory=o,this.filterFactory=n,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=a||[],this.optionalContentConfig=s,this.cachedCanvases=new rFi(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,i=null){return typeof e=="string"?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):i}beginDrawing({transform:e,viewport:i,transparency:r=!1,background:o=null}){const n=this.ctx.canvas.width,s=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=o||"#ffffff",this.ctx.fillRect(0,0,n,s),this.ctx.fillStyle=a,r){const l=this.cachedCanvases.getCanvas("transparent",n,s);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...Vo(this.compositeCtx))}this.ctx.save(),LR(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=Vo(this.ctx)}executeOperatorList(e,i,r,o){const n=e.argsArray,s=e.fnArray;let a=i||0;const l=n.length;if(l===a)return a;const c=l-a>rxe&&typeof r=="function",d=c?Date.now()+tFi:0;let u=0;const A=this.commonObjs,h=this.objs;let g;for(;;){if(o!==void 0&&a===o.nextBreakPoint)return o.breakIt(a,r),a;if(g=s[a],g!==Iu.dependency)this[g].apply(this,n[a]);else for(const p of n[a]){const m=p.startsWith("g_")?A:h;if(!m.has(p))return m.get(p,r),a}if(a++,a===l)return a;if(c&&++u>rxe){if(Date.now()>d)return r(),a;u=0}}}endDrawing(){ne(this,N9,oX).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const i of e.values())typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&(i.width=i.height=0);e.clear()}this._cachedBitmapsMap.clear(),ne(this,N9,nX).call(this)}_scaleImage(e,i){const r=e.width??e.displayWidth,o=e.height??e.displayHeight;let n=Math.max(Math.hypot(i[0],i[1]),1),s=Math.max(Math.hypot(i[2],i[3]),1),a=r,l=o,c="prescale1",d,u;for(;n>2&&a>1||s>2&&l>1;){let A=a,h=l;n>2&&a>1&&(A=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),n/=a/A),s>2&&l>1&&(h=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,s/=l/h),d=this.cachedCanvases.getCanvas(c,A,h),u=d.context,u.clearRect(0,0,A,h),u.drawImage(e,0,0,a,l,0,0,A,h),e=d.canvas,a=A,l=h,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:a,paintHeight:l}}_createMaskCanvas(e){const i=this.ctx,{width:r,height:o}=e,n=this.current.fillColor,s=this.current.patternFill,a=Vo(i);let l,c,d,u;if((e.bitmap||e.data)&&e.count>1){const x=e.bitmap||e.data.buffer;c=JSON.stringify(s?a:[a.slice(0,4),n]),l=this._cachedBitmapsMap.get(x),l||(l=new Map,this._cachedBitmapsMap.set(x,l));const M=l.get(c);if(M&&!s){const k=Math.round(Math.min(a[0],a[2])+a[4]),S=Math.round(Math.min(a[1],a[3])+a[5]);return{canvas:M,offsetX:k,offsetY:S}}d=M}d||(u=this.cachedCanvases.getCanvas("maskCanvas",r,o),axe(u.context,e));let A=Ci.transform(a,[1/r,0,0,-1/o,0,0]);A=Ci.transform(A,[1,0,0,1,0,-o]);const[h,g,p,m]=Ci.getAxialAlignedBoundingBox([0,0,r,o],A),f=Math.round(p-h)||1,v=Math.round(m-g)||1,C=this.cachedCanvases.getCanvas("fillCanvas",f,v),y=C.context,w=h,b=g;y.translate(-w,-b),y.transform(...A),d||(d=this._scaleImage(u.canvas,_A(y)),d=d.img,l&&s&&l.set(c,d)),y.imageSmoothingEnabled=lxe(Vo(y),e.interpolate),RR(y,d,0,0,d.width,d.height,0,0,r,o),y.globalCompositeOperation="source-in";const E=Ci.transform(_A(y),[1,0,0,1,-w,-b]);return y.fillStyle=s?n.getPattern(i,this,E,ya.FILL):n,y.fillRect(0,0,r,o),l&&!s&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,C.canvas)),{canvas:C.canvas,offsetX:Math.round(w),offsetY:Math.round(b)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=nFi[e]}setLineJoin(e){this.ctx.lineJoin=sFi[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,i){const r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(e),r.lineDashOffset=i)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[i,r]of e)switch(i){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r[0],r[1]);break;case"CA":this.current.strokeAlpha=r;break;case"ca":this.current.fillAlpha=r,this.ctx.globalAlpha=r;break;case"BM":this.ctx.globalCompositeOperation=r;break;case"SMask":this.current.activeSMask=r?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,i=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,o=this.cachedCanvases.getCanvas(r,e,i);this.suspendedCtx=this.ctx,this.ctx=o.context;const n=this.ctx;n.setTransform(...Vo(this.suspendedCtx)),pI(this.suspendedCtx,n),iFi(n,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(),pI(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const i=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,i,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,i,r,o){const n=o[0],s=o[1],a=o[2]-n,l=o[3]-s;a===0||l===0||(this.genericComposeSMask(i.context,r,a,l,i.subtype,i.backdrop,i.transferMap,n,s,i.offsetX,i.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(r.canvas,0,0),e.restore())}genericComposeSMask(e,i,r,o,n,s,a,l,c,d,u){let A=e.canvas,h=l-d,g=c-u;if(s){const m=Ci.makeHexColor(...s);if(h<0||g<0||h+r>A.width||g+o>A.height){const f=this.cachedCanvases.getCanvas("maskExtension",r,o),v=f.context;v.drawImage(A,-h,-g),v.globalCompositeOperation="destination-atop",v.fillStyle=m,v.fillRect(0,0,r,o),v.globalCompositeOperation="source-over",A=f.canvas,h=g=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const f=new Path2D;f.rect(h,g,r,o),e.clip(f),e.globalCompositeOperation="destination-atop",e.fillStyle=m,e.fillRect(h,g,r,o),e.restore()}}i.save(),i.globalAlpha=1,i.setTransform(1,0,0,1,0,0),n==="Alpha"&&a?i.filter=this.filterFactory.addAlphaFilter(a):n==="Luminosity"&&(i.filter=this.filterFactory.addLuminosityFilter(a));const p=new Path2D;p.rect(l,c,r,o),i.clip(p),i.globalCompositeOperation="destination-in",i.drawImage(A,h,g,r,o,l,c,r,o),i.restore()}save(){this.inSMaskMode?(pI(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),pI(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,i,r,o,n,s){this.ctx.transform(e,i,r,o,n,s),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,i,r){const o=this.ctx,n=this.current;let s=n.x,a=n.y,l,c;const d=Vo(o),u=d[0]===0&&d[3]===0||d[1]===0&&d[2]===0,A=u?r.slice(0):null;for(let h=0,g=0,p=e.length;h<p;h++)switch(e[h]|0){case Iu.rectangle:s=i[g++],a=i[g++];const m=i[g++],f=i[g++],v=s+m,C=a+f;o.moveTo(s,a),m===0||f===0?o.lineTo(v,C):(o.lineTo(v,a),o.lineTo(v,C),o.lineTo(s,C)),u||n.updateRectMinMax(d,[s,a,v,C]),o.closePath();break;case Iu.moveTo:s=i[g++],a=i[g++],o.moveTo(s,a),u||n.updatePathMinMax(d,s,a);break;case Iu.lineTo:s=i[g++],a=i[g++],o.lineTo(s,a),u||n.updatePathMinMax(d,s,a);break;case Iu.curveTo:l=s,c=a,s=i[g+4],a=i[g+5],o.bezierCurveTo(i[g],i[g+1],i[g+2],i[g+3],s,a),n.updateCurvePathMinMax(d,l,c,i[g],i[g+1],i[g+2],i[g+3],s,a,A),g+=6;break;case Iu.curveTo2:l=s,c=a,o.bezierCurveTo(s,a,i[g],i[g+1],i[g+2],i[g+3]),n.updateCurvePathMinMax(d,l,c,s,a,i[g],i[g+1],i[g+2],i[g+3],A),s=i[g+2],a=i[g+3],g+=4;break;case Iu.curveTo3:l=s,c=a,s=i[g+2],a=i[g+3],o.bezierCurveTo(i[g],i[g+1],s,a,s,a),n.updateCurvePathMinMax(d,l,c,i[g],i[g+1],s,a,s,a,A),g+=4;break;case Iu.closePath:o.closePath();break}u&&n.updateScalingPathMinMax(d,A),n.setCurrentPoint(s,a)}closePath(){this.ctx.closePath()}stroke(e=!0){const i=this.ctx,r=this.current.strokeColor;i.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof r=="object"&&r!=null&&r.getPattern?(i.save(),i.strokeStyle=r.getPattern(i,this,_A(i),ya.STROKE),this.rescaleAndStroke(!1),i.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),i.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){const i=this.ctx,r=this.current.fillColor,o=this.current.patternFill;let n=!1;o&&(i.save(),i.fillStyle=r.getPattern(i,this,_A(i),ya.FILL),n=!0);const s=this.current.getClippedPathBoundingBox();this.contentVisible&&s!==null&&(this.pendingEOFill?(i.fill("evenodd"),this.pendingEOFill=!1):i.fill()),n&&i.restore(),e&&this.consumePath(s)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=aFi}eoClip(){this.pendingClip=cxe}beginText(){this.current.textMatrix=lEe,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,i=this.ctx;if(e===void 0){i.beginPath();return}i.save(),i.beginPath();for(const r of e)i.setTransform(...r.transform),i.translate(r.x,r.y),r.addToPath(i,r.fontSize);i.restore(),i.clip(),i.beginPath(),delete this.pendingTextPaths}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,i){var r;const o=this.commonObjs.get(e),n=this.current;if(!o)throw new Error(`Can't find font for ${e}`);if(n.fontMatrix=o.fontMatrix||hZ,(n.fontMatrix[0]===0||n.fontMatrix[3]===0)&&ir("Invalid font matrix for font "+e),i<0?(i=-i,n.fontDirection=-1):n.fontDirection=1,this.current.font=o,this.current.fontSize=i,o.isType3Font)return;const s=o.loadedName||"sans-serif",a=((r=o.systemFontInfo)==null?void 0:r.css)||`"${s}", ${o.fallbackName}`;let l="normal";o.black?l="900":o.bold&&(l="bold");const c=o.italic?"italic":"normal";let d=i;i<txe?d=txe:i>ixe&&(d=ixe),this.current.fontSizeScale=i/d,this.ctx.font=`${c} ${l} ${d}px ${a}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,i){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=i}setLeadingMoveText(e,i){this.setLeading(-i),this.moveText(e,i)}setTextMatrix(e,i,r,o,n,s){this.current.textMatrix=[e,i,r,o,n,s],this.current.textMatrixScale=Math.hypot(e,i),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,i,r,o,n){const s=this.ctx,a=this.current,l=a.font,c=a.textRenderingMode,d=a.fontSize/a.fontSizeScale,u=c&fa.FILL_STROKE_MASK,A=!!(c&fa.ADD_TO_PATH_FLAG),h=a.patternFill&&!l.missingFile,g=a.patternStroke&&!l.missingFile;let p;(l.disableFontFace||A||h||g)&&(p=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||h||g?(s.save(),s.translate(i,r),s.beginPath(),p(s,d),(u===fa.FILL||u===fa.FILL_STROKE)&&(o&&s.setTransform(...o),s.fill()),(u===fa.STROKE||u===fa.FILL_STROKE)&&(n&&s.setTransform(...n),s.stroke()),s.restore()):((u===fa.FILL||u===fa.FILL_STROKE)&&s.fillText(e,i,r),(u===fa.STROKE||u===fa.FILL_STROKE)&&s.strokeText(e,i,r)),A&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Vo(s),x:i,y:r,fontSize:d,addToPath:p})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const i=e.getImageData(0,0,10,10).data;let r=!1;for(let o=3;o<i.length;o+=4)if(i[o]>0&&i[o]<255){r=!0;break}return cr(this,"isFontSubpixelAAEnabled",r)}showText(e){const i=this.current,r=i.font;if(r.isType3Font)return this.showType3Text(e);const o=i.fontSize;if(o===0)return;const n=this.ctx,s=i.fontSizeScale,a=i.charSpacing,l=i.wordSpacing,c=i.fontDirection,d=i.textHScale*c,u=e.length,A=r.vertical,h=A?1:-1,g=r.defaultVMetrics,p=o*i.fontMatrix[0],m=i.textRenderingMode===fa.FILL&&!r.disableFontFace&&!i.patternFill;n.save(),n.transform(...i.textMatrix),n.translate(i.x,i.y+i.textRise),c>0?n.scale(d,-1):n.scale(d,1);let f,v;if(i.patternFill){n.save();const E=i.fillColor.getPattern(n,this,_A(n),ya.FILL);f=Vo(n),n.restore(),n.fillStyle=E}if(i.patternStroke){n.save();const E=i.strokeColor.getPattern(n,this,_A(n),ya.STROKE);v=Vo(n),n.restore(),n.strokeStyle=E}let C=i.lineWidth;const y=i.textMatrixScale;if(y===0||C===0){const E=i.textRenderingMode&fa.FILL_STROKE_MASK;(E===fa.STROKE||E===fa.FILL_STROKE)&&(C=this.getSinglePixelWidth())}else C/=y;if(s!==1&&(n.scale(s,s),C/=s),n.lineWidth=C,r.isInvalidPDFjsFont){const E=[];let x=0;for(const M of e)E.push(M.unicode),x+=M.width;n.fillText(E.join(""),0,0),i.x+=x*p*d,n.restore(),this.compose();return}let w=0,b;for(b=0;b<u;++b){const E=e[b];if(typeof E=="number"){w+=h*E*o/1e3;continue}let x=!1;const M=(E.isSpace?l:0)+a,k=E.fontChar,S=E.accent;let D,T,U=E.width;if(A){const N=E.vmetric||g,H=-(E.vmetric?N[1]:U*.5)*p,Y=N[2]*p;U=N?-N[0]:U,D=H/s,T=(w+Y)/s}else D=w/s,T=0;if(r.remeasure&&U>0){const N=n.measureText(k).width*1e3/o*s;if(U<N&&this.isFontSubpixelAAEnabled){const H=U/N;x=!0,n.save(),n.scale(H,1),D/=H}else U!==N&&(D+=(U-N)/2e3*o/s)}if(this.contentVisible&&(E.isInFont||r.missingFile)){if(m&&!S)n.fillText(k,D,T);else if(this.paintChar(k,D,T,f,v),S){const N=D+o*S.offset.x/s,H=T-o*S.offset.y/s;this.paintChar(S.fontChar,N,H,f,v)}}const G=A?U*p-M*c:U*p+M*c;w+=G,x&&n.restore()}A?i.y-=w:i.x+=w*d,n.restore(),this.compose()}showType3Text(e){const i=this.ctx,r=this.current,o=r.font,n=r.fontSize,s=r.fontDirection,a=o.vertical?1:-1,l=r.charSpacing,c=r.wordSpacing,d=r.textHScale*s,u=r.fontMatrix||hZ,A=e.length,h=r.textRenderingMode===fa.INVISIBLE;let g,p,m,f;if(!(h||n===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),i.transform(...r.textMatrix),i.translate(r.x,r.y),i.scale(d,s),g=0;g<A;++g){if(p=e[g],typeof p=="number"){f=a*p*n/1e3,this.ctx.translate(f,0),r.x+=f*d;continue}const v=(p.isSpace?c:0)+l,C=o.charProcOperatorList[p.operatorListId];if(!C){ir(`Type3 character "${p.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=p,this.save(),i.scale(n,n),i.transform(...u),this.executeOperatorList(C),this.restore()),m=Ci.applyTransform([p.width,0],u)[0]*n+v,i.translate(m,0),r.x+=m*d}i.restore(),this.processingType3=null}}setCharWidth(e,i){}setCharWidthAndBounds(e,i,r,o,n,s){this.ctx.rect(r,o,n-r,s-o),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let i;if(e[0]==="TilingPattern"){const r=e[1],o=this.baseTransform||Vo(this.ctx),n={createCanvasGraphics:s=>new fDe(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};i=new $Ti(e,r,this.ctx,n,o)}else i=this._getPattern(e[1],e[2]);return i}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,i,r){this.ctx.strokeStyle=this.current.strokeColor=Ci.makeHexColor(e,i,r),this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,i,r){this.ctx.fillStyle=this.current.fillColor=Ci.makeHexColor(e,i,r),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,i=null){let r;return this.cachedPatterns.has(e)?r=this.cachedPatterns.get(e):(r=XTi(this.getObject(e)),this.cachedPatterns.set(e,r)),i&&(r.matrix=i),r}shadingFill(e){if(!this.contentVisible)return;const i=this.ctx;this.save();const r=this._getPattern(e);i.fillStyle=r.getPattern(i,this,_A(i),ya.SHADING);const o=_A(i);if(o){const{width:n,height:s}=i.canvas,[a,l,c,d]=Ci.getAxialAlignedBoundingBox([0,0,n,s],o);this.ctx.fillRect(a,l,c-a,d-l)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){no("Should not call beginInlineImage")}beginImageData(){no("Should not call beginImageData")}paintFormXObjectBegin(e,i){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=Vo(this.ctx),i)){const r=i[2]-i[0],o=i[3]-i[1];this.ctx.rect(i[0],i[1],r,o),this.current.updateRectMinMax(Vo(this.ctx),i),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const i=this.ctx;e.isolated||eR("TODO: Support non-isolated groups."),e.knockout&&ir("Knockout groups not supported.");const r=Vo(i);if(e.matrix&&i.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let o=Ci.getAxialAlignedBoundingBox(e.bbox,Vo(i));const n=[0,0,i.canvas.width,i.canvas.height];o=Ci.intersect(o,n)||[0,0,0,0];const s=Math.floor(o[0]),a=Math.floor(o[1]),l=Math.max(Math.ceil(o[2])-s,1),c=Math.max(Math.ceil(o[3])-a,1);this.current.startNewPathAndClipBox([0,0,l,c]);let d="groupAt"+this.groupLevel;e.smask&&(d+="_smask_"+this.smaskCounter++%2);const u=this.cachedCanvases.getCanvas(d,l,c),A=u.context;A.translate(-s,-a),A.transform(...r),e.smask?this.smaskStack.push({canvas:u.canvas,context:A,offsetX:s,offsetY:a,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(i.setTransform(1,0,0,1,0,0),i.translate(s,a),i.save()),pI(i,A),this.ctx=A,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(i),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,r=this.groupStack.pop();if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const o=Vo(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...o);const n=Ci.getAxialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],o);this.ctx.drawImage(i.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,i,r,o,n){if(ne(this,N9,oX).call(this),LR(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const s=i[2]-i[0],a=i[3]-i[1];if(n&&this.annotationCanvasMap){r=r.slice(),r[4]-=i[0],r[5]-=i[1],i=i.slice(),i[0]=i[1]=0,i[2]=s,i[3]=a;const[l,c]=Ci.singularValueDecompose2dScale(Vo(this.ctx)),{viewportScale:d}=this,u=Math.ceil(s*this.outputScaleX*d),A=Math.ceil(a*this.outputScaleY*d);this.annotationCanvas=this.canvasFactory.create(u,A);const{canvas:h,context:g}=this.annotationCanvas;this.annotationCanvasMap.set(e,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=g,this.ctx.save(),this.ctx.setTransform(l,0,0,-c,0,a*c),LR(this.ctx)}else LR(this.ctx),this.endPath(),this.ctx.rect(i[0],i[1],s,a),this.ctx.clip(),this.ctx.beginPath()}this.current=new nxe(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...o)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),ne(this,N9,nX).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const i=e.count;e=this.getObject(e.data,e),e.count=i;const r=this.ctx,o=this.processingType3;if(o&&(o.compiled===void 0&&(o.compiled=oFi(e)),o.compiled)){o.compiled(r);return}const n=this._createMaskCanvas(e),s=n.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(s,n.offsetX,n.offsetY),r.restore(),this.compose()}paintImageMaskXObjectRepeat(e,i,r=0,o=0,n,s){if(!this.contentVisible)return;e=this.getObject(e.data,e);const a=this.ctx;a.save();const l=Vo(a);a.transform(i,r,o,n,0,0);const c=this._createMaskCanvas(e);a.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]);for(let d=0,u=s.length;d<u;d+=2){const A=Ci.transform(l,[i,r,o,n,s[d],s[d+1]]),[h,g]=Ci.applyTransform([0,0],A);a.drawImage(c.canvas,h,g)}a.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const i=this.ctx,r=this.current.fillColor,o=this.current.patternFill;for(const n of e){const{data:s,width:a,height:l,transform:c}=n,d=this.cachedCanvases.getCanvas("maskCanvas",a,l),u=d.context;u.save();const A=this.getObject(s,n);axe(u,A),u.globalCompositeOperation="source-in",u.fillStyle=o?r.getPattern(u,this,_A(i),ya.FILL):r,u.fillRect(0,0,a,l),u.restore(),i.save(),i.transform(...c),i.scale(1,-1),RR(i,d.canvas,0,0,a,l,0,-1,1,1),i.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const i=this.getObject(e);if(!i){ir("Dependent image isn't ready yet");return}this.paintInlineImageXObject(i)}paintImageXObjectRepeat(e,i,r,o){if(!this.contentVisible)return;const n=this.getObject(e);if(!n){ir("Dependent image isn't ready yet");return}const s=n.width,a=n.height,l=[];for(let c=0,d=o.length;c<d;c+=2)l.push({transform:[i,0,0,r,o[c],o[c+1]],x:0,y:0,w:s,h:a});this.paintInlineImageXObjectGroup(n,l)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:i,width:r,height:o}=e,n=this.cachedCanvases.getCanvas("inlineImage",r,o),s=n.context;return s.filter=this.current.transferMaps,s.drawImage(i,0,0),s.filter="none",n.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const i=e.width,r=e.height,o=this.ctx;if(this.save(),!sl){const{filter:a}=o;a!=="none"&&a!==""&&(o.filter="none")}o.scale(1/i,-1/r);let n;if(e.bitmap)n=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)n=e;else{const a=this.cachedCanvases.getCanvas("inlineImage",i,r).context;sxe(a,e),n=this.applyTransferMapsToCanvas(a)}const s=this._scaleImage(n,_A(o));o.imageSmoothingEnabled=lxe(Vo(o),e.interpolate),RR(o,s.img,0,0,s.paintWidth,s.paintHeight,0,-r,i,r),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,i){if(!this.contentVisible)return;const r=this.ctx;let o;if(e.bitmap)o=e.bitmap;else{const n=e.width,s=e.height,a=this.cachedCanvases.getCanvas("inlineImage",n,s).context;sxe(a,e),o=this.applyTransferMapsToCanvas(a)}for(const n of i)r.save(),r.transform(...n.transform),r.scale(1,-1),RR(r,o,n.x,n.y,n.w,n.h,0,-1,1,1),r.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,i){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,i){e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){const i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const r=this.ctx;this.pendingClip&&(i||(this.pendingClip===cxe?r.clip("evenodd"):r.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),r.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=Vo(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const i=Math.abs(e[0]*e[3]-e[2]*e[1]),r=Math.hypot(e[0],e[2]),o=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(r,o)/i}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:i,b:r,c:o,d:n}=this.ctx.getTransform();let s,a;if(r===0&&o===0){const l=Math.abs(i),c=Math.abs(n);if(l===c)if(e===0)s=a=1/l;else{const d=l*e;s=a=d<1?1/d:1}else if(e===0)s=1/l,a=1/c;else{const d=l*e,u=c*e;s=d<1?1/d:1,a=u<1?1/u:1}}else{const l=Math.abs(i*n-r*o),c=Math.hypot(i,r),d=Math.hypot(o,n);if(e===0)s=d/l,a=c/l;else{const u=e*l;s=d>u?d/u:1,a=c>u?c/u:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:i}=this,{lineWidth:r}=this.current,[o,n]=this.getScaleForStroking();if(i.lineWidth=r||1,o===1&&n===1){i.stroke();return}const s=i.getLineDash();if(e&&i.save(),i.scale(o,n),s.length>0){const a=Math.max(o,n);i.setLineDash(s.map(l=>l/a)),i.lineDashOffset/=a}i.stroke(),e&&i.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};N9=new WeakSet,oX=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},nX=function(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}};let TR=lFi;for(const t in Iu)TR.prototype[t]!==void 0&&(TR.prototype[Iu[t]]=TR.prototype[t]);var FR,NR;class eg{static get workerPort(){return Q(this,FR)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");oe(this,FR,e)}static get workerSrc(){return Q(this,NR)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");oe(this,NR,e)}}FR=new WeakMap,NR=new WeakMap,Ae(eg,FR,null),Ae(eg,NR,"");const UR={UNKNOWN:0,DATA:1,ERROR:2},Vn={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Fc(t){switch(t instanceof Error||typeof t=="object"&&t!==null||no('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new C2(t.message);case"MissingPDFException":return new _b(t.message);case"PasswordException":return new gZ(t.message,t.code);case"UnexpectedResponseException":return new tR(t.message,t.status);case"UnknownErrorException":return new fZ(t.message,t.details);default:return new fZ(t.message,t.toString())}}var gI,tg,dxe,uxe,Axe,_R,hxe;let fI=(hxe=class{constructor(t,e,i){Ae(this,tg),Ae(this,gI,new AbortController),this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),i.addEventListener("message",ne(this,tg,dxe).bind(this),{signal:Q(this,gI).signal})}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const r=this.callbackId++,o=Promise.withResolvers();this.callbackCapabilities[r]=o;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:r,data:e},i)}catch(n){o.reject(n)}return o.promise}sendWithStream(t,e,i,r){const o=this.streamId++,n=this.sourceName,s=this.targetName,a=this.comObj;return new ReadableStream({start:l=>{const c=Promise.withResolvers();return this.streamControllers[o]={controller:l,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},a.postMessage({sourceName:n,targetName:s,action:t,streamId:o,data:e,desiredSize:l.desiredSize},r),c.promise},pull:l=>{const c=Promise.withResolvers();return this.streamControllers[o].pullCall=c,a.postMessage({sourceName:n,targetName:s,stream:Vn.PULL,streamId:o,desiredSize:l.desiredSize}),c.promise},cancel:l=>{Gn(l instanceof Error,"cancel must have a valid reason");const c=Promise.withResolvers();return this.streamControllers[o].cancelCall=c,this.streamControllers[o].isClosed=!0,a.postMessage({sourceName:n,targetName:s,stream:Vn.CANCEL,streamId:o,reason:Fc(l)}),c.promise}},i)}destroy(){var t;(t=Q(this,gI))==null||t.abort(),oe(this,gI,null)}},gI=new WeakMap,tg=new WeakSet,dxe=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){ne(this,tg,Axe).call(this,t);return}if(t.callback){const i=t.callbackId,r=this.callbackCapabilities[i];if(!r)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],t.callback===UR.DATA)r.resolve(t.data);else if(t.callback===UR.ERROR)r.reject(Fc(t.reason));else throw new Error("Unexpected callback case");return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const i=this.sourceName,r=t.sourceName,o=this.comObj;new Promise(function(n){n(e(t.data))}).then(function(n){o.postMessage({sourceName:i,targetName:r,callback:UR.DATA,callbackId:t.callbackId,data:n})},function(n){o.postMessage({sourceName:i,targetName:r,callback:UR.ERROR,callbackId:t.callbackId,reason:Fc(n)})});return}if(t.streamId){ne(this,tg,uxe).call(this,t);return}e(t.data)},uxe=function(t){const e=t.streamId,i=this.sourceName,r=t.sourceName,o=this.comObj,n=this,s=this.actionHandler[t.action],a={enqueue(l,c=1,d){if(this.isCancelled)return;const u=this.desiredSize;this.desiredSize-=c,u>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:i,targetName:r,stream:Vn.ENQUEUE,streamId:e,chunk:l},d)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:Vn.CLOSE,streamId:e}),delete n.streamSinks[e])},error(l){Gn(l instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:Vn.ERROR,streamId:e,reason:Fc(l)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};a.sinkCapability.resolve(),a.ready=a.sinkCapability.promise,this.streamSinks[e]=a,new Promise(function(l){l(s(t.data,a))}).then(function(){o.postMessage({sourceName:i,targetName:r,stream:Vn.START_COMPLETE,streamId:e,success:!0})},function(l){o.postMessage({sourceName:i,targetName:r,stream:Vn.START_COMPLETE,streamId:e,reason:Fc(l)})})},Axe=function(t){const e=t.streamId,i=this.sourceName,r=t.sourceName,o=this.comObj,n=this.streamControllers[e],s=this.streamSinks[e];switch(t.stream){case Vn.START_COMPLETE:t.success?n.startCall.resolve():n.startCall.reject(Fc(t.reason));break;case Vn.PULL_COMPLETE:t.success?n.pullCall.resolve():n.pullCall.reject(Fc(t.reason));break;case Vn.PULL:if(!s){o.postMessage({sourceName:i,targetName:r,stream:Vn.PULL_COMPLETE,streamId:e,success:!0});break}s.desiredSize<=0&&t.desiredSize>0&&s.sinkCapability.resolve(),s.desiredSize=t.desiredSize,new Promise(function(a){var l;a((l=s.onPull)==null?void 0:l.call(s))}).then(function(){o.postMessage({sourceName:i,targetName:r,stream:Vn.PULL_COMPLETE,streamId:e,success:!0})},function(a){o.postMessage({sourceName:i,targetName:r,stream:Vn.PULL_COMPLETE,streamId:e,reason:Fc(a)})});break;case Vn.ENQUEUE:if(Gn(n,"enqueue should have stream controller"),n.isClosed)break;n.controller.enqueue(t.chunk);break;case Vn.CLOSE:if(Gn(n,"close should have stream controller"),n.isClosed)break;n.isClosed=!0,n.controller.close(),ne(this,tg,_R).call(this,n,e);break;case Vn.ERROR:Gn(n,"error should have stream controller"),n.controller.error(Fc(t.reason)),ne(this,tg,_R).call(this,n,e);break;case Vn.CANCEL_COMPLETE:t.success?n.cancelCall.resolve():n.cancelCall.reject(Fc(t.reason)),ne(this,tg,_R).call(this,n,e);break;case Vn.CANCEL:if(!s)break;new Promise(function(a){var l;a((l=s.onCancel)==null?void 0:l.call(s,Fc(t.reason)))}).then(function(){o.postMessage({sourceName:i,targetName:r,stream:Vn.CANCEL_COMPLETE,streamId:e,success:!0})},function(a){o.postMessage({sourceName:i,targetName:r,stream:Vn.CANCEL_COMPLETE,streamId:e,reason:Fc(a)})}),s.sinkCapability.reject(Fc(t.reason)),s.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},_R=async function(t,e){var i,r,o;await Promise.allSettled([(i=t.startCall)==null?void 0:i.promise,(r=t.pullCall)==null?void 0:r.promise,(o=t.cancelCall)==null?void 0:o.promise]),delete this.streamControllers[e]},hxe);var U9,OR;class cFi{constructor({parsedData:e,rawData:i}){Ae(this,U9),Ae(this,OR),oe(this,U9,e),oe(this,OR,i)}getRaw(){return Q(this,OR)}get(e){return Q(this,U9).get(e)??null}getAll(){return mZ(Q(this,U9))}has(e){return Q(this,U9).has(e)}}U9=new WeakMap,OR=new WeakMap;const _9=Symbol("INTERNAL");var HR,GR,jR,mI;class dFi{constructor(e,{name:i,intent:r,usage:o,rbGroups:n}){Ae(this,HR,!1),Ae(this,GR,!1),Ae(this,jR,!1),Ae(this,mI,!0),oe(this,HR,!!(e&Lc.DISPLAY)),oe(this,GR,!!(e&Lc.PRINT)),this.name=i,this.intent=r,this.usage=o,this.rbGroups=n}get visible(){if(Q(this,jR))return Q(this,mI);if(!Q(this,mI))return!1;const{print:e,view:i}=this.usage;return Q(this,HR)?i?.viewState!=="OFF":Q(this,GR)?e?.printState!=="OFF":!0}_setVisible(e,i,r=!1){e!==_9&&no("Internal method `_setVisible` called."),oe(this,jR,r),oe(this,mI,i)}}HR=new WeakMap,GR=new WeakMap,jR=new WeakMap,mI=new WeakMap;var T2,lo,vI,CI,VR,sX;class uFi{constructor(e,i=Lc.DISPLAY){if(Ae(this,VR),Ae(this,T2,null),Ae(this,lo,new Map),Ae(this,vI,null),Ae(this,CI,null),this.renderingIntent=i,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,oe(this,CI,e.order);for(const r of e.groups)Q(this,lo).set(r.id,new dFi(i,r));if(e.baseState==="OFF")for(const r of Q(this,lo).values())r._setVisible(_9,!1);for(const r of e.on)Q(this,lo).get(r)._setVisible(_9,!0);for(const r of e.off)Q(this,lo).get(r)._setVisible(_9,!1);oe(this,vI,this.getHash())}}isVisible(e){if(Q(this,lo).size===0)return!0;if(!e)return eR("Optional content group not defined."),!0;if(e.type==="OCG")return Q(this,lo).has(e.id)?Q(this,lo).get(e.id).visible:(ir(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return ne(this,VR,sX).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(const i of e.ids){if(!Q(this,lo).has(i))return ir(`Optional content group not found: ${i}`),!0;if(Q(this,lo).get(i).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const i of e.ids){if(!Q(this,lo).has(i))return ir(`Optional content group not found: ${i}`),!0;if(!Q(this,lo).get(i).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const i of e.ids){if(!Q(this,lo).has(i))return ir(`Optional content group not found: ${i}`),!0;if(!Q(this,lo).get(i).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const i of e.ids){if(!Q(this,lo).has(i))return ir(`Optional content group not found: ${i}`),!0;if(Q(this,lo).get(i).visible)return!1}return!0}return ir(`Unknown optional content policy ${e.policy}.`),!0}return ir(`Unknown group type ${e.type}.`),!0}setVisibility(e,i=!0,r=!0){var o;const n=Q(this,lo).get(e);if(!n){ir(`Optional content group not found: ${e}`);return}if(r&&i&&n.rbGroups.length)for(const s of n.rbGroups)for(const a of s)a!==e&&((o=Q(this,lo).get(a))==null||o._setVisible(_9,!1,!0));n._setVisible(_9,!!i,!0),oe(this,T2,null)}setOCGState({state:e,preserveRB:i}){let r;for(const o of e){switch(o){case"ON":case"OFF":case"Toggle":r=o;continue}const n=Q(this,lo).get(o);if(n)switch(r){case"ON":this.setVisibility(o,!0,i);break;case"OFF":this.setVisibility(o,!1,i);break;case"Toggle":this.setVisibility(o,!n.visible,i);break}}oe(this,T2,null)}get hasInitialVisibility(){return Q(this,vI)===null||this.getHash()===Q(this,vI)}getOrder(){return Q(this,lo).size?Q(this,CI)?Q(this,CI).slice():[...Q(this,lo).keys()]:null}getGroups(){return Q(this,lo).size>0?mZ(Q(this,lo)):null}getGroup(e){return Q(this,lo).get(e)||null}getHash(){if(Q(this,T2)!==null)return Q(this,T2);const e=new GEe;for(const[i,r]of Q(this,lo))e.update(`${i}:${r.visible}`);return oe(this,T2,e.hexdigest())}}T2=new WeakMap,lo=new WeakMap,vI=new WeakMap,CI=new WeakMap,VR=new WeakSet,sX=function(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let r=1;r<e;r++){const o=t[r];let n;if(Array.isArray(o))n=ne(this,VR,sX).call(this,o);else if(Q(this,lo).has(o))n=Q(this,lo).get(o).visible;else return ir(`Optional content group not found: ${o}`),!0;switch(i){case"And":if(!n)return!1;break;case"Or":if(n)return!0;break;case"Not":return!n;default:return!0}}return i==="And"};class AFi{constructor(e,{disableRange:i=!1,disableStream:r=!1}){Gn(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:o,initialData:n,progressiveDone:s,contentDispositionFilename:a}=e;if(this._queuedChunks=[],this._progressiveDone=s,this._contentDispositionFilename=a,n?.length>0){const l=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!r,this._isRangeSupported=!i,this._contentLength=o,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),e.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:i}){const r=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const o=this._rangeReaders.some(function(n){return n._begin!==e?!1:(n._enqueue(r),!0)});Gn(o,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}_onProgress(e){var i,r,o,n;e.total===void 0?(r=(i=this._rangeReaders[0])==null?void 0:i.onProgress)==null||r.call(i,{loaded:e.loaded}):(n=(o=this._fullRequestReader)==null?void 0:o.onProgress)==null||n.call(o,{loaded:e.loaded,total:e.total})}_onProgressiveDone(){var e;(e=this._fullRequestReader)==null||e.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const i=this._rangeReaders.indexOf(e);i>=0&&this._rangeReaders.splice(i,1)}getFullReader(){Gn(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new hFi(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new pFi(this,e,i);return this._pdfDataRangeTransport.requestDataRange(e,i),this._rangeReaders.push(r),r}cancelAllRequests(e){var i;(i=this._fullRequestReader)==null||i.cancel(e);for(const r of this._rangeReaders.slice(0))r.cancel(e);this._pdfDataRangeTransport.abort()}}class hFi{constructor(e,i,r=!1,o=null){this._stream=e,this._done=r||!1,this._filename=BZ(o)?o:null,this._queuedChunks=i||[],this._loaded=0;for(const n of this._queuedChunks)this._loaded+=n.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.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 e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class pFi{constructor(e,i,r){this._stream=e,this._begin=i,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const i of this._requests)i.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 i=this._queuedChunk;return this._queuedChunk=null,{value:i,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function gFi(t){let e=!0,i=r("filename\\*","i").exec(t);if(i){i=i[1];let d=a(i);return d=unescape(d),d=l(d),d=c(d),n(d)}if(i=s(t),i){const d=c(i);return n(d)}if(i=r("filename","i").exec(t),i){i=i[1];let d=a(i);return d=c(d),n(d)}function r(d,u){return new RegExp("(?:^|;)\\s*"+d+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',u)}function o(d,u){if(d){if(!/^[\x00-\xFF]+$/.test(u))return u;try{const A=new TextDecoder(d,{fatal:!0}),h=iR(u);u=A.decode(h),e=!1}catch{}}return u}function n(d){return e&&/[\x80-\xff]/.test(d)&&(d=o("utf-8",d),e&&(d=o("iso-8859-1",d))),d}function s(d){const u=[];let A;const h=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(A=h.exec(d))!==null;){let[,p,m,f]=A;if(p=parseInt(p,10),p in u){if(p===0)break;continue}u[p]=[m,f]}const g=[];for(let p=0;p<u.length&&p in u;++p){let[m,f]=u[p];f=a(f),m&&(f=unescape(f),p===0&&(f=l(f))),g.push(f)}return g.join("")}function a(d){if(d.startsWith('"')){const u=d.slice(1).split('\\"');for(let A=0;A<u.length;++A){const h=u[A].indexOf('"');h!==-1&&(u[A]=u[A].slice(0,h),u.length=A+1),u[A]=u[A].replaceAll(/\\(.)/g,"$1")}d=u.join('"')}return d}function l(d){const u=d.indexOf("'");if(u===-1)return d;const A=d.slice(0,u),h=d.slice(u+1).replace(/^[^']*'/,"");return o(A,h)}function c(d){return!d.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(d)?d:d.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(u,A,h,g){if(h==="q"||h==="Q")return g=g.replaceAll("_"," "),g=g.replaceAll(/=([0-9a-fA-F]{2})/g,function(p,m){return String.fromCharCode(parseInt(m,16))}),o(A,g);try{g=atob(g)}catch{}return o(A,g)})}return""}function pxe(t,e){const i=new Headers;if(!t||!e||typeof e!="object")return i;for(const r in e){const o=e[r];o!==void 0&&i.append(r,o)}return i}function qR(t){try{return new URL(t).origin}catch{}return null}function gxe({responseHeaders:t,isHttp:e,rangeChunkSize:i,disableRange:r}){const o={allowRangeRequests:!1,suggestedLength:void 0},n=parseInt(t.get("Content-Length"),10);return!Number.isInteger(n)||(o.suggestedLength=n,n<=2*i)||r||!e||t.get("Accept-Ranges")!=="bytes"||(t.get("Content-Encoding")||"identity")!=="identity"||(o.allowRangeRequests=!0),o}function fxe(t){const e=t.get("Content-Disposition");if(e){let i=gFi(e);if(i.includes("%"))try{i=decodeURIComponent(i)}catch{}if(BZ(i))return i}return null}function zR(t,e){return t===404||t===0&&e.startsWith("file:")?new _b('Missing PDF "'+e+'".'):new tR(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function mxe(t){return t===200||t===206}function vxe(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Cxe(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(ir(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class yxe{constructor(e){ii(this,"_responseOrigin",null),this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=pxe(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return Gn(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new fFi(this),this._fullRequestReader}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new mFi(this,e,i);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var i;(i=this._fullRequestReader)==null||i.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class fFi{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const i=e.source;this._withCredentials=i.withCredentials||!1,this._contentLength=i.length,this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange;const r=new Headers(e.headers),o=i.url;fetch(o,vxe(r,this._withCredentials,this._abortController)).then(n=>{if(e._responseOrigin=qR(n.url),!mxe(n.status))throw zR(n.status,o);this._reader=n.body.getReader(),this._headersCapability.resolve();const s=n.headers,{allowRangeRequests:a,suggestedLength:l}=gxe({responseHeaders:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=l||this._contentLength,this._filename=fxe(s),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new C2("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 e;await this._headersCapability.promise;const{value:i,done:r}=await this._reader.read();return r?{value:i,done:r}:(this._loaded+=i.byteLength,(e=this.onProgress)==null||e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:Cxe(i),done:!1})}cancel(e){var i;(i=this._reader)==null||i.cancel(e),this._abortController.abort()}}class mFi{constructor(e,i,r){this._stream=e,this._reader=null,this._loaded=0;const o=e.source;this._withCredentials=o.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!o.disableStream,this._abortController=new AbortController;const n=new Headers(e.headers);n.append("Range",`bytes=${i}-${r-1}`);const s=o.url;fetch(s,vxe(n,this._withCredentials,this._abortController)).then(a=>{const l=qR(a.url);if(l!==e._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${e._responseOrigin}".`);if(!mxe(a.status))throw zR(a.status,s);this._readCapability.resolve(),this._reader=a.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._readCapability.promise;const{value:i,done:r}=await this._reader.read();return r?{value:i,done:r}:(this._loaded+=i.byteLength,(e=this.onProgress)==null||e.call(this,{loaded:this._loaded}),{value:Cxe(i),done:!1})}cancel(e){var i;(i=this._reader)==null||i.cancel(e),this._abortController.abort()}}const aX=200,lX=206;function vFi(t){const e=t.response;return typeof e!="string"?e:iR(e).buffer}class CFi{constructor({url:e,httpHeaders:i,withCredentials:r}){ii(this,"_responseOrigin",null),this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=pxe(this.isHttp,i),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,i,r){const o={begin:e,end:i};for(const n in r)o[n]=r[n];return this.request(o)}requestFull(e){return this.request(e)}request(e){const i=new XMLHttpRequest,r=this.currXhrId++,o=this.pendingRequests[r]={xhr:i};i.open("GET",this.url),i.withCredentials=this.withCredentials;for(const[n,s]of this.headers)i.setRequestHeader(n,s);return this.isHttp&&"begin"in e&&"end"in e?(i.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),o.expectedStatus=lX):o.expectedStatus=aX,i.responseType="arraybuffer",e.onError&&(i.onerror=function(n){e.onError(i.status)}),i.onreadystatechange=this.onStateChange.bind(this,r),i.onprogress=this.onProgress.bind(this,r),o.onHeadersReceived=e.onHeadersReceived,o.onDone=e.onDone,o.onError=e.onError,o.onProgress=e.onProgress,i.send(null),r}onProgress(e,i){var r;const o=this.pendingRequests[e];o&&((r=o.onProgress)==null||r.call(o,i))}onStateChange(e,i){var r,o,n;const s=this.pendingRequests[e];if(!s)return;const a=s.xhr;if(a.readyState>=2&&s.onHeadersReceived&&(s.onHeadersReceived(),delete s.onHeadersReceived),a.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],a.status===0&&this.isHttp){(r=s.onError)==null||r.call(s,a.status);return}const l=a.status||aX;if(!(l===aX&&s.expectedStatus===lX)&&l!==s.expectedStatus){(o=s.onError)==null||o.call(s,a.status);return}const c=vFi(a);if(l===lX){const d=a.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(d);s.onDone({begin:parseInt(u[1],10),chunk:c})}else c?s.onDone({begin:0,chunk:c}):(n=s.onError)==null||n.call(s,a.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const i=this.pendingRequests[e].xhr;delete this.pendingRequests[e],i.abort()}}class yFi{constructor(e){this._source=e,this._manager=new CFi(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const i=this._rangeRequestReaders.indexOf(e);i>=0&&this._rangeRequestReaders.splice(i,1)}getFullReader(){return Gn(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new wFi(this._manager,this._source),this._fullRequestReader}getRangeReader(e,i){const r=new bFi(this._manager,e,i);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var i;(i=this._fullRequestReader)==null||i.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class wFi{constructor(e,i){this._manager=e;const r={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=i.url,this._fullRequestId=e.requestFull(r),this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._contentLength=i.length,this._rangeChunkSize=i.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,i=this._manager.getRequestXhr(e);this._manager._responseOrigin=qR(i.responseURL);const r=i.getAllResponseHeaders(),o=new Headers(r?r.trim().split(/[\r\n]+/).map(a=>{const[l,...c]=a.split(": ");return[l,c.join(": ")]}):[]),{allowRangeRequests:n,suggestedLength:s}=gxe({responseHeaders:o,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=fxe(o),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.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 i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=zR(e,this._url),this._headersCapability.reject(this._storedError);for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){var i;(i=this.onProgress)==null||i.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._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class bFi{constructor(e,i,r){this._manager=e;const o={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(i,r,o),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var e;const i=qR((e=this._manager.getRequestXhr(this._requestId))==null?void 0:e.responseURL);i!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${i}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){var e;(e=this.onClosed)==null||e.call(this,this)}_onDone(e){const i=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:i,done:!1}):this._queuedChunk=i,this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??(this._storedError=zR(e,this._url));for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){var i;this.isStreamingSupported||(i=this.onProgress)==null||i.call(this,{loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const i=this._queuedChunk;return this._queuedChunk=null,{value:i,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const IFi=/^[a-z][a-z0-9\-+.]+:/i;function BFi(t){if(IFi.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}class EFi{constructor(e){this.source=e,this.url=BFi(e.url),Gn(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return Gn(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new xFi(this),this._fullRequestReader}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new kFi(this,e,i);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var i;(i=this._fullRequestReader)==null||i.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class xFi{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const i=e.source;this._contentLength=i.length,this._loaded=0,this._filename=null,this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const r=process.getBuiltinModule("fs");r.promises.lstat(this._url).then(o=>{this._contentLength=o.size,this._setReadableStream(r.createReadStream(this._url)),this._headersCapability.resolve()},o=>{o.code==="ENOENT"&&(o=new _b(`Missing PDF "${this._url}".`)),this._storedError=o,this._headersCapability.reject(o)})}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 e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const i=this._readableStream.read();return i===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=i.length,(e=this.onProgress)==null||e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(i).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",i=>{this._error(i)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new C2("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class kFi{constructor(e,i,r){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const o=e.source;this._isStreamingSupported=!o.disableStream;const n=process.getBuiltinModule("fs");this._setReadableStream(n.createReadStream(this._url,{start:i,end:r-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const i=this._readableStream.read();return i===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=i.length,(e=this.onProgress)==null||e.call(this,{loaded:this._loaded}),{value:new Uint8Array(i).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",i=>{this._error(i)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const MFi=1e5,Yl=30,SFi=.8;var wxe,F2,Nc,KR,JR,N2,ig,YR,WR,O9,yI,wI,U2,bI,ZR,II,H9,XR,$R,G9,j9,eL,_2,BI,V9,bxe,Ixe,cX,_1,tL,dX,Bxe,Exe;const Wl=class pE{constructor({textContentSource:e,container:i,viewport:r}){Ae(this,V9),Ae(this,F2,Promise.withResolvers()),Ae(this,Nc,null),Ae(this,KR,!1),Ae(this,JR,!!((wxe=globalThis.FontInspector)!=null&&wxe.enabled)),Ae(this,N2,null),Ae(this,ig,null),Ae(this,YR,0),Ae(this,WR,0),Ae(this,O9,null),Ae(this,yI,null),Ae(this,wI,0),Ae(this,U2,0),Ae(this,bI,Object.create(null)),Ae(this,ZR,[]),Ae(this,II,null),Ae(this,H9,[]),Ae(this,XR,new WeakMap),Ae(this,$R,null);var o;if(e instanceof ReadableStream)oe(this,II,e);else if(typeof e=="object")oe(this,II,new ReadableStream({start(c){c.enqueue(e),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');oe(this,Nc,oe(this,yI,i)),oe(this,U2,r.scale*(globalThis.devicePixelRatio||1)),oe(this,wI,r.rotation),oe(this,ig,{div:null,properties:null,ctx:null});const{pageWidth:n,pageHeight:s,pageX:a,pageY:l}=r.rawDims;oe(this,$R,[1,0,0,-1,-a,l+s]),oe(this,WR,n),oe(this,YR,s),ne(o=pE,_1,Bxe).call(o),w2(i,r),Q(this,F2).promise.finally(()=>{Q(pE,BI).delete(this),oe(this,ig,null),oe(this,bI,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:i}=al.platform;return cr(this,"fontFamilyMap",new Map([["sans-serif",`${e&&i?"Calibri, ":""}sans-serif`],["monospace",`${e&&i?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{Q(this,O9).read().then(({value:i,done:r})=>{if(r){Q(this,F2).resolve();return}Q(this,N2)??oe(this,N2,i.lang),Object.assign(Q(this,bI),i.styles),ne(this,V9,bxe).call(this,i.items),e()},Q(this,F2).reject)};return oe(this,O9,Q(this,II).getReader()),Q(pE,BI).add(this),e(),Q(this,F2).promise}update({viewport:e,onBefore:i=null}){var r;const o=e.scale*(globalThis.devicePixelRatio||1),n=e.rotation;if(n!==Q(this,wI)&&(i?.(),oe(this,wI,n),w2(Q(this,yI),{rotation:n})),o!==Q(this,U2)){i?.(),oe(this,U2,o);const s={div:null,properties:null,ctx:ne(r=pE,_1,tL).call(r,Q(this,N2))};for(const a of Q(this,H9))s.properties=Q(this,XR).get(a),s.div=a,ne(this,V9,cX).call(this,s)}}cancel(){var e;const i=new C2("TextLayer task cancelled.");(e=Q(this,O9))==null||e.cancel(i).catch(()=>{}),oe(this,O9,null),Q(this,F2).reject(i)}get textDivs(){return Q(this,H9)}get textContentItemsStr(){return Q(this,ZR)}static cleanup(){if(!(Q(this,BI).size>0)){Q(this,G9).clear();for(const{canvas:e}of Q(this,j9).values())e.remove();Q(this,j9).clear()}}};F2=new WeakMap,Nc=new WeakMap,KR=new WeakMap,JR=new WeakMap,N2=new WeakMap,ig=new WeakMap,YR=new WeakMap,WR=new WeakMap,O9=new WeakMap,yI=new WeakMap,wI=new WeakMap,U2=new WeakMap,bI=new WeakMap,ZR=new WeakMap,II=new WeakMap,H9=new WeakMap,XR=new WeakMap,$R=new WeakMap,G9=new WeakMap,j9=new WeakMap,eL=new WeakMap,_2=new WeakMap,BI=new WeakMap,V9=new WeakSet,bxe=function(t){var e,i;if(Q(this,KR))return;(i=Q(this,ig)).ctx??(i.ctx=ne(e=Wl,_1,tL).call(e,Q(this,N2)));const r=Q(this,H9),o=Q(this,ZR);for(const n of t){if(r.length>MFi){ir("Ignoring additional textDivs for performance reasons."),oe(this,KR,!0);return}if(n.str===void 0){if(n.type==="beginMarkedContentProps"||n.type==="beginMarkedContent"){const s=Q(this,Nc);oe(this,Nc,document.createElement("span")),Q(this,Nc).classList.add("markedContent"),n.id!==null&&Q(this,Nc).setAttribute("id",`${n.id}`),s.append(Q(this,Nc))}else n.type==="endMarkedContent"&&oe(this,Nc,Q(this,Nc).parentNode);continue}o.push(n.str),ne(this,V9,Ixe).call(this,n)}},Ixe=function(t){var e;const i=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};Q(this,H9).push(i);const o=Ci.transform(Q(this,$R),t.transform);let n=Math.atan2(o[1],o[0]);const s=Q(this,bI)[t.fontName];s.vertical&&(n+=Math.PI/2);let a=Q(this,JR)&&s.fontSubstitution||s.fontFamily;a=Wl.fontFamilyMap.get(a)||a;const l=Math.hypot(o[2],o[3]),c=l*ne(e=Wl,_1,Exe).call(e,a,Q(this,N2));let d,u;n===0?(d=o[4],u=o[5]-c):(d=o[4]+c*Math.sin(n),u=o[5]-c*Math.cos(n));const A="calc(var(--scale-factor)*",h=i.style;Q(this,Nc)===Q(this,yI)?(h.left=`${(100*d/Q(this,WR)).toFixed(2)}%`,h.top=`${(100*u/Q(this,YR)).toFixed(2)}%`):(h.left=`${A}${d.toFixed(2)}px)`,h.top=`${A}${u.toFixed(2)}px)`),h.fontSize=`${A}${(Q(Wl,_2)*l).toFixed(2)}px)`,h.fontFamily=a,r.fontSize=l,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,Q(this,JR)&&(i.dataset.fontName=s.fontSubstitutionLoadedName||t.fontName),n!==0&&(r.angle=n*(180/Math.PI));let g=!1;if(t.str.length>1)g=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const p=Math.abs(t.transform[0]),m=Math.abs(t.transform[3]);p!==m&&Math.max(p,m)/Math.min(p,m)>1.5&&(g=!0)}if(g&&(r.canvasWidth=s.vertical?t.height:t.width),Q(this,XR).set(i,r),Q(this,ig).div=i,Q(this,ig).properties=r,ne(this,V9,cX).call(this,Q(this,ig)),r.hasText&&Q(this,Nc).append(i),r.hasEOL){const p=document.createElement("br");p.setAttribute("role","presentation"),Q(this,Nc).append(p)}},cX=function(t){var e;const{div:i,properties:r,ctx:o}=t,{style:n}=i;let s="";if(Q(Wl,_2)>1&&(s=`scale(${1/Q(Wl,_2)})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:a}=n,{canvasWidth:l,fontSize:c}=r;ne(e=Wl,_1,dX).call(e,o,c*Q(this,U2),a);const{width:d}=o.measureText(i.textContent);d>0&&(s=`scaleX(${l*Q(this,U2)/d}) ${s}`)}r.angle!==0&&(s=`rotate(${r.angle}deg) ${s}`),s.length>0&&(n.transform=s)},_1=new WeakSet,tL=function(t=null){let e=Q(this,j9).get(t||(t=""));if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),Q(this,j9).set(t,e),Q(this,eL).set(e,{size:0,family:""})}return e},dX=function(t,e,i){const r=Q(this,eL).get(t);e===r.size&&i===r.family||(t.font=`${e}px ${i}`,r.size=e,r.family=i)},Bxe=function(){if(Q(this,_2)!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),oe(this,_2,t.getBoundingClientRect().height),t.remove()},Exe=function(t,e){const i=Q(this,G9).get(t);if(i)return i;const r=ne(this,_1,tL).call(this,e);r.canvas.width=r.canvas.height=Yl,ne(this,_1,dX).call(this,r,Yl,t);const o=r.measureText("");let n=o.fontBoundingBoxAscent,s=Math.abs(o.fontBoundingBoxDescent);if(n){const c=n/(n+s);return Q(this,G9).set(t,c),r.canvas.width=r.canvas.height=0,c}r.strokeStyle="red",r.clearRect(0,0,Yl,Yl),r.strokeText("g",0,0);let a=r.getImageData(0,0,Yl,Yl).data;s=0;for(let c=a.length-1-3;c>=0;c-=4)if(a[c]>0){s=Math.ceil(c/4/Yl);break}r.clearRect(0,0,Yl,Yl),r.strokeText("A",0,Yl),a=r.getImageData(0,0,Yl,Yl).data,n=0;for(let c=0,d=a.length;c<d;c+=4)if(a[c]>0){n=Yl-Math.floor(c/4/Yl);break}r.canvas.width=r.canvas.height=0;const l=n?n/(n+s):SFi;return Q(this,G9).set(t,l),l},Ae(Wl,_1),Ae(Wl,G9,new Map),Ae(Wl,j9,new Map),Ae(Wl,eL,new WeakMap),Ae(Wl,_2,null),Ae(Wl,BI,new Set);let uX=Wl;class kE{static textContent(e){const i=[],r={items:i,styles:Object.create(null)};function o(n){var s;if(!n)return;let a=null;const l=n.name;if(l==="#text")a=n.value;else if(kE.shouldBuildText(l))(s=n?.attributes)!=null&&s.textContent?a=n.attributes.textContent:n.value&&(a=n.value);else return;if(a!==null&&i.push({str:a}),!!n.children)for(const c of n.children)o(c)}return o(e),r}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}const QFi=65536,PFi=100,DFi=5e3,RFi=sl?qTi:GTi,LFi=sl?zTi:KEe,TFi=sl?VTi:jTi,FFi=sl?KTi:ZEe;function NFi(t={}){typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new OFi,{docId:i}=e,r=t.url?UFi(t.url):null,o=t.data?_Fi(t.data):null,n=t.httpHeaders||null,s=t.withCredentials===!0,a=t.password??null,l=t.range instanceof Mxe?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:QFi;let d=t.worker instanceof nL?t.worker:null;const u=t.verbosity,A=typeof t.docBaseUrl=="string"&&!nR(t.docBaseUrl)?t.docBaseUrl:null,h=typeof t.cMapUrl=="string"?t.cMapUrl:null,g=t.cMapPacked!==!1,p=t.CMapReaderFactory||LFi,m=typeof t.standardFontDataUrl=="string"?t.standardFontDataUrl:null,f=t.StandardFontDataFactory||FFi,v=t.stopAtErrors!==!0,C=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,y=t.isEvalSupported!==!1,w=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!sl,b=typeof t.isImageDecoderSupported=="boolean"?t.isImageDecoderSupported:!sl&&(al.platform.isFirefox||!globalThis.chrome),E=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,x=typeof t.disableFontFace=="boolean"?t.disableFontFace:sl,M=t.fontExtraProperties===!0,k=t.enableXfa===!0,S=t.ownerDocument||globalThis.document,D=t.disableRange===!0,T=t.disableStream===!0,U=t.disableAutoFetch===!0,G=t.pdfBug===!0,N=t.CanvasFactory||RFi,H=t.FilterFactory||TFi,Y=t.enableHWA===!0,re=l?l.length:t.length??NaN,ue=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!sl&&!x,Me=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:p===KEe&&f===ZEe&&h&&m&&Ob(h,document.baseURI)&&Ob(m,document.baseURI);t.canvasFactory&&hEe("`canvasFactory`-instance option, please use `CanvasFactory` instead."),t.filterFactory&&hEe("`filterFactory`-instance option, please use `FilterFactory` instead.");const me=null;mTi(u);const ke={canvasFactory:new N({ownerDocument:S,enableHWA:Y}),filterFactory:new H({docId:i,ownerDocument:S}),cMapReaderFactory:Me?null:new p({baseUrl:h,isCompressed:g}),standardFontDataFactory:Me?null:new f({baseUrl:m})};if(!d){const Be={verbosity:u,port:eg.workerPort};d=Be.port?nL.fromPort(Be):new nL(Be),e._worker=d}const he={docId:i,apiVersion:"4.9.124",data:o,password:a,disableAutoFetch:U,rangeChunkSize:c,length:re,docBaseUrl:A,enableXfa:k,evaluatorOptions:{maxImageSize:C,disableFontFace:x,ignoreErrors:v,isEvalSupported:y,isOffscreenCanvasSupported:w,isImageDecoderSupported:b,canvasMaxAreaInBytes:E,fontExtraProperties:M,useSystemFonts:ue,cMapUrl:Me?h:null,standardFontDataUrl:Me?m:null}},Le={disableFontFace:x,fontExtraProperties:M,ownerDocument:S,pdfBug:G,styleElement:me,loadingParams:{disableAutoFetch:U,enableXfa:k}};return d.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const Be=d.messageHandler.sendWithPromise("GetDocRequest",he,o?[o.buffer]:null);let X;if(l)X=new AFi(l,{disableRange:D,disableStream:T});else if(!o){if(!r)throw new Error("getDocument - no `url` parameter provided.");let le;if(sl)if(Ob(r)){if(typeof fetch>"u"||typeof Response>"u"||!("body"in Response.prototype))throw new Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`.");le=yxe}else le=EFi;else le=Ob(r)?yxe:yFi;X=new le({url:r,length:re,httpHeaders:n,withCredentials:s,rangeChunkSize:c,disableRange:D,disableStream:T})}return Be.then(le=>{if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const ae=new fI(i,le,d.port),pe=new VFi(ae,e,X,Le,ke);e._transport=pe,ae.send("Ready",null)})}).catch(e._capability.reject),e}function UFi(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(sl&&typeof t=="string")return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function _Fi(t){if(sl&&typeof Buffer<"u"&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if(typeof t=="string")return iR(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||typeof t=="object"&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function xxe(t){return typeof t=="object"&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0}var AX;const kxe=class mDe{constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${Il(mDe,AX)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var e,i,r,o;this.destroyed=!0;try{(e=this._worker)!=null&&e.port&&(this._worker._pendingDestroy=!0),await((i=this._transport)==null?void 0:i.destroy())}catch(n){throw(r=this._worker)!=null&&r.port&&delete this._worker._pendingDestroy,n}this._transport=null,(o=this._worker)==null||o.destroy(),this._worker=null}};AX=new WeakMap,Ae(kxe,AX,0);let OFi=kxe;class Mxe{constructor(e,i,r=!1,o=null){this.length=e,this.initialData=i,this.progressiveDone=r,this.contentDispositionFilename=o,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,i){for(const r of this._rangeListeners)r(e,i)}onDataProgress(e,i){this._readyCapability.promise.then(()=>{for(const r of this._progressListeners)r(e,i)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const i of this._progressiveReadListeners)i(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,i){no("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class HFi{constructor(e,i){this._pdfInfo=e,this._transport=i}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return cr(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(i)}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(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var O2,rg,KA,q9,iL;class GFi{constructor(e,i,r,o=!1){Ae(this,KA),Ae(this,O2,null),Ae(this,rg,!1),this._pageIndex=e,this._pageInfo=i,this._transport=r,this._stats=o?new AEe:null,this._pdfBug=o,this.commonObjs=r.commonObjs,this.objs=new Sxe,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:e,rotation:i=this.rotate,offsetX:r=0,offsetY:o=0,dontFlip:n=!1}={}){return new xE({viewBox:this.view,scale:e,rotation:i,offsetX:r,offsetY:o,dontFlip:n})}getAnnotations({intent:e="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,i)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return cr(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var e;return((e=this._transport._htmlForXfa)==null?void 0:e.children[this._pageIndex])||null}render({canvasContext:e,viewport:i,intent:r="display",annotationMode:o=Vp.ENABLE,transform:n=null,background:s=null,optionalContentConfigPromise:a=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:d=null,isEditing:u=!1}){var A,h;(A=this._stats)==null||A.time("Overall");const g=this._transport.getRenderingIntent(r,o,d,u),{renderingIntent:p,cacheKey:m}=g;oe(this,rg,!1),ne(this,KA,iL).call(this),a||(a=this._transport.getOptionalContentConfig(p));let f=this._intentStates.get(m);f||(f=Object.create(null),this._intentStates.set(m,f)),f.streamReaderCancelTimeout&&(clearTimeout(f.streamReaderCancelTimeout),f.streamReaderCancelTimeout=null);const v=!!(p&Lc.PRINT);f.displayReadyCapability||(f.displayReadyCapability=Promise.withResolvers(),f.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(h=this._stats)==null||h.time("Page Request"),this._pumpOperatorList(g));const C=b=>{var E;f.renderTasks.delete(y),(this._maybeCleanupAfterRender||v)&&oe(this,rg,!0),ne(this,KA,q9).call(this,!v),b?(y.capability.reject(b),this._abortOperatorList({intentState:f,reason:b instanceof Error?b:new Error(b)})):y.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(E=globalThis.Stats)!=null&&E.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},y=new zFi({callback:C,params:{canvasContext:e,viewport:i,transform:n,background:s},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:f.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:c});(f.renderTasks||(f.renderTasks=new Set)).add(y);const w=y.task;return Promise.all([f.displayReadyCapability.promise,a]).then(([b,E])=>{var x;if(this.destroyed){C();return}if((x=this._stats)==null||x.time("Rendering"),!(E.renderingIntent&p))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");y.initializeGraphics({transparency:b,optionalContentConfig:E}),y.operatorListChanged()}).catch(C),w}getOperatorList({intent:e="display",annotationMode:i=Vp.ENABLE,printAnnotationStorage:r=null,isEditing:o=!1}={}){var n;function s(){l.operatorList.lastChunk&&(l.opListReadCapability.resolve(l.operatorList),l.renderTasks.delete(c))}const a=this._transport.getRenderingIntent(e,i,r,o,!0);let l=this._intentStates.get(a.cacheKey);l||(l=Object.create(null),this._intentStates.set(a.cacheKey,l));let c;return l.opListReadCapability||(c=Object.create(null),c.operatorListChanged=s,l.opListReadCapability=Promise.withResolvers(),(l.renderTasks||(l.renderTasks=new Set)).add(c),l.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(n=this._stats)==null||n.time("Page Request"),this._pumpOperatorList(a)),l.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:i=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:i===!0},{highWaterMark:100,size(r){return r.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>kE.textContent(r));const i=this.streamTextContent(e);return new Promise(function(r,o){function n(){s.read().then(function({value:l,done:c}){if(c){r(a);return}a.lang??(a.lang=l.lang),Object.assign(a.styles,l.styles),a.items.push(...l.items),n()},o)}const s=i.getReader(),a={items:[],styles:Object.create(null),lang:null};n()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const i of this._intentStates.values())if(this._abortOperatorList({intentState:i,reason:new Error("Page was destroyed."),force:!0}),!i.opListReadCapability)for(const r of i.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),oe(this,rg,!1),ne(this,KA,iL).call(this),Promise.all(e)}cleanup(e=!1){oe(this,rg,!0);const i=ne(this,KA,q9).call(this,!1);return e&&i&&this._stats&&(this._stats=new AEe),i}_startRenderPage(e,i){var r,o;const n=this._intentStates.get(i);n&&((r=this._stats)==null||r.timeEnd("Page Request"),(o=n.displayReadyCapability)==null||o.resolve(e))}_renderPageChunk(e,i){for(let r=0,o=e.length;r<o;r++)i.operatorList.fnArray.push(e.fnArray[r]),i.operatorList.argsArray.push(e.argsArray[r]);i.operatorList.lastChunk=e.lastChunk,i.operatorList.separateAnnots=e.separateAnnots;for(const r of i.renderTasks)r.operatorListChanged();e.lastChunk&&ne(this,KA,q9).call(this,!0)}_pumpOperatorList({renderingIntent:e,cacheKey:i,annotationStorageSerializable:r,modifiedIds:o}){const{map:n,transfer:s}=r,a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:n,modifiedIds:o},s).getReader(),l=this._intentStates.get(i);l.streamReader=a;const c=()=>{a.read().then(({value:d,done:u})=>{if(u){l.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,l),c())},d=>{if(l.streamReader=null,!this._transport.destroyed){if(l.operatorList){l.operatorList.lastChunk=!0;for(const u of l.renderTasks)u.operatorListChanged();ne(this,KA,q9).call(this,!0)}if(l.displayReadyCapability)l.displayReadyCapability.reject(d);else if(l.opListReadCapability)l.opListReadCapability.reject(d);else throw d}})};c()}_abortOperatorList({intentState:e,reason:i,force:r=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(i instanceof IZ){let o=PFi;i.extraDelay>0&&i.extraDelay<1e3&&(o+=i.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:i,force:!0})},o);return}}if(e.streamReader.cancel(new C2(i.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[o,n]of this._intentStates)if(n===e){this._intentStates.delete(o);break}this.cleanup()}}}get stats(){return this._stats}}O2=new WeakMap,rg=new WeakMap,KA=new WeakSet,q9=function(t=!1){if(ne(this,KA,iL).call(this),!Q(this,rg)||this.destroyed)return!1;if(t)return oe(this,O2,setTimeout(()=>{oe(this,O2,null),ne(this,KA,q9).call(this,!1)},DFi)),!1;for(const{renderTasks:e,operatorList:i}of this._intentStates.values())if(e.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),oe(this,rg,!1),!0},iL=function(){Q(this,O2)&&(clearTimeout(Q(this,O2)),oe(this,O2,null))};var og,hX;class jFi{constructor(){Ae(this,og,new Map),Ae(this,hX,Promise.resolve())}postMessage(e,i){const r={data:structuredClone(e,i?{transfer:i}:null)};Q(this,hX).then(()=>{for(const[o]of Q(this,og))o.call(this,r)})}addEventListener(e,i,r=null){let o=null;if(r?.signal instanceof AbortSignal){const{signal:n}=r;if(n.aborted){ir("LoopbackPort - cannot use an `aborted` signal.");return}const s=()=>this.removeEventListener(e,i);o=()=>n.removeEventListener("abort",s),n.addEventListener("abort",s)}Q(this,og).set(i,o)}removeEventListener(e,i){const r=Q(this,og).get(i);r?.(),Q(this,og).delete(i)}terminate(){for(const[,e]of Q(this,og))e?.();Q(this,og).clear()}}og=new WeakMap,hX=new WeakMap;var pX,z9,H2,EI,rL,xI,oL;const ng=class Cl{constructor({name:e=null,port:i=null,verbosity:r=vTi()}={}){Ae(this,EI);var o;if(this.name=e,this.destroyed=!1,this.verbosity=r,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,i){if((o=Q(Cl,H2))!=null&&o.has(i))throw new Error("Cannot use more than one PDFWorker per port.");(Q(Cl,H2)||oe(Cl,H2,new WeakMap)).set(i,this),this._initializeFromPort(i);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new fI("main","worker",e),this._messageHandler.on("ready",function(){}),ne(this,EI,rL).call(this)}_initialize(){if(Q(Cl,z9)||Q(Cl,xI,oL)){this._setupFakeWorker();return}let{workerSrc:e}=Cl;try{Cl._isSameOrigin(window.location.href,e)||(e=Cl._createCDNWrapper(new URL(e,window.location).href));const i=new Worker(e,{type:"module"}),r=new fI("main","worker",i),o=()=>{n.abort(),r.destroy(),i.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},n=new AbortController;i.addEventListener("error",()=>{this._webWorker||o()},{signal:n.signal}),r.on("test",a=>{if(n.abort(),this.destroyed||!a){o();return}this._messageHandler=r,this._port=i,this._webWorker=i,ne(this,EI,rL).call(this)}),r.on("ready",a=>{if(n.abort(),this.destroyed){o();return}try{s()}catch{this._setupFakeWorker()}});const s=()=>{const a=new Uint8Array;r.send("test",a,[a.buffer])};s();return}catch{eR("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){Q(Cl,z9)||(ir("Setting up fake worker."),oe(Cl,z9,!0)),Cl._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const i=new jFi;this._port=i;const r=`fake${Il(Cl,pX)._++}`,o=new fI(r+"_worker",r,i);e.setup(o,i),this._messageHandler=new fI(r,r+"_worker",i),ne(this,EI,rL).call(this)}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){var e,i,r;this.destroyed=!0,(e=this._webWorker)==null||e.terminate(),this._webWorker=null,(i=Q(Cl,H2))==null||i.delete(this._port),this._port=null,(r=this._messageHandler)==null||r.destroy(),this._messageHandler=null}static fromPort(e){var i;if(!(e!=null&&e.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const r=(i=Q(this,H2))==null?void 0:i.get(e.port);if(r){if(r._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return r}return new Cl(e)}static get workerSrc(){if(eg.workerSrc)return eg.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return cr(this,"_setupFakeWorkerGlobal",(async()=>Q(this,xI,oL)?Q(this,xI,oL):(await import(this.workerSrc)).WorkerMessageHandler)())}};pX=new WeakMap,z9=new WeakMap,H2=new WeakMap,EI=new WeakSet,rL=function(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})},xI=new WeakSet,oL=function(){var t;try{return((t=globalThis.pdfjsWorker)==null?void 0:t.WorkerMessageHandler)||null}catch{return null}},Ae(ng,xI),Ae(ng,pX,0),Ae(ng,z9,!1),Ae(ng,H2),sl&&(oe(ng,z9,!0),eg.workerSrc||(eg.workerSrc="./pdf.worker.mjs")),ng._isSameOrigin=(t,e)=>{let i;try{if(i=new URL(t),!i.origin||i.origin==="null")return!1}catch{return!1}const r=new URL(e,i);return i.origin===r.origin},ng._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};let nL=ng;var sg,O1,kI,MI,H1,K9,SI;class VFi{constructor(e,i,r,o,n){Ae(this,K9),Ae(this,sg,new Map),Ae(this,O1,new Map),Ae(this,kI,new Map),Ae(this,MI,new Map),Ae(this,H1,null),this.messageHandler=e,this.loadingTask=i,this.commonObjs=new Sxe,this.fontLoader=new OTi({ownerDocument:o.ownerDocument,styleElement:o.styleElement}),this.loadingParams=o.loadingParams,this._params=o,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.cMapReaderFactory=n.cMapReaderFactory,this.standardFontDataFactory=n.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return cr(this,"annotationStorage",new XZ)}getRenderingIntent(e,i=Vp.ENABLE,r=null,o=!1,n=!1){let s=Lc.DISPLAY,a=WZ;switch(e){case"any":s=Lc.ANY;break;case"display":break;case"print":s=Lc.PRINT;break;default:ir(`getRenderingIntent - invalid intent: ${e}`)}const l=s&Lc.PRINT&&r instanceof VEe?r:this.annotationStorage;switch(i){case Vp.DISABLE:s+=Lc.ANNOTATIONS_DISABLE;break;case Vp.ENABLE:break;case Vp.ENABLE_FORMS:s+=Lc.ANNOTATIONS_FORMS;break;case Vp.ENABLE_STORAGE:s+=Lc.ANNOTATIONS_STORAGE,a=l.serializable;break;default:ir(`getRenderingIntent - invalid annotationMode: ${i}`)}o&&(s+=Lc.IS_EDITING),n&&(s+=Lc.OPLIST);const{ids:c,hash:d}=l.modifiedIds,u=[s,a.hash,d];return{renderingIntent:s,cacheKey:u.join("_"),annotationStorageSerializable:a,modifiedIds:c}}destroy(){var e;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(e=Q(this,H1))==null||e.reject(new Error("Worker was destroyed during onPassword callback"));const i=[];for(const o of Q(this,O1).values())i.push(o._destroy());Q(this,O1).clear(),Q(this,kI).clear(),Q(this,MI).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const r=this.messageHandler.sendWithPromise("Terminate",null);return i.push(r),Promise.all(i).then(()=>{var o,n;this.commonObjs.clear(),this.fontLoader.clear(),Q(this,sg).clear(),this.filterFactory.destroy(),uX.cleanup(),(o=this._networkStream)==null||o.cancelAllRequests(new C2("Worker was terminated.")),(n=this.messageHandler)==null||n.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:i}=this;e.on("GetReader",(r,o)=>{Gn(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=n=>{this._lastProgress={loaded:n.loaded,total:n.total}},o.onPull=()=>{this._fullReader.read().then(function({value:n,done:s}){if(s){o.close();return}Gn(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),o.enqueue(new Uint8Array(n),1,[n])}).catch(n=>{o.error(n)})},o.onCancel=n=>{this._fullReader.cancel(n),o.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",async r=>{var o;await this._fullReader.headersReady;const{isStreamingSupported:n,isRangeSupported:s,contentLength:a}=this._fullReader;return(!n||!s)&&(this._lastProgress&&((o=i.onProgress)==null||o.call(i,this._lastProgress)),this._fullReader.onProgress=l=>{var c;(c=i.onProgress)==null||c.call(i,{loaded:l.loaded,total:l.total})}),{isStreamingSupported:n,isRangeSupported:s,contentLength:a}}),e.on("GetRangeReader",(r,o)=>{Gn(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(r.begin,r.end);if(!n){o.close();return}o.onPull=()=>{n.read().then(function({value:s,done:a}){if(a){o.close();return}Gn(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),o.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{o.error(s)})},o.onCancel=s=>{n.cancel(s),o.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,i._capability.resolve(new HFi(r,this))}),e.on("DocException",function(r){let o;switch(r.name){case"PasswordException":o=new gZ(r.message,r.code);break;case"InvalidPDFException":o=new cEe(r.message);break;case"MissingPDFException":o=new _b(r.message);break;case"UnexpectedResponseException":o=new tR(r.message,r.status);break;case"UnknownErrorException":o=new fZ(r.message,r.details);break;default:no("DocException - expected a valid Error.")}i._capability.reject(o)}),e.on("PasswordRequest",r=>{if(oe(this,H1,Promise.withResolvers()),i.onPassword){const o=n=>{n instanceof Error?Q(this,H1).reject(n):Q(this,H1).resolve({password:n})};try{i.onPassword(o,r.code)}catch(n){Q(this,H1).reject(n)}}else Q(this,H1).reject(new gZ(r.message,r.code));return Q(this,H1).promise}),e.on("DataLoaded",r=>{var o;(o=i.onProgress)==null||o.call(i,{loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),e.on("StartRenderPage",r=>{this.destroyed||Q(this,O1).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),e.on("commonobj",([r,o,n])=>{var s;if(this.destroyed||this.commonObjs.has(r))return null;switch(o){case"Font":const{disableFontFace:a,fontExtraProperties:l,pdfBug:c}=this._params;if("error"in n){const h=n.error;ir(`Error during font loading: ${h}`),this.commonObjs.resolve(r,h);break}const d=c&&(s=globalThis.FontInspector)!=null&&s.enabled?(h,g)=>globalThis.FontInspector.fontAdded(h,g):null,u=new HTi(n,{disableFontFace:a,inspectFont:d});this.fontLoader.bind(u).catch(()=>e.sendWithPromise("FontFallback",{id:r})).finally(()=>{!l&&u.data&&(u.data=null),this.commonObjs.resolve(r,u)});break;case"CopyLocalImage":const{imageRef:A}=n;Gn(A,"The imageRef must be defined.");for(const h of Q(this,O1).values())for(const[,g]of h.objs)if(g?.ref===A)return g.dataLen?(this.commonObjs.resolve(r,structuredClone(g)),g.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,n);break;default:throw new Error(`Got unknown common object type ${o}`)}return null}),e.on("obj",([r,o,n,s])=>{var a;if(this.destroyed)return;const l=Q(this,O1).get(o);if(!l.objs.has(r)){if(l._intentStates.size===0){(a=s?.bitmap)==null||a.close();return}switch(n){case"Image":l.objs.resolve(r,s),s?.dataLen>hTi&&(l._maybeCleanupAfterRender=!0);break;case"Pattern":l.objs.resolve(r,s);break;default:throw new Error(`Got unknown object type ${n}`)}}}),e.on("DocProgress",r=>{var o;this.destroyed||(o=i.onProgress)==null||o.call(i,{loaded:r.loaded,total:r.total})}),e.on("FetchBuiltInCMap",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.cMapReaderFactory)throw new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.");return this.cMapReaderFactory.fetch(r)}),e.on("FetchStandardFontData",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.standardFontDataFactory)throw new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.");return this.standardFontDataFactory.fetch(r)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var e;this.annotationStorage.size<=0&&ir("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:i,transfer:r}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:i,filename:((e=this._fullReader)==null?void 0:e.filename)??null},r).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const i=e-1,r=Q(this,kI).get(i);if(r)return r;const o=this.messageHandler.sendWithPromise("GetPage",{pageIndex:i}).then(n=>{if(this.destroyed)throw new Error("Transport destroyed");n.refStr&&Q(this,MI).set(n.refStr,e);const s=new GFi(i,n,this,this._params.pdfBug);return Q(this,O1).set(i,s),s});return Q(this,kI).set(i,o),o}getPageIndex(e){return xxe(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,i){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:i})}getFieldObjects(){return ne(this,K9,SI).call(this,"GetFieldObjects")}hasJSActions(){return ne(this,K9,SI).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}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 ne(this,K9,SI).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return ne(this,K9,SI).call(this,"GetOptionalContentConfig").then(i=>new uFi(i,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",i=Q(this,sg).get(e);if(i)return i;const r=this.messageHandler.sendWithPromise(e,null).then(o=>{var n,s;return{info:o[0],metadata:o[1]?new cFi(o[1]):null,contentDispositionFilename:((n=this._fullReader)==null?void 0:n.filename)??null,contentLength:((s=this._fullReader)==null?void 0:s.contentLength)??null}});return Q(this,sg).set(e,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const i of Q(this,O1).values())if(!i.cleanup())throw new Error(`startCleanup: Page ${i.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),Q(this,sg).clear(),this.filterFactory.destroy(!0),uX.cleanup()}}cachedPageNumber(e){if(!xxe(e))return null;const i=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return Q(this,MI).get(i)??null}}sg=new WeakMap,O1=new WeakMap,kI=new WeakMap,MI=new WeakMap,H1=new WeakMap,K9=new WeakSet,SI=function(t,e=null){const i=Q(this,sg).get(t);if(i)return i;const r=this.messageHandler.sendWithPromise(t,e);return Q(this,sg).set(t,r),r};const sL=Symbol("INITIAL_DATA");var JA,aL,gX;class Sxe{constructor(){Ae(this,aL),Ae(this,JA,Object.create(null))}get(e,i=null){if(i){const o=ne(this,aL,gX).call(this,e);return o.promise.then(()=>i(o.data)),null}const r=Q(this,JA)[e];if(!r||r.data===sL)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const i=Q(this,JA)[e];return!!i&&i.data!==sL}resolve(e,i=null){const r=ne(this,aL,gX).call(this,e);r.data=i,r.resolve()}clear(){var e;for(const i in Q(this,JA)){const{data:r}=Q(this,JA)[i];(e=r?.bitmap)==null||e.close()}oe(this,JA,Object.create(null))}*[Symbol.iterator](){for(const e in Q(this,JA)){const{data:i}=Q(this,JA)[e];i!==sL&&(yield[e,i])}}}JA=new WeakMap,aL=new WeakSet,gX=function(t){var e;return(e=Q(this,JA))[t]||(e[t]={...Promise.withResolvers(),data:sL})};var G2;class qFi{constructor(e){Ae(this,G2,null),oe(this,G2,e),this.onContinue=null}get promise(){return Q(this,G2).capability.promise}cancel(e=0){Q(this,G2).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=Q(this,G2).operatorList;if(!e)return!1;const{annotationCanvasMap:i}=Q(this,G2);return e.form||e.canvas&&i?.size>0}}G2=new WeakMap;var j2,J9;const Qxe=class gE{constructor({callback:e,params:i,objs:r,commonObjs:o,annotationCanvasMap:n,operatorList:s,pageIndex:a,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:d=!1,pdfBug:u=!1,pageColors:A=null}){Ae(this,j2,null),this.callback=e,this.params=i,this.objs=r,this.commonObjs=o,this.annotationCanvasMap=n,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=a,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=u,this.pageColors=A,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=d===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new qFi(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:i}){var r,o;if(this.cancelled)return;if(this._canvas){if(Q(gE,J9).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.");Q(gE,J9).add(this._canvas)}this._pdfBug&&(r=globalThis.StepperManager)!=null&&r.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:s,transform:a,background:l}=this.params;this.gfx=new TR(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:a,viewport:s,transparency:e,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,(o=this.graphicsReadyCallback)==null||o.call(this)}cancel(e=null,i=0){var r;this.running=!1,this.cancelled=!0,(r=this.gfx)==null||r.endDrawing(),Q(this,j2)&&(window.cancelAnimationFrame(Q(this,j2)),oe(this,j2,null)),Q(gE,J9).delete(this._canvas),this.callback(e||new IZ(`Rendering cancelled, page ${this._pageIndex+1}`,i))}operatorListChanged(){var e;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(e=this.stepper)==null||e.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?oe(this,j2,window.requestAnimationFrame(()=>{oe(this,j2,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),Q(gE,J9).delete(this._canvas),this.callback())))}};j2=new WeakMap,J9=new WeakMap,Ae(Qxe,J9,new WeakSet);let zFi=Qxe;const KFi="4.9.124",JFi="867aaf01f";function Pxe(t){return Math.floor(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,"0")}function QI(t){return Math.max(0,Math.min(255,255*t))}class Dxe{static CMYK_G([e,i,r,o]){return["G",1-Math.min(1,.3*e+.59*r+.11*i+o)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=QI(e),[e,e,e]}static G_HTML([e]){const i=Pxe(e);return`#${i}${i}${i}`}static RGB_G([e,i,r]){return["G",.3*e+.59*i+.11*r]}static RGB_rgb(e){return e.map(QI)}static RGB_HTML(e){return`#${e.map(Pxe).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,i,r,o]){return["RGB",1-Math.min(1,e+o),1-Math.min(1,r+o),1-Math.min(1,i+o)]}static CMYK_rgb([e,i,r,o]){return[QI(1-Math.min(1,e+o)),QI(1-Math.min(1,r+o)),QI(1-Math.min(1,i+o))]}static CMYK_HTML(e){const i=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(i)}static RGB_CMYK([e,i,r]){const o=1-e,n=1-i,s=1-r,a=Math.min(o,n,s);return["CMYK",o,n,s,a]}}class YFi{create(e,i,r=!1){if(e<=0||i<=0)throw new Error("Invalid SVG dimensions");const o=this._createSVG("svg:svg");return o.setAttribute("version","1.1"),r||(o.setAttribute("width",`${e}px`),o.setAttribute("height",`${i}px`)),o.setAttribute("preserveAspectRatio","none"),o.setAttribute("viewBox",`0 0 ${e} ${i}`),o}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){no("Abstract method `_createSVG` called.")}}class fX extends YFi{_createSVG(e){return document.createElementNS(k1,e)}}class Rxe{static setupStorage(e,i,r,o,n){const s=o.getValue(i,{value:null});switch(r.name){case"textarea":if(s.value!==null&&(e.textContent=s.value),n==="print")break;e.addEventListener("input",a=>{o.setValue(i,{value:a.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(s.value===r.attributes.xfaOn?e.setAttribute("checked",!0):s.value===r.attributes.xfaOff&&e.removeAttribute("checked"),n==="print")break;e.addEventListener("change",a=>{o.setValue(i,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(s.value!==null&&e.setAttribute("value",s.value),n==="print")break;e.addEventListener("input",a=>{o.setValue(i,{value:a.target.value})})}break;case"select":if(s.value!==null){e.setAttribute("value",s.value);for(const a of r.children)a.attributes.value===s.value?a.attributes.selected=!0:a.attributes.hasOwnProperty("selected")&&delete a.attributes.selected}e.addEventListener("input",a=>{const l=a.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;o.setValue(i,{value:c})});break}}static setAttributes({html:e,element:i,storage:r=null,intent:o,linkService:n}){const{attributes:s}=i,a=e instanceof HTMLAnchorElement;s.type==="radio"&&(s.name=`${s.name}-${o}`);for(const[l,c]of Object.entries(s))if(c!=null)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!a||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,c)}a&&n.addLinkAttributes(e,s.href,s.newWindow),r&&s.dataId&&this.setupStorage(e,s.dataId,i,r)}static render(e){var i,r;const o=e.annotationStorage,n=e.linkService,s=e.xfaHtml,a=e.intent||"display",l=document.createElement(s.name);s.attributes&&this.setAttributes({html:l,element:s,intent:a,linkService:n});const c=a!=="richText",d=e.div;if(d.append(l),e.viewport){const h=`matrix(${e.viewport.transform.join(",")})`;d.style.transform=h}c&&d.setAttribute("class","xfaLayer xfaFont");const u=[];if(s.children.length===0){if(s.value){const h=document.createTextNode(s.value);l.append(h),c&&kE.shouldBuildText(s.name)&&u.push(h)}return{textDivs:u}}const A=[[s,-1,l]];for(;A.length>0;){const[h,g,p]=A.at(-1);if(g+1===h.children.length){A.pop();continue}const m=h.children[++A.at(-1)[1]];if(m===null)continue;const{name:f}=m;if(f==="#text"){const C=document.createTextNode(m.value);u.push(C),p.append(C);continue}const v=(i=m?.attributes)!=null&&i.xmlns?document.createElementNS(m.attributes.xmlns,f):document.createElement(f);if(p.append(v),m.attributes&&this.setAttributes({html:v,element:m,storage:o,intent:a,linkService:n}),((r=m.children)==null?void 0:r.length)>0)A.push([m,-1,v]);else if(m.value){const C=document.createTextNode(m.value);c&&kE.shouldBuildText(f)&&u.push(C),v.append(C)}}for(const h of d.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))h.setAttribute("readOnly",!0);return{textDivs:u}}static update(e){const i=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=i,e.div.hidden=!1}}const PI=1e3,WFi=9,V2=new WeakSet;function G1(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class ZFi{static create(e){switch(e.data.annotationType){case os.LINK:return new Fxe(e);case os.TEXT:return new $Fi(e);case os.WIDGET:switch(e.data.fieldType){case"Tx":return new eNi(e);case"Btn":return e.data.radioButton?new Nxe(e):e.data.checkBox?new iNi(e):new rNi(e);case"Ch":return new oNi(e);case"Sig":return new tNi(e)}return new K2(e);case os.POPUP:return new vX(e);case os.FREETEXT:return new Gxe(e);case os.LINE:return new sNi(e);case os.SQUARE:return new aNi(e);case os.CIRCLE:return new lNi(e);case os.POLYLINE:return new jxe(e);case os.CARET:return new dNi(e);case os.INK:return new IX(e);case os.POLYGON:return new cNi(e);case os.HIGHLIGHT:return new Vxe(e);case os.UNDERLINE:return new uNi(e);case os.SQUIGGLY:return new ANi(e);case os.STRIKEOUT:return new hNi(e);case os.STAMP:return new qxe(e);case os.FILEATTACHMENT:return new pNi(e);default:return new ss(e)}}}var q2,DI,RI,lL,mX;const XFi=class vDe{constructor(e,{isRenderable:i=!1,ignoreBorder:r=!1,createQuadrilaterals:o=!1}={}){Ae(this,lL),Ae(this,q2,null),Ae(this,DI,!1),Ae(this,RI,null),this.isRenderable=i,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,i&&(this.container=this._createContainer(r)),o&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:i,richText:r}){return!!(e!=null&&e.str||i!=null&&i.str||r!=null&&r.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return vDe._hasPopupData(this.data)}updateEdited(e){var i;if(!this.container)return;Q(this,q2)||oe(this,q2,{rect:this.data.rect.slice(0)});const{rect:r}=e;r&&ne(this,lL,mX).call(this,r),(i=Q(this,RI))==null||i.popup.updateEdited(e)}resetEdited(){var e;Q(this,q2)&&(ne(this,lL,mX).call(this,Q(this,q2).rect),(e=Q(this,RI))==null||e.popup.resetEdited(),oe(this,q2,null))}_createContainer(e){const{data:i,parent:{page:r,viewport:o}}=this,n=document.createElement("section");n.setAttribute("data-annotation-id",i.id),this instanceof K2||(n.tabIndex=PI);const{style:s}=n;if(s.zIndex=this.parent.zIndex++,i.alternativeText&&(n.title=i.alternativeText),i.noRotate&&n.classList.add("norotate"),!i.rect||this instanceof vX){const{rotation:p}=i;return!i.hasOwnCanvas&&p!==0&&this.setRotation(p,n),n}const{width:a,height:l}=G1(i.rect);if(!e&&i.borderStyle.width>0){s.borderWidth=`${i.borderStyle.width}px`;const p=i.borderStyle.horizontalCornerRadius,m=i.borderStyle.verticalCornerRadius;if(p>0||m>0){const v=`calc(${p}px * var(--scale-factor)) / calc(${m}px * var(--scale-factor))`;s.borderRadius=v}else if(this instanceof Nxe){const v=`calc(${a}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`;s.borderRadius=v}switch(i.borderStyle.style){case Ub.SOLID:s.borderStyle="solid";break;case Ub.DASHED:s.borderStyle="dashed";break;case Ub.BEVELED:ir("Unimplemented border style: beveled");break;case Ub.INSET:ir("Unimplemented border style: inset");break;case Ub.UNDERLINE:s.borderBottomStyle="solid";break}const f=i.borderColor||null;f?(oe(this,DI,!0),s.borderColor=Ci.makeHexColor(f[0]|0,f[1]|0,f[2]|0)):s.borderWidth=0}const c=Ci.normalizeRect([i.rect[0],r.view[3]-i.rect[1]+r.view[1],i.rect[2],r.view[3]-i.rect[3]+r.view[1]]),{pageWidth:d,pageHeight:u,pageX:A,pageY:h}=o.rawDims;s.left=`${100*(c[0]-A)/d}%`,s.top=`${100*(c[1]-h)/u}%`;const{rotation:g}=i;return i.hasOwnCanvas||g===0?(s.width=`${100*a/d}%`,s.height=`${100*l/u}%`):this.setRotation(g,n),n}setRotation(e,i=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:o}=this.parent.viewport.rawDims,{width:n,height:s}=G1(this.data.rect);let a,l;e%180===0?(a=100*n/r,l=100*s/o):(a=100*s/r,l=100*n/o),i.style.width=`${a}%`,i.style.height=`${l}%`,i.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(i,r,o)=>{const n=o.detail[i],s=n[0],a=n.slice(1);o.target.style[r]=Dxe[`${s}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[r]:Dxe[`${s}_rgb`](a)})};return cr(this,"_commonActions",{display:i=>{const{display:r}=i.detail,o=r%2===1;this.container.style.visibility=o?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:o,noPrint:r===1||r===2})},print:i=>{this.annotationStorage.setValue(this.data.id,{noPrint:!i.detail.print})},hidden:i=>{const{hidden:r}=i.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},focus:i=>{setTimeout(()=>i.target.focus({preventScroll:!1}),0)},userName:i=>{i.target.title=i.detail.userName},readonly:i=>{i.target.disabled=i.detail.readonly},required:i=>{this._setRequired(i.target,i.detail.required)},bgColor:i=>{e("bgColor","backgroundColor",i)},fillColor:i=>{e("fillColor","backgroundColor",i)},fgColor:i=>{e("fgColor","color",i)},textColor:i=>{e("textColor","color",i)},borderColor:i=>{e("borderColor","borderColor",i)},strokeColor:i=>{e("strokeColor","borderColor",i)},rotation:i=>{const r=i.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(e,i){const r=this._commonActions;for(const o of Object.keys(i.detail)){const n=e[o]||r[o];n?.(i)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const i=this.annotationStorage.getRawValue(this.data.id);if(!i)return;const r=this._commonActions;for(const[o,n]of Object.entries(i)){const s=r[o];if(s){const a={detail:{[o]:n},target:e};s(a),delete i[o]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[i,r,o,n]=this.data.rect.map(p=>Math.fround(p));if(e.length===8){const[p,m,f,v]=e.subarray(2,6);if(o===p&&n===m&&i===f&&r===v)return}const{style:s}=this.container;let a;if(Q(this,DI)){const{borderColor:p,borderWidth:m}=s;s.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${p}" stroke-width="${m}">`],this.container.classList.add("hasBorder")}const l=o-i,c=n-r,{svgFactory:d}=this,u=d.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0);const A=d.createElement("defs");u.append(A);const h=d.createElement("clipPath"),g=`clippath_${this.data.id}`;h.setAttribute("id",g),h.setAttribute("clipPathUnits","objectBoundingBox"),A.append(h);for(let p=2,m=e.length;p<m;p+=8){const f=e[p],v=e[p+1],C=e[p+2],y=e[p+3],w=d.createElement("rect"),b=(C-i)/l,E=(n-v)/c,x=(f-C)/l,M=(v-y)/c;w.setAttribute("x",b),w.setAttribute("y",E),w.setAttribute("width",x),w.setAttribute("height",M),h.append(w),a?.push(`<rect vector-effect="non-scaling-stroke" x="${b}" y="${E}" width="${x}" height="${M}"/>`)}Q(this,DI)&&(a.push("</g></svg>')"),s.backgroundImage=a.join("")),this.container.append(u),this.container.style.clipPath=`url(#${g})`}_createPopup(){const{data:e}=this,i=oe(this,RI,new vX({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(i.render())}render(){no("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,i=null){const r=[];if(this._fieldObjects){const o=this._fieldObjects[e];if(o)for(const{page:n,id:s,exportValues:a}of o){if(n===-1||s===i)continue;const l=typeof a=="string"?a:null,c=document.querySelector(`[data-element-id="${s}"]`);if(c&&!V2.has(c)){ir(`_getElementsByName - element not allowed: ${s}`);continue}r.push({id:s,exportValue:l,domElement:c})}return r}for(const o of document.getElementsByName(e)){const{exportValue:n}=o,s=o.getAttribute("data-element-id");s!==i&&V2.has(o)&&r.push({id:s,exportValue:n,domElement:o})}return r}show(){var e;this.container&&(this.container.hidden=!1),(e=this.popup)==null||e.maybeShow()}hide(){var e;this.container&&(this.container.hidden=!0),(e=this.popup)==null||e.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const i of e)i.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:i}}=this;this.container.addEventListener("dblclick",()=>{var r;(r=this.linkService.eventBus)==null||r.dispatch("switchannotationeditormode",{source:this,mode:e,editId:i})})}};q2=new WeakMap,DI=new WeakMap,RI=new WeakMap,lL=new WeakSet,mX=function(t){const{container:{style:e},data:{rect:i,rotation:r},parent:{viewport:{rawDims:{pageWidth:o,pageHeight:n,pageX:s,pageY:a}}}}=this;i?.splice(0,4,...t);const{width:l,height:c}=G1(t);e.left=`${100*(t[0]-s)/o}%`,e.top=`${100*(n-t[3]+a)/n}%`,r===0?(e.width=`${100*l/o}%`,e.height=`${100*c/n}%`):this.setRotation(r)};let ss=XFi;var YA,z2,Lxe,Txe;class Fxe extends ss{constructor(e,i=null){super(e,{isRenderable:!0,ignoreBorder:!!(i!=null&&i.ignoreBorder),createQuadrilaterals:!0}),Ae(this,YA),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:i}=this,r=document.createElement("a");r.setAttribute("data-element-id",e.id);let o=!1;return e.url?(i.addLinkAttributes(r,e.url,e.newWindow),o=!0):e.action?(this._bindNamedAction(r,e.action),o=!0):e.attachment?(ne(this,YA,Lxe).call(this,r,e.attachment,e.attachmentDest),o=!0):e.setOCGState?(ne(this,YA,Txe).call(this,r,e.setOCGState),o=!0):e.dest?(this._bindLink(r,e.dest),o=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,e),o=!0),e.resetForm?(this._bindResetFormAction(r,e.resetForm),o=!0):this.isTooltipOnly&&!o&&(this._bindLink(r,""),o=!0)),this.container.classList.add("linkAnnotation"),o&&this.container.append(r),this.container}_bindLink(e,i){e.href=this.linkService.getDestinationHash(i),e.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||i==="")&&ne(this,YA,z2).call(this)}_bindNamedAction(e,i){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(i),!1),ne(this,YA,z2).call(this)}_bindJSAction(e,i){e.href=this.linkService.getAnchorUrl("");const r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const o of Object.keys(i.actions)){const n=r.get(o);n&&(e[n]=()=>{var s;return(s=this.linkService.eventBus)==null||s.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:o}}),!1})}e.onclick||(e.onclick=()=>!1),ne(this,YA,z2).call(this)}_bindResetFormAction(e,i){const r=e.onclick;if(r||(e.href=this.linkService.getAnchorUrl("")),ne(this,YA,z2).call(this),!this._fieldObjects){ir('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),r||(e.onclick=()=>!1);return}e.onclick=()=>{var o;r?.();const{fields:n,refs:s,include:a}=i,l=[];if(n.length!==0||s.length!==0){const u=new Set(s);for(const A of n){const h=this._fieldObjects[A]||[];for(const{id:g}of h)u.add(g)}for(const A of Object.values(this._fieldObjects))for(const h of A)u.has(h.id)===a&&l.push(h)}else for(const u of Object.values(this._fieldObjects))l.push(...u);const c=this.annotationStorage,d=[];for(const u of l){const{id:A}=u;switch(d.push(A),u.type){case"text":{const g=u.defaultValue||"";c.setValue(A,{value:g});break}case"checkbox":case"radiobutton":{const g=u.defaultValue===u.exportValues;c.setValue(A,{value:g});break}case"combobox":case"listbox":{const g=u.defaultValue||"";c.setValue(A,{value:g});break}default:continue}const h=document.querySelector(`[data-element-id="${A}"]`);if(h){if(!V2.has(h)){ir(`_bindResetFormAction - element not allowed: ${A}`);continue}}else continue;h.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:d,name:"ResetForm"}})),!1}}}YA=new WeakSet,z2=function(){this.container.setAttribute("data-internal-link","")},Lxe=function(t,e,i=null){t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>{var r;return(r=this.downloadManager)==null||r.openOrDownloadData(e.content,e.filename,i),!1},ne(this,YA,z2).call(this)},Txe=function(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),ne(this,YA,z2).call(this)};class $Fi extends ss{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class K2 extends ss{render(){return this.container}showElementAndHideCanvas(e){var i;this.data.hasOwnCanvas&&(((i=e.previousSibling)==null?void 0:i.nodeName)==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return al.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,i,r,o,n){r.includes("mouse")?e.addEventListener(r,s=>{var a;(a=this.linkService.eventBus)==null||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:o,value:n(s),shift:s.shiftKey,modifier:this._getKeyModifier(s)}})}):e.addEventListener(r,s=>{var a;if(r==="blur"){if(!i.focused||!s.relatedTarget)return;i.focused=!1}else if(r==="focus"){if(i.focused)return;i.focused=!0}n&&((a=this.linkService.eventBus)==null||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:o,value:n(s)}}))})}_setEventListeners(e,i,r,o){var n,s,a;for(const[l,c]of r)(c==="Action"||(n=this.data.actions)!=null&&n[c])&&((c==="Focus"||c==="Blur")&&(i||(i={focused:!1})),this._setEventListener(e,i,l,c,o),c==="Focus"&&!((s=this.data.actions)!=null&&s.Blur)?this._setEventListener(e,i,"blur","Blur",null):c==="Blur"&&!((a=this.data.actions)!=null&&a.Focus)&&this._setEventListener(e,i,"focus","Focus",null))}_setBackgroundColor(e){const i=this.data.backgroundColor||null;e.style.backgroundColor=i===null?"transparent":Ci.makeHexColor(i[0],i[1],i[2])}_setTextStyle(e){const i=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,o=this.data.defaultAppearanceData.fontSize||WFi,n=e.style;let s;const a=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-a),d=Math.round(c/(pZ*o))||1,u=c/d;s=Math.min(o,l(u/pZ))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-a);s=Math.min(o,l(c/pZ))}n.fontSize=`calc(${s}px * var(--scale-factor))`,n.color=Ci.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(n.textAlign=i[this.data.textAlignment])}_setRequired(e,i){i?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",i)}}class eNi extends K2{constructor(e){const i=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:i})}setPropertyOnSiblings(e,i,r,o){const n=this.annotationStorage;for(const s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[i]=r),n.setValue(s.id,{[o]:r})}render(){var e,i;const r=this.annotationStorage,o=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const s=r.getValue(o,{value:this.data.fieldValue});let a=s.value||"";const l=r.getValue(o,{charLimit:this.data.maxLen}).charLimit;l&&a.length>l&&(a=a.slice(0,l));let c=s.formattedValue||((e=this.data.textContent)==null?void 0:e.join(`
|
|
5508
5508
|
`))||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const d={userValue:a,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=c??a,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",c??a),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),V2.add(n),n.setAttribute("data-element-id",o),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=PI,this._setRequired(n,this.data.required),l&&(n.maxLength=l),n.addEventListener("input",A=>{r.setValue(o,{value:A.target.value}),this.setPropertyOnSiblings(n,"value",A.target.value,"value"),d.formattedValue=null}),n.addEventListener("resetform",A=>{const h=this.data.defaultFieldValue??"";n.value=d.userValue=h,d.formattedValue=null});let u=A=>{const{formattedValue:h}=d;h!=null&&(A.target.value=h),A.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",h=>{var g;if(d.focused)return;const{target:p}=h;d.userValue&&(p.value=d.userValue),d.lastCommittedValue=p.value,d.commitKey=1,(g=this.data.actions)!=null&&g.Focus||(d.focused=!0)}),n.addEventListener("updatefromsandbox",h=>{this.showElementAndHideCanvas(h.target);const g={value(p){d.userValue=p.detail.value??"",r.setValue(o,{value:d.userValue.toString()}),p.target.value=d.userValue},formattedValue(p){const{formattedValue:m}=p.detail;d.formattedValue=m,m!=null&&p.target!==document.activeElement&&(p.target.value=m),r.setValue(o,{formattedValue:m})},selRange(p){p.target.setSelectionRange(...p.detail.selRange)},charLimit:p=>{var m;const{charLimit:f}=p.detail,{target:v}=p;if(f===0){v.removeAttribute("maxLength");return}v.setAttribute("maxLength",f);let C=d.userValue;!C||C.length<=f||(C=C.slice(0,f),v.value=d.userValue=C,r.setValue(o,{value:C}),(m=this.linkService.eventBus)==null||m.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:C,willCommit:!0,commitKey:1,selStart:v.selectionStart,selEnd:v.selectionEnd}}))}};this._dispatchEventFromSandbox(g,h)}),n.addEventListener("keydown",h=>{var g;d.commitKey=1;let p=-1;if(h.key==="Escape"?p=0:h.key==="Enter"&&!this.data.multiLine?p=2:h.key==="Tab"&&(d.commitKey=3),p===-1)return;const{value:m}=h.target;d.lastCommittedValue!==m&&(d.lastCommittedValue=m,d.userValue=m,(g=this.linkService.eventBus)==null||g.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:m,willCommit:!0,commitKey:p,selStart:h.target.selectionStart,selEnd:h.target.selectionEnd}}))});const A=u;u=null,n.addEventListener("blur",h=>{var g,p;if(!d.focused||!h.relatedTarget)return;(g=this.data.actions)!=null&&g.Blur||(d.focused=!1);const{value:m}=h.target;d.userValue=m,d.lastCommittedValue!==m&&((p=this.linkService.eventBus)==null||p.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:m,willCommit:!0,commitKey:d.commitKey,selStart:h.target.selectionStart,selEnd:h.target.selectionEnd}})),A(h)}),(i=this.data.actions)!=null&&i.Keystroke&&n.addEventListener("beforeinput",h=>{var g;d.lastCommittedValue=null;const{data:p,target:m}=h,{value:f,selectionStart:v,selectionEnd:C}=m;let y=v,w=C;switch(h.inputType){case"deleteWordBackward":{const b=f.substring(0,v).match(/\w*[^\w]*$/);b&&(y-=b[0].length);break}case"deleteWordForward":{const b=f.substring(v).match(/^[^\w]*\w*/);b&&(w+=b[0].length);break}case"deleteContentBackward":v===C&&(y-=1);break;case"deleteContentForward":v===C&&(w+=1);break}h.preventDefault(),(g=this.linkService.eventBus)==null||g.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:f,change:p||"",willCommit:!1,selStart:y,selEnd:w}})}),this._setEventListeners(n,d,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],h=>h.target.value)}if(u&&n.addEventListener("blur",u),this.data.comb){const A=(this.data.rect[2]-this.data.rect[0])/l;n.classList.add("comb"),n.style.letterSpacing=`calc(${A}px * var(--scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class tNi extends K2{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class iNi extends K2{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,i=this.data,r=i.id;let o=e.getValue(r,{value:i.exportValue===i.fieldValue}).value;typeof o=="string"&&(o=o!=="Off",e.setValue(r,{value:o})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const n=document.createElement("input");return V2.add(n),n.setAttribute("data-element-id",r),n.disabled=i.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=i.fieldName,o&&n.setAttribute("checked",!0),n.setAttribute("exportValue",i.exportValue),n.tabIndex=PI,n.addEventListener("change",s=>{const{name:a,checked:l}=s.target;for(const c of this._getElementsByName(a,r)){const d=l&&c.exportValue===i.exportValue;c.domElement&&(c.domElement.checked=d),e.setValue(c.id,{value:d})}e.setValue(r,{value:l})}),n.addEventListener("resetform",s=>{const a=i.defaultFieldValue||"Off";s.target.checked=a===i.exportValue}),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",s=>{const a={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(r,{value:l.target.checked})}};this._dispatchEventFromSandbox(a,s)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],s=>s.target.checked)),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Nxe extends K2{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,i=this.data,r=i.id;let o=e.getValue(r,{value:i.fieldValue===i.buttonValue}).value;if(typeof o=="string"&&(o=o!==i.buttonValue,e.setValue(r,{value:o})),o)for(const s of this._getElementsByName(i.fieldName,r))e.setValue(s.id,{value:!1});const n=document.createElement("input");if(V2.add(n),n.setAttribute("data-element-id",r),n.disabled=i.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=i.fieldName,o&&n.setAttribute("checked",!0),n.tabIndex=PI,n.addEventListener("change",s=>{const{name:a,checked:l}=s.target;for(const c of this._getElementsByName(a,r))e.setValue(c.id,{value:!1});e.setValue(r,{value:l})}),n.addEventListener("resetform",s=>{const a=i.defaultFieldValue;s.target.checked=a!=null&&a===i.buttonValue}),this.enableScripting&&this.hasJSActions){const s=i.buttonValue;n.addEventListener("updatefromsandbox",a=>{const l={value:c=>{const d=s===c.detail.value;for(const u of this._getElementsByName(c.target.name)){const A=d&&u.id===r;u.domElement&&(u.domElement.checked=A),e.setValue(u.id,{value:A})}}};this._dispatchEventFromSandbox(l,a)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)}return this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class rNi extends Fxe{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const i=e.lastChild;return this.enableScripting&&this.hasJSActions&&i&&(this._setDefaultPropertiesFromJS(i),i.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({},r)})),e}}class oNi extends K2{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,i=this.data.id,r=e.getValue(i,{value:this.data.fieldValue}),o=document.createElement("select");V2.add(o),o.setAttribute("data-element-id",i),o.disabled=this.data.readOnly,this._setRequired(o,this.data.required),o.name=this.data.fieldName,o.tabIndex=PI;let n=this.data.combo&&this.data.options.length>0;this.data.combo||(o.size=this.data.options.length,this.data.multiSelect&&(o.multiple=!0)),o.addEventListener("resetform",d=>{const u=this.data.defaultFieldValue;for(const A of o.options)A.selected=A.value===u});for(const d of this.data.options){const u=document.createElement("option");u.textContent=d.displayValue,u.value=d.exportValue,r.value.includes(d.exportValue)&&(u.setAttribute("selected",!0),n=!1),o.append(u)}let s=null;if(n){const d=document.createElement("option");d.value=" ",d.setAttribute("hidden",!0),d.setAttribute("selected",!0),o.prepend(d),s=()=>{d.remove(),o.removeEventListener("input",s),s=null},o.addEventListener("input",s)}const a=d=>{const u=d?"value":"textContent",{options:A,multiple:h}=o;return h?Array.prototype.filter.call(A,g=>g.selected).map(g=>g[u]):A.selectedIndex===-1?null:A[A.selectedIndex][u]};let l=a(!1);const c=d=>{const u=d.target.options;return Array.prototype.map.call(u,A=>({displayValue:A.textContent,exportValue:A.value}))};return this.enableScripting&&this.hasJSActions?(o.addEventListener("updatefromsandbox",d=>{const u={value(A){s?.();const h=A.detail.value,g=new Set(Array.isArray(h)?h:[h]);for(const p of o.options)p.selected=g.has(p.value);e.setValue(i,{value:a(!0)}),l=a(!1)},multipleSelection(A){o.multiple=!0},remove(A){const h=o.options,g=A.detail.remove;h[g].selected=!1,o.remove(g),h.length>0&&Array.prototype.findIndex.call(h,p=>p.selected)===-1&&(h[0].selected=!0),e.setValue(i,{value:a(!0),items:c(A)}),l=a(!1)},clear(A){for(;o.length!==0;)o.remove(0);e.setValue(i,{value:null,items:[]}),l=a(!1)},insert(A){const{index:h,displayValue:g,exportValue:p}=A.detail.insert,m=o.children[h],f=document.createElement("option");f.textContent=g,f.value=p,m?m.before(f):o.append(f),e.setValue(i,{value:a(!0),items:c(A)}),l=a(!1)},items(A){const{items:h}=A.detail;for(;o.length!==0;)o.remove(0);for(const g of h){const{displayValue:p,exportValue:m}=g,f=document.createElement("option");f.textContent=p,f.value=m,o.append(f)}o.options.length>0&&(o.options[0].selected=!0),e.setValue(i,{value:a(!0),items:c(A)}),l=a(!1)},indices(A){const h=new Set(A.detail.indices);for(const g of A.target.options)g.selected=h.has(g.index);e.setValue(i,{value:a(!0)}),l=a(!1)},editable(A){A.target.disabled=!A.detail.editable}};this._dispatchEventFromSandbox(u,d)}),o.addEventListener("input",d=>{var u;const A=a(!0),h=a(!1);e.setValue(i,{value:A}),d.preventDefault(),(u=this.linkService.eventBus)==null||u.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:l,change:h,changeEx:A,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(o,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],d=>d.target.value)):o.addEventListener("input",function(d){e.setValue(i,{value:a(!0)})}),this.data.combo&&this._setTextStyle(o),this._setBackgroundColor(o),this._setDefaultPropertiesFromJS(o),this.container.append(o),this.container}}class vX extends ss{constructor(e){const{data:i,elements:r}=e;super(e,{isRenderable:ss._hasPopupData(i)}),this.elements=r,this.popup=null}render(){this.container.classList.add("popupAnnotation");const e=this.popup=new nNi({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}),i=[];for(const r of this.elements)r.popup=e,r.container.ariaHasPopup="dialog",i.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(r=>`${bZ}${r}`).join(",")),this.container}}var LI,CX,yX,TI,Y9,Ln,ag,FI,cL,dL,NI,lg,WA,cg,uL,dg,AL,J2,W9,as,hL,wX,Uxe,_xe,Oxe,Hxe,pL,gL,bX;class nNi{constructor({container:e,color:i,elements:r,titleObj:o,modificationDate:n,contentsObj:s,richText:a,parent:l,rect:c,parentRect:d,open:u}){Ae(this,as),Ae(this,LI,ne(this,as,Oxe).bind(this)),Ae(this,CX,ne(this,as,bX).bind(this)),Ae(this,yX,ne(this,as,gL).bind(this)),Ae(this,TI,ne(this,as,pL).bind(this)),Ae(this,Y9,null),Ae(this,Ln,null),Ae(this,ag,null),Ae(this,FI,null),Ae(this,cL,null),Ae(this,dL,null),Ae(this,NI,null),Ae(this,lg,!1),Ae(this,WA,null),Ae(this,cg,null),Ae(this,uL,null),Ae(this,dg,null),Ae(this,AL,null),Ae(this,J2,null),Ae(this,W9,!1);var A;oe(this,Ln,e),oe(this,AL,o),oe(this,ag,s),oe(this,dg,a),oe(this,dL,l),oe(this,Y9,i),oe(this,uL,c),oe(this,NI,d),oe(this,cL,r),oe(this,FI,EZ.toDateObject(n)),this.trigger=r.flatMap(h=>h.getElementsToTriggerPopup());for(const h of this.trigger)h.addEventListener("click",Q(this,TI)),h.addEventListener("mouseenter",Q(this,yX)),h.addEventListener("mouseleave",Q(this,CX)),h.classList.add("popupTriggerArea");for(const h of r)(A=h.container)==null||A.addEventListener("keydown",Q(this,LI));Q(this,Ln).hidden=!0,u&&ne(this,as,pL).call(this)}render(){if(Q(this,WA))return;const e=oe(this,WA,document.createElement("div"));if(e.className="popup",Q(this,Y9)){const n=e.style.outlineColor=Ci.makeHexColor(...Q(this,Y9));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?e.style.backgroundColor=`color-mix(in srgb, ${n} 30%, white)`:e.style.backgroundColor=Ci.makeHexColor(...Q(this,Y9).map(s=>Math.floor(.7*(255-s)+s)))}const i=document.createElement("span");i.className="header";const r=document.createElement("h1");if(i.append(r),{dir:r.dir,str:r.textContent}=Q(this,AL),e.append(i),Q(this,FI)){const n=document.createElement("span");n.classList.add("popupDate"),n.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),n.setAttribute("data-l10n-args",JSON.stringify({dateObj:Q(this,FI).valueOf()})),i.append(n)}const o=Q(this,as,hL);if(o)Rxe.render({xfaHtml:o,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const n=this._formatContents(Q(this,ag));e.append(n)}Q(this,Ln).append(e)}_formatContents({str:e,dir:i}){const r=document.createElement("p");r.classList.add("popupContent"),r.dir=i;const o=e.split(/(?:\r\n?|\n)/);for(let n=0,s=o.length;n<s;++n){const a=o[n];r.append(document.createTextNode(a)),n<s-1&&r.append(document.createElement("br"))}return r}updateEdited({rect:e,popupContent:i}){var r;Q(this,J2)||oe(this,J2,{contentsObj:Q(this,ag),richText:Q(this,dg)}),e&&oe(this,cg,null),i&&(oe(this,dg,ne(this,as,_xe).call(this,i)),oe(this,ag,null)),(r=Q(this,WA))==null||r.remove(),oe(this,WA,null)}resetEdited(){var e;Q(this,J2)&&({contentsObj:Il(this,ag)._,richText:Il(this,dg)._}=Q(this,J2),oe(this,J2,null),(e=Q(this,WA))==null||e.remove(),oe(this,WA,null),oe(this,cg,null))}forceHide(){oe(this,W9,this.isVisible),Q(this,W9)&&(Q(this,Ln).hidden=!0)}maybeShow(){Q(this,W9)&&(Q(this,WA)||ne(this,as,gL).call(this),oe(this,W9,!1),Q(this,Ln).hidden=!1)}get isVisible(){return Q(this,Ln).hidden===!1}}LI=new WeakMap,CX=new WeakMap,yX=new WeakMap,TI=new WeakMap,Y9=new WeakMap,Ln=new WeakMap,ag=new WeakMap,FI=new WeakMap,cL=new WeakMap,dL=new WeakMap,NI=new WeakMap,lg=new WeakMap,WA=new WeakMap,cg=new WeakMap,uL=new WeakMap,dg=new WeakMap,AL=new WeakMap,J2=new WeakMap,W9=new WeakMap,as=new WeakSet,hL=function(){const t=Q(this,dg),e=Q(this,ag);return t!=null&&t.str&&(!(e!=null&&e.str)||e.str===t.str)&&Q(this,dg).html||null},wX=function(){var t,e,i;return((i=(e=(t=Q(this,as,hL))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.fontSize)||0},Uxe=function(){var t,e,i;return((i=(e=(t=Q(this,as,hL))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.color)||null},_xe=function(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},r={style:{color:Q(this,as,Uxe),fontSize:Q(this,as,wX)?`calc(${Q(this,as,wX)}px * var(--scale-factor))`:""}};for(const o of t.split(`
|