@zeniai/web-cockpit-ui 2.1.7-qa → 2.1.8-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/assets/{CreditAgentRoutes-C3szCTTE.js → CreditAgentRoutes-Dvse13EZ.js} +1 -1
  2. package/dist/assets/{Preview-bC9c_E6f.js → Preview-DBBP9r99.js} +1 -1
  3. package/dist/assets/{ScreenRoutes-DXOK_0fF.js → ScreenRoutes-BFmYZbdr.js} +3 -3
  4. package/dist/assets/{SignInScreen-CJujmJSu.js → SignInScreen-vUlTxjR_.js} +1 -1
  5. package/dist/assets/{analytics-CEFFFDe-.js → analytics-Cy_ddlAy.js} +1 -1
  6. package/dist/assets/{analyticsHelper-Cqxk-i_w.js → analyticsHelper-BVwhCBF2.js} +1 -1
  7. package/dist/assets/{core-CW4QtpSM.js → core-JOq4V17d.js} +1 -1
  8. package/dist/assets/{dash.all.min-CK5ugV6X.js → dash.all.min-DoyLTVt5.js} +1 -1
  9. package/dist/assets/{empty-uJGOQ04i.js → empty-BN27BaBf.js} +1 -1
  10. package/dist/assets/{empty-BtO5hDWn.js → empty-Bde-ejqA.js} +1 -1
  11. package/dist/assets/epic-cIogqHZr.js +2 -0
  12. package/dist/assets/{index-CFHFABuf.js → index-BeQtXS4B.js} +9 -9
  13. package/dist/assets/{index-DuGXVkoa.js → index-CA_htSJI.js} +1 -1
  14. package/dist/assets/{index-Co0tkgg1.js → index-DMqq1G7I.js} +1 -1
  15. package/dist/assets/{index-DmMlrXZ7.js → index-DgyFn3oa.js} +1 -1
  16. package/dist/assets/{index-8MC4NEb9.js → index-DwVLoI7i.js} +1 -1
  17. package/dist/assets/{index-DoD1kYk-.js → index-nuQ6WJZH.js} +2 -2
  18. package/dist/assets/{index-Cztz9BcG.js → index-pCOxDsRD.js} +1 -1
  19. package/dist/assets/{lexical-D6OuqZDu.js → lexical-gqfkJ4yd.js} +1 -1
  20. package/dist/assets/{liveblocks-Gs5m7sFu.js → liveblocks-D3BH9un_.js} +1 -1
  21. package/dist/assets/{lottie-N1M51rlZ.js → lottie-CXND4nkG.js} +1 -1
  22. package/dist/assets/{mui-BUuQeDcI.js → mui-rlLdPqp4.js} +1 -1
  23. package/dist/assets/{react-D4--plNh.js → react-BBUuCQlr.js} +1 -1
  24. package/dist/assets/{react-DaoIT90X.js → react-C3sWX2ZG.js} +1 -1
  25. package/dist/assets/{react-BlKq_esG.js → react-COPyUPwM.js} +1 -1
  26. package/dist/assets/{react-D5ZwIT-_.js → react-DEDFI7W-.js} +1 -1
  27. package/dist/assets/{react-CEsex43H.js → react-DGrZNHMi.js} +1 -1
  28. package/dist/assets/{react-B3DTXNtw.js → react-DObodVr2.js} +2 -2
  29. package/dist/assets/{react-0vJVgpzV.js → react-ZhciaXj-.js} +1 -1
  30. package/dist/assets/{react-CTc1q3KZ.js → react-sKFwdPhz.js} +1 -1
  31. package/dist/assets/{recharts-DkiadCxv.js → recharts-BVCeoCNo.js} +1 -1
  32. package/dist/assets/{sentry-Dcg8ucjJ.js → sentry-DpSyts5x.js} +1 -1
  33. package/dist/assets/{url-BD2R19fN.js → url-BE4qwGQm.js} +1 -1
  34. package/dist/assets/{url-BTTCUmrI.js → url-C9Fwu8i4.js} +1 -1
  35. package/dist/assets/{utils-CZSgvRy9.js → utils-NrwCaWzf.js} +1 -1
  36. package/dist/assets/{zeni-epic-state-BfB997ma.js → zeni-epic-state-DDBe5bD1.js} +3 -3
  37. package/dist/index.html +1 -1
  38. package/package.json +3 -3
  39. package/dist/assets/epic-k48p6ONn.js +0 -2
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/empty-uJGOQ04i.js","assets/sentry-Dcg8ucjJ.js","assets/empty-BtO5hDWn.js","assets/index-DmMlrXZ7.js","assets/index-Co0tkgg1.js","assets/zeni-epic-state-BfB997ma.js","assets/core-CW4QtpSM.js","assets/utils-CZSgvRy9.js","assets/recharts-DkiadCxv.js","assets/url-BD2R19fN.js","assets/index-8MC4NEb9.js","assets/index-Cztz9BcG.js","assets/url-BTTCUmrI.js","assets/index-DoD1kYk-.js","assets/ScreenRoutes-DXOK_0fF.js","assets/liveblocks-Gs5m7sFu.js","assets/analyticsHelper-Cqxk-i_w.js","assets/mui-BUuQeDcI.js","assets/SignInScreen-CJujmJSu.js","assets/analytics-CEFFFDe-.js","assets/lottie-N1M51rlZ.js","assets/lexical-D6OuqZDu.js"])))=>i.map(i=>d[i]);
2
- import{a as g,b as $,R as kHe,c as T4,p as Jh,r as bd,g as DW,e as NJ,f as SHe,s as HJ,w as EHe,i as LHe,S as jHe,j as IHe,k as MHe,l as BHe,m as PHe}from"./sentry-Dcg8ucjJ.js";import{j as wo,_ as g9e,a as rc,u as f9e,T as DHe,C as THe,b as zHe,c as qE,d as ZE,e as RHe,f as x9e,g as FHe,h as OHe,L as NHe,i as _J,k as HHe,l as _He,P as VHe,m as QHe,n as UHe,o as y9e,p as WHe,q as GHe,I as VJ,r as YHe,s as KHe,t as qHe,v as ZHe,w as JHe,x as XHe,y as w9e,z as e_e,A as t_e,B as o_e}from"./liveblocks-Gs5m7sFu.js";import{f as b9e,R as i4,r as _n,P as $n,u as JE,g as Vu,h as r_e,i as TW,j as i_e,k as n_e,l as OB,N as a_e,m as s_e,n as l_e,B as d_e}from"./core-CW4QtpSM.js";import{H as uk,ba as n4,bb as c_e,bc as QJ,bd as tf,be as Gr,bf as v9e,bg as XE,bh as zr,bi as p_e,bj as j0,bk as u_e,bl as h_e,bm as s6,bn as Sm,bo as zW,bp as C9e,bq as m_e,br as E1,bs as g_e,bt as RW,bu as A9e,bv as Ki,bw as l6,bx as wu,by as f_e,bz as x_e,bA as y_e,bB as $9e,bC as R_,bD as w_e,bE as b_e,bF as v_e,bG as C_e,bH as FW,bI as k9e,bJ as A_e,bK as S9e,bL as F_,bM as UJ,bN as WJ,bO as GJ,bP as Al,bQ as OW,bR as NW,bS as Z6,bT as HW,bU as _W,bV as VW,bW as QW,bX as $_e,bY as hk,bZ as k_e,b_ as E9e,b$ as UW,c0 as S_e,c1 as y0,c2 as qw,c3 as Zw,c4 as E_e,c5 as L_e,c6 as j_e,c7 as I_e,c8 as M_e,c9 as B_e,ca as P_e,cb as Mv,cc as D_e,cd as T_e,ce as z_e,cf as R_e,cg as F_e,ch as O_e,ci as N_e,cj as H_e,ck as __e,cl as V_e,cm as Q_e,cn as U_e,co as W_e,cp as G_e,cq as L9e,cr as Y_e,cs as YJ,ct as K_e,cu as q_e,cv as Yy,cw as j9e,cx as Z_e,cy as I9e,cz as WW,cA as J_e,cB as KJ,cC as X_e,cD as qJ,cE as M9e,cF as B9e,cG as P9e,cH as D9e,cI as T9e,cJ as eVe,cK as z9e,cL as tVe,cM as oVe,cN as rVe,cO as R9e,cP as O_,cQ as iVe,cR as F9e,cS as O9e,cT as nVe,cU as aVe,cV as sVe,cW as lVe,cX as dVe,cY as cVe,cZ as pVe,c_ as uVe,v as hVe,c$ as eL,d0 as N_,d1 as H_,d2 as mVe,d3 as gVe,d4 as fVe,d5 as xVe,d6 as yVe,d7 as wVe,d8 as bVe,d9 as vVe,da as CVe,db as AVe,dc as ZJ,dd as $Ve,de as kVe,df as SVe,dg as EVe,dh as LVe}from"./zeni-epic-state-BfB997ma.js";import{T as N9e,j as Ro,n,c as ue,k as Nt,G as Jw,C as H9e,u as _9e,a as jVe}from"./mui-BUuQeDcI.js";import{r as IVe,m as bu}from"./analytics-CEFFFDe-.js";import{L as __}from"./lottie-N1M51rlZ.js";import{r as ya}from"./lexical-D6OuqZDu.js";import{E as Hi,c as tL,P as MVe,R as V_,F as mk,X as Zd,Y as Jd,G as N0,H as gk,I as oL,J as H0,K as V9e,L as BVe,M as PVe,N as of,O as GW,Q as YW,S as Xw,U as DVe}from"./recharts-DkiadCxv.js";import{r as TVe}from"./utils-CZSgvRy9.js";(function(){try{var e=typeof window<"u"?window:typeof T4<"u"?T4:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2c2cdd3d-3771-4113-b8cb-e0378c6daaad",e._sentryDebugIdIdentifier="sentry-dbid-2c2cdd3d-3771-4113-b8cb-e0378c6daaad")}catch{}})();(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function o(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(a){if(a.ep)return;a.ep=!0;const l=o(a);fetch(a.href,l)}})();var Bv={},JJ;function zVe(){if(JJ)return Bv;JJ=1;var e=b9e();return Bv.createRoot=e.createRoot,Bv.hydrateRoot=e.hydrateRoot,Bv}var RVe=zVe(),ad=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof T4<"u"?T4:typeof self<"u"?self:{};function Dr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var XJ={exports:{}},J8={},eX;function FVe(){if(eX)return J8;eX=1;var e=$,t=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function d(c,p,u){var h,m={},f=null,x=null;u!==void 0&&(f=""+u),p.key!==void 0&&(f=""+p.key),p.ref!==void 0&&(x=p.ref);for(h in p)i.call(p,h)&&!l.hasOwnProperty(h)&&(m[h]=p[h]);if(c&&c.defaultProps)for(h in p=c.defaultProps,p)m[h]===void 0&&(m[h]=p[h]);return{$$typeof:t,type:c,key:f,ref:x,props:m,_owner:a.current}}return J8.Fragment=o,J8.jsx=d,J8.jsxs=d,J8}var tX;function Q9e(){return tX||(tX=1,XJ.exports=FVe()),XJ.exports}var s=Q9e();const OVe=g.createContext(null),NB={didCatch:!1,error:null};let NVe=class extends g.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=NB}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var t,o,i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];(t=(o=this.props).onReset)===null||t===void 0||t.call(o,{args:a,reason:"imperative-api"}),this.setState(NB)}}componentDidCatch(e,t){var o,i;(o=(i=this.props).onError)===null||o===void 0||o.call(i,e,t)}componentDidUpdate(e,t){const{didCatch:o}=this.state,{resetKeys:i}=this.props;if(o&&t.error!==null&&HVe(e.resetKeys,i)){var a,l;(a=(l=this.props).onReset)===null||a===void 0||a.call(l,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(NB)}}render(){const{children:e,fallbackRender:t,FallbackComponent:o,fallback:i}=this.props,{didCatch:a,error:l}=this.state;let d=e;if(a){const c={error:l,resetErrorBoundary:this.resetErrorBoundary};if(typeof t=="function")d=t(c);else if(o)d=g.createElement(o,c);else if(i!==void 0)d=i;else throw l}return g.createElement(OVe.Provider,{value:{didCatch:a,error:l,resetErrorBoundary:this.resetErrorBoundary}},d)}};function HVe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((o,i)=>!Object.is(o,t[i]))}var Q_={exports:{}},_Ve=Q_.exports,oX;function VVe(){return oX||(oX=1,(function(e){(function(t,o){e.exports?e.exports=o():t.numeral=o()})(_Ve,function(){var t,o,i="2.0.6",a={},l={},d={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},c={currentLocale:d.currentLocale,zeroFormat:d.zeroFormat,nullFormat:d.nullFormat,defaultFormat:d.defaultFormat,scalePercentBy100:d.scalePercentBy100};function p(u,h){this._input=u,this._value=h}return t=function(u){var h,m,f,x;if(t.isNumeral(u))h=u.value();else if(u===0||typeof u>"u")h=0;else if(u===null||o.isNaN(u))h=null;else if(typeof u=="string")if(c.zeroFormat&&u===c.zeroFormat)h=0;else if(c.nullFormat&&u===c.nullFormat||!u.replace(/[^0-9]+/g,"").length)h=null;else{for(m in a)if(x=typeof a[m].regexps.unformat=="function"?a[m].regexps.unformat():a[m].regexps.unformat,x&&u.match(x)){f=a[m].unformat;break}f=f||t._.stringToNumber,h=f(u)}else h=Number(u)||null;return new p(u,h)},t.version=i,t.isNumeral=function(u){return u instanceof p},t._=o={numberToFormat:function(u,h,m){var f=l[t.options.currentLocale],x=!1,y=!1,w=0,b="",v=1e12,A=1e9,S=1e6,E=1e3,I="",L=!1,B,P,D,T,O,F,Y;if(u=u||0,P=Math.abs(u),t._.includes(h,"(")?(x=!0,h=h.replace(/[\(|\)]/g,"")):(t._.includes(h,"+")||t._.includes(h,"-"))&&(O=t._.includes(h,"+")?h.indexOf("+"):u<0?h.indexOf("-"):-1,h=h.replace(/[\+|\-]/g,"")),t._.includes(h,"a")&&(B=h.match(/a(k|m|b|t)?/),B=B?B[1]:!1,t._.includes(h," a")&&(b=" "),h=h.replace(new RegExp(b+"a[kmbt]?"),""),P>=v&&!B||B==="t"?(b+=f.abbreviations.trillion,u=u/v):P<v&&P>=A&&!B||B==="b"?(b+=f.abbreviations.billion,u=u/A):P<A&&P>=S&&!B||B==="m"?(b+=f.abbreviations.million,u=u/S):(P<S&&P>=E&&!B||B==="k")&&(b+=f.abbreviations.thousand,u=u/E)),t._.includes(h,"[.]")&&(y=!0,h=h.replace("[.]",".")),D=u.toString().split(".")[0],T=h.split(".")[1],F=h.indexOf(","),w=(h.split(".")[0].split(",")[0].match(/0/g)||[]).length,T?(t._.includes(T,"[")?(T=T.replace("]",""),T=T.split("["),I=t._.toFixed(u,T[0].length+T[1].length,m,T[1].length)):I=t._.toFixed(u,T.length,m),D=I.split(".")[0],t._.includes(I,".")?I=f.delimiters.decimal+I.split(".")[1]:I="",y&&Number(I.slice(1))===0&&(I="")):D=t._.toFixed(u,0,m),b&&!B&&Number(D)>=1e3&&b!==f.abbreviations.trillion)switch(D=String(Number(D)/1e3),b){case f.abbreviations.thousand:b=f.abbreviations.million;break;case f.abbreviations.million:b=f.abbreviations.billion;break;case f.abbreviations.billion:b=f.abbreviations.trillion;break}if(t._.includes(D,"-")&&(D=D.slice(1),L=!0),D.length<w)for(var Z=w-D.length;Z>0;Z--)D="0"+D;return F>-1&&(D=D.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),h.indexOf(".")===0&&(D=""),Y=D+I+(b||""),x?Y=(x&&L?"(":"")+Y+(x&&L?")":""):O>=0?Y=O===0?(L?"-":"+")+Y:Y+(L?"-":"+"):L&&(Y="-"+Y),Y},stringToNumber:function(u){var h=l[c.currentLocale],m=u,f={thousand:3,million:6,billion:9,trillion:12},x,y,w;if(c.zeroFormat&&u===c.zeroFormat)y=0;else if(c.nullFormat&&u===c.nullFormat||!u.replace(/[^0-9]+/g,"").length)y=null;else{y=1,h.delimiters.decimal!=="."&&(u=u.replace(/\./g,"").replace(h.delimiters.decimal,"."));for(x in f)if(w=new RegExp("[^a-zA-Z]"+h.abbreviations[x]+"(?:\\)|(\\"+h.currency.symbol+")?(?:\\))?)?$"),m.match(w)){y*=Math.pow(10,f[x]);break}y*=(u.split("-").length+Math.min(u.split("(").length-1,u.split(")").length-1))%2?1:-1,u=u.replace(/[^0-9\.]+/g,""),y*=Number(u)}return y},isNaN:function(u){return typeof u=="number"&&isNaN(u)},includes:function(u,h){return u.indexOf(h)!==-1},insert:function(u,h,m){return u.slice(0,m)+h+u.slice(m)},reduce:function(u,h){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof h!="function")throw new TypeError(h+" is not a function");var m=Object(u),f=m.length>>>0,x=0,y;if(arguments.length===3)y=arguments[2];else{for(;x<f&&!(x in m);)x++;if(x>=f)throw new TypeError("Reduce of empty array with no initial value");y=m[x++]}for(;x<f;x++)x in m&&(y=h(y,m[x],x,m));return y},multiplier:function(u){var h=u.toString().split(".");return h.length<2?1:Math.pow(10,h[1].length)},correctionFactor:function(){var u=Array.prototype.slice.call(arguments);return u.reduce(function(h,m){var f=o.multiplier(m);return h>f?h:f},1)},toFixed:function(u,h,m,f){var x=u.toString().split("."),y=h-(f||0),w,b,v,A;return x.length===2?w=Math.min(Math.max(x[1].length,y),h):w=y,v=Math.pow(10,w),A=(m(u+"e+"+w)/v).toFixed(w),f>h-w&&(b=new RegExp("\\.?0{1,"+(f-(h-w))+"}$"),A=A.replace(b,"")),A}},t.options=c,t.formats=a,t.locales=l,t.locale=function(u){return u&&(c.currentLocale=u.toLowerCase()),c.currentLocale},t.localeData=function(u){if(!u)return l[c.currentLocale];if(u=u.toLowerCase(),!l[u])throw new Error("Unknown locale : "+u);return l[u]},t.reset=function(){for(var u in d)c[u]=d[u]},t.zeroFormat=function(u){c.zeroFormat=typeof u=="string"?u:null},t.nullFormat=function(u){c.nullFormat=typeof u=="string"?u:null},t.defaultFormat=function(u){c.defaultFormat=typeof u=="string"?u:"0.0"},t.register=function(u,h,m){if(h=h.toLowerCase(),this[u+"s"][h])throw new TypeError(h+" "+u+" already registered.");return this[u+"s"][h]=m,m},t.validate=function(u,h){var m,f,x,y,w,b,v,A;if(typeof u!="string"&&(u+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",u)),u=u.trim(),u.match(/^\d+$/))return!0;if(u==="")return!1;try{v=t.localeData(h)}catch{v=t.localeData(t.locale())}return x=v.currency.symbol,w=v.abbreviations,m=v.delimiters.decimal,v.delimiters.thousands==="."?f="\\.":f=v.delimiters.thousands,A=u.match(/^[^\d]+/),A!==null&&(u=u.substr(1),A[0]!==x)||(A=u.match(/[^\d]+$/),A!==null&&(u=u.slice(0,-1),A[0]!==w.thousand&&A[0]!==w.million&&A[0]!==w.billion&&A[0]!==w.trillion))?!1:(b=new RegExp(f+"{2}"),u.match(/[^\d.,]/g)?!1:(y=u.split(m),y.length>2?!1:y.length<2?!!y[0].match(/^\d+.*\d$/)&&!y[0].match(b):y[0].length===1?!!y[0].match(/^\d+$/)&&!y[0].match(b)&&!!y[1].match(/^\d+$/):!!y[0].match(/^\d+.*\d$/)&&!y[0].match(b)&&!!y[1].match(/^\d+$/)))},t.fn=p.prototype={clone:function(){return t(this)},format:function(u,h){var m=this._value,f=u||c.defaultFormat,x,y,w;if(h=h||Math.round,m===0&&c.zeroFormat!==null)y=c.zeroFormat;else if(m===null&&c.nullFormat!==null)y=c.nullFormat;else{for(x in a)if(f.match(a[x].regexps.format)){w=a[x].format;break}w=w||t._.numberToFormat,y=w(m,f,h)}return y},value:function(){return this._value},input:function(){return this._input},set:function(u){return this._value=Number(u),this},add:function(u){var h=o.correctionFactor.call(null,this._value,u);function m(f,x,y,w){return f+Math.round(h*x)}return this._value=o.reduce([this._value,u],m,0)/h,this},subtract:function(u){var h=o.correctionFactor.call(null,this._value,u);function m(f,x,y,w){return f-Math.round(h*x)}return this._value=o.reduce([u],m,Math.round(this._value*h))/h,this},multiply:function(u){function h(m,f,x,y){var w=o.correctionFactor(m,f);return Math.round(m*w)*Math.round(f*w)/Math.round(w*w)}return this._value=o.reduce([this._value,u],h,1),this},divide:function(u){function h(m,f,x,y){var w=o.correctionFactor(m,f);return Math.round(m*w)/Math.round(f*w)}return this._value=o.reduce([this._value,u],h),this},difference:function(u){return Math.abs(t(this._value).subtract(u).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(u){var h=u%10;return~~(u%100/10)===1?"th":h===1?"st":h===2?"nd":h===3?"rd":"th"},currency:{symbol:"$"}}),(function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(u,h,m){var f=t._.includes(h," BPS")?" ":"",x;return u=u*1e4,h=h.replace(/\s?BPS/,""),x=t._.numberToFormat(u,h,m),t._.includes(x,")")?(x=x.split(""),x.splice(-1,0,f+"BPS"),x=x.join("")):x=x+f+"BPS",x},unformat:function(u){return+(t._.stringToNumber(u)*1e-4).toFixed(15)}})})(),(function(){var u={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},h={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},m=u.suffixes.concat(h.suffixes.filter(function(x){return u.suffixes.indexOf(x)<0})),f=m.join("|");f="("+f.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(x,y,w){var b,v=t._.includes(y,"ib")?h:u,A=t._.includes(y," b")||t._.includes(y," ib")?" ":"",S,E,I;for(y=y.replace(/\s?i?b/,""),S=0;S<=v.suffixes.length;S++)if(E=Math.pow(v.base,S),I=Math.pow(v.base,S+1),x===null||x===0||x>=E&&x<I){A+=v.suffixes[S],E>0&&(x=x/E);break}return b=t._.numberToFormat(x,y,w),b+A},unformat:function(x){var y=t._.stringToNumber(x),w,b;if(y){for(w=u.suffixes.length-1;w>=0;w--){if(t._.includes(x,u.suffixes[w])){b=Math.pow(u.base,w);break}if(t._.includes(x,h.suffixes[w])){b=Math.pow(h.base,w);break}}y*=b||1}return y}})})(),(function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(u,h,m){var f=t.locales[t.options.currentLocale],x={before:h.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:h.match(/([\+|\-|\)|\s|\$]*)$/)[0]},y,w,b;for(h=h.replace(/\s?\$\s?/,""),y=t._.numberToFormat(u,h,m),u>=0?(x.before=x.before.replace(/[\-\(]/,""),x.after=x.after.replace(/[\-\)]/,"")):u<0&&!t._.includes(x.before,"-")&&!t._.includes(x.before,"(")&&(x.before="-"+x.before),b=0;b<x.before.length;b++)switch(w=x.before[b],w){case"$":y=t._.insert(y,f.currency.symbol,b);break;case" ":y=t._.insert(y," ",b+f.currency.symbol.length-1);break}for(b=x.after.length-1;b>=0;b--)switch(w=x.after[b],w){case"$":y=b===x.after.length-1?y+f.currency.symbol:t._.insert(y,f.currency.symbol,-(x.after.length-(1+b)));break;case" ":y=b===x.after.length-1?y+" ":t._.insert(y," ",-(x.after.length-(1+b)+f.currency.symbol.length-1));break}return y}})})(),(function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(u,h,m){var f,x=typeof u=="number"&&!t._.isNaN(u)?u.toExponential():"0e+0",y=x.split("e");return h=h.replace(/e[\+|\-]{1}0/,""),f=t._.numberToFormat(Number(y[0]),h,m),f+"e"+y[1]},unformat:function(u){var h=t._.includes(u,"e+")?u.split("e+"):u.split("e-"),m=Number(h[0]),f=Number(h[1]);f=t._.includes(u,"e-")?f*=-1:f;function x(y,w,b,v){var A=t._.correctionFactor(y,w),S=y*A*(w*A)/(A*A);return S}return t._.reduce([m,Math.pow(10,f)],x,1)}})})(),(function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(u,h,m){var f=t.locales[t.options.currentLocale],x,y=t._.includes(h," o")?" ":"";return h=h.replace(/\s?o/,""),y+=f.ordinal(u),x=t._.numberToFormat(u,h,m),x+y}})})(),(function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(u,h,m){var f=t._.includes(h," %")?" ":"",x;return t.options.scalePercentBy100&&(u=u*100),h=h.replace(/\s?\%/,""),x=t._.numberToFormat(u,h,m),t._.includes(x,")")?(x=x.split(""),x.splice(-1,0,f+"%"),x=x.join("")):x=x+f+"%",x},unformat:function(u){var h=t._.stringToNumber(u);return t.options.scalePercentBy100?h*.01:h}})})(),(function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(u,h,m){var f=Math.floor(u/60/60),x=Math.floor((u-f*60*60)/60),y=Math.round(u-f*60*60-x*60);return f+":"+(x<10?"0"+x:x)+":"+(y<10?"0"+y:y)},unformat:function(u){var h=u.split(":"),m=0;return h.length===3?(m=m+Number(h[0])*60*60,m=m+Number(h[1])*60,m=m+Number(h[2])):h.length===2&&(m=m+Number(h[0])*60,m=m+Number(h[1])),Number(m)}})})(),t})})(Q_)),Q_.exports}var QVe=VVe();const A0=Dr(QVe);function I0(e,...t){const o=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(i=>o.searchParams.append("args[]",i)),`Minified MUI error #${e}; visit ${o} for the full message.`}const $0="$$material";function UVe(e){for(var t=0,o,i=0,a=e.length;a>=4;++i,a-=4)o=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,o=(o&65535)*1540483477+((o>>>16)*59797<<16),o^=o>>>24,t=(o&65535)*1540483477+((o>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(i+2)&255)<<16;case 2:t^=(e.charCodeAt(i+1)&255)<<8;case 1:t^=e.charCodeAt(i)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var WVe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function GVe(e){var t=Object.create(null);return function(o){return t[o]===void 0&&(t[o]=e(o)),t[o]}}var YVe=/[A-Z]|^ms/g,KVe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,U9e=function(e){return e.charCodeAt(1)===45},rX=function(e){return e!=null&&typeof e!="boolean"},HB=GVe(function(e){return U9e(e)?e:e.replace(YVe,"-$&").toLowerCase()}),iX=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(KVe,function(o,i,a){return J2={name:i,styles:a,next:J2},i})}return WVe[e]!==1&&!U9e(e)&&typeof t=="number"&&t!==0?t+"px":t};function fk(e,t,o){if(o==null)return"";var i=o;if(i.__emotion_styles!==void 0)return i;switch(typeof o){case"boolean":return"";case"object":{var a=o;if(a.anim===1)return J2={name:a.name,styles:a.styles,next:J2},a.name;var l=o;if(l.styles!==void 0){var d=l.next;if(d!==void 0)for(;d!==void 0;)J2={name:d.name,styles:d.styles,next:J2},d=d.next;var c=l.styles+";";return c}return qVe(e,t,o)}}var p=o;return p}function qVe(e,t,o){var i="";if(Array.isArray(o))for(var a=0;a<o.length;a++)i+=fk(e,t,o[a])+";";else for(var l in o){var d=o[l];if(typeof d!="object"){var c=d;rX(c)&&(i+=HB(l)+":"+iX(l,c)+";")}else if(Array.isArray(d)&&typeof d[0]=="string"&&t==null)for(var p=0;p<d.length;p++)rX(d[p])&&(i+=HB(l)+":"+iX(l,d[p])+";");else{var u=fk(e,t,d);switch(l){case"animation":case"animationName":{i+=HB(l)+":"+u+";";break}default:i+=l+"{"+u+"}"}}}return i}var nX=/label:\s*([^\s;{]+)\s*(;|$)/g,J2;function ZVe(e,t,o){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var i=!0,a="";J2=void 0;var l=e[0];if(l==null||l.raw===void 0)i=!1,a+=fk(o,t,l);else{var d=l;a+=d[0]}for(var c=1;c<e.length;c++)if(a+=fk(o,t,e[c]),i){var p=l;a+=p[c]}nX.lastIndex=0;for(var u="",h;(h=nX.exec(a))!==null;)u+="-"+h[1];var m=UVe(a)+u;return{name:m,styles:a,next:J2}}var _B={exports:{}},VB,aX;function JVe(){if(aX)return VB;aX=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return VB=e,VB}var QB,sX;function XVe(){if(sX)return QB;sX=1;var e=JVe();function t(){}function o(){}return o.resetWarningCache=t,QB=function(){function i(d,c,p,u,h,m){if(m!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}i.isRequired=i;function a(){return i}var l={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:o,resetWarningCache:t};return l.PropTypes=l,l},QB}var lX;function KW(){return lX||(lX=1,_B.exports=XVe()()),_B.exports}var eQe=KW();const Rt=Dr(eQe);function tQe(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function oQe(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var rQe=(function(){function e(o){var i=this;this._insertTag=function(a){var l;i.tags.length===0?i.insertionPoint?l=i.insertionPoint.nextSibling:i.prepend?l=i.container.firstChild:l=i.before:l=i.tags[i.tags.length-1].nextSibling,i.container.insertBefore(a,l),i.tags.push(a)},this.isSpeedy=o.speedy===void 0?!0:o.speedy,this.tags=[],this.ctr=0,this.nonce=o.nonce,this.key=o.key,this.container=o.container,this.prepend=o.prepend,this.insertionPoint=o.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(o){o.forEach(this._insertTag)},t.insert=function(o){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(oQe(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=tQe(i);try{a.insertRule(o,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(o));this.ctr++},t.flush=function(){this.tags.forEach(function(o){var i;return(i=o.parentNode)==null?void 0:i.removeChild(o)}),this.tags=[],this.ctr=0},e})(),Hs="-ms-",xk="-moz-",gi="-webkit-",W9e="comm",qW="rule",ZW="decl",iQe="@import",G9e="@keyframes",nQe="@layer",aQe=Math.abs,rL=String.fromCharCode,sQe=Object.assign;function lQe(e,t){return ws(e,0)^45?(((t<<2^ws(e,0))<<2^ws(e,1))<<2^ws(e,2))<<2^ws(e,3):0}function Y9e(e){return e.trim()}function dQe(e,t){return(e=t.exec(e))?e[0]:e}function fi(e,t,o){return e.replace(t,o)}function U_(e,t){return e.indexOf(t)}function ws(e,t){return e.charCodeAt(t)|0}function Ky(e,t,o){return e.slice(t,o)}function vu(e){return e.length}function JW(e){return e.length}function Pv(e,t){return t.push(e),e}function cQe(e,t){return e.map(t).join("")}var iL=1,d6=1,K9e=0,gd=0,ma=0,J6="";function nL(e,t,o,i,a,l,d){return{value:e,root:t,parent:o,type:i,props:a,children:l,line:iL,column:d6,length:d,return:""}}function X8(e,t){return sQe(nL("",null,null,"",null,null,0),e,{length:-e.length},t)}function pQe(){return ma}function uQe(){return ma=gd>0?ws(J6,--gd):0,d6--,ma===10&&(d6=1,iL--),ma}function Gd(){return ma=gd<K9e?ws(J6,gd++):0,d6++,ma===10&&(d6=1,iL++),ma}function qu(){return ws(J6,gd)}function M$(){return gd}function eb(e,t){return Ky(J6,e,t)}function qy(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function q9e(e){return iL=d6=1,K9e=vu(J6=e),gd=0,[]}function Z9e(e){return J6="",e}function B$(e){return Y9e(eb(gd-1,W_(e===91?e+2:e===40?e+1:e)))}function hQe(e){for(;(ma=qu())&&ma<33;)Gd();return qy(e)>2||qy(ma)>3?"":" "}function mQe(e,t){for(;--t&&Gd()&&!(ma<48||ma>102||ma>57&&ma<65||ma>70&&ma<97););return eb(e,M$()+(t<6&&qu()==32&&Gd()==32))}function W_(e){for(;Gd();)switch(ma){case e:return gd;case 34:case 39:e!==34&&e!==39&&W_(ma);break;case 40:e===41&&W_(e);break;case 92:Gd();break}return gd}function gQe(e,t){for(;Gd()&&e+ma!==57&&!(e+ma===84&&qu()===47););return"/*"+eb(t,gd-1)+"*"+rL(e===47?e:Gd())}function fQe(e){for(;!qy(qu());)Gd();return eb(e,gd)}function xQe(e){return Z9e(P$("",null,null,null,[""],e=q9e(e),0,[0],e))}function P$(e,t,o,i,a,l,d,c,p){for(var u=0,h=0,m=d,f=0,x=0,y=0,w=1,b=1,v=1,A=0,S="",E=a,I=l,L=i,B=S;b;)switch(y=A,A=Gd()){case 40:if(y!=108&&ws(B,m-1)==58){U_(B+=fi(B$(A),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:B+=B$(A);break;case 9:case 10:case 13:case 32:B+=hQe(y);break;case 92:B+=mQe(M$()-1,7);continue;case 47:switch(qu()){case 42:case 47:Pv(yQe(gQe(Gd(),M$()),t,o),p);break;default:B+="/"}break;case 123*w:c[u++]=vu(B)*v;case 125*w:case 59:case 0:switch(A){case 0:case 125:b=0;case 59+h:v==-1&&(B=fi(B,/\f/g,"")),x>0&&vu(B)-m&&Pv(x>32?cX(B+";",i,o,m-1):cX(fi(B," ","")+";",i,o,m-2),p);break;case 59:B+=";";default:if(Pv(L=dX(B,t,o,u,h,a,c,S,E=[],I=[],m),l),A===123)if(h===0)P$(B,t,L,L,E,l,m,c,I);else switch(f===99&&ws(B,3)===110?100:f){case 100:case 108:case 109:case 115:P$(e,L,L,i&&Pv(dX(e,L,L,0,0,a,c,S,a,E=[],m),I),a,I,m,c,i?E:I);break;default:P$(B,L,L,L,[""],I,0,c,I)}}u=h=x=0,w=v=1,S=B="",m=d;break;case 58:m=1+vu(B),x=y;default:if(w<1){if(A==123)--w;else if(A==125&&w++==0&&uQe()==125)continue}switch(B+=rL(A),A*w){case 38:v=h>0?1:(B+="\f",-1);break;case 44:c[u++]=(vu(B)-1)*v,v=1;break;case 64:qu()===45&&(B+=B$(Gd())),f=qu(),h=m=vu(S=B+=fQe(M$())),A++;break;case 45:y===45&&vu(B)==2&&(w=0)}}return l}function dX(e,t,o,i,a,l,d,c,p,u,h){for(var m=a-1,f=a===0?l:[""],x=JW(f),y=0,w=0,b=0;y<i;++y)for(var v=0,A=Ky(e,m+1,m=aQe(w=d[y])),S=e;v<x;++v)(S=Y9e(w>0?f[v]+" "+A:fi(A,/&\f/g,f[v])))&&(p[b++]=S);return nL(e,t,o,a===0?qW:c,p,u,h)}function yQe(e,t,o){return nL(e,t,o,W9e,rL(pQe()),Ky(e,2,-2),0)}function cX(e,t,o,i){return nL(e,t,o,ZW,Ky(e,0,i),Ky(e,i+1,-1),i)}function O7(e,t){for(var o="",i=JW(e),a=0;a<i;a++)o+=t(e[a],a,e,t)||"";return o}function wQe(e,t,o,i){switch(e.type){case nQe:if(e.children.length)break;case iQe:case ZW:return e.return=e.return||e.value;case W9e:return"";case G9e:return e.return=e.value+"{"+O7(e.children,i)+"}";case qW:e.value=e.props.join(",")}return vu(o=O7(e.children,i))?e.return=e.value+"{"+o+"}":""}function bQe(e){var t=JW(e);return function(o,i,a,l){for(var d="",c=0;c<t;c++)d+=e[c](o,i,a,l)||"";return d}}function vQe(e){return function(t){t.root||(t=t.return)&&e(t)}}var CQe=function(e,t,o){for(var i=0,a=0;i=a,a=qu(),i===38&&a===12&&(t[o]=1),!qy(a);)Gd();return eb(e,gd)},AQe=function(e,t){var o=-1,i=44;do switch(qy(i)){case 0:i===38&&qu()===12&&(t[o]=1),e[o]+=CQe(gd-1,t,o);break;case 2:e[o]+=B$(i);break;case 4:if(i===44){e[++o]=qu()===58?"&\f":"",t[o]=e[o].length;break}default:e[o]+=rL(i)}while(i=Gd());return e},$Qe=function(e,t){return Z9e(AQe(q9e(e),t))},pX=new WeakMap,kQe=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,o=e.parent,i=e.column===o.column&&e.line===o.line;o.type!=="rule";)if(o=o.parent,!o)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!pX.get(o))&&!i){pX.set(e,!0);for(var a=[],l=$Qe(t,a),d=o.props,c=0,p=0;c<l.length;c++)for(var u=0;u<d.length;u++,p++)e.props[p]=a[c]?l[c].replace(/&\f/g,d[u]):d[u]+" "+l[c]}}},SQe=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function J9e(e,t){switch(lQe(e,t)){case 5103:return gi+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return gi+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return gi+e+xk+e+Hs+e+e;case 6828:case 4268:return gi+e+Hs+e+e;case 6165:return gi+e+Hs+"flex-"+e+e;case 5187:return gi+e+fi(e,/(\w+).+(:[^]+)/,gi+"box-$1$2"+Hs+"flex-$1$2")+e;case 5443:return gi+e+Hs+"flex-item-"+fi(e,/flex-|-self/,"")+e;case 4675:return gi+e+Hs+"flex-line-pack"+fi(e,/align-content|flex-|-self/,"")+e;case 5548:return gi+e+Hs+fi(e,"shrink","negative")+e;case 5292:return gi+e+Hs+fi(e,"basis","preferred-size")+e;case 6060:return gi+"box-"+fi(e,"-grow","")+gi+e+Hs+fi(e,"grow","positive")+e;case 4554:return gi+fi(e,/([^-])(transform)/g,"$1"+gi+"$2")+e;case 6187:return fi(fi(fi(e,/(zoom-|grab)/,gi+"$1"),/(image-set)/,gi+"$1"),e,"")+e;case 5495:case 3959:return fi(e,/(image-set\([^]*)/,gi+"$1$`$1");case 4968:return fi(fi(e,/(.+:)(flex-)?(.*)/,gi+"box-pack:$3"+Hs+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+gi+e+e;case 4095:case 3583:case 4068:case 2532:return fi(e,/(.+)-inline(.+)/,gi+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(vu(e)-1-t>6)switch(ws(e,t+1)){case 109:if(ws(e,t+4)!==45)break;case 102:return fi(e,/(.+:)(.+)-([^]+)/,"$1"+gi+"$2-$3$1"+xk+(ws(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~U_(e,"stretch")?J9e(fi(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(ws(e,t+1)!==115)break;case 6444:switch(ws(e,vu(e)-3-(~U_(e,"!important")&&10))){case 107:return fi(e,":",":"+gi)+e;case 101:return fi(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+gi+(ws(e,14)===45?"inline-":"")+"box$3$1"+gi+"$2$3$1"+Hs+"$2box$3")+e}break;case 5936:switch(ws(e,t+11)){case 114:return gi+e+Hs+fi(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return gi+e+Hs+fi(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return gi+e+Hs+fi(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return gi+e+Hs+e+e}return e}var EQe=function(e,t,o,i){if(e.length>-1&&!e.return)switch(e.type){case ZW:e.return=J9e(e.value,e.length);break;case G9e:return O7([X8(e,{value:fi(e.value,"@","@"+gi)})],i);case qW:if(e.length)return cQe(e.props,function(a){switch(dQe(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return O7([X8(e,{props:[fi(a,/:(read-\w+)/,":"+xk+"$1")]})],i);case"::placeholder":return O7([X8(e,{props:[fi(a,/:(plac\w+)/,":"+gi+"input-$1")]}),X8(e,{props:[fi(a,/:(plac\w+)/,":"+xk+"$1")]}),X8(e,{props:[fi(a,/:(plac\w+)/,Hs+"input-$1")]})],i)}return""})}},LQe=[EQe],X9e=function(e){var t=e.key;if(t==="css"){var o=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(o,function(y){var w=y.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=e.stylisPlugins||LQe,a={},l,d=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(y){for(var w=y.getAttribute("data-emotion").split(" "),b=1;b<w.length;b++)a[w[b]]=!0;d.push(y)});var c,p=[kQe,SQe];{var u,h=[wQe,vQe(function(y){u.insert(y)})],m=bQe(p.concat(i,h)),f=function(y){return O7(xQe(y),m)};c=function(y,w,b,v){u=b,f(y?y+"{"+w.styles+"}":w.styles),v&&(x.inserted[w.name]=!0)}}var x={key:t,sheet:new rQe({key:t,container:l,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:c};return x.sheet.hydrate(d),x};function jQe(e){return e==null||Object.keys(e).length===0}function exe(e){const{styles:t,defaultTheme:o={}}=e,i=typeof t=="function"?a=>t(jQe(a)?o:a):t;return s.jsx(Jw,{styles:i})}function IQe(e,t){return n(e,t)}function MQe(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const uX=[];function um(e){return uX[0]=e,ZVe(uX)}var hX={exports:{}},Di={},mX;function BQe(){if(mX)return Di;mX=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),d=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function y(w){if(typeof w=="object"&&w!==null){var b=w.$$typeof;switch(b){case e:switch(w=w.type,w){case o:case a:case i:case p:case u:case f:return w;default:switch(w=w&&w.$$typeof,w){case d:case c:case m:case h:return w;case l:return w;default:return b}}case t:return b}}}return Di.ContextConsumer=l,Di.ContextProvider=d,Di.Element=e,Di.ForwardRef=c,Di.Fragment=o,Di.Lazy=m,Di.Memo=h,Di.Portal=t,Di.Profiler=a,Di.StrictMode=i,Di.Suspense=p,Di.SuspenseList=u,Di.isContextConsumer=function(w){return y(w)===l},Di.isContextProvider=function(w){return y(w)===d},Di.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Di.isForwardRef=function(w){return y(w)===c},Di.isFragment=function(w){return y(w)===o},Di.isLazy=function(w){return y(w)===m},Di.isMemo=function(w){return y(w)===h},Di.isPortal=function(w){return y(w)===t},Di.isProfiler=function(w){return y(w)===a},Di.isStrictMode=function(w){return y(w)===i},Di.isSuspense=function(w){return y(w)===p},Di.isSuspenseList=function(w){return y(w)===u},Di.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===o||w===a||w===i||w===p||w===u||typeof w=="object"&&w!==null&&(w.$$typeof===m||w.$$typeof===h||w.$$typeof===d||w.$$typeof===l||w.$$typeof===c||w.$$typeof===x||w.getModuleId!==void 0)},Di.typeOf=y,Di}var gX;function PQe(){return gX||(gX=1,hX.exports=BQe()),hX.exports}var txe=PQe();function s0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function oxe(e){if(g.isValidElement(e)||txe.isValidElementType(e)||!s0(e))return e;const t={};return Object.keys(e).forEach(o=>{t[o]=oxe(e[o])}),t}function Xs(e,t,o={clone:!0}){const i=o.clone?{...e}:e;return s0(e)&&s0(t)&&Object.keys(t).forEach(a=>{g.isValidElement(t[a])||txe.isValidElementType(t[a])?i[a]=t[a]:s0(t[a])&&Object.prototype.hasOwnProperty.call(e,a)&&s0(e[a])?i[a]=Xs(e[a],t[a],o):o.clone?i[a]=s0(t[a])?oxe(t[a]):t[a]:i[a]=t[a]}),i}const DQe=e=>{const t=Object.keys(e).map(o=>({key:o,val:e[o]}))||[];return t.sort((o,i)=>o.val-i.val),t.reduce((o,i)=>({...o,[i.key]:i.val}),{})};function TQe(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:o="px",step:i=5,...a}=e,l=DQe(t),d=Object.keys(l);function c(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${o})`}function p(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-i/100}${o})`}function u(f,x){const y=d.indexOf(x);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${o}) and (max-width:${(y!==-1&&typeof t[d[y]]=="number"?t[d[y]]:x)-i/100}${o})`}function h(f){return d.indexOf(f)+1<d.length?u(f,d[d.indexOf(f)+1]):c(f)}function m(f){const x=d.indexOf(f);return x===0?c(d[1]):x===d.length-1?p(d[x]):u(f,d[d.indexOf(f)+1]).replace("@media","@media not all and")}return{keys:d,values:l,up:c,down:p,between:u,only:h,not:m,unit:o,...a}}function fX(e,t){if(!e.containerQueries)return t;const o=Object.keys(t).filter(i=>i.startsWith("@container")).sort((i,a)=>{const l=/min-width:\s*([0-9.]+)/;return+(i.match(l)?.[1]||0)-+(a.match(l)?.[1]||0)});return o.length?o.reduce((i,a)=>{const l=t[a];return delete i[a],i[a]=l,i},{...t}):t}function zQe(e,t){return t==="@"||t.startsWith("@")&&(e.some(o=>t.startsWith(`@${o}`))||!!t.match(/^@\d/))}function RQe(e,t){const o=t.match(/^@([^/]+)?\/?(.+)?$/);if(!o)return null;const[,i,a]=o,l=Number.isNaN(+i)?i||0:+i;return e.containerQueries(a).up(l)}function FQe(e){const t=(l,d)=>l.replace("@media",d?`@container ${d}`:"@container");function o(l,d){l.up=(...c)=>t(e.breakpoints.up(...c),d),l.down=(...c)=>t(e.breakpoints.down(...c),d),l.between=(...c)=>t(e.breakpoints.between(...c),d),l.only=(...c)=>t(e.breakpoints.only(...c),d),l.not=(...c)=>{const p=t(e.breakpoints.not(...c),d);return p.includes("not all and")?p.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):p}}const i={},a=l=>(o(i,l),i);return o(a),{...e,containerQueries:a}}const OQe={borderRadius:4};function by(e,t){return t?Xs(e,t,{clone:!1}):e}const aL={xs:0,sm:600,md:900,lg:1200,xl:1536},xX={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${aL[e]}px)`},NQe={containerQueries:e=>({up:t=>{let o=typeof t=="number"?t:aL[t]||t;return typeof o=="number"&&(o=`${o}px`),e?`@container ${e} (min-width:${o})`:`@container (min-width:${o})`}})};function M0(e,t,o){const i=e.theme||{};if(Array.isArray(t)){const a=i.breakpoints||xX;return t.reduce((l,d,c)=>(l[a.up(a.keys[c])]=o(t[c]),l),{})}if(typeof t=="object"){const a=i.breakpoints||xX;return Object.keys(t).reduce((l,d)=>{if(zQe(a.keys,d)){const c=RQe(i.containerQueries?i:NQe,d);c&&(l[c]=o(t[d],d))}else if(Object.keys(a.values||aL).includes(d)){const c=a.up(d);l[c]=o(t[d],d)}else{const c=d;l[c]=t[c]}return l},{})}return o(t)}function HQe(e={}){return e.keys?.reduce((t,o)=>{const i=e.up(o);return t[i]={},t},{})||{}}function yX(e,t){return e.reduce((o,i)=>{const a=o[i];return(!a||Object.keys(a).length===0)&&delete o[i],o},t)}function ir(e){if(typeof e!="string")throw new Error(I0(7));return e.charAt(0).toUpperCase()+e.slice(1)}function sL(e,t,o=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&o){const i=`vars.${t}`.split(".").reduce((a,l)=>a&&a[l]?a[l]:null,e);if(i!=null)return i}return t.split(".").reduce((i,a)=>i&&i[a]!=null?i[a]:null,e)}function yk(e,t,o,i=o){let a;return typeof e=="function"?a=e(o):Array.isArray(e)?a=e[o]||i:a=sL(e,o)||i,t&&(a=t(a,i,e)),a}function oa(e){const{prop:t,cssProperty:o=e.prop,themeKey:i,transform:a}=e,l=d=>{if(d[t]==null)return null;const c=d[t],p=d.theme,u=sL(p,i)||{};return M0(d,c,h=>{let m=yk(u,a,h);return h===m&&typeof h=="string"&&(m=yk(u,a,`${t}${h==="default"?"":ir(h)}`,h)),o===!1?m:{[o]:m}})};return l.propTypes={},l.filterProps=[t],l}function _Qe(e){const t={};return o=>(t[o]===void 0&&(t[o]=e(o)),t[o])}const VQe={m:"margin",p:"padding"},QQe={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},wX={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},UQe=_Qe(e=>{if(e.length>2)if(wX[e])e=wX[e];else return[e];const[t,o]=e.split(""),i=VQe[t],a=QQe[o]||"";return Array.isArray(a)?a.map(l=>i+l):[i+a]}),XW=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],eG=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...XW,...eG];function tb(e,t,o,i){const a=sL(e,t,!0)??o;return typeof a=="number"||typeof a=="string"?l=>typeof l=="string"?l:typeof a=="string"?a.startsWith("var(")&&l===0?0:a.startsWith("var(")&&l===1?a:`calc(${l} * ${a})`:a*l:Array.isArray(a)?l=>{if(typeof l=="string")return l;const d=Math.abs(l),c=a[d];return l>=0?c:typeof c=="number"?-c:typeof c=="string"&&c.startsWith("var(")?`calc(-1 * ${c})`:`-${c}`}:typeof a=="function"?a:(()=>{})}function tG(e){return tb(e,"spacing",8)}function ob(e,t){return typeof t=="string"||t==null?t:e(t)}function WQe(e,t){return o=>e.reduce((i,a)=>(i[a]=ob(t,o),i),{})}function GQe(e,t,o,i){if(!t.includes(o))return null;const a=UQe(o),l=WQe(a,i),d=e[o];return M0(e,d,l)}function rxe(e,t){const o=tG(e.theme);return Object.keys(e).map(i=>GQe(e,t,i,o)).reduce(by,{})}function In(e){return rxe(e,XW)}In.propTypes={};In.filterProps=XW;function Mn(e){return rxe(e,eG)}Mn.propTypes={};Mn.filterProps=eG;function ixe(e=8,t=tG({spacing:e})){if(e.mui)return e;const o=(...i)=>(i.length===0?[1]:i).map(a=>{const l=t(a);return typeof l=="number"?`${l}px`:l}).join(" ");return o.mui=!0,o}function lL(...e){const t=e.reduce((i,a)=>(a.filterProps.forEach(l=>{i[l]=a}),i),{}),o=i=>Object.keys(i).reduce((a,l)=>t[l]?by(a,t[l](i)):a,{});return o.propTypes={},o.filterProps=e.reduce((i,a)=>i.concat(a.filterProps),[]),o}function Mc(e){return typeof e!="number"?e:`${e}px solid`}function Jc(e,t){return oa({prop:e,themeKey:"borders",transform:t})}const YQe=Jc("border",Mc),KQe=Jc("borderTop",Mc),qQe=Jc("borderRight",Mc),ZQe=Jc("borderBottom",Mc),JQe=Jc("borderLeft",Mc),XQe=Jc("borderColor"),eUe=Jc("borderTopColor"),tUe=Jc("borderRightColor"),oUe=Jc("borderBottomColor"),rUe=Jc("borderLeftColor"),iUe=Jc("outline",Mc),nUe=Jc("outlineColor"),dL=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=tb(e.theme,"shape.borderRadius",4),o=i=>({borderRadius:ob(t,i)});return M0(e,e.borderRadius,o)}return null};dL.propTypes={};dL.filterProps=["borderRadius"];lL(YQe,KQe,qQe,ZQe,JQe,XQe,eUe,tUe,oUe,rUe,dL,iUe,nUe);const cL=e=>{if(e.gap!==void 0&&e.gap!==null){const t=tb(e.theme,"spacing",8),o=i=>({gap:ob(t,i)});return M0(e,e.gap,o)}return null};cL.propTypes={};cL.filterProps=["gap"];const pL=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=tb(e.theme,"spacing",8),o=i=>({columnGap:ob(t,i)});return M0(e,e.columnGap,o)}return null};pL.propTypes={};pL.filterProps=["columnGap"];const uL=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=tb(e.theme,"spacing",8),o=i=>({rowGap:ob(t,i)});return M0(e,e.rowGap,o)}return null};uL.propTypes={};uL.filterProps=["rowGap"];const aUe=oa({prop:"gridColumn"}),sUe=oa({prop:"gridRow"}),lUe=oa({prop:"gridAutoFlow"}),dUe=oa({prop:"gridAutoColumns"}),cUe=oa({prop:"gridAutoRows"}),pUe=oa({prop:"gridTemplateColumns"}),uUe=oa({prop:"gridTemplateRows"}),hUe=oa({prop:"gridTemplateAreas"}),mUe=oa({prop:"gridArea"});lL(cL,pL,uL,aUe,sUe,lUe,dUe,cUe,pUe,uUe,hUe,mUe);function N7(e,t){return t==="grey"?t:e}const gUe=oa({prop:"color",themeKey:"palette",transform:N7}),fUe=oa({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:N7}),xUe=oa({prop:"backgroundColor",themeKey:"palette",transform:N7});lL(gUe,fUe,xUe);function _d(e){return e<=1&&e!==0?`${e*100}%`:e}const yUe=oa({prop:"width",transform:_d}),oG=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=o=>{const i=e.theme?.breakpoints?.values?.[o]||aL[o];return i?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:_d(o)}};return M0(e,e.maxWidth,t)}return null};oG.filterProps=["maxWidth"];const wUe=oa({prop:"minWidth",transform:_d}),bUe=oa({prop:"height",transform:_d}),vUe=oa({prop:"maxHeight",transform:_d}),CUe=oa({prop:"minHeight",transform:_d});oa({prop:"size",cssProperty:"width",transform:_d});oa({prop:"size",cssProperty:"height",transform:_d});const AUe=oa({prop:"boxSizing"});lL(yUe,oG,wUe,bUe,vUe,CUe,AUe);const hL={border:{themeKey:"borders",transform:Mc},borderTop:{themeKey:"borders",transform:Mc},borderRight:{themeKey:"borders",transform:Mc},borderBottom:{themeKey:"borders",transform:Mc},borderLeft:{themeKey:"borders",transform:Mc},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Mc},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:dL},color:{themeKey:"palette",transform:N7},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:N7},backgroundColor:{themeKey:"palette",transform:N7},p:{style:Mn},pt:{style:Mn},pr:{style:Mn},pb:{style:Mn},pl:{style:Mn},px:{style:Mn},py:{style:Mn},padding:{style:Mn},paddingTop:{style:Mn},paddingRight:{style:Mn},paddingBottom:{style:Mn},paddingLeft:{style:Mn},paddingX:{style:Mn},paddingY:{style:Mn},paddingInline:{style:Mn},paddingInlineStart:{style:Mn},paddingInlineEnd:{style:Mn},paddingBlock:{style:Mn},paddingBlockStart:{style:Mn},paddingBlockEnd:{style:Mn},m:{style:In},mt:{style:In},mr:{style:In},mb:{style:In},ml:{style:In},mx:{style:In},my:{style:In},margin:{style:In},marginTop:{style:In},marginRight:{style:In},marginBottom:{style:In},marginLeft:{style:In},marginX:{style:In},marginY:{style:In},marginInline:{style:In},marginInlineStart:{style:In},marginInlineEnd:{style:In},marginBlock:{style:In},marginBlockStart:{style:In},marginBlockEnd:{style:In},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:cL},rowGap:{style:uL},columnGap:{style:pL},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:_d},maxWidth:{style:oG},minWidth:{transform:_d},height:{transform:_d},maxHeight:{transform:_d},minHeight:{transform:_d},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function $Ue(...e){const t=e.reduce((i,a)=>i.concat(Object.keys(a)),[]),o=new Set(t);return e.every(i=>o.size===Object.keys(i).length)}function kUe(e,t){return typeof e=="function"?e(t):e}function SUe(){function e(o,i,a,l){const d={[o]:i,theme:a},c=l[o];if(!c)return{[o]:i};const{cssProperty:p=o,themeKey:u,transform:h,style:m}=c;if(i==null)return null;if(u==="typography"&&i==="inherit")return{[o]:i};const f=sL(a,u)||{};return m?m(d):M0(d,i,x=>{let y=yk(f,h,x);return x===y&&typeof x=="string"&&(y=yk(f,h,`${o}${x==="default"?"":ir(x)}`,x)),p===!1?y:{[p]:y}})}function t(o){const{sx:i,theme:a={},nested:l}=o||{};if(!i)return null;const d=a.unstable_sxConfig??hL;function c(p){let u=p;if(typeof p=="function")u=p(a);else if(typeof p!="object")return p;if(!u)return null;const h=HQe(a.breakpoints),m=Object.keys(h);let f=h;return Object.keys(u).forEach(x=>{const y=kUe(u[x],a);if(y!=null)if(typeof y=="object")if(d[x])f=by(f,e(x,y,a,d));else{const w=M0({theme:a},y,b=>({[x]:b}));$Ue(w,y)?f[x]=t({sx:y,theme:a,nested:!0}):f=by(f,w)}else f=by(f,e(x,y,a,d))}),!l&&a.modularCssLayers?{"@layer sx":fX(a,yX(m,f))}:fX(a,yX(m,f))}return Array.isArray(i)?i.map(c):c(i)}return t}const z4=SUe();z4.filterProps=["sx"];function EUe(e,t){const o=this;if(o.vars){if(!o.colorSchemes?.[e]||typeof o.getColorSchemeSelector!="function")return{};let i=o.getColorSchemeSelector(e);return i==="&"?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return o.palette.mode===e?t:{}}function rG(e={},...t){const{breakpoints:o={},palette:i={},spacing:a,shape:l={},...d}=e,c=TQe(o),p=ixe(a);let u=Xs({breakpoints:c,direction:"ltr",components:{},palette:{mode:"light",...i},spacing:p,shape:{...OQe,...l}},d);return u=FQe(u),u.applyStyles=EUe,u=t.reduce((h,m)=>Xs(h,m),u),u.unstable_sxConfig={...hL,...d?.unstable_sxConfig},u.unstable_sx=function(h){return z4({sx:h,theme:this})},u}function LUe(e){return Object.keys(e).length===0}function iG(e=null){const t=g.useContext(N9e);return!t||LUe(t)?e:t}const jUe=rG();function nxe(e=jUe){return iG(e)}function bX(e){const t=um(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function axe({styles:e,themeId:t,defaultTheme:o={}}){const i=nxe(o),a=t&&i[t]||i;let l=typeof e=="function"?e(a):e;return a.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>bX(typeof d=="function"?d(a):d)):l=bX(l)),s.jsx(exe,{styles:l})}const vX=e=>e,IUe=()=>{let e=vX;return{configure(t){e=t},generate(t){return e(t)},reset(){e=vX}}},MUe=IUe();function sxe(e){var t,o,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(o=sxe(e[t]))&&(i&&(i+=" "),i+=o)}else for(o in e)e[o]&&(i&&(i+=" "),i+=o);return i}function No(){for(var e,t,o=0,i="",a=arguments.length;o<a;o++)(e=arguments[o])&&(t=sxe(e))&&(i&&(i+=" "),i+=t);return i}const BUe={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function ui(e,t,o="Mui"){const i=BUe[t];return i?`${o}-${i}`:`${MUe.generate(e)}-${t}`}function ti(e,t,o="Mui"){const i={};return t.forEach(a=>{i[a]=ui(e,a,o)}),i}function lxe(e){const{variants:t,...o}=e,i={variants:t,style:um(o),isProcessed:!0};return i.style===o||t&&t.forEach(a=>{typeof a.style!="function"&&(a.style=um(a.style))}),i}const PUe=rG();function UB(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function a4(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function DUe(e){return e?(t,o)=>o[e]:null}function TUe(e,t,o){e.theme=FUe(e.theme)?o:e.theme[t]||e.theme}function D$(e,t,o){const i=typeof t=="function"?t(e):t;if(Array.isArray(i))return i.flatMap(a=>D$(e,a,o));if(Array.isArray(i?.variants)){let a;if(i.isProcessed)a=o?a4(i.style,o):i.style;else{const{variants:l,...d}=i;a=o?a4(um(d),o):d}return dxe(e,i.variants,[a],o)}return i?.isProcessed?o?a4(um(i.style),o):i.style:o?a4(um(i),o):i}function dxe(e,t,o=[],i=void 0){let a;e:for(let l=0;l<t.length;l+=1){const d=t[l];if(typeof d.props=="function"){if(a??={...e,...e.ownerState,ownerState:e.ownerState},!d.props(a))continue}else for(const c in d.props)if(e[c]!==d.props[c]&&e.ownerState?.[c]!==d.props[c])continue e;typeof d.style=="function"?(a??={...e,...e.ownerState,ownerState:e.ownerState},o.push(i?a4(um(d.style(a)),i):d.style(a))):o.push(i?a4(um(d.style),i):d.style)}return o}function zUe(e={}){const{themeId:t,defaultTheme:o=PUe,rootShouldForwardProp:i=UB,slotShouldForwardProp:a=UB}=e;function l(d){TUe(d,t,o)}return(d,c={})=>{MQe(d,I=>I.filter(L=>L!==z4));const{name:p,slot:u,skipVariantsResolver:h,skipSx:m,overridesResolver:f=DUe(NUe(u)),...x}=c,y=p&&p.startsWith("Mui")||u?"components":"custom",w=h!==void 0?h:u&&u!=="Root"&&u!=="root"||!1,b=m||!1;let v=UB;u==="Root"||u==="root"?v=i:u?v=a:OUe(d)&&(v=void 0);const A=IQe(d,{shouldForwardProp:v,label:RUe(),...x}),S=I=>{if(I.__emotion_real===I)return I;if(typeof I=="function")return function(L){return D$(L,I,L.theme.modularCssLayers?y:void 0)};if(s0(I)){const L=lxe(I);return function(B){return L.variants?D$(B,L,B.theme.modularCssLayers?y:void 0):B.theme.modularCssLayers?a4(L.style,y):L.style}}return I},E=(...I)=>{const L=[],B=I.map(S),P=[];if(L.push(l),p&&f&&P.push(function(O){const F=O.theme.components?.[p]?.styleOverrides;if(!F)return null;const Y={};for(const Z in F)Y[Z]=D$(O,F[Z],O.theme.modularCssLayers?"theme":void 0);return f(O,Y)}),p&&!w&&P.push(function(O){const F=O.theme?.components?.[p]?.variants;return F?dxe(O,F,[],O.theme.modularCssLayers?"theme":void 0):null}),b||P.push(z4),Array.isArray(B[0])){const O=B.shift(),F=new Array(L.length).fill(""),Y=new Array(P.length).fill("");let Z;Z=[...F,...O,...Y],Z.raw=[...F,...O.raw,...Y],L.unshift(Z)}const D=[...L,...B,...P],T=A(...D);return d.muiName&&(T.muiName=d.muiName),T};return A.withConfig&&(E.withConfig=A.withConfig),E}}function RUe(e,t){return void 0}function FUe(e){for(const t in e)return!1;return!0}function OUe(e){return typeof e=="string"&&e.charCodeAt(0)>96}function NUe(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function G_(e,t,o=!1){const i={...t};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const l=a;if(l==="components"||l==="slots")i[l]={...e[l],...i[l]};else if(l==="componentsProps"||l==="slotProps"){const d=e[l],c=t[l];if(!c)i[l]=d||{};else if(!d)i[l]=c;else{i[l]={...c};for(const p in d)if(Object.prototype.hasOwnProperty.call(d,p)){const u=p;i[l][u]=G_(d[u],c[u],o)}}}else l==="className"&&o&&t.className?i.className=No(e?.className,t?.className):l==="style"&&o&&t.style?i.style={...e?.style,...t?.style}:i[l]===void 0&&(i[l]=e[l])}return i}const Xd=typeof window<"u"?g.useLayoutEffect:g.useEffect;function HUe(e,t=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,o))}function nG(e,t=0,o=1){return HUe(e,t,o)}function _Ue(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let o=e.match(t);return o&&o[0].length===1&&(o=o.map(i=>i+i)),o?`rgb${o.length===4?"a":""}(${o.map((i,a)=>a<3?parseInt(i,16):Math.round(parseInt(i,16)/255*1e3)/1e3).join(", ")})`:""}function Em(e){if(e.type)return e;if(e.charAt(0)==="#")return Em(_Ue(e));const t=e.indexOf("("),o=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(o))throw new Error(I0(9,e));let i=e.substring(t+1,e.length-1),a;if(o==="color"){if(i=i.split(" "),a=i.shift(),i.length===4&&i[3].charAt(0)==="/"&&(i[3]=i[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(a))throw new Error(I0(10,a))}else i=i.split(",");return i=i.map(l=>parseFloat(l)),{type:o,values:i,colorSpace:a}}const VUe=e=>{const t=Em(e);return t.values.slice(0,3).map((o,i)=>t.type.includes("hsl")&&i!==0?`${o}%`:o).join(" ")},Vx=(e,t)=>{try{return VUe(e)}catch{return e}};function mL(e){const{type:t,colorSpace:o}=e;let{values:i}=e;return t.includes("rgb")?i=i.map((a,l)=>l<3?parseInt(a,10):a):t.includes("hsl")&&(i[1]=`${i[1]}%`,i[2]=`${i[2]}%`),t.includes("color")?i=`${o} ${i.join(" ")}`:i=`${i.join(", ")}`,`${t}(${i})`}function cxe(e){e=Em(e);const{values:t}=e,o=t[0],i=t[1]/100,a=t[2]/100,l=i*Math.min(a,1-a),d=(u,h=(u+o/30)%12)=>a-l*Math.max(Math.min(h-3,9-h,1),-1);let c="rgb";const p=[Math.round(d(0)*255),Math.round(d(8)*255),Math.round(d(4)*255)];return e.type==="hsla"&&(c+="a",p.push(t[3])),mL({type:c,values:p})}function Y_(e){e=Em(e);let t=e.type==="hsl"||e.type==="hsla"?Em(cxe(e)).values:e.values;return t=t.map(o=>(e.type!=="color"&&(o/=255),o<=.03928?o/12.92:((o+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function QUe(e,t){const o=Y_(e),i=Y_(t);return(Math.max(o,i)+.05)/(Math.min(o,i)+.05)}function wk(e,t){return e=Em(e),t=nG(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,mL(e)}function Yg(e,t,o){try{return wk(e,t)}catch{return e}}function gL(e,t){if(e=Em(e),t=nG(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let o=0;o<3;o+=1)e.values[o]*=1-t;return mL(e)}function ki(e,t,o){try{return gL(e,t)}catch{return e}}function fL(e,t){if(e=Em(e),t=nG(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let o=0;o<3;o+=1)e.values[o]+=(255-e.values[o])*t;else if(e.type.includes("color"))for(let o=0;o<3;o+=1)e.values[o]+=(1-e.values[o])*t;return mL(e)}function Si(e,t,o){try{return fL(e,t)}catch{return e}}function UUe(e,t=.15){return Y_(e)>.5?gL(e,t):fL(e,t)}function Dv(e,t,o){try{return UUe(e,t)}catch{return e}}const pxe=g.createContext(null);function aG(){return g.useContext(pxe)}const WUe=typeof Symbol=="function"&&Symbol.for,GUe=WUe?Symbol.for("mui.nested"):"__THEME_NESTED__";function YUe(e,t){return typeof t=="function"?t(e):{...e,...t}}function KUe(e){const{children:t,theme:o}=e,i=aG(),a=g.useMemo(()=>{const l=i===null?{...o}:YUe(i,o);return l!=null&&(l[GUe]=i!==null),l},[o,i]);return s.jsx(pxe.Provider,{value:a,children:t})}const uxe=g.createContext();function qUe({value:e,...t}){return s.jsx(uxe.Provider,{value:e??!0,...t})}const X6=()=>g.useContext(uxe)??!1,hxe=g.createContext(void 0);function ZUe({value:e,children:t}){return s.jsx(hxe.Provider,{value:e,children:t})}function JUe(e){const{theme:t,name:o,props:i}=e;if(!t||!t.components||!t.components[o])return i;const a=t.components[o];return a.defaultProps?G_(a.defaultProps,i,t.components.mergeClassNameAndStyle):!a.styleOverrides&&!a.variants?G_(a,i,t.components.mergeClassNameAndStyle):i}function XUe({props:e,name:t}){const o=g.useContext(hxe);return JUe({props:e,name:t,theme:{components:o}})}let CX=0;function eWe(e){const[t,o]=g.useState(e),i=e||t;return g.useEffect(()=>{t==null&&(CX+=1,o(`mui-${CX}`))},[t]),i}const tWe={...kHe},AX=tWe.useId;function xL(e){if(AX!==void 0){const t=AX();return e??t}return eWe(e)}function oWe(e){const t=iG(),o=xL()||"",{modularCssLayers:i}=e;let a="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||t!==null?a="":typeof i=="string"?a=i.replace(/mui(?!\.)/g,a):a=`@layer ${a};`,Xd(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(a){if(d&&d.hasAttribute?.("data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===o)return;const c=document.createElement("style");c.setAttribute("data-mui-layer-order",o),c.textContent=a,l.prepend(c)}else l.querySelector(`style[data-mui-layer-order="${o}"]`)?.remove()},[a,o]),a?s.jsx(axe,{styles:a}):null}const $X={};function kX(e,t,o,i=!1){return g.useMemo(()=>{const a=e&&t[e]||t;if(typeof o=="function"){const l=o(a),d=e?{...t,[e]:l}:l;return i?()=>d:d}return e?{...t,[e]:o}:{...t,...o}},[e,t,o,i])}function mxe(e){const{children:t,theme:o,themeId:i}=e,a=iG($X),l=aG()||$X,d=kX(i,a,o),c=kX(i,l,o,!0),p=(i?d[i]:d).direction==="rtl",u=oWe(d);return s.jsx(KUe,{theme:c,children:s.jsx(N9e.Provider,{value:d,children:s.jsx(qUe,{value:p,children:s.jsxs(ZUe,{value:i?d[i].components:d.components,children:[u,t]})})})})}const SX={theme:void 0};function rWe(e){let t,o;return function(i){let a=t;return(a===void 0||i.theme!==o)&&(SX.theme=i.theme,a=lxe(e(SX)),t=a,o=i.theme),a}}const sG="mode",lG="color-scheme",iWe="data-color-scheme";function nWe(e){const{defaultMode:t="system",defaultLightColorScheme:o="light",defaultDarkColorScheme:i="dark",modeStorageKey:a=sG,colorSchemeStorageKey:l=lG,attribute:d=iWe,colorSchemeNode:c="document.documentElement",nonce:p}=e||{};let u="",h=d;if(d==="class"&&(h=".%s"),d==="data"&&(h="[data-%s]"),h.startsWith(".")){const f=h.substring(1);u+=`${c}.classList.remove('${f}'.replace('%s', light), '${f}'.replace('%s', dark));
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/empty-BN27BaBf.js","assets/sentry-DpSyts5x.js","assets/empty-Bde-ejqA.js","assets/index-DgyFn3oa.js","assets/index-DMqq1G7I.js","assets/zeni-epic-state-DDBe5bD1.js","assets/core-JOq4V17d.js","assets/utils-NrwCaWzf.js","assets/recharts-BVCeoCNo.js","assets/url-BE4qwGQm.js","assets/index-DwVLoI7i.js","assets/index-pCOxDsRD.js","assets/url-C9Fwu8i4.js","assets/index-nuQ6WJZH.js","assets/ScreenRoutes-BFmYZbdr.js","assets/liveblocks-D3BH9un_.js","assets/analyticsHelper-BVwhCBF2.js","assets/mui-rlLdPqp4.js","assets/SignInScreen-vUlTxjR_.js","assets/analytics-Cy_ddlAy.js","assets/lottie-CXND4nkG.js","assets/lexical-gqfkJ4yd.js"])))=>i.map(i=>d[i]);
2
+ import{a as g,b as $,R as kHe,c as T4,p as Jh,r as bd,g as DW,e as NJ,f as SHe,s as HJ,w as EHe,i as LHe,S as jHe,j as IHe,k as MHe,l as BHe,m as PHe}from"./sentry-DpSyts5x.js";import{j as wo,_ as g9e,a as rc,u as f9e,T as DHe,C as THe,b as zHe,c as qE,d as ZE,e as RHe,f as x9e,g as FHe,h as OHe,L as NHe,i as _J,k as HHe,l as _He,P as VHe,m as QHe,n as UHe,o as y9e,p as WHe,q as GHe,I as VJ,r as YHe,s as KHe,t as qHe,v as ZHe,w as JHe,x as XHe,y as w9e,z as e_e,A as t_e,B as o_e}from"./liveblocks-D3BH9un_.js";import{f as b9e,R as i4,r as _n,P as $n,u as JE,g as Vu,h as r_e,i as TW,j as i_e,k as n_e,l as OB,N as a_e,m as s_e,n as l_e,B as d_e}from"./core-JOq4V17d.js";import{H as uk,ba as n4,bb as c_e,bc as QJ,bd as tf,be as Gr,bf as v9e,bg as XE,bh as zr,bi as p_e,bj as j0,bk as u_e,bl as h_e,bm as s6,bn as Sm,bo as zW,bp as C9e,bq as m_e,br as E1,bs as g_e,bt as RW,bu as A9e,bv as Ki,bw as l6,bx as wu,by as f_e,bz as x_e,bA as y_e,bB as $9e,bC as R_,bD as w_e,bE as b_e,bF as v_e,bG as C_e,bH as FW,bI as k9e,bJ as A_e,bK as S9e,bL as F_,bM as UJ,bN as WJ,bO as GJ,bP as Al,bQ as OW,bR as NW,bS as Z6,bT as HW,bU as _W,bV as VW,bW as QW,bX as $_e,bY as hk,bZ as k_e,b_ as E9e,b$ as UW,c0 as S_e,c1 as y0,c2 as qw,c3 as Zw,c4 as E_e,c5 as L_e,c6 as j_e,c7 as I_e,c8 as M_e,c9 as B_e,ca as P_e,cb as Mv,cc as D_e,cd as T_e,ce as z_e,cf as R_e,cg as F_e,ch as O_e,ci as N_e,cj as H_e,ck as __e,cl as V_e,cm as Q_e,cn as U_e,co as W_e,cp as G_e,cq as L9e,cr as Y_e,cs as YJ,ct as K_e,cu as q_e,cv as Yy,cw as j9e,cx as Z_e,cy as I9e,cz as WW,cA as J_e,cB as KJ,cC as X_e,cD as qJ,cE as M9e,cF as B9e,cG as P9e,cH as D9e,cI as T9e,cJ as eVe,cK as z9e,cL as tVe,cM as oVe,cN as rVe,cO as R9e,cP as O_,cQ as iVe,cR as F9e,cS as O9e,cT as nVe,cU as aVe,cV as sVe,cW as lVe,cX as dVe,cY as cVe,cZ as pVe,c_ as uVe,v as hVe,c$ as eL,d0 as N_,d1 as H_,d2 as mVe,d3 as gVe,d4 as fVe,d5 as xVe,d6 as yVe,d7 as wVe,d8 as bVe,d9 as vVe,da as CVe,db as AVe,dc as ZJ,dd as $Ve,de as kVe,df as SVe,dg as EVe,dh as LVe}from"./zeni-epic-state-DDBe5bD1.js";import{T as N9e,j as Ro,n,c as ue,k as Nt,G as Jw,C as H9e,u as _9e,a as jVe}from"./mui-rlLdPqp4.js";import{r as IVe,m as bu}from"./analytics-Cy_ddlAy.js";import{L as __}from"./lottie-CXND4nkG.js";import{r as ya}from"./lexical-gqfkJ4yd.js";import{E as Hi,c as tL,P as MVe,R as V_,F as mk,X as Zd,Y as Jd,G as N0,H as gk,I as oL,J as H0,K as V9e,L as BVe,M as PVe,N as of,O as GW,Q as YW,S as Xw,U as DVe}from"./recharts-BVCeoCNo.js";import{r as TVe}from"./utils-NrwCaWzf.js";(function(){try{var e=typeof window<"u"?window:typeof T4<"u"?T4:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="87836a74-dd25-4931-8d33-c104e49c7e94",e._sentryDebugIdIdentifier="sentry-dbid-87836a74-dd25-4931-8d33-c104e49c7e94")}catch{}})();(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function o(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(a){if(a.ep)return;a.ep=!0;const l=o(a);fetch(a.href,l)}})();var Bv={},JJ;function zVe(){if(JJ)return Bv;JJ=1;var e=b9e();return Bv.createRoot=e.createRoot,Bv.hydrateRoot=e.hydrateRoot,Bv}var RVe=zVe(),ad=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof T4<"u"?T4:typeof self<"u"?self:{};function Dr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var XJ={exports:{}},J8={},eX;function FVe(){if(eX)return J8;eX=1;var e=$,t=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function d(c,p,u){var h,m={},f=null,x=null;u!==void 0&&(f=""+u),p.key!==void 0&&(f=""+p.key),p.ref!==void 0&&(x=p.ref);for(h in p)i.call(p,h)&&!l.hasOwnProperty(h)&&(m[h]=p[h]);if(c&&c.defaultProps)for(h in p=c.defaultProps,p)m[h]===void 0&&(m[h]=p[h]);return{$$typeof:t,type:c,key:f,ref:x,props:m,_owner:a.current}}return J8.Fragment=o,J8.jsx=d,J8.jsxs=d,J8}var tX;function Q9e(){return tX||(tX=1,XJ.exports=FVe()),XJ.exports}var s=Q9e();const OVe=g.createContext(null),NB={didCatch:!1,error:null};let NVe=class extends g.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=NB}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var t,o,i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];(t=(o=this.props).onReset)===null||t===void 0||t.call(o,{args:a,reason:"imperative-api"}),this.setState(NB)}}componentDidCatch(e,t){var o,i;(o=(i=this.props).onError)===null||o===void 0||o.call(i,e,t)}componentDidUpdate(e,t){const{didCatch:o}=this.state,{resetKeys:i}=this.props;if(o&&t.error!==null&&HVe(e.resetKeys,i)){var a,l;(a=(l=this.props).onReset)===null||a===void 0||a.call(l,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(NB)}}render(){const{children:e,fallbackRender:t,FallbackComponent:o,fallback:i}=this.props,{didCatch:a,error:l}=this.state;let d=e;if(a){const c={error:l,resetErrorBoundary:this.resetErrorBoundary};if(typeof t=="function")d=t(c);else if(o)d=g.createElement(o,c);else if(i!==void 0)d=i;else throw l}return g.createElement(OVe.Provider,{value:{didCatch:a,error:l,resetErrorBoundary:this.resetErrorBoundary}},d)}};function HVe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((o,i)=>!Object.is(o,t[i]))}var Q_={exports:{}},_Ve=Q_.exports,oX;function VVe(){return oX||(oX=1,(function(e){(function(t,o){e.exports?e.exports=o():t.numeral=o()})(_Ve,function(){var t,o,i="2.0.6",a={},l={},d={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},c={currentLocale:d.currentLocale,zeroFormat:d.zeroFormat,nullFormat:d.nullFormat,defaultFormat:d.defaultFormat,scalePercentBy100:d.scalePercentBy100};function p(u,h){this._input=u,this._value=h}return t=function(u){var h,m,f,x;if(t.isNumeral(u))h=u.value();else if(u===0||typeof u>"u")h=0;else if(u===null||o.isNaN(u))h=null;else if(typeof u=="string")if(c.zeroFormat&&u===c.zeroFormat)h=0;else if(c.nullFormat&&u===c.nullFormat||!u.replace(/[^0-9]+/g,"").length)h=null;else{for(m in a)if(x=typeof a[m].regexps.unformat=="function"?a[m].regexps.unformat():a[m].regexps.unformat,x&&u.match(x)){f=a[m].unformat;break}f=f||t._.stringToNumber,h=f(u)}else h=Number(u)||null;return new p(u,h)},t.version=i,t.isNumeral=function(u){return u instanceof p},t._=o={numberToFormat:function(u,h,m){var f=l[t.options.currentLocale],x=!1,y=!1,w=0,b="",v=1e12,A=1e9,S=1e6,E=1e3,I="",L=!1,B,P,D,T,O,F,Y;if(u=u||0,P=Math.abs(u),t._.includes(h,"(")?(x=!0,h=h.replace(/[\(|\)]/g,"")):(t._.includes(h,"+")||t._.includes(h,"-"))&&(O=t._.includes(h,"+")?h.indexOf("+"):u<0?h.indexOf("-"):-1,h=h.replace(/[\+|\-]/g,"")),t._.includes(h,"a")&&(B=h.match(/a(k|m|b|t)?/),B=B?B[1]:!1,t._.includes(h," a")&&(b=" "),h=h.replace(new RegExp(b+"a[kmbt]?"),""),P>=v&&!B||B==="t"?(b+=f.abbreviations.trillion,u=u/v):P<v&&P>=A&&!B||B==="b"?(b+=f.abbreviations.billion,u=u/A):P<A&&P>=S&&!B||B==="m"?(b+=f.abbreviations.million,u=u/S):(P<S&&P>=E&&!B||B==="k")&&(b+=f.abbreviations.thousand,u=u/E)),t._.includes(h,"[.]")&&(y=!0,h=h.replace("[.]",".")),D=u.toString().split(".")[0],T=h.split(".")[1],F=h.indexOf(","),w=(h.split(".")[0].split(",")[0].match(/0/g)||[]).length,T?(t._.includes(T,"[")?(T=T.replace("]",""),T=T.split("["),I=t._.toFixed(u,T[0].length+T[1].length,m,T[1].length)):I=t._.toFixed(u,T.length,m),D=I.split(".")[0],t._.includes(I,".")?I=f.delimiters.decimal+I.split(".")[1]:I="",y&&Number(I.slice(1))===0&&(I="")):D=t._.toFixed(u,0,m),b&&!B&&Number(D)>=1e3&&b!==f.abbreviations.trillion)switch(D=String(Number(D)/1e3),b){case f.abbreviations.thousand:b=f.abbreviations.million;break;case f.abbreviations.million:b=f.abbreviations.billion;break;case f.abbreviations.billion:b=f.abbreviations.trillion;break}if(t._.includes(D,"-")&&(D=D.slice(1),L=!0),D.length<w)for(var Z=w-D.length;Z>0;Z--)D="0"+D;return F>-1&&(D=D.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),h.indexOf(".")===0&&(D=""),Y=D+I+(b||""),x?Y=(x&&L?"(":"")+Y+(x&&L?")":""):O>=0?Y=O===0?(L?"-":"+")+Y:Y+(L?"-":"+"):L&&(Y="-"+Y),Y},stringToNumber:function(u){var h=l[c.currentLocale],m=u,f={thousand:3,million:6,billion:9,trillion:12},x,y,w;if(c.zeroFormat&&u===c.zeroFormat)y=0;else if(c.nullFormat&&u===c.nullFormat||!u.replace(/[^0-9]+/g,"").length)y=null;else{y=1,h.delimiters.decimal!=="."&&(u=u.replace(/\./g,"").replace(h.delimiters.decimal,"."));for(x in f)if(w=new RegExp("[^a-zA-Z]"+h.abbreviations[x]+"(?:\\)|(\\"+h.currency.symbol+")?(?:\\))?)?$"),m.match(w)){y*=Math.pow(10,f[x]);break}y*=(u.split("-").length+Math.min(u.split("(").length-1,u.split(")").length-1))%2?1:-1,u=u.replace(/[^0-9\.]+/g,""),y*=Number(u)}return y},isNaN:function(u){return typeof u=="number"&&isNaN(u)},includes:function(u,h){return u.indexOf(h)!==-1},insert:function(u,h,m){return u.slice(0,m)+h+u.slice(m)},reduce:function(u,h){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof h!="function")throw new TypeError(h+" is not a function");var m=Object(u),f=m.length>>>0,x=0,y;if(arguments.length===3)y=arguments[2];else{for(;x<f&&!(x in m);)x++;if(x>=f)throw new TypeError("Reduce of empty array with no initial value");y=m[x++]}for(;x<f;x++)x in m&&(y=h(y,m[x],x,m));return y},multiplier:function(u){var h=u.toString().split(".");return h.length<2?1:Math.pow(10,h[1].length)},correctionFactor:function(){var u=Array.prototype.slice.call(arguments);return u.reduce(function(h,m){var f=o.multiplier(m);return h>f?h:f},1)},toFixed:function(u,h,m,f){var x=u.toString().split("."),y=h-(f||0),w,b,v,A;return x.length===2?w=Math.min(Math.max(x[1].length,y),h):w=y,v=Math.pow(10,w),A=(m(u+"e+"+w)/v).toFixed(w),f>h-w&&(b=new RegExp("\\.?0{1,"+(f-(h-w))+"}$"),A=A.replace(b,"")),A}},t.options=c,t.formats=a,t.locales=l,t.locale=function(u){return u&&(c.currentLocale=u.toLowerCase()),c.currentLocale},t.localeData=function(u){if(!u)return l[c.currentLocale];if(u=u.toLowerCase(),!l[u])throw new Error("Unknown locale : "+u);return l[u]},t.reset=function(){for(var u in d)c[u]=d[u]},t.zeroFormat=function(u){c.zeroFormat=typeof u=="string"?u:null},t.nullFormat=function(u){c.nullFormat=typeof u=="string"?u:null},t.defaultFormat=function(u){c.defaultFormat=typeof u=="string"?u:"0.0"},t.register=function(u,h,m){if(h=h.toLowerCase(),this[u+"s"][h])throw new TypeError(h+" "+u+" already registered.");return this[u+"s"][h]=m,m},t.validate=function(u,h){var m,f,x,y,w,b,v,A;if(typeof u!="string"&&(u+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",u)),u=u.trim(),u.match(/^\d+$/))return!0;if(u==="")return!1;try{v=t.localeData(h)}catch{v=t.localeData(t.locale())}return x=v.currency.symbol,w=v.abbreviations,m=v.delimiters.decimal,v.delimiters.thousands==="."?f="\\.":f=v.delimiters.thousands,A=u.match(/^[^\d]+/),A!==null&&(u=u.substr(1),A[0]!==x)||(A=u.match(/[^\d]+$/),A!==null&&(u=u.slice(0,-1),A[0]!==w.thousand&&A[0]!==w.million&&A[0]!==w.billion&&A[0]!==w.trillion))?!1:(b=new RegExp(f+"{2}"),u.match(/[^\d.,]/g)?!1:(y=u.split(m),y.length>2?!1:y.length<2?!!y[0].match(/^\d+.*\d$/)&&!y[0].match(b):y[0].length===1?!!y[0].match(/^\d+$/)&&!y[0].match(b)&&!!y[1].match(/^\d+$/):!!y[0].match(/^\d+.*\d$/)&&!y[0].match(b)&&!!y[1].match(/^\d+$/)))},t.fn=p.prototype={clone:function(){return t(this)},format:function(u,h){var m=this._value,f=u||c.defaultFormat,x,y,w;if(h=h||Math.round,m===0&&c.zeroFormat!==null)y=c.zeroFormat;else if(m===null&&c.nullFormat!==null)y=c.nullFormat;else{for(x in a)if(f.match(a[x].regexps.format)){w=a[x].format;break}w=w||t._.numberToFormat,y=w(m,f,h)}return y},value:function(){return this._value},input:function(){return this._input},set:function(u){return this._value=Number(u),this},add:function(u){var h=o.correctionFactor.call(null,this._value,u);function m(f,x,y,w){return f+Math.round(h*x)}return this._value=o.reduce([this._value,u],m,0)/h,this},subtract:function(u){var h=o.correctionFactor.call(null,this._value,u);function m(f,x,y,w){return f-Math.round(h*x)}return this._value=o.reduce([u],m,Math.round(this._value*h))/h,this},multiply:function(u){function h(m,f,x,y){var w=o.correctionFactor(m,f);return Math.round(m*w)*Math.round(f*w)/Math.round(w*w)}return this._value=o.reduce([this._value,u],h,1),this},divide:function(u){function h(m,f,x,y){var w=o.correctionFactor(m,f);return Math.round(m*w)/Math.round(f*w)}return this._value=o.reduce([this._value,u],h),this},difference:function(u){return Math.abs(t(this._value).subtract(u).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(u){var h=u%10;return~~(u%100/10)===1?"th":h===1?"st":h===2?"nd":h===3?"rd":"th"},currency:{symbol:"$"}}),(function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(u,h,m){var f=t._.includes(h," BPS")?" ":"",x;return u=u*1e4,h=h.replace(/\s?BPS/,""),x=t._.numberToFormat(u,h,m),t._.includes(x,")")?(x=x.split(""),x.splice(-1,0,f+"BPS"),x=x.join("")):x=x+f+"BPS",x},unformat:function(u){return+(t._.stringToNumber(u)*1e-4).toFixed(15)}})})(),(function(){var u={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},h={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},m=u.suffixes.concat(h.suffixes.filter(function(x){return u.suffixes.indexOf(x)<0})),f=m.join("|");f="("+f.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(x,y,w){var b,v=t._.includes(y,"ib")?h:u,A=t._.includes(y," b")||t._.includes(y," ib")?" ":"",S,E,I;for(y=y.replace(/\s?i?b/,""),S=0;S<=v.suffixes.length;S++)if(E=Math.pow(v.base,S),I=Math.pow(v.base,S+1),x===null||x===0||x>=E&&x<I){A+=v.suffixes[S],E>0&&(x=x/E);break}return b=t._.numberToFormat(x,y,w),b+A},unformat:function(x){var y=t._.stringToNumber(x),w,b;if(y){for(w=u.suffixes.length-1;w>=0;w--){if(t._.includes(x,u.suffixes[w])){b=Math.pow(u.base,w);break}if(t._.includes(x,h.suffixes[w])){b=Math.pow(h.base,w);break}}y*=b||1}return y}})})(),(function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(u,h,m){var f=t.locales[t.options.currentLocale],x={before:h.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:h.match(/([\+|\-|\)|\s|\$]*)$/)[0]},y,w,b;for(h=h.replace(/\s?\$\s?/,""),y=t._.numberToFormat(u,h,m),u>=0?(x.before=x.before.replace(/[\-\(]/,""),x.after=x.after.replace(/[\-\)]/,"")):u<0&&!t._.includes(x.before,"-")&&!t._.includes(x.before,"(")&&(x.before="-"+x.before),b=0;b<x.before.length;b++)switch(w=x.before[b],w){case"$":y=t._.insert(y,f.currency.symbol,b);break;case" ":y=t._.insert(y," ",b+f.currency.symbol.length-1);break}for(b=x.after.length-1;b>=0;b--)switch(w=x.after[b],w){case"$":y=b===x.after.length-1?y+f.currency.symbol:t._.insert(y,f.currency.symbol,-(x.after.length-(1+b)));break;case" ":y=b===x.after.length-1?y+" ":t._.insert(y," ",-(x.after.length-(1+b)+f.currency.symbol.length-1));break}return y}})})(),(function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(u,h,m){var f,x=typeof u=="number"&&!t._.isNaN(u)?u.toExponential():"0e+0",y=x.split("e");return h=h.replace(/e[\+|\-]{1}0/,""),f=t._.numberToFormat(Number(y[0]),h,m),f+"e"+y[1]},unformat:function(u){var h=t._.includes(u,"e+")?u.split("e+"):u.split("e-"),m=Number(h[0]),f=Number(h[1]);f=t._.includes(u,"e-")?f*=-1:f;function x(y,w,b,v){var A=t._.correctionFactor(y,w),S=y*A*(w*A)/(A*A);return S}return t._.reduce([m,Math.pow(10,f)],x,1)}})})(),(function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(u,h,m){var f=t.locales[t.options.currentLocale],x,y=t._.includes(h," o")?" ":"";return h=h.replace(/\s?o/,""),y+=f.ordinal(u),x=t._.numberToFormat(u,h,m),x+y}})})(),(function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(u,h,m){var f=t._.includes(h," %")?" ":"",x;return t.options.scalePercentBy100&&(u=u*100),h=h.replace(/\s?\%/,""),x=t._.numberToFormat(u,h,m),t._.includes(x,")")?(x=x.split(""),x.splice(-1,0,f+"%"),x=x.join("")):x=x+f+"%",x},unformat:function(u){var h=t._.stringToNumber(u);return t.options.scalePercentBy100?h*.01:h}})})(),(function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(u,h,m){var f=Math.floor(u/60/60),x=Math.floor((u-f*60*60)/60),y=Math.round(u-f*60*60-x*60);return f+":"+(x<10?"0"+x:x)+":"+(y<10?"0"+y:y)},unformat:function(u){var h=u.split(":"),m=0;return h.length===3?(m=m+Number(h[0])*60*60,m=m+Number(h[1])*60,m=m+Number(h[2])):h.length===2&&(m=m+Number(h[0])*60,m=m+Number(h[1])),Number(m)}})})(),t})})(Q_)),Q_.exports}var QVe=VVe();const A0=Dr(QVe);function I0(e,...t){const o=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(i=>o.searchParams.append("args[]",i)),`Minified MUI error #${e}; visit ${o} for the full message.`}const $0="$$material";function UVe(e){for(var t=0,o,i=0,a=e.length;a>=4;++i,a-=4)o=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,o=(o&65535)*1540483477+((o>>>16)*59797<<16),o^=o>>>24,t=(o&65535)*1540483477+((o>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(i+2)&255)<<16;case 2:t^=(e.charCodeAt(i+1)&255)<<8;case 1:t^=e.charCodeAt(i)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var WVe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function GVe(e){var t=Object.create(null);return function(o){return t[o]===void 0&&(t[o]=e(o)),t[o]}}var YVe=/[A-Z]|^ms/g,KVe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,U9e=function(e){return e.charCodeAt(1)===45},rX=function(e){return e!=null&&typeof e!="boolean"},HB=GVe(function(e){return U9e(e)?e:e.replace(YVe,"-$&").toLowerCase()}),iX=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(KVe,function(o,i,a){return J2={name:i,styles:a,next:J2},i})}return WVe[e]!==1&&!U9e(e)&&typeof t=="number"&&t!==0?t+"px":t};function fk(e,t,o){if(o==null)return"";var i=o;if(i.__emotion_styles!==void 0)return i;switch(typeof o){case"boolean":return"";case"object":{var a=o;if(a.anim===1)return J2={name:a.name,styles:a.styles,next:J2},a.name;var l=o;if(l.styles!==void 0){var d=l.next;if(d!==void 0)for(;d!==void 0;)J2={name:d.name,styles:d.styles,next:J2},d=d.next;var c=l.styles+";";return c}return qVe(e,t,o)}}var p=o;return p}function qVe(e,t,o){var i="";if(Array.isArray(o))for(var a=0;a<o.length;a++)i+=fk(e,t,o[a])+";";else for(var l in o){var d=o[l];if(typeof d!="object"){var c=d;rX(c)&&(i+=HB(l)+":"+iX(l,c)+";")}else if(Array.isArray(d)&&typeof d[0]=="string"&&t==null)for(var p=0;p<d.length;p++)rX(d[p])&&(i+=HB(l)+":"+iX(l,d[p])+";");else{var u=fk(e,t,d);switch(l){case"animation":case"animationName":{i+=HB(l)+":"+u+";";break}default:i+=l+"{"+u+"}"}}}return i}var nX=/label:\s*([^\s;{]+)\s*(;|$)/g,J2;function ZVe(e,t,o){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var i=!0,a="";J2=void 0;var l=e[0];if(l==null||l.raw===void 0)i=!1,a+=fk(o,t,l);else{var d=l;a+=d[0]}for(var c=1;c<e.length;c++)if(a+=fk(o,t,e[c]),i){var p=l;a+=p[c]}nX.lastIndex=0;for(var u="",h;(h=nX.exec(a))!==null;)u+="-"+h[1];var m=UVe(a)+u;return{name:m,styles:a,next:J2}}var _B={exports:{}},VB,aX;function JVe(){if(aX)return VB;aX=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return VB=e,VB}var QB,sX;function XVe(){if(sX)return QB;sX=1;var e=JVe();function t(){}function o(){}return o.resetWarningCache=t,QB=function(){function i(d,c,p,u,h,m){if(m!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}i.isRequired=i;function a(){return i}var l={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:o,resetWarningCache:t};return l.PropTypes=l,l},QB}var lX;function KW(){return lX||(lX=1,_B.exports=XVe()()),_B.exports}var eQe=KW();const Rt=Dr(eQe);function tQe(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function oQe(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var rQe=(function(){function e(o){var i=this;this._insertTag=function(a){var l;i.tags.length===0?i.insertionPoint?l=i.insertionPoint.nextSibling:i.prepend?l=i.container.firstChild:l=i.before:l=i.tags[i.tags.length-1].nextSibling,i.container.insertBefore(a,l),i.tags.push(a)},this.isSpeedy=o.speedy===void 0?!0:o.speedy,this.tags=[],this.ctr=0,this.nonce=o.nonce,this.key=o.key,this.container=o.container,this.prepend=o.prepend,this.insertionPoint=o.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(o){o.forEach(this._insertTag)},t.insert=function(o){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(oQe(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=tQe(i);try{a.insertRule(o,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(o));this.ctr++},t.flush=function(){this.tags.forEach(function(o){var i;return(i=o.parentNode)==null?void 0:i.removeChild(o)}),this.tags=[],this.ctr=0},e})(),Hs="-ms-",xk="-moz-",gi="-webkit-",W9e="comm",qW="rule",ZW="decl",iQe="@import",G9e="@keyframes",nQe="@layer",aQe=Math.abs,rL=String.fromCharCode,sQe=Object.assign;function lQe(e,t){return ws(e,0)^45?(((t<<2^ws(e,0))<<2^ws(e,1))<<2^ws(e,2))<<2^ws(e,3):0}function Y9e(e){return e.trim()}function dQe(e,t){return(e=t.exec(e))?e[0]:e}function fi(e,t,o){return e.replace(t,o)}function U_(e,t){return e.indexOf(t)}function ws(e,t){return e.charCodeAt(t)|0}function Ky(e,t,o){return e.slice(t,o)}function vu(e){return e.length}function JW(e){return e.length}function Pv(e,t){return t.push(e),e}function cQe(e,t){return e.map(t).join("")}var iL=1,d6=1,K9e=0,gd=0,ma=0,J6="";function nL(e,t,o,i,a,l,d){return{value:e,root:t,parent:o,type:i,props:a,children:l,line:iL,column:d6,length:d,return:""}}function X8(e,t){return sQe(nL("",null,null,"",null,null,0),e,{length:-e.length},t)}function pQe(){return ma}function uQe(){return ma=gd>0?ws(J6,--gd):0,d6--,ma===10&&(d6=1,iL--),ma}function Gd(){return ma=gd<K9e?ws(J6,gd++):0,d6++,ma===10&&(d6=1,iL++),ma}function qu(){return ws(J6,gd)}function M$(){return gd}function eb(e,t){return Ky(J6,e,t)}function qy(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function q9e(e){return iL=d6=1,K9e=vu(J6=e),gd=0,[]}function Z9e(e){return J6="",e}function B$(e){return Y9e(eb(gd-1,W_(e===91?e+2:e===40?e+1:e)))}function hQe(e){for(;(ma=qu())&&ma<33;)Gd();return qy(e)>2||qy(ma)>3?"":" "}function mQe(e,t){for(;--t&&Gd()&&!(ma<48||ma>102||ma>57&&ma<65||ma>70&&ma<97););return eb(e,M$()+(t<6&&qu()==32&&Gd()==32))}function W_(e){for(;Gd();)switch(ma){case e:return gd;case 34:case 39:e!==34&&e!==39&&W_(ma);break;case 40:e===41&&W_(e);break;case 92:Gd();break}return gd}function gQe(e,t){for(;Gd()&&e+ma!==57&&!(e+ma===84&&qu()===47););return"/*"+eb(t,gd-1)+"*"+rL(e===47?e:Gd())}function fQe(e){for(;!qy(qu());)Gd();return eb(e,gd)}function xQe(e){return Z9e(P$("",null,null,null,[""],e=q9e(e),0,[0],e))}function P$(e,t,o,i,a,l,d,c,p){for(var u=0,h=0,m=d,f=0,x=0,y=0,w=1,b=1,v=1,A=0,S="",E=a,I=l,L=i,B=S;b;)switch(y=A,A=Gd()){case 40:if(y!=108&&ws(B,m-1)==58){U_(B+=fi(B$(A),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:B+=B$(A);break;case 9:case 10:case 13:case 32:B+=hQe(y);break;case 92:B+=mQe(M$()-1,7);continue;case 47:switch(qu()){case 42:case 47:Pv(yQe(gQe(Gd(),M$()),t,o),p);break;default:B+="/"}break;case 123*w:c[u++]=vu(B)*v;case 125*w:case 59:case 0:switch(A){case 0:case 125:b=0;case 59+h:v==-1&&(B=fi(B,/\f/g,"")),x>0&&vu(B)-m&&Pv(x>32?cX(B+";",i,o,m-1):cX(fi(B," ","")+";",i,o,m-2),p);break;case 59:B+=";";default:if(Pv(L=dX(B,t,o,u,h,a,c,S,E=[],I=[],m),l),A===123)if(h===0)P$(B,t,L,L,E,l,m,c,I);else switch(f===99&&ws(B,3)===110?100:f){case 100:case 108:case 109:case 115:P$(e,L,L,i&&Pv(dX(e,L,L,0,0,a,c,S,a,E=[],m),I),a,I,m,c,i?E:I);break;default:P$(B,L,L,L,[""],I,0,c,I)}}u=h=x=0,w=v=1,S=B="",m=d;break;case 58:m=1+vu(B),x=y;default:if(w<1){if(A==123)--w;else if(A==125&&w++==0&&uQe()==125)continue}switch(B+=rL(A),A*w){case 38:v=h>0?1:(B+="\f",-1);break;case 44:c[u++]=(vu(B)-1)*v,v=1;break;case 64:qu()===45&&(B+=B$(Gd())),f=qu(),h=m=vu(S=B+=fQe(M$())),A++;break;case 45:y===45&&vu(B)==2&&(w=0)}}return l}function dX(e,t,o,i,a,l,d,c,p,u,h){for(var m=a-1,f=a===0?l:[""],x=JW(f),y=0,w=0,b=0;y<i;++y)for(var v=0,A=Ky(e,m+1,m=aQe(w=d[y])),S=e;v<x;++v)(S=Y9e(w>0?f[v]+" "+A:fi(A,/&\f/g,f[v])))&&(p[b++]=S);return nL(e,t,o,a===0?qW:c,p,u,h)}function yQe(e,t,o){return nL(e,t,o,W9e,rL(pQe()),Ky(e,2,-2),0)}function cX(e,t,o,i){return nL(e,t,o,ZW,Ky(e,0,i),Ky(e,i+1,-1),i)}function O7(e,t){for(var o="",i=JW(e),a=0;a<i;a++)o+=t(e[a],a,e,t)||"";return o}function wQe(e,t,o,i){switch(e.type){case nQe:if(e.children.length)break;case iQe:case ZW:return e.return=e.return||e.value;case W9e:return"";case G9e:return e.return=e.value+"{"+O7(e.children,i)+"}";case qW:e.value=e.props.join(",")}return vu(o=O7(e.children,i))?e.return=e.value+"{"+o+"}":""}function bQe(e){var t=JW(e);return function(o,i,a,l){for(var d="",c=0;c<t;c++)d+=e[c](o,i,a,l)||"";return d}}function vQe(e){return function(t){t.root||(t=t.return)&&e(t)}}var CQe=function(e,t,o){for(var i=0,a=0;i=a,a=qu(),i===38&&a===12&&(t[o]=1),!qy(a);)Gd();return eb(e,gd)},AQe=function(e,t){var o=-1,i=44;do switch(qy(i)){case 0:i===38&&qu()===12&&(t[o]=1),e[o]+=CQe(gd-1,t,o);break;case 2:e[o]+=B$(i);break;case 4:if(i===44){e[++o]=qu()===58?"&\f":"",t[o]=e[o].length;break}default:e[o]+=rL(i)}while(i=Gd());return e},$Qe=function(e,t){return Z9e(AQe(q9e(e),t))},pX=new WeakMap,kQe=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,o=e.parent,i=e.column===o.column&&e.line===o.line;o.type!=="rule";)if(o=o.parent,!o)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!pX.get(o))&&!i){pX.set(e,!0);for(var a=[],l=$Qe(t,a),d=o.props,c=0,p=0;c<l.length;c++)for(var u=0;u<d.length;u++,p++)e.props[p]=a[c]?l[c].replace(/&\f/g,d[u]):d[u]+" "+l[c]}}},SQe=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function J9e(e,t){switch(lQe(e,t)){case 5103:return gi+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return gi+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return gi+e+xk+e+Hs+e+e;case 6828:case 4268:return gi+e+Hs+e+e;case 6165:return gi+e+Hs+"flex-"+e+e;case 5187:return gi+e+fi(e,/(\w+).+(:[^]+)/,gi+"box-$1$2"+Hs+"flex-$1$2")+e;case 5443:return gi+e+Hs+"flex-item-"+fi(e,/flex-|-self/,"")+e;case 4675:return gi+e+Hs+"flex-line-pack"+fi(e,/align-content|flex-|-self/,"")+e;case 5548:return gi+e+Hs+fi(e,"shrink","negative")+e;case 5292:return gi+e+Hs+fi(e,"basis","preferred-size")+e;case 6060:return gi+"box-"+fi(e,"-grow","")+gi+e+Hs+fi(e,"grow","positive")+e;case 4554:return gi+fi(e,/([^-])(transform)/g,"$1"+gi+"$2")+e;case 6187:return fi(fi(fi(e,/(zoom-|grab)/,gi+"$1"),/(image-set)/,gi+"$1"),e,"")+e;case 5495:case 3959:return fi(e,/(image-set\([^]*)/,gi+"$1$`$1");case 4968:return fi(fi(e,/(.+:)(flex-)?(.*)/,gi+"box-pack:$3"+Hs+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+gi+e+e;case 4095:case 3583:case 4068:case 2532:return fi(e,/(.+)-inline(.+)/,gi+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(vu(e)-1-t>6)switch(ws(e,t+1)){case 109:if(ws(e,t+4)!==45)break;case 102:return fi(e,/(.+:)(.+)-([^]+)/,"$1"+gi+"$2-$3$1"+xk+(ws(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~U_(e,"stretch")?J9e(fi(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(ws(e,t+1)!==115)break;case 6444:switch(ws(e,vu(e)-3-(~U_(e,"!important")&&10))){case 107:return fi(e,":",":"+gi)+e;case 101:return fi(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+gi+(ws(e,14)===45?"inline-":"")+"box$3$1"+gi+"$2$3$1"+Hs+"$2box$3")+e}break;case 5936:switch(ws(e,t+11)){case 114:return gi+e+Hs+fi(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return gi+e+Hs+fi(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return gi+e+Hs+fi(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return gi+e+Hs+e+e}return e}var EQe=function(e,t,o,i){if(e.length>-1&&!e.return)switch(e.type){case ZW:e.return=J9e(e.value,e.length);break;case G9e:return O7([X8(e,{value:fi(e.value,"@","@"+gi)})],i);case qW:if(e.length)return cQe(e.props,function(a){switch(dQe(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return O7([X8(e,{props:[fi(a,/:(read-\w+)/,":"+xk+"$1")]})],i);case"::placeholder":return O7([X8(e,{props:[fi(a,/:(plac\w+)/,":"+gi+"input-$1")]}),X8(e,{props:[fi(a,/:(plac\w+)/,":"+xk+"$1")]}),X8(e,{props:[fi(a,/:(plac\w+)/,Hs+"input-$1")]})],i)}return""})}},LQe=[EQe],X9e=function(e){var t=e.key;if(t==="css"){var o=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(o,function(y){var w=y.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=e.stylisPlugins||LQe,a={},l,d=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(y){for(var w=y.getAttribute("data-emotion").split(" "),b=1;b<w.length;b++)a[w[b]]=!0;d.push(y)});var c,p=[kQe,SQe];{var u,h=[wQe,vQe(function(y){u.insert(y)})],m=bQe(p.concat(i,h)),f=function(y){return O7(xQe(y),m)};c=function(y,w,b,v){u=b,f(y?y+"{"+w.styles+"}":w.styles),v&&(x.inserted[w.name]=!0)}}var x={key:t,sheet:new rQe({key:t,container:l,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:c};return x.sheet.hydrate(d),x};function jQe(e){return e==null||Object.keys(e).length===0}function exe(e){const{styles:t,defaultTheme:o={}}=e,i=typeof t=="function"?a=>t(jQe(a)?o:a):t;return s.jsx(Jw,{styles:i})}function IQe(e,t){return n(e,t)}function MQe(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const uX=[];function um(e){return uX[0]=e,ZVe(uX)}var hX={exports:{}},Di={},mX;function BQe(){if(mX)return Di;mX=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),d=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function y(w){if(typeof w=="object"&&w!==null){var b=w.$$typeof;switch(b){case e:switch(w=w.type,w){case o:case a:case i:case p:case u:case f:return w;default:switch(w=w&&w.$$typeof,w){case d:case c:case m:case h:return w;case l:return w;default:return b}}case t:return b}}}return Di.ContextConsumer=l,Di.ContextProvider=d,Di.Element=e,Di.ForwardRef=c,Di.Fragment=o,Di.Lazy=m,Di.Memo=h,Di.Portal=t,Di.Profiler=a,Di.StrictMode=i,Di.Suspense=p,Di.SuspenseList=u,Di.isContextConsumer=function(w){return y(w)===l},Di.isContextProvider=function(w){return y(w)===d},Di.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Di.isForwardRef=function(w){return y(w)===c},Di.isFragment=function(w){return y(w)===o},Di.isLazy=function(w){return y(w)===m},Di.isMemo=function(w){return y(w)===h},Di.isPortal=function(w){return y(w)===t},Di.isProfiler=function(w){return y(w)===a},Di.isStrictMode=function(w){return y(w)===i},Di.isSuspense=function(w){return y(w)===p},Di.isSuspenseList=function(w){return y(w)===u},Di.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===o||w===a||w===i||w===p||w===u||typeof w=="object"&&w!==null&&(w.$$typeof===m||w.$$typeof===h||w.$$typeof===d||w.$$typeof===l||w.$$typeof===c||w.$$typeof===x||w.getModuleId!==void 0)},Di.typeOf=y,Di}var gX;function PQe(){return gX||(gX=1,hX.exports=BQe()),hX.exports}var txe=PQe();function s0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function oxe(e){if(g.isValidElement(e)||txe.isValidElementType(e)||!s0(e))return e;const t={};return Object.keys(e).forEach(o=>{t[o]=oxe(e[o])}),t}function Xs(e,t,o={clone:!0}){const i=o.clone?{...e}:e;return s0(e)&&s0(t)&&Object.keys(t).forEach(a=>{g.isValidElement(t[a])||txe.isValidElementType(t[a])?i[a]=t[a]:s0(t[a])&&Object.prototype.hasOwnProperty.call(e,a)&&s0(e[a])?i[a]=Xs(e[a],t[a],o):o.clone?i[a]=s0(t[a])?oxe(t[a]):t[a]:i[a]=t[a]}),i}const DQe=e=>{const t=Object.keys(e).map(o=>({key:o,val:e[o]}))||[];return t.sort((o,i)=>o.val-i.val),t.reduce((o,i)=>({...o,[i.key]:i.val}),{})};function TQe(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:o="px",step:i=5,...a}=e,l=DQe(t),d=Object.keys(l);function c(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${o})`}function p(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-i/100}${o})`}function u(f,x){const y=d.indexOf(x);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${o}) and (max-width:${(y!==-1&&typeof t[d[y]]=="number"?t[d[y]]:x)-i/100}${o})`}function h(f){return d.indexOf(f)+1<d.length?u(f,d[d.indexOf(f)+1]):c(f)}function m(f){const x=d.indexOf(f);return x===0?c(d[1]):x===d.length-1?p(d[x]):u(f,d[d.indexOf(f)+1]).replace("@media","@media not all and")}return{keys:d,values:l,up:c,down:p,between:u,only:h,not:m,unit:o,...a}}function fX(e,t){if(!e.containerQueries)return t;const o=Object.keys(t).filter(i=>i.startsWith("@container")).sort((i,a)=>{const l=/min-width:\s*([0-9.]+)/;return+(i.match(l)?.[1]||0)-+(a.match(l)?.[1]||0)});return o.length?o.reduce((i,a)=>{const l=t[a];return delete i[a],i[a]=l,i},{...t}):t}function zQe(e,t){return t==="@"||t.startsWith("@")&&(e.some(o=>t.startsWith(`@${o}`))||!!t.match(/^@\d/))}function RQe(e,t){const o=t.match(/^@([^/]+)?\/?(.+)?$/);if(!o)return null;const[,i,a]=o,l=Number.isNaN(+i)?i||0:+i;return e.containerQueries(a).up(l)}function FQe(e){const t=(l,d)=>l.replace("@media",d?`@container ${d}`:"@container");function o(l,d){l.up=(...c)=>t(e.breakpoints.up(...c),d),l.down=(...c)=>t(e.breakpoints.down(...c),d),l.between=(...c)=>t(e.breakpoints.between(...c),d),l.only=(...c)=>t(e.breakpoints.only(...c),d),l.not=(...c)=>{const p=t(e.breakpoints.not(...c),d);return p.includes("not all and")?p.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):p}}const i={},a=l=>(o(i,l),i);return o(a),{...e,containerQueries:a}}const OQe={borderRadius:4};function by(e,t){return t?Xs(e,t,{clone:!1}):e}const aL={xs:0,sm:600,md:900,lg:1200,xl:1536},xX={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${aL[e]}px)`},NQe={containerQueries:e=>({up:t=>{let o=typeof t=="number"?t:aL[t]||t;return typeof o=="number"&&(o=`${o}px`),e?`@container ${e} (min-width:${o})`:`@container (min-width:${o})`}})};function M0(e,t,o){const i=e.theme||{};if(Array.isArray(t)){const a=i.breakpoints||xX;return t.reduce((l,d,c)=>(l[a.up(a.keys[c])]=o(t[c]),l),{})}if(typeof t=="object"){const a=i.breakpoints||xX;return Object.keys(t).reduce((l,d)=>{if(zQe(a.keys,d)){const c=RQe(i.containerQueries?i:NQe,d);c&&(l[c]=o(t[d],d))}else if(Object.keys(a.values||aL).includes(d)){const c=a.up(d);l[c]=o(t[d],d)}else{const c=d;l[c]=t[c]}return l},{})}return o(t)}function HQe(e={}){return e.keys?.reduce((t,o)=>{const i=e.up(o);return t[i]={},t},{})||{}}function yX(e,t){return e.reduce((o,i)=>{const a=o[i];return(!a||Object.keys(a).length===0)&&delete o[i],o},t)}function ir(e){if(typeof e!="string")throw new Error(I0(7));return e.charAt(0).toUpperCase()+e.slice(1)}function sL(e,t,o=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&o){const i=`vars.${t}`.split(".").reduce((a,l)=>a&&a[l]?a[l]:null,e);if(i!=null)return i}return t.split(".").reduce((i,a)=>i&&i[a]!=null?i[a]:null,e)}function yk(e,t,o,i=o){let a;return typeof e=="function"?a=e(o):Array.isArray(e)?a=e[o]||i:a=sL(e,o)||i,t&&(a=t(a,i,e)),a}function oa(e){const{prop:t,cssProperty:o=e.prop,themeKey:i,transform:a}=e,l=d=>{if(d[t]==null)return null;const c=d[t],p=d.theme,u=sL(p,i)||{};return M0(d,c,h=>{let m=yk(u,a,h);return h===m&&typeof h=="string"&&(m=yk(u,a,`${t}${h==="default"?"":ir(h)}`,h)),o===!1?m:{[o]:m}})};return l.propTypes={},l.filterProps=[t],l}function _Qe(e){const t={};return o=>(t[o]===void 0&&(t[o]=e(o)),t[o])}const VQe={m:"margin",p:"padding"},QQe={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},wX={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},UQe=_Qe(e=>{if(e.length>2)if(wX[e])e=wX[e];else return[e];const[t,o]=e.split(""),i=VQe[t],a=QQe[o]||"";return Array.isArray(a)?a.map(l=>i+l):[i+a]}),XW=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],eG=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...XW,...eG];function tb(e,t,o,i){const a=sL(e,t,!0)??o;return typeof a=="number"||typeof a=="string"?l=>typeof l=="string"?l:typeof a=="string"?a.startsWith("var(")&&l===0?0:a.startsWith("var(")&&l===1?a:`calc(${l} * ${a})`:a*l:Array.isArray(a)?l=>{if(typeof l=="string")return l;const d=Math.abs(l),c=a[d];return l>=0?c:typeof c=="number"?-c:typeof c=="string"&&c.startsWith("var(")?`calc(-1 * ${c})`:`-${c}`}:typeof a=="function"?a:(()=>{})}function tG(e){return tb(e,"spacing",8)}function ob(e,t){return typeof t=="string"||t==null?t:e(t)}function WQe(e,t){return o=>e.reduce((i,a)=>(i[a]=ob(t,o),i),{})}function GQe(e,t,o,i){if(!t.includes(o))return null;const a=UQe(o),l=WQe(a,i),d=e[o];return M0(e,d,l)}function rxe(e,t){const o=tG(e.theme);return Object.keys(e).map(i=>GQe(e,t,i,o)).reduce(by,{})}function In(e){return rxe(e,XW)}In.propTypes={};In.filterProps=XW;function Mn(e){return rxe(e,eG)}Mn.propTypes={};Mn.filterProps=eG;function ixe(e=8,t=tG({spacing:e})){if(e.mui)return e;const o=(...i)=>(i.length===0?[1]:i).map(a=>{const l=t(a);return typeof l=="number"?`${l}px`:l}).join(" ");return o.mui=!0,o}function lL(...e){const t=e.reduce((i,a)=>(a.filterProps.forEach(l=>{i[l]=a}),i),{}),o=i=>Object.keys(i).reduce((a,l)=>t[l]?by(a,t[l](i)):a,{});return o.propTypes={},o.filterProps=e.reduce((i,a)=>i.concat(a.filterProps),[]),o}function Mc(e){return typeof e!="number"?e:`${e}px solid`}function Jc(e,t){return oa({prop:e,themeKey:"borders",transform:t})}const YQe=Jc("border",Mc),KQe=Jc("borderTop",Mc),qQe=Jc("borderRight",Mc),ZQe=Jc("borderBottom",Mc),JQe=Jc("borderLeft",Mc),XQe=Jc("borderColor"),eUe=Jc("borderTopColor"),tUe=Jc("borderRightColor"),oUe=Jc("borderBottomColor"),rUe=Jc("borderLeftColor"),iUe=Jc("outline",Mc),nUe=Jc("outlineColor"),dL=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=tb(e.theme,"shape.borderRadius",4),o=i=>({borderRadius:ob(t,i)});return M0(e,e.borderRadius,o)}return null};dL.propTypes={};dL.filterProps=["borderRadius"];lL(YQe,KQe,qQe,ZQe,JQe,XQe,eUe,tUe,oUe,rUe,dL,iUe,nUe);const cL=e=>{if(e.gap!==void 0&&e.gap!==null){const t=tb(e.theme,"spacing",8),o=i=>({gap:ob(t,i)});return M0(e,e.gap,o)}return null};cL.propTypes={};cL.filterProps=["gap"];const pL=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=tb(e.theme,"spacing",8),o=i=>({columnGap:ob(t,i)});return M0(e,e.columnGap,o)}return null};pL.propTypes={};pL.filterProps=["columnGap"];const uL=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=tb(e.theme,"spacing",8),o=i=>({rowGap:ob(t,i)});return M0(e,e.rowGap,o)}return null};uL.propTypes={};uL.filterProps=["rowGap"];const aUe=oa({prop:"gridColumn"}),sUe=oa({prop:"gridRow"}),lUe=oa({prop:"gridAutoFlow"}),dUe=oa({prop:"gridAutoColumns"}),cUe=oa({prop:"gridAutoRows"}),pUe=oa({prop:"gridTemplateColumns"}),uUe=oa({prop:"gridTemplateRows"}),hUe=oa({prop:"gridTemplateAreas"}),mUe=oa({prop:"gridArea"});lL(cL,pL,uL,aUe,sUe,lUe,dUe,cUe,pUe,uUe,hUe,mUe);function N7(e,t){return t==="grey"?t:e}const gUe=oa({prop:"color",themeKey:"palette",transform:N7}),fUe=oa({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:N7}),xUe=oa({prop:"backgroundColor",themeKey:"palette",transform:N7});lL(gUe,fUe,xUe);function _d(e){return e<=1&&e!==0?`${e*100}%`:e}const yUe=oa({prop:"width",transform:_d}),oG=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=o=>{const i=e.theme?.breakpoints?.values?.[o]||aL[o];return i?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:_d(o)}};return M0(e,e.maxWidth,t)}return null};oG.filterProps=["maxWidth"];const wUe=oa({prop:"minWidth",transform:_d}),bUe=oa({prop:"height",transform:_d}),vUe=oa({prop:"maxHeight",transform:_d}),CUe=oa({prop:"minHeight",transform:_d});oa({prop:"size",cssProperty:"width",transform:_d});oa({prop:"size",cssProperty:"height",transform:_d});const AUe=oa({prop:"boxSizing"});lL(yUe,oG,wUe,bUe,vUe,CUe,AUe);const hL={border:{themeKey:"borders",transform:Mc},borderTop:{themeKey:"borders",transform:Mc},borderRight:{themeKey:"borders",transform:Mc},borderBottom:{themeKey:"borders",transform:Mc},borderLeft:{themeKey:"borders",transform:Mc},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Mc},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:dL},color:{themeKey:"palette",transform:N7},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:N7},backgroundColor:{themeKey:"palette",transform:N7},p:{style:Mn},pt:{style:Mn},pr:{style:Mn},pb:{style:Mn},pl:{style:Mn},px:{style:Mn},py:{style:Mn},padding:{style:Mn},paddingTop:{style:Mn},paddingRight:{style:Mn},paddingBottom:{style:Mn},paddingLeft:{style:Mn},paddingX:{style:Mn},paddingY:{style:Mn},paddingInline:{style:Mn},paddingInlineStart:{style:Mn},paddingInlineEnd:{style:Mn},paddingBlock:{style:Mn},paddingBlockStart:{style:Mn},paddingBlockEnd:{style:Mn},m:{style:In},mt:{style:In},mr:{style:In},mb:{style:In},ml:{style:In},mx:{style:In},my:{style:In},margin:{style:In},marginTop:{style:In},marginRight:{style:In},marginBottom:{style:In},marginLeft:{style:In},marginX:{style:In},marginY:{style:In},marginInline:{style:In},marginInlineStart:{style:In},marginInlineEnd:{style:In},marginBlock:{style:In},marginBlockStart:{style:In},marginBlockEnd:{style:In},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:cL},rowGap:{style:uL},columnGap:{style:pL},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:_d},maxWidth:{style:oG},minWidth:{transform:_d},height:{transform:_d},maxHeight:{transform:_d},minHeight:{transform:_d},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function $Ue(...e){const t=e.reduce((i,a)=>i.concat(Object.keys(a)),[]),o=new Set(t);return e.every(i=>o.size===Object.keys(i).length)}function kUe(e,t){return typeof e=="function"?e(t):e}function SUe(){function e(o,i,a,l){const d={[o]:i,theme:a},c=l[o];if(!c)return{[o]:i};const{cssProperty:p=o,themeKey:u,transform:h,style:m}=c;if(i==null)return null;if(u==="typography"&&i==="inherit")return{[o]:i};const f=sL(a,u)||{};return m?m(d):M0(d,i,x=>{let y=yk(f,h,x);return x===y&&typeof x=="string"&&(y=yk(f,h,`${o}${x==="default"?"":ir(x)}`,x)),p===!1?y:{[p]:y}})}function t(o){const{sx:i,theme:a={},nested:l}=o||{};if(!i)return null;const d=a.unstable_sxConfig??hL;function c(p){let u=p;if(typeof p=="function")u=p(a);else if(typeof p!="object")return p;if(!u)return null;const h=HQe(a.breakpoints),m=Object.keys(h);let f=h;return Object.keys(u).forEach(x=>{const y=kUe(u[x],a);if(y!=null)if(typeof y=="object")if(d[x])f=by(f,e(x,y,a,d));else{const w=M0({theme:a},y,b=>({[x]:b}));$Ue(w,y)?f[x]=t({sx:y,theme:a,nested:!0}):f=by(f,w)}else f=by(f,e(x,y,a,d))}),!l&&a.modularCssLayers?{"@layer sx":fX(a,yX(m,f))}:fX(a,yX(m,f))}return Array.isArray(i)?i.map(c):c(i)}return t}const z4=SUe();z4.filterProps=["sx"];function EUe(e,t){const o=this;if(o.vars){if(!o.colorSchemes?.[e]||typeof o.getColorSchemeSelector!="function")return{};let i=o.getColorSchemeSelector(e);return i==="&"?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return o.palette.mode===e?t:{}}function rG(e={},...t){const{breakpoints:o={},palette:i={},spacing:a,shape:l={},...d}=e,c=TQe(o),p=ixe(a);let u=Xs({breakpoints:c,direction:"ltr",components:{},palette:{mode:"light",...i},spacing:p,shape:{...OQe,...l}},d);return u=FQe(u),u.applyStyles=EUe,u=t.reduce((h,m)=>Xs(h,m),u),u.unstable_sxConfig={...hL,...d?.unstable_sxConfig},u.unstable_sx=function(h){return z4({sx:h,theme:this})},u}function LUe(e){return Object.keys(e).length===0}function iG(e=null){const t=g.useContext(N9e);return!t||LUe(t)?e:t}const jUe=rG();function nxe(e=jUe){return iG(e)}function bX(e){const t=um(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function axe({styles:e,themeId:t,defaultTheme:o={}}){const i=nxe(o),a=t&&i[t]||i;let l=typeof e=="function"?e(a):e;return a.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>bX(typeof d=="function"?d(a):d)):l=bX(l)),s.jsx(exe,{styles:l})}const vX=e=>e,IUe=()=>{let e=vX;return{configure(t){e=t},generate(t){return e(t)},reset(){e=vX}}},MUe=IUe();function sxe(e){var t,o,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(o=sxe(e[t]))&&(i&&(i+=" "),i+=o)}else for(o in e)e[o]&&(i&&(i+=" "),i+=o);return i}function No(){for(var e,t,o=0,i="",a=arguments.length;o<a;o++)(e=arguments[o])&&(t=sxe(e))&&(i&&(i+=" "),i+=t);return i}const BUe={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function ui(e,t,o="Mui"){const i=BUe[t];return i?`${o}-${i}`:`${MUe.generate(e)}-${t}`}function ti(e,t,o="Mui"){const i={};return t.forEach(a=>{i[a]=ui(e,a,o)}),i}function lxe(e){const{variants:t,...o}=e,i={variants:t,style:um(o),isProcessed:!0};return i.style===o||t&&t.forEach(a=>{typeof a.style!="function"&&(a.style=um(a.style))}),i}const PUe=rG();function UB(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function a4(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function DUe(e){return e?(t,o)=>o[e]:null}function TUe(e,t,o){e.theme=FUe(e.theme)?o:e.theme[t]||e.theme}function D$(e,t,o){const i=typeof t=="function"?t(e):t;if(Array.isArray(i))return i.flatMap(a=>D$(e,a,o));if(Array.isArray(i?.variants)){let a;if(i.isProcessed)a=o?a4(i.style,o):i.style;else{const{variants:l,...d}=i;a=o?a4(um(d),o):d}return dxe(e,i.variants,[a],o)}return i?.isProcessed?o?a4(um(i.style),o):i.style:o?a4(um(i),o):i}function dxe(e,t,o=[],i=void 0){let a;e:for(let l=0;l<t.length;l+=1){const d=t[l];if(typeof d.props=="function"){if(a??={...e,...e.ownerState,ownerState:e.ownerState},!d.props(a))continue}else for(const c in d.props)if(e[c]!==d.props[c]&&e.ownerState?.[c]!==d.props[c])continue e;typeof d.style=="function"?(a??={...e,...e.ownerState,ownerState:e.ownerState},o.push(i?a4(um(d.style(a)),i):d.style(a))):o.push(i?a4(um(d.style),i):d.style)}return o}function zUe(e={}){const{themeId:t,defaultTheme:o=PUe,rootShouldForwardProp:i=UB,slotShouldForwardProp:a=UB}=e;function l(d){TUe(d,t,o)}return(d,c={})=>{MQe(d,I=>I.filter(L=>L!==z4));const{name:p,slot:u,skipVariantsResolver:h,skipSx:m,overridesResolver:f=DUe(NUe(u)),...x}=c,y=p&&p.startsWith("Mui")||u?"components":"custom",w=h!==void 0?h:u&&u!=="Root"&&u!=="root"||!1,b=m||!1;let v=UB;u==="Root"||u==="root"?v=i:u?v=a:OUe(d)&&(v=void 0);const A=IQe(d,{shouldForwardProp:v,label:RUe(),...x}),S=I=>{if(I.__emotion_real===I)return I;if(typeof I=="function")return function(L){return D$(L,I,L.theme.modularCssLayers?y:void 0)};if(s0(I)){const L=lxe(I);return function(B){return L.variants?D$(B,L,B.theme.modularCssLayers?y:void 0):B.theme.modularCssLayers?a4(L.style,y):L.style}}return I},E=(...I)=>{const L=[],B=I.map(S),P=[];if(L.push(l),p&&f&&P.push(function(O){const F=O.theme.components?.[p]?.styleOverrides;if(!F)return null;const Y={};for(const Z in F)Y[Z]=D$(O,F[Z],O.theme.modularCssLayers?"theme":void 0);return f(O,Y)}),p&&!w&&P.push(function(O){const F=O.theme?.components?.[p]?.variants;return F?dxe(O,F,[],O.theme.modularCssLayers?"theme":void 0):null}),b||P.push(z4),Array.isArray(B[0])){const O=B.shift(),F=new Array(L.length).fill(""),Y=new Array(P.length).fill("");let Z;Z=[...F,...O,...Y],Z.raw=[...F,...O.raw,...Y],L.unshift(Z)}const D=[...L,...B,...P],T=A(...D);return d.muiName&&(T.muiName=d.muiName),T};return A.withConfig&&(E.withConfig=A.withConfig),E}}function RUe(e,t){return void 0}function FUe(e){for(const t in e)return!1;return!0}function OUe(e){return typeof e=="string"&&e.charCodeAt(0)>96}function NUe(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function G_(e,t,o=!1){const i={...t};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const l=a;if(l==="components"||l==="slots")i[l]={...e[l],...i[l]};else if(l==="componentsProps"||l==="slotProps"){const d=e[l],c=t[l];if(!c)i[l]=d||{};else if(!d)i[l]=c;else{i[l]={...c};for(const p in d)if(Object.prototype.hasOwnProperty.call(d,p)){const u=p;i[l][u]=G_(d[u],c[u],o)}}}else l==="className"&&o&&t.className?i.className=No(e?.className,t?.className):l==="style"&&o&&t.style?i.style={...e?.style,...t?.style}:i[l]===void 0&&(i[l]=e[l])}return i}const Xd=typeof window<"u"?g.useLayoutEffect:g.useEffect;function HUe(e,t=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,o))}function nG(e,t=0,o=1){return HUe(e,t,o)}function _Ue(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let o=e.match(t);return o&&o[0].length===1&&(o=o.map(i=>i+i)),o?`rgb${o.length===4?"a":""}(${o.map((i,a)=>a<3?parseInt(i,16):Math.round(parseInt(i,16)/255*1e3)/1e3).join(", ")})`:""}function Em(e){if(e.type)return e;if(e.charAt(0)==="#")return Em(_Ue(e));const t=e.indexOf("("),o=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(o))throw new Error(I0(9,e));let i=e.substring(t+1,e.length-1),a;if(o==="color"){if(i=i.split(" "),a=i.shift(),i.length===4&&i[3].charAt(0)==="/"&&(i[3]=i[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(a))throw new Error(I0(10,a))}else i=i.split(",");return i=i.map(l=>parseFloat(l)),{type:o,values:i,colorSpace:a}}const VUe=e=>{const t=Em(e);return t.values.slice(0,3).map((o,i)=>t.type.includes("hsl")&&i!==0?`${o}%`:o).join(" ")},Vx=(e,t)=>{try{return VUe(e)}catch{return e}};function mL(e){const{type:t,colorSpace:o}=e;let{values:i}=e;return t.includes("rgb")?i=i.map((a,l)=>l<3?parseInt(a,10):a):t.includes("hsl")&&(i[1]=`${i[1]}%`,i[2]=`${i[2]}%`),t.includes("color")?i=`${o} ${i.join(" ")}`:i=`${i.join(", ")}`,`${t}(${i})`}function cxe(e){e=Em(e);const{values:t}=e,o=t[0],i=t[1]/100,a=t[2]/100,l=i*Math.min(a,1-a),d=(u,h=(u+o/30)%12)=>a-l*Math.max(Math.min(h-3,9-h,1),-1);let c="rgb";const p=[Math.round(d(0)*255),Math.round(d(8)*255),Math.round(d(4)*255)];return e.type==="hsla"&&(c+="a",p.push(t[3])),mL({type:c,values:p})}function Y_(e){e=Em(e);let t=e.type==="hsl"||e.type==="hsla"?Em(cxe(e)).values:e.values;return t=t.map(o=>(e.type!=="color"&&(o/=255),o<=.03928?o/12.92:((o+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function QUe(e,t){const o=Y_(e),i=Y_(t);return(Math.max(o,i)+.05)/(Math.min(o,i)+.05)}function wk(e,t){return e=Em(e),t=nG(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,mL(e)}function Yg(e,t,o){try{return wk(e,t)}catch{return e}}function gL(e,t){if(e=Em(e),t=nG(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let o=0;o<3;o+=1)e.values[o]*=1-t;return mL(e)}function ki(e,t,o){try{return gL(e,t)}catch{return e}}function fL(e,t){if(e=Em(e),t=nG(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let o=0;o<3;o+=1)e.values[o]+=(255-e.values[o])*t;else if(e.type.includes("color"))for(let o=0;o<3;o+=1)e.values[o]+=(1-e.values[o])*t;return mL(e)}function Si(e,t,o){try{return fL(e,t)}catch{return e}}function UUe(e,t=.15){return Y_(e)>.5?gL(e,t):fL(e,t)}function Dv(e,t,o){try{return UUe(e,t)}catch{return e}}const pxe=g.createContext(null);function aG(){return g.useContext(pxe)}const WUe=typeof Symbol=="function"&&Symbol.for,GUe=WUe?Symbol.for("mui.nested"):"__THEME_NESTED__";function YUe(e,t){return typeof t=="function"?t(e):{...e,...t}}function KUe(e){const{children:t,theme:o}=e,i=aG(),a=g.useMemo(()=>{const l=i===null?{...o}:YUe(i,o);return l!=null&&(l[GUe]=i!==null),l},[o,i]);return s.jsx(pxe.Provider,{value:a,children:t})}const uxe=g.createContext();function qUe({value:e,...t}){return s.jsx(uxe.Provider,{value:e??!0,...t})}const X6=()=>g.useContext(uxe)??!1,hxe=g.createContext(void 0);function ZUe({value:e,children:t}){return s.jsx(hxe.Provider,{value:e,children:t})}function JUe(e){const{theme:t,name:o,props:i}=e;if(!t||!t.components||!t.components[o])return i;const a=t.components[o];return a.defaultProps?G_(a.defaultProps,i,t.components.mergeClassNameAndStyle):!a.styleOverrides&&!a.variants?G_(a,i,t.components.mergeClassNameAndStyle):i}function XUe({props:e,name:t}){const o=g.useContext(hxe);return JUe({props:e,name:t,theme:{components:o}})}let CX=0;function eWe(e){const[t,o]=g.useState(e),i=e||t;return g.useEffect(()=>{t==null&&(CX+=1,o(`mui-${CX}`))},[t]),i}const tWe={...kHe},AX=tWe.useId;function xL(e){if(AX!==void 0){const t=AX();return e??t}return eWe(e)}function oWe(e){const t=iG(),o=xL()||"",{modularCssLayers:i}=e;let a="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||t!==null?a="":typeof i=="string"?a=i.replace(/mui(?!\.)/g,a):a=`@layer ${a};`,Xd(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(a){if(d&&d.hasAttribute?.("data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===o)return;const c=document.createElement("style");c.setAttribute("data-mui-layer-order",o),c.textContent=a,l.prepend(c)}else l.querySelector(`style[data-mui-layer-order="${o}"]`)?.remove()},[a,o]),a?s.jsx(axe,{styles:a}):null}const $X={};function kX(e,t,o,i=!1){return g.useMemo(()=>{const a=e&&t[e]||t;if(typeof o=="function"){const l=o(a),d=e?{...t,[e]:l}:l;return i?()=>d:d}return e?{...t,[e]:o}:{...t,...o}},[e,t,o,i])}function mxe(e){const{children:t,theme:o,themeId:i}=e,a=iG($X),l=aG()||$X,d=kX(i,a,o),c=kX(i,l,o,!0),p=(i?d[i]:d).direction==="rtl",u=oWe(d);return s.jsx(KUe,{theme:c,children:s.jsx(N9e.Provider,{value:d,children:s.jsx(qUe,{value:p,children:s.jsxs(ZUe,{value:i?d[i].components:d.components,children:[u,t]})})})})}const SX={theme:void 0};function rWe(e){let t,o;return function(i){let a=t;return(a===void 0||i.theme!==o)&&(SX.theme=i.theme,a=lxe(e(SX)),t=a,o=i.theme),a}}const sG="mode",lG="color-scheme",iWe="data-color-scheme";function nWe(e){const{defaultMode:t="system",defaultLightColorScheme:o="light",defaultDarkColorScheme:i="dark",modeStorageKey:a=sG,colorSchemeStorageKey:l=lG,attribute:d=iWe,colorSchemeNode:c="document.documentElement",nonce:p}=e||{};let u="",h=d;if(d==="class"&&(h=".%s"),d==="data"&&(h="[data-%s]"),h.startsWith(".")){const f=h.substring(1);u+=`${c}.classList.remove('${f}'.replace('%s', light), '${f}'.replace('%s', dark));
3
3
  ${c}.classList.add('${f}'.replace('%s', colorScheme));`}const m=h.match(/\[([^[\]]+)\]/);if(m){const[f,x]=m[1].split("=");x||(u+=`${c}.removeAttribute('${f}'.replace('%s', light));
4
4
  ${c}.removeAttribute('${f}'.replace('%s', dark));`),u+=`
5
5
  ${c}.setAttribute('${f}'.replace('%s', colorScheme), ${x?`${x}.replace('%s', colorScheme)`:'""'});`}else h!==".%s"&&(u+=`${c}.setAttribute('${h}', colorScheme);`);return s.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(function() {
@@ -243,7 +243,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
243
243
  `+se:"")+"\n```"},regExp:/^```(\w{1,10})?\s/,replace:Z(he=>t.$createCodeNode(he?he[1]:void 0)),type:"element"},H={dependencies:[o.ListNode,o.ListItemNode],export:(he,se)=>o.$isListNode(he)?U(he,se,0):null,regExp:/^(\s*)[-*+]\s/,replace:R("bullet"),type:"element"},ee={dependencies:[o.ListNode,o.ListItemNode],export:(he,se)=>o.$isListNode(he)?U(he,se,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:R("check"),type:"element"},K={dependencies:[o.ListNode,o.ListItemNode],export:(he,se)=>o.$isListNode(he)?U(he,se,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:R("number"),type:"element"},G={format:["code"],tag:"`",type:"text-format"},J={format:["highlight"],tag:"==",type:"text-format"},X={format:["bold","italic"],tag:"***",type:"text-format"},le={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},xe={format:["bold"],tag:"**",type:"text-format"},me={format:["bold"],intraword:!1,tag:"__",type:"text-format"},ce={format:["strikethrough"],tag:"~~",type:"text-format"},de={format:["italic"],tag:"*",type:"text-format"},we={format:["italic"],intraword:!1,tag:"_",type:"text-format"},Ae={dependencies:[l.LinkNode],export:(he,se,fe)=>{if(!l.$isLinkNode(he))return null;se=(se=he.getTitle())?`[${he.getTextContent()}](${he.getURL()} "${se}")`:`[${he.getTextContent()}](${he.getURL()})`;const Le=he.getFirstChild();return he.getChildrenSize()===1&&e.$isTextNode(Le)?fe(Le,se):se},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(he,se)=>{const[,fe,Le,$e]=se;se=l.$createLinkNode(Le,{title:$e});const Ve=e.$createTextNode(fe);Ve.setFormat(he.getFormat()),se.append(Ve),he.replace(se)},trigger:")",type:"text-match"},ae=[_,N,z,H,K],pe=[G,X,le,xe,me,J,de,we,ce],ie=[Ae],ve=[...ae,...pe,...ie];return en.$convertFromMarkdownString=function(he,se=ve,fe){return B(se)(he,fe)},en.$convertToMarkdownString=function(he=ve,se){return u(he)(se)},en.BOLD_ITALIC_STAR=X,en.BOLD_ITALIC_UNDERSCORE=le,en.BOLD_STAR=xe,en.BOLD_UNDERSCORE=me,en.CHECK_LIST=ee,en.CODE=z,en.ELEMENT_TRANSFORMERS=ae,en.HEADING=_,en.HIGHLIGHT=J,en.INLINE_CODE=G,en.ITALIC_STAR=de,en.ITALIC_UNDERSCORE=we,en.LINK=Ae,en.ORDERED_LIST=K,en.QUOTE=N,en.STRIKETHROUGH=ce,en.TEXT_FORMAT_TRANSFORMERS=pe,en.TEXT_MATCH_TRANSFORMERS=ie,en.TRANSFORMERS=ve,en.UNORDERED_LIST=H,en.registerMarkdownShortcuts=function(he,se=ve){let fe=c(se),Le=d(fe.textFormat,({tag:Ve})=>Ve[Ve.length-1]),$e=d(fe.textMatch,({trigger:Ve})=>Ve);for(let Ve of se)if(se=Ve.type,(se==="element"||se==="text-match")&&!he.hasNodes(Ve.dependencies))throw Error("Minified Lexical error #79; visit https://lexical.dev/docs/error?code=79 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");return he.registerUpdateListener(({tags:Ve,dirtyLeaves:je,editorState:Ne,prevEditorState:Pe})=>{if(!Ve.has("historic")){var Be=Ne.read(e.$getSelection);if(Ve=Pe.read(e.$getSelection),e.$isRangeSelection(Ve)&&e.$isRangeSelection(Be)&&Be.isCollapsed()){Pe=Be.anchor.key;var De=Be.anchor.offset,Te=Ne._nodeMap.get(Pe);e.$isTextNode(Te)&&je.has(Pe)&&(De===1||De===Ve.anchor.offset+1)&&he.update(()=>{if(!Te.hasFormat("code")){var Se=Te.getParent();if(Se!==null&&!t.$isCodeNode(Se)){var _e=Be.anchor.offset;e:{var Je=fe.element,ot=Se.getParent();if(e.$isRootOrShadowRoot(ot)&&Se.getFirstChild()===Te&&(ot=Te.getTextContent(),ot[_e-1]===" ")){for(let{regExp:jt,replace:Pt}of Je)if((Je=ot.match(jt))&&Je[0].length===_e){ot=Te.getNextSiblings();let[to,Mo]=Te.splitText(_e);to.remove(),ot=Mo?[Mo,...ot]:ot,Pt(Se,ot,Je,!1),Se=!0;break e}}Se=!1}if(!Se){e:{if(Je=Te.getTextContent(),Se=$e[Je[_e-1]],Se!=null){_e<Je.length&&(Je=Je.slice(0,_e));for(ht of Se)if(Se=Je.match(ht.regExp),Se!==null){Je=Se.index||0,ot=Je+Se[0].length;var ct=void 0;Je===0?[ct]=Te.splitText(ot):[,ct]=Te.splitText(Je,ot),ct.selectNext(0,0),ht.replace(ct,Se);var ht=!0;break e}}ht=!1}if(!ht)e:{ot=Te.getTextContent(),--_e;var dt=ot[_e];if(ht=Le[dt])for(let jt of ht){var{tag:Dt}=jt;ht=Dt.length;let Pt=_e-ht+1;if(!(1<ht&&!Y(ot,Pt,Dt,0,ht)||ot[Pt-1]===" ")&&(ct=ot[_e+1],jt.intraword!==!1||!ct||p.test(ct))){Se=ct=Te,Je=F(ot,Pt,Dt);for(var mo=Se;0>Je&&(mo=mo.getPreviousSibling())&&!e.$isLineBreakNode(mo);)e.$isTextNode(mo)&&(Je=mo.getTextContent(),Se=mo,Je=F(Je,Je.length,Dt));if(!(0>Je||Se===ct&&Je+ht===Pt||(Dt=Se.getTextContent(),0<Je&&Dt[Je-1]===dt||(mo=Dt[Je-1],jt.intraword===!1&&mo&&!p.test(mo))))){ot=ct.getTextContent(),ot=ot.slice(0,Pt)+ot.slice(_e+1),ct.setTextContent(ot),ot=Se===ct?ot:Dt,Se.setTextContent(ot.slice(0,Je)+ot.slice(Je+ht)),ot=e.$getSelection(),dt=e.$createRangeSelection(),e.$setSelection(dt),_e=_e-ht*(Se===ct?2:1)+1,dt.anchor.set(Se.__key,Je,"text"),dt.focus.set(ct.__key,_e,"text");for(let to of jt.format)dt.hasFormat(to)||dt.formatText(to);dt.anchor.set(dt.focus.key,dt.focus.offset,dt.focus.type);for(let to of jt.format)dt.hasFormat(to)&&dt.toggleFormat(to);e.$isRangeSelection(ot)&&(dt.format=ot.format);break e}}}}}}}})}}})},en}var xO,vpe;function xLe(){return vpe||(vpe=1,xO=FLt()),xO}var OLt=xLe(),yO={},Cpe;function NLt(){if(Cpe)return yO;Cpe=1;var e=ic(),t=bd();return yO.AutoFocusPlugin=function({defaultSelection:o}){let[i]=e.useLexicalComposerContext();return t.useEffect(()=>{i.focus(()=>{let a=document.activeElement,l=i.getRootElement();l===null||a!==null&&l.contains(a)||l.focus({preventScroll:!0})},{defaultSelection:o})},[o,i]),null},yO}var wO,Ape;function HLt(){return Ape||(Ape=1,wO=NLt()),wO}var _Lt=HLt(),kC={},$5={},bO={},$pe;function VLt(){if($pe)return bO;$pe=1;var e=ic(),t=ya(),o=bd();function i(a,l){return a.getEditorState().read(()=>{let d=t.$getNodeByKey(l);return d===null?!1:d.isSelected()})}return bO.useLexicalNodeSelection=function(a){let[l]=e.useLexicalComposerContext(),[d,c]=o.useState(()=>i(l,a));o.useEffect(()=>{let h=!0,m=l.registerUpdateListener(()=>{h&&c(i(l,a))});return()=>{h=!1,m()}},[l,a]);let p=o.useCallback(h=>{l.update(()=>{let m=t.$getSelection();t.$isNodeSelection(m)||(m=t.$createNodeSelection(),t.$setSelection(m)),h?m.add(a):m.delete(a)})},[l,a]),u=o.useCallback(()=>{l.update(()=>{const h=t.$getSelection();t.$isNodeSelection(h)&&h.clear()})},[l]);return[d,p,u]},bO}var vO,kpe;function QLt(){return kpe||(kpe=1,vO=VLt()),vO}var Spe;function ULt(){if(Spe)return $5;Spe=1;var e=ic(),t=QLt(),o=Cd(),i=ya(),a=bd();let l=i.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function d({nodeKey:m}){let[f]=e.useLexicalComposerContext(),[x,y,w]=t.useLexicalNodeSelection(m),b=a.useCallback(v=>(x&&i.$isNodeSelection(i.$getSelection())&&(v.preventDefault(),v=i.$getNodeByKey(m),h(v)&&v.remove(),y(!1)),!1),[x,m,y]);return a.useEffect(()=>o.mergeRegister(f.registerCommand(i.CLICK_COMMAND,v=>{let A=f.getElementByKey(m);return v.target===A?(v.shiftKey||w(),y(!x),!0):!1},i.COMMAND_PRIORITY_LOW),f.registerCommand(i.KEY_DELETE_COMMAND,b,i.COMMAND_PRIORITY_LOW),f.registerCommand(i.KEY_BACKSPACE_COMMAND,b,i.COMMAND_PRIORITY_LOW)),[w,f,x,m,b,y]),a.useEffect(()=>{let v=f.getElementByKey(m);v!==null&&(v.className=x?"selected":"")},[f,x,m]),null}class c extends i.DecoratorNode{static getType(){return"horizontalrule"}static clone(f){return new c(f.__key)}static importJSON(){return u()}static importDOM(){return{hr:()=>({conversion:p,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
244
244
  `}isInline(){return!1}updateDOM(){return!1}decorate(){return a.createElement(d,{nodeKey:this.__key})}}function p(){return{node:u()}}function u(){return i.$applyNodeReplacement(new c)}function h(m){return m instanceof c}return $5.$createHorizontalRuleNode=u,$5.$isHorizontalRuleNode=h,$5.HorizontalRuleNode=c,$5.INSERT_HORIZONTAL_RULE_COMMAND=l,$5}var CO,Epe;function WLt(){return Epe||(Epe=1,CO=ULt()),CO}var Lpe;function GLt(){if(Lpe)return kC;Lpe=1;var e=xLe(),t=ic(),o=WLt(),i=bd();let a=[{dependencies:[o.HorizontalRuleNode],export:l=>o.$isHorizontalRuleNode(l)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(l,d,c,p)=>{d=o.$createHorizontalRuleNode(),p||l.getNextSibling()!=null?l.replace(d):l.insertBefore(d),d.selectNext()},type:"element"},...e.TRANSFORMERS];return kC.DEFAULT_TRANSFORMERS=a,kC.MarkdownShortcutPlugin=function({transformers:l=a}){let[d]=t.useLexicalComposerContext();return i.useEffect(()=>e.registerMarkdownShortcuts(d,l),[d,l]),null},kC}var AO,jpe;function YLt(){return jpe||(jpe=1,AO=GLt()),AO}var KLt=YLt(),ai={},Ipe;function qLt(){if(Ipe)return ai;Ipe=1;var e=ya(),t=Cd();let o={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class i extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(z){let H=new i(z.__headerState,z.__colSpan,z.__width,z.__key);return H.__rowSpan=z.__rowSpan,H}static importDOM(){return{td:()=>({conversion:a,priority:0}),th:()=>({conversion:a,priority:0})}}static importJSON(z){let H=l(z.headerState,z.colSpan,z.width||void 0);return H.__rowSpan=z.rowSpan,H}constructor(z=o.NO_STATUS,H=1,ee,K){super(H,K),this.__headerState=z,this.__width=ee}createDOM(z){let H=document.createElement(this.getTag());return this.__width&&(H.style.width=`${this.__width}px`),1<this.__colSpan&&(H.colSpan=this.__colSpan),1<this.__rowSpan&&(H.rowSpan=this.__rowSpan),t.addClassNamesToElement(H,z.theme.tableCell,this.hasHeader()&&z.theme.tableCellHeader),H}exportDOM(z){if({element:z}=super.exportDOM(z),z){let H=this.getParentOrThrow().getChildrenSize();z.style.border="1px solid black",1<this.__colSpan&&(z.colSpan=this.__colSpan),1<this.__rowSpan&&(z.rowSpan=this.__rowSpan),z.style.width=`${this.getWidth()||Math.max(90,700/H)}px`,z.style.verticalAlign="top",z.style.textAlign="start",this.hasHeader()&&(z.style.backgroundColor="#f2f3f5")}return{element:z}}exportJSON(){return{...super.exportJSON(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(z){return this.getWritable().__headerState=z,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(z){return this.getWritable().__width=z,this.__width}getWidth(){return this.getLatest().__width}toggleHeaderStyle(z){let H=this.getWritable();return H.__headerState=(H.__headerState&z)===z?H.__headerState-z:H.__headerState+z,H}hasHeaderState(z){return(this.getHeaderStyles()&z)===z}hasHeader(){return this.getLatest().__headerState!==o.NO_STATUS}updateDOM(z){return z.__headerState!==this.__headerState||z.__width!==this.__width||z.__colSpan!==this.__colSpan||z.__rowSpan!==this.__rowSpan}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function a(N){var z=N.nodeName.toLowerCase();return z=l(z==="th"?o.ROW:o.NO_STATUS),z.__colSpan=N.colSpan,z.__rowSpan=N.rowSpan,{forChild:(H,ee)=>d(ee)&&!e.$isElementNode(H)?(ee=e.$createParagraphNode(),e.$isLineBreakNode(H)&&H.getTextContent()===`
245
245
  `?null:(ee.append(H),ee)):H,node:z}}function l(N,z=1,H){return e.$applyNodeReplacement(new i(N,z,H))}function d(N){return N instanceof i}class c extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(z){return new c(z.__height,z.__key)}static importDOM(){return{tr:()=>({conversion:p,priority:0})}}static importJSON(z){return u(z.height)}constructor(z,H){super(H),this.__height=z}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(z){let H=document.createElement("tr");return this.__height&&(H.style.height=`${this.__height}px`),t.addClassNamesToElement(H,z.theme.tableRow),H}isShadowRoot(){return!0}setHeight(z){return this.getWritable().__height=z,this.__height}getHeight(){return this.getLatest().__height}updateDOM(z){return z.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function p(){return{node:u()}}function u(N){return e.$applyNodeReplacement(new c(N))}function h(N){return N instanceof c}function m(N){throw Error(`Minified Lexical error #${N}; visit https://lexical.dev/docs/error?code=${N} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let f=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class x{constructor(z,H){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=H,this.editor=z,this.grid={cells:[],columns:0,rows:0},this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(z=>z())}trackTableGrid(){let z=new MutationObserver(H=>{this.editor.update(()=>{var ee=!1;for(let K=0;K<H.length;K++){const G=H[K].target.nodeName;if(G==="TABLE"||G==="TR"){ee=!0;break}}if(ee){if(ee=this.editor.getElementByKey(this.tableNodeKey),!ee)throw Error("Expected to find TableElement in DOM");this.grid=w(ee)}})});this.editor.update(()=>{let H=this.editor.getElementByKey(this.tableNodeKey);if(!H)throw Error("Expected to find TableElement in DOM");this.grid=w(H),z.observe(H,{childList:!0,subtree:!0})})}clearHighlight(){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),this.editor.update(()=>{var z=e.$getNodeByKey(this.tableNodeKey);if(!O(z))throw Error("Expected TableNode.");if(z=this.editor.getElementByKey(this.tableNodeKey),!z)throw Error("Expected to find TableElement in DOM");z=w(z),b(z,null),e.$setSelection(null),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){this.editor.update(()=>{let z=this.editor.getElementByKey(this.tableNodeKey);if(!z)throw Error("Expected to find TableElement in DOM");z.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){this.editor.update(()=>{let z=this.editor.getElementByKey(this.tableNodeKey);if(!z)throw Error("Expected to find TableElement in DOM");z.classList.add("disable-selection"),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(z){z!=null&&z.gridKey===this.tableNodeKey?(this.gridSelection=z,this.isHighlightingCells=!0,this.disableHighlightStyle(),b(this.grid,this.gridSelection)):z==null&&this.clearHighlight()}setFocusCellForSelection(z,H=!1){this.editor.update(()=>{var ee=e.$getNodeByKey(this.tableNodeKey);if(!O(ee))throw Error("Expected TableNode.");if(!this.editor.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ee=z.x;let K=z.y;if(this.focusCell=z,this.anchorCell!==null){let G=f?(this.editor._window||window).getSelection():null;G&&G.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ee||this.anchorY!==K||H))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ee===this.focusX&&K===this.focusY)return;this.focusX=ee,this.focusY=K,this.isHighlightingCells&&(ee=e.$getNearestNodeFromDOMNode(z.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&d(ee)&&(ee=ee.getKey(),this.gridSelection=this.gridSelection.clone()||e.DEPRECATED_$createGridSelection(),this.focusCellNodeKey=ee,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),b(this.grid,this.gridSelection)))})}setAnchorCellForSelection(z){this.isHighlightingCells=!1,this.anchorCell=z,this.anchorX=z.x,this.anchorY=z.y,this.editor.update(()=>{var H=e.$getNearestNodeFromDOMNode(z.elem);d(H)&&(H=H.getKey(),this.gridSelection=e.DEPRECATED_$createGridSelection(),this.anchorCellNodeKey=H)})}formatCells(z){this.editor.update(()=>{let H=e.$getSelection();e.DEPRECATED_$isGridSelection(H)||m(11);let ee=e.$createRangeSelection(),K=ee.anchor,G=ee.focus;H.getNodes().forEach(J=>{d(J)&&J.getTextContentSize()!==0&&(K.set(J.getKey(),0,"element"),G.set(J.getKey(),J.getChildrenSize(),"element"),ee.formatText(z))}),e.$setSelection(H),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){this.editor.update(()=>{let z=e.$getNodeByKey(this.tableNodeKey);if(!O(z))throw Error("Expected TableNode.");var H=e.$getSelection();e.DEPRECATED_$isGridSelection(H)||m(11),H=H.getNodes().filter(d),H.length===this.grid.columns*this.grid.rows?(z.selectPrevious(),z.remove(),e.$getRoot().selectStart()):(H.forEach(ee=>{if(e.$isElementNode(ee)){let K=e.$createParagraphNode(),G=e.$createTextNode();K.append(G),ee.append(K),ee.getChildren().forEach(J=>{J!==K&&J.remove()})}}),b(this.grid,null),e.$setSelection(null),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function y(N){for(;N!=null;){let z=N.nodeName;if(z==="TD"||z==="TH"){if(N=N._cell,N===void 0)break;return N}N=N.parentNode}return null}function w(N){let z=[],H={cells:z,columns:0,rows:0};var ee=N.firstChild;let K=N=0;for(z.length=0;ee!=null;){var G=ee.nodeName;if(G==="TD"||G==="TH")G={elem:ee,highlighted:!1,x:N,y:K},ee._cell=G,z[K]===void 0&&(z[K]=[]),z[K][N]=G;else if(G=ee.firstChild,G!=null){ee=G;continue}if(G=ee.nextSibling,G!=null)N++,ee=G;else if(G=ee.parentNode,G!=null){if(ee=G.nextSibling,ee==null)break;K++,N=0}}return H.columns=N+1,H.rows=K+1,H}function b(N,z){let H=[],ee=new Set(z?z.getNodes():[]);return v(N,(K,G)=>{let J=K.elem;ee.has(G)?(K.highlighted=!0,J.style.setProperty("background-color","rgb(172, 206, 247)"),J.style.setProperty("caret-color","transparent"),H.push(K)):(K.highlighted=!1,J.style.removeProperty("background-color"),J.style.removeProperty("caret-color"),J.getAttribute("style")||J.removeAttribute("style"))}),H}function v(N,z){({cells:N}=N);for(let H=0;H<N.length;H++){let ee=N[H];for(let K=0;K<ee.length;K++){let G=ee[K],J=e.$getNearestNodeFromDOMNode(G.elem);J!==null&&z(G,J,{x:K,y:H})}}}function A(N){N.disableHighlightStyle(),v(N.grid,z=>{let H=z.elem;z.highlighted=!0,H.style.setProperty("background-color","rgb(172, 206, 247)"),H.style.setProperty("caret-color","transparent")})}function S(N){N.enableHighlightStyle(),v(N.grid,z=>{let H=z.elem;z.highlighted=!1,H.style.removeProperty("background-color"),H.style.removeProperty("caret-color"),H.getAttribute("style")||H.removeAttribute("style")})}let E=(N,z,H,ee,K)=>{const G=K==="forward";switch(K){case"backward":case"forward":return H!==(G?N.grid.columns-1:0)?B(z.getCellNodeFromCordsOrThrow(H+(G?1:-1),ee,N.grid)):ee!==(G?N.grid.rows-1:0)?B(z.getCellNodeFromCordsOrThrow(G?0:N.grid.columns-1,ee+(G?1:-1),N.grid)):G?z.selectNext():z.selectPrevious(),!0;case"up":return ee!==0?B(z.getCellNodeFromCordsOrThrow(H,ee-1,N.grid)):z.selectPrevious(),!0;case"down":return ee!==N.grid.rows-1?B(z.getCellNodeFromCordsOrThrow(H,ee+1,N.grid)):z.selectNext(),!0;default:return!1}},I=(N,z,H,ee,K)=>{const G=K==="forward";switch(K){case"backward":case"forward":return H!==(G?N.grid.columns-1:0)&&N.setFocusCellForSelection(z.getCellFromCordsOrThrow(H+(G?1:-1),ee,N.grid)),!0;case"up":return ee!==0?(N.setFocusCellForSelection(z.getCellFromCordsOrThrow(H,ee-1,N.grid)),!0):!1;case"down":return ee!==N.grid.rows-1?(N.setFocusCellForSelection(z.getCellFromCordsOrThrow(H,ee+1,N.grid)),!0):!1;default:return!1}};function L(N,z){if(e.$isRangeSelection(N)||e.DEPRECATED_$isGridSelection(N)){let H=z.isParentOf(N.anchor.getNode());return N=z.isParentOf(N.focus.getNode()),H&&N}return!1}function B(N){let z=N.getChildren().find(H=>e.$isParagraphNode(H));e.$isParagraphNode(z)?z.selectEnd():N.selectEnd()}class P extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(z){return new P(z.__key)}static importDOM(){return{table:()=>({conversion:D,priority:1})}}static importJSON(){return T()}constructor(z){super(z)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(z){let H=document.createElement("table");return t.addClassNamesToElement(H,z.theme.table),H}updateDOM(){return!1}exportDOM(z){return{...super.exportDOM(z),after:H=>{if(H){let ee=H.cloneNode(),K=document.createElement("colgroup"),G=document.createElement("tbody");if(G.append(...H.children),H=this.getFirstChildOrThrow(),!h(H))throw Error("Expected to find row node.");H=H.getChildrenSize();for(let J=0;J<H;J++){let X=document.createElement("col");K.append(X)}return ee.replaceChildren(K,G),ee}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(z,H){let{rows:ee,cells:K}=H;for(H=0;H<ee;H++){var G=K[H];if(G==null)throw Error(`Row not found at y:${H}`);if(G=G.findIndex(({elem:J})=>e.$getNearestNodeFromDOMNode(J)===z),G!==-1)return{x:G,y:H}}throw Error("Cell not found in table.")}getCellFromCords(z,H,ee){return{cells:ee}=ee,H=ee[H],H==null?null:(z=H[z],z??null)}getCellFromCordsOrThrow(z,H,ee){if(z=this.getCellFromCords(z,H,ee),!z)throw Error("Cell not found at cords.");return z}getCellNodeFromCords(z,H,ee){return z=this.getCellFromCords(z,H,ee),z==null?null:(z=e.$getNearestNodeFromDOMNode(z.elem),d(z)?z:null)}getCellNodeFromCordsOrThrow(z,H,ee){if(z=this.getCellNodeFromCords(z,H,ee),!z)throw Error("Node at cords not TableCellNode.");return z}canSelectBefore(){return!0}canIndent(){return!1}}function D(){return{node:T()}}function T(){return e.$applyNodeReplacement(new P)}function O(N){return N instanceof P}function F(N){if(N=t.$findMatchingParent(N,z=>h(z)),h(N))return N;throw Error("Expected table cell to be inside of table row.")}function Y(N){if(N=t.$findMatchingParent(N,z=>O(z)),O(N))return N;throw Error("Expected table cell to be inside of table.")}function Z(N,z){let H=Y(N),{x:ee,y:K}=H.getCordsFromCellNode(N,z);return{above:H.getCellNodeFromCords(ee,K-1,z),below:H.getCellNodeFromCords(ee,K+1,z),left:H.getCellNodeFromCords(ee-1,K,z),right:H.getCellNodeFromCords(ee+1,K,z)}}function R(N){N=N.getFirstDescendant(),N===null&&m(124),N.getParentOrThrow().selectStart()}function U(N,z){let H=N.getFirstChild();H!==null?H.insertBefore(z):N.append(z)}let _=e.createCommand("INSERT_TABLE_COMMAND");return ai.$createTableCellNode=l,ai.$createTableNode=T,ai.$createTableNodeWithDimensions=function(N,z,H=!0){let ee=T();for(let G=0;G<N;G++){let J=u();for(let X=0;X<z;X++){var K=o.NO_STATUS;typeof H=="object"?(G===0&&H.rows&&(K|=o.ROW),X===0&&H.columns&&(K|=o.COLUMN)):H&&(G===0&&(K|=o.ROW),X===0&&(K|=o.COLUMN)),K=l(K);let le=e.$createParagraphNode();le.append(e.$createTextNode()),K.append(le),J.append(K)}ee.append(J)}return ee},ai.$createTableRowNode=u,ai.$deleteTableColumn=function(N,z){let H=N.getChildren();for(let K=0;K<H.length;K++){var ee=H[K];if(h(ee)){if(ee=ee.getChildren(),z>=ee.length||0>z)throw Error("Table column target index out of range");ee[z].remove()}}return N},ai.$deleteTableColumn__EXPERIMENTAL=function(){var N=e.$getSelection();e.$isRangeSelection(N)||e.DEPRECATED_$isGridSelection(N)||m(118);var z=N.anchor.getNode();N=N.focus.getNode();let[H,,ee]=e.DEPRECATED_$getNodeTriplet(z);[z]=e.DEPRECATED_$getNodeTriplet(N);let[K,G,J]=e.DEPRECATED_$computeGridMap(ee,H,z);var{startColumn:X}=G;let{startRow:le,startColumn:xe}=J;N=Math.min(X,xe),X=Math.max(X+H.__colSpan-1,xe+z.__colSpan-1);let me=X-N+1;if(K[0].length===X-N+1)ee.selectPrevious(),ee.remove();else{var ce=K.length;for(let de=0;de<ce;de++)for(let we=N;we<=X;we++){let{cell:Ae,startColumn:ae}=K[de][we];ae<N?we===N&&Ae.setColSpan(Ae.__colSpan-Math.min(me,Ae.__colSpan-(N-ae))):ae+Ae.__colSpan-1>X?we===X&&Ae.setColSpan(Ae.__colSpan-(X-ae+1)):Ae.remove()}N=K[le],z=N[xe+z.__colSpan],z!==void 0?({cell:z}=z,R(z)):({cell:z}=N[xe-1],R(z))}},ai.$deleteTableRow__EXPERIMENTAL=function(){var N=e.$getSelection();e.$isRangeSelection(N)||e.DEPRECATED_$isGridSelection(N)||m(118);var z=N.anchor.getNode();N=N.focus.getNode();let[H,,ee]=e.DEPRECATED_$getNodeTriplet(z);[N]=e.DEPRECATED_$getNodeTriplet(N);let[K,G,J]=e.DEPRECATED_$computeGridMap(ee,H,N);({startRow:z}=G);var{startRow:X}=J;if(N=X+N.__rowSpan-1,K.length===N-z+1)ee.remove();else{X=K[0].length;var le=K[N+1],xe=ee.getChildAtIndex(N+1);for(let ce=N;ce>=z;ce--){for(var me=X-1;0<=me;me--){let{cell:de,startRow:we,startColumn:Ae}=K[ce][me];if(Ae===me&&(ce===z&&we<z&&de.setRowSpan(de.__rowSpan-(we-z)),we>=z&&we+de.__rowSpan-1>N))if(de.setRowSpan(de.__rowSpan-(N-we+1)),xe===null&&m(122),me===0)U(xe,de);else{let{cell:ae}=le[me-1];ae.insertAfter(de)}}me=ee.getChildAtIndex(ce),e.DEPRECATED_$isGridRowNode(me)||m(123),me.remove()}le!==void 0?({cell:z}=le[0],R(z)):({cell:z}=K[z-1][0],R(z))}},ai.$getElementGridForTableNode=function(N,z){if(N=N.getElementByKey(z.getKey()),N==null)throw Error("Table Element Not Found");return w(N)},ai.$getTableCellNodeFromLexicalNode=function(N){return N=t.$findMatchingParent(N,z=>d(z)),d(N)?N:null},ai.$getTableColumnIndexFromTableCellNode=function(N){return F(N).getChildren().findIndex(z=>z.is(N))},ai.$getTableNodeFromLexicalNodeOrThrow=Y,ai.$getTableRowIndexFromTableCellNode=function(N){let z=F(N);return Y(z).getChildren().findIndex(H=>H.is(z))},ai.$getTableRowNodeFromTableCellNodeOrThrow=F,ai.$insertTableColumn=function(N,z,H=!0,ee,K){let G=N.getChildren();for(let le=0;le<G.length;le++){let xe=G[le];if(h(xe))for(let me=0;me<ee;me++){var J=xe.getChildren();if(z>=J.length||0>z)throw Error("Table column target index out of range");J=J[z],d(J)||m(12);let{left:ce,right:de}=Z(J,K);var X=o.NO_STATUS;(ce&&ce.hasHeaderState(o.ROW)||de&&de.hasHeaderState(o.ROW))&&(X|=o.ROW),X=l(X),X.append(e.$createParagraphNode()),H?J.insertAfter(X):J.insertBefore(X)}}return N},ai.$insertTableColumn__EXPERIMENTAL=function(N=!0){function z(){let me=l(o.NO_STATUS).append(e.$createParagraphNode());return le===null&&(le=me),me}var H=e.$getSelection();e.$isRangeSelection(H)||e.DEPRECATED_$isGridSelection(H)||m(118),H=H.focus.getNode();let[ee,,K]=e.DEPRECATED_$getNodeTriplet(H),[G,J]=e.DEPRECATED_$computeGridMap(K,ee,ee);H=G.length;var{startColumn:X}=J;N=N?X+ee.__colSpan-1:X-1,X=K.getFirstChild(),e.DEPRECATED_$isGridRowNode(X)||m(120);let le=null;var xe=X;e:for(X=0;X<H;X++){X!==0&&(xe=xe.getNextSibling(),e.DEPRECATED_$isGridRowNode(xe)||m(121));let me=G[X];if(0>N){U(xe,z());continue}let{cell:ce,startColumn:de,startRow:we}=me[N];if(de+ce.__colSpan-1<=N){let Ae=ce,ae=we,pe=N;for(;ae!==X&&1<Ae.__rowSpan;)if(pe-=ce.__colSpan,0<=pe){let{cell:ie,startRow:ve}=me[pe];Ae=ie,ae=ve}else{xe.append(z());continue e}Ae.insertAfter(z())}else ce.setColSpan(ce.__colSpan+1)}le!==null&&R(le)},ai.$insertTableRow=function(N,z,H=!0,ee,K){var G=N.getChildren();if(z>=G.length||0>z)throw Error("Table row target index out of range");if(z=G[z],h(z))for(G=0;G<ee;G++){let X=z.getChildren(),le=X.length,xe=u();for(let me=0;me<le;me++){var J=X[me];d(J)||m(12);let{above:ce,below:de}=Z(J,K);J=o.NO_STATUS;let we=ce&&ce.getWidth()||de&&de.getWidth()||void 0;(ce&&ce.hasHeaderState(o.COLUMN)||de&&de.hasHeaderState(o.COLUMN))&&(J|=o.COLUMN),J=l(J,1,we),J.append(e.$createParagraphNode()),xe.append(J)}H?z.insertAfter(xe):z.insertBefore(xe)}else throw Error("Row before insertion index does not exist.");return N},ai.$insertTableRow__EXPERIMENTAL=function(N=!0){var z=e.$getSelection();e.$isRangeSelection(z)||e.DEPRECATED_$isGridSelection(z)||m(118),z=z.focus.getNode();let[H,,ee]=e.DEPRECATED_$getNodeTriplet(z),[K,G]=e.DEPRECATED_$computeGridMap(ee,H,H);z=K[0].length;var{startRow:J}=G;if(N){N=J+H.__rowSpan-1;var X=K[N];J=u();for(var le=0;le<z;le++){let{cell:xe,startRow:me}=X[le];me+xe.__rowSpan-1<=N?J.append(l(o.NO_STATUS)):xe.setRowSpan(xe.__rowSpan+1)}z=ee.getChildAtIndex(N),e.DEPRECATED_$isGridRowNode(z)||m(119),z.insertAfter(J)}else{for(X=K[J],N=u(),le=0;le<z;le++){let{cell:xe,startRow:me}=X[le];me===J?N.append(l(o.NO_STATUS)):xe.setRowSpan(xe.__rowSpan+1)}z=ee.getChildAtIndex(J),e.DEPRECATED_$isGridRowNode(z)||m(119),z.insertBefore(N)}},ai.$isTableCellNode=d,ai.$isTableNode=O,ai.$isTableRowNode=h,ai.$removeTableRowAtIndex=function(N,z){let H=N.getChildren();if(z>=H.length||0>z)throw Error("Expected table cell to be inside of table row.");return H[z].remove(),N},ai.$unmergeCell=function(){var N=e.$getSelection();e.$isRangeSelection(N)||e.DEPRECATED_$isGridSelection(N)||m(118),N=N.anchor.getNode();let[z,H,ee]=e.DEPRECATED_$getNodeTriplet(N);N=z.__colSpan;let K=z.__rowSpan;if(1<N){for(var G=1;G<N;G++)z.insertAfter(l(o.NO_STATUS));z.setColSpan(1)}if(1<K){let[le,xe]=e.DEPRECATED_$computeGridMap(ee,z,z),{startColumn:me,startRow:ce}=xe;for(G=1;G<K;G++){let de=ce+G,we=le[de];var J=H.getNextSibling();e.DEPRECATED_$isGridRowNode(J)||m(125);var X=null;for(let Ae=0;Ae<me;Ae++){let ae=we[Ae],pe=ae.cell;ae.startRow===de&&(X=pe),1<pe.__colSpan&&(Ae+=pe.__colSpan-1)}if(X===null)for(X=0;X<N;X++)U(J,l(o.NO_STATUS));else for(J=0;J<N;J++)X.insertAfter(l(o.NO_STATUS))}z.setRowSpan(1)}},ai.INSERT_TABLE_COMMAND=_,ai.TableCellHeaderStates=o,ai.TableCellNode=i,ai.TableNode=P,ai.TableRowNode=c,ai.TableSelection=x,ai.applyTableHandlers=function(N,z,H){let ee=H.getRootElement();if(ee===null)throw Error("No root element.");let K=new x(H,N.getKey());z.__lexicalTableSelection=K;let G=!1,J=!1;z.addEventListener("dblclick",ce=>{let de=y(ce.target);de!==null&&(ce.preventDefault(),ce.stopImmediatePropagation(),ce.stopPropagation(),K.setAnchorCellForSelection(de),K.setFocusCellForSelection(de,!0),G=!1)}),z.addEventListener("mousedown",ce=>{setTimeout(()=>{if(ce.button===0){var de=y(ce.target);de!==null&&(ce.preventDefault(),ce.stopPropagation(),ce.stopImmediatePropagation(),K.setAnchorCellForSelection(de))}},0)}),z.addEventListener("mousemove",ce=>{if(J&&(ce.preventDefault(),ce.stopPropagation(),ce.stopImmediatePropagation()),G){let de=y(ce.target);if(de!==null){let we=de.x,Ae=de.y;G&&(K.anchorX!==we||K.anchorY!==Ae||K.isHighlightingCells)&&(ce.preventDefault(),K.setFocusCellForSelection(de))}}}),z.addEventListener("mouseleave",()=>{});let X=ce=>{ce.button===0&&H.update(()=>{var de=e.$getSelection();const we=ce.target;if(we instanceof Node){if(e.DEPRECATED_$isGridSelection(de)&&de.gridKey===K.tableNodeKey&&ee.contains(we))return K.clearHighlight();de=e.$getNearestNodeFromDOMNode(we),de!==null&&t.$findMatchingParent(de,e.DEPRECATED_$isGridNode)&&(G=!0)}})};window.addEventListener("mousedown",X),K.listenersToRemove.add(()=>window.removeEventListener("mousedown",X));let le=ce=>{var de;(de=G)&&(de=ce.target,de=de!==null&&de.nodeName==="SPAN",de=!de),de&&(ce.preventDefault(),ce.stopPropagation()),G=!1};window.addEventListener("mouseup",le),K.listenersToRemove.add(()=>window.removeEventListener("mouseup",le)),z.addEventListener("mouseup",le),K.listenersToRemove.add(()=>z.removeEventListener("mouseup",le)),K.listenersToRemove.add(H.registerCommand(e.KEY_ARROW_DOWN_COMMAND,ce=>{var de=e.$getSelection();if(!L(de,N))return!1;if(e.$isRangeSelection(de)){if(de.isCollapsed()){var we=t.$findMatchingParent(de.anchor.getNode(),ae=>d(ae));if(!d(we))return!1;var Ae=N.getCordsFromCellNode(we,K.grid);if(de=t.$findMatchingParent(de.anchor.getNode(),ae=>e.$isElementNode(ae)),de==null)throw Error("Expected BlockNode Parent");if((we=we.getLastChild())&&de.isParentOf(we)||de===we||ce.shiftKey)return ce.preventDefault(),ce.stopImmediatePropagation(),ce.stopPropagation(),ce.shiftKey?(K.setAnchorCellForSelection(N.getCellFromCordsOrThrow(Ae.x,Ae.y,K.grid)),I(K,N,Ae.x,Ae.y,"down")):E(K,N,Ae.x,Ae.y,"down")}}else if(e.DEPRECATED_$isGridSelection(de)&&ce.shiftKey)return Ae=de.focus.getNode(),d(Ae)?(Ae=N.getCordsFromCellNode(Ae,K.grid),ce.preventDefault(),ce.stopImmediatePropagation(),ce.stopPropagation(),I(K,N,Ae.x,Ae.y,"down")):!1;return!1},e.COMMAND_PRIORITY_HIGH)),K.listenersToRemove.add(H.registerCommand(e.KEY_ARROW_UP_COMMAND,ce=>{var de=e.$getSelection();if(!L(de,N))return!1;if(e.$isRangeSelection(de)){if(de.isCollapsed()){var we=t.$findMatchingParent(de.anchor.getNode(),ae=>d(ae));if(!d(we))return!1;var Ae=N.getCordsFromCellNode(we,K.grid);if(de=t.$findMatchingParent(de.anchor.getNode(),ae=>e.$isElementNode(ae)),de==null)throw Error("Expected BlockNode Parent");if((we=we.getLastChild())&&de.isParentOf(we)||de===we||ce.shiftKey)return ce.preventDefault(),ce.stopImmediatePropagation(),ce.stopPropagation(),ce.shiftKey?(K.setAnchorCellForSelection(N.getCellFromCordsOrThrow(Ae.x,Ae.y,K.grid)),I(K,N,Ae.x,Ae.y,"up")):E(K,N,Ae.x,Ae.y,"up")}}else if(e.DEPRECATED_$isGridSelection(de)&&ce.shiftKey)return Ae=de.focus.getNode(),d(Ae)?(Ae=N.getCordsFromCellNode(Ae,K.grid),ce.preventDefault(),ce.stopImmediatePropagation(),ce.stopPropagation(),I(K,N,Ae.x,Ae.y,"up")):!1;return!1},e.COMMAND_PRIORITY_HIGH)),K.listenersToRemove.add(H.registerCommand(e.KEY_ARROW_LEFT_COMMAND,ce=>{var de=e.$getSelection();if(!L(de,N))return!1;if(e.$isRangeSelection(de)){if(de.isCollapsed()){var we=t.$findMatchingParent(de.anchor.getNode(),Ae=>d(Ae));if(!d(we))return!1;if(we=N.getCordsFromCellNode(we,K.grid),t.$findMatchingParent(de.anchor.getNode(),Ae=>e.$isElementNode(Ae))==null)throw Error("Expected BlockNode Parent");if(de.anchor.offset===0||ce.shiftKey)return ce.preventDefault(),ce.stopImmediatePropagation(),ce.stopPropagation(),ce.shiftKey?(K.setAnchorCellForSelection(N.getCellFromCordsOrThrow(we.x,we.y,K.grid)),I(K,N,we.x,we.y,"backward")):E(K,N,we.x,we.y,"backward")}}else if(e.DEPRECATED_$isGridSelection(de)&&ce.shiftKey)return de=de.focus.getNode(),d(de)?(de=N.getCordsFromCellNode(de,K.grid),ce.preventDefault(),ce.stopImmediatePropagation(),ce.stopPropagation(),I(K,N,de.x,de.y,"backward")):!1;return!1},e.COMMAND_PRIORITY_HIGH)),K.listenersToRemove.add(H.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,ce=>{var de=e.$getSelection();if(!L(de,N))return!1;if(e.$isRangeSelection(de)){if(de.isCollapsed()){var we=t.$findMatchingParent(de.anchor.getNode(),Ae=>d(Ae));if(!d(we))return!1;if(we=N.getCordsFromCellNode(we,K.grid),t.$findMatchingParent(de.anchor.getNode(),Ae=>e.$isElementNode(Ae))==null)throw Error("Expected BlockNode Parent");if(de.anchor.offset===de.anchor.getNode().getTextContentSize()||ce.shiftKey)return ce.preventDefault(),ce.stopImmediatePropagation(),ce.stopPropagation(),ce.shiftKey?(K.setAnchorCellForSelection(N.getCellFromCordsOrThrow(we.x,we.y,K.grid)),I(K,N,we.x,we.y,"forward")):E(K,N,we.x,we.y,"forward")}}else if(e.DEPRECATED_$isGridSelection(de)&&ce.shiftKey)return de=de.focus.getNode(),d(de)?(de=N.getCordsFromCellNode(de,K.grid),ce.preventDefault(),ce.stopImmediatePropagation(),ce.stopPropagation(),I(K,N,de.x,de.y,"forward")):!1;return!1},e.COMMAND_PRIORITY_HIGH));let xe=ce=>()=>{var de=e.$getSelection();if(!L(de,N))return!1;if(e.DEPRECATED_$isGridSelection(de))return K.clearText(),!0;if(e.$isRangeSelection(de)){const ae=t.$findMatchingParent(de.anchor.getNode(),pe=>d(pe));if(!d(ae))return!1;var we=de.anchor.getNode(),Ae=de.focus.getNode();if(we=N.isParentOf(we),Ae=N.isParentOf(Ae),we&&!Ae||Ae&&!we)return K.clearText(),!0;if(we=(Ae=t.$findMatchingParent(de.anchor.getNode(),pe=>e.$isElementNode(pe)))&&t.$findMatchingParent(Ae,pe=>e.$isElementNode(pe)&&d(pe.getParent())),!e.$isElementNode(we)||!e.$isElementNode(Ae))return!1;if(ce===e.DELETE_LINE_COMMAND&&we.getPreviousSibling()===null)return!0;if((ce===e.DELETE_CHARACTER_COMMAND||ce===e.DELETE_WORD_COMMAND)&&de.isCollapsed()&&de.anchor.offset===0&&Ae!==we){de=Ae.getChildren();const pe=e.$createParagraphNode();return de.forEach(ie=>pe.append(ie)),Ae.replace(pe),Ae.getWritable().__parent=ae.getKey(),!0}}return!1};[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(ce=>{K.listenersToRemove.add(H.registerCommand(ce,xe(ce),e.COMMAND_PRIORITY_CRITICAL))});let me=ce=>{const de=e.$getSelection();return L(de,N)?e.DEPRECATED_$isGridSelection(de)?(ce.preventDefault(),ce.stopPropagation(),K.clearText(),!0):(e.$isRangeSelection(de)&&(ce=t.$findMatchingParent(de.anchor.getNode(),we=>d(we)),d(ce)),!1):!1};return K.listenersToRemove.add(H.registerCommand(e.KEY_BACKSPACE_COMMAND,me,e.COMMAND_PRIORITY_CRITICAL)),K.listenersToRemove.add(H.registerCommand(e.KEY_DELETE_COMMAND,me,e.COMMAND_PRIORITY_CRITICAL)),K.listenersToRemove.add(H.registerCommand(e.FORMAT_TEXT_COMMAND,ce=>{let de=e.$getSelection();return L(de,N)?e.DEPRECATED_$isGridSelection(de)?(K.formatCells(ce),!0):(e.$isRangeSelection(de)&&(ce=t.$findMatchingParent(de.anchor.getNode(),we=>d(we)),d(ce)),!1):!1},e.COMMAND_PRIORITY_CRITICAL)),K.listenersToRemove.add(H.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var ce=e.$getSelection();return L(ce,N)&&(e.DEPRECATED_$isGridSelection(ce)?K.clearHighlight():e.$isRangeSelection(ce)&&(ce=t.$findMatchingParent(ce.anchor.getNode(),de=>d(de)),d(ce))),!1},e.COMMAND_PRIORITY_CRITICAL)),K.listenersToRemove.add(H.registerCommand(e.KEY_TAB_COMMAND,ce=>{var de=e.$getSelection();if(!L(de,N))return!1;if(e.$isRangeSelection(de)){let we=t.$findMatchingParent(de.anchor.getNode(),Ae=>d(Ae));if(!d(we))return!1;if(de.isCollapsed())return de=N.getCordsFromCellNode(we,K.grid),ce.preventDefault(),E(K,N,de.x,de.y,ce.shiftKey?"backward":"forward"),!0}return!1},e.COMMAND_PRIORITY_HIGH)),K.listenersToRemove.add(H.registerCommand(e.FOCUS_COMMAND,()=>N.isSelected(),e.COMMAND_PRIORITY_HIGH)),K.listenersToRemove.add(H.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{let ce=e.$getSelection();var de=e.$getPreviousSelection();if(ce&&e.$isRangeSelection(ce)&&!ce.isCollapsed()){var we=ce.anchor.getNode(),Ae=ce.focus.getNode();we=N.isParentOf(we);var ae=N.isParentOf(Ae);if(Ae=we&&!ae||ae&&!we,we=we&&ae&&!N.isSelected(),Ae)return de=ce.isBackward(),we=e.$createRangeSelection(),Ae=N.getKey(),we.anchor.set(ce.anchor.key,ce.anchor.offset,ce.anchor.type),we.focus.set(Ae,de?0:N.getChildrenSize(),"element"),J=!0,e.$setSelection(we),A(K),!0;if(we&&({grid:we}=K,ce.getNodes().filter(d).length===we.rows*we.columns)){we=e.DEPRECATED_$createGridSelection(),Ae=N.getKey(),ae=N.getFirstChildOrThrow().getFirstChild();let pe=N.getLastChildOrThrow().getLastChild();if(ae!=null&&pe!=null)return we.set(Ae,ae.getKey(),pe.getKey()),e.$setSelection(we),K.updateTableGridSelection(we),!0}}return ce&&!ce.is(de)&&(e.DEPRECATED_$isGridSelection(ce)||e.DEPRECATED_$isGridSelection(de))&&K.gridSelection&&!K.gridSelection.is(de)?(e.DEPRECATED_$isGridSelection(ce)&&ce.gridKey===K.tableNodeKey?K.updateTableGridSelection(ce):!e.DEPRECATED_$isGridSelection(ce)&&e.DEPRECATED_$isGridSelection(de)&&de.gridKey===K.tableNodeKey&&K.updateTableGridSelection(null),!1):(K.hasHijackedSelectionStyles&&!N.isSelected()?(S(K),J=!1):!K.hasHijackedSelectionStyles&&N.isSelected()&&A(K),!1)},e.COMMAND_PRIORITY_CRITICAL)),K},ai.getCellFromTarget=y,ai.getTableSelectionFromTableElement=function(N){return N.__lexicalTableSelection},ai}var $O,Mpe;function ZLt(){return Mpe||(Mpe=1,$O=qLt()),$O}var kO=ZLt(),SC={},Bpe;function JLt(){if(Bpe)return SC;Bpe=1;var e=sj(),t=ic(),o=Cd(),i=ya(),a=bd();function l(f,x){for(let y=0;y<x.length;y++){let w=x[y](f);if(w)return w}return null}let d=/[.,;\s]/;function c(f){f=f.getPreviousSibling(),i.$isElementNode(f)&&(f=f.getLastDescendant());var x;return!(x=f===null||i.$isLineBreakNode(f))&&(x=i.$isTextNode(f))&&(f=f.getTextContent(),x=d.test(f[f.length-1])),x}function p(f){return f=f.getNextSibling(),i.$isElementNode(f)&&(f=f.getFirstDescendant()),f===null||i.$isLineBreakNode(f)||i.$isTextNode(f)&&d.test(f.getTextContent()[0])}function u(f,x,y){var w=f.getChildren();let b=w.length;for(let v=0;v<b;v++){let A=w[v];if(!i.$isTextNode(A)||!A.isSimpleText()){h(f),y(null,f.getURL());return}}w=f.getTextContent(),x=l(w,x),x===null||x.text!==w?(h(f),y(null,f.getURL())):c(f)&&p(f)?(w=f.getURL(),w!==x.url&&(f.setURL(x.url),y(x.url,w)),x.attributes&&(w=f.getRel(),w!==x.attributes.rel&&(f.setRel(x.attributes.rel||null),y(x.attributes.rel||null,w)),w=f.getTarget(),w!==x.attributes.target&&(f.setTarget(x.attributes.target||null),y(x.attributes.target||null,w)))):(h(f),y(null,f.getURL()))}function h(f){let x=f.getChildren();var y=x.length;for(--y;0<=y;y--)f.insertAfter(x[y]);return f.remove(),x.map(w=>w.getLatest())}function m(f,x,y){a.useEffect(()=>{if(!f.hasNodes([e.AutoLinkNode]))throw Error("Minified Lexical error #77; visit https://lexical.dev/docs/error?code=77 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");let w=(b,v)=>{y&&y(b,v)};return o.mergeRegister(f.registerNodeTransform(i.TextNode,b=>{var v=b.getParentOrThrow(),A=b.getPreviousSibling();if(e.$isAutoLinkNode(v))u(v,x,w);else if(!e.$isLinkNode(v)){if(b.isSimpleText()&&(d.test(b.getTextContent()[0])||!e.$isAutoLinkNode(A))){A=v=b.getTextContent();let D=0,T=b;for(var S;(S=l(A,x))&&S!==null;){let O=S.index,F=S.length,Y=O+F;var E=D+O,I=D+Y,L=v,B=b;if((0<E?d.test(L[E-1]):c(B))&&(I<L.length?d.test(L[I]):p(B))){var P=void 0;D+O===0?[P,T]=T.splitText(D+F):[,P,T]=T.splitText(D+O,D+O+F),E=e.$createAutoLinkNode(S.url,S.attributes),I=i.$createTextNode(S.text),I.setFormat(P.getFormat()),I.setDetail(P.getDetail()),E.append(I),P.replace(E),y&&y(S.url,null),D=0}else D+=Y;A=A.substring(Y)}}v=b.getPreviousSibling(),S=b.getNextSibling(),P=b.getTextContent(),e.$isAutoLinkNode(v)&&!d.test(P[0])&&(v.append(b),u(v,x,w),b=v.getURL(),y&&y(null,b)),e.$isAutoLinkNode(S)&&!d.test(P[P.length-1])&&(h(S),u(S,x,w),b=S.getURL(),y&&y(null,b))}}))},[f,x,y])}return SC.AutoLinkPlugin=function({matchers:f,onChange:x}){let[y]=t.useLexicalComposerContext();return m(y,f,x),null},SC.createLinkMatcherWithRegExp=function(f,x=y=>y){return y=>{let w=f.exec(y);return w===null?null:{index:w.index,length:w[0].length,text:w[0],url:x(y)}}},SC}var SO,Ppe;function XLt(){return Ppe||(Ppe=1,SO=JLt()),SO}var ejt=XLt(),My={};My.d=(e,t)=>{for(var o in t)My.o(t,o)&&!My.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})};My.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Xo=globalThis.pdfjsLib={};My.d(Xo,{AbortException:()=>pf,AnnotationEditorLayer:()=>Zh,AnnotationEditorParamsType:()=>ar,AnnotationEditorType:()=>Xr,AnnotationEditorUIManager:()=>Mm,AnnotationLayer:()=>JIt,AnnotationMode:()=>W2,CMapCompressionType:()=>CQ,ColorPicker:()=>xu,DOMSVGFactory:()=>iK,DrawLayer:()=>Qs,FeatureTest:()=>sd,GlobalWorkerOptions:()=>vw,ImageKind:()=>q$,InvalidPDFException:()=>wLe,MissingPDFException:()=>cf,OPS:()=>j1,Outliner:()=>IQ,PDFDataRangeTransport:()=>zLe,PDFDateString:()=>kLe,PDFWorker:()=>jc,PasswordResponses:()=>ijt,PermissionFlag:()=>rjt,PixelsPerInch:()=>k6,RenderingCancelledException:()=>nK,TextLayer:()=>CS,UnexpectedResponseException:()=>pj,Util:()=>So,VerbosityLevel:()=>lj,XfaLayer:()=>FLe,build:()=>BIt,createValidAbsoluteUrl:()=>ljt,fetchData:()=>xj,getDocument:()=>AIt,getFilenameFromUrl:()=>yjt,getPdfFilenameFromUrl:()=>wjt,getXfaPageViewport:()=>bjt,isDataScheme:()=>aK,isPdfFile:()=>sK,noContextMenu:()=>hd,normalizeUnicode:()=>mjt,renderTextLayer:()=>mIt,setLayerDimensions:()=>_4,shadow:()=>si,updateTextLayer:()=>gIt,version:()=>MIt});const Zs=typeof Jh=="object"&&Jh+""=="[object process]"&&!Jh.versions.nw&&!(Jh.versions.electron&&Jh.type&&Jh.type!=="browser"),yLe=[1,0,0,1,0,0],vQ=[.001,0,0,.001,0,0],tjt=1e7,EO=1.35,kc={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},W2={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},ojt="pdfjs_internal_editor_",Xr={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},ar={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},rjt={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Vs={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},q$={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Ea={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},U9={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},lj={ERRORS:0,WARNINGS:1,INFOS:5},CQ={NONE:0,BINARY:1},j1={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},ijt={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let dj=lj.WARNINGS;function njt(e){Number.isInteger(e)&&(dj=e)}function ajt(){return dj}function cj(e){dj>=lj.INFOS&&console.log(`Info: ${e}`)}function Br(e){dj>=lj.WARNINGS&&console.log(`Warning: ${e}`)}function zi(e){throw new Error(e)}function Ba(e,t){e||zi(t)}function sjt(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function ljt(e,t=null,o=null){if(!e)return null;try{if(o&&typeof e=="string"&&(o.addDefaultProtocol&&e.startsWith("www.")&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),o.tryConvertEncoding))try{e=hjt(e)}catch{}const i=t?new URL(e,t):new URL(e);if(sjt(i))return i}catch{}return null}function si(e,t,o,i=!1){return Object.defineProperty(e,t,{value:o,enumerable:!i,configurable:!0,writable:!1}),o}const Wm=(function(){function t(o,i){this.constructor===t&&zi("Cannot initialize BaseException."),this.message=o,this.name=i}return t.prototype=new Error,t.constructor=t,t})();class AQ extends Wm{constructor(t,o){super(t,"PasswordException"),this.code=o}}class $Q extends Wm{constructor(t,o){super(t,"UnknownErrorException"),this.details=o}}class wLe extends Wm{constructor(t){super(t,"InvalidPDFException")}}class cf extends Wm{constructor(t){super(t,"MissingPDFException")}}class pj extends Wm{constructor(t,o){super(t,"UnexpectedResponseException"),this.status=o}}class djt extends Wm{constructor(t){super(t,"FormatError")}}class pf extends Wm{constructor(t){super(t,"AbortException")}}function bLe(e){(typeof e!="object"||e?.length===void 0)&&zi("Invalid argument for bytesToString");const t=e.length,o=8192;if(t<o)return String.fromCharCode.apply(null,e);const i=[];for(let a=0;a<t;a+=o){const l=Math.min(a+o,t),d=e.subarray(a,l);i.push(String.fromCharCode.apply(null,d))}return i.join("")}function uj(e){typeof e!="string"&&zi("Invalid argument for stringToBytes");const t=e.length,o=new Uint8Array(t);for(let i=0;i<t;++i)o[i]=e.charCodeAt(i)&255;return o}function cjt(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function oK(e){const t=Object.create(null);for(const[o,i]of e)t[o]=i;return t}function pjt(){const e=new Uint8Array(4);return e[0]=1,new Uint32Array(e.buffer,0,1)[0]===1}function ujt(){try{return new Function(""),!0}catch{return!1}}class sd{static get isLittleEndian(){return si(this,"isLittleEndian",pjt())}static get isEvalSupported(){return si(this,"isEvalSupported",ujt())}static get isOffscreenCanvasSupported(){return si(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&typeof navigator?.platform=="string"?si(this,"platform",{isMac:navigator.platform.includes("Mac")}):si(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){return si(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const LO=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0"));class So{static makeHexColor(t,o,i){return`#${LO[t]}${LO[o]}${LO[i]}`}static scaleMinMax(t,o){let i;t[0]?(t[0]<0&&(i=o[0],o[0]=o[2],o[2]=i),o[0]*=t[0],o[2]*=t[0],t[3]<0&&(i=o[1],o[1]=o[3],o[3]=i),o[1]*=t[3],o[3]*=t[3]):(i=o[0],o[0]=o[1],o[1]=i,i=o[2],o[2]=o[3],o[3]=i,t[1]<0&&(i=o[1],o[1]=o[3],o[3]=i),o[1]*=t[1],o[3]*=t[1],t[2]<0&&(i=o[0],o[0]=o[2],o[2]=i),o[0]*=t[2],o[2]*=t[2]),o[0]+=t[4],o[1]+=t[5],o[2]+=t[4],o[3]+=t[5]}static transform(t,o){return[t[0]*o[0]+t[2]*o[1],t[1]*o[0]+t[3]*o[1],t[0]*o[2]+t[2]*o[3],t[1]*o[2]+t[3]*o[3],t[0]*o[4]+t[2]*o[5]+t[4],t[1]*o[4]+t[3]*o[5]+t[5]]}static applyTransform(t,o){const i=t[0]*o[0]+t[1]*o[2]+o[4],a=t[0]*o[1]+t[1]*o[3]+o[5];return[i,a]}static applyInverseTransform(t,o){const i=o[0]*o[3]-o[1]*o[2],a=(t[0]*o[3]-t[1]*o[2]+o[2]*o[5]-o[4]*o[3])/i,l=(-t[0]*o[1]+t[1]*o[0]+o[4]*o[1]-o[5]*o[0])/i;return[a,l]}static getAxialAlignedBoundingBox(t,o){const i=this.applyTransform(t,o),a=this.applyTransform(t.slice(2,4),o),l=this.applyTransform([t[0],t[3]],o),d=this.applyTransform([t[2],t[1]],o);return[Math.min(i[0],a[0],l[0],d[0]),Math.min(i[1],a[1],l[1],d[1]),Math.max(i[0],a[0],l[0],d[0]),Math.max(i[1],a[1],l[1],d[1])]}static inverseTransform(t){const o=t[0]*t[3]-t[1]*t[2];return[t[3]/o,-t[1]/o,-t[2]/o,t[0]/o,(t[2]*t[5]-t[4]*t[3])/o,(t[4]*t[1]-t[5]*t[0])/o]}static singularValueDecompose2dScale(t){const o=[t[0],t[2],t[1],t[3]],i=t[0]*o[0]+t[1]*o[2],a=t[0]*o[1]+t[1]*o[3],l=t[2]*o[0]+t[3]*o[2],d=t[2]*o[1]+t[3]*o[3],c=(i+d)/2,p=Math.sqrt((i+d)**2-4*(i*d-l*a))/2,u=c+p||1,h=c-p||1;return[Math.sqrt(u),Math.sqrt(h)]}static normalizeRect(t){const o=t.slice(0);return t[0]>t[2]&&(o[0]=t[2],o[2]=t[0]),t[1]>t[3]&&(o[1]=t[3],o[3]=t[1]),o}static intersect(t,o){const i=Math.max(Math.min(t[0],t[2]),Math.min(o[0],o[2])),a=Math.min(Math.max(t[0],t[2]),Math.max(o[0],o[2]));if(i>a)return null;const l=Math.max(Math.min(t[1],t[3]),Math.min(o[1],o[3])),d=Math.min(Math.max(t[1],t[3]),Math.max(o[1],o[3]));return l>d?null:[i,l,a,d]}static#e(t,o,i,a,l,d,c,p,u,h){if(u<=0||u>=1)return;const m=1-u,f=u*u,x=f*u,y=m*(m*(m*t+3*u*o)+3*f*i)+x*a,w=m*(m*(m*l+3*u*d)+3*f*c)+x*p;h[0]=Math.min(h[0],y),h[1]=Math.min(h[1],w),h[2]=Math.max(h[2],y),h[3]=Math.max(h[3],w)}static#t(t,o,i,a,l,d,c,p,u,h,m,f){if(Math.abs(u)<1e-12){Math.abs(h)>=1e-12&&this.#e(t,o,i,a,l,d,c,p,-m/h,f);return}const x=h**2-4*m*u;if(x<0)return;const y=Math.sqrt(x),w=2*u;this.#e(t,o,i,a,l,d,c,p,(-h+y)/w,f),this.#e(t,o,i,a,l,d,c,p,(-h-y)/w,f)}static bezierBoundingBox(t,o,i,a,l,d,c,p,u){return u?(u[0]=Math.min(u[0],t,c),u[1]=Math.min(u[1],o,p),u[2]=Math.max(u[2],t,c),u[3]=Math.max(u[3],o,p)):u=[Math.min(t,c),Math.min(o,p),Math.max(t,c),Math.max(o,p)],this.#t(t,i,l,c,o,a,d,p,3*(-t+3*(i-l)+c),6*(t-2*i+l),3*(i-t),u),this.#t(t,i,l,c,o,a,d,p,3*(-o+3*(a-d)+p),6*(o-2*a+d),3*(a-o),u),u}}function hjt(e){return decodeURIComponent(escape(e))}let jO=null,Dpe=null;function mjt(e){return jO||(jO=/([\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,Dpe=new Map([["ſt","ſt"]])),e.replaceAll(jO,(t,o,i)=>o?o.normalize("NFKC"):Dpe.get(i))}function gjt(){if(typeof crypto<"u"&&typeof crypto?.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(32);if(typeof crypto<"u"&&typeof crypto?.getRandomValues=="function")crypto.getRandomValues(e);else for(let t=0;t<32;t++)e[t]=Math.floor(Math.random()*255);return bLe(e)}const vLe="pdfjs_internal_id_",Nh={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8};class hj{constructor(){this.constructor===hj&&zi("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,o){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,o,i,a,l){return"none"}destroy(t=!1){}}class mj{#e=!1;constructor({enableHWA:t=!1}={}){this.constructor===mj&&zi("Cannot initialize BaseCanvasFactory."),this.#e=t}create(t,o){if(t<=0||o<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,o);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!this.#e})}}reset(t,o,i){if(!t.canvas)throw new Error("Canvas is not specified");if(o<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=o,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,o){zi("Abstract method `_createCanvas` called.")}}class gj{constructor({baseUrl:t=null,isCompressed:o=!0}){this.constructor===gj&&zi("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=o}async fetch({name:t}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const o=this.baseUrl+t+(this.isCompressed?".bcmap":""),i=this.isCompressed?CQ.BINARY:CQ.NONE;return this._fetchData(o,i).catch(a=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${o}`)})}_fetchData(t,o){zi("Abstract method `_fetchData` called.")}}class fj{constructor({baseUrl:t=null}){this.constructor===fj&&zi("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const o=`${this.baseUrl}${t}`;return this._fetchData(o).catch(i=>{throw new Error(`Unable to load font data at: ${o}`)})}_fetchData(t){zi("Abstract method `_fetchData` called.")}}class rK{constructor(){this.constructor===rK&&zi("Cannot initialize BaseSVGFactory.")}create(t,o,i=!1){if(t<=0||o<=0)throw new Error("Invalid SVG dimensions");const a=this._createSVG("svg:svg");return a.setAttribute("version","1.1"),i||(a.setAttribute("width",`${t}px`),a.setAttribute("height",`${o}px`)),a.setAttribute("preserveAspectRatio","none"),a.setAttribute("viewBox",`0 0 ${t} ${o}`),a}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){zi("Abstract method `_createSVG` called.")}}const Gh="http://www.w3.org/2000/svg";class k6{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}class fjt extends hj{#e;#t;#o;#i;#s;#r=0;constructor({docId:t,ownerDocument:o=globalThis.document}={}){super(),this.#o=t,this.#i=o}get#n(){return this.#e||=new Map}get#l(){return this.#s||=new Map}get#c(){if(!this.#t){const t=this.#i.createElement("div"),{style:o}=t;o.visibility="hidden",o.contain="strict",o.width=o.height=0,o.position="absolute",o.top=o.left=0,o.zIndex=-1;const i=this.#i.createElementNS(Gh,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#t=this.#i.createElementNS(Gh,"defs"),t.append(i),i.append(this.#t),this.#i.body.append(t)}return this.#t}#p(t){if(t.length===1){const p=t[0],u=new Array(256);for(let m=0;m<256;m++)u[m]=p[m]/255;const h=u.join(",");return[h,h,h]}const[o,i,a]=t,l=new Array(256),d=new Array(256),c=new Array(256);for(let p=0;p<256;p++)l[p]=o[p]/255,d[p]=i[p]/255,c[p]=a[p]/255;return[l.join(","),d.join(","),c.join(",")]}addFilter(t){if(!t)return"none";let o=this.#n.get(t);if(o)return o;const[i,a,l]=this.#p(t),d=t.length===1?i:`${i}${a}${l}`;if(o=this.#n.get(d),o)return this.#n.set(t,o),o;const c=`g_${this.#o}_transfer_map_${this.#r++}`,p=`url(#${c})`;this.#n.set(t,p),this.#n.set(d,p);const u=this.#a(c);return this.#f(i,a,l,u),p}addHCMFilter(t,o){const i=`${t}-${o}`,a="base";let l=this.#l.get(a);if(l?.key===i||(l?(l.filter?.remove(),l.key=i,l.url="none",l.filter=null):(l={key:i,url:"none",filter:null},this.#l.set(a,l)),!t||!o))return l.url;const d=this.#y(t);t=So.makeHexColor(...d);const c=this.#y(o);if(o=So.makeHexColor(...c),this.#c.style.color="",t==="#000000"&&o==="#ffffff"||t===o)return l.url;const p=new Array(256);for(let x=0;x<=255;x++){const y=x/255;p[x]=y<=.03928?y/12.92:((y+.055)/1.055)**2.4}const u=p.join(","),h=`g_${this.#o}_hcm_filter`,m=l.filter=this.#a(h);this.#f(u,u,u,m),this.#d(m);const f=(x,y)=>{const w=d[x]/255,b=c[x]/255,v=new Array(y+1);for(let A=0;A<=y;A++)v[A]=w+A/y*(b-w);return v.join(",")};return this.#f(f(0,5),f(1,5),f(2,5),m),l.url=`url(#${h})`,l.url}addAlphaFilter(t){let o=this.#n.get(t);if(o)return o;const[i]=this.#p([t]),a=`alpha_${i}`;if(o=this.#n.get(a),o)return this.#n.set(t,o),o;const l=`g_${this.#o}_alpha_map_${this.#r++}`,d=`url(#${l})`;this.#n.set(t,d),this.#n.set(a,d);const c=this.#a(l);return this.#u(i,c),d}addLuminosityFilter(t){let o=this.#n.get(t||"luminosity");if(o)return o;let i,a;if(t?([i]=this.#p([t]),a=`luminosity_${i}`):a="luminosity",o=this.#n.get(a),o)return this.#n.set(t,o),o;const l=`g_${this.#o}_luminosity_map_${this.#r++}`,d=`url(#${l})`;this.#n.set(t,d),this.#n.set(a,d);const c=this.#a(l);return this.#h(c),t&&this.#u(i,c),d}addHighlightHCMFilter(t,o,i,a,l){const d=`${o}-${i}-${a}-${l}`;let c=this.#l.get(t);if(c?.key===d||(c?(c.filter?.remove(),c.key=d,c.url="none",c.filter=null):(c={key:d,url:"none",filter:null},this.#l.set(t,c)),!o||!i))return c.url;const[p,u]=[o,i].map(this.#y.bind(this));let h=Math.round(.2126*p[0]+.7152*p[1]+.0722*p[2]),m=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),[f,x]=[a,l].map(this.#y.bind(this));m<h&&([h,m,f,x]=[m,h,x,f]),this.#c.style.color="";const y=(v,A,S)=>{const E=new Array(256),I=(m-h)/S,L=v/255,B=(A-v)/(255*S);let P=0;for(let D=0;D<=S;D++){const T=Math.round(h+D*I),O=L+D*B;for(let F=P;F<=T;F++)E[F]=O;P=T+1}for(let D=P;D<256;D++)E[D]=E[P-1];return E.join(",")},w=`g_${this.#o}_hcm_${t}_filter`,b=c.filter=this.#a(w);return this.#d(b),this.#f(y(f[0],x[0],5),y(f[1],x[1],5),y(f[2],x[2],5),b),c.url=`url(#${w})`,c.url}destroy(t=!1){t&&this.#l.size!==0||(this.#t&&(this.#t.parentNode.parentNode.remove(),this.#t=null),this.#e&&(this.#e.clear(),this.#e=null),this.#r=0)}#h(t){const o=this.#i.createElementNS(Gh,"feColorMatrix");o.setAttribute("type","matrix"),o.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(o)}#d(t){const o=this.#i.createElementNS(Gh,"feColorMatrix");o.setAttribute("type","matrix"),o.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(o)}#a(t){const o=this.#i.createElementNS(Gh,"filter");return o.setAttribute("color-interpolation-filters","sRGB"),o.setAttribute("id",t),this.#c.append(o),o}#m(t,o,i){const a=this.#i.createElementNS(Gh,o);a.setAttribute("type","discrete"),a.setAttribute("tableValues",i),t.append(a)}#f(t,o,i,a){const l=this.#i.createElementNS(Gh,"feComponentTransfer");a.append(l),this.#m(l,"feFuncR",t),this.#m(l,"feFuncG",o),this.#m(l,"feFuncB",i)}#u(t,o){const i=this.#i.createElementNS(Gh,"feComponentTransfer");o.append(i),this.#m(i,"feFuncA",t)}#y(t){return this.#c.style.color=t,lK(getComputedStyle(this.#c).getPropertyValue("color"))}}class xjt extends mj{constructor({ownerDocument:t=globalThis.document,enableHWA:o=!1}={}){super({enableHWA:o}),this._document=t}_createCanvas(t,o){const i=this._document.createElement("canvas");return i.width=t,i.height=o,i}}async function xj(e,t="text"){if(Yx(e,document.baseURI)){const o=await fetch(e);if(!o.ok)throw new Error(o.statusText);switch(t){case"arraybuffer":return o.arrayBuffer();case"blob":return o.blob();case"json":return o.json()}return o.text()}return new Promise((o,i)=>{const a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType=t,a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE){if(a.status===200||a.status===0){switch(t){case"arraybuffer":case"blob":case"json":o(a.response);return}o(a.responseText);return}i(new Error(a.statusText))}},a.send(null)})}class CLe extends gj{_fetchData(t,o){return xj(t,this.isCompressed?"arraybuffer":"text").then(i=>({cMapData:i instanceof ArrayBuffer?new Uint8Array(i):uj(i),compressionType:o}))}}class ALe extends fj{_fetchData(t){return xj(t,"arraybuffer").then(o=>new Uint8Array(o))}}class iK extends rK{_createSVG(t){return document.createElementNS(Gh,t)}}class Eb{constructor({viewBox:t,scale:o,rotation:i,offsetX:a=0,offsetY:l=0,dontFlip:d=!1}){this.viewBox=t,this.scale=o,this.rotation=i,this.offsetX=a,this.offsetY=l;const c=(t[2]+t[0])/2,p=(t[3]+t[1])/2;let u,h,m,f;switch(i%=360,i<0&&(i+=360),i){case 180:u=-1,h=0,m=0,f=1;break;case 90:u=0,h=1,m=1,f=0;break;case 270:u=0,h=-1,m=-1,f=0;break;case 0:u=1,h=0,m=0,f=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}d&&(m=-m,f=-f);let x,y,w,b;u===0?(x=Math.abs(p-t[1])*o+a,y=Math.abs(c-t[0])*o+l,w=(t[3]-t[1])*o,b=(t[2]-t[0])*o):(x=Math.abs(c-t[0])*o+a,y=Math.abs(p-t[1])*o+l,w=(t[2]-t[0])*o,b=(t[3]-t[1])*o),this.transform=[u*o,h*o,m*o,f*o,x-u*o*c-m*o*p,y-h*o*c-f*o*p],this.width=w,this.height=b}get rawDims(){const{viewBox:t}=this;return si(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:o=this.rotation,offsetX:i=this.offsetX,offsetY:a=this.offsetY,dontFlip:l=!1}={}){return new Eb({viewBox:this.viewBox.slice(),scale:t,rotation:o,offsetX:i,offsetY:a,dontFlip:l})}convertToViewportPoint(t,o){return So.applyTransform([t,o],this.transform)}convertToViewportRectangle(t){const o=So.applyTransform([t[0],t[1]],this.transform),i=So.applyTransform([t[2],t[3]],this.transform);return[o[0],o[1],i[0],i[1]]}convertToPdfPoint(t,o){return So.applyInverseTransform([t,o],this.transform)}}class nK extends Wm{constructor(t,o=0){super(t,"RenderingCancelledException"),this.extraDelay=o}}function aK(e){const t=e.length;let o=0;for(;o<t&&e[o].trim()==="";)o++;return e.substring(o,o+5).toLowerCase()==="data:"}function sK(e){return typeof e=="string"&&/\.pdf$/i.test(e)}function yjt(e){return[e]=e.split(/[#?]/,1),e.substring(e.lastIndexOf("/")+1)}function wjt(e,t="document.pdf"){if(typeof e!="string")return t;if(aK(e))return Br('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const o=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,a=o.exec(e);let l=i.exec(a[1])||i.exec(a[2])||i.exec(a[3]);if(l&&(l=l[0],l.includes("%")))try{l=i.exec(decodeURIComponent(l))[0]}catch{}return l||t}class Tpe{started=Object.create(null);times=[];time(t){t in this.started&&Br(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||Br(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let o=0;for(const{name:i}of this.times)o=Math.max(i.length,o);for(const{name:i,start:a,end:l}of this.times)t.push(`${i.padEnd(o)} ${l-a}ms
246
- `);return t.join("")}}function Yx(e,t){try{const{protocol:o}=t?new URL(e,t):new URL(e);return o==="http:"||o==="https:"}catch{return!1}}function hd(e){e.preventDefault()}function $Le(e){console.log("Deprecated API usage: "+e)}let zpe;class kLe{static toDateObject(t){if(!t||typeof t!="string")return null;zpe||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const o=zpe.exec(t);if(!o)return null;const i=parseInt(o[1],10);let a=parseInt(o[2],10);a=a>=1&&a<=12?a-1:0;let l=parseInt(o[3],10);l=l>=1&&l<=31?l:1;let d=parseInt(o[4],10);d=d>=0&&d<=23?d:0;let c=parseInt(o[5],10);c=c>=0&&c<=59?c:0;let p=parseInt(o[6],10);p=p>=0&&p<=59?p:0;const u=o[7]||"Z";let h=parseInt(o[8],10);h=h>=0&&h<=23?h:0;let m=parseInt(o[9],10)||0;return m=m>=0&&m<=59?m:0,u==="-"?(d+=h,c+=m):u==="+"&&(d-=h,c-=m),new Date(Date.UTC(i,a,l,d,c,p))}}function bjt(e,{scale:t=1,rotation:o=0}){const{width:i,height:a}=e.attributes.style,l=[0,0,parseInt(i),parseInt(a)];return new Eb({viewBox:l,scale:t,rotation:o})}function lK(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map(t=>parseInt(t)):e.startsWith("rgba(")?e.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(Br(`Not a valid color format: "${e}"`),[0,0,0])}function vjt(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const o of e.keys()){t.style.color=o;const i=window.getComputedStyle(t).color;e.set(o,lK(i))}t.remove()}function An(e){const{a:t,b:o,c:i,d:a,e:l,f:d}=e.getTransform();return[t,o,i,a,l,d]}function Hh(e){const{a:t,b:o,c:i,d:a,e:l,f:d}=e.getTransform().invertSelf();return[t,o,i,a,l,d]}function _4(e,t,o=!1,i=!0){if(t instanceof Eb){const{pageWidth:a,pageHeight:l}=t.rawDims,{style:d}=e,c=sd.isCSSRoundSupported,p=`var(--scale-factor) * ${a}px`,u=`var(--scale-factor) * ${l}px`,h=c?`round(${p}, 1px)`:`calc(${p})`,m=c?`round(${u}, 1px)`:`calc(${u})`;!o||t.rotation%180===0?(d.width=h,d.height=m):(d.width=m,d.height=h)}i&&e.setAttribute("data-main-rotation",t.rotation)}class dK{#e=null;#t=null;#o;#i=null;constructor(t){this.#o=t}render(){const t=this.#e=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");const o=this.#o._uiManager._signal;t.addEventListener("contextmenu",hd,{signal:o}),t.addEventListener("pointerdown",dK.#s,{signal:o});const i=this.#i=document.createElement("div");i.className="buttons",t.append(i);const a=this.#o.toolbarPosition;if(a){const{style:l}=t,d=this.#o._uiManager.direction==="ltr"?1-a[0]:a[0];l.insetInlineEnd=`${100*d}%`,l.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return this.#c(),t}static#s(t){t.stopPropagation()}#r(t){this.#o._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}#n(t){this.#o._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}#l(t){const o=this.#o._uiManager._signal;t.addEventListener("focusin",this.#r.bind(this),{capture:!0,signal:o}),t.addEventListener("focusout",this.#n.bind(this),{capture:!0,signal:o}),t.addEventListener("contextmenu",hd,{signal:o})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden")}#c(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id",`pdfjs-editor-remove-${this.#o.editorType}-button`),this.#l(t),t.addEventListener("click",o=>{this.#o._uiManager.delete()},{signal:this.#o._uiManager._signal}),this.#i.append(t)}get#p(){const t=document.createElement("div");return t.className="divider",t}addAltTextButton(t){this.#l(t),this.#i.prepend(t,this.#p)}addColorPicker(t){this.#t=t;const o=t.renderButton();this.#l(o),this.#i.prepend(o,this.#p)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class Cjt{#e=null;#t=null;#o;constructor(t){this.#o=t}#i(){const t=this.#t=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",hd,{signal:this.#o._signal});const o=this.#e=document.createElement("div");return o.className="buttons",t.append(o),this.#r(),t}#s(t,o){let i=0,a=0;for(const l of t){const d=l.y+l.height;if(d<i)continue;const c=l.x+(o?l.width:0);if(d>i){a=c,i=d;continue}o?c>a&&(a=c):c<a&&(a=c)}return[o?1-a:a,i]}show(t,o,i){const[a,l]=this.#s(o,i),{style:d}=this.#t||=this.#i();t.append(this.#t),d.insetInlineEnd=`${100*a}%`,d.top=`calc(${100*l}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#r(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const o=document.createElement("span");t.append(o),o.className="visuallyHidden",o.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=this.#o._signal;t.addEventListener("contextmenu",hd,{signal:i}),t.addEventListener("click",()=>{this.#o.highlightSelection("floating_button")},{signal:i}),this.#e.append(t)}}function bS(e,t,o){for(const i of o)t.addEventListener(i,e[i].bind(e))}function Ajt(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")}class $jt{#e=0;get id(){return`${ojt}${this.#e++}`}}class cK{#e=gjt();#t=0;#o=null;static get _isSVGFittingCanvas(){const t='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}),a=new Image;a.src=t;const l=a.decode().then(()=>(i.drawImage(a,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return si(this,"_isSVGFittingCanvas",l)}async#i(t,o){this.#o||=new Map;let i=this.#o.get(t);if(i===null)return null;if(i?.bitmap)return i.refCounter+=1,i;try{i||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let a;if(typeof o=="string"?(i.url=o,a=await xj(o,"blob")):a=i.file=o,a.type==="image/svg+xml"){const l=cK._isSVGFittingCanvas,d=new FileReader,c=new Image,p=new Promise((u,h)=>{c.onload=()=>{i.bitmap=c,i.isSvg=!0,u()},d.onload=async()=>{const m=i.svgUrl=d.result;c.src=await l?`${m}#svgView(preserveAspectRatio(none))`:m},c.onerror=d.onerror=h});d.readAsDataURL(a),await p}else i.bitmap=await createImageBitmap(a);i.refCounter=1}catch(a){console.error(a),i=null}return this.#o.set(t,i),i&&this.#o.set(i.id,i),i}async getFromFile(t){const{lastModified:o,name:i,size:a,type:l}=t;return this.#i(`${o}_${i}_${a}_${l}`,t)}async getFromUrl(t){return this.#i(t,t)}async getFromId(t){this.#o||=new Map;const o=this.#o.get(t);return o?o.bitmap?(o.refCounter+=1,o):o.file?this.getFromFile(o.file):this.getFromUrl(o.url):null}getSvgUrl(t){const o=this.#o.get(t);return o?.isSvg?o.svgUrl:null}deleteId(t){this.#o||=new Map;const o=this.#o.get(t);o&&(o.refCounter-=1,o.refCounter===0&&(o.bitmap=null))}isValidId(t){return t.startsWith(`image_${this.#e}_`)}}class kjt{#e=[];#t=!1;#o;#i=-1;constructor(t=128){this.#o=t}add({cmd:t,undo:o,post:i,mustExec:a,type:l=NaN,overwriteIfSameType:d=!1,keepUndo:c=!1}){if(a&&t(),this.#t)return;const p={cmd:t,undo:o,post:i,type:l};if(this.#i===-1){this.#e.length>0&&(this.#e.length=0),this.#i=0,this.#e.push(p);return}if(d&&this.#e[this.#i].type===l){c&&(p.undo=this.#e[this.#i].undo),this.#e[this.#i]=p;return}const u=this.#i+1;u===this.#o?this.#e.splice(0,1):(this.#i=u,u<this.#e.length&&this.#e.splice(u)),this.#e.push(p)}undo(){if(this.#i===-1)return;this.#t=!0;const{undo:t,post:o}=this.#e[this.#i];t(),o?.(),this.#t=!1,this.#i-=1}redo(){if(this.#i<this.#e.length-1){this.#i+=1,this.#t=!0;const{cmd:t,post:o}=this.#e[this.#i];t(),o?.(),this.#t=!1}}hasSomethingToUndo(){return this.#i!==-1}hasSomethingToRedo(){return this.#i<this.#e.length-1}destroy(){this.#e=null}}class Lb{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:o}=sd.platform;for(const[i,a,l={}]of t)for(const d of i){const c=d.startsWith("mac+");o&&c?(this.callbacks.set(d.slice(4),{callback:a,options:l}),this.allKeys.add(d.split("+").at(-1))):!o&&!c&&(this.callbacks.set(d,{callback:a,options:l}),this.allKeys.add(d.split("+").at(-1)))}}#e(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 o=this.buffer.join("+");return this.buffer.length=0,o}exec(t,o){if(!this.allKeys.has(o.key))return;const i=this.callbacks.get(this.#e(o));if(!i)return;const{callback:a,options:{bubbles:l=!1,args:d=[],checker:c=null}}=i;c&&!c(t,o)||(a.bind(t,...d,o)(),l||(o.stopPropagation(),o.preventDefault()))}}class pK{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return vjt(t),si(this,"_colors",t)}convert(t){const o=lK(t);if(!window.matchMedia("(forced-colors: active)").matches)return o;for(const[i,a]of this._colors)if(a.every((l,d)=>l===o[d]))return pK._colorsMapping.get(i);return o}getHexCode(t){const o=this._colors.get(t);return o?So.makeHexColor(...o):t}}class Mm{#e=new AbortController;#t=null;#o=new Map;#i=new Map;#s=null;#r=null;#n=null;#l=new kjt;#c=0;#p=new Set;#h=null;#d=null;#a=new Set;#m=!1;#f=null;#u=null;#y=null;#g=!1;#w=null;#v=new $jt;#A=!1;#k=!1;#S=null;#I=null;#$=null;#b=Xr.NONE;#x=new Set;#C=null;#E=null;#L=null;#B=this.blur.bind(this);#M=this.focus.bind(this);#T=this.copy.bind(this);#P=this.cut.bind(this);#z=this.paste.bind(this);#D=this.keydown.bind(this);#Q=this.keyup.bind(this);#U=this.onEditingAction.bind(this);#_=this.onPageChanging.bind(this);#N=this.onScaleChanging.bind(this);#R=this.onRotationChanging.bind(this);#K={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#V=[0,0];#F=null;#H=null;#q=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=Mm.prototype,o=d=>d.#H.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&d.hasSomethingToControl(),i=(d,{target:c})=>{if(c instanceof HTMLInputElement){const{type:p}=c;return p!=="text"&&p!=="number"}return!0},a=this.TRANSLATE_SMALL,l=this.TRANSLATE_BIG;return si(this,"_keyboardManager",new Lb([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(d,{target:c})=>!(c instanceof HTMLButtonElement)&&d.#H.contains(c)&&!d.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(d,{target:c})=>!(c instanceof HTMLButtonElement)&&d.#H.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-a,0],checker:o}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-l,0],checker:o}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[a,0],checker:o}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[l,0],checker:o}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-a],checker:o}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-l],checker:o}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,a],checker:o}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,l],checker:o}]]))}constructor(t,o,i,a,l,d,c,p,u){this._signal=this.#e.signal,this.#H=t,this.#q=o,this.#s=i,this._eventBus=a,this._eventBus._on("editingaction",this.#U),this._eventBus._on("pagechanging",this.#_),this._eventBus._on("scalechanging",this.#N),this._eventBus._on("rotationchanging",this.#R),this.#ie(),this.#le(),this.#Z(),this.#r=l.annotationStorage,this.#f=l.filterFactory,this.#E=d,this.#y=c||null,this.#m=p,this.#$=u||null,this.viewParameters={realScale:k6.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#e?.abort(),this.#e=null,this._signal=null,this._eventBus._off("editingaction",this.#U),this._eventBus._off("pagechanging",this.#_),this._eventBus._off("scalechanging",this.#N),this._eventBus._off("rotationchanging",this.#R);for(const t of this.#i.values())t.destroy();this.#i.clear(),this.#o.clear(),this.#a.clear(),this.#t=null,this.#x.clear(),this.#l.destroy(),this.#s?.destroy(),this.#w?.hide(),this.#w=null,this.#u&&(clearTimeout(this.#u),this.#u=null),this.#F&&(clearTimeout(this.#F),this.#F=null)}async mlGuess(t){return this.#$?.guess(t)||null}get hasMLManager(){return!!this.#$}get hcmFilter(){return si(this,"hcmFilter",this.#E?this.#f.addHCMFilter(this.#E.foreground,this.#E.background):"none")}get direction(){return si(this,"direction",getComputedStyle(this.#H).direction)}get highlightColors(){return si(this,"highlightColors",this.#y?new Map(this.#y.split(",").map(t=>t.split("=").map(o=>o.trim()))):null)}get highlightColorNames(){return si(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){this.#I=t}editAltText(t){this.#s?.editAltText(this,t)}onPageChanging({pageNumber:t}){this.#c=t-1}focusMainContainer(){this.#H.focus()}findParent(t,o){for(const i of this.#i.values()){const{x:a,y:l,width:d,height:c}=i.div.getBoundingClientRect();if(t>=a&&t<=a+d&&o>=l&&o<=l+c)return i}return null}disableUserSelect(t=!1){this.#q.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#a.add(t)}removeShouldRescale(t){this.#a.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*k6.PDF_TO_CSS_UNITS;for(const o of this.#a)o.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#G({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}highlightSelection(t=""){const o=document.getSelection();if(!o||o.isCollapsed)return;const{anchorNode:i,anchorOffset:a,focusNode:l,focusOffset:d}=o,c=o.toString(),u=this.#G(o).closest(".textLayer"),h=this.getSelectionBoxes(u);if(h){o.empty(),this.#b===Xr.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:Xr.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const m of this.#i.values())if(m.hasTextLayer(u)){m.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:h,anchorNode:i,anchorOffset:a,focusNode:l,focusOffset:d,text:c});break}}}#oe(){const t=document.getSelection();if(!t||t.isCollapsed)return;const i=this.#G(t).closest(".textLayer"),a=this.getSelectionBoxes(i);a&&(this.#w||=new Cjt(this),this.#w.show(i,a,this.direction==="ltr"))}addToAnnotationStorage(t){!t.isEmpty()&&this.#r&&!this.#r.has(t.id)&&this.#r.setValue(t.id,t)}#re(){const t=document.getSelection();if(!t||t.isCollapsed){this.#C&&(this.#w?.hide(),this.#C=null,this.#j({hasSelectedText:!1}));return}const{anchorNode:o}=t;if(o===this.#C)return;if(!this.#G(t).closest(".textLayer")){this.#C&&(this.#w?.hide(),this.#C=null,this.#j({hasSelectedText:!1}));return}if(this.#w?.hide(),this.#C=o,this.#j({hasSelectedText:!0}),!(this.#b!==Xr.HIGHLIGHT&&this.#b!==Xr.NONE)&&(this.#b===Xr.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#g=this.isShiftKeyDown,!this.isShiftKeyDown)){const l=this._signal,d=c=>{c.type==="pointerup"&&c.button!==0||(window.removeEventListener("pointerup",d),window.removeEventListener("blur",d),c.type==="pointerup"&&this.#Y("main_toolbar"))};window.addEventListener("pointerup",d,{signal:l}),window.addEventListener("blur",d,{signal:l})}}#Y(t=""){this.#b===Xr.HIGHLIGHT?this.highlightSelection(t):this.#m&&this.#oe()}#ie(){document.addEventListener("selectionchange",this.#re.bind(this),{signal:this._signal})}#ne(){const t=this._signal;window.addEventListener("focus",this.#M,{signal:t}),window.addEventListener("blur",this.#B,{signal:t})}#ae(){window.removeEventListener("focus",this.#M),window.removeEventListener("blur",this.#B)}blur(){if(this.isShiftKeyDown=!1,this.#g&&(this.#g=!1,this.#Y("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const o of this.#x)if(o.div.contains(t)){this.#S=[o,t],o._focusEventsAllowed=!1;break}}focus(){if(!this.#S)return;const[t,o]=this.#S;this.#S=null,o.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),o.focus()}#Z(){const t=this._signal;window.addEventListener("keydown",this.#D,{signal:t}),window.addEventListener("keyup",this.#Q,{signal:t})}#se(){window.removeEventListener("keydown",this.#D),window.removeEventListener("keyup",this.#Q)}#J(){const t=this._signal;document.addEventListener("copy",this.#T,{signal:t}),document.addEventListener("cut",this.#P,{signal:t}),document.addEventListener("paste",this.#z,{signal:t})}#X(){document.removeEventListener("copy",this.#T),document.removeEventListener("cut",this.#P),document.removeEventListener("paste",this.#z)}#le(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#Z(),this.#J()}removeEditListeners(){this.#se(),this.#X()}dragOver(t){for(const{type:o}of t.dataTransfer.items)for(const i of this.#d)if(i.isHandlingMimeForPasting(o)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const o of t.dataTransfer.items)for(const i of this.#d)if(i.isHandlingMimeForPasting(o.type)){i.paste(o,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const o=[];for(const i of this.#x){const a=i.serialize(!0);a&&o.push(a)}o.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(o))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:o}=t;for(const l of o.items)for(const d of this.#d)if(d.isHandlingMimeForPasting(l.type)){d.paste(l,this.currentLayer);return}let i=o.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(l){Br(`paste: "${l.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();const a=this.currentLayer;try{const l=[];for(const p of i){const u=a.deserialize(p);if(!u)return;l.push(u)}const d=()=>{for(const p of l)this.#ee(p);this.#te(l)},c=()=>{for(const p of l)p.remove()};this.addCommands({cmd:d,undo:c,mustExec:!0})}catch(l){Br(`paste: "${l.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),this.#b!==Xr.NONE&&!this.isEditorHandlingKeyboard&&Mm._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,this.#g&&(this.#g=!1,this.#Y("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}#j(t){Object.entries(t).some(([i,a])=>this.#K[i]!==a)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#K,t)}),this.#b===Xr.HIGHLIGHT&&t.hasSelectedEditor===!1&&this.#O([[ar.HIGHLIGHT_FREE,!0]]))}#O(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#ne(),this.#J(),this.#j({isEditing:this.#b!==Xr.NONE,isEmpty:this.#W(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ae(),this.#X(),this.#j({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#d){this.#d=t;for(const o of this.#d)this.#O(o.defaultPropertiesToUpdate)}}getId(){return this.#v.id}get currentLayer(){return this.#i.get(this.#c)}getLayer(t){return this.#i.get(t)}get currentPageIndex(){return this.#c}addLayer(t){this.#i.set(t.pageIndex,t),this.#A?t.enable():t.disable()}removeLayer(t){this.#i.delete(t.pageIndex)}updateMode(t,o=null,i=!1){if(this.#b!==t){if(this.#b=t,t===Xr.NONE){this.setEditingState(!1),this.#ce();return}this.setEditingState(!0),this.#de(),this.unselectAll();for(const a of this.#i.values())a.updateMode(t);if(!o&&i){this.addNewEditorFromKeyboard();return}if(o){for(const a of this.#o.values())if(a.annotationElementId===o){this.setSelected(a),a.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#b&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,o){if(this.#d){switch(t){case ar.CREATE:this.currentLayer.addNewEditor();return;case ar.HIGHLIGHT_DEFAULT_COLOR:this.#I?.updateColor(o);break;case ar.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#L||=new Map).set(t,o),this.showAllEditors("highlight",o);break}for(const i of this.#x)i.updateParams(t,o);for(const i of this.#d)i.updateDefaultParams(t,o)}}showAllEditors(t,o,i=!1){for(const l of this.#o.values())l.editorType===t&&l.show(o);(this.#L?.get(ar.HIGHLIGHT_SHOW_ALL)??!0)!==o&&this.#O([[ar.HIGHLIGHT_SHOW_ALL,o]])}enableWaiting(t=!1){if(this.#k!==t){this.#k=t;for(const o of this.#i.values())t?o.disableClick():o.enableClick(),o.div.classList.toggle("waiting",t)}}#de(){if(!this.#A){this.#A=!0;for(const t of this.#i.values())t.enable();for(const t of this.#o.values())t.enable()}}#ce(){if(this.unselectAll(),this.#A){this.#A=!1;for(const t of this.#i.values())t.disable();for(const t of this.#o.values())t.disable()}}getEditors(t){const o=[];for(const i of this.#o.values())i.pageIndex===t&&o.push(i);return o}getEditor(t){return this.#o.get(t)}addEditor(t){this.#o.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#u&&clearTimeout(this.#u),this.#u=setTimeout(()=>{this.focusMainContainer(),this.#u=null},0)),this.#o.delete(t.id),this.unselect(t),(!t.annotationElementId||!this.#p.has(t.annotationElementId))&&this.#r?.remove(t.id)}addDeletedAnnotationElement(t){this.#p.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#p.has(t)}removeDeletedAnnotationElement(t){this.#p.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#ee(t){const o=this.#i.get(t.pageIndex);o?o.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#t!==t&&(this.#t=t,t&&this.#O(t.propertiesToUpdate))}get#pe(){let t=null;for(t of this.#x);return t}updateUI(t){this.#pe===t&&this.#O(t.propertiesToUpdate)}toggleSelected(t){if(this.#x.has(t)){this.#x.delete(t),t.unselect(),this.#j({hasSelectedEditor:this.hasSelection});return}this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#j({hasSelectedEditor:!0})}setSelected(t){for(const o of this.#x)o!==t&&o.unselect();this.#x.clear(),this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#j({hasSelectedEditor:!0})}isSelected(t){return this.#x.has(t)}get firstSelectedEditor(){return this.#x.values().next().value}unselect(t){t.unselect(),this.#x.delete(t),this.#j({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#x.size!==0}get isEnterHandled(){return this.#x.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#j({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#W()})}redo(){this.#l.redo(),this.#j({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#W()})}addCommands(t){this.#l.add(t),this.#j({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#W()})}#W(){if(this.#o.size===0)return!0;if(this.#o.size===1)for(const t of this.#o.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...this.#x],o=()=>{for(const a of t)a.remove()},i=()=>{for(const a of t)this.#ee(a)};this.addCommands({cmd:o,undo:i,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#te(t){for(const o of this.#x)o.unselect();this.#x.clear();for(const o of t)o.isEmpty()||(this.#x.add(o),o.select());this.#j({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#x)t.commit();this.#te(this.#o.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#b!==Xr.NONE))&&this.hasSelection){for(const t of this.#x)t.unselect();this.#x.clear(),this.#j({hasSelectedEditor:!1})}}translateSelectedEditors(t,o,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#V[0]+=t,this.#V[1]+=o;const[a,l]=this.#V,d=[...this.#x],c=1e3;this.#F&&clearTimeout(this.#F),this.#F=setTimeout(()=>{this.#F=null,this.#V[0]=this.#V[1]=0,this.addCommands({cmd:()=>{for(const p of d)this.#o.has(p.id)&&p.translateInPage(a,l)},undo:()=>{for(const p of d)this.#o.has(p.id)&&p.translateInPage(-a,-l)},mustExec:!1})},c);for(const p of d)p.translateInPage(t,o)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#h=new Map;for(const t of this.#x)this.#h.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#h)return!1;this.disableUserSelect(!1);const t=this.#h;this.#h=null;let o=!1;for(const[{x:a,y:l,pageIndex:d},c]of t)c.newX=a,c.newY=l,c.newPageIndex=d,o||=a!==c.savedX||l!==c.savedY||d!==c.savedPageIndex;if(!o)return!1;const i=(a,l,d,c)=>{if(this.#o.has(a.id)){const p=this.#i.get(c);p?a._setParentAndPosition(p,l,d):(a.pageIndex=c,a.x=l,a.y=d)}};return this.addCommands({cmd:()=>{for(const[a,{newX:l,newY:d,newPageIndex:c}]of t)i(a,l,d,c)},undo:()=>{for(const[a,{savedX:l,savedY:d,savedPageIndex:c}]of t)i(a,l,d,c)},mustExec:!0}),!0}dragSelectedEditors(t,o){if(this.#h)for(const i of this.#h.keys())i.drag(t,o)}rebuild(t){if(t.parent===null){const o=this.getLayer(t.pageIndex);o?(o.changeParent(t),o.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#x.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#t===t}getActive(){return this.#t}getMode(){return this.#b}get imageManager(){return si(this,"imageManager",new cK)}getSelectionBoxes(t){if(!t)return null;const o=document.getSelection();for(let u=0,h=o.rangeCount;u<h;u++)if(!t.contains(o.getRangeAt(u).commonAncestorContainer))return null;const{x:i,y:a,width:l,height:d}=t.getBoundingClientRect();let c;switch(t.getAttribute("data-main-rotation")){case"90":c=(u,h,m,f)=>({x:(h-a)/d,y:1-(u+m-i)/l,width:f/d,height:m/l});break;case"180":c=(u,h,m,f)=>({x:1-(u+m-i)/l,y:1-(h+f-a)/d,width:m/l,height:f/d});break;case"270":c=(u,h,m,f)=>({x:1-(h+f-a)/d,y:(u-i)/l,width:f/d,height:m/l});break;default:c=(u,h,m,f)=>({x:(u-i)/l,y:(h-a)/d,width:m/l,height:f/d});break}const p=[];for(let u=0,h=o.rangeCount;u<h;u++){const m=o.getRangeAt(u);if(!m.collapsed)for(const{x:f,y:x,width:y,height:w}of m.getClientRects())y===0||w===0||p.push(c(f,x,y,w))}return p.length===0?null:p}addChangedExistingAnnotation({annotationElementId:t,id:o}){(this.#n||=new Map).set(t,o)}removeChangedExistingAnnotation({annotationElementId:t}){this.#n?.delete(t)}renderAnnotationElement(t){const o=this.#n?.get(t.data.id);if(!o)return;const i=this.#r.getRawValue(o);i&&(this.#b===Xr.NONE&&!i.hasBeenModified||i.renderAnnotationElement(t))}}class h4{#e="";#t=!1;#o=null;#i=null;#s=null;#r=!1;#n=null;static _l10nPromise=null;constructor(t){this.#n=t}static initialize(t){h4._l10nPromise||=t}async render(){const t=this.#o=document.createElement("button");t.className="altText";const o=await h4._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=o,t.setAttribute("aria-label",o),t.tabIndex="0";const i=this.#n._uiManager._signal;t.addEventListener("contextmenu",hd,{signal:i}),t.addEventListener("pointerdown",l=>l.stopPropagation(),{signal:i});const a=l=>{l.preventDefault(),this.#n._uiManager.editAltText(this.#n)};return t.addEventListener("click",a,{capture:!0,signal:i}),t.addEventListener("keydown",l=>{l.target===t&&l.key==="Enter"&&(this.#r=!0,a(l))},{signal:i}),await this.#l(),t}finish(){this.#o&&(this.#o.focus({focusVisible:this.#r}),this.#r=!1)}isEmpty(){return!this.#e&&!this.#t}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:t,decorative:o}){this.#e===t&&this.#t===o||(this.#e=t,this.#t=o,this.#l())}toggle(t=!1){this.#o&&(!t&&this.#s&&(clearTimeout(this.#s),this.#s=null),this.#o.disabled=!t)}destroy(){this.#o?.remove(),this.#o=null,this.#i=null}async#l(){const t=this.#o;if(!t)return;if(!this.#e&&!this.#t){t.classList.remove("done"),this.#i?.remove();return}t.classList.add("done"),h4._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(a=>{t.setAttribute("aria-label",a)});let o=this.#i;if(!o){this.#i=o=document.createElement("span"),o.className="tooltip",o.setAttribute("role","tooltip");const a=o.id=`alt-text-tooltip-${this.#n.id}`;t.setAttribute("aria-describedby",a);const l=100,d=this.#n._uiManager._signal;d.addEventListener("abort",()=>{clearTimeout(this.#s),this.#s=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#s=setTimeout(()=>{this.#s=null,this.#i.classList.add("show"),this.#n._reportTelemetry({action:"alt_text_tooltip"})},l)},{signal:d}),t.addEventListener("mouseleave",()=>{this.#s&&(clearTimeout(this.#s),this.#s=null),this.#i?.classList.remove("show")},{signal:d})}o.innerText=this.#t?await h4._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):this.#e,o.parentNode||t.append(o),this.#n.getImageForAltText()?.setAttribute("aria-describedby",o.id)}}class or{#e=null;#t=null;#o=null;#i=!1;#s=!1;#r=null;#n=null;#l=this.focusin.bind(this);#c=this.focusout.bind(this);#p=null;#h="";#d=!1;#a=null;#m=!1;#f=!1;#u=!1;#y=null;#g=0;#w=0;#v=null;_initialOptions=Object.create(null);_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#A=!1;#k=or._zIndex++;static _borderLineWidth=-1;static _colorManager=new pK;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=or.prototype._resizeWithKeyboard,o=Mm.TRANSLATE_SMALL,i=Mm.TRANSLATE_BIG;return si(this,"_resizerKeyboardManager",new Lb([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-o,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[o,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-o]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,o]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],or.prototype._stopResizingWithKeyboard]]))}constructor(t){this.constructor===or&&zi("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:o,rawDims:{pageWidth:i,pageHeight:a,pageX:l,pageY:d}}=this.parent.viewport;this.rotation=o,this.pageRotation=(360+o-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,a],this.pageTranslation=[l,d];const[c,p]=this.parentDimensions;this.x=t.x/c,this.y=t.y/p,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return si(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const o=new Sjt({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});o.annotationElementId=t.annotationElementId,o.deleted=!0,o._uiManager.addToAnnotationStorage(o)}static initialize(t,o,i){if(or._l10nPromise||=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(l=>[l,t.get(l.replaceAll(/([A-Z])/g,d=>`-${d.toLowerCase()}`))])),i?.strings)for(const l of i.strings)or._l10nPromise.set(l,t.get(l));if(or._borderLineWidth!==-1)return;const a=getComputedStyle(document.documentElement);or._borderLineWidth=parseFloat(a.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,o){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,o){zi("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#A}set _isDraggable(t){this.#A=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,o]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*o/(t*2),this.y+=this.width*t/(o*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*o/(t*2),this.y-=this.width*t/(o*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#k}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#D(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#d?this.#d=!1:this.parent.setSelected(this))}focusout(t){!this._focusEventsAllowed||!this.isAttachedToDOM||t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,o,i,a){const[l,d]=this.parentDimensions;[i,a]=this.screenToPageTranslation(i,a),this.x=(t+i)/l,this.y=(o+a)/d,this.fixAndSetPosition()}#S([t,o],i,a){[i,a]=this.screenToPageTranslation(i,a),this.x+=i/t,this.y+=a/o,this.fixAndSetPosition()}translate(t,o){this.#S(this.parentDimensions,t,o)}translateInPage(t,o){this.#a||=[this.x,this.y],this.#S(this.pageDimensions,t,o),this.div.scrollIntoView({block:"nearest"})}drag(t,o){this.#a||=[this.x,this.y];const[i,a]=this.parentDimensions;if(this.x+=t/i,this.y+=o/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:h}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,h)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:l,y:d}=this;const[c,p]=this.getBaseTranslation();l+=c,d+=p,this.div.style.left=`${(100*l).toFixed(2)}%`,this.div.style.top=`${(100*d).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#a&&(this.#a[0]!==this.x||this.#a[1]!==this.y)}getBaseTranslation(){const[t,o]=this.parentDimensions,{_borderLineWidth:i}=or,a=i/t,l=i/o;switch(this.rotation){case 90:return[-a,l];case 180:return[a,l];case 270:return[a,-l];default:return[-a,-l]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const[o,i]=this.pageDimensions;let{x:a,y:l,width:d,height:c}=this;if(d*=o,c*=i,a*=o,l*=i,this._mustFixPosition)switch(t){case 0:a=Math.max(0,Math.min(o-d,a)),l=Math.max(0,Math.min(i-c,l));break;case 90:a=Math.max(0,Math.min(o-c,a)),l=Math.min(i,Math.max(d,l));break;case 180:a=Math.min(o,Math.max(d,a)),l=Math.min(i,Math.max(c,l));break;case 270:a=Math.min(o,Math.max(c,a)),l=Math.max(0,Math.min(i-d,l));break}this.x=a/=o,this.y=l/=i;const[p,u]=this.getBaseTranslation();a+=p,l+=u;const{style:h}=this.div;h.left=`${(100*a).toFixed(2)}%`,h.top=`${(100*l).toFixed(2)}%`,this.moveInDOM()}static#I(t,o,i){switch(i){case 90:return[o,-t];case 180:return[-t,-o];case 270:return[-o,t];default:return[t,o]}}screenToPageTranslation(t,o){return or.#I(t,o,this.parentRotation)}pageTranslationToScreen(t,o){return or.#I(t,o,360-this.parentRotation)}#$(t){switch(t){case 90:{const[o,i]=this.pageDimensions;return[0,-o/i,i/o,0]}case 180:return[-1,0,0,-1];case 270:{const[o,i]=this.pageDimensions;return[0,o/i,-i/o,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[o,i]}=this,a=o*t,l=i*t;return sd.isCSSRoundSupported?[Math.round(a),Math.round(l)]:[a,l]}setDims(t,o){const[i,a]=this.parentDimensions;this.div.style.width=`${(100*t/i).toFixed(2)}%`,this.#s||(this.div.style.height=`${(100*o/a).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:o,width:i}=t,a=i.endsWith("%"),l=!this.#s&&o.endsWith("%");if(a&&l)return;const[d,c]=this.parentDimensions;a||(t.width=`${(100*parseFloat(i)/d).toFixed(2)}%`),!this.#s&&!l&&(t.height=`${(100*parseFloat(o)/c).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#b(){if(this.#r)return;this.#r=document.createElement("div"),this.#r.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],o=this._uiManager._signal;for(const i of t){const a=document.createElement("div");this.#r.append(a),a.classList.add("resizer",i),a.setAttribute("data-resizer-name",i),a.addEventListener("pointerdown",this.#x.bind(this,i),{signal:o}),a.addEventListener("contextmenu",hd,{signal:o}),a.tabIndex=-1}this.div.prepend(this.#r)}#x(t,o){o.preventDefault();const{isMac:i}=sd.platform;if(o.button!==0||o.ctrlKey&&i)return;this.#o?.toggle(!1);const a=this.#E.bind(this,t),l=this._isDraggable;this._isDraggable=!1;const d=this._uiManager._signal,c={passive:!0,capture:!0,signal:d};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",a,c),window.addEventListener("contextmenu",hd,{signal:d});const p=this.x,u=this.y,h=this.width,m=this.height,f=this.parent.div.style.cursor,x=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(o.target).cursor;const y=()=>{this.parent.togglePointerEvents(!0),this.#o?.toggle(!0),this._isDraggable=l,window.removeEventListener("pointerup",y),window.removeEventListener("blur",y),window.removeEventListener("pointermove",a,c),window.removeEventListener("contextmenu",hd),this.parent.div.style.cursor=f,this.div.style.cursor=x,this.#C(p,u,h,m)};window.addEventListener("pointerup",y,{signal:d}),window.addEventListener("blur",y,{signal:d})}#C(t,o,i,a){const l=this.x,d=this.y,c=this.width,p=this.height;l===t&&d===o&&c===i&&p===a||this.addCommands({cmd:()=>{this.width=c,this.height=p,this.x=l,this.y=d;const[u,h]=this.parentDimensions;this.setDims(u*c,h*p),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=a,this.x=t,this.y=o;const[u,h]=this.parentDimensions;this.setDims(u*i,h*a),this.fixAndSetPosition()},mustExec:!0})}#E(t,o){const[i,a]=this.parentDimensions,l=this.x,d=this.y,c=this.width,p=this.height,u=or.MIN_SIZE/i,h=or.MIN_SIZE/a,m=_=>Math.round(_*1e4)/1e4,f=this.#$(this.rotation),x=(_,N)=>[f[0]*_+f[2]*N,f[1]*_+f[3]*N],y=this.#$(360-this.rotation),w=(_,N)=>[y[0]*_+y[2]*N,y[1]*_+y[3]*N];let b,v,A=!1,S=!1;switch(t){case"topLeft":A=!0,b=(_,N)=>[0,0],v=(_,N)=>[_,N];break;case"topMiddle":b=(_,N)=>[_/2,0],v=(_,N)=>[_/2,N];break;case"topRight":A=!0,b=(_,N)=>[_,0],v=(_,N)=>[0,N];break;case"middleRight":S=!0,b=(_,N)=>[_,N/2],v=(_,N)=>[0,N/2];break;case"bottomRight":A=!0,b=(_,N)=>[_,N],v=(_,N)=>[0,0];break;case"bottomMiddle":b=(_,N)=>[_/2,N],v=(_,N)=>[_/2,0];break;case"bottomLeft":A=!0,b=(_,N)=>[0,N],v=(_,N)=>[_,0];break;case"middleLeft":S=!0,b=(_,N)=>[0,N/2],v=(_,N)=>[_,N/2];break}const E=b(c,p),I=v(c,p);let L=x(...I);const B=m(l+L[0]),P=m(d+L[1]);let D=1,T=1,[O,F]=this.screenToPageTranslation(o.movementX,o.movementY);if([O,F]=w(O/i,F/a),A){const _=Math.hypot(c,p);D=T=Math.max(Math.min(Math.hypot(I[0]-E[0]-O,I[1]-E[1]-F)/_,1/c,1/p),u/c,h/p)}else S?D=Math.max(u,Math.min(1,Math.abs(I[0]-E[0]-O)))/c:T=Math.max(h,Math.min(1,Math.abs(I[1]-E[1]-F)))/p;const Y=m(c*D),Z=m(p*T);L=x(...v(Y,Z));const R=B-L[0],U=P-L[1];this.width=Y,this.height=Z,this.x=R,this.y=U,this.setDims(i*Y,a*Z),this.fixAndSetPosition()}altTextFinish(){this.#o?.finish()}async addEditToolbar(){return this.#p||this.#f?this.#p:(this.#p=new dK(this),this.div.append(this.#p.render()),this.#o&&this.#p.addAltTextButton(await this.#o.render()),this.#p)}removeEditToolbar(){this.#p&&(this.#p.remove(),this.#p=null,this.#o?.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#o||(h4.initialize(or._l10nPromise),this.#o=new h4(this),this.#e&&(this.#o.data=this.#e,this.#e=null),await this.addEditToolbar())}get altTextData(){return this.#o?.data}set altTextData(t){this.#o&&(this.#o.data=t)}hasAltText(){return!this.#o?.isEmpty()}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#i?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",this.#l,{signal:t}),this.div.addEventListener("focusout",this.#c,{signal:t});const[o,i]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*i/o).toFixed(2)}%`,this.div.style.maxHeight=`${(100*o/i).toFixed(2)}%`);const[a,l]=this.getInitialTranslation();return this.translate(a,l),bS(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:o}=sd.platform;if(t.button!==0||t.ctrlKey&&o){t.preventDefault();return}if(this.#d=!0,this._isDraggable){this.#B(t);return}this.#L(t)}#L(t){const{isMac:o}=sd.platform;t.ctrlKey&&!o||t.shiftKey||t.metaKey&&o?this.parent.toggleSelected(this):this.parent.setSelected(this)}#B(t){const o=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let i,a;const l=this._uiManager._signal;o&&(this.div.classList.add("moving"),i={passive:!0,capture:!0,signal:l},this.#g=t.clientX,this.#w=t.clientY,a=c=>{const{clientX:p,clientY:u}=c,[h,m]=this.screenToPageTranslation(p-this.#g,u-this.#w);this.#g=p,this.#w=u,this._uiManager.dragSelectedEditors(h,m)},window.addEventListener("pointermove",a,i));const d=()=>{window.removeEventListener("pointerup",d),window.removeEventListener("blur",d),o&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",a,i)),this.#d=!1,this._uiManager.endDragSession()||this.#L(t)};window.addEventListener("pointerup",d,{signal:l}),window.addEventListener("blur",d,{signal:l})}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,o,i){t.changeParent(this),this.x=o,this.y=i,this.fixAndSetPosition()}getRect(t,o,i=this.rotation){const a=this.parentScale,[l,d]=this.pageDimensions,[c,p]=this.pageTranslation,u=t/a,h=o/a,m=this.x*l,f=this.y*d,x=this.width*l,y=this.height*d;switch(i){case 0:return[m+u+c,d-f-h-y+p,m+u+x+c,d-f-h+p];case 90:return[m+h+c,d-f+u+p,m+h+y+c,d-f+u+x+p];case 180:return[m-u-x+c,d-f+h+p,m-u+c,d-f+h+y+p];case 270:return[m-h-y+c,d-f-u-x+p,m-h+c,d-f-u+p];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,o){const[i,a,l,d]=t,c=l-i,p=d-a;switch(this.rotation){case 0:return[i,o-d,c,p];case 90:return[i,o-a,p,c];case 180:return[l,o-a,c,p];case 270:return[l,o-d,p,c];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#f=!0}disableEditMode(){this.#f=!1}isInEditMode(){return this.#f}shouldGetKeyboardEvents(){return this.#u}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){const t=this._uiManager._signal;this.div?.addEventListener("focusin",this.#l,{signal:t}),this.div?.addEventListener("focusout",this.#c,{signal:t})}rotate(t){}serialize(t=!1,o=null){zi("An editor must be serializable")}static deserialize(t,o,i){const a=new this.prototype.constructor({parent:o,id:o.getNextId(),uiManager:i});a.rotation=t.rotation,a.#e=t.accessibilityData;const[l,d]=a.pageDimensions,[c,p,u,h]=a.getRectInCurrentCoords(t.rect,d);return a.x=c/l,a.y=p/d,a.width=u/l,a.height=h/d,a}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",this.#l),this.div.removeEventListener("focusout",this.#c),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#y&&(clearTimeout(this.#y),this.#y=null),this.#D(),this.removeEditToolbar(),this.#v){for(const t of this.#v.values())clearTimeout(t);this.#v=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#b(),this.#r.classList.remove("hidden"),bS(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),this.#n={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const o=this.#r.children;if(!this.#t){this.#t=Array.from(o);const d=this.#M.bind(this),c=this.#T.bind(this),p=this._uiManager._signal;for(const u of this.#t){const h=u.getAttribute("data-resizer-name");u.setAttribute("role","spinbutton"),u.addEventListener("keydown",d,{signal:p}),u.addEventListener("blur",c,{signal:p}),u.addEventListener("focus",this.#P.bind(this,h),{signal:p}),or._l10nPromise.get(`pdfjs-editor-resizer-label-${h}`).then(m=>u.setAttribute("aria-label",m))}}const i=this.#t[0];let a=0;for(const d of o){if(d===i)break;a++}const l=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(l!==a){if(l<a)for(let c=0;c<a-l;c++)this.#r.append(this.#r.firstChild);else if(l>a)for(let c=0;c<l-a;c++)this.#r.firstChild.before(this.#r.lastChild);let d=0;for(const c of o){const u=this.#t[d++].getAttribute("data-resizer-name");or._l10nPromise.get(`pdfjs-editor-resizer-label-${u}`).then(h=>c.setAttribute("aria-label",h))}}this.#z(0),this.#u=!0,this.#r.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#M(t){or._resizerKeyboardManager.exec(this,t)}#T(t){this.#u&&t.relatedTarget?.parentNode!==this.#r&&this.#D()}#P(t){this.#h=this.#u?t:""}#z(t){if(this.#t)for(const o of this.#t)o.tabIndex=t}_resizeWithKeyboard(t,o){this.#u&&this.#E(this.#h,{movementX:t,movementY:o})}#D(){if(this.#u=!1,this.#z(-1),this.#n){const{savedX:t,savedY:o,savedWidth:i,savedHeight:a}=this.#n;this.#C(t,o,i,a),this.#n=null}}_stopResizingWithKeyboard(){this.#D(),this.div.focus()}select(){if(this.makeResizable(),this.div?.classList.add("selectedEditor"),!this.#p){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this.#p?.show()});return}this.#p?.show()}unselect(){this.#r?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this.#p?.hide()}updateParams(t,o){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#m}set isEditing(t){this.#m=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,o){this.#s=!0;const i=t/o,{style:a}=this.div;a.aspectRatio=i,a.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,o=!1){if(o){this.#v||=new Map;const{action:i}=t;let a=this.#v.get(i);a&&clearTimeout(a),a=setTimeout(()=>{this._reportTelemetry(t),this.#v.delete(i),this.#v.size===0&&(this.#v=null)},or._telemetryTimeout),this.#v.set(i,a);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#i=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#i=!0}renderAnnotationElement(t){let o=t.container.querySelector(".annotationContent");if(!o)o=document.createElement("div"),o.classList.add("annotationContent",this.editorType),t.container.prepend(o);else if(o.nodeName==="CANVAS"){const i=o;o=document.createElement("div"),o.classList.add("annotationContent",this.editorType),i.before(o)}return o}resetAnnotationElement(t){const{firstChild:o}=t.container;o.nodeName==="DIV"&&o.classList.contains("annotationContent")&&o.remove()}}class Sjt extends or{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const Rpe=3285377520,fc=4294901760,cu=65535;class SLe{constructor(t){this.h1=t?t&4294967295:Rpe,this.h2=t?t&4294967295:Rpe}update(t){let o,i;if(typeof t=="string"){o=new Uint8Array(t.length*2),i=0;for(let w=0,b=t.length;w<b;w++){const v=t.charCodeAt(w);v<=255?o[i++]=v:(o[i++]=v>>>8,o[i++]=v&255)}}else if(ArrayBuffer.isView(t))o=t.slice(),i=o.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const a=i>>2,l=i-a*4,d=new Uint32Array(o.buffer,0,a);let c=0,p=0,u=this.h1,h=this.h2;const m=3432918353,f=461845907,x=m&cu,y=f&cu;for(let w=0;w<a;w++)w&1?(c=d[w],c=c*m&fc|c*x&cu,c=c<<15|c>>>17,c=c*f&fc|c*y&cu,u^=c,u=u<<13|u>>>19,u=u*5+3864292196):(p=d[w],p=p*m&fc|p*x&cu,p=p<<15|p>>>17,p=p*f&fc|p*y&cu,h^=p,h=h<<13|h>>>19,h=h*5+3864292196);switch(c=0,l){case 3:c^=o[a*4+2]<<16;case 2:c^=o[a*4+1]<<8;case 1:c^=o[a*4],c=c*m&fc|c*x&cu,c=c<<15|c>>>17,c=c*f&fc|c*y&cu,a&1?u^=c:h^=c}this.h1=u,this.h2=h}hexdigest(){let t=this.h1,o=this.h2;return t^=o>>>1,t=t*3981806797&fc|t*36045&cu,o=o*4283543511&fc|((o<<16|t>>>16)*2950163797&fc)>>>16,t^=o>>>1,t=t*444984403&fc|t*60499&cu,o=o*3301882366&fc|((o<<16|t>>>16)*3120437893&fc)>>>16,t^=o>>>1,(t>>>0).toString(16).padStart(8,"0")+(o>>>0).toString(16).padStart(8,"0")}}const kQ=Object.freeze({map:null,hash:"",transfer:void 0});class uK{#e=!1;#t=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,o){const i=this.#t.get(t);return i===void 0?o:Object.assign(o,i)}getRawValue(t){return this.#t.get(t)}remove(t){if(this.#t.delete(t),this.#t.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const o of this.#t.values())if(o instanceof or)return;this.onAnnotationEditor(null)}}setValue(t,o){const i=this.#t.get(t);let a=!1;if(i!==void 0)for(const[l,d]of Object.entries(o))i[l]!==d&&(a=!0,i[l]=d);else a=!0,this.#t.set(t,o);a&&this.#o(),o instanceof or&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(o.constructor._type)}has(t){return this.#t.has(t)}getAll(){return this.#t.size>0?oK(this.#t):null}setAll(t){for(const[o,i]of Object.entries(t))this.setValue(o,i)}get size(){return this.#t.size}#o(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new ELe(this)}get serializable(){if(this.#t.size===0)return kQ;const t=new Map,o=new SLe,i=[],a=Object.create(null);let l=!1;for(const[d,c]of this.#t){const p=c instanceof or?c.serialize(!1,a):c;p&&(t.set(d,p),o.update(`${d}:${JSON.stringify(p)}`),l||=!!p.bitmap)}if(l)for(const d of t.values())d.bitmap&&i.push(d.bitmap);return t.size>0?{map:t,hash:o.hexdigest(),transfer:i}:kQ}get editorStats(){let t=null;const o=new Map;for(const i of this.#t.values()){if(!(i instanceof or))continue;const a=i.telemetryFinalData;if(!a)continue;const{type:l}=a;o.has(l)||o.set(l,Object.getPrototypeOf(i).constructor),t||=Object.create(null);const d=t[l]||=new Map;for(const[c,p]of Object.entries(a)){if(c==="type")continue;let u=d.get(c);u||(u=new Map,d.set(c,u));const h=u.get(p)??0;u.set(p,h+1)}}for(const[i,a]of o)t[i]=a.computeTelemetryFinalData(t[i]);return t}}class ELe extends uK{#e;constructor(t){super();const{map:o,hash:i,transfer:a}=t.serializable,l=structuredClone(o,a?{transfer:a}:null);this.#e={map:l,hash:i,transfer:a}}get print(){zi("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}}class Ejt{#e=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:o=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const o=this.styleElement.sheet;o.insertRule(t,o.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,_inspectFont:o}){if(!(!t||this.#e.has(t.loadedName))){if(Ba(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:a,style:l}=t,d=new FontFace(i,a,l);this.addNativeFontFace(d);try{await d.load(),this.#e.add(i),o?.(t)}catch{Br(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(d)}return}zi("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const i=t.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(a){throw Br(`Failed to load font '${i.family}': '${a}'.`),t.disableFontFace=!0,a}}return}const o=t.createFontFaceRule();if(o){if(this.insertRule(o),this.isSyncFontLoadingSupported)return;await new Promise(i=>{const a=this._queueLoadingCallback(i);this._prepareFontLoadEvent(t,a)})}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return si(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(Zs||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),si(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){function o(){for(Ba(!a.done,"completeRequest() cannot be called twice."),a.done=!0;i.length>0&&i[0].done;){const l=i.shift();setTimeout(l.callback,0)}}const{loadingRequests:i}=this,a={done:!1,complete:o,callback:t};return i.push(a),a}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return si(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,o){function i(E,I){return E.charCodeAt(I)<<24|E.charCodeAt(I+1)<<16|E.charCodeAt(I+2)<<8|E.charCodeAt(I+3)&255}function a(E,I,L,B){const P=E.substring(0,I),D=E.substring(I+L);return P+B+D}let l,d;const c=this._document.createElement("canvas");c.width=1,c.height=1;const p=c.getContext("2d");let u=0;function h(E,I){if(++u>30){Br("Load test font never loaded."),I();return}if(p.font="30px "+E,p.fillText(".",0,20),p.getImageData(0,0,1,1).data[3]>0){I();return}setTimeout(h.bind(null,E,I))}const m=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=a(f,976,m.length,m);const y=16,w=1482184792;let b=i(f,y);for(l=0,d=m.length-3;l<d;l+=4)b=b-w+i(m,l)|0;l<m.length&&(b=b-w+i(m+"XXX",l)|0),f=a(f,y,4,cjt(b));const v=`url(data:font/opentype;base64,${btoa(f)});`,A=`@font-face {font-family:"${m}";src:${v}}`;this.insertRule(A);const S=this._document.createElement("div");S.style.visibility="hidden",S.style.width=S.style.height="10px",S.style.position="absolute",S.style.top=S.style.left="0px";for(const E of[t.loadedName,m]){const I=this._document.createElement("span");I.textContent="Hi",I.style.fontFamily=E,S.append(I)}this._document.body.append(S),h(m,()=>{S.remove(),o.complete()})}}class Ljt{constructor(t,{disableFontFace:o=!1,inspectFont:i=null}){this.compiledGlyphs=Object.create(null);for(const a in t)this[a]=t[a];this.disableFontFace=o===!0,this._inspectFont=i}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const o={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(o.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,o)}return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=bLe(this.data),o=`url(data:${this.mimetype};base64,${btoa(t)});`;let i;if(!this.cssFontInfo)i=`@font-face {font-family:"${this.loadedName}";src:${o}}`;else{let a=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(a+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${a}src:${o}}`}return this._inspectFont?.(this,o),i}getPathGenerator(t,o){if(this.compiledGlyphs[o]!==void 0)return this.compiledGlyphs[o];let i;try{i=t.get(this.loadedName+"_path_"+o)}catch(l){Br(`getPathGenerator - ignoring character: "${l}".`)}if(!Array.isArray(i)||i.length===0)return this.compiledGlyphs[o]=function(l,d){};const a=[];for(let l=0,d=i.length;l<d;)switch(i[l++]){case Nh.BEZIER_CURVE_TO:{const[c,p,u,h,m,f]=i.slice(l,l+6);a.push(x=>x.bezierCurveTo(c,p,u,h,m,f)),l+=6}break;case Nh.MOVE_TO:{const[c,p]=i.slice(l,l+2);a.push(u=>u.moveTo(c,p)),l+=2}break;case Nh.LINE_TO:{const[c,p]=i.slice(l,l+2);a.push(u=>u.lineTo(c,p)),l+=2}break;case Nh.QUADRATIC_CURVE_TO:{const[c,p,u,h]=i.slice(l,l+4);a.push(m=>m.quadraticCurveTo(c,p,u,h)),l+=4}break;case Nh.RESTORE:a.push(c=>c.restore());break;case Nh.SAVE:a.push(c=>c.save());break;case Nh.SCALE:Ba(a.length===2,"Scale command is only valid at the third position.");break;case Nh.TRANSFORM:{const[c,p,u,h,m,f]=i.slice(l,l+6);a.push(x=>x.transform(c,p,u,h,m,f)),l+=6}break;case Nh.TRANSLATE:{const[c,p]=i.slice(l,l+2);a.push(u=>u.translate(c,p)),l+=2}break}return this.compiledGlyphs[o]=function(d,c){a[0](d),a[1](d),d.scale(c,-c);for(let p=2,u=a.length;p<u;p++)a[p](d)}}}if(Zs){var SQ=Promise.withResolvers(),EQ=null;(async()=>{const t=await n4(()=>import("./empty-uJGOQ04i.js").then(c=>c.e),__vite__mapDeps([0,1,2])),o=await n4(()=>import("./index-DmMlrXZ7.js").then(c=>c.i),__vite__mapDeps([3,1,4,5,6,7,8,9])),i=await n4(()=>import("./index-8MC4NEb9.js").then(c=>c.i),__vite__mapDeps([10,1,11,4,5,6,7,8,9])),a=await n4(()=>import("./url-BTTCUmrI.js").then(c=>c.u),__vite__mapDeps([12,1,9,7,5,6,8]));let l,d;return new Map(Object.entries({fs:t,http:o,https:i,url:a,canvas:l,path2d:d}))})().then(t=>{EQ=t,SQ.resolve()},t=>{Br(`loadPackages: ${t}`),EQ=new Map,SQ.resolve()})}class sh{static get promise(){return SQ.promise}static get(t){return EQ?.get(t)}}const LLe=function(e){return sh.get("fs").promises.readFile(e).then(o=>new Uint8Array(o))};class jjt extends hj{}class Ijt extends mj{_createCanvas(t,o){return sh.get("canvas").createCanvas(t,o)}}class Mjt extends gj{_fetchData(t,o){return LLe(t).then(i=>({cMapData:i,compressionType:o}))}}class Bjt extends fj{_fetchData(t){return LLe(t)}}const Cl={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function LQ(e,t){if(!t)return;const o=t[2]-t[0],i=t[3]-t[1],a=new Path2D;a.rect(t[0],t[1],o,i),e.clip(a)}class jb{constructor(){this.constructor===jb&&zi("Cannot initialize BaseShadingPattern.")}getPattern(){zi("Abstract method `getPattern` called.")}}class Pjt extends jb{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let o;this._type==="axial"?o=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(o=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)o.addColorStop(i[0],i[1]);return o}getPattern(t,o,i,a){let l;if(a===Cl.STROKE||a===Cl.FILL){const d=o.current.getClippedPathBoundingBox(a,An(t))||[0,0,0,0],c=Math.ceil(d[2]-d[0])||1,p=Math.ceil(d[3]-d[1])||1,u=o.cachedCanvases.getCanvas("pattern",c,p,!0),h=u.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-d[0],-d[1]),i=So.transform(i,[1,0,0,1,d[0],d[1]]),h.transform(...o.baseTransform),this.matrix&&h.transform(...this.matrix),LQ(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),l=t.createPattern(u.canvas,"no-repeat");const m=new DOMMatrix(i);l.setTransform(m)}else LQ(t,this._bbox),l=this._createGradient(t);return l}}function IO(e,t,o,i,a,l,d,c){const p=t.coords,u=t.colors,h=e.data,m=e.width*4;let f;p[o+1]>p[i+1]&&(f=o,o=i,i=f,f=l,l=d,d=f),p[i+1]>p[a+1]&&(f=i,i=a,a=f,f=d,d=c,c=f),p[o+1]>p[i+1]&&(f=o,o=i,i=f,f=l,l=d,d=f);const x=(p[o]+t.offsetX)*t.scaleX,y=(p[o+1]+t.offsetY)*t.scaleY,w=(p[i]+t.offsetX)*t.scaleX,b=(p[i+1]+t.offsetY)*t.scaleY,v=(p[a]+t.offsetX)*t.scaleX,A=(p[a+1]+t.offsetY)*t.scaleY;if(y>=A)return;const S=u[l],E=u[l+1],I=u[l+2],L=u[d],B=u[d+1],P=u[d+2],D=u[c],T=u[c+1],O=u[c+2],F=Math.round(y),Y=Math.round(A);let Z,R,U,_,N,z,H,ee;for(let K=F;K<=Y;K++){if(K<b){const xe=K<y?0:(y-K)/(y-b);Z=x-(x-w)*xe,R=S-(S-L)*xe,U=E-(E-B)*xe,_=I-(I-P)*xe}else{let xe;K>A?xe=1:b===A?xe=0:xe=(b-K)/(b-A),Z=w-(w-v)*xe,R=L-(L-D)*xe,U=B-(B-T)*xe,_=P-(P-O)*xe}let G;K<y?G=0:K>A?G=1:G=(y-K)/(y-A),N=x-(x-v)*G,z=S-(S-D)*G,H=E-(E-T)*G,ee=I-(I-O)*G;const J=Math.round(Math.min(Z,N)),X=Math.round(Math.max(Z,N));let le=m*K+J*4;for(let xe=J;xe<=X;xe++)G=(Z-xe)/(Z-N),G<0?G=0:G>1&&(G=1),h[le++]=R-(R-z)*G|0,h[le++]=U-(U-H)*G|0,h[le++]=_-(_-ee)*G|0,h[le++]=255}}function Djt(e,t,o){const i=t.coords,a=t.colors;let l,d;switch(t.type){case"lattice":const c=t.verticesPerRow,p=Math.floor(i.length/c)-1,u=c-1;for(l=0;l<p;l++){let h=l*c;for(let m=0;m<u;m++,h++)IO(e,o,i[h],i[h+1],i[h+c],a[h],a[h+1],a[h+c]),IO(e,o,i[h+c+1],i[h+1],i[h+c],a[h+c+1],a[h+1],a[h+c])}break;case"triangles":for(l=0,d=i.length;l<d;l+=3)IO(e,o,i[l],i[l+1],i[l+2],a[l],a[l+1],a[l+2]);break;default:throw new Error("illegal figure")}}class Tjt extends jb{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,o,i){const c=Math.floor(this._bounds[0]),p=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-c,h=Math.ceil(this._bounds[3])-p,m=Math.min(Math.ceil(Math.abs(u*t[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(h*t[1]*1.1)),3e3),x=u/m,y=h/f,w={coords:this._coords,colors:this._colors,offsetX:-c,offsetY:-p,scaleX:1/x,scaleY:1/y},b=m+4,v=f+4,A=i.getCanvas("mesh",b,v,!1),S=A.context,E=S.createImageData(m,f);if(o){const L=E.data;for(let B=0,P=L.length;B<P;B+=4)L[B]=o[0],L[B+1]=o[1],L[B+2]=o[2],L[B+3]=255}for(const L of this._figures)Djt(E,L,w);return S.putImageData(E,2,2),{canvas:A.canvas,offsetX:c-2*x,offsetY:p-2*y,scaleX:x,scaleY:y}}getPattern(t,o,i,a){LQ(t,this._bbox);let l;if(a===Cl.SHADING)l=So.singularValueDecompose2dScale(An(t));else if(l=So.singularValueDecompose2dScale(o.baseTransform),this.matrix){const c=So.singularValueDecompose2dScale(this.matrix);l=[l[0]*c[0],l[1]*c[1]]}const d=this._createMeshCanvas(l,a===Cl.SHADING?null:this._background,o.cachedCanvases);return a!==Cl.SHADING&&(t.setTransform(...o.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(d.offsetX,d.offsetY),t.scale(d.scaleX,d.scaleY),t.createPattern(d.canvas,"no-repeat")}}class zjt extends jb{getPattern(){return"hotpink"}}function Rjt(e){switch(e[0]){case"RadialAxial":return new Pjt(e);case"Mesh":return new Tjt(e);case"Dummy":return new zjt}throw new Error(`Unknown IR type: ${e[0]}`)}const Fpe={COLORED:1,UNCOLORED:2};class hK{static MAX_PATTERN_SIZE=3e3;constructor(t,o,i,a,l){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=o,this.ctx=i,this.canvasGraphicsFactory=a,this.baseTransform=l}createPatternCanvas(t){const o=this.operatorList,i=this.bbox,a=this.xstep,l=this.ystep,d=this.paintType,c=this.tilingType,p=this.color,u=this.canvasGraphicsFactory;cj("TilingType: "+c);const h=i[0],m=i[1],f=i[2],x=i[3],y=So.singularValueDecompose2dScale(this.matrix),w=So.singularValueDecompose2dScale(this.baseTransform),b=[y[0]*w[0],y[1]*w[1]],v=this.getSizeAndScale(a,this.ctx.canvas.width,b[0]),A=this.getSizeAndScale(l,this.ctx.canvas.height,b[1]),S=t.cachedCanvases.getCanvas("pattern",v.size,A.size,!0),E=S.context,I=u.createCanvasGraphics(E);I.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(I,d,p);let L=h,B=m,P=f,D=x;return h<0&&(L=0,P+=Math.abs(h)),m<0&&(B=0,D+=Math.abs(m)),E.translate(-(v.scale*L),-(A.scale*B)),I.transform(v.scale,0,0,A.scale,0,0),E.save(),this.clipBbox(I,L,B,P,D),I.baseTransform=An(I.ctx),I.executeOperatorList(o),I.endDrawing(),{canvas:S.canvas,scaleX:v.scale,scaleY:A.scale,offsetX:L,offsetY:B}}getSizeAndScale(t,o,i){t=Math.abs(t);const a=Math.max(hK.MAX_PATTERN_SIZE,o);let l=Math.ceil(t*i);return l>=a?l=a:i=l/t,{scale:i,size:l}}clipBbox(t,o,i,a,l){const d=a-o,c=l-i;t.ctx.rect(o,i,d,c),t.current.updateRectMinMax(An(t.ctx),[o,i,a,l]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,o,i){const a=t.ctx,l=t.current;switch(o){case Fpe.COLORED:const d=this.ctx;a.fillStyle=d.fillStyle,a.strokeStyle=d.strokeStyle,l.fillColor=d.fillStyle,l.strokeColor=d.strokeStyle;break;case Fpe.UNCOLORED:const c=So.makeHexColor(i[0],i[1],i[2]);a.fillStyle=c,a.strokeStyle=c,l.fillColor=c,l.strokeColor=c;break;default:throw new djt(`Unsupported paint type: ${o}`)}}getPattern(t,o,i,a){let l=i;a!==Cl.SHADING&&(l=So.transform(l,o.baseTransform),this.matrix&&(l=So.transform(l,this.matrix)));const d=this.createPatternCanvas(o);let c=new DOMMatrix(l);c=c.translate(d.offsetX,d.offsetY),c=c.scale(1/d.scaleX,1/d.scaleY);const p=t.createPattern(d.canvas,"repeat");return p.setTransform(c),p}}function Fjt({src:e,srcPos:t=0,dest:o,width:i,height:a,nonBlackColor:l=4294967295,inverseDecode:d=!1}){const c=sd.isLittleEndian?4278190080:255,[p,u]=d?[l,c]:[c,l],h=i>>3,m=i&7,f=e.length;o=new Uint32Array(o.buffer);let x=0;for(let y=0;y<a;y++){for(const b=t+h;t<b;t++){const v=t<f?e[t]:255;o[x++]=v&128?u:p,o[x++]=v&64?u:p,o[x++]=v&32?u:p,o[x++]=v&16?u:p,o[x++]=v&8?u:p,o[x++]=v&4?u:p,o[x++]=v&2?u:p,o[x++]=v&1?u:p}if(m===0)continue;const w=t<f?e[t++]:255;for(let b=0;b<m;b++)o[x++]=w&1<<7-b?u:p}return{srcPos:t,destPos:x}}const Ope=16,Npe=100,Ojt=15,Hpe=10,_pe=1e3,Xl=16;function Njt(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(i,a){t.translate(i,a),this.__originalTranslate(i,a)},e.scale=function(i,a){t.scale(i,a),this.__originalScale(i,a)},e.transform=function(i,a,l,d,c,p){t.transform(i,a,l,d,c,p),this.__originalTransform(i,a,l,d,c,p)},e.setTransform=function(i,a,l,d,c,p){t.setTransform(i,a,l,d,c,p),this.__originalSetTransform(i,a,l,d,c,p)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(i){t.rotate(i),this.__originalRotate(i)},e.clip=function(i){t.clip(i),this.__originalClip(i)},e.moveTo=function(o,i){t.moveTo(o,i),this.__originalMoveTo(o,i)},e.lineTo=function(o,i){t.lineTo(o,i),this.__originalLineTo(o,i)},e.bezierCurveTo=function(o,i,a,l,d,c){t.bezierCurveTo(o,i,a,l,d,c),this.__originalBezierCurveTo(o,i,a,l,d,c)},e.rect=function(o,i,a,l){t.rect(o,i,a,l),this.__originalRect(o,i,a,l)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class Hjt{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,o,i){let a;return this.cache[t]!==void 0?(a=this.cache[t],this.canvasFactory.reset(a,o,i)):(a=this.canvasFactory.create(o,i),this.cache[t]=a),a}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const o=this.cache[t];this.canvasFactory.destroy(o),delete this.cache[t]}}}function EC(e,t,o,i,a,l,d,c,p,u){const[h,m,f,x,y,w]=An(e);if(m===0&&f===0){const A=d*h+y,S=Math.round(A),E=c*x+w,I=Math.round(E),L=(d+p)*h+y,B=Math.abs(Math.round(L)-S)||1,P=(c+u)*x+w,D=Math.abs(Math.round(P)-I)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(x),S,I),e.drawImage(t,o,i,a,l,0,0,B,D),e.setTransform(h,m,f,x,y,w),[B,D]}if(h===0&&x===0){const A=c*f+y,S=Math.round(A),E=d*m+w,I=Math.round(E),L=(c+u)*f+y,B=Math.abs(Math.round(L)-S)||1,P=(d+p)*m+w,D=Math.abs(Math.round(P)-I)||1;return e.setTransform(0,Math.sign(m),Math.sign(f),0,S,I),e.drawImage(t,o,i,a,l,0,0,D,B),e.setTransform(h,m,f,x,y,w),[D,B]}e.drawImage(t,o,i,a,l,d,c,p,u);const b=Math.hypot(h,m),v=Math.hypot(f,x);return[b*p,v*u]}function _jt(e){const{width:t,height:o}=e;if(t>_pe||o>_pe)return null;const i=1e3,a=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),l=t+1;let d=new Uint8Array(l*(o+1)),c,p,u;const h=t+7&-8;let m=new Uint8Array(h*o),f=0;for(const v of e.data){let A=128;for(;A>0;)m[f++]=v&A?0:255,A>>=1}let x=0;for(f=0,m[f]!==0&&(d[0]=1,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(d[p]=m[f]?2:1,++x),f++;for(m[f]!==0&&(d[p]=2,++x),c=1;c<o;c++){f=c*h,u=c*l,m[f-h]!==m[f]&&(d[u]=m[f]?1:8,++x);let v=(m[f]?4:0)+(m[f-h]?8:0);for(p=1;p<t;p++)v=(v>>2)+(m[f+1]?4:0)+(m[f-h+1]?8:0),a[v]&&(d[u+p]=a[v],++x),f++;if(m[f-h]!==m[f]&&(d[u+p]=m[f]?2:4,++x),x>i)return null}for(f=h*(o-1),u=c*l,m[f]!==0&&(d[u]=8,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(d[u+p]=m[f]?4:8,++x),f++;if(m[f]!==0&&(d[u+p]=4,++x),x>i)return null;const y=new Int32Array([0,l,-1,0,-l,0,0,0,1]),w=new Path2D;for(c=0;x&&c<=o;c++){let v=c*l;const A=v+t;for(;v<A&&!d[v];)v++;if(v===A)continue;w.moveTo(v%l,c);const S=v;let E=d[v];do{const I=y[E];do v+=I;while(!d[v]);const L=d[v];L!==5&&L!==10?(E=L,d[v]=0):(E=L&51*E>>4,d[v]&=E>>2|E<<2),w.lineTo(v%l,v/l|0),d[v]||--x}while(S!==v);--c}return m=null,d=null,function(v){v.save(),v.scale(1/t,-1/o),v.translate(0,-o),v.fill(w),v.beginPath(),v.restore()}}class Vpe{constructor(t,o){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=yLe,this.textMatrixScale=1,this.fontMatrix=vQ,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=Vs.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,o])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,o){this.x=t,this.y=o}updatePathMinMax(t,o,i){[o,i]=So.applyTransform([o,i],t),this.minX=Math.min(this.minX,o),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,o),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,o){const i=So.applyTransform(o,t),a=So.applyTransform(o.slice(2),t),l=So.applyTransform([o[0],o[3]],t),d=So.applyTransform([o[2],o[1]],t);this.minX=Math.min(this.minX,i[0],a[0],l[0],d[0]),this.minY=Math.min(this.minY,i[1],a[1],l[1],d[1]),this.maxX=Math.max(this.maxX,i[0],a[0],l[0],d[0]),this.maxY=Math.max(this.maxY,i[1],a[1],l[1],d[1])}updateScalingPathMinMax(t,o){So.scaleMinMax(t,o),this.minX=Math.min(this.minX,o[0]),this.minY=Math.min(this.minY,o[1]),this.maxX=Math.max(this.maxX,o[2]),this.maxY=Math.max(this.maxY,o[3])}updateCurvePathMinMax(t,o,i,a,l,d,c,p,u,h){const m=So.bezierBoundingBox(o,i,a,l,d,c,p,u,h);h||this.updateRectMinMax(t,m)}getPathBoundingBox(t=Cl.FILL,o=null){const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===Cl.STROKE){o||zi("Stroke bounding box must include transform.");const a=So.singularValueDecompose2dScale(o),l=a[0]*this.lineWidth/2,d=a[1]*this.lineWidth/2;i[0]-=l,i[1]-=d,i[2]+=l,i[3]+=d}return i}updateClipFromPath(){const t=So.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(t=Cl.FILL,o=null){return So.intersect(this.clipBox,this.getPathBoundingBox(t,o))}}function Qpe(e,t){if(typeof ImageData<"u"&&t instanceof ImageData){e.putImageData(t,0,0);return}const o=t.height,i=t.width,a=o%Xl,l=(o-a)/Xl,d=a===0?l:l+1,c=e.createImageData(i,Xl);let p=0,u;const h=t.data,m=c.data;let f,x,y,w;if(t.kind===q$.GRAYSCALE_1BPP){const b=h.byteLength,v=new Uint32Array(m.buffer,0,m.byteLength>>2),A=v.length,S=i+7>>3,E=4294967295,I=sd.isLittleEndian?4278190080:255;for(f=0;f<d;f++){for(y=f<l?Xl:a,u=0,x=0;x<y;x++){const L=b-p;let B=0;const P=L>S?i:L*8-7,D=P&-8;let T=0,O=0;for(;B<D;B+=8)O=h[p++],v[u++]=O&128?E:I,v[u++]=O&64?E:I,v[u++]=O&32?E:I,v[u++]=O&16?E:I,v[u++]=O&8?E:I,v[u++]=O&4?E:I,v[u++]=O&2?E:I,v[u++]=O&1?E:I;for(;B<P;B++)T===0&&(O=h[p++],T=128),v[u++]=O&T?E:I,T>>=1}for(;u<A;)v[u++]=0;e.putImageData(c,0,f*Xl)}}else if(t.kind===q$.RGBA_32BPP){for(x=0,w=i*Xl*4,f=0;f<l;f++)m.set(h.subarray(p,p+w)),p+=w,e.putImageData(c,0,x),x+=Xl;f<d&&(w=i*a*4,m.set(h.subarray(p,p+w)),e.putImageData(c,0,x))}else if(t.kind===q$.RGB_24BPP)for(y=Xl,w=i*y,f=0;f<d;f++){for(f>=l&&(y=a,w=i*y),u=0,x=w;x--;)m[u++]=h[p++],m[u++]=h[p++],m[u++]=h[p++],m[u++]=255;e.putImageData(c,0,f*Xl)}else throw new Error(`bad image kind: ${t.kind}`)}function Upe(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}const o=t.height,i=t.width,a=o%Xl,l=(o-a)/Xl,d=a===0?l:l+1,c=e.createImageData(i,Xl);let p=0;const u=t.data,h=c.data;for(let m=0;m<d;m++){const f=m<l?Xl:a;({srcPos:p}=Fjt({src:u,srcPos:p,dest:h,width:i,height:f,nonBlackColor:0})),e.putImageData(c,0,m*Xl)}}function W9(e,t){const o=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of o)e[i]!==void 0&&(t[i]=e[i]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function LC(e){if(e.strokeStyle=e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",e.setLineDash!==void 0&&(e.setLineDash([]),e.lineDashOffset=0),!Zs){const{filter:t}=e;t!=="none"&&t!==""&&(e.filter="none")}}function Wpe(e,t){if(t)return!0;const o=So.singularValueDecompose2dScale(e);o[0]=Math.fround(o[0]),o[1]=Math.fround(o[1]);const i=Math.fround((globalThis.devicePixelRatio||1)*k6.PDF_TO_CSS_UNITS);return o[0]<=i&&o[1]<=i}const Vjt=["butt","round","square"],Qjt=["miter","round","bevel"],Ujt={},Gpe={};class W7{constructor(t,o,i,a,l,{optionalContentConfig:d,markedContentStack:c=null},p,u){this.ctx=t,this.current=new Vpe(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=o,this.objs=i,this.canvasFactory=a,this.filterFactory=l,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=c||[],this.optionalContentConfig=d,this.cachedCanvases=new Hjt(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=p,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=u,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,o=null){return typeof t=="string"?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):o}beginDrawing({transform:t,viewport:o,transparency:i=!1,background:a=null}){const l=this.ctx.canvas.width,d=this.ctx.canvas.height,c=this.ctx.fillStyle;if(this.ctx.fillStyle=a||"#ffffff",this.ctx.fillRect(0,0,l,d),this.ctx.fillStyle=c,i){const p=this.cachedCanvases.getCanvas("transparent",l,d);this.compositeCtx=this.ctx,this.transparentCanvas=p.canvas,this.ctx=p.context,this.ctx.save(),this.ctx.transform(...An(this.compositeCtx))}this.ctx.save(),LC(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...o.transform),this.viewportScale=o.scale,this.baseTransform=An(this.ctx)}executeOperatorList(t,o,i,a){const l=t.argsArray,d=t.fnArray;let c=o||0;const p=l.length;if(p===c)return c;const u=p-c>Hpe&&typeof i=="function",h=u?Date.now()+Ojt:0;let m=0;const f=this.commonObjs,x=this.objs;let y;for(;;){if(a!==void 0&&c===a.nextBreakPoint)return a.breakIt(c,i),c;if(y=d[c],y!==j1.dependency)this[y].apply(this,l[c]);else for(const w of l[c]){const b=w.startsWith("g_")?f:x;if(!b.has(w))return b.get(w,i),c}if(c++,c===p)return c;if(u&&++m>Hpe){if(Date.now()>h)return i(),c;m=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const o of t.values())typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement&&(o.width=o.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const o=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=o}}}_scaleImage(t,o){const i=t.width,a=t.height;let l=Math.max(Math.hypot(o[0],o[1]),1),d=Math.max(Math.hypot(o[2],o[3]),1),c=i,p=a,u="prescale1",h,m;for(;l>2&&c>1||d>2&&p>1;){let f=c,x=p;l>2&&c>1&&(f=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c/2),l/=c/f),d>2&&p>1&&(x=p>=16384?Math.floor(p/2)-1||1:Math.ceil(p)/2,d/=p/x),h=this.cachedCanvases.getCanvas(u,f,x),m=h.context,m.clearRect(0,0,f,x),m.drawImage(t,0,0,c,p,0,0,f,x),t=h.canvas,c=f,p=x,u=u==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:c,paintHeight:p}}_createMaskCanvas(t){const o=this.ctx,{width:i,height:a}=t,l=this.current.fillColor,d=this.current.patternFill,c=An(o);let p,u,h,m;if((t.bitmap||t.data)&&t.count>1){const P=t.bitmap||t.data.buffer;u=JSON.stringify(d?c:[c.slice(0,4),l]),p=this._cachedBitmapsMap.get(P),p||(p=new Map,this._cachedBitmapsMap.set(P,p));const D=p.get(u);if(D&&!d){const T=Math.round(Math.min(c[0],c[2])+c[4]),O=Math.round(Math.min(c[1],c[3])+c[5]);return{canvas:D,offsetX:T,offsetY:O}}h=D}h||(m=this.cachedCanvases.getCanvas("maskCanvas",i,a),Upe(m.context,t));let f=So.transform(c,[1/i,0,0,-1/a,0,0]);f=So.transform(f,[1,0,0,1,0,-a]);const[x,y,w,b]=So.getAxialAlignedBoundingBox([0,0,i,a],f),v=Math.round(w-x)||1,A=Math.round(b-y)||1,S=this.cachedCanvases.getCanvas("fillCanvas",v,A),E=S.context,I=x,L=y;E.translate(-I,-L),E.transform(...f),h||(h=this._scaleImage(m.canvas,Hh(E)),h=h.img,p&&d&&p.set(u,h)),E.imageSmoothingEnabled=Wpe(An(E),t.interpolate),EC(E,h,0,0,h.width,h.height,0,0,i,a),E.globalCompositeOperation="source-in";const B=So.transform(Hh(E),[1,0,0,1,-I,-L]);return E.fillStyle=d?l.getPattern(o,this,B,Cl.FILL):l,E.fillRect(0,0,i,a),p&&!d&&(this.cachedCanvases.delete("fillCanvas"),p.set(u,S.canvas)),{canvas:S.canvas,offsetX:Math.round(I),offsetY:Math.round(L)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=Vjt[t]}setLineJoin(t){this.ctx.lineJoin=Qjt[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,o){const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(t),i.lineDashOffset=o)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[o,i]of t)switch(o){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,o=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(i,t,o);this.suspendedCtx=this.ctx,this.ctx=a.context;const l=this.ctx;l.setTransform(...An(this.suspendedCtx)),W9(this.suspendedCtx,l),Njt(l,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(),W9(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const o=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,o,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,o,i,a){const l=a[0],d=a[1],c=a[2]-l,p=a[3]-d;c===0||p===0||(this.genericComposeSMask(o.context,i,c,p,o.subtype,o.backdrop,o.transferMap,l,d,o.offsetX,o.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,o,i,a,l,d,c,p,u,h,m){let f=t.canvas,x=p-h,y=u-m;if(d){if(x<0||y<0||x+i>f.width||y+a>f.height){const b=this.cachedCanvases.getCanvas("maskExtension",i,a),v=b.context;v.drawImage(f,-x,-y),d.some(A=>A!==0)&&(v.globalCompositeOperation="destination-atop",v.fillStyle=So.makeHexColor(...d),v.fillRect(0,0,i,a),v.globalCompositeOperation="source-over"),f=b.canvas,x=y=0}else if(d.some(b=>b!==0)){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const b=new Path2D;b.rect(x,y,i,a),t.clip(b),t.globalCompositeOperation="destination-atop",t.fillStyle=So.makeHexColor(...d),t.fillRect(x,y,i,a),t.restore()}}o.save(),o.globalAlpha=1,o.setTransform(1,0,0,1,0,0),l==="Alpha"&&c?o.filter=this.filterFactory.addAlphaFilter(c):l==="Luminosity"&&(o.filter=this.filterFactory.addLuminosityFilter(c));const w=new Path2D;w.rect(p,u,i,a),o.clip(w),o.globalCompositeOperation="destination-in",o.drawImage(f,x,y,i,a,p,u,i,a),o.restore()}save(){this.inSMaskMode?(W9(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),W9(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,o,i,a,l,d){this.ctx.transform(t,o,i,a,l,d),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,o,i){const a=this.ctx,l=this.current;let d=l.x,c=l.y,p,u;const h=An(a),m=h[0]===0&&h[3]===0||h[1]===0&&h[2]===0,f=m?i.slice(0):null;for(let x=0,y=0,w=t.length;x<w;x++)switch(t[x]|0){case j1.rectangle:d=o[y++],c=o[y++];const b=o[y++],v=o[y++],A=d+b,S=c+v;a.moveTo(d,c),b===0||v===0?a.lineTo(A,S):(a.lineTo(A,c),a.lineTo(A,S),a.lineTo(d,S)),m||l.updateRectMinMax(h,[d,c,A,S]),a.closePath();break;case j1.moveTo:d=o[y++],c=o[y++],a.moveTo(d,c),m||l.updatePathMinMax(h,d,c);break;case j1.lineTo:d=o[y++],c=o[y++],a.lineTo(d,c),m||l.updatePathMinMax(h,d,c);break;case j1.curveTo:p=d,u=c,d=o[y+4],c=o[y+5],a.bezierCurveTo(o[y],o[y+1],o[y+2],o[y+3],d,c),l.updateCurvePathMinMax(h,p,u,o[y],o[y+1],o[y+2],o[y+3],d,c,f),y+=6;break;case j1.curveTo2:p=d,u=c,a.bezierCurveTo(d,c,o[y],o[y+1],o[y+2],o[y+3]),l.updateCurvePathMinMax(h,p,u,d,c,o[y],o[y+1],o[y+2],o[y+3],f),d=o[y+2],c=o[y+3],y+=4;break;case j1.curveTo3:p=d,u=c,d=o[y+2],c=o[y+3],a.bezierCurveTo(o[y],o[y+1],d,c,d,c),l.updateCurvePathMinMax(h,p,u,o[y],o[y+1],d,c,d,c,f),y+=4;break;case j1.closePath:a.closePath();break}m&&l.updateScalingPathMinMax(h,f),l.setCurrentPoint(d,c)}closePath(){this.ctx.closePath()}stroke(t=!0){const o=this.ctx,i=this.current.strokeColor;o.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof i=="object"&&i?.getPattern?(o.save(),o.strokeStyle=i.getPattern(o,this,Hh(o),Cl.STROKE),this.rescaleAndStroke(!1),o.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),o.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){const o=this.ctx,i=this.current.fillColor,a=this.current.patternFill;let l=!1;a&&(o.save(),o.fillStyle=i.getPattern(o,this,Hh(o),Cl.FILL),l=!0);const d=this.current.getClippedPathBoundingBox();this.contentVisible&&d!==null&&(this.pendingEOFill?(o.fill("evenodd"),this.pendingEOFill=!1):o.fill()),l&&o.restore(),t&&this.consumePath(d)}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=Ujt}eoClip(){this.pendingClip=Gpe}beginText(){this.current.textMatrix=yLe,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,o=this.ctx;if(t===void 0){o.beginPath();return}o.save(),o.beginPath();for(const i of t)o.setTransform(...i.transform),o.translate(i.x,i.y),i.addToPath(o,i.fontSize);o.restore(),o.clip(),o.beginPath(),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,o){const i=this.commonObjs.get(t),a=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(a.fontMatrix=i.fontMatrix||vQ,(a.fontMatrix[0]===0||a.fontMatrix[3]===0)&&Br("Invalid font matrix for font "+t),o<0?(o=-o,a.fontDirection=-1):a.fontDirection=1,this.current.font=i,this.current.fontSize=o,i.isType3Font)return;const l=i.loadedName||"sans-serif",d=i.systemFontInfo?.css||`"${l}", ${i.fallbackName}`;let c="normal";i.black?c="900":i.bold&&(c="bold");const p=i.italic?"italic":"normal";let u=o;o<Ope?u=Ope:o>Npe&&(u=Npe),this.current.fontSizeScale=o/u,this.ctx.font=`${p} ${c} ${u}px ${d}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,o){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=o}setLeadingMoveText(t,o){this.setLeading(-o),this.moveText(t,o)}setTextMatrix(t,o,i,a,l,d){this.current.textMatrix=[t,o,i,a,l,d],this.current.textMatrixScale=Math.hypot(t,o),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,o,i,a){const l=this.ctx,d=this.current,c=d.font,p=d.textRenderingMode,u=d.fontSize/d.fontSizeScale,h=p&Vs.FILL_STROKE_MASK,m=!!(p&Vs.ADD_TO_PATH_FLAG),f=d.patternFill&&!c.missingFile;let x;(c.disableFontFace||m||f)&&(x=c.getPathGenerator(this.commonObjs,t)),c.disableFontFace||f?(l.save(),l.translate(o,i),l.beginPath(),x(l,u),a&&l.setTransform(...a),(h===Vs.FILL||h===Vs.FILL_STROKE)&&l.fill(),(h===Vs.STROKE||h===Vs.FILL_STROKE)&&l.stroke(),l.restore()):((h===Vs.FILL||h===Vs.FILL_STROKE)&&l.fillText(t,o,i),(h===Vs.STROKE||h===Vs.FILL_STROKE)&&l.strokeText(t,o,i)),m&&(this.pendingTextPaths||=[]).push({transform:An(l),x:o,y:i,fontSize:u,addToPath:x})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const o=t.getImageData(0,0,10,10).data;let i=!1;for(let a=3;a<o.length;a+=4)if(o[a]>0&&o[a]<255){i=!0;break}return si(this,"isFontSubpixelAAEnabled",i)}showText(t){const o=this.current,i=o.font;if(i.isType3Font)return this.showType3Text(t);const a=o.fontSize;if(a===0)return;const l=this.ctx,d=o.fontSizeScale,c=o.charSpacing,p=o.wordSpacing,u=o.fontDirection,h=o.textHScale*u,m=t.length,f=i.vertical,x=f?1:-1,y=i.defaultVMetrics,w=a*o.fontMatrix[0],b=o.textRenderingMode===Vs.FILL&&!i.disableFontFace&&!o.patternFill;l.save(),l.transform(...o.textMatrix),l.translate(o.x,o.y+o.textRise),u>0?l.scale(h,-1):l.scale(h,1);let v;if(o.patternFill){l.save();const L=o.fillColor.getPattern(l,this,Hh(l),Cl.FILL);v=An(l),l.restore(),l.fillStyle=L}let A=o.lineWidth;const S=o.textMatrixScale;if(S===0||A===0){const L=o.textRenderingMode&Vs.FILL_STROKE_MASK;(L===Vs.STROKE||L===Vs.FILL_STROKE)&&(A=this.getSinglePixelWidth())}else A/=S;if(d!==1&&(l.scale(d,d),A/=d),l.lineWidth=A,i.isInvalidPDFjsFont){const L=[];let B=0;for(const P of t)L.push(P.unicode),B+=P.width;l.fillText(L.join(""),0,0),o.x+=B*w*h,l.restore(),this.compose();return}let E=0,I;for(I=0;I<m;++I){const L=t[I];if(typeof L=="number"){E+=x*L*a/1e3;continue}let B=!1;const P=(L.isSpace?p:0)+c,D=L.fontChar,T=L.accent;let O,F,Y=L.width;if(f){const R=L.vmetric||y,U=-(L.vmetric?R[1]:Y*.5)*w,_=R[2]*w;Y=R?-R[0]:Y,O=U/d,F=(E+_)/d}else O=E/d,F=0;if(i.remeasure&&Y>0){const R=l.measureText(D).width*1e3/a*d;if(Y<R&&this.isFontSubpixelAAEnabled){const U=Y/R;B=!0,l.save(),l.scale(U,1),O/=U}else Y!==R&&(O+=(Y-R)/2e3*a/d)}if(this.contentVisible&&(L.isInFont||i.missingFile)){if(b&&!T)l.fillText(D,O,F);else if(this.paintChar(D,O,F,v),T){const R=O+a*T.offset.x/d,U=F-a*T.offset.y/d;this.paintChar(T.fontChar,R,U,v)}}const Z=f?Y*w-P*u:Y*w+P*u;E+=Z,B&&l.restore()}f?o.y-=E:o.x+=E*h,l.restore(),this.compose()}showType3Text(t){const o=this.ctx,i=this.current,a=i.font,l=i.fontSize,d=i.fontDirection,c=a.vertical?1:-1,p=i.charSpacing,u=i.wordSpacing,h=i.textHScale*d,m=i.fontMatrix||vQ,f=t.length,x=i.textRenderingMode===Vs.INVISIBLE;let y,w,b,v;if(!(x||l===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,o.save(),o.transform(...i.textMatrix),o.translate(i.x,i.y),o.scale(h,d),y=0;y<f;++y){if(w=t[y],typeof w=="number"){v=c*w*l/1e3,this.ctx.translate(v,0),i.x+=v*h;continue}const A=(w.isSpace?u:0)+p,S=a.charProcOperatorList[w.operatorListId];if(!S){Br(`Type3 character "${w.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=w,this.save(),o.scale(l,l),o.transform(...m),this.executeOperatorList(S),this.restore()),b=So.applyTransform([w.width,0],m)[0]*l+A,o.translate(b,0),i.x+=b*h}o.restore(),this.processingType3=null}}setCharWidth(t,o){}setCharWidthAndBounds(t,o,i,a,l,d){this.ctx.rect(i,a,l-i,d-a),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let o;if(t[0]==="TilingPattern"){const i=t[1],a=this.baseTransform||An(this.ctx),l={createCanvasGraphics:d=>new W7(d,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};o=new hK(t,i,this.ctx,l,a)}else o=this._getPattern(t[1],t[2]);return o}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,o,i){const a=So.makeHexColor(t,o,i);this.ctx.strokeStyle=a,this.current.strokeColor=a}setFillRGBColor(t,o,i){const a=So.makeHexColor(t,o,i);this.ctx.fillStyle=a,this.current.fillColor=a,this.current.patternFill=!1}_getPattern(t,o=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=Rjt(this.getObject(t)),this.cachedPatterns.set(t,i)),o&&(i.matrix=o),i}shadingFill(t){if(!this.contentVisible)return;const o=this.ctx;this.save();const i=this._getPattern(t);o.fillStyle=i.getPattern(o,this,Hh(o),Cl.SHADING);const a=Hh(o);if(a){const{width:l,height:d}=o.canvas,[c,p,u,h]=So.getAxialAlignedBoundingBox([0,0,l,d],a);this.ctx.fillRect(c,p,u-c,h-p)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){zi("Should not call beginInlineImage")}beginImageData(){zi("Should not call beginImageData")}paintFormXObjectBegin(t,o){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=An(this.ctx),o)){const i=o[2]-o[0],a=o[3]-o[1];this.ctx.rect(o[0],o[1],i,a),this.current.updateRectMinMax(An(this.ctx),o),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const o=this.ctx;t.isolated||cj("TODO: Support non-isolated groups."),t.knockout&&Br("Knockout groups not supported.");const i=An(o);if(t.matrix&&o.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let a=So.getAxialAlignedBoundingBox(t.bbox,An(o));const l=[0,0,o.canvas.width,o.canvas.height];a=So.intersect(a,l)||[0,0,0,0];const d=Math.floor(a[0]),c=Math.floor(a[1]),p=Math.max(Math.ceil(a[2])-d,1),u=Math.max(Math.ceil(a[3])-c,1);this.current.startNewPathAndClipBox([0,0,p,u]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);const m=this.cachedCanvases.getCanvas(h,p,u),f=m.context;f.translate(-d,-c),f.transform(...i),t.smask?this.smaskStack.push({canvas:m.canvas,context:f,offsetX:d,offsetY:c,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(o.setTransform(1,0,0,1,0,0),o.translate(d,c),o.save()),W9(o,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(o),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const o=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const a=An(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...a);const l=So.getAxialAlignedBoundingBox([0,0,o.canvas.width,o.canvas.height],a);this.ctx.drawImage(o.canvas,0,0),this.ctx.restore(),this.compose(l)}}beginAnnotation(t,o,i,a,l){if(this.#e(),LC(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),o){const d=o[2]-o[0],c=o[3]-o[1];if(l&&this.annotationCanvasMap){i=i.slice(),i[4]-=o[0],i[5]-=o[1],o=o.slice(),o[0]=o[1]=0,o[2]=d,o[3]=c;const[p,u]=So.singularValueDecompose2dScale(An(this.ctx)),{viewportScale:h}=this,m=Math.ceil(d*this.outputScaleX*h),f=Math.ceil(c*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(m,f);const{canvas:x,context:y}=this.annotationCanvas;this.annotationCanvasMap.set(t,x),this.annotationCanvas.savedCtx=this.ctx,this.ctx=y,this.ctx.save(),this.ctx.setTransform(p,0,0,-u,0,c*u),LC(this.ctx)}else LC(this.ctx),this.ctx.rect(o[0],o[1],d,c),this.ctx.clip(),this.endPath()}this.current=new Vpe(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...a)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const o=t.count;t=this.getObject(t.data,t),t.count=o;const i=this.ctx,a=this.processingType3;if(a&&(a.compiled===void 0&&(a.compiled=_jt(t)),a.compiled)){a.compiled(i);return}const l=this._createMaskCanvas(t),d=l.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(d,l.offsetX,l.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,o,i=0,a=0,l,d){if(!this.contentVisible)return;t=this.getObject(t.data,t);const c=this.ctx;c.save();const p=An(c);c.transform(o,i,a,l,0,0);const u=this._createMaskCanvas(t);c.setTransform(1,0,0,1,u.offsetX-p[4],u.offsetY-p[5]);for(let h=0,m=d.length;h<m;h+=2){const f=So.transform(p,[o,i,a,l,d[h],d[h+1]]),[x,y]=So.applyTransform([0,0],f);c.drawImage(u.canvas,x,y)}c.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const o=this.ctx,i=this.current.fillColor,a=this.current.patternFill;for(const l of t){const{data:d,width:c,height:p,transform:u}=l,h=this.cachedCanvases.getCanvas("maskCanvas",c,p),m=h.context;m.save();const f=this.getObject(d,l);Upe(m,f),m.globalCompositeOperation="source-in",m.fillStyle=a?i.getPattern(m,this,Hh(o),Cl.FILL):i,m.fillRect(0,0,c,p),m.restore(),o.save(),o.transform(...u),o.scale(1,-1),EC(o,h.canvas,0,0,c,p,0,-1,1,1),o.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const o=this.getObject(t);if(!o){Br("Dependent image isn't ready yet");return}this.paintInlineImageXObject(o)}paintImageXObjectRepeat(t,o,i,a){if(!this.contentVisible)return;const l=this.getObject(t);if(!l){Br("Dependent image isn't ready yet");return}const d=l.width,c=l.height,p=[];for(let u=0,h=a.length;u<h;u+=2)p.push({transform:[o,0,0,i,a[u],a[u+1]],x:0,y:0,w:d,h:c});this.paintInlineImageXObjectGroup(l,p)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:o,width:i,height:a}=t,l=this.cachedCanvases.getCanvas("inlineImage",i,a),d=l.context;return d.filter=this.current.transferMaps,d.drawImage(o,0,0),d.filter="none",l.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const o=t.width,i=t.height,a=this.ctx;if(this.save(),!Zs){const{filter:c}=a;c!=="none"&&c!==""&&(a.filter="none")}a.scale(1/o,-1/i);let l;if(t.bitmap)l=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)l=t;else{const p=this.cachedCanvases.getCanvas("inlineImage",o,i).context;Qpe(p,t),l=this.applyTransferMapsToCanvas(p)}const d=this._scaleImage(l,Hh(a));a.imageSmoothingEnabled=Wpe(An(a),t.interpolate),EC(a,d.img,0,0,d.paintWidth,d.paintHeight,0,-i,o,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,o){if(!this.contentVisible)return;const i=this.ctx;let a;if(t.bitmap)a=t.bitmap;else{const l=t.width,d=t.height,p=this.cachedCanvases.getCanvas("inlineImage",l,d).context;Qpe(p,t),a=this.applyTransferMapsToCanvas(p)}for(const l of o)i.save(),i.transform(...l.transform),i.scale(1,-1),EC(i,a,l.x,l.y,l.w,l.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,o){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,o){t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(o)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const o=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(o||(this.pendingClip===Gpe?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=An(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const o=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),a=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,a)/o}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:o,b:i,c:a,d:l}=this.ctx.getTransform();let d,c;if(i===0&&a===0){const p=Math.abs(o),u=Math.abs(l);if(p===u)if(t===0)d=c=1/p;else{const h=p*t;d=c=h<1?1/h:1}else if(t===0)d=1/p,c=1/u;else{const h=p*t,m=u*t;d=h<1?1/h:1,c=m<1?1/m:1}}else{const p=Math.abs(o*l-i*a),u=Math.hypot(o,i),h=Math.hypot(a,l);if(t===0)d=h/p,c=u/p;else{const m=t*p;d=h>m?h/m:1,c=u>m?u/m:1}}this._cachedScaleForStroking[0]=d,this._cachedScaleForStroking[1]=c}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:o}=this,{lineWidth:i}=this.current,[a,l]=this.getScaleForStroking();if(o.lineWidth=i||1,a===1&&l===1){o.stroke();return}const d=o.getLineDash();if(t&&o.save(),o.scale(a,l),d.length>0){const c=Math.max(a,l);o.setLineDash(d.map(p=>p/c)),o.lineDashOffset/=c}o.stroke(),t&&o.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const e in j1)W7.prototype[e]!==void 0&&(W7.prototype[j1[e]]=W7.prototype[e]);class vw{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");this.#e=t}static get workerSrc(){return this.#t}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");this.#t=t}}const jC={DATA:1,ERROR:2},sa={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Td(e){switch(e instanceof Error||typeof e=="object"&&e!==null||zi('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new pf(e.message);case"MissingPDFException":return new cf(e.message);case"PasswordException":return new AQ(e.message,e.code);case"UnexpectedResponseException":return new pj(e.message,e.status);case"UnknownErrorException":return new $Q(e.message,e.details);default:return new $Q(e.message,e.toString())}}class Kx{constructor(t,o,i){this.sourceName=t,this.targetName=o,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=a=>{const l=a.data;if(l.targetName!==this.sourceName)return;if(l.stream){this.#t(l);return}if(l.callback){const c=l.callbackId,p=this.callbackCapabilities[c];if(!p)throw new Error(`Cannot resolve callback ${c}`);if(delete this.callbackCapabilities[c],l.callback===jC.DATA)p.resolve(l.data);else if(l.callback===jC.ERROR)p.reject(Td(l.reason));else throw new Error("Unexpected callback case");return}const d=this.actionHandler[l.action];if(!d)throw new Error(`Unknown action from worker: ${l.action}`);if(l.callbackId){const c=this.sourceName,p=l.sourceName;new Promise(function(u){u(d(l.data))}).then(function(u){i.postMessage({sourceName:c,targetName:p,callback:jC.DATA,callbackId:l.callbackId,data:u})},function(u){i.postMessage({sourceName:c,targetName:p,callback:jC.ERROR,callbackId:l.callbackId,reason:Td(u)})});return}if(l.streamId){this.#e(l);return}d(l.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,o){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=o}send(t,o,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:o},i)}sendWithPromise(t,o,i){const a=this.callbackId++,l=Promise.withResolvers();this.callbackCapabilities[a]=l;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:a,data:o},i)}catch(d){l.reject(d)}return l.promise}sendWithStream(t,o,i,a){const l=this.streamId++,d=this.sourceName,c=this.targetName,p=this.comObj;return new ReadableStream({start:u=>{const h=Promise.withResolvers();return this.streamControllers[l]={controller:u,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},p.postMessage({sourceName:d,targetName:c,action:t,streamId:l,data:o,desiredSize:u.desiredSize},a),h.promise},pull:u=>{const h=Promise.withResolvers();return this.streamControllers[l].pullCall=h,p.postMessage({sourceName:d,targetName:c,stream:sa.PULL,streamId:l,desiredSize:u.desiredSize}),h.promise},cancel:u=>{Ba(u instanceof Error,"cancel must have a valid reason");const h=Promise.withResolvers();return this.streamControllers[l].cancelCall=h,this.streamControllers[l].isClosed=!0,p.postMessage({sourceName:d,targetName:c,stream:sa.CANCEL,streamId:l,reason:Td(u)}),h.promise}},i)}#e(t){const o=t.streamId,i=this.sourceName,a=t.sourceName,l=this.comObj,d=this,c=this.actionHandler[t.action],p={enqueue(u,h=1,m){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=h,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),l.postMessage({sourceName:i,targetName:a,stream:sa.ENQUEUE,streamId:o,chunk:u},m)},close(){this.isCancelled||(this.isCancelled=!0,l.postMessage({sourceName:i,targetName:a,stream:sa.CLOSE,streamId:o}),delete d.streamSinks[o])},error(u){Ba(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,l.postMessage({sourceName:i,targetName:a,stream:sa.ERROR,streamId:o,reason:Td(u)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};p.sinkCapability.resolve(),p.ready=p.sinkCapability.promise,this.streamSinks[o]=p,new Promise(function(u){u(c(t.data,p))}).then(function(){l.postMessage({sourceName:i,targetName:a,stream:sa.START_COMPLETE,streamId:o,success:!0})},function(u){l.postMessage({sourceName:i,targetName:a,stream:sa.START_COMPLETE,streamId:o,reason:Td(u)})})}#t(t){const o=t.streamId,i=this.sourceName,a=t.sourceName,l=this.comObj,d=this.streamControllers[o],c=this.streamSinks[o];switch(t.stream){case sa.START_COMPLETE:t.success?d.startCall.resolve():d.startCall.reject(Td(t.reason));break;case sa.PULL_COMPLETE:t.success?d.pullCall.resolve():d.pullCall.reject(Td(t.reason));break;case sa.PULL:if(!c){l.postMessage({sourceName:i,targetName:a,stream:sa.PULL_COMPLETE,streamId:o,success:!0});break}c.desiredSize<=0&&t.desiredSize>0&&c.sinkCapability.resolve(),c.desiredSize=t.desiredSize,new Promise(function(p){p(c.onPull?.())}).then(function(){l.postMessage({sourceName:i,targetName:a,stream:sa.PULL_COMPLETE,streamId:o,success:!0})},function(p){l.postMessage({sourceName:i,targetName:a,stream:sa.PULL_COMPLETE,streamId:o,reason:Td(p)})});break;case sa.ENQUEUE:if(Ba(d,"enqueue should have stream controller"),d.isClosed)break;d.controller.enqueue(t.chunk);break;case sa.CLOSE:if(Ba(d,"close should have stream controller"),d.isClosed)break;d.isClosed=!0,d.controller.close(),this.#o(d,o);break;case sa.ERROR:Ba(d,"error should have stream controller"),d.controller.error(Td(t.reason)),this.#o(d,o);break;case sa.CANCEL_COMPLETE:t.success?d.cancelCall.resolve():d.cancelCall.reject(Td(t.reason)),this.#o(d,o);break;case sa.CANCEL:if(!c)break;new Promise(function(p){p(c.onCancel?.(Td(t.reason)))}).then(function(){l.postMessage({sourceName:i,targetName:a,stream:sa.CANCEL_COMPLETE,streamId:o,success:!0})},function(p){l.postMessage({sourceName:i,targetName:a,stream:sa.CANCEL_COMPLETE,streamId:o,reason:Td(p)})}),c.sinkCapability.reject(Td(t.reason)),c.isCancelled=!0,delete this.streamSinks[o];break;default:throw new Error("Unexpected stream case")}}async#o(t,o){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[o]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}class Wjt{#e;#t;constructor({parsedData:t,rawData:o}){this.#e=t,this.#t=o}getRaw(){return this.#t}get(t){return this.#e.get(t)??null}getAll(){return oK(this.#e)}has(t){return this.#e.has(t)}}const D2=Symbol("INTERNAL");class Gjt{#e=!1;#t=!1;#o=!1;#i=!0;constructor(t,{name:o,intent:i,usage:a}){this.#e=!!(t&kc.DISPLAY),this.#t=!!(t&kc.PRINT),this.name=o,this.intent=i,this.usage=a}get visible(){if(this.#o)return this.#i;if(!this.#i)return!1;const{print:t,view:o}=this.usage;return this.#e?o?.viewState!=="OFF":this.#t?t?.printState!=="OFF":!0}_setVisible(t,o,i=!1){t!==D2&&zi("Internal method `_setVisible` called."),this.#o=i,this.#i=o}}class Yjt{#e=null;#t=new Map;#o=null;#i=null;constructor(t,o=kc.DISPLAY){if(this.renderingIntent=o,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,this.#i=t.order;for(const i of t.groups)this.#t.set(i.id,new Gjt(o,i));if(t.baseState==="OFF")for(const i of this.#t.values())i._setVisible(D2,!1);for(const i of t.on)this.#t.get(i)._setVisible(D2,!0);for(const i of t.off)this.#t.get(i)._setVisible(D2,!1);this.#o=this.getHash()}}#s(t){const o=t.length;if(o<2)return!0;const i=t[0];for(let a=1;a<o;a++){const l=t[a];let d;if(Array.isArray(l))d=this.#s(l);else if(this.#t.has(l))d=this.#t.get(l).visible;else return Br(`Optional content group not found: ${l}`),!0;switch(i){case"And":if(!d)return!1;break;case"Or":if(d)return!0;break;case"Not":return!d;default:return!0}}return i==="And"}isVisible(t){if(this.#t.size===0)return!0;if(!t)return cj("Optional content group not defined."),!0;if(t.type==="OCG")return this.#t.has(t.id)?this.#t.get(t.id).visible:(Br(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return this.#s(t.expression);if(!t.policy||t.policy==="AnyOn"){for(const o of t.ids){if(!this.#t.has(o))return Br(`Optional content group not found: ${o}`),!0;if(this.#t.get(o).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const o of t.ids){if(!this.#t.has(o))return Br(`Optional content group not found: ${o}`),!0;if(!this.#t.get(o).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const o of t.ids){if(!this.#t.has(o))return Br(`Optional content group not found: ${o}`),!0;if(!this.#t.get(o).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const o of t.ids){if(!this.#t.has(o))return Br(`Optional content group not found: ${o}`),!0;if(this.#t.get(o).visible)return!1}return!0}return Br(`Unknown optional content policy ${t.policy}.`),!0}return Br(`Unknown group type ${t.type}.`),!0}setVisibility(t,o=!0){const i=this.#t.get(t);if(!i){Br(`Optional content group not found: ${t}`);return}i._setVisible(D2,!!o,!0),this.#e=null}setOCGState({state:t,preserveRB:o}){let i;for(const a of t){switch(a){case"ON":case"OFF":case"Toggle":i=a;continue}const l=this.#t.get(a);if(l)switch(i){case"ON":l._setVisible(D2,!0);break;case"OFF":l._setVisible(D2,!1);break;case"Toggle":l._setVisible(D2,!l.visible);break}}this.#e=null}get hasInitialVisibility(){return this.#o===null||this.getHash()===this.#o}getOrder(){return this.#t.size?this.#i?this.#i.slice():[...this.#t.keys()]:null}getGroups(){return this.#t.size>0?oK(this.#t):null}getGroup(t){return this.#t.get(t)||null}getHash(){if(this.#e!==null)return this.#e;const t=new SLe;for(const[o,i]of this.#t)t.update(`${o}:${i.visible}`);return this.#e=t.hexdigest()}}class Kjt{constructor(t,{disableRange:o=!1,disableStream:i=!1}){Ba(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:a,initialData:l,progressiveDone:d,contentDispositionFilename:c}=t;if(this._queuedChunks=[],this._progressiveDone=d,this._contentDispositionFilename=c,l?.length>0){const p=l instanceof Uint8Array&&l.byteLength===l.buffer.byteLength?l.buffer:new Uint8Array(l).buffer;this._queuedChunks.push(p)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!o,this._contentLength=a,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((p,u)=>{this._onReceiveData({begin:p,chunk:u})}),t.addProgressListener((p,u)=>{this._onProgress({loaded:p,total:u})}),t.addProgressiveReadListener(p=>{this._onReceiveData({chunk:p})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:o}){const i=o instanceof Uint8Array&&o.byteLength===o.buffer.byteLength?o.buffer:new Uint8Array(o).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{const a=this._rangeReaders.some(function(l){return l._begin!==t?!1:(l._enqueue(i),!0)});Ba(a,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){t.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const o=this._rangeReaders.indexOf(t);o>=0&&this._rangeReaders.splice(o,1)}getFullReader(){Ba(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new qjt(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,o){if(o<=this._progressiveDataLength)return null;const i=new Zjt(this,t,o);return this._pdfDataRangeTransport.requestDataRange(t,o),this._rangeReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeReaders.slice(0))o.cancel(t);this._pdfDataRangeTransport.abort()}}class qjt{constructor(t,o,i=!1,a=null){this._stream=t,this._done=i||!1,this._filename=sK(a)?a:null,this._queuedChunks=o||[],this._loaded=0;for(const l of this._queuedChunks)this._loaded+=l.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Zjt{constructor(t,o,i){this._stream=t,this._begin=o,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,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 o=this._queuedChunk;return this._queuedChunk=null,{value:o,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Jjt(e){let t=!0,o=i("filename\\*","i").exec(e);if(o){o=o[1];let h=c(o);return h=unescape(h),h=p(h),h=u(h),l(h)}if(o=d(e),o){const h=u(o);return l(h)}if(o=i("filename","i").exec(e),o){o=o[1];let h=c(o);return h=u(h),l(h)}function i(h,m){return new RegExp("(?:^|;)\\s*"+h+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',m)}function a(h,m){if(h){if(!/^[\x00-\xFF]+$/.test(m))return m;try{const f=new TextDecoder(h,{fatal:!0}),x=uj(m);m=f.decode(x),t=!1}catch{}}return m}function l(h){return t&&/[\x80-\xff]/.test(h)&&(h=a("utf-8",h),t&&(h=a("iso-8859-1",h))),h}function d(h){const m=[];let f;const x=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=x.exec(h))!==null;){let[,w,b,v]=f;if(w=parseInt(w,10),w in m){if(w===0)break;continue}m[w]=[b,v]}const y=[];for(let w=0;w<m.length&&w in m;++w){let[b,v]=m[w];v=c(v),b&&(v=unescape(v),w===0&&(v=p(v))),y.push(v)}return y.join("")}function c(h){if(h.startsWith('"')){const m=h.slice(1).split('\\"');for(let f=0;f<m.length;++f){const x=m[f].indexOf('"');x!==-1&&(m[f]=m[f].slice(0,x),m.length=f+1),m[f]=m[f].replaceAll(/\\(.)/g,"$1")}h=m.join('"')}return h}function p(h){const m=h.indexOf("'");if(m===-1)return h;const f=h.slice(0,m),y=h.slice(m+1).replace(/^[^']*'/,"");return a(f,y)}function u(h){return!h.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(h)?h:h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(m,f,x,y){if(x==="q"||x==="Q")return y=y.replaceAll("_"," "),y=y.replaceAll(/=([0-9a-fA-F]{2})/g,function(w,b){return String.fromCharCode(parseInt(b,16))}),a(f,y);try{y=atob(y)}catch{}return a(f,y)})}return""}function mK({getResponseHeader:e,isHttp:t,rangeChunkSize:o,disableRange:i}){const a={allowRangeRequests:!1,suggestedLength:void 0},l=parseInt(e("Content-Length"),10);return!Number.isInteger(l)||(a.suggestedLength=l,l<=2*o)||i||!t||e("Accept-Ranges")!=="bytes"||(e("Content-Encoding")||"identity")!=="identity"||(a.allowRangeRequests=!0),a}function gK(e){const t=e("Content-Disposition");if(t){let o=Jjt(t);if(o.includes("%"))try{o=decodeURIComponent(o)}catch{}if(sK(o))return o}return null}function yj(e,t){return e===404||e===0&&t.startsWith("file:")?new cf('Missing PDF "'+t+'".'):new pj(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)}function jLe(e){return e===200||e===206}function ILe(e,t,o){return{method:"GET",headers:e,signal:o.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function MLe(e){const t=new Headers;for(const o in e){const i=e[o];i!==void 0&&t.append(o,i)}return t}function BLe(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(Br(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}class Ype{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Ba(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Xjt(this),this._fullRequestReader}getRangeReader(t,o){if(o<=this._progressiveDataLength)return null;const i=new eIt(this,t,o);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeRequestReaders.slice(0))o.cancel(t)}}class Xjt{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const o=t.source;this._withCredentials=o.withCredentials||!1,this._contentLength=o.length,this._headersCapability=Promise.withResolvers(),this._disableRange=o.disableRange||!1,this._rangeChunkSize=o.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!o.disableStream,this._isRangeSupported=!o.disableRange,this._headers=MLe(this._stream.httpHeaders);const i=o.url;fetch(i,ILe(this._headers,this._withCredentials,this._abortController)).then(a=>{if(!jLe(a.status))throw yj(a.status,i);this._reader=a.body.getReader(),this._headersCapability.resolve();const l=p=>a.headers.get(p),{allowRangeRequests:d,suggestedLength:c}=mK({getResponseHeader:l,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=d,this._contentLength=c||this._contentLength,this._filename=gK(l),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new pf("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(){await this._headersCapability.promise;const{value:t,done:o}=await this._reader.read();return o?{value:t,done:o}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:BLe(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class eIt{constructor(t,o,i){this._stream=t,this._reader=null,this._loaded=0;const a=t.source;this._withCredentials=a.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!a.disableStream,this._abortController=new AbortController,this._headers=MLe(this._stream.httpHeaders),this._headers.append("Range",`bytes=${o}-${i-1}`);const l=a.url;fetch(l,ILe(this._headers,this._withCredentials,this._abortController)).then(d=>{if(!jLe(d.status))throw yj(d.status,l);this._readCapability.resolve(),this._reader=d.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:o}=await this._reader.read();return o?{value:t,done:o}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:BLe(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}const MO=200,BO=206;function tIt(e){const t=e.response;return typeof t!="string"?t:uj(t).buffer}class oIt{constructor(t,o={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&o.httpHeaders||Object.create(null),this.withCredentials=o.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,o,i){const a={begin:t,end:o};for(const l in i)a[l]=i[l];return this.request(a)}requestFull(t){return this.request(t)}request(t){const o=new XMLHttpRequest,i=this.currXhrId++,a=this.pendingRequests[i]={xhr:o};o.open("GET",this.url),o.withCredentials=this.withCredentials;for(const l in this.httpHeaders){const d=this.httpHeaders[l];d!==void 0&&o.setRequestHeader(l,d)}return this.isHttp&&"begin"in t&&"end"in t?(o.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),a.expectedStatus=BO):a.expectedStatus=MO,o.responseType="arraybuffer",t.onError&&(o.onerror=function(l){t.onError(o.status)}),o.onreadystatechange=this.onStateChange.bind(this,i),o.onprogress=this.onProgress.bind(this,i),a.onHeadersReceived=t.onHeadersReceived,a.onDone=t.onDone,a.onError=t.onError,a.onProgress=t.onProgress,o.send(null),i}onProgress(t,o){const i=this.pendingRequests[t];i&&i.onProgress?.(o)}onStateChange(t,o){const i=this.pendingRequests[t];if(!i)return;const a=i.xhr;if(a.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),a.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],a.status===0&&this.isHttp){i.onError?.(a.status);return}const l=a.status||MO;if(!(l===MO&&i.expectedStatus===BO)&&l!==i.expectedStatus){i.onError?.(a.status);return}const c=tIt(a);if(l===BO){const p=a.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(p);i.onDone({begin:parseInt(u[1],10),chunk:c})}else c?i.onDone({begin:0,chunk:c}):i.onError?.(a.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const o=this.pendingRequests[t].xhr;delete this.pendingRequests[t],o.abort()}}class rIt{constructor(t){this._source=t,this._manager=new oIt(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const o=this._rangeRequestReaders.indexOf(t);o>=0&&this._rangeRequestReaders.splice(o,1)}getFullReader(){return Ba(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new iIt(this._manager,this._source),this._fullRequestReader}getRangeReader(t,o){const i=new nIt(this._manager,t,o);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeRequestReaders.slice(0))o.cancel(t)}}class iIt{constructor(t,o){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=o.url,this._fullRequestId=t.requestFull(i),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=o.disableRange||!1,this._contentLength=o.length,this._rangeChunkSize=o.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,o=this._manager.getRequestXhr(t),i=d=>o.getResponseHeader(d),{allowRangeRequests:a,suggestedLength:l}=mK({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=l||this._contentLength,this._filename=gK(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=yj(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const o of this._requests)o.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class nIt{constructor(t,o,i){this._manager=t;const a={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(o,i,a),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const o=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:o,done:!1}):this._queuedChunk=o,this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=yj(t,this._url);for(const o of this._requests)o.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const o=this._queuedChunk;return this._queuedChunk=null,{value:o,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const PLe=/^file:\/\/\/[a-zA-Z]:\//;function aIt(e){const t=sh.get("url"),o=t.parse(e);return o.protocol==="file:"||o.host?o:/^[a-z]:[/\\]/i.test(e)?t.parse(`file:///${e}`):(o.host||(o.protocol="file:"),o)}class sIt{constructor(t){this.source=t,this.url=aIt(t.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Ba(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new cIt(this):new lIt(this),this._fullRequestReader}getRangeReader(t,o){if(o<=this._progressiveDataLength)return null;const i=this.isFsUrl?new pIt(this,t,o):new dIt(this,t,o);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeRequestReaders.slice(0))o.cancel(t)}}class DLe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const o=t.source;this._contentLength=o.length,this._loaded=0,this._filename=null,this._disableRange=o.disableRange||!1,this._rangeChunkSize=o.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!o.disableStream,this._isRangeSupported=!o.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",o=>{this._error(o)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new pf("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class TLe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const o=t.source;this._isStreamingSupported=!o.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",o=>{this._error(o)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function vS(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class lIt extends DLe{constructor(t){super(t);const o=i=>{if(i.statusCode===404){const c=new cf(`Missing PDF "${this._url}".`);this._storedError=c,this._headersCapability.reject(c);return}this._headersCapability.resolve(),this._setReadableStream(i);const a=c=>this._readableStream.headers[c.toLowerCase()],{allowRangeRequests:l,suggestedLength:d}=mK({getResponseHeader:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=l,this._contentLength=d||this._contentLength,this._filename=gK(a)};if(this._request=null,this._url.protocol==="http:"){const i=sh.get("http");this._request=i.request(vS(this._url,t.httpHeaders),o)}else{const i=sh.get("https");this._request=i.request(vS(this._url,t.httpHeaders),o)}this._request.on("error",i=>{this._storedError=i,this._headersCapability.reject(i)}),this._request.end()}}class dIt extends TLe{constructor(t,o,i){super(t),this._httpHeaders={};for(const l in t.httpHeaders){const d=t.httpHeaders[l];d!==void 0&&(this._httpHeaders[l]=d)}this._httpHeaders.Range=`bytes=${o}-${i-1}`;const a=l=>{if(l.statusCode===404){const d=new cf(`Missing PDF "${this._url}".`);this._storedError=d;return}this._setReadableStream(l)};if(this._request=null,this._url.protocol==="http:"){const l=sh.get("http");this._request=l.request(vS(this._url,this._httpHeaders),a)}else{const l=sh.get("https");this._request=l.request(vS(this._url,this._httpHeaders),a)}this._request.on("error",l=>{this._storedError=l}),this._request.end()}}class cIt extends DLe{constructor(t){super(t);let o=decodeURIComponent(this._url.path);PLe.test(this._url.href)&&(o=o.replace(/^\//,""));const i=sh.get("fs");i.promises.lstat(o).then(a=>{this._contentLength=a.size,this._setReadableStream(i.createReadStream(o)),this._headersCapability.resolve()},a=>{a.code==="ENOENT"&&(a=new cf(`Missing PDF "${o}".`)),this._storedError=a,this._headersCapability.reject(a)})}}class pIt extends TLe{constructor(t,o,i){super(t);let a=decodeURIComponent(this._url.path);PLe.test(this._url.href)&&(a=a.replace(/^\//,""));const l=sh.get("fs");this._setReadableStream(l.createReadStream(a,{start:o,end:i-1}))}}const uIt=1e5,Ul=30,hIt=.8;let CS=class mu{#e=Promise.withResolvers();#t=null;#o=!1;#i=!!globalThis.FontInspector?.enabled;#s=null;#r=null;#n=0;#l=0;#c=null;#p=null;#h=0;#d=0;#a=Object.create(null);#m=[];#f=null;#u=[];#y=new WeakMap;#g=null;static#w=new Map;static#v=new Map;static#A=null;static#k=new Set;constructor({textContentSource:t,container:o,viewport:i}){if(t instanceof ReadableStream)this.#f=t;else if(typeof t=="object")this.#f=new ReadableStream({start(p){p.enqueue(t),p.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#p=o,this.#d=i.scale*(globalThis.devicePixelRatio||1),this.#h=i.rotation,this.#r={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null};const{pageWidth:a,pageHeight:l,pageX:d,pageY:c}=i.rawDims;this.#g=[1,0,0,-1,-d,c+l],this.#l=a,this.#n=l,mu.#x(),_4(o,i),this.#e.promise.catch(()=>{}).then(()=>{mu.#k.delete(this),this.#r=null,this.#a=null})}render(){const t=()=>{this.#c.read().then(({value:o,done:i})=>{if(i){this.#e.resolve();return}this.#s??=o.lang,Object.assign(this.#a,o.styles),this.#S(o.items),t()},this.#e.reject)};return this.#c=this.#f.getReader(),mu.#k.add(this),t(),this.#e.promise}update({viewport:t,onBefore:o=null}){const i=t.scale*(globalThis.devicePixelRatio||1),a=t.rotation;if(a!==this.#h&&(o?.(),this.#h=a,_4(this.#p,{rotation:a})),i!==this.#d){o?.(),this.#d=i;const l={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:mu.#b(this.#s)};for(const d of this.#u)l.properties=this.#y.get(d),l.div=d,this.#$(l)}}cancel(){const t=new pf("TextLayer task cancelled.");this.#c?.cancel(t).catch(()=>{}),this.#c=null,this.#e.reject(t)}get textDivs(){return this.#u}get textContentItemsStr(){return this.#m}#S(t){if(this.#o)return;this.#r.ctx??=mu.#b(this.#s);const o=this.#u,i=this.#m;for(const a of t){if(o.length>uIt){Br("Ignoring additional textDivs for performance reasons."),this.#o=!0;return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const l=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),a.id!==null&&this.#t.setAttribute("id",`${a.id}`),l.append(this.#t)}else a.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}i.push(a.str),this.#I(a)}}#I(t){const o=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};this.#u.push(o);const a=So.transform(this.#g,t.transform);let l=Math.atan2(a[1],a[0]);const d=this.#a[t.fontName];d.vertical&&(l+=Math.PI/2);const c=this.#i&&d.fontSubstitution||d.fontFamily,p=Math.hypot(a[2],a[3]),u=p*mu.#C(c,this.#s);let h,m;l===0?(h=a[4],m=a[5]-u):(h=a[4]+u*Math.sin(l),m=a[5]-u*Math.cos(l));const f="calc(var(--scale-factor)*",x=o.style;this.#t===this.#p?(x.left=`${(100*h/this.#l).toFixed(2)}%`,x.top=`${(100*m/this.#n).toFixed(2)}%`):(x.left=`${f}${h.toFixed(2)}px)`,x.top=`${f}${m.toFixed(2)}px)`),x.fontSize=`${f}${(mu.#A*p).toFixed(2)}px)`,x.fontFamily=c,i.fontSize=p,o.setAttribute("role","presentation"),o.textContent=t.str,o.dir=t.dir,this.#i&&(o.dataset.fontName=d.fontSubstitutionLoadedName||t.fontName),l!==0&&(i.angle=l*(180/Math.PI));let y=!1;if(t.str.length>1)y=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const w=Math.abs(t.transform[0]),b=Math.abs(t.transform[3]);w!==b&&Math.max(w,b)/Math.min(w,b)>1.5&&(y=!0)}if(y&&(i.canvasWidth=d.vertical?t.height:t.width),this.#y.set(o,i),this.#r.div=o,this.#r.properties=i,this.#$(this.#r),i.hasText&&this.#t.append(o),i.hasEOL){const w=document.createElement("br");w.setAttribute("role","presentation"),this.#t.append(w)}}#$(t){const{div:o,properties:i,ctx:a,prevFontSize:l,prevFontFamily:d}=t,{style:c}=o;let p="";if(mu.#A>1&&(p=`scale(${1/mu.#A})`),i.canvasWidth!==0&&i.hasText){const{fontFamily:u}=c,{canvasWidth:h,fontSize:m}=i;(l!==m||d!==u)&&(a.font=`${m*this.#d}px ${u}`,t.prevFontSize=m,t.prevFontFamily=u);const{width:f}=a.measureText(o.textContent);f>0&&(p=`scaleX(${h*this.#d/f}) ${p}`)}i.angle!==0&&(p=`rotate(${i.angle}deg) ${p}`),p.length>0&&(c.transform=p)}static cleanup(){if(!(this.#k.size>0)){this.#w.clear();for(const{canvas:t}of this.#v.values())t.remove();this.#v.clear()}}static#b(t=null){let o=this.#v.get(t||="");if(!o){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),o=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#v.set(t,o)}return o}static#x(){if(this.#A!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),this.#A=t.getBoundingClientRect().height,t.remove()}static#C(t,o){const i=this.#w.get(t);if(i)return i;const a=this.#b(o),l=a.font;a.canvas.width=a.canvas.height=Ul,a.font=`${Ul}px ${t}`;const d=a.measureText("");let c=d.fontBoundingBoxAscent,p=Math.abs(d.fontBoundingBoxDescent);if(c){const m=c/(c+p);return this.#w.set(t,m),a.canvas.width=a.canvas.height=0,a.font=l,m}a.strokeStyle="red",a.clearRect(0,0,Ul,Ul),a.strokeText("g",0,0);let u=a.getImageData(0,0,Ul,Ul).data;p=0;for(let m=u.length-1-3;m>=0;m-=4)if(u[m]>0){p=Math.ceil(m/4/Ul);break}a.clearRect(0,0,Ul,Ul),a.strokeText("A",0,Ul),u=a.getImageData(0,0,Ul,Ul).data,c=0;for(let m=0,f=u.length;m<f;m+=4)if(u[m]>0){c=Ul-Math.floor(m/4/Ul);break}a.canvas.width=a.canvas.height=0,a.font=l;const h=c?c/(c+p):hIt;return this.#w.set(t,h),h}};function mIt(){$Le("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:e,container:t,viewport:o,...i}=arguments[0],a=Object.keys(i);a.length>0&&Br("Ignoring `renderTextLayer` parameters: "+a.join(", "));const l=new CS({textContentSource:e,container:t,viewport:o}),{textDivs:d,textContentItemsStr:c}=l;return{promise:l.render(),textDivs:d,textContentItemsStr:c}}function gIt(){$Le("`updateTextLayer`, please use `TextLayer` instead.")}class Cw{static textContent(t){const o=[],i={items:o,styles:Object.create(null)};function a(l){if(!l)return;let d=null;const c=l.name;if(c==="#text")d=l.value;else if(Cw.shouldBuildText(c))l?.attributes?.textContent?d=l.attributes.textContent:l.value&&(d=l.value);else return;if(d!==null&&o.push({str:d}),!!l.children)for(const p of l.children)a(p)}return a(t),i}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const fIt=65536,xIt=100,yIt=5e3,wIt=Zs?Ijt:xjt,bIt=Zs?Mjt:CLe,vIt=Zs?jjt:fjt,CIt=Zs?Bjt:ALe;function AIt(e={}){typeof e=="string"||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t=new fK,{docId:o}=t,i=e.url?$It(e.url):null,a=e.data?kIt(e.data):null,l=e.httpHeaders||null,d=e.withCredentials===!0,c=e.password??null,p=e.range instanceof zLe?e.range:null,u=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:fIt;let h=e.worker instanceof jc?e.worker:null;const m=e.verbosity,f=typeof e.docBaseUrl=="string"&&!aK(e.docBaseUrl)?e.docBaseUrl:null,x=typeof e.cMapUrl=="string"?e.cMapUrl:null,y=e.cMapPacked!==!1,w=e.CMapReaderFactory||bIt,b=typeof e.standardFontDataUrl=="string"?e.standardFontDataUrl:null,v=e.StandardFontDataFactory||CIt,A=e.stopAtErrors!==!0,S=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,E=e.isEvalSupported!==!1,I=typeof e.isOffscreenCanvasSupported=="boolean"?e.isOffscreenCanvasSupported:!Zs,L=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,B=typeof e.disableFontFace=="boolean"?e.disableFontFace:Zs,P=e.fontExtraProperties===!0,D=e.enableXfa===!0,T=e.ownerDocument||globalThis.document,O=e.disableRange===!0,F=e.disableStream===!0,Y=e.disableAutoFetch===!0,Z=e.pdfBug===!0,R=e.enableHWA===!0,U=p?p.length:e.length??NaN,_=typeof e.useSystemFonts=="boolean"?e.useSystemFonts:!Zs&&!B,N=typeof e.useWorkerFetch=="boolean"?e.useWorkerFetch:w===CLe&&v===ALe&&x&&b&&Yx(x,document.baseURI)&&Yx(b,document.baseURI),z=e.canvasFactory||new wIt({ownerDocument:T,enableHWA:R}),H=e.filterFactory||new vIt({docId:o,ownerDocument:T}),ee=null;njt(m);const K={canvasFactory:z,filterFactory:H};if(N||(K.cMapReaderFactory=new w({baseUrl:x,isCompressed:y}),K.standardFontDataFactory=new v({baseUrl:b})),!h){const X={verbosity:m,port:vw.workerPort};h=X.port?jc.fromPort(X):new jc(X),t._worker=h}const G={docId:o,apiVersion:"4.4.168",data:a,password:c,disableAutoFetch:Y,rangeChunkSize:u,length:U,docBaseUrl:f,enableXfa:D,evaluatorOptions:{maxImageSize:S,disableFontFace:B,ignoreErrors:A,isEvalSupported:E,isOffscreenCanvasSupported:I,canvasMaxAreaInBytes:L,fontExtraProperties:P,useSystemFonts:_,cMapUrl:N?x:null,standardFontDataUrl:N?b:null}},J={disableFontFace:B,fontExtraProperties:P,ownerDocument:T,pdfBug:Z,styleElement:ee,loadingParams:{disableAutoFetch:Y,enableXfa:D}};return h.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const X=h.messageHandler.sendWithPromise("GetDocRequest",G,a?[a.buffer]:null);let le;if(p)le=new Kjt(p,{disableRange:O,disableStream:F});else if(!a){if(!i)throw new Error("getDocument - no `url` parameter provided.");le=(me=>Zs?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&Yx(me.url)?new Ype(me):new sIt(me):Yx(me.url)?new Ype(me):new rIt(me))({url:i,length:U,httpHeaders:l,withCredentials:d,rangeChunkSize:u,disableRange:O,disableStream:F})}return X.then(xe=>{if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const me=new Kx(o,xe,h.port),ce=new jIt(me,t,le,J,K);t._transport=ce,me.send("Ready",null)})}).catch(t._capability.reject),t}function $It(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(Zs&&typeof e=="string")return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function kIt(e){if(Zs&&typeof uk<"u"&&e instanceof uk)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if(typeof e=="string")return uj(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof e=="object"&&!isNaN(e?.length))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function Kpe(e){return typeof e=="object"&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0}class fK{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${fK.#e++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}let zLe=class{constructor(t,o,i=!1,a=null){this.length=t,this.initialData=o,this.progressiveDone=i,this.contentDispositionFilename=a,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,o){for(const i of this._rangeListeners)i(t,o)}onDataProgress(t,o){this._readyCapability.promise.then(()=>{for(const i of this._progressListeners)i(t,o)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const o of this._progressiveReadListeners)o(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,o){zi("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class SIt{constructor(t,o){this._pdfInfo=t,this._transport=o}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return si(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:o}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(o)}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(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class EIt{#e=null;#t=!1;constructor(t,o,i,a=!1){this._pageIndex=t,this._pageInfo=o,this._transport=i,this._stats=a?new Tpe:null,this._pdfBug=a,this.commonObjs=i.commonObjs,this.objs=new RLe,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:t,rotation:o=this.rotate,offsetX:i=0,offsetY:a=0,dontFlip:l=!1}={}){return new Eb({viewBox:this.view,scale:t,rotation:o,offsetX:i,offsetY:a,dontFlip:l})}getAnnotations({intent:t="display"}={}){const{renderingIntent:o}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,o)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return si(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:o,intent:i="display",annotationMode:a=W2.ENABLE,transform:l=null,background:d=null,optionalContentConfigPromise:c=null,annotationCanvasMap:p=null,pageColors:u=null,printAnnotationStorage:h=null}){this._stats?.time("Overall");const m=this._transport.getRenderingIntent(i,a,h),{renderingIntent:f,cacheKey:x}=m;this.#t=!1,this.#i(),c||=this._transport.getOptionalContentConfig(f);let y=this._intentStates.get(x);y||(y=Object.create(null),this._intentStates.set(x,y)),y.streamReaderCancelTimeout&&(clearTimeout(y.streamReaderCancelTimeout),y.streamReaderCancelTimeout=null);const w=!!(f&kc.PRINT);y.displayReadyCapability||(y.displayReadyCapability=Promise.withResolvers(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(m));const b=S=>{y.renderTasks.delete(v),(this._maybeCleanupAfterRender||w)&&(this.#t=!0),this.#o(!w),S?(v.capability.reject(S),this._abortOperatorList({intentState:y,reason:S instanceof Error?S:new Error(S)})):v.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},v=new j7({callback:b,params:{canvasContext:t,viewport:o,transform:l,background:d},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:p,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!w,pdfBug:this._pdfBug,pageColors:u});(y.renderTasks||=new Set).add(v);const A=v.task;return Promise.all([y.displayReadyCapability.promise,c]).then(([S,E])=>{if(this.destroyed){b();return}if(this._stats?.time("Rendering"),!(E.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");v.initializeGraphics({transparency:S,optionalContentConfig:E}),v.operatorListChanged()}).catch(b),A}getOperatorList({intent:t="display",annotationMode:o=W2.ENABLE,printAnnotationStorage:i=null}={}){function a(){d.operatorList.lastChunk&&(d.opListReadCapability.resolve(d.operatorList),d.renderTasks.delete(c))}const l=this._transport.getRenderingIntent(t,o,i,!0);let d=this._intentStates.get(l.cacheKey);d||(d=Object.create(null),this._intentStates.set(l.cacheKey,d));let c;return d.opListReadCapability||(c=Object.create(null),c.operatorListChanged=a,d.opListReadCapability=Promise.withResolvers(),(d.renderTasks||=new Set).add(c),d.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(l)),d.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:o=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:o===!0},{highWaterMark:100,size(a){return a.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>Cw.textContent(i));const o=this.streamTextContent(t);return new Promise(function(i,a){function l(){d.read().then(function({value:p,done:u}){if(u){i(c);return}c.lang??=p.lang,Object.assign(c.styles,p.styles),c.items.push(...p.items),l()},a)}const d=o.getReader(),c={items:[],styles:Object.create(null),lang:null};l()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const o of this._intentStates.values())if(this._abortOperatorList({intentState:o,reason:new Error("Page was destroyed."),force:!0}),!o.opListReadCapability)for(const i of o.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),this.#t=!1,this.#i(),Promise.all(t)}cleanup(t=!1){this.#t=!0;const o=this.#o(!1);return t&&o&&(this._stats&&=new Tpe),o}#o(t=!1){if(this.#i(),!this.#t||this.destroyed)return!1;if(t)return this.#e=setTimeout(()=>{this.#e=null,this.#o(!1)},yIt),!1;for(const{renderTasks:o,operatorList:i}of this._intentStates.values())if(o.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}#i(){this.#e&&(clearTimeout(this.#e),this.#e=null)}_startRenderPage(t,o){const i=this._intentStates.get(o);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,o){for(let i=0,a=t.length;i<a;i++)o.operatorList.fnArray.push(t.fnArray[i]),o.operatorList.argsArray.push(t.argsArray[i]);o.operatorList.lastChunk=t.lastChunk,o.operatorList.separateAnnots=t.separateAnnots;for(const i of o.renderTasks)i.operatorListChanged();t.lastChunk&&this.#o(!0)}_pumpOperatorList({renderingIntent:t,cacheKey:o,annotationStorageSerializable:i}){const{map:a,transfer:l}=i,c=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:o,annotationStorage:a},l).getReader(),p=this._intentStates.get(o);p.streamReader=c;const u=()=>{c.read().then(({value:h,done:m})=>{if(m){p.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,p),u())},h=>{if(p.streamReader=null,!this._transport.destroyed){if(p.operatorList){p.operatorList.lastChunk=!0;for(const m of p.renderTasks)m.operatorListChanged();this.#o(!0)}if(p.displayReadyCapability)p.displayReadyCapability.reject(h);else if(p.opListReadCapability)p.opListReadCapability.reject(h);else throw h}})};u()}_abortOperatorList({intentState:t,reason:o,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(o instanceof nK){let a=xIt;o.extraDelay>0&&o.extraDelay<1e3&&(a+=o.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:o,force:!0})},a);return}}if(t.streamReader.cancel(new pf(o.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[a,l]of this._intentStates)if(l===t){this._intentStates.delete(a);break}this.cleanup()}}}get stats(){return this._stats}}class LIt{#e=new Set;#t=Promise.resolve();postMessage(t,o){const i={data:structuredClone(t,o?{transfer:o}:null)};this.#t.then(()=>{for(const a of this.#e)a.call(this,i)})}addEventListener(t,o){this.#e.add(o)}removeEventListener(t,o){this.#e.delete(o)}terminate(){this.#e.clear()}}const t0={isWorkerDisabled:!1,fakeWorkerId:0};Zs&&(t0.isWorkerDisabled=!0,vw.workerSrc||="./pdf.worker.mjs"),t0.isSameOrigin=function(e,t){let o;try{if(o=new URL(e),!o.origin||o.origin==="null")return!1}catch{return!1}const i=new URL(t,o);return o.origin===i.origin},t0.createCDNWrapper=function(e){const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};class jc{static#e;constructor({name:t=null,port:o=null,verbosity:i=ajt()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,o){if(jc.#e?.has(o))throw new Error("Cannot use more than one PDFWorker per port.");(jc.#e||=new WeakMap).set(o,this),this._initializeFromPort(o);return}this._initialize()}get promise(){return Zs?Promise.all([sh.promise,this._readyCapability.promise]):this._readyCapability.promise}#t(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new Kx("main","worker",t),this._messageHandler.on("ready",function(){}),this.#t()}_initialize(){if(t0.isWorkerDisabled||jc.#o){this._setupFakeWorker();return}let{workerSrc:t}=jc;try{t0.isSameOrigin(window.location.href,t)||(t=t0.createCDNWrapper(new URL(t,window.location).href));const o=new Worker(t,{type:"module"}),i=new Kx("main","worker",o),a=()=>{l.abort(),i.destroy(),o.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},l=new AbortController;o.addEventListener("error",()=>{this._webWorker||a()},{signal:l.signal}),i.on("test",c=>{if(l.abort(),this.destroyed||!c){a();return}this._messageHandler=i,this._port=o,this._webWorker=o,this.#t()}),i.on("ready",c=>{if(l.abort(),this.destroyed){a();return}try{d()}catch{this._setupFakeWorker()}});const d=()=>{const c=new Uint8Array;i.send("test",c,[c.buffer])};d();return}catch{cj("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){t0.isWorkerDisabled||(Br("Setting up fake worker."),t0.isWorkerDisabled=!0),jc._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const o=new LIt;this._port=o;const i=`fake${t0.fakeWorkerId++}`,a=new Kx(i+"_worker",i,o);t.setup(a,o),this._messageHandler=new Kx(i,i+"_worker",o),this.#t()}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),jc.#e?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const o=this.#e?.get(t.port);if(o){if(o._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return o}return new jc(t)}static get workerSrc(){if(vw.workerSrc)return vw.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#o(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return si(this,"_setupFakeWorkerGlobal",(async()=>this.#o?this.#o:(await import(this.workerSrc)).WorkerMessageHandler)())}}class jIt{#e=new Map;#t=new Map;#o=new Map;#i=new Map;#s=null;constructor(t,o,i,a,l){this.messageHandler=t,this.loadingTask=o,this.commonObjs=new RLe,this.fontLoader=new Ejt({ownerDocument:a.ownerDocument,styleElement:a.styleElement}),this.loadingParams=a.loadingParams,this._params=a,this.canvasFactory=l.canvasFactory,this.filterFactory=l.filterFactory,this.cMapReaderFactory=l.cMapReaderFactory,this.standardFontDataFactory=l.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#r(t,o=null){const i=this.#e.get(t);if(i)return i;const a=this.messageHandler.sendWithPromise(t,o);return this.#e.set(t,a),a}get annotationStorage(){return si(this,"annotationStorage",new uK)}getRenderingIntent(t,o=W2.ENABLE,i=null,a=!1){let l=kc.DISPLAY,d=kQ;switch(t){case"any":l=kc.ANY;break;case"display":break;case"print":l=kc.PRINT;break;default:Br(`getRenderingIntent - invalid intent: ${t}`)}switch(o){case W2.DISABLE:l+=kc.ANNOTATIONS_DISABLE;break;case W2.ENABLE:break;case W2.ENABLE_FORMS:l+=kc.ANNOTATIONS_FORMS;break;case W2.ENABLE_STORAGE:l+=kc.ANNOTATIONS_STORAGE,d=(l&kc.PRINT&&i instanceof ELe?i:this.annotationStorage).serializable;break;default:Br(`getRenderingIntent - invalid annotationMode: ${o}`)}return a&&(l+=kc.OPLIST),{renderingIntent:l,cacheKey:`${l}_${d.hash}`,annotationStorageSerializable:d}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#s?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const i of this.#t.values())t.push(i._destroy());this.#t.clear(),this.#o.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const o=this.messageHandler.sendWithPromise("Terminate",null);return t.push(o),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),CS.cleanup(),this._networkStream?.cancelAllRequests(new pf("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:o}=this;t.on("GetReader",(i,a)=>{Ba(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=l=>{this._lastProgress={loaded:l.loaded,total:l.total}},a.onPull=()=>{this._fullReader.read().then(function({value:l,done:d}){if(d){a.close();return}Ba(l instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(l),1,[l])}).catch(l=>{a.error(l)})},a.onCancel=l=>{this._fullReader.cancel(l),a.ready.catch(d=>{if(!this.destroyed)throw d})}}),t.on("ReaderHeadersReady",i=>{const a=Promise.withResolvers(),l=this._fullReader;return l.headersReady.then(()=>{(!l.isStreamingSupported||!l.isRangeSupported)&&(this._lastProgress&&o.onProgress?.(this._lastProgress),l.onProgress=d=>{o.onProgress?.({loaded:d.loaded,total:d.total})}),a.resolve({isStreamingSupported:l.isStreamingSupported,isRangeSupported:l.isRangeSupported,contentLength:l.contentLength})},a.reject),a.promise}),t.on("GetRangeReader",(i,a)=>{Ba(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const l=this._networkStream.getRangeReader(i.begin,i.end);if(!l){a.close();return}a.onPull=()=>{l.read().then(function({value:d,done:c}){if(c){a.close();return}Ba(d instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(d),1,[d])}).catch(d=>{a.error(d)})},a.onCancel=d=>{l.cancel(d),a.ready.catch(c=>{if(!this.destroyed)throw c})}}),t.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,o._capability.resolve(new SIt(i,this))}),t.on("DocException",function(i){let a;switch(i.name){case"PasswordException":a=new AQ(i.message,i.code);break;case"InvalidPDFException":a=new wLe(i.message);break;case"MissingPDFException":a=new cf(i.message);break;case"UnexpectedResponseException":a=new pj(i.message,i.status);break;case"UnknownErrorException":a=new $Q(i.message,i.details);break;default:zi("DocException - expected a valid Error.")}o._capability.reject(a)}),t.on("PasswordRequest",i=>{if(this.#s=Promise.withResolvers(),o.onPassword){const a=l=>{l instanceof Error?this.#s.reject(l):this.#s.resolve({password:l})};try{o.onPassword(a,i.code)}catch(l){this.#s.reject(l)}}else this.#s.reject(new AQ(i.message,i.code));return this.#s.promise}),t.on("DataLoaded",i=>{o.onProgress?.({loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),t.on("StartRenderPage",i=>{if(this.destroyed)return;this.#t.get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),t.on("commonobj",([i,a,l])=>{if(this.destroyed||this.commonObjs.has(i))return null;switch(a){case"Font":const{disableFontFace:d,fontExtraProperties:c,pdfBug:p}=this._params;if("error"in l){const f=l.error;Br(`Error during font loading: ${f}`),this.commonObjs.resolve(i,f);break}const u=p&&globalThis.FontInspector?.enabled?(f,x)=>globalThis.FontInspector.fontAdded(f,x):null,h=new Ljt(l,{disableFontFace:d,inspectFont:u});this.fontLoader.bind(h).catch(()=>t.sendWithPromise("FontFallback",{id:i})).finally(()=>{!c&&h.data&&(h.data=null),this.commonObjs.resolve(i,h)});break;case"CopyLocalImage":const{imageRef:m}=l;Ba(m,"The imageRef must be defined.");for(const f of this.#t.values())for(const[,x]of f.objs)if(x?.ref===m)return x.dataLen?(this.commonObjs.resolve(i,structuredClone(x)),x.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,l);break;default:throw new Error(`Got unknown common object type ${a}`)}return null}),t.on("obj",([i,a,l,d])=>{if(this.destroyed)return;const c=this.#t.get(a);if(!c.objs.has(i)){if(c._intentStates.size===0){d?.bitmap?.close();return}switch(l){case"Image":c.objs.resolve(i,d),d?.dataLen>tjt&&(c._maybeCleanupAfterRender=!0);break;case"Pattern":c.objs.resolve(i,d);break;default:throw new Error(`Got unknown object type ${l}`)}}}),t.on("DocProgress",i=>{this.destroyed||o.onProgress?.({loaded:i.loaded,total:i.total})}),t.on("FetchBuiltInCMap",i=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(i):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),t.on("FetchStandardFontData",i=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(i):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Br("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:o}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},o).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const o=t-1,i=this.#o.get(o);if(i)return i;const a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:o}).then(l=>{if(this.destroyed)throw new Error("Transport destroyed");l.refStr&&this.#i.set(l.refStr,t);const d=new EIt(o,l,this,this._params.pdfBug);return this.#t.set(o,d),d});return this.#o.set(o,a),a}getPageIndex(t){return Kpe(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,o){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:o})}getFieldObjects(){return this.#r("GetFieldObjects")}hasJSActions(){return this.#r("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#r("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#r("GetOptionalContentConfig").then(o=>new Yjt(o,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",o=this.#e.get(t);if(o)return o;const i=this.messageHandler.sendWithPromise(t,null).then(a=>({info:a[0],metadata:a[1]?new Wjt(a[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const o of this.#t.values())if(!o.cleanup())throw new Error(`startCleanup: Page ${o.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),CS.cleanup()}}cachedPageNumber(t){if(!Kpe(t))return null;const o=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return this.#i.get(o)??null}}const IC=Symbol("INITIAL_DATA");class RLe{#e=Object.create(null);#t(t){return this.#e[t]||={...Promise.withResolvers(),data:IC}}get(t,o=null){if(o){const a=this.#t(t);return a.promise.then(()=>o(a.data)),null}const i=this.#e[t];if(!i||i.data===IC)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const o=this.#e[t];return!!o&&o.data!==IC}resolve(t,o=null){const i=this.#t(t);i.data=o,i.resolve()}clear(){for(const t in this.#e){const{data:o}=this.#e[t];o?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const t in this.#e){const{data:o}=this.#e[t];o!==IC&&(yield[t,o])}}}class IIt{#e=null;constructor(t){this.#e=t,this.onContinue=null}get promise(){return this.#e.capability.promise}cancel(t=0){this.#e.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#e.operatorList;if(!t)return!1;const{annotationCanvasMap:o}=this.#e;return t.form||t.canvas&&o?.size>0}}class j7{#e=null;static#t=new WeakSet;constructor({callback:t,params:o,objs:i,commonObjs:a,annotationCanvasMap:l,operatorList:d,pageIndex:c,canvasFactory:p,filterFactory:u,useRequestAnimationFrame:h=!1,pdfBug:m=!1,pageColors:f=null}){this.callback=t,this.params=o,this.objs=i,this.commonObjs=a,this.annotationCanvasMap=l,this.operatorListIdx=null,this.operatorList=d,this._pageIndex=c,this.canvasFactory=p,this.filterFactory=u,this._pdfBug=m,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=h===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new IIt(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=o.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:o}){if(this.cancelled)return;if(this._canvas){if(j7.#t.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.");j7.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:a,transform:l,background:d}=this.params;this.gfx=new W7(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:o},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:l,viewport:a,transparency:t,background:d}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,o=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),j7.#t.delete(this._canvas),this.callback(t||new nK(`Rendering cancelled, page ${this._pageIndex+1}`,o))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.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?this.#e=window.requestAnimationFrame(()=>{this.#e=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(),j7.#t.delete(this._canvas),this.callback())))}}const MIt="4.4.168",BIt="19fbc8998";function qpe(e){return Math.floor(Math.max(0,Math.min(1,e))*255).toString(16).padStart(2,"0")}function G9(e){return Math.max(0,Math.min(255,255*e))}class Zpe{static CMYK_G([t,o,i,a]){return["G",1-Math.min(1,.3*t+.59*i+.11*o+a)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=G9(t),[t,t,t]}static G_HTML([t]){const o=qpe(t);return`#${o}${o}${o}`}static RGB_G([t,o,i]){return["G",.3*t+.59*o+.11*i]}static RGB_rgb(t){return t.map(G9)}static RGB_HTML(t){return`#${t.map(qpe).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,o,i,a]){return["RGB",1-Math.min(1,t+a),1-Math.min(1,i+a),1-Math.min(1,o+a)]}static CMYK_rgb([t,o,i,a]){return[G9(1-Math.min(1,t+a)),G9(1-Math.min(1,i+a)),G9(1-Math.min(1,o+a))]}static CMYK_HTML(t){const o=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(o)}static RGB_CMYK([t,o,i]){const a=1-t,l=1-o,d=1-i,c=Math.min(a,l,d);return["CMYK",a,l,d,c]}}class FLe{static setupStorage(t,o,i,a,l){const d=a.getValue(o,{value:null});switch(i.name){case"textarea":if(d.value!==null&&(t.textContent=d.value),l==="print")break;t.addEventListener("input",c=>{a.setValue(o,{value:c.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(d.value===i.attributes.xfaOn?t.setAttribute("checked",!0):d.value===i.attributes.xfaOff&&t.removeAttribute("checked"),l==="print")break;t.addEventListener("change",c=>{a.setValue(o,{value:c.target.checked?c.target.getAttribute("xfaOn"):c.target.getAttribute("xfaOff")})})}else{if(d.value!==null&&t.setAttribute("value",d.value),l==="print")break;t.addEventListener("input",c=>{a.setValue(o,{value:c.target.value})})}break;case"select":if(d.value!==null){t.setAttribute("value",d.value);for(const c of i.children)c.attributes.value===d.value?c.attributes.selected=!0:c.attributes.hasOwnProperty("selected")&&delete c.attributes.selected}t.addEventListener("input",c=>{const p=c.target.options,u=p.selectedIndex===-1?"":p[p.selectedIndex].value;a.setValue(o,{value:u})});break}}static setAttributes({html:t,element:o,storage:i=null,intent:a,linkService:l}){const{attributes:d}=o,c=t instanceof HTMLAnchorElement;d.type==="radio"&&(d.name=`${d.name}-${a}`);for(const[p,u]of Object.entries(d))if(u!=null)switch(p){case"class":u.length&&t.setAttribute(p,u.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",u);break;case"style":Object.assign(t.style,u);break;case"textContent":t.textContent=u;break;default:(!c||p!=="href"&&p!=="newWindow")&&t.setAttribute(p,u)}c&&l.addLinkAttributes(t,d.href,d.newWindow),i&&d.dataId&&this.setupStorage(t,d.dataId,o,i)}static render(t){const o=t.annotationStorage,i=t.linkService,a=t.xfaHtml,l=t.intent||"display",d=document.createElement(a.name);a.attributes&&this.setAttributes({html:d,element:a,intent:l,linkService:i});const c=l!=="richText",p=t.div;if(p.append(d),t.viewport){const m=`matrix(${t.viewport.transform.join(",")})`;p.style.transform=m}c&&p.setAttribute("class","xfaLayer xfaFont");const u=[];if(a.children.length===0){if(a.value){const m=document.createTextNode(a.value);d.append(m),c&&Cw.shouldBuildText(a.name)&&u.push(m)}return{textDivs:u}}const h=[[a,-1,d]];for(;h.length>0;){const[m,f,x]=h.at(-1);if(f+1===m.children.length){h.pop();continue}const y=m.children[++h.at(-1)[1]];if(y===null)continue;const{name:w}=y;if(w==="#text"){const v=document.createTextNode(y.value);u.push(v),x.append(v);continue}const b=y?.attributes?.xmlns?document.createElementNS(y.attributes.xmlns,w):document.createElement(w);if(x.append(b),y.attributes&&this.setAttributes({html:b,element:y,storage:o,intent:l,linkService:i}),y.children?.length>0)h.push([y,-1,b]);else if(y.value){const v=document.createTextNode(y.value);c&&Cw.shouldBuildText(w)&&u.push(v),b.append(v)}}for(const m of p.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:u}}static update(t){const o=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=o,t.div.hidden=!1}}const Ib=1e3,PIt=9,V4=new WeakSet;function S0(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class DIt{static create(t){switch(t.data.annotationType){case Ea.LINK:return new OLe(t);case Ea.TEXT:return new TIt(t);case Ea.WIDGET:switch(t.data.fieldType){case"Tx":return new zIt(t);case"Btn":return t.data.radioButton?new NLe(t):t.data.checkBox?new FIt(t):new OIt(t);case"Ch":return new NIt(t);case"Sig":return new RIt(t)}return new uf(t);case Ea.POPUP:return new jQ(t);case Ea.FREETEXT:return new HLe(t);case Ea.LINE:return new _It(t);case Ea.SQUARE:return new VIt(t);case Ea.CIRCLE:return new QIt(t);case Ea.POLYLINE:return new _Le(t);case Ea.CARET:return new WIt(t);case Ea.INK:return new VLe(t);case Ea.POLYGON:return new UIt(t);case Ea.HIGHLIGHT:return new GIt(t);case Ea.UNDERLINE:return new YIt(t);case Ea.SQUIGGLY:return new KIt(t);case Ea.STRIKEOUT:return new qIt(t);case Ea.STAMP:return new QLe(t);case Ea.FILEATTACHMENT:return new ZIt(t);default:return new ta(t)}}}class ta{#e=null;#t=!1;#o=null;constructor(t,{isRenderable:o=!1,ignoreBorder:i=!1,createQuadrilaterals:a=!1}={}){this.isRenderable=o,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,o&&(this.container=this._createContainer(i)),a&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:o,richText:i}){return!!(t?.str||o?.str||i?.str)}get hasPopupData(){return ta._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};const{rect:o}=t;o&&this.#i(o),this.#o?.popup.updateEdited(t)}resetEdited(){this.#e&&(this.#i(this.#e.rect),this.#o?.popup.resetEdited(),this.#e=null)}#i(t){const{container:{style:o},data:{rect:i,rotation:a},parent:{viewport:{rawDims:{pageWidth:l,pageHeight:d,pageX:c,pageY:p}}}}=this;i?.splice(0,4,...t);const{width:u,height:h}=S0(t);o.left=`${100*(t[0]-c)/l}%`,o.top=`${100*(d-t[3]+p)/d}%`,a===0?(o.width=`${100*u/l}%`,o.height=`${100*h/d}%`):this.setRotation(a)}_createContainer(t){const{data:o,parent:{page:i,viewport:a}}=this,l=document.createElement("section");l.setAttribute("data-annotation-id",o.id),this instanceof uf||(l.tabIndex=Ib);const{style:d}=l;if(d.zIndex=this.parent.zIndex++,o.popupRef&&l.setAttribute("aria-haspopup","dialog"),o.alternativeText&&(l.title=o.alternativeText),o.noRotate&&l.classList.add("norotate"),!o.rect||this instanceof jQ){const{rotation:w}=o;return!o.hasOwnCanvas&&w!==0&&this.setRotation(w,l),l}const{width:c,height:p}=S0(o.rect);if(!t&&o.borderStyle.width>0){d.borderWidth=`${o.borderStyle.width}px`;const w=o.borderStyle.horizontalCornerRadius,b=o.borderStyle.verticalCornerRadius;if(w>0||b>0){const A=`calc(${w}px * var(--scale-factor)) / calc(${b}px * var(--scale-factor))`;d.borderRadius=A}else if(this instanceof NLe){const A=`calc(${c}px * var(--scale-factor)) / calc(${p}px * var(--scale-factor))`;d.borderRadius=A}switch(o.borderStyle.style){case U9.SOLID:d.borderStyle="solid";break;case U9.DASHED:d.borderStyle="dashed";break;case U9.BEVELED:Br("Unimplemented border style: beveled");break;case U9.INSET:Br("Unimplemented border style: inset");break;case U9.UNDERLINE:d.borderBottomStyle="solid";break}const v=o.borderColor||null;v?(this.#t=!0,d.borderColor=So.makeHexColor(v[0]|0,v[1]|0,v[2]|0)):d.borderWidth=0}const u=So.normalizeRect([o.rect[0],i.view[3]-o.rect[1]+i.view[1],o.rect[2],i.view[3]-o.rect[3]+i.view[1]]),{pageWidth:h,pageHeight:m,pageX:f,pageY:x}=a.rawDims;d.left=`${100*(u[0]-f)/h}%`,d.top=`${100*(u[1]-x)/m}%`;const{rotation:y}=o;return o.hasOwnCanvas||y===0?(d.width=`${100*c/h}%`,d.height=`${100*p/m}%`):this.setRotation(y,l),l}setRotation(t,o=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:a}=this.parent.viewport.rawDims,{width:l,height:d}=S0(this.data.rect);let c,p;t%180===0?(c=100*l/i,p=100*d/a):(c=100*d/i,p=100*l/a),o.style.width=`${c}%`,o.style.height=`${p}%`,o.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(o,i,a)=>{const l=a.detail[o],d=l[0],c=l.slice(1);a.target.style[i]=Zpe[`${d}_HTML`](c),this.annotationStorage.setValue(this.data.id,{[i]:Zpe[`${d}_rgb`](c)})};return si(this,"_commonActions",{display:o=>{const{display:i}=o.detail,a=i%2===1;this.container.style.visibility=a?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:a,noPrint:i===1||i===2})},print:o=>{this.annotationStorage.setValue(this.data.id,{noPrint:!o.detail.print})},hidden:o=>{const{hidden:i}=o.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:o=>{setTimeout(()=>o.target.focus({preventScroll:!1}),0)},userName:o=>{o.target.title=o.detail.userName},readonly:o=>{o.target.disabled=o.detail.readonly},required:o=>{this._setRequired(o.target,o.detail.required)},bgColor:o=>{t("bgColor","backgroundColor",o)},fillColor:o=>{t("fillColor","backgroundColor",o)},fgColor:o=>{t("fgColor","color",o)},textColor:o=>{t("textColor","color",o)},borderColor:o=>{t("borderColor","borderColor",o)},strokeColor:o=>{t("strokeColor","borderColor",o)},rotation:o=>{const i=o.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(t,o){const i=this._commonActions;for(const a of Object.keys(o.detail))(t[a]||i[a])?.(o)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const o=this.annotationStorage.getRawValue(this.data.id);if(!o)return;const i=this._commonActions;for(const[a,l]of Object.entries(o)){const d=i[a];if(d){const c={detail:{[a]:l},target:t};d(c),delete o[a]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[o,i,a,l]=this.data.rect.map(w=>Math.fround(w));if(t.length===8){const[w,b,v,A]=t.subarray(2,6);if(a===w&&l===b&&o===v&&i===A)return}const{style:d}=this.container;let c;if(this.#t){const{borderColor:w,borderWidth:b}=d;d.borderWidth=0,c=["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="${w}" stroke-width="${b}">`],this.container.classList.add("hasBorder")}const p=a-o,u=l-i,{svgFactory:h}=this,m=h.createElement("svg");m.classList.add("quadrilateralsContainer"),m.setAttribute("width",0),m.setAttribute("height",0);const f=h.createElement("defs");m.append(f);const x=h.createElement("clipPath"),y=`clippath_${this.data.id}`;x.setAttribute("id",y),x.setAttribute("clipPathUnits","objectBoundingBox"),f.append(x);for(let w=2,b=t.length;w<b;w+=8){const v=t[w],A=t[w+1],S=t[w+2],E=t[w+3],I=h.createElement("rect"),L=(S-o)/p,B=(l-A)/u,P=(v-S)/p,D=(A-E)/u;I.setAttribute("x",L),I.setAttribute("y",B),I.setAttribute("width",P),I.setAttribute("height",D),x.append(I),c?.push(`<rect vector-effect="non-scaling-stroke" x="${L}" y="${B}" width="${P}" height="${D}"/>`)}this.#t&&(c.push("</g></svg>')"),d.backgroundImage=c.join("")),this.container.append(m),this.container.style.clipPath=`url(#${y})`}_createPopup(){const{container:t,data:o}=this;t.setAttribute("aria-haspopup","dialog");const i=this.#o=new jQ({data:{color:o.color,titleObj:o.titleObj,modificationDate:o.modificationDate,contentsObj:o.contentsObj,richText:o.richText,parentRect:o.rect,borderStyle:0,id:`popup_${o.id}`,rotation:o.rotation},parent:this.parent,elements:[this]});this.parent.div.append(i.render())}render(){zi("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,o=null){const i=[];if(this._fieldObjects){const a=this._fieldObjects[t];if(a)for(const{page:l,id:d,exportValues:c}of a){if(l===-1||d===o)continue;const p=typeof c=="string"?c:null,u=document.querySelector(`[data-element-id="${d}"]`);if(u&&!V4.has(u)){Br(`_getElementsByName - element not allowed: ${d}`);continue}i.push({id:d,exportValue:p,domElement:u})}return i}for(const a of document.getElementsByName(t)){const{exportValue:l}=a,d=a.getAttribute("data-element-id");d!==o&&V4.has(a)&&i.push({id:d,exportValue:l,domElement:a})}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const o of t)o.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:o}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:o})})}}class OLe extends ta{constructor(t,o=null){super(t,{isRenderable:!0,ignoreBorder:!!o?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:o}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let a=!1;return t.url?(o.addLinkAttributes(i,t.url,t.newWindow),a=!0):t.action?(this._bindNamedAction(i,t.action),a=!0):t.attachment?(this.#t(i,t.attachment,t.attachmentDest),a=!0):t.setOCGState?(this.#o(i,t.setOCGState),a=!0):t.dest?(this._bindLink(i,t.dest),a=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),a=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),a=!0):this.isTooltipOnly&&!a&&(this._bindLink(i,""),a=!0)),this.container.classList.add("linkAnnotation"),a&&this.container.append(i),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(t,o){t.href=this.linkService.getDestinationHash(o),t.onclick=()=>(o&&this.linkService.goToDestination(o),!1),(o||o==="")&&this.#e()}_bindNamedAction(t,o){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(o),!1),this.#e()}#t(t,o,i=null){t.href=this.linkService.getAnchorUrl(""),o.description&&(t.title=o.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(o.content,o.filename,i),!1),this.#e()}#o(t,o){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(o),!1),this.#e()}_bindJSAction(t,o){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const a of Object.keys(o.actions)){const l=i.get(a);l&&(t[l]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o.id,name:a}}),!1))}t.onclick||(t.onclick=()=>!1),this.#e()}_bindResetFormAction(t,o){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){Br('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(t.onclick=()=>!1);return}t.onclick=()=>{i?.();const{fields:a,refs:l,include:d}=o,c=[];if(a.length!==0||l.length!==0){const h=new Set(l);for(const m of a){const f=this._fieldObjects[m]||[];for(const{id:x}of f)h.add(x)}for(const m of Object.values(this._fieldObjects))for(const f of m)h.has(f.id)===d&&c.push(f)}else for(const h of Object.values(this._fieldObjects))c.push(...h);const p=this.annotationStorage,u=[];for(const h of c){const{id:m}=h;switch(u.push(m),h.type){case"text":{const x=h.defaultValue||"";p.setValue(m,{value:x});break}case"checkbox":case"radiobutton":{const x=h.defaultValue===h.exportValues;p.setValue(m,{value:x});break}case"combobox":case"listbox":{const x=h.defaultValue||"";p.setValue(m,{value:x});break}default:continue}const f=document.querySelector(`[data-element-id="${m}"]`);if(f){if(!V4.has(f)){Br(`_bindResetFormAction - element not allowed: ${m}`);continue}}else continue;f.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:u,name:"ResetForm"}}),!1}}}class TIt extends ta{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class uf extends ta{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return sd.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,o,i,a,l){i.includes("mouse")?t.addEventListener(i,d=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(d),shift:d.shiftKey,modifier:this._getKeyModifier(d)}})}):t.addEventListener(i,d=>{if(i==="blur"){if(!o.focused||!d.relatedTarget)return;o.focused=!1}else if(i==="focus"){if(o.focused)return;o.focused=!0}l&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(d)}})})}_setEventListeners(t,o,i,a){for(const[l,d]of i)(d==="Action"||this.data.actions?.[d])&&((d==="Focus"||d==="Blur")&&(o||={focused:!1}),this._setEventListener(t,o,l,d,a),d==="Focus"&&!this.data.actions?.Blur?this._setEventListener(t,o,"blur","Blur",null):d==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(t,o,"focus","Focus",null))}_setBackgroundColor(t){const o=this.data.backgroundColor||null;t.style.backgroundColor=o===null?"transparent":So.makeHexColor(o[0],o[1],o[2])}_setTextStyle(t){const o=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||PIt,l=t.style;let d;const c=2,p=u=>Math.round(10*u)/10;if(this.data.multiLine){const u=Math.abs(this.data.rect[3]-this.data.rect[1]-c),h=Math.round(u/(EO*a))||1,m=u/h;d=Math.min(a,p(m/EO))}else{const u=Math.abs(this.data.rect[3]-this.data.rect[1]-c);d=Math.min(a,p(u/EO))}l.fontSize=`calc(${d}px * var(--scale-factor))`,l.color=So.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(l.textAlign=o[this.data.textAlignment])}_setRequired(t,o){o?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",o)}}class zIt extends uf{constructor(t){const o=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:o})}setPropertyOnSiblings(t,o,i,a){const l=this.annotationStorage;for(const d of this._getElementsByName(t.name,t.id))d.domElement&&(d.domElement[o]=i),l.setValue(d.id,{[a]:i})}render(){const t=this.annotationStorage,o=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const a=t.getValue(o,{value:this.data.fieldValue});let l=a.value||"";const d=t.getValue(o,{charLimit:this.data.maxLen}).charLimit;d&&l.length>d&&(l=l.slice(0,d));let c=a.formattedValue||this.data.textContent?.join(`
246
+ `);return t.join("")}}function Yx(e,t){try{const{protocol:o}=t?new URL(e,t):new URL(e);return o==="http:"||o==="https:"}catch{return!1}}function hd(e){e.preventDefault()}function $Le(e){console.log("Deprecated API usage: "+e)}let zpe;class kLe{static toDateObject(t){if(!t||typeof t!="string")return null;zpe||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const o=zpe.exec(t);if(!o)return null;const i=parseInt(o[1],10);let a=parseInt(o[2],10);a=a>=1&&a<=12?a-1:0;let l=parseInt(o[3],10);l=l>=1&&l<=31?l:1;let d=parseInt(o[4],10);d=d>=0&&d<=23?d:0;let c=parseInt(o[5],10);c=c>=0&&c<=59?c:0;let p=parseInt(o[6],10);p=p>=0&&p<=59?p:0;const u=o[7]||"Z";let h=parseInt(o[8],10);h=h>=0&&h<=23?h:0;let m=parseInt(o[9],10)||0;return m=m>=0&&m<=59?m:0,u==="-"?(d+=h,c+=m):u==="+"&&(d-=h,c-=m),new Date(Date.UTC(i,a,l,d,c,p))}}function bjt(e,{scale:t=1,rotation:o=0}){const{width:i,height:a}=e.attributes.style,l=[0,0,parseInt(i),parseInt(a)];return new Eb({viewBox:l,scale:t,rotation:o})}function lK(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map(t=>parseInt(t)):e.startsWith("rgba(")?e.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(Br(`Not a valid color format: "${e}"`),[0,0,0])}function vjt(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const o of e.keys()){t.style.color=o;const i=window.getComputedStyle(t).color;e.set(o,lK(i))}t.remove()}function An(e){const{a:t,b:o,c:i,d:a,e:l,f:d}=e.getTransform();return[t,o,i,a,l,d]}function Hh(e){const{a:t,b:o,c:i,d:a,e:l,f:d}=e.getTransform().invertSelf();return[t,o,i,a,l,d]}function _4(e,t,o=!1,i=!0){if(t instanceof Eb){const{pageWidth:a,pageHeight:l}=t.rawDims,{style:d}=e,c=sd.isCSSRoundSupported,p=`var(--scale-factor) * ${a}px`,u=`var(--scale-factor) * ${l}px`,h=c?`round(${p}, 1px)`:`calc(${p})`,m=c?`round(${u}, 1px)`:`calc(${u})`;!o||t.rotation%180===0?(d.width=h,d.height=m):(d.width=m,d.height=h)}i&&e.setAttribute("data-main-rotation",t.rotation)}class dK{#e=null;#t=null;#o;#i=null;constructor(t){this.#o=t}render(){const t=this.#e=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");const o=this.#o._uiManager._signal;t.addEventListener("contextmenu",hd,{signal:o}),t.addEventListener("pointerdown",dK.#s,{signal:o});const i=this.#i=document.createElement("div");i.className="buttons",t.append(i);const a=this.#o.toolbarPosition;if(a){const{style:l}=t,d=this.#o._uiManager.direction==="ltr"?1-a[0]:a[0];l.insetInlineEnd=`${100*d}%`,l.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return this.#c(),t}static#s(t){t.stopPropagation()}#r(t){this.#o._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}#n(t){this.#o._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}#l(t){const o=this.#o._uiManager._signal;t.addEventListener("focusin",this.#r.bind(this),{capture:!0,signal:o}),t.addEventListener("focusout",this.#n.bind(this),{capture:!0,signal:o}),t.addEventListener("contextmenu",hd,{signal:o})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden")}#c(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id",`pdfjs-editor-remove-${this.#o.editorType}-button`),this.#l(t),t.addEventListener("click",o=>{this.#o._uiManager.delete()},{signal:this.#o._uiManager._signal}),this.#i.append(t)}get#p(){const t=document.createElement("div");return t.className="divider",t}addAltTextButton(t){this.#l(t),this.#i.prepend(t,this.#p)}addColorPicker(t){this.#t=t;const o=t.renderButton();this.#l(o),this.#i.prepend(o,this.#p)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class Cjt{#e=null;#t=null;#o;constructor(t){this.#o=t}#i(){const t=this.#t=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",hd,{signal:this.#o._signal});const o=this.#e=document.createElement("div");return o.className="buttons",t.append(o),this.#r(),t}#s(t,o){let i=0,a=0;for(const l of t){const d=l.y+l.height;if(d<i)continue;const c=l.x+(o?l.width:0);if(d>i){a=c,i=d;continue}o?c>a&&(a=c):c<a&&(a=c)}return[o?1-a:a,i]}show(t,o,i){const[a,l]=this.#s(o,i),{style:d}=this.#t||=this.#i();t.append(this.#t),d.insetInlineEnd=`${100*a}%`,d.top=`calc(${100*l}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#r(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const o=document.createElement("span");t.append(o),o.className="visuallyHidden",o.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=this.#o._signal;t.addEventListener("contextmenu",hd,{signal:i}),t.addEventListener("click",()=>{this.#o.highlightSelection("floating_button")},{signal:i}),this.#e.append(t)}}function bS(e,t,o){for(const i of o)t.addEventListener(i,e[i].bind(e))}function Ajt(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")}class $jt{#e=0;get id(){return`${ojt}${this.#e++}`}}class cK{#e=gjt();#t=0;#o=null;static get _isSVGFittingCanvas(){const t='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}),a=new Image;a.src=t;const l=a.decode().then(()=>(i.drawImage(a,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return si(this,"_isSVGFittingCanvas",l)}async#i(t,o){this.#o||=new Map;let i=this.#o.get(t);if(i===null)return null;if(i?.bitmap)return i.refCounter+=1,i;try{i||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let a;if(typeof o=="string"?(i.url=o,a=await xj(o,"blob")):a=i.file=o,a.type==="image/svg+xml"){const l=cK._isSVGFittingCanvas,d=new FileReader,c=new Image,p=new Promise((u,h)=>{c.onload=()=>{i.bitmap=c,i.isSvg=!0,u()},d.onload=async()=>{const m=i.svgUrl=d.result;c.src=await l?`${m}#svgView(preserveAspectRatio(none))`:m},c.onerror=d.onerror=h});d.readAsDataURL(a),await p}else i.bitmap=await createImageBitmap(a);i.refCounter=1}catch(a){console.error(a),i=null}return this.#o.set(t,i),i&&this.#o.set(i.id,i),i}async getFromFile(t){const{lastModified:o,name:i,size:a,type:l}=t;return this.#i(`${o}_${i}_${a}_${l}`,t)}async getFromUrl(t){return this.#i(t,t)}async getFromId(t){this.#o||=new Map;const o=this.#o.get(t);return o?o.bitmap?(o.refCounter+=1,o):o.file?this.getFromFile(o.file):this.getFromUrl(o.url):null}getSvgUrl(t){const o=this.#o.get(t);return o?.isSvg?o.svgUrl:null}deleteId(t){this.#o||=new Map;const o=this.#o.get(t);o&&(o.refCounter-=1,o.refCounter===0&&(o.bitmap=null))}isValidId(t){return t.startsWith(`image_${this.#e}_`)}}class kjt{#e=[];#t=!1;#o;#i=-1;constructor(t=128){this.#o=t}add({cmd:t,undo:o,post:i,mustExec:a,type:l=NaN,overwriteIfSameType:d=!1,keepUndo:c=!1}){if(a&&t(),this.#t)return;const p={cmd:t,undo:o,post:i,type:l};if(this.#i===-1){this.#e.length>0&&(this.#e.length=0),this.#i=0,this.#e.push(p);return}if(d&&this.#e[this.#i].type===l){c&&(p.undo=this.#e[this.#i].undo),this.#e[this.#i]=p;return}const u=this.#i+1;u===this.#o?this.#e.splice(0,1):(this.#i=u,u<this.#e.length&&this.#e.splice(u)),this.#e.push(p)}undo(){if(this.#i===-1)return;this.#t=!0;const{undo:t,post:o}=this.#e[this.#i];t(),o?.(),this.#t=!1,this.#i-=1}redo(){if(this.#i<this.#e.length-1){this.#i+=1,this.#t=!0;const{cmd:t,post:o}=this.#e[this.#i];t(),o?.(),this.#t=!1}}hasSomethingToUndo(){return this.#i!==-1}hasSomethingToRedo(){return this.#i<this.#e.length-1}destroy(){this.#e=null}}class Lb{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:o}=sd.platform;for(const[i,a,l={}]of t)for(const d of i){const c=d.startsWith("mac+");o&&c?(this.callbacks.set(d.slice(4),{callback:a,options:l}),this.allKeys.add(d.split("+").at(-1))):!o&&!c&&(this.callbacks.set(d,{callback:a,options:l}),this.allKeys.add(d.split("+").at(-1)))}}#e(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 o=this.buffer.join("+");return this.buffer.length=0,o}exec(t,o){if(!this.allKeys.has(o.key))return;const i=this.callbacks.get(this.#e(o));if(!i)return;const{callback:a,options:{bubbles:l=!1,args:d=[],checker:c=null}}=i;c&&!c(t,o)||(a.bind(t,...d,o)(),l||(o.stopPropagation(),o.preventDefault()))}}class pK{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return vjt(t),si(this,"_colors",t)}convert(t){const o=lK(t);if(!window.matchMedia("(forced-colors: active)").matches)return o;for(const[i,a]of this._colors)if(a.every((l,d)=>l===o[d]))return pK._colorsMapping.get(i);return o}getHexCode(t){const o=this._colors.get(t);return o?So.makeHexColor(...o):t}}class Mm{#e=new AbortController;#t=null;#o=new Map;#i=new Map;#s=null;#r=null;#n=null;#l=new kjt;#c=0;#p=new Set;#h=null;#d=null;#a=new Set;#m=!1;#f=null;#u=null;#y=null;#g=!1;#w=null;#v=new $jt;#A=!1;#k=!1;#S=null;#I=null;#$=null;#b=Xr.NONE;#x=new Set;#C=null;#E=null;#L=null;#B=this.blur.bind(this);#M=this.focus.bind(this);#T=this.copy.bind(this);#P=this.cut.bind(this);#z=this.paste.bind(this);#D=this.keydown.bind(this);#Q=this.keyup.bind(this);#U=this.onEditingAction.bind(this);#_=this.onPageChanging.bind(this);#N=this.onScaleChanging.bind(this);#R=this.onRotationChanging.bind(this);#K={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#V=[0,0];#F=null;#H=null;#q=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=Mm.prototype,o=d=>d.#H.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&d.hasSomethingToControl(),i=(d,{target:c})=>{if(c instanceof HTMLInputElement){const{type:p}=c;return p!=="text"&&p!=="number"}return!0},a=this.TRANSLATE_SMALL,l=this.TRANSLATE_BIG;return si(this,"_keyboardManager",new Lb([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(d,{target:c})=>!(c instanceof HTMLButtonElement)&&d.#H.contains(c)&&!d.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(d,{target:c})=>!(c instanceof HTMLButtonElement)&&d.#H.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-a,0],checker:o}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-l,0],checker:o}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[a,0],checker:o}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[l,0],checker:o}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-a],checker:o}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-l],checker:o}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,a],checker:o}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,l],checker:o}]]))}constructor(t,o,i,a,l,d,c,p,u){this._signal=this.#e.signal,this.#H=t,this.#q=o,this.#s=i,this._eventBus=a,this._eventBus._on("editingaction",this.#U),this._eventBus._on("pagechanging",this.#_),this._eventBus._on("scalechanging",this.#N),this._eventBus._on("rotationchanging",this.#R),this.#ie(),this.#le(),this.#Z(),this.#r=l.annotationStorage,this.#f=l.filterFactory,this.#E=d,this.#y=c||null,this.#m=p,this.#$=u||null,this.viewParameters={realScale:k6.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#e?.abort(),this.#e=null,this._signal=null,this._eventBus._off("editingaction",this.#U),this._eventBus._off("pagechanging",this.#_),this._eventBus._off("scalechanging",this.#N),this._eventBus._off("rotationchanging",this.#R);for(const t of this.#i.values())t.destroy();this.#i.clear(),this.#o.clear(),this.#a.clear(),this.#t=null,this.#x.clear(),this.#l.destroy(),this.#s?.destroy(),this.#w?.hide(),this.#w=null,this.#u&&(clearTimeout(this.#u),this.#u=null),this.#F&&(clearTimeout(this.#F),this.#F=null)}async mlGuess(t){return this.#$?.guess(t)||null}get hasMLManager(){return!!this.#$}get hcmFilter(){return si(this,"hcmFilter",this.#E?this.#f.addHCMFilter(this.#E.foreground,this.#E.background):"none")}get direction(){return si(this,"direction",getComputedStyle(this.#H).direction)}get highlightColors(){return si(this,"highlightColors",this.#y?new Map(this.#y.split(",").map(t=>t.split("=").map(o=>o.trim()))):null)}get highlightColorNames(){return si(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){this.#I=t}editAltText(t){this.#s?.editAltText(this,t)}onPageChanging({pageNumber:t}){this.#c=t-1}focusMainContainer(){this.#H.focus()}findParent(t,o){for(const i of this.#i.values()){const{x:a,y:l,width:d,height:c}=i.div.getBoundingClientRect();if(t>=a&&t<=a+d&&o>=l&&o<=l+c)return i}return null}disableUserSelect(t=!1){this.#q.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#a.add(t)}removeShouldRescale(t){this.#a.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*k6.PDF_TO_CSS_UNITS;for(const o of this.#a)o.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#G({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}highlightSelection(t=""){const o=document.getSelection();if(!o||o.isCollapsed)return;const{anchorNode:i,anchorOffset:a,focusNode:l,focusOffset:d}=o,c=o.toString(),u=this.#G(o).closest(".textLayer"),h=this.getSelectionBoxes(u);if(h){o.empty(),this.#b===Xr.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:Xr.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const m of this.#i.values())if(m.hasTextLayer(u)){m.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:h,anchorNode:i,anchorOffset:a,focusNode:l,focusOffset:d,text:c});break}}}#oe(){const t=document.getSelection();if(!t||t.isCollapsed)return;const i=this.#G(t).closest(".textLayer"),a=this.getSelectionBoxes(i);a&&(this.#w||=new Cjt(this),this.#w.show(i,a,this.direction==="ltr"))}addToAnnotationStorage(t){!t.isEmpty()&&this.#r&&!this.#r.has(t.id)&&this.#r.setValue(t.id,t)}#re(){const t=document.getSelection();if(!t||t.isCollapsed){this.#C&&(this.#w?.hide(),this.#C=null,this.#j({hasSelectedText:!1}));return}const{anchorNode:o}=t;if(o===this.#C)return;if(!this.#G(t).closest(".textLayer")){this.#C&&(this.#w?.hide(),this.#C=null,this.#j({hasSelectedText:!1}));return}if(this.#w?.hide(),this.#C=o,this.#j({hasSelectedText:!0}),!(this.#b!==Xr.HIGHLIGHT&&this.#b!==Xr.NONE)&&(this.#b===Xr.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#g=this.isShiftKeyDown,!this.isShiftKeyDown)){const l=this._signal,d=c=>{c.type==="pointerup"&&c.button!==0||(window.removeEventListener("pointerup",d),window.removeEventListener("blur",d),c.type==="pointerup"&&this.#Y("main_toolbar"))};window.addEventListener("pointerup",d,{signal:l}),window.addEventListener("blur",d,{signal:l})}}#Y(t=""){this.#b===Xr.HIGHLIGHT?this.highlightSelection(t):this.#m&&this.#oe()}#ie(){document.addEventListener("selectionchange",this.#re.bind(this),{signal:this._signal})}#ne(){const t=this._signal;window.addEventListener("focus",this.#M,{signal:t}),window.addEventListener("blur",this.#B,{signal:t})}#ae(){window.removeEventListener("focus",this.#M),window.removeEventListener("blur",this.#B)}blur(){if(this.isShiftKeyDown=!1,this.#g&&(this.#g=!1,this.#Y("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const o of this.#x)if(o.div.contains(t)){this.#S=[o,t],o._focusEventsAllowed=!1;break}}focus(){if(!this.#S)return;const[t,o]=this.#S;this.#S=null,o.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),o.focus()}#Z(){const t=this._signal;window.addEventListener("keydown",this.#D,{signal:t}),window.addEventListener("keyup",this.#Q,{signal:t})}#se(){window.removeEventListener("keydown",this.#D),window.removeEventListener("keyup",this.#Q)}#J(){const t=this._signal;document.addEventListener("copy",this.#T,{signal:t}),document.addEventListener("cut",this.#P,{signal:t}),document.addEventListener("paste",this.#z,{signal:t})}#X(){document.removeEventListener("copy",this.#T),document.removeEventListener("cut",this.#P),document.removeEventListener("paste",this.#z)}#le(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#Z(),this.#J()}removeEditListeners(){this.#se(),this.#X()}dragOver(t){for(const{type:o}of t.dataTransfer.items)for(const i of this.#d)if(i.isHandlingMimeForPasting(o)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const o of t.dataTransfer.items)for(const i of this.#d)if(i.isHandlingMimeForPasting(o.type)){i.paste(o,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const o=[];for(const i of this.#x){const a=i.serialize(!0);a&&o.push(a)}o.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(o))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:o}=t;for(const l of o.items)for(const d of this.#d)if(d.isHandlingMimeForPasting(l.type)){d.paste(l,this.currentLayer);return}let i=o.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(l){Br(`paste: "${l.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();const a=this.currentLayer;try{const l=[];for(const p of i){const u=a.deserialize(p);if(!u)return;l.push(u)}const d=()=>{for(const p of l)this.#ee(p);this.#te(l)},c=()=>{for(const p of l)p.remove()};this.addCommands({cmd:d,undo:c,mustExec:!0})}catch(l){Br(`paste: "${l.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),this.#b!==Xr.NONE&&!this.isEditorHandlingKeyboard&&Mm._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,this.#g&&(this.#g=!1,this.#Y("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}#j(t){Object.entries(t).some(([i,a])=>this.#K[i]!==a)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#K,t)}),this.#b===Xr.HIGHLIGHT&&t.hasSelectedEditor===!1&&this.#O([[ar.HIGHLIGHT_FREE,!0]]))}#O(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#ne(),this.#J(),this.#j({isEditing:this.#b!==Xr.NONE,isEmpty:this.#W(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ae(),this.#X(),this.#j({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#d){this.#d=t;for(const o of this.#d)this.#O(o.defaultPropertiesToUpdate)}}getId(){return this.#v.id}get currentLayer(){return this.#i.get(this.#c)}getLayer(t){return this.#i.get(t)}get currentPageIndex(){return this.#c}addLayer(t){this.#i.set(t.pageIndex,t),this.#A?t.enable():t.disable()}removeLayer(t){this.#i.delete(t.pageIndex)}updateMode(t,o=null,i=!1){if(this.#b!==t){if(this.#b=t,t===Xr.NONE){this.setEditingState(!1),this.#ce();return}this.setEditingState(!0),this.#de(),this.unselectAll();for(const a of this.#i.values())a.updateMode(t);if(!o&&i){this.addNewEditorFromKeyboard();return}if(o){for(const a of this.#o.values())if(a.annotationElementId===o){this.setSelected(a),a.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#b&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,o){if(this.#d){switch(t){case ar.CREATE:this.currentLayer.addNewEditor();return;case ar.HIGHLIGHT_DEFAULT_COLOR:this.#I?.updateColor(o);break;case ar.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#L||=new Map).set(t,o),this.showAllEditors("highlight",o);break}for(const i of this.#x)i.updateParams(t,o);for(const i of this.#d)i.updateDefaultParams(t,o)}}showAllEditors(t,o,i=!1){for(const l of this.#o.values())l.editorType===t&&l.show(o);(this.#L?.get(ar.HIGHLIGHT_SHOW_ALL)??!0)!==o&&this.#O([[ar.HIGHLIGHT_SHOW_ALL,o]])}enableWaiting(t=!1){if(this.#k!==t){this.#k=t;for(const o of this.#i.values())t?o.disableClick():o.enableClick(),o.div.classList.toggle("waiting",t)}}#de(){if(!this.#A){this.#A=!0;for(const t of this.#i.values())t.enable();for(const t of this.#o.values())t.enable()}}#ce(){if(this.unselectAll(),this.#A){this.#A=!1;for(const t of this.#i.values())t.disable();for(const t of this.#o.values())t.disable()}}getEditors(t){const o=[];for(const i of this.#o.values())i.pageIndex===t&&o.push(i);return o}getEditor(t){return this.#o.get(t)}addEditor(t){this.#o.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#u&&clearTimeout(this.#u),this.#u=setTimeout(()=>{this.focusMainContainer(),this.#u=null},0)),this.#o.delete(t.id),this.unselect(t),(!t.annotationElementId||!this.#p.has(t.annotationElementId))&&this.#r?.remove(t.id)}addDeletedAnnotationElement(t){this.#p.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#p.has(t)}removeDeletedAnnotationElement(t){this.#p.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#ee(t){const o=this.#i.get(t.pageIndex);o?o.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#t!==t&&(this.#t=t,t&&this.#O(t.propertiesToUpdate))}get#pe(){let t=null;for(t of this.#x);return t}updateUI(t){this.#pe===t&&this.#O(t.propertiesToUpdate)}toggleSelected(t){if(this.#x.has(t)){this.#x.delete(t),t.unselect(),this.#j({hasSelectedEditor:this.hasSelection});return}this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#j({hasSelectedEditor:!0})}setSelected(t){for(const o of this.#x)o!==t&&o.unselect();this.#x.clear(),this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#j({hasSelectedEditor:!0})}isSelected(t){return this.#x.has(t)}get firstSelectedEditor(){return this.#x.values().next().value}unselect(t){t.unselect(),this.#x.delete(t),this.#j({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#x.size!==0}get isEnterHandled(){return this.#x.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#j({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#W()})}redo(){this.#l.redo(),this.#j({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#W()})}addCommands(t){this.#l.add(t),this.#j({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#W()})}#W(){if(this.#o.size===0)return!0;if(this.#o.size===1)for(const t of this.#o.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...this.#x],o=()=>{for(const a of t)a.remove()},i=()=>{for(const a of t)this.#ee(a)};this.addCommands({cmd:o,undo:i,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#te(t){for(const o of this.#x)o.unselect();this.#x.clear();for(const o of t)o.isEmpty()||(this.#x.add(o),o.select());this.#j({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#x)t.commit();this.#te(this.#o.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#b!==Xr.NONE))&&this.hasSelection){for(const t of this.#x)t.unselect();this.#x.clear(),this.#j({hasSelectedEditor:!1})}}translateSelectedEditors(t,o,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#V[0]+=t,this.#V[1]+=o;const[a,l]=this.#V,d=[...this.#x],c=1e3;this.#F&&clearTimeout(this.#F),this.#F=setTimeout(()=>{this.#F=null,this.#V[0]=this.#V[1]=0,this.addCommands({cmd:()=>{for(const p of d)this.#o.has(p.id)&&p.translateInPage(a,l)},undo:()=>{for(const p of d)this.#o.has(p.id)&&p.translateInPage(-a,-l)},mustExec:!1})},c);for(const p of d)p.translateInPage(t,o)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#h=new Map;for(const t of this.#x)this.#h.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#h)return!1;this.disableUserSelect(!1);const t=this.#h;this.#h=null;let o=!1;for(const[{x:a,y:l,pageIndex:d},c]of t)c.newX=a,c.newY=l,c.newPageIndex=d,o||=a!==c.savedX||l!==c.savedY||d!==c.savedPageIndex;if(!o)return!1;const i=(a,l,d,c)=>{if(this.#o.has(a.id)){const p=this.#i.get(c);p?a._setParentAndPosition(p,l,d):(a.pageIndex=c,a.x=l,a.y=d)}};return this.addCommands({cmd:()=>{for(const[a,{newX:l,newY:d,newPageIndex:c}]of t)i(a,l,d,c)},undo:()=>{for(const[a,{savedX:l,savedY:d,savedPageIndex:c}]of t)i(a,l,d,c)},mustExec:!0}),!0}dragSelectedEditors(t,o){if(this.#h)for(const i of this.#h.keys())i.drag(t,o)}rebuild(t){if(t.parent===null){const o=this.getLayer(t.pageIndex);o?(o.changeParent(t),o.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#x.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#t===t}getActive(){return this.#t}getMode(){return this.#b}get imageManager(){return si(this,"imageManager",new cK)}getSelectionBoxes(t){if(!t)return null;const o=document.getSelection();for(let u=0,h=o.rangeCount;u<h;u++)if(!t.contains(o.getRangeAt(u).commonAncestorContainer))return null;const{x:i,y:a,width:l,height:d}=t.getBoundingClientRect();let c;switch(t.getAttribute("data-main-rotation")){case"90":c=(u,h,m,f)=>({x:(h-a)/d,y:1-(u+m-i)/l,width:f/d,height:m/l});break;case"180":c=(u,h,m,f)=>({x:1-(u+m-i)/l,y:1-(h+f-a)/d,width:m/l,height:f/d});break;case"270":c=(u,h,m,f)=>({x:1-(h+f-a)/d,y:(u-i)/l,width:f/d,height:m/l});break;default:c=(u,h,m,f)=>({x:(u-i)/l,y:(h-a)/d,width:m/l,height:f/d});break}const p=[];for(let u=0,h=o.rangeCount;u<h;u++){const m=o.getRangeAt(u);if(!m.collapsed)for(const{x:f,y:x,width:y,height:w}of m.getClientRects())y===0||w===0||p.push(c(f,x,y,w))}return p.length===0?null:p}addChangedExistingAnnotation({annotationElementId:t,id:o}){(this.#n||=new Map).set(t,o)}removeChangedExistingAnnotation({annotationElementId:t}){this.#n?.delete(t)}renderAnnotationElement(t){const o=this.#n?.get(t.data.id);if(!o)return;const i=this.#r.getRawValue(o);i&&(this.#b===Xr.NONE&&!i.hasBeenModified||i.renderAnnotationElement(t))}}class h4{#e="";#t=!1;#o=null;#i=null;#s=null;#r=!1;#n=null;static _l10nPromise=null;constructor(t){this.#n=t}static initialize(t){h4._l10nPromise||=t}async render(){const t=this.#o=document.createElement("button");t.className="altText";const o=await h4._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=o,t.setAttribute("aria-label",o),t.tabIndex="0";const i=this.#n._uiManager._signal;t.addEventListener("contextmenu",hd,{signal:i}),t.addEventListener("pointerdown",l=>l.stopPropagation(),{signal:i});const a=l=>{l.preventDefault(),this.#n._uiManager.editAltText(this.#n)};return t.addEventListener("click",a,{capture:!0,signal:i}),t.addEventListener("keydown",l=>{l.target===t&&l.key==="Enter"&&(this.#r=!0,a(l))},{signal:i}),await this.#l(),t}finish(){this.#o&&(this.#o.focus({focusVisible:this.#r}),this.#r=!1)}isEmpty(){return!this.#e&&!this.#t}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:t,decorative:o}){this.#e===t&&this.#t===o||(this.#e=t,this.#t=o,this.#l())}toggle(t=!1){this.#o&&(!t&&this.#s&&(clearTimeout(this.#s),this.#s=null),this.#o.disabled=!t)}destroy(){this.#o?.remove(),this.#o=null,this.#i=null}async#l(){const t=this.#o;if(!t)return;if(!this.#e&&!this.#t){t.classList.remove("done"),this.#i?.remove();return}t.classList.add("done"),h4._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(a=>{t.setAttribute("aria-label",a)});let o=this.#i;if(!o){this.#i=o=document.createElement("span"),o.className="tooltip",o.setAttribute("role","tooltip");const a=o.id=`alt-text-tooltip-${this.#n.id}`;t.setAttribute("aria-describedby",a);const l=100,d=this.#n._uiManager._signal;d.addEventListener("abort",()=>{clearTimeout(this.#s),this.#s=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#s=setTimeout(()=>{this.#s=null,this.#i.classList.add("show"),this.#n._reportTelemetry({action:"alt_text_tooltip"})},l)},{signal:d}),t.addEventListener("mouseleave",()=>{this.#s&&(clearTimeout(this.#s),this.#s=null),this.#i?.classList.remove("show")},{signal:d})}o.innerText=this.#t?await h4._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):this.#e,o.parentNode||t.append(o),this.#n.getImageForAltText()?.setAttribute("aria-describedby",o.id)}}class or{#e=null;#t=null;#o=null;#i=!1;#s=!1;#r=null;#n=null;#l=this.focusin.bind(this);#c=this.focusout.bind(this);#p=null;#h="";#d=!1;#a=null;#m=!1;#f=!1;#u=!1;#y=null;#g=0;#w=0;#v=null;_initialOptions=Object.create(null);_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#A=!1;#k=or._zIndex++;static _borderLineWidth=-1;static _colorManager=new pK;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=or.prototype._resizeWithKeyboard,o=Mm.TRANSLATE_SMALL,i=Mm.TRANSLATE_BIG;return si(this,"_resizerKeyboardManager",new Lb([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-o,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[o,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-o]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,o]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],or.prototype._stopResizingWithKeyboard]]))}constructor(t){this.constructor===or&&zi("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:o,rawDims:{pageWidth:i,pageHeight:a,pageX:l,pageY:d}}=this.parent.viewport;this.rotation=o,this.pageRotation=(360+o-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,a],this.pageTranslation=[l,d];const[c,p]=this.parentDimensions;this.x=t.x/c,this.y=t.y/p,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return si(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const o=new Sjt({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});o.annotationElementId=t.annotationElementId,o.deleted=!0,o._uiManager.addToAnnotationStorage(o)}static initialize(t,o,i){if(or._l10nPromise||=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(l=>[l,t.get(l.replaceAll(/([A-Z])/g,d=>`-${d.toLowerCase()}`))])),i?.strings)for(const l of i.strings)or._l10nPromise.set(l,t.get(l));if(or._borderLineWidth!==-1)return;const a=getComputedStyle(document.documentElement);or._borderLineWidth=parseFloat(a.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,o){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,o){zi("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#A}set _isDraggable(t){this.#A=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,o]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*o/(t*2),this.y+=this.width*t/(o*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*o/(t*2),this.y-=this.width*t/(o*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#k}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#D(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#d?this.#d=!1:this.parent.setSelected(this))}focusout(t){!this._focusEventsAllowed||!this.isAttachedToDOM||t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,o,i,a){const[l,d]=this.parentDimensions;[i,a]=this.screenToPageTranslation(i,a),this.x=(t+i)/l,this.y=(o+a)/d,this.fixAndSetPosition()}#S([t,o],i,a){[i,a]=this.screenToPageTranslation(i,a),this.x+=i/t,this.y+=a/o,this.fixAndSetPosition()}translate(t,o){this.#S(this.parentDimensions,t,o)}translateInPage(t,o){this.#a||=[this.x,this.y],this.#S(this.pageDimensions,t,o),this.div.scrollIntoView({block:"nearest"})}drag(t,o){this.#a||=[this.x,this.y];const[i,a]=this.parentDimensions;if(this.x+=t/i,this.y+=o/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:h}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,h)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:l,y:d}=this;const[c,p]=this.getBaseTranslation();l+=c,d+=p,this.div.style.left=`${(100*l).toFixed(2)}%`,this.div.style.top=`${(100*d).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#a&&(this.#a[0]!==this.x||this.#a[1]!==this.y)}getBaseTranslation(){const[t,o]=this.parentDimensions,{_borderLineWidth:i}=or,a=i/t,l=i/o;switch(this.rotation){case 90:return[-a,l];case 180:return[a,l];case 270:return[a,-l];default:return[-a,-l]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const[o,i]=this.pageDimensions;let{x:a,y:l,width:d,height:c}=this;if(d*=o,c*=i,a*=o,l*=i,this._mustFixPosition)switch(t){case 0:a=Math.max(0,Math.min(o-d,a)),l=Math.max(0,Math.min(i-c,l));break;case 90:a=Math.max(0,Math.min(o-c,a)),l=Math.min(i,Math.max(d,l));break;case 180:a=Math.min(o,Math.max(d,a)),l=Math.min(i,Math.max(c,l));break;case 270:a=Math.min(o,Math.max(c,a)),l=Math.max(0,Math.min(i-d,l));break}this.x=a/=o,this.y=l/=i;const[p,u]=this.getBaseTranslation();a+=p,l+=u;const{style:h}=this.div;h.left=`${(100*a).toFixed(2)}%`,h.top=`${(100*l).toFixed(2)}%`,this.moveInDOM()}static#I(t,o,i){switch(i){case 90:return[o,-t];case 180:return[-t,-o];case 270:return[-o,t];default:return[t,o]}}screenToPageTranslation(t,o){return or.#I(t,o,this.parentRotation)}pageTranslationToScreen(t,o){return or.#I(t,o,360-this.parentRotation)}#$(t){switch(t){case 90:{const[o,i]=this.pageDimensions;return[0,-o/i,i/o,0]}case 180:return[-1,0,0,-1];case 270:{const[o,i]=this.pageDimensions;return[0,o/i,-i/o,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[o,i]}=this,a=o*t,l=i*t;return sd.isCSSRoundSupported?[Math.round(a),Math.round(l)]:[a,l]}setDims(t,o){const[i,a]=this.parentDimensions;this.div.style.width=`${(100*t/i).toFixed(2)}%`,this.#s||(this.div.style.height=`${(100*o/a).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:o,width:i}=t,a=i.endsWith("%"),l=!this.#s&&o.endsWith("%");if(a&&l)return;const[d,c]=this.parentDimensions;a||(t.width=`${(100*parseFloat(i)/d).toFixed(2)}%`),!this.#s&&!l&&(t.height=`${(100*parseFloat(o)/c).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#b(){if(this.#r)return;this.#r=document.createElement("div"),this.#r.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],o=this._uiManager._signal;for(const i of t){const a=document.createElement("div");this.#r.append(a),a.classList.add("resizer",i),a.setAttribute("data-resizer-name",i),a.addEventListener("pointerdown",this.#x.bind(this,i),{signal:o}),a.addEventListener("contextmenu",hd,{signal:o}),a.tabIndex=-1}this.div.prepend(this.#r)}#x(t,o){o.preventDefault();const{isMac:i}=sd.platform;if(o.button!==0||o.ctrlKey&&i)return;this.#o?.toggle(!1);const a=this.#E.bind(this,t),l=this._isDraggable;this._isDraggable=!1;const d=this._uiManager._signal,c={passive:!0,capture:!0,signal:d};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",a,c),window.addEventListener("contextmenu",hd,{signal:d});const p=this.x,u=this.y,h=this.width,m=this.height,f=this.parent.div.style.cursor,x=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(o.target).cursor;const y=()=>{this.parent.togglePointerEvents(!0),this.#o?.toggle(!0),this._isDraggable=l,window.removeEventListener("pointerup",y),window.removeEventListener("blur",y),window.removeEventListener("pointermove",a,c),window.removeEventListener("contextmenu",hd),this.parent.div.style.cursor=f,this.div.style.cursor=x,this.#C(p,u,h,m)};window.addEventListener("pointerup",y,{signal:d}),window.addEventListener("blur",y,{signal:d})}#C(t,o,i,a){const l=this.x,d=this.y,c=this.width,p=this.height;l===t&&d===o&&c===i&&p===a||this.addCommands({cmd:()=>{this.width=c,this.height=p,this.x=l,this.y=d;const[u,h]=this.parentDimensions;this.setDims(u*c,h*p),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=a,this.x=t,this.y=o;const[u,h]=this.parentDimensions;this.setDims(u*i,h*a),this.fixAndSetPosition()},mustExec:!0})}#E(t,o){const[i,a]=this.parentDimensions,l=this.x,d=this.y,c=this.width,p=this.height,u=or.MIN_SIZE/i,h=or.MIN_SIZE/a,m=_=>Math.round(_*1e4)/1e4,f=this.#$(this.rotation),x=(_,N)=>[f[0]*_+f[2]*N,f[1]*_+f[3]*N],y=this.#$(360-this.rotation),w=(_,N)=>[y[0]*_+y[2]*N,y[1]*_+y[3]*N];let b,v,A=!1,S=!1;switch(t){case"topLeft":A=!0,b=(_,N)=>[0,0],v=(_,N)=>[_,N];break;case"topMiddle":b=(_,N)=>[_/2,0],v=(_,N)=>[_/2,N];break;case"topRight":A=!0,b=(_,N)=>[_,0],v=(_,N)=>[0,N];break;case"middleRight":S=!0,b=(_,N)=>[_,N/2],v=(_,N)=>[0,N/2];break;case"bottomRight":A=!0,b=(_,N)=>[_,N],v=(_,N)=>[0,0];break;case"bottomMiddle":b=(_,N)=>[_/2,N],v=(_,N)=>[_/2,0];break;case"bottomLeft":A=!0,b=(_,N)=>[0,N],v=(_,N)=>[_,0];break;case"middleLeft":S=!0,b=(_,N)=>[0,N/2],v=(_,N)=>[_,N/2];break}const E=b(c,p),I=v(c,p);let L=x(...I);const B=m(l+L[0]),P=m(d+L[1]);let D=1,T=1,[O,F]=this.screenToPageTranslation(o.movementX,o.movementY);if([O,F]=w(O/i,F/a),A){const _=Math.hypot(c,p);D=T=Math.max(Math.min(Math.hypot(I[0]-E[0]-O,I[1]-E[1]-F)/_,1/c,1/p),u/c,h/p)}else S?D=Math.max(u,Math.min(1,Math.abs(I[0]-E[0]-O)))/c:T=Math.max(h,Math.min(1,Math.abs(I[1]-E[1]-F)))/p;const Y=m(c*D),Z=m(p*T);L=x(...v(Y,Z));const R=B-L[0],U=P-L[1];this.width=Y,this.height=Z,this.x=R,this.y=U,this.setDims(i*Y,a*Z),this.fixAndSetPosition()}altTextFinish(){this.#o?.finish()}async addEditToolbar(){return this.#p||this.#f?this.#p:(this.#p=new dK(this),this.div.append(this.#p.render()),this.#o&&this.#p.addAltTextButton(await this.#o.render()),this.#p)}removeEditToolbar(){this.#p&&(this.#p.remove(),this.#p=null,this.#o?.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#o||(h4.initialize(or._l10nPromise),this.#o=new h4(this),this.#e&&(this.#o.data=this.#e,this.#e=null),await this.addEditToolbar())}get altTextData(){return this.#o?.data}set altTextData(t){this.#o&&(this.#o.data=t)}hasAltText(){return!this.#o?.isEmpty()}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#i?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",this.#l,{signal:t}),this.div.addEventListener("focusout",this.#c,{signal:t});const[o,i]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*i/o).toFixed(2)}%`,this.div.style.maxHeight=`${(100*o/i).toFixed(2)}%`);const[a,l]=this.getInitialTranslation();return this.translate(a,l),bS(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:o}=sd.platform;if(t.button!==0||t.ctrlKey&&o){t.preventDefault();return}if(this.#d=!0,this._isDraggable){this.#B(t);return}this.#L(t)}#L(t){const{isMac:o}=sd.platform;t.ctrlKey&&!o||t.shiftKey||t.metaKey&&o?this.parent.toggleSelected(this):this.parent.setSelected(this)}#B(t){const o=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let i,a;const l=this._uiManager._signal;o&&(this.div.classList.add("moving"),i={passive:!0,capture:!0,signal:l},this.#g=t.clientX,this.#w=t.clientY,a=c=>{const{clientX:p,clientY:u}=c,[h,m]=this.screenToPageTranslation(p-this.#g,u-this.#w);this.#g=p,this.#w=u,this._uiManager.dragSelectedEditors(h,m)},window.addEventListener("pointermove",a,i));const d=()=>{window.removeEventListener("pointerup",d),window.removeEventListener("blur",d),o&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",a,i)),this.#d=!1,this._uiManager.endDragSession()||this.#L(t)};window.addEventListener("pointerup",d,{signal:l}),window.addEventListener("blur",d,{signal:l})}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,o,i){t.changeParent(this),this.x=o,this.y=i,this.fixAndSetPosition()}getRect(t,o,i=this.rotation){const a=this.parentScale,[l,d]=this.pageDimensions,[c,p]=this.pageTranslation,u=t/a,h=o/a,m=this.x*l,f=this.y*d,x=this.width*l,y=this.height*d;switch(i){case 0:return[m+u+c,d-f-h-y+p,m+u+x+c,d-f-h+p];case 90:return[m+h+c,d-f+u+p,m+h+y+c,d-f+u+x+p];case 180:return[m-u-x+c,d-f+h+p,m-u+c,d-f+h+y+p];case 270:return[m-h-y+c,d-f-u-x+p,m-h+c,d-f-u+p];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,o){const[i,a,l,d]=t,c=l-i,p=d-a;switch(this.rotation){case 0:return[i,o-d,c,p];case 90:return[i,o-a,p,c];case 180:return[l,o-a,c,p];case 270:return[l,o-d,p,c];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#f=!0}disableEditMode(){this.#f=!1}isInEditMode(){return this.#f}shouldGetKeyboardEvents(){return this.#u}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){const t=this._uiManager._signal;this.div?.addEventListener("focusin",this.#l,{signal:t}),this.div?.addEventListener("focusout",this.#c,{signal:t})}rotate(t){}serialize(t=!1,o=null){zi("An editor must be serializable")}static deserialize(t,o,i){const a=new this.prototype.constructor({parent:o,id:o.getNextId(),uiManager:i});a.rotation=t.rotation,a.#e=t.accessibilityData;const[l,d]=a.pageDimensions,[c,p,u,h]=a.getRectInCurrentCoords(t.rect,d);return a.x=c/l,a.y=p/d,a.width=u/l,a.height=h/d,a}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",this.#l),this.div.removeEventListener("focusout",this.#c),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#y&&(clearTimeout(this.#y),this.#y=null),this.#D(),this.removeEditToolbar(),this.#v){for(const t of this.#v.values())clearTimeout(t);this.#v=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#b(),this.#r.classList.remove("hidden"),bS(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),this.#n={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const o=this.#r.children;if(!this.#t){this.#t=Array.from(o);const d=this.#M.bind(this),c=this.#T.bind(this),p=this._uiManager._signal;for(const u of this.#t){const h=u.getAttribute("data-resizer-name");u.setAttribute("role","spinbutton"),u.addEventListener("keydown",d,{signal:p}),u.addEventListener("blur",c,{signal:p}),u.addEventListener("focus",this.#P.bind(this,h),{signal:p}),or._l10nPromise.get(`pdfjs-editor-resizer-label-${h}`).then(m=>u.setAttribute("aria-label",m))}}const i=this.#t[0];let a=0;for(const d of o){if(d===i)break;a++}const l=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(l!==a){if(l<a)for(let c=0;c<a-l;c++)this.#r.append(this.#r.firstChild);else if(l>a)for(let c=0;c<l-a;c++)this.#r.firstChild.before(this.#r.lastChild);let d=0;for(const c of o){const u=this.#t[d++].getAttribute("data-resizer-name");or._l10nPromise.get(`pdfjs-editor-resizer-label-${u}`).then(h=>c.setAttribute("aria-label",h))}}this.#z(0),this.#u=!0,this.#r.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#M(t){or._resizerKeyboardManager.exec(this,t)}#T(t){this.#u&&t.relatedTarget?.parentNode!==this.#r&&this.#D()}#P(t){this.#h=this.#u?t:""}#z(t){if(this.#t)for(const o of this.#t)o.tabIndex=t}_resizeWithKeyboard(t,o){this.#u&&this.#E(this.#h,{movementX:t,movementY:o})}#D(){if(this.#u=!1,this.#z(-1),this.#n){const{savedX:t,savedY:o,savedWidth:i,savedHeight:a}=this.#n;this.#C(t,o,i,a),this.#n=null}}_stopResizingWithKeyboard(){this.#D(),this.div.focus()}select(){if(this.makeResizable(),this.div?.classList.add("selectedEditor"),!this.#p){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this.#p?.show()});return}this.#p?.show()}unselect(){this.#r?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this.#p?.hide()}updateParams(t,o){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#m}set isEditing(t){this.#m=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,o){this.#s=!0;const i=t/o,{style:a}=this.div;a.aspectRatio=i,a.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,o=!1){if(o){this.#v||=new Map;const{action:i}=t;let a=this.#v.get(i);a&&clearTimeout(a),a=setTimeout(()=>{this._reportTelemetry(t),this.#v.delete(i),this.#v.size===0&&(this.#v=null)},or._telemetryTimeout),this.#v.set(i,a);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#i=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#i=!0}renderAnnotationElement(t){let o=t.container.querySelector(".annotationContent");if(!o)o=document.createElement("div"),o.classList.add("annotationContent",this.editorType),t.container.prepend(o);else if(o.nodeName==="CANVAS"){const i=o;o=document.createElement("div"),o.classList.add("annotationContent",this.editorType),i.before(o)}return o}resetAnnotationElement(t){const{firstChild:o}=t.container;o.nodeName==="DIV"&&o.classList.contains("annotationContent")&&o.remove()}}class Sjt extends or{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const Rpe=3285377520,fc=4294901760,cu=65535;class SLe{constructor(t){this.h1=t?t&4294967295:Rpe,this.h2=t?t&4294967295:Rpe}update(t){let o,i;if(typeof t=="string"){o=new Uint8Array(t.length*2),i=0;for(let w=0,b=t.length;w<b;w++){const v=t.charCodeAt(w);v<=255?o[i++]=v:(o[i++]=v>>>8,o[i++]=v&255)}}else if(ArrayBuffer.isView(t))o=t.slice(),i=o.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const a=i>>2,l=i-a*4,d=new Uint32Array(o.buffer,0,a);let c=0,p=0,u=this.h1,h=this.h2;const m=3432918353,f=461845907,x=m&cu,y=f&cu;for(let w=0;w<a;w++)w&1?(c=d[w],c=c*m&fc|c*x&cu,c=c<<15|c>>>17,c=c*f&fc|c*y&cu,u^=c,u=u<<13|u>>>19,u=u*5+3864292196):(p=d[w],p=p*m&fc|p*x&cu,p=p<<15|p>>>17,p=p*f&fc|p*y&cu,h^=p,h=h<<13|h>>>19,h=h*5+3864292196);switch(c=0,l){case 3:c^=o[a*4+2]<<16;case 2:c^=o[a*4+1]<<8;case 1:c^=o[a*4],c=c*m&fc|c*x&cu,c=c<<15|c>>>17,c=c*f&fc|c*y&cu,a&1?u^=c:h^=c}this.h1=u,this.h2=h}hexdigest(){let t=this.h1,o=this.h2;return t^=o>>>1,t=t*3981806797&fc|t*36045&cu,o=o*4283543511&fc|((o<<16|t>>>16)*2950163797&fc)>>>16,t^=o>>>1,t=t*444984403&fc|t*60499&cu,o=o*3301882366&fc|((o<<16|t>>>16)*3120437893&fc)>>>16,t^=o>>>1,(t>>>0).toString(16).padStart(8,"0")+(o>>>0).toString(16).padStart(8,"0")}}const kQ=Object.freeze({map:null,hash:"",transfer:void 0});class uK{#e=!1;#t=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,o){const i=this.#t.get(t);return i===void 0?o:Object.assign(o,i)}getRawValue(t){return this.#t.get(t)}remove(t){if(this.#t.delete(t),this.#t.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const o of this.#t.values())if(o instanceof or)return;this.onAnnotationEditor(null)}}setValue(t,o){const i=this.#t.get(t);let a=!1;if(i!==void 0)for(const[l,d]of Object.entries(o))i[l]!==d&&(a=!0,i[l]=d);else a=!0,this.#t.set(t,o);a&&this.#o(),o instanceof or&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(o.constructor._type)}has(t){return this.#t.has(t)}getAll(){return this.#t.size>0?oK(this.#t):null}setAll(t){for(const[o,i]of Object.entries(t))this.setValue(o,i)}get size(){return this.#t.size}#o(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new ELe(this)}get serializable(){if(this.#t.size===0)return kQ;const t=new Map,o=new SLe,i=[],a=Object.create(null);let l=!1;for(const[d,c]of this.#t){const p=c instanceof or?c.serialize(!1,a):c;p&&(t.set(d,p),o.update(`${d}:${JSON.stringify(p)}`),l||=!!p.bitmap)}if(l)for(const d of t.values())d.bitmap&&i.push(d.bitmap);return t.size>0?{map:t,hash:o.hexdigest(),transfer:i}:kQ}get editorStats(){let t=null;const o=new Map;for(const i of this.#t.values()){if(!(i instanceof or))continue;const a=i.telemetryFinalData;if(!a)continue;const{type:l}=a;o.has(l)||o.set(l,Object.getPrototypeOf(i).constructor),t||=Object.create(null);const d=t[l]||=new Map;for(const[c,p]of Object.entries(a)){if(c==="type")continue;let u=d.get(c);u||(u=new Map,d.set(c,u));const h=u.get(p)??0;u.set(p,h+1)}}for(const[i,a]of o)t[i]=a.computeTelemetryFinalData(t[i]);return t}}class ELe extends uK{#e;constructor(t){super();const{map:o,hash:i,transfer:a}=t.serializable,l=structuredClone(o,a?{transfer:a}:null);this.#e={map:l,hash:i,transfer:a}}get print(){zi("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}}class Ejt{#e=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:o=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const o=this.styleElement.sheet;o.insertRule(t,o.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,_inspectFont:o}){if(!(!t||this.#e.has(t.loadedName))){if(Ba(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:a,style:l}=t,d=new FontFace(i,a,l);this.addNativeFontFace(d);try{await d.load(),this.#e.add(i),o?.(t)}catch{Br(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(d)}return}zi("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const i=t.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(a){throw Br(`Failed to load font '${i.family}': '${a}'.`),t.disableFontFace=!0,a}}return}const o=t.createFontFaceRule();if(o){if(this.insertRule(o),this.isSyncFontLoadingSupported)return;await new Promise(i=>{const a=this._queueLoadingCallback(i);this._prepareFontLoadEvent(t,a)})}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return si(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(Zs||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),si(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){function o(){for(Ba(!a.done,"completeRequest() cannot be called twice."),a.done=!0;i.length>0&&i[0].done;){const l=i.shift();setTimeout(l.callback,0)}}const{loadingRequests:i}=this,a={done:!1,complete:o,callback:t};return i.push(a),a}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return si(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,o){function i(E,I){return E.charCodeAt(I)<<24|E.charCodeAt(I+1)<<16|E.charCodeAt(I+2)<<8|E.charCodeAt(I+3)&255}function a(E,I,L,B){const P=E.substring(0,I),D=E.substring(I+L);return P+B+D}let l,d;const c=this._document.createElement("canvas");c.width=1,c.height=1;const p=c.getContext("2d");let u=0;function h(E,I){if(++u>30){Br("Load test font never loaded."),I();return}if(p.font="30px "+E,p.fillText(".",0,20),p.getImageData(0,0,1,1).data[3]>0){I();return}setTimeout(h.bind(null,E,I))}const m=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=a(f,976,m.length,m);const y=16,w=1482184792;let b=i(f,y);for(l=0,d=m.length-3;l<d;l+=4)b=b-w+i(m,l)|0;l<m.length&&(b=b-w+i(m+"XXX",l)|0),f=a(f,y,4,cjt(b));const v=`url(data:font/opentype;base64,${btoa(f)});`,A=`@font-face {font-family:"${m}";src:${v}}`;this.insertRule(A);const S=this._document.createElement("div");S.style.visibility="hidden",S.style.width=S.style.height="10px",S.style.position="absolute",S.style.top=S.style.left="0px";for(const E of[t.loadedName,m]){const I=this._document.createElement("span");I.textContent="Hi",I.style.fontFamily=E,S.append(I)}this._document.body.append(S),h(m,()=>{S.remove(),o.complete()})}}class Ljt{constructor(t,{disableFontFace:o=!1,inspectFont:i=null}){this.compiledGlyphs=Object.create(null);for(const a in t)this[a]=t[a];this.disableFontFace=o===!0,this._inspectFont=i}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const o={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(o.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,o)}return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=bLe(this.data),o=`url(data:${this.mimetype};base64,${btoa(t)});`;let i;if(!this.cssFontInfo)i=`@font-face {font-family:"${this.loadedName}";src:${o}}`;else{let a=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(a+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${a}src:${o}}`}return this._inspectFont?.(this,o),i}getPathGenerator(t,o){if(this.compiledGlyphs[o]!==void 0)return this.compiledGlyphs[o];let i;try{i=t.get(this.loadedName+"_path_"+o)}catch(l){Br(`getPathGenerator - ignoring character: "${l}".`)}if(!Array.isArray(i)||i.length===0)return this.compiledGlyphs[o]=function(l,d){};const a=[];for(let l=0,d=i.length;l<d;)switch(i[l++]){case Nh.BEZIER_CURVE_TO:{const[c,p,u,h,m,f]=i.slice(l,l+6);a.push(x=>x.bezierCurveTo(c,p,u,h,m,f)),l+=6}break;case Nh.MOVE_TO:{const[c,p]=i.slice(l,l+2);a.push(u=>u.moveTo(c,p)),l+=2}break;case Nh.LINE_TO:{const[c,p]=i.slice(l,l+2);a.push(u=>u.lineTo(c,p)),l+=2}break;case Nh.QUADRATIC_CURVE_TO:{const[c,p,u,h]=i.slice(l,l+4);a.push(m=>m.quadraticCurveTo(c,p,u,h)),l+=4}break;case Nh.RESTORE:a.push(c=>c.restore());break;case Nh.SAVE:a.push(c=>c.save());break;case Nh.SCALE:Ba(a.length===2,"Scale command is only valid at the third position.");break;case Nh.TRANSFORM:{const[c,p,u,h,m,f]=i.slice(l,l+6);a.push(x=>x.transform(c,p,u,h,m,f)),l+=6}break;case Nh.TRANSLATE:{const[c,p]=i.slice(l,l+2);a.push(u=>u.translate(c,p)),l+=2}break}return this.compiledGlyphs[o]=function(d,c){a[0](d),a[1](d),d.scale(c,-c);for(let p=2,u=a.length;p<u;p++)a[p](d)}}}if(Zs){var SQ=Promise.withResolvers(),EQ=null;(async()=>{const t=await n4(()=>import("./empty-BN27BaBf.js").then(c=>c.e),__vite__mapDeps([0,1,2])),o=await n4(()=>import("./index-DgyFn3oa.js").then(c=>c.i),__vite__mapDeps([3,1,4,5,6,7,8,9])),i=await n4(()=>import("./index-DwVLoI7i.js").then(c=>c.i),__vite__mapDeps([10,1,11,4,5,6,7,8,9])),a=await n4(()=>import("./url-C9Fwu8i4.js").then(c=>c.u),__vite__mapDeps([12,1,9,7,5,6,8]));let l,d;return new Map(Object.entries({fs:t,http:o,https:i,url:a,canvas:l,path2d:d}))})().then(t=>{EQ=t,SQ.resolve()},t=>{Br(`loadPackages: ${t}`),EQ=new Map,SQ.resolve()})}class sh{static get promise(){return SQ.promise}static get(t){return EQ?.get(t)}}const LLe=function(e){return sh.get("fs").promises.readFile(e).then(o=>new Uint8Array(o))};class jjt extends hj{}class Ijt extends mj{_createCanvas(t,o){return sh.get("canvas").createCanvas(t,o)}}class Mjt extends gj{_fetchData(t,o){return LLe(t).then(i=>({cMapData:i,compressionType:o}))}}class Bjt extends fj{_fetchData(t){return LLe(t)}}const Cl={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function LQ(e,t){if(!t)return;const o=t[2]-t[0],i=t[3]-t[1],a=new Path2D;a.rect(t[0],t[1],o,i),e.clip(a)}class jb{constructor(){this.constructor===jb&&zi("Cannot initialize BaseShadingPattern.")}getPattern(){zi("Abstract method `getPattern` called.")}}class Pjt extends jb{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let o;this._type==="axial"?o=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(o=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)o.addColorStop(i[0],i[1]);return o}getPattern(t,o,i,a){let l;if(a===Cl.STROKE||a===Cl.FILL){const d=o.current.getClippedPathBoundingBox(a,An(t))||[0,0,0,0],c=Math.ceil(d[2]-d[0])||1,p=Math.ceil(d[3]-d[1])||1,u=o.cachedCanvases.getCanvas("pattern",c,p,!0),h=u.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-d[0],-d[1]),i=So.transform(i,[1,0,0,1,d[0],d[1]]),h.transform(...o.baseTransform),this.matrix&&h.transform(...this.matrix),LQ(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),l=t.createPattern(u.canvas,"no-repeat");const m=new DOMMatrix(i);l.setTransform(m)}else LQ(t,this._bbox),l=this._createGradient(t);return l}}function IO(e,t,o,i,a,l,d,c){const p=t.coords,u=t.colors,h=e.data,m=e.width*4;let f;p[o+1]>p[i+1]&&(f=o,o=i,i=f,f=l,l=d,d=f),p[i+1]>p[a+1]&&(f=i,i=a,a=f,f=d,d=c,c=f),p[o+1]>p[i+1]&&(f=o,o=i,i=f,f=l,l=d,d=f);const x=(p[o]+t.offsetX)*t.scaleX,y=(p[o+1]+t.offsetY)*t.scaleY,w=(p[i]+t.offsetX)*t.scaleX,b=(p[i+1]+t.offsetY)*t.scaleY,v=(p[a]+t.offsetX)*t.scaleX,A=(p[a+1]+t.offsetY)*t.scaleY;if(y>=A)return;const S=u[l],E=u[l+1],I=u[l+2],L=u[d],B=u[d+1],P=u[d+2],D=u[c],T=u[c+1],O=u[c+2],F=Math.round(y),Y=Math.round(A);let Z,R,U,_,N,z,H,ee;for(let K=F;K<=Y;K++){if(K<b){const xe=K<y?0:(y-K)/(y-b);Z=x-(x-w)*xe,R=S-(S-L)*xe,U=E-(E-B)*xe,_=I-(I-P)*xe}else{let xe;K>A?xe=1:b===A?xe=0:xe=(b-K)/(b-A),Z=w-(w-v)*xe,R=L-(L-D)*xe,U=B-(B-T)*xe,_=P-(P-O)*xe}let G;K<y?G=0:K>A?G=1:G=(y-K)/(y-A),N=x-(x-v)*G,z=S-(S-D)*G,H=E-(E-T)*G,ee=I-(I-O)*G;const J=Math.round(Math.min(Z,N)),X=Math.round(Math.max(Z,N));let le=m*K+J*4;for(let xe=J;xe<=X;xe++)G=(Z-xe)/(Z-N),G<0?G=0:G>1&&(G=1),h[le++]=R-(R-z)*G|0,h[le++]=U-(U-H)*G|0,h[le++]=_-(_-ee)*G|0,h[le++]=255}}function Djt(e,t,o){const i=t.coords,a=t.colors;let l,d;switch(t.type){case"lattice":const c=t.verticesPerRow,p=Math.floor(i.length/c)-1,u=c-1;for(l=0;l<p;l++){let h=l*c;for(let m=0;m<u;m++,h++)IO(e,o,i[h],i[h+1],i[h+c],a[h],a[h+1],a[h+c]),IO(e,o,i[h+c+1],i[h+1],i[h+c],a[h+c+1],a[h+1],a[h+c])}break;case"triangles":for(l=0,d=i.length;l<d;l+=3)IO(e,o,i[l],i[l+1],i[l+2],a[l],a[l+1],a[l+2]);break;default:throw new Error("illegal figure")}}class Tjt extends jb{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,o,i){const c=Math.floor(this._bounds[0]),p=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-c,h=Math.ceil(this._bounds[3])-p,m=Math.min(Math.ceil(Math.abs(u*t[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(h*t[1]*1.1)),3e3),x=u/m,y=h/f,w={coords:this._coords,colors:this._colors,offsetX:-c,offsetY:-p,scaleX:1/x,scaleY:1/y},b=m+4,v=f+4,A=i.getCanvas("mesh",b,v,!1),S=A.context,E=S.createImageData(m,f);if(o){const L=E.data;for(let B=0,P=L.length;B<P;B+=4)L[B]=o[0],L[B+1]=o[1],L[B+2]=o[2],L[B+3]=255}for(const L of this._figures)Djt(E,L,w);return S.putImageData(E,2,2),{canvas:A.canvas,offsetX:c-2*x,offsetY:p-2*y,scaleX:x,scaleY:y}}getPattern(t,o,i,a){LQ(t,this._bbox);let l;if(a===Cl.SHADING)l=So.singularValueDecompose2dScale(An(t));else if(l=So.singularValueDecompose2dScale(o.baseTransform),this.matrix){const c=So.singularValueDecompose2dScale(this.matrix);l=[l[0]*c[0],l[1]*c[1]]}const d=this._createMeshCanvas(l,a===Cl.SHADING?null:this._background,o.cachedCanvases);return a!==Cl.SHADING&&(t.setTransform(...o.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(d.offsetX,d.offsetY),t.scale(d.scaleX,d.scaleY),t.createPattern(d.canvas,"no-repeat")}}class zjt extends jb{getPattern(){return"hotpink"}}function Rjt(e){switch(e[0]){case"RadialAxial":return new Pjt(e);case"Mesh":return new Tjt(e);case"Dummy":return new zjt}throw new Error(`Unknown IR type: ${e[0]}`)}const Fpe={COLORED:1,UNCOLORED:2};class hK{static MAX_PATTERN_SIZE=3e3;constructor(t,o,i,a,l){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=o,this.ctx=i,this.canvasGraphicsFactory=a,this.baseTransform=l}createPatternCanvas(t){const o=this.operatorList,i=this.bbox,a=this.xstep,l=this.ystep,d=this.paintType,c=this.tilingType,p=this.color,u=this.canvasGraphicsFactory;cj("TilingType: "+c);const h=i[0],m=i[1],f=i[2],x=i[3],y=So.singularValueDecompose2dScale(this.matrix),w=So.singularValueDecompose2dScale(this.baseTransform),b=[y[0]*w[0],y[1]*w[1]],v=this.getSizeAndScale(a,this.ctx.canvas.width,b[0]),A=this.getSizeAndScale(l,this.ctx.canvas.height,b[1]),S=t.cachedCanvases.getCanvas("pattern",v.size,A.size,!0),E=S.context,I=u.createCanvasGraphics(E);I.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(I,d,p);let L=h,B=m,P=f,D=x;return h<0&&(L=0,P+=Math.abs(h)),m<0&&(B=0,D+=Math.abs(m)),E.translate(-(v.scale*L),-(A.scale*B)),I.transform(v.scale,0,0,A.scale,0,0),E.save(),this.clipBbox(I,L,B,P,D),I.baseTransform=An(I.ctx),I.executeOperatorList(o),I.endDrawing(),{canvas:S.canvas,scaleX:v.scale,scaleY:A.scale,offsetX:L,offsetY:B}}getSizeAndScale(t,o,i){t=Math.abs(t);const a=Math.max(hK.MAX_PATTERN_SIZE,o);let l=Math.ceil(t*i);return l>=a?l=a:i=l/t,{scale:i,size:l}}clipBbox(t,o,i,a,l){const d=a-o,c=l-i;t.ctx.rect(o,i,d,c),t.current.updateRectMinMax(An(t.ctx),[o,i,a,l]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,o,i){const a=t.ctx,l=t.current;switch(o){case Fpe.COLORED:const d=this.ctx;a.fillStyle=d.fillStyle,a.strokeStyle=d.strokeStyle,l.fillColor=d.fillStyle,l.strokeColor=d.strokeStyle;break;case Fpe.UNCOLORED:const c=So.makeHexColor(i[0],i[1],i[2]);a.fillStyle=c,a.strokeStyle=c,l.fillColor=c,l.strokeColor=c;break;default:throw new djt(`Unsupported paint type: ${o}`)}}getPattern(t,o,i,a){let l=i;a!==Cl.SHADING&&(l=So.transform(l,o.baseTransform),this.matrix&&(l=So.transform(l,this.matrix)));const d=this.createPatternCanvas(o);let c=new DOMMatrix(l);c=c.translate(d.offsetX,d.offsetY),c=c.scale(1/d.scaleX,1/d.scaleY);const p=t.createPattern(d.canvas,"repeat");return p.setTransform(c),p}}function Fjt({src:e,srcPos:t=0,dest:o,width:i,height:a,nonBlackColor:l=4294967295,inverseDecode:d=!1}){const c=sd.isLittleEndian?4278190080:255,[p,u]=d?[l,c]:[c,l],h=i>>3,m=i&7,f=e.length;o=new Uint32Array(o.buffer);let x=0;for(let y=0;y<a;y++){for(const b=t+h;t<b;t++){const v=t<f?e[t]:255;o[x++]=v&128?u:p,o[x++]=v&64?u:p,o[x++]=v&32?u:p,o[x++]=v&16?u:p,o[x++]=v&8?u:p,o[x++]=v&4?u:p,o[x++]=v&2?u:p,o[x++]=v&1?u:p}if(m===0)continue;const w=t<f?e[t++]:255;for(let b=0;b<m;b++)o[x++]=w&1<<7-b?u:p}return{srcPos:t,destPos:x}}const Ope=16,Npe=100,Ojt=15,Hpe=10,_pe=1e3,Xl=16;function Njt(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(i,a){t.translate(i,a),this.__originalTranslate(i,a)},e.scale=function(i,a){t.scale(i,a),this.__originalScale(i,a)},e.transform=function(i,a,l,d,c,p){t.transform(i,a,l,d,c,p),this.__originalTransform(i,a,l,d,c,p)},e.setTransform=function(i,a,l,d,c,p){t.setTransform(i,a,l,d,c,p),this.__originalSetTransform(i,a,l,d,c,p)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(i){t.rotate(i),this.__originalRotate(i)},e.clip=function(i){t.clip(i),this.__originalClip(i)},e.moveTo=function(o,i){t.moveTo(o,i),this.__originalMoveTo(o,i)},e.lineTo=function(o,i){t.lineTo(o,i),this.__originalLineTo(o,i)},e.bezierCurveTo=function(o,i,a,l,d,c){t.bezierCurveTo(o,i,a,l,d,c),this.__originalBezierCurveTo(o,i,a,l,d,c)},e.rect=function(o,i,a,l){t.rect(o,i,a,l),this.__originalRect(o,i,a,l)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class Hjt{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,o,i){let a;return this.cache[t]!==void 0?(a=this.cache[t],this.canvasFactory.reset(a,o,i)):(a=this.canvasFactory.create(o,i),this.cache[t]=a),a}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const o=this.cache[t];this.canvasFactory.destroy(o),delete this.cache[t]}}}function EC(e,t,o,i,a,l,d,c,p,u){const[h,m,f,x,y,w]=An(e);if(m===0&&f===0){const A=d*h+y,S=Math.round(A),E=c*x+w,I=Math.round(E),L=(d+p)*h+y,B=Math.abs(Math.round(L)-S)||1,P=(c+u)*x+w,D=Math.abs(Math.round(P)-I)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(x),S,I),e.drawImage(t,o,i,a,l,0,0,B,D),e.setTransform(h,m,f,x,y,w),[B,D]}if(h===0&&x===0){const A=c*f+y,S=Math.round(A),E=d*m+w,I=Math.round(E),L=(c+u)*f+y,B=Math.abs(Math.round(L)-S)||1,P=(d+p)*m+w,D=Math.abs(Math.round(P)-I)||1;return e.setTransform(0,Math.sign(m),Math.sign(f),0,S,I),e.drawImage(t,o,i,a,l,0,0,D,B),e.setTransform(h,m,f,x,y,w),[D,B]}e.drawImage(t,o,i,a,l,d,c,p,u);const b=Math.hypot(h,m),v=Math.hypot(f,x);return[b*p,v*u]}function _jt(e){const{width:t,height:o}=e;if(t>_pe||o>_pe)return null;const i=1e3,a=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),l=t+1;let d=new Uint8Array(l*(o+1)),c,p,u;const h=t+7&-8;let m=new Uint8Array(h*o),f=0;for(const v of e.data){let A=128;for(;A>0;)m[f++]=v&A?0:255,A>>=1}let x=0;for(f=0,m[f]!==0&&(d[0]=1,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(d[p]=m[f]?2:1,++x),f++;for(m[f]!==0&&(d[p]=2,++x),c=1;c<o;c++){f=c*h,u=c*l,m[f-h]!==m[f]&&(d[u]=m[f]?1:8,++x);let v=(m[f]?4:0)+(m[f-h]?8:0);for(p=1;p<t;p++)v=(v>>2)+(m[f+1]?4:0)+(m[f-h+1]?8:0),a[v]&&(d[u+p]=a[v],++x),f++;if(m[f-h]!==m[f]&&(d[u+p]=m[f]?2:4,++x),x>i)return null}for(f=h*(o-1),u=c*l,m[f]!==0&&(d[u]=8,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(d[u+p]=m[f]?4:8,++x),f++;if(m[f]!==0&&(d[u+p]=4,++x),x>i)return null;const y=new Int32Array([0,l,-1,0,-l,0,0,0,1]),w=new Path2D;for(c=0;x&&c<=o;c++){let v=c*l;const A=v+t;for(;v<A&&!d[v];)v++;if(v===A)continue;w.moveTo(v%l,c);const S=v;let E=d[v];do{const I=y[E];do v+=I;while(!d[v]);const L=d[v];L!==5&&L!==10?(E=L,d[v]=0):(E=L&51*E>>4,d[v]&=E>>2|E<<2),w.lineTo(v%l,v/l|0),d[v]||--x}while(S!==v);--c}return m=null,d=null,function(v){v.save(),v.scale(1/t,-1/o),v.translate(0,-o),v.fill(w),v.beginPath(),v.restore()}}class Vpe{constructor(t,o){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=yLe,this.textMatrixScale=1,this.fontMatrix=vQ,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=Vs.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,o])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,o){this.x=t,this.y=o}updatePathMinMax(t,o,i){[o,i]=So.applyTransform([o,i],t),this.minX=Math.min(this.minX,o),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,o),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,o){const i=So.applyTransform(o,t),a=So.applyTransform(o.slice(2),t),l=So.applyTransform([o[0],o[3]],t),d=So.applyTransform([o[2],o[1]],t);this.minX=Math.min(this.minX,i[0],a[0],l[0],d[0]),this.minY=Math.min(this.minY,i[1],a[1],l[1],d[1]),this.maxX=Math.max(this.maxX,i[0],a[0],l[0],d[0]),this.maxY=Math.max(this.maxY,i[1],a[1],l[1],d[1])}updateScalingPathMinMax(t,o){So.scaleMinMax(t,o),this.minX=Math.min(this.minX,o[0]),this.minY=Math.min(this.minY,o[1]),this.maxX=Math.max(this.maxX,o[2]),this.maxY=Math.max(this.maxY,o[3])}updateCurvePathMinMax(t,o,i,a,l,d,c,p,u,h){const m=So.bezierBoundingBox(o,i,a,l,d,c,p,u,h);h||this.updateRectMinMax(t,m)}getPathBoundingBox(t=Cl.FILL,o=null){const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===Cl.STROKE){o||zi("Stroke bounding box must include transform.");const a=So.singularValueDecompose2dScale(o),l=a[0]*this.lineWidth/2,d=a[1]*this.lineWidth/2;i[0]-=l,i[1]-=d,i[2]+=l,i[3]+=d}return i}updateClipFromPath(){const t=So.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(t=Cl.FILL,o=null){return So.intersect(this.clipBox,this.getPathBoundingBox(t,o))}}function Qpe(e,t){if(typeof ImageData<"u"&&t instanceof ImageData){e.putImageData(t,0,0);return}const o=t.height,i=t.width,a=o%Xl,l=(o-a)/Xl,d=a===0?l:l+1,c=e.createImageData(i,Xl);let p=0,u;const h=t.data,m=c.data;let f,x,y,w;if(t.kind===q$.GRAYSCALE_1BPP){const b=h.byteLength,v=new Uint32Array(m.buffer,0,m.byteLength>>2),A=v.length,S=i+7>>3,E=4294967295,I=sd.isLittleEndian?4278190080:255;for(f=0;f<d;f++){for(y=f<l?Xl:a,u=0,x=0;x<y;x++){const L=b-p;let B=0;const P=L>S?i:L*8-7,D=P&-8;let T=0,O=0;for(;B<D;B+=8)O=h[p++],v[u++]=O&128?E:I,v[u++]=O&64?E:I,v[u++]=O&32?E:I,v[u++]=O&16?E:I,v[u++]=O&8?E:I,v[u++]=O&4?E:I,v[u++]=O&2?E:I,v[u++]=O&1?E:I;for(;B<P;B++)T===0&&(O=h[p++],T=128),v[u++]=O&T?E:I,T>>=1}for(;u<A;)v[u++]=0;e.putImageData(c,0,f*Xl)}}else if(t.kind===q$.RGBA_32BPP){for(x=0,w=i*Xl*4,f=0;f<l;f++)m.set(h.subarray(p,p+w)),p+=w,e.putImageData(c,0,x),x+=Xl;f<d&&(w=i*a*4,m.set(h.subarray(p,p+w)),e.putImageData(c,0,x))}else if(t.kind===q$.RGB_24BPP)for(y=Xl,w=i*y,f=0;f<d;f++){for(f>=l&&(y=a,w=i*y),u=0,x=w;x--;)m[u++]=h[p++],m[u++]=h[p++],m[u++]=h[p++],m[u++]=255;e.putImageData(c,0,f*Xl)}else throw new Error(`bad image kind: ${t.kind}`)}function Upe(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}const o=t.height,i=t.width,a=o%Xl,l=(o-a)/Xl,d=a===0?l:l+1,c=e.createImageData(i,Xl);let p=0;const u=t.data,h=c.data;for(let m=0;m<d;m++){const f=m<l?Xl:a;({srcPos:p}=Fjt({src:u,srcPos:p,dest:h,width:i,height:f,nonBlackColor:0})),e.putImageData(c,0,m*Xl)}}function W9(e,t){const o=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of o)e[i]!==void 0&&(t[i]=e[i]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function LC(e){if(e.strokeStyle=e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",e.setLineDash!==void 0&&(e.setLineDash([]),e.lineDashOffset=0),!Zs){const{filter:t}=e;t!=="none"&&t!==""&&(e.filter="none")}}function Wpe(e,t){if(t)return!0;const o=So.singularValueDecompose2dScale(e);o[0]=Math.fround(o[0]),o[1]=Math.fround(o[1]);const i=Math.fround((globalThis.devicePixelRatio||1)*k6.PDF_TO_CSS_UNITS);return o[0]<=i&&o[1]<=i}const Vjt=["butt","round","square"],Qjt=["miter","round","bevel"],Ujt={},Gpe={};class W7{constructor(t,o,i,a,l,{optionalContentConfig:d,markedContentStack:c=null},p,u){this.ctx=t,this.current=new Vpe(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=o,this.objs=i,this.canvasFactory=a,this.filterFactory=l,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=c||[],this.optionalContentConfig=d,this.cachedCanvases=new Hjt(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=p,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=u,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,o=null){return typeof t=="string"?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):o}beginDrawing({transform:t,viewport:o,transparency:i=!1,background:a=null}){const l=this.ctx.canvas.width,d=this.ctx.canvas.height,c=this.ctx.fillStyle;if(this.ctx.fillStyle=a||"#ffffff",this.ctx.fillRect(0,0,l,d),this.ctx.fillStyle=c,i){const p=this.cachedCanvases.getCanvas("transparent",l,d);this.compositeCtx=this.ctx,this.transparentCanvas=p.canvas,this.ctx=p.context,this.ctx.save(),this.ctx.transform(...An(this.compositeCtx))}this.ctx.save(),LC(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...o.transform),this.viewportScale=o.scale,this.baseTransform=An(this.ctx)}executeOperatorList(t,o,i,a){const l=t.argsArray,d=t.fnArray;let c=o||0;const p=l.length;if(p===c)return c;const u=p-c>Hpe&&typeof i=="function",h=u?Date.now()+Ojt:0;let m=0;const f=this.commonObjs,x=this.objs;let y;for(;;){if(a!==void 0&&c===a.nextBreakPoint)return a.breakIt(c,i),c;if(y=d[c],y!==j1.dependency)this[y].apply(this,l[c]);else for(const w of l[c]){const b=w.startsWith("g_")?f:x;if(!b.has(w))return b.get(w,i),c}if(c++,c===p)return c;if(u&&++m>Hpe){if(Date.now()>h)return i(),c;m=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const o of t.values())typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement&&(o.width=o.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const o=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=o}}}_scaleImage(t,o){const i=t.width,a=t.height;let l=Math.max(Math.hypot(o[0],o[1]),1),d=Math.max(Math.hypot(o[2],o[3]),1),c=i,p=a,u="prescale1",h,m;for(;l>2&&c>1||d>2&&p>1;){let f=c,x=p;l>2&&c>1&&(f=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c/2),l/=c/f),d>2&&p>1&&(x=p>=16384?Math.floor(p/2)-1||1:Math.ceil(p)/2,d/=p/x),h=this.cachedCanvases.getCanvas(u,f,x),m=h.context,m.clearRect(0,0,f,x),m.drawImage(t,0,0,c,p,0,0,f,x),t=h.canvas,c=f,p=x,u=u==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:c,paintHeight:p}}_createMaskCanvas(t){const o=this.ctx,{width:i,height:a}=t,l=this.current.fillColor,d=this.current.patternFill,c=An(o);let p,u,h,m;if((t.bitmap||t.data)&&t.count>1){const P=t.bitmap||t.data.buffer;u=JSON.stringify(d?c:[c.slice(0,4),l]),p=this._cachedBitmapsMap.get(P),p||(p=new Map,this._cachedBitmapsMap.set(P,p));const D=p.get(u);if(D&&!d){const T=Math.round(Math.min(c[0],c[2])+c[4]),O=Math.round(Math.min(c[1],c[3])+c[5]);return{canvas:D,offsetX:T,offsetY:O}}h=D}h||(m=this.cachedCanvases.getCanvas("maskCanvas",i,a),Upe(m.context,t));let f=So.transform(c,[1/i,0,0,-1/a,0,0]);f=So.transform(f,[1,0,0,1,0,-a]);const[x,y,w,b]=So.getAxialAlignedBoundingBox([0,0,i,a],f),v=Math.round(w-x)||1,A=Math.round(b-y)||1,S=this.cachedCanvases.getCanvas("fillCanvas",v,A),E=S.context,I=x,L=y;E.translate(-I,-L),E.transform(...f),h||(h=this._scaleImage(m.canvas,Hh(E)),h=h.img,p&&d&&p.set(u,h)),E.imageSmoothingEnabled=Wpe(An(E),t.interpolate),EC(E,h,0,0,h.width,h.height,0,0,i,a),E.globalCompositeOperation="source-in";const B=So.transform(Hh(E),[1,0,0,1,-I,-L]);return E.fillStyle=d?l.getPattern(o,this,B,Cl.FILL):l,E.fillRect(0,0,i,a),p&&!d&&(this.cachedCanvases.delete("fillCanvas"),p.set(u,S.canvas)),{canvas:S.canvas,offsetX:Math.round(I),offsetY:Math.round(L)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=Vjt[t]}setLineJoin(t){this.ctx.lineJoin=Qjt[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,o){const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(t),i.lineDashOffset=o)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[o,i]of t)switch(o){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,o=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(i,t,o);this.suspendedCtx=this.ctx,this.ctx=a.context;const l=this.ctx;l.setTransform(...An(this.suspendedCtx)),W9(this.suspendedCtx,l),Njt(l,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(),W9(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const o=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,o,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,o,i,a){const l=a[0],d=a[1],c=a[2]-l,p=a[3]-d;c===0||p===0||(this.genericComposeSMask(o.context,i,c,p,o.subtype,o.backdrop,o.transferMap,l,d,o.offsetX,o.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,o,i,a,l,d,c,p,u,h,m){let f=t.canvas,x=p-h,y=u-m;if(d){if(x<0||y<0||x+i>f.width||y+a>f.height){const b=this.cachedCanvases.getCanvas("maskExtension",i,a),v=b.context;v.drawImage(f,-x,-y),d.some(A=>A!==0)&&(v.globalCompositeOperation="destination-atop",v.fillStyle=So.makeHexColor(...d),v.fillRect(0,0,i,a),v.globalCompositeOperation="source-over"),f=b.canvas,x=y=0}else if(d.some(b=>b!==0)){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const b=new Path2D;b.rect(x,y,i,a),t.clip(b),t.globalCompositeOperation="destination-atop",t.fillStyle=So.makeHexColor(...d),t.fillRect(x,y,i,a),t.restore()}}o.save(),o.globalAlpha=1,o.setTransform(1,0,0,1,0,0),l==="Alpha"&&c?o.filter=this.filterFactory.addAlphaFilter(c):l==="Luminosity"&&(o.filter=this.filterFactory.addLuminosityFilter(c));const w=new Path2D;w.rect(p,u,i,a),o.clip(w),o.globalCompositeOperation="destination-in",o.drawImage(f,x,y,i,a,p,u,i,a),o.restore()}save(){this.inSMaskMode?(W9(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),W9(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,o,i,a,l,d){this.ctx.transform(t,o,i,a,l,d),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,o,i){const a=this.ctx,l=this.current;let d=l.x,c=l.y,p,u;const h=An(a),m=h[0]===0&&h[3]===0||h[1]===0&&h[2]===0,f=m?i.slice(0):null;for(let x=0,y=0,w=t.length;x<w;x++)switch(t[x]|0){case j1.rectangle:d=o[y++],c=o[y++];const b=o[y++],v=o[y++],A=d+b,S=c+v;a.moveTo(d,c),b===0||v===0?a.lineTo(A,S):(a.lineTo(A,c),a.lineTo(A,S),a.lineTo(d,S)),m||l.updateRectMinMax(h,[d,c,A,S]),a.closePath();break;case j1.moveTo:d=o[y++],c=o[y++],a.moveTo(d,c),m||l.updatePathMinMax(h,d,c);break;case j1.lineTo:d=o[y++],c=o[y++],a.lineTo(d,c),m||l.updatePathMinMax(h,d,c);break;case j1.curveTo:p=d,u=c,d=o[y+4],c=o[y+5],a.bezierCurveTo(o[y],o[y+1],o[y+2],o[y+3],d,c),l.updateCurvePathMinMax(h,p,u,o[y],o[y+1],o[y+2],o[y+3],d,c,f),y+=6;break;case j1.curveTo2:p=d,u=c,a.bezierCurveTo(d,c,o[y],o[y+1],o[y+2],o[y+3]),l.updateCurvePathMinMax(h,p,u,d,c,o[y],o[y+1],o[y+2],o[y+3],f),d=o[y+2],c=o[y+3],y+=4;break;case j1.curveTo3:p=d,u=c,d=o[y+2],c=o[y+3],a.bezierCurveTo(o[y],o[y+1],d,c,d,c),l.updateCurvePathMinMax(h,p,u,o[y],o[y+1],d,c,d,c,f),y+=4;break;case j1.closePath:a.closePath();break}m&&l.updateScalingPathMinMax(h,f),l.setCurrentPoint(d,c)}closePath(){this.ctx.closePath()}stroke(t=!0){const o=this.ctx,i=this.current.strokeColor;o.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof i=="object"&&i?.getPattern?(o.save(),o.strokeStyle=i.getPattern(o,this,Hh(o),Cl.STROKE),this.rescaleAndStroke(!1),o.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),o.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){const o=this.ctx,i=this.current.fillColor,a=this.current.patternFill;let l=!1;a&&(o.save(),o.fillStyle=i.getPattern(o,this,Hh(o),Cl.FILL),l=!0);const d=this.current.getClippedPathBoundingBox();this.contentVisible&&d!==null&&(this.pendingEOFill?(o.fill("evenodd"),this.pendingEOFill=!1):o.fill()),l&&o.restore(),t&&this.consumePath(d)}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=Ujt}eoClip(){this.pendingClip=Gpe}beginText(){this.current.textMatrix=yLe,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,o=this.ctx;if(t===void 0){o.beginPath();return}o.save(),o.beginPath();for(const i of t)o.setTransform(...i.transform),o.translate(i.x,i.y),i.addToPath(o,i.fontSize);o.restore(),o.clip(),o.beginPath(),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,o){const i=this.commonObjs.get(t),a=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(a.fontMatrix=i.fontMatrix||vQ,(a.fontMatrix[0]===0||a.fontMatrix[3]===0)&&Br("Invalid font matrix for font "+t),o<0?(o=-o,a.fontDirection=-1):a.fontDirection=1,this.current.font=i,this.current.fontSize=o,i.isType3Font)return;const l=i.loadedName||"sans-serif",d=i.systemFontInfo?.css||`"${l}", ${i.fallbackName}`;let c="normal";i.black?c="900":i.bold&&(c="bold");const p=i.italic?"italic":"normal";let u=o;o<Ope?u=Ope:o>Npe&&(u=Npe),this.current.fontSizeScale=o/u,this.ctx.font=`${p} ${c} ${u}px ${d}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,o){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=o}setLeadingMoveText(t,o){this.setLeading(-o),this.moveText(t,o)}setTextMatrix(t,o,i,a,l,d){this.current.textMatrix=[t,o,i,a,l,d],this.current.textMatrixScale=Math.hypot(t,o),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,o,i,a){const l=this.ctx,d=this.current,c=d.font,p=d.textRenderingMode,u=d.fontSize/d.fontSizeScale,h=p&Vs.FILL_STROKE_MASK,m=!!(p&Vs.ADD_TO_PATH_FLAG),f=d.patternFill&&!c.missingFile;let x;(c.disableFontFace||m||f)&&(x=c.getPathGenerator(this.commonObjs,t)),c.disableFontFace||f?(l.save(),l.translate(o,i),l.beginPath(),x(l,u),a&&l.setTransform(...a),(h===Vs.FILL||h===Vs.FILL_STROKE)&&l.fill(),(h===Vs.STROKE||h===Vs.FILL_STROKE)&&l.stroke(),l.restore()):((h===Vs.FILL||h===Vs.FILL_STROKE)&&l.fillText(t,o,i),(h===Vs.STROKE||h===Vs.FILL_STROKE)&&l.strokeText(t,o,i)),m&&(this.pendingTextPaths||=[]).push({transform:An(l),x:o,y:i,fontSize:u,addToPath:x})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const o=t.getImageData(0,0,10,10).data;let i=!1;for(let a=3;a<o.length;a+=4)if(o[a]>0&&o[a]<255){i=!0;break}return si(this,"isFontSubpixelAAEnabled",i)}showText(t){const o=this.current,i=o.font;if(i.isType3Font)return this.showType3Text(t);const a=o.fontSize;if(a===0)return;const l=this.ctx,d=o.fontSizeScale,c=o.charSpacing,p=o.wordSpacing,u=o.fontDirection,h=o.textHScale*u,m=t.length,f=i.vertical,x=f?1:-1,y=i.defaultVMetrics,w=a*o.fontMatrix[0],b=o.textRenderingMode===Vs.FILL&&!i.disableFontFace&&!o.patternFill;l.save(),l.transform(...o.textMatrix),l.translate(o.x,o.y+o.textRise),u>0?l.scale(h,-1):l.scale(h,1);let v;if(o.patternFill){l.save();const L=o.fillColor.getPattern(l,this,Hh(l),Cl.FILL);v=An(l),l.restore(),l.fillStyle=L}let A=o.lineWidth;const S=o.textMatrixScale;if(S===0||A===0){const L=o.textRenderingMode&Vs.FILL_STROKE_MASK;(L===Vs.STROKE||L===Vs.FILL_STROKE)&&(A=this.getSinglePixelWidth())}else A/=S;if(d!==1&&(l.scale(d,d),A/=d),l.lineWidth=A,i.isInvalidPDFjsFont){const L=[];let B=0;for(const P of t)L.push(P.unicode),B+=P.width;l.fillText(L.join(""),0,0),o.x+=B*w*h,l.restore(),this.compose();return}let E=0,I;for(I=0;I<m;++I){const L=t[I];if(typeof L=="number"){E+=x*L*a/1e3;continue}let B=!1;const P=(L.isSpace?p:0)+c,D=L.fontChar,T=L.accent;let O,F,Y=L.width;if(f){const R=L.vmetric||y,U=-(L.vmetric?R[1]:Y*.5)*w,_=R[2]*w;Y=R?-R[0]:Y,O=U/d,F=(E+_)/d}else O=E/d,F=0;if(i.remeasure&&Y>0){const R=l.measureText(D).width*1e3/a*d;if(Y<R&&this.isFontSubpixelAAEnabled){const U=Y/R;B=!0,l.save(),l.scale(U,1),O/=U}else Y!==R&&(O+=(Y-R)/2e3*a/d)}if(this.contentVisible&&(L.isInFont||i.missingFile)){if(b&&!T)l.fillText(D,O,F);else if(this.paintChar(D,O,F,v),T){const R=O+a*T.offset.x/d,U=F-a*T.offset.y/d;this.paintChar(T.fontChar,R,U,v)}}const Z=f?Y*w-P*u:Y*w+P*u;E+=Z,B&&l.restore()}f?o.y-=E:o.x+=E*h,l.restore(),this.compose()}showType3Text(t){const o=this.ctx,i=this.current,a=i.font,l=i.fontSize,d=i.fontDirection,c=a.vertical?1:-1,p=i.charSpacing,u=i.wordSpacing,h=i.textHScale*d,m=i.fontMatrix||vQ,f=t.length,x=i.textRenderingMode===Vs.INVISIBLE;let y,w,b,v;if(!(x||l===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,o.save(),o.transform(...i.textMatrix),o.translate(i.x,i.y),o.scale(h,d),y=0;y<f;++y){if(w=t[y],typeof w=="number"){v=c*w*l/1e3,this.ctx.translate(v,0),i.x+=v*h;continue}const A=(w.isSpace?u:0)+p,S=a.charProcOperatorList[w.operatorListId];if(!S){Br(`Type3 character "${w.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=w,this.save(),o.scale(l,l),o.transform(...m),this.executeOperatorList(S),this.restore()),b=So.applyTransform([w.width,0],m)[0]*l+A,o.translate(b,0),i.x+=b*h}o.restore(),this.processingType3=null}}setCharWidth(t,o){}setCharWidthAndBounds(t,o,i,a,l,d){this.ctx.rect(i,a,l-i,d-a),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let o;if(t[0]==="TilingPattern"){const i=t[1],a=this.baseTransform||An(this.ctx),l={createCanvasGraphics:d=>new W7(d,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};o=new hK(t,i,this.ctx,l,a)}else o=this._getPattern(t[1],t[2]);return o}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,o,i){const a=So.makeHexColor(t,o,i);this.ctx.strokeStyle=a,this.current.strokeColor=a}setFillRGBColor(t,o,i){const a=So.makeHexColor(t,o,i);this.ctx.fillStyle=a,this.current.fillColor=a,this.current.patternFill=!1}_getPattern(t,o=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=Rjt(this.getObject(t)),this.cachedPatterns.set(t,i)),o&&(i.matrix=o),i}shadingFill(t){if(!this.contentVisible)return;const o=this.ctx;this.save();const i=this._getPattern(t);o.fillStyle=i.getPattern(o,this,Hh(o),Cl.SHADING);const a=Hh(o);if(a){const{width:l,height:d}=o.canvas,[c,p,u,h]=So.getAxialAlignedBoundingBox([0,0,l,d],a);this.ctx.fillRect(c,p,u-c,h-p)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){zi("Should not call beginInlineImage")}beginImageData(){zi("Should not call beginImageData")}paintFormXObjectBegin(t,o){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=An(this.ctx),o)){const i=o[2]-o[0],a=o[3]-o[1];this.ctx.rect(o[0],o[1],i,a),this.current.updateRectMinMax(An(this.ctx),o),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const o=this.ctx;t.isolated||cj("TODO: Support non-isolated groups."),t.knockout&&Br("Knockout groups not supported.");const i=An(o);if(t.matrix&&o.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let a=So.getAxialAlignedBoundingBox(t.bbox,An(o));const l=[0,0,o.canvas.width,o.canvas.height];a=So.intersect(a,l)||[0,0,0,0];const d=Math.floor(a[0]),c=Math.floor(a[1]),p=Math.max(Math.ceil(a[2])-d,1),u=Math.max(Math.ceil(a[3])-c,1);this.current.startNewPathAndClipBox([0,0,p,u]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);const m=this.cachedCanvases.getCanvas(h,p,u),f=m.context;f.translate(-d,-c),f.transform(...i),t.smask?this.smaskStack.push({canvas:m.canvas,context:f,offsetX:d,offsetY:c,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(o.setTransform(1,0,0,1,0,0),o.translate(d,c),o.save()),W9(o,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(o),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const o=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const a=An(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...a);const l=So.getAxialAlignedBoundingBox([0,0,o.canvas.width,o.canvas.height],a);this.ctx.drawImage(o.canvas,0,0),this.ctx.restore(),this.compose(l)}}beginAnnotation(t,o,i,a,l){if(this.#e(),LC(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),o){const d=o[2]-o[0],c=o[3]-o[1];if(l&&this.annotationCanvasMap){i=i.slice(),i[4]-=o[0],i[5]-=o[1],o=o.slice(),o[0]=o[1]=0,o[2]=d,o[3]=c;const[p,u]=So.singularValueDecompose2dScale(An(this.ctx)),{viewportScale:h}=this,m=Math.ceil(d*this.outputScaleX*h),f=Math.ceil(c*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(m,f);const{canvas:x,context:y}=this.annotationCanvas;this.annotationCanvasMap.set(t,x),this.annotationCanvas.savedCtx=this.ctx,this.ctx=y,this.ctx.save(),this.ctx.setTransform(p,0,0,-u,0,c*u),LC(this.ctx)}else LC(this.ctx),this.ctx.rect(o[0],o[1],d,c),this.ctx.clip(),this.endPath()}this.current=new Vpe(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...a)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const o=t.count;t=this.getObject(t.data,t),t.count=o;const i=this.ctx,a=this.processingType3;if(a&&(a.compiled===void 0&&(a.compiled=_jt(t)),a.compiled)){a.compiled(i);return}const l=this._createMaskCanvas(t),d=l.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(d,l.offsetX,l.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,o,i=0,a=0,l,d){if(!this.contentVisible)return;t=this.getObject(t.data,t);const c=this.ctx;c.save();const p=An(c);c.transform(o,i,a,l,0,0);const u=this._createMaskCanvas(t);c.setTransform(1,0,0,1,u.offsetX-p[4],u.offsetY-p[5]);for(let h=0,m=d.length;h<m;h+=2){const f=So.transform(p,[o,i,a,l,d[h],d[h+1]]),[x,y]=So.applyTransform([0,0],f);c.drawImage(u.canvas,x,y)}c.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const o=this.ctx,i=this.current.fillColor,a=this.current.patternFill;for(const l of t){const{data:d,width:c,height:p,transform:u}=l,h=this.cachedCanvases.getCanvas("maskCanvas",c,p),m=h.context;m.save();const f=this.getObject(d,l);Upe(m,f),m.globalCompositeOperation="source-in",m.fillStyle=a?i.getPattern(m,this,Hh(o),Cl.FILL):i,m.fillRect(0,0,c,p),m.restore(),o.save(),o.transform(...u),o.scale(1,-1),EC(o,h.canvas,0,0,c,p,0,-1,1,1),o.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const o=this.getObject(t);if(!o){Br("Dependent image isn't ready yet");return}this.paintInlineImageXObject(o)}paintImageXObjectRepeat(t,o,i,a){if(!this.contentVisible)return;const l=this.getObject(t);if(!l){Br("Dependent image isn't ready yet");return}const d=l.width,c=l.height,p=[];for(let u=0,h=a.length;u<h;u+=2)p.push({transform:[o,0,0,i,a[u],a[u+1]],x:0,y:0,w:d,h:c});this.paintInlineImageXObjectGroup(l,p)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:o,width:i,height:a}=t,l=this.cachedCanvases.getCanvas("inlineImage",i,a),d=l.context;return d.filter=this.current.transferMaps,d.drawImage(o,0,0),d.filter="none",l.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const o=t.width,i=t.height,a=this.ctx;if(this.save(),!Zs){const{filter:c}=a;c!=="none"&&c!==""&&(a.filter="none")}a.scale(1/o,-1/i);let l;if(t.bitmap)l=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)l=t;else{const p=this.cachedCanvases.getCanvas("inlineImage",o,i).context;Qpe(p,t),l=this.applyTransferMapsToCanvas(p)}const d=this._scaleImage(l,Hh(a));a.imageSmoothingEnabled=Wpe(An(a),t.interpolate),EC(a,d.img,0,0,d.paintWidth,d.paintHeight,0,-i,o,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,o){if(!this.contentVisible)return;const i=this.ctx;let a;if(t.bitmap)a=t.bitmap;else{const l=t.width,d=t.height,p=this.cachedCanvases.getCanvas("inlineImage",l,d).context;Qpe(p,t),a=this.applyTransferMapsToCanvas(p)}for(const l of o)i.save(),i.transform(...l.transform),i.scale(1,-1),EC(i,a,l.x,l.y,l.w,l.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,o){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,o){t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(o)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const o=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(o||(this.pendingClip===Gpe?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=An(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const o=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),a=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,a)/o}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:o,b:i,c:a,d:l}=this.ctx.getTransform();let d,c;if(i===0&&a===0){const p=Math.abs(o),u=Math.abs(l);if(p===u)if(t===0)d=c=1/p;else{const h=p*t;d=c=h<1?1/h:1}else if(t===0)d=1/p,c=1/u;else{const h=p*t,m=u*t;d=h<1?1/h:1,c=m<1?1/m:1}}else{const p=Math.abs(o*l-i*a),u=Math.hypot(o,i),h=Math.hypot(a,l);if(t===0)d=h/p,c=u/p;else{const m=t*p;d=h>m?h/m:1,c=u>m?u/m:1}}this._cachedScaleForStroking[0]=d,this._cachedScaleForStroking[1]=c}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:o}=this,{lineWidth:i}=this.current,[a,l]=this.getScaleForStroking();if(o.lineWidth=i||1,a===1&&l===1){o.stroke();return}const d=o.getLineDash();if(t&&o.save(),o.scale(a,l),d.length>0){const c=Math.max(a,l);o.setLineDash(d.map(p=>p/c)),o.lineDashOffset/=c}o.stroke(),t&&o.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const e in j1)W7.prototype[e]!==void 0&&(W7.prototype[j1[e]]=W7.prototype[e]);class vw{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");this.#e=t}static get workerSrc(){return this.#t}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");this.#t=t}}const jC={DATA:1,ERROR:2},sa={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Td(e){switch(e instanceof Error||typeof e=="object"&&e!==null||zi('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new pf(e.message);case"MissingPDFException":return new cf(e.message);case"PasswordException":return new AQ(e.message,e.code);case"UnexpectedResponseException":return new pj(e.message,e.status);case"UnknownErrorException":return new $Q(e.message,e.details);default:return new $Q(e.message,e.toString())}}class Kx{constructor(t,o,i){this.sourceName=t,this.targetName=o,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=a=>{const l=a.data;if(l.targetName!==this.sourceName)return;if(l.stream){this.#t(l);return}if(l.callback){const c=l.callbackId,p=this.callbackCapabilities[c];if(!p)throw new Error(`Cannot resolve callback ${c}`);if(delete this.callbackCapabilities[c],l.callback===jC.DATA)p.resolve(l.data);else if(l.callback===jC.ERROR)p.reject(Td(l.reason));else throw new Error("Unexpected callback case");return}const d=this.actionHandler[l.action];if(!d)throw new Error(`Unknown action from worker: ${l.action}`);if(l.callbackId){const c=this.sourceName,p=l.sourceName;new Promise(function(u){u(d(l.data))}).then(function(u){i.postMessage({sourceName:c,targetName:p,callback:jC.DATA,callbackId:l.callbackId,data:u})},function(u){i.postMessage({sourceName:c,targetName:p,callback:jC.ERROR,callbackId:l.callbackId,reason:Td(u)})});return}if(l.streamId){this.#e(l);return}d(l.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,o){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=o}send(t,o,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:o},i)}sendWithPromise(t,o,i){const a=this.callbackId++,l=Promise.withResolvers();this.callbackCapabilities[a]=l;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:a,data:o},i)}catch(d){l.reject(d)}return l.promise}sendWithStream(t,o,i,a){const l=this.streamId++,d=this.sourceName,c=this.targetName,p=this.comObj;return new ReadableStream({start:u=>{const h=Promise.withResolvers();return this.streamControllers[l]={controller:u,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},p.postMessage({sourceName:d,targetName:c,action:t,streamId:l,data:o,desiredSize:u.desiredSize},a),h.promise},pull:u=>{const h=Promise.withResolvers();return this.streamControllers[l].pullCall=h,p.postMessage({sourceName:d,targetName:c,stream:sa.PULL,streamId:l,desiredSize:u.desiredSize}),h.promise},cancel:u=>{Ba(u instanceof Error,"cancel must have a valid reason");const h=Promise.withResolvers();return this.streamControllers[l].cancelCall=h,this.streamControllers[l].isClosed=!0,p.postMessage({sourceName:d,targetName:c,stream:sa.CANCEL,streamId:l,reason:Td(u)}),h.promise}},i)}#e(t){const o=t.streamId,i=this.sourceName,a=t.sourceName,l=this.comObj,d=this,c=this.actionHandler[t.action],p={enqueue(u,h=1,m){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=h,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),l.postMessage({sourceName:i,targetName:a,stream:sa.ENQUEUE,streamId:o,chunk:u},m)},close(){this.isCancelled||(this.isCancelled=!0,l.postMessage({sourceName:i,targetName:a,stream:sa.CLOSE,streamId:o}),delete d.streamSinks[o])},error(u){Ba(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,l.postMessage({sourceName:i,targetName:a,stream:sa.ERROR,streamId:o,reason:Td(u)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};p.sinkCapability.resolve(),p.ready=p.sinkCapability.promise,this.streamSinks[o]=p,new Promise(function(u){u(c(t.data,p))}).then(function(){l.postMessage({sourceName:i,targetName:a,stream:sa.START_COMPLETE,streamId:o,success:!0})},function(u){l.postMessage({sourceName:i,targetName:a,stream:sa.START_COMPLETE,streamId:o,reason:Td(u)})})}#t(t){const o=t.streamId,i=this.sourceName,a=t.sourceName,l=this.comObj,d=this.streamControllers[o],c=this.streamSinks[o];switch(t.stream){case sa.START_COMPLETE:t.success?d.startCall.resolve():d.startCall.reject(Td(t.reason));break;case sa.PULL_COMPLETE:t.success?d.pullCall.resolve():d.pullCall.reject(Td(t.reason));break;case sa.PULL:if(!c){l.postMessage({sourceName:i,targetName:a,stream:sa.PULL_COMPLETE,streamId:o,success:!0});break}c.desiredSize<=0&&t.desiredSize>0&&c.sinkCapability.resolve(),c.desiredSize=t.desiredSize,new Promise(function(p){p(c.onPull?.())}).then(function(){l.postMessage({sourceName:i,targetName:a,stream:sa.PULL_COMPLETE,streamId:o,success:!0})},function(p){l.postMessage({sourceName:i,targetName:a,stream:sa.PULL_COMPLETE,streamId:o,reason:Td(p)})});break;case sa.ENQUEUE:if(Ba(d,"enqueue should have stream controller"),d.isClosed)break;d.controller.enqueue(t.chunk);break;case sa.CLOSE:if(Ba(d,"close should have stream controller"),d.isClosed)break;d.isClosed=!0,d.controller.close(),this.#o(d,o);break;case sa.ERROR:Ba(d,"error should have stream controller"),d.controller.error(Td(t.reason)),this.#o(d,o);break;case sa.CANCEL_COMPLETE:t.success?d.cancelCall.resolve():d.cancelCall.reject(Td(t.reason)),this.#o(d,o);break;case sa.CANCEL:if(!c)break;new Promise(function(p){p(c.onCancel?.(Td(t.reason)))}).then(function(){l.postMessage({sourceName:i,targetName:a,stream:sa.CANCEL_COMPLETE,streamId:o,success:!0})},function(p){l.postMessage({sourceName:i,targetName:a,stream:sa.CANCEL_COMPLETE,streamId:o,reason:Td(p)})}),c.sinkCapability.reject(Td(t.reason)),c.isCancelled=!0,delete this.streamSinks[o];break;default:throw new Error("Unexpected stream case")}}async#o(t,o){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[o]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}class Wjt{#e;#t;constructor({parsedData:t,rawData:o}){this.#e=t,this.#t=o}getRaw(){return this.#t}get(t){return this.#e.get(t)??null}getAll(){return oK(this.#e)}has(t){return this.#e.has(t)}}const D2=Symbol("INTERNAL");class Gjt{#e=!1;#t=!1;#o=!1;#i=!0;constructor(t,{name:o,intent:i,usage:a}){this.#e=!!(t&kc.DISPLAY),this.#t=!!(t&kc.PRINT),this.name=o,this.intent=i,this.usage=a}get visible(){if(this.#o)return this.#i;if(!this.#i)return!1;const{print:t,view:o}=this.usage;return this.#e?o?.viewState!=="OFF":this.#t?t?.printState!=="OFF":!0}_setVisible(t,o,i=!1){t!==D2&&zi("Internal method `_setVisible` called."),this.#o=i,this.#i=o}}class Yjt{#e=null;#t=new Map;#o=null;#i=null;constructor(t,o=kc.DISPLAY){if(this.renderingIntent=o,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,this.#i=t.order;for(const i of t.groups)this.#t.set(i.id,new Gjt(o,i));if(t.baseState==="OFF")for(const i of this.#t.values())i._setVisible(D2,!1);for(const i of t.on)this.#t.get(i)._setVisible(D2,!0);for(const i of t.off)this.#t.get(i)._setVisible(D2,!1);this.#o=this.getHash()}}#s(t){const o=t.length;if(o<2)return!0;const i=t[0];for(let a=1;a<o;a++){const l=t[a];let d;if(Array.isArray(l))d=this.#s(l);else if(this.#t.has(l))d=this.#t.get(l).visible;else return Br(`Optional content group not found: ${l}`),!0;switch(i){case"And":if(!d)return!1;break;case"Or":if(d)return!0;break;case"Not":return!d;default:return!0}}return i==="And"}isVisible(t){if(this.#t.size===0)return!0;if(!t)return cj("Optional content group not defined."),!0;if(t.type==="OCG")return this.#t.has(t.id)?this.#t.get(t.id).visible:(Br(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return this.#s(t.expression);if(!t.policy||t.policy==="AnyOn"){for(const o of t.ids){if(!this.#t.has(o))return Br(`Optional content group not found: ${o}`),!0;if(this.#t.get(o).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const o of t.ids){if(!this.#t.has(o))return Br(`Optional content group not found: ${o}`),!0;if(!this.#t.get(o).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const o of t.ids){if(!this.#t.has(o))return Br(`Optional content group not found: ${o}`),!0;if(!this.#t.get(o).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const o of t.ids){if(!this.#t.has(o))return Br(`Optional content group not found: ${o}`),!0;if(this.#t.get(o).visible)return!1}return!0}return Br(`Unknown optional content policy ${t.policy}.`),!0}return Br(`Unknown group type ${t.type}.`),!0}setVisibility(t,o=!0){const i=this.#t.get(t);if(!i){Br(`Optional content group not found: ${t}`);return}i._setVisible(D2,!!o,!0),this.#e=null}setOCGState({state:t,preserveRB:o}){let i;for(const a of t){switch(a){case"ON":case"OFF":case"Toggle":i=a;continue}const l=this.#t.get(a);if(l)switch(i){case"ON":l._setVisible(D2,!0);break;case"OFF":l._setVisible(D2,!1);break;case"Toggle":l._setVisible(D2,!l.visible);break}}this.#e=null}get hasInitialVisibility(){return this.#o===null||this.getHash()===this.#o}getOrder(){return this.#t.size?this.#i?this.#i.slice():[...this.#t.keys()]:null}getGroups(){return this.#t.size>0?oK(this.#t):null}getGroup(t){return this.#t.get(t)||null}getHash(){if(this.#e!==null)return this.#e;const t=new SLe;for(const[o,i]of this.#t)t.update(`${o}:${i.visible}`);return this.#e=t.hexdigest()}}class Kjt{constructor(t,{disableRange:o=!1,disableStream:i=!1}){Ba(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:a,initialData:l,progressiveDone:d,contentDispositionFilename:c}=t;if(this._queuedChunks=[],this._progressiveDone=d,this._contentDispositionFilename=c,l?.length>0){const p=l instanceof Uint8Array&&l.byteLength===l.buffer.byteLength?l.buffer:new Uint8Array(l).buffer;this._queuedChunks.push(p)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!o,this._contentLength=a,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((p,u)=>{this._onReceiveData({begin:p,chunk:u})}),t.addProgressListener((p,u)=>{this._onProgress({loaded:p,total:u})}),t.addProgressiveReadListener(p=>{this._onReceiveData({chunk:p})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:o}){const i=o instanceof Uint8Array&&o.byteLength===o.buffer.byteLength?o.buffer:new Uint8Array(o).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{const a=this._rangeReaders.some(function(l){return l._begin!==t?!1:(l._enqueue(i),!0)});Ba(a,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){t.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const o=this._rangeReaders.indexOf(t);o>=0&&this._rangeReaders.splice(o,1)}getFullReader(){Ba(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new qjt(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,o){if(o<=this._progressiveDataLength)return null;const i=new Zjt(this,t,o);return this._pdfDataRangeTransport.requestDataRange(t,o),this._rangeReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeReaders.slice(0))o.cancel(t);this._pdfDataRangeTransport.abort()}}class qjt{constructor(t,o,i=!1,a=null){this._stream=t,this._done=i||!1,this._filename=sK(a)?a:null,this._queuedChunks=o||[],this._loaded=0;for(const l of this._queuedChunks)this._loaded+=l.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Zjt{constructor(t,o,i){this._stream=t,this._begin=o,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,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 o=this._queuedChunk;return this._queuedChunk=null,{value:o,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Jjt(e){let t=!0,o=i("filename\\*","i").exec(e);if(o){o=o[1];let h=c(o);return h=unescape(h),h=p(h),h=u(h),l(h)}if(o=d(e),o){const h=u(o);return l(h)}if(o=i("filename","i").exec(e),o){o=o[1];let h=c(o);return h=u(h),l(h)}function i(h,m){return new RegExp("(?:^|;)\\s*"+h+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',m)}function a(h,m){if(h){if(!/^[\x00-\xFF]+$/.test(m))return m;try{const f=new TextDecoder(h,{fatal:!0}),x=uj(m);m=f.decode(x),t=!1}catch{}}return m}function l(h){return t&&/[\x80-\xff]/.test(h)&&(h=a("utf-8",h),t&&(h=a("iso-8859-1",h))),h}function d(h){const m=[];let f;const x=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=x.exec(h))!==null;){let[,w,b,v]=f;if(w=parseInt(w,10),w in m){if(w===0)break;continue}m[w]=[b,v]}const y=[];for(let w=0;w<m.length&&w in m;++w){let[b,v]=m[w];v=c(v),b&&(v=unescape(v),w===0&&(v=p(v))),y.push(v)}return y.join("")}function c(h){if(h.startsWith('"')){const m=h.slice(1).split('\\"');for(let f=0;f<m.length;++f){const x=m[f].indexOf('"');x!==-1&&(m[f]=m[f].slice(0,x),m.length=f+1),m[f]=m[f].replaceAll(/\\(.)/g,"$1")}h=m.join('"')}return h}function p(h){const m=h.indexOf("'");if(m===-1)return h;const f=h.slice(0,m),y=h.slice(m+1).replace(/^[^']*'/,"");return a(f,y)}function u(h){return!h.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(h)?h:h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(m,f,x,y){if(x==="q"||x==="Q")return y=y.replaceAll("_"," "),y=y.replaceAll(/=([0-9a-fA-F]{2})/g,function(w,b){return String.fromCharCode(parseInt(b,16))}),a(f,y);try{y=atob(y)}catch{}return a(f,y)})}return""}function mK({getResponseHeader:e,isHttp:t,rangeChunkSize:o,disableRange:i}){const a={allowRangeRequests:!1,suggestedLength:void 0},l=parseInt(e("Content-Length"),10);return!Number.isInteger(l)||(a.suggestedLength=l,l<=2*o)||i||!t||e("Accept-Ranges")!=="bytes"||(e("Content-Encoding")||"identity")!=="identity"||(a.allowRangeRequests=!0),a}function gK(e){const t=e("Content-Disposition");if(t){let o=Jjt(t);if(o.includes("%"))try{o=decodeURIComponent(o)}catch{}if(sK(o))return o}return null}function yj(e,t){return e===404||e===0&&t.startsWith("file:")?new cf('Missing PDF "'+t+'".'):new pj(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)}function jLe(e){return e===200||e===206}function ILe(e,t,o){return{method:"GET",headers:e,signal:o.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function MLe(e){const t=new Headers;for(const o in e){const i=e[o];i!==void 0&&t.append(o,i)}return t}function BLe(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(Br(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}class Ype{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Ba(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Xjt(this),this._fullRequestReader}getRangeReader(t,o){if(o<=this._progressiveDataLength)return null;const i=new eIt(this,t,o);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeRequestReaders.slice(0))o.cancel(t)}}class Xjt{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const o=t.source;this._withCredentials=o.withCredentials||!1,this._contentLength=o.length,this._headersCapability=Promise.withResolvers(),this._disableRange=o.disableRange||!1,this._rangeChunkSize=o.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!o.disableStream,this._isRangeSupported=!o.disableRange,this._headers=MLe(this._stream.httpHeaders);const i=o.url;fetch(i,ILe(this._headers,this._withCredentials,this._abortController)).then(a=>{if(!jLe(a.status))throw yj(a.status,i);this._reader=a.body.getReader(),this._headersCapability.resolve();const l=p=>a.headers.get(p),{allowRangeRequests:d,suggestedLength:c}=mK({getResponseHeader:l,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=d,this._contentLength=c||this._contentLength,this._filename=gK(l),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new pf("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(){await this._headersCapability.promise;const{value:t,done:o}=await this._reader.read();return o?{value:t,done:o}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:BLe(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class eIt{constructor(t,o,i){this._stream=t,this._reader=null,this._loaded=0;const a=t.source;this._withCredentials=a.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!a.disableStream,this._abortController=new AbortController,this._headers=MLe(this._stream.httpHeaders),this._headers.append("Range",`bytes=${o}-${i-1}`);const l=a.url;fetch(l,ILe(this._headers,this._withCredentials,this._abortController)).then(d=>{if(!jLe(d.status))throw yj(d.status,l);this._readCapability.resolve(),this._reader=d.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:o}=await this._reader.read();return o?{value:t,done:o}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:BLe(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}const MO=200,BO=206;function tIt(e){const t=e.response;return typeof t!="string"?t:uj(t).buffer}class oIt{constructor(t,o={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&o.httpHeaders||Object.create(null),this.withCredentials=o.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,o,i){const a={begin:t,end:o};for(const l in i)a[l]=i[l];return this.request(a)}requestFull(t){return this.request(t)}request(t){const o=new XMLHttpRequest,i=this.currXhrId++,a=this.pendingRequests[i]={xhr:o};o.open("GET",this.url),o.withCredentials=this.withCredentials;for(const l in this.httpHeaders){const d=this.httpHeaders[l];d!==void 0&&o.setRequestHeader(l,d)}return this.isHttp&&"begin"in t&&"end"in t?(o.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),a.expectedStatus=BO):a.expectedStatus=MO,o.responseType="arraybuffer",t.onError&&(o.onerror=function(l){t.onError(o.status)}),o.onreadystatechange=this.onStateChange.bind(this,i),o.onprogress=this.onProgress.bind(this,i),a.onHeadersReceived=t.onHeadersReceived,a.onDone=t.onDone,a.onError=t.onError,a.onProgress=t.onProgress,o.send(null),i}onProgress(t,o){const i=this.pendingRequests[t];i&&i.onProgress?.(o)}onStateChange(t,o){const i=this.pendingRequests[t];if(!i)return;const a=i.xhr;if(a.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),a.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],a.status===0&&this.isHttp){i.onError?.(a.status);return}const l=a.status||MO;if(!(l===MO&&i.expectedStatus===BO)&&l!==i.expectedStatus){i.onError?.(a.status);return}const c=tIt(a);if(l===BO){const p=a.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(p);i.onDone({begin:parseInt(u[1],10),chunk:c})}else c?i.onDone({begin:0,chunk:c}):i.onError?.(a.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const o=this.pendingRequests[t].xhr;delete this.pendingRequests[t],o.abort()}}class rIt{constructor(t){this._source=t,this._manager=new oIt(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const o=this._rangeRequestReaders.indexOf(t);o>=0&&this._rangeRequestReaders.splice(o,1)}getFullReader(){return Ba(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new iIt(this._manager,this._source),this._fullRequestReader}getRangeReader(t,o){const i=new nIt(this._manager,t,o);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeRequestReaders.slice(0))o.cancel(t)}}class iIt{constructor(t,o){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=o.url,this._fullRequestId=t.requestFull(i),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=o.disableRange||!1,this._contentLength=o.length,this._rangeChunkSize=o.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,o=this._manager.getRequestXhr(t),i=d=>o.getResponseHeader(d),{allowRangeRequests:a,suggestedLength:l}=mK({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=l||this._contentLength,this._filename=gK(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=yj(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const o of this._requests)o.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class nIt{constructor(t,o,i){this._manager=t;const a={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(o,i,a),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const o=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:o,done:!1}):this._queuedChunk=o,this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=yj(t,this._url);for(const o of this._requests)o.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const o=this._queuedChunk;return this._queuedChunk=null,{value:o,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const PLe=/^file:\/\/\/[a-zA-Z]:\//;function aIt(e){const t=sh.get("url"),o=t.parse(e);return o.protocol==="file:"||o.host?o:/^[a-z]:[/\\]/i.test(e)?t.parse(`file:///${e}`):(o.host||(o.protocol="file:"),o)}class sIt{constructor(t){this.source=t,this.url=aIt(t.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Ba(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new cIt(this):new lIt(this),this._fullRequestReader}getRangeReader(t,o){if(o<=this._progressiveDataLength)return null;const i=this.isFsUrl?new pIt(this,t,o):new dIt(this,t,o);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeRequestReaders.slice(0))o.cancel(t)}}class DLe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const o=t.source;this._contentLength=o.length,this._loaded=0,this._filename=null,this._disableRange=o.disableRange||!1,this._rangeChunkSize=o.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!o.disableStream,this._isRangeSupported=!o.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",o=>{this._error(o)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new pf("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class TLe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const o=t.source;this._isStreamingSupported=!o.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",o=>{this._error(o)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function vS(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class lIt extends DLe{constructor(t){super(t);const o=i=>{if(i.statusCode===404){const c=new cf(`Missing PDF "${this._url}".`);this._storedError=c,this._headersCapability.reject(c);return}this._headersCapability.resolve(),this._setReadableStream(i);const a=c=>this._readableStream.headers[c.toLowerCase()],{allowRangeRequests:l,suggestedLength:d}=mK({getResponseHeader:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=l,this._contentLength=d||this._contentLength,this._filename=gK(a)};if(this._request=null,this._url.protocol==="http:"){const i=sh.get("http");this._request=i.request(vS(this._url,t.httpHeaders),o)}else{const i=sh.get("https");this._request=i.request(vS(this._url,t.httpHeaders),o)}this._request.on("error",i=>{this._storedError=i,this._headersCapability.reject(i)}),this._request.end()}}class dIt extends TLe{constructor(t,o,i){super(t),this._httpHeaders={};for(const l in t.httpHeaders){const d=t.httpHeaders[l];d!==void 0&&(this._httpHeaders[l]=d)}this._httpHeaders.Range=`bytes=${o}-${i-1}`;const a=l=>{if(l.statusCode===404){const d=new cf(`Missing PDF "${this._url}".`);this._storedError=d;return}this._setReadableStream(l)};if(this._request=null,this._url.protocol==="http:"){const l=sh.get("http");this._request=l.request(vS(this._url,this._httpHeaders),a)}else{const l=sh.get("https");this._request=l.request(vS(this._url,this._httpHeaders),a)}this._request.on("error",l=>{this._storedError=l}),this._request.end()}}class cIt extends DLe{constructor(t){super(t);let o=decodeURIComponent(this._url.path);PLe.test(this._url.href)&&(o=o.replace(/^\//,""));const i=sh.get("fs");i.promises.lstat(o).then(a=>{this._contentLength=a.size,this._setReadableStream(i.createReadStream(o)),this._headersCapability.resolve()},a=>{a.code==="ENOENT"&&(a=new cf(`Missing PDF "${o}".`)),this._storedError=a,this._headersCapability.reject(a)})}}class pIt extends TLe{constructor(t,o,i){super(t);let a=decodeURIComponent(this._url.path);PLe.test(this._url.href)&&(a=a.replace(/^\//,""));const l=sh.get("fs");this._setReadableStream(l.createReadStream(a,{start:o,end:i-1}))}}const uIt=1e5,Ul=30,hIt=.8;let CS=class mu{#e=Promise.withResolvers();#t=null;#o=!1;#i=!!globalThis.FontInspector?.enabled;#s=null;#r=null;#n=0;#l=0;#c=null;#p=null;#h=0;#d=0;#a=Object.create(null);#m=[];#f=null;#u=[];#y=new WeakMap;#g=null;static#w=new Map;static#v=new Map;static#A=null;static#k=new Set;constructor({textContentSource:t,container:o,viewport:i}){if(t instanceof ReadableStream)this.#f=t;else if(typeof t=="object")this.#f=new ReadableStream({start(p){p.enqueue(t),p.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#p=o,this.#d=i.scale*(globalThis.devicePixelRatio||1),this.#h=i.rotation,this.#r={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null};const{pageWidth:a,pageHeight:l,pageX:d,pageY:c}=i.rawDims;this.#g=[1,0,0,-1,-d,c+l],this.#l=a,this.#n=l,mu.#x(),_4(o,i),this.#e.promise.catch(()=>{}).then(()=>{mu.#k.delete(this),this.#r=null,this.#a=null})}render(){const t=()=>{this.#c.read().then(({value:o,done:i})=>{if(i){this.#e.resolve();return}this.#s??=o.lang,Object.assign(this.#a,o.styles),this.#S(o.items),t()},this.#e.reject)};return this.#c=this.#f.getReader(),mu.#k.add(this),t(),this.#e.promise}update({viewport:t,onBefore:o=null}){const i=t.scale*(globalThis.devicePixelRatio||1),a=t.rotation;if(a!==this.#h&&(o?.(),this.#h=a,_4(this.#p,{rotation:a})),i!==this.#d){o?.(),this.#d=i;const l={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:mu.#b(this.#s)};for(const d of this.#u)l.properties=this.#y.get(d),l.div=d,this.#$(l)}}cancel(){const t=new pf("TextLayer task cancelled.");this.#c?.cancel(t).catch(()=>{}),this.#c=null,this.#e.reject(t)}get textDivs(){return this.#u}get textContentItemsStr(){return this.#m}#S(t){if(this.#o)return;this.#r.ctx??=mu.#b(this.#s);const o=this.#u,i=this.#m;for(const a of t){if(o.length>uIt){Br("Ignoring additional textDivs for performance reasons."),this.#o=!0;return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const l=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),a.id!==null&&this.#t.setAttribute("id",`${a.id}`),l.append(this.#t)}else a.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}i.push(a.str),this.#I(a)}}#I(t){const o=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};this.#u.push(o);const a=So.transform(this.#g,t.transform);let l=Math.atan2(a[1],a[0]);const d=this.#a[t.fontName];d.vertical&&(l+=Math.PI/2);const c=this.#i&&d.fontSubstitution||d.fontFamily,p=Math.hypot(a[2],a[3]),u=p*mu.#C(c,this.#s);let h,m;l===0?(h=a[4],m=a[5]-u):(h=a[4]+u*Math.sin(l),m=a[5]-u*Math.cos(l));const f="calc(var(--scale-factor)*",x=o.style;this.#t===this.#p?(x.left=`${(100*h/this.#l).toFixed(2)}%`,x.top=`${(100*m/this.#n).toFixed(2)}%`):(x.left=`${f}${h.toFixed(2)}px)`,x.top=`${f}${m.toFixed(2)}px)`),x.fontSize=`${f}${(mu.#A*p).toFixed(2)}px)`,x.fontFamily=c,i.fontSize=p,o.setAttribute("role","presentation"),o.textContent=t.str,o.dir=t.dir,this.#i&&(o.dataset.fontName=d.fontSubstitutionLoadedName||t.fontName),l!==0&&(i.angle=l*(180/Math.PI));let y=!1;if(t.str.length>1)y=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const w=Math.abs(t.transform[0]),b=Math.abs(t.transform[3]);w!==b&&Math.max(w,b)/Math.min(w,b)>1.5&&(y=!0)}if(y&&(i.canvasWidth=d.vertical?t.height:t.width),this.#y.set(o,i),this.#r.div=o,this.#r.properties=i,this.#$(this.#r),i.hasText&&this.#t.append(o),i.hasEOL){const w=document.createElement("br");w.setAttribute("role","presentation"),this.#t.append(w)}}#$(t){const{div:o,properties:i,ctx:a,prevFontSize:l,prevFontFamily:d}=t,{style:c}=o;let p="";if(mu.#A>1&&(p=`scale(${1/mu.#A})`),i.canvasWidth!==0&&i.hasText){const{fontFamily:u}=c,{canvasWidth:h,fontSize:m}=i;(l!==m||d!==u)&&(a.font=`${m*this.#d}px ${u}`,t.prevFontSize=m,t.prevFontFamily=u);const{width:f}=a.measureText(o.textContent);f>0&&(p=`scaleX(${h*this.#d/f}) ${p}`)}i.angle!==0&&(p=`rotate(${i.angle}deg) ${p}`),p.length>0&&(c.transform=p)}static cleanup(){if(!(this.#k.size>0)){this.#w.clear();for(const{canvas:t}of this.#v.values())t.remove();this.#v.clear()}}static#b(t=null){let o=this.#v.get(t||="");if(!o){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),o=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#v.set(t,o)}return o}static#x(){if(this.#A!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),this.#A=t.getBoundingClientRect().height,t.remove()}static#C(t,o){const i=this.#w.get(t);if(i)return i;const a=this.#b(o),l=a.font;a.canvas.width=a.canvas.height=Ul,a.font=`${Ul}px ${t}`;const d=a.measureText("");let c=d.fontBoundingBoxAscent,p=Math.abs(d.fontBoundingBoxDescent);if(c){const m=c/(c+p);return this.#w.set(t,m),a.canvas.width=a.canvas.height=0,a.font=l,m}a.strokeStyle="red",a.clearRect(0,0,Ul,Ul),a.strokeText("g",0,0);let u=a.getImageData(0,0,Ul,Ul).data;p=0;for(let m=u.length-1-3;m>=0;m-=4)if(u[m]>0){p=Math.ceil(m/4/Ul);break}a.clearRect(0,0,Ul,Ul),a.strokeText("A",0,Ul),u=a.getImageData(0,0,Ul,Ul).data,c=0;for(let m=0,f=u.length;m<f;m+=4)if(u[m]>0){c=Ul-Math.floor(m/4/Ul);break}a.canvas.width=a.canvas.height=0,a.font=l;const h=c?c/(c+p):hIt;return this.#w.set(t,h),h}};function mIt(){$Le("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:e,container:t,viewport:o,...i}=arguments[0],a=Object.keys(i);a.length>0&&Br("Ignoring `renderTextLayer` parameters: "+a.join(", "));const l=new CS({textContentSource:e,container:t,viewport:o}),{textDivs:d,textContentItemsStr:c}=l;return{promise:l.render(),textDivs:d,textContentItemsStr:c}}function gIt(){$Le("`updateTextLayer`, please use `TextLayer` instead.")}class Cw{static textContent(t){const o=[],i={items:o,styles:Object.create(null)};function a(l){if(!l)return;let d=null;const c=l.name;if(c==="#text")d=l.value;else if(Cw.shouldBuildText(c))l?.attributes?.textContent?d=l.attributes.textContent:l.value&&(d=l.value);else return;if(d!==null&&o.push({str:d}),!!l.children)for(const p of l.children)a(p)}return a(t),i}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const fIt=65536,xIt=100,yIt=5e3,wIt=Zs?Ijt:xjt,bIt=Zs?Mjt:CLe,vIt=Zs?jjt:fjt,CIt=Zs?Bjt:ALe;function AIt(e={}){typeof e=="string"||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t=new fK,{docId:o}=t,i=e.url?$It(e.url):null,a=e.data?kIt(e.data):null,l=e.httpHeaders||null,d=e.withCredentials===!0,c=e.password??null,p=e.range instanceof zLe?e.range:null,u=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:fIt;let h=e.worker instanceof jc?e.worker:null;const m=e.verbosity,f=typeof e.docBaseUrl=="string"&&!aK(e.docBaseUrl)?e.docBaseUrl:null,x=typeof e.cMapUrl=="string"?e.cMapUrl:null,y=e.cMapPacked!==!1,w=e.CMapReaderFactory||bIt,b=typeof e.standardFontDataUrl=="string"?e.standardFontDataUrl:null,v=e.StandardFontDataFactory||CIt,A=e.stopAtErrors!==!0,S=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,E=e.isEvalSupported!==!1,I=typeof e.isOffscreenCanvasSupported=="boolean"?e.isOffscreenCanvasSupported:!Zs,L=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,B=typeof e.disableFontFace=="boolean"?e.disableFontFace:Zs,P=e.fontExtraProperties===!0,D=e.enableXfa===!0,T=e.ownerDocument||globalThis.document,O=e.disableRange===!0,F=e.disableStream===!0,Y=e.disableAutoFetch===!0,Z=e.pdfBug===!0,R=e.enableHWA===!0,U=p?p.length:e.length??NaN,_=typeof e.useSystemFonts=="boolean"?e.useSystemFonts:!Zs&&!B,N=typeof e.useWorkerFetch=="boolean"?e.useWorkerFetch:w===CLe&&v===ALe&&x&&b&&Yx(x,document.baseURI)&&Yx(b,document.baseURI),z=e.canvasFactory||new wIt({ownerDocument:T,enableHWA:R}),H=e.filterFactory||new vIt({docId:o,ownerDocument:T}),ee=null;njt(m);const K={canvasFactory:z,filterFactory:H};if(N||(K.cMapReaderFactory=new w({baseUrl:x,isCompressed:y}),K.standardFontDataFactory=new v({baseUrl:b})),!h){const X={verbosity:m,port:vw.workerPort};h=X.port?jc.fromPort(X):new jc(X),t._worker=h}const G={docId:o,apiVersion:"4.4.168",data:a,password:c,disableAutoFetch:Y,rangeChunkSize:u,length:U,docBaseUrl:f,enableXfa:D,evaluatorOptions:{maxImageSize:S,disableFontFace:B,ignoreErrors:A,isEvalSupported:E,isOffscreenCanvasSupported:I,canvasMaxAreaInBytes:L,fontExtraProperties:P,useSystemFonts:_,cMapUrl:N?x:null,standardFontDataUrl:N?b:null}},J={disableFontFace:B,fontExtraProperties:P,ownerDocument:T,pdfBug:Z,styleElement:ee,loadingParams:{disableAutoFetch:Y,enableXfa:D}};return h.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const X=h.messageHandler.sendWithPromise("GetDocRequest",G,a?[a.buffer]:null);let le;if(p)le=new Kjt(p,{disableRange:O,disableStream:F});else if(!a){if(!i)throw new Error("getDocument - no `url` parameter provided.");le=(me=>Zs?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&Yx(me.url)?new Ype(me):new sIt(me):Yx(me.url)?new Ype(me):new rIt(me))({url:i,length:U,httpHeaders:l,withCredentials:d,rangeChunkSize:u,disableRange:O,disableStream:F})}return X.then(xe=>{if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const me=new Kx(o,xe,h.port),ce=new jIt(me,t,le,J,K);t._transport=ce,me.send("Ready",null)})}).catch(t._capability.reject),t}function $It(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(Zs&&typeof e=="string")return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function kIt(e){if(Zs&&typeof uk<"u"&&e instanceof uk)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if(typeof e=="string")return uj(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof e=="object"&&!isNaN(e?.length))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function Kpe(e){return typeof e=="object"&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0}class fK{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${fK.#e++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}let zLe=class{constructor(t,o,i=!1,a=null){this.length=t,this.initialData=o,this.progressiveDone=i,this.contentDispositionFilename=a,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,o){for(const i of this._rangeListeners)i(t,o)}onDataProgress(t,o){this._readyCapability.promise.then(()=>{for(const i of this._progressListeners)i(t,o)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const o of this._progressiveReadListeners)o(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,o){zi("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class SIt{constructor(t,o){this._pdfInfo=t,this._transport=o}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return si(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:o}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(o)}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(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class EIt{#e=null;#t=!1;constructor(t,o,i,a=!1){this._pageIndex=t,this._pageInfo=o,this._transport=i,this._stats=a?new Tpe:null,this._pdfBug=a,this.commonObjs=i.commonObjs,this.objs=new RLe,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:t,rotation:o=this.rotate,offsetX:i=0,offsetY:a=0,dontFlip:l=!1}={}){return new Eb({viewBox:this.view,scale:t,rotation:o,offsetX:i,offsetY:a,dontFlip:l})}getAnnotations({intent:t="display"}={}){const{renderingIntent:o}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,o)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return si(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:o,intent:i="display",annotationMode:a=W2.ENABLE,transform:l=null,background:d=null,optionalContentConfigPromise:c=null,annotationCanvasMap:p=null,pageColors:u=null,printAnnotationStorage:h=null}){this._stats?.time("Overall");const m=this._transport.getRenderingIntent(i,a,h),{renderingIntent:f,cacheKey:x}=m;this.#t=!1,this.#i(),c||=this._transport.getOptionalContentConfig(f);let y=this._intentStates.get(x);y||(y=Object.create(null),this._intentStates.set(x,y)),y.streamReaderCancelTimeout&&(clearTimeout(y.streamReaderCancelTimeout),y.streamReaderCancelTimeout=null);const w=!!(f&kc.PRINT);y.displayReadyCapability||(y.displayReadyCapability=Promise.withResolvers(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(m));const b=S=>{y.renderTasks.delete(v),(this._maybeCleanupAfterRender||w)&&(this.#t=!0),this.#o(!w),S?(v.capability.reject(S),this._abortOperatorList({intentState:y,reason:S instanceof Error?S:new Error(S)})):v.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},v=new j7({callback:b,params:{canvasContext:t,viewport:o,transform:l,background:d},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:p,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!w,pdfBug:this._pdfBug,pageColors:u});(y.renderTasks||=new Set).add(v);const A=v.task;return Promise.all([y.displayReadyCapability.promise,c]).then(([S,E])=>{if(this.destroyed){b();return}if(this._stats?.time("Rendering"),!(E.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");v.initializeGraphics({transparency:S,optionalContentConfig:E}),v.operatorListChanged()}).catch(b),A}getOperatorList({intent:t="display",annotationMode:o=W2.ENABLE,printAnnotationStorage:i=null}={}){function a(){d.operatorList.lastChunk&&(d.opListReadCapability.resolve(d.operatorList),d.renderTasks.delete(c))}const l=this._transport.getRenderingIntent(t,o,i,!0);let d=this._intentStates.get(l.cacheKey);d||(d=Object.create(null),this._intentStates.set(l.cacheKey,d));let c;return d.opListReadCapability||(c=Object.create(null),c.operatorListChanged=a,d.opListReadCapability=Promise.withResolvers(),(d.renderTasks||=new Set).add(c),d.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(l)),d.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:o=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:o===!0},{highWaterMark:100,size(a){return a.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>Cw.textContent(i));const o=this.streamTextContent(t);return new Promise(function(i,a){function l(){d.read().then(function({value:p,done:u}){if(u){i(c);return}c.lang??=p.lang,Object.assign(c.styles,p.styles),c.items.push(...p.items),l()},a)}const d=o.getReader(),c={items:[],styles:Object.create(null),lang:null};l()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const o of this._intentStates.values())if(this._abortOperatorList({intentState:o,reason:new Error("Page was destroyed."),force:!0}),!o.opListReadCapability)for(const i of o.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),this.#t=!1,this.#i(),Promise.all(t)}cleanup(t=!1){this.#t=!0;const o=this.#o(!1);return t&&o&&(this._stats&&=new Tpe),o}#o(t=!1){if(this.#i(),!this.#t||this.destroyed)return!1;if(t)return this.#e=setTimeout(()=>{this.#e=null,this.#o(!1)},yIt),!1;for(const{renderTasks:o,operatorList:i}of this._intentStates.values())if(o.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}#i(){this.#e&&(clearTimeout(this.#e),this.#e=null)}_startRenderPage(t,o){const i=this._intentStates.get(o);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,o){for(let i=0,a=t.length;i<a;i++)o.operatorList.fnArray.push(t.fnArray[i]),o.operatorList.argsArray.push(t.argsArray[i]);o.operatorList.lastChunk=t.lastChunk,o.operatorList.separateAnnots=t.separateAnnots;for(const i of o.renderTasks)i.operatorListChanged();t.lastChunk&&this.#o(!0)}_pumpOperatorList({renderingIntent:t,cacheKey:o,annotationStorageSerializable:i}){const{map:a,transfer:l}=i,c=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:o,annotationStorage:a},l).getReader(),p=this._intentStates.get(o);p.streamReader=c;const u=()=>{c.read().then(({value:h,done:m})=>{if(m){p.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,p),u())},h=>{if(p.streamReader=null,!this._transport.destroyed){if(p.operatorList){p.operatorList.lastChunk=!0;for(const m of p.renderTasks)m.operatorListChanged();this.#o(!0)}if(p.displayReadyCapability)p.displayReadyCapability.reject(h);else if(p.opListReadCapability)p.opListReadCapability.reject(h);else throw h}})};u()}_abortOperatorList({intentState:t,reason:o,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(o instanceof nK){let a=xIt;o.extraDelay>0&&o.extraDelay<1e3&&(a+=o.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:o,force:!0})},a);return}}if(t.streamReader.cancel(new pf(o.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[a,l]of this._intentStates)if(l===t){this._intentStates.delete(a);break}this.cleanup()}}}get stats(){return this._stats}}class LIt{#e=new Set;#t=Promise.resolve();postMessage(t,o){const i={data:structuredClone(t,o?{transfer:o}:null)};this.#t.then(()=>{for(const a of this.#e)a.call(this,i)})}addEventListener(t,o){this.#e.add(o)}removeEventListener(t,o){this.#e.delete(o)}terminate(){this.#e.clear()}}const t0={isWorkerDisabled:!1,fakeWorkerId:0};Zs&&(t0.isWorkerDisabled=!0,vw.workerSrc||="./pdf.worker.mjs"),t0.isSameOrigin=function(e,t){let o;try{if(o=new URL(e),!o.origin||o.origin==="null")return!1}catch{return!1}const i=new URL(t,o);return o.origin===i.origin},t0.createCDNWrapper=function(e){const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};class jc{static#e;constructor({name:t=null,port:o=null,verbosity:i=ajt()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,o){if(jc.#e?.has(o))throw new Error("Cannot use more than one PDFWorker per port.");(jc.#e||=new WeakMap).set(o,this),this._initializeFromPort(o);return}this._initialize()}get promise(){return Zs?Promise.all([sh.promise,this._readyCapability.promise]):this._readyCapability.promise}#t(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new Kx("main","worker",t),this._messageHandler.on("ready",function(){}),this.#t()}_initialize(){if(t0.isWorkerDisabled||jc.#o){this._setupFakeWorker();return}let{workerSrc:t}=jc;try{t0.isSameOrigin(window.location.href,t)||(t=t0.createCDNWrapper(new URL(t,window.location).href));const o=new Worker(t,{type:"module"}),i=new Kx("main","worker",o),a=()=>{l.abort(),i.destroy(),o.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},l=new AbortController;o.addEventListener("error",()=>{this._webWorker||a()},{signal:l.signal}),i.on("test",c=>{if(l.abort(),this.destroyed||!c){a();return}this._messageHandler=i,this._port=o,this._webWorker=o,this.#t()}),i.on("ready",c=>{if(l.abort(),this.destroyed){a();return}try{d()}catch{this._setupFakeWorker()}});const d=()=>{const c=new Uint8Array;i.send("test",c,[c.buffer])};d();return}catch{cj("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){t0.isWorkerDisabled||(Br("Setting up fake worker."),t0.isWorkerDisabled=!0),jc._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const o=new LIt;this._port=o;const i=`fake${t0.fakeWorkerId++}`,a=new Kx(i+"_worker",i,o);t.setup(a,o),this._messageHandler=new Kx(i,i+"_worker",o),this.#t()}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),jc.#e?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const o=this.#e?.get(t.port);if(o){if(o._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return o}return new jc(t)}static get workerSrc(){if(vw.workerSrc)return vw.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#o(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return si(this,"_setupFakeWorkerGlobal",(async()=>this.#o?this.#o:(await import(this.workerSrc)).WorkerMessageHandler)())}}class jIt{#e=new Map;#t=new Map;#o=new Map;#i=new Map;#s=null;constructor(t,o,i,a,l){this.messageHandler=t,this.loadingTask=o,this.commonObjs=new RLe,this.fontLoader=new Ejt({ownerDocument:a.ownerDocument,styleElement:a.styleElement}),this.loadingParams=a.loadingParams,this._params=a,this.canvasFactory=l.canvasFactory,this.filterFactory=l.filterFactory,this.cMapReaderFactory=l.cMapReaderFactory,this.standardFontDataFactory=l.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#r(t,o=null){const i=this.#e.get(t);if(i)return i;const a=this.messageHandler.sendWithPromise(t,o);return this.#e.set(t,a),a}get annotationStorage(){return si(this,"annotationStorage",new uK)}getRenderingIntent(t,o=W2.ENABLE,i=null,a=!1){let l=kc.DISPLAY,d=kQ;switch(t){case"any":l=kc.ANY;break;case"display":break;case"print":l=kc.PRINT;break;default:Br(`getRenderingIntent - invalid intent: ${t}`)}switch(o){case W2.DISABLE:l+=kc.ANNOTATIONS_DISABLE;break;case W2.ENABLE:break;case W2.ENABLE_FORMS:l+=kc.ANNOTATIONS_FORMS;break;case W2.ENABLE_STORAGE:l+=kc.ANNOTATIONS_STORAGE,d=(l&kc.PRINT&&i instanceof ELe?i:this.annotationStorage).serializable;break;default:Br(`getRenderingIntent - invalid annotationMode: ${o}`)}return a&&(l+=kc.OPLIST),{renderingIntent:l,cacheKey:`${l}_${d.hash}`,annotationStorageSerializable:d}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#s?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const i of this.#t.values())t.push(i._destroy());this.#t.clear(),this.#o.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const o=this.messageHandler.sendWithPromise("Terminate",null);return t.push(o),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),CS.cleanup(),this._networkStream?.cancelAllRequests(new pf("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:o}=this;t.on("GetReader",(i,a)=>{Ba(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=l=>{this._lastProgress={loaded:l.loaded,total:l.total}},a.onPull=()=>{this._fullReader.read().then(function({value:l,done:d}){if(d){a.close();return}Ba(l instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(l),1,[l])}).catch(l=>{a.error(l)})},a.onCancel=l=>{this._fullReader.cancel(l),a.ready.catch(d=>{if(!this.destroyed)throw d})}}),t.on("ReaderHeadersReady",i=>{const a=Promise.withResolvers(),l=this._fullReader;return l.headersReady.then(()=>{(!l.isStreamingSupported||!l.isRangeSupported)&&(this._lastProgress&&o.onProgress?.(this._lastProgress),l.onProgress=d=>{o.onProgress?.({loaded:d.loaded,total:d.total})}),a.resolve({isStreamingSupported:l.isStreamingSupported,isRangeSupported:l.isRangeSupported,contentLength:l.contentLength})},a.reject),a.promise}),t.on("GetRangeReader",(i,a)=>{Ba(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const l=this._networkStream.getRangeReader(i.begin,i.end);if(!l){a.close();return}a.onPull=()=>{l.read().then(function({value:d,done:c}){if(c){a.close();return}Ba(d instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(d),1,[d])}).catch(d=>{a.error(d)})},a.onCancel=d=>{l.cancel(d),a.ready.catch(c=>{if(!this.destroyed)throw c})}}),t.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,o._capability.resolve(new SIt(i,this))}),t.on("DocException",function(i){let a;switch(i.name){case"PasswordException":a=new AQ(i.message,i.code);break;case"InvalidPDFException":a=new wLe(i.message);break;case"MissingPDFException":a=new cf(i.message);break;case"UnexpectedResponseException":a=new pj(i.message,i.status);break;case"UnknownErrorException":a=new $Q(i.message,i.details);break;default:zi("DocException - expected a valid Error.")}o._capability.reject(a)}),t.on("PasswordRequest",i=>{if(this.#s=Promise.withResolvers(),o.onPassword){const a=l=>{l instanceof Error?this.#s.reject(l):this.#s.resolve({password:l})};try{o.onPassword(a,i.code)}catch(l){this.#s.reject(l)}}else this.#s.reject(new AQ(i.message,i.code));return this.#s.promise}),t.on("DataLoaded",i=>{o.onProgress?.({loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),t.on("StartRenderPage",i=>{if(this.destroyed)return;this.#t.get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),t.on("commonobj",([i,a,l])=>{if(this.destroyed||this.commonObjs.has(i))return null;switch(a){case"Font":const{disableFontFace:d,fontExtraProperties:c,pdfBug:p}=this._params;if("error"in l){const f=l.error;Br(`Error during font loading: ${f}`),this.commonObjs.resolve(i,f);break}const u=p&&globalThis.FontInspector?.enabled?(f,x)=>globalThis.FontInspector.fontAdded(f,x):null,h=new Ljt(l,{disableFontFace:d,inspectFont:u});this.fontLoader.bind(h).catch(()=>t.sendWithPromise("FontFallback",{id:i})).finally(()=>{!c&&h.data&&(h.data=null),this.commonObjs.resolve(i,h)});break;case"CopyLocalImage":const{imageRef:m}=l;Ba(m,"The imageRef must be defined.");for(const f of this.#t.values())for(const[,x]of f.objs)if(x?.ref===m)return x.dataLen?(this.commonObjs.resolve(i,structuredClone(x)),x.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,l);break;default:throw new Error(`Got unknown common object type ${a}`)}return null}),t.on("obj",([i,a,l,d])=>{if(this.destroyed)return;const c=this.#t.get(a);if(!c.objs.has(i)){if(c._intentStates.size===0){d?.bitmap?.close();return}switch(l){case"Image":c.objs.resolve(i,d),d?.dataLen>tjt&&(c._maybeCleanupAfterRender=!0);break;case"Pattern":c.objs.resolve(i,d);break;default:throw new Error(`Got unknown object type ${l}`)}}}),t.on("DocProgress",i=>{this.destroyed||o.onProgress?.({loaded:i.loaded,total:i.total})}),t.on("FetchBuiltInCMap",i=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(i):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),t.on("FetchStandardFontData",i=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(i):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Br("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:o}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},o).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const o=t-1,i=this.#o.get(o);if(i)return i;const a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:o}).then(l=>{if(this.destroyed)throw new Error("Transport destroyed");l.refStr&&this.#i.set(l.refStr,t);const d=new EIt(o,l,this,this._params.pdfBug);return this.#t.set(o,d),d});return this.#o.set(o,a),a}getPageIndex(t){return Kpe(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,o){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:o})}getFieldObjects(){return this.#r("GetFieldObjects")}hasJSActions(){return this.#r("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#r("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#r("GetOptionalContentConfig").then(o=>new Yjt(o,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",o=this.#e.get(t);if(o)return o;const i=this.messageHandler.sendWithPromise(t,null).then(a=>({info:a[0],metadata:a[1]?new Wjt(a[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const o of this.#t.values())if(!o.cleanup())throw new Error(`startCleanup: Page ${o.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),CS.cleanup()}}cachedPageNumber(t){if(!Kpe(t))return null;const o=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return this.#i.get(o)??null}}const IC=Symbol("INITIAL_DATA");class RLe{#e=Object.create(null);#t(t){return this.#e[t]||={...Promise.withResolvers(),data:IC}}get(t,o=null){if(o){const a=this.#t(t);return a.promise.then(()=>o(a.data)),null}const i=this.#e[t];if(!i||i.data===IC)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const o=this.#e[t];return!!o&&o.data!==IC}resolve(t,o=null){const i=this.#t(t);i.data=o,i.resolve()}clear(){for(const t in this.#e){const{data:o}=this.#e[t];o?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const t in this.#e){const{data:o}=this.#e[t];o!==IC&&(yield[t,o])}}}class IIt{#e=null;constructor(t){this.#e=t,this.onContinue=null}get promise(){return this.#e.capability.promise}cancel(t=0){this.#e.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#e.operatorList;if(!t)return!1;const{annotationCanvasMap:o}=this.#e;return t.form||t.canvas&&o?.size>0}}class j7{#e=null;static#t=new WeakSet;constructor({callback:t,params:o,objs:i,commonObjs:a,annotationCanvasMap:l,operatorList:d,pageIndex:c,canvasFactory:p,filterFactory:u,useRequestAnimationFrame:h=!1,pdfBug:m=!1,pageColors:f=null}){this.callback=t,this.params=o,this.objs=i,this.commonObjs=a,this.annotationCanvasMap=l,this.operatorListIdx=null,this.operatorList=d,this._pageIndex=c,this.canvasFactory=p,this.filterFactory=u,this._pdfBug=m,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=h===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new IIt(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=o.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:o}){if(this.cancelled)return;if(this._canvas){if(j7.#t.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.");j7.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:a,transform:l,background:d}=this.params;this.gfx=new W7(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:o},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:l,viewport:a,transparency:t,background:d}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,o=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),j7.#t.delete(this._canvas),this.callback(t||new nK(`Rendering cancelled, page ${this._pageIndex+1}`,o))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.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?this.#e=window.requestAnimationFrame(()=>{this.#e=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(),j7.#t.delete(this._canvas),this.callback())))}}const MIt="4.4.168",BIt="19fbc8998";function qpe(e){return Math.floor(Math.max(0,Math.min(1,e))*255).toString(16).padStart(2,"0")}function G9(e){return Math.max(0,Math.min(255,255*e))}class Zpe{static CMYK_G([t,o,i,a]){return["G",1-Math.min(1,.3*t+.59*i+.11*o+a)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=G9(t),[t,t,t]}static G_HTML([t]){const o=qpe(t);return`#${o}${o}${o}`}static RGB_G([t,o,i]){return["G",.3*t+.59*o+.11*i]}static RGB_rgb(t){return t.map(G9)}static RGB_HTML(t){return`#${t.map(qpe).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,o,i,a]){return["RGB",1-Math.min(1,t+a),1-Math.min(1,i+a),1-Math.min(1,o+a)]}static CMYK_rgb([t,o,i,a]){return[G9(1-Math.min(1,t+a)),G9(1-Math.min(1,i+a)),G9(1-Math.min(1,o+a))]}static CMYK_HTML(t){const o=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(o)}static RGB_CMYK([t,o,i]){const a=1-t,l=1-o,d=1-i,c=Math.min(a,l,d);return["CMYK",a,l,d,c]}}class FLe{static setupStorage(t,o,i,a,l){const d=a.getValue(o,{value:null});switch(i.name){case"textarea":if(d.value!==null&&(t.textContent=d.value),l==="print")break;t.addEventListener("input",c=>{a.setValue(o,{value:c.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(d.value===i.attributes.xfaOn?t.setAttribute("checked",!0):d.value===i.attributes.xfaOff&&t.removeAttribute("checked"),l==="print")break;t.addEventListener("change",c=>{a.setValue(o,{value:c.target.checked?c.target.getAttribute("xfaOn"):c.target.getAttribute("xfaOff")})})}else{if(d.value!==null&&t.setAttribute("value",d.value),l==="print")break;t.addEventListener("input",c=>{a.setValue(o,{value:c.target.value})})}break;case"select":if(d.value!==null){t.setAttribute("value",d.value);for(const c of i.children)c.attributes.value===d.value?c.attributes.selected=!0:c.attributes.hasOwnProperty("selected")&&delete c.attributes.selected}t.addEventListener("input",c=>{const p=c.target.options,u=p.selectedIndex===-1?"":p[p.selectedIndex].value;a.setValue(o,{value:u})});break}}static setAttributes({html:t,element:o,storage:i=null,intent:a,linkService:l}){const{attributes:d}=o,c=t instanceof HTMLAnchorElement;d.type==="radio"&&(d.name=`${d.name}-${a}`);for(const[p,u]of Object.entries(d))if(u!=null)switch(p){case"class":u.length&&t.setAttribute(p,u.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",u);break;case"style":Object.assign(t.style,u);break;case"textContent":t.textContent=u;break;default:(!c||p!=="href"&&p!=="newWindow")&&t.setAttribute(p,u)}c&&l.addLinkAttributes(t,d.href,d.newWindow),i&&d.dataId&&this.setupStorage(t,d.dataId,o,i)}static render(t){const o=t.annotationStorage,i=t.linkService,a=t.xfaHtml,l=t.intent||"display",d=document.createElement(a.name);a.attributes&&this.setAttributes({html:d,element:a,intent:l,linkService:i});const c=l!=="richText",p=t.div;if(p.append(d),t.viewport){const m=`matrix(${t.viewport.transform.join(",")})`;p.style.transform=m}c&&p.setAttribute("class","xfaLayer xfaFont");const u=[];if(a.children.length===0){if(a.value){const m=document.createTextNode(a.value);d.append(m),c&&Cw.shouldBuildText(a.name)&&u.push(m)}return{textDivs:u}}const h=[[a,-1,d]];for(;h.length>0;){const[m,f,x]=h.at(-1);if(f+1===m.children.length){h.pop();continue}const y=m.children[++h.at(-1)[1]];if(y===null)continue;const{name:w}=y;if(w==="#text"){const v=document.createTextNode(y.value);u.push(v),x.append(v);continue}const b=y?.attributes?.xmlns?document.createElementNS(y.attributes.xmlns,w):document.createElement(w);if(x.append(b),y.attributes&&this.setAttributes({html:b,element:y,storage:o,intent:l,linkService:i}),y.children?.length>0)h.push([y,-1,b]);else if(y.value){const v=document.createTextNode(y.value);c&&Cw.shouldBuildText(w)&&u.push(v),b.append(v)}}for(const m of p.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:u}}static update(t){const o=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=o,t.div.hidden=!1}}const Ib=1e3,PIt=9,V4=new WeakSet;function S0(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class DIt{static create(t){switch(t.data.annotationType){case Ea.LINK:return new OLe(t);case Ea.TEXT:return new TIt(t);case Ea.WIDGET:switch(t.data.fieldType){case"Tx":return new zIt(t);case"Btn":return t.data.radioButton?new NLe(t):t.data.checkBox?new FIt(t):new OIt(t);case"Ch":return new NIt(t);case"Sig":return new RIt(t)}return new uf(t);case Ea.POPUP:return new jQ(t);case Ea.FREETEXT:return new HLe(t);case Ea.LINE:return new _It(t);case Ea.SQUARE:return new VIt(t);case Ea.CIRCLE:return new QIt(t);case Ea.POLYLINE:return new _Le(t);case Ea.CARET:return new WIt(t);case Ea.INK:return new VLe(t);case Ea.POLYGON:return new UIt(t);case Ea.HIGHLIGHT:return new GIt(t);case Ea.UNDERLINE:return new YIt(t);case Ea.SQUIGGLY:return new KIt(t);case Ea.STRIKEOUT:return new qIt(t);case Ea.STAMP:return new QLe(t);case Ea.FILEATTACHMENT:return new ZIt(t);default:return new ta(t)}}}class ta{#e=null;#t=!1;#o=null;constructor(t,{isRenderable:o=!1,ignoreBorder:i=!1,createQuadrilaterals:a=!1}={}){this.isRenderable=o,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,o&&(this.container=this._createContainer(i)),a&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:o,richText:i}){return!!(t?.str||o?.str||i?.str)}get hasPopupData(){return ta._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};const{rect:o}=t;o&&this.#i(o),this.#o?.popup.updateEdited(t)}resetEdited(){this.#e&&(this.#i(this.#e.rect),this.#o?.popup.resetEdited(),this.#e=null)}#i(t){const{container:{style:o},data:{rect:i,rotation:a},parent:{viewport:{rawDims:{pageWidth:l,pageHeight:d,pageX:c,pageY:p}}}}=this;i?.splice(0,4,...t);const{width:u,height:h}=S0(t);o.left=`${100*(t[0]-c)/l}%`,o.top=`${100*(d-t[3]+p)/d}%`,a===0?(o.width=`${100*u/l}%`,o.height=`${100*h/d}%`):this.setRotation(a)}_createContainer(t){const{data:o,parent:{page:i,viewport:a}}=this,l=document.createElement("section");l.setAttribute("data-annotation-id",o.id),this instanceof uf||(l.tabIndex=Ib);const{style:d}=l;if(d.zIndex=this.parent.zIndex++,o.popupRef&&l.setAttribute("aria-haspopup","dialog"),o.alternativeText&&(l.title=o.alternativeText),o.noRotate&&l.classList.add("norotate"),!o.rect||this instanceof jQ){const{rotation:w}=o;return!o.hasOwnCanvas&&w!==0&&this.setRotation(w,l),l}const{width:c,height:p}=S0(o.rect);if(!t&&o.borderStyle.width>0){d.borderWidth=`${o.borderStyle.width}px`;const w=o.borderStyle.horizontalCornerRadius,b=o.borderStyle.verticalCornerRadius;if(w>0||b>0){const A=`calc(${w}px * var(--scale-factor)) / calc(${b}px * var(--scale-factor))`;d.borderRadius=A}else if(this instanceof NLe){const A=`calc(${c}px * var(--scale-factor)) / calc(${p}px * var(--scale-factor))`;d.borderRadius=A}switch(o.borderStyle.style){case U9.SOLID:d.borderStyle="solid";break;case U9.DASHED:d.borderStyle="dashed";break;case U9.BEVELED:Br("Unimplemented border style: beveled");break;case U9.INSET:Br("Unimplemented border style: inset");break;case U9.UNDERLINE:d.borderBottomStyle="solid";break}const v=o.borderColor||null;v?(this.#t=!0,d.borderColor=So.makeHexColor(v[0]|0,v[1]|0,v[2]|0)):d.borderWidth=0}const u=So.normalizeRect([o.rect[0],i.view[3]-o.rect[1]+i.view[1],o.rect[2],i.view[3]-o.rect[3]+i.view[1]]),{pageWidth:h,pageHeight:m,pageX:f,pageY:x}=a.rawDims;d.left=`${100*(u[0]-f)/h}%`,d.top=`${100*(u[1]-x)/m}%`;const{rotation:y}=o;return o.hasOwnCanvas||y===0?(d.width=`${100*c/h}%`,d.height=`${100*p/m}%`):this.setRotation(y,l),l}setRotation(t,o=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:a}=this.parent.viewport.rawDims,{width:l,height:d}=S0(this.data.rect);let c,p;t%180===0?(c=100*l/i,p=100*d/a):(c=100*d/i,p=100*l/a),o.style.width=`${c}%`,o.style.height=`${p}%`,o.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(o,i,a)=>{const l=a.detail[o],d=l[0],c=l.slice(1);a.target.style[i]=Zpe[`${d}_HTML`](c),this.annotationStorage.setValue(this.data.id,{[i]:Zpe[`${d}_rgb`](c)})};return si(this,"_commonActions",{display:o=>{const{display:i}=o.detail,a=i%2===1;this.container.style.visibility=a?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:a,noPrint:i===1||i===2})},print:o=>{this.annotationStorage.setValue(this.data.id,{noPrint:!o.detail.print})},hidden:o=>{const{hidden:i}=o.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:o=>{setTimeout(()=>o.target.focus({preventScroll:!1}),0)},userName:o=>{o.target.title=o.detail.userName},readonly:o=>{o.target.disabled=o.detail.readonly},required:o=>{this._setRequired(o.target,o.detail.required)},bgColor:o=>{t("bgColor","backgroundColor",o)},fillColor:o=>{t("fillColor","backgroundColor",o)},fgColor:o=>{t("fgColor","color",o)},textColor:o=>{t("textColor","color",o)},borderColor:o=>{t("borderColor","borderColor",o)},strokeColor:o=>{t("strokeColor","borderColor",o)},rotation:o=>{const i=o.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(t,o){const i=this._commonActions;for(const a of Object.keys(o.detail))(t[a]||i[a])?.(o)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const o=this.annotationStorage.getRawValue(this.data.id);if(!o)return;const i=this._commonActions;for(const[a,l]of Object.entries(o)){const d=i[a];if(d){const c={detail:{[a]:l},target:t};d(c),delete o[a]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[o,i,a,l]=this.data.rect.map(w=>Math.fround(w));if(t.length===8){const[w,b,v,A]=t.subarray(2,6);if(a===w&&l===b&&o===v&&i===A)return}const{style:d}=this.container;let c;if(this.#t){const{borderColor:w,borderWidth:b}=d;d.borderWidth=0,c=["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="${w}" stroke-width="${b}">`],this.container.classList.add("hasBorder")}const p=a-o,u=l-i,{svgFactory:h}=this,m=h.createElement("svg");m.classList.add("quadrilateralsContainer"),m.setAttribute("width",0),m.setAttribute("height",0);const f=h.createElement("defs");m.append(f);const x=h.createElement("clipPath"),y=`clippath_${this.data.id}`;x.setAttribute("id",y),x.setAttribute("clipPathUnits","objectBoundingBox"),f.append(x);for(let w=2,b=t.length;w<b;w+=8){const v=t[w],A=t[w+1],S=t[w+2],E=t[w+3],I=h.createElement("rect"),L=(S-o)/p,B=(l-A)/u,P=(v-S)/p,D=(A-E)/u;I.setAttribute("x",L),I.setAttribute("y",B),I.setAttribute("width",P),I.setAttribute("height",D),x.append(I),c?.push(`<rect vector-effect="non-scaling-stroke" x="${L}" y="${B}" width="${P}" height="${D}"/>`)}this.#t&&(c.push("</g></svg>')"),d.backgroundImage=c.join("")),this.container.append(m),this.container.style.clipPath=`url(#${y})`}_createPopup(){const{container:t,data:o}=this;t.setAttribute("aria-haspopup","dialog");const i=this.#o=new jQ({data:{color:o.color,titleObj:o.titleObj,modificationDate:o.modificationDate,contentsObj:o.contentsObj,richText:o.richText,parentRect:o.rect,borderStyle:0,id:`popup_${o.id}`,rotation:o.rotation},parent:this.parent,elements:[this]});this.parent.div.append(i.render())}render(){zi("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,o=null){const i=[];if(this._fieldObjects){const a=this._fieldObjects[t];if(a)for(const{page:l,id:d,exportValues:c}of a){if(l===-1||d===o)continue;const p=typeof c=="string"?c:null,u=document.querySelector(`[data-element-id="${d}"]`);if(u&&!V4.has(u)){Br(`_getElementsByName - element not allowed: ${d}`);continue}i.push({id:d,exportValue:p,domElement:u})}return i}for(const a of document.getElementsByName(t)){const{exportValue:l}=a,d=a.getAttribute("data-element-id");d!==o&&V4.has(a)&&i.push({id:d,exportValue:l,domElement:a})}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const o of t)o.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:o}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:o})})}}class OLe extends ta{constructor(t,o=null){super(t,{isRenderable:!0,ignoreBorder:!!o?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:o}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let a=!1;return t.url?(o.addLinkAttributes(i,t.url,t.newWindow),a=!0):t.action?(this._bindNamedAction(i,t.action),a=!0):t.attachment?(this.#t(i,t.attachment,t.attachmentDest),a=!0):t.setOCGState?(this.#o(i,t.setOCGState),a=!0):t.dest?(this._bindLink(i,t.dest),a=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),a=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),a=!0):this.isTooltipOnly&&!a&&(this._bindLink(i,""),a=!0)),this.container.classList.add("linkAnnotation"),a&&this.container.append(i),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(t,o){t.href=this.linkService.getDestinationHash(o),t.onclick=()=>(o&&this.linkService.goToDestination(o),!1),(o||o==="")&&this.#e()}_bindNamedAction(t,o){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(o),!1),this.#e()}#t(t,o,i=null){t.href=this.linkService.getAnchorUrl(""),o.description&&(t.title=o.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(o.content,o.filename,i),!1),this.#e()}#o(t,o){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(o),!1),this.#e()}_bindJSAction(t,o){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const a of Object.keys(o.actions)){const l=i.get(a);l&&(t[l]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o.id,name:a}}),!1))}t.onclick||(t.onclick=()=>!1),this.#e()}_bindResetFormAction(t,o){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){Br('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(t.onclick=()=>!1);return}t.onclick=()=>{i?.();const{fields:a,refs:l,include:d}=o,c=[];if(a.length!==0||l.length!==0){const h=new Set(l);for(const m of a){const f=this._fieldObjects[m]||[];for(const{id:x}of f)h.add(x)}for(const m of Object.values(this._fieldObjects))for(const f of m)h.has(f.id)===d&&c.push(f)}else for(const h of Object.values(this._fieldObjects))c.push(...h);const p=this.annotationStorage,u=[];for(const h of c){const{id:m}=h;switch(u.push(m),h.type){case"text":{const x=h.defaultValue||"";p.setValue(m,{value:x});break}case"checkbox":case"radiobutton":{const x=h.defaultValue===h.exportValues;p.setValue(m,{value:x});break}case"combobox":case"listbox":{const x=h.defaultValue||"";p.setValue(m,{value:x});break}default:continue}const f=document.querySelector(`[data-element-id="${m}"]`);if(f){if(!V4.has(f)){Br(`_bindResetFormAction - element not allowed: ${m}`);continue}}else continue;f.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:u,name:"ResetForm"}}),!1}}}class TIt extends ta{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class uf extends ta{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return sd.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,o,i,a,l){i.includes("mouse")?t.addEventListener(i,d=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(d),shift:d.shiftKey,modifier:this._getKeyModifier(d)}})}):t.addEventListener(i,d=>{if(i==="blur"){if(!o.focused||!d.relatedTarget)return;o.focused=!1}else if(i==="focus"){if(o.focused)return;o.focused=!0}l&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(d)}})})}_setEventListeners(t,o,i,a){for(const[l,d]of i)(d==="Action"||this.data.actions?.[d])&&((d==="Focus"||d==="Blur")&&(o||={focused:!1}),this._setEventListener(t,o,l,d,a),d==="Focus"&&!this.data.actions?.Blur?this._setEventListener(t,o,"blur","Blur",null):d==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(t,o,"focus","Focus",null))}_setBackgroundColor(t){const o=this.data.backgroundColor||null;t.style.backgroundColor=o===null?"transparent":So.makeHexColor(o[0],o[1],o[2])}_setTextStyle(t){const o=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||PIt,l=t.style;let d;const c=2,p=u=>Math.round(10*u)/10;if(this.data.multiLine){const u=Math.abs(this.data.rect[3]-this.data.rect[1]-c),h=Math.round(u/(EO*a))||1,m=u/h;d=Math.min(a,p(m/EO))}else{const u=Math.abs(this.data.rect[3]-this.data.rect[1]-c);d=Math.min(a,p(u/EO))}l.fontSize=`calc(${d}px * var(--scale-factor))`,l.color=So.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(l.textAlign=o[this.data.textAlignment])}_setRequired(t,o){o?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",o)}}class zIt extends uf{constructor(t){const o=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:o})}setPropertyOnSiblings(t,o,i,a){const l=this.annotationStorage;for(const d of this._getElementsByName(t.name,t.id))d.domElement&&(d.domElement[o]=i),l.setValue(d.id,{[a]:i})}render(){const t=this.annotationStorage,o=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const a=t.getValue(o,{value:this.data.fieldValue});let l=a.value||"";const d=t.getValue(o,{charLimit:this.data.maxLen}).charLimit;d&&l.length>d&&(l=l.slice(0,d));let c=a.formattedValue||this.data.textContent?.join(`
247
247
  `)||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const p={userValue:l,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=c??l,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",c??l),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),V4.add(i),i.setAttribute("data-element-id",o),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=Ib,this._setRequired(i,this.data.required),d&&(i.maxLength=d),i.addEventListener("input",h=>{t.setValue(o,{value:h.target.value}),this.setPropertyOnSiblings(i,"value",h.target.value,"value"),p.formattedValue=null}),i.addEventListener("resetform",h=>{const m=this.data.defaultFieldValue??"";i.value=p.userValue=m,p.formattedValue=null});let u=h=>{const{formattedValue:m}=p;m!=null&&(h.target.value=m),h.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",m=>{if(p.focused)return;const{target:f}=m;p.userValue&&(f.value=p.userValue),p.lastCommittedValue=f.value,p.commitKey=1,this.data.actions?.Focus||(p.focused=!0)}),i.addEventListener("updatefromsandbox",m=>{this.showElementAndHideCanvas(m.target);const f={value(x){p.userValue=x.detail.value??"",t.setValue(o,{value:p.userValue.toString()}),x.target.value=p.userValue},formattedValue(x){const{formattedValue:y}=x.detail;p.formattedValue=y,y!=null&&x.target!==document.activeElement&&(x.target.value=y),t.setValue(o,{formattedValue:y})},selRange(x){x.target.setSelectionRange(...x.detail.selRange)},charLimit:x=>{const{charLimit:y}=x.detail,{target:w}=x;if(y===0){w.removeAttribute("maxLength");return}w.setAttribute("maxLength",y);let b=p.userValue;!b||b.length<=y||(b=b.slice(0,y),w.value=p.userValue=b,t.setValue(o,{value:b}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:b,willCommit:!0,commitKey:1,selStart:w.selectionStart,selEnd:w.selectionEnd}}))}};this._dispatchEventFromSandbox(f,m)}),i.addEventListener("keydown",m=>{p.commitKey=1;let f=-1;if(m.key==="Escape"?f=0:m.key==="Enter"&&!this.data.multiLine?f=2:m.key==="Tab"&&(p.commitKey=3),f===-1)return;const{value:x}=m.target;p.lastCommittedValue!==x&&(p.lastCommittedValue=x,p.userValue=x,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:x,willCommit:!0,commitKey:f,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}))});const h=u;u=null,i.addEventListener("blur",m=>{if(!p.focused||!m.relatedTarget)return;this.data.actions?.Blur||(p.focused=!1);const{value:f}=m.target;p.userValue=f,p.lastCommittedValue!==f&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:f,willCommit:!0,commitKey:p.commitKey,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}),h(m)}),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",m=>{p.lastCommittedValue=null;const{data:f,target:x}=m,{value:y,selectionStart:w,selectionEnd:b}=x;let v=w,A=b;switch(m.inputType){case"deleteWordBackward":{const S=y.substring(0,w).match(/\w*[^\w]*$/);S&&(v-=S[0].length);break}case"deleteWordForward":{const S=y.substring(w).match(/^[^\w]*\w*/);S&&(A+=S[0].length);break}case"deleteContentBackward":w===b&&(v-=1);break;case"deleteContentForward":w===b&&(A+=1);break}m.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:y,change:f||"",willCommit:!1,selStart:v,selEnd:A}})}),this._setEventListeners(i,p,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],m=>m.target.value)}if(u&&i.addEventListener("blur",u),this.data.comb){const m=(this.data.rect[2]-this.data.rect[0])/d;i.classList.add("comb"),i.style.letterSpacing=`calc(${m}px * var(--scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class RIt extends uf{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class FIt extends uf{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,o=this.data,i=o.id;let a=t.getValue(i,{value:o.exportValue===o.fieldValue}).value;typeof a=="string"&&(a=a!=="Off",t.setValue(i,{value:a})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const l=document.createElement("input");return V4.add(l),l.setAttribute("data-element-id",i),l.disabled=o.readOnly,this._setRequired(l,this.data.required),l.type="checkbox",l.name=o.fieldName,a&&l.setAttribute("checked",!0),l.setAttribute("exportValue",o.exportValue),l.tabIndex=Ib,l.addEventListener("change",d=>{const{name:c,checked:p}=d.target;for(const u of this._getElementsByName(c,i)){const h=p&&u.exportValue===o.exportValue;u.domElement&&(u.domElement.checked=h),t.setValue(u.id,{value:h})}t.setValue(i,{value:p})}),l.addEventListener("resetform",d=>{const c=o.defaultFieldValue||"Off";d.target.checked=c===o.exportValue}),this.enableScripting&&this.hasJSActions&&(l.addEventListener("updatefromsandbox",d=>{const c={value(p){p.target.checked=p.detail.value!=="Off",t.setValue(i,{value:p.target.checked})}};this._dispatchEventFromSandbox(c,d)}),this._setEventListeners(l,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],d=>d.target.checked)),this._setBackgroundColor(l),this._setDefaultPropertiesFromJS(l),this.container.append(l),this.container}}class NLe extends uf{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,o=this.data,i=o.id;let a=t.getValue(i,{value:o.fieldValue===o.buttonValue}).value;if(typeof a=="string"&&(a=a!==o.buttonValue,t.setValue(i,{value:a})),a)for(const d of this._getElementsByName(o.fieldName,i))t.setValue(d.id,{value:!1});const l=document.createElement("input");if(V4.add(l),l.setAttribute("data-element-id",i),l.disabled=o.readOnly,this._setRequired(l,this.data.required),l.type="radio",l.name=o.fieldName,a&&l.setAttribute("checked",!0),l.tabIndex=Ib,l.addEventListener("change",d=>{const{name:c,checked:p}=d.target;for(const u of this._getElementsByName(c,i))t.setValue(u.id,{value:!1});t.setValue(i,{value:p})}),l.addEventListener("resetform",d=>{const c=o.defaultFieldValue;d.target.checked=c!=null&&c===o.buttonValue}),this.enableScripting&&this.hasJSActions){const d=o.buttonValue;l.addEventListener("updatefromsandbox",c=>{const p={value:u=>{const h=d===u.detail.value;for(const m of this._getElementsByName(u.target.name)){const f=h&&m.id===i;m.domElement&&(m.domElement.checked=f),t.setValue(m.id,{value:f})}}};this._dispatchEventFromSandbox(p,c)}),this._setEventListeners(l,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],c=>c.target.checked)}return this._setBackgroundColor(l),this._setDefaultPropertiesFromJS(l),this.container.append(l),this.container}}class OIt extends OLe{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const o=t.lastChild;return this.enableScripting&&this.hasJSActions&&o&&(this._setDefaultPropertiesFromJS(o),o.addEventListener("updatefromsandbox",i=>{this._dispatchEventFromSandbox({},i)})),t}}class NIt extends uf{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,o=this.data.id,i=t.getValue(o,{value:this.data.fieldValue}),a=document.createElement("select");V4.add(a),a.setAttribute("data-element-id",o),a.disabled=this.data.readOnly,this._setRequired(a,this.data.required),a.name=this.data.fieldName,a.tabIndex=Ib;let l=this.data.combo&&this.data.options.length>0;this.data.combo||(a.size=this.data.options.length,this.data.multiSelect&&(a.multiple=!0)),a.addEventListener("resetform",h=>{const m=this.data.defaultFieldValue;for(const f of a.options)f.selected=f.value===m});for(const h of this.data.options){const m=document.createElement("option");m.textContent=h.displayValue,m.value=h.exportValue,i.value.includes(h.exportValue)&&(m.setAttribute("selected",!0),l=!1),a.append(m)}let d=null;if(l){const h=document.createElement("option");h.value=" ",h.setAttribute("hidden",!0),h.setAttribute("selected",!0),a.prepend(h),d=()=>{h.remove(),a.removeEventListener("input",d),d=null},a.addEventListener("input",d)}const c=h=>{const m=h?"value":"textContent",{options:f,multiple:x}=a;return x?Array.prototype.filter.call(f,y=>y.selected).map(y=>y[m]):f.selectedIndex===-1?null:f[f.selectedIndex][m]};let p=c(!1);const u=h=>{const m=h.target.options;return Array.prototype.map.call(m,f=>({displayValue:f.textContent,exportValue:f.value}))};return this.enableScripting&&this.hasJSActions?(a.addEventListener("updatefromsandbox",h=>{const m={value(f){d?.();const x=f.detail.value,y=new Set(Array.isArray(x)?x:[x]);for(const w of a.options)w.selected=y.has(w.value);t.setValue(o,{value:c(!0)}),p=c(!1)},multipleSelection(f){a.multiple=!0},remove(f){const x=a.options,y=f.detail.remove;x[y].selected=!1,a.remove(y),x.length>0&&Array.prototype.findIndex.call(x,b=>b.selected)===-1&&(x[0].selected=!0),t.setValue(o,{value:c(!0),items:u(f)}),p=c(!1)},clear(f){for(;a.length!==0;)a.remove(0);t.setValue(o,{value:null,items:[]}),p=c(!1)},insert(f){const{index:x,displayValue:y,exportValue:w}=f.detail.insert,b=a.children[x],v=document.createElement("option");v.textContent=y,v.value=w,b?b.before(v):a.append(v),t.setValue(o,{value:c(!0),items:u(f)}),p=c(!1)},items(f){const{items:x}=f.detail;for(;a.length!==0;)a.remove(0);for(const y of x){const{displayValue:w,exportValue:b}=y,v=document.createElement("option");v.textContent=w,v.value=b,a.append(v)}a.options.length>0&&(a.options[0].selected=!0),t.setValue(o,{value:c(!0),items:u(f)}),p=c(!1)},indices(f){const x=new Set(f.detail.indices);for(const y of f.target.options)y.selected=x.has(y.index);t.setValue(o,{value:c(!0)}),p=c(!1)},editable(f){f.target.disabled=!f.detail.editable}};this._dispatchEventFromSandbox(m,h)}),a.addEventListener("input",h=>{const m=c(!0),f=c(!1);t.setValue(o,{value:m}),h.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:p,change:f,changeEx:m,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(a,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],h=>h.target.value)):a.addEventListener("input",function(h){t.setValue(o,{value:c(!0)})}),this.data.combo&&this._setTextStyle(a),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class jQ extends ta{constructor(t){const{data:o,elements:i}=t;super(t,{isRenderable:ta._hasPopupData(o)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new HIt({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}),o=[];for(const i of this.elements)i.popup=t,o.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",o.map(i=>`${vLe}${i}`).join(",")),this.container}}class HIt{#e=this.#I.bind(this);#t=this.#C.bind(this);#o=this.#x.bind(this);#i=this.#b.bind(this);#s=null;#r=null;#n=null;#l=null;#c=null;#p=null;#h=null;#d=!1;#a=null;#m=null;#f=null;#u=null;#y=null;#g=null;#w=!1;constructor({container:t,color:o,elements:i,titleObj:a,modificationDate:l,contentsObj:d,richText:c,parent:p,rect:u,parentRect:h,open:m}){this.#r=t,this.#y=a,this.#n=d,this.#u=c,this.#p=p,this.#s=o,this.#f=u,this.#h=h,this.#c=i,this.#l=kLe.toDateObject(l),this.trigger=i.flatMap(f=>f.getElementsToTriggerPopup());for(const f of this.trigger)f.addEventListener("click",this.#i),f.addEventListener("mouseenter",this.#o),f.addEventListener("mouseleave",this.#t),f.classList.add("popupTriggerArea");for(const f of i)f.container?.addEventListener("keydown",this.#e);this.#r.hidden=!0,m&&this.#b()}render(){if(this.#a)return;const t=this.#a=document.createElement("div");if(t.className="popup",this.#s){const l=t.style.outlineColor=So.makeHexColor(...this.#s);CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?t.style.backgroundColor=`color-mix(in srgb, ${l} 30%, white)`:t.style.backgroundColor=So.makeHexColor(...this.#s.map(c=>Math.floor(.7*(255-c)+c)))}const o=document.createElement("span");o.className="header";const i=document.createElement("h1");if(o.append(i),{dir:i.dir,str:i.textContent}=this.#y,t.append(o),this.#l){const l=document.createElement("span");l.classList.add("popupDate"),l.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),l.setAttribute("data-l10n-args",JSON.stringify({date:this.#l.toLocaleDateString(),time:this.#l.toLocaleTimeString()})),o.append(l)}const a=this.#v;if(a)FLe.render({xfaHtml:a,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const l=this._formatContents(this.#n);t.append(l)}this.#r.append(t)}get#v(){const t=this.#u,o=this.#n;return t?.str&&(!o?.str||o.str===t.str)&&this.#u.html||null}get#A(){return this.#v?.attributes?.style?.fontSize||0}get#k(){return this.#v?.attributes?.style?.color||null}#S(t){const o=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:o}]}},a={style:{color:this.#k,fontSize:this.#A?`calc(${this.#A}px * var(--scale-factor))`:""}};for(const l of t.split(`
248
248
  `))o.push({name:"span",value:l,attributes:a});return i}_formatContents({str:t,dir:o}){const i=document.createElement("p");i.classList.add("popupContent"),i.dir=o;const a=t.split(/(?:\r\n?|\n)/);for(let l=0,d=a.length;l<d;++l){const c=a[l];i.append(document.createTextNode(c)),l<d-1&&i.append(document.createElement("br"))}return i}#I(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&this.#d)&&this.#b()}updateEdited({rect:t,popupContent:o}){this.#g||={contentsObj:this.#n,richText:this.#u},t&&(this.#m=null),o&&(this.#u=this.#S(o),this.#n=null),this.#a?.remove(),this.#a=null}resetEdited(){this.#g&&({contentsObj:this.#n,richText:this.#u}=this.#g,this.#g=null,this.#a?.remove(),this.#a=null,this.#m=null)}#$(){if(this.#m!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:o,pageHeight:i,pageX:a,pageY:l}}}=this.#p;let d=!!this.#h,c=d?this.#h:this.#f;for(const y of this.#c)if(!c||So.intersect(y.data.rect,c)!==null){c=y.data.rect,d=!0;break}const p=So.normalizeRect([c[0],t[3]-c[1]+t[1],c[2],t[3]-c[3]+t[1]]),h=d?c[2]-c[0]+5:0,m=p[0]+h,f=p[1];this.#m=[100*(m-a)/o,100*(f-l)/i];const{style:x}=this.#r;x.left=`${this.#m[0]}%`,x.top=`${this.#m[1]}%`}#b(){this.#d=!this.#d,this.#d?(this.#x(),this.#r.addEventListener("click",this.#i),this.#r.addEventListener("keydown",this.#e)):(this.#C(),this.#r.removeEventListener("click",this.#i),this.#r.removeEventListener("keydown",this.#e))}#x(){this.#a||this.render(),this.isVisible?this.#d&&this.#r.classList.add("focused"):(this.#$(),this.#r.hidden=!1,this.#r.style.zIndex=parseInt(this.#r.style.zIndex)+1e3)}#C(){this.#r.classList.remove("focused"),!(this.#d||!this.isVisible)&&(this.#r.hidden=!0,this.#r.style.zIndex=parseInt(this.#r.style.zIndex)-1e3)}forceHide(){this.#w=this.isVisible,this.#w&&(this.#r.hidden=!0)}maybeShow(){this.#w&&(this.#a||this.#x(),this.#w=!1,this.#r.hidden=!1)}get isVisible(){return this.#r.hidden===!1}}class HLe extends ta{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Xr.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const o of this.textContent){const i=document.createElement("span");i.textContent=o,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}class _It extends ta{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:o,height:i}=S0(t.rect),a=this.svgFactory.create(o,i,!0),l=this.#e=this.svgFactory.createElement("svg:line");return l.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),l.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),l.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),l.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),l.setAttribute("stroke-width",t.borderStyle.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),a.append(l),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class VIt extends ta{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:o,height:i}=S0(t.rect),a=this.svgFactory.create(o,i,!0),l=t.borderStyle.width,d=this.#e=this.svgFactory.createElement("svg:rect");return d.setAttribute("x",l/2),d.setAttribute("y",l/2),d.setAttribute("width",o-l),d.setAttribute("height",i-l),d.setAttribute("stroke-width",l||1),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),a.append(d),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class QIt extends ta{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:o,height:i}=S0(t.rect),a=this.svgFactory.create(o,i,!0),l=t.borderStyle.width,d=this.#e=this.svgFactory.createElement("svg:ellipse");return d.setAttribute("cx",o/2),d.setAttribute("cy",i/2),d.setAttribute("rx",o/2-l/2),d.setAttribute("ry",i/2-l/2),d.setAttribute("stroke-width",l||1),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),a.append(d),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class _Le extends ta{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:o,borderStyle:i,popupRef:a}}=this;if(!o)return this.container;const{width:l,height:d}=S0(t),c=this.svgFactory.create(l,d,!0);let p=[];for(let h=0,m=o.length;h<m;h+=2){const f=o[h]-t[0],x=t[3]-o[h+1];p.push(`${f},${x}`)}p=p.join(" ");const u=this.#e=this.svgFactory.createElement(this.svgElementName);return u.setAttribute("points",p),u.setAttribute("stroke-width",i.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),c.append(u),this.container.append(c),!a&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class UIt extends _Le{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class WIt extends ta{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class VLe extends ta{#e=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=Xr.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:o,borderStyle:i,popupRef:a}}=this,{width:l,height:d}=S0(t),c=this.svgFactory.create(l,d,!0);for(const p of o){let u=[];for(let m=0,f=p.length;m<f;m+=2){const x=p[m]-t[0],y=t[3]-p[m+1];u.push(`${x},${y}`)}u=u.join(" ");const h=this.svgFactory.createElement(this.svgElementName);this.#e.push(h),h.setAttribute("points",u),h.setAttribute("stroke-width",i.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),!a&&this.hasPopupData&&this._createPopup(),c.append(h)}return this.container.append(c),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class GIt extends ta{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class YIt extends ta{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class KIt extends ta{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class qIt extends ta{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class QLe extends ta{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class ZIt extends ta{#e=null;constructor(t){super(t,{isRenderable:!0});const{file:o}=this.data;this.filename=o.filename,this.content=o.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...o})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:o}=this;let i;o.hasAppearance||o.fillAlpha===0?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(o.name)?"paperclip":"pushpin"}.svg`,o.fillAlpha&&o.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(o.fillAlpha*100)}%);`)),i.addEventListener("dblclick",this.#t.bind(this)),this.#e=i;const{isMac:a}=sd.platform;return t.addEventListener("keydown",l=>{l.key==="Enter"&&(a?l.metaKey:l.ctrlKey)&&this.#t()}),!o.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}let JIt=class{#e=null;#t=null;#o=new Map;constructor({div:t,accessibilityManager:o,annotationCanvasMap:i,annotationEditorUIManager:a,page:l,viewport:d}){this.div=t,this.#e=o,this.#t=i,this.page=l,this.viewport=d,this.zIndex=0,this._annotationEditorUIManager=a}#i(t,o){const i=t.firstChild||t;i.id=`${vLe}${o}`,this.div.append(t),this.#e?.moveElementInDOM(this.div,t,i,!1)}async render(t){const{annotations:o}=t,i=this.div;_4(i,this.viewport);const a=new Map,l={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new iK,annotationStorage:t.annotationStorage||new uK,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const d of o){if(d.noHTML)continue;const c=d.annotationType===Ea.POPUP;if(c){const h=a.get(d.id);if(!h)continue;l.elements=h}else{const{width:h,height:m}=S0(d.rect);if(h<=0||m<=0)continue}l.data=d;const p=DIt.create(l);if(!p.isRenderable)continue;if(!c&&d.popupRef){const h=a.get(d.popupRef);h?h.push(p):a.set(d.popupRef,[p])}const u=p.render();d.hidden&&(u.style.visibility="hidden"),this.#i(u,d.id),p.annotationEditorType>0&&(this.#o.set(p.data.id,p),this._annotationEditorUIManager?.renderAnnotationElement(p))}this.#s()}update({viewport:t}){const o=this.div;this.viewport=t,_4(o,{rotation:t.rotation}),this.#s(),o.hidden=!1}#s(){if(!this.#t)return;const t=this.div;for(const[o,i]of this.#t){const a=t.querySelector(`[data-annotation-id="${o}"]`);if(!a)continue;i.className="annotationContent";const{firstChild:l}=a;l?l.nodeName==="CANVAS"?l.replaceWith(i):l.classList.contains("annotationContent")?l.after(i):l.before(i):a.append(i)}this.#t.clear()}getEditableAnnotations(){return Array.from(this.#o.values())}getEditableAnnotation(t){return this.#o.get(t)}};const MC=/\r\n?|\n/g;class Ia extends or{#e=this.editorDivBlur.bind(this);#t=this.editorDivFocus.bind(this);#o=this.editorDivInput.bind(this);#i=this.editorDivKeydown.bind(this);#s=this.editorDivPaste.bind(this);#r;#n="";#l=`${this.id}-editor`;#c;#p=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=Ia.prototype,o=l=>l.isEmpty(),i=Mm.TRANSLATE_SMALL,a=Mm.TRANSLATE_BIG;return si(this,"_keyboardManager",new Lb([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:o}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-a,0],checker:o}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:o}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[a,0],checker:o}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:o}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-a],checker:o}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:o}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,a],checker:o}]]))}static _type="freetext";static _editorType=Xr.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.#r=t.color||Ia._defaultColor||or._defaultLineColor,this.#c=t.fontSize||Ia._defaultFontSize}static initialize(t,o){or.initialize(t,o,{strings:["pdfjs-free-text-default-content"]});const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,o){switch(t){case ar.FREETEXT_SIZE:Ia._defaultFontSize=o;break;case ar.FREETEXT_COLOR:Ia._defaultColor=o;break}}updateParams(t,o){switch(t){case ar.FREETEXT_SIZE:this.#h(o);break;case ar.FREETEXT_COLOR:this.#d(o);break}}static get defaultPropertiesToUpdate(){return[[ar.FREETEXT_SIZE,Ia._defaultFontSize],[ar.FREETEXT_COLOR,Ia._defaultColor||or._defaultLineColor]]}get propertiesToUpdate(){return[[ar.FREETEXT_SIZE,this.#c],[ar.FREETEXT_COLOR,this.#r]]}#h(t){const o=a=>{this.editorDiv.style.fontSize=`calc(${a}px * var(--scale-factor))`,this.translate(0,-(a-this.#c)*this.parentScale),this.#c=a,this.#m()},i=this.#c;this.addCommands({cmd:o.bind(this,t),undo:o.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ar.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#d(t){const o=a=>{this.#r=this.editorDiv.style.color=a},i=this.#r;this.addCommands({cmd:o.bind(this,t),undo:o.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ar.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,o){this._uiManager.translateSelectedEditors(t,o,!0)}getInitialTranslation(){const t=this.parentScale;return[-Ia._internalPadding*t,-(Ia._internalPadding+this.#c)*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(Xr.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant");const t=this._uiManager._signal;this.editorDiv.addEventListener("keydown",this.#i,{signal:t}),this.editorDiv.addEventListener("focus",this.#t,{signal:t}),this.editorDiv.addEventListener("blur",this.#e,{signal:t}),this.editorDiv.addEventListener("input",this.#o,{signal:t}),this.editorDiv.addEventListener("paste",this.#s,{signal:t})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#l),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#i),this.editorDiv.removeEventListener("focus",this.#t),this.editorDiv.removeEventListener("blur",this.#e),this.editorDiv.removeEventListener("input",this.#o),this.editorDiv.removeEventListener("paste",this.#s),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#a(){const t=[];this.editorDiv.normalize();for(const o of this.editorDiv.childNodes)t.push(Ia.#f(o));return t.join(`
249
249
  `)}#m(){const[t,o]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:a,div:l}=this,d=l.style.display,c=l.classList.contains("hidden");l.classList.remove("hidden"),l.style.display="hidden",a.div.append(this.div),i=l.getBoundingClientRect(),l.remove(),l.style.display=d,l.classList.toggle("hidden",c)}this.rotation%180===this.parentRotation%180?(this.width=i.width/t,this.height=i.height/o):(this.width=i.height/t,this.height=i.width/o),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#n,o=this.#n=this.#a().trimEnd();if(t===o)return;const i=a=>{if(this.#n=a,!a){this.remove();return}this.#u(),this._uiManager.rebuild(this),this.#m()};this.addCommands({cmd:()=>{i(o)},undo:()=>{i(t)},mustExec:!1}),this.#m()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&t.key==="Enter"&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){Ia._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,o;this.width&&(t=this.x,o=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#l),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),or._l10nPromise.get("pdfjs-free-text-default-content").then(a=>this.editorDiv?.setAttribute("default-content",a)),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#c}px * var(--scale-factor))`,i.color=this.#r,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),bS(this,this.div,["dblclick","keydown"]),this.width){const[a,l]=this.parentDimensions;if(this.annotationElementId){const{position:d}=this.#p;let[c,p]=this.getInitialTranslation();[c,p]=this.pageTranslationToScreen(c,p);const[u,h]=this.pageDimensions,[m,f]=this.pageTranslation;let x,y;switch(this.rotation){case 0:x=t+(d[0]-m)/u,y=o+this.height-(d[1]-f)/h;break;case 90:x=t+(d[0]-m)/u,y=o-(d[1]-f)/h,[c,p]=[p,-c];break;case 180:x=t-this.width+(d[0]-m)/u,y=o-(d[1]-f)/h,[c,p]=[-c,-p];break;case 270:x=t+(d[0]-m-this.height*h)/u,y=o+(d[1]-f-this.width*u)/h,[c,p]=[-p,c];break}this.setAt(x*a,y*l,c,p)}else this.setAt(t*a,o*l,this.width*a,this.height*l);this.#u(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#f(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(MC,"")}editorDivPaste(t){const o=t.clipboardData||window.clipboardData,{types:i}=o;if(i.length===1&&i[0]==="text/plain")return;t.preventDefault();const a=Ia.#g(o.getData("text")||"").replaceAll(MC,`
@@ -348,7 +348,7 @@ Initiate your first transfer to start earning yield.`,insuredFundsTooltip:"Secur
348
348
  The KYB info is required to comply with financial regulations and uphold the security of our customers.`},link_card:{footNote:{text1:"Or, use credit card instead (3% fee)",text2:"Switch to credit card (3% fee)"},footNoteCard:{text1:"Switch to bank account — save 3% on your fee"}}},navBar:{skipText:"Skip, I will do this later",link_payment_account:{title:"Go live with your Zeni Dashboard!",subTitle:"To setup your Zeni dashboard, please complete the following steps"},qbo_connection:{title:"Connect to QBO",subTitle:"To set up your dashboard, we must connect with your QuickBooks account."},company_officer:{title:"Verify Identity",subTitle:`Enter proof of identity to complete verification.
349
349
  The KYC info is required to comply with the Bank Secrecy Act and Anti-Money Laundering regulations.`},company_details:{title:"Verify Business",subTitle:`Enter business details to complete verification.
350
350
  The KYB info is required to comply with financial regulations and uphold the security of our customers.`}},sections:{link_payment_account:{title:"Set up Payment",text:"Link Bank Account",subText:"Log in securely to your bank and start managing your payments right away",defaultAccountLabel:"Bank Account",smsOptIn:"SMS Opt-in",smsOptOut:"SMS Opt-out",bankVerificationTitle:"Follow these steps to verify bank account",plaidSmsVerification:"An example of Plaid sending an SMS with the verification link",highlightedWords:{depositAmount:"$0.01",plaidSms:"Plaid will then send you a",smsWithALink:"SMS with a link",zeniAccountVerify:"ZENI ACCTVERIFY",smsLink:"link in the SMS",startVerification:"Start Verification"},bankVerification1:{step1:"Within a few days, you'll see a $0.01 deposit from Plaid in your bank account.",step2:"Plaid will then send you an SMS with a link (unless opted out) to complete the verification.",step3:'Check your bank statement for a 3-letter code after "#" symbol in "ZENI ACCTVERIFY" transaction.',step4:'Open the link in the SMS from Plaid or click "Start Verification" below to verify.'},bankVerification2:{step1:"Within a few days, you'll see a $0.01 deposit from Plaid in your bank account",step2:'Check your bank statement for a 3-letter code after "#" symbol in "ZENI ACCTVERIFY" transaction.',step3:'Enter this code by clicking "Start Verification" button below to complete your verification.'},verifyButton:"Verify Bank Account",startVerification:"Start Verification",verificationNotice:{title:"We're verifying your account via Plaid",subTitle:"This may take up to 2 business days.",notificationText:"Once verified, we’ll notify you via email so you can complete the onboarding."}},card_payment_method:{header:"Set up Payment",subHeader:"Securely add your preferred payment method to activate your account.",titleText:"Credit Card",addNewCard:"Link a new card",protectedCardNo:"****"},connectLedger:{pageTitle:"Connect your ledger",pageSubtitle:"Required foundation for both AI Agents",introBody:"This is the moment AI Accountant activates. In the first 2 hours it will read your books, detect recurring journal entry patterns, flag variance anomalies, and hand AI CFO the financial foundation it needs to answer any question you ask.",whatHappensHeading:"What happens after you connect?",firstPhase:{title:"First 2 hours",body:"Reads your chart of accounts and every transaction to build a complete finance graph of your company — a structured model of vendors, accounts, cash flows, and relationships that powers every automated report."},secondPhase:{title:"First 2 to 4 hours — your AI gets personal",body:"Zeni builds AI models fine-tuned specifically to {tenantName} — your vendors, your chart of accounts, your accounting patterns. Trained on signals from 1,000+ Zeni customers and over $20B in transactions."},unlocksTooltip:{quickbooks:{heading:"What you unlock by connecting Quickbooks",accountantSectionLabel:"AI Accountant",cfoSectionLabel:"AI CFO",accountantBullets:["Auto-categorizes every transaction into your chart of accounts.","Reconciles bank, card, and ledger lines end-to-end.","Drafts the journal entries that close your books."],cfoBullets:["Grounds every forecast and answer in your live ledger.","Powers cash, burn, and runway in the dashboard."]},netsuite:{heading:"What you will unlock by connecting NetSuite",accountantSectionLabel:"AI Accountant",cfoSectionLabel:"AI CFO",accountantBullets:["Consolidates close across every subsidiary in your structure.","Drafts multi-entity GL with intercompany eliminations.","Handles advanced revenue recognition schedules."],cfoBullets:["Rolls cash, burn, and runway up across all subsidiaries.","Forecasts respect entity-level transfer pricing and FX."]}}},officerVerification:{introTitle:"Verify your identity",introBody:"Upload a government-issued ID below. Zeni AI reads the document and autofills your details automatically — no manual typing required.",aiCallout:{prefix:"Zeni AI",body:"will retrieve data from the document once you upload it and autofill the details."},autofillFooter:"Fields marked with the Zeni AI sparkle were autofilled from your uploaded document."},companyVerification:{introTitle:"Verify your business.",introBody:"Upload your EIN document. Zeni AI extracts all business details automatically — no manual typing required.",aiCallout:{prefix:"Zeni AI",body:"will retrieve data from your EIN document and autofill all business details."},autofillFooter:"Fields marked with the Zeni AI sparkle were autofilled from your uploaded document."},unlockFinancialStack:{pageTitle:"Unlock your financial stack",pageSubtitle:"You can complete verification any time from Company Settings.",introTitle:"Verify once. Unlock two financial products.",introBody:"A quick identity and business check — required for financial compliance and takes about 5 minutes. Your AI Agents are already working. When you use Zeni's own products, every transaction flows natively into AI Accountant with zero gaps — your close literally takes care of itself. Here is what you unlock.",products:{chargeCard:{name:"Zeni Charge Card",value:"1.75% cashback",body:"On every purchase. No annual fees, no foreign transaction fees, no complexity. Credit based on your financial health — no personal guarantee."},businessChecking:{name:"Business Checking",value:"2.5% APY",body:"FDIC insured up to $3M through Thread Bank sweep network. Interest compounded daily. No minimums, unlimited accounts."},treasury:{name:"Treasury",value:"Up to 4% APY",body:"Put idle cash to work automatically. Smart allocation across instruments to maximize yield on your operating reserves."},billPay:{name:"Bill Pay",value:"FREE Unlimited",body:"Free domestic transfers, free USD international wires, $0 ACH fees. AI auto-fills invoice details and handles all journal entries automatically."},reimbursements:{name:"Reimbursements",value:"FREE Unlimited",body:"Unlimited reimbursements with same-day ACH payouts. Supports 160 currencies, multi-level approval workflows, and AI categorization built in."},debitCard:{name:"Zeni Debit Card",value:"1.75% cashback",body:"Instant cashback on every spend with no minimums. Full AI spend management, real-time controls per employee or department, and zero foreign transaction fees."}},aiActiveCallout:{heading:"AI Accountant and AI CFO are already active.",body:"Zeni AI will read your uploaded documents and autofill all details automatically.",metaPrimary:"Most verifications",metaSecondary:"complete in under 5 mins"},kycStep:{title:"Step 1 — Verify your identity (KYC)",body:"Upload a government-issued ID. Zeni AI reads the document and autofills name, date of birth, and address automatically. Required by the Bank Secrecy Act and Anti-Money Laundering regulations.",meta:"Takes about 2 mins"},kybStep:{title:"Step 2 — Verify your business (KYB)",body:"Upload your EIN document. Zeni AI extracts company legal name, incorporation type, registered address, and Tax ID automatically. Required for financial services compliance.",meta:"Takes about 3 mins"},startVerificationCta:"Start verification",skipToDashboardCta:"Skip — go to my dashboard"},chrome:{skipLabel:"Skip for now",skipToDashboardLabel:"Skip — go to my dashboard",backLabel:"Back"},activateSubscription:{pageTitle:"Activate your subscription",pageSubtitle:"Required to activate your Zeni subscription.",ctaLabel:"Continue to connect your ledger",ctaLabelWithoutLedger:"Continue to verify your business"},connectLedgerPage:{pageTitle:"Connect your ledger",pageSubtitle:"Required foundation for both AI Agents",ctaLabel:"Continue to activation"},officerVerifyPage:{pageTitle:"Verify your identity",pageSubtitle:"Documents are encrypted and stored with SOC 2 Type II compliance.",ctaLabel:"Continue to business verification"},companyVerifyPage:{pageTitle:"Verify your business",pageSubtitle:"Documents are encrypted and stored with SOC 2 Type II compliance.",ctaLabel:"Submit and go to dashboard"},aiAgentsActivating:{pageTitle:"AI Agents are activating",ctaLabel:"Continue to connect more sources",demoTenantName:"Pied Piper"},connectDataSources:{pageTitle:"Connect your data sources",pageSubtitle:"Connect what you have access to — others on your team can add the rest later.",ctaLabel:"Continue to verification"},setupBilling:{introTitle:"To get started, please link your payment method and enter company billing address.",introBody:"Your AI Agents are already reading your books. Set up billing to keep them running after your trial ends.",includedCard:{heading:"What's always included:",accountantBody:"Runs your books every day, automatically.",cfoBody:"Answers every financial question, always available.",connectionsLabel:"Unlimited data source connections",connectionsBody:"QBO, banks, cards, AR, AP, revenue, payroll, email and more.",financeTeamLabel:"Your dedicated finance team",financeTeamBody:"Controller, Team Lead and Accountant available Monday–Friday."},paymentMethodHeading:"Subscription Payment Method",paymentMethodSubheading:"ACH bank debit — no additional fees",companyBillingAddress:"Billing Address",connectBankTitle:"Connect bank account",connectBankSubtitle:"Sign in securely via Plaid",creditCardStripCta:"Or, use credit card instead (3% fee)"},qbo_connection:{title:"Connect QuickBooks",subTitle:"To set up your dashboard, we must connect with your QuickBooks account.",sucessText:"Congratulations! You have successfully established a connection with QuickBooks.",subtitleText:"Accounting & bookkeeping — journal entries, invoices, bills, expenses",errorText:"Unable to connect quickbooks. Please try again.",requiredText:"Please connect Quickbooks to sync your financial data",button:{connect:"Connect",reconnect:"Reconnect"}},company_officer:{title:"Company Officer",subTitle:"Enter proof of identity to complete verification."},company_details:{title:"Company Details",subTitle:"Enter business details to complete verification."}},thankYou:{title:"Thank you for providing the details.",subTitle:"We are currently verifying and working on your Dashboard."},footer:{buttons:{submitText:'By clicking "__action__", I certify that the information provided here is complete and correct.'}},tags:{verified:"Verified",connected:"Connected"},productSuite:{navTitleCFO:"Thank you, we've got your details",navTitle:"Thank you for completing your onboarding steps",updatePaymentDetails:"Update Payment Details",messageBox:{default:"We're now setting up your Quickbooks account and will notify you via email once it's ready.",onlyTax:"Our Tax team will email you with the next steps within 2 business days.",onlyCFO:"Our CFO team will email you with the next steps before your service start date.",onlyPayroll:"Our Payroll team will email you with the next steps within 2 business days.",taxAndPayroll:"Our Tax & Payroll teams will email you with the next steps within 2 business days.",withTax:"Our Tax team will email you within 2 business days.",withPayroll:"Our Payroll team will email you within 2 business days.",withCFO:"Our CFO team will reach out to you before your service start date.",withTaxAndPayroll:"Our Tax & Payroll teams will email you within 2 business days."},sectionTitleCFO:"Explore more solutions tailored for your business",sectionTitle:"Meanwhile, learn more about Zeni products",sectionFooter:"Discover Zeni's product suite",productCard:{seeMore:"Learn More",cards:[{cardTitle:"Zeni Reimbursements",sectionTitle:"Pay your employees back faster",sectionSubTitle:"Reimburse your employees at lightning speed with AI-powered expense processing at no additional cost."},{cardTitle:"Zeni Bill Payments",sectionTitle:"Pay your bills in seconds",sectionSubTitle:"Speed up domestic and international vendor payments with AI-powered invoice processing at no additional cost."},{cardTitle:"Zeni AI Bookkeeping",sectionTitle:"Simplify your bookkeeping",sectionSubTitle:"Give your business all the financial insights it needs to succeed on a single dashboard."}]}},aiFinanceTeamReady:{title:{prefix:"Your ",highlight:"AI finance",suffix:" team is ready, {firstName}."},agentChip:"Two AI Agents are joining {companyName}'s finance org today.",description:"Connect them to your financial data and they start working immediately — categorizing, reconciling, journalizing, and answering every question your CFO has.",accountantCard:{title:"AI Accountant",subtitle:"Runs the books every day. Handles every accounting task automatically.",tasks:{bankReconciliation:{title:"Bank reconciliation",meta:"Chase ••••8992 — 847 transactions matched"},autoCategorization:{title:"Auto categorization",meta:"1,204 transactions — 94% categorized"},journalEntryEngine:{title:"Journal entry engine",meta:"12 recurring JEs detected and scheduled"},fluxAnalysis:{title:"Flux analysis",meta:"AWS +29% vs last month — flagged"},apArAging:{title:"AP and AR aging",meta:"3 invoices 30+ days overdue — surfaced"}},statusComplete:"Complete",statusInProgress:"In Progress",footer:"All of this happens automatically, every day."},cfoCard:{title:"AI CFO",subtitle:"Answers every financial question. Always available, always precise.",chat:{netBurnQuestion:"What is our net burn this month?",netBurnAnswer:{heading:"Net burn is $487K this month",body:"Payroll 61%, software and infrastructure 22%. Up $34K vs last month — new engineering hire Mar 12 and an $18K AWS overage."},revenueQuestion:"Are we on track for Q2 revenue?",revenueAnswer:{heading:"Yes, on track at 94% confidence",body:"$312K closed, $180K in late stage pipeline due this month. Risk: 3 March renewal invoices totalling $42K still outstanding."}},suggestions:{runway:"What's our current runway?",burnByDept:"Show me burn by department",vendorReview:"Which vendors should I review?",closeStatus:"Close status for November"}},trustRow:{soc2:"SOC 2 Type II",bankGrade:"Bank-grade encryption",trusted:"Trusted by 1,500+ finance teams"},cta:"Connect your Finance Team"}},uncategorizedAccountsMapping:{title:"Accounting",accountingSettings:{heading:"Account Settings",confirmLabel:"Confirm",cancelLabel:"Cancel",accountingClasses:{title:"Accounting Classes",subTitle:"Track and categorize transactions by class. Turning this off hides class fields and columns across the workspace.",enableConfirmation:{title:"Enable Accounting Classes?",description:"Class fields will appear on transactions, bills, reimbursements, and reports so you can track spending by class."},disableConfirmation:{title:"Disable Accounting Classes?",description:"Class fields and columns will be hidden across the workspace. Existing class assignments on transactions are preserved but won't be visible until you re-enable this setting."}},projects:{title:"Projects",subTitle:"Track transactions by project. This setting reflects the project configuration from QuickBooks and cannot be changed here."}},uncategorizedSection:{heading:"Uncategorized Accounts",title:"Income & Expense Accounts",subTitle:"Select the accounts used to temporarily track transactions that require clarification.",incomeLabel:"Income Account:",expenseLabel:"Expense Account:",incomeAccount:"Income Account",expenseAccount:"Expense Account"},billsSection:{heading:"Bills",title:"Expense Accounts",subTitle:"Select the account used to track charges while using Zeni Bill Pay",bankChargesAndFeesLabel:"Bank Charges & Fees Account:",billPayExpenseAccount:"Bill Pay Expense Account"},reimbursementsSection:{heading:"Reimbursements",title:"Expense Accounts",subTitle:"Select the account used to track charges while using Zeni Reimbursements",mileageLabel:"Mileage Account:",reimbursementsExpenseAccount:"Mileage Expense Account"},vendorSection:{heading:"Vendors",prepaidExpenseTitle:"Prepaid Expenses",FixedAssetsTitle:"Fixed Assets",AccruedExpensesTitle:"Accrued Expenses",prepaidExpenseSubTitle:"Select the accounts used to track prepaid expenses",fixedAssetsSubTitle:"Select the accounts used to track fixed asset expenses",accruedExpensesSubTitle:"Select the accounts used to track accrued expenses",prepaidExpenselabel:"Prepaid Expense Accounts:",fixedAssetslabel:"Fixed Asset Accounts:",accruedExpenseslabel:"Accrued Expense Accounts:",prepaidExpenseAccount:"Prepaid Expense Account",fixedAssetsAccount:"Fixed Asset Account",accruedExpensesAccount:"Accrued Expense Account"},common:{label:{bankAccountLabel:"Bank Accounts:",expenseCategoriesLabel:"Expense Categories:"}},filing1099Section:{heading:"1099 Filing",subHeading:"Form 1099 is a tax form filed by businesses to report annual payments of $600 or more to vendors or independent contractors.",bankAccountTitle:"Bank Accounts",expenseCategoryTitle:"Expense Categories",bankAccountSubTitle:"Select the bank accounts used to pay vendors",expenseCategoriesSubTitle:"Select the expense categories to filter eligible payment types",infoTextBankAccount:"To fetch all payments made to vendors",infoTextGlAccount:"To filter the eligible payments",allExpenseTypes:"All Expense Types",all1099Types:"All 1099 Types",allBoxes:"All Boxes"},placeholder:{incomePlaceholder:"Select Income Account",expensePlaceholder:"Select Expense Account",accountPlaceholder:"Select account",accountPlaceholders:"Select accounts",categoryPlaceholder:"Select Category",boxPlaceholder:"Select box",expenseType1099Placeholder:"Select type"},tooltip:'The "__account__" recommendation is __based__',noOptions:{noAccountsFound:"No accounts found!",establishQBO:"Kindly establish the accounts in QuickBooks.",noTypesFound:"No type found!",noBoxTypesFound:"No box type found!"},capitalizationSection:{heading:"Capitalization Thresholds",headingSubtitle:"Thresholds are auto-calculated nightly. Set a user override to use your own value instead.",defaultCurrencySymbol:"$",sections:{prepaid:"Prepaid Expenses",fixedAsset:"Fixed Assets"},onboardingPopup:{titles:{prepaid:"Prepaid Expense Thresholds Identified",fixed_asset:"Fixed Asset Thresholds Identified"},descriptions:{prepaid:"Set a capitalization threshold for __accountName__. Transactions below the threshold will be expensed directly instead of being capitalized.",fixed_asset:"Set a capitalization threshold for __accountName__. Transactions below the threshold will be expensed rather than capitalized as assets."},submitButton:"Submit",maybeLaterButton:"Maybe Later",thresholdLabel:"Capitalization Threshold",thresholdPlaceholder:"Enter threshold amount",helpText:"You can always update this later in Settings > Accounting."},globalControls:{title:"Global Threshold Controls",threshold:{label:"Capitalization Threshold",description:"Overrides all learned thresholds when set. Clear to use per-account learned values."},maxCeiling:{label:"Max Ceiling",description:"Caps learned thresholds — any account whose learned value exceeds this is clamped. Clear to use system default."},placeholder:"Not set",saveButton:"Save",cancelButton:"Cancel"},accountsTable:{subtitle:"Capitalizable Accounts",overrideBanner:"All accounts using user-set threshold: __value__",headers:{accountName:"Account Name",threshold:"Threshold",type:"Type",matchStrength:"Match Strength",effectiveThreshold:"Effective Threshold",learnedThreshold:"Learned Threshold",userOverride:"User Override"},classification:{prepaid:"Prepaid",fixed_asset:"Fixed Asset"},matchPattern:{LABEL:"Strong",TYPE_SUBTYPE_AND_JE_HISTORY:"Medium",TYPE_ONLY:"Weak"},sourceBadge:{override:"Override",learned:"Learned"},resetButton:"Reset",lastUpdated:"Last updated: __date__",empty:{noData:"Accounts will appear here after the nightly analysis runs.",noLearned:"No capitalizable accounts with identified thresholds yet.",noAccounts:"No capitalizable accounts identified yet."}}}},jeSchedules:{scheduleList:{tabs:{all:"All",new:"New",onGoing:"Ongoing",completed:"Completed"},defaultDownloadFileName:"__tenant__ Schedules.xlsx",tableHeaders:{scheduleCreationDate:"Schedule Creation Date",transactionDate:"Transaction Date",vendor:"Vendor",scheduleCategory:"Schedule Category",accruedExpenseCategory:"Accrued Expense Category",accumulatedDepreciationCategory:"Accumulated Depreciation Category",expenseCategory:"Expense Category",category:"Category",class:"Class",amount:"Amount",balanceAsOfToday:"Balance as of today",memo:"Memo",startMonth:"Start Month",endMonth:"End Month",months:"Months",transactionType:"Transaction Type",status:"Status",assetId:"Asset ID",user:"Created By"},noData:"No Schedules Found",heading:{expenseSchedules:"Expense Schedules",searchPlaceholder:"Search Schedules"},getSchedules:{selectSchedule:"Select Schedule:",getSchedules:"Get Schedules",selectDate:"Period:",noOptions:{noAccountsFound:"No accounts found!"}},scheduleStatus:{new:"Create",ongoing:"Ongoing",completed:"Completed",unknown:"Unknown",marked_as_completed:"Completed",draft:"Draft"}},scheduleDetails:{jeSchedule:"JE Schedule",showTransactionTooltip:"Show Transaction",scheduleTransactionsHeader:{types:{prepaidExpenses:"Prepaid Expense",fixedAssets:"Fixed Asset"},addVendor:"Add Vendor",vendorName:"Vendor Name",transactionDate:"Transaction Date:",amount:"Amount",expenseCategory:"Expense Category:",category:"Category:",class:"Class:",memo:"Memo:"},sequenceSchedule:{header:"Schedule Sequence",notCreated:"Once details are entered, the schedule sequence will be displayed here.",sequenceHeaders:{jePostingDate:"JE Posting Date",amount:"Amount",runningBalance:"Running Balance (as of today)",postingStatus:"Status",jeLink:"",memo:"Memo"},accruedSequenceHeader:{jePostingDate:"Accrual Posting Date",amount:"Amount",runningBalance:"Accrual Balance",postingStatus:"Status",jeLink:"",memo:"Memo"},sequenceData:{amountPlaceholder:"0"},postingStatus:{pending:"Pending",unknown:"Unknown",posted:"Posted",canceled:"Canceled",recorded:"Recorded"}},scheduleDetailsSection:{header:"Schedule Details",startMonth:"Start Month:",startMonthPlaceholder:"Select start month",months:"Months:",monthsPlaceholder:"Select month",expenseCategory:"Category:",expenseCategoryPlaceholder:"Select category",accumulatedDepreciationCategory:"Accumulated Depreciation Category:",accumulatedDepreciationCategoryPlaceholder:"Select accumulated depreciation category",assetId:"Asset ID:",assetIdPlaceholder:"Add asset ID",postingDate:"Posting Date:",postingDatePlaceholder:"Select posting date",class:"Class:",classPlaceholder:"Select class",confirmDeletionTitle:"Confirm Deletion",confirmCancelAccrualTitle:"Are you sure?",confirmCancelAccrualDescription:"Cancel all the pending accrual schedules. This action cannot be undone.",confirmDeletionDescription:"Are you sure you want to delete this schedule? This action cannot be undone.",confirmDeletionDescriptionNote:"Note - Deleting the schedule will not delete any associated journal entries in QBO.",markAsCompleted:"Mark As Completed",createSchedule:"Create Schedule",scheduleMarkedAsCompleted:"Schedule has been marked as completed",cancelPendingAccrual:"Cancel Pending Accruals",cancelAccrual:"Cancel Accrual",viewRecordedJE:"View Recorded JE",viewPostedJE:"View Posted JE",deleteSchedule:"Delete Schedule"},linkJE:{fetchJE:"Fetch JE",invalidJEURL:"Invalid URL",jeLinkURLPlaceholder:"Add Link",jeLink:"JE Link:",linkJE:"Link JE",linkBillExpense:"Link Bill or Expense",viewBillExpense:"View Bill or Expense",jePostingDate:"JE Posting Date:",jeDetails:"JE details will be presented here once you enter the JE link and complete the fetch operation.",transactionFetchError:"There was an error fetching the transaction.",zeniRecommendation:"Based on Zeni GPT recommendation, journal entry posting has been automatically retrieved for the schedule."}},scheduleAccruedDetails:{new:{header:"New Accrued Expenses",new:"new"},headers:{scheduleCreationDate:"Schedule Creation Date",accruedExpenseCat:"Accrued Expense Category"},labels:{vendor:"Vendor:",estimatedMonthlyAmount:"Estimated Monthly Amount:",accruedExpenseCategory:"Accrued Expense Category:",memo:"Memo:",startingBalance:"Starting Balance:"},placeholders:{selectVendor:"Search and select vendor",addAmount:"Add amount",addMemo:"Add Memo",addBalance:"Add Balance",selectAccruedExpenseCat:"Select accrued expense category"}},linkBillExpenseDetails:{tableHeaders:{name:"Name",transactionAttachment:"",transactionDate:"Transaction Date",memo:"Memo",transactionType:"Transaction Type",amount:"Amount"},viewReceipt:"View Receipt",title:"Link Bill Or Expense",noBillFound:"No Bill or Expense found for the schedule",linkBill:"Link Bill",additionalBills:"Additional Bills For The Vendor",zeniGPTText:"Based on Zeni GPT recommendation, the bill or expense posting has been automatically retrieved for the schedule."}},vendorReview:{globalReview:{newGlobalMerchant:{tip:"Protip: Verify online domain availability of the vendor name.",recommendationInfoText:"Enter text to fetch recommendation",recommendationText:"Update to"},globalMerchantList:{navBarTitle:"Global Vendors Review",searchPlaceholder:"Search tenant",confirmationPopup:{title:'Are you sure you want to add "_merchant_name_" in Global vendor list?',description:"Confirm will add the vendor to the global list. This change can’t be reverted back.",merchantNameFallback:"this merchant"},selectPlaceholder:"Select Global Vendor",noDataText:"No global vendors to display yet!",noMatchedDataText:"No global vendors matched your search."}},firstReview:{title:"Review Vendor",searchPlaceholder:"Search vendor",viewRecipts:"View receipts",vendorDropdown:{recommendedVendor:"Recommended Vendor",recommendedCustomer:"Recommended Customer",allVendors:"All Vendors",allCustomers:"AllCustomers",vendors:"Vendors",customers:"Customers",fromOldName:'Change name from "__old_name__"',toNewName:' to "__new_name__"'},invoice:"invoice",noDataText:"No vendors to display yet!",noMatchedDataText:"No vendors matched your search.",editNameTooltipText:"Edit name",popupMessages:{netsuiteLinkPopupTitle:'A vendor by name "_vendor_name_" already exists in NetSuite',netsuiteLinkPopupMsgHeader:"Please login to NetSuite and follow the steps given below to merge the vendor",netsuiteLinkPopupSubTitle:"Keep in mind that merging vendor profiles is permanent. You can't undo this later.",netsuiteLinkPopupDescription:"Please note that the related transactions will be migrated within the next 24 hours after the change.",qboLinkPopupMsgHeader:"Please login to QBO and follow the steps given below to merge the vendor",qboLinkPopupSubTitle:"Keep in mind that merging vendor profiles is permanent. You can't undo this later.",qboLinkPopupTitle:'A vendor by name "_vendor_name_" already exists in QBO',zeniUpdatedRecommendationPopupTitle:'Vendor recommendation for "_vendor_name_" is updated from "_old_recommendation_" to "_new_recommendation_".',zeniUpdatedRecommendationPopupMsg:"Zeni AI has updated the recommendation for this vendor name. Click 'Continue' to use updated vendor name or Click 'cancel' & refresh the page to view the updated vendor recommendation.",zeniNewRecommendationPopupTitle:'Vendor recommendation for "_vendor_name_" is updated to "_new_recommendation_".',zeniNewRecommendationPopupMsg:"Zeni AI has provided a recommendation for this vendor name. Click 'Continue' to proceed with the selected vendor name or 'Cancel' to view the newly added recommendation.",zeniNewRecommendationNotAvailablePopupTitle:'Vendor recommendation for "_vendor_name_" is no longer available.',zeniNewRecommendationNotAvailablePopupMsg:`Zeni AI has updated the recommendation for this vendor. Please try again.
351
- `,redirectToQBO:"Redirect to QBO",mergeInQBOSteppedContent:{step1:{navigateTo:"Navigate to ",expenses:"Expenses",andSelectThe:" and Select the ",vendors:"Vendors",tab:" tab."},step2:{lineText:"Find and open the vendor profile you want to keep. Then Select ",andCopy:" and copy",company:"Company",display:"Display"},step3:{goBackTo:"Go back to the ",lineText:" tab. Find and open the vendor you don't want to keep. Then select "},step4:{lineText:"Change the display name to make it identical to the vendor you're merging it with."},step5:{andThen:" and then "}},mergeInNetSuiteSteppedContent:{step1:{goTo:"Go to ",lists:"Lists",then:" then ",relationships:"Relationships",then2:" then ",vendors:"Vendors"},step2:{click:"Click ",next:" next to the ",vendor:"Vendor",sourceInfo:" that will be the source "},step3:{onThe:"On the ",vendor:"Vendor",page:" page, under ",actions:"Actions",click:", click ",merge:"Merge"},step4:{onThe:"On the ",mergeVendor:"Merge Vendor",endText:" page, select the target vendor into which you want to merge this source vendor record. "},step5:{text:" Both the source and target vendor records must have the same primary subsidiary to merge the records. "},step6:{click:"Click ",merge:"Merge",text:" . At the prompt to confirm the action, click ",ok:"OK"},step7:{onThe:"On the ",duplicateResolution:"Duplicate Resolution Status",text:" page, the merge is queued for process. "},step8:{click:"Click ",refresh:"Refresh",processText:" to process the merge or the ",haltText:" link to halt the merge process. "},step9:{the:"The ",status:"Status",text:" column provides the results of the merge. "},step10:{text:"The un-categorized and mis-categorized transactions for the deleted vendor will be migrated within 24 hours after the vendor merge is completed. "}}},rowMoreActions:{markAsEmployee:"Mark as Employee",markAsLocalContractor:"Mark as Local Contractor"},tooltip:{mergeInQBOText:"Updated vendor name already exists in QBO and needs to be merged.",mergeInNetSuiteText:"Updated vendor name already exists in NetSuite and needs to be merged."},overlay:{title:'Add Website for "_vendor_name_"'}}},commentsAndNotifications:{notifications:{title:{notifications:"Notifications"},texts:{markAsRead:"Mark as Read",markAllAsRead:"Mark all as read"},actionStrings:{comments:{mention:"mentioned you in comment",reply:"replied to your comment",reaction:"reacted to your message",toMessage:"to your message",assign:"assigned you to a task",unassign:"unassigned you from a task",newThread:"created a new thread",resolveComment:"resolved a thread",unResolveComment:"unresolved a thread",newActivity:"performed new activity on your message",newRepliesAdded:"New replies are added",newCommentAdded:"New comment is added"},notifications:{create:"created this task.",assign:"assigned this task to you.",overdue:"Due date was __date__",due:"Currently __task_status__ and is due tomorrow.",dueTomorrow:"This task is due tomorrow.",statusUpdate:"Status updated from",activities:"made updates to this task.",delete:"deleted this task.",archive:"archived this task.",newActivity:"performed new activity on this task."}},strings:{notificationSelected:"Notification selected",notificationsSelected:"Notifications selected",newMessage:"You have received a new message"},message:{noNotificationsMessage:"No notifications at this time. You're all caught up."}}},featurePreview:{scheduleDemo:"Schedule a Demo",goBack:"Go Back",popups:{home:{title:"Unleash the Power of AI Bookkeeping",text:"Update your books daily, access real-time insights, and receive personalized support from a dedicated team of experts — all on a single platform"},ai_automation:{title:"Unleash the Power of AI Bookkeeping",text:"Update your books daily, access real-time insights, and receive personalized support from a dedicated team of experts — all on a single platform"},reports:{title:"Investor Ready Reports",text:"Generate beautiful PDF reports to forward to investors, bankers, or to build into your board deck. Alternatively, download or share view-only access to your dashboard."},forecast:{title:"Forecasting and Planning",text:"Don't settle for Excel. Accurately forecast your bookings, revenues, workforce, expenses and cash flows by comparing Actuals vs Budgets from a central dashboard."},bills:{title:"The fastest way to pay vendors",text:"Pay domestic and international vendors quickly and automate your accounts payable process end-to-end directly from the dashboard – at no additional cost. "},reimbursements:{title:"Reimburse employees at lightning speed",text:"Embrace the efficiency and future of AI-driven expense reimbursements while boosting employee satisfaction."},vendors:{title:"Stop wondering how you’re spending money",text:"Daily, crystal-clear insights into your Operating Expenses give you an instant view into your cash burn and expenses, including Gross Burn and Net Burn trends."},people:{title:"",text:""},rewards:{title:"",text:""},cards:{title:"",text:""},checking:{title:"Business banking turning transactions into triumphs",text:"Modern checking accounts with a guaranteed yield earned from your first dollar and no hidden fees. Leverage AI to auto categorize your transactions effortlessly."},treasury:{title:"",text:""},accounting:{title:"",text:""},approval_rules:{title:"",text:""},bank_connections:{title:"",text:""},business_verification:{title:"",text:""},company_details:{title:"",text:""},integrations:{title:"",text:""},my_profile:{title:"",text:""},my_bank_connections:{title:"",text:""},notifications:{title:"",text:""},billing:{title:"",text:""},performance:{title:"",text:""},ai_cfo:{title:"",text:""}}},collaboration:{commentOnField:"comment on field",threads:{title:{comments:"Comments"},placeholder:{replyAComment:"Reply to comment...",addANewComment:"Add a new comment..."},tooltip:{resolveComment:"Resolve comment",unResolveComment:"Re-open comment"}}},expenseAutomation:{common:{numbers:{maximumCount:999}},overview:{title:"Overview",confidenceScoreTitle:"Confidence Score",confidenceScoreDescription:"Higher score means you're close to finish.",auditScoreTitle:"Audit Score",auditScoreDescription:"Streamline your month-end close with Zeni AI.",monthEndCloseProgress:"Month-end close progress",targetClose:"Target Close:",daysToClose:"Days to Close:",financialClose:"Financial Close",reviewReport:"Review month-end close report.",insightsCtaMessage:"Improve your confidence score to _minimum_score_ or above to unlock month-end insights",createInsights:"Create _month_name_ Insights",monthEndCloseTrend:"Performance Trend",monthEndCloseTrendNoData:"No data yet!",monthEndCloseTrendNoDataDescription:"Initiate your first month-end close to track performance.",confidenceScoreTooltip:"Indicates overall progress of all month-end close tasks. Higher score means you're closer to finishing the close.",byAI:"by AI",byHumans:"by Humans",remaining:"remaining",workflows:"Workflows",progress:"Progress",headerByAI:"By AI",statistics:{accountsAutoReconciled:"Accounts auto-reconciled",transactionsAutoCategorized:"Transactions auto-categorized",humanEfficiency:"Tasks completed by AI Agents",fasterReviews:"Faster reviews",vendorsWithFluctuations:"Vendors with fluctuations"}},confirmationDescription:"Are you sure you want to exit without saving?",dashboardCard:{flux_analysis:"Flux Analysis",transaction_categorization:"Transactions",missing_receipts:"Receipts",je_schedules:"JE Schedules",month_end_insights:"Month end insights",reconciliation:"Reconciliation"},transactions:{header:{vendors:"Payee",category:"Category",classText:"Class",project:"Project",date:"Date",type:"Type",amount:"Amount",memo:"Memo",memoReceipt:"Memo | Receipt",activity:"Activity",paymentAccount:"Payment Account",receipt:"Receipt",toFrom:"To/From",description:"Description"},paymentAccountTooltip:{accountLabel:"Account",methodLabel:"Method"},description:"Description",searchPlaceholder:"Search by date, amount, memo, or vendor",tabs:{review:"Review",pendingReview:"Pending Review",completed:"Completed",autoCategorized:"Auto-categorized"},completedSubTabs:{all:"All",aiAccountant:"AI Accountant",manual:"Manual"},subTitles:{review:{item1:{pre:"",prefixIconName:"zeniAIIcon",bold:"AI Bookkeeper",post:"has recommendations for Payees, Categories, Classes."},item2:{pre:"",bold:"",prefixIconName:"",post:"Review them, select, save your changes, and AI Bookkeeper will learn from your updates."}},autoCategorized:{item1:{pre:"",prefixIconName:"zeniAIIcon",bold:"AI Agents",post:"have auto-categorized the below #number transactions for this month."},item2:{pre:"",bold:"",prefixIconName:"",post:"Feel free to review and make the necessary changes. AI Agents will learn from your updates."}}},allDoneText:{title:"All set!",subTitle:"Task cleared, ready to soar!"},emptyStates:{noSearchResults:{title:"No matching transactions",subTitle:"Try adjusting your search or filters."}},filters:{categoryLabels:{paymentAccountName:"Payment Account Name",paymentAccountType:"Payment Account Type",payee:"Payee",category:"Category",class:"Class",amount:"Amount"},amountOperators:{lessThan:"Less than",greaterThan:"Greater than",isEqual:"Is equal",inBetween:"In between",placeholder:"Select operator"},amountInputPlaceholders:{enterAmount:"Enter amount",from:"From",to:"To"},filterOptions:{transactionAmountOptions:[{label:"< 100",value:"-10000000<->100"},{label:"100 to 500",value:"100<->500"},{label:"500 to 1K",value:"500<->1000"},{label:"1K to 5K",value:"1000<->5000"},{label:"5K to 10K",value:"5000<->10000"},{label:"10K to 20K",value:"10000<->20000"},{label:"> 20K",value:"20000<->10000000"}],transactionTypeOptions:[{label:"Auto-categorized",value:"autoCategorized"},{label:"Review",value:"review"},{label:"Categorized",value:"categorized"},{label:"Uncategorized",value:"uncategorized"}]},selectPaymentAccountNamePlaceholder:"Select Payment Account Name",searchForPayeePlaceholder:"Search for Payee"},addCategory:"Add Category",addClass:"Add Class",addProject:"Add Project",addVendor:"Add Vendor",addPayee:"Add Payee",transactionActivityLog:{title:"Activity",noLogsFound:"No Activity logs found",transactionIngested:"Transaction ingested.",aiBookkeeperAdded:"AI Bookkeeper added the",userUpdatedDetails:"Updated the transaction details.",details:"Details",linePrefix:"Line #",fields:{vendor:"Vendor",category:"Category",class:"Class",customer:"Customer",memo:"Memo",description:"Description"}},transferDrawer:{title:"Review & Confirm",sourceSection:"Source",payeeLabel:"Payee:",categoryLabel:"Category:",classLabel:"Class:",amountLabel:"Amount:",debitAccountLabel:"Debit Account:",creditAccountLabel:"Credit Account:",creditAccountPlaceholder:"Select account",keepExpense:"Keep Expense",convert:"Convert",convertToTransfer:"Convert Expense to Transfer",convertToCreditCard:"Convert Expense to Credit Card Payment",transferDrawerSubtitle:"The current expense will be deleted and replaced with a transfer entry",creditCardPaymentDrawerSubtitle:"The current expense will be deleted and replaced with a credit card payment entry",groupHeadingAllAccounts:"All Accounts",noEligibleAccountsInline:"No eligible accounts available.",noEligibleAccountsDropdownLine1:"No eligible accounts available.",noEligibleAccountsDropdownLine2:"Connect an account or keep this as an expense."},transactionTypeDropdown:{groupHeadingAllTypes:"All Types",expense:"Expense",transfer:"Transfer",creditCard:"Credit Card Payment",multilineNotEligibleTooltip:"Multiline transactions are not eligible for transfer entry."}},jeSchedules:{searchPlaceholder:"Search for schedules",subTitles:{item1:{pre:"",bold:"",prefixIconName:"",post:"Please review the following journal entries below and correct or post them."},item2:{pre:"",bold:"AI Agents",prefixIconName:"zeniAIIcon",post:"will learn from your update, automate it, and boost accuracy and efficiency to simplify every step."}},allDoneText:{title:"High five!",subTitle:"All schedules reviewed!"},emptyState:{pendingReview:{title:"High five!",subTitle:"All schedules reviewed!"},ongoing:{title:"High five!",subTitle:"No ongoing schedules"},completed:{title:"High five!",subTitle:"No completed schedules"}},scheduleHeaders:{scheduleCategory:"Schedule Category",startMonth:"Start Month",period:"Amortization Period",type:"Type",jePostingDate:"JE Posting Date",balance:"Running balance (as of today)",months:"Remaining Months",amountForMonth:"Amount(for this month)",accumulatedCategory:"Accumulated Depreciation Category",transactionDate:"Transaction Date",memo:"Memo"},scheduleTypes:{prepaid_expenses:"Prepaid Expense",fixed_assets:"Fixed Assets",accrued_expenses:"Accrued Expense",deferred_revenue:"Deferred Revenue"},tooltipText:{missingVendor:'The vendor "_deleted_vendor_" was deleted from the Journal Entry. Please add the correct vendor and try posting again.',missingCategory:'The category "_deleted_category_" was deleted from the Journal Entry. Please add the correct category and try posting again.',missingDepCategory:'The category "_deleted_dep_category_" was deleted from the Journal Entry. Please add the correct accumulated depreciation category and try posting again'},addCategory:"Add Category",addDepCategory:"Add Depreciation Category",aiBotEmail:"ai@zeni.ai",botEmail:"bot@zeni.ai",aiAccountant:"AI Accountant ",zeniGPTText:"recommends a new JE schedule. Please review and set it up!"},missingReceipts:{searchPlaceholder:"Search for transactions",subTitles:{pre:"",preLink:"",bold:"AI Agents",prefixIconName:"zeniAIIcon",post:"will do the best to automatically match receipts with the correct transactions. Forward all receipts to receipts@zeni.ai",postLink:"receipts@zeni.ai"},allDoneText:{title:"Ta-da!",subTitle:"All receipts uploaded, like magic!"}},fluxAnalysis:{vendors:"Vendors",searchPlaceholder:"Search for vendors",subTitles:{item1:{pre:"",bold:"",prefixIconName:"",post:"Review vendor account transactions for emerging trends and adjust categories and classes to resolve anomalies."},item2:{pre:"Feel free to review and make the necessary changes",bold:"AI Agents",prefixIconName:"zeniAIIcon",post:"will learn from it."}},sectionTitle:{generalExpense:"General Expenses",reimbursement:"Reimbursement"},reviewedBy:"Reviewed by",remarksBy:"Remarks by",variance:"Variance",viewVendorDetails:"View Vendor Details",emptyPageTexts:{youDidIt:"You did it!",allReviewed:"All flux reviewed!"},stepsBanner:{collapsedTitle:"Quick steps for Flux Analysis",hide:"Hide",show:"Show",step1:{label:"Step 1",title:"Review Variances",description:"Compare vendor-wise spend across months and drill down into categories and classes."},step2:{label:"Step 2",title:"Mark as Reviewed",descriptionPrefix:"Once variances are confirmed,",descriptionSuffix:"select vendors and mark as reviewed."}}},transactionCategorizationHeaders:{vendors:"Payee",category:"Category",classText:"Class",account:"Account",date:"Date",type:"Type",amount:"Amount",description:"Description",memo:"Memo",activity:"Activity"},accountRecon:{reconciliation:{headers:{section:{assets:{title:"Assets",subTitle:"Cash and Equivalents"},liabilities:{title:"Liabilities",subTitle:"Credit Cards"}},bankBalance:"Bank Balance",openingBalance:"Opening Balance",closingBalance:"Closing Balance",clearedBalance:"Cleared Balance",variance:"Variance",matchProgress:"AI Progress",lastReconciled:"Last Reconciled",status:"Status",excludedAccountTitle:"Excluded Accounts"},matchProgressLegend:{byAi:"by AI",byHuman:"by human"},stepsBanner:{hide:"Hide",show:"Show",collapsedTitle:"Quick steps for Bank Reconciliation",step1:{eyebrow:"Step 1",title:"Connect Bank Account",line1BeforeIcon:"Select",line1AfterIcon:"to add a bank account or",line2:"upload a bank statement."},step2:{eyebrow:"Step 2",title:"Compare Balance",body:'Compare bank statement and cleared balances. Select "Review" if they differ.'},step3:{eyebrow:"Step 3",title:"Review & Update Transactions",body:"Approve AI suggestions to categorize or match entries, and complete any missing fields."},step4:{eyebrow:"Step 4",title:"Reconcile the account",body:'Ensure balances match, then select "Reconcile" to complete reconciliation.'}},menu:{statement:"Account Statement",bankConnection:"Bank Connection"},statsCards:{autoMatched:"AI Auto-matched",needsReview:"Needs Review",accountsDone:"Accounts Reconciled",timeSavedByAi:"Time saved by AI",ofTotalTxn:"of _total_ transactions",acrossAccounts:"across _count_ accounts",ofTotalAccounts:"of _total_ Accounts",hrsSuffix:"hrs"},connectAccountsBanner:{accountLabelSingular:"Account",accountLabelPlural:"Accounts",leadNeedConnectedSuffix:"need to be connected.",body:"Connect a data source to start reconciliation. Takes less than 2 min per account.",connectAccounts:"Connect Accounts",dismissAriaLabel:"Dismiss"},status:{reconciled:"Reconciled",reconciledBy:"Reconciled by",reconciledVia:"Reconciled via",QBOUser:"QBO",reconciliationFailed:"Failed",reconcileViaQBO:"Reconcile via QBO",balanceNotFound:"Balance unavailable!",bankBalanceNotFound:"Balance unavailable!",clearedBalanceNotFound:"Balance unavailable!",balanceSyncInProgress:"Balance sync",statementSyncInProgress:"Statement sync",autoReconInProgress:"Auto-reconciliation",statementParseError:"Statement parse",statementValidationFailed:"Statement validation",statementProcessingFailed:"Statement processing",failed:"failed",isInProgress:"is in progress",review:"Review",booksClosed:"Books closed",reopenToReconcile:"Reopen to reconcile",booksClosedTooltip:"Refresh after reopening the books"},tooltips:{selectSource:"Select source",lastUpdated:"Last updated",reconciledByLabel:"Reconciled by:",lastUpdatedLabel:"Last updated:",applyingChanges:"Applying changes...",failed:"Could not apply changes",inProgress:"Connection is in progress. Please check back in a few minutes.",balancesNotFound:"Unable to fetch balances for this account.",bankBalanceNotFound:"Unable to fetch bank balance for this account.",clearedBalanceNotFound:"Unable to fetch cleared balance for this account.",reconInProgress:"Reconciliation is in progress. Please check back in a few minutes.",excludeAccount:{title:"Exclude Account",ignore:"Ignore",exclude:"Exclude"}},connect:{connect:"Connect",reconnnect:"Reconnect"},drawer:{source:"Source",downloadPlaceholder:"Select file or drop here",labels:{type:"Type:",status:"Status:",accountType:"Account Type:",lastUpdated:"Last Updated:",lastSync:"Last Sync:"},values:{bankConnection:"Bank Connection",bank:"Bank",creditCard:"Credit Card",connected:"Connected",reconnect:"Reconnect",connect:"Connect",connecting:"Connecting",uploaded:"Uploaded",statementParsing:"Statement sync is in progress"},deleteConfirmation:{heading:"Delete this file?",description:"Deleting the file will affect your reviewed transactions or reconciliation progress."},validationFailed:{heading:"Validation Failed",ok:"OK"},fileValidationFailed:{heading:"File Validation failed",description:"We couldn't process your statement. Please check the file and try uploading again.",reupload:"Re-upload Statement",closeAriaLabel:"Close"},dateRangeConflict:{alreadyReconciled:{heading:"Date Range Already Reconciled",description:"The statement period overlaps with a period that has already been reconciled"},gap:{heading:"Gap in Reconciliation Period",description:"The statement must start the day after the last reconciled period",expectedStartDate:e=>`Please upload a statement starting ${e}`},lastReconciled:e=>`Last Reconciled: ${e}`,lastReconciledBy:(e,t)=>`Last Reconciled: ${e} by ${t}`,reupload:"Re-upload Statement",closeAriaLabel:"Close"},error:{validationFailed:"Validation failed",parsingFailed:"Parsing failed"},excludeFromReconciliation:"Exclude from Reconciliation",excludeConfirmation:{heading:e=>`Exclude "${e}" from Reconciliation?`,description:"This account will be removed from your reconciliation workflow and progress report. Existing data will not be affected, and you can include the account again at any time."},includeForReconciliation:"Include account for Reconciliation",includeConfirmation:{heading:e=>`Include "${e}" for Reconciliation?`,description:"This account will be added back to your reconciliation workflow and progress report."},excludedStatus:"Excluded"}},statementProcessing:{steps:["Uploading file","Reading document structure","Identifying statement type","Extracting account details","Determining opening & closing balances","Verifying statement details","Gathering transactions","Finalizing"],headerTitle:"AI Accountant Reading Statement",stepSubtitles:["Setting up statement analysis and validation","Recognizing transaction layouts and summary sections","Matching format against known bank statement templates","Pulling account number, entity name, and statement period","Locating balance summary from the checking summary table","Cross-checking deposit and withdrawal totals for accuracy","Reading transactions. Extracting dates, amounts, and descriptions","Matching transactions to your ledger and preparing the review"],stepProgressLabel:(e,t)=>`Step ${e} of ${t} completed`,timeRemainingMinutes:e=>`${e} min left`,timeRemainingSeconds:e=>`${e} sec left`,takingLongerThanExpected:"It's taking longer than expected",working:"Working",continueInBackground:"Continue in Background",continueParsing:"Continue Parsing",cancelConfirmation:{heading:"Cancel statement parsing?",description:"Your uploaded statement is still being parsed. If you cancel now, the uploaded file and all processing progress will be lost.",discard:"Discard",continueParsing:"Continue Parsing"}},statementParseInfo:{aiSummaryTitle:"AI Accountant",statementPeriodAndBalances:"Statement period & balances",period:"Period:",from:"From:",to:"To:",deposits:"Deposits",payments:"Payments",addCredit:"Add Credit",addDebit:"Add Debit",confirmAndSave:"Confirm & Save",totalsDoNotAddUp:"The totals do not add up.",reparseStatement:"Re-parse statement",retryParsing:"Retry Parsing",cancelConfirmation:{heading:"Are you sure?",description:e=>`Your ${e} extracted transactions and any edits haven't been saved yet. If you cancel now, they'll be lost.`,discard:"Discard",keepEditing:"Keep Editing"},reparseConfirmation:{heading:"Restart parsing?",description:"Re-parsing reads the statement again from scratch and replaces your current review. Any edits you've made will be lost.",reparse:"Re-parse",keepEditing:"Keep Editing"},aiSummary:{accountRecognized:"Account recognized",transactionsExtracted:"Transactions extracted",exceptionsDetected:"Exceptions detected",fieldsCaptured:"Fields captured",validated:"Validated",openingDate:"Opening date"}},tabs:{review:"Pending Review",reconcile:"Completed"},review:{allDoneText:{title:"High five!",subTitle:"All transactions reviewed!"},header:{date:"Date",amount:"Amount",payee:"Payee",memo:"Memo",direction:"Payment/Deposit",match:"Record or Match"},transactionDirection:{credit:"Credit",debit:"Debit"},matchesCount:"__count__ Matches",matchedFoundCount:"__count__ Matches Found",matchesFoundFullInfo:"for this bank transaction within the last 90 days",zeniGptRecommendation:"Based on Zeni GPT recommendation",bankDetail:"Bank Detail",creditCardDetail:"Credit Card Detail",formLabels:{match:"Match",categorize:"Categorize",record_expense:"Expense",record_transfer:"Bank Transfer",record_cc_payment:"Credit Card Payment",record_deposit:"Deposit",record_cc_credit:"Credit Card Credit",record_bill_payment:"Bill Payment",exclude:"Exclude",addVendor:"Add Vendor",addCategory:"Add Category",addClass:"Add Class",addMemo:"Add Memo",transferTo:"Transfer To",selectAccount:"Select Account",selectCard:"Select Card",allBankAccounts:"All bank accounts",allCreditCards:"All credit cards",creditCard:"Credit Card",addCustomer:"Add Customer"}},reconcile:{allDoneText:{title:"Ta-da!",subTitle:"No transactions found for reconciliation!"},header:{date:"Date",clearedDate:"Cleared Date",type:"Type",payee:"Payee",account:"Account",direction:"Payment/Deposit",memo:"Memo",amount:"Amount"}},subTitles:{review:{item1:{pre:"",bold:"",prefixIconName:"",post:"Please review these transactions because the general ledger balance doesn't match the bank balance."},item2:{pre:"",bold:"AI Agents",prefixIconName:"zeniAIIcon",post:"suggest updating these transactions to resolve the ledger discrepancies, which will help auto-adjust the variance."}},reconcile:{item1:{pre:"",prefixIconName:"zeniAIIcon",bold:"AI Agents",post:"have reconciled pending transactions and saved 42% of your reconciliation time."},item2:{pre:"",prefixIconName:"",bold:"",post:"It's time to review for discrepancies and select all transactions to bring the variance to zero."}}},titles:{item1:{pre:"",bold:"AI Agents",prefixIconName:"zeniAIIcon",post:"have reconciled your bank transactions and saved 38% of your reconciliation time."},item2:{pre:"",bold:"",prefixIconName:"",post:" It's time to check for discrepancies and review them if there's a difference."}}}},aiCfo:{pageView:{pageTitle:"AI CFO",panelTitle:"Ask AI CFO",scopePageTitle:"AI CFO Scope",titleTag:"BETA",hello:"Hello, ",helpText:"How can I help you today?",showMoreSuggestedQuestions:"Show __count__ more..."},questionTemplates:{sampleQuestion1:"Show me last month's Month-end insights",sampleQuestion2:"Show me the runway and projected cash zero date",sampleQuestion3:"Show me the top expenses from past six months"},skillMenu:{examplePrefix:"try:",tip:"Tip: type details after a skill to tailor it — e.g. a period, a filter, or what to focus on."},texts:{analyzing:"Analyzing",generating:"Generating...",artifactFallbackTitle:"Financial visualization",errorInAnswer:"We couldn’t generate a response at the moment. Please submit question again.",errorInArtifact:"Unable to render visualization. The data is available in the text response above.",creatingCards:"Creating cards...",creatingPolicies:"Creating policies based on your preferences...",cardCreatedSingular:"1 card is created and ready",cardsCreatedPlural:"__count__ cards are created and ready",policyCreatedSingular:"1 policy is created and saved",policiesCreatedPlural:"__count__ policies are created and saved",createdCardsTableCardHeader:"Card",createdCardsTableOwnerHeader:"Owner",createdCardsTableRecommendedLimitHeader:"Recommended Limit"},interactiveForm:{noMatches:"No matches",nameColumnHeader:"Name",backButtonAriaLabel:"Back",cardPolicy:{limits:{transactionLimitLabel:"Transaction Limit",transactionLimitHelperText:"Maximum amount per single transaction",requireReceiptLabel:"Require Receipt",requireReceiptHelperText:"Require a receipt above this amount",amountPlaceholder:"$0"}},cardsCreation:{step1Title:"Based on your last 3 months of spend, here are the cards. Review and confirm.",step1Cta:"Continue",step1AddRowPlaceholder:"Add something else",step1ColumnCard:"Card",step1ColumnAvgMonthlySpend:"Avg monthly spend",step1ColumnRecommendedLimit:"Recommended limit",step2Title:"Who should these cards be assigned to? Suggested owners based on past spend.",step2Cta:"Create cards",step2ColumnCard:"Card",step2ColumnOwner:"Owner",step2ColumnLimit:"Recommended limit",cardTypeOptions:{virtual:{label:"Virtual card",description:"Issued instantly"}}}},chainOfThoughts:{analysis:"Analyzing",reasoning:"Thinking",thought:"Thought Process"},reason:{show:"Show Reason",hide:"Hide Reason"},tooltips:{likeResponse:"Like",dislikeResponse:"Dislike",chatWithAI:"Chat with AI CFO"},headers:{followUpQuestions:"Follow-up questions to ask next",didYouKnow:"Did you know?",assumptions:"Key Assumptions"},input:{placeholder:"Ask AI CFO a question and get clear answers.",disclaimer:"__agent__ can make mistakes. Check important info.",maxFilesError:"Cannot add __count__ file(s). Maximum __max__ files allowed per message.",fileTooLargeError:"'__fileName__' exceeds the 5MB size limit and was not added.",unsupportedFileTypeError:"'__fileName__' is not a supported file type and was not added.",uploading:"Uploading",uploadPromoTooltip:{title:"Now upload documents",description:"Add a financial document to see key insights and ask questions."}},menu:{chatHistory:"CHAT HISTORY"},onboarding:{section:{title:"Run your business with confidence.",subtitle:"Built to analyze, explain, and summarize your numbers like a real CFO would."},capabilities:[{title:"Analyze Financials",subtitle:"Profit & loss, balance sheets, and trend detection — no spreadsheets required.",icon:"analyzing"},{title:"Spot Vendor Patterns",subtitle:"Review expenses across vendors and categories. Surface anomalies and overspend.",icon:"vendors"},{title:"Calculate Core Metrics",subtitle:"Runway, burn, margins — calculated from your real books.",icon:"calculator"},{title:"Forecast With Confidence",subtitle:"Auto-generate projections based on historicals. Updated weekly.",icon:"forecast"},{title:"Visualize Key Trends",subtitle:"Bar graphs, line charts, tables — linked to real data for full traceability.",icon:"graph-trend"}],whoIsItFor:{title:"Who's It For",details:["Startup founders without a full-time CFO — but need strategic clarity.","VPs of Finance/Operations who want faster answers, fewer spreadsheets.","Department heads (Sales, Marketing, Eng) who want to own their numbers.","Fractional CFOs managing multiple clients on Zeni.","In-house CFOs using it as a 10x strategic co-pilot."]},footer:{buttonText:"Launch __agent__",scope:"__agent__ Scope",betaText:"This is Beta — and your usage will shape what’s next.",footerText:'By clicking "Launch __agent__" I accept '}}},aiPerformanceDashboard:{tileTitle:"AI Performance",tileSubtitle:"Monitor and analyze the performance of your AI agents.",chartTitle:"Cost and Time Savings Trend",workflows:"Workflows",aiCostSavedTile:{title:"Cost Saved",subtitle:"Total reduction in expense."},aiTimeSavedTile:{title:"Time Saved",subtitle:"Manual hours saved by AI."},noPerformanceData:{firstLine:"No tasks performed yet!"},personas:{aiBookkeeper:"AI Bookkeeper Agent",aiAccountant:"AI Accountant",aiCardsAgent:"AI Cards Agent",aiBillsAgent:"AI Bills Agent",aiExpenseAgent:"AI Expenses Agent",aiBankingAgent:"AI Banking Agent",aiAccountantAgent:"AI Accountant Agent",aiCfo:"AI CFO",personaTypes:{aiBookkeeper:"bookkeeper",aiCardsAgent:"ai_cards_agent",aiBillsAgent:"ai_bills_agent",aiExpensesAgent:"ai_expenses_agent",aiBankingAgent:"ai_banking_agent",accountant:"accountant",aiCfo:"ai_cfo"}},valueDelivered:{title:"Value Delivered",subtitle:"Measurement of what you get vs. what you pay",zeniSubscriptionPlan:"Zeni Subscription Plan"},annualizedImpact:{title:"Annualized Impact",subtitle:"At this rate annually, you'll save"}},sessionTimeout:{title:"Session ends in",description:"You will be signed out due to inactivity.",descriptionClickPrefix:"Click",descriptionSuffix:"to stay signed in.",signOut:"Sign Out",continueSession:"Continue Session"},aiAccountantCustomer:{filters:{enrollmentStatus:{active:"Live",pending:"Pending",onboarding:"Onboarding",offboarded:"Offboarded",failed:"Failed"}},table:{company:"Company",status:"Status",bookClose:"Book Close",lastTraining:"Last Training",lastSync:"Last Sync",accuracy:"Accuracy",noCustomersFound:"No customers found"},actions:{onboard:"Onboard",evaluate:"Evaluate",fullPipeline:"Full Pipeline",retrain:"Retrain",offboard:"Offboard",cancelOnboarding:"Cancel Onboarding"},jobTriggerDialog:{title:"Trigger Job",startDate:"Start Date",endDate:"End Date",startDatePlaceholder:"Select start date",endDatePlaceholder:"Select end date",datesInstruction:"Please provide start and end dates.",singleDescription:"__companyName__. __datesInstruction__",singleDescriptionOffboard:"__companyName__ will be offboarded from AI Accountant."},drawer:{enrollmentDetails:"Enrollment Details",statusLabel:"Status",onboarded:"Onboarded",lastTraining:"Last Training",lastSync:"Last Sync",offboarded:"Offboarded",modelAccuracy:"Model Accuracy",noAccuracyData:"No accuracy data available",actionsTitle:"Actions",jobHistory:"Job History",loadingJobs:"Loading jobs...",noJobsFound:"No jobs found",operation:"Operation",status:"Status",created:"Created",by:"By"},summary:{totalCustomers:"Total Customers",active:"Live",inProgress:"In Progress",avgAccuracy:"Avg Accuracy",evaluateAll:"Evaluate All"},bulkActions:{menuLabel:"Bulk Actions",selectedCount:"__count__ selected",noCommonOperations:"No actions available for the selected customers",disabledInfo:"The selected customers have no action in common. Narrow your selection to customers in the same state.",bulkDialogDescription:"__count__ customers selected for __action__. Please provide start and end dates.",bulkDialogDescriptionOffboard:"__count__ customers selected for offboarding.",evaluateAllDialogTitle:"Evaluate All",evaluateAllDialogDescription:"__count__ unonboarded customer(s) will be evaluated. Please provide start and end dates."}},cardsShutdown:{bannerTitle:"Zeni Cards is shutting down",bannerDescription:"We're discontinuing our cards product. Here's what's changing, key dates, and how to switch your payments smoothly.",knowMore:"Know More",drawerTitle:"Zeni Cards is shutting down",introBody:"We're discontinuing the Zeni Cards product. Here's what's changing, key dates, and how to switch your payments smoothly.",whatsHappeningTitle:"What's happening",whatsHappeningBodyPrefix:"We've made the decision to discontinue Zeni Cards. Your card will remain active until ",whatsHappeningBodySuffix:", after which all Zeni Cards will be permanently deactivated and no new transactions will be processed.",switchPaymentsTitle:"Switch your vendor payments in minutes",switchPaymentsBodyPrefix:"To simplify the transition, we recommend ",cardSwitcherLinkText:"Knot CardSwitcher,",switchPaymentsBodySuffix:" which can automatically update your saved payment method across hundreds of merchants and subscription providers.",switchPaymentsCoverage:"CardSwitcher works with hundreds of major merchants - including Amazon, Uber, Netflix, Walmart, and most popular subscription and software providers — so you won't need to hunt through each account and update billing details one by one.",whatToDoNowTitle:"What you should do now",whatToDoItem1:"Review recurring payments linked to your Zeni Card",whatToDoItem2:"Move vendor and subscription payments to a new card",whatToDoItem3:"Download any statements you need for your records",needHelpBodyLine1:"Our team is here to help you through the transition.",needHelpBodyPrefix:"Reach us at ",needHelpBodySuffix:" for any assistance."}},lue={en:Z$,"en-US":Z$,"en-IN":Z$};class wK{getAppLocaleID(){return this.#e}getLocalizedStrings(){return lue[this.#e]}updateAppLocaleID(t){if(lue[t]==null)throw Error(`strings are not available in ${t}`);c_e(t),this.updateLibsLocale(t),this.#e=t,console.log(`Set the locale to ${this.#e}`)}currencyFormatter(t=0,o="standard"){switch(this.getAppLocaleID()){case"en-IN":return Intl.NumberFormat(this.getAppLocaleID(),{maximumFractionDigits:t,minimumFractionDigits:0,style:"currency",currency:"INR",currencySign:o});case"en-US":case"en":return Intl.NumberFormat("en-US",{maximumFractionDigits:t,minimumFractionDigits:0,style:"currency",currency:"USD",currencySign:o})}}numberFormatter(t=0){switch(this.getAppLocaleID()){case"en-IN":return Intl.NumberFormat(this.getAppLocaleID(),{maximumFractionDigits:t,minimumFractionDigits:0});case"en-US":case"en":return Intl.NumberFormat("en-US",{maximumFractionDigits:t,minimumFractionDigits:0})}}updateLibsLocale(t){A0.locale(t.toLowerCase())}static registerNumeralForEnINLocale(){A0.register("locale","en-in",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(t){const o=t%10;return~~(t%100/10)===1?"th":o===1?"st":o===2?"nd":o===3?"rd":"th"},currency:{symbol:"₹"}})}static registerNumeralForEnUSLocale(){A0.register("locale","en-us",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(t){const o=t%10;return~~(t%100/10)===1?"th":o===1?"st":o===2?"nd":o===3?"rd":"th"},currency:{symbol:"$"}})}#e="en";static#t=new wK;static instance(){return this.registerNumeralForEnINLocale(),this.registerNumeralForEnUSLocale(),this.#t}}const Q=wK.instance(),zQ=e=>e<600?"small":e>=600&&e<905?"medium-compact":e>=905&&e<1240?"medium-regular":e>=1240&&e<1440?"large":e>=1440&&e<1920?"extra-large":e>=1920?"ultra-large":(console.warn("this can't happen!"),"medium-regular"),sje=$.createContext(zQ(window.innerWidth)),Ie=()=>g.useContext(sje),GMt=e=>{const[t,o]=g.useState(e.fixedWindowSize??zQ(window.innerWidth));return g.useEffect(()=>{const i=()=>{const a=zQ(window.innerWidth);e.fixedWindowSize==null&&t!=null&&t!=a&&o(a)};return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[e.fixedWindowSize,t]),s.jsx(sje.Provider,{value:t,children:e.children})},YMt=(e,t,o,i,a,l)=>({small:e,"medium-compact":t,"medium-regular":o??t,large:i??o??t,"extra-large":a??i??o??t,"ultra-large":l??a??i??o??t});class j{constructor(t,o,i,a,l,d){this._size=YMt(t,o,i,a,l,d)}value(t="medium-regular"){switch(t){case"small":return this._size.small;case"medium-compact":return this._size["medium-compact"];case"medium-regular":return this._size["medium-regular"];case"large":return this._size.large;case"extra-large":return this._size["extra-large"];case"ultra-large":return this._size["ultra-large"]}}valuePx(t="medium-regular"){return`${this.value(t)}px`}valuePercentage(t="medium-regular"){return`${this.value(t)}%`}add(t){return new j(this._size.small+t._size.small,this._size["medium-compact"]+t._size["medium-compact"],this._size["medium-regular"]+t._size["medium-regular"],this._size.large+t._size.large,this._size["extra-large"]+t._size["extra-large"],this._size["ultra-large"]+t._size["ultra-large"])}subtract(t){return new j(this._size.small-t._size.small,this._size["medium-compact"]-t._size["medium-compact"],this._size["medium-regular"]-t._size["medium-regular"],this._size.large-t._size.large,this._size["extra-large"]-t._size["extra-large"],this._size["ultra-large"]-t._size["ultra-large"])}_size}const b0=e=>e==="small"||e==="medium-compact",om=e=>e==="small";var k=(e=>(e.brandColorOnyx="#162324",e.brandColorPearl="#FAFAFA",e.brandColorSapphire="#366170",e.brandColorSapphireDark="#26454F",e.brandColorSapphireLight="#D2E3E9",e.brandColorJade="#97C3B9",e.brandColorJadeDark="#508B7E",e.brandColorJadeLight="#D5E7E3",e.brandColorOpal="#C9ABC7",e.brandColorOpalDark="#855682",e.brandColorOpalLight="#E5D7E4",e.brandColorGold="#EEBA7D",e.brandColorGoldDark="#C27419",e.brandColorGoldLight="#F7E0C4",e.brandColorRuby="#AD584A",e.brandColorRubyDark="#9A4E42",e.brandColorRubyLight="#EBD4D1",e.primaryDark="#FAFAFA",e.primaryLight="#162324",e.backgroundThemeLight="#F3F7F7",e.backgroundThemeDark="#1B1C1C",e.championLight="#4B5253",e.championDark="#D4DBDB",e.heroLight="#757D7E",e.heroDark="#AAB4B5",e.neutralGrey1Light="#A6B0B1",e.neutralGrey1Dark="#727979",e.neutralGrey2Light="#D4DCDD",e.neutralGrey2Dark="#545B5C",e.neutralGrey3Light="#E9F0F0",e.neutralGrey3Dark="#3E4343",e.neutralGrey4Light="#FAFCFC",e.neutralGrey4Dark="#202222",e.neutralGrey5Light="#FFFFFF",e.neutralGrey5Dark="#2C2F2F",e.topExCustomColor="#90EE7D40",e.offerColor="#EF7F56",e.comingSoon="#5EBBF5",e.badgeBackground="#E9F0F033",e.dropShadowNormalLight="rgba(166, 177, 174, 0.24)",e.dropShadowNormalDark="rgba(0, 0, 0, 0.24)",e.dropShadowHoverLight="rgba(166, 177, 174, 0.8)",e.blackColor="#000000",e.billPayPromoColor="#8D6C9F",e.billPayPromoColorHover="rgba(238, 186, 125, 0.4)",e.billPayPromoBorderColorLight="#FBD1A0",e.billPayPromoBorderColorDark="#714B1E",e.billPayPromoBackGroundColorLight="#FFFBF5",e.reimbursementPromoColor="#5DB59A",e.reimbursementPromoColorHover="rgba(93, 181, 154, 0.4)",e.reimbursementPromoBorderColorLight="#CCE8DF",e.reimbursementPromoBorderColorDark="#545D5B",e.reimbursementPromoBackGroundColorLight="#EDFFF8",e.primaryWhite="#FEFEFE",e.rewardsPromoColor1="#397C93",e.rewardsPromoColor2="#065773",e.zeniAccountsPromoBackgroundColor="#D0E7E2",e.zeniAccountsPromoBackgroundColorLight="#D0E7E250",e.zeniAccountsPromoBackgroundColorDark="#3E434350",e.zeniAccountsPromoNavigationDotHoverColorLight="#36617032",e.zeniAccountsPromoNavigationDotHoverColorDark="#97C3B932",e.zeniAccountsPromoCardTitleLight="#4B4F53",e.chargeCardsGradientColor1="#ECECEC",e.chargeCardsGradientColor2="#626565",e.chargeCardsGradientColor3="#A8B1B1",e.chargeCardsGradientColor4="#444A4A",e.chargeCardBoxShadow1="rgba(132, 134, 137, 0.80)",e.chargeCardBoxShadow2="rgba(0, 0, 0, 0.35)",e.chargeCardBackgroundShadowLight="rgba(166,172,177,0.7)",e.chargeCardBackgroundShadowDark="rgba(0,0,0,0.8)",e.issueChargeCardBackgroundShadowLight="rgba(166,172,177,0.25)",e.issueChargeCardBackgroundShadowDark="rgba(0,0,0,0.25)",e.physicalCardBoxShadow="#68AAA0",e.chargeCardFaded="rgba(166, 176, 177, 0.65)",e.phoneSignalColor="#3C3C432E",e.batteryBorderColor="#3c3c4399",e.physicalCardBlueColor1="#eaeff8",e.physicalCardBlueColor2="#bdd4ee",e.physicalCardYellowColor1="#ffe9c6",e.physicalCardYellowColor2="#fff8ec",e.plaidVerificationBackground="rgb(213, 231, 227, 0.5)",e.tagDefaultBgLight="#ECEFF3",e.tagDefaultColorLight="#667085",e.tagDefaultBgDark="#1C2128",e.tagDefaultColorDark="#8C97A4",e.tagWarningBgLight="#FFF4E5",e.tagWarningColorLight="#C08A2E",e.tagWarningBgDark="#2A2416",e.tagWarningColorDark="#E6C27A",e.tagInfoBgLight="#E0EDFF",e.tagInfoColorLight="#1D62C0",e.tagInfoBgDark="#0E1E35",e.tagInfoColorDark="#7EB3F5",e.tagSuccessBgLight="#E8F5EE",e.tagSuccessColorLight="#3A8F5B",e.tagSuccessBgDark="#11241B",e.tagSuccessColorDark="#7FD9A6",e.tagAttentionBgLight="#FDEFF2",e.tagAttentionColorLight="#C23A57",e.tagAttentionBgDark="#2A1419",e.tagAttentionColorDark="#F29BB0",e.success="#36B37E",e.successDark="#1B806A",e.successLight="#D8FBDE",e.alert="#F0BC02",e.alertDark="#AC7F01",e.alertLight="#FEF7CB",e.important="#EB535D",e.importantDark="#A92949",e.importantLight="#FEE6DD",e.info="#1192E8",e.infoDark="#0855A7",e.infoLight="#CEF6FD",e.link="#4589FF",e.linkLight="#D9ECFF",e.linkDark="#224EB7",e.linkLighter="#D9ECFFAF",e.graphColor01="#EE7D7D",e.graphColor01Light="#F8C9C9",e.graphColor01Dark="#D81C1C",e.graphColor02="#EE7D90",e.graphColor02Light="#F8C9D1",e.graphColor02Dark="#D81C3C",e.graphColor03="#EE7DA3",e.graphColor03Light="#F8C9D9",e.graphColor03Dark="#D81C5B",e.graphColor04="#EE7DB5",e.graphColor04Light="#F8C9E0",e.graphColor04Dark="#D81C7A",e.graphColor05="#EE7DC8",e.graphColor05Light="#F8C9E8",e.graphColor05Dark="#D81C9A",e.graphColor06="#EE7DDB",e.graphColor06Light="#F8C9F0",e.graphColor06Dark="#D81CB9",e.graphColor07="#EE7DEE",e.graphColor07Light="#F8C9F8",e.graphColor07Dark="#D81CD8",e.graphColor08="#DB7DEE",e.graphColor08Light="#F0C9F8",e.graphColor08Dark="#B91CD8",e.graphColor09="#C87DEE",e.graphColor09Light="#E8C9F8",e.graphColor09Dark="#9A1CD8",e.graphColor10="#B67DEE",e.graphColor10Light="#E0C9F8",e.graphColor10Dark="#7A1CD8",e.graphColor11="#A37DEE",e.graphColor11Light="#D9C9F8",e.graphColor11Dark="#5B1CD8",e.graphColor12="#907DEE",e.graphColor12Light="#D1C9F8",e.graphColor12Dark="#3C1CD8",e.graphColor13="#7D7DEE",e.graphColor13Light="#C9C9F8",e.graphColor13Dark="#1C1CD8",e.graphColor14="#7D90EE",e.graphColor14Light="#C9D1F8",e.graphColor14Dark="#1C3CD8",e.graphColor15="#7DA3EE",e.graphColor15Light="#C9D9F8",e.graphColor15Dark="#1C5BD8",e.graphColor16="#7DB6EE",e.graphColor16Light="#C9E0F8",e.graphColor16Dark="#1C7AD8",e.graphColor17="#7DC8EE",e.graphColor17Light="#C9E8F8",e.graphColor17Dark="#1C9AD8",e.graphColor18="#7DDBEE",e.graphColor18Light="#C9F0F8",e.graphColor18Dark="#1CB9D8",e.graphColor19="#7DEEEE",e.graphColor19Light="#C9F8F8",e.graphColor19Dark="#1CD8D8",e.graphColor20="#7DEEDB",e.graphColor20Light="#C9F8F0",e.graphColor20Dark="#1CD8B9",e.graphColor21="#7DEEC8",e.graphColor21Light="#C9F8E8",e.graphColor21Dark="#1CD89A",e.graphColor22="#7DEEB5",e.graphColor22Light="#C9F8E0",e.graphColor22Dark="#1CD87A",e.graphColor23="#7DEEA3",e.graphColor23Light="#C9F8D9",e.graphColor23Dark="#1CD85B",e.graphColor24="#7DEE90",e.graphColor24Light="#C9F8D1",e.graphColor24Dark="#1CD83C",e.graphColor25="#7DEE7D",e.graphColor25Light="#C9F8C9",e.graphColor25Dark="#1CD81C",e.graphColor26="#90EE7D",e.graphColor26Light="#D1F8C9",e.graphColor26Dark="#3CD81C",e.graphColor27="#A3EE7D",e.graphColor27Light="#D9F8C9",e.graphColor27Dark="#5BD81C",e.graphColor28="#B5EE7D",e.graphColor28Light="#E0F8C9",e.graphColor28Dark="#7AD81C",e.graphColor29="#C8EE7D",e.graphColor29Light="#E8F8C9",e.graphColor29Dark="#9AD81C",e.graphColor30="#DBEE7D",e.graphColor30Light="#F0F8C9",e.graphColor30Dark="#B9D81C",e.graphColor31="#EEEE7D",e.graphColor31Light="#F8F8C9",e.graphColor31Dark="#D8D81C",e.graphColor32="#EEDB7D",e.graphColor32Light="#F8F0C9",e.graphColor32Dark="#D8B91C",e.graphColor33="#EEC87D",e.graphColor33Light="#F8E8C9",e.graphColor33Dark="#D89A1C",e.graphColor34="#EEB57D",e.graphColor34Light="#F8E0C9",e.graphColor34Dark="#D87A1C",e.graphColor35="#EEA37D",e.graphColor35Light="#F8D9C9",e.graphColor35Dark="#D85B1C",e.graphColor36="#EE907D",e.graphColor36Light="#F8D1C9",e.graphColor36Dark="#D83C1C",e.overlayLight="rgba(0, 0, 0, 0.40)",e.overlayDark="rgba(0, 0, 0, 0.75)",e.overlayBackgroundBlack="rgba(0, 0, 0, 0.50)",e.playButtonBackGroundColorLight="#16232466",e.playButtonBackGroundColorDark="#16232466",e.backgroundGradient1Light="rgba(54, 97, 112, 0.20)",e.backgroundGradient1Dark="rgba(151, 195, 185, 0.20)",e.backgroundGradient2Light="rgba(255, 255, 255, 0.20)",e.backgroundGradient2Dark="rgba(0, 0, 0, 0.20)",e.backgroundGradient3Light="rgba(212, 220, 221, 1)",e.boxShadowElevation="rgba(166, 172, 177, 0.24)",e.Elevation1Light="0px 1px 2px 0px rgba(166, 172, 177, 0.25)",e.Elevation2Light="0px 2px 8px 0px rgba(166, 172, 177, 0.8)",e.Elevation3Light="1px 3px 24px 0px rgba(166, 172, 177, 0.8)",e.Elevation1Dark="0px 1px 2px 0px rgba(0, 0, 0, 0.25)",e.Elevation2Dark="0px 2px 8px 0px rgba(0, 0, 0, 0.8)",e.Elevation3Dark="1px 3px 24px 0px rgba(0, 0, 0, 0.8)",e.scrollbarBoxShadow="rgba(0, 0, 0, 0.1)",e.drawerBackground="rgba(0, 0, 0, 0.7)",e.modalBackground="rgba(0, 0, 0, 0.64)",e.whiteGradient="rgba(255, 255, 255, 0)",e.whiteGradientDark="rgba(255, 255, 255, 0.1)",e.whiteGradientLight="rgba(255, 255, 255, 0.9)",e.runwayRed="#eb535d",e.runwayYellow="#e8aa0b",e.runwayGreen="#51c571",e.optionBorderLight="#E9ECF0",e.selectMenuItem="#1d1f20",e.aiCfoGradient1="#6D3FD8",e.aiCfoGradient2="#BD54CF",e.aiCfoGradient3="#CF6CC9",e.aiCfoGradient4="#EE609C",e.aiVibrantPurple="#7135FF",e.aiCfoLinearGradient="linear-gradient(315deg, #6D3FD8 34.09%, #BD54CF 43.64%, #CF6CC9 50%, #EE609C 56.36%, #EE609C 65.91%)",e.aiChainOfThoughtLinearGradient="linear-gradient(322.09deg, #6D3FD8 7.71%, #BD54CF 30.79%, #CF6CC9 54.3%, #EE609C 78.68%, #EE609C 98.27%);",e.aiChainOfThoughtBackgroundGradient="linear-gradient(296.16deg, #6D3FD8b3 20.44%, #BD54CFb3 40.68%, #CF6CC9b3 54.18%, #EE609Cb3 67.68%, #EE609Cb3 87.92%)",e.aiCfoScrollAreaFadeGradientLight="linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 100%)",e.aiCfoScrollAreaFadeGradientDark="linear-gradient(180deg, rgba(0,0,0, 0) 0%, #2C2F2F 100%)",e.receiptAgentLinearGradient="linear-gradient(315deg, #6D3FD8 31.79%, #BD54CF 42.72%, #CF6CC9 50%, #EE609C 57.28%,#EE609C 68.21%)",e.aiParsingBorderConicGradient=`conic-gradient(
351
+ `,redirectToQBO:"Redirect to QBO",mergeInQBOSteppedContent:{step1:{navigateTo:"Navigate to ",expenses:"Expenses",andSelectThe:" and Select the ",vendors:"Vendors",tab:" tab."},step2:{lineText:"Find and open the vendor profile you want to keep. Then Select ",andCopy:" and copy",company:"Company",display:"Display"},step3:{goBackTo:"Go back to the ",lineText:" tab. Find and open the vendor you don't want to keep. Then select "},step4:{lineText:"Change the display name to make it identical to the vendor you're merging it with."},step5:{andThen:" and then "}},mergeInNetSuiteSteppedContent:{step1:{goTo:"Go to ",lists:"Lists",then:" then ",relationships:"Relationships",then2:" then ",vendors:"Vendors"},step2:{click:"Click ",next:" next to the ",vendor:"Vendor",sourceInfo:" that will be the source "},step3:{onThe:"On the ",vendor:"Vendor",page:" page, under ",actions:"Actions",click:", click ",merge:"Merge"},step4:{onThe:"On the ",mergeVendor:"Merge Vendor",endText:" page, select the target vendor into which you want to merge this source vendor record. "},step5:{text:" Both the source and target vendor records must have the same primary subsidiary to merge the records. "},step6:{click:"Click ",merge:"Merge",text:" . At the prompt to confirm the action, click ",ok:"OK"},step7:{onThe:"On the ",duplicateResolution:"Duplicate Resolution Status",text:" page, the merge is queued for process. "},step8:{click:"Click ",refresh:"Refresh",processText:" to process the merge or the ",haltText:" link to halt the merge process. "},step9:{the:"The ",status:"Status",text:" column provides the results of the merge. "},step10:{text:"The un-categorized and mis-categorized transactions for the deleted vendor will be migrated within 24 hours after the vendor merge is completed. "}}},rowMoreActions:{markAsEmployee:"Mark as Employee",markAsLocalContractor:"Mark as Local Contractor"},tooltip:{mergeInQBOText:"Updated vendor name already exists in QBO and needs to be merged.",mergeInNetSuiteText:"Updated vendor name already exists in NetSuite and needs to be merged."},overlay:{title:'Add Website for "_vendor_name_"'}}},commentsAndNotifications:{notifications:{title:{notifications:"Notifications"},texts:{markAsRead:"Mark as Read",markAllAsRead:"Mark all as read"},actionStrings:{comments:{mention:"mentioned you in comment",reply:"replied to your comment",reaction:"reacted to your message",toMessage:"to your message",assign:"assigned you to a task",unassign:"unassigned you from a task",newThread:"created a new thread",resolveComment:"resolved a thread",unResolveComment:"unresolved a thread",newActivity:"performed new activity on your message",newRepliesAdded:"New replies are added",newCommentAdded:"New comment is added"},notifications:{create:"created this task.",assign:"assigned this task to you.",overdue:"Due date was __date__",due:"Currently __task_status__ and is due tomorrow.",dueTomorrow:"This task is due tomorrow.",statusUpdate:"Status updated from",activities:"made updates to this task.",delete:"deleted this task.",archive:"archived this task.",newActivity:"performed new activity on this task."}},strings:{notificationSelected:"Notification selected",notificationsSelected:"Notifications selected",newMessage:"You have received a new message"},message:{noNotificationsMessage:"No notifications at this time. You're all caught up."}}},featurePreview:{scheduleDemo:"Schedule a Demo",goBack:"Go Back",popups:{home:{title:"Unleash the Power of AI Bookkeeping",text:"Update your books daily, access real-time insights, and receive personalized support from a dedicated team of experts — all on a single platform"},ai_automation:{title:"Unleash the Power of AI Bookkeeping",text:"Update your books daily, access real-time insights, and receive personalized support from a dedicated team of experts — all on a single platform"},reports:{title:"Investor Ready Reports",text:"Generate beautiful PDF reports to forward to investors, bankers, or to build into your board deck. Alternatively, download or share view-only access to your dashboard."},forecast:{title:"Forecasting and Planning",text:"Don't settle for Excel. Accurately forecast your bookings, revenues, workforce, expenses and cash flows by comparing Actuals vs Budgets from a central dashboard."},bills:{title:"The fastest way to pay vendors",text:"Pay domestic and international vendors quickly and automate your accounts payable process end-to-end directly from the dashboard – at no additional cost. "},reimbursements:{title:"Reimburse employees at lightning speed",text:"Embrace the efficiency and future of AI-driven expense reimbursements while boosting employee satisfaction."},vendors:{title:"Stop wondering how you’re spending money",text:"Daily, crystal-clear insights into your Operating Expenses give you an instant view into your cash burn and expenses, including Gross Burn and Net Burn trends."},people:{title:"",text:""},rewards:{title:"",text:""},cards:{title:"",text:""},checking:{title:"Business banking turning transactions into triumphs",text:"Modern checking accounts with a guaranteed yield earned from your first dollar and no hidden fees. Leverage AI to auto categorize your transactions effortlessly."},treasury:{title:"",text:""},accounting:{title:"",text:""},approval_rules:{title:"",text:""},bank_connections:{title:"",text:""},business_verification:{title:"",text:""},company_details:{title:"",text:""},integrations:{title:"",text:""},my_profile:{title:"",text:""},my_bank_connections:{title:"",text:""},notifications:{title:"",text:""},billing:{title:"",text:""},performance:{title:"",text:""},ai_cfo:{title:"",text:""}}},collaboration:{commentOnField:"comment on field",threads:{title:{comments:"Comments"},placeholder:{replyAComment:"Reply to comment...",addANewComment:"Add a new comment..."},tooltip:{resolveComment:"Resolve comment",unResolveComment:"Re-open comment"}}},expenseAutomation:{common:{numbers:{maximumCount:999}},overview:{title:"Overview",confidenceScoreTitle:"Confidence Score",confidenceScoreDescription:"Higher score means you're close to finish.",auditScoreTitle:"Audit Score",auditScoreDescription:"Streamline your month-end close with Zeni AI.",monthEndCloseProgress:"Month-end close progress",targetClose:"Target Close:",daysToClose:"Days to Close:",financialClose:"Financial Close",reviewReport:"Review month-end close report.",insightsCtaMessage:"Improve your confidence score to _minimum_score_ or above to unlock month-end insights",createInsights:"Create _month_name_ Insights",monthEndCloseTrend:"Performance Trend",monthEndCloseTrendNoData:"No data yet!",monthEndCloseTrendNoDataDescription:"Initiate your first month-end close to track performance.",confidenceScoreTooltip:"Indicates overall progress of all month-end close tasks. Higher score means you're closer to finishing the close.",byAI:"by AI",byHumans:"by Humans",remaining:"remaining",workflows:"Workflows",progress:"Progress",headerByAI:"By AI",statistics:{accountsAutoReconciled:"Accounts auto-reconciled",transactionsAutoCategorized:"Transactions auto-categorized",humanEfficiency:"Tasks completed by AI Agents",fasterReviews:"Faster reviews",vendorsWithFluctuations:"Vendors with fluctuations"}},confirmationDescription:"Are you sure you want to exit without saving?",dashboardCard:{flux_analysis:"Flux Analysis",transaction_categorization:"Transactions",missing_receipts:"Receipts",je_schedules:"JE Schedules",month_end_insights:"Month end insights",reconciliation:"Reconciliation"},transactions:{header:{vendors:"Payee",category:"Category",classText:"Class",project:"Project",date:"Date",type:"Type",amount:"Amount",memo:"Memo",memoReceipt:"Memo | Receipt",activity:"Activity",paymentAccount:"Payment Account",receipt:"Receipt",toFrom:"To/From",description:"Description"},paymentAccountTooltip:{accountLabel:"Account",methodLabel:"Method"},description:"Description",searchPlaceholder:"Search by vendor, amount, date, or memo",tabs:{review:"Review",pendingReview:"Pending Review",completed:"Completed",autoCategorized:"Auto-categorized"},completedSubTabs:{all:"All",aiAccountant:"AI Accountant",manual:"Manual"},subTitles:{review:{item1:{pre:"",prefixIconName:"zeniAIIcon",bold:"AI Bookkeeper",post:"has recommendations for Payees, Categories, Classes."},item2:{pre:"",bold:"",prefixIconName:"",post:"Review them, select, save your changes, and AI Bookkeeper will learn from your updates."}},autoCategorized:{item1:{pre:"",prefixIconName:"zeniAIIcon",bold:"AI Agents",post:"have auto-categorized the below #number transactions for this month."},item2:{pre:"",bold:"",prefixIconName:"",post:"Feel free to review and make the necessary changes. AI Agents will learn from your updates."}}},allDoneText:{title:"All set!",subTitle:"Task cleared, ready to soar!"},emptyStates:{noSearchResults:{title:"No matching transactions",subTitle:"Try adjusting your search or filters."}},filters:{categoryLabels:{paymentAccountName:"Payment Account Name",paymentAccountType:"Payment Account Type",payee:"Payee",category:"Category",class:"Class",amount:"Amount"},amountOperators:{lessThan:"Less than",greaterThan:"Greater than",isEqual:"Is equal",inBetween:"In between",placeholder:"Select operator"},amountInputPlaceholders:{enterAmount:"Enter amount",from:"From",to:"To"},filterOptions:{transactionAmountOptions:[{label:"< 100",value:"-10000000<->100"},{label:"100 to 500",value:"100<->500"},{label:"500 to 1K",value:"500<->1000"},{label:"1K to 5K",value:"1000<->5000"},{label:"5K to 10K",value:"5000<->10000"},{label:"10K to 20K",value:"10000<->20000"},{label:"> 20K",value:"20000<->10000000"}],transactionTypeOptions:[{label:"Auto-categorized",value:"autoCategorized"},{label:"Review",value:"review"},{label:"Categorized",value:"categorized"},{label:"Uncategorized",value:"uncategorized"}]},selectPaymentAccountNamePlaceholder:"Select Payment Account Name",searchForPayeePlaceholder:"Search for Payee"},addCategory:"Add Category",addClass:"Add Class",addProject:"Add Project",addVendor:"Add Vendor",addPayee:"Add Payee",transactionActivityLog:{title:"Activity",noLogsFound:"No Activity logs found",transactionIngested:"Transaction ingested.",aiBookkeeperAdded:"AI Bookkeeper added the",userUpdatedDetails:"Updated the transaction details.",details:"Details",linePrefix:"Line #",fields:{vendor:"Vendor",category:"Category",class:"Class",customer:"Customer",memo:"Memo",description:"Description"}},transferDrawer:{title:"Review & Confirm",sourceSection:"Source",payeeLabel:"Payee:",categoryLabel:"Category:",classLabel:"Class:",amountLabel:"Amount:",debitAccountLabel:"Debit Account:",creditAccountLabel:"Credit Account:",creditAccountPlaceholder:"Select account",keepExpense:"Keep Expense",convert:"Convert",convertToTransfer:"Convert Expense to Transfer",convertToCreditCard:"Convert Expense to Credit Card Payment",transferDrawerSubtitle:"The current expense will be deleted and replaced with a transfer entry",creditCardPaymentDrawerSubtitle:"The current expense will be deleted and replaced with a credit card payment entry",groupHeadingAllAccounts:"All Accounts",noEligibleAccountsInline:"No eligible accounts available.",noEligibleAccountsDropdownLine1:"No eligible accounts available.",noEligibleAccountsDropdownLine2:"Connect an account or keep this as an expense."},transactionTypeDropdown:{groupHeadingAllTypes:"All Types",expense:"Expense",transfer:"Transfer",creditCard:"Credit Card Payment",multilineNotEligibleTooltip:"Multiline transactions are not eligible for transfer entry."}},jeSchedules:{searchPlaceholder:"Search for schedules",subTitles:{item1:{pre:"",bold:"",prefixIconName:"",post:"Please review the following journal entries below and correct or post them."},item2:{pre:"",bold:"AI Agents",prefixIconName:"zeniAIIcon",post:"will learn from your update, automate it, and boost accuracy and efficiency to simplify every step."}},allDoneText:{title:"High five!",subTitle:"All schedules reviewed!"},emptyState:{pendingReview:{title:"High five!",subTitle:"All schedules reviewed!"},ongoing:{title:"High five!",subTitle:"No ongoing schedules"},completed:{title:"High five!",subTitle:"No completed schedules"}},scheduleHeaders:{scheduleCategory:"Schedule Category",startMonth:"Start Month",period:"Amortization Period",type:"Type",jePostingDate:"JE Posting Date",balance:"Running balance (as of today)",months:"Remaining Months",amountForMonth:"Amount(for this month)",accumulatedCategory:"Accumulated Depreciation Category",transactionDate:"Transaction Date",memo:"Memo"},scheduleTypes:{prepaid_expenses:"Prepaid Expense",fixed_assets:"Fixed Assets",accrued_expenses:"Accrued Expense",deferred_revenue:"Deferred Revenue"},tooltipText:{missingVendor:'The vendor "_deleted_vendor_" was deleted from the Journal Entry. Please add the correct vendor and try posting again.',missingCategory:'The category "_deleted_category_" was deleted from the Journal Entry. Please add the correct category and try posting again.',missingDepCategory:'The category "_deleted_dep_category_" was deleted from the Journal Entry. Please add the correct accumulated depreciation category and try posting again'},addCategory:"Add Category",addDepCategory:"Add Depreciation Category",aiBotEmail:"ai@zeni.ai",botEmail:"bot@zeni.ai",aiAccountant:"AI Accountant ",zeniGPTText:"recommends a new JE schedule. Please review and set it up!"},missingReceipts:{searchPlaceholder:"Search for transactions",subTitles:{pre:"",preLink:"",bold:"AI Agents",prefixIconName:"zeniAIIcon",post:"will do the best to automatically match receipts with the correct transactions. Forward all receipts to receipts@zeni.ai",postLink:"receipts@zeni.ai"},allDoneText:{title:"Ta-da!",subTitle:"All receipts uploaded, like magic!"}},fluxAnalysis:{vendors:"Vendors",searchPlaceholder:"Search for vendors",subTitles:{item1:{pre:"",bold:"",prefixIconName:"",post:"Review vendor account transactions for emerging trends and adjust categories and classes to resolve anomalies."},item2:{pre:"Feel free to review and make the necessary changes",bold:"AI Agents",prefixIconName:"zeniAIIcon",post:"will learn from it."}},sectionTitle:{generalExpense:"General Expenses",reimbursement:"Reimbursement"},reviewedBy:"Reviewed by",remarksBy:"Remarks by",variance:"Variance",viewVendorDetails:"View Vendor Details",emptyPageTexts:{youDidIt:"You did it!",allReviewed:"All flux reviewed!"},stepsBanner:{collapsedTitle:"Quick steps for Flux Analysis",hide:"Hide",show:"Show",step1:{label:"Step 1",title:"Review Variances",description:"Compare vendor-wise spend across months and drill down into categories and classes."},step2:{label:"Step 2",title:"Mark as Reviewed",descriptionPrefix:"Once variances are confirmed,",descriptionSuffix:"select vendors and mark as reviewed."}}},transactionCategorizationHeaders:{vendors:"Payee",category:"Category",classText:"Class",account:"Account",date:"Date",type:"Type",amount:"Amount",description:"Description",memo:"Memo",activity:"Activity"},accountRecon:{reconciliation:{headers:{section:{assets:{title:"Assets",subTitle:"Cash and Equivalents"},liabilities:{title:"Liabilities",subTitle:"Credit Cards"}},bankBalance:"Bank Balance",openingBalance:"Opening Balance",closingBalance:"Closing Balance",clearedBalance:"Cleared Balance",variance:"Variance",matchProgress:"AI Progress",lastReconciled:"Last Reconciled",status:"Status",excludedAccountTitle:"Excluded Accounts"},matchProgressLegend:{byAi:"by AI",byHuman:"by human"},stepsBanner:{hide:"Hide",show:"Show",collapsedTitle:"Quick steps for Bank Reconciliation",step1:{eyebrow:"Step 1",title:"Connect Bank Account",line1BeforeIcon:"Select",line1AfterIcon:"to add a bank account or",line2:"upload a bank statement."},step2:{eyebrow:"Step 2",title:"Compare Balance",body:'Compare bank statement and cleared balances. Select "Review" if they differ.'},step3:{eyebrow:"Step 3",title:"Review & Update Transactions",body:"Approve AI suggestions to categorize or match entries, and complete any missing fields."},step4:{eyebrow:"Step 4",title:"Reconcile the account",body:'Ensure balances match, then select "Reconcile" to complete reconciliation.'}},menu:{statement:"Account Statement",bankConnection:"Bank Connection"},statsCards:{autoMatched:"AI Auto-matched",needsReview:"Needs Review",accountsDone:"Accounts Reconciled",timeSavedByAi:"Time saved by AI",ofTotalTxn:"of _total_ transactions",acrossAccounts:"across _count_ accounts",ofTotalAccounts:"of _total_ Accounts",hrsSuffix:"hrs"},connectAccountsBanner:{accountLabelSingular:"Account",accountLabelPlural:"Accounts",leadNeedConnectedSuffix:"need to be connected.",body:"Connect a data source to start reconciliation. Takes less than 2 min per account.",connectAccounts:"Connect Accounts",dismissAriaLabel:"Dismiss"},status:{reconciled:"Reconciled",reconciledBy:"Reconciled by",reconciledVia:"Reconciled via",QBOUser:"QBO",reconciliationFailed:"Failed",reconcileViaQBO:"Reconcile via QBO",balanceNotFound:"Balance unavailable!",bankBalanceNotFound:"Balance unavailable!",clearedBalanceNotFound:"Balance unavailable!",balanceSyncInProgress:"Balance sync",statementSyncInProgress:"Statement sync",autoReconInProgress:"Auto-reconciliation",statementParseError:"Statement parse",statementValidationFailed:"Statement validation",statementProcessingFailed:"Statement processing",failed:"failed",isInProgress:"is in progress",review:"Review",booksClosed:"Books closed",reopenToReconcile:"Reopen to reconcile",booksClosedTooltip:"Refresh after reopening the books"},tooltips:{selectSource:"Select source",lastUpdated:"Last updated",reconciledByLabel:"Reconciled by:",lastUpdatedLabel:"Last updated:",applyingChanges:"Applying changes...",failed:"Could not apply changes",inProgress:"Connection is in progress. Please check back in a few minutes.",balancesNotFound:"Unable to fetch balances for this account.",bankBalanceNotFound:"Unable to fetch bank balance for this account.",clearedBalanceNotFound:"Unable to fetch cleared balance for this account.",reconInProgress:"Reconciliation is in progress. Please check back in a few minutes.",excludeAccount:{title:"Exclude Account",ignore:"Ignore",exclude:"Exclude"}},connect:{connect:"Connect",reconnnect:"Reconnect"},drawer:{source:"Source",downloadPlaceholder:"Select file or drop here",labels:{type:"Type:",status:"Status:",accountType:"Account Type:",lastUpdated:"Last Updated:",lastSync:"Last Sync:"},values:{bankConnection:"Bank Connection",bank:"Bank",creditCard:"Credit Card",connected:"Connected",reconnect:"Reconnect",connect:"Connect",connecting:"Connecting",uploaded:"Uploaded",statementParsing:"Statement sync is in progress"},deleteConfirmation:{heading:"Delete this file?",description:"Deleting the file will affect your reviewed transactions or reconciliation progress."},validationFailed:{heading:"Validation Failed",ok:"OK"},fileValidationFailed:{heading:"File Validation failed",description:"We couldn't process your statement. Please check the file and try uploading again.",reupload:"Re-upload Statement",closeAriaLabel:"Close"},dateRangeConflict:{alreadyReconciled:{heading:"Date Range Already Reconciled",description:"The statement period overlaps with a period that has already been reconciled"},gap:{heading:"Gap in Reconciliation Period",description:"The statement must start the day after the last reconciled period",expectedStartDate:e=>`Please upload a statement starting ${e}`},lastReconciled:e=>`Last Reconciled: ${e}`,lastReconciledBy:(e,t)=>`Last Reconciled: ${e} by ${t}`,reupload:"Re-upload Statement",closeAriaLabel:"Close"},error:{validationFailed:"Validation failed",parsingFailed:"Parsing failed"},excludeFromReconciliation:"Exclude from Reconciliation",excludeConfirmation:{heading:e=>`Exclude "${e}" from Reconciliation?`,description:"This account will be removed from your reconciliation workflow and progress report. Existing data will not be affected, and you can include the account again at any time."},includeForReconciliation:"Include account for Reconciliation",includeConfirmation:{heading:e=>`Include "${e}" for Reconciliation?`,description:"This account will be added back to your reconciliation workflow and progress report."},excludedStatus:"Excluded"}},statementProcessing:{steps:["Uploading file","Reading document structure","Identifying statement type","Extracting account details","Determining opening & closing balances","Verifying statement details","Gathering transactions","Finalizing"],headerTitle:"AI Accountant Reading Statement",stepSubtitles:["Setting up statement analysis and validation","Recognizing transaction layouts and summary sections","Matching format against known bank statement templates","Pulling account number, entity name, and statement period","Locating balance summary from the checking summary table","Cross-checking deposit and withdrawal totals for accuracy","Reading transactions. Extracting dates, amounts, and descriptions","Matching transactions to your ledger and preparing the review"],stepProgressLabel:(e,t)=>`Step ${e} of ${t} completed`,timeRemainingMinutes:e=>`${e} min left`,timeRemainingSeconds:e=>`${e} sec left`,takingLongerThanExpected:"It's taking longer than expected",working:"Working",continueInBackground:"Continue in Background",continueParsing:"Continue Parsing",cancelConfirmation:{heading:"Cancel statement parsing?",description:"Your uploaded statement is still being parsed. If you cancel now, the uploaded file and all processing progress will be lost.",discard:"Discard",continueParsing:"Continue Parsing"}},statementParseInfo:{aiSummaryTitle:"AI Accountant",statementPeriodAndBalances:"Statement period & balances",period:"Period:",from:"From:",to:"To:",deposits:"Deposits",payments:"Payments",addCredit:"Add Credit",addDebit:"Add Debit",confirmAndSave:"Confirm & Save",totalsDoNotAddUp:"The totals do not add up.",reparseStatement:"Re-parse statement",retryParsing:"Retry Parsing",cancelConfirmation:{heading:"Are you sure?",description:e=>`Your ${e} extracted transactions and any edits haven't been saved yet. If you cancel now, they'll be lost.`,discard:"Discard",keepEditing:"Keep Editing"},reparseConfirmation:{heading:"Restart parsing?",description:"Re-parsing reads the statement again from scratch and replaces your current review. Any edits you've made will be lost.",reparse:"Re-parse",keepEditing:"Keep Editing"},aiSummary:{accountRecognized:"Account recognized",transactionsExtracted:"Transactions extracted",exceptionsDetected:"Exceptions detected",fieldsCaptured:"Fields captured",validated:"Validated",openingDate:"Opening date"}},tabs:{review:"Pending Review",reconcile:"Completed"},review:{allDoneText:{title:"High five!",subTitle:"All transactions reviewed!"},header:{date:"Date",amount:"Amount",payee:"Payee",memo:"Memo",direction:"Payment/Deposit",match:"Record or Match"},transactionDirection:{credit:"Credit",debit:"Debit"},matchesCount:"__count__ Matches",matchedFoundCount:"__count__ Matches Found",matchesFoundFullInfo:"for this bank transaction within the last 90 days",zeniGptRecommendation:"Based on Zeni GPT recommendation",bankDetail:"Bank Detail",creditCardDetail:"Credit Card Detail",formLabels:{match:"Match",categorize:"Categorize",record_expense:"Expense",record_transfer:"Bank Transfer",record_cc_payment:"Credit Card Payment",record_deposit:"Deposit",record_cc_credit:"Credit Card Credit",record_bill_payment:"Bill Payment",exclude:"Exclude",addVendor:"Add Vendor",addCategory:"Add Category",addClass:"Add Class",addMemo:"Add Memo",transferTo:"Transfer To",selectAccount:"Select Account",selectCard:"Select Card",allBankAccounts:"All bank accounts",allCreditCards:"All credit cards",creditCard:"Credit Card",addCustomer:"Add Customer"}},reconcile:{allDoneText:{title:"Ta-da!",subTitle:"No transactions found for reconciliation!"},header:{date:"Date",clearedDate:"Cleared Date",type:"Type",payee:"Payee",account:"Account",direction:"Payment/Deposit",memo:"Memo",amount:"Amount"}},subTitles:{review:{item1:{pre:"",bold:"",prefixIconName:"",post:"Please review these transactions because the general ledger balance doesn't match the bank balance."},item2:{pre:"",bold:"AI Agents",prefixIconName:"zeniAIIcon",post:"suggest updating these transactions to resolve the ledger discrepancies, which will help auto-adjust the variance."}},reconcile:{item1:{pre:"",prefixIconName:"zeniAIIcon",bold:"AI Agents",post:"have reconciled pending transactions and saved 42% of your reconciliation time."},item2:{pre:"",prefixIconName:"",bold:"",post:"It's time to review for discrepancies and select all transactions to bring the variance to zero."}}},titles:{item1:{pre:"",bold:"AI Agents",prefixIconName:"zeniAIIcon",post:"have reconciled your bank transactions and saved 38% of your reconciliation time."},item2:{pre:"",bold:"",prefixIconName:"",post:" It's time to check for discrepancies and review them if there's a difference."}}}},aiCfo:{pageView:{pageTitle:"AI CFO",panelTitle:"Ask AI CFO",scopePageTitle:"AI CFO Scope",titleTag:"BETA",hello:"Hello, ",helpText:"How can I help you today?",showMoreSuggestedQuestions:"Show __count__ more..."},questionTemplates:{sampleQuestion1:"Show me last month's Month-end insights",sampleQuestion2:"Show me the runway and projected cash zero date",sampleQuestion3:"Show me the top expenses from past six months"},skillMenu:{examplePrefix:"try:",tip:"Tip: type details after a skill to tailor it — e.g. a period, a filter, or what to focus on."},texts:{analyzing:"Analyzing",generating:"Generating...",artifactFallbackTitle:"Financial visualization",errorInAnswer:"We couldn’t generate a response at the moment. Please submit question again.",errorInArtifact:"Unable to render visualization. The data is available in the text response above.",creatingCards:"Creating cards...",creatingPolicies:"Creating policies based on your preferences...",cardCreatedSingular:"1 card is created and ready",cardsCreatedPlural:"__count__ cards are created and ready",policyCreatedSingular:"1 policy is created and saved",policiesCreatedPlural:"__count__ policies are created and saved",createdCardsTableCardHeader:"Card",createdCardsTableOwnerHeader:"Owner",createdCardsTableRecommendedLimitHeader:"Recommended Limit"},interactiveForm:{noMatches:"No matches",nameColumnHeader:"Name",backButtonAriaLabel:"Back",cardPolicy:{limits:{transactionLimitLabel:"Transaction Limit",transactionLimitHelperText:"Maximum amount per single transaction",requireReceiptLabel:"Require Receipt",requireReceiptHelperText:"Require a receipt above this amount",amountPlaceholder:"$0"}},cardsCreation:{step1Title:"Based on your last 3 months of spend, here are the cards. Review and confirm.",step1Cta:"Continue",step1AddRowPlaceholder:"Add something else",step1ColumnCard:"Card",step1ColumnAvgMonthlySpend:"Avg monthly spend",step1ColumnRecommendedLimit:"Recommended limit",step2Title:"Who should these cards be assigned to? Suggested owners based on past spend.",step2Cta:"Create cards",step2ColumnCard:"Card",step2ColumnOwner:"Owner",step2ColumnLimit:"Recommended limit",cardTypeOptions:{virtual:{label:"Virtual card",description:"Issued instantly"}}}},chainOfThoughts:{analysis:"Analyzing",reasoning:"Thinking",thought:"Thought Process"},reason:{show:"Show Reason",hide:"Hide Reason"},tooltips:{likeResponse:"Like",dislikeResponse:"Dislike",chatWithAI:"Chat with AI CFO"},headers:{followUpQuestions:"Follow-up questions to ask next",didYouKnow:"Did you know?",assumptions:"Key Assumptions"},input:{placeholder:"Ask AI CFO a question and get clear answers.",disclaimer:"__agent__ can make mistakes. Check important info.",maxFilesError:"Cannot add __count__ file(s). Maximum __max__ files allowed per message.",fileTooLargeError:"'__fileName__' exceeds the 5MB size limit and was not added.",unsupportedFileTypeError:"'__fileName__' is not a supported file type and was not added.",uploading:"Uploading",uploadPromoTooltip:{title:"Now upload documents",description:"Add a financial document to see key insights and ask questions."}},menu:{chatHistory:"CHAT HISTORY"},onboarding:{section:{title:"Run your business with confidence.",subtitle:"Built to analyze, explain, and summarize your numbers like a real CFO would."},capabilities:[{title:"Analyze Financials",subtitle:"Profit & loss, balance sheets, and trend detection — no spreadsheets required.",icon:"analyzing"},{title:"Spot Vendor Patterns",subtitle:"Review expenses across vendors and categories. Surface anomalies and overspend.",icon:"vendors"},{title:"Calculate Core Metrics",subtitle:"Runway, burn, margins — calculated from your real books.",icon:"calculator"},{title:"Forecast With Confidence",subtitle:"Auto-generate projections based on historicals. Updated weekly.",icon:"forecast"},{title:"Visualize Key Trends",subtitle:"Bar graphs, line charts, tables — linked to real data for full traceability.",icon:"graph-trend"}],whoIsItFor:{title:"Who's It For",details:["Startup founders without a full-time CFO — but need strategic clarity.","VPs of Finance/Operations who want faster answers, fewer spreadsheets.","Department heads (Sales, Marketing, Eng) who want to own their numbers.","Fractional CFOs managing multiple clients on Zeni.","In-house CFOs using it as a 10x strategic co-pilot."]},footer:{buttonText:"Launch __agent__",scope:"__agent__ Scope",betaText:"This is Beta — and your usage will shape what’s next.",footerText:'By clicking "Launch __agent__" I accept '}}},aiPerformanceDashboard:{tileTitle:"AI Performance",tileSubtitle:"Monitor and analyze the performance of your AI agents.",chartTitle:"Cost and Time Savings Trend",workflows:"Workflows",aiCostSavedTile:{title:"Cost Saved",subtitle:"Total reduction in expense."},aiTimeSavedTile:{title:"Time Saved",subtitle:"Manual hours saved by AI."},noPerformanceData:{firstLine:"No tasks performed yet!"},personas:{aiBookkeeper:"AI Bookkeeper Agent",aiAccountant:"AI Accountant",aiCardsAgent:"AI Cards Agent",aiBillsAgent:"AI Bills Agent",aiExpenseAgent:"AI Expenses Agent",aiBankingAgent:"AI Banking Agent",aiAccountantAgent:"AI Accountant Agent",aiCfo:"AI CFO",personaTypes:{aiBookkeeper:"bookkeeper",aiCardsAgent:"ai_cards_agent",aiBillsAgent:"ai_bills_agent",aiExpensesAgent:"ai_expenses_agent",aiBankingAgent:"ai_banking_agent",accountant:"accountant",aiCfo:"ai_cfo"}},valueDelivered:{title:"Value Delivered",subtitle:"Measurement of what you get vs. what you pay",zeniSubscriptionPlan:"Zeni Subscription Plan"},annualizedImpact:{title:"Annualized Impact",subtitle:"At this rate annually, you'll save"}},sessionTimeout:{title:"Session ends in",description:"You will be signed out due to inactivity.",descriptionClickPrefix:"Click",descriptionSuffix:"to stay signed in.",signOut:"Sign Out",continueSession:"Continue Session"},aiAccountantCustomer:{filters:{enrollmentStatus:{active:"Live",pending:"Pending",onboarding:"Onboarding",offboarded:"Offboarded",failed:"Failed"}},table:{company:"Company",status:"Status",bookClose:"Book Close",lastTraining:"Last Training",lastSync:"Last Sync",accuracy:"Accuracy",noCustomersFound:"No customers found"},actions:{onboard:"Onboard",evaluate:"Evaluate",fullPipeline:"Full Pipeline",retrain:"Retrain",offboard:"Offboard",cancelOnboarding:"Cancel Onboarding"},jobTriggerDialog:{title:"Trigger Job",startDate:"Start Date",endDate:"End Date",startDatePlaceholder:"Select start date",endDatePlaceholder:"Select end date",datesInstruction:"Please provide start and end dates.",singleDescription:"__companyName__. __datesInstruction__",singleDescriptionOffboard:"__companyName__ will be offboarded from AI Accountant."},drawer:{enrollmentDetails:"Enrollment Details",statusLabel:"Status",onboarded:"Onboarded",lastTraining:"Last Training",lastSync:"Last Sync",offboarded:"Offboarded",modelAccuracy:"Model Accuracy",noAccuracyData:"No accuracy data available",actionsTitle:"Actions",jobHistory:"Job History",loadingJobs:"Loading jobs...",noJobsFound:"No jobs found",operation:"Operation",status:"Status",created:"Created",by:"By"},summary:{totalCustomers:"Total Customers",active:"Live",inProgress:"In Progress",avgAccuracy:"Avg Accuracy",evaluateAll:"Evaluate All"},bulkActions:{menuLabel:"Bulk Actions",selectedCount:"__count__ selected",noCommonOperations:"No actions available for the selected customers",disabledInfo:"The selected customers have no action in common. Narrow your selection to customers in the same state.",bulkDialogDescription:"__count__ customers selected for __action__. Please provide start and end dates.",bulkDialogDescriptionOffboard:"__count__ customers selected for offboarding.",evaluateAllDialogTitle:"Evaluate All",evaluateAllDialogDescription:"__count__ unonboarded customer(s) will be evaluated. Please provide start and end dates."}},cardsShutdown:{bannerTitle:"Zeni Cards is shutting down",bannerDescription:"We're discontinuing our cards product. Here's what's changing, key dates, and how to switch your payments smoothly.",knowMore:"Know More",drawerTitle:"Zeni Cards is shutting down",introBody:"We're discontinuing the Zeni Cards product. Here's what's changing, key dates, and how to switch your payments smoothly.",whatsHappeningTitle:"What's happening",whatsHappeningBodyPrefix:"We've made the decision to discontinue Zeni Cards. Your card will remain active until ",whatsHappeningBodySuffix:", after which all Zeni Cards will be permanently deactivated and no new transactions will be processed.",switchPaymentsTitle:"Switch your vendor payments in minutes",switchPaymentsBodyPrefix:"To simplify the transition, we recommend ",cardSwitcherLinkText:"Knot CardSwitcher,",switchPaymentsBodySuffix:" which can automatically update your saved payment method across hundreds of merchants and subscription providers.",switchPaymentsCoverage:"CardSwitcher works with hundreds of major merchants - including Amazon, Uber, Netflix, Walmart, and most popular subscription and software providers — so you won't need to hunt through each account and update billing details one by one.",whatToDoNowTitle:"What you should do now",whatToDoItem1:"Review recurring payments linked to your Zeni Card",whatToDoItem2:"Move vendor and subscription payments to a new card",whatToDoItem3:"Download any statements you need for your records",needHelpBodyLine1:"Our team is here to help you through the transition.",needHelpBodyPrefix:"Reach us at ",needHelpBodySuffix:" for any assistance."}},lue={en:Z$,"en-US":Z$,"en-IN":Z$};class wK{getAppLocaleID(){return this.#e}getLocalizedStrings(){return lue[this.#e]}updateAppLocaleID(t){if(lue[t]==null)throw Error(`strings are not available in ${t}`);c_e(t),this.updateLibsLocale(t),this.#e=t,console.log(`Set the locale to ${this.#e}`)}currencyFormatter(t=0,o="standard"){switch(this.getAppLocaleID()){case"en-IN":return Intl.NumberFormat(this.getAppLocaleID(),{maximumFractionDigits:t,minimumFractionDigits:0,style:"currency",currency:"INR",currencySign:o});case"en-US":case"en":return Intl.NumberFormat("en-US",{maximumFractionDigits:t,minimumFractionDigits:0,style:"currency",currency:"USD",currencySign:o})}}numberFormatter(t=0){switch(this.getAppLocaleID()){case"en-IN":return Intl.NumberFormat(this.getAppLocaleID(),{maximumFractionDigits:t,minimumFractionDigits:0});case"en-US":case"en":return Intl.NumberFormat("en-US",{maximumFractionDigits:t,minimumFractionDigits:0})}}updateLibsLocale(t){A0.locale(t.toLowerCase())}static registerNumeralForEnINLocale(){A0.register("locale","en-in",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(t){const o=t%10;return~~(t%100/10)===1?"th":o===1?"st":o===2?"nd":o===3?"rd":"th"},currency:{symbol:"₹"}})}static registerNumeralForEnUSLocale(){A0.register("locale","en-us",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(t){const o=t%10;return~~(t%100/10)===1?"th":o===1?"st":o===2?"nd":o===3?"rd":"th"},currency:{symbol:"$"}})}#e="en";static#t=new wK;static instance(){return this.registerNumeralForEnINLocale(),this.registerNumeralForEnUSLocale(),this.#t}}const Q=wK.instance(),zQ=e=>e<600?"small":e>=600&&e<905?"medium-compact":e>=905&&e<1240?"medium-regular":e>=1240&&e<1440?"large":e>=1440&&e<1920?"extra-large":e>=1920?"ultra-large":(console.warn("this can't happen!"),"medium-regular"),sje=$.createContext(zQ(window.innerWidth)),Ie=()=>g.useContext(sje),GMt=e=>{const[t,o]=g.useState(e.fixedWindowSize??zQ(window.innerWidth));return g.useEffect(()=>{const i=()=>{const a=zQ(window.innerWidth);e.fixedWindowSize==null&&t!=null&&t!=a&&o(a)};return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[e.fixedWindowSize,t]),s.jsx(sje.Provider,{value:t,children:e.children})},YMt=(e,t,o,i,a,l)=>({small:e,"medium-compact":t,"medium-regular":o??t,large:i??o??t,"extra-large":a??i??o??t,"ultra-large":l??a??i??o??t});class j{constructor(t,o,i,a,l,d){this._size=YMt(t,o,i,a,l,d)}value(t="medium-regular"){switch(t){case"small":return this._size.small;case"medium-compact":return this._size["medium-compact"];case"medium-regular":return this._size["medium-regular"];case"large":return this._size.large;case"extra-large":return this._size["extra-large"];case"ultra-large":return this._size["ultra-large"]}}valuePx(t="medium-regular"){return`${this.value(t)}px`}valuePercentage(t="medium-regular"){return`${this.value(t)}%`}add(t){return new j(this._size.small+t._size.small,this._size["medium-compact"]+t._size["medium-compact"],this._size["medium-regular"]+t._size["medium-regular"],this._size.large+t._size.large,this._size["extra-large"]+t._size["extra-large"],this._size["ultra-large"]+t._size["ultra-large"])}subtract(t){return new j(this._size.small-t._size.small,this._size["medium-compact"]-t._size["medium-compact"],this._size["medium-regular"]-t._size["medium-regular"],this._size.large-t._size.large,this._size["extra-large"]-t._size["extra-large"],this._size["ultra-large"]-t._size["ultra-large"])}_size}const b0=e=>e==="small"||e==="medium-compact",om=e=>e==="small";var k=(e=>(e.brandColorOnyx="#162324",e.brandColorPearl="#FAFAFA",e.brandColorSapphire="#366170",e.brandColorSapphireDark="#26454F",e.brandColorSapphireLight="#D2E3E9",e.brandColorJade="#97C3B9",e.brandColorJadeDark="#508B7E",e.brandColorJadeLight="#D5E7E3",e.brandColorOpal="#C9ABC7",e.brandColorOpalDark="#855682",e.brandColorOpalLight="#E5D7E4",e.brandColorGold="#EEBA7D",e.brandColorGoldDark="#C27419",e.brandColorGoldLight="#F7E0C4",e.brandColorRuby="#AD584A",e.brandColorRubyDark="#9A4E42",e.brandColorRubyLight="#EBD4D1",e.primaryDark="#FAFAFA",e.primaryLight="#162324",e.backgroundThemeLight="#F3F7F7",e.backgroundThemeDark="#1B1C1C",e.championLight="#4B5253",e.championDark="#D4DBDB",e.heroLight="#757D7E",e.heroDark="#AAB4B5",e.neutralGrey1Light="#A6B0B1",e.neutralGrey1Dark="#727979",e.neutralGrey2Light="#D4DCDD",e.neutralGrey2Dark="#545B5C",e.neutralGrey3Light="#E9F0F0",e.neutralGrey3Dark="#3E4343",e.neutralGrey4Light="#FAFCFC",e.neutralGrey4Dark="#202222",e.neutralGrey5Light="#FFFFFF",e.neutralGrey5Dark="#2C2F2F",e.topExCustomColor="#90EE7D40",e.offerColor="#EF7F56",e.comingSoon="#5EBBF5",e.badgeBackground="#E9F0F033",e.dropShadowNormalLight="rgba(166, 177, 174, 0.24)",e.dropShadowNormalDark="rgba(0, 0, 0, 0.24)",e.dropShadowHoverLight="rgba(166, 177, 174, 0.8)",e.blackColor="#000000",e.billPayPromoColor="#8D6C9F",e.billPayPromoColorHover="rgba(238, 186, 125, 0.4)",e.billPayPromoBorderColorLight="#FBD1A0",e.billPayPromoBorderColorDark="#714B1E",e.billPayPromoBackGroundColorLight="#FFFBF5",e.reimbursementPromoColor="#5DB59A",e.reimbursementPromoColorHover="rgba(93, 181, 154, 0.4)",e.reimbursementPromoBorderColorLight="#CCE8DF",e.reimbursementPromoBorderColorDark="#545D5B",e.reimbursementPromoBackGroundColorLight="#EDFFF8",e.primaryWhite="#FEFEFE",e.rewardsPromoColor1="#397C93",e.rewardsPromoColor2="#065773",e.zeniAccountsPromoBackgroundColor="#D0E7E2",e.zeniAccountsPromoBackgroundColorLight="#D0E7E250",e.zeniAccountsPromoBackgroundColorDark="#3E434350",e.zeniAccountsPromoNavigationDotHoverColorLight="#36617032",e.zeniAccountsPromoNavigationDotHoverColorDark="#97C3B932",e.zeniAccountsPromoCardTitleLight="#4B4F53",e.chargeCardsGradientColor1="#ECECEC",e.chargeCardsGradientColor2="#626565",e.chargeCardsGradientColor3="#A8B1B1",e.chargeCardsGradientColor4="#444A4A",e.chargeCardBoxShadow1="rgba(132, 134, 137, 0.80)",e.chargeCardBoxShadow2="rgba(0, 0, 0, 0.35)",e.chargeCardBackgroundShadowLight="rgba(166,172,177,0.7)",e.chargeCardBackgroundShadowDark="rgba(0,0,0,0.8)",e.issueChargeCardBackgroundShadowLight="rgba(166,172,177,0.25)",e.issueChargeCardBackgroundShadowDark="rgba(0,0,0,0.25)",e.physicalCardBoxShadow="#68AAA0",e.chargeCardFaded="rgba(166, 176, 177, 0.65)",e.phoneSignalColor="#3C3C432E",e.batteryBorderColor="#3c3c4399",e.physicalCardBlueColor1="#eaeff8",e.physicalCardBlueColor2="#bdd4ee",e.physicalCardYellowColor1="#ffe9c6",e.physicalCardYellowColor2="#fff8ec",e.plaidVerificationBackground="rgb(213, 231, 227, 0.5)",e.tagDefaultBgLight="#ECEFF3",e.tagDefaultColorLight="#667085",e.tagDefaultBgDark="#1C2128",e.tagDefaultColorDark="#8C97A4",e.tagWarningBgLight="#FFF4E5",e.tagWarningColorLight="#C08A2E",e.tagWarningBgDark="#2A2416",e.tagWarningColorDark="#E6C27A",e.tagInfoBgLight="#E0EDFF",e.tagInfoColorLight="#1D62C0",e.tagInfoBgDark="#0E1E35",e.tagInfoColorDark="#7EB3F5",e.tagSuccessBgLight="#E8F5EE",e.tagSuccessColorLight="#3A8F5B",e.tagSuccessBgDark="#11241B",e.tagSuccessColorDark="#7FD9A6",e.tagAttentionBgLight="#FDEFF2",e.tagAttentionColorLight="#C23A57",e.tagAttentionBgDark="#2A1419",e.tagAttentionColorDark="#F29BB0",e.success="#36B37E",e.successDark="#1B806A",e.successLight="#D8FBDE",e.alert="#F0BC02",e.alertDark="#AC7F01",e.alertLight="#FEF7CB",e.important="#EB535D",e.importantDark="#A92949",e.importantLight="#FEE6DD",e.info="#1192E8",e.infoDark="#0855A7",e.infoLight="#CEF6FD",e.link="#4589FF",e.linkLight="#D9ECFF",e.linkDark="#224EB7",e.linkLighter="#D9ECFFAF",e.graphColor01="#EE7D7D",e.graphColor01Light="#F8C9C9",e.graphColor01Dark="#D81C1C",e.graphColor02="#EE7D90",e.graphColor02Light="#F8C9D1",e.graphColor02Dark="#D81C3C",e.graphColor03="#EE7DA3",e.graphColor03Light="#F8C9D9",e.graphColor03Dark="#D81C5B",e.graphColor04="#EE7DB5",e.graphColor04Light="#F8C9E0",e.graphColor04Dark="#D81C7A",e.graphColor05="#EE7DC8",e.graphColor05Light="#F8C9E8",e.graphColor05Dark="#D81C9A",e.graphColor06="#EE7DDB",e.graphColor06Light="#F8C9F0",e.graphColor06Dark="#D81CB9",e.graphColor07="#EE7DEE",e.graphColor07Light="#F8C9F8",e.graphColor07Dark="#D81CD8",e.graphColor08="#DB7DEE",e.graphColor08Light="#F0C9F8",e.graphColor08Dark="#B91CD8",e.graphColor09="#C87DEE",e.graphColor09Light="#E8C9F8",e.graphColor09Dark="#9A1CD8",e.graphColor10="#B67DEE",e.graphColor10Light="#E0C9F8",e.graphColor10Dark="#7A1CD8",e.graphColor11="#A37DEE",e.graphColor11Light="#D9C9F8",e.graphColor11Dark="#5B1CD8",e.graphColor12="#907DEE",e.graphColor12Light="#D1C9F8",e.graphColor12Dark="#3C1CD8",e.graphColor13="#7D7DEE",e.graphColor13Light="#C9C9F8",e.graphColor13Dark="#1C1CD8",e.graphColor14="#7D90EE",e.graphColor14Light="#C9D1F8",e.graphColor14Dark="#1C3CD8",e.graphColor15="#7DA3EE",e.graphColor15Light="#C9D9F8",e.graphColor15Dark="#1C5BD8",e.graphColor16="#7DB6EE",e.graphColor16Light="#C9E0F8",e.graphColor16Dark="#1C7AD8",e.graphColor17="#7DC8EE",e.graphColor17Light="#C9E8F8",e.graphColor17Dark="#1C9AD8",e.graphColor18="#7DDBEE",e.graphColor18Light="#C9F0F8",e.graphColor18Dark="#1CB9D8",e.graphColor19="#7DEEEE",e.graphColor19Light="#C9F8F8",e.graphColor19Dark="#1CD8D8",e.graphColor20="#7DEEDB",e.graphColor20Light="#C9F8F0",e.graphColor20Dark="#1CD8B9",e.graphColor21="#7DEEC8",e.graphColor21Light="#C9F8E8",e.graphColor21Dark="#1CD89A",e.graphColor22="#7DEEB5",e.graphColor22Light="#C9F8E0",e.graphColor22Dark="#1CD87A",e.graphColor23="#7DEEA3",e.graphColor23Light="#C9F8D9",e.graphColor23Dark="#1CD85B",e.graphColor24="#7DEE90",e.graphColor24Light="#C9F8D1",e.graphColor24Dark="#1CD83C",e.graphColor25="#7DEE7D",e.graphColor25Light="#C9F8C9",e.graphColor25Dark="#1CD81C",e.graphColor26="#90EE7D",e.graphColor26Light="#D1F8C9",e.graphColor26Dark="#3CD81C",e.graphColor27="#A3EE7D",e.graphColor27Light="#D9F8C9",e.graphColor27Dark="#5BD81C",e.graphColor28="#B5EE7D",e.graphColor28Light="#E0F8C9",e.graphColor28Dark="#7AD81C",e.graphColor29="#C8EE7D",e.graphColor29Light="#E8F8C9",e.graphColor29Dark="#9AD81C",e.graphColor30="#DBEE7D",e.graphColor30Light="#F0F8C9",e.graphColor30Dark="#B9D81C",e.graphColor31="#EEEE7D",e.graphColor31Light="#F8F8C9",e.graphColor31Dark="#D8D81C",e.graphColor32="#EEDB7D",e.graphColor32Light="#F8F0C9",e.graphColor32Dark="#D8B91C",e.graphColor33="#EEC87D",e.graphColor33Light="#F8E8C9",e.graphColor33Dark="#D89A1C",e.graphColor34="#EEB57D",e.graphColor34Light="#F8E0C9",e.graphColor34Dark="#D87A1C",e.graphColor35="#EEA37D",e.graphColor35Light="#F8D9C9",e.graphColor35Dark="#D85B1C",e.graphColor36="#EE907D",e.graphColor36Light="#F8D1C9",e.graphColor36Dark="#D83C1C",e.overlayLight="rgba(0, 0, 0, 0.40)",e.overlayDark="rgba(0, 0, 0, 0.75)",e.overlayBackgroundBlack="rgba(0, 0, 0, 0.50)",e.playButtonBackGroundColorLight="#16232466",e.playButtonBackGroundColorDark="#16232466",e.backgroundGradient1Light="rgba(54, 97, 112, 0.20)",e.backgroundGradient1Dark="rgba(151, 195, 185, 0.20)",e.backgroundGradient2Light="rgba(255, 255, 255, 0.20)",e.backgroundGradient2Dark="rgba(0, 0, 0, 0.20)",e.backgroundGradient3Light="rgba(212, 220, 221, 1)",e.boxShadowElevation="rgba(166, 172, 177, 0.24)",e.Elevation1Light="0px 1px 2px 0px rgba(166, 172, 177, 0.25)",e.Elevation2Light="0px 2px 8px 0px rgba(166, 172, 177, 0.8)",e.Elevation3Light="1px 3px 24px 0px rgba(166, 172, 177, 0.8)",e.Elevation1Dark="0px 1px 2px 0px rgba(0, 0, 0, 0.25)",e.Elevation2Dark="0px 2px 8px 0px rgba(0, 0, 0, 0.8)",e.Elevation3Dark="1px 3px 24px 0px rgba(0, 0, 0, 0.8)",e.scrollbarBoxShadow="rgba(0, 0, 0, 0.1)",e.drawerBackground="rgba(0, 0, 0, 0.7)",e.modalBackground="rgba(0, 0, 0, 0.64)",e.whiteGradient="rgba(255, 255, 255, 0)",e.whiteGradientDark="rgba(255, 255, 255, 0.1)",e.whiteGradientLight="rgba(255, 255, 255, 0.9)",e.runwayRed="#eb535d",e.runwayYellow="#e8aa0b",e.runwayGreen="#51c571",e.optionBorderLight="#E9ECF0",e.selectMenuItem="#1d1f20",e.aiCfoGradient1="#6D3FD8",e.aiCfoGradient2="#BD54CF",e.aiCfoGradient3="#CF6CC9",e.aiCfoGradient4="#EE609C",e.aiVibrantPurple="#7135FF",e.aiCfoLinearGradient="linear-gradient(315deg, #6D3FD8 34.09%, #BD54CF 43.64%, #CF6CC9 50%, #EE609C 56.36%, #EE609C 65.91%)",e.aiChainOfThoughtLinearGradient="linear-gradient(322.09deg, #6D3FD8 7.71%, #BD54CF 30.79%, #CF6CC9 54.3%, #EE609C 78.68%, #EE609C 98.27%);",e.aiChainOfThoughtBackgroundGradient="linear-gradient(296.16deg, #6D3FD8b3 20.44%, #BD54CFb3 40.68%, #CF6CC9b3 54.18%, #EE609Cb3 67.68%, #EE609Cb3 87.92%)",e.aiCfoScrollAreaFadeGradientLight="linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 100%)",e.aiCfoScrollAreaFadeGradientDark="linear-gradient(180deg, rgba(0,0,0, 0) 0%, #2C2F2F 100%)",e.receiptAgentLinearGradient="linear-gradient(315deg, #6D3FD8 31.79%, #BD54CF 42.72%, #CF6CC9 50%, #EE609C 57.28%,#EE609C 68.21%)",e.aiParsingBorderConicGradient=`conic-gradient(
352
352
  from var(--ai-conic-from) at 50% 50%,
353
353
  #EE609C 0deg,
354
354
  #CF6CC9 45deg,
@@ -18162,7 +18162,7 @@ to {
18162
18162
  flex-direction: row;
18163
18163
  align-items: center;
18164
18164
  gap: ${r.sp3};
18165
- `,tU={searchCancelIconPadding:new j(2,2),searchIconHeightWidth:new j(C[4],C[4])},A0e=80;function F8o(e,t){if(typeof navigator>"u")return null;const o=navigator.userAgent?.toLowerCase()??"";return o.includes("mac")?e:o.includes("win")||o.includes("linux")?t:null}function GS({enableSearchHotkey:e=!1,disabled:t=!1,inputWrapperStyle:o,keepSearchBoxOpen:i=!1,placeholder:a,searchBarDataTestId:l,searchIconMarginRight:d,searchText:c="",style:p,styledSearchCancelIconWrapperStyle:u,styledSearchIconContainerStyle:h,styledSearchIconWrapperStyle:m,onSearchOpen:f,onSearchTextChanged:x}){const y=Ie(),[w,b]=g.useState(!!i),v=g.useRef(null),A=g.useRef(void 0),{common:S}=Q.getLocalizedStrings(),E=e?F8o(S.texts.searchShortcutCmd,S.texts.searchShortcutCtrl):null,I=E!=null?`${S.search} (${E})`:S.search;g.useEffect(()=>{c.length>0&&b(!0)},[c]);const L=g.useRef(w);return g.useEffect(()=>{const B=L.current;if(L.current=w,B===!1&&w===!0&&y!=="small"){const P=window.setTimeout(()=>{v.current?.focus()},A0e);return()=>window.clearTimeout(P)}B===!0&&w===!1&&(A.current!==void 0&&(window.clearTimeout(A.current),A.current=void 0),v.current?.blur())},[w,y]),g.useEffect(()=>{if(!e)return;const B=P=>{(P.metaKey&&P.key==="k"||P.ctrlKey&&P.key==="k")&&(P.preventDefault(),b(!0),f?.(!0),A.current!==void 0&&window.clearTimeout(A.current),A.current=window.setTimeout(()=>{v.current?.focus(),A.current=void 0},A0e))};return globalThis.addEventListener("keydown",B),()=>{globalThis.removeEventListener("keydown",B),A.current!==void 0&&(window.clearTimeout(A.current),A.current=void 0)}},[e,f]),s.jsx(sr,{onClickAway:()=>{c.length===0&&(b(!!i),f?.(!1))},children:s.jsxs(G8o,{"data-testid":l,isSearchOpen:w,searchIconMarginRight:d,searchText:c,style:p,windowSize:y,children:[s.jsx(V8o,{style:h,windowSize:y,searchIconMarginRight:d,isSearchOpen:w,disabled:t,onClick:()=>{!w&&!t&&(b(!0),f?.(!0))},children:s.jsx(St,{placement:"bottom",title:I,arrow:!0,enterDelay:600,children:s.jsx(H8o,{windowSize:y,children:s.jsx(_8o,{"data-testid":te("search-icon"),disabled:t})})})}),s.jsxs(O8o,{$isSearchOpen:w,style:{...o},children:[s.jsx(N8o,{"data-testid":te("search-input"),windowSize:y,placeholder:a,value:c,tabIndex:w?0:-1,"aria-hidden":w===!1?!0:void 0,onChange:B=>{const P=B.target;x?.(P.value)},ref:v}),s.jsx(Q8o,{windowSize:y,style:m,children:c.length>0?s.jsx(W8o,{windowSize:y,style:u,onClick:()=>{x?.("")},children:s.jsx(U8o,{width:r.sp3,height:r.sp3,"data-testid":te("search-cancel-icon")})}):null})]})]})})}const O8o=n.div`
18165
+ `,tU={searchCancelIconPadding:new j(2,2),searchIconHeightWidth:new j(C[4],C[4])},A0e=80;function F8o(e,t){if(typeof navigator>"u")return null;const o=navigator.userAgent?.toLowerCase()??"";return o.includes("mac")?e:o.includes("win")||o.includes("linux")?t:null}function GS({enableSearchHotkey:e=!1,disabled:t=!1,inputWrapperStyle:o,keepSearchBoxOpen:i=!1,placeholder:a,searchBarDataTestId:l,searchIconMarginRight:d,searchText:c="",style:p,styledSearchCancelIconWrapperStyle:u,styledSearchIconContainerStyle:h,styledSearchIconWrapperStyle:m,onSearchOpen:f,onSearchTextChanged:x}){const y=Ie(),[w,b]=g.useState(!!i),v=g.useRef(null),A=g.useRef(void 0),{common:S}=Q.getLocalizedStrings(),E=e?F8o(S.texts.searchShortcutCmd,S.texts.searchShortcutCtrl):null,I=E!=null?`${S.search} (${E})`:S.search;g.useEffect(()=>{c.length>0&&b(!0)},[c]);const L=g.useRef(w);return g.useEffect(()=>{const B=L.current;if(L.current=w,B===!1&&w===!0&&y!=="small"){const P=window.setTimeout(()=>{v.current?.focus()},A0e);return()=>window.clearTimeout(P)}B===!0&&w===!1&&(A.current!==void 0&&(window.clearTimeout(A.current),A.current=void 0),v.current?.blur())},[w,y]),g.useEffect(()=>{if(!e)return;const B=P=>{(P.metaKey&&P.key==="k"||P.ctrlKey&&P.key==="k")&&(P.preventDefault(),b(!0),f?.(!0),A.current!==void 0&&window.clearTimeout(A.current),A.current=window.setTimeout(()=>{v.current?.focus(),A.current=void 0},A0e))};return globalThis.addEventListener("keydown",B),()=>{globalThis.removeEventListener("keydown",B),A.current!==void 0&&(window.clearTimeout(A.current),A.current=void 0)}},[e,f]),s.jsx(sr,{onClickAway:()=>{c.length===0&&(b(!!i),f?.(!1))},children:s.jsxs(G8o,{"data-testid":l,isSearchOpen:w,searchIconMarginRight:d,searchText:c,style:p,windowSize:y,children:[s.jsx(V8o,{style:h,windowSize:y,searchIconMarginRight:d,isSearchOpen:w,disabled:t,onClick:()=>{!w&&!t&&(b(!0),f?.(!0))},children:s.jsx(St,{placement:"bottom",title:I,arrow:!0,enterDelay:600,children:s.jsx(H8o,{windowSize:y,children:s.jsx(_8o,{"data-testid":te("search-icon"),disabled:t})})})}),s.jsxs(O8o,{$isSearchOpen:w,style:{...o},children:[s.jsx(N8o,{"data-testid":te("search-input"),windowSize:y,placeholder:a,value:c,tabIndex:w?0:-1,"aria-hidden":w===!1?!0:void 0,onChange:B=>{const P=B.target;x?.(P.value)},onKeyDown:B=>{B.key==="Enter"?(B.preventDefault(),x?.(c)):B.key==="Escape"&&(B.preventDefault(),B.stopPropagation(),x?.(""),b(i),f?.(!1),v.current?.blur())},ref:v}),s.jsx(Q8o,{windowSize:y,style:m,children:c.length>0?s.jsx(W8o,{windowSize:y,style:u,onClick:()=>{x?.("")},children:s.jsx(U8o,{width:r.sp3,height:r.sp3,"data-testid":te("search-cancel-icon")})}):null})]})]})})}const O8o=n.div`
18166
18166
  display: flex;
18167
18167
  align-items: center;
18168
18168
  flex: 1;
@@ -21518,7 +21518,7 @@ to {
21518
21518
  align-content: center;
21519
21519
  min-width: 235px;
21520
21520
  max-width: 260px;
21521
- `;function wko({planAmount:e,dimension:t,windowSize:o,cardType:i,cardIndex:a,onCardClick:l}){const{rewardsCard:d,referAndEarn:c}=Q.getLocalizedStrings().rewardsPage;return s.jsx(mko,{dimension:t,onClick:()=>l(a,i),"data-testid":te("dashboard",i),children:s.jsxs(gko,{windowSize:o,children:[s.jsx(fko,{children:c}),s.jsx(xko,{windowSize:o,children:d.rewardsSummaryShort.replace("__reward-amount__",It("0,0",e))}),s.jsx(yko,{children:s.jsx(uko,{planAmount:e})})]})})}function bko({card:e,actions:t,data:o,dndProps:i}){const a=Ie();return s.jsx(bn,{isDragging:i?.draggedCardType!=null,isDragOver:i?.dragOverCard===e.cardType,draggable:!0,onDragStart:l=>i?.onDragStart(e.cardType,l),onDragOver:l=>i?.onDragOver(l,e.cardType),onDragLeave:l=>i?.onDragLeave(l),onDrop:l=>i?.onDrop(l,e.cardType),dimension:e.dimension,children:s.jsx(Rl,{card:e,actions:t,children:s.jsx(wko,{planAmount:o.rewardsPlan.referrerAmount,dimension:e.dimension,windowSize:a,cardType:e.cardType,cardIndex:e.cardIndex,onCardClick:t.onCardClick})})},e.cardIndex)}function vko(e,t){return e<=50?t:e<=75?k.brandColorGoldDark:k.success}const{common:Xa,expenseAutomation:Rq}=Q.getLocalizedStrings(),{overview:g3}=Rq,D2e=168,T2e=C[7],z2e=30;function Cko({card:e,actions:t,aiAuditScorePercentageEnabled:o,data:i,dndProps:a}){return i?.monthEndCloseChecks?.monthEndCloseCheckList==null||i.selectedPeriod==null?null:s.jsx(bn,{isDragging:a?.draggedCardType!=null,isDragOver:a?.dragOverCard===e.cardType,draggable:!0,onDragStart:l=>a?.onDragStart(e.cardType,l),onDragOver:l=>a?.onDragOver(l,e.cardType),onDragLeave:l=>a?.onDragLeave(l),onDrop:l=>a?.onDrop(l,e.cardType),dimension:e.dimension,children:s.jsx(Rl,{card:e,actions:t,children:o?s.jsx(Ako,{card:e,actions:t,data:i}):s.jsx($ko,{card:e,actions:t,data:i})})},e.cardIndex)}function Ako({card:e,actions:t,data:o}){const i=at(),{monthEndCloseChecks:a,selectedPeriod:l}=o;if(a?.monthEndCloseCheckList==null||l==null)return null;const d=a.auditSummary,c=Math.floor(d.auditScorePercentage),p=Math.floor(d.auditScorePercentageAI??0),u=Math.max(0,c-p),h=Math.max(0,100-c);return s.jsx(Nko,{dimension:e.dimension,onClick:()=>t.onCardClick(e.cardIndex,e.cardType),"data-testid":te("dashboard",e.cardType),children:s.jsxs(kko,{children:[s.jsxs(Sko,{children:[Xa.monthsByIndex[l.month],Xa.strings.space,Xa.close]}),s.jsxs(Eko,{children:[s.jsxs(Lko,{children:[s.jsxs(R2e,{children:[s.jsxs(jko,{children:[c,Xa.strings.percentage]}),s.jsx(F2e,{children:Xa.texts.complete})]}),s.jsxs(R2e,{children:[s.jsxs(Iko,{children:[p,Xa.strings.percentage]}),s.jsx(F2e,{children:g3.byAI})]})]}),s.jsxs(Mko,{children:[s.jsx(O2e,{widthPercent:p,color:k.success}),s.jsx(O2e,{widthPercent:u,color:k.brandColorSapphire})]}),s.jsxs(Bko,{children:[s.jsxs(N2e,{children:[s.jsxs(Hko,{children:[p,Xa.strings.percentage]}),s.jsxs(_ko,{children:[" ",g3.byAI]})]}),s.jsxs(N2e,{children:[s.jsxs(Vko,{children:[u,Xa.strings.percentage]}),s.jsxs(Qko,{children:[" ",g3.byHumans]})]}),s.jsxs(Pko,{children:[h,Xa.strings.percentage,Xa.strings.space,g3.remaining]})]})]}),s.jsxs(Dko,{children:[s.jsx(vN,{$textAlign:"left",$width:D2e,children:g3.workflows}),s.jsx(vN,{$width:T2e,$textAlign:"right",children:g3.progress}),s.jsx(vN,{$width:z2e,$textAlign:"right",children:g3.headerByAI})]}),s.jsx(Tko,{children:a.monthEndCloseCheckList.filter(m=>m.id!=="month_end_insights").map(m=>s.jsxs(zko,{children:[s.jsx(Rko,{$width:D2e,children:Rq.dashboardCard[m.id]}),s.jsxs(Fko,{$width:T2e,children:[Math.floor(m.progress),Xa.strings.percentage]}),s.jsxs(Oko,{$width:z2e,$color:vko(m.progressAI,i.colors.grey1),children:[Math.floor(m.progressAI),Xa.strings.percentage]})]},m.id))})]})})}function $ko({card:e,actions:t,data:o}){const{monthEndCloseChecks:i,selectedPeriod:a}=o;return i?.monthEndCloseCheckList==null||a==null?null:s.jsx(dn,{dimension:e.dimension,style:{cursor:"pointer"},onClick:()=>t.onCardClick(e.cardIndex,e.cardType),"data-testid":te("dashboard",e.cardType),children:s.jsxs(Yko,{children:[s.jsxs(Uko,{children:[s.jsxs(Wko,{children:[Xa.monthsByIndex[a.month],Xa.strings.space,Xa.close]}),s.jsxs(Gko,{children:[Math.floor(i.auditSummary.auditScorePercentage),Xa.strings.percentage," ",Xa.texts.complete]})]}),s.jsx(Kko,{children:i.monthEndCloseCheckList.filter(l=>l.id!=="month_end_insights").map(l=>s.jsxs(qko,{children:[s.jsx(Zko,{completion:l.progress,children:s.jsx(Jko,{children:Rq.dashboardCard[l.id]})}),s.jsxs(Xko,{children:[Math.floor(l.progress),Xa.strings.percentage]})]},l.id))})]})})}const kko=n.div`
21521
+ `;function wko({planAmount:e,dimension:t,windowSize:o,cardType:i,cardIndex:a,onCardClick:l}){const{rewardsCard:d,referAndEarn:c}=Q.getLocalizedStrings().rewardsPage;return s.jsx(mko,{dimension:t,onClick:()=>l(a,i),"data-testid":te("dashboard",i),children:s.jsxs(gko,{windowSize:o,children:[s.jsx(fko,{children:c}),s.jsx(xko,{windowSize:o,children:d.rewardsSummaryShort.replace("__reward-amount__",It("0,0",e))}),s.jsx(yko,{children:s.jsx(uko,{planAmount:e})})]})})}function bko({card:e,actions:t,data:o,dndProps:i}){const a=Ie();return s.jsx(bn,{isDragging:i?.draggedCardType!=null,isDragOver:i?.dragOverCard===e.cardType,draggable:!0,onDragStart:l=>i?.onDragStart(e.cardType,l),onDragOver:l=>i?.onDragOver(l,e.cardType),onDragLeave:l=>i?.onDragLeave(l),onDrop:l=>i?.onDrop(l,e.cardType),dimension:e.dimension,children:s.jsx(Rl,{card:e,actions:t,children:s.jsx(wko,{planAmount:o.rewardsPlan.referrerAmount,dimension:e.dimension,windowSize:a,cardType:e.cardType,cardIndex:e.cardIndex,onCardClick:t.onCardClick})})},e.cardIndex)}function vko(e,t){return e<=50?t.hero:e<=75?k.brandColorGoldDark:k.success}const{common:Xa,expenseAutomation:Rq}=Q.getLocalizedStrings(),{overview:g3}=Rq,D2e=168,T2e=C[7],z2e=30;function Cko({card:e,actions:t,aiAuditScorePercentageEnabled:o,data:i,dndProps:a}){return i?.monthEndCloseChecks?.monthEndCloseCheckList==null||i.selectedPeriod==null?null:s.jsx(bn,{isDragging:a?.draggedCardType!=null,isDragOver:a?.dragOverCard===e.cardType,draggable:!0,onDragStart:l=>a?.onDragStart(e.cardType,l),onDragOver:l=>a?.onDragOver(l,e.cardType),onDragLeave:l=>a?.onDragLeave(l),onDrop:l=>a?.onDrop(l,e.cardType),dimension:e.dimension,children:s.jsx(Rl,{card:e,actions:t,children:o?s.jsx(Ako,{card:e,actions:t,data:i}):s.jsx($ko,{card:e,actions:t,data:i})})},e.cardIndex)}function Ako({card:e,actions:t,data:o}){const i=at(),{monthEndCloseChecks:a,selectedPeriod:l}=o;if(a?.monthEndCloseCheckList==null||l==null)return null;const d=a.auditSummary,c=Math.floor(d.auditScorePercentage),p=Math.floor(d.auditScorePercentageAI??0),u=Math.max(0,c-p),h=Math.max(0,100-c);return s.jsx(Nko,{dimension:e.dimension,onClick:()=>t.onCardClick(e.cardIndex,e.cardType),"data-testid":te("dashboard",e.cardType),children:s.jsxs(kko,{children:[s.jsxs(Sko,{children:[Xa.monthsByIndex[l.month],Xa.strings.space,Xa.close]}),s.jsxs(Eko,{children:[s.jsxs(Lko,{children:[s.jsxs(R2e,{children:[s.jsxs(jko,{children:[c,Xa.strings.percentage]}),s.jsx(F2e,{children:Xa.texts.complete})]}),s.jsxs(R2e,{children:[s.jsxs(Iko,{children:[p,Xa.strings.percentage]}),s.jsx(F2e,{children:g3.byAI})]})]}),s.jsxs(Mko,{children:[s.jsx(O2e,{widthPercent:p,color:k.success}),s.jsx(O2e,{widthPercent:u,color:k.brandColorSapphire})]}),s.jsxs(Bko,{children:[s.jsxs(N2e,{children:[s.jsxs(Hko,{children:[p,Xa.strings.percentage]}),s.jsxs(_ko,{children:[" ",g3.byAI]})]}),s.jsxs(N2e,{children:[s.jsxs(Vko,{children:[u,Xa.strings.percentage]}),s.jsxs(Qko,{children:[" ",g3.byHumans]})]}),s.jsxs(Pko,{children:[h,Xa.strings.percentage,Xa.strings.space,g3.remaining]})]})]}),s.jsxs(Dko,{children:[s.jsx(vN,{$textAlign:"left",$width:D2e,children:g3.workflows}),s.jsx(vN,{$width:T2e,$textAlign:"right",children:g3.progress}),s.jsx(vN,{$width:z2e,$textAlign:"right",children:g3.headerByAI})]}),s.jsx(Tko,{children:a.monthEndCloseCheckList.filter(m=>m.id!=="month_end_insights").map(m=>s.jsxs(zko,{children:[s.jsx(Rko,{$width:D2e,children:Rq.dashboardCard[m.id]}),s.jsxs(Fko,{$width:T2e,children:[Math.floor(m.progress),Xa.strings.percentage]}),s.jsxs(Oko,{$width:z2e,$color:vko(m.progressAI,i.colors),children:[Math.floor(m.progressAI),Xa.strings.percentage]})]},m.id))})]})})}function $ko({card:e,actions:t,data:o}){const{monthEndCloseChecks:i,selectedPeriod:a}=o;return i?.monthEndCloseCheckList==null||a==null?null:s.jsx(dn,{dimension:e.dimension,style:{cursor:"pointer"},onClick:()=>t.onCardClick(e.cardIndex,e.cardType),"data-testid":te("dashboard",e.cardType),children:s.jsxs(Yko,{children:[s.jsxs(Uko,{children:[s.jsxs(Wko,{children:[Xa.monthsByIndex[a.month],Xa.strings.space,Xa.close]}),s.jsxs(Gko,{children:[Math.floor(i.auditSummary.auditScorePercentage),Xa.strings.percentage," ",Xa.texts.complete]})]}),s.jsx(Kko,{children:i.monthEndCloseCheckList.filter(l=>l.id!=="month_end_insights").map(l=>s.jsxs(qko,{children:[s.jsx(Zko,{completion:l.progress,children:s.jsx(Jko,{children:Rq.dashboardCard[l.id]})}),s.jsxs(Xko,{children:[Math.floor(l.progress),Xa.strings.percentage]})]},l.id))})]})})}const kko=n.div`
21522
21522
  display: flex;
21523
21523
  flex-direction: column;
21524
21524
  width: 100%;
@@ -22860,7 +22860,7 @@ to {
22860
22860
  ${({isMenuVisible:e})=>e===!1?ue`
22861
22861
  display: none;
22862
22862
  `:null};
22863
- `,IPe=e=>g.createElement("svg",{width:208,height:208,viewBox:"0 0 208 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("g",{filter:"url(#filter0_f_251_38441)"},g.createElement("circle",{cx:104,cy:104,r:44,fill:"url(#paint0_linear_251_38441)"}),g.createElement("circle",{cx:104,cy:104,r:50,stroke:"url(#paint1_linear_251_38441)",strokeWidth:12})),g.createElement("g",{filter:"url(#filter1_d_251_38441)"},g.createElement("circle",{cx:104,cy:104,r:41.1429,fill:"#FAFAFA"}),g.createElement("circle",{cx:104,cy:104,r:43.1429,stroke:"url(#paint2_linear_251_38441)",strokeWidth:4})),g.createElement("g",{clipPath:"url(#clip0_251_38441)"},g.createElement("path",{d:"M120.16 102.411L96.2853 90.4684C96.0134 90.3343 95.7118 90.2718 95.409 90.2867C95.1062 90.3016 94.8122 90.3935 94.5548 90.5536C94.2974 90.7138 94.0851 90.9369 93.938 91.202C93.7908 91.467 93.7137 91.7652 93.7139 92.0684V115.931C93.7137 116.234 93.7908 116.533 93.938 116.798C94.0851 117.063 94.2974 117.286 94.5548 117.446C94.8122 117.606 95.1062 117.698 95.409 117.713C95.7118 117.728 96.0134 117.665 96.2853 117.531L120.16 105.588C120.456 105.442 120.706 105.216 120.88 104.935C121.055 104.654 121.147 104.33 121.147 104C121.147 103.669 121.055 103.345 120.88 103.065C120.706 102.784 120.456 102.558 120.16 102.411Z",fill:"black"})),g.createElement("defs",null,g.createElement("filter",{id:"filter0_f_251_38441",x:0,y:0,width:208,height:208,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},g.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),g.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),g.createElement("feGaussianBlur",{stdDeviation:24,result:"effect1_foregroundBlur_251_38441"})),g.createElement("filter",{id:"filter1_d_251_38441",x:54.8569,y:58.8571,width:98.2856,height:98.2857,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},g.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),g.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),g.createElement("feOffset",{dy:4}),g.createElement("feGaussianBlur",{stdDeviation:2}),g.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),g.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),g.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_251_38441"}),g.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_251_38441",result:"shape"})),g.createElement("linearGradient",{id:"paint0_linear_251_38441",x1:119.671,y1:119.671,x2:87.9755,y2:87.9758,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#7135FF"}),g.createElement("stop",{offset:.27204,stopColor:"#A050E4"}),g.createElement("stop",{offset:.364594,stopColor:"#B85ED7"}),g.createElement("stop",{offset:.546546,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.732127,stopColor:"#EE609C"}),g.createElement("stop",{offset:.85586,stopColor:"#EB61A0"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint1_linear_251_38441",x1:119.671,y1:119.671,x2:87.9755,y2:87.9758,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#7135FF"}),g.createElement("stop",{offset:.27204,stopColor:"#A050E4"}),g.createElement("stop",{offset:.364594,stopColor:"#B85ED7"}),g.createElement("stop",{offset:.546546,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.732127,stopColor:"#EE609C"}),g.createElement("stop",{offset:.85586,stopColor:"#EB61A0"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint2_linear_251_38441",x1:118.653,y1:118.653,x2:89.0159,y2:89.0164,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#7135FF"}),g.createElement("stop",{offset:.27204,stopColor:"#A050E4"}),g.createElement("stop",{offset:.364594,stopColor:"#B85ED7"}),g.createElement("stop",{offset:.546546,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.732127,stopColor:"#EE609C"}),g.createElement("stop",{offset:.85586,stopColor:"#EB61A0"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("clipPath",{id:"clip0_251_38441"},g.createElement("rect",{width:27.4286,height:27.4286,fill:"white",transform:"translate(93.7139 90.2849)"})))),ume=g.lazy(()=>n4(()=>import("./index-DoD1kYk-.js"),__vite__mapDeps([13,5,1,6])));function NLo({src:e,autoPlay:t=!0,config:o,controls:i=!0,height:a="100%",isModalOpen:l,loop:d=!1,muted:c=!1,showPlayButton:p=!1,style:u,thumbnail:h,width:m="100%",onEnded:f,onModalClose:x,onPlay:y}){const w=Ie(),[b,v]=g.useState(!1);g.useEffect(()=>{l===!0&&t?v(!0):l===!1&&v(!1)},[l,t]);const A={};o?.youtube&&(A.youtube=o.youtube);const S=()=>{v(!0),y?.()},E=()=>{v(!1),x?.()},I=()=>{v(!1),f?.(),l!=null&&x?.()},L=()=>{v(!0),y?.()};return l!=null?l?_n.createPortal(s.jsx(ULo,{windowSize:w,role:"presentation",children:s.jsx(sr,{onClickAway:E,children:s.jsx(WLo,{windowSize:w,"data-testid":"video-player-modal",children:s.jsxs(GLo,{children:[p&&!b&&s.jsxs(s.Fragment,{children:[h!=null&&h!==""&&s.jsx(QLo,{src:h,alt:"Video thumbnail"}),s.jsx(_Lo,{onClick:S,children:s.jsx(VLo,{windowSize:w})})]}),(!p||b)&&s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:"100%",height:"100%"}}),children:s.jsx(ume,{src:e,playing:b,controls:i,muted:c,loop:d,width:"100%",height:"100%",onEnded:I,onPlay:L,config:A})})]})})})}),document.body):null:s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:m,height:a,...u}}),children:s.jsx(ume,{src:e,playing:b,controls:i,muted:c,loop:d,width:m,height:a,style:u,light:p&&!b?h??!0:!1,onEnded:I,onPlay:L,config:A})})}const HLo=Nt`
22863
+ `,IPe=e=>g.createElement("svg",{width:208,height:208,viewBox:"0 0 208 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("g",{filter:"url(#filter0_f_251_38441)"},g.createElement("circle",{cx:104,cy:104,r:44,fill:"url(#paint0_linear_251_38441)"}),g.createElement("circle",{cx:104,cy:104,r:50,stroke:"url(#paint1_linear_251_38441)",strokeWidth:12})),g.createElement("g",{filter:"url(#filter1_d_251_38441)"},g.createElement("circle",{cx:104,cy:104,r:41.1429,fill:"#FAFAFA"}),g.createElement("circle",{cx:104,cy:104,r:43.1429,stroke:"url(#paint2_linear_251_38441)",strokeWidth:4})),g.createElement("g",{clipPath:"url(#clip0_251_38441)"},g.createElement("path",{d:"M120.16 102.411L96.2853 90.4684C96.0134 90.3343 95.7118 90.2718 95.409 90.2867C95.1062 90.3016 94.8122 90.3935 94.5548 90.5536C94.2974 90.7138 94.0851 90.9369 93.938 91.202C93.7908 91.467 93.7137 91.7652 93.7139 92.0684V115.931C93.7137 116.234 93.7908 116.533 93.938 116.798C94.0851 117.063 94.2974 117.286 94.5548 117.446C94.8122 117.606 95.1062 117.698 95.409 117.713C95.7118 117.728 96.0134 117.665 96.2853 117.531L120.16 105.588C120.456 105.442 120.706 105.216 120.88 104.935C121.055 104.654 121.147 104.33 121.147 104C121.147 103.669 121.055 103.345 120.88 103.065C120.706 102.784 120.456 102.558 120.16 102.411Z",fill:"black"})),g.createElement("defs",null,g.createElement("filter",{id:"filter0_f_251_38441",x:0,y:0,width:208,height:208,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},g.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),g.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),g.createElement("feGaussianBlur",{stdDeviation:24,result:"effect1_foregroundBlur_251_38441"})),g.createElement("filter",{id:"filter1_d_251_38441",x:54.8569,y:58.8571,width:98.2856,height:98.2857,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},g.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),g.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),g.createElement("feOffset",{dy:4}),g.createElement("feGaussianBlur",{stdDeviation:2}),g.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),g.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),g.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_251_38441"}),g.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_251_38441",result:"shape"})),g.createElement("linearGradient",{id:"paint0_linear_251_38441",x1:119.671,y1:119.671,x2:87.9755,y2:87.9758,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#7135FF"}),g.createElement("stop",{offset:.27204,stopColor:"#A050E4"}),g.createElement("stop",{offset:.364594,stopColor:"#B85ED7"}),g.createElement("stop",{offset:.546546,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.732127,stopColor:"#EE609C"}),g.createElement("stop",{offset:.85586,stopColor:"#EB61A0"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint1_linear_251_38441",x1:119.671,y1:119.671,x2:87.9755,y2:87.9758,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#7135FF"}),g.createElement("stop",{offset:.27204,stopColor:"#A050E4"}),g.createElement("stop",{offset:.364594,stopColor:"#B85ED7"}),g.createElement("stop",{offset:.546546,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.732127,stopColor:"#EE609C"}),g.createElement("stop",{offset:.85586,stopColor:"#EB61A0"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint2_linear_251_38441",x1:118.653,y1:118.653,x2:89.0159,y2:89.0164,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#7135FF"}),g.createElement("stop",{offset:.27204,stopColor:"#A050E4"}),g.createElement("stop",{offset:.364594,stopColor:"#B85ED7"}),g.createElement("stop",{offset:.546546,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.732127,stopColor:"#EE609C"}),g.createElement("stop",{offset:.85586,stopColor:"#EB61A0"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("clipPath",{id:"clip0_251_38441"},g.createElement("rect",{width:27.4286,height:27.4286,fill:"white",transform:"translate(93.7139 90.2849)"})))),ume=g.lazy(()=>n4(()=>import("./index-nuQ6WJZH.js"),__vite__mapDeps([13,5,1,6])));function NLo({src:e,autoPlay:t=!0,config:o,controls:i=!0,height:a="100%",isModalOpen:l,loop:d=!1,muted:c=!1,showPlayButton:p=!1,style:u,thumbnail:h,width:m="100%",onEnded:f,onModalClose:x,onPlay:y}){const w=Ie(),[b,v]=g.useState(!1);g.useEffect(()=>{l===!0&&t?v(!0):l===!1&&v(!1)},[l,t]);const A={};o?.youtube&&(A.youtube=o.youtube);const S=()=>{v(!0),y?.()},E=()=>{v(!1),x?.()},I=()=>{v(!1),f?.(),l!=null&&x?.()},L=()=>{v(!0),y?.()};return l!=null?l?_n.createPortal(s.jsx(ULo,{windowSize:w,role:"presentation",children:s.jsx(sr,{onClickAway:E,children:s.jsx(WLo,{windowSize:w,"data-testid":"video-player-modal",children:s.jsxs(GLo,{children:[p&&!b&&s.jsxs(s.Fragment,{children:[h!=null&&h!==""&&s.jsx(QLo,{src:h,alt:"Video thumbnail"}),s.jsx(_Lo,{onClick:S,children:s.jsx(VLo,{windowSize:w})})]}),(!p||b)&&s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:"100%",height:"100%"}}),children:s.jsx(ume,{src:e,playing:b,controls:i,muted:c,loop:d,width:"100%",height:"100%",onEnded:I,onPlay:L,config:A})})]})})})}),document.body):null:s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:m,height:a,...u}}),children:s.jsx(ume,{src:e,playing:b,controls:i,muted:c,loop:d,width:m,height:a,style:u,light:p&&!b?h??!0:!1,onEnded:I,onPlay:L,config:A})})}const HLo=Nt`
22864
22864
  0% {
22865
22865
  transform: rotate(0deg);
22866
22866
  }
@@ -88745,7 +88745,7 @@ ${e}`,OBr=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
88745
88745
  `,sJr=n(bK)`
88746
88746
  color: ${e=>e.theme.colors.alert};
88747
88747
  margin-top: ${r.sp2};
88748
- `;var lJr=TVe();const Gy=DW(lJr);class dJr{getSignedInUser(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID),o=window.localStorage.getItem(this.ZENI_SIGNED_IN_USER);if(o!=null&&t!=null)return JSON.parse(this.decrypt(o,t))}getShowNegativeAmountInParenthesis(){const t=window.localStorage.getItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS),o=window.localStorage.getItem(this.ZENI_SESSION_ID);return t!=null&&o!=null?JSON.parse(this.decrypt(t,o)):!1}getShowNegativeAmountInParenthesisPDF(){const t=window.localStorage.getItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF),o=window.localStorage.getItem(this.ZENI_SESSION_ID);return t!=null&&o!=null?JSON.parse(this.decrypt(t,o)):!0}getSignedInUserTenant(t){const o=window.localStorage.getItem(this.ZENI_SIGNED_IN_USER_TENANTS),i=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null&&i!=null)return JSON.parse(this.decrypt(o,i)).find(l=>l.tenantEmailDomain===t)}getSignedInUserTenantWithId(t){const o=window.localStorage.getItem(this.ZENI_SIGNED_IN_USER_TENANTS),i=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null&&i!=null)return JSON.parse(this.decrypt(o,i)).find(l=>l.tenantId===t)}getForceRefreshedComponents(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID),o=window.localStorage.getItem(this.ZENI_FORCE_REFRESHED_COMPONENTS);if(o&&t!=null){const i=this.decrypt(o,t);return i?JSON.parse(i):[]}return[]}saveForceRefreshedComponents(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);o!=null?window.localStorage.setItem(this.ZENI_FORCE_REFRESHED_COMPONENTS,this.encrypt(JSON.stringify(t),o)):console.warn("Can't update the force refreshed components when the user is logged out!")}saveSignedInUserWithSession(t,o){if(t==null||o==null)throw new Error("Can't accept nil for user or session Id");window.localStorage.setItem(this.ZENI_SESSION_ID,o),window.localStorage.setItem(this.ZENI_SIGNED_IN_USER,this.encrypt(JSON.stringify(t),o))}saveSignedInUserTenants(t,o){const i=o??window.localStorage.getItem(this.ZENI_SESSION_ID);i!=null?window.localStorage.setItem(this.ZENI_SIGNED_IN_USER_TENANTS,this.encrypt(JSON.stringify(t),i)):console.warn("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesis(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.encrypt(JSON.stringify(t),o));else throw new Error("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesisPDF(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.encrypt(JSON.stringify(t),o));else throw new Error("Can't update the setting when the user is logged out!")}isSignedIn(){return[this.ZENI_SESSION_ID,this.ZENI_SIGNED_IN_USER].map(o=>window.localStorage.getItem(o)!=null).reduce((o,i)=>o&&i)}clearAll(){this.ALL_IDs.forEach(t=>window.localStorage.removeItem(t))}setTheme(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);o!=null&&window.localStorage.setItem(this.ZENI_THEME,this.encrypt(t,o))}getTheme(){const t=window.localStorage.getItem(this.ZENI_THEME),o=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t!=null&&o!==null)return this.decrypt(t,o)}encrypt(t,o){return Gy.AES.encrypt(t,o).toString()}decrypt(t,o){return Gy.AES.decrypt(t,o).toString(Gy.enc.Utf8)}ZENI_SESSION_ID="ZENI_SESSION_ID";ZENI_SIGNED_IN_USER="ZENI_SIGNED_IN_USER";ZENI_SIGNED_IN_USER_TENANTS="ZENI_SIGNED_IN_USER_TENANTS";ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS="ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS";ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF="ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF";ZENI_THEME="ZENI_THEME";ZENI_FORCE_REFRESHED_COMPONENTS="ZENI_FORCE_REFRESHED_COMPONENTS";ALL_IDs=[this.ZENI_SESSION_ID,this.ZENI_SIGNED_IN_USER,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.ZENI_SIGNED_IN_USER_TENANTS,this.ZENI_THEME,this.ZENI_FORCE_REFRESHED_COMPONENTS]}const is=new dJr,cJr=({children:e})=>{const t=jVe("(prefers-color-scheme: dark)"),[o,i]=$.useState({dark:t});g.useEffect(()=>{const p=is.getTheme()==null?t:is.getTheme()==="dark";o.dark!==p&&i({dark:p})},[o,t]);const a=()=>{const p=!o.dark;is.setTheme(p?"dark":"light"),i({...o,dark:p})},l=o.dark?oyo():tyo(),d=typeof window<"u"?window.__NONCE__:void 0,c=d!=null&&d.length>0?d:void 0;return wo.jsx(Zfo,{dark:o.dark,webAppTheme:l,toggle:a,nonce:c,children:e})},pJr=["sandbox","production"],uJr=e=>tf(e,pJr),hJr=e=>{switch(e){case"DEV":case"QA":case"PUNE":case"SUNNYVALE":case"DELHI":case"MOHALI":return"sandbox";case"PROD":case"NEXT":return"production";default:return"sandbox"}},mJr=["development","staging","production"],gJr=e=>tf(e,mJr),fJr=e=>{switch(e){case"QA":case"PUNE":case"SUNNYVALE":case"DELHI":case"MOHALI":return"staging";case"PROD":case"NEXT":return"production";default:return"development"}},xJr=["DEV","QA","PUNE","SUNNYVALE","DELHI","MOHALI","PROD","NEXT"],yJr=e=>tf(e,xJr),Oc=yJr("QA"),Kw=()=>Oc==="DEV"||Oc==="QA"||Oc==="PUNE"||Oc==="SUNNYVALE"||Oc==="DELHI"||Oc==="MOHALI",xJ="https://zeni-webapp-qa.uc.r.appspot.com",wJr="ed1936cb971f6aad4104ddbe708f812c",qhi=uJr(hJr(Oc)),bJr=gJr(fJr(Oc));function vJr(e,t){return Gy.AES.decrypt(e,t).toString(Gy.enc.Utf8)}const CJr="ZENI-WEB-APP-",XNe=Oc==="DEV"||Oc==="QA"?.2:.8,da={sentryDsn:"",sentryTraceSamplingRate:XNe,googleClientId:"",googleMapsAPIKey:"",microsoftClientId:"",mixpanelToken:"",pusherClientSecret:"",pusherCluster:"",quickbooksKey:"",appUrl:"",featureClientSecret:"",featureClientSecretCockpit:"",cardVaultId:"",stripeKey:"",qboRedirectionUrl:"",mixpanelUrl:"",mixpanelHMUrl:""};let ef,yJ;function AJr(e){da.sentryDsn=e.keys.SENTRY_DSN,da.sentryTraceSamplingRate=e.keys.SENTRY_TRACE_SAMPLE_RATES!=null?parseInt(e.keys.SENTRY_TRACE_SAMPLE_RATES):XNe,da.googleClientId=e.keys.GOOGLE_CLIENT_ID,da.googleMapsAPIKey=e.keys.GOOGLE_MAP_KEY,da.microsoftClientId=e.keys.MICROSOFT_CLIENT_ID,da.mixpanelToken=e.keys.MIXPANEL_TOKEN,da.pusherClientSecret=e.keys.PUSHER_CLIENT_SECRET,da.pusherCluster=e.keys.PUSHER_CLUSTER,da.quickbooksKey=e.keys.QUICKBOOK_TOKEN,da.appUrl=e.keys.WEB_ENDPOINT,da.featureClientSecret=e.keys.STATSIG_CLIENT_SECRET,da.featureClientSecretCockpit=e.keys.STATSIG_CLIENT_SECRET_COCKPIT,da.cardVaultId=e.keys.UNIT_VAULT_ID,da.stripeKey=e.keys.STRIPE_KEY,da.qboRedirectionUrl=e.keys.QBO_URL,da.mixpanelUrl=e.keys.MIXPANEL_URL,da.mixpanelHMUrl=e.keys.MIXPANEL_HM_URL,yJ=e.externalEndPoints,ef=e.apiEndPoints,$Jr()}function $Jr(){try{const e=new Set;if(ef!=null){for(const t of Object.values(ef))if(typeof t=="string"&&t.startsWith("http"))try{e.add(new URL(t).origin)}catch{}}for(const t of e){const o=document.createElement("link");o.rel="preconnect",o.href=t,o.crossOrigin="anonymous",document.head.appendChild(o)}}catch{}}async function kJr(){const t=encodeURIComponent(JSON.stringify({environment:Oc}));try{const o=await fetch(`${xJ}/api/keys?query=${t}`);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return await o.json()}catch(o){return console.error("Error fetching details:",o),null}}let s9e=!1;function wy(){s9e||(bu.init(wJr,{api_host:yJ.mixpanelBaseUrl,ignore_dnt:!0,store_google:!1,track_marketing:!1}),s9e=!0)}let l9e=!1,d9e=!1;function eHe(){if(l9e)return;l9e=!0,wy();const e=qs.extractUtmParamsFromUrl();Object.keys(e).length>0&&bu.register(e),Kw()&&console.log(`[UTM] first-touch bootstrap: ${JSON.stringify(e)}`)}function SJr(){return bu?.persistence?.props??null}const EJr=new Set(["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"]);function LJr(){const e=SJr();if(e==null)return;const t=Object.keys(e).filter(o=>o.startsWith("utm_")||EJr.has(o));for(const o of t)bu.unregister(o);Kw()&&t.length>0&&console.log(`[UTM] cleared from cookie: ${JSON.stringify(t)}`)}function jJr(){d9e||(d9e=!0,LJr())}class r4{identify(t,o){if(wy(),this.#o=t,t!=null&&o!=null&&(r4.#t==null||hVe({userId:t,traits:o},r4.#t)!==!0)){const{$email:i,...a}={...o};bu.identify(t),i&&i!=null&&bu.people.set_once({$email:i}),bu.people.set(a),r4.#t={userId:t,traits:o},Kw()&&console.log(`*** Called people set with userId ${t} traits ${JSON.stringify(o)} `)}}identifyUserAndCompany(t,o,i,a,l){throw Error("Use identify in the web-app!!")}track(t,o){if(wy(),this.#o==null){console.error("user is not identified :(, so can not fire event");return}eHe();const i={distinct_id:this.#o,...o};bu.track(t,i),jJr(),Kw()&&console.log(`*** firing ${t} with props ${JSON.stringify(o)}`)}alias(t,o){wy(),bu.alias(t,o)}reset(){wy(),bu.reset(),this.#o=void 0,r4.#t=void 0}static get analytics(){return this.#e}static#e=new qs.Analytics(new r4);static#t;#o}const Z2=r4.analytics;function IJr(){eHe()}const MJr=()=>{const e=JE(),t=Vu(o=>o.companyState);if(e.pathname.includes("/management/parent/")){const o=e.pathname.split("/")[3],i=t.companiesById[o];if(i!=null)return`${i.companyInfo.name} ${Q.getLocalizedStrings().cockpit.cockpitHeaderSubsidiaryText}`}if(e.pathname.includes("management/month-end-report/company/")){const o=e.pathname.split("/")[4],i=t.companiesById[o];if(i!=null)return i.companyInfo.name}},c9e=e=>{switch(e){case"healthMonitor":return"health-monitor";case"taskManager":return"task-manager";case"aiAccountant":return"ai-accountant";case"creditAgent":return"credit-agent";default:return e}},Zhi=e=>{switch(e){case"healthMonitor":return"health monitor";case"taskManager":return"task manager";case"aiAccountant":return"ai accountant";case"creditAgent":return"credit agent";default:return e}};function BJr(e,t){return{updateDownloadStateHandler:o=>{e(mVe(o))},onZeniLogoClick:()=>{t.themeState.toggle()},onLogOutClick:()=>{e(N_()),e(H_(!1)),is.clearAll();const o=t.locationHook.state?.origin??"/";t.navigate(o,{replace:!0})},onNewCustomerClick:()=>{t.navigate("/onboarding/new"),Z2?.trackOnboardingNewCustomerStarted()},onThreadClick:(o,i,a)=>{const l=o.entityType.split(".");if(l.length===2){const d=b6e(l[0]);if(d!=null){const c=c9e(d);t.navigate(`/${c}`),a(o,i)}else console.warn(`Invalid navigation target in thread: ${l[0]}`)}},onNotificationClick:(o,i,a)=>{const l=o.entityType.split(".");if(o.isGlobalComment&&l.length===2){const d=b6e(l[0]);if(d!=null){const c=c9e(d);t.navigate(`/${c}`),a(o,i)}else console.warn(`Invalid navigation target in notification: ${l[0]}`)}}}}function PJr(e,t){const{signedInUser:o,cockpitHeader:i}=t,a=e.tenantState.currentTenantId,d=eL(e)?.companyName??"",c={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:a??""};return{signedInUser:o,cockpitHeader:i,downloadState:e.companyViewState.downloadState,downloadParams:{currentTenantCompanyName:d,cockpitEndPoint:`${xJ}/cockpitTabs`,authParams:c}}}const DJr=r_e(PJr,BJr)(PIr);function TJr(){const e=HMe(),t=is.getSignedInUser(),o=TW(),i=JE(),a=MJr(),l=Vu(p=>gVe(p)),d={tabsFileType:"excel",tabs:["management","subscription","portfolio","onboarding","healthMonitor"],filterByTabs:l.filterByTabs,timezone:fVe()},c=i.pathname.split("/")[1];return wo.jsx(DJr,{locationHook:i,themeState:e,signedInUser:t,cockpitHeader:a,allTabsViews:l,defaultOptions:d,analytics:Z2,currentTab:c,navigate:o})}const zJr=["/management/*","/subscription/*","/onboarding/*","/portfolio/*","/audit/*","/health-monitor/*","/task-manager/*","/ai-accountant/*","/credit-agent/*"];function RJr({appContent:e}){const t=zJr.filter(o=>i_e(o)).length===0;return wo.jsxs(wo.Fragment,{children:[t?null:wo.jsx(TJr,{}),wo.jsx(wo.Fragment,{children:e})]})}const FJr="cockpit",tHe="init-enter";function OJr({location:e,visitedUrl:t}){const{pathname:o}=e;return g.useLayoutEffect(()=>{const i=t.get(o||tHe);p9e(i!==void 0?i:0)}),null}const NJr=g.memo(OJr,(e,t)=>{const{location:o,visitedUrl:i}=e,{location:a}=t,l=o.pathname||tHe,d=HJr();return i.set(l,d),!((a.pathname!==o.pathname||a.search!==o.search)&&a.hash==="")}),p9e=(e=0)=>window.requestAnimationFrame(()=>{window.scrollTo(0,e)}),HJr=()=>{let e=0;return document!=null&&document.documentElement!==null&&(e=document.documentElement.scrollTop),window.pageYOffset||e},oHe=e=>g.lazy(async()=>{const t=e.toString(),o=is.getForceRefreshedComponents(),i=new Set(o),a=i.has(t);try{const l=await e();return i.delete(t),is.saveForceRefreshedComponents(Array.from(i)),l}catch(l){throw a||(i.add(t),is.saveForceRefreshedComponents(Array.from(i)),location.reload()),l}}),_Jr=oHe(()=>n4(()=>import("./ScreenRoutes-DXOK_0fF.js").then(e=>e.S),__vite__mapDeps([14,5,1,6,15,8,16,17,7,2,4,9,11]))),VJr=oHe(()=>n4(()=>import("./SignInScreen-CJujmJSu.js"),__vite__mapDeps([18,15,1,6,8,5,16,17,19,20,21,7])));function QJr(){const e=g.useRef();e.current==null&&(e.current=new Map);const t=TW(),o=JE();return g.useEffect(()=>{IJr()},[]),g.useEffect(()=>{const i="signin/auth";is.isSignedIn()===!1&&!o.pathname.includes(i)&&t(i,{replace:!0,state:{...o.state,message:"...",origin:o.pathname}})}),wo.jsxs(GJr,{children:[wo.jsx(NJr,{visitedUrl:e.current,location:o}),wo.jsx(UJr,{})]})}const UJr=()=>{const e=is.isSignedIn(),t=is.getSignedInUser(),o=e&&XE(t),i=Vu(p=>eL(p)),a={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:i.tenantId??""},l=Vu(p=>xVe(p)),c=Vu(p=>yVe(p)).map(p=>({companyId:p.companyId,tenantId:p.tenantId,companyName:p.name}));return wo.jsx(XCr,{roomId:FJr,authParams:a,users:l,companies:c,authUrlEndPoint:`${ef.tenantMicroServiceBaseUrl}/1.0/commenting/auth`,fetchZeniUsers:!1,commentingUsersUrlEndPoint:`${ef.tenantMicroServiceBaseUrl}/1.0/users/zeni-users`,autoConnect:o,withRoomProvider:!1,loggedInUser:t,withThreadsProvider:!0,filter:{application:"cockpit"},children:wo.jsx(WJr,{})})},WJr=()=>wo.jsx(g.Suspense,{fallback:wo.jsx(YJr,{children:wo.jsx(bo,{size:"Large",start:!0})}),children:wo.jsxs(n_e,{children:[wo.jsx(OB,{path:"/",element:wo.jsx(a_e,{to:"management",replace:!0})}),wo.jsx(OB,{path:"/signin/auth",element:wo.jsx(VJr,{})}),wo.jsx(OB,{path:"*",element:wo.jsx(RJr,{appContent:wo.jsx(_Jr,{})})})]})}),GJr=Jt("div")``,YJr=Jt("div")`
88748
+ `;var lJr=TVe();const Gy=DW(lJr);class dJr{getSignedInUser(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID),o=window.localStorage.getItem(this.ZENI_SIGNED_IN_USER);if(o!=null&&t!=null)return JSON.parse(this.decrypt(o,t))}getShowNegativeAmountInParenthesis(){const t=window.localStorage.getItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS),o=window.localStorage.getItem(this.ZENI_SESSION_ID);return t!=null&&o!=null?JSON.parse(this.decrypt(t,o)):!1}getShowNegativeAmountInParenthesisPDF(){const t=window.localStorage.getItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF),o=window.localStorage.getItem(this.ZENI_SESSION_ID);return t!=null&&o!=null?JSON.parse(this.decrypt(t,o)):!0}getSignedInUserTenant(t){const o=window.localStorage.getItem(this.ZENI_SIGNED_IN_USER_TENANTS),i=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null&&i!=null)return JSON.parse(this.decrypt(o,i)).find(l=>l.tenantEmailDomain===t)}getSignedInUserTenantWithId(t){const o=window.localStorage.getItem(this.ZENI_SIGNED_IN_USER_TENANTS),i=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null&&i!=null)return JSON.parse(this.decrypt(o,i)).find(l=>l.tenantId===t)}getForceRefreshedComponents(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID),o=window.localStorage.getItem(this.ZENI_FORCE_REFRESHED_COMPONENTS);if(o&&t!=null){const i=this.decrypt(o,t);return i?JSON.parse(i):[]}return[]}saveForceRefreshedComponents(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);o!=null?window.localStorage.setItem(this.ZENI_FORCE_REFRESHED_COMPONENTS,this.encrypt(JSON.stringify(t),o)):console.warn("Can't update the force refreshed components when the user is logged out!")}saveSignedInUserWithSession(t,o){if(t==null||o==null)throw new Error("Can't accept nil for user or session Id");window.localStorage.setItem(this.ZENI_SESSION_ID,o),window.localStorage.setItem(this.ZENI_SIGNED_IN_USER,this.encrypt(JSON.stringify(t),o))}saveSignedInUserTenants(t,o){const i=o??window.localStorage.getItem(this.ZENI_SESSION_ID);i!=null?window.localStorage.setItem(this.ZENI_SIGNED_IN_USER_TENANTS,this.encrypt(JSON.stringify(t),i)):console.warn("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesis(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.encrypt(JSON.stringify(t),o));else throw new Error("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesisPDF(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.encrypt(JSON.stringify(t),o));else throw new Error("Can't update the setting when the user is logged out!")}isSignedIn(){return[this.ZENI_SESSION_ID,this.ZENI_SIGNED_IN_USER].map(o=>window.localStorage.getItem(o)!=null).reduce((o,i)=>o&&i)}clearAll(){this.ALL_IDs.forEach(t=>window.localStorage.removeItem(t))}setTheme(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);o!=null&&window.localStorage.setItem(this.ZENI_THEME,this.encrypt(t,o))}getTheme(){const t=window.localStorage.getItem(this.ZENI_THEME),o=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t!=null&&o!==null)return this.decrypt(t,o)}encrypt(t,o){return Gy.AES.encrypt(t,o).toString()}decrypt(t,o){return Gy.AES.decrypt(t,o).toString(Gy.enc.Utf8)}ZENI_SESSION_ID="ZENI_SESSION_ID";ZENI_SIGNED_IN_USER="ZENI_SIGNED_IN_USER";ZENI_SIGNED_IN_USER_TENANTS="ZENI_SIGNED_IN_USER_TENANTS";ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS="ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS";ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF="ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF";ZENI_THEME="ZENI_THEME";ZENI_FORCE_REFRESHED_COMPONENTS="ZENI_FORCE_REFRESHED_COMPONENTS";ALL_IDs=[this.ZENI_SESSION_ID,this.ZENI_SIGNED_IN_USER,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.ZENI_SIGNED_IN_USER_TENANTS,this.ZENI_THEME,this.ZENI_FORCE_REFRESHED_COMPONENTS]}const is=new dJr,cJr=({children:e})=>{const t=jVe("(prefers-color-scheme: dark)"),[o,i]=$.useState({dark:t});g.useEffect(()=>{const p=is.getTheme()==null?t:is.getTheme()==="dark";o.dark!==p&&i({dark:p})},[o,t]);const a=()=>{const p=!o.dark;is.setTheme(p?"dark":"light"),i({...o,dark:p})},l=o.dark?oyo():tyo(),d=typeof window<"u"?window.__NONCE__:void 0,c=d!=null&&d.length>0?d:void 0;return wo.jsx(Zfo,{dark:o.dark,webAppTheme:l,toggle:a,nonce:c,children:e})},pJr=["sandbox","production"],uJr=e=>tf(e,pJr),hJr=e=>{switch(e){case"DEV":case"QA":case"PUNE":case"SUNNYVALE":case"DELHI":case"MOHALI":return"sandbox";case"PROD":case"NEXT":return"production";default:return"sandbox"}},mJr=["development","staging","production"],gJr=e=>tf(e,mJr),fJr=e=>{switch(e){case"QA":case"PUNE":case"SUNNYVALE":case"DELHI":case"MOHALI":return"staging";case"PROD":case"NEXT":return"production";default:return"development"}},xJr=["DEV","QA","PUNE","SUNNYVALE","DELHI","MOHALI","PROD","NEXT"],yJr=e=>tf(e,xJr),Oc=yJr("DEV"),Kw=()=>Oc==="DEV"||Oc==="QA"||Oc==="PUNE"||Oc==="SUNNYVALE"||Oc==="DELHI"||Oc==="MOHALI",xJ="https://zeni-webapp-dev.uc.r.appspot.com",wJr="63d3a2406505a5737a2b4debdb513f20",qhi=uJr(hJr(Oc)),bJr=gJr(fJr(Oc));function vJr(e,t){return Gy.AES.decrypt(e,t).toString(Gy.enc.Utf8)}const CJr="ZENI-WEB-APP-",XNe=Oc==="DEV"||Oc==="QA"?.2:.8,da={sentryDsn:"",sentryTraceSamplingRate:XNe,googleClientId:"",googleMapsAPIKey:"",microsoftClientId:"",mixpanelToken:"",pusherClientSecret:"",pusherCluster:"",quickbooksKey:"",appUrl:"",featureClientSecret:"",featureClientSecretCockpit:"",cardVaultId:"",stripeKey:"",qboRedirectionUrl:"",mixpanelUrl:"",mixpanelHMUrl:""};let ef,yJ;function AJr(e){da.sentryDsn=e.keys.SENTRY_DSN,da.sentryTraceSamplingRate=e.keys.SENTRY_TRACE_SAMPLE_RATES!=null?parseInt(e.keys.SENTRY_TRACE_SAMPLE_RATES):XNe,da.googleClientId=e.keys.GOOGLE_CLIENT_ID,da.googleMapsAPIKey=e.keys.GOOGLE_MAP_KEY,da.microsoftClientId=e.keys.MICROSOFT_CLIENT_ID,da.mixpanelToken=e.keys.MIXPANEL_TOKEN,da.pusherClientSecret=e.keys.PUSHER_CLIENT_SECRET,da.pusherCluster=e.keys.PUSHER_CLUSTER,da.quickbooksKey=e.keys.QUICKBOOK_TOKEN,da.appUrl=e.keys.WEB_ENDPOINT,da.featureClientSecret=e.keys.STATSIG_CLIENT_SECRET,da.featureClientSecretCockpit=e.keys.STATSIG_CLIENT_SECRET_COCKPIT,da.cardVaultId=e.keys.UNIT_VAULT_ID,da.stripeKey=e.keys.STRIPE_KEY,da.qboRedirectionUrl=e.keys.QBO_URL,da.mixpanelUrl=e.keys.MIXPANEL_URL,da.mixpanelHMUrl=e.keys.MIXPANEL_HM_URL,yJ=e.externalEndPoints,ef=e.apiEndPoints,$Jr()}function $Jr(){try{const e=new Set;if(ef!=null){for(const t of Object.values(ef))if(typeof t=="string"&&t.startsWith("http"))try{e.add(new URL(t).origin)}catch{}}for(const t of e){const o=document.createElement("link");o.rel="preconnect",o.href=t,o.crossOrigin="anonymous",document.head.appendChild(o)}}catch{}}async function kJr(){const t=encodeURIComponent(JSON.stringify({environment:Oc}));try{const o=await fetch(`${xJ}/api/keys?query=${t}`);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return await o.json()}catch(o){return console.error("Error fetching details:",o),null}}let s9e=!1;function wy(){s9e||(bu.init(wJr,{api_host:yJ.mixpanelBaseUrl,ignore_dnt:!0,store_google:!1,track_marketing:!1}),s9e=!0)}let l9e=!1,d9e=!1;function eHe(){if(l9e)return;l9e=!0,wy();const e=qs.extractUtmParamsFromUrl();Object.keys(e).length>0&&bu.register(e),Kw()&&console.log(`[UTM] first-touch bootstrap: ${JSON.stringify(e)}`)}function SJr(){return bu?.persistence?.props??null}const EJr=new Set(["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"]);function LJr(){const e=SJr();if(e==null)return;const t=Object.keys(e).filter(o=>o.startsWith("utm_")||EJr.has(o));for(const o of t)bu.unregister(o);Kw()&&t.length>0&&console.log(`[UTM] cleared from cookie: ${JSON.stringify(t)}`)}function jJr(){d9e||(d9e=!0,LJr())}class r4{identify(t,o){if(wy(),this.#o=t,t!=null&&o!=null&&(r4.#t==null||hVe({userId:t,traits:o},r4.#t)!==!0)){const{$email:i,...a}={...o};bu.identify(t),i&&i!=null&&bu.people.set_once({$email:i}),bu.people.set(a),r4.#t={userId:t,traits:o},Kw()&&console.log(`*** Called people set with userId ${t} traits ${JSON.stringify(o)} `)}}identifyUserAndCompany(t,o,i,a,l){throw Error("Use identify in the web-app!!")}track(t,o){if(wy(),this.#o==null){console.error("user is not identified :(, so can not fire event");return}eHe();const i={distinct_id:this.#o,...o};bu.track(t,i),jJr(),Kw()&&console.log(`*** firing ${t} with props ${JSON.stringify(o)}`)}alias(t,o){wy(),bu.alias(t,o)}reset(){wy(),bu.reset(),this.#o=void 0,r4.#t=void 0}static get analytics(){return this.#e}static#e=new qs.Analytics(new r4);static#t;#o}const Z2=r4.analytics;function IJr(){eHe()}const MJr=()=>{const e=JE(),t=Vu(o=>o.companyState);if(e.pathname.includes("/management/parent/")){const o=e.pathname.split("/")[3],i=t.companiesById[o];if(i!=null)return`${i.companyInfo.name} ${Q.getLocalizedStrings().cockpit.cockpitHeaderSubsidiaryText}`}if(e.pathname.includes("management/month-end-report/company/")){const o=e.pathname.split("/")[4],i=t.companiesById[o];if(i!=null)return i.companyInfo.name}},c9e=e=>{switch(e){case"healthMonitor":return"health-monitor";case"taskManager":return"task-manager";case"aiAccountant":return"ai-accountant";case"creditAgent":return"credit-agent";default:return e}},Zhi=e=>{switch(e){case"healthMonitor":return"health monitor";case"taskManager":return"task manager";case"aiAccountant":return"ai accountant";case"creditAgent":return"credit agent";default:return e}};function BJr(e,t){return{updateDownloadStateHandler:o=>{e(mVe(o))},onZeniLogoClick:()=>{t.themeState.toggle()},onLogOutClick:()=>{e(N_()),e(H_(!1)),is.clearAll();const o=t.locationHook.state?.origin??"/";t.navigate(o,{replace:!0})},onNewCustomerClick:()=>{t.navigate("/onboarding/new"),Z2?.trackOnboardingNewCustomerStarted()},onThreadClick:(o,i,a)=>{const l=o.entityType.split(".");if(l.length===2){const d=b6e(l[0]);if(d!=null){const c=c9e(d);t.navigate(`/${c}`),a(o,i)}else console.warn(`Invalid navigation target in thread: ${l[0]}`)}},onNotificationClick:(o,i,a)=>{const l=o.entityType.split(".");if(o.isGlobalComment&&l.length===2){const d=b6e(l[0]);if(d!=null){const c=c9e(d);t.navigate(`/${c}`),a(o,i)}else console.warn(`Invalid navigation target in notification: ${l[0]}`)}}}}function PJr(e,t){const{signedInUser:o,cockpitHeader:i}=t,a=e.tenantState.currentTenantId,d=eL(e)?.companyName??"",c={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:a??""};return{signedInUser:o,cockpitHeader:i,downloadState:e.companyViewState.downloadState,downloadParams:{currentTenantCompanyName:d,cockpitEndPoint:`${xJ}/cockpitTabs`,authParams:c}}}const DJr=r_e(PJr,BJr)(PIr);function TJr(){const e=HMe(),t=is.getSignedInUser(),o=TW(),i=JE(),a=MJr(),l=Vu(p=>gVe(p)),d={tabsFileType:"excel",tabs:["management","subscription","portfolio","onboarding","healthMonitor"],filterByTabs:l.filterByTabs,timezone:fVe()},c=i.pathname.split("/")[1];return wo.jsx(DJr,{locationHook:i,themeState:e,signedInUser:t,cockpitHeader:a,allTabsViews:l,defaultOptions:d,analytics:Z2,currentTab:c,navigate:o})}const zJr=["/management/*","/subscription/*","/onboarding/*","/portfolio/*","/audit/*","/health-monitor/*","/task-manager/*","/ai-accountant/*","/credit-agent/*"];function RJr({appContent:e}){const t=zJr.filter(o=>i_e(o)).length===0;return wo.jsxs(wo.Fragment,{children:[t?null:wo.jsx(TJr,{}),wo.jsx(wo.Fragment,{children:e})]})}const FJr="cockpit",tHe="init-enter";function OJr({location:e,visitedUrl:t}){const{pathname:o}=e;return g.useLayoutEffect(()=>{const i=t.get(o||tHe);p9e(i!==void 0?i:0)}),null}const NJr=g.memo(OJr,(e,t)=>{const{location:o,visitedUrl:i}=e,{location:a}=t,l=o.pathname||tHe,d=HJr();return i.set(l,d),!((a.pathname!==o.pathname||a.search!==o.search)&&a.hash==="")}),p9e=(e=0)=>window.requestAnimationFrame(()=>{window.scrollTo(0,e)}),HJr=()=>{let e=0;return document!=null&&document.documentElement!==null&&(e=document.documentElement.scrollTop),window.pageYOffset||e},oHe=e=>g.lazy(async()=>{const t=e.toString(),o=is.getForceRefreshedComponents(),i=new Set(o),a=i.has(t);try{const l=await e();return i.delete(t),is.saveForceRefreshedComponents(Array.from(i)),l}catch(l){throw a||(i.add(t),is.saveForceRefreshedComponents(Array.from(i)),location.reload()),l}}),_Jr=oHe(()=>n4(()=>import("./ScreenRoutes-BFmYZbdr.js").then(e=>e.S),__vite__mapDeps([14,5,1,6,15,8,16,17,7,2,4,9,11]))),VJr=oHe(()=>n4(()=>import("./SignInScreen-vUlTxjR_.js"),__vite__mapDeps([18,15,1,6,8,5,16,17,19,20,21,7])));function QJr(){const e=g.useRef();e.current==null&&(e.current=new Map);const t=TW(),o=JE();return g.useEffect(()=>{IJr()},[]),g.useEffect(()=>{const i="signin/auth";is.isSignedIn()===!1&&!o.pathname.includes(i)&&t(i,{replace:!0,state:{...o.state,message:"...",origin:o.pathname}})}),wo.jsxs(GJr,{children:[wo.jsx(NJr,{visitedUrl:e.current,location:o}),wo.jsx(UJr,{})]})}const UJr=()=>{const e=is.isSignedIn(),t=is.getSignedInUser(),o=e&&XE(t),i=Vu(p=>eL(p)),a={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:i.tenantId??""},l=Vu(p=>xVe(p)),c=Vu(p=>yVe(p)).map(p=>({companyId:p.companyId,tenantId:p.tenantId,companyName:p.name}));return wo.jsx(XCr,{roomId:FJr,authParams:a,users:l,companies:c,authUrlEndPoint:`${ef.tenantMicroServiceBaseUrl}/1.0/commenting/auth`,fetchZeniUsers:!1,commentingUsersUrlEndPoint:`${ef.tenantMicroServiceBaseUrl}/1.0/users/zeni-users`,autoConnect:o,withRoomProvider:!1,loggedInUser:t,withThreadsProvider:!0,filter:{application:"cockpit"},children:wo.jsx(WJr,{})})},WJr=()=>wo.jsx(g.Suspense,{fallback:wo.jsx(YJr,{children:wo.jsx(bo,{size:"Large",start:!0})}),children:wo.jsxs(n_e,{children:[wo.jsx(OB,{path:"/",element:wo.jsx(a_e,{to:"management",replace:!0})}),wo.jsx(OB,{path:"/signin/auth",element:wo.jsx(VJr,{})}),wo.jsx(OB,{path:"*",element:wo.jsx(RJr,{appContent:wo.jsx(_Jr,{})})})]})}),GJr=Jt("div")``,YJr=Jt("div")`
88749
88749
  display: flex;
88750
88750
  flex: 1 1 auto;
88751
88751
  flex-direction: row;
@@ -88756,4 +88756,4 @@ ${e}`,OBr=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
88756
88756
  background-color: ${e=>e.theme.colors.background};
88757
88757
  `;function KJr(){Q.updateAppLocaleID("en"),XJr();const e=eXr(),[t,o]=g.useState(!1),i=g.useCallback(l=>{l.data?.type==="UPDATE_READY"?o(!0):l.data?.type==="HIDE_UPDATE_POPUP"&&o(!1)},[]);g.useEffect(()=>("serviceWorker"in navigator&&(navigator.serviceWorker.addEventListener("message",i),navigator.serviceWorker.addEventListener("controllerchange",()=>{o(!1)})),()=>{navigator.serviceWorker.removeEventListener("message",i)}),[i]);const a=()=>{o(!1),window.location.reload()};return wo.jsx(cJr,{children:wo.jsx(s_e,{store:e,children:wo.jsx(GMt,{children:wo.jsxs(yoo,{children:[t?wo.jsx(S1o,{onPrimaryClick:a}):null,wo.jsx(ZJr,{})]})})})})}const _x=new wVe,qJr=()=>{const e=is.getSignedInUser(),t=Vu(L=>eL(L)),o=Vu(L=>AVe(L,t.companyId)),i=JE(),a=TW(),l=l_e(),[d,c]=g.useState(null),p=L7r(e?.userId),u=t?.excludedResources?.fetchState=="Completed"?t.excludedResources.resources:[];g.useEffect(()=>()=>{l(ZJ())},[]);const h=Vu(L=>$Ve(L)),m=t?.externalConnections?.accounting[0]?.connectionName,f=()=>{l(ZJ())},x=g.useMemo(()=>kVe(t.userRole),[t.userRole]),y=Vu(L=>L.companyViewState.zeniUsers),w=g.useMemo(()=>{const L=y.fetchState==="Error"&&SVe(y.error);return L&&console.warn("Auto-logout triggered due to invalid session"),L},[y.fetchState,y.error]),b=g.useMemo(()=>{const L=y.fetchState==="Error"&&EVe(y.error)===!0;return L&&console.warn("Page is not accessible, show 404"),L},[y.fetchState,y.error]),v=g.useRef(!1);g.useEffect(()=>(w&&!v.current&&(v.current=!0,A()),()=>{v.current=!1}),[w]),g.useEffect(()=>{b&&window.open("/page-not-found","_self")},[b]);const A=g.useCallback(()=>{c(null),_x.stop(),l(N_()),l(H_(!1)),is.clearAll();const L=i.state?.origin??"/";a(L,{replace:!0})},[l,c,i,a]),S=g.useCallback((L="manual")=>{L==="auto-logout"?Dyo({idleTimeoutMinutes:p.idleTimeoutMinutes}):Ryo(),c(null),_x.stop(),l(N_()),l(H_(!1)),is.clearAll(),window.location.href="/signin/auth"},[l,c,p.idleTimeoutMinutes]);g.useEffect(()=>{if(e?.zeniSessionId!=null)return _x.start({idleTimeoutMinutes:p.idleTimeoutMinutes,warningDurationSeconds:p.warningDurationSeconds,heartbeatIntervalMinutes:p.heartbeatIntervalMinutes,isAutoLogoutEnabled:p.isAutoLogoutEnabled},{onHeartbeat:()=>l(LVe()),onWarningStart:L=>{Z2.trackSessionTimeoutPopupShown(L),c(L)},onWarningTick:c,onAutoLogout:()=>{Z2.trackSessionTimeoutAutoLogout(),S("auto-logout")},onSessionExtended:()=>c(null)}),()=>_x.stop()},[e?.zeniSessionId,p.isAutoLogoutEnabled,p.idleTimeoutMinutes,p.warningDurationSeconds,p.heartbeatIntervalMinutes,l,S,c]);const E=g.useMemo(()=>is.getSignedInUser(),[]),I=g.useMemo(()=>({userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:t.tenantId??""}),[E,t.tenantId]);return wo.jsxs(Moo,{globalInfo:{loggedInUser:e,loggedInUserRole:t?.userRole,excludedResources:u,loggedInUserRoleMap:x,currentTenant:t,connectionName:m,controllersList:o},children:[wo.jsx(Coo,{toolkit:{analytics:Z2,sentry:jHe,authParams:I},children:wo.jsxs(Tto,{endPoint:{url:xJ},children:[wo.jsx(N2r,{isOnDashboard:!1,showSnackbar:h.isSnackbarOpen,snackbar:{message:h.message,messageType:h.messageType,onRemoveSnackbar:f,showStatusIcon:h.showStatusIcon}}),wo.jsx(QJr,{})]})}),d!=null&&e!=null?wo.jsx(Ajr,{secondsRemaining:d,onContinueSession:()=>{Z2.trackSessionTimeoutClicked("continue",d),_x.continueSession()},onSignOut:()=>{Z2.trackSessionTimeoutClicked("sign_out",d),S()}}):null]})},ZJr=()=>{const e=is.isSignedIn(),o=Vu(i=>eL(i)).companyId;return wo.jsx(Pno,{isUserSignedIn:e,featureGateCustomFields:{companyId:o},zeniFeatureConfig:{currentFeatureEnv:bJr,featureClientSecret:da.featureClientSecretCockpit,providerEndPoint:yJ.statsigBaseUrl},children:wo.jsx(qJr,{})})},JJr=EHe(KJr);function XJr(){console.log("Initialize any 3rd party libs!")}let z_=null;function eXr(){return z_===null&&(z_=tXr(),bVe().catch(e=>{console.error("Failed to load feature epics:",e),LHe(e,{tags:{critical:"true",module:"epicManager"}}),alert(`The application failed to load required modules. Some features may not work correctly.
88758
88758
 
88759
- Please refresh the page to try again.`)})),z_}function tXr(){console.warn(`initializing epic state with url ${JSON.stringify(ef)}`);const e=is.getSignedInUser(),t=vVe(ef,e?.userId,e?.zeniSessionId,void 0,Kw()),o=CVe();return o.userId!=null&&Z2.identify(o.userId,{tenant_id:o.tenantId}),t}const u9e="zeni-chunk-reload-at",oXr=6e4,rXr=["Failed to fetch dynamically imported module","error loading dynamically imported module","Importing a module script failed"];function iXr(){window.addEventListener("vite:preloadError",e=>{const t=e;h9e(t.payload)&&t.preventDefault()}),window.addEventListener("unhandledrejection",e=>{nXr(e.reason)&&h9e(e.reason)})}function h9e(e){try{const t=Number(sessionStorage.getItem(u9e))||0;if(Date.now()-t<oXr)return!1;sessionStorage.setItem(u9e,String(Date.now()))}catch{return!1}return console.warn("[chunk-load] Stale chunk detected — hard-reloading:",e),window.location.reload(),!0}function nXr(e){const t=String(e?.message??e??"");return rXr.some(o=>t.includes(o))}const aXr=!!(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)),sXr="QA",lXr="https://zeni-webapp-qa.uc.r.appspot.com",m9e=`/service-worker.js?v=${Date.now()}&env=${sXr}&endpoint=${encodeURIComponent(lXr)}`;function dXr(e){if("serviceWorker"in navigator){if(new URL("https://qa.app.zeni.ai",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{aXr?cXr(m9e):rHe(m9e)})}}function rHe(e,t){navigator.serviceWorker.register(e).then(o=>{o.onupdatefound=()=>{const i=o.installing;i!=null&&(i.onstatechange=()=>{i.state==="installed"&&(navigator.serviceWorker.controller?(console.log("New content available; will be used when all tabs are closed."),navigator.serviceWorker.controller?.postMessage({type:"UPDATE_READY"}),o.waiting?.postMessage({type:"SKIP_WAITING"})):console.log("Content is cached for offline use."))})},o.waiting&&o.waiting.postMessage({type:"SKIP_WAITING"}),navigator.serviceWorker.addEventListener("controllerchange",()=>{console.log("New service worker activated."),o.active?.postMessage({type:"CLIENTS_CLAIM"})})}).catch(o=>{console.error("Error during service worker registration:",o)})}function cXr(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(o=>{const i=o.headers.get("content-type");o.status===404||i!=null&&!i.includes("javascript")?navigator.serviceWorker.ready.then(a=>{a.unregister().then(()=>window.location.reload())}):rHe(e)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}const pXr=is.getSignedInUser(),uXr=pXr?.zeniSessionId;async function hXr(){try{const e=await kJr(),t=vJr(e,CJr+Oc);AJr(JSON.parse(t)),RVe.createRoot(document.getElementById("root")).render(wo.jsx($.StrictMode,{children:wo.jsx(d_e,{basename:"/cockpit",children:wo.jsx(JJr,{})})})),mXr()}catch(e){console.error("Error initializing app:",e)}}function mXr(){const e=()=>{IHe({dsn:da.sentryDsn,integrations:[MHe(),BHe({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:da.sentryTraceSamplingRate,replaysSessionSampleRate:0,replaysOnErrorSampleRate:1,beforeSendTransaction(t){return t.breadcrumbs&&(t.breadcrumbs=t.breadcrumbs.filter(o=>o.category!=="console"?!0:(o.message??"").toLowerCase().includes("called people set")||Array.isArray(o.data?.arguments)&&o.data.arguments.some(a=>typeof a=="string"&&a.toLowerCase().includes("called people set"))?!1:(Array.isArray(o.data?.arguments)&&(o.data.arguments=o.data.arguments.map(a=>{if(typeof a=="string"&&a.includes("user_roles"))try{const l=a.match(/\{.*\}/s);if(l!==null){const d=JSON.parse(l[0]);if(d.user_roles!=null)return delete d.user_roles,a.replace(l[0],JSON.stringify(d))}}catch{}return a})),!0))),t}}),PHe("session-id",uXr)};typeof requestIdleCallback=="function"?requestIdleCallback(e):setTimeout(e,0)}iXr();hXr();dXr();export{Qhi as $,iM as A,Vhi as B,Uhi as C,Cti as D,Rni as E,PXr as F,_hi as G,Vri as H,Ohi as I,Ie as J,Psi as K,Dsi as L,Yhi as M,Whi as N,Q as O,Fhi as P,qri as Q,Rhi as R,Ghi as S,zhi as T,Phi as U,bo as V,oHe as W,Wf as X,Voi as Y,xJ as Z,Kri as _,Hhi as a,Khi as a0,Z2 as b,Sno as c,gci as d,eAr as e,Dhi as f,Zhi as g,c9e as h,Mhi as i,da as j,r as k,C as l,_oi as m,Bhi as n,kh as o,Thi as p,qhi as q,qxo as r,qs as s,iIe as t,IJr as u,dh as v,j as w,Nhi as x,at as y,is as z};
88759
+ Please refresh the page to try again.`)})),z_}function tXr(){console.warn(`initializing epic state with url ${JSON.stringify(ef)}`);const e=is.getSignedInUser(),t=vVe(ef,e?.userId,e?.zeniSessionId,void 0,Kw()),o=CVe();return o.userId!=null&&Z2.identify(o.userId,{tenant_id:o.tenantId}),t}const u9e="zeni-chunk-reload-at",oXr=6e4,rXr=["Failed to fetch dynamically imported module","error loading dynamically imported module","Importing a module script failed"];function iXr(){window.addEventListener("vite:preloadError",e=>{const t=e;h9e(t.payload)&&t.preventDefault()}),window.addEventListener("unhandledrejection",e=>{nXr(e.reason)&&h9e(e.reason)})}function h9e(e){try{const t=Number(sessionStorage.getItem(u9e))||0;if(Date.now()-t<oXr)return!1;sessionStorage.setItem(u9e,String(Date.now()))}catch{return!1}return console.warn("[chunk-load] Stale chunk detected — hard-reloading:",e),window.location.reload(),!0}function nXr(e){const t=String(e?.message??e??"");return rXr.some(o=>t.includes(o))}const aXr=!!(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)),sXr="DEV",lXr="https://zeni-webapp-dev.uc.r.appspot.com",m9e=`/service-worker.js?v=${Date.now()}&env=${sXr}&endpoint=${encodeURIComponent(lXr)}`;function dXr(e){if("serviceWorker"in navigator){if(new URL("https://dev.app.zeni.ai",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{aXr?cXr(m9e):rHe(m9e)})}}function rHe(e,t){navigator.serviceWorker.register(e).then(o=>{o.onupdatefound=()=>{const i=o.installing;i!=null&&(i.onstatechange=()=>{i.state==="installed"&&(navigator.serviceWorker.controller?(console.log("New content available; will be used when all tabs are closed."),navigator.serviceWorker.controller?.postMessage({type:"UPDATE_READY"}),o.waiting?.postMessage({type:"SKIP_WAITING"})):console.log("Content is cached for offline use."))})},o.waiting&&o.waiting.postMessage({type:"SKIP_WAITING"}),navigator.serviceWorker.addEventListener("controllerchange",()=>{console.log("New service worker activated."),o.active?.postMessage({type:"CLIENTS_CLAIM"})})}).catch(o=>{console.error("Error during service worker registration:",o)})}function cXr(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(o=>{const i=o.headers.get("content-type");o.status===404||i!=null&&!i.includes("javascript")?navigator.serviceWorker.ready.then(a=>{a.unregister().then(()=>window.location.reload())}):rHe(e)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}const pXr=is.getSignedInUser(),uXr=pXr?.zeniSessionId;async function hXr(){try{const e=await kJr(),t=vJr(e,CJr+Oc);AJr(JSON.parse(t)),RVe.createRoot(document.getElementById("root")).render(wo.jsx($.StrictMode,{children:wo.jsx(d_e,{basename:"/cockpit",children:wo.jsx(JJr,{})})})),mXr()}catch(e){console.error("Error initializing app:",e)}}function mXr(){const e=()=>{IHe({dsn:da.sentryDsn,integrations:[MHe(),BHe({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:da.sentryTraceSamplingRate,replaysSessionSampleRate:0,replaysOnErrorSampleRate:1,beforeSendTransaction(t){return t.breadcrumbs&&(t.breadcrumbs=t.breadcrumbs.filter(o=>o.category!=="console"?!0:(o.message??"").toLowerCase().includes("called people set")||Array.isArray(o.data?.arguments)&&o.data.arguments.some(a=>typeof a=="string"&&a.toLowerCase().includes("called people set"))?!1:(Array.isArray(o.data?.arguments)&&(o.data.arguments=o.data.arguments.map(a=>{if(typeof a=="string"&&a.includes("user_roles"))try{const l=a.match(/\{.*\}/s);if(l!==null){const d=JSON.parse(l[0]);if(d.user_roles!=null)return delete d.user_roles,a.replace(l[0],JSON.stringify(d))}}catch{}return a})),!0))),t}}),PHe("session-id",uXr)};typeof requestIdleCallback=="function"?requestIdleCallback(e):setTimeout(e,0)}iXr();hXr();dXr();export{Qhi as $,iM as A,Vhi as B,Uhi as C,Cti as D,Rni as E,PXr as F,_hi as G,Vri as H,Ohi as I,Ie as J,Psi as K,Dsi as L,Yhi as M,Whi as N,Q as O,Fhi as P,qri as Q,Rhi as R,Ghi as S,zhi as T,Phi as U,bo as V,oHe as W,Wf as X,Voi as Y,xJ as Z,Kri as _,Hhi as a,Khi as a0,Z2 as b,Sno as c,gci as d,eAr as e,Dhi as f,Zhi as g,c9e as h,Mhi as i,da as j,r as k,C as l,_oi as m,Bhi as n,kh as o,Thi as p,qhi as q,qxo as r,qs as s,iIe as t,IJr as u,dh as v,j as w,Nhi as x,at as y,is as z};