@bimdata/viewer 2.10.0-beta.2 → 2.10.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.
@@ -5507,7 +5507,7 @@ void main() {
5507
5507
  --bimdata-local-context-width: ${r.width}px;
5508
5508
  --bimdata-local-context-center-width: ${r.centerWidth}px;
5509
5509
  --bimdata-local-context-resolution: ${r.resolution};
5510
- `),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",nLi,[r.windowPlugins.leftSidePanel?(Q(),te(a,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):fe("",!0),B("div",sLi,[(Q(!0),U(Et,null,Wt(r.windowPlugins.free,A=>(Q(),te(l,{key:A.name,class:be({"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?(Q(),te(a,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):fe("",!0)]),r.loading?(Q(),U("div",aLi,[r.spinner&&r.spinner.component?(Q(),te(Uo(r.spinner.component),ud(ll({key:0},r.spinner.props)),null,16)):(Q(),te(d,{key:1,size:"20px",border:"3px"}))])):fe("",!0),r.layoutSettingsDisplayed?(Q(),U("div",lLi,[L(u)])):fe("",!0)],36)}const dLi=K(oLi,[["render",cLi],["__scopeId","data-v-558e7ce5"]]);let uLi=class{constructor(t=!0){const e=XPi(mae,null,{resizable:t});e.registerContent("default",dLi),this.settings=xa({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?$Pi(t):null}copy(t,e=!0){return eRi(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 ALi="2.10.0-beta.2",hLi={version:ALi};class pLi{constructor({plugins:e,api:i,ui:r,locale:o="fr"}){this.pluginManager=new uSi(e),this.windowManager=new hSi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new tPi(i),this.globalContext=new oHe(this),this.state=mPi(this),this.shortcutManager=ZRe(this.state),this.uiSettings=r||{},this.i18n=new iHe(o),this._contextMenu=null,this.layout=new uLi(this.uiSettings.resizable!==!1),this.localContext=null,window.$viewer=this}get version(){return hLi.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||YRe}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 gLi(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 fLi=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),S9=Object.freeze({READ:"read",WRITE:"write"});function ZEe(t){const e={};return t.forEach(i=>{const[r,o]=i.split(":");e[r]?e[r].push(o):e[r]=[o]}),e}const mLi={token_scopes:[],usable_scopes:[],user_role:25};function XEe(t=mLi){var e,i,r,o,n,s;const a=ZEe(t.token_scopes),l=ZEe(t.usable_scopes);return{...rAe(t),tokenScopes:a,usableScopes:l,userRole:fLi[t.user_role],user:t.user?rAe(t.user):null,hasBcfReadPermission:((e=l.bcf)==null?void 0:e.includes(S9.READ))??!1,hasBcfWritePermission:((i=l.bcf)==null?void 0:i.includes(S9.WRITE))??!1,hasModelReadPermission:((r=l.model)==null?void 0:r.includes(S9.READ))??!1,hasModelWritePermission:((o=l.model)==null?void 0:o.includes(S9.WRITE))??!1,hasDocReadPermission:((n=l.document)==null?void 0:n.includes(S9.READ))??!1,hasDocWritePermission:((s=l.document)==null?void 0:s.includes(S9.WRITE))??!1}}const vLi={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"}}},CLi={BcfComponents:vLi},yLi={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"}}},wLi={BcfComponents:yLi},bLi={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"}}},ILi={BcfComponents:bLi},BLi={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"}}},ELi={BcfComponents:BLi},xLi={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"}}},kLi={BcfComponents:xLi},MLi={de:CLi,en:wLi,es:ILi,fr:ELi,it:kLi},SLi=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(r){t?mo.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(MLi).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(Bqe).forEach(([o,n])=>{r.component(o,n)})}}),QLi={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"}},DLi={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"},PLi={BuildingMaker:QLi,FileManager:DLi},RLi={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},LLi={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"},FLi={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},_Li={title:"Photosphere Building"},ULi={BIMDataComponents:RLi,BuildingMaker:LLi,FileManager:TLi,MetaBuildingStructure:FLi,PhotosphereBuilding:_Li},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"}},OLi={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"},HLi={BuildingMaker:NLi,FileManager:OLi},VLi={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"}},jLi={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"}},GLi={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"},zLi={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},qLi={title:"Photosph\xE8re Building"},KLi={BIMDataComponents:VLi,BuildingMaker:jLi,FileManager:GLi,MetaBuildingStructure:zLi,PhotosphereBuilding:qLi},JLi={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"}},YLi={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"},WLi={BuildingMaker:JLi,FileManager:YLi},ZLi={de:PLi,en:ULi,es:HLi,fr:KLi,it:WLi},XLi=({i18nPlugin:t}={})=>({install(e){t?Object.entries(ZLi).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(Lvi).forEach(([i,r])=>{e.component(i,r)})}}),$Li={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}},eTi=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:xA,BIMDataClickInputAway:$Li},Symbol.toStringTag,{value:"Module"})),tTi=t=>({install(e){Object.entries(f5t).forEach(([i,r])=>{e.component(i,r)}),Object.entries(eTi).forEach(([i,r])=>e.directive(i.split("BIMData")[1],r))}}),iTi={name:"LiWrapper",render(){return Ln("li",this.$slots.default())}};function rTi(t,e){var i=new Set([]);return t.forEach(r=>{e.has(r)||i.add(r)}),i}const $A=Ia("id"),oTi=({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(hA(kr("visible"),hf("selected"))).map($A)),predicate:()=>e.some(hA(kr("visible"),hf("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(kr("selected")).map($A)),predicate:()=>e.some(kr("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($A);i.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(hA(kr("visible"),kr("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(kr("selected")).map($A)),n=new Set(e.filter(kr("visible")).map($A));i.selectObjects(Array.from(rTi(n,o)),{exclusive:!0})},predicate:()=>e.some(hA(hf("selected"),kr("visible")))&&e.some(hA(kr("selected"),kr("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(hf("visible")).map($A)),predicate:()=>e.some(hf("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(kr("selected"));o.length>0&&i.deselectObjects(o.map($A)),i.hideObjects(this.objectsToHide.map($A))},predicate(){return this.objectsToHide=e.filter(hA(kr("selected"),kr("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(kr("visible"));o.some(kr("selected"))&&i.deselectObjects(o.filter(kr("selected")).map($A)),i.hideObjects(o.map($A))},predicate:()=>e.some(kr("visible"))}].filter(o=>o.predicate()),nTi={components:{LiWrapper:iTi},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)),oTi({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}}},sTi={key:0,class:"separator"},aTi={class:"menu-text"},lTi={key:1,class:"menu-picto"},cTi={key:0,class:"context-menu__spinner"};function dTi(t,e,i,r,o,n){const s=R("BIMDataIconChevron"),a=R("LiWrapper"),l=R("BIMDataSpinner"),c=tr("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?Ft((Q(),U("ul",{key:0,class:"bimdata-list context-menu",style:Be(n.position)},[(Q(!0),U(Et,null,Wt(o.currentCommands,(d,u)=>(Q(),te(a,{key:d.label,class:"context-menu__element",onClick:A=>n.executeCommand(d)},{default:z(()=>[n.isGroupIntersection(u)?(Q(),U("div",sTi)):fe("",!0),B("div",aTi,ee(d.label),1),!d.component&&d.picto?(Q(),U("span",lTi,ee(d.picto),1)):d.component?(Q(),te(s,{key:2,size:"xxs",class:"fill-primary"})):fe("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(Q(),U("li",cTi,[L(l)])):fe("",!0)],4)),[[c,n.away]]):fe("",!0)}const uTi=K(nTi,[["render",dTi],["__scopeId","data-v-5b87d4a3"]]),ATi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=_t("$viewer"),e=xa(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}}},hTi={class:"viewer-header"},pTi={class:"viewer-header__content"},gTi={class:"viewer-header__content__left"},fTi={class:"viewer-header__content__right"},mTi={key:0,class:"m-l-6 flex items-center"},vTi={key:1,class:"viewer-header__version"};function CTi(t,e,i,r,o,n){const s=R("BIMDataIllustration");return Ft((Q(),U("div",hTi,[B("div",pTi,[B("div",gTi,[(Q(!0),U(Et,null,Wt(r.headerLeftContentComponents,a=>(Q(),te(Uo(a),{key:a.name}))),128))]),B("div",fTi,[(Q(!0),U(Et,null,Wt(r.headerRightContentComponents,a=>(Q(),te(Uo(a),{key:a.name}))),128))])]),r.logo||r.version?(Q(),U("div",mTi,[r.logo?(Q(),te(s,{key:0,name:"logo",width:"30px",height:"30px"})):fe("",!0),r.version?(Q(),U("div",vTi,ee(r.version),1)):fe("",!0)])):fe("",!0)],512)),[[vi,i.visible]])}const yTi=K(ATi,[["render",CTi],["__scopeId","data-v-5c9ea6b6"]]),wTi={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)}}}},bTi={class:"bimdata-separator"};function ITi(t,e,i,r,o,n){return Q(),U("div",bTi,[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 BTi=K(wTi,[["render",ITi],["__scopeId","data-v-79a3b3af"]]),ETi={components:{Separator:BTi},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=Ue(null),i=Ue(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}}},xTi={class:"bimdata-global-side-panel__component"};function kTi(t,e,i,r,o,n){const s=R("Separator");return Q(),U("div",{class:"bimdata-global-side-panel",style:Be(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(Q(),te(s,{key:0,onResize:e[0]||(e[0]=a=>r.onResize(a,-1))})):fe("",!0),B("div",xTi,[(Q(),te(Uo(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(Q(),te(s,{key:1,onResize:e[1]||(e[1]=a=>r.onResize(a))})):fe("",!0)],4)}const MTi=K(ETi,[["render",kTi],["__scopeId","data-v-82d0d4cb"]]),STi={name:"BimdataViewer",components:{ContextMenu:uTi,ViewerHeader:yTi,ModalManager:JEe,GlobalSidePanel:MTi},setup(){const t=_t("$viewer"),{globalContext:e,shortcutManager:i}=t;fo(()=>{i&&i.destroy(),e.hub.clear()}),Mr(()=>{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=Ue(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}}},QTi={key:1,class:"global-spinner",style:{"z-index":"3"}},DTi={key:2,class:"viewer__logo"},PTi={key:1,class:"version m-t-6"};function RTi(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 Q(),U("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system 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?(Q(),te(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):fe("",!0),L(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),B("div",{class:"bimdata-viewer__content",style:Be(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(Q(),te(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):fe("",!0),(Q(),te(Uo(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(Q(),te(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):fe("",!0)],4),r.loading?(Q(),U("div",QTi,[r.spinner&&r.spinner.component?(Q(),te(Uo(r.spinner.component),ud(ll({key:0},r.spinner.props)),null,16)):(Q(),te(d,{key:1,size:"40px",border:"5px"}))])):fe("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(Q(),U("div",DTi,[r.bimdataLogoOnSingleWindow?(Q(),te(u,{key:0,name:"logo"})):fe("",!0),r.viewerVersionOnSingleWindow?(Q(),U("div",PTi,ee(r.version),1)):fe("",!0)])):fe("",!0)],544)}const LTi=K(STi,[["render",RTi],["__scopeId","data-v-c02b9f3f"]]),TTi=["src"],FTi={class:"bimdata-models__header"},_Ti={key:0,class:"bimdata-models__header__loader"},UTi={class:"bimdata-models__header__picto"},NTi={class:"bimdata-models__header__name"},OTi={key:0,class:"bimdata-models__header__name--empty"},HTi={key:1,class:"bimdata-models__header__name--empty"},VTi={key:3},jTi=["onMousemove","onClick"],GTi={__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=_t("$viewer"),r=Ue(),o=Ue(0),n=Ue(0),s=Ue(),a=go([]),l=Ue(!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"}},y=(b,E)=>{b!=null&&b.viewer_360_file&&(o.value=E.clientX,n.value=E.clientY),r.value=b?.viewer_360_file},C=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(o1("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 C(i.localContext.modelTypes).then(b=>{a.value=b}),(b,E)=>{const x=R("BIMDataSpinner"),k=R("BIMDataIconModel3D"),M=R("BIMDataTextbox"),D=R("BIMDataCheckbox"),P=R("BIMDataRadio"),T=R("BIMDataIcon"),O=R("BIMDataDropdownList");return Q(),U("div",{ref_key:"templateRef",ref:s,class:be(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[r.value?(Q(),U("div",{key:0,class:"bimdata-models__preview",style:Be(m.value)},[B("img",{src:r.value},null,8,TTi)],4)):fe("",!0),L(O,{style:Be(`--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:V})=>[B("div",FTi,[l.value||u.value.length>0?(Q(),U("div",_Ti,[L(x)])):(Q(),U(Et,{key:1},[B("div",UTi,[L(k)]),B("div",{class:be(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[B("span",null,ee(d.value.length),1)],2),B("div",NTi,[h.value.length===0?(Q(),U("span",OTi,ee(b.$t("model.no_model")),1)):d.value.length===0?(Q(),U("span",HTi,ee(b.$t("model.no_loaded_model")),1)):d.value.length===1?(Q(),te(M,{key:2,text:c.value[0].name,tooltip:!V},null,8,["text","tooltip"])):d.value.length>1?(Q(),U("span",VTi,ee(b.$t("model.selected_models")),1)):fe("",!0)])],64))])]),element:z(({element:V,close:_})=>[B("div",{class:"bimdata-models__model",onMousemove:H=>t.preview&&y(V,H),onMouseout:E[0]||(E[0]=H=>t.preview&&y()),onClick:()=>{!A.value&&!g(V.id)&&_()}},[A.value?(Q(),te(D,{key:0,"model-value":g(V.id)||w(V),disabled:V.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(Q(),te(P,{key:1,"model-value":g(V.id)||w(V),disabled:V.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),L(T,{margin:"0 calc(var(--spacing-unit) / 2)",name:v(V.status),size:"xs",class:be({"fill-success":V.status==="C","fill-high":V.status==="E"})},null,8,["name","class"]),L(M,{class:be({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":V.status!=="C"||u.value.length>0}),text:V.name,width:`calc(100% -
5510
+ `),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",nLi,[r.windowPlugins.leftSidePanel?(Q(),te(a,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):fe("",!0),B("div",sLi,[(Q(!0),U(Et,null,Wt(r.windowPlugins.free,A=>(Q(),te(l,{key:A.name,class:be({"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?(Q(),te(a,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):fe("",!0)]),r.loading?(Q(),U("div",aLi,[r.spinner&&r.spinner.component?(Q(),te(Uo(r.spinner.component),ud(ll({key:0},r.spinner.props)),null,16)):(Q(),te(d,{key:1,size:"20px",border:"3px"}))])):fe("",!0),r.layoutSettingsDisplayed?(Q(),U("div",lLi,[L(u)])):fe("",!0)],36)}const dLi=K(oLi,[["render",cLi],["__scopeId","data-v-558e7ce5"]]);let uLi=class{constructor(t=!0){const e=XPi(mae,null,{resizable:t});e.registerContent("default",dLi),this.settings=xa({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?$Pi(t):null}copy(t,e=!0){return eRi(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 ALi="2.10.0",hLi={version:ALi};class pLi{constructor({plugins:e,api:i,ui:r,locale:o="fr"}){this.pluginManager=new uSi(e),this.windowManager=new hSi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new tPi(i),this.globalContext=new oHe(this),this.state=mPi(this),this.shortcutManager=ZRe(this.state),this.uiSettings=r||{},this.i18n=new iHe(o),this._contextMenu=null,this.layout=new uLi(this.uiSettings.resizable!==!1),this.localContext=null,window.$viewer=this}get version(){return hLi.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||YRe}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 gLi(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 fLi=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),S9=Object.freeze({READ:"read",WRITE:"write"});function ZEe(t){const e={};return t.forEach(i=>{const[r,o]=i.split(":");e[r]?e[r].push(o):e[r]=[o]}),e}const mLi={token_scopes:[],usable_scopes:[],user_role:25};function XEe(t=mLi){var e,i,r,o,n,s;const a=ZEe(t.token_scopes),l=ZEe(t.usable_scopes);return{...rAe(t),tokenScopes:a,usableScopes:l,userRole:fLi[t.user_role],user:t.user?rAe(t.user):null,hasBcfReadPermission:((e=l.bcf)==null?void 0:e.includes(S9.READ))??!1,hasBcfWritePermission:((i=l.bcf)==null?void 0:i.includes(S9.WRITE))??!1,hasModelReadPermission:((r=l.model)==null?void 0:r.includes(S9.READ))??!1,hasModelWritePermission:((o=l.model)==null?void 0:o.includes(S9.WRITE))??!1,hasDocReadPermission:((n=l.document)==null?void 0:n.includes(S9.READ))??!1,hasDocWritePermission:((s=l.document)==null?void 0:s.includes(S9.WRITE))??!1}}const vLi={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"}}},CLi={BcfComponents:vLi},yLi={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"}}},wLi={BcfComponents:yLi},bLi={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"}}},ILi={BcfComponents:bLi},BLi={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"}}},ELi={BcfComponents:BLi},xLi={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"}}},kLi={BcfComponents:xLi},MLi={de:CLi,en:wLi,es:ILi,fr:ELi,it:kLi},SLi=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(r){t?mo.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(MLi).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(Bqe).forEach(([o,n])=>{r.component(o,n)})}}),QLi={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"}},DLi={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"},PLi={BuildingMaker:QLi,FileManager:DLi},RLi={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},LLi={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"},FLi={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},_Li={title:"Photosphere Building"},ULi={BIMDataComponents:RLi,BuildingMaker:LLi,FileManager:TLi,MetaBuildingStructure:FLi,PhotosphereBuilding:_Li},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"}},OLi={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"},HLi={BuildingMaker:NLi,FileManager:OLi},VLi={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"}},jLi={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"}},GLi={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"},zLi={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},qLi={title:"Photosph\xE8re Building"},KLi={BIMDataComponents:VLi,BuildingMaker:jLi,FileManager:GLi,MetaBuildingStructure:zLi,PhotosphereBuilding:qLi},JLi={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"}},YLi={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"},WLi={BuildingMaker:JLi,FileManager:YLi},ZLi={de:PLi,en:ULi,es:HLi,fr:KLi,it:WLi},XLi=({i18nPlugin:t}={})=>({install(e){t?Object.entries(ZLi).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(Lvi).forEach(([i,r])=>{e.component(i,r)})}}),$Li={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}},eTi=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:xA,BIMDataClickInputAway:$Li},Symbol.toStringTag,{value:"Module"})),tTi=t=>({install(e){Object.entries(f5t).forEach(([i,r])=>{e.component(i,r)}),Object.entries(eTi).forEach(([i,r])=>e.directive(i.split("BIMData")[1],r))}}),iTi={name:"LiWrapper",render(){return Ln("li",this.$slots.default())}};function rTi(t,e){var i=new Set([]);return t.forEach(r=>{e.has(r)||i.add(r)}),i}const $A=Ia("id"),oTi=({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(hA(kr("visible"),hf("selected"))).map($A)),predicate:()=>e.some(hA(kr("visible"),hf("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(kr("selected")).map($A)),predicate:()=>e.some(kr("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($A);i.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(hA(kr("visible"),kr("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(kr("selected")).map($A)),n=new Set(e.filter(kr("visible")).map($A));i.selectObjects(Array.from(rTi(n,o)),{exclusive:!0})},predicate:()=>e.some(hA(hf("selected"),kr("visible")))&&e.some(hA(kr("selected"),kr("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(hf("visible")).map($A)),predicate:()=>e.some(hf("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(kr("selected"));o.length>0&&i.deselectObjects(o.map($A)),i.hideObjects(this.objectsToHide.map($A))},predicate(){return this.objectsToHide=e.filter(hA(kr("selected"),kr("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(kr("visible"));o.some(kr("selected"))&&i.deselectObjects(o.filter(kr("selected")).map($A)),i.hideObjects(o.map($A))},predicate:()=>e.some(kr("visible"))}].filter(o=>o.predicate()),nTi={components:{LiWrapper:iTi},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)),oTi({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}}},sTi={key:0,class:"separator"},aTi={class:"menu-text"},lTi={key:1,class:"menu-picto"},cTi={key:0,class:"context-menu__spinner"};function dTi(t,e,i,r,o,n){const s=R("BIMDataIconChevron"),a=R("LiWrapper"),l=R("BIMDataSpinner"),c=tr("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?Ft((Q(),U("ul",{key:0,class:"bimdata-list context-menu",style:Be(n.position)},[(Q(!0),U(Et,null,Wt(o.currentCommands,(d,u)=>(Q(),te(a,{key:d.label,class:"context-menu__element",onClick:A=>n.executeCommand(d)},{default:z(()=>[n.isGroupIntersection(u)?(Q(),U("div",sTi)):fe("",!0),B("div",aTi,ee(d.label),1),!d.component&&d.picto?(Q(),U("span",lTi,ee(d.picto),1)):d.component?(Q(),te(s,{key:2,size:"xxs",class:"fill-primary"})):fe("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(Q(),U("li",cTi,[L(l)])):fe("",!0)],4)),[[c,n.away]]):fe("",!0)}const uTi=K(nTi,[["render",dTi],["__scopeId","data-v-5b87d4a3"]]),ATi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=_t("$viewer"),e=xa(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}}},hTi={class:"viewer-header"},pTi={class:"viewer-header__content"},gTi={class:"viewer-header__content__left"},fTi={class:"viewer-header__content__right"},mTi={key:0,class:"m-l-6 flex items-center"},vTi={key:1,class:"viewer-header__version"};function CTi(t,e,i,r,o,n){const s=R("BIMDataIllustration");return Ft((Q(),U("div",hTi,[B("div",pTi,[B("div",gTi,[(Q(!0),U(Et,null,Wt(r.headerLeftContentComponents,a=>(Q(),te(Uo(a),{key:a.name}))),128))]),B("div",fTi,[(Q(!0),U(Et,null,Wt(r.headerRightContentComponents,a=>(Q(),te(Uo(a),{key:a.name}))),128))])]),r.logo||r.version?(Q(),U("div",mTi,[r.logo?(Q(),te(s,{key:0,name:"logo",width:"30px",height:"30px"})):fe("",!0),r.version?(Q(),U("div",vTi,ee(r.version),1)):fe("",!0)])):fe("",!0)],512)),[[vi,i.visible]])}const yTi=K(ATi,[["render",CTi],["__scopeId","data-v-5c9ea6b6"]]),wTi={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)}}}},bTi={class:"bimdata-separator"};function ITi(t,e,i,r,o,n){return Q(),U("div",bTi,[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 BTi=K(wTi,[["render",ITi],["__scopeId","data-v-79a3b3af"]]),ETi={components:{Separator:BTi},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=Ue(null),i=Ue(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}}},xTi={class:"bimdata-global-side-panel__component"};function kTi(t,e,i,r,o,n){const s=R("Separator");return Q(),U("div",{class:"bimdata-global-side-panel",style:Be(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(Q(),te(s,{key:0,onResize:e[0]||(e[0]=a=>r.onResize(a,-1))})):fe("",!0),B("div",xTi,[(Q(),te(Uo(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(Q(),te(s,{key:1,onResize:e[1]||(e[1]=a=>r.onResize(a))})):fe("",!0)],4)}const MTi=K(ETi,[["render",kTi],["__scopeId","data-v-82d0d4cb"]]),STi={name:"BimdataViewer",components:{ContextMenu:uTi,ViewerHeader:yTi,ModalManager:JEe,GlobalSidePanel:MTi},setup(){const t=_t("$viewer"),{globalContext:e,shortcutManager:i}=t;fo(()=>{i&&i.destroy(),e.hub.clear()}),Mr(()=>{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=Ue(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}}},QTi={key:1,class:"global-spinner",style:{"z-index":"3"}},DTi={key:2,class:"viewer__logo"},PTi={key:1,class:"version m-t-6"};function RTi(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 Q(),U("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system 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?(Q(),te(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):fe("",!0),L(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),B("div",{class:"bimdata-viewer__content",style:Be(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(Q(),te(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):fe("",!0),(Q(),te(Uo(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(Q(),te(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):fe("",!0)],4),r.loading?(Q(),U("div",QTi,[r.spinner&&r.spinner.component?(Q(),te(Uo(r.spinner.component),ud(ll({key:0},r.spinner.props)),null,16)):(Q(),te(d,{key:1,size:"40px",border:"5px"}))])):fe("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(Q(),U("div",DTi,[r.bimdataLogoOnSingleWindow?(Q(),te(u,{key:0,name:"logo"})):fe("",!0),r.viewerVersionOnSingleWindow?(Q(),U("div",PTi,ee(r.version),1)):fe("",!0)])):fe("",!0)],544)}const LTi=K(STi,[["render",RTi],["__scopeId","data-v-c02b9f3f"]]),TTi=["src"],FTi={class:"bimdata-models__header"},_Ti={key:0,class:"bimdata-models__header__loader"},UTi={class:"bimdata-models__header__picto"},NTi={class:"bimdata-models__header__name"},OTi={key:0,class:"bimdata-models__header__name--empty"},HTi={key:1,class:"bimdata-models__header__name--empty"},VTi={key:3},jTi=["onMousemove","onClick"],GTi={__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=_t("$viewer"),r=Ue(),o=Ue(0),n=Ue(0),s=Ue(),a=go([]),l=Ue(!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"}},y=(b,E)=>{b!=null&&b.viewer_360_file&&(o.value=E.clientX,n.value=E.clientY),r.value=b?.viewer_360_file},C=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(o1("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 C(i.localContext.modelTypes).then(b=>{a.value=b}),(b,E)=>{const x=R("BIMDataSpinner"),k=R("BIMDataIconModel3D"),M=R("BIMDataTextbox"),D=R("BIMDataCheckbox"),P=R("BIMDataRadio"),T=R("BIMDataIcon"),O=R("BIMDataDropdownList");return Q(),U("div",{ref_key:"templateRef",ref:s,class:be(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[r.value?(Q(),U("div",{key:0,class:"bimdata-models__preview",style:Be(m.value)},[B("img",{src:r.value},null,8,TTi)],4)):fe("",!0),L(O,{style:Be(`--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:V})=>[B("div",FTi,[l.value||u.value.length>0?(Q(),U("div",_Ti,[L(x)])):(Q(),U(Et,{key:1},[B("div",UTi,[L(k)]),B("div",{class:be(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[B("span",null,ee(d.value.length),1)],2),B("div",NTi,[h.value.length===0?(Q(),U("span",OTi,ee(b.$t("model.no_model")),1)):d.value.length===0?(Q(),U("span",HTi,ee(b.$t("model.no_loaded_model")),1)):d.value.length===1?(Q(),te(M,{key:2,text:c.value[0].name,tooltip:!V},null,8,["text","tooltip"])):d.value.length>1?(Q(),U("span",VTi,ee(b.$t("model.selected_models")),1)):fe("",!0)])],64))])]),element:z(({element:V,close:_})=>[B("div",{class:"bimdata-models__model",onMousemove:H=>t.preview&&y(V,H),onMouseout:E[0]||(E[0]=H=>t.preview&&y()),onClick:()=>{!A.value&&!g(V.id)&&_()}},[A.value?(Q(),te(D,{key:0,"model-value":g(V.id)||w(V),disabled:V.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(Q(),te(P,{key:1,"model-value":g(V.id)||w(V),disabled:V.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),L(T,{margin:"0 calc(var(--spacing-unit) / 2)",name:v(V.status),size:"xs",class:be({"fill-success":V.status==="C","fill-high":V.status==="E"})},null,8,["name","class"]),L(M,{class:be({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":V.status!=="C"||u.value.length>0}),text:V.name,width:`calc(100% -
5511
5511
  ${A.value?13:23}px - 2 * 6px - 16px)`},null,8,["class","text","width"]),V.document&&!V.document.is_head_version?(Q(),te(T,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):fe("",!0)],40,jTi),p(V.id)?(Q(),te(x,{key:0,class:"bimdata-models__model__spinner"})):fe("",!0)]),_:1},8,["style","width","list","loading","disabled"])],2)}}},$Ee=K(GTi,[["__scopeId","data-v-34c2cf79"]]),zTi="data:image/svg+xml,%3csvg%20width='16'%20height='21'%20viewBox='0%200%2016%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.47193%202.76644C7.65699%202.84439%207.77716%203.02565%207.777%203.22661L7.77339%207.94624C7.77318%208.22238%207.54916%208.44655%207.27301%208.44693L2.4192%208.45366C2.21569%208.45394%202.03258%208.33085%201.95617%208.1424C1.87975%207.95394%201.92528%207.73773%202.07129%207.59566L6.92872%202.86931C7.0729%202.72902%207.28688%202.6885%207.47193%202.76644ZM3.65141%207.45195L6.77378%207.44762L6.7761%204.41157L3.65141%207.45195ZM5.81657%200.893911L6.02338%200.893274L13.3879%200.870595C14.679%200.866619%2015.7208%201.91642%2015.722%203.20083L15.2221%203.20237L15.722%203.20052L15.722%203.20083L15.745%2017.8999L15.745%2017.9002C15.7462%2019.1846%2014.7063%2020.2408%2013.4153%2020.2448L2.35929%2020.2788C1.07114%2020.2828%200.0171799%2019.2362%200.0159721%2017.9486L0.00563138%206.92409L0.00543684%206.71668L0.152103%206.56972L5.67032%201.04045L5.81657%200.893911ZM6.23113%201.89264L1.00582%207.12841L1.01597%2017.9455C1.01666%2018.6791%201.62068%2019.2811%202.35835%2019.2788L13.4143%2019.2448C14.1484%2019.2425%2014.7456%2018.6402%2014.745%2017.9035C14.745%2017.9034%2014.745%2017.9033%2014.745%2017.9033L14.722%203.20423L14.722%203.20391C14.7213%202.46716%2014.123%201.86833%2013.3888%201.87059L6.23113%201.89264Z'%20fill='%232F374A'/%3e%3c/svg%3e",qTi=["src"],KTi={key:0,class:"bimdata-multi-model-loader__header-container"},JTi={key:0,class:"bimdata-multi-model-loader__header__loader"},YTi={class:"bimdata-multi-model-loader__header__picto"},WTi=["src"],ZTi={class:"bimdata-multi-model-loader__header__name"},XTi={key:0,class:"bimdata-multi-model-loader__header__name--empty"},$Ti={key:1,class:"bimdata-multi-model-loader__header__name--empty"},eFi={key:3},tFi={key:1,class:"bimdata-multi-model-loader__main"},iFi=["onMousemove","onClick"],rFi={__name:"BIMDataMultiModelLoader",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=_t("$viewer"),r=Ue(),o=Ue(0),n=Ue(0),s=Ue(),a=go([]),l=Ue(!1),c=Ue(!0),d=P=>{P.key==="Escape"?c.value=!0:P.key==="Enter"&&x()};Ht(c,P=>{P?(window.removeEventListener("keydown",d),y.clear(),v.clear(),r.value=null):window.addEventListener("keydown",d)});const u=At(()=>i.localContext.loadedModels),A=At(()=>i.localContext.loadedModelIds),h=At(()=>i.localContext.loadingModelIds),g=At(()=>i.localContext.multiModel),p=At(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(P=>u.value.find(T=>{var O;return((O=T.document)==null?void 0:O.head_id)!=null&&T.document.head_id===P.document.id})??P)),m=P=>A.value.includes(P),f=P=>h.value.includes(P),v=xa(new Set),y=xa(new Set),C=P=>{var T;return((T=P.children)==null?void 0:T.some(O=>m(O.id)))??!1},w=P=>(m(P.id)||C(P)||v.has(P))&&!y.has(P),b=At(()=>{const{x:P,y:T}=s.value.getBoundingClientRect();return`top:${n.value-T}px; left:${o.value-P}px;`}),E=P=>{P.status==="C"&&(!g.value&&m(P.id)||(m(P.id)?y.has(P)?y.delete(P):y.add(P):v.has(P)?v.delete(P):v.add(P)))},x=()=>{v.size>0&&i.localContext.loadModels(Array.from(v).map(P=>P.id)),y.size>0&&i.localContext.unloadModels(Array.from(y).map(P=>P.id)),c.value=!0},k=P=>{switch(P){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},M=P=>P.document&&!P.document.is_head_version,D=(P,T)=>{e.preview&&(P!=null&&P.viewer_360_file&&(o.value=T.clientX,n.value=T.clientY),r.value=P?.viewer_360_file)};return(async P=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,P)).filter(T=>i.state.models.some(O=>O.archived)||!T.archived).sort(o1("updated_at",!1))}catch(T){console.error("[Models] Cannot get project models. Error: ",T)}finally{l.value=!1}return[]})(i.localContext.modelTypes).then(P=>{a.value=P}),(P,T)=>{const O=R("BIMDataSpinner"),V=R("BIMDataTextbox"),_=R("BIMDataIconChevron"),H=R("BIMDataButton"),Y=R("BIMDataIconFileIfcPolychrome"),re=R("BIMDataCheckbox"),de=R("BIMDataRadio"),xe=R("BIMDataIcon"),pe=R("BIMDataPaginatedList"),Ee=tr("click-away");return Q(),U("div",{ref_key:"templateRef",ref:s,class:be(["bimdata-multi-model-loader",{"bimdata-multi-model-loader--window-positioning":t.windowPositioning}])},[r.value?(Q(),U("div",{key:0,class:"bimdata-multi-model-loader__preview",style:Be(b.value)},[B("img",{src:r.value},null,8,qTi)],4)):fe("",!0),L(lr,{name:"fade",mode:"out-in"},{default:z(()=>[c.value?(Q(),U("div",KTi,[Mt(P.$slots,"left",{},void 0,!0),B("div",{class:"bimdata-multi-model-loader__header",onClick:T[0]||(T[0]=ue=>c.value=!1)},[l.value||h.value.length>0?(Q(),U("div",JTi,[L(O)])):(Q(),U(Et,{key:1},[B("div",YTi,[B("img",{src:Vt(zTi),alt:"file icon"},null,8,WTi)]),B("div",{class:be(["bimdata-multi-model-loader__header__number bimdata-info-length",{"bimdata-multi-model-loader__header__number--empty":A.value.length===0}])},[B("span",null,ee(A.value.length),1)],2),B("div",ZTi,[p.value.length===0?(Q(),U("span",XTi,ee(P.$t("model.no_model")),1)):A.value.length===0?(Q(),U("span",$Ti,ee(P.$t("model.no_loaded_model")),1)):A.value.length===1?(Q(),te(V,{key:2,text:u.value[0].name,tooltip:c.value,width:"233px"},null,8,["text","tooltip"])):A.value.length>1?(Q(),U("span",eFi,ee(P.$t("model.selected_models")),1)):fe("",!0)]),L(H,{color:"default",icon:"",radius:"",fill:"",width:"21px",height:"21px"},{default:z(()=>[L(_,{size:"xxxs"})]),_:1})],64))]),Mt(P.$slots,"right",{},void 0,!0)])):Ft((Q(),U("div",tFi,[L(pe,{list:p.value,"per-page":10},{element:z(({element:ue})=>[B("div",{class:be(["bimdata-multi-model-loader__main__model",{"bimdata-multi-model-loader__main__model--disabled":ue.status!=="C"}]),onMousemove:De=>D(ue,De),onMouseout:T[1]||(T[1]=De=>D()),onClick:De=>E(ue)},[L(Y,{fill:"",color:"default",size:"xs"}),g.value?(Q(),te(re,{key:0,"model-value":w(ue),disabled:ue.status!=="C"},null,8,["model-value","disabled"])):(Q(),te(de,{key:1,"model-value":w(ue),disabled:ue.status!=="C"},null,8,["model-value","disabled"])),L(V,{class:be({"bimdata-multi-model-loader__main__model__name":!0,"bimdata-multi-model-loader__main__model__name--disabled":ue.status!=="C"}),text:ue.name,width:M(ue)?"333px":"363px"},null,8,["class","text","width"]),M(ue)?(Q(),te(xe,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):fe("",!0),f(ue.id)?(Q(),te(O,{key:3,class:"bimdata-multi-model-loader__main__model__spinner"})):(Q(),te(xe,{key:4,name:k(ue.status),size:"xs",class:be({"fill-success":ue.status==="C","fill-high":ue.status==="E"})},null,8,["name","class"]))],42,iFi)]),_:1},8,["list"]),L(H,{class:"bimdata-multi-model-loader__main__validate",width:"93px",color:"primary",fill:"",radius:"",disabled:Vt(v).size===0&&Vt(y).size===0,onClick:x},{default:z(()=>[gt(ee(P.$t("global.validate")),1)]),_:1},8,["disabled"])])),[[Ee,()=>c.value=!0]])]),_:3})],2)}}},oFi=K(rFi,[["__scopeId","data-v-ef41eab1"]]),nFi={data(){return{shown:!1}},mounted(){setTimeout(()=>{this.shown=!0},500)}};function sFi(t,e,i,r,o,n){const s=R("BIMDataIllustration");return Q(),U("div",{class:"bimdata__no-model",style:Be({"--no-model--opacity":o.shown?1:0})},[L(s,{name:"emptyViewer",x:"90",y:"90"}),B("span",null,ee(t.$t("model.select_model")),1)],4)}const exe=K(nFi,[["render",sFi],["__scopeId","data-v-5ffd9bc0"]]);window.BIMDataViewerVue=mae;class aFi{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 pLi(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=XEe(u)}catch{o.api.permissions=XEe()}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 Ln(LTi,{style:"height: 100%"})}},l=ny(a).use(s.i18nVuePlugin).use(tTi()).use(XLi({i18nPlugin:s.i18nVuePlugin})).use(SLi({apiClient:o.api.apiClient,i18nPlugin:s.i18nVuePlugin}));l.provide("$viewer",o),l.component("BIMDataModelLoader",$Ee),l.component("BIMDataMultiModelLoader",oFi),l.component("BIMDataNoModelWindowPlaceHolder",exe),l.component("BIMDataStoreySelector",Xj),l.component("ModelsLoader",$Ee),l.component("NoModelWindowPlaceHolder",exe);const c=e instanceof HTMLElement?e:document.querySelector(e);c&&(c.style.height="100%");const d=l.mount(e);return d.$viewer=o,gLi(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(!Rae.includes(e))throw new Error(`Viewer available locales are ${Rae.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 txe=(t={})=>new aFi(t);window.makeBIMDataViewer=txe;var iI={};iI.d=(t,e)=>{for(var i in e)iI.o(e,i)&&!iI.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},iI.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var zi=globalThis.pdfjsLib={};iI.d(zi,{AbortException:()=>og,AnnotationEditorLayer:()=>bUi,AnnotationEditorParamsType:()=>Qr,AnnotationEditorType:()=>rr,AnnotationEditorUIManager:()=>CI,AnnotationLayer:()=>dUi,AnnotationMode:()=>ig,ColorPicker:()=>AMe,DOMSVGFactory:()=>UX,DrawLayer:()=>IUi,FeatureTest:()=>xl,GlobalWorkerOptions:()=>mg,ImageKind:()=>gR,InvalidPDFException:()=>UZ,MissingPDFException:()=>oI,OPS:()=>Vu,OutputScale:()=>YZ,PDFDataRangeTransport:()=>Ske,PDFDateString:()=>KZ,PDFWorker:()=>DL,PasswordResponses:()=>uFi,PermissionFlag:()=>dFi,PixelsPerInch:()=>D9,RenderingCancelledException:()=>zZ,TextLayer:()=>RX,TouchManager:()=>Dxe,UnexpectedResponseException:()=>CR,Util:()=>bi,VerbosityLevel:()=>fR,XfaLayer:()=>Lke,build:()=>j_i,createValidAbsoluteUrl:()=>gFi,fetchData:()=>bR,getDocument:()=>P_i,getFilenameFromUrl:()=>BFi,getPdfFilenameFromUrl:()=>EFi,getXfaPageViewport:()=>xFi,isDataScheme:()=>IR,isPdfFile:()=>qZ,noContextMenu:()=>ju,normalizeUnicode:()=>wFi,setLayerDimensions:()=>H2,shadow:()=>pr,stopEvent:()=>Xc,version:()=>V_i});const Oa=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),ixe=[1,0,0,1,0,0],TZ=[.001,0,0,.001,0,0],lFi=1e7,FZ=1.35,Zc={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},ig={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},cFi="pdfjs_internal_editor_",rr={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},Qr={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},dFi={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Ha={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},gR={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Cs={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,WIDGET:20},rI={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},fR={ERRORS:0,WARNINGS:1,INFOS:5},Vu={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},uFi={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let mR=fR.WARNINGS;function AFi(t){Number.isInteger(t)&&(mR=t)}function hFi(){return mR}function vR(t){mR>=fR.INFOS&&console.log(`Info: ${t}`)}function or(t){mR>=fR.WARNINGS&&console.log(`Warning: ${t}`)}function Mo(t){throw new Error(t)}function $n(t,e){t||Mo(e)}function pFi(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function gFi(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=yFi(t)}catch{}}const r=e?new URL(t,e):new URL(t);if(pFi(r))return r}catch{}return null}function pr(t,e,i,r=!1){return Object.defineProperty(t,e,{value:i,enumerable:!r,configurable:!0,writable:!1}),i}const rg=function(){function t(e,i){this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();let rxe=class extends rg{constructor(t,e){super(t,"PasswordException"),this.code=e}},_Z=class extends rg{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},UZ=class extends rg{constructor(t){super(t,"InvalidPDFException")}},oI=class extends rg{constructor(t){super(t,"MissingPDFException")}},CR=class extends rg{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}},fFi=class extends rg{constructor(t){super(t,"FormatError")}},og=class extends rg{constructor(t){super(t,"AbortException")}};function oxe(t){(typeof t!="object"||t?.length===void 0)&&Mo("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 yR(t){typeof t!="string"&&Mo("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 mFi(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function NZ(t){const e=Object.create(null);for(const[i,r]of t)e[i]=r;return e}function vFi(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}function CFi(){try{return new Function(""),!0}catch{return!1}}class xl{static get isLittleEndian(){return pr(this,"isLittleEndian",vFi())}static get isEvalSupported(){return pr(this,"isEvalSupported",CFi())}static get isOffscreenCanvasSupported(){return pr(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return pr(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){return typeof navigator<"u"&&typeof navigator?.platform=="string"?pr(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:typeof navigator?.userAgent=="string"&&navigator.userAgent.includes("Firefox")}):pr(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){var e,i;return pr(this,"isCSSRoundSupported",(i=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:i.call(e,"width: round(1.5px, 1px)"))}}const OZ=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));var O2,HZ,wR,VZ;let bi=(HZ=class{static makeHexColor(t,e,i){return`#${OZ[t]}${OZ[e]}${OZ[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)],oe(this,O2,VZ).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),oe(this,O2,VZ).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}},O2=new WeakSet,wR=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)},VZ=function(t,e,i,r,o,n,s,a,l,c,d,u){if(Math.abs(l)<1e-12){Math.abs(c)>=1e-12&&oe(this,O2,wR).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;oe(this,O2,wR).call(this,t,e,i,r,o,n,s,a,(-c+h)/g,u),oe(this,O2,wR).call(this,t,e,i,r,o,n,s,a,(-c-h)/g,u)},ce(HZ,O2),HZ);function yFi(t){return decodeURIComponent(escape(t))}let jZ=null,nxe=null;function wFi(t){return jZ||(jZ=/([\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,nxe=new Map([["\uFB05","\u017Ft"]])),t.replaceAll(jZ,(e,i,r)=>i?i.normalize("NFKC"):nxe.get(r))}function bFi(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),oxe(t)}const GZ="pdfjs_internal_id_";function IFi(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(oxe(t))}typeof Promise.try!="function"&&(Promise.try=function(t,...e){return new Promise(i=>{i(t(...e))})});const N1="http://www.w3.org/2000/svg",Q9=class{};ai(Q9,"CSS",96),ai(Q9,"PDF",72),ai(Q9,"PDF_TO_CSS_UNITS",Q9.CSS/Q9.PDF);let D9=Q9;async function bR(t,e="text"){if(nI(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 YE{constructor({viewBox:e,userUnit:i,scale:r,rotation:o,offsetX:n=0,offsetY:s=0,dontFlip:a=!1}){this.viewBox=e,this.userUnit=i,this.scale=r,this.rotation=o,this.offsetX=n,this.offsetY=s,r*=i;const l=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let d,u,A,h;switch(o%=360,o<0&&(o+=360),o){case 180:d=-1,u=0,A=0,h=1;break;case 90:d=0,u=1,A=1,h=0;break;case 270:d=0,u=-1,A=-1,h=0;break;case 0:d=1,u=0,A=0,h=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(A=-A,h=-h);let g,p,m,f;d===0?(g=Math.abs(c-e[1])*r+n,p=Math.abs(l-e[0])*r+s,m=(e[3]-e[1])*r,f=(e[2]-e[0])*r):(g=Math.abs(l-e[0])*r+n,p=Math.abs(c-e[1])*r+s,m=(e[2]-e[0])*r,f=(e[3]-e[1])*r),this.transform=[d*r,u*r,A*r,h*r,g-d*r*l-A*r*c,p-u*r*l-h*r*c],this.width=m,this.height=f}get rawDims(){const{userUnit:e,viewBox:i}=this,r=i.map(o=>o*e);return pr(this,"rawDims",{pageWidth:r[2]-r[0],pageHeight:r[3]-r[1],pageX:r[0],pageY:r[1]})}clone({scale:e=this.scale,rotation:i=this.rotation,offsetX:r=this.offsetX,offsetY:o=this.offsetY,dontFlip:n=!1}={}){return new YE({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:i,offsetX:r,offsetY:o,dontFlip:n})}convertToViewportPoint(e,i){return bi.applyTransform([e,i],this.transform)}convertToViewportRectangle(e){const i=bi.applyTransform([e[0],e[1]],this.transform),r=bi.applyTransform([e[2],e[3]],this.transform);return[i[0],i[1],r[0],r[1]]}convertToPdfPoint(e,i){return bi.applyInverseTransform([e,i],this.transform)}}class zZ extends rg{constructor(e,i=0){super(e,"RenderingCancelledException"),this.extraDelay=i}}function IR(t){const e=t.length;let i=0;for(;i<e&&t[i].trim()==="";)i++;return t.substring(i,i+5).toLowerCase()==="data:"}function qZ(t){return typeof t=="string"&&/\.pdf$/i.test(t)}function BFi(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function EFi(t,e="document.pdf"){if(typeof t!="string")return e;if(IR(t))return or('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 sxe{constructor(){ai(this,"started",Object.create(null)),ai(this,"times",[])}time(e){e in this.started&&or(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||or(`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
5512
5512
  `);return e.join("")}}function nI(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return i==="http:"||i==="https:"}catch{return!1}}function ju(t){t.preventDefault()}function Xc(t){t.preventDefault(),t.stopPropagation()}var sI;class KZ{static toDateObject(e){if(!e||typeof e!="string")return null;S(this,sI)||ie(this,sI,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const i=S(this,sI).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))}}sI=new WeakMap,ce(KZ,sI);function xFi(t,{scale:e=1,rotation:i=0}){const{width:r,height:o}=t.attributes.style,n=[0,0,parseInt(r),parseInt(o)];return new YE({viewBox:n,userUnit:1,scale:e,rotation:i})}function JZ(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):(or(`Not a valid color format: "${t}"`),[0,0,0])}function kFi(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,JZ(r))}e.remove()}function en(t){const{a:e,b:i,c:r,d:o,e:n,f:s}=t.getTransform();return[e,i,r,o,n,s]}function eh(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 H2(t,e,i=!1,r=!0){if(e instanceof YE){const{pageWidth:o,pageHeight:n}=e.rawDims,{style:s}=t,a=xl.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 YZ{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 V2,P9,th,R9,BR,aI,WZ,axe,ih,lxe,cxe,ER,dxe,ZZ;const xR=class f_{constructor(e){ce(this,ih),ce(this,V2,null),ce(this,P9,null),ce(this,th),ce(this,R9,null),ce(this,BR,null),ie(this,th,e),S(f_,aI)||ie(f_,aI,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=ie(this,V2,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const i=S(this,th)._uiManager._signal;e.addEventListener("contextmenu",ju,{signal:i}),e.addEventListener("pointerdown",oe(f_,WZ,axe),{signal:i});const r=ie(this,R9,document.createElement("div"));r.className="buttons",e.append(r);const o=S(this,th).toolbarPosition;if(o){const{style:n}=e,s=S(this,th)._uiManager.direction==="ltr"?1-o[0]:o[0];n.insetInlineEnd=`${100*s}%`,n.top=`calc(${100*o[1]}% + var(--editor-toolbar-vert-offset))`}return oe(this,ih,dxe).call(this),e}get div(){return S(this,V2)}hide(){var e;S(this,V2).classList.add("hidden"),(e=S(this,P9))==null||e.hideDropdown()}show(){var e;S(this,V2).classList.remove("hidden"),(e=S(this,BR))==null||e.shown()}async addAltText(e){const i=await e.render();oe(this,ih,ER).call(this,i),S(this,R9).prepend(i,S(this,ih,ZZ)),ie(this,BR,e)}addColorPicker(e){ie(this,P9,e);const i=e.renderButton();oe(this,ih,ER).call(this,i),S(this,R9).prepend(i,S(this,ih,ZZ))}remove(){var e;S(this,V2).remove(),(e=S(this,P9))==null||e.destroy(),ie(this,P9,null)}};V2=new WeakMap,P9=new WeakMap,th=new WeakMap,R9=new WeakMap,BR=new WeakMap,aI=new WeakMap,WZ=new WeakSet,axe=function(t){t.stopPropagation()},ih=new WeakSet,lxe=function(t){S(this,th)._focusEventsAllowed=!1,Xc(t)},cxe=function(t){S(this,th)._focusEventsAllowed=!0,Xc(t)},ER=function(t){const e=S(this,th)._uiManager._signal;t.addEventListener("focusin",oe(this,ih,lxe).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",oe(this,ih,cxe).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",ju,{signal:e})},dxe=function(){const{editorType:t,_uiManager:e}=S(this,th),i=document.createElement("button");i.className="delete",i.tabIndex=0,i.setAttribute("data-l10n-id",S(xR,aI)[t]),oe(this,ih,ER).call(this,i),i.addEventListener("click",r=>{e.delete()},{signal:e._signal}),S(this,R9).append(i)},ZZ=function(){const t=document.createElement("div");return t.className="divider",t},ce(xR,WZ),ce(xR,aI,null);let MFi=xR;var kR,j2,L9,lI,uxe,Axe,hxe;class SFi{constructor(e){ce(this,lI),ce(this,kR,null),ce(this,j2,null),ce(this,L9),ie(this,L9,e)}show(e,i,r){const[o,n]=oe(this,lI,Axe).call(this,i,r),{style:s}=S(this,j2)||ie(this,j2,oe(this,lI,uxe).call(this));e.append(S(this,j2)),s.insetInlineEnd=`${100*o}%`,s.top=`calc(${100*n}% + var(--editor-toolbar-vert-offset))`}hide(){S(this,j2).remove()}}kR=new WeakMap,j2=new WeakMap,L9=new WeakMap,lI=new WeakSet,uxe=function(){const t=ie(this,j2,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",ju,{signal:S(this,L9)._signal});const e=ie(this,kR,document.createElement("div"));return e.className="buttons",t.append(e),oe(this,lI,hxe).call(this),t},Axe=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]},hxe=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=S(this,L9)._signal;t.addEventListener("contextmenu",ju,{signal:i}),t.addEventListener("click",()=>{S(this,L9).highlightSelection("floating_button")},{signal:i}),S(this,kR).append(t)};function MR(t,e,i){for(const r of i)e.addEventListener(r,t[r].bind(t))}var XZ;class QFi{constructor(){ce(this,XZ,0)}get id(){return`${cFi}${Ol(this,XZ)._++}`}}XZ=new WeakMap;var cI,SR,ys,dI,QR;const pxe=class{constructor(){ce(this,dI),ce(this,cI,bFi()),ce(this,SR,0),ce(this,ys,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 pr(this,"_isSVGFittingCanvas",o)}async getFromFile(e){const{lastModified:i,name:r,size:o,type:n}=e;return oe(this,dI,QR).call(this,`${i}_${r}_${o}_${n}`,e)}async getFromUrl(e){return oe(this,dI,QR).call(this,e,e)}async getFromBlob(e,i){const r=await i;return oe(this,dI,QR).call(this,e,r)}async getFromId(e){S(this,ys)||ie(this,ys,new Map);const i=S(this,ys).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){S(this,ys)||ie(this,ys,new Map);let r=S(this,ys).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_${S(this,cI)}_${Ol(this,SR)._++}`,refCounter:1,isSvg:!1},S(this,ys).set(e,r),S(this,ys).set(r.id,r),r}getSvgUrl(e){const i=S(this,ys).get(e);return i!=null&&i.isSvg?i.svgUrl:null}deleteId(e){var i;S(this,ys)||ie(this,ys,new Map);const r=S(this,ys).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_${S(this,cI)}_`)}};cI=new WeakMap,SR=new WeakMap,ys=new WeakMap,dI=new WeakSet,QR=async function(t,e){S(this,ys)||ie(this,ys,new Map);let i=S(this,ys).get(t);if(i===null)return null;if(i!=null&&i.bitmap)return i.refCounter+=1,i;try{i||(i={bitmap:null,id:`image_${S(this,cI)}_${Ol(this,SR)._++}`,refCounter:0,isSvg:!1});let r;if(typeof e=="string"?(i.url=e,r=await bR(e,"blob")):e instanceof File?r=i.file=e:e instanceof Blob&&(r=e),r.type==="image/svg+xml"){const o=pxe._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){or(r),i=null}return S(this,ys).set(t,i),i&&S(this,ys).set(i.id,i),i};let DFi=pxe;var es,G2,DR,tn;class PFi{constructor(e=128){ce(this,es,[]),ce(this,G2,!1),ce(this,DR),ce(this,tn,-1),ie(this,DR,e)}add({cmd:e,undo:i,post:r,mustExec:o,type:n=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}){if(o&&e(),S(this,G2))return;const l={cmd:e,undo:i,post:r,type:n};if(S(this,tn)===-1){S(this,es).length>0&&(S(this,es).length=0),ie(this,tn,0),S(this,es).push(l);return}if(s&&S(this,es)[S(this,tn)].type===n){a&&(l.undo=S(this,es)[S(this,tn)].undo),S(this,es)[S(this,tn)]=l;return}const c=S(this,tn)+1;c===S(this,DR)?S(this,es).splice(0,1):(ie(this,tn,c),c<S(this,es).length&&S(this,es).splice(c)),S(this,es).push(l)}undo(){if(S(this,tn)===-1)return;ie(this,G2,!0);const{undo:e,post:i}=S(this,es)[S(this,tn)];e(),i?.(),ie(this,G2,!1),ie(this,tn,S(this,tn)-1)}redo(){if(S(this,tn)<S(this,es).length-1){ie(this,tn,S(this,tn)+1),ie(this,G2,!0);const{cmd:e,post:i}=S(this,es)[S(this,tn)];e(),i?.(),ie(this,G2,!1)}}hasSomethingToUndo(){return S(this,tn)!==-1}hasSomethingToRedo(){return S(this,tn)<S(this,es).length-1}cleanType(e){if(S(this,tn)!==-1){for(let i=S(this,tn);i>=0;i--)if(S(this,es)[i].type!==e){S(this,es).splice(i+1,S(this,tn)-i),ie(this,tn,i);return}S(this,es).length=0,ie(this,tn,-1)}}destroy(){ie(this,es,null)}}es=new WeakMap,G2=new WeakMap,DR=new WeakMap,tn=new WeakMap;var $Z,gxe;class uI{constructor(e){ce(this,$Z),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:i}=xl.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(oe(this,$Z,gxe).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||Xc(i))}}$Z=new WeakSet,gxe=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 fxe=class CRe{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return kFi(e),pr(this,"_colors",e)}convert(e){const i=JZ(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 CRe._colorsMapping.get(r);return i}getHexCode(e){const i=this._colors.get(e);return i?bi.makeHexColor(...i):e}};ai(fxe,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let RFi=fxe;var AI,Td,Us,Va,hI,ng,T9,Gu,z2,F9,pI,_9,O1,rh,U9,PR,RR,gI,LR,H1,q2,fI,K2,oh,eX,J2,TR,Y2,N9,FR,_R,oa,Bo,sg,O9,mI,UR,W2,V1,ag,NR,zu,Ei,OR,tX,mxe,vxe,HR,Cxe,yxe,wxe,iX,bxe,rX,oX,Ixe,kl,j1,Bxe,Exe,nX,xxe,vI,sX;const aX=class xte{constructor(e,i,r,o,n,s,a,l,c,d,u,A,h){ce(this,Ei),ce(this,AI,new AbortController),ce(this,Td,null),ce(this,Us,new Map),ce(this,Va,new Map),ce(this,hI,null),ce(this,ng,null),ce(this,T9,null),ce(this,Gu,new PFi),ce(this,z2,null),ce(this,F9,null),ce(this,pI,0),ce(this,_9,new Set),ce(this,O1,null),ce(this,rh,null),ce(this,U9,new Set),ai(this,"_editorUndoBar",null),ce(this,PR,!1),ce(this,RR,!1),ce(this,gI,!1),ce(this,LR,null),ce(this,H1,null),ce(this,q2,null),ce(this,fI,null),ce(this,K2,!1),ce(this,oh,null),ce(this,eX,new QFi),ce(this,J2,!1),ce(this,TR,!1),ce(this,Y2,null),ce(this,N9,null),ce(this,FR,null),ce(this,_R,null),ce(this,oa,rr.NONE),ce(this,Bo,new Set),ce(this,sg,null),ce(this,O9,null),ce(this,mI,null),ce(this,UR,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),ce(this,W2,[0,0]),ce(this,V1,null),ce(this,ag,null),ce(this,NR,null),ce(this,zu,null);const g=this._signal=S(this,AI).signal;ie(this,ag,e),ie(this,NR,i),ie(this,hI,r),this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:g}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:g}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:g}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:g}),o._on("setpreference",this.onSetPreference.bind(this),{signal:g}),o._on("switchannotationeditorparams",p=>this.updateParams(p.type,p.value),{signal:g}),oe(this,Ei,Cxe).call(this),oe(this,Ei,Ixe).call(this),oe(this,Ei,iX).call(this),ie(this,ng,n.annotationStorage),ie(this,LR,n.filterFactory),ie(this,O9,s),ie(this,fI,a||null),ie(this,PR,l),ie(this,RR,c),ie(this,gI,d),ie(this,_R,u||null),this.viewParameters={realScale:D9.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=A||null,this._supportsPinchToZoom=h!==!1}static get _keyboardManager(){const e=xte.prototype,i=s=>S(s,ag).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 pr(this,"_keyboardManager",new uI([[["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)&&S(s,ag).contains(a)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&S(s,ag).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,n;(e=S(this,zu))==null||e.resolve(),ie(this,zu,null),(i=S(this,AI))==null||i.abort(),ie(this,AI,null),this._signal=null;for(const s of S(this,Va).values())s.destroy();S(this,Va).clear(),S(this,Us).clear(),S(this,U9).clear(),ie(this,Td,null),S(this,Bo).clear(),S(this,Gu).destroy(),(r=S(this,hI))==null||r.destroy(),(o=S(this,oh))==null||o.hide(),ie(this,oh,null),S(this,H1)&&(clearTimeout(S(this,H1)),ie(this,H1,null)),S(this,V1)&&(clearTimeout(S(this,V1)),ie(this,V1,null)),(n=this._editorUndoBar)==null||n.destroy()}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return S(this,_R)}get useNewAltTextFlow(){return S(this,RR)}get useNewAltTextWhenAddingImage(){return S(this,gI)}get hcmFilter(){return pr(this,"hcmFilter",S(this,O9)?S(this,LR).addHCMFilter(S(this,O9).foreground,S(this,O9).background):"none")}get direction(){return pr(this,"direction",getComputedStyle(S(this,ag)).direction)}get highlightColors(){return pr(this,"highlightColors",S(this,fI)?new Map(S(this,fI).split(",").map(e=>e.split("=").map(i=>i.trim()))):null)}get highlightColorNames(){return pr(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),ie(this,F9,e)}setMainHighlightColorPicker(e){ie(this,FR,e)}editAltText(e,i=!1){var r;(r=S(this,hI))==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":ie(this,gI,i);break}}onPageChanging({pageNumber:e}){ie(this,pI,e-1)}focusMainContainer(){S(this,ag).focus()}findParent(e,i){for(const r of S(this,Va).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){S(this,NR).classList.toggle("noUserSelect",e)}addShouldRescale(e){S(this,U9).add(e)}removeShouldRescale(e){S(this,U9).delete(e)}onScaleChanging({scale:e}){var i;this.commitOrRemove(),this.viewParameters.realScale=e*D9.PDF_TO_CSS_UNITS;for(const r of S(this,U9))r.onScaleChanging();(i=S(this,F9))==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=oe(this,Ei,OR).call(this,i).closest(".textLayer"),c=this.getSelectionBoxes(l);if(!c)return;i.empty();const d=oe(this,Ei,tX).call(this,l),u=S(this,oa)===rr.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(rr.HIGHLIGHT,A);return}A()}addToAnnotationStorage(e){!e.isEmpty()&&S(this,ng)&&!S(this,ng).has(e.id)&&S(this,ng).setValue(e.id,e)}blur(){if(this.isShiftKeyDown=!1,S(this,K2)&&(ie(this,K2,!1),oe(this,Ei,HR).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const i of S(this,Bo))if(i.div.contains(e)){ie(this,N9,[i,e]),i._focusEventsAllowed=!1;break}}focus(){if(!S(this,N9))return;const[e,i]=S(this,N9);ie(this,N9,null),i.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),i.focus()}addEditListeners(){oe(this,Ei,iX).call(this),oe(this,Ei,rX).call(this)}removeEditListeners(){oe(this,Ei,bxe).call(this),oe(this,Ei,oX).call(this)}dragOver(e){for(const{type:i}of e.dataTransfer.items)for(const r of S(this,rh))if(r.isHandlingMimeForPasting(i)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const i of e.dataTransfer.items)for(const r of S(this,rh))if(r.isHandlingMimeForPasting(i.type)){r.paste(i,this.currentLayer),e.preventDefault();return}}copy(e){var i;if(e.preventDefault(),(i=S(this,Td))==null||i.commitOrRemove(),!this.hasSelection)return;const r=[];for(const o of S(this,Bo)){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 S(this,rh))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){or(`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)oe(this,Ei,nX).call(this,l);oe(this,Ei,sX).call(this,n)},a=()=>{for(const l of n)l.remove()};this.addCommands({cmd:s,undo:a,mustExec:!0})}catch(n){or(`paste: "${n.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),S(this,oa)!==rr.NONE&&!this.isEditorHandlingKeyboard&&xte._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,S(this,K2)&&(ie(this,K2,!1),oe(this,Ei,HR).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?(oe(this,Ei,yxe).call(this),oe(this,Ei,rX).call(this),oe(this,Ei,kl).call(this,{isEditing:S(this,oa)!==rr.NONE,isEmpty:oe(this,Ei,vI).call(this),hasSomethingToUndo:S(this,Gu).hasSomethingToUndo(),hasSomethingToRedo:S(this,Gu).hasSomethingToRedo(),hasSelectedEditor:!1})):(oe(this,Ei,wxe).call(this),oe(this,Ei,oX).call(this),oe(this,Ei,kl).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!S(this,rh)){ie(this,rh,e);for(const i of S(this,rh))oe(this,Ei,j1).call(this,i.defaultPropertiesToUpdate)}}getId(){return S(this,eX).id}get currentLayer(){return S(this,Va).get(S(this,pI))}getLayer(e){return S(this,Va).get(e)}get currentPageIndex(){return S(this,pI)}addLayer(e){S(this,Va).set(e.pageIndex,e),S(this,J2)?e.enable():e.disable()}removeLayer(e){S(this,Va).delete(e.pageIndex)}async updateMode(e,i=null,r=!1){var o;if(S(this,oa)!==e&&!(S(this,zu)&&(await S(this,zu).promise,!S(this,zu)))){if(ie(this,zu,Promise.withResolvers()),ie(this,oa,e),e===rr.NONE){this.setEditingState(!1),oe(this,Ei,Exe).call(this),(o=this._editorUndoBar)==null||o.hide(),S(this,zu).resolve();return}this.setEditingState(!0),await oe(this,Ei,Bxe).call(this),this.unselectAll();for(const n of S(this,Va).values())n.updateMode(e);if(!i){r&&this.addNewEditorFromKeyboard(),S(this,zu).resolve();return}for(const n of S(this,Us).values())n.annotationElementId===i?(this.setSelected(n),n.enterInEditMode()):n.unselect();S(this,zu).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==S(this,oa)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,i){var r;if(S(this,rh)){switch(e){case Qr.CREATE:this.currentLayer.addNewEditor();return;case Qr.HIGHLIGHT_DEFAULT_COLOR:(r=S(this,FR))==null||r.updateColor(i);break;case Qr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(S(this,mI)||ie(this,mI,new Map)).set(e,i),this.showAllEditors("highlight",i);break}for(const o of S(this,Bo))o.updateParams(e,i);for(const o of S(this,rh))o.updateDefaultParams(e,i)}}showAllEditors(e,i,r=!1){var o;for(const n of S(this,Us).values())n.editorType===e&&n.show(i);(((o=S(this,mI))==null?void 0:o.get(Qr.HIGHLIGHT_SHOW_ALL))??!0)!==i&&oe(this,Ei,j1).call(this,[[Qr.HIGHLIGHT_SHOW_ALL,i]])}enableWaiting(e=!1){if(S(this,TR)!==e){ie(this,TR,e);for(const i of S(this,Va).values())e?i.disableClick():i.enableClick(),i.div.classList.toggle("waiting",e)}}getEditors(e){const i=[];for(const r of S(this,Us).values())r.pageIndex===e&&i.push(r);return i}getEditor(e){return S(this,Us).get(e)}addEditor(e){S(this,Us).set(e.id,e)}removeEditor(e){var i;e.div.contains(document.activeElement)&&(S(this,H1)&&clearTimeout(S(this,H1)),ie(this,H1,setTimeout(()=>{this.focusMainContainer(),ie(this,H1,null)},0))),S(this,Us).delete(e.id),this.unselect(e),(!e.annotationElementId||!S(this,_9).has(e.annotationElementId))&&((i=S(this,ng))==null||i.remove(e.id))}addDeletedAnnotationElement(e){S(this,_9).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return S(this,_9).has(e)}removeDeletedAnnotationElement(e){S(this,_9).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){S(this,Td)!==e&&(ie(this,Td,e),e&&oe(this,Ei,j1).call(this,e.propertiesToUpdate))}updateUI(e){S(this,Ei,xxe)===e&&oe(this,Ei,j1).call(this,e.propertiesToUpdate)}updateUIForDefaultProperties(e){oe(this,Ei,j1).call(this,e.defaultPropertiesToUpdate)}toggleSelected(e){if(S(this,Bo).has(e)){S(this,Bo).delete(e),e.unselect(),oe(this,Ei,kl).call(this,{hasSelectedEditor:this.hasSelection});return}S(this,Bo).add(e),e.select(),oe(this,Ei,j1).call(this,e.propertiesToUpdate),oe(this,Ei,kl).call(this,{hasSelectedEditor:!0})}setSelected(e){var i;(i=S(this,F9))==null||i.commitOrRemove();for(const r of S(this,Bo))r!==e&&r.unselect();S(this,Bo).clear(),S(this,Bo).add(e),e.select(),oe(this,Ei,j1).call(this,e.propertiesToUpdate),oe(this,Ei,kl).call(this,{hasSelectedEditor:!0})}isSelected(e){return S(this,Bo).has(e)}get firstSelectedEditor(){return S(this,Bo).values().next().value}unselect(e){e.unselect(),S(this,Bo).delete(e),oe(this,Ei,kl).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return S(this,Bo).size!==0}get isEnterHandled(){return S(this,Bo).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var e;S(this,Gu).undo(),oe(this,Ei,kl).call(this,{hasSomethingToUndo:S(this,Gu).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:oe(this,Ei,vI).call(this)}),(e=this._editorUndoBar)==null||e.hide()}redo(){S(this,Gu).redo(),oe(this,Ei,kl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:S(this,Gu).hasSomethingToRedo(),isEmpty:oe(this,Ei,vI).call(this)})}addCommands(e){S(this,Gu).add(e),oe(this,Ei,kl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:oe(this,Ei,vI).call(this)})}cleanUndoStack(e){S(this,Gu).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]:[...S(this,Bo)],o=()=>{var s;(s=this._editorUndoBar)==null||s.show(n,r.length===1?r[0].editorType:r.length);for(const a of r)a.remove()},n=()=>{for(const s of r)oe(this,Ei,nX).call(this,s)};this.addCommands({cmd:o,undo:n,mustExec:!0})}commitOrRemove(){var e;(e=S(this,Td))==null||e.commitOrRemove()}hasSomethingToControl(){return S(this,Td)||this.hasSelection}selectAll(){for(const e of S(this,Bo))e.commit();oe(this,Ei,sX).call(this,S(this,Us).values())}unselectAll(){var e;if(!(S(this,Td)&&(S(this,Td).commitOrRemove(),S(this,oa)!==rr.NONE))&&!((e=S(this,F9))!=null&&e.commitOrRemove())&&this.hasSelection){for(const i of S(this,Bo))i.unselect();S(this,Bo).clear(),oe(this,Ei,kl).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,i,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;S(this,W2)[0]+=e,S(this,W2)[1]+=i;const[o,n]=S(this,W2),s=[...S(this,Bo)];S(this,V1)&&clearTimeout(S(this,V1)),ie(this,V1,setTimeout(()=>{ie(this,V1,null),S(this,W2)[0]=S(this,W2)[1]=0,this.addCommands({cmd:()=>{for(const l of s)S(this,Us).has(l.id)&&l.translateInPage(o,n)},undo:()=>{for(const l of s)S(this,Us).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),ie(this,O1,new Map);for(const e of S(this,Bo))S(this,O1).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!S(this,O1))return!1;this.disableUserSelect(!1);const e=S(this,O1);ie(this,O1,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(S(this,Us).has(o.id)){const l=S(this,Va).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(S(this,O1))for(const r of S(this,O1).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())||S(this,Bo).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return S(this,Td)===e}getActive(){return S(this,Td)}getMode(){return S(this,oa)}get imageManager(){return pr(this,"imageManager",new DFi)}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}){(S(this,T9)||ie(this,T9,new Map)).set(e,i)}removeChangedExistingAnnotation({annotationElementId:e}){var i;(i=S(this,T9))==null||i.delete(e)}renderAnnotationElement(e){var i;const r=(i=S(this,T9))==null?void 0:i.get(e.data.id);if(!r)return;const o=S(this,ng).getRawValue(r);o&&(S(this,oa)===rr.NONE&&!o.hasBeenModified||o.renderAnnotationElement(e))}};AI=new WeakMap,Td=new WeakMap,Us=new WeakMap,Va=new WeakMap,hI=new WeakMap,ng=new WeakMap,T9=new WeakMap,Gu=new WeakMap,z2=new WeakMap,F9=new WeakMap,pI=new WeakMap,_9=new WeakMap,O1=new WeakMap,rh=new WeakMap,U9=new WeakMap,PR=new WeakMap,RR=new WeakMap,gI=new WeakMap,LR=new WeakMap,H1=new WeakMap,q2=new WeakMap,fI=new WeakMap,K2=new WeakMap,oh=new WeakMap,eX=new WeakMap,J2=new WeakMap,TR=new WeakMap,Y2=new WeakMap,N9=new WeakMap,FR=new WeakMap,_R=new WeakMap,oa=new WeakMap,Bo=new WeakMap,sg=new WeakMap,O9=new WeakMap,mI=new WeakMap,UR=new WeakMap,W2=new WeakMap,V1=new WeakMap,ag=new WeakMap,NR=new WeakMap,zu=new WeakMap,Ei=new WeakSet,OR=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},tX=function(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of S(this,Va).values())if(i.hasTextLayer(t))return i;return null},mxe=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=oe(this,Ei,OR).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(S(this,oh)||ie(this,oh,new SFi(this)),S(this,oh).show(e,i,this.direction==="ltr"))},vxe=function(){var t,e,i;const r=document.getSelection();if(!r||r.isCollapsed){S(this,sg)&&((t=S(this,oh))==null||t.hide(),ie(this,sg,null),oe(this,Ei,kl).call(this,{hasSelectedText:!1}));return}const{anchorNode:o}=r;if(o===S(this,sg))return;const n=oe(this,Ei,OR).call(this,r).closest(".textLayer");if(!n){S(this,sg)&&((e=S(this,oh))==null||e.hide(),ie(this,sg,null),oe(this,Ei,kl).call(this,{hasSelectedText:!1}));return}if((i=S(this,oh))==null||i.hide(),ie(this,sg,o),oe(this,Ei,kl).call(this,{hasSelectedText:!0}),!(S(this,oa)!==rr.HIGHLIGHT&&S(this,oa)!==rr.NONE)&&(S(this,oa)===rr.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),ie(this,K2,this.isShiftKeyDown),!this.isShiftKeyDown)){const s=S(this,oa)===rr.HIGHLIGHT?oe(this,Ei,tX).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"&&oe(this,Ei,HR).call(this,"main_toolbar"))};window.addEventListener("pointerup",c,{signal:l}),window.addEventListener("blur",c,{signal:l})}},HR=function(t=""){S(this,oa)===rr.HIGHLIGHT?this.highlightSelection(t):S(this,PR)&&oe(this,Ei,mxe).call(this)},Cxe=function(){document.addEventListener("selectionchange",oe(this,Ei,vxe).bind(this),{signal:this._signal})},yxe=function(){if(S(this,q2))return;ie(this,q2,new AbortController);const t=this.combinedSignal(S(this,q2));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},wxe=function(){var t;(t=S(this,q2))==null||t.abort(),ie(this,q2,null)},iX=function(){if(S(this,Y2))return;ie(this,Y2,new AbortController);const t=this.combinedSignal(S(this,Y2));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},bxe=function(){var t;(t=S(this,Y2))==null||t.abort(),ie(this,Y2,null)},rX=function(){if(S(this,z2))return;ie(this,z2,new AbortController);const t=this.combinedSignal(S(this,z2));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})},oX=function(){var t;(t=S(this,z2))==null||t.abort(),ie(this,z2,null)},Ixe=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},kl=function(t){Object.entries(t).some(([e,i])=>S(this,UR)[e]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(S(this,UR),t)}),S(this,oa)===rr.HIGHLIGHT&&t.hasSelectedEditor===!1&&oe(this,Ei,j1).call(this,[[Qr.HIGHLIGHT_FREE,!0]]))},j1=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},Bxe=async function(){if(!S(this,J2)){ie(this,J2,!0);const t=[];for(const e of S(this,Va).values())t.push(e.enable());await Promise.all(t);for(const e of S(this,Us).values())e.enable()}},Exe=function(){if(this.unselectAll(),S(this,J2)){ie(this,J2,!1);for(const t of S(this,Va).values())t.disable();for(const t of S(this,Us).values())t.disable()}},nX=function(t){const e=S(this,Va).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},xxe=function(){let t=null;for(t of S(this,Bo));return t},vI=function(){if(S(this,Us).size===0)return!0;if(S(this,Us).size===1)for(const t of S(this,Us).values())return t.isEmpty();return!1},sX=function(t){for(const e of S(this,Bo))e.unselect();S(this,Bo).clear();for(const e of t)e.isEmpty()||(S(this,Bo).add(e),e.select());oe(this,Ei,kl).call(this,{hasSelectedEditor:this.hasSelection})},ai(aX,"TRANSLATE_SMALL",1),ai(aX,"TRANSLATE_BIG",10);let CI=aX;var na,G1,nh,yI,z1,Fd,wI,q1,$c,lg,H9,K1,cg,J1,bI,VR;const II=class cf{constructor(e){ce(this,J1),ce(this,na,null),ce(this,G1,!1),ce(this,nh,null),ce(this,yI,null),ce(this,z1,null),ce(this,Fd,null),ce(this,wI,!1),ce(this,q1,null),ce(this,$c,null),ce(this,lg,null),ce(this,H9,null),ce(this,K1,!1),ie(this,$c,e),ie(this,K1,e._uiManager.useNewAltTextFlow),S(cf,cg)||ie(cf,cg,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){cf._l10n??(cf._l10n=e)}async render(){const e=ie(this,nh,document.createElement("button"));e.className="altText",e.tabIndex="0";const i=ie(this,yI,document.createElement("span"));e.append(i),S(this,K1)?(e.classList.add("new"),e.setAttribute("data-l10n-id",S(cf,cg).missing),i.setAttribute("data-l10n-id",S(cf,cg)["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=S(this,$c)._uiManager._signal;e.addEventListener("contextmenu",ju,{signal:r}),e.addEventListener("pointerdown",n=>n.stopPropagation(),{signal:r});const o=n=>{n.preventDefault(),S(this,$c)._uiManager.editAltText(S(this,$c)),S(this,K1)&&S(this,$c)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:S(this,J1,bI)}})};return e.addEventListener("click",o,{capture:!0,signal:r}),e.addEventListener("keydown",n=>{n.target===e&&n.key==="Enter"&&(ie(this,wI,!0),o(n))},{signal:r}),await oe(this,J1,VR).call(this),e}finish(){S(this,nh)&&(S(this,nh).focus({focusVisible:S(this,wI)}),ie(this,wI,!1))}isEmpty(){return S(this,K1)?S(this,na)===null:!S(this,na)&&!S(this,G1)}hasData(){return S(this,K1)?S(this,na)!==null||!!S(this,lg):this.isEmpty()}get guessedText(){return S(this,lg)}async setGuessedText(e){S(this,na)===null&&(ie(this,lg,e),ie(this,H9,await cf._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),oe(this,J1,VR).call(this))}toggleAltTextBadge(e=!1){var i;if(!S(this,K1)||S(this,na)){(i=S(this,q1))==null||i.remove(),ie(this,q1,null);return}if(!S(this,q1)){const r=ie(this,q1,document.createElement("div"));r.className="noAltTextBadge",S(this,$c).div.append(r)}S(this,q1).classList.toggle("hidden",!e)}serialize(e){let i=S(this,na);return!e&&S(this,lg)===i&&(i=S(this,H9)),{altText:i,decorative:S(this,G1),guessedText:S(this,lg),textWithDisclaimer:S(this,H9)}}get data(){return{altText:S(this,na),decorative:S(this,G1)}}set data({altText:e,decorative:i,guessedText:r,textWithDisclaimer:o,cancel:n=!1}){r&&(ie(this,lg,r),ie(this,H9,o)),!(S(this,na)===e&&S(this,G1)===i)&&(n||(ie(this,na,e),ie(this,G1,i)),oe(this,J1,VR).call(this))}toggle(e=!1){S(this,nh)&&(!e&&S(this,Fd)&&(clearTimeout(S(this,Fd)),ie(this,Fd,null)),S(this,nh).disabled=!e)}shown(){S(this,$c)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:S(this,J1,bI)}})}destroy(){var e,i;(e=S(this,nh))==null||e.remove(),ie(this,nh,null),ie(this,yI,null),ie(this,z1,null),(i=S(this,q1))==null||i.remove(),ie(this,q1,null)}};na=new WeakMap,G1=new WeakMap,nh=new WeakMap,yI=new WeakMap,z1=new WeakMap,Fd=new WeakMap,wI=new WeakMap,q1=new WeakMap,$c=new WeakMap,lg=new WeakMap,H9=new WeakMap,K1=new WeakMap,cg=new WeakMap,J1=new WeakSet,bI=function(){return S(this,na)&&"added"||S(this,na)===null&&this.guessedText&&"review"||"missing"},VR=async function(){var t,e,i;const r=S(this,nh);if(!r)return;if(S(this,K1)){if(r.classList.toggle("done",!!S(this,na)),r.setAttribute("data-l10n-id",S(II,cg)[S(this,J1,bI)]),(t=S(this,yI))==null||t.setAttribute("data-l10n-id",S(II,cg)[`${S(this,J1,bI)}-label`]),!S(this,na)){(e=S(this,z1))==null||e.remove();return}}else{if(!S(this,na)&&!S(this,G1)){r.classList.remove("done"),(i=S(this,z1))==null||i.remove();return}r.classList.add("done"),r.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let o=S(this,z1);if(!o){ie(this,z1,o=document.createElement("span")),o.className="tooltip",o.setAttribute("role","tooltip"),o.id=`alt-text-tooltip-${S(this,$c).id}`;const s=100,a=S(this,$c)._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(S(this,Fd)),ie(this,Fd,null)},{once:!0}),r.addEventListener("mouseenter",()=>{ie(this,Fd,setTimeout(()=>{ie(this,Fd,null),S(this,z1).classList.add("show"),S(this,$c)._reportTelemetry({action:"alt_text_tooltip"})},s))},{signal:a}),r.addEventListener("mouseleave",()=>{var l;S(this,Fd)&&(clearTimeout(S(this,Fd)),ie(this,Fd,null)),(l=S(this,z1))==null||l.classList.remove("show")},{signal:a})}S(this,G1)?o.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(o.removeAttribute("data-l10n-id"),o.textContent=S(this,na)),o.parentNode||r.append(o);const n=S(this,$c).getImageForAltText();n?.setAttribute("aria-describedby",o.id)},ce(II,cg,null),ai(II,"_l10n",null);let kxe=II;var jR,V9,GR,zR,qR,KR,JR,BI,dg,j9,Z2,G9,Mxe,Sxe,lX;const Qxe=class{constructor({container:e,isPinchingDisabled:i=null,isPinchingStopped:r=null,onPinchStart:o=null,onPinching:n=null,onPinchEnd:s=null,signal:a}){ce(this,G9),ce(this,jR),ce(this,V9,!1),ce(this,GR,null),ce(this,zR),ce(this,qR),ce(this,KR),ce(this,JR),ce(this,BI),ce(this,dg,null),ce(this,j9),ce(this,Z2,null),ie(this,jR,e),ie(this,GR,r),ie(this,zR,i),ie(this,qR,o),ie(this,KR,n),ie(this,JR,s),ie(this,j9,new AbortController),ie(this,BI,AbortSignal.any([a,S(this,j9).signal])),e.addEventListener("touchstart",oe(this,G9,Mxe).bind(this),{passive:!1,signal:S(this,BI)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return pr(this,"MIN_TOUCH_DISTANCE_TO_PINCH",35/(window.devicePixelRatio||1))}destroy(){var e;(e=S(this,j9))==null||e.abort(),ie(this,j9,null)}};jR=new WeakMap,V9=new WeakMap,GR=new WeakMap,zR=new WeakMap,qR=new WeakMap,KR=new WeakMap,JR=new WeakMap,BI=new WeakMap,dg=new WeakMap,j9=new WeakMap,Z2=new WeakMap,G9=new WeakSet,Mxe=function(t){var e,i,r;if((e=S(this,zR))!=null&&e.call(this)||t.touches.length<2)return;if(!S(this,Z2)){ie(this,Z2,new AbortController);const s=AbortSignal.any([S(this,BI),S(this,Z2).signal]),a=S(this,jR),l={signal:s,passive:!1};a.addEventListener("touchmove",oe(this,G9,Sxe).bind(this),l),a.addEventListener("touchend",oe(this,G9,lX).bind(this),l),a.addEventListener("touchcancel",oe(this,G9,lX).bind(this),l),(i=S(this,qR))==null||i.call(this)}if(Xc(t),t.touches.length!==2||(r=S(this,GR))!=null&&r.call(this)){ie(this,dg,null);return}let[o,n]=t.touches;o.identifier>n.identifier&&([o,n]=[n,o]),ie(this,dg,{touch0X:o.screenX,touch0Y:o.screenY,touch1X:n.screenX,touch1Y:n.screenY})},Sxe=function(t){var e;if(!S(this,dg)||t.touches.length!==2)return;let[i,r]=t.touches;i.identifier>r.identifier&&([i,r]=[r,i]);const{screenX:o,screenY:n}=i,{screenX:s,screenY:a}=r,l=S(this,dg),{touch0X:c,touch0Y:d,touch1X:u,touch1Y:A}=l,h=u-c,g=A-d,p=s-o,m=a-n,f=Math.hypot(p,m)||1,v=Math.hypot(h,g)||1;if(!S(this,V9)&&Math.abs(v-f)<=Qxe.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=o,l.touch0Y=n,l.touch1X=s,l.touch1Y=a,t.preventDefault(),!S(this,V9)){ie(this,V9,!0);return}const y=[(o+s)/2,(n+a)/2];(e=S(this,KR))==null||e.call(this,y,v,f)},lX=function(t){var e;S(this,Z2).abort(),ie(this,Z2,null),(e=S(this,JR))==null||e.call(this),S(this,dg)&&(t.preventDefault(),ie(this,dg,null),ie(this,V9,!1))};let Dxe=Qxe;var z9,sh,rn,EI,X2,YR,q9,ja,K9,ug,$2,WR,J9,Ga,ZR,Y9,Ag,Y1,xI,kI,_d,em,XR,cX,jr,dX,$R,uX,eL,Pxe,Rxe,AX,tL,hX,Lxe,Txe,Fxe,pX,_xe,gX,Uxe,Nxe,Oxe,fX,MI;const Vn=class Ca{constructor(e){ce(this,jr),ce(this,z9,null),ce(this,sh,null),ce(this,rn,null),ce(this,EI,!1),ce(this,X2,null),ce(this,YR,""),ce(this,q9,!1),ce(this,ja,null),ce(this,K9,null),ce(this,ug,null),ce(this,$2,null),ce(this,WR,""),ce(this,J9,!1),ce(this,Ga,null),ce(this,ZR,!1),ce(this,Y9,!1),ce(this,Ag,!1),ce(this,Y1,null),ce(this,xI,0),ce(this,kI,0),ce(this,_d,null),ce(this,em,null),ai(this,"_editToolbar",null),ai(this,"_initialOptions",Object.create(null)),ai(this,"_initialData",null),ai(this,"_isVisible",!0),ai(this,"_uiManager",null),ai(this,"_focusEventsAllowed",!0),ce(this,XR,!1),ce(this,cX,Ca._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=Ca.prototype._resizeWithKeyboard,i=CI.TRANSLATE_SMALL,r=CI.TRANSLATE_BIG;return pr(this,"_resizerKeyboardManager",new uI([[["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"],Ca.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get isDrawer(){return!1}static get _defaultLineColor(){return pr(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const i=new LFi({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(Ca._l10n??(Ca._l10n=e),Ca._l10nResizer||(Ca._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"})),Ca._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);Ca._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,i){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,i){Mo("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return S(this,XR)}set _isDraggable(e){var i;ie(this,XR,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=S(this,cX)}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):oe(this,jr,MI).call(this),this.parent=e}focusin(e){this._focusEventsAllowed&&(S(this,J9)?ie(this,J9,!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){oe(this,jr,dX).call(this,this.parentDimensions,e,i)}translateInPage(e,i){S(this,Ga)||ie(this,Ga,[this.x,this.y,this.width,this.height]),oe(this,jr,dX).call(this,this.pageDimensions,e,i),this.div.scrollIntoView({block:"nearest"})}drag(e,i){S(this,Ga)||ie(this,Ga,[this.x,this.y,this.width,this.height]);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!!S(this,Ga)&&(S(this,Ga)[0]!==this.x||S(this,Ga)[1]!==this.y)}get _hasBeenResized(){return!!S(this,Ga)&&(S(this,Ga)[2]!==this.width||S(this,Ga)[3]!==this.height)}getBaseTranslation(){const[e,i]=this.parentDimensions,{_borderLineWidth:r}=Ca,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 oe(r=Ca,$R,uX).call(r,e,i,this.parentRotation)}pageTranslationToScreen(e,i){var r;return oe(r=Ca,$R,uX).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)}%`,S(this,q9)||(n.height=`${(100*i/o).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:i,width:r}=e,o=r.endsWith("%"),n=!S(this,q9)&&i.endsWith("%");if(o&&n)return;const[s,a]=this.parentDimensions;o||(e.width=`${(100*parseFloat(r)/s).toFixed(2)}%`),!S(this,q9)&&!n&&(e.height=`${(100*parseFloat(i)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}_onResized(){}static _round(e){return Math.round(e*1e4)/1e4}_onResizing(){}altTextFinish(){var e;(e=S(this,rn))==null||e.finish()}async addEditToolbar(){return this._editToolbar||S(this,Y9)?this._editToolbar:(this._editToolbar=new MFi(this),this.div.append(this._editToolbar.render()),S(this,rn)&&await this._editToolbar.addAltText(S(this,rn)),this._editToolbar)}removeEditToolbar(){var e;this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,(e=S(this,rn))==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(){S(this,rn)||(kxe.initialize(Ca._l10n),ie(this,rn,new kxe(this)),S(this,z9)&&(S(this,rn).data=S(this,z9),ie(this,z9,null)),await this.addEditToolbar())}get altTextData(){var e;return(e=S(this,rn))==null?void 0:e.data}set altTextData(e){S(this,rn)&&(S(this,rn).data=e)}get guessedAltText(){var e;return(e=S(this,rn))==null?void 0:e.guessedText}async setGuessedAltText(e){var i;await((i=S(this,rn))==null?void 0:i.setGuessedText(e))}serializeAltText(e){var i;return(i=S(this,rn))==null?void 0:i.serialize(e)}hasAltText(){return!!S(this,rn)&&!S(this,rn).isEmpty()}hasAltTextData(){var e;return((e=S(this,rn))==null?void 0:e.hasData())??!1}render(){var e;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=S(this,EI)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),oe(this,jr,gX).call(this);const[i,r]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*r/i).toFixed(2)}%`,this.div.style.maxHeight=`${(100*i/r).toFixed(2)}%`);const[o,n]=this.getInitialTranslation();return this.translate(o,n),MR(this,this.div,["pointerdown"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(S(this,em)||ie(this,em,new Dxe({container:this.div,isPinchingDisabled:()=>!this.isSelected,onPinchStart:oe(this,jr,Lxe).bind(this),onPinching:oe(this,jr,Txe).bind(this),onPinchEnd:oe(this,jr,Fxe).bind(this),signal:this._uiManager._signal}))),(e=this._uiManager._editorUndoBar)==null||e.hide(),this.div}pointerdown(e){const{isMac:i}=xl.platform;if(e.button!==0||e.ctrlKey&&i){e.preventDefault();return}if(ie(this,J9,!0),this._isDraggable){oe(this,jr,_xe).call(this,e);return}oe(this,jr,pX).call(this,e)}get isSelected(){return this._uiManager.isSelected(this)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){S(this,Y1)&&clearTimeout(S(this,Y1)),ie(this,Y1,setTimeout(()=>{var e;ie(this,Y1,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(e){}isEmpty(){return!1}enableEditMode(){ie(this,Y9,!0)}disableEditMode(){ie(this,Y9,!1)}isInEditMode(){return S(this,Y9)}shouldGetKeyboardEvents(){return S(this,Ag)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:i,bottom:r,right:o}=this.getClientDimensions(),{innerHeight:n,innerWidth:s}=window;return i<s&&o>0&&e<n&&r>0}rebuild(){oe(this,jr,gX).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){Mo("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,ie(o,z9,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,i;if((e=S(this,$2))==null||e.abort(),ie(this,$2,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),S(this,Y1)&&(clearTimeout(S(this,Y1)),ie(this,Y1,null)),oe(this,jr,MI).call(this),this.removeEditToolbar(),S(this,_d)){for(const r of S(this,_d).values())clearTimeout(r);ie(this,_d,null)}this.parent=null,(i=S(this,em))==null||i.destroy(),ie(this,em,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(oe(this,jr,Pxe).call(this),S(this,ja).classList.remove("hidden"),MR(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),ie(this,ug,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const i=S(this,ja).children;if(!S(this,sh)){ie(this,sh,Array.from(i));const s=oe(this,jr,Uxe).bind(this),a=oe(this,jr,Nxe).bind(this),l=this._uiManager._signal;for(const c of S(this,sh)){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",oe(this,jr,Oxe).bind(this,d),{signal:l}),c.setAttribute("data-l10n-id",Ca._l10nResizer[d])}}const r=S(this,sh)[0];let o=0;for(const s of i){if(s===r)break;o++}const n=(360-this.rotation+this.parentRotation)%360/90*(S(this,sh).length/4);if(n!==o){if(n<o)for(let a=0;a<o-n;a++)S(this,ja).append(S(this,ja).firstChild);else if(n>o)for(let a=0;a<n-o;a++)S(this,ja).firstChild.before(S(this,ja).lastChild);let s=0;for(const a of i){const l=S(this,sh)[s++].getAttribute("data-resizer-name");a.setAttribute("data-l10n-id",Ca._l10nResizer[l])}}oe(this,jr,fX).call(this,0),ie(this,Ag,!0),S(this,ja).firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,i){S(this,Ag)&&oe(this,jr,hX).call(this,S(this,WR),{deltaX:e,deltaY:i,fromKeyboard:!0})}_stopResizingWithKeyboard(){oe(this,jr,MI).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=S(this,rn))==null||r.toggleAltTextBadge(!1)}unselect(){var e,i,r,o,n;(e=S(this,ja))==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=S(this,rn))==null||n.toggleAltTextBadge(!0)}updateParams(e,i){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return S(this,ZR)}set isEditing(e){ie(this,ZR,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,i){ie(this,q9,!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){S(this,_d)||ie(this,_d,new Map);const{action:r}=e;let o=S(this,_d).get(r);o&&clearTimeout(o),o=setTimeout(()=>{this._reportTelemetry(e),S(this,_d).delete(r),S(this,_d).size===0&&ie(this,_d,null)},Ca._telemetryTimeout),S(this,_d).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),ie(this,EI,!1)}disable(){this.div&&(this.div.tabIndex=-1),ie(this,EI,!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()}};z9=new WeakMap,sh=new WeakMap,rn=new WeakMap,EI=new WeakMap,X2=new WeakMap,YR=new WeakMap,q9=new WeakMap,ja=new WeakMap,K9=new WeakMap,ug=new WeakMap,$2=new WeakMap,WR=new WeakMap,J9=new WeakMap,Ga=new WeakMap,ZR=new WeakMap,Y9=new WeakMap,Ag=new WeakMap,Y1=new WeakMap,xI=new WeakMap,kI=new WeakMap,_d=new WeakMap,em=new WeakMap,XR=new WeakMap,cX=new WeakMap,jr=new WeakSet,dX=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()},$R=new WeakSet,uX=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]}},eL=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]}},Pxe=function(){if(S(this,ja))return;ie(this,ja,document.createElement("div")),S(this,ja).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");S(this,ja).append(r),r.classList.add("resizer",i),r.setAttribute("data-resizer-name",i),r.addEventListener("pointerdown",oe(this,jr,Rxe).bind(this,i),{signal:e}),r.addEventListener("contextmenu",ju,{signal:e}),r.tabIndex=-1}this.div.prepend(S(this,ja))},Rxe=function(t,e){var i;e.preventDefault();const{isMac:r}=xl.platform;if(e.button!==0||e.ctrlKey&&r)return;(i=S(this,rn))==null||i.toggle(!1);const o=this._isDraggable;this._isDraggable=!1,ie(this,K9,[e.screenX,e.screenY]);const n=new AbortController,s=this._uiManager.combinedSignal(n);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",oe(this,jr,hX).bind(this,t),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",Xc,{passive:!1,signal:s}),window.addEventListener("contextmenu",ju,{signal:s}),ie(this,ug,{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=S(this,rn))==null||d.toggle(!0),this._isDraggable=o,this.parent.div.style.cursor=a,this.div.style.cursor=l,oe(this,jr,tL).call(this)};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})},AX=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()},tL=function(){if(!S(this,ug))return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:r}=S(this,ug);ie(this,ug,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:oe(this,jr,AX).bind(this,o,n,s,a),undo:oe(this,jr,AX).bind(this,t,e,i,r),mustExec:!0})},hX=function(t,e){const[i,r]=this.parentDimensions,o=this.x,n=this.y,s=this.width,a=this.height,l=Vn.MIN_SIZE/i,c=Vn.MIN_SIZE/r,d=oe(this,jr,eL).call(this,this.rotation),u=(V,_)=>[d[0]*V+d[2]*_,d[1]*V+d[3]*_],A=oe(this,jr,eL).call(this,360-this.rotation),h=(V,_)=>[A[0]*V+A[2]*_,A[1]*V+A[3]*_];let g,p,m=!1,f=!1;switch(t){case"topLeft":m=!0,g=(V,_)=>[0,0],p=(V,_)=>[V,_];break;case"topMiddle":g=(V,_)=>[V/2,0],p=(V,_)=>[V/2,_];break;case"topRight":m=!0,g=(V,_)=>[V,0],p=(V,_)=>[0,_];break;case"middleRight":f=!0,g=(V,_)=>[V,_/2],p=(V,_)=>[0,_/2];break;case"bottomRight":m=!0,g=(V,_)=>[V,_],p=(V,_)=>[0,0];break;case"bottomMiddle":g=(V,_)=>[V/2,_],p=(V,_)=>[V/2,0];break;case"bottomLeft":m=!0,g=(V,_)=>[0,_],p=(V,_)=>[V,0];break;case"middleLeft":f=!0,g=(V,_)=>[0,_/2],p=(V,_)=>[V,_/2];break}const v=g(s,a),y=p(s,a);let C=u(...y);const w=Vn._round(o+C[0]),b=Vn._round(n+C[1]);let E=1,x=1,k,M;if(e.fromKeyboard)({deltaX:k,deltaY:M}=e);else{const{screenX:V,screenY:_}=e,[H,Y]=S(this,K9);[k,M]=this.screenToPageTranslation(V-H,_-Y),S(this,K9)[0]=V,S(this,K9)[1]=_}if([k,M]=h(k/i,M/r),m){const V=Math.hypot(s,a);E=x=Math.max(Math.min(Math.hypot(y[0]-v[0]-k,y[1]-v[1]-M)/V,1/s,1/a),l/s,c/a)}else f?E=Math.max(l,Math.min(1,Math.abs(y[0]-v[0]-k)))/s:x=Math.max(c,Math.min(1,Math.abs(y[1]-v[1]-M)))/a;const D=Vn._round(s*E),P=Vn._round(a*x);C=u(...p(D,P));const T=w-C[0],O=b-C[1];S(this,Ga)||ie(this,Ga,[this.x,this.y,this.width,this.height]),this.width=D,this.height=P,this.x=T,this.y=O,this.setDims(i*D,r*P),this.fixAndSetPosition(),this._onResizing()},Lxe=function(){var t;ie(this,ug,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(t=S(this,rn))==null||t.toggle(!1),this.parent.togglePointerEvents(!1)},Txe=function(t,e,i){let r=.7*(i/e)+1-.7;if(r===1)return;const o=oe(this,jr,eL).call(this,this.rotation),n=(C,w)=>[o[0]*C+o[2]*w,o[1]*C+o[3]*w],[s,a]=this.parentDimensions,l=this.x,c=this.y,d=this.width,u=this.height,A=Vn.MIN_SIZE/s,h=Vn.MIN_SIZE/a;r=Math.max(Math.min(r,1/d,1/u),A/d,h/u);const g=Vn._round(d*r),p=Vn._round(u*r);if(g===d&&p===u)return;S(this,Ga)||ie(this,Ga,[l,c,d,u]);const m=n(d/2,u/2),f=Vn._round(l+m[0]),v=Vn._round(c+m[1]),y=n(g/2,p/2);this.x=f-y[0],this.y=v-y[1],this.width=g,this.height=p,this.setDims(s*g,a*p),this.fixAndSetPosition(),this._onResizing()},Fxe=function(){var t;(t=S(this,rn))==null||t.toggle(!0),this.parent.togglePointerEvents(!0),oe(this,jr,tL).call(this)},pX=function(t){const{isMac:e}=xl.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},_xe=function(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const r=new AbortController,o=this._uiManager.combinedSignal(r),n={capture:!0,passive:!1,signal:o},s=l=>{r.abort(),ie(this,X2,null),ie(this,J9,!1),this._uiManager.endDragSession()||oe(this,jr,pX).call(this,l),i&&this._onStopDragging()};e&&(ie(this,xI,t.clientX),ie(this,kI,t.clientY),ie(this,X2,t.pointerId),ie(this,YR,t.pointerType),window.addEventListener("pointermove",l=>{i||(i=!0,this._onStartDragging());const{clientX:c,clientY:d,pointerId:u}=l;if(u!==S(this,X2)){Xc(l);return}const[A,h]=this.screenToPageTranslation(c-S(this,xI),d-S(this,kI));ie(this,xI,c),ie(this,kI,d),this._uiManager.dragSelectedEditors(A,h)},n),window.addEventListener("touchmove",Xc,n),window.addEventListener("pointerdown",l=>{l.pointerType===S(this,YR)&&(S(this,em)||l.isPrimary)&&s(l),Xc(l)},n));const a=l=>{if(!S(this,X2)||S(this,X2)===l.pointerId){s(l);return}Xc(l)};window.addEventListener("pointerup",a,{signal:o}),window.addEventListener("blur",a,{signal:o})},gX=function(){if(S(this,$2)||!this.div)return;ie(this,$2,new AbortController);const t=this._uiManager.combinedSignal(S(this,$2));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},Uxe=function(t){Vn._resizerKeyboardManager.exec(this,t)},Nxe=function(t){var e;S(this,Ag)&&((e=t.relatedTarget)==null?void 0:e.parentNode)!==S(this,ja)&&oe(this,jr,MI).call(this)},Oxe=function(t){ie(this,WR,S(this,Ag)?t:"")},fX=function(t){if(S(this,sh))for(const e of S(this,sh))e.tabIndex=t},MI=function(){ie(this,Ag,!1),oe(this,jr,fX).call(this,-1),oe(this,jr,tL).call(this)},ce(Vn,$R),ai(Vn,"_l10n",null),ai(Vn,"_l10nResizer",null),ai(Vn,"_borderLineWidth",-1),ai(Vn,"_colorManager",new RFi),ai(Vn,"_zIndex",1),ai(Vn,"_telemetryTimeout",1e3);let jn=Vn;class LFi extends jn{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const Hxe=3285377520,Ud=4294901760,ah=65535;let Vxe=class{constructor(t){this.h1=t?t&4294967295:Hxe,this.h2=t?t&4294967295:Hxe}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&ah,h=u&ah;for(let g=0;g<r;g++)g&1?(s=n[g],s=s*d&Ud|s*A&ah,s=s<<15|s>>>17,s=s*u&Ud|s*h&ah,l^=s,l=l<<13|l>>>19,l=l*5+3864292196):(a=n[g],a=a*d&Ud|a*A&ah,a=a<<15|a>>>17,a=a*u&Ud|a*h&ah,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&Ud|s*A&ah,s=s<<15|s>>>17,s=s*u&Ud|s*h&ah,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&Ud|t*36045&ah,e=e*4283543511&Ud|((e<<16|t>>>16)*2950163797&Ud)>>>16,t^=e>>>1,t=t*444984403&Ud|t*60499&ah,e=e*3301882366&Ud|((e<<16|t>>>16)*3120437893&Ud)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}};const mX=Object.freeze({map:null,hash:"",transfer:void 0});var W9,Z9,sa,vX,jxe;class CX{constructor(){ce(this,vX),ce(this,W9,!1),ce(this,Z9,null),ce(this,sa,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,i){const r=S(this,sa).get(e);return r===void 0?i:Object.assign(i,r)}getRawValue(e){return S(this,sa).get(e)}remove(e){if(S(this,sa).delete(e),S(this,sa).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const i of S(this,sa).values())if(i instanceof jn)return;this.onAnnotationEditor(null)}}setValue(e,i){const r=S(this,sa).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,S(this,sa).set(e,i);o&&oe(this,vX,jxe).call(this),i instanceof jn&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(i.constructor._type)}has(e){return S(this,sa).has(e)}getAll(){return S(this,sa).size>0?NZ(S(this,sa)):null}setAll(e){for(const[i,r]of Object.entries(e))this.setValue(i,r)}get size(){return S(this,sa).size}resetModified(){S(this,W9)&&(ie(this,W9,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new Gxe(this)}get serializable(){if(S(this,sa).size===0)return mX;const e=new Map,i=new Vxe,r=[],o=Object.create(null);let n=!1;for(const[s,a]of S(this,sa)){const l=a instanceof jn?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}:mX}get editorStats(){let e=null;const i=new Map;for(const r of S(this,sa).values()){if(!(r instanceof jn))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(){ie(this,Z9,null)}get modifiedIds(){if(S(this,Z9))return S(this,Z9);const e=[];for(const i of S(this,sa).values())!(i instanceof jn)||!i.annotationElementId||!i.serialize()||e.push(i.annotationElementId);return ie(this,Z9,{ids:new Set(e),hash:e.join(",")})}}W9=new WeakMap,Z9=new WeakMap,sa=new WeakMap,vX=new WeakSet,jxe=function(){S(this,W9)||(ie(this,W9,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var iL;class Gxe extends CX{constructor(e){super(),ce(this,iL);const{map:i,hash:r,transfer:o}=e.serializable,n=structuredClone(i,o?{transfer:o}:null);ie(this,iL,{map:n,hash:r,transfer:o})}get print(){Mo("Should not call PrintAnnotationStorage.print")}get serializable(){return S(this,iL)}get modifiedIds(){return pr(this,"modifiedIds",{ids:new Set,hash:""})}}iL=new WeakMap;var SI;class TFi{constructor({ownerDocument:e=globalThis.document,styleElement:i=null}){ce(this,SI,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(),S(this,SI).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:i}){if(!(!e||S(this,SI).has(e.loadedName))){if($n(!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(),S(this,SI).add(r),i?.(e)}catch{or(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(s)}return}Mo("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 or(`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 pr(this,"isFontLoadingAPISupported",i)}get isSyncFontLoadingSupported(){let e=!1;return(Oa||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),pr(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){function i(){for($n(!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 pr(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,i){function r(y,C){return y.charCodeAt(C)<<24|y.charCodeAt(C+1)<<16|y.charCodeAt(C+2)<<8|y.charCodeAt(C+3)&255}function o(y,C,w,b){const E=y.substring(0,C),x=y.substring(C+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(y,C){if(++c>30){or("Load test font never loaded."),C();return}if(l.font="30px "+y,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){C();return}setTimeout(d.bind(null,y,C))}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,mFi(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 y of[e.loadedName,u]){const C=this._document.createElement("span");C.textContent="Hi",C.style.fontFamily=y,v.append(C)}this._document.body.append(v),d(u,()=>{v.remove(),i.complete()})}}SI=new WeakMap;class FFi{constructor(e,{disableFontFace:i=!1,fontExtraProperties:r=!1,inspectFont:o=null}){this.compiledGlyphs=Object.create(null);for(const n in e)this[n]=e[n];this.disableFontFace=i===!0,this.fontExtraProperties=r===!0,this._inspectFont=o}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,${IFi(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];const r=this.loadedName+"_path_"+i;let o;try{o=e.get(r)}catch(s){or(`getPathGenerator - ignoring character: "${s}".`)}const n=new Path2D(o||"");return this.fontExtraProperties||e.delete(r),this.compiledGlyphs[i]=n}}const rL={DATA:1,ERROR:2},ts={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function zxe(){}function cc(t){if(t instanceof og||t instanceof UZ||t instanceof oI||t instanceof rxe||t instanceof CR||t instanceof _Z)return t;switch(t instanceof Error||typeof t=="object"&&t!==null||Mo('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new og(t.message);case"InvalidPDFException":return new UZ(t.message);case"MissingPDFException":return new oI(t.message);case"PasswordException":return new rxe(t.message,t.code);case"UnexpectedResponseException":return new CR(t.message,t.status);case"UnknownErrorException":return new _Z(t.message,t.details)}return new _Z(t.message,t.toString())}var QI,hg,qxe,Kxe,Jxe,oL,Yxe;let DI=(Yxe=class{constructor(t,e,i){ce(this,hg),ce(this,QI,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",oe(this,hg,qxe).bind(this),{signal:S(this,QI).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:ts.PULL,streamId:o,desiredSize:l.desiredSize}),c.promise},cancel:l=>{$n(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:ts.CANCEL,streamId:o,reason:cc(l)}),c.promise}},i)}destroy(){var t;(t=S(this,QI))==null||t.abort(),ie(this,QI,null)}},QI=new WeakMap,hg=new WeakSet,qxe=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){oe(this,hg,Jxe).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===rL.DATA)r.resolve(t.data);else if(t.callback===rL.ERROR)r.reject(cc(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;Promise.try(e,t.data).then(function(n){o.postMessage({sourceName:i,targetName:r,callback:rL.DATA,callbackId:t.callbackId,data:n})},function(n){o.postMessage({sourceName:i,targetName:r,callback:rL.ERROR,callbackId:t.callbackId,reason:cc(n)})});return}if(t.streamId){oe(this,hg,Kxe).call(this,t);return}e(t.data)},Kxe=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:ts.ENQUEUE,streamId:e,chunk:l},d)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:ts.CLOSE,streamId:e}),delete n.streamSinks[e])},error(l){$n(l instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:ts.ERROR,streamId:e,reason:cc(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,Promise.try(s,t.data,a).then(function(){o.postMessage({sourceName:i,targetName:r,stream:ts.START_COMPLETE,streamId:e,success:!0})},function(l){o.postMessage({sourceName:i,targetName:r,stream:ts.START_COMPLETE,streamId:e,reason:cc(l)})})},Jxe=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 ts.START_COMPLETE:t.success?n.startCall.resolve():n.startCall.reject(cc(t.reason));break;case ts.PULL_COMPLETE:t.success?n.pullCall.resolve():n.pullCall.reject(cc(t.reason));break;case ts.PULL:if(!s){o.postMessage({sourceName:i,targetName:r,stream:ts.PULL_COMPLETE,streamId:e,success:!0});break}s.desiredSize<=0&&t.desiredSize>0&&s.sinkCapability.resolve(),s.desiredSize=t.desiredSize,Promise.try(s.onPull||zxe).then(function(){o.postMessage({sourceName:i,targetName:r,stream:ts.PULL_COMPLETE,streamId:e,success:!0})},function(l){o.postMessage({sourceName:i,targetName:r,stream:ts.PULL_COMPLETE,streamId:e,reason:cc(l)})});break;case ts.ENQUEUE:if($n(n,"enqueue should have stream controller"),n.isClosed)break;n.controller.enqueue(t.chunk);break;case ts.CLOSE:if($n(n,"close should have stream controller"),n.isClosed)break;n.isClosed=!0,n.controller.close(),oe(this,hg,oL).call(this,n,e);break;case ts.ERROR:$n(n,"error should have stream controller"),n.controller.error(cc(t.reason)),oe(this,hg,oL).call(this,n,e);break;case ts.CANCEL_COMPLETE:t.success?n.cancelCall.resolve():n.cancelCall.reject(cc(t.reason)),oe(this,hg,oL).call(this,n,e);break;case ts.CANCEL:if(!s)break;const a=cc(t.reason);Promise.try(s.onCancel||zxe,a).then(function(){o.postMessage({sourceName:i,targetName:r,stream:ts.CANCEL_COMPLETE,streamId:e,success:!0})},function(l){o.postMessage({sourceName:i,targetName:r,stream:ts.CANCEL_COMPLETE,streamId:e,reason:cc(l)})}),s.sinkCapability.reject(a),s.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},oL=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]},Yxe);var nL;class Wxe{constructor({enableHWA:e=!1}){ce(this,nL,!1),ie(this,nL,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:!S(this,nL)})}}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){Mo("Abstract method `_createCanvas` called.")}}nL=new WeakMap;class _Fi extends Wxe{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 Zxe{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){Mo("Abstract method `_fetch` called.")}}class Xxe extends Zxe{async _fetch(e){const i=await bR(e,this.isCompressed?"arraybuffer":"text");return i instanceof ArrayBuffer?new Uint8Array(i):yR(i)}}class $xe{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 X9,$9,pg,gg,Ml,tm,e6,xi,za,PI,t6,sL,i6,eke,yX,r6,RI,LI,wX,TI;class UFi extends $xe{constructor({docId:e,ownerDocument:i=globalThis.document}){super(),ce(this,xi),ce(this,X9),ce(this,$9),ce(this,pg),ce(this,gg),ce(this,Ml),ce(this,tm),ce(this,e6,0),ie(this,gg,e),ie(this,Ml,i)}addFilter(e){if(!e)return"none";let i=S(this,xi,za).get(e);if(i)return i;const[r,o,n]=oe(this,xi,sL).call(this,e),s=e.length===1?r:`${r}${o}${n}`;if(i=S(this,xi,za).get(s),i)return S(this,xi,za).set(e,i),i;const a=`g_${S(this,gg)}_transfer_map_${Ol(this,e6)._++}`,l=oe(this,xi,i6).call(this,a);S(this,xi,za).set(e,l),S(this,xi,za).set(s,l);const c=oe(this,xi,r6).call(this,a);return oe(this,xi,LI).call(this,r,o,n,c),l}addHCMFilter(e,i){var r;const o=`${e}-${i}`,n="base";let s=S(this,xi,PI).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},S(this,xi,PI).set(n,s)),!e||!i))return s.url;const a=oe(this,xi,TI).call(this,e);e=bi.makeHexColor(...a);const l=oe(this,xi,TI).call(this,i);if(i=bi.makeHexColor(...l),S(this,xi,t6).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_${S(this,gg)}_hcm_filter`,A=s.filter=oe(this,xi,r6).call(this,u);oe(this,xi,LI).call(this,d,d,d,A),oe(this,xi,yX).call(this,A);const h=(g,p)=>{const m=a[g]/255,f=l[g]/255,v=new Array(p+1);for(let y=0;y<=p;y++)v[y]=m+y/p*(f-m);return v.join(",")};return oe(this,xi,LI).call(this,h(0,5),h(1,5),h(2,5),A),s.url=oe(this,xi,i6).call(this,u),s.url}addAlphaFilter(e){let i=S(this,xi,za).get(e);if(i)return i;const[r]=oe(this,xi,sL).call(this,[e]),o=`alpha_${r}`;if(i=S(this,xi,za).get(o),i)return S(this,xi,za).set(e,i),i;const n=`g_${S(this,gg)}_alpha_map_${Ol(this,e6)._++}`,s=oe(this,xi,i6).call(this,n);S(this,xi,za).set(e,s),S(this,xi,za).set(o,s);const a=oe(this,xi,r6).call(this,n);return oe(this,xi,wX).call(this,r,a),s}addLuminosityFilter(e){let i=S(this,xi,za).get(e||"luminosity");if(i)return i;let r,o;if(e?([r]=oe(this,xi,sL).call(this,[e]),o=`luminosity_${r}`):o="luminosity",i=S(this,xi,za).get(o),i)return S(this,xi,za).set(e,i),i;const n=`g_${S(this,gg)}_luminosity_map_${Ol(this,e6)._++}`,s=oe(this,xi,i6).call(this,n);S(this,xi,za).set(e,s),S(this,xi,za).set(o,s);const a=oe(this,xi,r6).call(this,n);return oe(this,xi,eke).call(this,a),e&&oe(this,xi,wX).call(this,r,a),s}addHighlightHCMFilter(e,i,r,o,n){var s;const a=`${i}-${r}-${o}-${n}`;let l=S(this,xi,PI).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},S(this,xi,PI).set(e,l)),!i||!r))return l.url;const[c,d]=[i,r].map(oe(this,xi,TI).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(oe(this,xi,TI).bind(this));A<u&&([u,A,h,g]=[A,u,g,h]),S(this,xi,t6).style.color="";const p=(v,y,C)=>{const w=new Array(256),b=(A-u)/C,E=v/255,x=(y-v)/(255*C);let k=0;for(let M=0;M<=C;M++){const D=Math.round(u+M*b),P=E+M*x;for(let T=k;T<=D;T++)w[T]=P;k=D+1}for(let M=k;M<256;M++)w[M]=w[k-1];return w.join(",")},m=`g_${S(this,gg)}_hcm_${e}_filter`,f=l.filter=oe(this,xi,r6).call(this,m);return oe(this,xi,yX).call(this,f),oe(this,xi,LI).call(this,p(h[0],g[0],5),p(h[1],g[1],5),p(h[2],g[2],5),f),l.url=oe(this,xi,i6).call(this,m),l.url}destroy(e=!1){var i,r,o,n;e&&(i=S(this,tm))!=null&&i.size||((r=S(this,pg))==null||r.parentNode.parentNode.remove(),ie(this,pg,null),(o=S(this,$9))==null||o.clear(),ie(this,$9,null),(n=S(this,tm))==null||n.clear(),ie(this,tm,null),ie(this,e6,0))}}X9=new WeakMap,$9=new WeakMap,pg=new WeakMap,gg=new WeakMap,Ml=new WeakMap,tm=new WeakMap,e6=new WeakMap,xi=new WeakSet,za=function(){return S(this,$9)||ie(this,$9,new Map)},PI=function(){return S(this,tm)||ie(this,tm,new Map)},t6=function(){if(!S(this,pg)){const t=S(this,Ml).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=S(this,Ml).createElementNS(N1,"svg");i.setAttribute("width",0),i.setAttribute("height",0),ie(this,pg,S(this,Ml).createElementNS(N1,"defs")),t.append(i),i.append(S(this,pg)),S(this,Ml).body.append(t)}return S(this,pg)},sL=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(",")]},i6=function(t){if(S(this,X9)===void 0){ie(this,X9,"");const e=S(this,Ml).URL;e!==S(this,Ml).baseURI&&(IR(e)?or('#createUrl: ignore "data:"-URL for performance reasons.'):ie(this,X9,e.split("#",1)[0]))}return`url(${S(this,X9)}#${t})`},eke=function(t){const e=S(this,Ml).createElementNS(N1,"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)},yX=function(t){const e=S(this,Ml).createElementNS(N1,"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)},r6=function(t){const e=S(this,Ml).createElementNS(N1,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),S(this,xi,t6).append(e),e},RI=function(t,e,i){const r=S(this,Ml).createElementNS(N1,e);r.setAttribute("type","discrete"),r.setAttribute("tableValues",i),t.append(r)},LI=function(t,e,i,r){const o=S(this,Ml).createElementNS(N1,"feComponentTransfer");r.append(o),oe(this,xi,RI).call(this,o,"feFuncR",t),oe(this,xi,RI).call(this,o,"feFuncG",e),oe(this,xi,RI).call(this,o,"feFuncB",i)},wX=function(t,e){const i=S(this,Ml).createElementNS(N1,"feComponentTransfer");e.append(i),oe(this,xi,RI).call(this,i,"feFuncA",t)},TI=function(t){return S(this,xi,t6).style.color=t,JZ(getComputedStyle(S(this,xi,t6)).getPropertyValue("color"))};class tke{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){Mo("Abstract method `_fetch` called.")}}class ike extends tke{async _fetch(e){const i=await bR(e,"arraybuffer");return new Uint8Array(i)}}Oa&&or("Please use the `legacy` build in Node.js environments.");async function rke(t){const e=await process.getBuiltinModule("fs").promises.readFile(t);return new Uint8Array(e)}class NFi extends $xe{}class OFi extends Wxe{_createCanvas(e,i){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(e,i)}}class HFi extends Zxe{async _fetch(e){return rke(e)}}class VFi extends tke{async _fetch(e){return rke(e)}}const qa={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function bX(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(){Mo("Abstract method `getPattern` called.")}}class jFi 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===qa.STROKE||o===qa.FILL){const s=i.current.getClippedPathBoundingBox(o,en(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=bi.transform(r,[1,0,0,1,s[0],s[1]]),d.transform(...i.baseTransform),this.matrix&&d.transform(...this.matrix),bX(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 bX(e,this._bbox),n=this._createGradient(e);return n}}function BX(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 y=c[n],C=c[n+1],w=c[n+2],b=c[s],E=c[s+1],x=c[s+2],k=c[a],M=c[a+1],D=c[a+2],P=Math.round(g),T=Math.round(v);let O,V,_,H,Y,re,de,xe;for(let pe=P;pe<=T;pe++){if(pe<m){const Z=pe<g?0:(g-pe)/(g-m);O=h-(h-p)*Z,V=y-(y-b)*Z,_=C-(C-E)*Z,H=w-(w-x)*Z}else{let Z;pe>v?Z=1:m===v?Z=0:Z=(m-pe)/(m-v),O=p-(p-f)*Z,V=b-(b-k)*Z,_=E-(E-M)*Z,H=x-(x-D)*Z}let Ee;pe<g?Ee=0:pe>v?Ee=1:Ee=(g-pe)/(g-v),Y=h-(h-f)*Ee,re=y-(y-k)*Ee,de=C-(C-M)*Ee,xe=w-(w-D)*Ee;const ue=Math.round(Math.min(O,Y)),De=Math.round(Math.max(O,Y));let Ie=u*pe+ue*4;for(let Z=ue;Z<=De;Z++)Ee=(O-Z)/(O-Y),Ee<0?Ee=0:Ee>1&&(Ee=1),d[Ie++]=V-(V-re)*Ee|0,d[Ie++]=_-(_-de)*Ee|0,d[Ie++]=H-(H-xe)*Ee|0,d[Ie++]=255}}function GFi(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++)BX(t,i,r[d],r[d+1],r[d+a],o[d],o[d+1],o[d+a]),BX(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)BX(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 zFi 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 y=0,C=v.length;y<C;y+=4)v[y]=i[0],v[y+1]=i[1],v[y+2]=i[2],v[y+3]=255}for(const v of this._figures)GFi(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){bX(e,this._bbox);let n;if(o===qa.SHADING)n=bi.singularValueDecompose2dScale(en(e));else if(n=bi.singularValueDecompose2dScale(i.baseTransform),this.matrix){const a=bi.singularValueDecompose2dScale(this.matrix);n=[n[0]*a[0],n[1]*a[1]]}const s=this._createMeshCanvas(n,o===qa.SHADING?null:this._background,i.cachedCanvases);return o!==qa.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 qFi extends IX{getPattern(){return"hotpink"}}function KFi(t){switch(t[0]){case"RadialAxial":return new jFi(t);case"Mesh":return new zFi(t);case"Dummy":return new qFi}throw new Error(`Unknown IR type: ${t[0]}`)}const oke={COLORED:1,UNCOLORED:2},nke=class yRe{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),vR("TilingType: "+n);const d=i[0],u=i[1],A=i[2],h=i[3],g=A-d,p=h-u,m=bi.singularValueDecompose2dScale(this.matrix),f=bi.singularValueDecompose2dScale(this.baseTransform),v=m[0]*f[0],y=m[1]*f[1];let C=g,w=p,b=!1,E=!1;const x=Math.ceil(l*v),k=Math.ceil(c*y),M=Math.ceil(g*v),D=Math.ceil(p*y);x>=M?C=l:b=!0,k>=D?w=c:E=!0;const P=this.getSizeAndScale(C,this.ctx.canvas.width,v),T=this.getSizeAndScale(w,this.ctx.canvas.height,y),O=e.cachedCanvases.getCanvas("pattern",P.size,T.size),V=O.context,_=a.createCanvasGraphics(V);if(_.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(_,o,s),V.translate(-P.scale*d,-T.scale*u),_.transform(P.scale,0,0,T.scale,0,0),V.save(),this.clipBbox(_,d,u,A,h),_.baseTransform=en(_.ctx),_.executeOperatorList(r),_.endDrawing(),V.restore(),b||E){const H=O.canvas;b&&(C=l),E&&(w=c);const Y=this.getSizeAndScale(C,this.ctx.canvas.width,v),re=this.getSizeAndScale(w,this.ctx.canvas.height,y),de=Y.size,xe=re.size,pe=e.cachedCanvases.getCanvas("pattern-workaround",de,xe),Ee=pe.context,ue=b?Math.floor(g/l):0,De=E?Math.floor(p/c):0;for(let Ie=0;Ie<=ue;Ie++)for(let Z=0;Z<=De;Z++)Ee.drawImage(H,de*Ie,xe*Z,de,xe,0,0,de,xe);return{canvas:pe.canvas,scaleX:Y.scale,scaleY:re.scale,offsetX:d,offsetY:u}}return{canvas:O.canvas,scaleX:P.scale,scaleY:T.scale,offsetX:d,offsetY:u}}getSizeAndScale(e,i,r){const o=Math.max(yRe.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(en(e.ctx),[i,r,o,n]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,i,r){const o=e.ctx,n=e.current;switch(i){case oke.COLORED:const s=this.ctx;o.fillStyle=s.fillStyle,o.strokeStyle=s.strokeStyle,n.fillColor=s.fillStyle,n.strokeColor=s.strokeStyle;break;case oke.UNCOLORED:const a=bi.makeHexColor(r[0],r[1],r[2]);o.fillStyle=a,o.strokeStyle=a,n.fillColor=a,n.strokeColor=a;break;default:throw new fFi(`Unsupported paint type: ${i}`)}}getPattern(e,i,r,o){let n=r;o!==qa.SHADING&&(n=bi.transform(n,i.baseTransform),this.matrix&&(n=bi.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}};ai(nke,"MAX_PATTERN_SIZE",3e3);let JFi=nke;function YFi({src:t,srcPos:e=0,dest:i,width:r,height:o,nonBlackColor:n=4294967295,inverseDecode:s=!1}){const a=xl.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 ske=16,ake=100,WFi=15,lke=10,cke=1e3,dc=16;function ZFi(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 XFi{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 aL(t,e,i,r,o,n,s,a,l,c){const[d,u,A,h,g,p]=en(t);if(u===0&&A===0){const v=s*d+g,y=Math.round(v),C=a*h+p,w=Math.round(C),b=(s+l)*d+g,E=Math.abs(Math.round(b)-y)||1,x=(a+c)*h+p,k=Math.abs(Math.round(x)-w)||1;return t.setTransform(Math.sign(d),0,0,Math.sign(h),y,w),t.drawImage(e,i,r,o,n,0,0,E,k),t.setTransform(d,u,A,h,g,p),[E,k]}if(d===0&&h===0){const v=a*A+g,y=Math.round(v),C=s*u+p,w=Math.round(C),b=(a+c)*A+g,E=Math.abs(Math.round(b)-y)||1,x=(s+l)*u+p,k=Math.abs(Math.round(x)-w)||1;return t.setTransform(0,Math.sign(u),Math.sign(A),0,y,w),t.drawImage(e,i,r,o,n,0,0,k,E),t.setTransform(d,u,A,h,g,p),[k,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 $Fi(t){const{width:e,height:i}=t;if(e>cke||i>cke)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 y=s[m];do{const C=g[y];do m+=C;while(!s[m]);const w=s[m];w!==5&&w!==10?(y=w,s[m]=0):(y=w&51*y>>4,s[m]&=y>>2|y<<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 dke{constructor(e,i){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=ixe,this.textMatrixScale=1,this.fontMatrix=TZ,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=Ha.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]=bi.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=bi.applyTransform(i,e),o=bi.applyTransform(i.slice(2),e),n=bi.applyTransform([i[0],i[3]],e),s=bi.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){bi.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=bi.bezierBoundingBox(i,r,o,n,s,a,l,c,d);d||this.updateRectMinMax(e,u)}getPathBoundingBox(e=qa.FILL,i=null){const r=[this.minX,this.minY,this.maxX,this.maxY];if(e===qa.STROKE){i||Mo("Stroke bounding box must include transform.");const o=bi.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=bi.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=qa.FILL,i=null){return bi.intersect(this.clipBox,this.getPathBoundingBox(e,i))}}function uke(t,e){if(e instanceof ImageData){t.putImageData(e,0,0);return}const i=e.height,r=e.width,o=i%dc,n=(i-o)/dc,s=o===0?n:n+1,a=t.createImageData(r,dc);let l=0,c;const d=e.data,u=a.data;let A,h,g,p;if(e.kind===gR.GRAYSCALE_1BPP){const m=d.byteLength,f=new Uint32Array(u.buffer,0,u.byteLength>>2),v=f.length,y=r+7>>3,C=4294967295,w=xl.isLittleEndian?4278190080:255;for(A=0;A<s;A++){for(g=A<n?dc:o,c=0,h=0;h<g;h++){const b=m-l;let E=0;const x=b>y?r:b*8-7,k=x&-8;let M=0,D=0;for(;E<k;E+=8)D=d[l++],f[c++]=D&128?C:w,f[c++]=D&64?C:w,f[c++]=D&32?C:w,f[c++]=D&16?C:w,f[c++]=D&8?C:w,f[c++]=D&4?C:w,f[c++]=D&2?C:w,f[c++]=D&1?C:w;for(;E<x;E++)M===0&&(D=d[l++],M=128),f[c++]=D&M?C:w,M>>=1}for(;c<v;)f[c++]=0;t.putImageData(a,0,A*dc)}}else if(e.kind===gR.RGBA_32BPP){for(h=0,p=r*dc*4,A=0;A<n;A++)u.set(d.subarray(l,l+p)),l+=p,t.putImageData(a,0,h),h+=dc;A<s&&(p=r*o*4,u.set(d.subarray(l,l+p)),t.putImageData(a,0,h))}else if(e.kind===gR.RGB_24BPP)for(g=dc,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*dc)}else throw new Error(`bad image kind: ${e.kind}`)}function Ake(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const i=e.height,r=e.width,o=i%dc,n=(i-o)/dc,s=o===0?n:n+1,a=t.createImageData(r,dc);let l=0;const c=e.data,d=a.data;for(let u=0;u<s;u++){const A=u<n?dc:o;({srcPos:l}=YFi({src:c,srcPos:l,dest:d,width:r,height:A,nonBlackColor:0})),t.putImageData(a,0,u*dc)}}function FI(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 lL(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),!Oa){const{filter:e}=t;e!=="none"&&e!==""&&(t.filter="none")}}function hke(t,e){if(e)return!0;const i=bi.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const r=Math.fround((globalThis.devicePixelRatio||1)*D9.PDF_TO_CSS_UNITS);return i[0]<=r&&i[1]<=r}const e_i=["butt","round","square"],t_i=["miter","round","bevel"],i_i={},pke={};var fg,EX,xX,kX;const r_i=class wRe{constructor(e,i,r,o,n,{optionalContentConfig:s,markedContentStack:a=null},l,c){ce(this,fg),this.ctx=e,this.current=new dke(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 XFi(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(...en(this.compositeCtx))}this.ctx.save(),lL(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=en(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>lke&&typeof r=="function",d=c?Date.now()+WFi: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!==Vu.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>lke){if(Date.now()>d)return r(),a;u=0}}}endDrawing(){oe(this,fg,EX).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(),oe(this,fg,xX).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=en(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 k=l.get(c);if(k&&!s){const M=Math.round(Math.min(a[0],a[2])+a[4]),D=Math.round(Math.min(a[1],a[3])+a[5]);return{canvas:k,offsetX:M,offsetY:D}}d=k}d||(u=this.cachedCanvases.getCanvas("maskCanvas",r,o),Ake(u.context,e));let A=bi.transform(a,[1/r,0,0,-1/o,0,0]);A=bi.transform(A,[1,0,0,1,0,-o]);const[h,g,p,m]=bi.getAxialAlignedBoundingBox([0,0,r,o],A),f=Math.round(p-h)||1,v=Math.round(m-g)||1,y=this.cachedCanvases.getCanvas("fillCanvas",f,v),C=y.context,w=h,b=g;C.translate(-w,-b),C.transform(...A),d||(d=this._scaleImage(u.canvas,eh(C)),d=d.img,l&&s&&l.set(c,d)),C.imageSmoothingEnabled=hke(en(C),e.interpolate),aL(C,d,0,0,d.width,d.height,0,0,r,o),C.globalCompositeOperation="source-in";const E=bi.transform(eh(C),[1,0,0,1,-w,-b]);return C.fillStyle=s?n.getPattern(i,this,E,qa.FILL):n,C.fillRect(0,0,r,o),l&&!s&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,y.canvas)),{canvas:y.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=e_i[e]}setLineJoin(e){this.ctx.lineJoin=t_i[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(...en(this.suspendedCtx)),FI(this.suspendedCtx,n),ZFi(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(),FI(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=bi.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?(FI(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(),FI(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=en(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 Vu.rectangle:s=i[g++],a=i[g++];const m=i[g++],f=i[g++],v=s+m,y=a+f;o.moveTo(s,a),m===0||f===0?o.lineTo(v,y):(o.lineTo(v,a),o.lineTo(v,y),o.lineTo(s,y)),u||n.updateRectMinMax(d,[s,a,v,y]),o.closePath();break;case Vu.moveTo:s=i[g++],a=i[g++],o.moveTo(s,a),u||n.updatePathMinMax(d,s,a);break;case Vu.lineTo:s=i[g++],a=i[g++],o.lineTo(s,a),u||n.updatePathMinMax(d,s,a);break;case Vu.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 Vu.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 Vu.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 Vu.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,eh(i),qa.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,eh(i),qa.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=i_i}eoClip(){this.pendingClip=pke}beginText(){this.current.textMatrix=ixe,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}const r=new Path2D,o=i.getTransform().invertSelf();for(const{transform:n,x:s,y:a,fontSize:l,path:c}of e)r.addPath(c,new DOMMatrix(n).preMultiplySelf(o).translate(s,a).scale(l,-l));i.clip(r),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||TZ,(n.fontMatrix[0]===0||n.fontMatrix[3]===0)&&or("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<ske?d=ske:i>ake&&(d=ake),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&Ha.FILL_STROKE_MASK,A=!!(c&Ha.ADD_TO_PATH_FLAG),h=a.patternFill&&!l.missingFile,g=a.patternStroke&&!l.missingFile;let p;if((l.disableFontFace||A||h||g)&&(p=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||h||g){if(s.save(),s.translate(i,r),s.scale(d,-d),u===Ha.FILL||u===Ha.FILL_STROKE)if(o){const m=s.getTransform();s.setTransform(...o),s.fill(oe(this,fg,kX).call(this,p,m,o))}else s.fill(p);if(u===Ha.STROKE||u===Ha.FILL_STROKE)if(n){const m=s.getTransform();s.setTransform(...n),s.stroke(oe(this,fg,kX).call(this,p,m,n))}else s.lineWidth/=d,s.stroke(p);s.restore()}else(u===Ha.FILL||u===Ha.FILL_STROKE)&&s.fillText(e,i,r),(u===Ha.STROKE||u===Ha.FILL_STROKE)&&s.strokeText(e,i,r);A&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:en(s),x:i,y:r,fontSize:d,path: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 pr(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===Ha.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,eh(n),qa.FILL);f=en(n),n.restore(),n.fillStyle=E}if(i.patternStroke){n.save();const E=i.strokeColor.getPattern(n,this,eh(n),qa.STROKE);v=en(n),n.restore(),n.strokeStyle=E}let y=i.lineWidth;const C=i.textMatrixScale;if(C===0||y===0){const E=i.textRenderingMode&Ha.FILL_STROKE_MASK;(E===Ha.STROKE||E===Ha.FILL_STROKE)&&(y=this.getSinglePixelWidth())}else y/=C;if(s!==1&&(n.scale(s,s),y/=s),n.lineWidth=y,r.isInvalidPDFjsFont){const E=[];let x=0;for(const k of e)E.push(k.unicode),x+=k.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 k=(E.isSpace?l:0)+a,M=E.fontChar,D=E.accent;let P,T,O=E.width;if(A){const _=E.vmetric||g,H=-(E.vmetric?_[1]:O*.5)*p,Y=_[2]*p;O=_?-_[0]:O,P=H/s,T=(w+Y)/s}else P=w/s,T=0;if(r.remeasure&&O>0){const _=n.measureText(M).width*1e3/o*s;if(O<_&&this.isFontSubpixelAAEnabled){const H=O/_;x=!0,n.save(),n.scale(H,1),P/=H}else O!==_&&(P+=(O-_)/2e3*o/s)}if(this.contentVisible&&(E.isInFont||r.missingFile)){if(m&&!D)n.fillText(M,P,T);else if(this.paintChar(M,P,T,f,v),D){const _=P+o*D.offset.x/s,H=T-o*D.offset.y/s;this.paintChar(D.fontChar,_,H,f,v)}}const V=A?O*p-k*c:O*p+k*c;w+=V,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||TZ,A=e.length,h=r.textRenderingMode===Ha.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,y=o.charProcOperatorList[p.operatorListId];if(!y){or(`Type3 character "${p.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=p,this.save(),i.scale(n,n),i.transform(...u),this.executeOperatorList(y),this.restore()),m=bi.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||en(this.ctx),n={createCanvasGraphics:s=>new wRe(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};i=new JFi(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=bi.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=bi.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=KFi(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,eh(i),qa.SHADING);const o=eh(i);if(o){const{width:n,height:s}=i.canvas,[a,l,c,d]=bi.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(){Mo("Should not call beginInlineImage")}beginImageData(){Mo("Should not call beginImageData")}paintFormXObjectBegin(e,i){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=en(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(en(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||vR("TODO: Support non-isolated groups."),e.knockout&&or("Knockout groups not supported.");const r=en(i);if(e.matrix&&i.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let o=bi.getAxialAlignedBoundingBox(e.bbox,en(i));const n=[0,0,i.canvas.width,i.canvas.height];o=bi.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()),FI(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=en(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...o);const n=bi.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(oe(this,fg,EX).call(this),lL(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]=bi.singularValueDecompose2dScale(en(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),lL(this.ctx)}else lL(this.ctx),this.endPath(),this.ctx.rect(i[0],i[1],s,a),this.ctx.clip(),this.ctx.beginPath()}this.current=new dke(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...o)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),oe(this,fg,xX).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=$Fi(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=en(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=bi.transform(l,[i,r,o,n,s[d],s[d+1]]),[h,g]=bi.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);Ake(u,A),u.globalCompositeOperation="source-in",u.fillStyle=o?r.getPattern(u,this,eh(i),qa.FILL):r,u.fillRect(0,0,a,l),u.restore(),i.save(),i.transform(...c),i.scale(1,-1),aL(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){or("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){or("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(),!Oa){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;uke(a,e),n=this.applyTransferMapsToCanvas(a)}const s=this._scaleImage(n,eh(o));o.imageSmoothingEnabled=hke(en(o),e.interpolate),aL(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;uke(a,e),o=this.applyTransferMapsToCanvas(a)}for(const n of i)r.save(),r.transform(...n.transform),r.scale(1,-1),aL(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===pke?r.clip("evenodd"):r.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),r.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=en(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}};fg=new WeakSet,EX=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)},xX=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}}},kX=function(t,e,i){const r=new Path2D;return r.addPath(t,new DOMMatrix(i).invertSelf().multiplySelf(e)),r};let cL=r_i;for(const t in Vu)cL.prototype[t]!==void 0&&(cL.prototype[Vu[t]]=cL.prototype[t]);var dL,uL;class mg{static get workerPort(){return S(this,dL)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");ie(this,dL,e)}static get workerSrc(){return S(this,uL)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");ie(this,uL,e)}}dL=new WeakMap,uL=new WeakMap,ce(mg,dL,null),ce(mg,uL,"");var o6,AL;class o_i{constructor({parsedData:e,rawData:i}){ce(this,o6),ce(this,AL),ie(this,o6,e),ie(this,AL,i)}getRaw(){return S(this,AL)}get(e){return S(this,o6).get(e)??null}getAll(){return NZ(S(this,o6))}has(e){return S(this,o6).has(e)}}o6=new WeakMap,AL=new WeakMap;const n6=Symbol("INTERNAL");var hL,pL,gL,_I;class n_i{constructor(e,{name:i,intent:r,usage:o,rbGroups:n}){ce(this,hL,!1),ce(this,pL,!1),ce(this,gL,!1),ce(this,_I,!0),ie(this,hL,!!(e&Zc.DISPLAY)),ie(this,pL,!!(e&Zc.PRINT)),this.name=i,this.intent=r,this.usage=o,this.rbGroups=n}get visible(){if(S(this,gL))return S(this,_I);if(!S(this,_I))return!1;const{print:e,view:i}=this.usage;return S(this,hL)?i?.viewState!=="OFF":S(this,pL)?e?.printState!=="OFF":!0}_setVisible(e,i,r=!1){e!==n6&&Mo("Internal method `_setVisible` called."),ie(this,gL,r),ie(this,_I,i)}}hL=new WeakMap,pL=new WeakMap,gL=new WeakMap,_I=new WeakMap;var im,Eo,UI,NI,fL,MX;class s_i{constructor(e,i=Zc.DISPLAY){if(ce(this,fL),ce(this,im,null),ce(this,Eo,new Map),ce(this,UI,null),ce(this,NI,null),this.renderingIntent=i,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,ie(this,NI,e.order);for(const r of e.groups)S(this,Eo).set(r.id,new n_i(i,r));if(e.baseState==="OFF")for(const r of S(this,Eo).values())r._setVisible(n6,!1);for(const r of e.on)S(this,Eo).get(r)._setVisible(n6,!0);for(const r of e.off)S(this,Eo).get(r)._setVisible(n6,!1);ie(this,UI,this.getHash())}}isVisible(e){if(S(this,Eo).size===0)return!0;if(!e)return vR("Optional content group not defined."),!0;if(e.type==="OCG")return S(this,Eo).has(e.id)?S(this,Eo).get(e.id).visible:(or(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return oe(this,fL,MX).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(const i of e.ids){if(!S(this,Eo).has(i))return or(`Optional content group not found: ${i}`),!0;if(S(this,Eo).get(i).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const i of e.ids){if(!S(this,Eo).has(i))return or(`Optional content group not found: ${i}`),!0;if(!S(this,Eo).get(i).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const i of e.ids){if(!S(this,Eo).has(i))return or(`Optional content group not found: ${i}`),!0;if(!S(this,Eo).get(i).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const i of e.ids){if(!S(this,Eo).has(i))return or(`Optional content group not found: ${i}`),!0;if(S(this,Eo).get(i).visible)return!1}return!0}return or(`Unknown optional content policy ${e.policy}.`),!0}return or(`Unknown group type ${e.type}.`),!0}setVisibility(e,i=!0,r=!0){var o;const n=S(this,Eo).get(e);if(!n){or(`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=S(this,Eo).get(a))==null||o._setVisible(n6,!1,!0));n._setVisible(n6,!!i,!0),ie(this,im,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=S(this,Eo).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}}ie(this,im,null)}get hasInitialVisibility(){return S(this,UI)===null||this.getHash()===S(this,UI)}getOrder(){return S(this,Eo).size?S(this,NI)?S(this,NI).slice():[...S(this,Eo).keys()]:null}getGroups(){return S(this,Eo).size>0?NZ(S(this,Eo)):null}getGroup(e){return S(this,Eo).get(e)||null}getHash(){if(S(this,im)!==null)return S(this,im);const e=new Vxe;for(const[i,r]of S(this,Eo))e.update(`${i}:${r.visible}`);return ie(this,im,e.hexdigest())}}im=new WeakMap,Eo=new WeakMap,UI=new WeakMap,NI=new WeakMap,fL=new WeakSet,MX=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=oe(this,fL,MX).call(this,o);else if(S(this,Eo).has(o))n=S(this,Eo).get(o).visible;else return or(`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 a_i{constructor(e,{disableRange:i=!1,disableStream:r=!1}){$n(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)});$n(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(){$n(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new l_i(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new c_i(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 l_i{constructor(e,i,r=!1,o=null){this._stream=e,this._done=r||!1,this._filename=qZ(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 c_i{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 d_i(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=yR(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 gke(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 mL(t){try{return new URL(t).origin}catch{}return null}function fke({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 mke(t){const e=t.get("Content-Disposition");if(e){let i=d_i(e);if(i.includes("%"))try{i=decodeURIComponent(i)}catch{}if(qZ(i))return i}return null}function vL(t,e){return t===404||t===0&&e.startsWith("file:")?new oI('Missing PDF "'+e+'".'):new CR(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function vke(t){return t===200||t===206}function Cke(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function yke(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(or(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class wke{constructor(e){ai(this,"_responseOrigin",null),this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=gke(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 $n(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new u_i(this),this._fullRequestReader}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new A_i(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 u_i{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,Cke(r,this._withCredentials,this._abortController)).then(n=>{if(e._responseOrigin=mL(n.url),!vke(n.status))throw vL(n.status,o);this._reader=n.body.getReader(),this._headersCapability.resolve();const s=n.headers,{allowRangeRequests:a,suggestedLength:l}=fke({responseHeaders:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=l||this._contentLength,this._filename=mke(s),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new og("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:yke(i),done:!1})}cancel(e){var i;(i=this._reader)==null||i.cancel(e),this._abortController.abort()}}class A_i{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,Cke(n,this._withCredentials,this._abortController)).then(a=>{const l=mL(a.url);if(l!==e._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${e._responseOrigin}".`);if(!vke(a.status))throw vL(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:yke(i),done:!1})}cancel(e){var i;(i=this._reader)==null||i.cancel(e),this._abortController.abort()}}const SX=200,QX=206;function h_i(t){const e=t.response;return typeof e!="string"?e:yR(e).buffer}class p_i{constructor({url:e,httpHeaders:i,withCredentials:r}){ai(this,"_responseOrigin",null),this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=gke(this.isHttp,i),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}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=QX):o.expectedStatus=SX,i.responseType="arraybuffer",$n(e.onError,"Expected `onError` callback to be provided."),i.onerror=()=>{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){const r=this.pendingRequests[e];if(!r)return;const o=r.xhr;if(o.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),o.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],o.status===0&&this.isHttp){r.onError(o.status);return}const n=o.status||SX;if(!(n===SX&&r.expectedStatus===QX)&&n!==r.expectedStatus){r.onError(o.status);return}const s=h_i(o);if(n===QX){const a=o.getResponseHeader("Content-Range"),l=/bytes (\d+)-(\d+)\/(\d+)/.exec(a);l?r.onDone({begin:parseInt(l[1],10),chunk:s}):(or('Missing or invalid "Content-Range" header.'),r.onError(0))}else s?r.onDone({begin:0,chunk:s}):r.onError(o.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 g_i{constructor(e){this._source=e,this._manager=new p_i(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 $n(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new f_i(this._manager,this._source),this._fullRequestReader}getRangeReader(e,i){const r=new m_i(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 f_i{constructor(e,i){this._manager=e,this._url=i.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=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=mL(i.responseURL);const r=i.getAllResponseHeaders(),o=new Headers(r?r.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(a=>{const[l,...c]=a.split(": ");return[l,c.join(": ")]}):[]),{allowRangeRequests:n,suggestedLength:s}=fke({responseHeaders:o,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=mke(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=vL(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 m_i{constructor(e,i,r){this._manager=e,this._url=e.url,this._requestId=e.request({begin:i,end:r,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var e;const i=mL((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=vL(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 v_i=/^[a-z][a-z0-9\-+.]+:/i;function C_i(t){if(v_i.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}class y_i{constructor(e){this.source=e,this.url=C_i(e.url),$n(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 $n(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new w_i(this),this._fullRequestReader}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new b_i(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 w_i{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 oI(`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 og("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class b_i{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 I_i=1e5,uc=30,B_i=.8;var bke,rm,ed,CL,yL,om,vg,wL,bL,s6,OI,HI,nm,VI,IL,jI,a6,BL,EL,l6,c6,xL,sm,GI,d6,Ike,Bke,DX,W1,kL,PX,Eke,xke;const Ac=class UE{constructor({textContentSource:e,container:i,viewport:r}){ce(this,d6),ce(this,rm,Promise.withResolvers()),ce(this,ed,null),ce(this,CL,!1),ce(this,yL,!!((bke=globalThis.FontInspector)!=null&&bke.enabled)),ce(this,om,null),ce(this,vg,null),ce(this,wL,0),ce(this,bL,0),ce(this,s6,null),ce(this,OI,null),ce(this,HI,0),ce(this,nm,0),ce(this,VI,Object.create(null)),ce(this,IL,[]),ce(this,jI,null),ce(this,a6,[]),ce(this,BL,new WeakMap),ce(this,EL,null);var o;if(e instanceof ReadableStream)ie(this,jI,e);else if(typeof e=="object")ie(this,jI,new ReadableStream({start(c){c.enqueue(e),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');ie(this,ed,ie(this,OI,i)),ie(this,nm,r.scale*(globalThis.devicePixelRatio||1)),ie(this,HI,r.rotation),ie(this,vg,{div:null,properties:null,ctx:null});const{pageWidth:n,pageHeight:s,pageX:a,pageY:l}=r.rawDims;ie(this,EL,[1,0,0,-1,-a,l+s]),ie(this,bL,n),ie(this,wL,s),oe(o=UE,W1,Eke).call(o),H2(i,r),S(this,rm).promise.finally(()=>{S(UE,GI).delete(this),ie(this,vg,null),ie(this,VI,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:i}=xl.platform;return pr(this,"fontFamilyMap",new Map([["sans-serif",`${e&&i?"Calibri, ":""}sans-serif`],["monospace",`${e&&i?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{S(this,s6).read().then(({value:i,done:r})=>{if(r){S(this,rm).resolve();return}S(this,om)??ie(this,om,i.lang),Object.assign(S(this,VI),i.styles),oe(this,d6,Ike).call(this,i.items),e()},S(this,rm).reject)};return ie(this,s6,S(this,jI).getReader()),S(UE,GI).add(this),e(),S(this,rm).promise}update({viewport:e,onBefore:i=null}){var r;const o=e.scale*(globalThis.devicePixelRatio||1),n=e.rotation;if(n!==S(this,HI)&&(i?.(),ie(this,HI,n),H2(S(this,OI),{rotation:n})),o!==S(this,nm)){i?.(),ie(this,nm,o);const s={div:null,properties:null,ctx:oe(r=UE,W1,kL).call(r,S(this,om))};for(const a of S(this,a6))s.properties=S(this,BL).get(a),s.div=a,oe(this,d6,DX).call(this,s)}}cancel(){var e;const i=new og("TextLayer task cancelled.");(e=S(this,s6))==null||e.cancel(i).catch(()=>{}),ie(this,s6,null),S(this,rm).reject(i)}get textDivs(){return S(this,a6)}get textContentItemsStr(){return S(this,IL)}static cleanup(){if(!(S(this,GI).size>0)){S(this,l6).clear();for(const{canvas:e}of S(this,c6).values())e.remove();S(this,c6).clear()}}};rm=new WeakMap,ed=new WeakMap,CL=new WeakMap,yL=new WeakMap,om=new WeakMap,vg=new WeakMap,wL=new WeakMap,bL=new WeakMap,s6=new WeakMap,OI=new WeakMap,HI=new WeakMap,nm=new WeakMap,VI=new WeakMap,IL=new WeakMap,jI=new WeakMap,a6=new WeakMap,BL=new WeakMap,EL=new WeakMap,l6=new WeakMap,c6=new WeakMap,xL=new WeakMap,sm=new WeakMap,GI=new WeakMap,d6=new WeakSet,Ike=function(t){var e,i;if(S(this,CL))return;(i=S(this,vg)).ctx??(i.ctx=oe(e=Ac,W1,kL).call(e,S(this,om)));const r=S(this,a6),o=S(this,IL);for(const n of t){if(r.length>I_i){or("Ignoring additional textDivs for performance reasons."),ie(this,CL,!0);return}if(n.str===void 0){if(n.type==="beginMarkedContentProps"||n.type==="beginMarkedContent"){const s=S(this,ed);ie(this,ed,document.createElement("span")),S(this,ed).classList.add("markedContent"),n.id!==null&&S(this,ed).setAttribute("id",`${n.id}`),s.append(S(this,ed))}else n.type==="endMarkedContent"&&ie(this,ed,S(this,ed).parentNode);continue}o.push(n.str),oe(this,d6,Bke).call(this,n)}},Bke=function(t){var e;const i=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};S(this,a6).push(i);const o=bi.transform(S(this,EL),t.transform);let n=Math.atan2(o[1],o[0]);const s=S(this,VI)[t.fontName];s.vertical&&(n+=Math.PI/2);let a=S(this,yL)&&s.fontSubstitution||s.fontFamily;a=Ac.fontFamilyMap.get(a)||a;const l=Math.hypot(o[2],o[3]),c=l*oe(e=Ac,W1,xke).call(e,a,S(this,om));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;S(this,ed)===S(this,OI)?(h.left=`${(100*d/S(this,bL)).toFixed(2)}%`,h.top=`${(100*u/S(this,wL)).toFixed(2)}%`):(h.left=`${A}${d.toFixed(2)}px)`,h.top=`${A}${u.toFixed(2)}px)`),h.fontSize=`${A}${(S(Ac,sm)*l).toFixed(2)}px)`,h.fontFamily=a,r.fontSize=l,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,S(this,yL)&&(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),S(this,BL).set(i,r),S(this,vg).div=i,S(this,vg).properties=r,oe(this,d6,DX).call(this,S(this,vg)),r.hasText&&S(this,ed).append(i),r.hasEOL){const p=document.createElement("br");p.setAttribute("role","presentation"),S(this,ed).append(p)}},DX=function(t){var e;const{div:i,properties:r,ctx:o}=t,{style:n}=i;let s="";if(S(Ac,sm)>1&&(s=`scale(${1/S(Ac,sm)})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:a}=n,{canvasWidth:l,fontSize:c}=r;oe(e=Ac,W1,PX).call(e,o,c*S(this,nm),a);const{width:d}=o.measureText(i.textContent);d>0&&(s=`scaleX(${l*S(this,nm)/d}) ${s}`)}r.angle!==0&&(s=`rotate(${r.angle}deg) ${s}`),s.length>0&&(n.transform=s)},W1=new WeakSet,kL=function(t=null){let e=S(this,c6).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}),S(this,c6).set(t,e),S(this,xL).set(e,{size:0,family:""})}return e},PX=function(t,e,i){const r=S(this,xL).get(t);e===r.size&&i===r.family||(t.font=`${e}px ${i}`,r.size=e,r.family=i)},Eke=function(){if(S(this,sm)!==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),ie(this,sm,t.getBoundingClientRect().height),t.remove()},xke=function(t,e){const i=S(this,l6).get(t);if(i)return i;const r=oe(this,W1,kL).call(this,e);r.canvas.width=r.canvas.height=uc,oe(this,W1,PX).call(this,r,uc,t);const o=r.measureText("");let n=o.fontBoundingBoxAscent,s=Math.abs(o.fontBoundingBoxDescent);if(n){const c=n/(n+s);return S(this,l6).set(t,c),r.canvas.width=r.canvas.height=0,c}r.strokeStyle="red",r.clearRect(0,0,uc,uc),r.strokeText("g",0,0);let a=r.getImageData(0,0,uc,uc).data;s=0;for(let c=a.length-1-3;c>=0;c-=4)if(a[c]>0){s=Math.ceil(c/4/uc);break}r.clearRect(0,0,uc,uc),r.strokeText("A",0,uc),a=r.getImageData(0,0,uc,uc).data,n=0;for(let c=0,d=a.length;c<d;c+=4)if(a[c]>0){n=uc-Math.floor(c/4/uc);break}r.canvas.width=r.canvas.height=0;const l=n?n/(n+s):B_i;return S(this,l6).set(t,l),l},ce(Ac,W1),ce(Ac,l6,new Map),ce(Ac,c6,new Map),ce(Ac,xL,new WeakMap),ce(Ac,sm,null),ce(Ac,GI,new Set);let RX=Ac;class WE{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(WE.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 E_i=65536,x_i=100,k_i=5e3,M_i=Oa?OFi:_Fi,S_i=Oa?HFi:Xxe,Q_i=Oa?NFi:UFi,D_i=Oa?VFi:ike;function P_i(t={}){typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new T_i,{docId:i}=e,r=t.url?R_i(t.url):null,o=t.data?L_i(t.data):null,n=t.httpHeaders||null,s=t.withCredentials===!0,a=t.password??null,l=t.range instanceof Ske?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:E_i;let d=t.worker instanceof DL?t.worker:null;const u=t.verbosity,A=typeof t.docBaseUrl=="string"&&!IR(t.docBaseUrl)?t.docBaseUrl:null,h=typeof t.cMapUrl=="string"?t.cMapUrl:null,g=t.cMapPacked!==!1,p=t.CMapReaderFactory||S_i,m=typeof t.standardFontDataUrl=="string"?t.standardFontDataUrl:null,f=t.StandardFontDataFactory||D_i,v=t.stopAtErrors!==!0,y=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,C=t.isEvalSupported!==!1,w=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!Oa,b=typeof t.isImageDecoderSupported=="boolean"?t.isImageDecoderSupported:!Oa&&(xl.platform.isFirefox||!globalThis.chrome),E=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,x=typeof t.disableFontFace=="boolean"?t.disableFontFace:Oa,k=t.fontExtraProperties===!0,M=t.enableXfa===!0,D=t.ownerDocument||globalThis.document,P=t.disableRange===!0,T=t.disableStream===!0,O=t.disableAutoFetch===!0,V=t.pdfBug===!0,_=t.CanvasFactory||M_i,H=t.FilterFactory||Q_i,Y=t.enableHWA===!0,re=l?l.length:t.length??NaN,de=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!Oa&&!x,xe=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:p===Xxe&&f===ike&&h&&m&&nI(h,document.baseURI)&&nI(m,document.baseURI),pe=null;AFi(u);const Ee={canvasFactory:new _({ownerDocument:D,enableHWA:Y}),filterFactory:new H({docId:i,ownerDocument:D}),cMapReaderFactory:xe?null:new p({baseUrl:h,isCompressed:g}),standardFontDataFactory:xe?null:new f({baseUrl:m})};if(!d){const Ie={verbosity:u,port:mg.workerPort};d=Ie.port?DL.fromPort(Ie):new DL(Ie),e._worker=d}const ue={docId:i,apiVersion:"4.10.38",data:o,password:a,disableAutoFetch:O,rangeChunkSize:c,length:re,docBaseUrl:A,enableXfa:M,evaluatorOptions:{maxImageSize:y,disableFontFace:x,ignoreErrors:v,isEvalSupported:C,isOffscreenCanvasSupported:w,isImageDecoderSupported:b,canvasMaxAreaInBytes:E,fontExtraProperties:k,useSystemFonts:de,cMapUrl:xe?h:null,standardFontDataUrl:xe?m:null}},De={disableFontFace:x,fontExtraProperties:k,ownerDocument:D,pdfBug:V,styleElement:pe,loadingParams:{disableAutoFetch:O,enableXfa:M}};return d.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const Ie=d.messageHandler.sendWithPromise("GetDocRequest",ue,o?[o.buffer]:null);let Z;if(l)Z=new a_i(l,{disableRange:P,disableStream:T});else if(!o){if(!r)throw new Error("getDocument - no `url` parameter provided.");let ae;if(Oa)if(nI(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`.");ae=wke}else ae=y_i;else ae=nI(r)?wke:g_i;Z=new ae({url:r,length:re,httpHeaders:n,withCredentials:s,rangeChunkSize:c,disableRange:P,disableStream:T})}return Ie.then(ae=>{if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const le=new DI(i,ae,d.port),he=new N_i(le,e,Z,De,Ee);e._transport=he,le.send("Ready",null)})}).catch(e._capability.reject),e}function R_i(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(Oa&&typeof t=="string")return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function L_i(t){if(Oa&&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 yR(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 kke(t){return typeof t=="object"&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0}var LX;const Mke=class bRe{constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${Ol(bRe,LX)._++}`,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}};LX=new WeakMap,ce(Mke,LX,0);let T_i=Mke;class Ske{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){Mo("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class F_i{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 pr(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 am,Cg,lh,u6,ML;class __i{constructor(e,i,r,o=!1){ce(this,lh),ce(this,am,null),ce(this,Cg,!1),this._pageIndex=e,this._pageInfo=i,this._transport=r,this._stats=o?new sxe:null,this._pdfBug=o,this.commonObjs=r.commonObjs,this.objs=new Qke,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 YE({viewBox:this.view,userUnit:this.userUnit,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 pr(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=ig.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;ie(this,Cg,!1),oe(this,lh,ML).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&Zc.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 y=b=>{var E;f.renderTasks.delete(C),(this._maybeCleanupAfterRender||v)&&ie(this,Cg,!0),oe(this,lh,u6).call(this,!v),b?(C.capability.reject(b),this._abortOperatorList({intentState:f,reason:b instanceof Error?b:new Error(b)})):C.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))},C=new H_i({callback:y,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(C);const w=C.task;return Promise.all([f.displayReadyCapability.promise,a]).then(([b,E])=>{var x;if(this.destroyed){y();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.");C.initializeGraphics({transparency:b,optionalContentConfig:E}),C.operatorListChanged()}).catch(y),w}getOperatorList({intent:e="display",annotationMode:i=ig.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=>WE.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(),ie(this,Cg,!1),oe(this,lh,ML).call(this),Promise.all(e)}cleanup(e=!1){ie(this,Cg,!0);const i=oe(this,lh,u6).call(this,!1);return e&&i&&this._stats&&(this._stats=new sxe),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&&oe(this,lh,u6).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();oe(this,lh,u6).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 zZ){let o=x_i;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 og(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}}am=new WeakMap,Cg=new WeakMap,lh=new WeakSet,u6=function(t=!1){if(oe(this,lh,ML).call(this),!S(this,Cg)||this.destroyed)return!1;if(t)return ie(this,am,setTimeout(()=>{ie(this,am,null),oe(this,lh,u6).call(this,!1)},k_i)),!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(),ie(this,Cg,!1),!0},ML=function(){S(this,am)&&(clearTimeout(S(this,am)),ie(this,am,null))};var yg,TX;class U_i{constructor(){ce(this,yg,new Map),ce(this,TX,Promise.resolve())}postMessage(e,i){const r={data:structuredClone(e,i?{transfer:i}:null)};S(this,TX).then(()=>{for(const[o]of S(this,yg))o.call(this,r)})}addEventListener(e,i,r=null){let o=null;if(r?.signal instanceof AbortSignal){const{signal:n}=r;if(n.aborted){or("LoopbackPort - cannot use an `aborted` signal.");return}const s=()=>this.removeEventListener(e,i);o=()=>n.removeEventListener("abort",s),n.addEventListener("abort",s)}S(this,yg).set(i,o)}removeEventListener(e,i){const r=S(this,yg).get(i);r?.(),S(this,yg).delete(i)}terminate(){for(const[,e]of S(this,yg))e?.();S(this,yg).clear()}}yg=new WeakMap,TX=new WeakMap;var FX,A6,lm,zI,SL,qI,QL;const wg=class _l{constructor({name:e=null,port:i=null,verbosity:r=hFi()}={}){ce(this,zI);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=S(_l,lm))!=null&&o.has(i))throw new Error("Cannot use more than one PDFWorker per port.");(S(_l,lm)||ie(_l,lm,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 DI("main","worker",e),this._messageHandler.on("ready",function(){}),oe(this,zI,SL).call(this)}_initialize(){if(S(_l,A6)||S(_l,qI,QL)){this._setupFakeWorker();return}let{workerSrc:e}=_l;try{_l._isSameOrigin(window.location.href,e)||(e=_l._createCDNWrapper(new URL(e,window.location).href));const i=new Worker(e,{type:"module"}),r=new DI("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,oe(this,zI,SL).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{vR("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){S(_l,A6)||(or("Setting up fake worker."),ie(_l,A6,!0)),_l._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const i=new U_i;this._port=i;const r=`fake${Ol(_l,FX)._++}`,o=new DI(r+"_worker",r,i);e.setup(o,i),this._messageHandler=new DI(r,r+"_worker",i),oe(this,zI,SL).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=S(_l,lm))==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=S(this,lm))==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 _l(e)}static get workerSrc(){if(mg.workerSrc)return mg.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return pr(this,"_setupFakeWorkerGlobal",(async()=>S(this,qI,QL)?S(this,qI,QL):(await import(this.workerSrc)).WorkerMessageHandler)())}};FX=new WeakMap,A6=new WeakMap,lm=new WeakMap,zI=new WeakSet,SL=function(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})},qI=new WeakSet,QL=function(){var t;try{return((t=globalThis.pdfjsWorker)==null?void 0:t.WorkerMessageHandler)||null}catch{return null}},ce(wg,qI),ce(wg,FX,0),ce(wg,A6,!1),ce(wg,lm),Oa&&(ie(wg,A6,!0),mg.workerSrc||(mg.workerSrc="./pdf.worker.mjs")),wg._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},wg._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};let DL=wg;var bg,Z1,KI,JI,Ig,h6,YI;class N_i{constructor(e,i,r,o,n){ce(this,h6),ce(this,bg,new Map),ce(this,Z1,new Map),ce(this,KI,new Map),ce(this,JI,new Map),ce(this,Ig,null),this.messageHandler=e,this.loadingTask=i,this.commonObjs=new Qke,this.fontLoader=new TFi({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 pr(this,"annotationStorage",new CX)}getRenderingIntent(e,i=ig.ENABLE,r=null,o=!1,n=!1){let s=Zc.DISPLAY,a=mX;switch(e){case"any":s=Zc.ANY;break;case"display":break;case"print":s=Zc.PRINT;break;default:or(`getRenderingIntent - invalid intent: ${e}`)}const l=s&Zc.PRINT&&r instanceof Gxe?r:this.annotationStorage;switch(i){case ig.DISABLE:s+=Zc.ANNOTATIONS_DISABLE;break;case ig.ENABLE:break;case ig.ENABLE_FORMS:s+=Zc.ANNOTATIONS_FORMS;break;case ig.ENABLE_STORAGE:s+=Zc.ANNOTATIONS_STORAGE,a=l.serializable;break;default:or(`getRenderingIntent - invalid annotationMode: ${i}`)}o&&(s+=Zc.IS_EDITING),n&&(s+=Zc.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=S(this,Ig))==null||e.reject(new Error("Worker was destroyed during onPassword callback"));const i=[];for(const o of S(this,Z1).values())i.push(o._destroy());S(this,Z1).clear(),S(this,KI).clear(),S(this,JI).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(),S(this,bg).clear(),this.filterFactory.destroy(),RX.cleanup(),(o=this._networkStream)==null||o.cancelAllRequests(new og("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)=>{$n(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}$n(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)=>{$n(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}$n(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 F_i(r,this))}),e.on("DocException",r=>{i._capability.reject(cc(r))}),e.on("PasswordRequest",r=>{ie(this,Ig,Promise.withResolvers());try{if(!i.onPassword)throw cc(r);const o=n=>{n instanceof Error?S(this,Ig).reject(n):S(this,Ig).resolve({password:n})};i.onPassword(o,r.code)}catch(o){S(this,Ig).reject(o)}return S(this,Ig).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||S(this,Z1).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;or(`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 FFi(n,{disableFontFace:a,fontExtraProperties:l,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;$n(A,"The imageRef must be defined.");for(const h of S(this,Z1).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=S(this,Z1).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>lFi&&(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&&or("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=S(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&&S(this,JI).set(n.refStr,e);const s=new __i(i,n,this,this._params.pdfBug);return S(this,Z1).set(i,s),s});return S(this,KI).set(i,o),o}getPageIndex(e){return kke(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 oe(this,h6,YI).call(this,"GetFieldObjects")}hasJSActions(){return oe(this,h6,YI).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 oe(this,h6,YI).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 oe(this,h6,YI).call(this,"GetOptionalContentConfig").then(i=>new s_i(i,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",i=S(this,bg).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 o_i(o[1]):null,contentDispositionFilename:((n=this._fullReader)==null?void 0:n.filename)??null,contentLength:((s=this._fullReader)==null?void 0:s.contentLength)??null}});return S(this,bg).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 S(this,Z1).values())if(!i.cleanup())throw new Error(`startCleanup: Page ${i.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),S(this,bg).clear(),this.filterFactory.destroy(!0),RX.cleanup()}}cachedPageNumber(e){if(!kke(e))return null;const i=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return S(this,JI).get(i)??null}}bg=new WeakMap,Z1=new WeakMap,KI=new WeakMap,JI=new WeakMap,Ig=new WeakMap,h6=new WeakSet,YI=function(t,e=null){const i=S(this,bg).get(t);if(i)return i;const r=this.messageHandler.sendWithPromise(t,e);return S(this,bg).set(t,r),r};const WI=Symbol("INITIAL_DATA");var Nd,PL,_X;class Qke{constructor(){ce(this,PL),ce(this,Nd,Object.create(null))}get(e,i=null){if(i){const o=oe(this,PL,_X).call(this,e);return o.promise.then(()=>i(o.data)),null}const r=S(this,Nd)[e];if(!r||r.data===WI)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const i=S(this,Nd)[e];return!!i&&i.data!==WI}delete(e){const i=S(this,Nd)[e];return!i||i.data===WI?!1:(delete S(this,Nd)[e],!0)}resolve(e,i=null){const r=oe(this,PL,_X).call(this,e);r.data=i,r.resolve()}clear(){var e;for(const i in S(this,Nd)){const{data:r}=S(this,Nd)[i];(e=r?.bitmap)==null||e.close()}ie(this,Nd,Object.create(null))}*[Symbol.iterator](){for(const e in S(this,Nd)){const{data:i}=S(this,Nd)[e];i!==WI&&(yield[e,i])}}}Nd=new WeakMap,PL=new WeakSet,_X=function(t){var e;return(e=S(this,Nd))[t]||(e[t]={...Promise.withResolvers(),data:WI})};var cm;class O_i{constructor(e){ce(this,cm,null),ie(this,cm,e),this.onContinue=null}get promise(){return S(this,cm).capability.promise}cancel(e=0){S(this,cm).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=S(this,cm).operatorList;if(!e)return!1;const{annotationCanvasMap:i}=S(this,cm);return e.form||e.canvas&&i?.size>0}}cm=new WeakMap;var dm,p6;const Dke=class NE{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}){ce(this,dm,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 O_i(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(S(NE,p6).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.");S(NE,p6).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 cL(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(),S(this,dm)&&(window.cancelAnimationFrame(S(this,dm)),ie(this,dm,null)),S(NE,p6).delete(this._canvas),this.callback(e||new zZ(`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?ie(this,dm,window.requestAnimationFrame(()=>{ie(this,dm,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(),S(NE,p6).delete(this._canvas),this.callback())))}};dm=new WeakMap,p6=new WeakMap,ce(Dke,p6,new WeakSet);let H_i=Dke;const V_i="4.10.38",j_i="f9bea397f";function Pke(t){return Math.floor(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,"0")}function ZI(t){return Math.max(0,Math.min(255,255*t))}class Rke{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=ZI(e),[e,e,e]}static G_HTML([e]){const i=Pke(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(ZI)}static RGB_HTML(e){return`#${e.map(Pke).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[ZI(1-Math.min(1,e+o)),ZI(1-Math.min(1,r+o)),ZI(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 G_i{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){Mo("Abstract method `_createSVG` called.")}}class UX extends G_i{_createSVG(e){return document.createElementNS(N1,e)}}class Lke{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&&WE.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 y=document.createTextNode(m.value);u.push(y),p.append(y);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 y=document.createTextNode(m.value);c&&WE.shouldBuildText(f)&&u.push(y),v.append(y)}}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 XI=1e3,z_i=9,um=new WeakSet;function Bg(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class q_i{static create(e){switch(e.data.annotationType){case Cs.LINK:return new _ke(e);case Cs.TEXT:return new J_i(e);case Cs.WIDGET:switch(e.data.fieldType){case"Tx":return new Y_i(e);case"Btn":return e.data.radioButton?new Uke(e):e.data.checkBox?new Z_i(e):new X_i(e);case"Ch":return new $_i(e);case"Sig":return new W_i(e)}return new pm(e);case Cs.POPUP:return new OX(e);case Cs.FREETEXT:return new jke(e);case Cs.LINE:return new tUi(e);case Cs.SQUARE:return new iUi(e);case Cs.CIRCLE:return new rUi(e);case Cs.POLYLINE:return new Gke(e);case Cs.CARET:return new nUi(e);case Cs.INK:return new qX(e);case Cs.POLYGON:return new oUi(e);case Cs.HIGHLIGHT:return new zke(e);case Cs.UNDERLINE:return new sUi(e);case Cs.SQUIGGLY:return new aUi(e);case Cs.STRIKEOUT:return new lUi(e);case Cs.STAMP:return new qke(e);case Cs.FILEATTACHMENT:return new cUi(e);default:return new ws(e)}}}var Am,$I,eB,RL,NX;const K_i=class IRe{constructor(e,{isRenderable:i=!1,ignoreBorder:r=!1,createQuadrilaterals:o=!1}={}){ce(this,RL),ce(this,Am,null),ce(this,$I,!1),ce(this,eB,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 IRe._hasPopupData(this.data)}updateEdited(e){var i;if(!this.container)return;S(this,Am)||ie(this,Am,{rect:this.data.rect.slice(0)});const{rect:r}=e;r&&oe(this,RL,NX).call(this,r),(i=S(this,eB))==null||i.popup.updateEdited(e)}resetEdited(){var e;S(this,Am)&&(oe(this,RL,NX).call(this,S(this,Am).rect),(e=S(this,eB))==null||e.popup.resetEdited(),ie(this,Am,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 pm||(n.tabIndex=XI);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 OX){const{rotation:p}=i;return!i.hasOwnCanvas&&p!==0&&this.setRotation(p,n),n}const{width:a,height:l}=Bg(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 Uke){const v=`calc(${a}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`;s.borderRadius=v}switch(i.borderStyle.style){case rI.SOLID:s.borderStyle="solid";break;case rI.DASHED:s.borderStyle="dashed";break;case rI.BEVELED:or("Unimplemented border style: beveled");break;case rI.INSET:or("Unimplemented border style: inset");break;case rI.UNDERLINE:s.borderBottomStyle="solid";break}const f=i.borderColor||null;f?(ie(this,$I,!0),s.borderColor=bi.makeHexColor(f[0]|0,f[1]|0,f[2]|0)):s.borderWidth=0}const c=bi.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}=Bg(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]=Rke[`${s}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[r]:Rke[`${s}_rgb`](a)})};return pr(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(S(this,$I)){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],y=e[p+2],C=e[p+3],w=d.createElement("rect"),b=(y-i)/l,E=(n-v)/c,x=(f-y)/l,k=(v-C)/c;w.setAttribute("x",b),w.setAttribute("y",E),w.setAttribute("width",x),w.setAttribute("height",k),h.append(w),a?.push(`<rect vector-effect="non-scaling-stroke" x="${b}" y="${E}" width="${x}" height="${k}"/>`)}S(this,$I)&&(a.push("</g></svg>')"),s.backgroundImage=a.join("")),this.container.append(u),this.container.style.clipPath=`url(#${g})`}_createPopup(){const{data:e}=this,i=ie(this,eB,new OX({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(){Mo("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&&!um.has(c)){or(`_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&&um.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})})}};Am=new WeakMap,$I=new WeakMap,eB=new WeakMap,RL=new WeakSet,NX=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}=Bg(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 ws=K_i;var ch,hm,Tke,Fke;class _ke extends ws{constructor(e,i=null){super(e,{isRenderable:!0,ignoreBorder:!!(i!=null&&i.ignoreBorder),createQuadrilaterals:!0}),ce(this,ch),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?(oe(this,ch,Tke).call(this,r,e.attachment,e.attachmentDest),o=!0):e.setOCGState?(oe(this,ch,Fke).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==="")&&oe(this,ch,hm).call(this)}_bindNamedAction(e,i){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(i),!1),oe(this,ch,hm).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),oe(this,ch,hm).call(this)}_bindResetFormAction(e,i){const r=e.onclick;if(r||(e.href=this.linkService.getAnchorUrl("")),oe(this,ch,hm).call(this),!this._fieldObjects){or('_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(!um.has(h)){or(`_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}}}ch=new WeakSet,hm=function(){this.container.setAttribute("data-internal-link","")},Tke=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},oe(this,ch,hm).call(this)},Fke=function(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),oe(this,ch,hm).call(this)};class J_i extends ws{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 pm extends ws{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 xl.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":bi.makeHexColor(i[0],i[1],i[2])}_setTextStyle(e){const i=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,o=this.data.defaultAppearanceData.fontSize||z_i,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/(FZ*o))||1,u=c/d;s=Math.min(o,l(u/FZ))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-a);s=Math.min(o,l(c/FZ))}n.fontSize=`calc(${s}px * var(--scale-factor))`,n.color=bi.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 Y_i extends pm{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(`
5513
5513
  `))||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),um.add(n),n.setAttribute("data-element-id",o),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=XI,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 y=d.userValue;!y||y.length<=f||(y=y.slice(0,f),v.value=d.userValue=y,r.setValue(o,{value:y}),(m=this.linkService.eventBus)==null||m.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:y,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:y}=m;let C=v,w=y;switch(h.inputType){case"deleteWordBackward":{const b=f.substring(0,v).match(/\w*[^\w]*$/);b&&(C-=b[0].length);break}case"deleteWordForward":{const b=f.substring(v).match(/^[^\w]*\w*/);b&&(w+=b[0].length);break}case"deleteContentBackward":v===y&&(C-=1);break;case"deleteContentForward":v===y&&(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:C,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 W_i extends pm{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class Z_i extends pm{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 um.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=XI,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 Uke extends pm{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(um.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=XI,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 X_i extends _ke{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 $_i extends pm{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");um.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=XI;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 OX extends ws{constructor(e){const{data:i,elements:r}=e;super(e,{isRenderable:ws._hasPopupData(i)}),this.elements=r,this.popup=null}render(){this.container.classList.add("popupAnnotation");const e=this.popup=new eUi({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=>`${GZ}${r}`).join(",")),this.container}}var tB,HX,VX,iB,g6,Gn,Eg,rB,LL,TL,oB,xg,dh,kg,FL,Mg,_L,gm,f6,bs,UL,jX,Nke,Oke,Hke,Vke,NL,OL,GX;class eUi{constructor({container:e,color:i,elements:r,titleObj:o,modificationDate:n,contentsObj:s,richText:a,parent:l,rect:c,parentRect:d,open:u}){ce(this,bs),ce(this,tB,oe(this,bs,Hke).bind(this)),ce(this,HX,oe(this,bs,GX).bind(this)),ce(this,VX,oe(this,bs,OL).bind(this)),ce(this,iB,oe(this,bs,NL).bind(this)),ce(this,g6,null),ce(this,Gn,null),ce(this,Eg,null),ce(this,rB,null),ce(this,LL,null),ce(this,TL,null),ce(this,oB,null),ce(this,xg,!1),ce(this,dh,null),ce(this,kg,null),ce(this,FL,null),ce(this,Mg,null),ce(this,_L,null),ce(this,gm,null),ce(this,f6,!1);var A;ie(this,Gn,e),ie(this,_L,o),ie(this,Eg,s),ie(this,Mg,a),ie(this,TL,l),ie(this,g6,i),ie(this,FL,c),ie(this,oB,d),ie(this,LL,r),ie(this,rB,KZ.toDateObject(n)),this.trigger=r.flatMap(h=>h.getElementsToTriggerPopup());for(const h of this.trigger)h.addEventListener("click",S(this,iB)),h.addEventListener("mouseenter",S(this,VX)),h.addEventListener("mouseleave",S(this,HX)),h.classList.add("popupTriggerArea");for(const h of r)(A=h.container)==null||A.addEventListener("keydown",S(this,tB));S(this,Gn).hidden=!0,u&&oe(this,bs,NL).call(this)}render(){if(S(this,dh))return;const e=ie(this,dh,document.createElement("div"));if(e.className="popup",S(this,g6)){const n=e.style.outlineColor=bi.makeHexColor(...S(this,g6));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?e.style.backgroundColor=`color-mix(in srgb, ${n} 30%, white)`:e.style.backgroundColor=bi.makeHexColor(...S(this,g6).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}=S(this,_L),e.append(i),S(this,rB)){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:S(this,rB).valueOf()})),i.append(n)}const o=S(this,bs,UL);if(o)Lke.render({xfaHtml:o,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const n=this._formatContents(S(this,Eg));e.append(n)}S(this,Gn).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;S(this,gm)||ie(this,gm,{contentsObj:S(this,Eg),richText:S(this,Mg)}),e&&ie(this,kg,null),i&&(ie(this,Mg,oe(this,bs,Oke).call(this,i)),ie(this,Eg,null)),(r=S(this,dh))==null||r.remove(),ie(this,dh,null)}resetEdited(){var e;S(this,gm)&&({contentsObj:Ol(this,Eg)._,richText:Ol(this,Mg)._}=S(this,gm),ie(this,gm,null),(e=S(this,dh))==null||e.remove(),ie(this,dh,null),ie(this,kg,null))}forceHide(){ie(this,f6,this.isVisible),S(this,f6)&&(S(this,Gn).hidden=!0)}maybeShow(){S(this,f6)&&(S(this,dh)||oe(this,bs,OL).call(this),ie(this,f6,!1),S(this,Gn).hidden=!1)}get isVisible(){return S(this,Gn).hidden===!1}}tB=new WeakMap,HX=new WeakMap,VX=new WeakMap,iB=new WeakMap,g6=new WeakMap,Gn=new WeakMap,Eg=new WeakMap,rB=new WeakMap,LL=new WeakMap,TL=new WeakMap,oB=new WeakMap,xg=new WeakMap,dh=new WeakMap,kg=new WeakMap,FL=new WeakMap,Mg=new WeakMap,_L=new WeakMap,gm=new WeakMap,f6=new WeakMap,bs=new WeakSet,UL=function(){const t=S(this,Mg),e=S(this,Eg);return t!=null&&t.str&&(!(e!=null&&e.str)||e.str===t.str)&&S(this,Mg).html||null},jX=function(){var t,e,i;return((i=(e=(t=S(this,bs,UL))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.fontSize)||0},Nke=function(){var t,e,i;return((i=(e=(t=S(this,bs,UL))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.color)||null},Oke=function(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},r={style:{color:S(this,bs,Nke),fontSize:S(this,bs,jX)?`calc(${S(this,bs,jX)}px * var(--scale-factor))`:""}};for(const o of t.split(`