@zeniai/web-cockpit-ui 2.2.36-qa → 2.2.37-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 (38) hide show
  1. package/dist/assets/{CreditAgentRoutes-Uru6-42E.js → CreditAgentRoutes-BDadq_dH.js} +1 -1
  2. package/dist/assets/{Preview-CPh7pDbL.js → Preview-Bl3tOkfs.js} +1 -1
  3. package/dist/assets/{ScreenRoutes-BYm2ki6f.js → ScreenRoutes-CUdw31xk.js} +3 -3
  4. package/dist/assets/{SignInScreen-DFK5dZ2x.js → SignInScreen-iQrcvFVn.js} +1 -1
  5. package/dist/assets/{analytics-i73wLbFz.js → analytics-BB2Z07-E.js} +1 -1
  6. package/dist/assets/{analyticsHelper-BJlZWXce.js → analyticsHelper-B-ah4cGP.js} +1 -1
  7. package/dist/assets/{core-G37kO4o4.js → core-BLUwF2Ga.js} +1 -1
  8. package/dist/assets/{dash.all.min-H9Q7CC2_.js → dash.all.min-CEX1XL9C.js} +1 -1
  9. package/dist/assets/{empty-D_qmwTtc.js → empty-CaJqLeqH.js} +1 -1
  10. package/dist/assets/{empty-BHFUXp6S.js → empty-itfoynxx.js} +1 -1
  11. package/dist/assets/{epic-CDjhDpo_.js → epic-Cr4JRbOR.js} +1 -1
  12. package/dist/assets/{index-D5abkZg2.js → index-B-IAe6yw.js} +1 -1
  13. package/dist/assets/{index-lKgP1B52.js → index-B84g_66Z.js} +2 -2
  14. package/dist/assets/{index-ik9c0K0T.js → index-BMTRxK2p.js} +7 -7
  15. package/dist/assets/{index-D3SGnURh.js → index-Binxs7hQ.js} +1 -1
  16. package/dist/assets/{index-CEcX7V-S.js → index-CF6KfbAT.js} +1 -1
  17. package/dist/assets/{index-DygAp99g.js → index-CZ-7ZFkm.js} +1 -1
  18. package/dist/assets/{index-D0siUunb.js → index-DZqDnnOK.js} +1 -1
  19. package/dist/assets/{lexical-WxP4v39H.js → lexical-BuP3IVgU.js} +1 -1
  20. package/dist/assets/{liveblocks-DfVop9iK.js → liveblocks-p25-TTyD.js} +1 -1
  21. package/dist/assets/{lottie-B6gk327V.js → lottie-q5H7mx0-.js} +1 -1
  22. package/dist/assets/{mui-DDryRcQN.js → mui-P78yhQU-.js} +1 -1
  23. package/dist/assets/{react-kGVh8aBQ.js → react-BeUONl2Y.js} +1 -1
  24. package/dist/assets/{react-DDYxDrYQ.js → react-DSH91-H5.js} +1 -1
  25. package/dist/assets/{react-D6qaFjOD.js → react-DaGBysvQ.js} +1 -1
  26. package/dist/assets/{react-CF37OIFy.js → react-DeEuSSwy.js} +1 -1
  27. package/dist/assets/{react-DiFuVsY_.js → react-DzGwgH7E.js} +1 -1
  28. package/dist/assets/{react-DgfhqHZi.js → react-O4TWvCn5.js} +1 -1
  29. package/dist/assets/{react-Dy0RRtEU.js → react-V2ETOZb1.js} +2 -2
  30. package/dist/assets/{react-DcrXCfRe.js → react-k1fwibm2.js} +1 -1
  31. package/dist/assets/{recharts-CErfhk7D.js → recharts-BBlvhOR8.js} +1 -1
  32. package/dist/assets/{sentry-C-ZFvX-S.js → sentry-C55DzYyA.js} +1 -1
  33. package/dist/assets/{url-B7Z-cGBi.js → url-C-fDE88q.js} +1 -1
  34. package/dist/assets/{url-okO9gg5d.js → url-DH9-bXDQ.js} +1 -1
  35. package/dist/assets/{utils-Dfq1gb3q.js → utils-DEG-3n18.js} +1 -1
  36. package/dist/assets/{zeni-epic-state-DuUbWCm2.js → zeni-epic-state-B-8YrXU1.js} +3 -3
  37. package/dist/index.html +1 -1
  38. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/empty-D_qmwTtc.js","assets/sentry-C-ZFvX-S.js","assets/empty-BHFUXp6S.js","assets/index-CEcX7V-S.js","assets/index-DygAp99g.js","assets/zeni-epic-state-DuUbWCm2.js","assets/core-G37kO4o4.js","assets/utils-Dfq1gb3q.js","assets/recharts-CErfhk7D.js","assets/url-B7Z-cGBi.js","assets/index-D5abkZg2.js","assets/index-D0siUunb.js","assets/url-okO9gg5d.js","assets/index-lKgP1B52.js","assets/ScreenRoutes-BYm2ki6f.js","assets/liveblocks-DfVop9iK.js","assets/analyticsHelper-BJlZWXce.js","assets/mui-DDryRcQN.js","assets/SignInScreen-DFK5dZ2x.js","assets/analytics-i73wLbFz.js","assets/lottie-B6gk327V.js","assets/lexical-WxP4v39H.js"])))=>i.map(i=>d[i]);
2
- import{a as g,R as $,e as oJe,b as P4,p as R0,r as Tc,g as Xq,d as vre,f as rJe,s as Cre,w as iJe,i as nJe,S as aJe,j as sJe,k as lJe,l as cJe,m as dJe}from"./sentry-C-ZFvX-S.js";import{j as Co,_ as B$e,a as Cd,u as P$e,T as pJe,C as uJe,b as hJe,c as hj,d as mj,e as mJe,f as gJe,g as D$e,h as fJe,i as xJe,L as yJe,k as Are,l as bJe,m as wJe,n as vJe,P as CJe,o as AJe,p as $Je,q as T$e,r as kJe,s as SJe,I as $re,t as EJe,v as LJe,w as IJe,x as jJe,y as MJe,z as BJe,A as z$e,B as PJe,D as DJe,E as TJe}from"./liveblocks-DfVop9iK.js";import{f as R$e,R as o4,r as Fn,P as Dn,u as gj,g as yh,h as zJe,i as eZ,j as RJe,k as FJe,l as hT,N as OJe,m as NJe,n as HJe,B as _Je}from"./core-G37kO4o4.js";import{H as AE,ba as r4,bb as VJe,bc as kre,bd as X4,be as xr,bf as F$e,bg as Wr,bh as fj,bi as QJe,bj as Dh,bk as UJe,bl as WJe,bm as S8,bn as hg,bo as b9,bp as O$e,bq as GJe,br as Z1,bs as N$e,bt as YJe,bu as tZ,bv as H$e,bw as ln,bx as E8,by as Gu,bz as Sre,bA as KJe,bB as qJe,bC as _$e,bD as OW,bE as ZJe,bF as JJe,bG as XJe,bH as eXe,bI as oZ,bJ as V$e,bK as tXe,bL as qb,bM as oXe,bN as Q$e,bO as NW,bP as Ere,bQ as Lre,bR as Ire,bS as zl,bT as rZ,bU as U$e,bV as W$e,bW as iZ,bX as w9,bY as xj,bZ as nZ,b_ as aZ,b$ as sZ,c0 as lZ,c1 as rXe,c2 as yj,c3 as lp,c4 as cp,c5 as $E,c6 as G$e,c7 as Y$e,c8 as iXe,c9 as cZ,ca as dZ,cb as nXe,cc as aXe,cd as tp,ce as Dv,cf as Tv,cg as sXe,ch as lXe,ci as cXe,cj as dXe,ck as pXe,cl as uXe,cm as hXe,cn as bA,co as K$e,cp as q$e,cq as mXe,cr as gXe,cs as Z$e,ct as J$e,cu as fXe,cv as xXe,cw as yXe,cx as X$e,cy as eke,cz as bXe,cA as wXe,cB as tke,cC as oke,cD as vXe,cE as jre,cF as CXe,cG as AXe,cH as Iw,cI as $Xe,cJ as rke,cK as kXe,cL as ike,cM as SXe,cN as Mre,cO as EXe,cP as nke,cQ as ake,cR as ske,cS as lke,cT as cke,cU as LXe,cV as dke,cW as IXe,cX as jXe,cY as MXe,cZ as pke,c_ as HW,c$ as BXe,d0 as uke,d1 as hke,d2 as PXe,d3 as DXe,d4 as TXe,d5 as zXe,d6 as RXe,d7 as FXe,d8 as OXe,d9 as NXe,v as HXe,da as bj,db as _W,dc as VW,dd as _Xe,de as VXe,df as QXe,dg as UXe,dh as WXe,di as GXe,dj as YXe,dk as KXe,dl as qXe,dm as ZXe,dn as Bre,dp as JXe,dq as XXe,dr as eet,ds as tet,dt as oet}from"./zeni-epic-state-DuUbWCm2.js";import{T as mke,j as Uo,n as i,c as pe,k as _t,G as zv,C as gke,u as ret,a as iet}from"./mui-DDryRcQN.js";import{r as net,m as Yu}from"./analytics-i73wLbFz.js";import{L as QW}from"./lottie-B6gk327V.js";import{r as Ta}from"./lexical-WxP4v39H.js";import{E as en,c as wj,P as aet,R as UW,F as kE,X as gd,Y as fd,G as k2,H as SE,I as vj,J as S2,K as fke,L as set,M as cet,N as e5,O as pZ,Q as uZ,S as Rv,U as det}from"./recharts-CErfhk7D.js";import{r as pet}from"./utils-Dfq1gb3q.js";(function(){try{var e=typeof window<"u"?window:typeof P4<"u"?P4:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3654a763-99e6-4df4-8827-290919f31597",e._sentryDebugIdIdentifier="sentry-dbid-3654a763-99e6-4df4-8827-290919f31597")}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"]'))n(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function r(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 n(a){if(a.ep)return;a.ep=!0;const l=r(a);fetch(a.href,l)}})();var wA={},Pre;function uet(){if(Pre)return wA;Pre=1;var e=R$e();return wA.createRoot=e.createRoot,wA.hydrateRoot=e.hydrateRoot,wA}var het=uet(),wc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof P4<"u"?P4:typeof self<"u"?self:{};function Vr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dre={exports:{}},yx={},Tre;function met(){if(Tre)return yx;Tre=1;var e=$,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=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 c(d,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)n.call(p,h)&&!l.hasOwnProperty(h)&&(m[h]=p[h]);if(d&&d.defaultProps)for(h in p=d.defaultProps,p)m[h]===void 0&&(m[h]=p[h]);return{$$typeof:t,type:d,key:f,ref:x,props:m,_owner:a.current}}return yx.Fragment=r,yx.jsx=c,yx.jsxs=c,yx}var zre;function xke(){return zre||(zre=1,Dre.exports=met()),Dre.exports}var s=xke();const get=g.createContext(null),mT={didCatch:!1,error:null};let fet=class extends g.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=mT}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var t,r,n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];(t=(r=this.props).onReset)===null||t===void 0||t.call(r,{args:a,reason:"imperative-api"}),this.setState(mT)}}componentDidCatch(e,t){var r,n;(r=(n=this.props).onError)===null||r===void 0||r.call(n,e,t)}componentDidUpdate(e,t){const{didCatch:r}=this.state,{resetKeys:n}=this.props;if(r&&t.error!==null&&xet(e.resetKeys,n)){var a,l;(a=(l=this.props).onReset)===null||a===void 0||a.call(l,{next:n,prev:e.resetKeys,reason:"keys"}),this.setState(mT)}}render(){const{children:e,fallbackRender:t,FallbackComponent:r,fallback:n}=this.props,{didCatch:a,error:l}=this.state;let c=e;if(a){const d={error:l,resetErrorBoundary:this.resetErrorBoundary};if(typeof t=="function")c=t(d);else if(r)c=g.createElement(r,d);else if(n!==void 0)c=n;else throw l}return g.createElement(get.Provider,{value:{didCatch:a,error:l,resetErrorBoundary:this.resetErrorBoundary}},c)}};function xet(){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((r,n)=>!Object.is(r,t[n]))}var WW={exports:{}},yet=WW.exports,Rre;function bet(){return Rre||(Rre=1,(function(e){(function(t,r){e.exports?e.exports=r():t.numeral=r()})(yet,function(){var t,r,n="2.0.6",a={},l={},c={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},d={currentLocale:c.currentLocale,zeroFormat:c.zeroFormat,nullFormat:c.nullFormat,defaultFormat:c.defaultFormat,scalePercentBy100:c.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||r.isNaN(u))h=null;else if(typeof u=="string")if(d.zeroFormat&&u===d.zeroFormat)h=0;else if(d.nullFormat&&u===d.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=n,t.isNumeral=function(u){return u instanceof p},t._=r={numberToFormat:function(u,h,m){var f=l[t.options.currentLocale],x=!1,y=!1,b=0,w="",v=1e12,A=1e9,S=1e6,E=1e3,I="",L=!1,M,D,P,T,z,N,K;if(u=u||0,D=Math.abs(u),t._.includes(h,"(")?(x=!0,h=h.replace(/[\(|\)]/g,"")):(t._.includes(h,"+")||t._.includes(h,"-"))&&(z=t._.includes(h,"+")?h.indexOf("+"):u<0?h.indexOf("-"):-1,h=h.replace(/[\+|\-]/g,"")),t._.includes(h,"a")&&(M=h.match(/a(k|m|b|t)?/),M=M?M[1]:!1,t._.includes(h," a")&&(w=" "),h=h.replace(new RegExp(w+"a[kmbt]?"),""),D>=v&&!M||M==="t"?(w+=f.abbreviations.trillion,u=u/v):D<v&&D>=A&&!M||M==="b"?(w+=f.abbreviations.billion,u=u/A):D<A&&D>=S&&!M||M==="m"?(w+=f.abbreviations.million,u=u/S):(D<S&&D>=E&&!M||M==="k")&&(w+=f.abbreviations.thousand,u=u/E)),t._.includes(h,"[.]")&&(y=!0,h=h.replace("[.]",".")),P=u.toString().split(".")[0],T=h.split(".")[1],N=h.indexOf(","),b=(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),P=I.split(".")[0],t._.includes(I,".")?I=f.delimiters.decimal+I.split(".")[1]:I="",y&&Number(I.slice(1))===0&&(I="")):P=t._.toFixed(u,0,m),w&&!M&&Number(P)>=1e3&&w!==f.abbreviations.trillion)switch(P=String(Number(P)/1e3),w){case f.abbreviations.thousand:w=f.abbreviations.million;break;case f.abbreviations.million:w=f.abbreviations.billion;break;case f.abbreviations.billion:w=f.abbreviations.trillion;break}if(t._.includes(P,"-")&&(P=P.slice(1),L=!0),P.length<b)for(var q=b-P.length;q>0;q--)P="0"+P;return N>-1&&(P=P.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),h.indexOf(".")===0&&(P=""),K=P+I+(w||""),x?K=(x&&L?"(":"")+K+(x&&L?")":""):z>=0?K=z===0?(L?"-":"+")+K:K+(L?"-":"+"):L&&(K="-"+K),K},stringToNumber:function(u){var h=l[d.currentLocale],m=u,f={thousand:3,million:6,billion:9,trillion:12},x,y,b;if(d.zeroFormat&&u===d.zeroFormat)y=0;else if(d.nullFormat&&u===d.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(b=new RegExp("[^a-zA-Z]"+h.abbreviations[x]+"(?:\\)|(\\"+h.currency.symbol+")?(?:\\))?)?$"),m.match(b)){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=r.multiplier(m);return h>f?h:f},1)},toFixed:function(u,h,m,f){var x=u.toString().split("."),y=h-(f||0),b,w,v,A;return x.length===2?b=Math.min(Math.max(x[1].length,y),h):b=y,v=Math.pow(10,b),A=(m(u+"e+"+b)/v).toFixed(b),f>h-b&&(w=new RegExp("\\.?0{1,"+(f-(h-b))+"}$"),A=A.replace(w,"")),A}},t.options=d,t.formats=a,t.locales=l,t.locale=function(u){return u&&(d.currentLocale=u.toLowerCase()),d.currentLocale},t.localeData=function(u){if(!u)return l[d.currentLocale];if(u=u.toLowerCase(),!l[u])throw new Error("Unknown locale : "+u);return l[u]},t.reset=function(){for(var u in c)d[u]=c[u]},t.zeroFormat=function(u){d.zeroFormat=typeof u=="string"?u:null},t.nullFormat=function(u){d.nullFormat=typeof u=="string"?u:null},t.defaultFormat=function(u){d.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,b,w,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,b=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]!==b.thousand&&A[0]!==b.million&&A[0]!==b.billion&&A[0]!==b.trillion))?!1:(w=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(w):y[0].length===1?!!y[0].match(/^\d+$/)&&!y[0].match(w)&&!!y[1].match(/^\d+$/):!!y[0].match(/^\d+.*\d$/)&&!y[0].match(w)&&!!y[1].match(/^\d+$/)))},t.fn=p.prototype={clone:function(){return t(this)},format:function(u,h){var m=this._value,f=u||d.defaultFormat,x,y,b;if(h=h||Math.round,m===0&&d.zeroFormat!==null)y=d.zeroFormat;else if(m===null&&d.nullFormat!==null)y=d.nullFormat;else{for(x in a)if(f.match(a[x].regexps.format)){b=a[x].format;break}b=b||t._.numberToFormat,y=b(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=r.correctionFactor.call(null,this._value,u);function m(f,x,y,b){return f+Math.round(h*x)}return this._value=r.reduce([this._value,u],m,0)/h,this},subtract:function(u){var h=r.correctionFactor.call(null,this._value,u);function m(f,x,y,b){return f-Math.round(h*x)}return this._value=r.reduce([u],m,Math.round(this._value*h))/h,this},multiply:function(u){function h(m,f,x,y){var b=r.correctionFactor(m,f);return Math.round(m*b)*Math.round(f*b)/Math.round(b*b)}return this._value=r.reduce([this._value,u],h,1),this},divide:function(u){function h(m,f,x,y){var b=r.correctionFactor(m,f);return Math.round(m*b)/Math.round(f*b)}return this._value=r.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,b){var w,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 w=t._.numberToFormat(x,y,b),w+A},unformat:function(x){var y=t._.stringToNumber(x),b,w;if(y){for(b=u.suffixes.length-1;b>=0;b--){if(t._.includes(x,u.suffixes[b])){w=Math.pow(u.base,b);break}if(t._.includes(x,h.suffixes[b])){w=Math.pow(h.base,b);break}}y*=w||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,b,w;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),w=0;w<x.before.length;w++)switch(b=x.before[w],b){case"$":y=t._.insert(y,f.currency.symbol,w);break;case" ":y=t._.insert(y," ",w+f.currency.symbol.length-1);break}for(w=x.after.length-1;w>=0;w--)switch(b=x.after[w],b){case"$":y=w===x.after.length-1?y+f.currency.symbol:t._.insert(y,f.currency.symbol,-(x.after.length-(1+w)));break;case" ":y=w===x.after.length-1?y+" ":t._.insert(y," ",-(x.after.length-(1+w)+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,b,w,v){var A=t._.correctionFactor(y,b),S=y*A*(b*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})})(WW)),WW.exports}var wet=bet();const ap=Vr(wet);function m2(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(n=>r.searchParams.append("args[]",n)),`Minified MUI error #${e}; visit ${r} for the full message.`}const c2="$$material";function vet(e){for(var t=0,r,n=0,a=e.length;a>=4;++n,a-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&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 Cet={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 Aet(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var $et=/[A-Z]|^ms/g,ket=/_EMO_([^_]+?)_([^]*?)_EMO_/g,yke=function(e){return e.charCodeAt(1)===45},Fre=function(e){return e!=null&&typeof e!="boolean"},gT=Aet(function(e){return yke(e)?e:e.replace($et,"-$&").toLowerCase()}),Ore=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(ket,function(r,n,a){return Qm={name:n,styles:a,next:Qm},n})}return Cet[e]!==1&&!yke(e)&&typeof t=="number"&&t!==0?t+"px":t};function EE(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var a=r;if(a.anim===1)return Qm={name:a.name,styles:a.styles,next:Qm},a.name;var l=r;if(l.styles!==void 0){var c=l.next;if(c!==void 0)for(;c!==void 0;)Qm={name:c.name,styles:c.styles,next:Qm},c=c.next;var d=l.styles+";";return d}return Eet(e,t,r)}}var p=r;return p}function Eet(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a<r.length;a++)n+=EE(e,t,r[a])+";";else for(var l in r){var c=r[l];if(typeof c!="object"){var d=c;Fre(d)&&(n+=gT(l)+":"+Ore(l,d)+";")}else if(Array.isArray(c)&&typeof c[0]=="string"&&t==null)for(var p=0;p<c.length;p++)Fre(c[p])&&(n+=gT(l)+":"+Ore(l,c[p])+";");else{var u=EE(e,t,c);switch(l){case"animation":case"animationName":{n+=gT(l)+":"+u+";";break}default:n+=l+"{"+u+"}"}}}return n}var Nre=/label:\s*([^\s;{]+)\s*(;|$)/g,Qm;function Let(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,a="";Qm=void 0;var l=e[0];if(l==null||l.raw===void 0)n=!1,a+=EE(r,t,l);else{var c=l;a+=c[0]}for(var d=1;d<e.length;d++)if(a+=EE(r,t,e[d]),n){var p=l;a+=p[d]}Nre.lastIndex=0;for(var u="",h;(h=Nre.exec(a))!==null;)u+="-"+h[1];var m=vet(a)+u;return{name:m,styles:a,next:Qm}}var fT={exports:{}},xT,Hre;function Iet(){if(Hre)return xT;Hre=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xT=e,xT}var yT,_re;function jet(){if(_re)return yT;_re=1;var e=Iet();function t(){}function r(){}return r.resetWarningCache=t,yT=function(){function n(c,d,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}}n.isRequired=n;function a(){return n}var l={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:a,element:n,elementType:n,instanceOf:a,node:n,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:t};return l.PropTypes=l,l},yT}var Vre;function hZ(){return Vre||(Vre=1,fT.exports=jet()()),fT.exports}var Met=hZ();const Nt=Vr(Met);function Bet(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 Pet(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 Det=(function(){function e(r){var n=this;this._insertTag=function(a){var l;n.tags.length===0?n.insertionPoint?l=n.insertionPoint.nextSibling:n.prepend?l=n.container.firstChild:l=n.before:l=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(a,l),n.tags.push(a)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Pet(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var a=Bet(n);try{a.insertRule(r,a.cssRules.length)}catch{}}else n.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var n;return(n=r.parentNode)==null?void 0:n.removeChild(r)}),this.tags=[],this.ctr=0},e})(),ol="-ms-",LE="-moz-",ki="-webkit-",bke="comm",mZ="rule",gZ="decl",Tet="@import",wke="@keyframes",zet="@layer",Ret=Math.abs,Cj=String.fromCharCode,Fet=Object.assign;function Oet(e,t){return zs(e,0)^45?(((t<<2^zs(e,0))<<2^zs(e,1))<<2^zs(e,2))<<2^zs(e,3):0}function vke(e){return e.trim()}function Net(e,t){return(e=t.exec(e))?e[0]:e}function Si(e,t,r){return e.replace(t,r)}function GW(e,t){return e.indexOf(t)}function zs(e,t){return e.charCodeAt(t)|0}function jw(e,t,r){return e.slice(t,r)}function Ku(e){return e.length}function fZ(e){return e.length}function vA(e,t){return t.push(e),e}function Het(e,t){return e.map(t).join("")}var Aj=1,L8=1,Cke=0,jc=0,Ia=0,v9="";function $j(e,t,r,n,a,l,c){return{value:e,root:t,parent:r,type:n,props:a,children:l,line:Aj,column:L8,length:c,return:""}}function bx(e,t){return Fet($j("",null,null,"",null,null,0),e,{length:-e.length},t)}function _et(){return Ia}function Vet(){return Ia=jc>0?zs(v9,--jc):0,L8--,Ia===10&&(L8=1,Aj--),Ia}function ud(){return Ia=jc<Cke?zs(v9,jc++):0,L8++,Ia===10&&(L8=1,Aj++),Ia}function kh(){return zs(v9,jc)}function NS(){return jc}function Fv(e,t){return jw(v9,e,t)}function Mw(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 Ake(e){return Aj=L8=1,Cke=Ku(v9=e),jc=0,[]}function $ke(e){return v9="",e}function HS(e){return vke(Fv(jc-1,YW(e===91?e+2:e===40?e+1:e)))}function Qet(e){for(;(Ia=kh())&&Ia<33;)ud();return Mw(e)>2||Mw(Ia)>3?"":" "}function Uet(e,t){for(;--t&&ud()&&!(Ia<48||Ia>102||Ia>57&&Ia<65||Ia>70&&Ia<97););return Fv(e,NS()+(t<6&&kh()==32&&ud()==32))}function YW(e){for(;ud();)switch(Ia){case e:return jc;case 34:case 39:e!==34&&e!==39&&YW(Ia);break;case 40:e===41&&YW(e);break;case 92:ud();break}return jc}function Wet(e,t){for(;ud()&&e+Ia!==57&&!(e+Ia===84&&kh()===47););return"/*"+Fv(t,jc-1)+"*"+Cj(e===47?e:ud())}function Get(e){for(;!Mw(kh());)ud();return Fv(e,jc)}function Yet(e){return $ke(_S("",null,null,null,[""],e=Ake(e),0,[0],e))}function _S(e,t,r,n,a,l,c,d,p){for(var u=0,h=0,m=c,f=0,x=0,y=0,b=1,w=1,v=1,A=0,S="",E=a,I=l,L=n,M=S;w;)switch(y=A,A=ud()){case 40:if(y!=108&&zs(M,m-1)==58){GW(M+=Si(HS(A),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:M+=HS(A);break;case 9:case 10:case 13:case 32:M+=Qet(y);break;case 92:M+=Uet(NS()-1,7);continue;case 47:switch(kh()){case 42:case 47:vA(Ket(Wet(ud(),NS()),t,r),p);break;default:M+="/"}break;case 123*b:d[u++]=Ku(M)*v;case 125*b:case 59:case 0:switch(A){case 0:case 125:w=0;case 59+h:v==-1&&(M=Si(M,/\f/g,"")),x>0&&Ku(M)-m&&vA(x>32?Ure(M+";",n,r,m-1):Ure(Si(M," ","")+";",n,r,m-2),p);break;case 59:M+=";";default:if(vA(L=Qre(M,t,r,u,h,a,d,S,E=[],I=[],m),l),A===123)if(h===0)_S(M,t,L,L,E,l,m,d,I);else switch(f===99&&zs(M,3)===110?100:f){case 100:case 108:case 109:case 115:_S(e,L,L,n&&vA(Qre(e,L,L,0,0,a,d,S,a,E=[],m),I),a,I,m,d,n?E:I);break;default:_S(M,L,L,L,[""],I,0,d,I)}}u=h=x=0,b=v=1,S=M="",m=c;break;case 58:m=1+Ku(M),x=y;default:if(b<1){if(A==123)--b;else if(A==125&&b++==0&&Vet()==125)continue}switch(M+=Cj(A),A*b){case 38:v=h>0?1:(M+="\f",-1);break;case 44:d[u++]=(Ku(M)-1)*v,v=1;break;case 64:kh()===45&&(M+=HS(ud())),f=kh(),h=m=Ku(S=M+=Get(NS())),A++;break;case 45:y===45&&Ku(M)==2&&(b=0)}}return l}function Qre(e,t,r,n,a,l,c,d,p,u,h){for(var m=a-1,f=a===0?l:[""],x=fZ(f),y=0,b=0,w=0;y<n;++y)for(var v=0,A=jw(e,m+1,m=Ret(b=c[y])),S=e;v<x;++v)(S=vke(b>0?f[v]+" "+A:Si(A,/&\f/g,f[v])))&&(p[w++]=S);return $j(e,t,r,a===0?mZ:d,p,u,h)}function Ket(e,t,r){return $j(e,t,r,bke,Cj(_et()),jw(e,2,-2),0)}function Ure(e,t,r,n){return $j(e,t,r,gZ,jw(e,0,n),jw(e,n+1,-1),n)}function r8(e,t){for(var r="",n=fZ(e),a=0;a<n;a++)r+=t(e[a],a,e,t)||"";return r}function qet(e,t,r,n){switch(e.type){case zet:if(e.children.length)break;case Tet:case gZ:return e.return=e.return||e.value;case bke:return"";case wke:return e.return=e.value+"{"+r8(e.children,n)+"}";case mZ:e.value=e.props.join(",")}return Ku(r=r8(e.children,n))?e.return=e.value+"{"+r+"}":""}function Zet(e){var t=fZ(e);return function(r,n,a,l){for(var c="",d=0;d<t;d++)c+=e[d](r,n,a,l)||"";return c}}function Jet(e){return function(t){t.root||(t=t.return)&&e(t)}}var Xet=function(e,t,r){for(var n=0,a=0;n=a,a=kh(),n===38&&a===12&&(t[r]=1),!Mw(a);)ud();return Fv(e,jc)},ett=function(e,t){var r=-1,n=44;do switch(Mw(n)){case 0:n===38&&kh()===12&&(t[r]=1),e[r]+=Xet(jc-1,t,r);break;case 2:e[r]+=HS(n);break;case 4:if(n===44){e[++r]=kh()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Cj(n)}while(n=ud());return e},ttt=function(e,t){return $ke(ett(Ake(e),t))},Wre=new WeakMap,ott=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!Wre.get(r))&&!n){Wre.set(e,!0);for(var a=[],l=ttt(t,a),c=r.props,d=0,p=0;d<l.length;d++)for(var u=0;u<c.length;u++,p++)e.props[p]=a[d]?l[d].replace(/&\f/g,c[u]):c[u]+" "+l[d]}}},rtt=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function kke(e,t){switch(Oet(e,t)){case 5103:return ki+"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 ki+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ki+e+LE+e+ol+e+e;case 6828:case 4268:return ki+e+ol+e+e;case 6165:return ki+e+ol+"flex-"+e+e;case 5187:return ki+e+Si(e,/(\w+).+(:[^]+)/,ki+"box-$1$2"+ol+"flex-$1$2")+e;case 5443:return ki+e+ol+"flex-item-"+Si(e,/flex-|-self/,"")+e;case 4675:return ki+e+ol+"flex-line-pack"+Si(e,/align-content|flex-|-self/,"")+e;case 5548:return ki+e+ol+Si(e,"shrink","negative")+e;case 5292:return ki+e+ol+Si(e,"basis","preferred-size")+e;case 6060:return ki+"box-"+Si(e,"-grow","")+ki+e+ol+Si(e,"grow","positive")+e;case 4554:return ki+Si(e,/([^-])(transform)/g,"$1"+ki+"$2")+e;case 6187:return Si(Si(Si(e,/(zoom-|grab)/,ki+"$1"),/(image-set)/,ki+"$1"),e,"")+e;case 5495:case 3959:return Si(e,/(image-set\([^]*)/,ki+"$1$`$1");case 4968:return Si(Si(e,/(.+:)(flex-)?(.*)/,ki+"box-pack:$3"+ol+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ki+e+e;case 4095:case 3583:case 4068:case 2532:return Si(e,/(.+)-inline(.+)/,ki+"$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(Ku(e)-1-t>6)switch(zs(e,t+1)){case 109:if(zs(e,t+4)!==45)break;case 102:return Si(e,/(.+:)(.+)-([^]+)/,"$1"+ki+"$2-$3$1"+LE+(zs(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~GW(e,"stretch")?kke(Si(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(zs(e,t+1)!==115)break;case 6444:switch(zs(e,Ku(e)-3-(~GW(e,"!important")&&10))){case 107:return Si(e,":",":"+ki)+e;case 101:return Si(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ki+(zs(e,14)===45?"inline-":"")+"box$3$1"+ki+"$2$3$1"+ol+"$2box$3")+e}break;case 5936:switch(zs(e,t+11)){case 114:return ki+e+ol+Si(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ki+e+ol+Si(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ki+e+ol+Si(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ki+e+ol+e+e}return e}var itt=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case gZ:e.return=kke(e.value,e.length);break;case wke:return r8([bx(e,{value:Si(e.value,"@","@"+ki)})],n);case mZ:if(e.length)return Het(e.props,function(a){switch(Net(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return r8([bx(e,{props:[Si(a,/:(read-\w+)/,":"+LE+"$1")]})],n);case"::placeholder":return r8([bx(e,{props:[Si(a,/:(plac\w+)/,":"+ki+"input-$1")]}),bx(e,{props:[Si(a,/:(plac\w+)/,":"+LE+"$1")]}),bx(e,{props:[Si(a,/:(plac\w+)/,ol+"input-$1")]})],n)}return""})}},ntt=[itt],Ske=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var b=y.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var n=e.stylisPlugins||ntt,a={},l,c=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(y){for(var b=y.getAttribute("data-emotion").split(" "),w=1;w<b.length;w++)a[b[w]]=!0;c.push(y)});var d,p=[ott,rtt];{var u,h=[qet,Jet(function(y){u.insert(y)})],m=Zet(p.concat(n,h)),f=function(y){return r8(Yet(y),m)};d=function(y,b,w,v){u=w,f(y?y+"{"+b.styles+"}":b.styles),v&&(x.inserted[b.name]=!0)}}var x={key:t,sheet:new Det({key:t,container:l,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:d};return x.sheet.hydrate(c),x};function att(e){return e==null||Object.keys(e).length===0}function Eke(e){const{styles:t,defaultTheme:r={}}=e,n=typeof t=="function"?a=>t(att(a)?r:a):t;return s.jsx(zv,{styles:n})}function stt(e,t){return i(e,t)}function ltt(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Gre=[];function rg(e){return Gre[0]=e,Let(Gre)}var Yre={exports:{}},Qi={},Kre;function ctt(){if(Kre)return Qi;Kre=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=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(b){if(typeof b=="object"&&b!==null){var w=b.$$typeof;switch(w){case e:switch(b=b.type,b){case r:case a:case n:case p:case u:case f:return b;default:switch(b=b&&b.$$typeof,b){case c:case d:case m:case h:return b;case l:return b;default:return w}}case t:return w}}}return Qi.ContextConsumer=l,Qi.ContextProvider=c,Qi.Element=e,Qi.ForwardRef=d,Qi.Fragment=r,Qi.Lazy=m,Qi.Memo=h,Qi.Portal=t,Qi.Profiler=a,Qi.StrictMode=n,Qi.Suspense=p,Qi.SuspenseList=u,Qi.isContextConsumer=function(b){return y(b)===l},Qi.isContextProvider=function(b){return y(b)===c},Qi.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Qi.isForwardRef=function(b){return y(b)===d},Qi.isFragment=function(b){return y(b)===r},Qi.isLazy=function(b){return y(b)===m},Qi.isMemo=function(b){return y(b)===h},Qi.isPortal=function(b){return y(b)===t},Qi.isProfiler=function(b){return y(b)===a},Qi.isStrictMode=function(b){return y(b)===n},Qi.isSuspense=function(b){return y(b)===p},Qi.isSuspenseList=function(b){return y(b)===u},Qi.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===r||b===a||b===n||b===p||b===u||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===h||b.$$typeof===c||b.$$typeof===l||b.$$typeof===d||b.$$typeof===x||b.getModuleId!==void 0)},Qi.typeOf=y,Qi}var qre;function dtt(){return qre||(qre=1,Yre.exports=ctt()),Yre.exports}var Lke=dtt();function G0(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 Ike(e){if(g.isValidElement(e)||Lke.isValidElementType(e)||!G0(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=Ike(e[r])}),t}function ml(e,t,r={clone:!0}){const n=r.clone?{...e}:e;return G0(e)&&G0(t)&&Object.keys(t).forEach(a=>{g.isValidElement(t[a])||Lke.isValidElementType(t[a])?n[a]=t[a]:G0(t[a])&&Object.prototype.hasOwnProperty.call(e,a)&&G0(e[a])?n[a]=ml(e[a],t[a],r):r.clone?n[a]=G0(t[a])?Ike(t[a]):t[a]:n[a]=t[a]}),n}const ptt=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>({...r,[n.key]:n.val}),{})};function utt(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5,...a}=e,l=ptt(t),c=Object.keys(l);function d(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r})`}function p(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-n/100}${r})`}function u(f,x){const y=c.indexOf(x);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r}) and (max-width:${(y!==-1&&typeof t[c[y]]=="number"?t[c[y]]:x)-n/100}${r})`}function h(f){return c.indexOf(f)+1<c.length?u(f,c[c.indexOf(f)+1]):d(f)}function m(f){const x=c.indexOf(f);return x===0?d(c[1]):x===c.length-1?p(c[x]):u(f,c[c.indexOf(f)+1]).replace("@media","@media not all and")}return{keys:c,values:l,up:d,down:p,between:u,only:h,not:m,unit:r,...a}}function Zre(e,t){if(!e.containerQueries)return t;const r=Object.keys(t).filter(n=>n.startsWith("@container")).sort((n,a)=>{const l=/min-width:\s*([0-9.]+)/;return+(n.match(l)?.[1]||0)-+(a.match(l)?.[1]||0)});return r.length?r.reduce((n,a)=>{const l=t[a];return delete n[a],n[a]=l,n},{...t}):t}function htt(e,t){return t==="@"||t.startsWith("@")&&(e.some(r=>t.startsWith(`@${r}`))||!!t.match(/^@\d/))}function mtt(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r)return null;const[,n,a]=r,l=Number.isNaN(+n)?n||0:+n;return e.containerQueries(a).up(l)}function gtt(e){const t=(l,c)=>l.replace("@media",c?`@container ${c}`:"@container");function r(l,c){l.up=(...d)=>t(e.breakpoints.up(...d),c),l.down=(...d)=>t(e.breakpoints.down(...d),c),l.between=(...d)=>t(e.breakpoints.between(...d),c),l.only=(...d)=>t(e.breakpoints.only(...d),c),l.not=(...d)=>{const p=t(e.breakpoints.not(...d),c);return p.includes("not all and")?p.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):p}}const n={},a=l=>(r(n,l),n);return r(a),{...e,containerQueries:a}}const ftt={borderRadius:4};function Zb(e,t){return t?ml(e,t,{clone:!1}):e}const kj={xs:0,sm:600,md:900,lg:1200,xl:1536},Jre={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${kj[e]}px)`},xtt={containerQueries:e=>({up:t=>{let r=typeof t=="number"?t:kj[t]||t;return typeof r=="number"&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function g2(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const a=n.breakpoints||Jre;return t.reduce((l,c,d)=>(l[a.up(a.keys[d])]=r(t[d]),l),{})}if(typeof t=="object"){const a=n.breakpoints||Jre;return Object.keys(t).reduce((l,c)=>{if(htt(a.keys,c)){const d=mtt(n.containerQueries?n:xtt,c);d&&(l[d]=r(t[c],c))}else if(Object.keys(a.values||kj).includes(c)){const d=a.up(c);l[d]=r(t[c],c)}else{const d=c;l[d]=t[d]}return l},{})}return r(t)}function ytt(e={}){return e.keys?.reduce((t,r)=>{const n=e.up(r);return t[n]={},t},{})||{}}function Xre(e,t){return e.reduce((r,n)=>{const a=r[n];return(!a||Object.keys(a).length===0)&&delete r[n],r},t)}function mr(e){if(typeof e!="string")throw new Error(m2(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Sj(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((a,l)=>a&&a[l]?a[l]:null,e);if(n!=null)return n}return t.split(".").reduce((n,a)=>n&&n[a]!=null?n[a]:null,e)}function IE(e,t,r,n=r){let a;return typeof e=="function"?a=e(r):Array.isArray(e)?a=e[r]||n:a=Sj(e,r)||n,t&&(a=t(a,n,e)),a}function ha(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:a}=e,l=c=>{if(c[t]==null)return null;const d=c[t],p=c.theme,u=Sj(p,n)||{};return g2(c,d,h=>{let m=IE(u,a,h);return h===m&&typeof h=="string"&&(m=IE(u,a,`${t}${h==="default"?"":mr(h)}`,h)),r===!1?m:{[r]:m}})};return l.propTypes={},l.filterProps=[t],l}function btt(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const wtt={m:"margin",p:"padding"},vtt={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},eie={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Ctt=btt(e=>{if(e.length>2)if(eie[e])e=eie[e];else return[e];const[t,r]=e.split(""),n=wtt[t],a=vtt[r]||"";return Array.isArray(a)?a.map(l=>n+l):[n+a]}),xZ=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],yZ=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...xZ,...yZ];function Ov(e,t,r,n){const a=Sj(e,t,!0)??r;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 c=Math.abs(l),d=a[c];return l>=0?d:typeof d=="number"?-d:typeof d=="string"&&d.startsWith("var(")?`calc(-1 * ${d})`:`-${d}`}:typeof a=="function"?a:(()=>{})}function bZ(e){return Ov(e,"spacing",8)}function Nv(e,t){return typeof t=="string"||t==null?t:e(t)}function Att(e,t){return r=>e.reduce((n,a)=>(n[a]=Nv(t,r),n),{})}function $tt(e,t,r,n){if(!t.includes(r))return null;const a=Ctt(r),l=Att(a,n),c=e[r];return g2(e,c,l)}function jke(e,t){const r=bZ(e.theme);return Object.keys(e).map(n=>$tt(e,t,n,r)).reduce(Zb,{})}function Hn(e){return jke(e,xZ)}Hn.propTypes={};Hn.filterProps=xZ;function _n(e){return jke(e,yZ)}_n.propTypes={};_n.filterProps=yZ;function Mke(e=8,t=bZ({spacing:e})){if(e.mui)return e;const r=(...n)=>(n.length===0?[1]:n).map(a=>{const l=t(a);return typeof l=="number"?`${l}px`:l}).join(" ");return r.mui=!0,r}function Ej(...e){const t=e.reduce((n,a)=>(a.filterProps.forEach(l=>{n[l]=a}),n),{}),r=n=>Object.keys(n).reduce((a,l)=>t[l]?Zb(a,t[l](n)):a,{});return r.propTypes={},r.filterProps=e.reduce((n,a)=>n.concat(a.filterProps),[]),r}function Gd(e){return typeof e!="number"?e:`${e}px solid`}function g1(e,t){return ha({prop:e,themeKey:"borders",transform:t})}const ktt=g1("border",Gd),Stt=g1("borderTop",Gd),Ett=g1("borderRight",Gd),Ltt=g1("borderBottom",Gd),Itt=g1("borderLeft",Gd),jtt=g1("borderColor"),Mtt=g1("borderTopColor"),Btt=g1("borderRightColor"),Ptt=g1("borderBottomColor"),Dtt=g1("borderLeftColor"),Ttt=g1("outline",Gd),ztt=g1("outlineColor"),Lj=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Ov(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:Nv(t,n)});return g2(e,e.borderRadius,r)}return null};Lj.propTypes={};Lj.filterProps=["borderRadius"];Ej(ktt,Stt,Ett,Ltt,Itt,jtt,Mtt,Btt,Ptt,Dtt,Lj,Ttt,ztt);const Ij=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Ov(e.theme,"spacing",8),r=n=>({gap:Nv(t,n)});return g2(e,e.gap,r)}return null};Ij.propTypes={};Ij.filterProps=["gap"];const jj=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Ov(e.theme,"spacing",8),r=n=>({columnGap:Nv(t,n)});return g2(e,e.columnGap,r)}return null};jj.propTypes={};jj.filterProps=["columnGap"];const Mj=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Ov(e.theme,"spacing",8),r=n=>({rowGap:Nv(t,n)});return g2(e,e.rowGap,r)}return null};Mj.propTypes={};Mj.filterProps=["rowGap"];const Rtt=ha({prop:"gridColumn"}),Ftt=ha({prop:"gridRow"}),Ott=ha({prop:"gridAutoFlow"}),Ntt=ha({prop:"gridAutoColumns"}),Htt=ha({prop:"gridAutoRows"}),_tt=ha({prop:"gridTemplateColumns"}),Vtt=ha({prop:"gridTemplateRows"}),Qtt=ha({prop:"gridTemplateAreas"}),Utt=ha({prop:"gridArea"});Ej(Ij,jj,Mj,Rtt,Ftt,Ott,Ntt,Htt,_tt,Vtt,Qtt,Utt);function i8(e,t){return t==="grey"?t:e}const Wtt=ha({prop:"color",themeKey:"palette",transform:i8}),Gtt=ha({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:i8}),Ytt=ha({prop:"backgroundColor",themeKey:"palette",transform:i8});Ej(Wtt,Gtt,Ytt);function nd(e){return e<=1&&e!==0?`${e*100}%`:e}const Ktt=ha({prop:"width",transform:nd}),wZ=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{const n=e.theme?.breakpoints?.values?.[r]||kj[r];return n?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:n}:{maxWidth:nd(r)}};return g2(e,e.maxWidth,t)}return null};wZ.filterProps=["maxWidth"];const qtt=ha({prop:"minWidth",transform:nd}),Ztt=ha({prop:"height",transform:nd}),Jtt=ha({prop:"maxHeight",transform:nd}),Xtt=ha({prop:"minHeight",transform:nd});ha({prop:"size",cssProperty:"width",transform:nd});ha({prop:"size",cssProperty:"height",transform:nd});const eot=ha({prop:"boxSizing"});Ej(Ktt,wZ,qtt,Ztt,Jtt,Xtt,eot);const Bj={border:{themeKey:"borders",transform:Gd},borderTop:{themeKey:"borders",transform:Gd},borderRight:{themeKey:"borders",transform:Gd},borderBottom:{themeKey:"borders",transform:Gd},borderLeft:{themeKey:"borders",transform:Gd},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Gd},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Lj},color:{themeKey:"palette",transform:i8},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:i8},backgroundColor:{themeKey:"palette",transform:i8},p:{style:_n},pt:{style:_n},pr:{style:_n},pb:{style:_n},pl:{style:_n},px:{style:_n},py:{style:_n},padding:{style:_n},paddingTop:{style:_n},paddingRight:{style:_n},paddingBottom:{style:_n},paddingLeft:{style:_n},paddingX:{style:_n},paddingY:{style:_n},paddingInline:{style:_n},paddingInlineStart:{style:_n},paddingInlineEnd:{style:_n},paddingBlock:{style:_n},paddingBlockStart:{style:_n},paddingBlockEnd:{style:_n},m:{style:Hn},mt:{style:Hn},mr:{style:Hn},mb:{style:Hn},ml:{style:Hn},mx:{style:Hn},my:{style:Hn},margin:{style:Hn},marginTop:{style:Hn},marginRight:{style:Hn},marginBottom:{style:Hn},marginLeft:{style:Hn},marginX:{style:Hn},marginY:{style:Hn},marginInline:{style:Hn},marginInlineStart:{style:Hn},marginInlineEnd:{style:Hn},marginBlock:{style:Hn},marginBlockStart:{style:Hn},marginBlockEnd:{style:Hn},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:Ij},rowGap:{style:Mj},columnGap:{style:jj},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:nd},maxWidth:{style:wZ},minWidth:{transform:nd},height:{transform:nd},maxHeight:{transform:nd},minHeight:{transform:nd},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 tot(...e){const t=e.reduce((n,a)=>n.concat(Object.keys(a)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function oot(e,t){return typeof e=="function"?e(t):e}function rot(){function e(r,n,a,l){const c={[r]:n,theme:a},d=l[r];if(!d)return{[r]:n};const{cssProperty:p=r,themeKey:u,transform:h,style:m}=d;if(n==null)return null;if(u==="typography"&&n==="inherit")return{[r]:n};const f=Sj(a,u)||{};return m?m(c):g2(c,n,x=>{let y=IE(f,h,x);return x===y&&typeof x=="string"&&(y=IE(f,h,`${r}${x==="default"?"":mr(x)}`,x)),p===!1?y:{[p]:y}})}function t(r){const{sx:n,theme:a={},nested:l}=r||{};if(!n)return null;const c=a.unstable_sxConfig??Bj;function d(p){let u=p;if(typeof p=="function")u=p(a);else if(typeof p!="object")return p;if(!u)return null;const h=ytt(a.breakpoints),m=Object.keys(h);let f=h;return Object.keys(u).forEach(x=>{const y=oot(u[x],a);if(y!=null)if(typeof y=="object")if(c[x])f=Zb(f,e(x,y,a,c));else{const b=g2({theme:a},y,w=>({[x]:w}));tot(b,y)?f[x]=t({sx:y,theme:a,nested:!0}):f=Zb(f,b)}else f=Zb(f,e(x,y,a,c))}),!l&&a.modularCssLayers?{"@layer sx":Zre(a,Xre(m,f))}:Zre(a,Xre(m,f))}return Array.isArray(n)?n.map(d):d(n)}return t}const D4=rot();D4.filterProps=["sx"];function iot(e,t){const r=this;if(r.vars){if(!r.colorSchemes?.[e]||typeof r.getColorSchemeSelector!="function")return{};let n=r.getColorSchemeSelector(e);return n==="&"?t:((n.includes("data-")||n.includes("."))&&(n=`*:where(${n.replace(/\s*&$/,"")}) &`),{[n]:t})}return r.palette.mode===e?t:{}}function vZ(e={},...t){const{breakpoints:r={},palette:n={},spacing:a,shape:l={},...c}=e,d=utt(r),p=Mke(a);let u=ml({breakpoints:d,direction:"ltr",components:{},palette:{mode:"light",...n},spacing:p,shape:{...ftt,...l}},c);return u=gtt(u),u.applyStyles=iot,u=t.reduce((h,m)=>ml(h,m),u),u.unstable_sxConfig={...Bj,...c?.unstable_sxConfig},u.unstable_sx=function(h){return D4({sx:h,theme:this})},u}function not(e){return Object.keys(e).length===0}function CZ(e=null){const t=g.useContext(mke);return!t||not(t)?e:t}const aot=vZ();function Bke(e=aot){return CZ(e)}function tie(e){const t=rg(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function Pke({styles:e,themeId:t,defaultTheme:r={}}){const n=Bke(r),a=t&&n[t]||n;let l=typeof e=="function"?e(a):e;return a.modularCssLayers&&(Array.isArray(l)?l=l.map(c=>tie(typeof c=="function"?c(a):c)):l=tie(l)),s.jsx(Eke,{styles:l})}const oie=e=>e,sot=()=>{let e=oie;return{configure(t){e=t},generate(t){return e(t)},reset(){e=oie}}},lot=sot();function Dke(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=Dke(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ko(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Dke(e))&&(n&&(n+=" "),n+=t);return n}const cot={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 vi(e,t,r="Mui"){const n=cot[t];return n?`${r}-${n}`:`${lot.generate(e)}-${t}`}function ci(e,t,r="Mui"){const n={};return t.forEach(a=>{n[a]=vi(e,a,r)}),n}function Tke(e){const{variants:t,...r}=e,n={variants:t,style:rg(r),isProcessed:!0};return n.style===r||t&&t.forEach(a=>{typeof a.style!="function"&&(a.style=rg(a.style))}),n}const dot=vZ();function bT(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function i4(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function pot(e){return e?(t,r)=>r[e]:null}function uot(e,t,r){e.theme=got(e.theme)?r:e.theme[t]||e.theme}function VS(e,t,r){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(a=>VS(e,a,r));if(Array.isArray(n?.variants)){let a;if(n.isProcessed)a=r?i4(n.style,r):n.style;else{const{variants:l,...c}=n;a=r?i4(rg(c),r):c}return zke(e,n.variants,[a],r)}return n?.isProcessed?r?i4(rg(n.style),r):n.style:r?i4(rg(n),r):n}function zke(e,t,r=[],n=void 0){let a;e:for(let l=0;l<t.length;l+=1){const c=t[l];if(typeof c.props=="function"){if(a??={...e,...e.ownerState,ownerState:e.ownerState},!c.props(a))continue}else for(const d in c.props)if(e[d]!==c.props[d]&&e.ownerState?.[d]!==c.props[d])continue e;typeof c.style=="function"?(a??={...e,...e.ownerState,ownerState:e.ownerState},r.push(n?i4(rg(c.style(a)),n):c.style(a))):r.push(n?i4(rg(c.style),n):c.style)}return r}function hot(e={}){const{themeId:t,defaultTheme:r=dot,rootShouldForwardProp:n=bT,slotShouldForwardProp:a=bT}=e;function l(c){uot(c,t,r)}return(c,d={})=>{ltt(c,I=>I.filter(L=>L!==D4));const{name:p,slot:u,skipVariantsResolver:h,skipSx:m,overridesResolver:f=pot(xot(u)),...x}=d,y=p&&p.startsWith("Mui")||u?"components":"custom",b=h!==void 0?h:u&&u!=="Root"&&u!=="root"||!1,w=m||!1;let v=bT;u==="Root"||u==="root"?v=n:u?v=a:fot(c)&&(v=void 0);const A=stt(c,{shouldForwardProp:v,label:mot(),...x}),S=I=>{if(I.__emotion_real===I)return I;if(typeof I=="function")return function(L){return VS(L,I,L.theme.modularCssLayers?y:void 0)};if(G0(I)){const L=Tke(I);return function(M){return L.variants?VS(M,L,M.theme.modularCssLayers?y:void 0):M.theme.modularCssLayers?i4(L.style,y):L.style}}return I},E=(...I)=>{const L=[],M=I.map(S),D=[];if(L.push(l),p&&f&&D.push(function(z){const N=z.theme.components?.[p]?.styleOverrides;if(!N)return null;const K={};for(const q in N)K[q]=VS(z,N[q],z.theme.modularCssLayers?"theme":void 0);return f(z,K)}),p&&!b&&D.push(function(z){const N=z.theme?.components?.[p]?.variants;return N?zke(z,N,[],z.theme.modularCssLayers?"theme":void 0):null}),w||D.push(D4),Array.isArray(M[0])){const z=M.shift(),N=new Array(L.length).fill(""),K=new Array(D.length).fill("");let q;q=[...N,...z,...K],q.raw=[...N,...z.raw,...K],L.unshift(q)}const P=[...L,...M,...D],T=A(...P);return c.muiName&&(T.muiName=c.muiName),T};return A.withConfig&&(E.withConfig=A.withConfig),E}}function mot(e,t){return void 0}function got(e){for(const t in e)return!1;return!0}function fot(e){return typeof e=="string"&&e.charCodeAt(0)>96}function xot(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function KW(e,t,r=!1){const n={...t};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const l=a;if(l==="components"||l==="slots")n[l]={...e[l],...n[l]};else if(l==="componentsProps"||l==="slotProps"){const c=e[l],d=t[l];if(!d)n[l]=c||{};else if(!c)n[l]=d;else{n[l]={...d};for(const p in c)if(Object.prototype.hasOwnProperty.call(c,p)){const u=p;n[l][u]=KW(c[u],d[u],r)}}}else l==="className"&&r&&t.className?n.className=Ko(e?.className,t?.className):l==="style"&&r&&t.style?n.style={...e?.style,...t?.style}:n[l]===void 0&&(n[l]=e[l])}return n}const xd=typeof window<"u"?g.useLayoutEffect:g.useEffect;function yot(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function AZ(e,t=0,r=1){return yot(e,t,r)}function bot(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),r?`rgb${r.length===4?"a":""}(${r.map((n,a)=>a<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function mg(e){if(e.type)return e;if(e.charAt(0)==="#")return mg(bot(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(m2(9,e));let n=e.substring(t+1,e.length-1),a;if(r==="color"){if(n=n.split(" "),a=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(a))throw new Error(m2(10,a))}else n=n.split(",");return n=n.map(l=>parseFloat(l)),{type:r,values:n,colorSpace:a}}const wot=e=>{const t=mg(e);return t.values.slice(0,3).map((r,n)=>t.type.includes("hsl")&&n!==0?`${r}%`:r).join(" ")},mb=(e,t)=>{try{return wot(e)}catch{return e}};function Pj(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.includes("rgb")?n=n.map((a,l)=>l<3?parseInt(a,10):a):t.includes("hsl")&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.includes("color")?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function Rke(e){e=mg(e);const{values:t}=e,r=t[0],n=t[1]/100,a=t[2]/100,l=n*Math.min(a,1-a),c=(u,h=(u+r/30)%12)=>a-l*Math.max(Math.min(h-3,9-h,1),-1);let d="rgb";const p=[Math.round(c(0)*255),Math.round(c(8)*255),Math.round(c(4)*255)];return e.type==="hsla"&&(d+="a",p.push(t[3])),Pj({type:d,values:p})}function qW(e){e=mg(e);let t=e.type==="hsl"||e.type==="hsla"?mg(Rke(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function vot(e,t){const r=qW(e),n=qW(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function jE(e,t){return e=mg(e),t=AZ(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Pj(e)}function N3(e,t,r){try{return jE(e,t)}catch{return e}}function Dj(e,t){if(e=mg(e),t=AZ(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Pj(e)}function Pi(e,t,r){try{return Dj(e,t)}catch{return e}}function Tj(e,t){if(e=mg(e),t=AZ(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Pj(e)}function Di(e,t,r){try{return Tj(e,t)}catch{return e}}function Cot(e,t=.15){return qW(e)>.5?Dj(e,t):Tj(e,t)}function CA(e,t,r){try{return Cot(e,t)}catch{return e}}const Fke=g.createContext(null);function $Z(){return g.useContext(Fke)}const Aot=typeof Symbol=="function"&&Symbol.for,$ot=Aot?Symbol.for("mui.nested"):"__THEME_NESTED__";function kot(e,t){return typeof t=="function"?t(e):{...e,...t}}function Sot(e){const{children:t,theme:r}=e,n=$Z(),a=g.useMemo(()=>{const l=n===null?{...r}:kot(n,r);return l!=null&&(l[$ot]=n!==null),l},[r,n]);return s.jsx(Fke.Provider,{value:a,children:t})}const Oke=g.createContext();function Eot({value:e,...t}){return s.jsx(Oke.Provider,{value:e??!0,...t})}const C9=()=>g.useContext(Oke)??!1,Nke=g.createContext(void 0);function Lot({value:e,children:t}){return s.jsx(Nke.Provider,{value:e,children:t})}function Iot(e){const{theme:t,name:r,props:n}=e;if(!t||!t.components||!t.components[r])return n;const a=t.components[r];return a.defaultProps?KW(a.defaultProps,n,t.components.mergeClassNameAndStyle):!a.styleOverrides&&!a.variants?KW(a,n,t.components.mergeClassNameAndStyle):n}function jot({props:e,name:t}){const r=g.useContext(Nke);return Iot({props:e,name:t,theme:{components:r}})}let rie=0;function Mot(e){const[t,r]=g.useState(e),n=e||t;return g.useEffect(()=>{t==null&&(rie+=1,r(`mui-${rie}`))},[t]),n}const Bot={...oJe},iie=Bot.useId;function zj(e){if(iie!==void 0){const t=iie();return e??t}return Mot(e)}function Pot(e){const t=CZ(),r=zj()||"",{modularCssLayers:n}=e;let a="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!n||t!==null?a="":typeof n=="string"?a=n.replace(/mui(?!\.)/g,a):a=`@layer ${a};`,xd(()=>{const l=document.querySelector("head");if(!l)return;const c=l.firstChild;if(a){if(c&&c.hasAttribute?.("data-mui-layer-order")&&c.getAttribute("data-mui-layer-order")===r)return;const d=document.createElement("style");d.setAttribute("data-mui-layer-order",r),d.textContent=a,l.prepend(d)}else l.querySelector(`style[data-mui-layer-order="${r}"]`)?.remove()},[a,r]),a?s.jsx(Pke,{styles:a}):null}const nie={};function aie(e,t,r,n=!1){return g.useMemo(()=>{const a=e&&t[e]||t;if(typeof r=="function"){const l=r(a),c=e?{...t,[e]:l}:l;return n?()=>c:c}return e?{...t,[e]:r}:{...t,...r}},[e,t,r,n])}function Hke(e){const{children:t,theme:r,themeId:n}=e,a=CZ(nie),l=$Z()||nie,c=aie(n,a,r),d=aie(n,l,r,!0),p=(n?c[n]:c).direction==="rtl",u=Pot(c);return s.jsx(Sot,{theme:d,children:s.jsx(mke.Provider,{value:c,children:s.jsx(Eot,{value:p,children:s.jsxs(Lot,{value:n?c[n].components:c.components,children:[u,t]})})})})}const sie={theme:void 0};function Dot(e){let t,r;return function(n){let a=t;return(a===void 0||n.theme!==r)&&(sie.theme=n.theme,a=Tke(e(sie)),t=a,r=n.theme),a}}const kZ="mode",SZ="color-scheme",Tot="data-color-scheme";function zot(e){const{defaultMode:t="system",defaultLightColorScheme:r="light",defaultDarkColorScheme:n="dark",modeStorageKey:a=kZ,colorSchemeStorageKey:l=SZ,attribute:c=Tot,colorSchemeNode:d="document.documentElement",nonce:p}=e||{};let u="",h=c;if(c==="class"&&(h=".%s"),c==="data"&&(h="[data-%s]"),h.startsWith(".")){const f=h.substring(1);u+=`${d}.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-CaJqLeqH.js","assets/sentry-C55DzYyA.js","assets/empty-itfoynxx.js","assets/index-CF6KfbAT.js","assets/index-CZ-7ZFkm.js","assets/zeni-epic-state-B-8YrXU1.js","assets/core-BLUwF2Ga.js","assets/utils-DEG-3n18.js","assets/recharts-BBlvhOR8.js","assets/url-C-fDE88q.js","assets/index-B-IAe6yw.js","assets/index-DZqDnnOK.js","assets/url-DH9-bXDQ.js","assets/index-B84g_66Z.js","assets/ScreenRoutes-CUdw31xk.js","assets/liveblocks-p25-TTyD.js","assets/analyticsHelper-B-ah4cGP.js","assets/mui-P78yhQU-.js","assets/SignInScreen-iQrcvFVn.js","assets/analytics-BB2Z07-E.js","assets/lottie-q5H7mx0-.js","assets/lexical-BuP3IVgU.js"])))=>i.map(i=>d[i]);
2
+ import{a as g,R as $,e as oJe,b as P4,p as R0,r as Tc,g as Xq,d as vre,f as rJe,s as Cre,w as iJe,i as nJe,S as aJe,j as sJe,k as lJe,l as cJe,m as dJe}from"./sentry-C55DzYyA.js";import{j as Co,_ as B$e,a as Cd,u as P$e,T as pJe,C as uJe,b as hJe,c as hj,d as mj,e as mJe,f as gJe,g as D$e,h as fJe,i as xJe,L as yJe,k as Are,l as bJe,m as wJe,n as vJe,P as CJe,o as AJe,p as $Je,q as T$e,r as kJe,s as SJe,I as $re,t as EJe,v as LJe,w as IJe,x as jJe,y as MJe,z as BJe,A as z$e,B as PJe,D as DJe,E as TJe}from"./liveblocks-p25-TTyD.js";import{f as R$e,R as o4,r as Fn,P as Dn,u as gj,g as yh,h as zJe,i as eZ,j as RJe,k as FJe,l as hT,N as OJe,m as NJe,n as HJe,B as _Je}from"./core-BLUwF2Ga.js";import{H as AE,ba as r4,bb as VJe,bc as kre,bd as X4,be as xr,bf as F$e,bg as Wr,bh as fj,bi as QJe,bj as Dh,bk as UJe,bl as WJe,bm as S8,bn as hg,bo as b9,bp as O$e,bq as GJe,br as Z1,bs as N$e,bt as YJe,bu as tZ,bv as H$e,bw as ln,bx as E8,by as Gu,bz as Sre,bA as KJe,bB as qJe,bC as _$e,bD as OW,bE as ZJe,bF as JJe,bG as XJe,bH as eXe,bI as oZ,bJ as V$e,bK as tXe,bL as qb,bM as oXe,bN as Q$e,bO as NW,bP as Ere,bQ as Lre,bR as Ire,bS as zl,bT as rZ,bU as U$e,bV as W$e,bW as iZ,bX as w9,bY as xj,bZ as nZ,b_ as aZ,b$ as sZ,c0 as lZ,c1 as rXe,c2 as yj,c3 as lp,c4 as cp,c5 as $E,c6 as G$e,c7 as Y$e,c8 as iXe,c9 as cZ,ca as dZ,cb as nXe,cc as aXe,cd as tp,ce as Dv,cf as Tv,cg as sXe,ch as lXe,ci as cXe,cj as dXe,ck as pXe,cl as uXe,cm as hXe,cn as bA,co as K$e,cp as q$e,cq as mXe,cr as gXe,cs as Z$e,ct as J$e,cu as fXe,cv as xXe,cw as yXe,cx as X$e,cy as eke,cz as bXe,cA as wXe,cB as tke,cC as oke,cD as vXe,cE as jre,cF as CXe,cG as AXe,cH as Iw,cI as $Xe,cJ as rke,cK as kXe,cL as ike,cM as SXe,cN as Mre,cO as EXe,cP as nke,cQ as ake,cR as ske,cS as lke,cT as cke,cU as LXe,cV as dke,cW as IXe,cX as jXe,cY as MXe,cZ as pke,c_ as HW,c$ as BXe,d0 as uke,d1 as hke,d2 as PXe,d3 as DXe,d4 as TXe,d5 as zXe,d6 as RXe,d7 as FXe,d8 as OXe,d9 as NXe,v as HXe,da as bj,db as _W,dc as VW,dd as _Xe,de as VXe,df as QXe,dg as UXe,dh as WXe,di as GXe,dj as YXe,dk as KXe,dl as qXe,dm as ZXe,dn as Bre,dp as JXe,dq as XXe,dr as eet,ds as tet,dt as oet}from"./zeni-epic-state-B-8YrXU1.js";import{T as mke,j as Uo,n as i,c as pe,k as _t,G as zv,C as gke,u as ret,a as iet}from"./mui-P78yhQU-.js";import{r as net,m as Yu}from"./analytics-BB2Z07-E.js";import{L as QW}from"./lottie-q5H7mx0-.js";import{r as Ta}from"./lexical-BuP3IVgU.js";import{E as en,c as wj,P as aet,R as UW,F as kE,X as gd,Y as fd,G as k2,H as SE,I as vj,J as S2,K as fke,L as set,M as cet,N as e5,O as pZ,Q as uZ,S as Rv,U as det}from"./recharts-BBlvhOR8.js";import{r as pet}from"./utils-DEG-3n18.js";(function(){try{var e=typeof window<"u"?window:typeof P4<"u"?P4:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0e6cd8a0-d033-4d29-9946-51280dc4a144",e._sentryDebugIdIdentifier="sentry-dbid-0e6cd8a0-d033-4d29-9946-51280dc4a144")}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"]'))n(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function r(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 n(a){if(a.ep)return;a.ep=!0;const l=r(a);fetch(a.href,l)}})();var wA={},Pre;function uet(){if(Pre)return wA;Pre=1;var e=R$e();return wA.createRoot=e.createRoot,wA.hydrateRoot=e.hydrateRoot,wA}var het=uet(),wc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof P4<"u"?P4:typeof self<"u"?self:{};function Vr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dre={exports:{}},yx={},Tre;function met(){if(Tre)return yx;Tre=1;var e=$,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=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 c(d,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)n.call(p,h)&&!l.hasOwnProperty(h)&&(m[h]=p[h]);if(d&&d.defaultProps)for(h in p=d.defaultProps,p)m[h]===void 0&&(m[h]=p[h]);return{$$typeof:t,type:d,key:f,ref:x,props:m,_owner:a.current}}return yx.Fragment=r,yx.jsx=c,yx.jsxs=c,yx}var zre;function xke(){return zre||(zre=1,Dre.exports=met()),Dre.exports}var s=xke();const get=g.createContext(null),mT={didCatch:!1,error:null};let fet=class extends g.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=mT}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var t,r,n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];(t=(r=this.props).onReset)===null||t===void 0||t.call(r,{args:a,reason:"imperative-api"}),this.setState(mT)}}componentDidCatch(e,t){var r,n;(r=(n=this.props).onError)===null||r===void 0||r.call(n,e,t)}componentDidUpdate(e,t){const{didCatch:r}=this.state,{resetKeys:n}=this.props;if(r&&t.error!==null&&xet(e.resetKeys,n)){var a,l;(a=(l=this.props).onReset)===null||a===void 0||a.call(l,{next:n,prev:e.resetKeys,reason:"keys"}),this.setState(mT)}}render(){const{children:e,fallbackRender:t,FallbackComponent:r,fallback:n}=this.props,{didCatch:a,error:l}=this.state;let c=e;if(a){const d={error:l,resetErrorBoundary:this.resetErrorBoundary};if(typeof t=="function")c=t(d);else if(r)c=g.createElement(r,d);else if(n!==void 0)c=n;else throw l}return g.createElement(get.Provider,{value:{didCatch:a,error:l,resetErrorBoundary:this.resetErrorBoundary}},c)}};function xet(){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((r,n)=>!Object.is(r,t[n]))}var WW={exports:{}},yet=WW.exports,Rre;function bet(){return Rre||(Rre=1,(function(e){(function(t,r){e.exports?e.exports=r():t.numeral=r()})(yet,function(){var t,r,n="2.0.6",a={},l={},c={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},d={currentLocale:c.currentLocale,zeroFormat:c.zeroFormat,nullFormat:c.nullFormat,defaultFormat:c.defaultFormat,scalePercentBy100:c.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||r.isNaN(u))h=null;else if(typeof u=="string")if(d.zeroFormat&&u===d.zeroFormat)h=0;else if(d.nullFormat&&u===d.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=n,t.isNumeral=function(u){return u instanceof p},t._=r={numberToFormat:function(u,h,m){var f=l[t.options.currentLocale],x=!1,y=!1,b=0,w="",v=1e12,A=1e9,S=1e6,E=1e3,I="",L=!1,M,D,P,T,z,N,K;if(u=u||0,D=Math.abs(u),t._.includes(h,"(")?(x=!0,h=h.replace(/[\(|\)]/g,"")):(t._.includes(h,"+")||t._.includes(h,"-"))&&(z=t._.includes(h,"+")?h.indexOf("+"):u<0?h.indexOf("-"):-1,h=h.replace(/[\+|\-]/g,"")),t._.includes(h,"a")&&(M=h.match(/a(k|m|b|t)?/),M=M?M[1]:!1,t._.includes(h," a")&&(w=" "),h=h.replace(new RegExp(w+"a[kmbt]?"),""),D>=v&&!M||M==="t"?(w+=f.abbreviations.trillion,u=u/v):D<v&&D>=A&&!M||M==="b"?(w+=f.abbreviations.billion,u=u/A):D<A&&D>=S&&!M||M==="m"?(w+=f.abbreviations.million,u=u/S):(D<S&&D>=E&&!M||M==="k")&&(w+=f.abbreviations.thousand,u=u/E)),t._.includes(h,"[.]")&&(y=!0,h=h.replace("[.]",".")),P=u.toString().split(".")[0],T=h.split(".")[1],N=h.indexOf(","),b=(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),P=I.split(".")[0],t._.includes(I,".")?I=f.delimiters.decimal+I.split(".")[1]:I="",y&&Number(I.slice(1))===0&&(I="")):P=t._.toFixed(u,0,m),w&&!M&&Number(P)>=1e3&&w!==f.abbreviations.trillion)switch(P=String(Number(P)/1e3),w){case f.abbreviations.thousand:w=f.abbreviations.million;break;case f.abbreviations.million:w=f.abbreviations.billion;break;case f.abbreviations.billion:w=f.abbreviations.trillion;break}if(t._.includes(P,"-")&&(P=P.slice(1),L=!0),P.length<b)for(var q=b-P.length;q>0;q--)P="0"+P;return N>-1&&(P=P.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),h.indexOf(".")===0&&(P=""),K=P+I+(w||""),x?K=(x&&L?"(":"")+K+(x&&L?")":""):z>=0?K=z===0?(L?"-":"+")+K:K+(L?"-":"+"):L&&(K="-"+K),K},stringToNumber:function(u){var h=l[d.currentLocale],m=u,f={thousand:3,million:6,billion:9,trillion:12},x,y,b;if(d.zeroFormat&&u===d.zeroFormat)y=0;else if(d.nullFormat&&u===d.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(b=new RegExp("[^a-zA-Z]"+h.abbreviations[x]+"(?:\\)|(\\"+h.currency.symbol+")?(?:\\))?)?$"),m.match(b)){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=r.multiplier(m);return h>f?h:f},1)},toFixed:function(u,h,m,f){var x=u.toString().split("."),y=h-(f||0),b,w,v,A;return x.length===2?b=Math.min(Math.max(x[1].length,y),h):b=y,v=Math.pow(10,b),A=(m(u+"e+"+b)/v).toFixed(b),f>h-b&&(w=new RegExp("\\.?0{1,"+(f-(h-b))+"}$"),A=A.replace(w,"")),A}},t.options=d,t.formats=a,t.locales=l,t.locale=function(u){return u&&(d.currentLocale=u.toLowerCase()),d.currentLocale},t.localeData=function(u){if(!u)return l[d.currentLocale];if(u=u.toLowerCase(),!l[u])throw new Error("Unknown locale : "+u);return l[u]},t.reset=function(){for(var u in c)d[u]=c[u]},t.zeroFormat=function(u){d.zeroFormat=typeof u=="string"?u:null},t.nullFormat=function(u){d.nullFormat=typeof u=="string"?u:null},t.defaultFormat=function(u){d.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,b,w,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,b=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]!==b.thousand&&A[0]!==b.million&&A[0]!==b.billion&&A[0]!==b.trillion))?!1:(w=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(w):y[0].length===1?!!y[0].match(/^\d+$/)&&!y[0].match(w)&&!!y[1].match(/^\d+$/):!!y[0].match(/^\d+.*\d$/)&&!y[0].match(w)&&!!y[1].match(/^\d+$/)))},t.fn=p.prototype={clone:function(){return t(this)},format:function(u,h){var m=this._value,f=u||d.defaultFormat,x,y,b;if(h=h||Math.round,m===0&&d.zeroFormat!==null)y=d.zeroFormat;else if(m===null&&d.nullFormat!==null)y=d.nullFormat;else{for(x in a)if(f.match(a[x].regexps.format)){b=a[x].format;break}b=b||t._.numberToFormat,y=b(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=r.correctionFactor.call(null,this._value,u);function m(f,x,y,b){return f+Math.round(h*x)}return this._value=r.reduce([this._value,u],m,0)/h,this},subtract:function(u){var h=r.correctionFactor.call(null,this._value,u);function m(f,x,y,b){return f-Math.round(h*x)}return this._value=r.reduce([u],m,Math.round(this._value*h))/h,this},multiply:function(u){function h(m,f,x,y){var b=r.correctionFactor(m,f);return Math.round(m*b)*Math.round(f*b)/Math.round(b*b)}return this._value=r.reduce([this._value,u],h,1),this},divide:function(u){function h(m,f,x,y){var b=r.correctionFactor(m,f);return Math.round(m*b)/Math.round(f*b)}return this._value=r.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,b){var w,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 w=t._.numberToFormat(x,y,b),w+A},unformat:function(x){var y=t._.stringToNumber(x),b,w;if(y){for(b=u.suffixes.length-1;b>=0;b--){if(t._.includes(x,u.suffixes[b])){w=Math.pow(u.base,b);break}if(t._.includes(x,h.suffixes[b])){w=Math.pow(h.base,b);break}}y*=w||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,b,w;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),w=0;w<x.before.length;w++)switch(b=x.before[w],b){case"$":y=t._.insert(y,f.currency.symbol,w);break;case" ":y=t._.insert(y," ",w+f.currency.symbol.length-1);break}for(w=x.after.length-1;w>=0;w--)switch(b=x.after[w],b){case"$":y=w===x.after.length-1?y+f.currency.symbol:t._.insert(y,f.currency.symbol,-(x.after.length-(1+w)));break;case" ":y=w===x.after.length-1?y+" ":t._.insert(y," ",-(x.after.length-(1+w)+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,b,w,v){var A=t._.correctionFactor(y,b),S=y*A*(b*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})})(WW)),WW.exports}var wet=bet();const ap=Vr(wet);function m2(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(n=>r.searchParams.append("args[]",n)),`Minified MUI error #${e}; visit ${r} for the full message.`}const c2="$$material";function vet(e){for(var t=0,r,n=0,a=e.length;a>=4;++n,a-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&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 Cet={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 Aet(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var $et=/[A-Z]|^ms/g,ket=/_EMO_([^_]+?)_([^]*?)_EMO_/g,yke=function(e){return e.charCodeAt(1)===45},Fre=function(e){return e!=null&&typeof e!="boolean"},gT=Aet(function(e){return yke(e)?e:e.replace($et,"-$&").toLowerCase()}),Ore=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(ket,function(r,n,a){return Qm={name:n,styles:a,next:Qm},n})}return Cet[e]!==1&&!yke(e)&&typeof t=="number"&&t!==0?t+"px":t};function EE(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var a=r;if(a.anim===1)return Qm={name:a.name,styles:a.styles,next:Qm},a.name;var l=r;if(l.styles!==void 0){var c=l.next;if(c!==void 0)for(;c!==void 0;)Qm={name:c.name,styles:c.styles,next:Qm},c=c.next;var d=l.styles+";";return d}return Eet(e,t,r)}}var p=r;return p}function Eet(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a<r.length;a++)n+=EE(e,t,r[a])+";";else for(var l in r){var c=r[l];if(typeof c!="object"){var d=c;Fre(d)&&(n+=gT(l)+":"+Ore(l,d)+";")}else if(Array.isArray(c)&&typeof c[0]=="string"&&t==null)for(var p=0;p<c.length;p++)Fre(c[p])&&(n+=gT(l)+":"+Ore(l,c[p])+";");else{var u=EE(e,t,c);switch(l){case"animation":case"animationName":{n+=gT(l)+":"+u+";";break}default:n+=l+"{"+u+"}"}}}return n}var Nre=/label:\s*([^\s;{]+)\s*(;|$)/g,Qm;function Let(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,a="";Qm=void 0;var l=e[0];if(l==null||l.raw===void 0)n=!1,a+=EE(r,t,l);else{var c=l;a+=c[0]}for(var d=1;d<e.length;d++)if(a+=EE(r,t,e[d]),n){var p=l;a+=p[d]}Nre.lastIndex=0;for(var u="",h;(h=Nre.exec(a))!==null;)u+="-"+h[1];var m=vet(a)+u;return{name:m,styles:a,next:Qm}}var fT={exports:{}},xT,Hre;function Iet(){if(Hre)return xT;Hre=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xT=e,xT}var yT,_re;function jet(){if(_re)return yT;_re=1;var e=Iet();function t(){}function r(){}return r.resetWarningCache=t,yT=function(){function n(c,d,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}}n.isRequired=n;function a(){return n}var l={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:a,element:n,elementType:n,instanceOf:a,node:n,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:t};return l.PropTypes=l,l},yT}var Vre;function hZ(){return Vre||(Vre=1,fT.exports=jet()()),fT.exports}var Met=hZ();const Nt=Vr(Met);function Bet(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 Pet(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 Det=(function(){function e(r){var n=this;this._insertTag=function(a){var l;n.tags.length===0?n.insertionPoint?l=n.insertionPoint.nextSibling:n.prepend?l=n.container.firstChild:l=n.before:l=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(a,l),n.tags.push(a)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Pet(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var a=Bet(n);try{a.insertRule(r,a.cssRules.length)}catch{}}else n.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var n;return(n=r.parentNode)==null?void 0:n.removeChild(r)}),this.tags=[],this.ctr=0},e})(),ol="-ms-",LE="-moz-",ki="-webkit-",bke="comm",mZ="rule",gZ="decl",Tet="@import",wke="@keyframes",zet="@layer",Ret=Math.abs,Cj=String.fromCharCode,Fet=Object.assign;function Oet(e,t){return zs(e,0)^45?(((t<<2^zs(e,0))<<2^zs(e,1))<<2^zs(e,2))<<2^zs(e,3):0}function vke(e){return e.trim()}function Net(e,t){return(e=t.exec(e))?e[0]:e}function Si(e,t,r){return e.replace(t,r)}function GW(e,t){return e.indexOf(t)}function zs(e,t){return e.charCodeAt(t)|0}function jw(e,t,r){return e.slice(t,r)}function Ku(e){return e.length}function fZ(e){return e.length}function vA(e,t){return t.push(e),e}function Het(e,t){return e.map(t).join("")}var Aj=1,L8=1,Cke=0,jc=0,Ia=0,v9="";function $j(e,t,r,n,a,l,c){return{value:e,root:t,parent:r,type:n,props:a,children:l,line:Aj,column:L8,length:c,return:""}}function bx(e,t){return Fet($j("",null,null,"",null,null,0),e,{length:-e.length},t)}function _et(){return Ia}function Vet(){return Ia=jc>0?zs(v9,--jc):0,L8--,Ia===10&&(L8=1,Aj--),Ia}function ud(){return Ia=jc<Cke?zs(v9,jc++):0,L8++,Ia===10&&(L8=1,Aj++),Ia}function kh(){return zs(v9,jc)}function NS(){return jc}function Fv(e,t){return jw(v9,e,t)}function Mw(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 Ake(e){return Aj=L8=1,Cke=Ku(v9=e),jc=0,[]}function $ke(e){return v9="",e}function HS(e){return vke(Fv(jc-1,YW(e===91?e+2:e===40?e+1:e)))}function Qet(e){for(;(Ia=kh())&&Ia<33;)ud();return Mw(e)>2||Mw(Ia)>3?"":" "}function Uet(e,t){for(;--t&&ud()&&!(Ia<48||Ia>102||Ia>57&&Ia<65||Ia>70&&Ia<97););return Fv(e,NS()+(t<6&&kh()==32&&ud()==32))}function YW(e){for(;ud();)switch(Ia){case e:return jc;case 34:case 39:e!==34&&e!==39&&YW(Ia);break;case 40:e===41&&YW(e);break;case 92:ud();break}return jc}function Wet(e,t){for(;ud()&&e+Ia!==57&&!(e+Ia===84&&kh()===47););return"/*"+Fv(t,jc-1)+"*"+Cj(e===47?e:ud())}function Get(e){for(;!Mw(kh());)ud();return Fv(e,jc)}function Yet(e){return $ke(_S("",null,null,null,[""],e=Ake(e),0,[0],e))}function _S(e,t,r,n,a,l,c,d,p){for(var u=0,h=0,m=c,f=0,x=0,y=0,b=1,w=1,v=1,A=0,S="",E=a,I=l,L=n,M=S;w;)switch(y=A,A=ud()){case 40:if(y!=108&&zs(M,m-1)==58){GW(M+=Si(HS(A),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:M+=HS(A);break;case 9:case 10:case 13:case 32:M+=Qet(y);break;case 92:M+=Uet(NS()-1,7);continue;case 47:switch(kh()){case 42:case 47:vA(Ket(Wet(ud(),NS()),t,r),p);break;default:M+="/"}break;case 123*b:d[u++]=Ku(M)*v;case 125*b:case 59:case 0:switch(A){case 0:case 125:w=0;case 59+h:v==-1&&(M=Si(M,/\f/g,"")),x>0&&Ku(M)-m&&vA(x>32?Ure(M+";",n,r,m-1):Ure(Si(M," ","")+";",n,r,m-2),p);break;case 59:M+=";";default:if(vA(L=Qre(M,t,r,u,h,a,d,S,E=[],I=[],m),l),A===123)if(h===0)_S(M,t,L,L,E,l,m,d,I);else switch(f===99&&zs(M,3)===110?100:f){case 100:case 108:case 109:case 115:_S(e,L,L,n&&vA(Qre(e,L,L,0,0,a,d,S,a,E=[],m),I),a,I,m,d,n?E:I);break;default:_S(M,L,L,L,[""],I,0,d,I)}}u=h=x=0,b=v=1,S=M="",m=c;break;case 58:m=1+Ku(M),x=y;default:if(b<1){if(A==123)--b;else if(A==125&&b++==0&&Vet()==125)continue}switch(M+=Cj(A),A*b){case 38:v=h>0?1:(M+="\f",-1);break;case 44:d[u++]=(Ku(M)-1)*v,v=1;break;case 64:kh()===45&&(M+=HS(ud())),f=kh(),h=m=Ku(S=M+=Get(NS())),A++;break;case 45:y===45&&Ku(M)==2&&(b=0)}}return l}function Qre(e,t,r,n,a,l,c,d,p,u,h){for(var m=a-1,f=a===0?l:[""],x=fZ(f),y=0,b=0,w=0;y<n;++y)for(var v=0,A=jw(e,m+1,m=Ret(b=c[y])),S=e;v<x;++v)(S=vke(b>0?f[v]+" "+A:Si(A,/&\f/g,f[v])))&&(p[w++]=S);return $j(e,t,r,a===0?mZ:d,p,u,h)}function Ket(e,t,r){return $j(e,t,r,bke,Cj(_et()),jw(e,2,-2),0)}function Ure(e,t,r,n){return $j(e,t,r,gZ,jw(e,0,n),jw(e,n+1,-1),n)}function r8(e,t){for(var r="",n=fZ(e),a=0;a<n;a++)r+=t(e[a],a,e,t)||"";return r}function qet(e,t,r,n){switch(e.type){case zet:if(e.children.length)break;case Tet:case gZ:return e.return=e.return||e.value;case bke:return"";case wke:return e.return=e.value+"{"+r8(e.children,n)+"}";case mZ:e.value=e.props.join(",")}return Ku(r=r8(e.children,n))?e.return=e.value+"{"+r+"}":""}function Zet(e){var t=fZ(e);return function(r,n,a,l){for(var c="",d=0;d<t;d++)c+=e[d](r,n,a,l)||"";return c}}function Jet(e){return function(t){t.root||(t=t.return)&&e(t)}}var Xet=function(e,t,r){for(var n=0,a=0;n=a,a=kh(),n===38&&a===12&&(t[r]=1),!Mw(a);)ud();return Fv(e,jc)},ett=function(e,t){var r=-1,n=44;do switch(Mw(n)){case 0:n===38&&kh()===12&&(t[r]=1),e[r]+=Xet(jc-1,t,r);break;case 2:e[r]+=HS(n);break;case 4:if(n===44){e[++r]=kh()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Cj(n)}while(n=ud());return e},ttt=function(e,t){return $ke(ett(Ake(e),t))},Wre=new WeakMap,ott=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!Wre.get(r))&&!n){Wre.set(e,!0);for(var a=[],l=ttt(t,a),c=r.props,d=0,p=0;d<l.length;d++)for(var u=0;u<c.length;u++,p++)e.props[p]=a[d]?l[d].replace(/&\f/g,c[u]):c[u]+" "+l[d]}}},rtt=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function kke(e,t){switch(Oet(e,t)){case 5103:return ki+"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 ki+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ki+e+LE+e+ol+e+e;case 6828:case 4268:return ki+e+ol+e+e;case 6165:return ki+e+ol+"flex-"+e+e;case 5187:return ki+e+Si(e,/(\w+).+(:[^]+)/,ki+"box-$1$2"+ol+"flex-$1$2")+e;case 5443:return ki+e+ol+"flex-item-"+Si(e,/flex-|-self/,"")+e;case 4675:return ki+e+ol+"flex-line-pack"+Si(e,/align-content|flex-|-self/,"")+e;case 5548:return ki+e+ol+Si(e,"shrink","negative")+e;case 5292:return ki+e+ol+Si(e,"basis","preferred-size")+e;case 6060:return ki+"box-"+Si(e,"-grow","")+ki+e+ol+Si(e,"grow","positive")+e;case 4554:return ki+Si(e,/([^-])(transform)/g,"$1"+ki+"$2")+e;case 6187:return Si(Si(Si(e,/(zoom-|grab)/,ki+"$1"),/(image-set)/,ki+"$1"),e,"")+e;case 5495:case 3959:return Si(e,/(image-set\([^]*)/,ki+"$1$`$1");case 4968:return Si(Si(e,/(.+:)(flex-)?(.*)/,ki+"box-pack:$3"+ol+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ki+e+e;case 4095:case 3583:case 4068:case 2532:return Si(e,/(.+)-inline(.+)/,ki+"$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(Ku(e)-1-t>6)switch(zs(e,t+1)){case 109:if(zs(e,t+4)!==45)break;case 102:return Si(e,/(.+:)(.+)-([^]+)/,"$1"+ki+"$2-$3$1"+LE+(zs(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~GW(e,"stretch")?kke(Si(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(zs(e,t+1)!==115)break;case 6444:switch(zs(e,Ku(e)-3-(~GW(e,"!important")&&10))){case 107:return Si(e,":",":"+ki)+e;case 101:return Si(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ki+(zs(e,14)===45?"inline-":"")+"box$3$1"+ki+"$2$3$1"+ol+"$2box$3")+e}break;case 5936:switch(zs(e,t+11)){case 114:return ki+e+ol+Si(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ki+e+ol+Si(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ki+e+ol+Si(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ki+e+ol+e+e}return e}var itt=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case gZ:e.return=kke(e.value,e.length);break;case wke:return r8([bx(e,{value:Si(e.value,"@","@"+ki)})],n);case mZ:if(e.length)return Het(e.props,function(a){switch(Net(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return r8([bx(e,{props:[Si(a,/:(read-\w+)/,":"+LE+"$1")]})],n);case"::placeholder":return r8([bx(e,{props:[Si(a,/:(plac\w+)/,":"+ki+"input-$1")]}),bx(e,{props:[Si(a,/:(plac\w+)/,":"+LE+"$1")]}),bx(e,{props:[Si(a,/:(plac\w+)/,ol+"input-$1")]})],n)}return""})}},ntt=[itt],Ske=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var b=y.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var n=e.stylisPlugins||ntt,a={},l,c=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(y){for(var b=y.getAttribute("data-emotion").split(" "),w=1;w<b.length;w++)a[b[w]]=!0;c.push(y)});var d,p=[ott,rtt];{var u,h=[qet,Jet(function(y){u.insert(y)})],m=Zet(p.concat(n,h)),f=function(y){return r8(Yet(y),m)};d=function(y,b,w,v){u=w,f(y?y+"{"+b.styles+"}":b.styles),v&&(x.inserted[b.name]=!0)}}var x={key:t,sheet:new Det({key:t,container:l,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:d};return x.sheet.hydrate(c),x};function att(e){return e==null||Object.keys(e).length===0}function Eke(e){const{styles:t,defaultTheme:r={}}=e,n=typeof t=="function"?a=>t(att(a)?r:a):t;return s.jsx(zv,{styles:n})}function stt(e,t){return i(e,t)}function ltt(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Gre=[];function rg(e){return Gre[0]=e,Let(Gre)}var Yre={exports:{}},Qi={},Kre;function ctt(){if(Kre)return Qi;Kre=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=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(b){if(typeof b=="object"&&b!==null){var w=b.$$typeof;switch(w){case e:switch(b=b.type,b){case r:case a:case n:case p:case u:case f:return b;default:switch(b=b&&b.$$typeof,b){case c:case d:case m:case h:return b;case l:return b;default:return w}}case t:return w}}}return Qi.ContextConsumer=l,Qi.ContextProvider=c,Qi.Element=e,Qi.ForwardRef=d,Qi.Fragment=r,Qi.Lazy=m,Qi.Memo=h,Qi.Portal=t,Qi.Profiler=a,Qi.StrictMode=n,Qi.Suspense=p,Qi.SuspenseList=u,Qi.isContextConsumer=function(b){return y(b)===l},Qi.isContextProvider=function(b){return y(b)===c},Qi.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Qi.isForwardRef=function(b){return y(b)===d},Qi.isFragment=function(b){return y(b)===r},Qi.isLazy=function(b){return y(b)===m},Qi.isMemo=function(b){return y(b)===h},Qi.isPortal=function(b){return y(b)===t},Qi.isProfiler=function(b){return y(b)===a},Qi.isStrictMode=function(b){return y(b)===n},Qi.isSuspense=function(b){return y(b)===p},Qi.isSuspenseList=function(b){return y(b)===u},Qi.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===r||b===a||b===n||b===p||b===u||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===h||b.$$typeof===c||b.$$typeof===l||b.$$typeof===d||b.$$typeof===x||b.getModuleId!==void 0)},Qi.typeOf=y,Qi}var qre;function dtt(){return qre||(qre=1,Yre.exports=ctt()),Yre.exports}var Lke=dtt();function G0(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 Ike(e){if(g.isValidElement(e)||Lke.isValidElementType(e)||!G0(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=Ike(e[r])}),t}function ml(e,t,r={clone:!0}){const n=r.clone?{...e}:e;return G0(e)&&G0(t)&&Object.keys(t).forEach(a=>{g.isValidElement(t[a])||Lke.isValidElementType(t[a])?n[a]=t[a]:G0(t[a])&&Object.prototype.hasOwnProperty.call(e,a)&&G0(e[a])?n[a]=ml(e[a],t[a],r):r.clone?n[a]=G0(t[a])?Ike(t[a]):t[a]:n[a]=t[a]}),n}const ptt=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>({...r,[n.key]:n.val}),{})};function utt(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5,...a}=e,l=ptt(t),c=Object.keys(l);function d(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r})`}function p(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-n/100}${r})`}function u(f,x){const y=c.indexOf(x);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r}) and (max-width:${(y!==-1&&typeof t[c[y]]=="number"?t[c[y]]:x)-n/100}${r})`}function h(f){return c.indexOf(f)+1<c.length?u(f,c[c.indexOf(f)+1]):d(f)}function m(f){const x=c.indexOf(f);return x===0?d(c[1]):x===c.length-1?p(c[x]):u(f,c[c.indexOf(f)+1]).replace("@media","@media not all and")}return{keys:c,values:l,up:d,down:p,between:u,only:h,not:m,unit:r,...a}}function Zre(e,t){if(!e.containerQueries)return t;const r=Object.keys(t).filter(n=>n.startsWith("@container")).sort((n,a)=>{const l=/min-width:\s*([0-9.]+)/;return+(n.match(l)?.[1]||0)-+(a.match(l)?.[1]||0)});return r.length?r.reduce((n,a)=>{const l=t[a];return delete n[a],n[a]=l,n},{...t}):t}function htt(e,t){return t==="@"||t.startsWith("@")&&(e.some(r=>t.startsWith(`@${r}`))||!!t.match(/^@\d/))}function mtt(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r)return null;const[,n,a]=r,l=Number.isNaN(+n)?n||0:+n;return e.containerQueries(a).up(l)}function gtt(e){const t=(l,c)=>l.replace("@media",c?`@container ${c}`:"@container");function r(l,c){l.up=(...d)=>t(e.breakpoints.up(...d),c),l.down=(...d)=>t(e.breakpoints.down(...d),c),l.between=(...d)=>t(e.breakpoints.between(...d),c),l.only=(...d)=>t(e.breakpoints.only(...d),c),l.not=(...d)=>{const p=t(e.breakpoints.not(...d),c);return p.includes("not all and")?p.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):p}}const n={},a=l=>(r(n,l),n);return r(a),{...e,containerQueries:a}}const ftt={borderRadius:4};function Zb(e,t){return t?ml(e,t,{clone:!1}):e}const kj={xs:0,sm:600,md:900,lg:1200,xl:1536},Jre={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${kj[e]}px)`},xtt={containerQueries:e=>({up:t=>{let r=typeof t=="number"?t:kj[t]||t;return typeof r=="number"&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function g2(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const a=n.breakpoints||Jre;return t.reduce((l,c,d)=>(l[a.up(a.keys[d])]=r(t[d]),l),{})}if(typeof t=="object"){const a=n.breakpoints||Jre;return Object.keys(t).reduce((l,c)=>{if(htt(a.keys,c)){const d=mtt(n.containerQueries?n:xtt,c);d&&(l[d]=r(t[c],c))}else if(Object.keys(a.values||kj).includes(c)){const d=a.up(c);l[d]=r(t[c],c)}else{const d=c;l[d]=t[d]}return l},{})}return r(t)}function ytt(e={}){return e.keys?.reduce((t,r)=>{const n=e.up(r);return t[n]={},t},{})||{}}function Xre(e,t){return e.reduce((r,n)=>{const a=r[n];return(!a||Object.keys(a).length===0)&&delete r[n],r},t)}function mr(e){if(typeof e!="string")throw new Error(m2(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Sj(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((a,l)=>a&&a[l]?a[l]:null,e);if(n!=null)return n}return t.split(".").reduce((n,a)=>n&&n[a]!=null?n[a]:null,e)}function IE(e,t,r,n=r){let a;return typeof e=="function"?a=e(r):Array.isArray(e)?a=e[r]||n:a=Sj(e,r)||n,t&&(a=t(a,n,e)),a}function ha(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:a}=e,l=c=>{if(c[t]==null)return null;const d=c[t],p=c.theme,u=Sj(p,n)||{};return g2(c,d,h=>{let m=IE(u,a,h);return h===m&&typeof h=="string"&&(m=IE(u,a,`${t}${h==="default"?"":mr(h)}`,h)),r===!1?m:{[r]:m}})};return l.propTypes={},l.filterProps=[t],l}function btt(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const wtt={m:"margin",p:"padding"},vtt={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},eie={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Ctt=btt(e=>{if(e.length>2)if(eie[e])e=eie[e];else return[e];const[t,r]=e.split(""),n=wtt[t],a=vtt[r]||"";return Array.isArray(a)?a.map(l=>n+l):[n+a]}),xZ=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],yZ=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...xZ,...yZ];function Ov(e,t,r,n){const a=Sj(e,t,!0)??r;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 c=Math.abs(l),d=a[c];return l>=0?d:typeof d=="number"?-d:typeof d=="string"&&d.startsWith("var(")?`calc(-1 * ${d})`:`-${d}`}:typeof a=="function"?a:(()=>{})}function bZ(e){return Ov(e,"spacing",8)}function Nv(e,t){return typeof t=="string"||t==null?t:e(t)}function Att(e,t){return r=>e.reduce((n,a)=>(n[a]=Nv(t,r),n),{})}function $tt(e,t,r,n){if(!t.includes(r))return null;const a=Ctt(r),l=Att(a,n),c=e[r];return g2(e,c,l)}function jke(e,t){const r=bZ(e.theme);return Object.keys(e).map(n=>$tt(e,t,n,r)).reduce(Zb,{})}function Hn(e){return jke(e,xZ)}Hn.propTypes={};Hn.filterProps=xZ;function _n(e){return jke(e,yZ)}_n.propTypes={};_n.filterProps=yZ;function Mke(e=8,t=bZ({spacing:e})){if(e.mui)return e;const r=(...n)=>(n.length===0?[1]:n).map(a=>{const l=t(a);return typeof l=="number"?`${l}px`:l}).join(" ");return r.mui=!0,r}function Ej(...e){const t=e.reduce((n,a)=>(a.filterProps.forEach(l=>{n[l]=a}),n),{}),r=n=>Object.keys(n).reduce((a,l)=>t[l]?Zb(a,t[l](n)):a,{});return r.propTypes={},r.filterProps=e.reduce((n,a)=>n.concat(a.filterProps),[]),r}function Gd(e){return typeof e!="number"?e:`${e}px solid`}function g1(e,t){return ha({prop:e,themeKey:"borders",transform:t})}const ktt=g1("border",Gd),Stt=g1("borderTop",Gd),Ett=g1("borderRight",Gd),Ltt=g1("borderBottom",Gd),Itt=g1("borderLeft",Gd),jtt=g1("borderColor"),Mtt=g1("borderTopColor"),Btt=g1("borderRightColor"),Ptt=g1("borderBottomColor"),Dtt=g1("borderLeftColor"),Ttt=g1("outline",Gd),ztt=g1("outlineColor"),Lj=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Ov(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:Nv(t,n)});return g2(e,e.borderRadius,r)}return null};Lj.propTypes={};Lj.filterProps=["borderRadius"];Ej(ktt,Stt,Ett,Ltt,Itt,jtt,Mtt,Btt,Ptt,Dtt,Lj,Ttt,ztt);const Ij=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Ov(e.theme,"spacing",8),r=n=>({gap:Nv(t,n)});return g2(e,e.gap,r)}return null};Ij.propTypes={};Ij.filterProps=["gap"];const jj=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Ov(e.theme,"spacing",8),r=n=>({columnGap:Nv(t,n)});return g2(e,e.columnGap,r)}return null};jj.propTypes={};jj.filterProps=["columnGap"];const Mj=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Ov(e.theme,"spacing",8),r=n=>({rowGap:Nv(t,n)});return g2(e,e.rowGap,r)}return null};Mj.propTypes={};Mj.filterProps=["rowGap"];const Rtt=ha({prop:"gridColumn"}),Ftt=ha({prop:"gridRow"}),Ott=ha({prop:"gridAutoFlow"}),Ntt=ha({prop:"gridAutoColumns"}),Htt=ha({prop:"gridAutoRows"}),_tt=ha({prop:"gridTemplateColumns"}),Vtt=ha({prop:"gridTemplateRows"}),Qtt=ha({prop:"gridTemplateAreas"}),Utt=ha({prop:"gridArea"});Ej(Ij,jj,Mj,Rtt,Ftt,Ott,Ntt,Htt,_tt,Vtt,Qtt,Utt);function i8(e,t){return t==="grey"?t:e}const Wtt=ha({prop:"color",themeKey:"palette",transform:i8}),Gtt=ha({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:i8}),Ytt=ha({prop:"backgroundColor",themeKey:"palette",transform:i8});Ej(Wtt,Gtt,Ytt);function nd(e){return e<=1&&e!==0?`${e*100}%`:e}const Ktt=ha({prop:"width",transform:nd}),wZ=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{const n=e.theme?.breakpoints?.values?.[r]||kj[r];return n?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:n}:{maxWidth:nd(r)}};return g2(e,e.maxWidth,t)}return null};wZ.filterProps=["maxWidth"];const qtt=ha({prop:"minWidth",transform:nd}),Ztt=ha({prop:"height",transform:nd}),Jtt=ha({prop:"maxHeight",transform:nd}),Xtt=ha({prop:"minHeight",transform:nd});ha({prop:"size",cssProperty:"width",transform:nd});ha({prop:"size",cssProperty:"height",transform:nd});const eot=ha({prop:"boxSizing"});Ej(Ktt,wZ,qtt,Ztt,Jtt,Xtt,eot);const Bj={border:{themeKey:"borders",transform:Gd},borderTop:{themeKey:"borders",transform:Gd},borderRight:{themeKey:"borders",transform:Gd},borderBottom:{themeKey:"borders",transform:Gd},borderLeft:{themeKey:"borders",transform:Gd},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Gd},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Lj},color:{themeKey:"palette",transform:i8},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:i8},backgroundColor:{themeKey:"palette",transform:i8},p:{style:_n},pt:{style:_n},pr:{style:_n},pb:{style:_n},pl:{style:_n},px:{style:_n},py:{style:_n},padding:{style:_n},paddingTop:{style:_n},paddingRight:{style:_n},paddingBottom:{style:_n},paddingLeft:{style:_n},paddingX:{style:_n},paddingY:{style:_n},paddingInline:{style:_n},paddingInlineStart:{style:_n},paddingInlineEnd:{style:_n},paddingBlock:{style:_n},paddingBlockStart:{style:_n},paddingBlockEnd:{style:_n},m:{style:Hn},mt:{style:Hn},mr:{style:Hn},mb:{style:Hn},ml:{style:Hn},mx:{style:Hn},my:{style:Hn},margin:{style:Hn},marginTop:{style:Hn},marginRight:{style:Hn},marginBottom:{style:Hn},marginLeft:{style:Hn},marginX:{style:Hn},marginY:{style:Hn},marginInline:{style:Hn},marginInlineStart:{style:Hn},marginInlineEnd:{style:Hn},marginBlock:{style:Hn},marginBlockStart:{style:Hn},marginBlockEnd:{style:Hn},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:Ij},rowGap:{style:Mj},columnGap:{style:jj},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:nd},maxWidth:{style:wZ},minWidth:{transform:nd},height:{transform:nd},maxHeight:{transform:nd},minHeight:{transform:nd},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 tot(...e){const t=e.reduce((n,a)=>n.concat(Object.keys(a)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function oot(e,t){return typeof e=="function"?e(t):e}function rot(){function e(r,n,a,l){const c={[r]:n,theme:a},d=l[r];if(!d)return{[r]:n};const{cssProperty:p=r,themeKey:u,transform:h,style:m}=d;if(n==null)return null;if(u==="typography"&&n==="inherit")return{[r]:n};const f=Sj(a,u)||{};return m?m(c):g2(c,n,x=>{let y=IE(f,h,x);return x===y&&typeof x=="string"&&(y=IE(f,h,`${r}${x==="default"?"":mr(x)}`,x)),p===!1?y:{[p]:y}})}function t(r){const{sx:n,theme:a={},nested:l}=r||{};if(!n)return null;const c=a.unstable_sxConfig??Bj;function d(p){let u=p;if(typeof p=="function")u=p(a);else if(typeof p!="object")return p;if(!u)return null;const h=ytt(a.breakpoints),m=Object.keys(h);let f=h;return Object.keys(u).forEach(x=>{const y=oot(u[x],a);if(y!=null)if(typeof y=="object")if(c[x])f=Zb(f,e(x,y,a,c));else{const b=g2({theme:a},y,w=>({[x]:w}));tot(b,y)?f[x]=t({sx:y,theme:a,nested:!0}):f=Zb(f,b)}else f=Zb(f,e(x,y,a,c))}),!l&&a.modularCssLayers?{"@layer sx":Zre(a,Xre(m,f))}:Zre(a,Xre(m,f))}return Array.isArray(n)?n.map(d):d(n)}return t}const D4=rot();D4.filterProps=["sx"];function iot(e,t){const r=this;if(r.vars){if(!r.colorSchemes?.[e]||typeof r.getColorSchemeSelector!="function")return{};let n=r.getColorSchemeSelector(e);return n==="&"?t:((n.includes("data-")||n.includes("."))&&(n=`*:where(${n.replace(/\s*&$/,"")}) &`),{[n]:t})}return r.palette.mode===e?t:{}}function vZ(e={},...t){const{breakpoints:r={},palette:n={},spacing:a,shape:l={},...c}=e,d=utt(r),p=Mke(a);let u=ml({breakpoints:d,direction:"ltr",components:{},palette:{mode:"light",...n},spacing:p,shape:{...ftt,...l}},c);return u=gtt(u),u.applyStyles=iot,u=t.reduce((h,m)=>ml(h,m),u),u.unstable_sxConfig={...Bj,...c?.unstable_sxConfig},u.unstable_sx=function(h){return D4({sx:h,theme:this})},u}function not(e){return Object.keys(e).length===0}function CZ(e=null){const t=g.useContext(mke);return!t||not(t)?e:t}const aot=vZ();function Bke(e=aot){return CZ(e)}function tie(e){const t=rg(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function Pke({styles:e,themeId:t,defaultTheme:r={}}){const n=Bke(r),a=t&&n[t]||n;let l=typeof e=="function"?e(a):e;return a.modularCssLayers&&(Array.isArray(l)?l=l.map(c=>tie(typeof c=="function"?c(a):c)):l=tie(l)),s.jsx(Eke,{styles:l})}const oie=e=>e,sot=()=>{let e=oie;return{configure(t){e=t},generate(t){return e(t)},reset(){e=oie}}},lot=sot();function Dke(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=Dke(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ko(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Dke(e))&&(n&&(n+=" "),n+=t);return n}const cot={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 vi(e,t,r="Mui"){const n=cot[t];return n?`${r}-${n}`:`${lot.generate(e)}-${t}`}function ci(e,t,r="Mui"){const n={};return t.forEach(a=>{n[a]=vi(e,a,r)}),n}function Tke(e){const{variants:t,...r}=e,n={variants:t,style:rg(r),isProcessed:!0};return n.style===r||t&&t.forEach(a=>{typeof a.style!="function"&&(a.style=rg(a.style))}),n}const dot=vZ();function bT(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function i4(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function pot(e){return e?(t,r)=>r[e]:null}function uot(e,t,r){e.theme=got(e.theme)?r:e.theme[t]||e.theme}function VS(e,t,r){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(a=>VS(e,a,r));if(Array.isArray(n?.variants)){let a;if(n.isProcessed)a=r?i4(n.style,r):n.style;else{const{variants:l,...c}=n;a=r?i4(rg(c),r):c}return zke(e,n.variants,[a],r)}return n?.isProcessed?r?i4(rg(n.style),r):n.style:r?i4(rg(n),r):n}function zke(e,t,r=[],n=void 0){let a;e:for(let l=0;l<t.length;l+=1){const c=t[l];if(typeof c.props=="function"){if(a??={...e,...e.ownerState,ownerState:e.ownerState},!c.props(a))continue}else for(const d in c.props)if(e[d]!==c.props[d]&&e.ownerState?.[d]!==c.props[d])continue e;typeof c.style=="function"?(a??={...e,...e.ownerState,ownerState:e.ownerState},r.push(n?i4(rg(c.style(a)),n):c.style(a))):r.push(n?i4(rg(c.style),n):c.style)}return r}function hot(e={}){const{themeId:t,defaultTheme:r=dot,rootShouldForwardProp:n=bT,slotShouldForwardProp:a=bT}=e;function l(c){uot(c,t,r)}return(c,d={})=>{ltt(c,I=>I.filter(L=>L!==D4));const{name:p,slot:u,skipVariantsResolver:h,skipSx:m,overridesResolver:f=pot(xot(u)),...x}=d,y=p&&p.startsWith("Mui")||u?"components":"custom",b=h!==void 0?h:u&&u!=="Root"&&u!=="root"||!1,w=m||!1;let v=bT;u==="Root"||u==="root"?v=n:u?v=a:fot(c)&&(v=void 0);const A=stt(c,{shouldForwardProp:v,label:mot(),...x}),S=I=>{if(I.__emotion_real===I)return I;if(typeof I=="function")return function(L){return VS(L,I,L.theme.modularCssLayers?y:void 0)};if(G0(I)){const L=Tke(I);return function(M){return L.variants?VS(M,L,M.theme.modularCssLayers?y:void 0):M.theme.modularCssLayers?i4(L.style,y):L.style}}return I},E=(...I)=>{const L=[],M=I.map(S),D=[];if(L.push(l),p&&f&&D.push(function(z){const N=z.theme.components?.[p]?.styleOverrides;if(!N)return null;const K={};for(const q in N)K[q]=VS(z,N[q],z.theme.modularCssLayers?"theme":void 0);return f(z,K)}),p&&!b&&D.push(function(z){const N=z.theme?.components?.[p]?.variants;return N?zke(z,N,[],z.theme.modularCssLayers?"theme":void 0):null}),w||D.push(D4),Array.isArray(M[0])){const z=M.shift(),N=new Array(L.length).fill(""),K=new Array(D.length).fill("");let q;q=[...N,...z,...K],q.raw=[...N,...z.raw,...K],L.unshift(q)}const P=[...L,...M,...D],T=A(...P);return c.muiName&&(T.muiName=c.muiName),T};return A.withConfig&&(E.withConfig=A.withConfig),E}}function mot(e,t){return void 0}function got(e){for(const t in e)return!1;return!0}function fot(e){return typeof e=="string"&&e.charCodeAt(0)>96}function xot(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function KW(e,t,r=!1){const n={...t};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const l=a;if(l==="components"||l==="slots")n[l]={...e[l],...n[l]};else if(l==="componentsProps"||l==="slotProps"){const c=e[l],d=t[l];if(!d)n[l]=c||{};else if(!c)n[l]=d;else{n[l]={...d};for(const p in c)if(Object.prototype.hasOwnProperty.call(c,p)){const u=p;n[l][u]=KW(c[u],d[u],r)}}}else l==="className"&&r&&t.className?n.className=Ko(e?.className,t?.className):l==="style"&&r&&t.style?n.style={...e?.style,...t?.style}:n[l]===void 0&&(n[l]=e[l])}return n}const xd=typeof window<"u"?g.useLayoutEffect:g.useEffect;function yot(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function AZ(e,t=0,r=1){return yot(e,t,r)}function bot(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),r?`rgb${r.length===4?"a":""}(${r.map((n,a)=>a<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function mg(e){if(e.type)return e;if(e.charAt(0)==="#")return mg(bot(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(m2(9,e));let n=e.substring(t+1,e.length-1),a;if(r==="color"){if(n=n.split(" "),a=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(a))throw new Error(m2(10,a))}else n=n.split(",");return n=n.map(l=>parseFloat(l)),{type:r,values:n,colorSpace:a}}const wot=e=>{const t=mg(e);return t.values.slice(0,3).map((r,n)=>t.type.includes("hsl")&&n!==0?`${r}%`:r).join(" ")},mb=(e,t)=>{try{return wot(e)}catch{return e}};function Pj(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.includes("rgb")?n=n.map((a,l)=>l<3?parseInt(a,10):a):t.includes("hsl")&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.includes("color")?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function Rke(e){e=mg(e);const{values:t}=e,r=t[0],n=t[1]/100,a=t[2]/100,l=n*Math.min(a,1-a),c=(u,h=(u+r/30)%12)=>a-l*Math.max(Math.min(h-3,9-h,1),-1);let d="rgb";const p=[Math.round(c(0)*255),Math.round(c(8)*255),Math.round(c(4)*255)];return e.type==="hsla"&&(d+="a",p.push(t[3])),Pj({type:d,values:p})}function qW(e){e=mg(e);let t=e.type==="hsl"||e.type==="hsla"?mg(Rke(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function vot(e,t){const r=qW(e),n=qW(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function jE(e,t){return e=mg(e),t=AZ(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Pj(e)}function N3(e,t,r){try{return jE(e,t)}catch{return e}}function Dj(e,t){if(e=mg(e),t=AZ(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Pj(e)}function Pi(e,t,r){try{return Dj(e,t)}catch{return e}}function Tj(e,t){if(e=mg(e),t=AZ(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Pj(e)}function Di(e,t,r){try{return Tj(e,t)}catch{return e}}function Cot(e,t=.15){return qW(e)>.5?Dj(e,t):Tj(e,t)}function CA(e,t,r){try{return Cot(e,t)}catch{return e}}const Fke=g.createContext(null);function $Z(){return g.useContext(Fke)}const Aot=typeof Symbol=="function"&&Symbol.for,$ot=Aot?Symbol.for("mui.nested"):"__THEME_NESTED__";function kot(e,t){return typeof t=="function"?t(e):{...e,...t}}function Sot(e){const{children:t,theme:r}=e,n=$Z(),a=g.useMemo(()=>{const l=n===null?{...r}:kot(n,r);return l!=null&&(l[$ot]=n!==null),l},[r,n]);return s.jsx(Fke.Provider,{value:a,children:t})}const Oke=g.createContext();function Eot({value:e,...t}){return s.jsx(Oke.Provider,{value:e??!0,...t})}const C9=()=>g.useContext(Oke)??!1,Nke=g.createContext(void 0);function Lot({value:e,children:t}){return s.jsx(Nke.Provider,{value:e,children:t})}function Iot(e){const{theme:t,name:r,props:n}=e;if(!t||!t.components||!t.components[r])return n;const a=t.components[r];return a.defaultProps?KW(a.defaultProps,n,t.components.mergeClassNameAndStyle):!a.styleOverrides&&!a.variants?KW(a,n,t.components.mergeClassNameAndStyle):n}function jot({props:e,name:t}){const r=g.useContext(Nke);return Iot({props:e,name:t,theme:{components:r}})}let rie=0;function Mot(e){const[t,r]=g.useState(e),n=e||t;return g.useEffect(()=>{t==null&&(rie+=1,r(`mui-${rie}`))},[t]),n}const Bot={...oJe},iie=Bot.useId;function zj(e){if(iie!==void 0){const t=iie();return e??t}return Mot(e)}function Pot(e){const t=CZ(),r=zj()||"",{modularCssLayers:n}=e;let a="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!n||t!==null?a="":typeof n=="string"?a=n.replace(/mui(?!\.)/g,a):a=`@layer ${a};`,xd(()=>{const l=document.querySelector("head");if(!l)return;const c=l.firstChild;if(a){if(c&&c.hasAttribute?.("data-mui-layer-order")&&c.getAttribute("data-mui-layer-order")===r)return;const d=document.createElement("style");d.setAttribute("data-mui-layer-order",r),d.textContent=a,l.prepend(d)}else l.querySelector(`style[data-mui-layer-order="${r}"]`)?.remove()},[a,r]),a?s.jsx(Pke,{styles:a}):null}const nie={};function aie(e,t,r,n=!1){return g.useMemo(()=>{const a=e&&t[e]||t;if(typeof r=="function"){const l=r(a),c=e?{...t,[e]:l}:l;return n?()=>c:c}return e?{...t,[e]:r}:{...t,...r}},[e,t,r,n])}function Hke(e){const{children:t,theme:r,themeId:n}=e,a=CZ(nie),l=$Z()||nie,c=aie(n,a,r),d=aie(n,l,r,!0),p=(n?c[n]:c).direction==="rtl",u=Pot(c);return s.jsx(Sot,{theme:d,children:s.jsx(mke.Provider,{value:c,children:s.jsx(Eot,{value:p,children:s.jsxs(Lot,{value:n?c[n].components:c.components,children:[u,t]})})})})}const sie={theme:void 0};function Dot(e){let t,r;return function(n){let a=t;return(a===void 0||n.theme!==r)&&(sie.theme=n.theme,a=Tke(e(sie)),t=a,r=n.theme),a}}const kZ="mode",SZ="color-scheme",Tot="data-color-scheme";function zot(e){const{defaultMode:t="system",defaultLightColorScheme:r="light",defaultDarkColorScheme:n="dark",modeStorageKey:a=kZ,colorSchemeStorageKey:l=SZ,attribute:c=Tot,colorSchemeNode:d="document.documentElement",nonce:p}=e||{};let u="",h=c;if(c==="class"&&(h=".%s"),c==="data"&&(h="[data-%s]"),h.startsWith(".")){const f=h.substring(1);u+=`${d}.classList.remove('${f}'.replace('%s', light), '${f}'.replace('%s', dark));
3
3
  ${d}.classList.add('${f}'.replace('%s', colorScheme));`}const m=h.match(/\[([^[\]]+)\]/);if(m){const[f,x]=m[1].split("=");x||(u+=`${d}.removeAttribute('${f}'.replace('%s', light));
4
4
  ${d}.removeAttribute('${f}'.replace('%s', dark));`),u+=`
5
5
  ${d}.setAttribute('${f}'.replace('%s', colorScheme), ${x?`${x}.replace('%s', colorScheme)`:'""'});`}else h!==".%s"&&(u+=`${d}.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
  `+he:"")+"\n```"},regExp:/^```(\w{1,10})?\s/,replace:q(re=>t.$createCodeNode(re?re[1]:void 0)),type:"element"},H={dependencies:[r.ListNode,r.ListItemNode],export:(re,he)=>r.$isListNode(re)?_(re,he,0):null,regExp:/^(\s*)[-*+]\s/,replace:F("bullet"),type:"element"},ee={dependencies:[r.ListNode,r.ListItemNode],export:(re,he)=>r.$isListNode(re)?_(re,he,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:F("check"),type:"element"},Y={dependencies:[r.ListNode,r.ListItemNode],export:(re,he)=>r.$isListNode(re)?_(re,he,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:F("number"),type:"element"},G={format:["code"],tag:"`",type:"text-format"},X={format:["highlight"],tag:"==",type:"text-format"},J={format:["bold","italic"],tag:"***",type:"text-format"},ie={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},ye={format:["bold"],tag:"**",type:"text-format"},me={format:["bold"],intraword:!1,tag:"__",type:"text-format"},de={format:["strikethrough"],tag:"~~",type:"text-format"},ce={format:["italic"],tag:"*",type:"text-format"},ge={format:["italic"],intraword:!1,tag:"_",type:"text-format"},be={dependencies:[l.LinkNode],export:(re,he,Ee)=>{if(!l.$isLinkNode(re))return null;he=(he=re.getTitle())?`[${re.getTextContent()}](${re.getURL()} "${he}")`:`[${re.getTextContent()}](${re.getURL()})`;const Me=re.getFirstChild();return re.getChildrenSize()===1&&e.$isTextNode(Me)?Ee(Me,he):he},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(re,he)=>{const[,Ee,Me,we]=he;he=l.$createLinkNode(Me,{title:we});const De=e.$createTextNode(Ee);De.setFormat(re.getFormat()),he.append(De),re.replace(he)},trigger:")",type:"text-match"},ne=[V,O,R,H,Y],ae=[G,J,ie,ye,me,X,ce,ge,de],fe=[be],ve=[...ne,...ae,...fe];return mn.$convertFromMarkdownString=function(re,he=ve,Ee){return M(he)(re,Ee)},mn.$convertToMarkdownString=function(re=ve,he){return u(re)(he)},mn.BOLD_ITALIC_STAR=J,mn.BOLD_ITALIC_UNDERSCORE=ie,mn.BOLD_STAR=ye,mn.BOLD_UNDERSCORE=me,mn.CHECK_LIST=ee,mn.CODE=R,mn.ELEMENT_TRANSFORMERS=ne,mn.HEADING=V,mn.HIGHLIGHT=X,mn.INLINE_CODE=G,mn.ITALIC_STAR=ce,mn.ITALIC_UNDERSCORE=ge,mn.LINK=be,mn.ORDERED_LIST=Y,mn.QUOTE=O,mn.STRIKETHROUGH=de,mn.TEXT_FORMAT_TRANSFORMERS=ae,mn.TEXT_MATCH_TRANSFORMERS=fe,mn.TRANSFORMERS=ve,mn.UNORDERED_LIST=H,mn.registerMarkdownShortcuts=function(re,he=ve){let Ee=d(he),Me=c(Ee.textFormat,({tag:De})=>De[De.length-1]),we=c(Ee.textMatch,({trigger:De})=>De);for(let De of he)if(he=De.type,(he==="element"||he==="text-match")&&!re.hasNodes(De.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 re.registerUpdateListener(({tags:De,dirtyLeaves:ze,editorState:tt,prevEditorState:Qe})=>{if(!De.has("historic")){var Be=tt.read(e.$getSelection);if(De=Qe.read(e.$getSelection),e.$isRangeSelection(De)&&e.$isRangeSelection(Be)&&Be.isCollapsed()){Qe=Be.anchor.key;var _e=Be.anchor.offset,$e=tt._nodeMap.get(Qe);e.$isTextNode($e)&&ze.has(Qe)&&(_e===1||_e===De.anchor.offset+1)&&re.update(()=>{if(!$e.hasFormat("code")){var Re=$e.getParent();if(Re!==null&&!t.$isCodeNode(Re)){var Ze=Be.anchor.offset;e:{var Ne=Ee.element,et=Re.getParent();if(e.$isRootOrShadowRoot(et)&&Re.getFirstChild()===$e&&(et=$e.getTextContent(),et[Ze-1]===" ")){for(let{regExp:pt,replace:ut}of Ne)if((Ne=et.match(pt))&&Ne[0].length===Ze){et=$e.getNextSiblings();let[zt,Yt]=$e.splitText(Ze);zt.remove(),et=Yt?[Yt,...et]:et,ut(Re,et,Ne,!1),Re=!0;break e}}Re=!1}if(!Re){e:{if(Ne=$e.getTextContent(),Re=we[Ne[Ze-1]],Re!=null){Ze<Ne.length&&(Ne=Ne.slice(0,Ze));for(He of Re)if(Re=Ne.match(He.regExp),Re!==null){Ne=Re.index||0,et=Ne+Re[0].length;var mt=void 0;Ne===0?[mt]=$e.splitText(et):[,mt]=$e.splitText(Ne,et),mt.selectNext(0,0),He.replace(mt,Re);var He=!0;break e}}He=!1}if(!He)e:{et=$e.getTextContent(),--Ze;var bt=et[Ze];if(He=Me[bt])for(let pt of He){var{tag:Mt}=pt;He=Mt.length;let ut=Ze-He+1;if(!(1<He&&!K(et,ut,Mt,0,He)||et[ut-1]===" ")&&(mt=et[Ze+1],pt.intraword!==!1||!mt||p.test(mt))){Re=mt=$e,Ne=N(et,ut,Mt);for(var Ft=Re;0>Ne&&(Ft=Ft.getPreviousSibling())&&!e.$isLineBreakNode(Ft);)e.$isTextNode(Ft)&&(Ne=Ft.getTextContent(),Re=Ft,Ne=N(Ne,Ne.length,Mt));if(!(0>Ne||Re===mt&&Ne+He===ut||(Mt=Re.getTextContent(),0<Ne&&Mt[Ne-1]===bt||(Ft=Mt[Ne-1],pt.intraword===!1&&Ft&&!p.test(Ft))))){et=mt.getTextContent(),et=et.slice(0,ut)+et.slice(Ze+1),mt.setTextContent(et),et=Re===mt?et:Mt,Re.setTextContent(et.slice(0,Ne)+et.slice(Ne+He)),et=e.$getSelection(),bt=e.$createRangeSelection(),e.$setSelection(bt),Ze=Ze-He*(Re===mt?2:1)+1,bt.anchor.set(Re.__key,Ne,"text"),bt.focus.set(mt.__key,Ze,"text");for(let zt of pt.format)bt.hasFormat(zt)||bt.formatText(zt);bt.anchor.set(bt.focus.key,bt.focus.offset,bt.focus.type);for(let zt of pt.format)bt.hasFormat(zt)&&bt.toggleFormat(zt);e.$isRangeSelection(et)&&(bt.format=et.format);break e}}}}}}}})}}})},mn}var UH,rme;function Uze(){return rme||(rme=1,UH=hOt()),UH}var mOt=Uze(),WH={},ime;function gOt(){if(ime)return WH;ime=1;var e=Ad(),t=Tc();return WH.AutoFocusPlugin=function({defaultSelection:r}){let[n]=e.useLexicalComposerContext();return t.useEffect(()=>{n.focus(()=>{let a=document.activeElement,l=n.getRootElement();l===null||a!==null&&l.contains(a)||l.focus({preventScroll:!0})},{defaultSelection:r})},[r,n]),null},WH}var GH,nme;function fOt(){return nme||(nme=1,GH=gOt()),GH}var xOt=fOt(),h$={},v7={},YH={},ame;function yOt(){if(ame)return YH;ame=1;var e=Ad(),t=Ta(),r=Tc();function n(a,l){return a.getEditorState().read(()=>{let c=t.$getNodeByKey(l);return c===null?!1:c.isSelected()})}return YH.useLexicalNodeSelection=function(a){let[l]=e.useLexicalComposerContext(),[c,d]=r.useState(()=>n(l,a));r.useEffect(()=>{let h=!0,m=l.registerUpdateListener(()=>{h&&d(n(l,a))});return()=>{h=!1,m()}},[l,a]);let p=r.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=r.useCallback(()=>{l.update(()=>{const h=t.$getSelection();t.$isNodeSelection(h)&&h.clear()})},[l]);return[c,p,u]},YH}var KH,sme;function bOt(){return sme||(sme=1,KH=yOt()),KH}var lme;function wOt(){if(lme)return v7;lme=1;var e=Ad(),t=bOt(),r=Rc(),n=Ta(),a=Tc();let l=n.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function c({nodeKey:m}){let[f]=e.useLexicalComposerContext(),[x,y,b]=t.useLexicalNodeSelection(m),w=a.useCallback(v=>(x&&n.$isNodeSelection(n.$getSelection())&&(v.preventDefault(),v=n.$getNodeByKey(m),h(v)&&v.remove(),y(!1)),!1),[x,m,y]);return a.useEffect(()=>r.mergeRegister(f.registerCommand(n.CLICK_COMMAND,v=>{let A=f.getElementByKey(m);return v.target===A?(v.shiftKey||b(),y(!x),!0):!1},n.COMMAND_PRIORITY_LOW),f.registerCommand(n.KEY_DELETE_COMMAND,w,n.COMMAND_PRIORITY_LOW),f.registerCommand(n.KEY_BACKSPACE_COMMAND,w,n.COMMAND_PRIORITY_LOW)),[b,f,x,m,w,y]),a.useEffect(()=>{let v=f.getElementByKey(m);v!==null&&(v.className=x?"selected":"")},[f,x,m]),null}class d extends n.DecoratorNode{static getType(){return"horizontalrule"}static clone(f){return new d(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(c,{nodeKey:this.__key})}}function p(){return{node:u()}}function u(){return n.$applyNodeReplacement(new d)}function h(m){return m instanceof d}return v7.$createHorizontalRuleNode=u,v7.$isHorizontalRuleNode=h,v7.HorizontalRuleNode=d,v7.INSERT_HORIZONTAL_RULE_COMMAND=l,v7}var qH,cme;function vOt(){return cme||(cme=1,qH=wOt()),qH}var dme;function COt(){if(dme)return h$;dme=1;var e=Uze(),t=Ad(),r=vOt(),n=Tc();let a=[{dependencies:[r.HorizontalRuleNode],export:l=>r.$isHorizontalRuleNode(l)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(l,c,d,p)=>{c=r.$createHorizontalRuleNode(),p||l.getNextSibling()!=null?l.replace(c):l.insertBefore(c),c.selectNext()},type:"element"},...e.TRANSFORMERS];return h$.DEFAULT_TRANSFORMERS=a,h$.MarkdownShortcutPlugin=function({transformers:l=a}){let[c]=t.useLexicalComposerContext();return n.useEffect(()=>e.registerMarkdownShortcuts(c,l),[c,l]),null},h$}var ZH,pme;function AOt(){return pme||(pme=1,ZH=COt()),ZH}var $Ot=AOt(),hi={},ume;function kOt(){if(ume)return hi;ume=1;var e=Ta(),t=Rc();let r={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class n extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(R){let H=new n(R.__headerState,R.__colSpan,R.__width,R.__key);return H.__rowSpan=R.__rowSpan,H}static importDOM(){return{td:()=>({conversion:a,priority:0}),th:()=>({conversion:a,priority:0})}}static importJSON(R){let H=l(R.headerState,R.colSpan,R.width||void 0);return H.__rowSpan=R.rowSpan,H}constructor(R=r.NO_STATUS,H=1,ee,Y){super(H,Y),this.__headerState=R,this.__width=ee}createDOM(R){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,R.theme.tableCell,this.hasHeader()&&R.theme.tableCellHeader),H}exportDOM(R){if({element:R}=super.exportDOM(R),R){let H=this.getParentOrThrow().getChildrenSize();R.style.border="1px solid black",1<this.__colSpan&&(R.colSpan=this.__colSpan),1<this.__rowSpan&&(R.rowSpan=this.__rowSpan),R.style.width=`${this.getWidth()||Math.max(90,700/H)}px`,R.style.verticalAlign="top",R.style.textAlign="start",this.hasHeader()&&(R.style.backgroundColor="#f2f3f5")}return{element:R}}exportJSON(){return{...super.exportJSON(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(R){return this.getWritable().__headerState=R,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(R){return this.getWritable().__width=R,this.__width}getWidth(){return this.getLatest().__width}toggleHeaderStyle(R){let H=this.getWritable();return H.__headerState=(H.__headerState&R)===R?H.__headerState-R:H.__headerState+R,H}hasHeaderState(R){return(this.getHeaderStyles()&R)===R}hasHeader(){return this.getLatest().__headerState!==r.NO_STATUS}updateDOM(R){return R.__headerState!==this.__headerState||R.__width!==this.__width||R.__colSpan!==this.__colSpan||R.__rowSpan!==this.__rowSpan}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function a(O){var R=O.nodeName.toLowerCase();return R=l(R==="th"?r.ROW:r.NO_STATUS),R.__colSpan=O.colSpan,R.__rowSpan=O.rowSpan,{forChild:(H,ee)=>c(ee)&&!e.$isElementNode(H)?(ee=e.$createParagraphNode(),e.$isLineBreakNode(H)&&H.getTextContent()===`
245
245
  `?null:(ee.append(H),ee)):H,node:R}}function l(O,R=1,H){return e.$applyNodeReplacement(new n(O,R,H))}function c(O){return O instanceof n}class d extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(R){return new d(R.__height,R.__key)}static importDOM(){return{tr:()=>({conversion:p,priority:0})}}static importJSON(R){return u(R.height)}constructor(R,H){super(H),this.__height=R}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(R){let H=document.createElement("tr");return this.__height&&(H.style.height=`${this.__height}px`),t.addClassNamesToElement(H,R.theme.tableRow),H}isShadowRoot(){return!0}setHeight(R){return this.getWritable().__height=R,this.__height}getHeight(){return this.getLatest().__height}updateDOM(R){return R.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function p(){return{node:u()}}function u(O){return e.$applyNodeReplacement(new d(O))}function h(O){return O instanceof d}function m(O){throw Error(`Minified Lexical error #${O}; visit https://lexical.dev/docs/error?code=${O} 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(R,H){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=H,this.editor=R,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(R=>R())}trackTableGrid(){let R=new MutationObserver(H=>{this.editor.update(()=>{var ee=!1;for(let Y=0;Y<H.length;Y++){const G=H[Y].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=b(ee)}})});this.editor.update(()=>{let H=this.editor.getElementByKey(this.tableNodeKey);if(!H)throw Error("Expected to find TableElement in DOM");this.grid=b(H),R.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 R=e.$getNodeByKey(this.tableNodeKey);if(!z(R))throw Error("Expected TableNode.");if(R=this.editor.getElementByKey(this.tableNodeKey),!R)throw Error("Expected to find TableElement in DOM");R=b(R),w(R,null),e.$setSelection(null),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){this.editor.update(()=>{let R=this.editor.getElementByKey(this.tableNodeKey);if(!R)throw Error("Expected to find TableElement in DOM");R.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){this.editor.update(()=>{let R=this.editor.getElementByKey(this.tableNodeKey);if(!R)throw Error("Expected to find TableElement in DOM");R.classList.add("disable-selection"),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(R){R!=null&&R.gridKey===this.tableNodeKey?(this.gridSelection=R,this.isHighlightingCells=!0,this.disableHighlightStyle(),w(this.grid,this.gridSelection)):R==null&&this.clearHighlight()}setFocusCellForSelection(R,H=!1){this.editor.update(()=>{var ee=e.$getNodeByKey(this.tableNodeKey);if(!z(ee))throw Error("Expected TableNode.");if(!this.editor.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ee=R.x;let Y=R.y;if(this.focusCell=R,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!==Y||H))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ee===this.focusX&&Y===this.focusY)return;this.focusX=ee,this.focusY=Y,this.isHighlightingCells&&(ee=e.$getNearestNodeFromDOMNode(R.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&c(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),w(this.grid,this.gridSelection)))})}setAnchorCellForSelection(R){this.isHighlightingCells=!1,this.anchorCell=R,this.anchorX=R.x,this.anchorY=R.y,this.editor.update(()=>{var H=e.$getNearestNodeFromDOMNode(R.elem);c(H)&&(H=H.getKey(),this.gridSelection=e.DEPRECATED_$createGridSelection(),this.anchorCellNodeKey=H)})}formatCells(R){this.editor.update(()=>{let H=e.$getSelection();e.DEPRECATED_$isGridSelection(H)||m(11);let ee=e.$createRangeSelection(),Y=ee.anchor,G=ee.focus;H.getNodes().forEach(X=>{c(X)&&X.getTextContentSize()!==0&&(Y.set(X.getKey(),0,"element"),G.set(X.getKey(),X.getChildrenSize(),"element"),ee.formatText(R))}),e.$setSelection(H),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){this.editor.update(()=>{let R=e.$getNodeByKey(this.tableNodeKey);if(!z(R))throw Error("Expected TableNode.");var H=e.$getSelection();e.DEPRECATED_$isGridSelection(H)||m(11),H=H.getNodes().filter(c),H.length===this.grid.columns*this.grid.rows?(R.selectPrevious(),R.remove(),e.$getRoot().selectStart()):(H.forEach(ee=>{if(e.$isElementNode(ee)){let Y=e.$createParagraphNode(),G=e.$createTextNode();Y.append(G),ee.append(Y),ee.getChildren().forEach(X=>{X!==Y&&X.remove()})}}),w(this.grid,null),e.$setSelection(null),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function y(O){for(;O!=null;){let R=O.nodeName;if(R==="TD"||R==="TH"){if(O=O._cell,O===void 0)break;return O}O=O.parentNode}return null}function b(O){let R=[],H={cells:R,columns:0,rows:0};var ee=O.firstChild;let Y=O=0;for(R.length=0;ee!=null;){var G=ee.nodeName;if(G==="TD"||G==="TH")G={elem:ee,highlighted:!1,x:O,y:Y},ee._cell=G,R[Y]===void 0&&(R[Y]=[]),R[Y][O]=G;else if(G=ee.firstChild,G!=null){ee=G;continue}if(G=ee.nextSibling,G!=null)O++,ee=G;else if(G=ee.parentNode,G!=null){if(ee=G.nextSibling,ee==null)break;Y++,O=0}}return H.columns=O+1,H.rows=Y+1,H}function w(O,R){let H=[],ee=new Set(R?R.getNodes():[]);return v(O,(Y,G)=>{let X=Y.elem;ee.has(G)?(Y.highlighted=!0,X.style.setProperty("background-color","rgb(172, 206, 247)"),X.style.setProperty("caret-color","transparent"),H.push(Y)):(Y.highlighted=!1,X.style.removeProperty("background-color"),X.style.removeProperty("caret-color"),X.getAttribute("style")||X.removeAttribute("style"))}),H}function v(O,R){({cells:O}=O);for(let H=0;H<O.length;H++){let ee=O[H];for(let Y=0;Y<ee.length;Y++){let G=ee[Y],X=e.$getNearestNodeFromDOMNode(G.elem);X!==null&&R(G,X,{x:Y,y:H})}}}function A(O){O.disableHighlightStyle(),v(O.grid,R=>{let H=R.elem;R.highlighted=!0,H.style.setProperty("background-color","rgb(172, 206, 247)"),H.style.setProperty("caret-color","transparent")})}function S(O){O.enableHighlightStyle(),v(O.grid,R=>{let H=R.elem;R.highlighted=!1,H.style.removeProperty("background-color"),H.style.removeProperty("caret-color"),H.getAttribute("style")||H.removeAttribute("style")})}let E=(O,R,H,ee,Y)=>{const G=Y==="forward";switch(Y){case"backward":case"forward":return H!==(G?O.grid.columns-1:0)?M(R.getCellNodeFromCordsOrThrow(H+(G?1:-1),ee,O.grid)):ee!==(G?O.grid.rows-1:0)?M(R.getCellNodeFromCordsOrThrow(G?0:O.grid.columns-1,ee+(G?1:-1),O.grid)):G?R.selectNext():R.selectPrevious(),!0;case"up":return ee!==0?M(R.getCellNodeFromCordsOrThrow(H,ee-1,O.grid)):R.selectPrevious(),!0;case"down":return ee!==O.grid.rows-1?M(R.getCellNodeFromCordsOrThrow(H,ee+1,O.grid)):R.selectNext(),!0;default:return!1}},I=(O,R,H,ee,Y)=>{const G=Y==="forward";switch(Y){case"backward":case"forward":return H!==(G?O.grid.columns-1:0)&&O.setFocusCellForSelection(R.getCellFromCordsOrThrow(H+(G?1:-1),ee,O.grid)),!0;case"up":return ee!==0?(O.setFocusCellForSelection(R.getCellFromCordsOrThrow(H,ee-1,O.grid)),!0):!1;case"down":return ee!==O.grid.rows-1?(O.setFocusCellForSelection(R.getCellFromCordsOrThrow(H,ee+1,O.grid)),!0):!1;default:return!1}};function L(O,R){if(e.$isRangeSelection(O)||e.DEPRECATED_$isGridSelection(O)){let H=R.isParentOf(O.anchor.getNode());return O=R.isParentOf(O.focus.getNode()),H&&O}return!1}function M(O){let R=O.getChildren().find(H=>e.$isParagraphNode(H));e.$isParagraphNode(R)?R.selectEnd():O.selectEnd()}class D extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(R){return new D(R.__key)}static importDOM(){return{table:()=>({conversion:P,priority:1})}}static importJSON(){return T()}constructor(R){super(R)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(R){let H=document.createElement("table");return t.addClassNamesToElement(H,R.theme.table),H}updateDOM(){return!1}exportDOM(R){return{...super.exportDOM(R),after:H=>{if(H){let ee=H.cloneNode(),Y=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 X=0;X<H;X++){let J=document.createElement("col");Y.append(J)}return ee.replaceChildren(Y,G),ee}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(R,H){let{rows:ee,cells:Y}=H;for(H=0;H<ee;H++){var G=Y[H];if(G==null)throw Error(`Row not found at y:${H}`);if(G=G.findIndex(({elem:X})=>e.$getNearestNodeFromDOMNode(X)===R),G!==-1)return{x:G,y:H}}throw Error("Cell not found in table.")}getCellFromCords(R,H,ee){return{cells:ee}=ee,H=ee[H],H==null?null:(R=H[R],R??null)}getCellFromCordsOrThrow(R,H,ee){if(R=this.getCellFromCords(R,H,ee),!R)throw Error("Cell not found at cords.");return R}getCellNodeFromCords(R,H,ee){return R=this.getCellFromCords(R,H,ee),R==null?null:(R=e.$getNearestNodeFromDOMNode(R.elem),c(R)?R:null)}getCellNodeFromCordsOrThrow(R,H,ee){if(R=this.getCellNodeFromCords(R,H,ee),!R)throw Error("Node at cords not TableCellNode.");return R}canSelectBefore(){return!0}canIndent(){return!1}}function P(){return{node:T()}}function T(){return e.$applyNodeReplacement(new D)}function z(O){return O instanceof D}function N(O){if(O=t.$findMatchingParent(O,R=>h(R)),h(O))return O;throw Error("Expected table cell to be inside of table row.")}function K(O){if(O=t.$findMatchingParent(O,R=>z(R)),z(O))return O;throw Error("Expected table cell to be inside of table.")}function q(O,R){let H=K(O),{x:ee,y:Y}=H.getCordsFromCellNode(O,R);return{above:H.getCellNodeFromCords(ee,Y-1,R),below:H.getCellNodeFromCords(ee,Y+1,R),left:H.getCellNodeFromCords(ee-1,Y,R),right:H.getCellNodeFromCords(ee+1,Y,R)}}function F(O){O=O.getFirstDescendant(),O===null&&m(124),O.getParentOrThrow().selectStart()}function _(O,R){let H=O.getFirstChild();H!==null?H.insertBefore(R):O.append(R)}let V=e.createCommand("INSERT_TABLE_COMMAND");return hi.$createTableCellNode=l,hi.$createTableNode=T,hi.$createTableNodeWithDimensions=function(O,R,H=!0){let ee=T();for(let G=0;G<O;G++){let X=u();for(let J=0;J<R;J++){var Y=r.NO_STATUS;typeof H=="object"?(G===0&&H.rows&&(Y|=r.ROW),J===0&&H.columns&&(Y|=r.COLUMN)):H&&(G===0&&(Y|=r.ROW),J===0&&(Y|=r.COLUMN)),Y=l(Y);let ie=e.$createParagraphNode();ie.append(e.$createTextNode()),Y.append(ie),X.append(Y)}ee.append(X)}return ee},hi.$createTableRowNode=u,hi.$deleteTableColumn=function(O,R){let H=O.getChildren();for(let Y=0;Y<H.length;Y++){var ee=H[Y];if(h(ee)){if(ee=ee.getChildren(),R>=ee.length||0>R)throw Error("Table column target index out of range");ee[R].remove()}}return O},hi.$deleteTableColumn__EXPERIMENTAL=function(){var O=e.$getSelection();e.$isRangeSelection(O)||e.DEPRECATED_$isGridSelection(O)||m(118);var R=O.anchor.getNode();O=O.focus.getNode();let[H,,ee]=e.DEPRECATED_$getNodeTriplet(R);[R]=e.DEPRECATED_$getNodeTriplet(O);let[Y,G,X]=e.DEPRECATED_$computeGridMap(ee,H,R);var{startColumn:J}=G;let{startRow:ie,startColumn:ye}=X;O=Math.min(J,ye),J=Math.max(J+H.__colSpan-1,ye+R.__colSpan-1);let me=J-O+1;if(Y[0].length===J-O+1)ee.selectPrevious(),ee.remove();else{var de=Y.length;for(let ce=0;ce<de;ce++)for(let ge=O;ge<=J;ge++){let{cell:be,startColumn:ne}=Y[ce][ge];ne<O?ge===O&&be.setColSpan(be.__colSpan-Math.min(me,be.__colSpan-(O-ne))):ne+be.__colSpan-1>J?ge===J&&be.setColSpan(be.__colSpan-(J-ne+1)):be.remove()}O=Y[ie],R=O[ye+R.__colSpan],R!==void 0?({cell:R}=R,F(R)):({cell:R}=O[ye-1],F(R))}},hi.$deleteTableRow__EXPERIMENTAL=function(){var O=e.$getSelection();e.$isRangeSelection(O)||e.DEPRECATED_$isGridSelection(O)||m(118);var R=O.anchor.getNode();O=O.focus.getNode();let[H,,ee]=e.DEPRECATED_$getNodeTriplet(R);[O]=e.DEPRECATED_$getNodeTriplet(O);let[Y,G,X]=e.DEPRECATED_$computeGridMap(ee,H,O);({startRow:R}=G);var{startRow:J}=X;if(O=J+O.__rowSpan-1,Y.length===O-R+1)ee.remove();else{J=Y[0].length;var ie=Y[O+1],ye=ee.getChildAtIndex(O+1);for(let de=O;de>=R;de--){for(var me=J-1;0<=me;me--){let{cell:ce,startRow:ge,startColumn:be}=Y[de][me];if(be===me&&(de===R&&ge<R&&ce.setRowSpan(ce.__rowSpan-(ge-R)),ge>=R&&ge+ce.__rowSpan-1>O))if(ce.setRowSpan(ce.__rowSpan-(O-ge+1)),ye===null&&m(122),me===0)_(ye,ce);else{let{cell:ne}=ie[me-1];ne.insertAfter(ce)}}me=ee.getChildAtIndex(de),e.DEPRECATED_$isGridRowNode(me)||m(123),me.remove()}ie!==void 0?({cell:R}=ie[0],F(R)):({cell:R}=Y[R-1][0],F(R))}},hi.$getElementGridForTableNode=function(O,R){if(O=O.getElementByKey(R.getKey()),O==null)throw Error("Table Element Not Found");return b(O)},hi.$getTableCellNodeFromLexicalNode=function(O){return O=t.$findMatchingParent(O,R=>c(R)),c(O)?O:null},hi.$getTableColumnIndexFromTableCellNode=function(O){return N(O).getChildren().findIndex(R=>R.is(O))},hi.$getTableNodeFromLexicalNodeOrThrow=K,hi.$getTableRowIndexFromTableCellNode=function(O){let R=N(O);return K(R).getChildren().findIndex(H=>H.is(R))},hi.$getTableRowNodeFromTableCellNodeOrThrow=N,hi.$insertTableColumn=function(O,R,H=!0,ee,Y){let G=O.getChildren();for(let ie=0;ie<G.length;ie++){let ye=G[ie];if(h(ye))for(let me=0;me<ee;me++){var X=ye.getChildren();if(R>=X.length||0>R)throw Error("Table column target index out of range");X=X[R],c(X)||m(12);let{left:de,right:ce}=q(X,Y);var J=r.NO_STATUS;(de&&de.hasHeaderState(r.ROW)||ce&&ce.hasHeaderState(r.ROW))&&(J|=r.ROW),J=l(J),J.append(e.$createParagraphNode()),H?X.insertAfter(J):X.insertBefore(J)}}return O},hi.$insertTableColumn__EXPERIMENTAL=function(O=!0){function R(){let me=l(r.NO_STATUS).append(e.$createParagraphNode());return ie===null&&(ie=me),me}var H=e.$getSelection();e.$isRangeSelection(H)||e.DEPRECATED_$isGridSelection(H)||m(118),H=H.focus.getNode();let[ee,,Y]=e.DEPRECATED_$getNodeTriplet(H),[G,X]=e.DEPRECATED_$computeGridMap(Y,ee,ee);H=G.length;var{startColumn:J}=X;O=O?J+ee.__colSpan-1:J-1,J=Y.getFirstChild(),e.DEPRECATED_$isGridRowNode(J)||m(120);let ie=null;var ye=J;e:for(J=0;J<H;J++){J!==0&&(ye=ye.getNextSibling(),e.DEPRECATED_$isGridRowNode(ye)||m(121));let me=G[J];if(0>O){_(ye,R());continue}let{cell:de,startColumn:ce,startRow:ge}=me[O];if(ce+de.__colSpan-1<=O){let be=de,ne=ge,ae=O;for(;ne!==J&&1<be.__rowSpan;)if(ae-=de.__colSpan,0<=ae){let{cell:fe,startRow:ve}=me[ae];be=fe,ne=ve}else{ye.append(R());continue e}be.insertAfter(R())}else de.setColSpan(de.__colSpan+1)}ie!==null&&F(ie)},hi.$insertTableRow=function(O,R,H=!0,ee,Y){var G=O.getChildren();if(R>=G.length||0>R)throw Error("Table row target index out of range");if(R=G[R],h(R))for(G=0;G<ee;G++){let J=R.getChildren(),ie=J.length,ye=u();for(let me=0;me<ie;me++){var X=J[me];c(X)||m(12);let{above:de,below:ce}=q(X,Y);X=r.NO_STATUS;let ge=de&&de.getWidth()||ce&&ce.getWidth()||void 0;(de&&de.hasHeaderState(r.COLUMN)||ce&&ce.hasHeaderState(r.COLUMN))&&(X|=r.COLUMN),X=l(X,1,ge),X.append(e.$createParagraphNode()),ye.append(X)}H?R.insertAfter(ye):R.insertBefore(ye)}else throw Error("Row before insertion index does not exist.");return O},hi.$insertTableRow__EXPERIMENTAL=function(O=!0){var R=e.$getSelection();e.$isRangeSelection(R)||e.DEPRECATED_$isGridSelection(R)||m(118),R=R.focus.getNode();let[H,,ee]=e.DEPRECATED_$getNodeTriplet(R),[Y,G]=e.DEPRECATED_$computeGridMap(ee,H,H);R=Y[0].length;var{startRow:X}=G;if(O){O=X+H.__rowSpan-1;var J=Y[O];X=u();for(var ie=0;ie<R;ie++){let{cell:ye,startRow:me}=J[ie];me+ye.__rowSpan-1<=O?X.append(l(r.NO_STATUS)):ye.setRowSpan(ye.__rowSpan+1)}R=ee.getChildAtIndex(O),e.DEPRECATED_$isGridRowNode(R)||m(119),R.insertAfter(X)}else{for(J=Y[X],O=u(),ie=0;ie<R;ie++){let{cell:ye,startRow:me}=J[ie];me===X?O.append(l(r.NO_STATUS)):ye.setRowSpan(ye.__rowSpan+1)}R=ee.getChildAtIndex(X),e.DEPRECATED_$isGridRowNode(R)||m(119),R.insertBefore(O)}},hi.$isTableCellNode=c,hi.$isTableNode=z,hi.$isTableRowNode=h,hi.$removeTableRowAtIndex=function(O,R){let H=O.getChildren();if(R>=H.length||0>R)throw Error("Expected table cell to be inside of table row.");return H[R].remove(),O},hi.$unmergeCell=function(){var O=e.$getSelection();e.$isRangeSelection(O)||e.DEPRECATED_$isGridSelection(O)||m(118),O=O.anchor.getNode();let[R,H,ee]=e.DEPRECATED_$getNodeTriplet(O);O=R.__colSpan;let Y=R.__rowSpan;if(1<O){for(var G=1;G<O;G++)R.insertAfter(l(r.NO_STATUS));R.setColSpan(1)}if(1<Y){let[ie,ye]=e.DEPRECATED_$computeGridMap(ee,R,R),{startColumn:me,startRow:de}=ye;for(G=1;G<Y;G++){let ce=de+G,ge=ie[ce];var X=H.getNextSibling();e.DEPRECATED_$isGridRowNode(X)||m(125);var J=null;for(let be=0;be<me;be++){let ne=ge[be],ae=ne.cell;ne.startRow===ce&&(J=ae),1<ae.__colSpan&&(be+=ae.__colSpan-1)}if(J===null)for(J=0;J<O;J++)_(X,l(r.NO_STATUS));else for(X=0;X<O;X++)J.insertAfter(l(r.NO_STATUS))}R.setRowSpan(1)}},hi.INSERT_TABLE_COMMAND=V,hi.TableCellHeaderStates=r,hi.TableCellNode=n,hi.TableNode=D,hi.TableRowNode=d,hi.TableSelection=x,hi.applyTableHandlers=function(O,R,H){let ee=H.getRootElement();if(ee===null)throw Error("No root element.");let Y=new x(H,O.getKey());R.__lexicalTableSelection=Y;let G=!1,X=!1;R.addEventListener("dblclick",de=>{let ce=y(de.target);ce!==null&&(de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),Y.setAnchorCellForSelection(ce),Y.setFocusCellForSelection(ce,!0),G=!1)}),R.addEventListener("mousedown",de=>{setTimeout(()=>{if(de.button===0){var ce=y(de.target);ce!==null&&(de.preventDefault(),de.stopPropagation(),de.stopImmediatePropagation(),Y.setAnchorCellForSelection(ce))}},0)}),R.addEventListener("mousemove",de=>{if(X&&(de.preventDefault(),de.stopPropagation(),de.stopImmediatePropagation()),G){let ce=y(de.target);if(ce!==null){let ge=ce.x,be=ce.y;G&&(Y.anchorX!==ge||Y.anchorY!==be||Y.isHighlightingCells)&&(de.preventDefault(),Y.setFocusCellForSelection(ce))}}}),R.addEventListener("mouseleave",()=>{});let J=de=>{de.button===0&&H.update(()=>{var ce=e.$getSelection();const ge=de.target;if(ge instanceof Node){if(e.DEPRECATED_$isGridSelection(ce)&&ce.gridKey===Y.tableNodeKey&&ee.contains(ge))return Y.clearHighlight();ce=e.$getNearestNodeFromDOMNode(ge),ce!==null&&t.$findMatchingParent(ce,e.DEPRECATED_$isGridNode)&&(G=!0)}})};window.addEventListener("mousedown",J),Y.listenersToRemove.add(()=>window.removeEventListener("mousedown",J));let ie=de=>{var ce;(ce=G)&&(ce=de.target,ce=ce!==null&&ce.nodeName==="SPAN",ce=!ce),ce&&(de.preventDefault(),de.stopPropagation()),G=!1};window.addEventListener("mouseup",ie),Y.listenersToRemove.add(()=>window.removeEventListener("mouseup",ie)),R.addEventListener("mouseup",ie),Y.listenersToRemove.add(()=>R.removeEventListener("mouseup",ie)),Y.listenersToRemove.add(H.registerCommand(e.KEY_ARROW_DOWN_COMMAND,de=>{var ce=e.$getSelection();if(!L(ce,O))return!1;if(e.$isRangeSelection(ce)){if(ce.isCollapsed()){var ge=t.$findMatchingParent(ce.anchor.getNode(),ne=>c(ne));if(!c(ge))return!1;var be=O.getCordsFromCellNode(ge,Y.grid);if(ce=t.$findMatchingParent(ce.anchor.getNode(),ne=>e.$isElementNode(ne)),ce==null)throw Error("Expected BlockNode Parent");if((ge=ge.getLastChild())&&ce.isParentOf(ge)||ce===ge||de.shiftKey)return de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),de.shiftKey?(Y.setAnchorCellForSelection(O.getCellFromCordsOrThrow(be.x,be.y,Y.grid)),I(Y,O,be.x,be.y,"down")):E(Y,O,be.x,be.y,"down")}}else if(e.DEPRECATED_$isGridSelection(ce)&&de.shiftKey)return be=ce.focus.getNode(),c(be)?(be=O.getCordsFromCellNode(be,Y.grid),de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),I(Y,O,be.x,be.y,"down")):!1;return!1},e.COMMAND_PRIORITY_HIGH)),Y.listenersToRemove.add(H.registerCommand(e.KEY_ARROW_UP_COMMAND,de=>{var ce=e.$getSelection();if(!L(ce,O))return!1;if(e.$isRangeSelection(ce)){if(ce.isCollapsed()){var ge=t.$findMatchingParent(ce.anchor.getNode(),ne=>c(ne));if(!c(ge))return!1;var be=O.getCordsFromCellNode(ge,Y.grid);if(ce=t.$findMatchingParent(ce.anchor.getNode(),ne=>e.$isElementNode(ne)),ce==null)throw Error("Expected BlockNode Parent");if((ge=ge.getLastChild())&&ce.isParentOf(ge)||ce===ge||de.shiftKey)return de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),de.shiftKey?(Y.setAnchorCellForSelection(O.getCellFromCordsOrThrow(be.x,be.y,Y.grid)),I(Y,O,be.x,be.y,"up")):E(Y,O,be.x,be.y,"up")}}else if(e.DEPRECATED_$isGridSelection(ce)&&de.shiftKey)return be=ce.focus.getNode(),c(be)?(be=O.getCordsFromCellNode(be,Y.grid),de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),I(Y,O,be.x,be.y,"up")):!1;return!1},e.COMMAND_PRIORITY_HIGH)),Y.listenersToRemove.add(H.registerCommand(e.KEY_ARROW_LEFT_COMMAND,de=>{var ce=e.$getSelection();if(!L(ce,O))return!1;if(e.$isRangeSelection(ce)){if(ce.isCollapsed()){var ge=t.$findMatchingParent(ce.anchor.getNode(),be=>c(be));if(!c(ge))return!1;if(ge=O.getCordsFromCellNode(ge,Y.grid),t.$findMatchingParent(ce.anchor.getNode(),be=>e.$isElementNode(be))==null)throw Error("Expected BlockNode Parent");if(ce.anchor.offset===0||de.shiftKey)return de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),de.shiftKey?(Y.setAnchorCellForSelection(O.getCellFromCordsOrThrow(ge.x,ge.y,Y.grid)),I(Y,O,ge.x,ge.y,"backward")):E(Y,O,ge.x,ge.y,"backward")}}else if(e.DEPRECATED_$isGridSelection(ce)&&de.shiftKey)return ce=ce.focus.getNode(),c(ce)?(ce=O.getCordsFromCellNode(ce,Y.grid),de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),I(Y,O,ce.x,ce.y,"backward")):!1;return!1},e.COMMAND_PRIORITY_HIGH)),Y.listenersToRemove.add(H.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,de=>{var ce=e.$getSelection();if(!L(ce,O))return!1;if(e.$isRangeSelection(ce)){if(ce.isCollapsed()){var ge=t.$findMatchingParent(ce.anchor.getNode(),be=>c(be));if(!c(ge))return!1;if(ge=O.getCordsFromCellNode(ge,Y.grid),t.$findMatchingParent(ce.anchor.getNode(),be=>e.$isElementNode(be))==null)throw Error("Expected BlockNode Parent");if(ce.anchor.offset===ce.anchor.getNode().getTextContentSize()||de.shiftKey)return de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),de.shiftKey?(Y.setAnchorCellForSelection(O.getCellFromCordsOrThrow(ge.x,ge.y,Y.grid)),I(Y,O,ge.x,ge.y,"forward")):E(Y,O,ge.x,ge.y,"forward")}}else if(e.DEPRECATED_$isGridSelection(ce)&&de.shiftKey)return ce=ce.focus.getNode(),c(ce)?(ce=O.getCordsFromCellNode(ce,Y.grid),de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),I(Y,O,ce.x,ce.y,"forward")):!1;return!1},e.COMMAND_PRIORITY_HIGH));let ye=de=>()=>{var ce=e.$getSelection();if(!L(ce,O))return!1;if(e.DEPRECATED_$isGridSelection(ce))return Y.clearText(),!0;if(e.$isRangeSelection(ce)){const ne=t.$findMatchingParent(ce.anchor.getNode(),ae=>c(ae));if(!c(ne))return!1;var ge=ce.anchor.getNode(),be=ce.focus.getNode();if(ge=O.isParentOf(ge),be=O.isParentOf(be),ge&&!be||be&&!ge)return Y.clearText(),!0;if(ge=(be=t.$findMatchingParent(ce.anchor.getNode(),ae=>e.$isElementNode(ae)))&&t.$findMatchingParent(be,ae=>e.$isElementNode(ae)&&c(ae.getParent())),!e.$isElementNode(ge)||!e.$isElementNode(be))return!1;if(de===e.DELETE_LINE_COMMAND&&ge.getPreviousSibling()===null)return!0;if((de===e.DELETE_CHARACTER_COMMAND||de===e.DELETE_WORD_COMMAND)&&ce.isCollapsed()&&ce.anchor.offset===0&&be!==ge){ce=be.getChildren();const ae=e.$createParagraphNode();return ce.forEach(fe=>ae.append(fe)),be.replace(ae),be.getWritable().__parent=ne.getKey(),!0}}return!1};[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(de=>{Y.listenersToRemove.add(H.registerCommand(de,ye(de),e.COMMAND_PRIORITY_CRITICAL))});let me=de=>{const ce=e.$getSelection();return L(ce,O)?e.DEPRECATED_$isGridSelection(ce)?(de.preventDefault(),de.stopPropagation(),Y.clearText(),!0):(e.$isRangeSelection(ce)&&(de=t.$findMatchingParent(ce.anchor.getNode(),ge=>c(ge)),c(de)),!1):!1};return Y.listenersToRemove.add(H.registerCommand(e.KEY_BACKSPACE_COMMAND,me,e.COMMAND_PRIORITY_CRITICAL)),Y.listenersToRemove.add(H.registerCommand(e.KEY_DELETE_COMMAND,me,e.COMMAND_PRIORITY_CRITICAL)),Y.listenersToRemove.add(H.registerCommand(e.FORMAT_TEXT_COMMAND,de=>{let ce=e.$getSelection();return L(ce,O)?e.DEPRECATED_$isGridSelection(ce)?(Y.formatCells(de),!0):(e.$isRangeSelection(ce)&&(de=t.$findMatchingParent(ce.anchor.getNode(),ge=>c(ge)),c(de)),!1):!1},e.COMMAND_PRIORITY_CRITICAL)),Y.listenersToRemove.add(H.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var de=e.$getSelection();return L(de,O)&&(e.DEPRECATED_$isGridSelection(de)?Y.clearHighlight():e.$isRangeSelection(de)&&(de=t.$findMatchingParent(de.anchor.getNode(),ce=>c(ce)),c(de))),!1},e.COMMAND_PRIORITY_CRITICAL)),Y.listenersToRemove.add(H.registerCommand(e.KEY_TAB_COMMAND,de=>{var ce=e.$getSelection();if(!L(ce,O))return!1;if(e.$isRangeSelection(ce)){let ge=t.$findMatchingParent(ce.anchor.getNode(),be=>c(be));if(!c(ge))return!1;if(ce.isCollapsed())return ce=O.getCordsFromCellNode(ge,Y.grid),de.preventDefault(),E(Y,O,ce.x,ce.y,de.shiftKey?"backward":"forward"),!0}return!1},e.COMMAND_PRIORITY_HIGH)),Y.listenersToRemove.add(H.registerCommand(e.FOCUS_COMMAND,()=>O.isSelected(),e.COMMAND_PRIORITY_HIGH)),Y.listenersToRemove.add(H.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{let de=e.$getSelection();var ce=e.$getPreviousSelection();if(de&&e.$isRangeSelection(de)&&!de.isCollapsed()){var ge=de.anchor.getNode(),be=de.focus.getNode();ge=O.isParentOf(ge);var ne=O.isParentOf(be);if(be=ge&&!ne||ne&&!ge,ge=ge&&ne&&!O.isSelected(),be)return ce=de.isBackward(),ge=e.$createRangeSelection(),be=O.getKey(),ge.anchor.set(de.anchor.key,de.anchor.offset,de.anchor.type),ge.focus.set(be,ce?0:O.getChildrenSize(),"element"),X=!0,e.$setSelection(ge),A(Y),!0;if(ge&&({grid:ge}=Y,de.getNodes().filter(c).length===ge.rows*ge.columns)){ge=e.DEPRECATED_$createGridSelection(),be=O.getKey(),ne=O.getFirstChildOrThrow().getFirstChild();let ae=O.getLastChildOrThrow().getLastChild();if(ne!=null&&ae!=null)return ge.set(be,ne.getKey(),ae.getKey()),e.$setSelection(ge),Y.updateTableGridSelection(ge),!0}}return de&&!de.is(ce)&&(e.DEPRECATED_$isGridSelection(de)||e.DEPRECATED_$isGridSelection(ce))&&Y.gridSelection&&!Y.gridSelection.is(ce)?(e.DEPRECATED_$isGridSelection(de)&&de.gridKey===Y.tableNodeKey?Y.updateTableGridSelection(de):!e.DEPRECATED_$isGridSelection(de)&&e.DEPRECATED_$isGridSelection(ce)&&ce.gridKey===Y.tableNodeKey&&Y.updateTableGridSelection(null),!1):(Y.hasHijackedSelectionStyles&&!O.isSelected()?(S(Y),X=!1):!Y.hasHijackedSelectionStyles&&O.isSelected()&&A(Y),!1)},e.COMMAND_PRIORITY_CRITICAL)),Y},hi.getCellFromTarget=y,hi.getTableSelectionFromTableElement=function(O){return O.__lexicalTableSelection},hi}var JH,hme;function SOt(){return hme||(hme=1,JH=kOt()),JH}var XH=SOt(),m$={},mme;function EOt(){if(mme)return m$;mme=1;var e=EM(),t=Ad(),r=Rc(),n=Ta(),a=Tc();function l(f,x){for(let y=0;y<x.length;y++){let b=x[y](f);if(b)return b}return null}let c=/[.,;\s]/;function d(f){f=f.getPreviousSibling(),n.$isElementNode(f)&&(f=f.getLastDescendant());var x;return!(x=f===null||n.$isLineBreakNode(f))&&(x=n.$isTextNode(f))&&(f=f.getTextContent(),x=c.test(f[f.length-1])),x}function p(f){return f=f.getNextSibling(),n.$isElementNode(f)&&(f=f.getFirstDescendant()),f===null||n.$isLineBreakNode(f)||n.$isTextNode(f)&&c.test(f.getTextContent()[0])}function u(f,x,y){var b=f.getChildren();let w=b.length;for(let v=0;v<w;v++){let A=b[v];if(!n.$isTextNode(A)||!A.isSimpleText()){h(f),y(null,f.getURL());return}}b=f.getTextContent(),x=l(b,x),x===null||x.text!==b?(h(f),y(null,f.getURL())):d(f)&&p(f)?(b=f.getURL(),b!==x.url&&(f.setURL(x.url),y(x.url,b)),x.attributes&&(b=f.getRel(),b!==x.attributes.rel&&(f.setRel(x.attributes.rel||null),y(x.attributes.rel||null,b)),b=f.getTarget(),b!==x.attributes.target&&(f.setTarget(x.attributes.target||null),y(x.attributes.target||null,b)))):(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(b=>b.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 b=(w,v)=>{y&&y(w,v)};return r.mergeRegister(f.registerNodeTransform(n.TextNode,w=>{var v=w.getParentOrThrow(),A=w.getPreviousSibling();if(e.$isAutoLinkNode(v))u(v,x,b);else if(!e.$isLinkNode(v)){if(w.isSimpleText()&&(c.test(w.getTextContent()[0])||!e.$isAutoLinkNode(A))){A=v=w.getTextContent();let P=0,T=w;for(var S;(S=l(A,x))&&S!==null;){let z=S.index,N=S.length,K=z+N;var E=P+z,I=P+K,L=v,M=w;if((0<E?c.test(L[E-1]):d(M))&&(I<L.length?c.test(L[I]):p(M))){var D=void 0;P+z===0?[D,T]=T.splitText(P+N):[,D,T]=T.splitText(P+z,P+z+N),E=e.$createAutoLinkNode(S.url,S.attributes),I=n.$createTextNode(S.text),I.setFormat(D.getFormat()),I.setDetail(D.getDetail()),E.append(I),D.replace(E),y&&y(S.url,null),P=0}else P+=K;A=A.substring(K)}}v=w.getPreviousSibling(),S=w.getNextSibling(),D=w.getTextContent(),e.$isAutoLinkNode(v)&&!c.test(D[0])&&(v.append(w),u(v,x,b),w=v.getURL(),y&&y(null,w)),e.$isAutoLinkNode(S)&&!c.test(D[D.length-1])&&(h(S),u(S,x,b),w=S.getURL(),y&&y(null,w))}}))},[f,x,y])}return m$.AutoLinkPlugin=function({matchers:f,onChange:x}){let[y]=t.useLexicalComposerContext();return m(y,f,x),null},m$.createLinkMatcherWithRegExp=function(f,x=y=>y){return y=>{let b=f.exec(y);return b===null?null:{index:b.index,length:b[0].length,text:b[0],url:x(y)}}},m$}var e_,gme;function LOt(){return gme||(gme=1,e_=EOt()),e_}var IOt=LOt(),lw={};lw.d=(e,t)=>{for(var r in t)lw.o(t,r)&&!lw.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})};lw.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var dr=globalThis.pdfjsLib={};lw.d(dr,{AbortException:()=>p5,AnnotationEditorLayer:()=>D0,AnnotationEditorParamsType:()=>gr,AnnotationEditorType:()=>ai,AnnotationEditorUIManager:()=>yg,AnnotationLayer:()=>EHt,AnnotationMode:()=>Fm,CMapCompressionType:()=>$Y,ColorPicker:()=>Uu,DOMSVGFactory:()=>AX,DrawLayer:()=>nl,FeatureTest:()=>vc,GlobalWorkerOptions:()=>ov,ImageKind:()=>nE,InvalidPDFException:()=>Gze,MissingPDFException:()=>d5,OPS:()=>X1,Outliner:()=>BY,PDFDataRangeTransport:()=>dRe,PDFDateString:()=>Xze,PDFWorker:()=>Ud,PasswordResponses:()=>POt,PermissionFlag:()=>BOt,PixelsPerInch:()=>Q8,RenderingCancelledException:()=>$X,TextLayer:()=>PL,UnexpectedResponseException:()=>MM,Util:()=>jo,VerbosityLevel:()=>LM,XfaLayer:()=>uRe,build:()=>sHt,createValidAbsoluteUrl:()=>ROt,fetchData:()=>RM,getDocument:()=>JNt,getFilenameFromUrl:()=>GOt,getPdfFilenameFromUrl:()=>YOt,getXfaPageViewport:()=>KOt,isDataScheme:()=>kX,isPdfFile:()=>SX,noContextMenu:()=>Ec,normalizeUnicode:()=>VOt,renderTextLayer:()=>VNt,setLayerDimensions:()=>H4,shadow:()=>mi,updateTextLayer:()=>QNt,version:()=>aHt});const ul=typeof R0=="object"&&R0+""=="[object process]"&&!R0.versions.nw&&!(R0.versions.electron&&R0.type&&R0.type!=="browser"),Wze=[1,0,0,1,0,0],AY=[.001,0,0,.001,0,0],jOt=1e7,t_=1.35,Nd={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},Fm={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},MOt="pdfjs_internal_editor_",ai={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},gr={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},BOt={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},il={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},nE={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Ha={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},py={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},LM={ERRORS:0,WARNINGS:1,INFOS:5},$Y={NONE:0,BINARY:1},X1={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},POt={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let IM=LM.WARNINGS;function DOt(e){Number.isInteger(e)&&(IM=e)}function TOt(){return IM}function jM(e){IM>=LM.INFOS&&console.log(`Info: ${e}`)}function Nr(e){IM>=LM.WARNINGS&&console.log(`Warning: ${e}`)}function Gi(e){throw new Error(e)}function Wa(e,t){e||Gi(t)}function zOt(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function ROt(e,t=null,r=null){if(!e)return null;try{if(r&&typeof e=="string"&&(r.addDefaultProtocol&&e.startsWith("www.")&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),r.tryConvertEncoding))try{e=_Ot(e)}catch{}const n=t?new URL(e,t):new URL(e);if(zOt(n))return n}catch{}return null}function mi(e,t,r,n=!1){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!0,writable:!1}),r}const Dg=(function(){function t(r,n){this.constructor===t&&Gi("Cannot initialize BaseException."),this.message=r,this.name=n}return t.prototype=new Error,t.constructor=t,t})();class kY extends Dg{constructor(t,r){super(t,"PasswordException"),this.code=r}}class SY extends Dg{constructor(t,r){super(t,"UnknownErrorException"),this.details=r}}class Gze extends Dg{constructor(t){super(t,"InvalidPDFException")}}class d5 extends Dg{constructor(t){super(t,"MissingPDFException")}}class MM extends Dg{constructor(t,r){super(t,"UnexpectedResponseException"),this.status=r}}class FOt extends Dg{constructor(t){super(t,"FormatError")}}class p5 extends Dg{constructor(t){super(t,"AbortException")}}function Yze(e){(typeof e!="object"||e?.length===void 0)&&Gi("Invalid argument for bytesToString");const t=e.length,r=8192;if(t<r)return String.fromCharCode.apply(null,e);const n=[];for(let a=0;a<t;a+=r){const l=Math.min(a+r,t),c=e.subarray(a,l);n.push(String.fromCharCode.apply(null,c))}return n.join("")}function BM(e){typeof e!="string"&&Gi("Invalid argument for stringToBytes");const t=e.length,r=new Uint8Array(t);for(let n=0;n<t;++n)r[n]=e.charCodeAt(n)&255;return r}function OOt(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function vX(e){const t=Object.create(null);for(const[r,n]of e)t[r]=n;return t}function NOt(){const e=new Uint8Array(4);return e[0]=1,new Uint32Array(e.buffer,0,1)[0]===1}function HOt(){try{return new Function(""),!0}catch{return!1}}class vc{static get isLittleEndian(){return mi(this,"isLittleEndian",NOt())}static get isEvalSupported(){return mi(this,"isEvalSupported",HOt())}static get isOffscreenCanvasSupported(){return mi(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&typeof navigator?.platform=="string"?mi(this,"platform",{isMac:navigator.platform.includes("Mac")}):mi(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){return mi(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const o_=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0"));class jo{static makeHexColor(t,r,n){return`#${o_[t]}${o_[r]}${o_[n]}`}static scaleMinMax(t,r){let n;t[0]?(t[0]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=t[0],r[2]*=t[0],t[3]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=t[3],r[3]*=t[3]):(n=r[0],r[0]=r[1],r[1]=n,n=r[2],r[2]=r[3],r[3]=n,t[1]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=t[1],r[3]*=t[1],t[2]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=t[2],r[2]*=t[2]),r[0]+=t[4],r[1]+=t[5],r[2]+=t[4],r[3]+=t[5]}static transform(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]}static applyTransform(t,r){const n=t[0]*r[0]+t[1]*r[2]+r[4],a=t[0]*r[1]+t[1]*r[3]+r[5];return[n,a]}static applyInverseTransform(t,r){const n=r[0]*r[3]-r[1]*r[2],a=(t[0]*r[3]-t[1]*r[2]+r[2]*r[5]-r[4]*r[3])/n,l=(-t[0]*r[1]+t[1]*r[0]+r[4]*r[1]-r[5]*r[0])/n;return[a,l]}static getAxialAlignedBoundingBox(t,r){const n=this.applyTransform(t,r),a=this.applyTransform(t.slice(2,4),r),l=this.applyTransform([t[0],t[3]],r),c=this.applyTransform([t[2],t[1]],r);return[Math.min(n[0],a[0],l[0],c[0]),Math.min(n[1],a[1],l[1],c[1]),Math.max(n[0],a[0],l[0],c[0]),Math.max(n[1],a[1],l[1],c[1])]}static inverseTransform(t){const r=t[0]*t[3]-t[1]*t[2];return[t[3]/r,-t[1]/r,-t[2]/r,t[0]/r,(t[2]*t[5]-t[4]*t[3])/r,(t[4]*t[1]-t[5]*t[0])/r]}static singularValueDecompose2dScale(t){const r=[t[0],t[2],t[1],t[3]],n=t[0]*r[0]+t[1]*r[2],a=t[0]*r[1]+t[1]*r[3],l=t[2]*r[0]+t[3]*r[2],c=t[2]*r[1]+t[3]*r[3],d=(n+c)/2,p=Math.sqrt((n+c)**2-4*(n*c-l*a))/2,u=d+p||1,h=d-p||1;return[Math.sqrt(u),Math.sqrt(h)]}static normalizeRect(t){const r=t.slice(0);return t[0]>t[2]&&(r[0]=t[2],r[2]=t[0]),t[1]>t[3]&&(r[1]=t[3],r[3]=t[1]),r}static intersect(t,r){const n=Math.max(Math.min(t[0],t[2]),Math.min(r[0],r[2])),a=Math.min(Math.max(t[0],t[2]),Math.max(r[0],r[2]));if(n>a)return null;const l=Math.max(Math.min(t[1],t[3]),Math.min(r[1],r[3])),c=Math.min(Math.max(t[1],t[3]),Math.max(r[1],r[3]));return l>c?null:[n,l,a,c]}static#e(t,r,n,a,l,c,d,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*r)+3*f*n)+x*a,b=m*(m*(m*l+3*u*c)+3*f*d)+x*p;h[0]=Math.min(h[0],y),h[1]=Math.min(h[1],b),h[2]=Math.max(h[2],y),h[3]=Math.max(h[3],b)}static#t(t,r,n,a,l,c,d,p,u,h,m,f){if(Math.abs(u)<1e-12){Math.abs(h)>=1e-12&&this.#e(t,r,n,a,l,c,d,p,-m/h,f);return}const x=h**2-4*m*u;if(x<0)return;const y=Math.sqrt(x),b=2*u;this.#e(t,r,n,a,l,c,d,p,(-h+y)/b,f),this.#e(t,r,n,a,l,c,d,p,(-h-y)/b,f)}static bezierBoundingBox(t,r,n,a,l,c,d,p,u){return u?(u[0]=Math.min(u[0],t,d),u[1]=Math.min(u[1],r,p),u[2]=Math.max(u[2],t,d),u[3]=Math.max(u[3],r,p)):u=[Math.min(t,d),Math.min(r,p),Math.max(t,d),Math.max(r,p)],this.#t(t,n,l,d,r,a,c,p,3*(-t+3*(n-l)+d),6*(t-2*n+l),3*(n-t),u),this.#t(t,n,l,d,r,a,c,p,3*(-r+3*(a-c)+p),6*(r-2*a+c),3*(a-r),u),u}}function _Ot(e){return decodeURIComponent(escape(e))}let r_=null,fme=null;function VOt(e){return r_||(r_=/([\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,fme=new Map([["ſt","ſt"]])),e.replaceAll(r_,(t,r,n)=>r?r.normalize("NFKC"):fme.get(n))}function QOt(){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 Yze(e)}const Kze="pdfjs_internal_id_",C0={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 PM{constructor(){this.constructor===PM&&Gi("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,r){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,r,n,a,l){return"none"}destroy(t=!1){}}class DM{#e=!1;constructor({enableHWA:t=!1}={}){this.constructor===DM&&Gi("Cannot initialize BaseCanvasFactory."),this.#e=t}create(t,r){if(t<=0||r<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(t,r);return{canvas:n,context:n.getContext("2d",{willReadFrequently:!this.#e})}}reset(t,r,n){if(!t.canvas)throw new Error("Canvas is not specified");if(r<=0||n<=0)throw new Error("Invalid canvas size");t.canvas.width=r,t.canvas.height=n}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,r){Gi("Abstract method `_createCanvas` called.")}}class TM{constructor({baseUrl:t=null,isCompressed:r=!0}){this.constructor===TM&&Gi("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=r}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 r=this.baseUrl+t+(this.isCompressed?".bcmap":""),n=this.isCompressed?$Y.BINARY:$Y.NONE;return this._fetchData(r,n).catch(a=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${r}`)})}_fetchData(t,r){Gi("Abstract method `_fetchData` called.")}}class zM{constructor({baseUrl:t=null}){this.constructor===zM&&Gi("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 r=`${this.baseUrl}${t}`;return this._fetchData(r).catch(n=>{throw new Error(`Unable to load font data at: ${r}`)})}_fetchData(t){Gi("Abstract method `_fetchData` called.")}}class CX{constructor(){this.constructor===CX&&Gi("Cannot initialize BaseSVGFactory.")}create(t,r,n=!1){if(t<=0||r<=0)throw new Error("Invalid SVG dimensions");const a=this._createSVG("svg:svg");return a.setAttribute("version","1.1"),n||(a.setAttribute("width",`${t}px`),a.setAttribute("height",`${r}px`)),a.setAttribute("preserveAspectRatio","none"),a.setAttribute("viewBox",`0 0 ${t} ${r}`),a}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Gi("Abstract method `_createSVG` called.")}}const I0="http://www.w3.org/2000/svg";class Q8{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}class UOt extends PM{#e;#t;#o;#i;#s;#r=0;constructor({docId:t,ownerDocument:r=globalThis.document}={}){super(),this.#o=t,this.#i=r}get#n(){return this.#e||=new Map}get#l(){return this.#s||=new Map}get#d(){if(!this.#t){const t=this.#i.createElement("div"),{style:r}=t;r.visibility="hidden",r.contain="strict",r.width=r.height=0,r.position="absolute",r.top=r.left=0,r.zIndex=-1;const n=this.#i.createElementNS(I0,"svg");n.setAttribute("width",0),n.setAttribute("height",0),this.#t=this.#i.createElementNS(I0,"defs"),t.append(n),n.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[r,n,a]=t,l=new Array(256),c=new Array(256),d=new Array(256);for(let p=0;p<256;p++)l[p]=r[p]/255,c[p]=n[p]/255,d[p]=a[p]/255;return[l.join(","),c.join(","),d.join(",")]}addFilter(t){if(!t)return"none";let r=this.#n.get(t);if(r)return r;const[n,a,l]=this.#p(t),c=t.length===1?n:`${n}${a}${l}`;if(r=this.#n.get(c),r)return this.#n.set(t,r),r;const d=`g_${this.#o}_transfer_map_${this.#r++}`,p=`url(#${d})`;this.#n.set(t,p),this.#n.set(c,p);const u=this.#a(d);return this.#f(n,a,l,u),p}addHCMFilter(t,r){const n=`${t}-${r}`,a="base";let l=this.#l.get(a);if(l?.key===n||(l?(l.filter?.remove(),l.key=n,l.url="none",l.filter=null):(l={key:n,url:"none",filter:null},this.#l.set(a,l)),!t||!r))return l.url;const c=this.#y(t);t=jo.makeHexColor(...c);const d=this.#y(r);if(r=jo.makeHexColor(...d),this.#d.style.color="",t==="#000000"&&r==="#ffffff"||t===r)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.#c(m);const f=(x,y)=>{const b=c[x]/255,w=d[x]/255,v=new Array(y+1);for(let A=0;A<=y;A++)v[A]=b+A/y*(w-b);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 r=this.#n.get(t);if(r)return r;const[n]=this.#p([t]),a=`alpha_${n}`;if(r=this.#n.get(a),r)return this.#n.set(t,r),r;const l=`g_${this.#o}_alpha_map_${this.#r++}`,c=`url(#${l})`;this.#n.set(t,c),this.#n.set(a,c);const d=this.#a(l);return this.#u(n,d),c}addLuminosityFilter(t){let r=this.#n.get(t||"luminosity");if(r)return r;let n,a;if(t?([n]=this.#p([t]),a=`luminosity_${n}`):a="luminosity",r=this.#n.get(a),r)return this.#n.set(t,r),r;const l=`g_${this.#o}_luminosity_map_${this.#r++}`,c=`url(#${l})`;this.#n.set(t,c),this.#n.set(a,c);const d=this.#a(l);return this.#h(d),t&&this.#u(n,d),c}addHighlightHCMFilter(t,r,n,a,l){const c=`${r}-${n}-${a}-${l}`;let d=this.#l.get(t);if(d?.key===c||(d?(d.filter?.remove(),d.key=c,d.url="none",d.filter=null):(d={key:c,url:"none",filter:null},this.#l.set(t,d)),!r||!n))return d.url;const[p,u]=[r,n].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.#d.style.color="";const y=(v,A,S)=>{const E=new Array(256),I=(m-h)/S,L=v/255,M=(A-v)/(255*S);let D=0;for(let P=0;P<=S;P++){const T=Math.round(h+P*I),z=L+P*M;for(let N=D;N<=T;N++)E[N]=z;D=T+1}for(let P=D;P<256;P++)E[P]=E[D-1];return E.join(",")},b=`g_${this.#o}_hcm_${t}_filter`,w=d.filter=this.#a(b);return this.#c(w),this.#f(y(f[0],x[0],5),y(f[1],x[1],5),y(f[2],x[2],5),w),d.url=`url(#${b})`,d.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 r=this.#i.createElementNS(I0,"feColorMatrix");r.setAttribute("type","matrix"),r.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(r)}#c(t){const r=this.#i.createElementNS(I0,"feColorMatrix");r.setAttribute("type","matrix"),r.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(r)}#a(t){const r=this.#i.createElementNS(I0,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",t),this.#d.append(r),r}#m(t,r,n){const a=this.#i.createElementNS(I0,r);a.setAttribute("type","discrete"),a.setAttribute("tableValues",n),t.append(a)}#f(t,r,n,a){const l=this.#i.createElementNS(I0,"feComponentTransfer");a.append(l),this.#m(l,"feFuncR",t),this.#m(l,"feFuncG",r),this.#m(l,"feFuncB",n)}#u(t,r){const n=this.#i.createElementNS(I0,"feComponentTransfer");r.append(n),this.#m(n,"feFuncA",t)}#y(t){return this.#d.style.color=t,EX(getComputedStyle(this.#d).getPropertyValue("color"))}}class WOt extends DM{constructor({ownerDocument:t=globalThis.document,enableHWA:r=!1}={}){super({enableHWA:r}),this._document=t}_createCanvas(t,r){const n=this._document.createElement("canvas");return n.width=t,n.height=r,n}}async function RM(e,t="text"){if(bb(e,document.baseURI)){const r=await fetch(e);if(!r.ok)throw new Error(r.statusText);switch(t){case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"json":return r.json()}return r.text()}return new Promise((r,n)=>{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":r(a.response);return}r(a.responseText);return}n(new Error(a.statusText))}},a.send(null)})}class qze extends TM{_fetchData(t,r){return RM(t,this.isCompressed?"arraybuffer":"text").then(n=>({cMapData:n instanceof ArrayBuffer?new Uint8Array(n):BM(n),compressionType:r}))}}class Zze extends zM{_fetchData(t){return RM(t,"arraybuffer").then(r=>new Uint8Array(r))}}class AX extends CX{_createSVG(t){return document.createElementNS(I0,t)}}class hC{constructor({viewBox:t,scale:r,rotation:n,offsetX:a=0,offsetY:l=0,dontFlip:c=!1}){this.viewBox=t,this.scale=r,this.rotation=n,this.offsetX=a,this.offsetY=l;const d=(t[2]+t[0])/2,p=(t[3]+t[1])/2;let u,h,m,f;switch(n%=360,n<0&&(n+=360),n){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.")}c&&(m=-m,f=-f);let x,y,b,w;u===0?(x=Math.abs(p-t[1])*r+a,y=Math.abs(d-t[0])*r+l,b=(t[3]-t[1])*r,w=(t[2]-t[0])*r):(x=Math.abs(d-t[0])*r+a,y=Math.abs(p-t[1])*r+l,b=(t[2]-t[0])*r,w=(t[3]-t[1])*r),this.transform=[u*r,h*r,m*r,f*r,x-u*r*d-m*r*p,y-h*r*d-f*r*p],this.width=b,this.height=w}get rawDims(){const{viewBox:t}=this;return mi(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:r=this.rotation,offsetX:n=this.offsetX,offsetY:a=this.offsetY,dontFlip:l=!1}={}){return new hC({viewBox:this.viewBox.slice(),scale:t,rotation:r,offsetX:n,offsetY:a,dontFlip:l})}convertToViewportPoint(t,r){return jo.applyTransform([t,r],this.transform)}convertToViewportRectangle(t){const r=jo.applyTransform([t[0],t[1]],this.transform),n=jo.applyTransform([t[2],t[3]],this.transform);return[r[0],r[1],n[0],n[1]]}convertToPdfPoint(t,r){return jo.applyInverseTransform([t,r],this.transform)}}class $X extends Dg{constructor(t,r=0){super(t,"RenderingCancelledException"),this.extraDelay=r}}function kX(e){const t=e.length;let r=0;for(;r<t&&e[r].trim()==="";)r++;return e.substring(r,r+5).toLowerCase()==="data:"}function SX(e){return typeof e=="string"&&/\.pdf$/i.test(e)}function GOt(e){return[e]=e.split(/[#?]/,1),e.substring(e.lastIndexOf("/")+1)}function YOt(e,t="document.pdf"){if(typeof e!="string")return t;if(kX(e))return Nr('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const r=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,a=r.exec(e);let l=n.exec(a[1])||n.exec(a[2])||n.exec(a[3]);if(l&&(l=l[0],l.includes("%")))try{l=n.exec(decodeURIComponent(l))[0]}catch{}return l||t}class xme{started=Object.create(null);times=[];time(t){t in this.started&&Nr(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||Nr(`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 r=0;for(const{name:n}of this.times)r=Math.max(n.length,r);for(const{name:n,start:a,end:l}of this.times)t.push(`${n.padEnd(r)} ${l-a}ms
246
- `);return t.join("")}}function bb(e,t){try{const{protocol:r}=t?new URL(e,t):new URL(e);return r==="http:"||r==="https:"}catch{return!1}}function Ec(e){e.preventDefault()}function Jze(e){console.log("Deprecated API usage: "+e)}let yme;class Xze{static toDateObject(t){if(!t||typeof t!="string")return null;yme||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const r=yme.exec(t);if(!r)return null;const n=parseInt(r[1],10);let a=parseInt(r[2],10);a=a>=1&&a<=12?a-1:0;let l=parseInt(r[3],10);l=l>=1&&l<=31?l:1;let c=parseInt(r[4],10);c=c>=0&&c<=23?c:0;let d=parseInt(r[5],10);d=d>=0&&d<=59?d:0;let p=parseInt(r[6],10);p=p>=0&&p<=59?p:0;const u=r[7]||"Z";let h=parseInt(r[8],10);h=h>=0&&h<=23?h:0;let m=parseInt(r[9],10)||0;return m=m>=0&&m<=59?m:0,u==="-"?(c+=h,d+=m):u==="+"&&(c-=h,d-=m),new Date(Date.UTC(n,a,l,c,d,p))}}function KOt(e,{scale:t=1,rotation:r=0}){const{width:n,height:a}=e.attributes.style,l=[0,0,parseInt(n),parseInt(a)];return new hC({viewBox:l,scale:t,rotation:r})}function EX(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):(Nr(`Not a valid color format: "${e}"`),[0,0,0])}function qOt(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const r of e.keys()){t.style.color=r;const n=window.getComputedStyle(t).color;e.set(r,EX(n))}t.remove()}function Pn(e){const{a:t,b:r,c:n,d:a,e:l,f:c}=e.getTransform();return[t,r,n,a,l,c]}function A0(e){const{a:t,b:r,c:n,d:a,e:l,f:c}=e.getTransform().invertSelf();return[t,r,n,a,l,c]}function H4(e,t,r=!1,n=!0){if(t instanceof hC){const{pageWidth:a,pageHeight:l}=t.rawDims,{style:c}=e,d=vc.isCSSRoundSupported,p=`var(--scale-factor) * ${a}px`,u=`var(--scale-factor) * ${l}px`,h=d?`round(${p}, 1px)`:`calc(${p})`,m=d?`round(${u}, 1px)`:`calc(${u})`;!r||t.rotation%180===0?(c.width=h,c.height=m):(c.width=m,c.height=h)}n&&e.setAttribute("data-main-rotation",t.rotation)}class LX{#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 r=this.#o._uiManager._signal;t.addEventListener("contextmenu",Ec,{signal:r}),t.addEventListener("pointerdown",LX.#s,{signal:r});const n=this.#i=document.createElement("div");n.className="buttons",t.append(n);const a=this.#o.toolbarPosition;if(a){const{style:l}=t,c=this.#o._uiManager.direction==="ltr"?1-a[0]:a[0];l.insetInlineEnd=`${100*c}%`,l.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return this.#d(),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 r=this.#o._uiManager._signal;t.addEventListener("focusin",this.#r.bind(this),{capture:!0,signal:r}),t.addEventListener("focusout",this.#n.bind(this),{capture:!0,signal:r}),t.addEventListener("contextmenu",Ec,{signal:r})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden")}#d(){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",r=>{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 r=t.renderButton();this.#l(r),this.#i.prepend(r,this.#p)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class ZOt{#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",Ec,{signal:this.#o._signal});const r=this.#e=document.createElement("div");return r.className="buttons",t.append(r),this.#r(),t}#s(t,r){let n=0,a=0;for(const l of t){const c=l.y+l.height;if(c<n)continue;const d=l.x+(r?l.width:0);if(c>n){a=d,n=c;continue}r?d>a&&(a=d):d<a&&(a=d)}return[r?1-a:a,n]}show(t,r,n){const[a,l]=this.#s(r,n),{style:c}=this.#t||=this.#i();t.append(this.#t),c.insetInlineEnd=`${100*a}%`,c.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 r=document.createElement("span");t.append(r),r.className="visuallyHidden",r.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const n=this.#o._signal;t.addEventListener("contextmenu",Ec,{signal:n}),t.addEventListener("click",()=>{this.#o.highlightSelection("floating_button")},{signal:n}),this.#e.append(t)}}function ML(e,t,r){for(const n of r)t.addEventListener(n,e[n].bind(e))}function JOt(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")}class XOt{#e=0;get id(){return`${MOt}${this.#e++}`}}class IX{#e=QOt();#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>',n=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),a=new Image;a.src=t;const l=a.decode().then(()=>(n.drawImage(a,0,0,1,1,0,0,1,3),new Uint32Array(n.getImageData(0,0,1,1).data.buffer)[0]===0));return mi(this,"_isSVGFittingCanvas",l)}async#i(t,r){this.#o||=new Map;let n=this.#o.get(t);if(n===null)return null;if(n?.bitmap)return n.refCounter+=1,n;try{n||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let a;if(typeof r=="string"?(n.url=r,a=await RM(r,"blob")):a=n.file=r,a.type==="image/svg+xml"){const l=IX._isSVGFittingCanvas,c=new FileReader,d=new Image,p=new Promise((u,h)=>{d.onload=()=>{n.bitmap=d,n.isSvg=!0,u()},c.onload=async()=>{const m=n.svgUrl=c.result;d.src=await l?`${m}#svgView(preserveAspectRatio(none))`:m},d.onerror=c.onerror=h});c.readAsDataURL(a),await p}else n.bitmap=await createImageBitmap(a);n.refCounter=1}catch(a){console.error(a),n=null}return this.#o.set(t,n),n&&this.#o.set(n.id,n),n}async getFromFile(t){const{lastModified:r,name:n,size:a,type:l}=t;return this.#i(`${r}_${n}_${a}_${l}`,t)}async getFromUrl(t){return this.#i(t,t)}async getFromId(t){this.#o||=new Map;const r=this.#o.get(t);return r?r.bitmap?(r.refCounter+=1,r):r.file?this.getFromFile(r.file):this.getFromUrl(r.url):null}getSvgUrl(t){const r=this.#o.get(t);return r?.isSvg?r.svgUrl:null}deleteId(t){this.#o||=new Map;const r=this.#o.get(t);r&&(r.refCounter-=1,r.refCounter===0&&(r.bitmap=null))}isValidId(t){return t.startsWith(`image_${this.#e}_`)}}class eNt{#e=[];#t=!1;#o;#i=-1;constructor(t=128){this.#o=t}add({cmd:t,undo:r,post:n,mustExec:a,type:l=NaN,overwriteIfSameType:c=!1,keepUndo:d=!1}){if(a&&t(),this.#t)return;const p={cmd:t,undo:r,post:n,type:l};if(this.#i===-1){this.#e.length>0&&(this.#e.length=0),this.#i=0,this.#e.push(p);return}if(c&&this.#e[this.#i].type===l){d&&(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:r}=this.#e[this.#i];t(),r?.(),this.#t=!1,this.#i-=1}redo(){if(this.#i<this.#e.length-1){this.#i+=1,this.#t=!0;const{cmd:t,post:r}=this.#e[this.#i];t(),r?.(),this.#t=!1}}hasSomethingToUndo(){return this.#i!==-1}hasSomethingToRedo(){return this.#i<this.#e.length-1}destroy(){this.#e=null}}class mC{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:r}=vc.platform;for(const[n,a,l={}]of t)for(const c of n){const d=c.startsWith("mac+");r&&d?(this.callbacks.set(c.slice(4),{callback:a,options:l}),this.allKeys.add(c.split("+").at(-1))):!r&&!d&&(this.callbacks.set(c,{callback:a,options:l}),this.allKeys.add(c.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 r=this.buffer.join("+");return this.buffer.length=0,r}exec(t,r){if(!this.allKeys.has(r.key))return;const n=this.callbacks.get(this.#e(r));if(!n)return;const{callback:a,options:{bubbles:l=!1,args:c=[],checker:d=null}}=n;d&&!d(t,r)||(a.bind(t,...c,r)(),l||(r.stopPropagation(),r.preventDefault()))}}class jX{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return qOt(t),mi(this,"_colors",t)}convert(t){const r=EX(t);if(!window.matchMedia("(forced-colors: active)").matches)return r;for(const[n,a]of this._colors)if(a.every((l,c)=>l===r[c]))return jX._colorsMapping.get(n);return r}getHexCode(t){const r=this._colors.get(t);return r?jo.makeHexColor(...r):t}}class yg{#e=new AbortController;#t=null;#o=new Map;#i=new Map;#s=null;#r=null;#n=null;#l=new eNt;#d=0;#p=new Set;#h=null;#c=null;#a=new Set;#m=!1;#f=null;#u=null;#y=null;#g=!1;#b=null;#v=new XOt;#A=!1;#k=!1;#S=null;#j=null;#$=null;#w=ai.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=yg.prototype,r=c=>c.#H.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&c.hasSomethingToControl(),n=(c,{target:d})=>{if(d instanceof HTMLInputElement){const{type:p}=d;return p!=="text"&&p!=="number"}return!0},a=this.TRANSLATE_SMALL,l=this.TRANSLATE_BIG;return mi(this,"_keyboardManager",new mC([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],t.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:n}],[["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:n}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(c,{target:d})=>!(d instanceof HTMLButtonElement)&&c.#H.contains(d)&&!c.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(c,{target:d})=>!(d instanceof HTMLButtonElement)&&c.#H.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-a,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-l,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[a,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[l,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-a],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-l],checker:r}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,a],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,l],checker:r}]]))}constructor(t,r,n,a,l,c,d,p,u){this._signal=this.#e.signal,this.#H=t,this.#q=r,this.#s=n,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=c,this.#y=d||null,this.#m=p,this.#$=u||null,this.viewParameters={realScale:Q8.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.#b?.hide(),this.#b=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 mi(this,"hcmFilter",this.#E?this.#f.addHCMFilter(this.#E.foreground,this.#E.background):"none")}get direction(){return mi(this,"direction",getComputedStyle(this.#H).direction)}get highlightColors(){return mi(this,"highlightColors",this.#y?new Map(this.#y.split(",").map(t=>t.split("=").map(r=>r.trim()))):null)}get highlightColorNames(){return mi(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){this.#j=t}editAltText(t){this.#s?.editAltText(this,t)}onPageChanging({pageNumber:t}){this.#d=t-1}focusMainContainer(){this.#H.focus()}findParent(t,r){for(const n of this.#i.values()){const{x:a,y:l,width:c,height:d}=n.div.getBoundingClientRect();if(t>=a&&t<=a+c&&r>=l&&r<=l+d)return n}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*Q8.PDF_TO_CSS_UNITS;for(const r of this.#a)r.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 r=document.getSelection();if(!r||r.isCollapsed)return;const{anchorNode:n,anchorOffset:a,focusNode:l,focusOffset:c}=r,d=r.toString(),u=this.#G(r).closest(".textLayer"),h=this.getSelectionBoxes(u);if(h){r.empty(),this.#w===ai.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:ai.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:n,anchorOffset:a,focusNode:l,focusOffset:c,text:d});break}}}#oe(){const t=document.getSelection();if(!t||t.isCollapsed)return;const n=this.#G(t).closest(".textLayer"),a=this.getSelectionBoxes(n);a&&(this.#b||=new ZOt(this),this.#b.show(n,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.#b?.hide(),this.#C=null,this.#I({hasSelectedText:!1}));return}const{anchorNode:r}=t;if(r===this.#C)return;if(!this.#G(t).closest(".textLayer")){this.#C&&(this.#b?.hide(),this.#C=null,this.#I({hasSelectedText:!1}));return}if(this.#b?.hide(),this.#C=r,this.#I({hasSelectedText:!0}),!(this.#w!==ai.HIGHLIGHT&&this.#w!==ai.NONE)&&(this.#w===ai.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#g=this.isShiftKeyDown,!this.isShiftKeyDown)){const l=this._signal,c=d=>{d.type==="pointerup"&&d.button!==0||(window.removeEventListener("pointerup",c),window.removeEventListener("blur",c),d.type==="pointerup"&&this.#Y("main_toolbar"))};window.addEventListener("pointerup",c,{signal:l}),window.addEventListener("blur",c,{signal:l})}}#Y(t=""){this.#w===ai.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 r of this.#x)if(r.div.contains(t)){this.#S=[r,t],r._focusEventsAllowed=!1;break}}focus(){if(!this.#S)return;const[t,r]=this.#S;this.#S=null,r.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),r.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:r}of t.dataTransfer.items)for(const n of this.#c)if(n.isHandlingMimeForPasting(r)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const r of t.dataTransfer.items)for(const n of this.#c)if(n.isHandlingMimeForPasting(r.type)){n.paste(r,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const r=[];for(const n of this.#x){const a=n.serialize(!0);a&&r.push(a)}r.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(r))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:r}=t;for(const l of r.items)for(const c of this.#c)if(c.isHandlingMimeForPasting(l.type)){c.paste(l,this.currentLayer);return}let n=r.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(l){Nr(`paste: "${l.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();const a=this.currentLayer;try{const l=[];for(const p of n){const u=a.deserialize(p);if(!u)return;l.push(u)}const c=()=>{for(const p of l)this.#ee(p);this.#te(l)},d=()=>{for(const p of l)p.remove()};this.addCommands({cmd:c,undo:d,mustExec:!0})}catch(l){Nr(`paste: "${l.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),this.#w!==ai.NONE&&!this.isEditorHandlingKeyboard&&yg._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}}#I(t){Object.entries(t).some(([n,a])=>this.#K[n]!==a)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#K,t)}),this.#w===ai.HIGHLIGHT&&t.hasSelectedEditor===!1&&this.#O([[gr.HIGHLIGHT_FREE,!0]]))}#O(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#ne(),this.#J(),this.#I({isEditing:this.#w!==ai.NONE,isEmpty:this.#W(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ae(),this.#X(),this.#I({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#c){this.#c=t;for(const r of this.#c)this.#O(r.defaultPropertiesToUpdate)}}getId(){return this.#v.id}get currentLayer(){return this.#i.get(this.#d)}getLayer(t){return this.#i.get(t)}get currentPageIndex(){return this.#d}addLayer(t){this.#i.set(t.pageIndex,t),this.#A?t.enable():t.disable()}removeLayer(t){this.#i.delete(t.pageIndex)}updateMode(t,r=null,n=!1){if(this.#w!==t){if(this.#w=t,t===ai.NONE){this.setEditingState(!1),this.#de();return}this.setEditingState(!0),this.#ce(),this.unselectAll();for(const a of this.#i.values())a.updateMode(t);if(!r&&n){this.addNewEditorFromKeyboard();return}if(r){for(const a of this.#o.values())if(a.annotationElementId===r){this.setSelected(a),a.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#w&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,r){if(this.#c){switch(t){case gr.CREATE:this.currentLayer.addNewEditor();return;case gr.HIGHLIGHT_DEFAULT_COLOR:this.#j?.updateColor(r);break;case gr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#L||=new Map).set(t,r),this.showAllEditors("highlight",r);break}for(const n of this.#x)n.updateParams(t,r);for(const n of this.#c)n.updateDefaultParams(t,r)}}showAllEditors(t,r,n=!1){for(const l of this.#o.values())l.editorType===t&&l.show(r);(this.#L?.get(gr.HIGHLIGHT_SHOW_ALL)??!0)!==r&&this.#O([[gr.HIGHLIGHT_SHOW_ALL,r]])}enableWaiting(t=!1){if(this.#k!==t){this.#k=t;for(const r of this.#i.values())t?r.disableClick():r.enableClick(),r.div.classList.toggle("waiting",t)}}#ce(){if(!this.#A){this.#A=!0;for(const t of this.#i.values())t.enable();for(const t of this.#o.values())t.enable()}}#de(){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 r=[];for(const n of this.#o.values())n.pageIndex===t&&r.push(n);return r}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 r=this.#i.get(t.pageIndex);r?r.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.#I({hasSelectedEditor:this.hasSelection});return}this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#I({hasSelectedEditor:!0})}setSelected(t){for(const r of this.#x)r!==t&&r.unselect();this.#x.clear(),this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#I({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.#I({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.#I({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#W()})}redo(){this.#l.redo(),this.#I({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#W()})}addCommands(t){this.#l.add(t),this.#I({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],r=()=>{for(const a of t)a.remove()},n=()=>{for(const a of t)this.#ee(a)};this.addCommands({cmd:r,undo:n,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#te(t){for(const r of this.#x)r.unselect();this.#x.clear();for(const r of t)r.isEmpty()||(this.#x.add(r),r.select());this.#I({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.#w!==ai.NONE))&&this.hasSelection){for(const t of this.#x)t.unselect();this.#x.clear(),this.#I({hasSelectedEditor:!1})}}translateSelectedEditors(t,r,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#V[0]+=t,this.#V[1]+=r;const[a,l]=this.#V,c=[...this.#x],d=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 c)this.#o.has(p.id)&&p.translateInPage(a,l)},undo:()=>{for(const p of c)this.#o.has(p.id)&&p.translateInPage(-a,-l)},mustExec:!1})},d);for(const p of c)p.translateInPage(t,r)}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 r=!1;for(const[{x:a,y:l,pageIndex:c},d]of t)d.newX=a,d.newY=l,d.newPageIndex=c,r||=a!==d.savedX||l!==d.savedY||c!==d.savedPageIndex;if(!r)return!1;const n=(a,l,c,d)=>{if(this.#o.has(a.id)){const p=this.#i.get(d);p?a._setParentAndPosition(p,l,c):(a.pageIndex=d,a.x=l,a.y=c)}};return this.addCommands({cmd:()=>{for(const[a,{newX:l,newY:c,newPageIndex:d}]of t)n(a,l,c,d)},undo:()=>{for(const[a,{savedX:l,savedY:c,savedPageIndex:d}]of t)n(a,l,c,d)},mustExec:!0}),!0}dragSelectedEditors(t,r){if(this.#h)for(const n of this.#h.keys())n.drag(t,r)}rebuild(t){if(t.parent===null){const r=this.getLayer(t.pageIndex);r?(r.changeParent(t),r.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.#w}get imageManager(){return mi(this,"imageManager",new IX)}getSelectionBoxes(t){if(!t)return null;const r=document.getSelection();for(let u=0,h=r.rangeCount;u<h;u++)if(!t.contains(r.getRangeAt(u).commonAncestorContainer))return null;const{x:n,y:a,width:l,height:c}=t.getBoundingClientRect();let d;switch(t.getAttribute("data-main-rotation")){case"90":d=(u,h,m,f)=>({x:(h-a)/c,y:1-(u+m-n)/l,width:f/c,height:m/l});break;case"180":d=(u,h,m,f)=>({x:1-(u+m-n)/l,y:1-(h+f-a)/c,width:m/l,height:f/c});break;case"270":d=(u,h,m,f)=>({x:1-(h+f-a)/c,y:(u-n)/l,width:f/c,height:m/l});break;default:d=(u,h,m,f)=>({x:(u-n)/l,y:(h-a)/c,width:m/l,height:f/c});break}const p=[];for(let u=0,h=r.rangeCount;u<h;u++){const m=r.getRangeAt(u);if(!m.collapsed)for(const{x:f,y:x,width:y,height:b}of m.getClientRects())y===0||b===0||p.push(d(f,x,y,b))}return p.length===0?null:p}addChangedExistingAnnotation({annotationElementId:t,id:r}){(this.#n||=new Map).set(t,r)}removeChangedExistingAnnotation({annotationElementId:t}){this.#n?.delete(t)}renderAnnotationElement(t){const r=this.#n?.get(t.data.id);if(!r)return;const n=this.#r.getRawValue(r);n&&(this.#w===ai.NONE&&!n.hasBeenModified||n.renderAnnotationElement(t))}}class p4{#e="";#t=!1;#o=null;#i=null;#s=null;#r=!1;#n=null;static _l10nPromise=null;constructor(t){this.#n=t}static initialize(t){p4._l10nPromise||=t}async render(){const t=this.#o=document.createElement("button");t.className="altText";const r=await p4._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=r,t.setAttribute("aria-label",r),t.tabIndex="0";const n=this.#n._uiManager._signal;t.addEventListener("contextmenu",Ec,{signal:n}),t.addEventListener("pointerdown",l=>l.stopPropagation(),{signal:n});const a=l=>{l.preventDefault(),this.#n._uiManager.editAltText(this.#n)};return t.addEventListener("click",a,{capture:!0,signal:n}),t.addEventListener("keydown",l=>{l.target===t&&l.key==="Enter"&&(this.#r=!0,a(l))},{signal:n}),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:r}){this.#e===t&&this.#t===r||(this.#e=t,this.#t=r,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"),p4._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(a=>{t.setAttribute("aria-label",a)});let r=this.#i;if(!r){this.#i=r=document.createElement("span"),r.className="tooltip",r.setAttribute("role","tooltip");const a=r.id=`alt-text-tooltip-${this.#n.id}`;t.setAttribute("aria-describedby",a);const l=100,c=this.#n._uiManager._signal;c.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:c}),t.addEventListener("mouseleave",()=>{this.#s&&(clearTimeout(this.#s),this.#s=null),this.#i?.classList.remove("show")},{signal:c})}r.innerText=this.#t?await p4._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):this.#e,r.parentNode||t.append(r),this.#n.getImageForAltText()?.setAttribute("aria-describedby",r.id)}}class ur{#e=null;#t=null;#o=null;#i=!1;#s=!1;#r=null;#n=null;#l=this.focusin.bind(this);#d=this.focusout.bind(this);#p=null;#h="";#c=!1;#a=null;#m=!1;#f=!1;#u=!1;#y=null;#g=0;#b=0;#v=null;_initialOptions=Object.create(null);_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#A=!1;#k=ur._zIndex++;static _borderLineWidth=-1;static _colorManager=new jX;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=ur.prototype._resizeWithKeyboard,r=yg.TRANSLATE_SMALL,n=yg.TRANSLATE_BIG;return mi(this,"_resizerKeyboardManager",new mC([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-r,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[r,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-r]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,r]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,n]}],[["Escape","mac+Escape"],ur.prototype._stopResizingWithKeyboard]]))}constructor(t){this.constructor===ur&&Gi("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:r,rawDims:{pageWidth:n,pageHeight:a,pageX:l,pageY:c}}=this.parent.viewport;this.rotation=r,this.pageRotation=(360+r-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,a],this.pageTranslation=[l,c];const[d,p]=this.parentDimensions;this.x=t.x/d,this.y=t.y/p,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return mi(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const r=new tNt({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});r.annotationElementId=t.annotationElementId,r.deleted=!0,r._uiManager.addToAnnotationStorage(r)}static initialize(t,r,n){if(ur._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,c=>`-${c.toLowerCase()}`))])),n?.strings)for(const l of n.strings)ur._l10nPromise.set(l,t.get(l));if(ur._borderLineWidth!==-1)return;const a=getComputedStyle(document.documentElement);ur._borderLineWidth=parseFloat(a.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,r){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,r){Gi("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,r]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*r/(t*2),this.y+=this.width*t/(r*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*r/(t*2),this.y-=this.width*t/(r*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.#c?this.#c=!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,r,n,a){const[l,c]=this.parentDimensions;[n,a]=this.screenToPageTranslation(n,a),this.x=(t+n)/l,this.y=(r+a)/c,this.fixAndSetPosition()}#S([t,r],n,a){[n,a]=this.screenToPageTranslation(n,a),this.x+=n/t,this.y+=a/r,this.fixAndSetPosition()}translate(t,r){this.#S(this.parentDimensions,t,r)}translateInPage(t,r){this.#a||=[this.x,this.y],this.#S(this.pageDimensions,t,r),this.div.scrollIntoView({block:"nearest"})}drag(t,r){this.#a||=[this.x,this.y];const[n,a]=this.parentDimensions;if(this.x+=t/n,this.y+=r/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:c}=this;const[d,p]=this.getBaseTranslation();l+=d,c+=p,this.div.style.left=`${(100*l).toFixed(2)}%`,this.div.style.top=`${(100*c).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,r]=this.parentDimensions,{_borderLineWidth:n}=ur,a=n/t,l=n/r;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[r,n]=this.pageDimensions;let{x:a,y:l,width:c,height:d}=this;if(c*=r,d*=n,a*=r,l*=n,this._mustFixPosition)switch(t){case 0:a=Math.max(0,Math.min(r-c,a)),l=Math.max(0,Math.min(n-d,l));break;case 90:a=Math.max(0,Math.min(r-d,a)),l=Math.min(n,Math.max(c,l));break;case 180:a=Math.min(r,Math.max(c,a)),l=Math.min(n,Math.max(d,l));break;case 270:a=Math.min(r,Math.max(d,a)),l=Math.max(0,Math.min(n-c,l));break}this.x=a/=r,this.y=l/=n;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#j(t,r,n){switch(n){case 90:return[r,-t];case 180:return[-t,-r];case 270:return[-r,t];default:return[t,r]}}screenToPageTranslation(t,r){return ur.#j(t,r,this.parentRotation)}pageTranslationToScreen(t,r){return ur.#j(t,r,360-this.parentRotation)}#$(t){switch(t){case 90:{const[r,n]=this.pageDimensions;return[0,-r/n,n/r,0]}case 180:return[-1,0,0,-1];case 270:{const[r,n]=this.pageDimensions;return[0,r/n,-n/r,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:[r,n]}=this,a=r*t,l=n*t;return vc.isCSSRoundSupported?[Math.round(a),Math.round(l)]:[a,l]}setDims(t,r){const[n,a]=this.parentDimensions;this.div.style.width=`${(100*t/n).toFixed(2)}%`,this.#s||(this.div.style.height=`${(100*r/a).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:r,width:n}=t,a=n.endsWith("%"),l=!this.#s&&r.endsWith("%");if(a&&l)return;const[c,d]=this.parentDimensions;a||(t.width=`${(100*parseFloat(n)/c).toFixed(2)}%`),!this.#s&&!l&&(t.height=`${(100*parseFloat(r)/d).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#w(){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"],r=this._uiManager._signal;for(const n of t){const a=document.createElement("div");this.#r.append(a),a.classList.add("resizer",n),a.setAttribute("data-resizer-name",n),a.addEventListener("pointerdown",this.#x.bind(this,n),{signal:r}),a.addEventListener("contextmenu",Ec,{signal:r}),a.tabIndex=-1}this.div.prepend(this.#r)}#x(t,r){r.preventDefault();const{isMac:n}=vc.platform;if(r.button!==0||r.ctrlKey&&n)return;this.#o?.toggle(!1);const a=this.#E.bind(this,t),l=this._isDraggable;this._isDraggable=!1;const c=this._uiManager._signal,d={passive:!0,capture:!0,signal:c};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",a,d),window.addEventListener("contextmenu",Ec,{signal:c});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(r.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,d),window.removeEventListener("contextmenu",Ec),this.parent.div.style.cursor=f,this.div.style.cursor=x,this.#C(p,u,h,m)};window.addEventListener("pointerup",y,{signal:c}),window.addEventListener("blur",y,{signal:c})}#C(t,r,n,a){const l=this.x,c=this.y,d=this.width,p=this.height;l===t&&c===r&&d===n&&p===a||this.addCommands({cmd:()=>{this.width=d,this.height=p,this.x=l,this.y=c;const[u,h]=this.parentDimensions;this.setDims(u*d,h*p),this.fixAndSetPosition()},undo:()=>{this.width=n,this.height=a,this.x=t,this.y=r;const[u,h]=this.parentDimensions;this.setDims(u*n,h*a),this.fixAndSetPosition()},mustExec:!0})}#E(t,r){const[n,a]=this.parentDimensions,l=this.x,c=this.y,d=this.width,p=this.height,u=ur.MIN_SIZE/n,h=ur.MIN_SIZE/a,m=V=>Math.round(V*1e4)/1e4,f=this.#$(this.rotation),x=(V,O)=>[f[0]*V+f[2]*O,f[1]*V+f[3]*O],y=this.#$(360-this.rotation),b=(V,O)=>[y[0]*V+y[2]*O,y[1]*V+y[3]*O];let w,v,A=!1,S=!1;switch(t){case"topLeft":A=!0,w=(V,O)=>[0,0],v=(V,O)=>[V,O];break;case"topMiddle":w=(V,O)=>[V/2,0],v=(V,O)=>[V/2,O];break;case"topRight":A=!0,w=(V,O)=>[V,0],v=(V,O)=>[0,O];break;case"middleRight":S=!0,w=(V,O)=>[V,O/2],v=(V,O)=>[0,O/2];break;case"bottomRight":A=!0,w=(V,O)=>[V,O],v=(V,O)=>[0,0];break;case"bottomMiddle":w=(V,O)=>[V/2,O],v=(V,O)=>[V/2,0];break;case"bottomLeft":A=!0,w=(V,O)=>[0,O],v=(V,O)=>[V,0];break;case"middleLeft":S=!0,w=(V,O)=>[0,O/2],v=(V,O)=>[V,O/2];break}const E=w(d,p),I=v(d,p);let L=x(...I);const M=m(l+L[0]),D=m(c+L[1]);let P=1,T=1,[z,N]=this.screenToPageTranslation(r.movementX,r.movementY);if([z,N]=b(z/n,N/a),A){const V=Math.hypot(d,p);P=T=Math.max(Math.min(Math.hypot(I[0]-E[0]-z,I[1]-E[1]-N)/V,1/d,1/p),u/d,h/p)}else S?P=Math.max(u,Math.min(1,Math.abs(I[0]-E[0]-z)))/d:T=Math.max(h,Math.min(1,Math.abs(I[1]-E[1]-N)))/p;const K=m(d*P),q=m(p*T);L=x(...v(K,q));const F=M-L[0],_=D-L[1];this.width=K,this.height=q,this.x=F,this.y=_,this.setDims(n*K,a*q),this.fixAndSetPosition()}altTextFinish(){this.#o?.finish()}async addEditToolbar(){return this.#p||this.#f?this.#p:(this.#p=new LX(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||(p4.initialize(ur._l10nPromise),this.#o=new p4(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.#d,{signal:t});const[r,n]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*n/r).toFixed(2)}%`,this.div.style.maxHeight=`${(100*r/n).toFixed(2)}%`);const[a,l]=this.getInitialTranslation();return this.translate(a,l),ML(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:r}=vc.platform;if(t.button!==0||t.ctrlKey&&r){t.preventDefault();return}if(this.#c=!0,this._isDraggable){this.#B(t);return}this.#L(t)}#L(t){const{isMac:r}=vc.platform;t.ctrlKey&&!r||t.shiftKey||t.metaKey&&r?this.parent.toggleSelected(this):this.parent.setSelected(this)}#B(t){const r=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let n,a;const l=this._uiManager._signal;r&&(this.div.classList.add("moving"),n={passive:!0,capture:!0,signal:l},this.#g=t.clientX,this.#b=t.clientY,a=d=>{const{clientX:p,clientY:u}=d,[h,m]=this.screenToPageTranslation(p-this.#g,u-this.#b);this.#g=p,this.#b=u,this._uiManager.dragSelectedEditors(h,m)},window.addEventListener("pointermove",a,n));const c=()=>{window.removeEventListener("pointerup",c),window.removeEventListener("blur",c),r&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",a,n)),this.#c=!1,this._uiManager.endDragSession()||this.#L(t)};window.addEventListener("pointerup",c,{signal:l}),window.addEventListener("blur",c,{signal:l})}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,r,n){t.changeParent(this),this.x=r,this.y=n,this.fixAndSetPosition()}getRect(t,r,n=this.rotation){const a=this.parentScale,[l,c]=this.pageDimensions,[d,p]=this.pageTranslation,u=t/a,h=r/a,m=this.x*l,f=this.y*c,x=this.width*l,y=this.height*c;switch(n){case 0:return[m+u+d,c-f-h-y+p,m+u+x+d,c-f-h+p];case 90:return[m+h+d,c-f+u+p,m+h+y+d,c-f+u+x+p];case 180:return[m-u-x+d,c-f+h+p,m-u+d,c-f+h+y+p];case 270:return[m-h-y+d,c-f-u-x+p,m-h+d,c-f-u+p];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,r){const[n,a,l,c]=t,d=l-n,p=c-a;switch(this.rotation){case 0:return[n,r-c,d,p];case 90:return[n,r-a,p,d];case 180:return[l,r-a,d,p];case 270:return[l,r-c,p,d];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.#d,{signal:t})}rotate(t){}serialize(t=!1,r=null){Gi("An editor must be serializable")}static deserialize(t,r,n){const a=new this.prototype.constructor({parent:r,id:r.getNextId(),uiManager:n});a.rotation=t.rotation,a.#e=t.accessibilityData;const[l,c]=a.pageDimensions,[d,p,u,h]=a.getRectInCurrentCoords(t.rect,c);return a.x=d/l,a.y=p/c,a.width=u/l,a.height=h/c,a}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",this.#l),this.div.removeEventListener("focusout",this.#d),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.#w(),this.#r.classList.remove("hidden"),ML(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 r=this.#r.children;if(!this.#t){this.#t=Array.from(r);const c=this.#M.bind(this),d=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",c,{signal:p}),u.addEventListener("blur",d,{signal:p}),u.addEventListener("focus",this.#P.bind(this,h),{signal:p}),ur._l10nPromise.get(`pdfjs-editor-resizer-label-${h}`).then(m=>u.setAttribute("aria-label",m))}}const n=this.#t[0];let a=0;for(const c of r){if(c===n)break;a++}const l=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(l!==a){if(l<a)for(let d=0;d<a-l;d++)this.#r.append(this.#r.firstChild);else if(l>a)for(let d=0;d<l-a;d++)this.#r.firstChild.before(this.#r.lastChild);let c=0;for(const d of r){const u=this.#t[c++].getAttribute("data-resizer-name");ur._l10nPromise.get(`pdfjs-editor-resizer-label-${u}`).then(h=>d.setAttribute("aria-label",h))}}this.#z(0),this.#u=!0,this.#r.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#M(t){ur._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 r of this.#t)r.tabIndex=t}_resizeWithKeyboard(t,r){this.#u&&this.#E(this.#h,{movementX:t,movementY:r})}#D(){if(this.#u=!1,this.#z(-1),this.#n){const{savedX:t,savedY:r,savedWidth:n,savedHeight:a}=this.#n;this.#C(t,r,n,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,r){}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,r){this.#s=!0;const n=t/r,{style:a}=this.div;a.aspectRatio=n,a.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,r=!1){if(r){this.#v||=new Map;const{action:n}=t;let a=this.#v.get(n);a&&clearTimeout(a),a=setTimeout(()=>{this._reportTelemetry(t),this.#v.delete(n),this.#v.size===0&&(this.#v=null)},ur._telemetryTimeout),this.#v.set(n,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 r=t.container.querySelector(".annotationContent");if(!r)r=document.createElement("div"),r.classList.add("annotationContent",this.editorType),t.container.prepend(r);else if(r.nodeName==="CANVAS"){const n=r;r=document.createElement("div"),r.classList.add("annotationContent",this.editorType),n.before(r)}return r}resetAnnotationElement(t){const{firstChild:r}=t.container;r.nodeName==="DIV"&&r.classList.contains("annotationContent")&&r.remove()}}class tNt extends ur{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const bme=3285377520,Dd=4294901760,Tu=65535;class eRe{constructor(t){this.h1=t?t&4294967295:bme,this.h2=t?t&4294967295:bme}update(t){let r,n;if(typeof t=="string"){r=new Uint8Array(t.length*2),n=0;for(let b=0,w=t.length;b<w;b++){const v=t.charCodeAt(b);v<=255?r[n++]=v:(r[n++]=v>>>8,r[n++]=v&255)}}else if(ArrayBuffer.isView(t))r=t.slice(),n=r.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const a=n>>2,l=n-a*4,c=new Uint32Array(r.buffer,0,a);let d=0,p=0,u=this.h1,h=this.h2;const m=3432918353,f=461845907,x=m&Tu,y=f&Tu;for(let b=0;b<a;b++)b&1?(d=c[b],d=d*m&Dd|d*x&Tu,d=d<<15|d>>>17,d=d*f&Dd|d*y&Tu,u^=d,u=u<<13|u>>>19,u=u*5+3864292196):(p=c[b],p=p*m&Dd|p*x&Tu,p=p<<15|p>>>17,p=p*f&Dd|p*y&Tu,h^=p,h=h<<13|h>>>19,h=h*5+3864292196);switch(d=0,l){case 3:d^=r[a*4+2]<<16;case 2:d^=r[a*4+1]<<8;case 1:d^=r[a*4],d=d*m&Dd|d*x&Tu,d=d<<15|d>>>17,d=d*f&Dd|d*y&Tu,a&1?u^=d:h^=d}this.h1=u,this.h2=h}hexdigest(){let t=this.h1,r=this.h2;return t^=r>>>1,t=t*3981806797&Dd|t*36045&Tu,r=r*4283543511&Dd|((r<<16|t>>>16)*2950163797&Dd)>>>16,t^=r>>>1,t=t*444984403&Dd|t*60499&Tu,r=r*3301882366&Dd|((r<<16|t>>>16)*3120437893&Dd)>>>16,t^=r>>>1,(t>>>0).toString(16).padStart(8,"0")+(r>>>0).toString(16).padStart(8,"0")}}const EY=Object.freeze({map:null,hash:"",transfer:void 0});class MX{#e=!1;#t=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,r){const n=this.#t.get(t);return n===void 0?r:Object.assign(r,n)}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 r of this.#t.values())if(r instanceof ur)return;this.onAnnotationEditor(null)}}setValue(t,r){const n=this.#t.get(t);let a=!1;if(n!==void 0)for(const[l,c]of Object.entries(r))n[l]!==c&&(a=!0,n[l]=c);else a=!0,this.#t.set(t,r);a&&this.#o(),r instanceof ur&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(r.constructor._type)}has(t){return this.#t.has(t)}getAll(){return this.#t.size>0?vX(this.#t):null}setAll(t){for(const[r,n]of Object.entries(t))this.setValue(r,n)}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 tRe(this)}get serializable(){if(this.#t.size===0)return EY;const t=new Map,r=new eRe,n=[],a=Object.create(null);let l=!1;for(const[c,d]of this.#t){const p=d instanceof ur?d.serialize(!1,a):d;p&&(t.set(c,p),r.update(`${c}:${JSON.stringify(p)}`),l||=!!p.bitmap)}if(l)for(const c of t.values())c.bitmap&&n.push(c.bitmap);return t.size>0?{map:t,hash:r.hexdigest(),transfer:n}:EY}get editorStats(){let t=null;const r=new Map;for(const n of this.#t.values()){if(!(n instanceof ur))continue;const a=n.telemetryFinalData;if(!a)continue;const{type:l}=a;r.has(l)||r.set(l,Object.getPrototypeOf(n).constructor),t||=Object.create(null);const c=t[l]||=new Map;for(const[d,p]of Object.entries(a)){if(d==="type")continue;let u=c.get(d);u||(u=new Map,c.set(d,u));const h=u.get(p)??0;u.set(p,h+1)}}for(const[n,a]of r)t[n]=a.computeTelemetryFinalData(t[n]);return t}}class tRe extends MX{#e;constructor(t){super();const{map:r,hash:n,transfer:a}=t.serializable,l=structuredClone(r,a?{transfer:a}:null);this.#e={map:l,hash:n,transfer:a}}get print(){Gi("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}}class oNt{#e=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:r=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 r=this.styleElement.sheet;r.insertRule(t,r.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:r}){if(!(!t||this.#e.has(t.loadedName))){if(Wa(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:n,src:a,style:l}=t,c=new FontFace(n,a,l);this.addNativeFontFace(c);try{await c.load(),this.#e.add(n),r?.(t)}catch{Nr(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(c)}return}Gi("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 n=t.createNativeFontFace();if(n){this.addNativeFontFace(n);try{await n.loaded}catch(a){throw Nr(`Failed to load font '${n.family}': '${a}'.`),t.disableFontFace=!0,a}}return}const r=t.createFontFaceRule();if(r){if(this.insertRule(r),this.isSyncFontLoadingSupported)return;await new Promise(n=>{const a=this._queueLoadingCallback(n);this._prepareFontLoadEvent(t,a)})}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return mi(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(ul||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),mi(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){function r(){for(Wa(!a.done,"completeRequest() cannot be called twice."),a.done=!0;n.length>0&&n[0].done;){const l=n.shift();setTimeout(l.callback,0)}}const{loadingRequests:n}=this,a={done:!1,complete:r,callback:t};return n.push(a),a}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return mi(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,r){function n(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,M){const D=E.substring(0,I),P=E.substring(I+L);return D+M+P}let l,c;const d=this._document.createElement("canvas");d.width=1,d.height=1;const p=d.getContext("2d");let u=0;function h(E,I){if(++u>30){Nr("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,b=1482184792;let w=n(f,y);for(l=0,c=m.length-3;l<c;l+=4)w=w-b+n(m,l)|0;l<m.length&&(w=w-b+n(m+"XXX",l)|0),f=a(f,y,4,OOt(w));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(),r.complete()})}}class rNt{constructor(t,{disableFontFace:r=!1,inspectFont:n=null}){this.compiledGlyphs=Object.create(null);for(const a in t)this[a]=t[a];this.disableFontFace=r===!0,this._inspectFont=n}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=Yze(this.data),r=`url(data:${this.mimetype};base64,${btoa(t)});`;let n;if(!this.cssFontInfo)n=`@font-face {font-family:"${this.loadedName}";src:${r}}`;else{let a=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(a+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${a}src:${r}}`}return this._inspectFont?.(this,r),n}getPathGenerator(t,r){if(this.compiledGlyphs[r]!==void 0)return this.compiledGlyphs[r];let n;try{n=t.get(this.loadedName+"_path_"+r)}catch(l){Nr(`getPathGenerator - ignoring character: "${l}".`)}if(!Array.isArray(n)||n.length===0)return this.compiledGlyphs[r]=function(l,c){};const a=[];for(let l=0,c=n.length;l<c;)switch(n[l++]){case C0.BEZIER_CURVE_TO:{const[d,p,u,h,m,f]=n.slice(l,l+6);a.push(x=>x.bezierCurveTo(d,p,u,h,m,f)),l+=6}break;case C0.MOVE_TO:{const[d,p]=n.slice(l,l+2);a.push(u=>u.moveTo(d,p)),l+=2}break;case C0.LINE_TO:{const[d,p]=n.slice(l,l+2);a.push(u=>u.lineTo(d,p)),l+=2}break;case C0.QUADRATIC_CURVE_TO:{const[d,p,u,h]=n.slice(l,l+4);a.push(m=>m.quadraticCurveTo(d,p,u,h)),l+=4}break;case C0.RESTORE:a.push(d=>d.restore());break;case C0.SAVE:a.push(d=>d.save());break;case C0.SCALE:Wa(a.length===2,"Scale command is only valid at the third position.");break;case C0.TRANSFORM:{const[d,p,u,h,m,f]=n.slice(l,l+6);a.push(x=>x.transform(d,p,u,h,m,f)),l+=6}break;case C0.TRANSLATE:{const[d,p]=n.slice(l,l+2);a.push(u=>u.translate(d,p)),l+=2}break}return this.compiledGlyphs[r]=function(c,d){a[0](c),a[1](c),c.scale(d,-d);for(let p=2,u=a.length;p<u;p++)a[p](c)}}}if(ul){var LY=Promise.withResolvers(),IY=null;(async()=>{const t=await r4(()=>import("./empty-D_qmwTtc.js").then(d=>d.e),__vite__mapDeps([0,1,2])),r=await r4(()=>import("./index-CEcX7V-S.js").then(d=>d.i),__vite__mapDeps([3,1,4,5,6,7,8,9])),n=await r4(()=>import("./index-D5abkZg2.js").then(d=>d.i),__vite__mapDeps([10,1,11,4,5,6,7,8,9])),a=await r4(()=>import("./url-okO9gg5d.js").then(d=>d.u),__vite__mapDeps([12,1,9,7,5,6,8]));let l,c;return new Map(Object.entries({fs:t,http:r,https:n,url:a,canvas:l,path2d:c}))})().then(t=>{IY=t,LY.resolve()},t=>{Nr(`loadPackages: ${t}`),IY=new Map,LY.resolve()})}class Rh{static get promise(){return LY.promise}static get(t){return IY?.get(t)}}const oRe=function(e){return Rh.get("fs").promises.readFile(e).then(r=>new Uint8Array(r))};class iNt extends PM{}class nNt extends DM{_createCanvas(t,r){return Rh.get("canvas").createCanvas(t,r)}}class aNt extends TM{_fetchData(t,r){return oRe(t).then(n=>({cMapData:n,compressionType:r}))}}class sNt extends zM{_fetchData(t){return oRe(t)}}const Tl={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function jY(e,t){if(!t)return;const r=t[2]-t[0],n=t[3]-t[1],a=new Path2D;a.rect(t[0],t[1],r,n),e.clip(a)}class gC{constructor(){this.constructor===gC&&Gi("Cannot initialize BaseShadingPattern.")}getPattern(){Gi("Abstract method `getPattern` called.")}}class lNt extends gC{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 r;this._type==="axial"?r=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(r=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const n of this._colorStops)r.addColorStop(n[0],n[1]);return r}getPattern(t,r,n,a){let l;if(a===Tl.STROKE||a===Tl.FILL){const c=r.current.getClippedPathBoundingBox(a,Pn(t))||[0,0,0,0],d=Math.ceil(c[2]-c[0])||1,p=Math.ceil(c[3]-c[1])||1,u=r.cachedCanvases.getCanvas("pattern",d,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(-c[0],-c[1]),n=jo.transform(n,[1,0,0,1,c[0],c[1]]),h.transform(...r.baseTransform),this.matrix&&h.transform(...this.matrix),jY(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),l=t.createPattern(u.canvas,"no-repeat");const m=new DOMMatrix(n);l.setTransform(m)}else jY(t,this._bbox),l=this._createGradient(t);return l}}function i_(e,t,r,n,a,l,c,d){const p=t.coords,u=t.colors,h=e.data,m=e.width*4;let f;p[r+1]>p[n+1]&&(f=r,r=n,n=f,f=l,l=c,c=f),p[n+1]>p[a+1]&&(f=n,n=a,a=f,f=c,c=d,d=f),p[r+1]>p[n+1]&&(f=r,r=n,n=f,f=l,l=c,c=f);const x=(p[r]+t.offsetX)*t.scaleX,y=(p[r+1]+t.offsetY)*t.scaleY,b=(p[n]+t.offsetX)*t.scaleX,w=(p[n+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[c],M=u[c+1],D=u[c+2],P=u[d],T=u[d+1],z=u[d+2],N=Math.round(y),K=Math.round(A);let q,F,_,V,O,R,H,ee;for(let Y=N;Y<=K;Y++){if(Y<w){const ye=Y<y?0:(y-Y)/(y-w);q=x-(x-b)*ye,F=S-(S-L)*ye,_=E-(E-M)*ye,V=I-(I-D)*ye}else{let ye;Y>A?ye=1:w===A?ye=0:ye=(w-Y)/(w-A),q=b-(b-v)*ye,F=L-(L-P)*ye,_=M-(M-T)*ye,V=D-(D-z)*ye}let G;Y<y?G=0:Y>A?G=1:G=(y-Y)/(y-A),O=x-(x-v)*G,R=S-(S-P)*G,H=E-(E-T)*G,ee=I-(I-z)*G;const X=Math.round(Math.min(q,O)),J=Math.round(Math.max(q,O));let ie=m*Y+X*4;for(let ye=X;ye<=J;ye++)G=(q-ye)/(q-O),G<0?G=0:G>1&&(G=1),h[ie++]=F-(F-R)*G|0,h[ie++]=_-(_-H)*G|0,h[ie++]=V-(V-ee)*G|0,h[ie++]=255}}function cNt(e,t,r){const n=t.coords,a=t.colors;let l,c;switch(t.type){case"lattice":const d=t.verticesPerRow,p=Math.floor(n.length/d)-1,u=d-1;for(l=0;l<p;l++){let h=l*d;for(let m=0;m<u;m++,h++)i_(e,r,n[h],n[h+1],n[h+d],a[h],a[h+1],a[h+d]),i_(e,r,n[h+d+1],n[h+1],n[h+d],a[h+d+1],a[h+1],a[h+d])}break;case"triangles":for(l=0,c=n.length;l<c;l+=3)i_(e,r,n[l],n[l+1],n[l+2],a[l],a[l+1],a[l+2]);break;default:throw new Error("illegal figure")}}class dNt extends gC{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,r,n){const d=Math.floor(this._bounds[0]),p=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-d,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,b={coords:this._coords,colors:this._colors,offsetX:-d,offsetY:-p,scaleX:1/x,scaleY:1/y},w=m+4,v=f+4,A=n.getCanvas("mesh",w,v,!1),S=A.context,E=S.createImageData(m,f);if(r){const L=E.data;for(let M=0,D=L.length;M<D;M+=4)L[M]=r[0],L[M+1]=r[1],L[M+2]=r[2],L[M+3]=255}for(const L of this._figures)cNt(E,L,b);return S.putImageData(E,2,2),{canvas:A.canvas,offsetX:d-2*x,offsetY:p-2*y,scaleX:x,scaleY:y}}getPattern(t,r,n,a){jY(t,this._bbox);let l;if(a===Tl.SHADING)l=jo.singularValueDecompose2dScale(Pn(t));else if(l=jo.singularValueDecompose2dScale(r.baseTransform),this.matrix){const d=jo.singularValueDecompose2dScale(this.matrix);l=[l[0]*d[0],l[1]*d[1]]}const c=this._createMeshCanvas(l,a===Tl.SHADING?null:this._background,r.cachedCanvases);return a!==Tl.SHADING&&(t.setTransform(...r.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(c.offsetX,c.offsetY),t.scale(c.scaleX,c.scaleY),t.createPattern(c.canvas,"no-repeat")}}class pNt extends gC{getPattern(){return"hotpink"}}function uNt(e){switch(e[0]){case"RadialAxial":return new lNt(e);case"Mesh":return new dNt(e);case"Dummy":return new pNt}throw new Error(`Unknown IR type: ${e[0]}`)}const wme={COLORED:1,UNCOLORED:2};class BX{static MAX_PATTERN_SIZE=3e3;constructor(t,r,n,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=r,this.ctx=n,this.canvasGraphicsFactory=a,this.baseTransform=l}createPatternCanvas(t){const r=this.operatorList,n=this.bbox,a=this.xstep,l=this.ystep,c=this.paintType,d=this.tilingType,p=this.color,u=this.canvasGraphicsFactory;jM("TilingType: "+d);const h=n[0],m=n[1],f=n[2],x=n[3],y=jo.singularValueDecompose2dScale(this.matrix),b=jo.singularValueDecompose2dScale(this.baseTransform),w=[y[0]*b[0],y[1]*b[1]],v=this.getSizeAndScale(a,this.ctx.canvas.width,w[0]),A=this.getSizeAndScale(l,this.ctx.canvas.height,w[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,c,p);let L=h,M=m,D=f,P=x;return h<0&&(L=0,D+=Math.abs(h)),m<0&&(M=0,P+=Math.abs(m)),E.translate(-(v.scale*L),-(A.scale*M)),I.transform(v.scale,0,0,A.scale,0,0),E.save(),this.clipBbox(I,L,M,D,P),I.baseTransform=Pn(I.ctx),I.executeOperatorList(r),I.endDrawing(),{canvas:S.canvas,scaleX:v.scale,scaleY:A.scale,offsetX:L,offsetY:M}}getSizeAndScale(t,r,n){t=Math.abs(t);const a=Math.max(BX.MAX_PATTERN_SIZE,r);let l=Math.ceil(t*n);return l>=a?l=a:n=l/t,{scale:n,size:l}}clipBbox(t,r,n,a,l){const c=a-r,d=l-n;t.ctx.rect(r,n,c,d),t.current.updateRectMinMax(Pn(t.ctx),[r,n,a,l]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,r,n){const a=t.ctx,l=t.current;switch(r){case wme.COLORED:const c=this.ctx;a.fillStyle=c.fillStyle,a.strokeStyle=c.strokeStyle,l.fillColor=c.fillStyle,l.strokeColor=c.strokeStyle;break;case wme.UNCOLORED:const d=jo.makeHexColor(n[0],n[1],n[2]);a.fillStyle=d,a.strokeStyle=d,l.fillColor=d,l.strokeColor=d;break;default:throw new FOt(`Unsupported paint type: ${r}`)}}getPattern(t,r,n,a){let l=n;a!==Tl.SHADING&&(l=jo.transform(l,r.baseTransform),this.matrix&&(l=jo.transform(l,this.matrix)));const c=this.createPatternCanvas(r);let d=new DOMMatrix(l);d=d.translate(c.offsetX,c.offsetY),d=d.scale(1/c.scaleX,1/c.scaleY);const p=t.createPattern(c.canvas,"repeat");return p.setTransform(d),p}}function hNt({src:e,srcPos:t=0,dest:r,width:n,height:a,nonBlackColor:l=4294967295,inverseDecode:c=!1}){const d=vc.isLittleEndian?4278190080:255,[p,u]=c?[l,d]:[d,l],h=n>>3,m=n&7,f=e.length;r=new Uint32Array(r.buffer);let x=0;for(let y=0;y<a;y++){for(const w=t+h;t<w;t++){const v=t<f?e[t]:255;r[x++]=v&128?u:p,r[x++]=v&64?u:p,r[x++]=v&32?u:p,r[x++]=v&16?u:p,r[x++]=v&8?u:p,r[x++]=v&4?u:p,r[x++]=v&2?u:p,r[x++]=v&1?u:p}if(m===0)continue;const b=t<f?e[t++]:255;for(let w=0;w<m;w++)r[x++]=b&1<<7-w?u:p}return{srcPos:t,destPos:x}}const vme=16,Cme=100,mNt=15,Ame=10,$me=1e3,dc=16;function gNt(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(n,a){t.translate(n,a),this.__originalTranslate(n,a)},e.scale=function(n,a){t.scale(n,a),this.__originalScale(n,a)},e.transform=function(n,a,l,c,d,p){t.transform(n,a,l,c,d,p),this.__originalTransform(n,a,l,c,d,p)},e.setTransform=function(n,a,l,c,d,p){t.setTransform(n,a,l,c,d,p),this.__originalSetTransform(n,a,l,c,d,p)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(n){t.rotate(n),this.__originalRotate(n)},e.clip=function(n){t.clip(n),this.__originalClip(n)},e.moveTo=function(r,n){t.moveTo(r,n),this.__originalMoveTo(r,n)},e.lineTo=function(r,n){t.lineTo(r,n),this.__originalLineTo(r,n)},e.bezierCurveTo=function(r,n,a,l,c,d){t.bezierCurveTo(r,n,a,l,c,d),this.__originalBezierCurveTo(r,n,a,l,c,d)},e.rect=function(r,n,a,l){t.rect(r,n,a,l),this.__originalRect(r,n,a,l)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class fNt{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,r,n){let a;return this.cache[t]!==void 0?(a=this.cache[t],this.canvasFactory.reset(a,r,n)):(a=this.canvasFactory.create(r,n),this.cache[t]=a),a}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const r=this.cache[t];this.canvasFactory.destroy(r),delete this.cache[t]}}}function g$(e,t,r,n,a,l,c,d,p,u){const[h,m,f,x,y,b]=Pn(e);if(m===0&&f===0){const A=c*h+y,S=Math.round(A),E=d*x+b,I=Math.round(E),L=(c+p)*h+y,M=Math.abs(Math.round(L)-S)||1,D=(d+u)*x+b,P=Math.abs(Math.round(D)-I)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(x),S,I),e.drawImage(t,r,n,a,l,0,0,M,P),e.setTransform(h,m,f,x,y,b),[M,P]}if(h===0&&x===0){const A=d*f+y,S=Math.round(A),E=c*m+b,I=Math.round(E),L=(d+u)*f+y,M=Math.abs(Math.round(L)-S)||1,D=(c+p)*m+b,P=Math.abs(Math.round(D)-I)||1;return e.setTransform(0,Math.sign(m),Math.sign(f),0,S,I),e.drawImage(t,r,n,a,l,0,0,P,M),e.setTransform(h,m,f,x,y,b),[P,M]}e.drawImage(t,r,n,a,l,c,d,p,u);const w=Math.hypot(h,m),v=Math.hypot(f,x);return[w*p,v*u]}function xNt(e){const{width:t,height:r}=e;if(t>$me||r>$me)return null;const n=1e3,a=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),l=t+1;let c=new Uint8Array(l*(r+1)),d,p,u;const h=t+7&-8;let m=new Uint8Array(h*r),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&&(c[0]=1,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(c[p]=m[f]?2:1,++x),f++;for(m[f]!==0&&(c[p]=2,++x),d=1;d<r;d++){f=d*h,u=d*l,m[f-h]!==m[f]&&(c[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]&&(c[u+p]=a[v],++x),f++;if(m[f-h]!==m[f]&&(c[u+p]=m[f]?2:4,++x),x>n)return null}for(f=h*(r-1),u=d*l,m[f]!==0&&(c[u]=8,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(c[u+p]=m[f]?4:8,++x),f++;if(m[f]!==0&&(c[u+p]=4,++x),x>n)return null;const y=new Int32Array([0,l,-1,0,-l,0,0,0,1]),b=new Path2D;for(d=0;x&&d<=r;d++){let v=d*l;const A=v+t;for(;v<A&&!c[v];)v++;if(v===A)continue;b.moveTo(v%l,d);const S=v;let E=c[v];do{const I=y[E];do v+=I;while(!c[v]);const L=c[v];L!==5&&L!==10?(E=L,c[v]=0):(E=L&51*E>>4,c[v]&=E>>2|E<<2),b.lineTo(v%l,v/l|0),c[v]||--x}while(S!==v);--d}return m=null,c=null,function(v){v.save(),v.scale(1/t,-1/r),v.translate(0,-r),v.fill(b),v.beginPath(),v.restore()}}class kme{constructor(t,r){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=Wze,this.textMatrixScale=1,this.fontMatrix=AY,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=il.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,r])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,r){this.x=t,this.y=r}updatePathMinMax(t,r,n){[r,n]=jo.applyTransform([r,n],t),this.minX=Math.min(this.minX,r),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,r),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(t,r){const n=jo.applyTransform(r,t),a=jo.applyTransform(r.slice(2),t),l=jo.applyTransform([r[0],r[3]],t),c=jo.applyTransform([r[2],r[1]],t);this.minX=Math.min(this.minX,n[0],a[0],l[0],c[0]),this.minY=Math.min(this.minY,n[1],a[1],l[1],c[1]),this.maxX=Math.max(this.maxX,n[0],a[0],l[0],c[0]),this.maxY=Math.max(this.maxY,n[1],a[1],l[1],c[1])}updateScalingPathMinMax(t,r){jo.scaleMinMax(t,r),this.minX=Math.min(this.minX,r[0]),this.minY=Math.min(this.minY,r[1]),this.maxX=Math.max(this.maxX,r[2]),this.maxY=Math.max(this.maxY,r[3])}updateCurvePathMinMax(t,r,n,a,l,c,d,p,u,h){const m=jo.bezierBoundingBox(r,n,a,l,c,d,p,u,h);h||this.updateRectMinMax(t,m)}getPathBoundingBox(t=Tl.FILL,r=null){const n=[this.minX,this.minY,this.maxX,this.maxY];if(t===Tl.STROKE){r||Gi("Stroke bounding box must include transform.");const a=jo.singularValueDecompose2dScale(r),l=a[0]*this.lineWidth/2,c=a[1]*this.lineWidth/2;n[0]-=l,n[1]-=c,n[2]+=l,n[3]+=c}return n}updateClipFromPath(){const t=jo.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=Tl.FILL,r=null){return jo.intersect(this.clipBox,this.getPathBoundingBox(t,r))}}function Sme(e,t){if(typeof ImageData<"u"&&t instanceof ImageData){e.putImageData(t,0,0);return}const r=t.height,n=t.width,a=r%dc,l=(r-a)/dc,c=a===0?l:l+1,d=e.createImageData(n,dc);let p=0,u;const h=t.data,m=d.data;let f,x,y,b;if(t.kind===nE.GRAYSCALE_1BPP){const w=h.byteLength,v=new Uint32Array(m.buffer,0,m.byteLength>>2),A=v.length,S=n+7>>3,E=4294967295,I=vc.isLittleEndian?4278190080:255;for(f=0;f<c;f++){for(y=f<l?dc:a,u=0,x=0;x<y;x++){const L=w-p;let M=0;const D=L>S?n:L*8-7,P=D&-8;let T=0,z=0;for(;M<P;M+=8)z=h[p++],v[u++]=z&128?E:I,v[u++]=z&64?E:I,v[u++]=z&32?E:I,v[u++]=z&16?E:I,v[u++]=z&8?E:I,v[u++]=z&4?E:I,v[u++]=z&2?E:I,v[u++]=z&1?E:I;for(;M<D;M++)T===0&&(z=h[p++],T=128),v[u++]=z&T?E:I,T>>=1}for(;u<A;)v[u++]=0;e.putImageData(d,0,f*dc)}}else if(t.kind===nE.RGBA_32BPP){for(x=0,b=n*dc*4,f=0;f<l;f++)m.set(h.subarray(p,p+b)),p+=b,e.putImageData(d,0,x),x+=dc;f<c&&(b=n*a*4,m.set(h.subarray(p,p+b)),e.putImageData(d,0,x))}else if(t.kind===nE.RGB_24BPP)for(y=dc,b=n*y,f=0;f<c;f++){for(f>=l&&(y=a,b=n*y),u=0,x=b;x--;)m[u++]=h[p++],m[u++]=h[p++],m[u++]=h[p++],m[u++]=255;e.putImageData(d,0,f*dc)}else throw new Error(`bad image kind: ${t.kind}`)}function Eme(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}const r=t.height,n=t.width,a=r%dc,l=(r-a)/dc,c=a===0?l:l+1,d=e.createImageData(n,dc);let p=0;const u=t.data,h=d.data;for(let m=0;m<c;m++){const f=m<l?dc:a;({srcPos:p}=hNt({src:u,srcPos:p,dest:h,width:n,height:f,nonBlackColor:0})),e.putImageData(d,0,m*dc)}}function uy(e,t){const r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of r)e[n]!==void 0&&(t[n]=e[n]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function f$(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),!ul){const{filter:t}=e;t!=="none"&&t!==""&&(e.filter="none")}}function Lme(e,t){if(t)return!0;const r=jo.singularValueDecompose2dScale(e);r[0]=Math.fround(r[0]),r[1]=Math.fround(r[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*Q8.PDF_TO_CSS_UNITS);return r[0]<=n&&r[1]<=n}const yNt=["butt","round","square"],bNt=["miter","round","bevel"],wNt={},Ime={};class d8{constructor(t,r,n,a,l,{optionalContentConfig:c,markedContentStack:d=null},p,u){this.ctx=t,this.current=new kme(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=r,this.objs=n,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=d||[],this.optionalContentConfig=c,this.cachedCanvases=new fNt(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,r=null){return typeof t=="string"?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):r}beginDrawing({transform:t,viewport:r,transparency:n=!1,background:a=null}){const l=this.ctx.canvas.width,c=this.ctx.canvas.height,d=this.ctx.fillStyle;if(this.ctx.fillStyle=a||"#ffffff",this.ctx.fillRect(0,0,l,c),this.ctx.fillStyle=d,n){const p=this.cachedCanvases.getCanvas("transparent",l,c);this.compositeCtx=this.ctx,this.transparentCanvas=p.canvas,this.ctx=p.context,this.ctx.save(),this.ctx.transform(...Pn(this.compositeCtx))}this.ctx.save(),f$(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...r.transform),this.viewportScale=r.scale,this.baseTransform=Pn(this.ctx)}executeOperatorList(t,r,n,a){const l=t.argsArray,c=t.fnArray;let d=r||0;const p=l.length;if(p===d)return d;const u=p-d>Ame&&typeof n=="function",h=u?Date.now()+mNt:0;let m=0;const f=this.commonObjs,x=this.objs;let y;for(;;){if(a!==void 0&&d===a.nextBreakPoint)return a.breakIt(d,n),d;if(y=c[d],y!==X1.dependency)this[y].apply(this,l[d]);else for(const b of l[d]){const w=b.startsWith("g_")?f:x;if(!w.has(b))return w.get(b,n),d}if(d++,d===p)return d;if(u&&++m>Ame){if(Date.now()>h)return n(),d;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 r of t.values())typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement&&(r.width=r.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 r=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=r}}}_scaleImage(t,r){const n=t.width,a=t.height;let l=Math.max(Math.hypot(r[0],r[1]),1),c=Math.max(Math.hypot(r[2],r[3]),1),d=n,p=a,u="prescale1",h,m;for(;l>2&&d>1||c>2&&p>1;){let f=d,x=p;l>2&&d>1&&(f=d>=16384?Math.floor(d/2)-1||1:Math.ceil(d/2),l/=d/f),c>2&&p>1&&(x=p>=16384?Math.floor(p/2)-1||1:Math.ceil(p)/2,c/=p/x),h=this.cachedCanvases.getCanvas(u,f,x),m=h.context,m.clearRect(0,0,f,x),m.drawImage(t,0,0,d,p,0,0,f,x),t=h.canvas,d=f,p=x,u=u==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:d,paintHeight:p}}_createMaskCanvas(t){const r=this.ctx,{width:n,height:a}=t,l=this.current.fillColor,c=this.current.patternFill,d=Pn(r);let p,u,h,m;if((t.bitmap||t.data)&&t.count>1){const D=t.bitmap||t.data.buffer;u=JSON.stringify(c?d:[d.slice(0,4),l]),p=this._cachedBitmapsMap.get(D),p||(p=new Map,this._cachedBitmapsMap.set(D,p));const P=p.get(u);if(P&&!c){const T=Math.round(Math.min(d[0],d[2])+d[4]),z=Math.round(Math.min(d[1],d[3])+d[5]);return{canvas:P,offsetX:T,offsetY:z}}h=P}h||(m=this.cachedCanvases.getCanvas("maskCanvas",n,a),Eme(m.context,t));let f=jo.transform(d,[1/n,0,0,-1/a,0,0]);f=jo.transform(f,[1,0,0,1,0,-a]);const[x,y,b,w]=jo.getAxialAlignedBoundingBox([0,0,n,a],f),v=Math.round(b-x)||1,A=Math.round(w-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,A0(E)),h=h.img,p&&c&&p.set(u,h)),E.imageSmoothingEnabled=Lme(Pn(E),t.interpolate),g$(E,h,0,0,h.width,h.height,0,0,n,a),E.globalCompositeOperation="source-in";const M=jo.transform(A0(E),[1,0,0,1,-I,-L]);return E.fillStyle=c?l.getPattern(r,this,M,Tl.FILL):l,E.fillRect(0,0,n,a),p&&!c&&(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=yNt[t]}setLineJoin(t){this.ctx.lineJoin=bNt[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,r){const n=this.ctx;n.setLineDash!==void 0&&(n.setLineDash(t),n.lineDashOffset=r)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[r,n]of t)switch(r){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n,this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n);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,r=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(n,t,r);this.suspendedCtx=this.ctx,this.ctx=a.context;const l=this.ctx;l.setTransform(...Pn(this.suspendedCtx)),uy(this.suspendedCtx,l),gNt(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(),uy(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 r=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,r,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,r,n,a){const l=a[0],c=a[1],d=a[2]-l,p=a[3]-c;d===0||p===0||(this.genericComposeSMask(r.context,n,d,p,r.subtype,r.backdrop,r.transferMap,l,c,r.offsetX,r.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(n.canvas,0,0),t.restore())}genericComposeSMask(t,r,n,a,l,c,d,p,u,h,m){let f=t.canvas,x=p-h,y=u-m;if(c){if(x<0||y<0||x+n>f.width||y+a>f.height){const w=this.cachedCanvases.getCanvas("maskExtension",n,a),v=w.context;v.drawImage(f,-x,-y),c.some(A=>A!==0)&&(v.globalCompositeOperation="destination-atop",v.fillStyle=jo.makeHexColor(...c),v.fillRect(0,0,n,a),v.globalCompositeOperation="source-over"),f=w.canvas,x=y=0}else if(c.some(w=>w!==0)){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const w=new Path2D;w.rect(x,y,n,a),t.clip(w),t.globalCompositeOperation="destination-atop",t.fillStyle=jo.makeHexColor(...c),t.fillRect(x,y,n,a),t.restore()}}r.save(),r.globalAlpha=1,r.setTransform(1,0,0,1,0,0),l==="Alpha"&&d?r.filter=this.filterFactory.addAlphaFilter(d):l==="Luminosity"&&(r.filter=this.filterFactory.addLuminosityFilter(d));const b=new Path2D;b.rect(p,u,n,a),r.clip(b),r.globalCompositeOperation="destination-in",r.drawImage(f,x,y,n,a,p,u,n,a),r.restore()}save(){this.inSMaskMode?(uy(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(),uy(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,r,n,a,l,c){this.ctx.transform(t,r,n,a,l,c),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,r,n){const a=this.ctx,l=this.current;let c=l.x,d=l.y,p,u;const h=Pn(a),m=h[0]===0&&h[3]===0||h[1]===0&&h[2]===0,f=m?n.slice(0):null;for(let x=0,y=0,b=t.length;x<b;x++)switch(t[x]|0){case X1.rectangle:c=r[y++],d=r[y++];const w=r[y++],v=r[y++],A=c+w,S=d+v;a.moveTo(c,d),w===0||v===0?a.lineTo(A,S):(a.lineTo(A,d),a.lineTo(A,S),a.lineTo(c,S)),m||l.updateRectMinMax(h,[c,d,A,S]),a.closePath();break;case X1.moveTo:c=r[y++],d=r[y++],a.moveTo(c,d),m||l.updatePathMinMax(h,c,d);break;case X1.lineTo:c=r[y++],d=r[y++],a.lineTo(c,d),m||l.updatePathMinMax(h,c,d);break;case X1.curveTo:p=c,u=d,c=r[y+4],d=r[y+5],a.bezierCurveTo(r[y],r[y+1],r[y+2],r[y+3],c,d),l.updateCurvePathMinMax(h,p,u,r[y],r[y+1],r[y+2],r[y+3],c,d,f),y+=6;break;case X1.curveTo2:p=c,u=d,a.bezierCurveTo(c,d,r[y],r[y+1],r[y+2],r[y+3]),l.updateCurvePathMinMax(h,p,u,c,d,r[y],r[y+1],r[y+2],r[y+3],f),c=r[y+2],d=r[y+3],y+=4;break;case X1.curveTo3:p=c,u=d,c=r[y+2],d=r[y+3],a.bezierCurveTo(r[y],r[y+1],c,d,c,d),l.updateCurvePathMinMax(h,p,u,r[y],r[y+1],c,d,c,d,f),y+=4;break;case X1.closePath:a.closePath();break}m&&l.updateScalingPathMinMax(h,f),l.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(t=!0){const r=this.ctx,n=this.current.strokeColor;r.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof n=="object"&&n?.getPattern?(r.save(),r.strokeStyle=n.getPattern(r,this,A0(r),Tl.STROKE),this.rescaleAndStroke(!1),r.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),r.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){const r=this.ctx,n=this.current.fillColor,a=this.current.patternFill;let l=!1;a&&(r.save(),r.fillStyle=n.getPattern(r,this,A0(r),Tl.FILL),l=!0);const c=this.current.getClippedPathBoundingBox();this.contentVisible&&c!==null&&(this.pendingEOFill?(r.fill("evenodd"),this.pendingEOFill=!1):r.fill()),l&&r.restore(),t&&this.consumePath(c)}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=wNt}eoClip(){this.pendingClip=Ime}beginText(){this.current.textMatrix=Wze,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,r=this.ctx;if(t===void 0){r.beginPath();return}r.save(),r.beginPath();for(const n of t)r.setTransform(...n.transform),r.translate(n.x,n.y),n.addToPath(r,n.fontSize);r.restore(),r.clip(),r.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,r){const n=this.commonObjs.get(t),a=this.current;if(!n)throw new Error(`Can't find font for ${t}`);if(a.fontMatrix=n.fontMatrix||AY,(a.fontMatrix[0]===0||a.fontMatrix[3]===0)&&Nr("Invalid font matrix for font "+t),r<0?(r=-r,a.fontDirection=-1):a.fontDirection=1,this.current.font=n,this.current.fontSize=r,n.isType3Font)return;const l=n.loadedName||"sans-serif",c=n.systemFontInfo?.css||`"${l}", ${n.fallbackName}`;let d="normal";n.black?d="900":n.bold&&(d="bold");const p=n.italic?"italic":"normal";let u=r;r<vme?u=vme:r>Cme&&(u=Cme),this.current.fontSizeScale=r/u,this.ctx.font=`${p} ${d} ${u}px ${c}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,r){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=r}setLeadingMoveText(t,r){this.setLeading(-r),this.moveText(t,r)}setTextMatrix(t,r,n,a,l,c){this.current.textMatrix=[t,r,n,a,l,c],this.current.textMatrixScale=Math.hypot(t,r),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,r,n,a){const l=this.ctx,c=this.current,d=c.font,p=c.textRenderingMode,u=c.fontSize/c.fontSizeScale,h=p&il.FILL_STROKE_MASK,m=!!(p&il.ADD_TO_PATH_FLAG),f=c.patternFill&&!d.missingFile;let x;(d.disableFontFace||m||f)&&(x=d.getPathGenerator(this.commonObjs,t)),d.disableFontFace||f?(l.save(),l.translate(r,n),l.beginPath(),x(l,u),a&&l.setTransform(...a),(h===il.FILL||h===il.FILL_STROKE)&&l.fill(),(h===il.STROKE||h===il.FILL_STROKE)&&l.stroke(),l.restore()):((h===il.FILL||h===il.FILL_STROKE)&&l.fillText(t,r,n),(h===il.STROKE||h===il.FILL_STROKE)&&l.strokeText(t,r,n)),m&&(this.pendingTextPaths||=[]).push({transform:Pn(l),x:r,y:n,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 r=t.getImageData(0,0,10,10).data;let n=!1;for(let a=3;a<r.length;a+=4)if(r[a]>0&&r[a]<255){n=!0;break}return mi(this,"isFontSubpixelAAEnabled",n)}showText(t){const r=this.current,n=r.font;if(n.isType3Font)return this.showType3Text(t);const a=r.fontSize;if(a===0)return;const l=this.ctx,c=r.fontSizeScale,d=r.charSpacing,p=r.wordSpacing,u=r.fontDirection,h=r.textHScale*u,m=t.length,f=n.vertical,x=f?1:-1,y=n.defaultVMetrics,b=a*r.fontMatrix[0],w=r.textRenderingMode===il.FILL&&!n.disableFontFace&&!r.patternFill;l.save(),l.transform(...r.textMatrix),l.translate(r.x,r.y+r.textRise),u>0?l.scale(h,-1):l.scale(h,1);let v;if(r.patternFill){l.save();const L=r.fillColor.getPattern(l,this,A0(l),Tl.FILL);v=Pn(l),l.restore(),l.fillStyle=L}let A=r.lineWidth;const S=r.textMatrixScale;if(S===0||A===0){const L=r.textRenderingMode&il.FILL_STROKE_MASK;(L===il.STROKE||L===il.FILL_STROKE)&&(A=this.getSinglePixelWidth())}else A/=S;if(c!==1&&(l.scale(c,c),A/=c),l.lineWidth=A,n.isInvalidPDFjsFont){const L=[];let M=0;for(const D of t)L.push(D.unicode),M+=D.width;l.fillText(L.join(""),0,0),r.x+=M*b*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 M=!1;const D=(L.isSpace?p:0)+d,P=L.fontChar,T=L.accent;let z,N,K=L.width;if(f){const F=L.vmetric||y,_=-(L.vmetric?F[1]:K*.5)*b,V=F[2]*b;K=F?-F[0]:K,z=_/c,N=(E+V)/c}else z=E/c,N=0;if(n.remeasure&&K>0){const F=l.measureText(P).width*1e3/a*c;if(K<F&&this.isFontSubpixelAAEnabled){const _=K/F;M=!0,l.save(),l.scale(_,1),z/=_}else K!==F&&(z+=(K-F)/2e3*a/c)}if(this.contentVisible&&(L.isInFont||n.missingFile)){if(w&&!T)l.fillText(P,z,N);else if(this.paintChar(P,z,N,v),T){const F=z+a*T.offset.x/c,_=N-a*T.offset.y/c;this.paintChar(T.fontChar,F,_,v)}}const q=f?K*b-D*u:K*b+D*u;E+=q,M&&l.restore()}f?r.y-=E:r.x+=E*h,l.restore(),this.compose()}showType3Text(t){const r=this.ctx,n=this.current,a=n.font,l=n.fontSize,c=n.fontDirection,d=a.vertical?1:-1,p=n.charSpacing,u=n.wordSpacing,h=n.textHScale*c,m=n.fontMatrix||AY,f=t.length,x=n.textRenderingMode===il.INVISIBLE;let y,b,w,v;if(!(x||l===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,r.save(),r.transform(...n.textMatrix),r.translate(n.x,n.y),r.scale(h,c),y=0;y<f;++y){if(b=t[y],typeof b=="number"){v=d*b*l/1e3,this.ctx.translate(v,0),n.x+=v*h;continue}const A=(b.isSpace?u:0)+p,S=a.charProcOperatorList[b.operatorListId];if(!S){Nr(`Type3 character "${b.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=b,this.save(),r.scale(l,l),r.transform(...m),this.executeOperatorList(S),this.restore()),w=jo.applyTransform([b.width,0],m)[0]*l+A,r.translate(w,0),n.x+=w*h}r.restore(),this.processingType3=null}}setCharWidth(t,r){}setCharWidthAndBounds(t,r,n,a,l,c){this.ctx.rect(n,a,l-n,c-a),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let r;if(t[0]==="TilingPattern"){const n=t[1],a=this.baseTransform||Pn(this.ctx),l={createCanvasGraphics:c=>new d8(c,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};r=new BX(t,n,this.ctx,l,a)}else r=this._getPattern(t[1],t[2]);return r}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,r,n){const a=jo.makeHexColor(t,r,n);this.ctx.strokeStyle=a,this.current.strokeColor=a}setFillRGBColor(t,r,n){const a=jo.makeHexColor(t,r,n);this.ctx.fillStyle=a,this.current.fillColor=a,this.current.patternFill=!1}_getPattern(t,r=null){let n;return this.cachedPatterns.has(t)?n=this.cachedPatterns.get(t):(n=uNt(this.getObject(t)),this.cachedPatterns.set(t,n)),r&&(n.matrix=r),n}shadingFill(t){if(!this.contentVisible)return;const r=this.ctx;this.save();const n=this._getPattern(t);r.fillStyle=n.getPattern(r,this,A0(r),Tl.SHADING);const a=A0(r);if(a){const{width:l,height:c}=r.canvas,[d,p,u,h]=jo.getAxialAlignedBoundingBox([0,0,l,c],a);this.ctx.fillRect(d,p,u-d,h-p)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Gi("Should not call beginInlineImage")}beginImageData(){Gi("Should not call beginImageData")}paintFormXObjectBegin(t,r){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=Pn(this.ctx),r)){const n=r[2]-r[0],a=r[3]-r[1];this.ctx.rect(r[0],r[1],n,a),this.current.updateRectMinMax(Pn(this.ctx),r),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 r=this.ctx;t.isolated||jM("TODO: Support non-isolated groups."),t.knockout&&Nr("Knockout groups not supported.");const n=Pn(r);if(t.matrix&&r.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let a=jo.getAxialAlignedBoundingBox(t.bbox,Pn(r));const l=[0,0,r.canvas.width,r.canvas.height];a=jo.intersect(a,l)||[0,0,0,0];const c=Math.floor(a[0]),d=Math.floor(a[1]),p=Math.max(Math.ceil(a[2])-c,1),u=Math.max(Math.ceil(a[3])-d,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(-c,-d),f.transform(...n),t.smask?this.smaskStack.push({canvas:m.canvas,context:f,offsetX:c,offsetY:d,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(r.setTransform(1,0,0,1,0,0),r.translate(c,d),r.save()),uy(r,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(r),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const r=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const a=Pn(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...a);const l=jo.getAxialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],a);this.ctx.drawImage(r.canvas,0,0),this.ctx.restore(),this.compose(l)}}beginAnnotation(t,r,n,a,l){if(this.#e(),f$(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),r){const c=r[2]-r[0],d=r[3]-r[1];if(l&&this.annotationCanvasMap){n=n.slice(),n[4]-=r[0],n[5]-=r[1],r=r.slice(),r[0]=r[1]=0,r[2]=c,r[3]=d;const[p,u]=jo.singularValueDecompose2dScale(Pn(this.ctx)),{viewportScale:h}=this,m=Math.ceil(c*this.outputScaleX*h),f=Math.ceil(d*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,d*u),f$(this.ctx)}else f$(this.ctx),this.ctx.rect(r[0],r[1],c,d),this.ctx.clip(),this.endPath()}this.current=new kme(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),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 r=t.count;t=this.getObject(t.data,t),t.count=r;const n=this.ctx,a=this.processingType3;if(a&&(a.compiled===void 0&&(a.compiled=xNt(t)),a.compiled)){a.compiled(n);return}const l=this._createMaskCanvas(t),c=l.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(c,l.offsetX,l.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(t,r,n=0,a=0,l,c){if(!this.contentVisible)return;t=this.getObject(t.data,t);const d=this.ctx;d.save();const p=Pn(d);d.transform(r,n,a,l,0,0);const u=this._createMaskCanvas(t);d.setTransform(1,0,0,1,u.offsetX-p[4],u.offsetY-p[5]);for(let h=0,m=c.length;h<m;h+=2){const f=jo.transform(p,[r,n,a,l,c[h],c[h+1]]),[x,y]=jo.applyTransform([0,0],f);d.drawImage(u.canvas,x,y)}d.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const r=this.ctx,n=this.current.fillColor,a=this.current.patternFill;for(const l of t){const{data:c,width:d,height:p,transform:u}=l,h=this.cachedCanvases.getCanvas("maskCanvas",d,p),m=h.context;m.save();const f=this.getObject(c,l);Eme(m,f),m.globalCompositeOperation="source-in",m.fillStyle=a?n.getPattern(m,this,A0(r),Tl.FILL):n,m.fillRect(0,0,d,p),m.restore(),r.save(),r.transform(...u),r.scale(1,-1),g$(r,h.canvas,0,0,d,p,0,-1,1,1),r.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const r=this.getObject(t);if(!r){Nr("Dependent image isn't ready yet");return}this.paintInlineImageXObject(r)}paintImageXObjectRepeat(t,r,n,a){if(!this.contentVisible)return;const l=this.getObject(t);if(!l){Nr("Dependent image isn't ready yet");return}const c=l.width,d=l.height,p=[];for(let u=0,h=a.length;u<h;u+=2)p.push({transform:[r,0,0,n,a[u],a[u+1]],x:0,y:0,w:c,h:d});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:r,width:n,height:a}=t,l=this.cachedCanvases.getCanvas("inlineImage",n,a),c=l.context;return c.filter=this.current.transferMaps,c.drawImage(r,0,0),c.filter="none",l.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const r=t.width,n=t.height,a=this.ctx;if(this.save(),!ul){const{filter:d}=a;d!=="none"&&d!==""&&(a.filter="none")}a.scale(1/r,-1/n);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",r,n).context;Sme(p,t),l=this.applyTransferMapsToCanvas(p)}const c=this._scaleImage(l,A0(a));a.imageSmoothingEnabled=Lme(Pn(a),t.interpolate),g$(a,c.img,0,0,c.paintWidth,c.paintHeight,0,-n,r,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,r){if(!this.contentVisible)return;const n=this.ctx;let a;if(t.bitmap)a=t.bitmap;else{const l=t.width,c=t.height,p=this.cachedCanvases.getCanvas("inlineImage",l,c).context;Sme(p,t),a=this.applyTransferMapsToCanvas(p)}for(const l of r)n.save(),n.transform(...l.transform),n.scale(1,-1),g$(n,a,l.x,l.y,l.w,l.h,0,-1,1,1),n.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,r){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,r){t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const r=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const n=this.ctx;this.pendingClip&&(r||(this.pendingClip===Ime?n.clip("evenodd"):n.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),n.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Pn(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const r=Math.abs(t[0]*t[3]-t[2]*t[1]),n=Math.hypot(t[0],t[2]),a=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(n,a)/r}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:r,b:n,c:a,d:l}=this.ctx.getTransform();let c,d;if(n===0&&a===0){const p=Math.abs(r),u=Math.abs(l);if(p===u)if(t===0)c=d=1/p;else{const h=p*t;c=d=h<1?1/h:1}else if(t===0)c=1/p,d=1/u;else{const h=p*t,m=u*t;c=h<1?1/h:1,d=m<1?1/m:1}}else{const p=Math.abs(r*l-n*a),u=Math.hypot(r,n),h=Math.hypot(a,l);if(t===0)c=h/p,d=u/p;else{const m=t*p;c=h>m?h/m:1,d=u>m?u/m:1}}this._cachedScaleForStroking[0]=c,this._cachedScaleForStroking[1]=d}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:r}=this,{lineWidth:n}=this.current,[a,l]=this.getScaleForStroking();if(r.lineWidth=n||1,a===1&&l===1){r.stroke();return}const c=r.getLineDash();if(t&&r.save(),r.scale(a,l),c.length>0){const d=Math.max(a,l);r.setLineDash(c.map(p=>p/d)),r.lineDashOffset/=d}r.stroke(),t&&r.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 X1)d8.prototype[e]!==void 0&&(d8.prototype[X1[e]]=d8.prototype[e]);class ov{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 x$={DATA:1,ERROR:2},Ca={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function qc(e){switch(e instanceof Error||typeof e=="object"&&e!==null||Gi('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new p5(e.message);case"MissingPDFException":return new d5(e.message);case"PasswordException":return new kY(e.message,e.code);case"UnexpectedResponseException":return new MM(e.message,e.status);case"UnknownErrorException":return new SY(e.message,e.details);default:return new SY(e.message,e.toString())}}class wb{constructor(t,r,n){this.sourceName=t,this.targetName=r,this.comObj=n,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 d=l.callbackId,p=this.callbackCapabilities[d];if(!p)throw new Error(`Cannot resolve callback ${d}`);if(delete this.callbackCapabilities[d],l.callback===x$.DATA)p.resolve(l.data);else if(l.callback===x$.ERROR)p.reject(qc(l.reason));else throw new Error("Unexpected callback case");return}const c=this.actionHandler[l.action];if(!c)throw new Error(`Unknown action from worker: ${l.action}`);if(l.callbackId){const d=this.sourceName,p=l.sourceName;new Promise(function(u){u(c(l.data))}).then(function(u){n.postMessage({sourceName:d,targetName:p,callback:x$.DATA,callbackId:l.callbackId,data:u})},function(u){n.postMessage({sourceName:d,targetName:p,callback:x$.ERROR,callbackId:l.callbackId,reason:qc(u)})});return}if(l.streamId){this.#e(l);return}c(l.data)},n.addEventListener("message",this._onComObjOnMessage)}on(t,r){const n=this.actionHandler;if(n[t])throw new Error(`There is already an actionName called "${t}"`);n[t]=r}send(t,r,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:r},n)}sendWithPromise(t,r,n){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:r},n)}catch(c){l.reject(c)}return l.promise}sendWithStream(t,r,n,a){const l=this.streamId++,c=this.sourceName,d=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:c,targetName:d,action:t,streamId:l,data:r,desiredSize:u.desiredSize},a),h.promise},pull:u=>{const h=Promise.withResolvers();return this.streamControllers[l].pullCall=h,p.postMessage({sourceName:c,targetName:d,stream:Ca.PULL,streamId:l,desiredSize:u.desiredSize}),h.promise},cancel:u=>{Wa(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:c,targetName:d,stream:Ca.CANCEL,streamId:l,reason:qc(u)}),h.promise}},n)}#e(t){const r=t.streamId,n=this.sourceName,a=t.sourceName,l=this.comObj,c=this,d=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:n,targetName:a,stream:Ca.ENQUEUE,streamId:r,chunk:u},m)},close(){this.isCancelled||(this.isCancelled=!0,l.postMessage({sourceName:n,targetName:a,stream:Ca.CLOSE,streamId:r}),delete c.streamSinks[r])},error(u){Wa(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,l.postMessage({sourceName:n,targetName:a,stream:Ca.ERROR,streamId:r,reason:qc(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[r]=p,new Promise(function(u){u(d(t.data,p))}).then(function(){l.postMessage({sourceName:n,targetName:a,stream:Ca.START_COMPLETE,streamId:r,success:!0})},function(u){l.postMessage({sourceName:n,targetName:a,stream:Ca.START_COMPLETE,streamId:r,reason:qc(u)})})}#t(t){const r=t.streamId,n=this.sourceName,a=t.sourceName,l=this.comObj,c=this.streamControllers[r],d=this.streamSinks[r];switch(t.stream){case Ca.START_COMPLETE:t.success?c.startCall.resolve():c.startCall.reject(qc(t.reason));break;case Ca.PULL_COMPLETE:t.success?c.pullCall.resolve():c.pullCall.reject(qc(t.reason));break;case Ca.PULL:if(!d){l.postMessage({sourceName:n,targetName:a,stream:Ca.PULL_COMPLETE,streamId:r,success:!0});break}d.desiredSize<=0&&t.desiredSize>0&&d.sinkCapability.resolve(),d.desiredSize=t.desiredSize,new Promise(function(p){p(d.onPull?.())}).then(function(){l.postMessage({sourceName:n,targetName:a,stream:Ca.PULL_COMPLETE,streamId:r,success:!0})},function(p){l.postMessage({sourceName:n,targetName:a,stream:Ca.PULL_COMPLETE,streamId:r,reason:qc(p)})});break;case Ca.ENQUEUE:if(Wa(c,"enqueue should have stream controller"),c.isClosed)break;c.controller.enqueue(t.chunk);break;case Ca.CLOSE:if(Wa(c,"close should have stream controller"),c.isClosed)break;c.isClosed=!0,c.controller.close(),this.#o(c,r);break;case Ca.ERROR:Wa(c,"error should have stream controller"),c.controller.error(qc(t.reason)),this.#o(c,r);break;case Ca.CANCEL_COMPLETE:t.success?c.cancelCall.resolve():c.cancelCall.reject(qc(t.reason)),this.#o(c,r);break;case Ca.CANCEL:if(!d)break;new Promise(function(p){p(d.onCancel?.(qc(t.reason)))}).then(function(){l.postMessage({sourceName:n,targetName:a,stream:Ca.CANCEL_COMPLETE,streamId:r,success:!0})},function(p){l.postMessage({sourceName:n,targetName:a,stream:Ca.CANCEL_COMPLETE,streamId:r,reason:qc(p)})}),d.sinkCapability.reject(qc(t.reason)),d.isCancelled=!0,delete this.streamSinks[r];break;default:throw new Error("Unexpected stream case")}}async#o(t,r){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[r]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}class vNt{#e;#t;constructor({parsedData:t,rawData:r}){this.#e=t,this.#t=r}getRaw(){return this.#t}get(t){return this.#e.get(t)??null}getAll(){return vX(this.#e)}has(t){return this.#e.has(t)}}const Sm=Symbol("INTERNAL");class CNt{#e=!1;#t=!1;#o=!1;#i=!0;constructor(t,{name:r,intent:n,usage:a}){this.#e=!!(t&Nd.DISPLAY),this.#t=!!(t&Nd.PRINT),this.name=r,this.intent=n,this.usage=a}get visible(){if(this.#o)return this.#i;if(!this.#i)return!1;const{print:t,view:r}=this.usage;return this.#e?r?.viewState!=="OFF":this.#t?t?.printState!=="OFF":!0}_setVisible(t,r,n=!1){t!==Sm&&Gi("Internal method `_setVisible` called."),this.#o=n,this.#i=r}}class ANt{#e=null;#t=new Map;#o=null;#i=null;constructor(t,r=Nd.DISPLAY){if(this.renderingIntent=r,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,this.#i=t.order;for(const n of t.groups)this.#t.set(n.id,new CNt(r,n));if(t.baseState==="OFF")for(const n of this.#t.values())n._setVisible(Sm,!1);for(const n of t.on)this.#t.get(n)._setVisible(Sm,!0);for(const n of t.off)this.#t.get(n)._setVisible(Sm,!1);this.#o=this.getHash()}}#s(t){const r=t.length;if(r<2)return!0;const n=t[0];for(let a=1;a<r;a++){const l=t[a];let c;if(Array.isArray(l))c=this.#s(l);else if(this.#t.has(l))c=this.#t.get(l).visible;else return Nr(`Optional content group not found: ${l}`),!0;switch(n){case"And":if(!c)return!1;break;case"Or":if(c)return!0;break;case"Not":return!c;default:return!0}}return n==="And"}isVisible(t){if(this.#t.size===0)return!0;if(!t)return jM("Optional content group not defined."),!0;if(t.type==="OCG")return this.#t.has(t.id)?this.#t.get(t.id).visible:(Nr(`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 r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(this.#t.get(r).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(!this.#t.get(r).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(!this.#t.get(r).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(this.#t.get(r).visible)return!1}return!0}return Nr(`Unknown optional content policy ${t.policy}.`),!0}return Nr(`Unknown group type ${t.type}.`),!0}setVisibility(t,r=!0){const n=this.#t.get(t);if(!n){Nr(`Optional content group not found: ${t}`);return}n._setVisible(Sm,!!r,!0),this.#e=null}setOCGState({state:t,preserveRB:r}){let n;for(const a of t){switch(a){case"ON":case"OFF":case"Toggle":n=a;continue}const l=this.#t.get(a);if(l)switch(n){case"ON":l._setVisible(Sm,!0);break;case"OFF":l._setVisible(Sm,!1);break;case"Toggle":l._setVisible(Sm,!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?vX(this.#t):null}getGroup(t){return this.#t.get(t)||null}getHash(){if(this.#e!==null)return this.#e;const t=new eRe;for(const[r,n]of this.#t)t.update(`${r}:${n.visible}`);return this.#e=t.hexdigest()}}class $Nt{constructor(t,{disableRange:r=!1,disableStream:n=!1}){Wa(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:a,initialData:l,progressiveDone:c,contentDispositionFilename:d}=t;if(this._queuedChunks=[],this._progressiveDone=c,this._contentDispositionFilename=d,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=!n,this._isRangeSupported=!r,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:r}){const n=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const a=this._rangeReaders.some(function(l){return l._begin!==t?!1:(l._enqueue(n),!0)});Wa(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 r=this._rangeReaders.indexOf(t);r>=0&&this._rangeReaders.splice(r,1)}getFullReader(){Wa(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new kNt(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;const n=new SNt(this,t,r);return this._pdfDataRangeTransport.requestDataRange(t,r),this._rangeReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeReaders.slice(0))r.cancel(t);this._pdfDataRangeTransport.abort()}}class kNt{constructor(t,r,n=!1,a=null){this._stream=t,this._done=n||!1,this._filename=SX(a)?a:null,this._queuedChunks=r||[],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 r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class SNt{constructor(t,r,n){this._stream=t,this._begin=r,this._end=n,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 n of this._requests)n.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 r=this._queuedChunk;return this._queuedChunk=null,{value:r,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 r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function ENt(e){let t=!0,r=n("filename\\*","i").exec(e);if(r){r=r[1];let h=d(r);return h=unescape(h),h=p(h),h=u(h),l(h)}if(r=c(e),r){const h=u(r);return l(h)}if(r=n("filename","i").exec(e),r){r=r[1];let h=d(r);return h=u(h),l(h)}function n(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=BM(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 c(h){const m=[];let f;const x=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=x.exec(h))!==null;){let[,b,w,v]=f;if(b=parseInt(b,10),b in m){if(b===0)break;continue}m[b]=[w,v]}const y=[];for(let b=0;b<m.length&&b in m;++b){let[w,v]=m[b];v=d(v),w&&(v=unescape(v),b===0&&(v=p(v))),y.push(v)}return y.join("")}function d(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(b,w){return String.fromCharCode(parseInt(w,16))}),a(f,y);try{y=atob(y)}catch{}return a(f,y)})}return""}function PX({getResponseHeader:e,isHttp:t,rangeChunkSize:r,disableRange:n}){const a={allowRangeRequests:!1,suggestedLength:void 0},l=parseInt(e("Content-Length"),10);return!Number.isInteger(l)||(a.suggestedLength=l,l<=2*r)||n||!t||e("Accept-Ranges")!=="bytes"||(e("Content-Encoding")||"identity")!=="identity"||(a.allowRangeRequests=!0),a}function DX(e){const t=e("Content-Disposition");if(t){let r=ENt(t);if(r.includes("%"))try{r=decodeURIComponent(r)}catch{}if(SX(r))return r}return null}function FM(e,t){return e===404||e===0&&t.startsWith("file:")?new d5('Missing PDF "'+t+'".'):new MM(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)}function rRe(e){return e===200||e===206}function iRe(e,t,r){return{method:"GET",headers:e,signal:r.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function nRe(e){const t=new Headers;for(const r in e){const n=e[r];n!==void 0&&t.append(r,n)}return t}function aRe(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(Nr(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}class jme{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 Wa(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new LNt(this),this._fullRequestReader}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;const n=new INt(this,t,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class LNt{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const r=t.source;this._withCredentials=r.withCredentials||!1,this._contentLength=r.length,this._headersCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.disableRange,this._headers=nRe(this._stream.httpHeaders);const n=r.url;fetch(n,iRe(this._headers,this._withCredentials,this._abortController)).then(a=>{if(!rRe(a.status))throw FM(a.status,n);this._reader=a.body.getReader(),this._headersCapability.resolve();const l=p=>a.headers.get(p),{allowRangeRequests:c,suggestedLength:d}=PX({getResponseHeader:l,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=c,this._contentLength=d||this._contentLength,this._filename=DX(l),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new p5("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:r}=await this._reader.read();return r?{value:t,done:r}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:aRe(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class INt{constructor(t,r,n){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=nRe(this._stream.httpHeaders),this._headers.append("Range",`bytes=${r}-${n-1}`);const l=a.url;fetch(l,iRe(this._headers,this._withCredentials,this._abortController)).then(c=>{if(!rRe(c.status))throw FM(c.status,l);this._readCapability.resolve(),this._reader=c.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:r}=await this._reader.read();return r?{value:t,done:r}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:aRe(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}const n_=200,a_=206;function jNt(e){const t=e.response;return typeof t!="string"?t:BM(t).buffer}class MNt{constructor(t,r={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&r.httpHeaders||Object.create(null),this.withCredentials=r.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,r,n){const a={begin:t,end:r};for(const l in n)a[l]=n[l];return this.request(a)}requestFull(t){return this.request(t)}request(t){const r=new XMLHttpRequest,n=this.currXhrId++,a=this.pendingRequests[n]={xhr:r};r.open("GET",this.url),r.withCredentials=this.withCredentials;for(const l in this.httpHeaders){const c=this.httpHeaders[l];c!==void 0&&r.setRequestHeader(l,c)}return this.isHttp&&"begin"in t&&"end"in t?(r.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),a.expectedStatus=a_):a.expectedStatus=n_,r.responseType="arraybuffer",t.onError&&(r.onerror=function(l){t.onError(r.status)}),r.onreadystatechange=this.onStateChange.bind(this,n),r.onprogress=this.onProgress.bind(this,n),a.onHeadersReceived=t.onHeadersReceived,a.onDone=t.onDone,a.onError=t.onError,a.onProgress=t.onProgress,r.send(null),n}onProgress(t,r){const n=this.pendingRequests[t];n&&n.onProgress?.(r)}onStateChange(t,r){const n=this.pendingRequests[t];if(!n)return;const a=n.xhr;if(a.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),a.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],a.status===0&&this.isHttp){n.onError?.(a.status);return}const l=a.status||n_;if(!(l===n_&&n.expectedStatus===a_)&&l!==n.expectedStatus){n.onError?.(a.status);return}const d=jNt(a);if(l===a_){const p=a.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(p);n.onDone({begin:parseInt(u[1],10),chunk:d})}else d?n.onDone({begin:0,chunk:d}):n.onError?.(a.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const r=this.pendingRequests[t].xhr;delete this.pendingRequests[t],r.abort()}}class BNt{constructor(t){this._source=t,this._manager=new MNt(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const r=this._rangeRequestReaders.indexOf(t);r>=0&&this._rangeRequestReaders.splice(r,1)}getFullReader(){return Wa(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new PNt(this._manager,this._source),this._fullRequestReader}getRangeReader(t,r){const n=new DNt(this._manager,t,r);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class PNt{constructor(t,r){this._manager=t;const n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=r.url,this._fullRequestId=t.requestFull(n),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._contentLength=r.length,this._rangeChunkSize=r.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,r=this._manager.getRequestXhr(t),n=c=>r.getResponseHeader(c),{allowRangeRequests:a,suggestedLength:l}=PX({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=l||this._contentLength,this._filename=DX(n),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 r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=FM(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const r of this._requests)r.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 r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class DNt{constructor(t,r,n){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(r,n,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 r=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:r,done:!1}):this._queuedChunk=r,this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=FM(t,this._url);for(const r of this._requests)r.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 r=this._queuedChunk;return this._queuedChunk=null,{value:r,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 r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const sRe=/^file:\/\/\/[a-zA-Z]:\//;function TNt(e){const t=Rh.get("url"),r=t.parse(e);return r.protocol==="file:"||r.host?r:/^[a-z]:[/\\]/i.test(e)?t.parse(`file:///${e}`):(r.host||(r.protocol="file:"),r)}class zNt{constructor(t){this.source=t,this.url=TNt(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 Wa(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new ONt(this):new RNt(this),this._fullRequestReader}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;const n=this.isFsUrl?new NNt(this,t,r):new FNt(this,t,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class lRe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const r=t.source;this._contentLength=r.length,this._loaded=0,this._filename=null,this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.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",r=>{this._error(r)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new p5("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class cRe{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 r=t.source;this._isStreamingSupported=!r.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",r=>{this._error(r)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function BL(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class RNt extends lRe{constructor(t){super(t);const r=n=>{if(n.statusCode===404){const d=new d5(`Missing PDF "${this._url}".`);this._storedError=d,this._headersCapability.reject(d);return}this._headersCapability.resolve(),this._setReadableStream(n);const a=d=>this._readableStream.headers[d.toLowerCase()],{allowRangeRequests:l,suggestedLength:c}=PX({getResponseHeader:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=l,this._contentLength=c||this._contentLength,this._filename=DX(a)};if(this._request=null,this._url.protocol==="http:"){const n=Rh.get("http");this._request=n.request(BL(this._url,t.httpHeaders),r)}else{const n=Rh.get("https");this._request=n.request(BL(this._url,t.httpHeaders),r)}this._request.on("error",n=>{this._storedError=n,this._headersCapability.reject(n)}),this._request.end()}}class FNt extends cRe{constructor(t,r,n){super(t),this._httpHeaders={};for(const l in t.httpHeaders){const c=t.httpHeaders[l];c!==void 0&&(this._httpHeaders[l]=c)}this._httpHeaders.Range=`bytes=${r}-${n-1}`;const a=l=>{if(l.statusCode===404){const c=new d5(`Missing PDF "${this._url}".`);this._storedError=c;return}this._setReadableStream(l)};if(this._request=null,this._url.protocol==="http:"){const l=Rh.get("http");this._request=l.request(BL(this._url,this._httpHeaders),a)}else{const l=Rh.get("https");this._request=l.request(BL(this._url,this._httpHeaders),a)}this._request.on("error",l=>{this._storedError=l}),this._request.end()}}class ONt extends lRe{constructor(t){super(t);let r=decodeURIComponent(this._url.path);sRe.test(this._url.href)&&(r=r.replace(/^\//,""));const n=Rh.get("fs");n.promises.lstat(r).then(a=>{this._contentLength=a.size,this._setReadableStream(n.createReadStream(r)),this._headersCapability.resolve()},a=>{a.code==="ENOENT"&&(a=new d5(`Missing PDF "${r}".`)),this._storedError=a,this._headersCapability.reject(a)})}}class NNt extends cRe{constructor(t,r,n){super(t);let a=decodeURIComponent(this._url.path);sRe.test(this._url.href)&&(a=a.replace(/^\//,""));const l=Rh.get("fs");this._setReadableStream(l.createReadStream(a,{start:r,end:n-1}))}}const HNt=1e5,rc=30,_Nt=.8;let PL=class Nu{#e=Promise.withResolvers();#t=null;#o=!1;#i=!!globalThis.FontInspector?.enabled;#s=null;#r=null;#n=0;#l=0;#d=null;#p=null;#h=0;#c=0;#a=Object.create(null);#m=[];#f=null;#u=[];#y=new WeakMap;#g=null;static#b=new Map;static#v=new Map;static#A=null;static#k=new Set;constructor({textContentSource:t,container:r,viewport:n}){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=r,this.#c=n.scale*(globalThis.devicePixelRatio||1),this.#h=n.rotation,this.#r={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null};const{pageWidth:a,pageHeight:l,pageX:c,pageY:d}=n.rawDims;this.#g=[1,0,0,-1,-c,d+l],this.#l=a,this.#n=l,Nu.#x(),H4(r,n),this.#e.promise.catch(()=>{}).then(()=>{Nu.#k.delete(this),this.#r=null,this.#a=null})}render(){const t=()=>{this.#d.read().then(({value:r,done:n})=>{if(n){this.#e.resolve();return}this.#s??=r.lang,Object.assign(this.#a,r.styles),this.#S(r.items),t()},this.#e.reject)};return this.#d=this.#f.getReader(),Nu.#k.add(this),t(),this.#e.promise}update({viewport:t,onBefore:r=null}){const n=t.scale*(globalThis.devicePixelRatio||1),a=t.rotation;if(a!==this.#h&&(r?.(),this.#h=a,H4(this.#p,{rotation:a})),n!==this.#c){r?.(),this.#c=n;const l={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:Nu.#w(this.#s)};for(const c of this.#u)l.properties=this.#y.get(c),l.div=c,this.#$(l)}}cancel(){const t=new p5("TextLayer task cancelled.");this.#d?.cancel(t).catch(()=>{}),this.#d=null,this.#e.reject(t)}get textDivs(){return this.#u}get textContentItemsStr(){return this.#m}#S(t){if(this.#o)return;this.#r.ctx??=Nu.#w(this.#s);const r=this.#u,n=this.#m;for(const a of t){if(r.length>HNt){Nr("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}n.push(a.str),this.#j(a)}}#j(t){const r=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};this.#u.push(r);const a=jo.transform(this.#g,t.transform);let l=Math.atan2(a[1],a[0]);const c=this.#a[t.fontName];c.vertical&&(l+=Math.PI/2);const d=this.#i&&c.fontSubstitution||c.fontFamily,p=Math.hypot(a[2],a[3]),u=p*Nu.#C(d,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=r.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}${(Nu.#A*p).toFixed(2)}px)`,x.fontFamily=d,n.fontSize=p,r.setAttribute("role","presentation"),r.textContent=t.str,r.dir=t.dir,this.#i&&(r.dataset.fontName=c.fontSubstitutionLoadedName||t.fontName),l!==0&&(n.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 b=Math.abs(t.transform[0]),w=Math.abs(t.transform[3]);b!==w&&Math.max(b,w)/Math.min(b,w)>1.5&&(y=!0)}if(y&&(n.canvasWidth=c.vertical?t.height:t.width),this.#y.set(r,n),this.#r.div=r,this.#r.properties=n,this.#$(this.#r),n.hasText&&this.#t.append(r),n.hasEOL){const b=document.createElement("br");b.setAttribute("role","presentation"),this.#t.append(b)}}#$(t){const{div:r,properties:n,ctx:a,prevFontSize:l,prevFontFamily:c}=t,{style:d}=r;let p="";if(Nu.#A>1&&(p=`scale(${1/Nu.#A})`),n.canvasWidth!==0&&n.hasText){const{fontFamily:u}=d,{canvasWidth:h,fontSize:m}=n;(l!==m||c!==u)&&(a.font=`${m*this.#c}px ${u}`,t.prevFontSize=m,t.prevFontFamily=u);const{width:f}=a.measureText(r.textContent);f>0&&(p=`scaleX(${h*this.#c/f}) ${p}`)}n.angle!==0&&(p=`rotate(${n.angle}deg) ${p}`),p.length>0&&(d.transform=p)}static cleanup(){if(!(this.#k.size>0)){this.#b.clear();for(const{canvas:t}of this.#v.values())t.remove();this.#v.clear()}}static#w(t=null){let r=this.#v.get(t||="");if(!r){const n=document.createElement("canvas");n.className="hiddenCanvasElement",n.lang=t,document.body.append(n),r=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#v.set(t,r)}return r}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,r){const n=this.#b.get(t);if(n)return n;const a=this.#w(r),l=a.font;a.canvas.width=a.canvas.height=rc,a.font=`${rc}px ${t}`;const c=a.measureText("");let d=c.fontBoundingBoxAscent,p=Math.abs(c.fontBoundingBoxDescent);if(d){const m=d/(d+p);return this.#b.set(t,m),a.canvas.width=a.canvas.height=0,a.font=l,m}a.strokeStyle="red",a.clearRect(0,0,rc,rc),a.strokeText("g",0,0);let u=a.getImageData(0,0,rc,rc).data;p=0;for(let m=u.length-1-3;m>=0;m-=4)if(u[m]>0){p=Math.ceil(m/4/rc);break}a.clearRect(0,0,rc,rc),a.strokeText("A",0,rc),u=a.getImageData(0,0,rc,rc).data,d=0;for(let m=0,f=u.length;m<f;m+=4)if(u[m]>0){d=rc-Math.floor(m/4/rc);break}a.canvas.width=a.canvas.height=0,a.font=l;const h=d?d/(d+p):_Nt;return this.#b.set(t,h),h}};function VNt(){Jze("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:e,container:t,viewport:r,...n}=arguments[0],a=Object.keys(n);a.length>0&&Nr("Ignoring `renderTextLayer` parameters: "+a.join(", "));const l=new PL({textContentSource:e,container:t,viewport:r}),{textDivs:c,textContentItemsStr:d}=l;return{promise:l.render(),textDivs:c,textContentItemsStr:d}}function QNt(){Jze("`updateTextLayer`, please use `TextLayer` instead.")}class rv{static textContent(t){const r=[],n={items:r,styles:Object.create(null)};function a(l){if(!l)return;let c=null;const d=l.name;if(d==="#text")c=l.value;else if(rv.shouldBuildText(d))l?.attributes?.textContent?c=l.attributes.textContent:l.value&&(c=l.value);else return;if(c!==null&&r.push({str:c}),!!l.children)for(const p of l.children)a(p)}return a(t),n}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const UNt=65536,WNt=100,GNt=5e3,YNt=ul?nNt:WOt,KNt=ul?aNt:qze,qNt=ul?iNt:UOt,ZNt=ul?sNt:Zze;function JNt(e={}){typeof e=="string"||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t=new TX,{docId:r}=t,n=e.url?XNt(e.url):null,a=e.data?eHt(e.data):null,l=e.httpHeaders||null,c=e.withCredentials===!0,d=e.password??null,p=e.range instanceof dRe?e.range:null,u=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:UNt;let h=e.worker instanceof Ud?e.worker:null;const m=e.verbosity,f=typeof e.docBaseUrl=="string"&&!kX(e.docBaseUrl)?e.docBaseUrl:null,x=typeof e.cMapUrl=="string"?e.cMapUrl:null,y=e.cMapPacked!==!1,b=e.CMapReaderFactory||KNt,w=typeof e.standardFontDataUrl=="string"?e.standardFontDataUrl:null,v=e.StandardFontDataFactory||ZNt,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:!ul,L=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,M=typeof e.disableFontFace=="boolean"?e.disableFontFace:ul,D=e.fontExtraProperties===!0,P=e.enableXfa===!0,T=e.ownerDocument||globalThis.document,z=e.disableRange===!0,N=e.disableStream===!0,K=e.disableAutoFetch===!0,q=e.pdfBug===!0,F=e.enableHWA===!0,_=p?p.length:e.length??NaN,V=typeof e.useSystemFonts=="boolean"?e.useSystemFonts:!ul&&!M,O=typeof e.useWorkerFetch=="boolean"?e.useWorkerFetch:b===qze&&v===Zze&&x&&w&&bb(x,document.baseURI)&&bb(w,document.baseURI),R=e.canvasFactory||new YNt({ownerDocument:T,enableHWA:F}),H=e.filterFactory||new qNt({docId:r,ownerDocument:T}),ee=null;DOt(m);const Y={canvasFactory:R,filterFactory:H};if(O||(Y.cMapReaderFactory=new b({baseUrl:x,isCompressed:y}),Y.standardFontDataFactory=new v({baseUrl:w})),!h){const J={verbosity:m,port:ov.workerPort};h=J.port?Ud.fromPort(J):new Ud(J),t._worker=h}const G={docId:r,apiVersion:"4.4.168",data:a,password:d,disableAutoFetch:K,rangeChunkSize:u,length:_,docBaseUrl:f,enableXfa:P,evaluatorOptions:{maxImageSize:S,disableFontFace:M,ignoreErrors:A,isEvalSupported:E,isOffscreenCanvasSupported:I,canvasMaxAreaInBytes:L,fontExtraProperties:D,useSystemFonts:V,cMapUrl:O?x:null,standardFontDataUrl:O?w:null}},X={disableFontFace:M,fontExtraProperties:D,ownerDocument:T,pdfBug:q,styleElement:ee,loadingParams:{disableAutoFetch:K,enableXfa:P}};return h.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const J=h.messageHandler.sendWithPromise("GetDocRequest",G,a?[a.buffer]:null);let ie;if(p)ie=new $Nt(p,{disableRange:z,disableStream:N});else if(!a){if(!n)throw new Error("getDocument - no `url` parameter provided.");ie=(me=>ul?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&bb(me.url)?new jme(me):new zNt(me):bb(me.url)?new jme(me):new BNt(me))({url:n,length:_,httpHeaders:l,withCredentials:c,rangeChunkSize:u,disableRange:z,disableStream:N})}return J.then(ye=>{if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const me=new wb(r,ye,h.port),de=new iHt(me,t,ie,X,Y);t._transport=de,me.send("Ready",null)})}).catch(t._capability.reject),t}function XNt(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(ul&&typeof e=="string")return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function eHt(e){if(ul&&typeof AE<"u"&&e instanceof AE)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 BM(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 Mme(e){return typeof e=="object"&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0}class TX{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${TX.#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 dRe=class{constructor(t,r,n=!1,a=null){this.length=t,this.initialData=r,this.progressiveDone=n,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,r){for(const n of this._rangeListeners)n(t,r)}onDataProgress(t,r){this._readyCapability.promise.then(()=>{for(const n of this._progressListeners)n(t,r)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const r of this._progressiveReadListeners)r(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,r){Gi("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class tHt{constructor(t,r){this._pdfInfo=t,this._transport=r}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 mi(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:r}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(r)}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 oHt{#e=null;#t=!1;constructor(t,r,n,a=!1){this._pageIndex=t,this._pageInfo=r,this._transport=n,this._stats=a?new xme:null,this._pdfBug=a,this.commonObjs=n.commonObjs,this.objs=new pRe,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:r=this.rotate,offsetX:n=0,offsetY:a=0,dontFlip:l=!1}={}){return new hC({viewBox:this.view,scale:t,rotation:r,offsetX:n,offsetY:a,dontFlip:l})}getAnnotations({intent:t="display"}={}){const{renderingIntent:r}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,r)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return mi(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:r,intent:n="display",annotationMode:a=Fm.ENABLE,transform:l=null,background:c=null,optionalContentConfigPromise:d=null,annotationCanvasMap:p=null,pageColors:u=null,printAnnotationStorage:h=null}){this._stats?.time("Overall");const m=this._transport.getRenderingIntent(n,a,h),{renderingIntent:f,cacheKey:x}=m;this.#t=!1,this.#i(),d||=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 b=!!(f&Nd.PRINT);y.displayReadyCapability||(y.displayReadyCapability=Promise.withResolvers(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(m));const w=S=>{y.renderTasks.delete(v),(this._maybeCleanupAfterRender||b)&&(this.#t=!0),this.#o(!b),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 W6({callback:w,params:{canvasContext:t,viewport:r,transform:l,background:c},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:p,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!b,pdfBug:this._pdfBug,pageColors:u});(y.renderTasks||=new Set).add(v);const A=v.task;return Promise.all([y.displayReadyCapability.promise,d]).then(([S,E])=>{if(this.destroyed){w();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(w),A}getOperatorList({intent:t="display",annotationMode:r=Fm.ENABLE,printAnnotationStorage:n=null}={}){function a(){c.operatorList.lastChunk&&(c.opListReadCapability.resolve(c.operatorList),c.renderTasks.delete(d))}const l=this._transport.getRenderingIntent(t,r,n,!0);let c=this._intentStates.get(l.cacheKey);c||(c=Object.create(null),this._intentStates.set(l.cacheKey,c));let d;return c.opListReadCapability||(d=Object.create(null),d.operatorListChanged=a,c.opListReadCapability=Promise.withResolvers(),(c.renderTasks||=new Set).add(d),c.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(l)),c.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:r=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:r===!0},{highWaterMark:100,size(a){return a.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(n=>rv.textContent(n));const r=this.streamTextContent(t);return new Promise(function(n,a){function l(){c.read().then(function({value:p,done:u}){if(u){n(d);return}d.lang??=p.lang,Object.assign(d.styles,p.styles),d.items.push(...p.items),l()},a)}const c=r.getReader(),d={items:[],styles:Object.create(null),lang:null};l()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const r of this._intentStates.values())if(this._abortOperatorList({intentState:r,reason:new Error("Page was destroyed."),force:!0}),!r.opListReadCapability)for(const n of r.renderTasks)t.push(n.completed),n.cancel();return this.objs.clear(),this.#t=!1,this.#i(),Promise.all(t)}cleanup(t=!1){this.#t=!0;const r=this.#o(!1);return t&&r&&(this._stats&&=new xme),r}#o(t=!1){if(this.#i(),!this.#t||this.destroyed)return!1;if(t)return this.#e=setTimeout(()=>{this.#e=null,this.#o(!1)},GNt),!1;for(const{renderTasks:r,operatorList:n}of this._intentStates.values())if(r.size>0||!n.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,r){const n=this._intentStates.get(r);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(t))}_renderPageChunk(t,r){for(let n=0,a=t.length;n<a;n++)r.operatorList.fnArray.push(t.fnArray[n]),r.operatorList.argsArray.push(t.argsArray[n]);r.operatorList.lastChunk=t.lastChunk,r.operatorList.separateAnnots=t.separateAnnots;for(const n of r.renderTasks)n.operatorListChanged();t.lastChunk&&this.#o(!0)}_pumpOperatorList({renderingIntent:t,cacheKey:r,annotationStorageSerializable:n}){const{map:a,transfer:l}=n,d=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:r,annotationStorage:a},l).getReader(),p=this._intentStates.get(r);p.streamReader=d;const u=()=>{d.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:r,force:n=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!n){if(t.renderTasks.size>0)return;if(r instanceof $X){let a=WNt;r.extraDelay>0&&r.extraDelay<1e3&&(a+=r.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:r,force:!0})},a);return}}if(t.streamReader.cancel(new p5(r.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 rHt{#e=new Set;#t=Promise.resolve();postMessage(t,r){const n={data:structuredClone(t,r?{transfer:r}:null)};this.#t.then(()=>{for(const a of this.#e)a.call(this,n)})}addEventListener(t,r){this.#e.add(r)}removeEventListener(t,r){this.#e.delete(r)}terminate(){this.#e.clear()}}const N0={isWorkerDisabled:!1,fakeWorkerId:0};ul&&(N0.isWorkerDisabled=!0,ov.workerSrc||="./pdf.worker.mjs"),N0.isSameOrigin=function(e,t){let r;try{if(r=new URL(e),!r.origin||r.origin==="null")return!1}catch{return!1}const n=new URL(t,r);return r.origin===n.origin},N0.createCDNWrapper=function(e){const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};class Ud{static#e;constructor({name:t=null,port:r=null,verbosity:n=TOt()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=n,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,r){if(Ud.#e?.has(r))throw new Error("Cannot use more than one PDFWorker per port.");(Ud.#e||=new WeakMap).set(r,this),this._initializeFromPort(r);return}this._initialize()}get promise(){return ul?Promise.all([Rh.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 wb("main","worker",t),this._messageHandler.on("ready",function(){}),this.#t()}_initialize(){if(N0.isWorkerDisabled||Ud.#o){this._setupFakeWorker();return}let{workerSrc:t}=Ud;try{N0.isSameOrigin(window.location.href,t)||(t=N0.createCDNWrapper(new URL(t,window.location).href));const r=new Worker(t,{type:"module"}),n=new wb("main","worker",r),a=()=>{l.abort(),n.destroy(),r.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},l=new AbortController;r.addEventListener("error",()=>{this._webWorker||a()},{signal:l.signal}),n.on("test",d=>{if(l.abort(),this.destroyed||!d){a();return}this._messageHandler=n,this._port=r,this._webWorker=r,this.#t()}),n.on("ready",d=>{if(l.abort(),this.destroyed){a();return}try{c()}catch{this._setupFakeWorker()}});const c=()=>{const d=new Uint8Array;n.send("test",d,[d.buffer])};c();return}catch{jM("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){N0.isWorkerDisabled||(Nr("Setting up fake worker."),N0.isWorkerDisabled=!0),Ud._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const r=new rHt;this._port=r;const n=`fake${N0.fakeWorkerId++}`,a=new wb(n+"_worker",n,r);t.setup(a,r),this._messageHandler=new wb(n,n+"_worker",r),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),Ud.#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 r=this.#e?.get(t.port);if(r){if(r._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return r}return new Ud(t)}static get workerSrc(){if(ov.workerSrc)return ov.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#o(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return mi(this,"_setupFakeWorkerGlobal",(async()=>this.#o?this.#o:(await import(this.workerSrc)).WorkerMessageHandler)())}}class iHt{#e=new Map;#t=new Map;#o=new Map;#i=new Map;#s=null;constructor(t,r,n,a,l){this.messageHandler=t,this.loadingTask=r,this.commonObjs=new pRe,this.fontLoader=new oNt({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=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#r(t,r=null){const n=this.#e.get(t);if(n)return n;const a=this.messageHandler.sendWithPromise(t,r);return this.#e.set(t,a),a}get annotationStorage(){return mi(this,"annotationStorage",new MX)}getRenderingIntent(t,r=Fm.ENABLE,n=null,a=!1){let l=Nd.DISPLAY,c=EY;switch(t){case"any":l=Nd.ANY;break;case"display":break;case"print":l=Nd.PRINT;break;default:Nr(`getRenderingIntent - invalid intent: ${t}`)}switch(r){case Fm.DISABLE:l+=Nd.ANNOTATIONS_DISABLE;break;case Fm.ENABLE:break;case Fm.ENABLE_FORMS:l+=Nd.ANNOTATIONS_FORMS;break;case Fm.ENABLE_STORAGE:l+=Nd.ANNOTATIONS_STORAGE,c=(l&Nd.PRINT&&n instanceof tRe?n:this.annotationStorage).serializable;break;default:Nr(`getRenderingIntent - invalid annotationMode: ${r}`)}return a&&(l+=Nd.OPLIST),{renderingIntent:l,cacheKey:`${l}_${c.hash}`,annotationStorageSerializable:c}}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 n of this.#t.values())t.push(n._destroy());this.#t.clear(),this.#o.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const r=this.messageHandler.sendWithPromise("Terminate",null);return t.push(r),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),PL.cleanup(),this._networkStream?.cancelAllRequests(new p5("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:r}=this;t.on("GetReader",(n,a)=>{Wa(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:c}){if(c){a.close();return}Wa(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(c=>{if(!this.destroyed)throw c})}}),t.on("ReaderHeadersReady",n=>{const a=Promise.withResolvers(),l=this._fullReader;return l.headersReady.then(()=>{(!l.isStreamingSupported||!l.isRangeSupported)&&(this._lastProgress&&r.onProgress?.(this._lastProgress),l.onProgress=c=>{r.onProgress?.({loaded:c.loaded,total:c.total})}),a.resolve({isStreamingSupported:l.isStreamingSupported,isRangeSupported:l.isRangeSupported,contentLength:l.contentLength})},a.reject),a.promise}),t.on("GetRangeReader",(n,a)=>{Wa(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const l=this._networkStream.getRangeReader(n.begin,n.end);if(!l){a.close();return}a.onPull=()=>{l.read().then(function({value:c,done:d}){if(d){a.close();return}Wa(c instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(c),1,[c])}).catch(c=>{a.error(c)})},a.onCancel=c=>{l.cancel(c),a.ready.catch(d=>{if(!this.destroyed)throw d})}}),t.on("GetDoc",({pdfInfo:n})=>{this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,r._capability.resolve(new tHt(n,this))}),t.on("DocException",function(n){let a;switch(n.name){case"PasswordException":a=new kY(n.message,n.code);break;case"InvalidPDFException":a=new Gze(n.message);break;case"MissingPDFException":a=new d5(n.message);break;case"UnexpectedResponseException":a=new MM(n.message,n.status);break;case"UnknownErrorException":a=new SY(n.message,n.details);break;default:Gi("DocException - expected a valid Error.")}r._capability.reject(a)}),t.on("PasswordRequest",n=>{if(this.#s=Promise.withResolvers(),r.onPassword){const a=l=>{l instanceof Error?this.#s.reject(l):this.#s.resolve({password:l})};try{r.onPassword(a,n.code)}catch(l){this.#s.reject(l)}}else this.#s.reject(new kY(n.message,n.code));return this.#s.promise}),t.on("DataLoaded",n=>{r.onProgress?.({loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),t.on("StartRenderPage",n=>{if(this.destroyed)return;this.#t.get(n.pageIndex)._startRenderPage(n.transparency,n.cacheKey)}),t.on("commonobj",([n,a,l])=>{if(this.destroyed||this.commonObjs.has(n))return null;switch(a){case"Font":const{disableFontFace:c,fontExtraProperties:d,pdfBug:p}=this._params;if("error"in l){const f=l.error;Nr(`Error during font loading: ${f}`),this.commonObjs.resolve(n,f);break}const u=p&&globalThis.FontInspector?.enabled?(f,x)=>globalThis.FontInspector.fontAdded(f,x):null,h=new rNt(l,{disableFontFace:c,inspectFont:u});this.fontLoader.bind(h).catch(()=>t.sendWithPromise("FontFallback",{id:n})).finally(()=>{!d&&h.data&&(h.data=null),this.commonObjs.resolve(n,h)});break;case"CopyLocalImage":const{imageRef:m}=l;Wa(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(n,structuredClone(x)),x.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,l);break;default:throw new Error(`Got unknown common object type ${a}`)}return null}),t.on("obj",([n,a,l,c])=>{if(this.destroyed)return;const d=this.#t.get(a);if(!d.objs.has(n)){if(d._intentStates.size===0){c?.bitmap?.close();return}switch(l){case"Image":d.objs.resolve(n,c),c?.dataLen>jOt&&(d._maybeCleanupAfterRender=!0);break;case"Pattern":d.objs.resolve(n,c);break;default:throw new Error(`Got unknown object type ${l}`)}}}),t.on("DocProgress",n=>{this.destroyed||r.onProgress?.({loaded:n.loaded,total:n.total})}),t.on("FetchBuiltInCMap",n=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(n):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),t.on("FetchStandardFontData",n=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(n):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Nr("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:r}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},r).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const r=t-1,n=this.#o.get(r);if(n)return n;const a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:r}).then(l=>{if(this.destroyed)throw new Error("Transport destroyed");l.refStr&&this.#i.set(l.refStr,t);const c=new oHt(r,l,this,this._params.pdfBug);return this.#t.set(r,c),c});return this.#o.set(r,a),a}getPageIndex(t){return Mme(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:r})}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(r=>new ANt(r,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",r=this.#e.get(t);if(r)return r;const n=this.messageHandler.sendWithPromise(t,null).then(a=>({info:a[0],metadata:a[1]?new vNt(a[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(t,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const r of this.#t.values())if(!r.cleanup())throw new Error(`startCleanup: Page ${r.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),PL.cleanup()}}cachedPageNumber(t){if(!Mme(t))return null;const r=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return this.#i.get(r)??null}}const y$=Symbol("INITIAL_DATA");class pRe{#e=Object.create(null);#t(t){return this.#e[t]||={...Promise.withResolvers(),data:y$}}get(t,r=null){if(r){const a=this.#t(t);return a.promise.then(()=>r(a.data)),null}const n=this.#e[t];if(!n||n.data===y$)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return n.data}has(t){const r=this.#e[t];return!!r&&r.data!==y$}resolve(t,r=null){const n=this.#t(t);n.data=r,n.resolve()}clear(){for(const t in this.#e){const{data:r}=this.#e[t];r?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const t in this.#e){const{data:r}=this.#e[t];r!==y$&&(yield[t,r])}}}class nHt{#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:r}=this.#e;return t.form||t.canvas&&r?.size>0}}class W6{#e=null;static#t=new WeakSet;constructor({callback:t,params:r,objs:n,commonObjs:a,annotationCanvasMap:l,operatorList:c,pageIndex:d,canvasFactory:p,filterFactory:u,useRequestAnimationFrame:h=!1,pdfBug:m=!1,pageColors:f=null}){this.callback=t,this.params=r,this.objs=n,this.commonObjs=a,this.annotationCanvasMap=l,this.operatorListIdx=null,this.operatorList=c,this._pageIndex=d,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 nHt(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=r.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:r}){if(this.cancelled)return;if(this._canvas){if(W6.#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.");W6.#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:n,viewport:a,transform:l,background:c}=this.params;this.gfx=new d8(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:r},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:l,viewport:a,transparency:t,background:c}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,r=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),W6.#t.delete(this._canvas),this.callback(t||new $X(`Rendering cancelled, page ${this._pageIndex+1}`,r))}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(),W6.#t.delete(this._canvas),this.callback())))}}const aHt="4.4.168",sHt="19fbc8998";function Bme(e){return Math.floor(Math.max(0,Math.min(1,e))*255).toString(16).padStart(2,"0")}function hy(e){return Math.max(0,Math.min(255,255*e))}class Pme{static CMYK_G([t,r,n,a]){return["G",1-Math.min(1,.3*t+.59*n+.11*r+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=hy(t),[t,t,t]}static G_HTML([t]){const r=Bme(t);return`#${r}${r}${r}`}static RGB_G([t,r,n]){return["G",.3*t+.59*r+.11*n]}static RGB_rgb(t){return t.map(hy)}static RGB_HTML(t){return`#${t.map(Bme).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,r,n,a]){return["RGB",1-Math.min(1,t+a),1-Math.min(1,n+a),1-Math.min(1,r+a)]}static CMYK_rgb([t,r,n,a]){return[hy(1-Math.min(1,t+a)),hy(1-Math.min(1,n+a)),hy(1-Math.min(1,r+a))]}static CMYK_HTML(t){const r=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(r)}static RGB_CMYK([t,r,n]){const a=1-t,l=1-r,c=1-n,d=Math.min(a,l,c);return["CMYK",a,l,c,d]}}class uRe{static setupStorage(t,r,n,a,l){const c=a.getValue(r,{value:null});switch(n.name){case"textarea":if(c.value!==null&&(t.textContent=c.value),l==="print")break;t.addEventListener("input",d=>{a.setValue(r,{value:d.target.value})});break;case"input":if(n.attributes.type==="radio"||n.attributes.type==="checkbox"){if(c.value===n.attributes.xfaOn?t.setAttribute("checked",!0):c.value===n.attributes.xfaOff&&t.removeAttribute("checked"),l==="print")break;t.addEventListener("change",d=>{a.setValue(r,{value:d.target.checked?d.target.getAttribute("xfaOn"):d.target.getAttribute("xfaOff")})})}else{if(c.value!==null&&t.setAttribute("value",c.value),l==="print")break;t.addEventListener("input",d=>{a.setValue(r,{value:d.target.value})})}break;case"select":if(c.value!==null){t.setAttribute("value",c.value);for(const d of n.children)d.attributes.value===c.value?d.attributes.selected=!0:d.attributes.hasOwnProperty("selected")&&delete d.attributes.selected}t.addEventListener("input",d=>{const p=d.target.options,u=p.selectedIndex===-1?"":p[p.selectedIndex].value;a.setValue(r,{value:u})});break}}static setAttributes({html:t,element:r,storage:n=null,intent:a,linkService:l}){const{attributes:c}=r,d=t instanceof HTMLAnchorElement;c.type==="radio"&&(c.name=`${c.name}-${a}`);for(const[p,u]of Object.entries(c))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:(!d||p!=="href"&&p!=="newWindow")&&t.setAttribute(p,u)}d&&l.addLinkAttributes(t,c.href,c.newWindow),n&&c.dataId&&this.setupStorage(t,c.dataId,r,n)}static render(t){const r=t.annotationStorage,n=t.linkService,a=t.xfaHtml,l=t.intent||"display",c=document.createElement(a.name);a.attributes&&this.setAttributes({html:c,element:a,intent:l,linkService:n});const d=l!=="richText",p=t.div;if(p.append(c),t.viewport){const m=`matrix(${t.viewport.transform.join(",")})`;p.style.transform=m}d&&p.setAttribute("class","xfaLayer xfaFont");const u=[];if(a.children.length===0){if(a.value){const m=document.createTextNode(a.value);c.append(m),d&&rv.shouldBuildText(a.name)&&u.push(m)}return{textDivs:u}}const h=[[a,-1,c]];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:b}=y;if(b==="#text"){const v=document.createTextNode(y.value);u.push(v),x.append(v);continue}const w=y?.attributes?.xmlns?document.createElementNS(y.attributes.xmlns,b):document.createElement(b);if(x.append(w),y.attributes&&this.setAttributes({html:w,element:y,storage:r,intent:l,linkService:n}),y.children?.length>0)h.push([y,-1,w]);else if(y.value){const v=document.createTextNode(y.value);d&&rv.shouldBuildText(b)&&u.push(v),w.append(v)}}for(const m of p.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:u}}static update(t){const r=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=r,t.div.hidden=!1}}const fC=1e3,lHt=9,_4=new WeakSet;function u2(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class cHt{static create(t){switch(t.data.annotationType){case Ha.LINK:return new hRe(t);case Ha.TEXT:return new dHt(t);case Ha.WIDGET:switch(t.data.fieldType){case"Tx":return new pHt(t);case"Btn":return t.data.radioButton?new mRe(t):t.data.checkBox?new hHt(t):new mHt(t);case"Ch":return new gHt(t);case"Sig":return new uHt(t)}return new u5(t);case Ha.POPUP:return new MY(t);case Ha.FREETEXT:return new gRe(t);case Ha.LINE:return new xHt(t);case Ha.SQUARE:return new yHt(t);case Ha.CIRCLE:return new bHt(t);case Ha.POLYLINE:return new fRe(t);case Ha.CARET:return new vHt(t);case Ha.INK:return new xRe(t);case Ha.POLYGON:return new wHt(t);case Ha.HIGHLIGHT:return new CHt(t);case Ha.UNDERLINE:return new AHt(t);case Ha.SQUIGGLY:return new $Ht(t);case Ha.STRIKEOUT:return new kHt(t);case Ha.STAMP:return new yRe(t);case Ha.FILEATTACHMENT:return new SHt(t);default:return new ua(t)}}}class ua{#e=null;#t=!1;#o=null;constructor(t,{isRenderable:r=!1,ignoreBorder:n=!1,createQuadrilaterals:a=!1}={}){this.isRenderable=r,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,r&&(this.container=this._createContainer(n)),a&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:r,richText:n}){return!!(t?.str||r?.str||n?.str)}get hasPopupData(){return ua._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};const{rect:r}=t;r&&this.#i(r),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:r},data:{rect:n,rotation:a},parent:{viewport:{rawDims:{pageWidth:l,pageHeight:c,pageX:d,pageY:p}}}}=this;n?.splice(0,4,...t);const{width:u,height:h}=u2(t);r.left=`${100*(t[0]-d)/l}%`,r.top=`${100*(c-t[3]+p)/c}%`,a===0?(r.width=`${100*u/l}%`,r.height=`${100*h/c}%`):this.setRotation(a)}_createContainer(t){const{data:r,parent:{page:n,viewport:a}}=this,l=document.createElement("section");l.setAttribute("data-annotation-id",r.id),this instanceof u5||(l.tabIndex=fC);const{style:c}=l;if(c.zIndex=this.parent.zIndex++,r.popupRef&&l.setAttribute("aria-haspopup","dialog"),r.alternativeText&&(l.title=r.alternativeText),r.noRotate&&l.classList.add("norotate"),!r.rect||this instanceof MY){const{rotation:b}=r;return!r.hasOwnCanvas&&b!==0&&this.setRotation(b,l),l}const{width:d,height:p}=u2(r.rect);if(!t&&r.borderStyle.width>0){c.borderWidth=`${r.borderStyle.width}px`;const b=r.borderStyle.horizontalCornerRadius,w=r.borderStyle.verticalCornerRadius;if(b>0||w>0){const A=`calc(${b}px * var(--scale-factor)) / calc(${w}px * var(--scale-factor))`;c.borderRadius=A}else if(this instanceof mRe){const A=`calc(${d}px * var(--scale-factor)) / calc(${p}px * var(--scale-factor))`;c.borderRadius=A}switch(r.borderStyle.style){case py.SOLID:c.borderStyle="solid";break;case py.DASHED:c.borderStyle="dashed";break;case py.BEVELED:Nr("Unimplemented border style: beveled");break;case py.INSET:Nr("Unimplemented border style: inset");break;case py.UNDERLINE:c.borderBottomStyle="solid";break}const v=r.borderColor||null;v?(this.#t=!0,c.borderColor=jo.makeHexColor(v[0]|0,v[1]|0,v[2]|0)):c.borderWidth=0}const u=jo.normalizeRect([r.rect[0],n.view[3]-r.rect[1]+n.view[1],r.rect[2],n.view[3]-r.rect[3]+n.view[1]]),{pageWidth:h,pageHeight:m,pageX:f,pageY:x}=a.rawDims;c.left=`${100*(u[0]-f)/h}%`,c.top=`${100*(u[1]-x)/m}%`;const{rotation:y}=r;return r.hasOwnCanvas||y===0?(c.width=`${100*d/h}%`,c.height=`${100*p/m}%`):this.setRotation(y,l),l}setRotation(t,r=this.container){if(!this.data.rect)return;const{pageWidth:n,pageHeight:a}=this.parent.viewport.rawDims,{width:l,height:c}=u2(this.data.rect);let d,p;t%180===0?(d=100*l/n,p=100*c/a):(d=100*c/n,p=100*l/a),r.style.width=`${d}%`,r.style.height=`${p}%`,r.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(r,n,a)=>{const l=a.detail[r],c=l[0],d=l.slice(1);a.target.style[n]=Pme[`${c}_HTML`](d),this.annotationStorage.setValue(this.data.id,{[n]:Pme[`${c}_rgb`](d)})};return mi(this,"_commonActions",{display:r=>{const{display:n}=r.detail,a=n%2===1;this.container.style.visibility=a?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:a,noPrint:n===1||n===2})},print:r=>{this.annotationStorage.setValue(this.data.id,{noPrint:!r.detail.print})},hidden:r=>{const{hidden:n}=r.detail;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:n,noView:n})},focus:r=>{setTimeout(()=>r.target.focus({preventScroll:!1}),0)},userName:r=>{r.target.title=r.detail.userName},readonly:r=>{r.target.disabled=r.detail.readonly},required:r=>{this._setRequired(r.target,r.detail.required)},bgColor:r=>{t("bgColor","backgroundColor",r)},fillColor:r=>{t("fillColor","backgroundColor",r)},fgColor:r=>{t("fgColor","color",r)},textColor:r=>{t("textColor","color",r)},borderColor:r=>{t("borderColor","borderColor",r)},strokeColor:r=>{t("strokeColor","borderColor",r)},rotation:r=>{const n=r.detail.rotation;this.setRotation(n),this.annotationStorage.setValue(this.data.id,{rotation:n})}})}_dispatchEventFromSandbox(t,r){const n=this._commonActions;for(const a of Object.keys(r.detail))(t[a]||n[a])?.(r)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const r=this.annotationStorage.getRawValue(this.data.id);if(!r)return;const n=this._commonActions;for(const[a,l]of Object.entries(r)){const c=n[a];if(c){const d={detail:{[a]:l},target:t};c(d),delete r[a]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[r,n,a,l]=this.data.rect.map(b=>Math.fround(b));if(t.length===8){const[b,w,v,A]=t.subarray(2,6);if(a===b&&l===w&&r===v&&n===A)return}const{style:c}=this.container;let d;if(this.#t){const{borderColor:b,borderWidth:w}=c;c.borderWidth=0,d=["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="${b}" stroke-width="${w}">`],this.container.classList.add("hasBorder")}const p=a-r,u=l-n,{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 b=2,w=t.length;b<w;b+=8){const v=t[b],A=t[b+1],S=t[b+2],E=t[b+3],I=h.createElement("rect"),L=(S-r)/p,M=(l-A)/u,D=(v-S)/p,P=(A-E)/u;I.setAttribute("x",L),I.setAttribute("y",M),I.setAttribute("width",D),I.setAttribute("height",P),x.append(I),d?.push(`<rect vector-effect="non-scaling-stroke" x="${L}" y="${M}" width="${D}" height="${P}"/>`)}this.#t&&(d.push("</g></svg>')"),c.backgroundImage=d.join("")),this.container.append(m),this.container.style.clipPath=`url(#${y})`}_createPopup(){const{container:t,data:r}=this;t.setAttribute("aria-haspopup","dialog");const n=this.#o=new MY({data:{color:r.color,titleObj:r.titleObj,modificationDate:r.modificationDate,contentsObj:r.contentsObj,richText:r.richText,parentRect:r.rect,borderStyle:0,id:`popup_${r.id}`,rotation:r.rotation},parent:this.parent,elements:[this]});this.parent.div.append(n.render())}render(){Gi("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,r=null){const n=[];if(this._fieldObjects){const a=this._fieldObjects[t];if(a)for(const{page:l,id:c,exportValues:d}of a){if(l===-1||c===r)continue;const p=typeof d=="string"?d:null,u=document.querySelector(`[data-element-id="${c}"]`);if(u&&!_4.has(u)){Nr(`_getElementsByName - element not allowed: ${c}`);continue}n.push({id:c,exportValue:p,domElement:u})}return n}for(const a of document.getElementsByName(t)){const{exportValue:l}=a,c=a.getAttribute("data-element-id");c!==r&&_4.has(a)&&n.push({id:c,exportValue:l,domElement:a})}return n}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 r of t)r.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:r}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:r})})}}class hRe extends ua{constructor(t,r=null){super(t,{isRenderable:!0,ignoreBorder:!!r?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:r}=this,n=document.createElement("a");n.setAttribute("data-element-id",t.id);let a=!1;return t.url?(r.addLinkAttributes(n,t.url,t.newWindow),a=!0):t.action?(this._bindNamedAction(n,t.action),a=!0):t.attachment?(this.#t(n,t.attachment,t.attachmentDest),a=!0):t.setOCGState?(this.#o(n,t.setOCGState),a=!0):t.dest?(this._bindLink(n,t.dest),a=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,t),a=!0),t.resetForm?(this._bindResetFormAction(n,t.resetForm),a=!0):this.isTooltipOnly&&!a&&(this._bindLink(n,""),a=!0)),this.container.classList.add("linkAnnotation"),a&&this.container.append(n),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(t,r){t.href=this.linkService.getDestinationHash(r),t.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||r==="")&&this.#e()}_bindNamedAction(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(r),!1),this.#e()}#t(t,r,n=null){t.href=this.linkService.getAnchorUrl(""),r.description&&(t.title=r.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(r.content,r.filename,n),!1),this.#e()}#o(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(r),!1),this.#e()}_bindJSAction(t,r){t.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const a of Object.keys(r.actions)){const l=n.get(a);l&&(t[l]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:a}}),!1))}t.onclick||(t.onclick=()=>!1),this.#e()}_bindResetFormAction(t,r){const n=t.onclick;if(n||(t.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){Nr('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(t.onclick=()=>!1);return}t.onclick=()=>{n?.();const{fields:a,refs:l,include:c}=r,d=[];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)===c&&d.push(f)}else for(const h of Object.values(this._fieldObjects))d.push(...h);const p=this.annotationStorage,u=[];for(const h of d){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(!_4.has(f)){Nr(`_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 dHt extends ua{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 u5 extends ua{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return vc.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,r,n,a,l){n.includes("mouse")?t.addEventListener(n,c=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(c),shift:c.shiftKey,modifier:this._getKeyModifier(c)}})}):t.addEventListener(n,c=>{if(n==="blur"){if(!r.focused||!c.relatedTarget)return;r.focused=!1}else if(n==="focus"){if(r.focused)return;r.focused=!0}l&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(c)}})})}_setEventListeners(t,r,n,a){for(const[l,c]of n)(c==="Action"||this.data.actions?.[c])&&((c==="Focus"||c==="Blur")&&(r||={focused:!1}),this._setEventListener(t,r,l,c,a),c==="Focus"&&!this.data.actions?.Blur?this._setEventListener(t,r,"blur","Blur",null):c==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(t,r,"focus","Focus",null))}_setBackgroundColor(t){const r=this.data.backgroundColor||null;t.style.backgroundColor=r===null?"transparent":jo.makeHexColor(r[0],r[1],r[2])}_setTextStyle(t){const r=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||lHt,l=t.style;let c;const d=2,p=u=>Math.round(10*u)/10;if(this.data.multiLine){const u=Math.abs(this.data.rect[3]-this.data.rect[1]-d),h=Math.round(u/(t_*a))||1,m=u/h;c=Math.min(a,p(m/t_))}else{const u=Math.abs(this.data.rect[3]-this.data.rect[1]-d);c=Math.min(a,p(u/t_))}l.fontSize=`calc(${c}px * var(--scale-factor))`,l.color=jo.makeHexColor(n[0],n[1],n[2]),this.data.textAlignment!==null&&(l.textAlign=r[this.data.textAlignment])}_setRequired(t,r){r?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",r)}}class pHt extends u5{constructor(t){const r=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:r})}setPropertyOnSiblings(t,r,n,a){const l=this.annotationStorage;for(const c of this._getElementsByName(t.name,t.id))c.domElement&&(c.domElement[r]=n),l.setValue(c.id,{[a]:n})}render(){const t=this.annotationStorage,r=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const a=t.getValue(r,{value:this.data.fieldValue});let l=a.value||"";const c=t.getValue(r,{charLimit:this.data.maxLen}).charLimit;c&&l.length>c&&(l=l.slice(0,c));let d=a.formattedValue||this.data.textContent?.join(`
246
+ `);return t.join("")}}function bb(e,t){try{const{protocol:r}=t?new URL(e,t):new URL(e);return r==="http:"||r==="https:"}catch{return!1}}function Ec(e){e.preventDefault()}function Jze(e){console.log("Deprecated API usage: "+e)}let yme;class Xze{static toDateObject(t){if(!t||typeof t!="string")return null;yme||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const r=yme.exec(t);if(!r)return null;const n=parseInt(r[1],10);let a=parseInt(r[2],10);a=a>=1&&a<=12?a-1:0;let l=parseInt(r[3],10);l=l>=1&&l<=31?l:1;let c=parseInt(r[4],10);c=c>=0&&c<=23?c:0;let d=parseInt(r[5],10);d=d>=0&&d<=59?d:0;let p=parseInt(r[6],10);p=p>=0&&p<=59?p:0;const u=r[7]||"Z";let h=parseInt(r[8],10);h=h>=0&&h<=23?h:0;let m=parseInt(r[9],10)||0;return m=m>=0&&m<=59?m:0,u==="-"?(c+=h,d+=m):u==="+"&&(c-=h,d-=m),new Date(Date.UTC(n,a,l,c,d,p))}}function KOt(e,{scale:t=1,rotation:r=0}){const{width:n,height:a}=e.attributes.style,l=[0,0,parseInt(n),parseInt(a)];return new hC({viewBox:l,scale:t,rotation:r})}function EX(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):(Nr(`Not a valid color format: "${e}"`),[0,0,0])}function qOt(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const r of e.keys()){t.style.color=r;const n=window.getComputedStyle(t).color;e.set(r,EX(n))}t.remove()}function Pn(e){const{a:t,b:r,c:n,d:a,e:l,f:c}=e.getTransform();return[t,r,n,a,l,c]}function A0(e){const{a:t,b:r,c:n,d:a,e:l,f:c}=e.getTransform().invertSelf();return[t,r,n,a,l,c]}function H4(e,t,r=!1,n=!0){if(t instanceof hC){const{pageWidth:a,pageHeight:l}=t.rawDims,{style:c}=e,d=vc.isCSSRoundSupported,p=`var(--scale-factor) * ${a}px`,u=`var(--scale-factor) * ${l}px`,h=d?`round(${p}, 1px)`:`calc(${p})`,m=d?`round(${u}, 1px)`:`calc(${u})`;!r||t.rotation%180===0?(c.width=h,c.height=m):(c.width=m,c.height=h)}n&&e.setAttribute("data-main-rotation",t.rotation)}class LX{#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 r=this.#o._uiManager._signal;t.addEventListener("contextmenu",Ec,{signal:r}),t.addEventListener("pointerdown",LX.#s,{signal:r});const n=this.#i=document.createElement("div");n.className="buttons",t.append(n);const a=this.#o.toolbarPosition;if(a){const{style:l}=t,c=this.#o._uiManager.direction==="ltr"?1-a[0]:a[0];l.insetInlineEnd=`${100*c}%`,l.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return this.#d(),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 r=this.#o._uiManager._signal;t.addEventListener("focusin",this.#r.bind(this),{capture:!0,signal:r}),t.addEventListener("focusout",this.#n.bind(this),{capture:!0,signal:r}),t.addEventListener("contextmenu",Ec,{signal:r})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden")}#d(){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",r=>{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 r=t.renderButton();this.#l(r),this.#i.prepend(r,this.#p)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class ZOt{#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",Ec,{signal:this.#o._signal});const r=this.#e=document.createElement("div");return r.className="buttons",t.append(r),this.#r(),t}#s(t,r){let n=0,a=0;for(const l of t){const c=l.y+l.height;if(c<n)continue;const d=l.x+(r?l.width:0);if(c>n){a=d,n=c;continue}r?d>a&&(a=d):d<a&&(a=d)}return[r?1-a:a,n]}show(t,r,n){const[a,l]=this.#s(r,n),{style:c}=this.#t||=this.#i();t.append(this.#t),c.insetInlineEnd=`${100*a}%`,c.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 r=document.createElement("span");t.append(r),r.className="visuallyHidden",r.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const n=this.#o._signal;t.addEventListener("contextmenu",Ec,{signal:n}),t.addEventListener("click",()=>{this.#o.highlightSelection("floating_button")},{signal:n}),this.#e.append(t)}}function ML(e,t,r){for(const n of r)t.addEventListener(n,e[n].bind(e))}function JOt(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")}class XOt{#e=0;get id(){return`${MOt}${this.#e++}`}}class IX{#e=QOt();#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>',n=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),a=new Image;a.src=t;const l=a.decode().then(()=>(n.drawImage(a,0,0,1,1,0,0,1,3),new Uint32Array(n.getImageData(0,0,1,1).data.buffer)[0]===0));return mi(this,"_isSVGFittingCanvas",l)}async#i(t,r){this.#o||=new Map;let n=this.#o.get(t);if(n===null)return null;if(n?.bitmap)return n.refCounter+=1,n;try{n||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let a;if(typeof r=="string"?(n.url=r,a=await RM(r,"blob")):a=n.file=r,a.type==="image/svg+xml"){const l=IX._isSVGFittingCanvas,c=new FileReader,d=new Image,p=new Promise((u,h)=>{d.onload=()=>{n.bitmap=d,n.isSvg=!0,u()},c.onload=async()=>{const m=n.svgUrl=c.result;d.src=await l?`${m}#svgView(preserveAspectRatio(none))`:m},d.onerror=c.onerror=h});c.readAsDataURL(a),await p}else n.bitmap=await createImageBitmap(a);n.refCounter=1}catch(a){console.error(a),n=null}return this.#o.set(t,n),n&&this.#o.set(n.id,n),n}async getFromFile(t){const{lastModified:r,name:n,size:a,type:l}=t;return this.#i(`${r}_${n}_${a}_${l}`,t)}async getFromUrl(t){return this.#i(t,t)}async getFromId(t){this.#o||=new Map;const r=this.#o.get(t);return r?r.bitmap?(r.refCounter+=1,r):r.file?this.getFromFile(r.file):this.getFromUrl(r.url):null}getSvgUrl(t){const r=this.#o.get(t);return r?.isSvg?r.svgUrl:null}deleteId(t){this.#o||=new Map;const r=this.#o.get(t);r&&(r.refCounter-=1,r.refCounter===0&&(r.bitmap=null))}isValidId(t){return t.startsWith(`image_${this.#e}_`)}}class eNt{#e=[];#t=!1;#o;#i=-1;constructor(t=128){this.#o=t}add({cmd:t,undo:r,post:n,mustExec:a,type:l=NaN,overwriteIfSameType:c=!1,keepUndo:d=!1}){if(a&&t(),this.#t)return;const p={cmd:t,undo:r,post:n,type:l};if(this.#i===-1){this.#e.length>0&&(this.#e.length=0),this.#i=0,this.#e.push(p);return}if(c&&this.#e[this.#i].type===l){d&&(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:r}=this.#e[this.#i];t(),r?.(),this.#t=!1,this.#i-=1}redo(){if(this.#i<this.#e.length-1){this.#i+=1,this.#t=!0;const{cmd:t,post:r}=this.#e[this.#i];t(),r?.(),this.#t=!1}}hasSomethingToUndo(){return this.#i!==-1}hasSomethingToRedo(){return this.#i<this.#e.length-1}destroy(){this.#e=null}}class mC{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:r}=vc.platform;for(const[n,a,l={}]of t)for(const c of n){const d=c.startsWith("mac+");r&&d?(this.callbacks.set(c.slice(4),{callback:a,options:l}),this.allKeys.add(c.split("+").at(-1))):!r&&!d&&(this.callbacks.set(c,{callback:a,options:l}),this.allKeys.add(c.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 r=this.buffer.join("+");return this.buffer.length=0,r}exec(t,r){if(!this.allKeys.has(r.key))return;const n=this.callbacks.get(this.#e(r));if(!n)return;const{callback:a,options:{bubbles:l=!1,args:c=[],checker:d=null}}=n;d&&!d(t,r)||(a.bind(t,...c,r)(),l||(r.stopPropagation(),r.preventDefault()))}}class jX{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return qOt(t),mi(this,"_colors",t)}convert(t){const r=EX(t);if(!window.matchMedia("(forced-colors: active)").matches)return r;for(const[n,a]of this._colors)if(a.every((l,c)=>l===r[c]))return jX._colorsMapping.get(n);return r}getHexCode(t){const r=this._colors.get(t);return r?jo.makeHexColor(...r):t}}class yg{#e=new AbortController;#t=null;#o=new Map;#i=new Map;#s=null;#r=null;#n=null;#l=new eNt;#d=0;#p=new Set;#h=null;#c=null;#a=new Set;#m=!1;#f=null;#u=null;#y=null;#g=!1;#b=null;#v=new XOt;#A=!1;#k=!1;#S=null;#j=null;#$=null;#w=ai.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=yg.prototype,r=c=>c.#H.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&c.hasSomethingToControl(),n=(c,{target:d})=>{if(d instanceof HTMLInputElement){const{type:p}=d;return p!=="text"&&p!=="number"}return!0},a=this.TRANSLATE_SMALL,l=this.TRANSLATE_BIG;return mi(this,"_keyboardManager",new mC([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],t.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:n}],[["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:n}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(c,{target:d})=>!(d instanceof HTMLButtonElement)&&c.#H.contains(d)&&!c.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(c,{target:d})=>!(d instanceof HTMLButtonElement)&&c.#H.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-a,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-l,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[a,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[l,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-a],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-l],checker:r}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,a],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,l],checker:r}]]))}constructor(t,r,n,a,l,c,d,p,u){this._signal=this.#e.signal,this.#H=t,this.#q=r,this.#s=n,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=c,this.#y=d||null,this.#m=p,this.#$=u||null,this.viewParameters={realScale:Q8.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.#b?.hide(),this.#b=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 mi(this,"hcmFilter",this.#E?this.#f.addHCMFilter(this.#E.foreground,this.#E.background):"none")}get direction(){return mi(this,"direction",getComputedStyle(this.#H).direction)}get highlightColors(){return mi(this,"highlightColors",this.#y?new Map(this.#y.split(",").map(t=>t.split("=").map(r=>r.trim()))):null)}get highlightColorNames(){return mi(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){this.#j=t}editAltText(t){this.#s?.editAltText(this,t)}onPageChanging({pageNumber:t}){this.#d=t-1}focusMainContainer(){this.#H.focus()}findParent(t,r){for(const n of this.#i.values()){const{x:a,y:l,width:c,height:d}=n.div.getBoundingClientRect();if(t>=a&&t<=a+c&&r>=l&&r<=l+d)return n}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*Q8.PDF_TO_CSS_UNITS;for(const r of this.#a)r.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 r=document.getSelection();if(!r||r.isCollapsed)return;const{anchorNode:n,anchorOffset:a,focusNode:l,focusOffset:c}=r,d=r.toString(),u=this.#G(r).closest(".textLayer"),h=this.getSelectionBoxes(u);if(h){r.empty(),this.#w===ai.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:ai.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:n,anchorOffset:a,focusNode:l,focusOffset:c,text:d});break}}}#oe(){const t=document.getSelection();if(!t||t.isCollapsed)return;const n=this.#G(t).closest(".textLayer"),a=this.getSelectionBoxes(n);a&&(this.#b||=new ZOt(this),this.#b.show(n,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.#b?.hide(),this.#C=null,this.#I({hasSelectedText:!1}));return}const{anchorNode:r}=t;if(r===this.#C)return;if(!this.#G(t).closest(".textLayer")){this.#C&&(this.#b?.hide(),this.#C=null,this.#I({hasSelectedText:!1}));return}if(this.#b?.hide(),this.#C=r,this.#I({hasSelectedText:!0}),!(this.#w!==ai.HIGHLIGHT&&this.#w!==ai.NONE)&&(this.#w===ai.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#g=this.isShiftKeyDown,!this.isShiftKeyDown)){const l=this._signal,c=d=>{d.type==="pointerup"&&d.button!==0||(window.removeEventListener("pointerup",c),window.removeEventListener("blur",c),d.type==="pointerup"&&this.#Y("main_toolbar"))};window.addEventListener("pointerup",c,{signal:l}),window.addEventListener("blur",c,{signal:l})}}#Y(t=""){this.#w===ai.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 r of this.#x)if(r.div.contains(t)){this.#S=[r,t],r._focusEventsAllowed=!1;break}}focus(){if(!this.#S)return;const[t,r]=this.#S;this.#S=null,r.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),r.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:r}of t.dataTransfer.items)for(const n of this.#c)if(n.isHandlingMimeForPasting(r)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const r of t.dataTransfer.items)for(const n of this.#c)if(n.isHandlingMimeForPasting(r.type)){n.paste(r,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const r=[];for(const n of this.#x){const a=n.serialize(!0);a&&r.push(a)}r.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(r))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:r}=t;for(const l of r.items)for(const c of this.#c)if(c.isHandlingMimeForPasting(l.type)){c.paste(l,this.currentLayer);return}let n=r.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(l){Nr(`paste: "${l.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();const a=this.currentLayer;try{const l=[];for(const p of n){const u=a.deserialize(p);if(!u)return;l.push(u)}const c=()=>{for(const p of l)this.#ee(p);this.#te(l)},d=()=>{for(const p of l)p.remove()};this.addCommands({cmd:c,undo:d,mustExec:!0})}catch(l){Nr(`paste: "${l.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),this.#w!==ai.NONE&&!this.isEditorHandlingKeyboard&&yg._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}}#I(t){Object.entries(t).some(([n,a])=>this.#K[n]!==a)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#K,t)}),this.#w===ai.HIGHLIGHT&&t.hasSelectedEditor===!1&&this.#O([[gr.HIGHLIGHT_FREE,!0]]))}#O(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#ne(),this.#J(),this.#I({isEditing:this.#w!==ai.NONE,isEmpty:this.#W(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ae(),this.#X(),this.#I({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#c){this.#c=t;for(const r of this.#c)this.#O(r.defaultPropertiesToUpdate)}}getId(){return this.#v.id}get currentLayer(){return this.#i.get(this.#d)}getLayer(t){return this.#i.get(t)}get currentPageIndex(){return this.#d}addLayer(t){this.#i.set(t.pageIndex,t),this.#A?t.enable():t.disable()}removeLayer(t){this.#i.delete(t.pageIndex)}updateMode(t,r=null,n=!1){if(this.#w!==t){if(this.#w=t,t===ai.NONE){this.setEditingState(!1),this.#de();return}this.setEditingState(!0),this.#ce(),this.unselectAll();for(const a of this.#i.values())a.updateMode(t);if(!r&&n){this.addNewEditorFromKeyboard();return}if(r){for(const a of this.#o.values())if(a.annotationElementId===r){this.setSelected(a),a.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#w&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,r){if(this.#c){switch(t){case gr.CREATE:this.currentLayer.addNewEditor();return;case gr.HIGHLIGHT_DEFAULT_COLOR:this.#j?.updateColor(r);break;case gr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#L||=new Map).set(t,r),this.showAllEditors("highlight",r);break}for(const n of this.#x)n.updateParams(t,r);for(const n of this.#c)n.updateDefaultParams(t,r)}}showAllEditors(t,r,n=!1){for(const l of this.#o.values())l.editorType===t&&l.show(r);(this.#L?.get(gr.HIGHLIGHT_SHOW_ALL)??!0)!==r&&this.#O([[gr.HIGHLIGHT_SHOW_ALL,r]])}enableWaiting(t=!1){if(this.#k!==t){this.#k=t;for(const r of this.#i.values())t?r.disableClick():r.enableClick(),r.div.classList.toggle("waiting",t)}}#ce(){if(!this.#A){this.#A=!0;for(const t of this.#i.values())t.enable();for(const t of this.#o.values())t.enable()}}#de(){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 r=[];for(const n of this.#o.values())n.pageIndex===t&&r.push(n);return r}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 r=this.#i.get(t.pageIndex);r?r.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.#I({hasSelectedEditor:this.hasSelection});return}this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#I({hasSelectedEditor:!0})}setSelected(t){for(const r of this.#x)r!==t&&r.unselect();this.#x.clear(),this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#I({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.#I({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.#I({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#W()})}redo(){this.#l.redo(),this.#I({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#W()})}addCommands(t){this.#l.add(t),this.#I({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],r=()=>{for(const a of t)a.remove()},n=()=>{for(const a of t)this.#ee(a)};this.addCommands({cmd:r,undo:n,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#te(t){for(const r of this.#x)r.unselect();this.#x.clear();for(const r of t)r.isEmpty()||(this.#x.add(r),r.select());this.#I({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.#w!==ai.NONE))&&this.hasSelection){for(const t of this.#x)t.unselect();this.#x.clear(),this.#I({hasSelectedEditor:!1})}}translateSelectedEditors(t,r,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#V[0]+=t,this.#V[1]+=r;const[a,l]=this.#V,c=[...this.#x],d=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 c)this.#o.has(p.id)&&p.translateInPage(a,l)},undo:()=>{for(const p of c)this.#o.has(p.id)&&p.translateInPage(-a,-l)},mustExec:!1})},d);for(const p of c)p.translateInPage(t,r)}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 r=!1;for(const[{x:a,y:l,pageIndex:c},d]of t)d.newX=a,d.newY=l,d.newPageIndex=c,r||=a!==d.savedX||l!==d.savedY||c!==d.savedPageIndex;if(!r)return!1;const n=(a,l,c,d)=>{if(this.#o.has(a.id)){const p=this.#i.get(d);p?a._setParentAndPosition(p,l,c):(a.pageIndex=d,a.x=l,a.y=c)}};return this.addCommands({cmd:()=>{for(const[a,{newX:l,newY:c,newPageIndex:d}]of t)n(a,l,c,d)},undo:()=>{for(const[a,{savedX:l,savedY:c,savedPageIndex:d}]of t)n(a,l,c,d)},mustExec:!0}),!0}dragSelectedEditors(t,r){if(this.#h)for(const n of this.#h.keys())n.drag(t,r)}rebuild(t){if(t.parent===null){const r=this.getLayer(t.pageIndex);r?(r.changeParent(t),r.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.#w}get imageManager(){return mi(this,"imageManager",new IX)}getSelectionBoxes(t){if(!t)return null;const r=document.getSelection();for(let u=0,h=r.rangeCount;u<h;u++)if(!t.contains(r.getRangeAt(u).commonAncestorContainer))return null;const{x:n,y:a,width:l,height:c}=t.getBoundingClientRect();let d;switch(t.getAttribute("data-main-rotation")){case"90":d=(u,h,m,f)=>({x:(h-a)/c,y:1-(u+m-n)/l,width:f/c,height:m/l});break;case"180":d=(u,h,m,f)=>({x:1-(u+m-n)/l,y:1-(h+f-a)/c,width:m/l,height:f/c});break;case"270":d=(u,h,m,f)=>({x:1-(h+f-a)/c,y:(u-n)/l,width:f/c,height:m/l});break;default:d=(u,h,m,f)=>({x:(u-n)/l,y:(h-a)/c,width:m/l,height:f/c});break}const p=[];for(let u=0,h=r.rangeCount;u<h;u++){const m=r.getRangeAt(u);if(!m.collapsed)for(const{x:f,y:x,width:y,height:b}of m.getClientRects())y===0||b===0||p.push(d(f,x,y,b))}return p.length===0?null:p}addChangedExistingAnnotation({annotationElementId:t,id:r}){(this.#n||=new Map).set(t,r)}removeChangedExistingAnnotation({annotationElementId:t}){this.#n?.delete(t)}renderAnnotationElement(t){const r=this.#n?.get(t.data.id);if(!r)return;const n=this.#r.getRawValue(r);n&&(this.#w===ai.NONE&&!n.hasBeenModified||n.renderAnnotationElement(t))}}class p4{#e="";#t=!1;#o=null;#i=null;#s=null;#r=!1;#n=null;static _l10nPromise=null;constructor(t){this.#n=t}static initialize(t){p4._l10nPromise||=t}async render(){const t=this.#o=document.createElement("button");t.className="altText";const r=await p4._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=r,t.setAttribute("aria-label",r),t.tabIndex="0";const n=this.#n._uiManager._signal;t.addEventListener("contextmenu",Ec,{signal:n}),t.addEventListener("pointerdown",l=>l.stopPropagation(),{signal:n});const a=l=>{l.preventDefault(),this.#n._uiManager.editAltText(this.#n)};return t.addEventListener("click",a,{capture:!0,signal:n}),t.addEventListener("keydown",l=>{l.target===t&&l.key==="Enter"&&(this.#r=!0,a(l))},{signal:n}),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:r}){this.#e===t&&this.#t===r||(this.#e=t,this.#t=r,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"),p4._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(a=>{t.setAttribute("aria-label",a)});let r=this.#i;if(!r){this.#i=r=document.createElement("span"),r.className="tooltip",r.setAttribute("role","tooltip");const a=r.id=`alt-text-tooltip-${this.#n.id}`;t.setAttribute("aria-describedby",a);const l=100,c=this.#n._uiManager._signal;c.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:c}),t.addEventListener("mouseleave",()=>{this.#s&&(clearTimeout(this.#s),this.#s=null),this.#i?.classList.remove("show")},{signal:c})}r.innerText=this.#t?await p4._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):this.#e,r.parentNode||t.append(r),this.#n.getImageForAltText()?.setAttribute("aria-describedby",r.id)}}class ur{#e=null;#t=null;#o=null;#i=!1;#s=!1;#r=null;#n=null;#l=this.focusin.bind(this);#d=this.focusout.bind(this);#p=null;#h="";#c=!1;#a=null;#m=!1;#f=!1;#u=!1;#y=null;#g=0;#b=0;#v=null;_initialOptions=Object.create(null);_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#A=!1;#k=ur._zIndex++;static _borderLineWidth=-1;static _colorManager=new jX;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=ur.prototype._resizeWithKeyboard,r=yg.TRANSLATE_SMALL,n=yg.TRANSLATE_BIG;return mi(this,"_resizerKeyboardManager",new mC([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-r,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[r,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-r]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,r]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,n]}],[["Escape","mac+Escape"],ur.prototype._stopResizingWithKeyboard]]))}constructor(t){this.constructor===ur&&Gi("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:r,rawDims:{pageWidth:n,pageHeight:a,pageX:l,pageY:c}}=this.parent.viewport;this.rotation=r,this.pageRotation=(360+r-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,a],this.pageTranslation=[l,c];const[d,p]=this.parentDimensions;this.x=t.x/d,this.y=t.y/p,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return mi(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const r=new tNt({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});r.annotationElementId=t.annotationElementId,r.deleted=!0,r._uiManager.addToAnnotationStorage(r)}static initialize(t,r,n){if(ur._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,c=>`-${c.toLowerCase()}`))])),n?.strings)for(const l of n.strings)ur._l10nPromise.set(l,t.get(l));if(ur._borderLineWidth!==-1)return;const a=getComputedStyle(document.documentElement);ur._borderLineWidth=parseFloat(a.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,r){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,r){Gi("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,r]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*r/(t*2),this.y+=this.width*t/(r*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*r/(t*2),this.y-=this.width*t/(r*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.#c?this.#c=!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,r,n,a){const[l,c]=this.parentDimensions;[n,a]=this.screenToPageTranslation(n,a),this.x=(t+n)/l,this.y=(r+a)/c,this.fixAndSetPosition()}#S([t,r],n,a){[n,a]=this.screenToPageTranslation(n,a),this.x+=n/t,this.y+=a/r,this.fixAndSetPosition()}translate(t,r){this.#S(this.parentDimensions,t,r)}translateInPage(t,r){this.#a||=[this.x,this.y],this.#S(this.pageDimensions,t,r),this.div.scrollIntoView({block:"nearest"})}drag(t,r){this.#a||=[this.x,this.y];const[n,a]=this.parentDimensions;if(this.x+=t/n,this.y+=r/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:c}=this;const[d,p]=this.getBaseTranslation();l+=d,c+=p,this.div.style.left=`${(100*l).toFixed(2)}%`,this.div.style.top=`${(100*c).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,r]=this.parentDimensions,{_borderLineWidth:n}=ur,a=n/t,l=n/r;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[r,n]=this.pageDimensions;let{x:a,y:l,width:c,height:d}=this;if(c*=r,d*=n,a*=r,l*=n,this._mustFixPosition)switch(t){case 0:a=Math.max(0,Math.min(r-c,a)),l=Math.max(0,Math.min(n-d,l));break;case 90:a=Math.max(0,Math.min(r-d,a)),l=Math.min(n,Math.max(c,l));break;case 180:a=Math.min(r,Math.max(c,a)),l=Math.min(n,Math.max(d,l));break;case 270:a=Math.min(r,Math.max(d,a)),l=Math.max(0,Math.min(n-c,l));break}this.x=a/=r,this.y=l/=n;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#j(t,r,n){switch(n){case 90:return[r,-t];case 180:return[-t,-r];case 270:return[-r,t];default:return[t,r]}}screenToPageTranslation(t,r){return ur.#j(t,r,this.parentRotation)}pageTranslationToScreen(t,r){return ur.#j(t,r,360-this.parentRotation)}#$(t){switch(t){case 90:{const[r,n]=this.pageDimensions;return[0,-r/n,n/r,0]}case 180:return[-1,0,0,-1];case 270:{const[r,n]=this.pageDimensions;return[0,r/n,-n/r,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:[r,n]}=this,a=r*t,l=n*t;return vc.isCSSRoundSupported?[Math.round(a),Math.round(l)]:[a,l]}setDims(t,r){const[n,a]=this.parentDimensions;this.div.style.width=`${(100*t/n).toFixed(2)}%`,this.#s||(this.div.style.height=`${(100*r/a).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:r,width:n}=t,a=n.endsWith("%"),l=!this.#s&&r.endsWith("%");if(a&&l)return;const[c,d]=this.parentDimensions;a||(t.width=`${(100*parseFloat(n)/c).toFixed(2)}%`),!this.#s&&!l&&(t.height=`${(100*parseFloat(r)/d).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#w(){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"],r=this._uiManager._signal;for(const n of t){const a=document.createElement("div");this.#r.append(a),a.classList.add("resizer",n),a.setAttribute("data-resizer-name",n),a.addEventListener("pointerdown",this.#x.bind(this,n),{signal:r}),a.addEventListener("contextmenu",Ec,{signal:r}),a.tabIndex=-1}this.div.prepend(this.#r)}#x(t,r){r.preventDefault();const{isMac:n}=vc.platform;if(r.button!==0||r.ctrlKey&&n)return;this.#o?.toggle(!1);const a=this.#E.bind(this,t),l=this._isDraggable;this._isDraggable=!1;const c=this._uiManager._signal,d={passive:!0,capture:!0,signal:c};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",a,d),window.addEventListener("contextmenu",Ec,{signal:c});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(r.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,d),window.removeEventListener("contextmenu",Ec),this.parent.div.style.cursor=f,this.div.style.cursor=x,this.#C(p,u,h,m)};window.addEventListener("pointerup",y,{signal:c}),window.addEventListener("blur",y,{signal:c})}#C(t,r,n,a){const l=this.x,c=this.y,d=this.width,p=this.height;l===t&&c===r&&d===n&&p===a||this.addCommands({cmd:()=>{this.width=d,this.height=p,this.x=l,this.y=c;const[u,h]=this.parentDimensions;this.setDims(u*d,h*p),this.fixAndSetPosition()},undo:()=>{this.width=n,this.height=a,this.x=t,this.y=r;const[u,h]=this.parentDimensions;this.setDims(u*n,h*a),this.fixAndSetPosition()},mustExec:!0})}#E(t,r){const[n,a]=this.parentDimensions,l=this.x,c=this.y,d=this.width,p=this.height,u=ur.MIN_SIZE/n,h=ur.MIN_SIZE/a,m=V=>Math.round(V*1e4)/1e4,f=this.#$(this.rotation),x=(V,O)=>[f[0]*V+f[2]*O,f[1]*V+f[3]*O],y=this.#$(360-this.rotation),b=(V,O)=>[y[0]*V+y[2]*O,y[1]*V+y[3]*O];let w,v,A=!1,S=!1;switch(t){case"topLeft":A=!0,w=(V,O)=>[0,0],v=(V,O)=>[V,O];break;case"topMiddle":w=(V,O)=>[V/2,0],v=(V,O)=>[V/2,O];break;case"topRight":A=!0,w=(V,O)=>[V,0],v=(V,O)=>[0,O];break;case"middleRight":S=!0,w=(V,O)=>[V,O/2],v=(V,O)=>[0,O/2];break;case"bottomRight":A=!0,w=(V,O)=>[V,O],v=(V,O)=>[0,0];break;case"bottomMiddle":w=(V,O)=>[V/2,O],v=(V,O)=>[V/2,0];break;case"bottomLeft":A=!0,w=(V,O)=>[0,O],v=(V,O)=>[V,0];break;case"middleLeft":S=!0,w=(V,O)=>[0,O/2],v=(V,O)=>[V,O/2];break}const E=w(d,p),I=v(d,p);let L=x(...I);const M=m(l+L[0]),D=m(c+L[1]);let P=1,T=1,[z,N]=this.screenToPageTranslation(r.movementX,r.movementY);if([z,N]=b(z/n,N/a),A){const V=Math.hypot(d,p);P=T=Math.max(Math.min(Math.hypot(I[0]-E[0]-z,I[1]-E[1]-N)/V,1/d,1/p),u/d,h/p)}else S?P=Math.max(u,Math.min(1,Math.abs(I[0]-E[0]-z)))/d:T=Math.max(h,Math.min(1,Math.abs(I[1]-E[1]-N)))/p;const K=m(d*P),q=m(p*T);L=x(...v(K,q));const F=M-L[0],_=D-L[1];this.width=K,this.height=q,this.x=F,this.y=_,this.setDims(n*K,a*q),this.fixAndSetPosition()}altTextFinish(){this.#o?.finish()}async addEditToolbar(){return this.#p||this.#f?this.#p:(this.#p=new LX(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||(p4.initialize(ur._l10nPromise),this.#o=new p4(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.#d,{signal:t});const[r,n]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*n/r).toFixed(2)}%`,this.div.style.maxHeight=`${(100*r/n).toFixed(2)}%`);const[a,l]=this.getInitialTranslation();return this.translate(a,l),ML(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:r}=vc.platform;if(t.button!==0||t.ctrlKey&&r){t.preventDefault();return}if(this.#c=!0,this._isDraggable){this.#B(t);return}this.#L(t)}#L(t){const{isMac:r}=vc.platform;t.ctrlKey&&!r||t.shiftKey||t.metaKey&&r?this.parent.toggleSelected(this):this.parent.setSelected(this)}#B(t){const r=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let n,a;const l=this._uiManager._signal;r&&(this.div.classList.add("moving"),n={passive:!0,capture:!0,signal:l},this.#g=t.clientX,this.#b=t.clientY,a=d=>{const{clientX:p,clientY:u}=d,[h,m]=this.screenToPageTranslation(p-this.#g,u-this.#b);this.#g=p,this.#b=u,this._uiManager.dragSelectedEditors(h,m)},window.addEventListener("pointermove",a,n));const c=()=>{window.removeEventListener("pointerup",c),window.removeEventListener("blur",c),r&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",a,n)),this.#c=!1,this._uiManager.endDragSession()||this.#L(t)};window.addEventListener("pointerup",c,{signal:l}),window.addEventListener("blur",c,{signal:l})}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,r,n){t.changeParent(this),this.x=r,this.y=n,this.fixAndSetPosition()}getRect(t,r,n=this.rotation){const a=this.parentScale,[l,c]=this.pageDimensions,[d,p]=this.pageTranslation,u=t/a,h=r/a,m=this.x*l,f=this.y*c,x=this.width*l,y=this.height*c;switch(n){case 0:return[m+u+d,c-f-h-y+p,m+u+x+d,c-f-h+p];case 90:return[m+h+d,c-f+u+p,m+h+y+d,c-f+u+x+p];case 180:return[m-u-x+d,c-f+h+p,m-u+d,c-f+h+y+p];case 270:return[m-h-y+d,c-f-u-x+p,m-h+d,c-f-u+p];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,r){const[n,a,l,c]=t,d=l-n,p=c-a;switch(this.rotation){case 0:return[n,r-c,d,p];case 90:return[n,r-a,p,d];case 180:return[l,r-a,d,p];case 270:return[l,r-c,p,d];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.#d,{signal:t})}rotate(t){}serialize(t=!1,r=null){Gi("An editor must be serializable")}static deserialize(t,r,n){const a=new this.prototype.constructor({parent:r,id:r.getNextId(),uiManager:n});a.rotation=t.rotation,a.#e=t.accessibilityData;const[l,c]=a.pageDimensions,[d,p,u,h]=a.getRectInCurrentCoords(t.rect,c);return a.x=d/l,a.y=p/c,a.width=u/l,a.height=h/c,a}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",this.#l),this.div.removeEventListener("focusout",this.#d),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.#w(),this.#r.classList.remove("hidden"),ML(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 r=this.#r.children;if(!this.#t){this.#t=Array.from(r);const c=this.#M.bind(this),d=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",c,{signal:p}),u.addEventListener("blur",d,{signal:p}),u.addEventListener("focus",this.#P.bind(this,h),{signal:p}),ur._l10nPromise.get(`pdfjs-editor-resizer-label-${h}`).then(m=>u.setAttribute("aria-label",m))}}const n=this.#t[0];let a=0;for(const c of r){if(c===n)break;a++}const l=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(l!==a){if(l<a)for(let d=0;d<a-l;d++)this.#r.append(this.#r.firstChild);else if(l>a)for(let d=0;d<l-a;d++)this.#r.firstChild.before(this.#r.lastChild);let c=0;for(const d of r){const u=this.#t[c++].getAttribute("data-resizer-name");ur._l10nPromise.get(`pdfjs-editor-resizer-label-${u}`).then(h=>d.setAttribute("aria-label",h))}}this.#z(0),this.#u=!0,this.#r.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#M(t){ur._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 r of this.#t)r.tabIndex=t}_resizeWithKeyboard(t,r){this.#u&&this.#E(this.#h,{movementX:t,movementY:r})}#D(){if(this.#u=!1,this.#z(-1),this.#n){const{savedX:t,savedY:r,savedWidth:n,savedHeight:a}=this.#n;this.#C(t,r,n,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,r){}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,r){this.#s=!0;const n=t/r,{style:a}=this.div;a.aspectRatio=n,a.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,r=!1){if(r){this.#v||=new Map;const{action:n}=t;let a=this.#v.get(n);a&&clearTimeout(a),a=setTimeout(()=>{this._reportTelemetry(t),this.#v.delete(n),this.#v.size===0&&(this.#v=null)},ur._telemetryTimeout),this.#v.set(n,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 r=t.container.querySelector(".annotationContent");if(!r)r=document.createElement("div"),r.classList.add("annotationContent",this.editorType),t.container.prepend(r);else if(r.nodeName==="CANVAS"){const n=r;r=document.createElement("div"),r.classList.add("annotationContent",this.editorType),n.before(r)}return r}resetAnnotationElement(t){const{firstChild:r}=t.container;r.nodeName==="DIV"&&r.classList.contains("annotationContent")&&r.remove()}}class tNt extends ur{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const bme=3285377520,Dd=4294901760,Tu=65535;class eRe{constructor(t){this.h1=t?t&4294967295:bme,this.h2=t?t&4294967295:bme}update(t){let r,n;if(typeof t=="string"){r=new Uint8Array(t.length*2),n=0;for(let b=0,w=t.length;b<w;b++){const v=t.charCodeAt(b);v<=255?r[n++]=v:(r[n++]=v>>>8,r[n++]=v&255)}}else if(ArrayBuffer.isView(t))r=t.slice(),n=r.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const a=n>>2,l=n-a*4,c=new Uint32Array(r.buffer,0,a);let d=0,p=0,u=this.h1,h=this.h2;const m=3432918353,f=461845907,x=m&Tu,y=f&Tu;for(let b=0;b<a;b++)b&1?(d=c[b],d=d*m&Dd|d*x&Tu,d=d<<15|d>>>17,d=d*f&Dd|d*y&Tu,u^=d,u=u<<13|u>>>19,u=u*5+3864292196):(p=c[b],p=p*m&Dd|p*x&Tu,p=p<<15|p>>>17,p=p*f&Dd|p*y&Tu,h^=p,h=h<<13|h>>>19,h=h*5+3864292196);switch(d=0,l){case 3:d^=r[a*4+2]<<16;case 2:d^=r[a*4+1]<<8;case 1:d^=r[a*4],d=d*m&Dd|d*x&Tu,d=d<<15|d>>>17,d=d*f&Dd|d*y&Tu,a&1?u^=d:h^=d}this.h1=u,this.h2=h}hexdigest(){let t=this.h1,r=this.h2;return t^=r>>>1,t=t*3981806797&Dd|t*36045&Tu,r=r*4283543511&Dd|((r<<16|t>>>16)*2950163797&Dd)>>>16,t^=r>>>1,t=t*444984403&Dd|t*60499&Tu,r=r*3301882366&Dd|((r<<16|t>>>16)*3120437893&Dd)>>>16,t^=r>>>1,(t>>>0).toString(16).padStart(8,"0")+(r>>>0).toString(16).padStart(8,"0")}}const EY=Object.freeze({map:null,hash:"",transfer:void 0});class MX{#e=!1;#t=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,r){const n=this.#t.get(t);return n===void 0?r:Object.assign(r,n)}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 r of this.#t.values())if(r instanceof ur)return;this.onAnnotationEditor(null)}}setValue(t,r){const n=this.#t.get(t);let a=!1;if(n!==void 0)for(const[l,c]of Object.entries(r))n[l]!==c&&(a=!0,n[l]=c);else a=!0,this.#t.set(t,r);a&&this.#o(),r instanceof ur&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(r.constructor._type)}has(t){return this.#t.has(t)}getAll(){return this.#t.size>0?vX(this.#t):null}setAll(t){for(const[r,n]of Object.entries(t))this.setValue(r,n)}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 tRe(this)}get serializable(){if(this.#t.size===0)return EY;const t=new Map,r=new eRe,n=[],a=Object.create(null);let l=!1;for(const[c,d]of this.#t){const p=d instanceof ur?d.serialize(!1,a):d;p&&(t.set(c,p),r.update(`${c}:${JSON.stringify(p)}`),l||=!!p.bitmap)}if(l)for(const c of t.values())c.bitmap&&n.push(c.bitmap);return t.size>0?{map:t,hash:r.hexdigest(),transfer:n}:EY}get editorStats(){let t=null;const r=new Map;for(const n of this.#t.values()){if(!(n instanceof ur))continue;const a=n.telemetryFinalData;if(!a)continue;const{type:l}=a;r.has(l)||r.set(l,Object.getPrototypeOf(n).constructor),t||=Object.create(null);const c=t[l]||=new Map;for(const[d,p]of Object.entries(a)){if(d==="type")continue;let u=c.get(d);u||(u=new Map,c.set(d,u));const h=u.get(p)??0;u.set(p,h+1)}}for(const[n,a]of r)t[n]=a.computeTelemetryFinalData(t[n]);return t}}class tRe extends MX{#e;constructor(t){super();const{map:r,hash:n,transfer:a}=t.serializable,l=structuredClone(r,a?{transfer:a}:null);this.#e={map:l,hash:n,transfer:a}}get print(){Gi("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}}class oNt{#e=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:r=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 r=this.styleElement.sheet;r.insertRule(t,r.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:r}){if(!(!t||this.#e.has(t.loadedName))){if(Wa(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:n,src:a,style:l}=t,c=new FontFace(n,a,l);this.addNativeFontFace(c);try{await c.load(),this.#e.add(n),r?.(t)}catch{Nr(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(c)}return}Gi("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 n=t.createNativeFontFace();if(n){this.addNativeFontFace(n);try{await n.loaded}catch(a){throw Nr(`Failed to load font '${n.family}': '${a}'.`),t.disableFontFace=!0,a}}return}const r=t.createFontFaceRule();if(r){if(this.insertRule(r),this.isSyncFontLoadingSupported)return;await new Promise(n=>{const a=this._queueLoadingCallback(n);this._prepareFontLoadEvent(t,a)})}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return mi(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(ul||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),mi(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){function r(){for(Wa(!a.done,"completeRequest() cannot be called twice."),a.done=!0;n.length>0&&n[0].done;){const l=n.shift();setTimeout(l.callback,0)}}const{loadingRequests:n}=this,a={done:!1,complete:r,callback:t};return n.push(a),a}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return mi(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,r){function n(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,M){const D=E.substring(0,I),P=E.substring(I+L);return D+M+P}let l,c;const d=this._document.createElement("canvas");d.width=1,d.height=1;const p=d.getContext("2d");let u=0;function h(E,I){if(++u>30){Nr("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,b=1482184792;let w=n(f,y);for(l=0,c=m.length-3;l<c;l+=4)w=w-b+n(m,l)|0;l<m.length&&(w=w-b+n(m+"XXX",l)|0),f=a(f,y,4,OOt(w));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(),r.complete()})}}class rNt{constructor(t,{disableFontFace:r=!1,inspectFont:n=null}){this.compiledGlyphs=Object.create(null);for(const a in t)this[a]=t[a];this.disableFontFace=r===!0,this._inspectFont=n}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=Yze(this.data),r=`url(data:${this.mimetype};base64,${btoa(t)});`;let n;if(!this.cssFontInfo)n=`@font-face {font-family:"${this.loadedName}";src:${r}}`;else{let a=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(a+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${a}src:${r}}`}return this._inspectFont?.(this,r),n}getPathGenerator(t,r){if(this.compiledGlyphs[r]!==void 0)return this.compiledGlyphs[r];let n;try{n=t.get(this.loadedName+"_path_"+r)}catch(l){Nr(`getPathGenerator - ignoring character: "${l}".`)}if(!Array.isArray(n)||n.length===0)return this.compiledGlyphs[r]=function(l,c){};const a=[];for(let l=0,c=n.length;l<c;)switch(n[l++]){case C0.BEZIER_CURVE_TO:{const[d,p,u,h,m,f]=n.slice(l,l+6);a.push(x=>x.bezierCurveTo(d,p,u,h,m,f)),l+=6}break;case C0.MOVE_TO:{const[d,p]=n.slice(l,l+2);a.push(u=>u.moveTo(d,p)),l+=2}break;case C0.LINE_TO:{const[d,p]=n.slice(l,l+2);a.push(u=>u.lineTo(d,p)),l+=2}break;case C0.QUADRATIC_CURVE_TO:{const[d,p,u,h]=n.slice(l,l+4);a.push(m=>m.quadraticCurveTo(d,p,u,h)),l+=4}break;case C0.RESTORE:a.push(d=>d.restore());break;case C0.SAVE:a.push(d=>d.save());break;case C0.SCALE:Wa(a.length===2,"Scale command is only valid at the third position.");break;case C0.TRANSFORM:{const[d,p,u,h,m,f]=n.slice(l,l+6);a.push(x=>x.transform(d,p,u,h,m,f)),l+=6}break;case C0.TRANSLATE:{const[d,p]=n.slice(l,l+2);a.push(u=>u.translate(d,p)),l+=2}break}return this.compiledGlyphs[r]=function(c,d){a[0](c),a[1](c),c.scale(d,-d);for(let p=2,u=a.length;p<u;p++)a[p](c)}}}if(ul){var LY=Promise.withResolvers(),IY=null;(async()=>{const t=await r4(()=>import("./empty-CaJqLeqH.js").then(d=>d.e),__vite__mapDeps([0,1,2])),r=await r4(()=>import("./index-CF6KfbAT.js").then(d=>d.i),__vite__mapDeps([3,1,4,5,6,7,8,9])),n=await r4(()=>import("./index-B-IAe6yw.js").then(d=>d.i),__vite__mapDeps([10,1,11,4,5,6,7,8,9])),a=await r4(()=>import("./url-DH9-bXDQ.js").then(d=>d.u),__vite__mapDeps([12,1,9,7,5,6,8]));let l,c;return new Map(Object.entries({fs:t,http:r,https:n,url:a,canvas:l,path2d:c}))})().then(t=>{IY=t,LY.resolve()},t=>{Nr(`loadPackages: ${t}`),IY=new Map,LY.resolve()})}class Rh{static get promise(){return LY.promise}static get(t){return IY?.get(t)}}const oRe=function(e){return Rh.get("fs").promises.readFile(e).then(r=>new Uint8Array(r))};class iNt extends PM{}class nNt extends DM{_createCanvas(t,r){return Rh.get("canvas").createCanvas(t,r)}}class aNt extends TM{_fetchData(t,r){return oRe(t).then(n=>({cMapData:n,compressionType:r}))}}class sNt extends zM{_fetchData(t){return oRe(t)}}const Tl={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function jY(e,t){if(!t)return;const r=t[2]-t[0],n=t[3]-t[1],a=new Path2D;a.rect(t[0],t[1],r,n),e.clip(a)}class gC{constructor(){this.constructor===gC&&Gi("Cannot initialize BaseShadingPattern.")}getPattern(){Gi("Abstract method `getPattern` called.")}}class lNt extends gC{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 r;this._type==="axial"?r=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(r=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const n of this._colorStops)r.addColorStop(n[0],n[1]);return r}getPattern(t,r,n,a){let l;if(a===Tl.STROKE||a===Tl.FILL){const c=r.current.getClippedPathBoundingBox(a,Pn(t))||[0,0,0,0],d=Math.ceil(c[2]-c[0])||1,p=Math.ceil(c[3]-c[1])||1,u=r.cachedCanvases.getCanvas("pattern",d,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(-c[0],-c[1]),n=jo.transform(n,[1,0,0,1,c[0],c[1]]),h.transform(...r.baseTransform),this.matrix&&h.transform(...this.matrix),jY(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),l=t.createPattern(u.canvas,"no-repeat");const m=new DOMMatrix(n);l.setTransform(m)}else jY(t,this._bbox),l=this._createGradient(t);return l}}function i_(e,t,r,n,a,l,c,d){const p=t.coords,u=t.colors,h=e.data,m=e.width*4;let f;p[r+1]>p[n+1]&&(f=r,r=n,n=f,f=l,l=c,c=f),p[n+1]>p[a+1]&&(f=n,n=a,a=f,f=c,c=d,d=f),p[r+1]>p[n+1]&&(f=r,r=n,n=f,f=l,l=c,c=f);const x=(p[r]+t.offsetX)*t.scaleX,y=(p[r+1]+t.offsetY)*t.scaleY,b=(p[n]+t.offsetX)*t.scaleX,w=(p[n+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[c],M=u[c+1],D=u[c+2],P=u[d],T=u[d+1],z=u[d+2],N=Math.round(y),K=Math.round(A);let q,F,_,V,O,R,H,ee;for(let Y=N;Y<=K;Y++){if(Y<w){const ye=Y<y?0:(y-Y)/(y-w);q=x-(x-b)*ye,F=S-(S-L)*ye,_=E-(E-M)*ye,V=I-(I-D)*ye}else{let ye;Y>A?ye=1:w===A?ye=0:ye=(w-Y)/(w-A),q=b-(b-v)*ye,F=L-(L-P)*ye,_=M-(M-T)*ye,V=D-(D-z)*ye}let G;Y<y?G=0:Y>A?G=1:G=(y-Y)/(y-A),O=x-(x-v)*G,R=S-(S-P)*G,H=E-(E-T)*G,ee=I-(I-z)*G;const X=Math.round(Math.min(q,O)),J=Math.round(Math.max(q,O));let ie=m*Y+X*4;for(let ye=X;ye<=J;ye++)G=(q-ye)/(q-O),G<0?G=0:G>1&&(G=1),h[ie++]=F-(F-R)*G|0,h[ie++]=_-(_-H)*G|0,h[ie++]=V-(V-ee)*G|0,h[ie++]=255}}function cNt(e,t,r){const n=t.coords,a=t.colors;let l,c;switch(t.type){case"lattice":const d=t.verticesPerRow,p=Math.floor(n.length/d)-1,u=d-1;for(l=0;l<p;l++){let h=l*d;for(let m=0;m<u;m++,h++)i_(e,r,n[h],n[h+1],n[h+d],a[h],a[h+1],a[h+d]),i_(e,r,n[h+d+1],n[h+1],n[h+d],a[h+d+1],a[h+1],a[h+d])}break;case"triangles":for(l=0,c=n.length;l<c;l+=3)i_(e,r,n[l],n[l+1],n[l+2],a[l],a[l+1],a[l+2]);break;default:throw new Error("illegal figure")}}class dNt extends gC{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,r,n){const d=Math.floor(this._bounds[0]),p=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-d,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,b={coords:this._coords,colors:this._colors,offsetX:-d,offsetY:-p,scaleX:1/x,scaleY:1/y},w=m+4,v=f+4,A=n.getCanvas("mesh",w,v,!1),S=A.context,E=S.createImageData(m,f);if(r){const L=E.data;for(let M=0,D=L.length;M<D;M+=4)L[M]=r[0],L[M+1]=r[1],L[M+2]=r[2],L[M+3]=255}for(const L of this._figures)cNt(E,L,b);return S.putImageData(E,2,2),{canvas:A.canvas,offsetX:d-2*x,offsetY:p-2*y,scaleX:x,scaleY:y}}getPattern(t,r,n,a){jY(t,this._bbox);let l;if(a===Tl.SHADING)l=jo.singularValueDecompose2dScale(Pn(t));else if(l=jo.singularValueDecompose2dScale(r.baseTransform),this.matrix){const d=jo.singularValueDecompose2dScale(this.matrix);l=[l[0]*d[0],l[1]*d[1]]}const c=this._createMeshCanvas(l,a===Tl.SHADING?null:this._background,r.cachedCanvases);return a!==Tl.SHADING&&(t.setTransform(...r.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(c.offsetX,c.offsetY),t.scale(c.scaleX,c.scaleY),t.createPattern(c.canvas,"no-repeat")}}class pNt extends gC{getPattern(){return"hotpink"}}function uNt(e){switch(e[0]){case"RadialAxial":return new lNt(e);case"Mesh":return new dNt(e);case"Dummy":return new pNt}throw new Error(`Unknown IR type: ${e[0]}`)}const wme={COLORED:1,UNCOLORED:2};class BX{static MAX_PATTERN_SIZE=3e3;constructor(t,r,n,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=r,this.ctx=n,this.canvasGraphicsFactory=a,this.baseTransform=l}createPatternCanvas(t){const r=this.operatorList,n=this.bbox,a=this.xstep,l=this.ystep,c=this.paintType,d=this.tilingType,p=this.color,u=this.canvasGraphicsFactory;jM("TilingType: "+d);const h=n[0],m=n[1],f=n[2],x=n[3],y=jo.singularValueDecompose2dScale(this.matrix),b=jo.singularValueDecompose2dScale(this.baseTransform),w=[y[0]*b[0],y[1]*b[1]],v=this.getSizeAndScale(a,this.ctx.canvas.width,w[0]),A=this.getSizeAndScale(l,this.ctx.canvas.height,w[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,c,p);let L=h,M=m,D=f,P=x;return h<0&&(L=0,D+=Math.abs(h)),m<0&&(M=0,P+=Math.abs(m)),E.translate(-(v.scale*L),-(A.scale*M)),I.transform(v.scale,0,0,A.scale,0,0),E.save(),this.clipBbox(I,L,M,D,P),I.baseTransform=Pn(I.ctx),I.executeOperatorList(r),I.endDrawing(),{canvas:S.canvas,scaleX:v.scale,scaleY:A.scale,offsetX:L,offsetY:M}}getSizeAndScale(t,r,n){t=Math.abs(t);const a=Math.max(BX.MAX_PATTERN_SIZE,r);let l=Math.ceil(t*n);return l>=a?l=a:n=l/t,{scale:n,size:l}}clipBbox(t,r,n,a,l){const c=a-r,d=l-n;t.ctx.rect(r,n,c,d),t.current.updateRectMinMax(Pn(t.ctx),[r,n,a,l]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,r,n){const a=t.ctx,l=t.current;switch(r){case wme.COLORED:const c=this.ctx;a.fillStyle=c.fillStyle,a.strokeStyle=c.strokeStyle,l.fillColor=c.fillStyle,l.strokeColor=c.strokeStyle;break;case wme.UNCOLORED:const d=jo.makeHexColor(n[0],n[1],n[2]);a.fillStyle=d,a.strokeStyle=d,l.fillColor=d,l.strokeColor=d;break;default:throw new FOt(`Unsupported paint type: ${r}`)}}getPattern(t,r,n,a){let l=n;a!==Tl.SHADING&&(l=jo.transform(l,r.baseTransform),this.matrix&&(l=jo.transform(l,this.matrix)));const c=this.createPatternCanvas(r);let d=new DOMMatrix(l);d=d.translate(c.offsetX,c.offsetY),d=d.scale(1/c.scaleX,1/c.scaleY);const p=t.createPattern(c.canvas,"repeat");return p.setTransform(d),p}}function hNt({src:e,srcPos:t=0,dest:r,width:n,height:a,nonBlackColor:l=4294967295,inverseDecode:c=!1}){const d=vc.isLittleEndian?4278190080:255,[p,u]=c?[l,d]:[d,l],h=n>>3,m=n&7,f=e.length;r=new Uint32Array(r.buffer);let x=0;for(let y=0;y<a;y++){for(const w=t+h;t<w;t++){const v=t<f?e[t]:255;r[x++]=v&128?u:p,r[x++]=v&64?u:p,r[x++]=v&32?u:p,r[x++]=v&16?u:p,r[x++]=v&8?u:p,r[x++]=v&4?u:p,r[x++]=v&2?u:p,r[x++]=v&1?u:p}if(m===0)continue;const b=t<f?e[t++]:255;for(let w=0;w<m;w++)r[x++]=b&1<<7-w?u:p}return{srcPos:t,destPos:x}}const vme=16,Cme=100,mNt=15,Ame=10,$me=1e3,dc=16;function gNt(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(n,a){t.translate(n,a),this.__originalTranslate(n,a)},e.scale=function(n,a){t.scale(n,a),this.__originalScale(n,a)},e.transform=function(n,a,l,c,d,p){t.transform(n,a,l,c,d,p),this.__originalTransform(n,a,l,c,d,p)},e.setTransform=function(n,a,l,c,d,p){t.setTransform(n,a,l,c,d,p),this.__originalSetTransform(n,a,l,c,d,p)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(n){t.rotate(n),this.__originalRotate(n)},e.clip=function(n){t.clip(n),this.__originalClip(n)},e.moveTo=function(r,n){t.moveTo(r,n),this.__originalMoveTo(r,n)},e.lineTo=function(r,n){t.lineTo(r,n),this.__originalLineTo(r,n)},e.bezierCurveTo=function(r,n,a,l,c,d){t.bezierCurveTo(r,n,a,l,c,d),this.__originalBezierCurveTo(r,n,a,l,c,d)},e.rect=function(r,n,a,l){t.rect(r,n,a,l),this.__originalRect(r,n,a,l)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class fNt{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,r,n){let a;return this.cache[t]!==void 0?(a=this.cache[t],this.canvasFactory.reset(a,r,n)):(a=this.canvasFactory.create(r,n),this.cache[t]=a),a}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const r=this.cache[t];this.canvasFactory.destroy(r),delete this.cache[t]}}}function g$(e,t,r,n,a,l,c,d,p,u){const[h,m,f,x,y,b]=Pn(e);if(m===0&&f===0){const A=c*h+y,S=Math.round(A),E=d*x+b,I=Math.round(E),L=(c+p)*h+y,M=Math.abs(Math.round(L)-S)||1,D=(d+u)*x+b,P=Math.abs(Math.round(D)-I)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(x),S,I),e.drawImage(t,r,n,a,l,0,0,M,P),e.setTransform(h,m,f,x,y,b),[M,P]}if(h===0&&x===0){const A=d*f+y,S=Math.round(A),E=c*m+b,I=Math.round(E),L=(d+u)*f+y,M=Math.abs(Math.round(L)-S)||1,D=(c+p)*m+b,P=Math.abs(Math.round(D)-I)||1;return e.setTransform(0,Math.sign(m),Math.sign(f),0,S,I),e.drawImage(t,r,n,a,l,0,0,P,M),e.setTransform(h,m,f,x,y,b),[P,M]}e.drawImage(t,r,n,a,l,c,d,p,u);const w=Math.hypot(h,m),v=Math.hypot(f,x);return[w*p,v*u]}function xNt(e){const{width:t,height:r}=e;if(t>$me||r>$me)return null;const n=1e3,a=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),l=t+1;let c=new Uint8Array(l*(r+1)),d,p,u;const h=t+7&-8;let m=new Uint8Array(h*r),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&&(c[0]=1,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(c[p]=m[f]?2:1,++x),f++;for(m[f]!==0&&(c[p]=2,++x),d=1;d<r;d++){f=d*h,u=d*l,m[f-h]!==m[f]&&(c[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]&&(c[u+p]=a[v],++x),f++;if(m[f-h]!==m[f]&&(c[u+p]=m[f]?2:4,++x),x>n)return null}for(f=h*(r-1),u=d*l,m[f]!==0&&(c[u]=8,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(c[u+p]=m[f]?4:8,++x),f++;if(m[f]!==0&&(c[u+p]=4,++x),x>n)return null;const y=new Int32Array([0,l,-1,0,-l,0,0,0,1]),b=new Path2D;for(d=0;x&&d<=r;d++){let v=d*l;const A=v+t;for(;v<A&&!c[v];)v++;if(v===A)continue;b.moveTo(v%l,d);const S=v;let E=c[v];do{const I=y[E];do v+=I;while(!c[v]);const L=c[v];L!==5&&L!==10?(E=L,c[v]=0):(E=L&51*E>>4,c[v]&=E>>2|E<<2),b.lineTo(v%l,v/l|0),c[v]||--x}while(S!==v);--d}return m=null,c=null,function(v){v.save(),v.scale(1/t,-1/r),v.translate(0,-r),v.fill(b),v.beginPath(),v.restore()}}class kme{constructor(t,r){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=Wze,this.textMatrixScale=1,this.fontMatrix=AY,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=il.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,r])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,r){this.x=t,this.y=r}updatePathMinMax(t,r,n){[r,n]=jo.applyTransform([r,n],t),this.minX=Math.min(this.minX,r),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,r),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(t,r){const n=jo.applyTransform(r,t),a=jo.applyTransform(r.slice(2),t),l=jo.applyTransform([r[0],r[3]],t),c=jo.applyTransform([r[2],r[1]],t);this.minX=Math.min(this.minX,n[0],a[0],l[0],c[0]),this.minY=Math.min(this.minY,n[1],a[1],l[1],c[1]),this.maxX=Math.max(this.maxX,n[0],a[0],l[0],c[0]),this.maxY=Math.max(this.maxY,n[1],a[1],l[1],c[1])}updateScalingPathMinMax(t,r){jo.scaleMinMax(t,r),this.minX=Math.min(this.minX,r[0]),this.minY=Math.min(this.minY,r[1]),this.maxX=Math.max(this.maxX,r[2]),this.maxY=Math.max(this.maxY,r[3])}updateCurvePathMinMax(t,r,n,a,l,c,d,p,u,h){const m=jo.bezierBoundingBox(r,n,a,l,c,d,p,u,h);h||this.updateRectMinMax(t,m)}getPathBoundingBox(t=Tl.FILL,r=null){const n=[this.minX,this.minY,this.maxX,this.maxY];if(t===Tl.STROKE){r||Gi("Stroke bounding box must include transform.");const a=jo.singularValueDecompose2dScale(r),l=a[0]*this.lineWidth/2,c=a[1]*this.lineWidth/2;n[0]-=l,n[1]-=c,n[2]+=l,n[3]+=c}return n}updateClipFromPath(){const t=jo.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=Tl.FILL,r=null){return jo.intersect(this.clipBox,this.getPathBoundingBox(t,r))}}function Sme(e,t){if(typeof ImageData<"u"&&t instanceof ImageData){e.putImageData(t,0,0);return}const r=t.height,n=t.width,a=r%dc,l=(r-a)/dc,c=a===0?l:l+1,d=e.createImageData(n,dc);let p=0,u;const h=t.data,m=d.data;let f,x,y,b;if(t.kind===nE.GRAYSCALE_1BPP){const w=h.byteLength,v=new Uint32Array(m.buffer,0,m.byteLength>>2),A=v.length,S=n+7>>3,E=4294967295,I=vc.isLittleEndian?4278190080:255;for(f=0;f<c;f++){for(y=f<l?dc:a,u=0,x=0;x<y;x++){const L=w-p;let M=0;const D=L>S?n:L*8-7,P=D&-8;let T=0,z=0;for(;M<P;M+=8)z=h[p++],v[u++]=z&128?E:I,v[u++]=z&64?E:I,v[u++]=z&32?E:I,v[u++]=z&16?E:I,v[u++]=z&8?E:I,v[u++]=z&4?E:I,v[u++]=z&2?E:I,v[u++]=z&1?E:I;for(;M<D;M++)T===0&&(z=h[p++],T=128),v[u++]=z&T?E:I,T>>=1}for(;u<A;)v[u++]=0;e.putImageData(d,0,f*dc)}}else if(t.kind===nE.RGBA_32BPP){for(x=0,b=n*dc*4,f=0;f<l;f++)m.set(h.subarray(p,p+b)),p+=b,e.putImageData(d,0,x),x+=dc;f<c&&(b=n*a*4,m.set(h.subarray(p,p+b)),e.putImageData(d,0,x))}else if(t.kind===nE.RGB_24BPP)for(y=dc,b=n*y,f=0;f<c;f++){for(f>=l&&(y=a,b=n*y),u=0,x=b;x--;)m[u++]=h[p++],m[u++]=h[p++],m[u++]=h[p++],m[u++]=255;e.putImageData(d,0,f*dc)}else throw new Error(`bad image kind: ${t.kind}`)}function Eme(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}const r=t.height,n=t.width,a=r%dc,l=(r-a)/dc,c=a===0?l:l+1,d=e.createImageData(n,dc);let p=0;const u=t.data,h=d.data;for(let m=0;m<c;m++){const f=m<l?dc:a;({srcPos:p}=hNt({src:u,srcPos:p,dest:h,width:n,height:f,nonBlackColor:0})),e.putImageData(d,0,m*dc)}}function uy(e,t){const r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of r)e[n]!==void 0&&(t[n]=e[n]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function f$(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),!ul){const{filter:t}=e;t!=="none"&&t!==""&&(e.filter="none")}}function Lme(e,t){if(t)return!0;const r=jo.singularValueDecompose2dScale(e);r[0]=Math.fround(r[0]),r[1]=Math.fround(r[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*Q8.PDF_TO_CSS_UNITS);return r[0]<=n&&r[1]<=n}const yNt=["butt","round","square"],bNt=["miter","round","bevel"],wNt={},Ime={};class d8{constructor(t,r,n,a,l,{optionalContentConfig:c,markedContentStack:d=null},p,u){this.ctx=t,this.current=new kme(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=r,this.objs=n,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=d||[],this.optionalContentConfig=c,this.cachedCanvases=new fNt(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,r=null){return typeof t=="string"?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):r}beginDrawing({transform:t,viewport:r,transparency:n=!1,background:a=null}){const l=this.ctx.canvas.width,c=this.ctx.canvas.height,d=this.ctx.fillStyle;if(this.ctx.fillStyle=a||"#ffffff",this.ctx.fillRect(0,0,l,c),this.ctx.fillStyle=d,n){const p=this.cachedCanvases.getCanvas("transparent",l,c);this.compositeCtx=this.ctx,this.transparentCanvas=p.canvas,this.ctx=p.context,this.ctx.save(),this.ctx.transform(...Pn(this.compositeCtx))}this.ctx.save(),f$(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...r.transform),this.viewportScale=r.scale,this.baseTransform=Pn(this.ctx)}executeOperatorList(t,r,n,a){const l=t.argsArray,c=t.fnArray;let d=r||0;const p=l.length;if(p===d)return d;const u=p-d>Ame&&typeof n=="function",h=u?Date.now()+mNt:0;let m=0;const f=this.commonObjs,x=this.objs;let y;for(;;){if(a!==void 0&&d===a.nextBreakPoint)return a.breakIt(d,n),d;if(y=c[d],y!==X1.dependency)this[y].apply(this,l[d]);else for(const b of l[d]){const w=b.startsWith("g_")?f:x;if(!w.has(b))return w.get(b,n),d}if(d++,d===p)return d;if(u&&++m>Ame){if(Date.now()>h)return n(),d;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 r of t.values())typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement&&(r.width=r.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 r=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=r}}}_scaleImage(t,r){const n=t.width,a=t.height;let l=Math.max(Math.hypot(r[0],r[1]),1),c=Math.max(Math.hypot(r[2],r[3]),1),d=n,p=a,u="prescale1",h,m;for(;l>2&&d>1||c>2&&p>1;){let f=d,x=p;l>2&&d>1&&(f=d>=16384?Math.floor(d/2)-1||1:Math.ceil(d/2),l/=d/f),c>2&&p>1&&(x=p>=16384?Math.floor(p/2)-1||1:Math.ceil(p)/2,c/=p/x),h=this.cachedCanvases.getCanvas(u,f,x),m=h.context,m.clearRect(0,0,f,x),m.drawImage(t,0,0,d,p,0,0,f,x),t=h.canvas,d=f,p=x,u=u==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:d,paintHeight:p}}_createMaskCanvas(t){const r=this.ctx,{width:n,height:a}=t,l=this.current.fillColor,c=this.current.patternFill,d=Pn(r);let p,u,h,m;if((t.bitmap||t.data)&&t.count>1){const D=t.bitmap||t.data.buffer;u=JSON.stringify(c?d:[d.slice(0,4),l]),p=this._cachedBitmapsMap.get(D),p||(p=new Map,this._cachedBitmapsMap.set(D,p));const P=p.get(u);if(P&&!c){const T=Math.round(Math.min(d[0],d[2])+d[4]),z=Math.round(Math.min(d[1],d[3])+d[5]);return{canvas:P,offsetX:T,offsetY:z}}h=P}h||(m=this.cachedCanvases.getCanvas("maskCanvas",n,a),Eme(m.context,t));let f=jo.transform(d,[1/n,0,0,-1/a,0,0]);f=jo.transform(f,[1,0,0,1,0,-a]);const[x,y,b,w]=jo.getAxialAlignedBoundingBox([0,0,n,a],f),v=Math.round(b-x)||1,A=Math.round(w-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,A0(E)),h=h.img,p&&c&&p.set(u,h)),E.imageSmoothingEnabled=Lme(Pn(E),t.interpolate),g$(E,h,0,0,h.width,h.height,0,0,n,a),E.globalCompositeOperation="source-in";const M=jo.transform(A0(E),[1,0,0,1,-I,-L]);return E.fillStyle=c?l.getPattern(r,this,M,Tl.FILL):l,E.fillRect(0,0,n,a),p&&!c&&(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=yNt[t]}setLineJoin(t){this.ctx.lineJoin=bNt[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,r){const n=this.ctx;n.setLineDash!==void 0&&(n.setLineDash(t),n.lineDashOffset=r)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[r,n]of t)switch(r){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n,this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n);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,r=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(n,t,r);this.suspendedCtx=this.ctx,this.ctx=a.context;const l=this.ctx;l.setTransform(...Pn(this.suspendedCtx)),uy(this.suspendedCtx,l),gNt(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(),uy(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 r=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,r,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,r,n,a){const l=a[0],c=a[1],d=a[2]-l,p=a[3]-c;d===0||p===0||(this.genericComposeSMask(r.context,n,d,p,r.subtype,r.backdrop,r.transferMap,l,c,r.offsetX,r.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(n.canvas,0,0),t.restore())}genericComposeSMask(t,r,n,a,l,c,d,p,u,h,m){let f=t.canvas,x=p-h,y=u-m;if(c){if(x<0||y<0||x+n>f.width||y+a>f.height){const w=this.cachedCanvases.getCanvas("maskExtension",n,a),v=w.context;v.drawImage(f,-x,-y),c.some(A=>A!==0)&&(v.globalCompositeOperation="destination-atop",v.fillStyle=jo.makeHexColor(...c),v.fillRect(0,0,n,a),v.globalCompositeOperation="source-over"),f=w.canvas,x=y=0}else if(c.some(w=>w!==0)){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const w=new Path2D;w.rect(x,y,n,a),t.clip(w),t.globalCompositeOperation="destination-atop",t.fillStyle=jo.makeHexColor(...c),t.fillRect(x,y,n,a),t.restore()}}r.save(),r.globalAlpha=1,r.setTransform(1,0,0,1,0,0),l==="Alpha"&&d?r.filter=this.filterFactory.addAlphaFilter(d):l==="Luminosity"&&(r.filter=this.filterFactory.addLuminosityFilter(d));const b=new Path2D;b.rect(p,u,n,a),r.clip(b),r.globalCompositeOperation="destination-in",r.drawImage(f,x,y,n,a,p,u,n,a),r.restore()}save(){this.inSMaskMode?(uy(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(),uy(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,r,n,a,l,c){this.ctx.transform(t,r,n,a,l,c),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,r,n){const a=this.ctx,l=this.current;let c=l.x,d=l.y,p,u;const h=Pn(a),m=h[0]===0&&h[3]===0||h[1]===0&&h[2]===0,f=m?n.slice(0):null;for(let x=0,y=0,b=t.length;x<b;x++)switch(t[x]|0){case X1.rectangle:c=r[y++],d=r[y++];const w=r[y++],v=r[y++],A=c+w,S=d+v;a.moveTo(c,d),w===0||v===0?a.lineTo(A,S):(a.lineTo(A,d),a.lineTo(A,S),a.lineTo(c,S)),m||l.updateRectMinMax(h,[c,d,A,S]),a.closePath();break;case X1.moveTo:c=r[y++],d=r[y++],a.moveTo(c,d),m||l.updatePathMinMax(h,c,d);break;case X1.lineTo:c=r[y++],d=r[y++],a.lineTo(c,d),m||l.updatePathMinMax(h,c,d);break;case X1.curveTo:p=c,u=d,c=r[y+4],d=r[y+5],a.bezierCurveTo(r[y],r[y+1],r[y+2],r[y+3],c,d),l.updateCurvePathMinMax(h,p,u,r[y],r[y+1],r[y+2],r[y+3],c,d,f),y+=6;break;case X1.curveTo2:p=c,u=d,a.bezierCurveTo(c,d,r[y],r[y+1],r[y+2],r[y+3]),l.updateCurvePathMinMax(h,p,u,c,d,r[y],r[y+1],r[y+2],r[y+3],f),c=r[y+2],d=r[y+3],y+=4;break;case X1.curveTo3:p=c,u=d,c=r[y+2],d=r[y+3],a.bezierCurveTo(r[y],r[y+1],c,d,c,d),l.updateCurvePathMinMax(h,p,u,r[y],r[y+1],c,d,c,d,f),y+=4;break;case X1.closePath:a.closePath();break}m&&l.updateScalingPathMinMax(h,f),l.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(t=!0){const r=this.ctx,n=this.current.strokeColor;r.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof n=="object"&&n?.getPattern?(r.save(),r.strokeStyle=n.getPattern(r,this,A0(r),Tl.STROKE),this.rescaleAndStroke(!1),r.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),r.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){const r=this.ctx,n=this.current.fillColor,a=this.current.patternFill;let l=!1;a&&(r.save(),r.fillStyle=n.getPattern(r,this,A0(r),Tl.FILL),l=!0);const c=this.current.getClippedPathBoundingBox();this.contentVisible&&c!==null&&(this.pendingEOFill?(r.fill("evenodd"),this.pendingEOFill=!1):r.fill()),l&&r.restore(),t&&this.consumePath(c)}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=wNt}eoClip(){this.pendingClip=Ime}beginText(){this.current.textMatrix=Wze,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,r=this.ctx;if(t===void 0){r.beginPath();return}r.save(),r.beginPath();for(const n of t)r.setTransform(...n.transform),r.translate(n.x,n.y),n.addToPath(r,n.fontSize);r.restore(),r.clip(),r.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,r){const n=this.commonObjs.get(t),a=this.current;if(!n)throw new Error(`Can't find font for ${t}`);if(a.fontMatrix=n.fontMatrix||AY,(a.fontMatrix[0]===0||a.fontMatrix[3]===0)&&Nr("Invalid font matrix for font "+t),r<0?(r=-r,a.fontDirection=-1):a.fontDirection=1,this.current.font=n,this.current.fontSize=r,n.isType3Font)return;const l=n.loadedName||"sans-serif",c=n.systemFontInfo?.css||`"${l}", ${n.fallbackName}`;let d="normal";n.black?d="900":n.bold&&(d="bold");const p=n.italic?"italic":"normal";let u=r;r<vme?u=vme:r>Cme&&(u=Cme),this.current.fontSizeScale=r/u,this.ctx.font=`${p} ${d} ${u}px ${c}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,r){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=r}setLeadingMoveText(t,r){this.setLeading(-r),this.moveText(t,r)}setTextMatrix(t,r,n,a,l,c){this.current.textMatrix=[t,r,n,a,l,c],this.current.textMatrixScale=Math.hypot(t,r),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,r,n,a){const l=this.ctx,c=this.current,d=c.font,p=c.textRenderingMode,u=c.fontSize/c.fontSizeScale,h=p&il.FILL_STROKE_MASK,m=!!(p&il.ADD_TO_PATH_FLAG),f=c.patternFill&&!d.missingFile;let x;(d.disableFontFace||m||f)&&(x=d.getPathGenerator(this.commonObjs,t)),d.disableFontFace||f?(l.save(),l.translate(r,n),l.beginPath(),x(l,u),a&&l.setTransform(...a),(h===il.FILL||h===il.FILL_STROKE)&&l.fill(),(h===il.STROKE||h===il.FILL_STROKE)&&l.stroke(),l.restore()):((h===il.FILL||h===il.FILL_STROKE)&&l.fillText(t,r,n),(h===il.STROKE||h===il.FILL_STROKE)&&l.strokeText(t,r,n)),m&&(this.pendingTextPaths||=[]).push({transform:Pn(l),x:r,y:n,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 r=t.getImageData(0,0,10,10).data;let n=!1;for(let a=3;a<r.length;a+=4)if(r[a]>0&&r[a]<255){n=!0;break}return mi(this,"isFontSubpixelAAEnabled",n)}showText(t){const r=this.current,n=r.font;if(n.isType3Font)return this.showType3Text(t);const a=r.fontSize;if(a===0)return;const l=this.ctx,c=r.fontSizeScale,d=r.charSpacing,p=r.wordSpacing,u=r.fontDirection,h=r.textHScale*u,m=t.length,f=n.vertical,x=f?1:-1,y=n.defaultVMetrics,b=a*r.fontMatrix[0],w=r.textRenderingMode===il.FILL&&!n.disableFontFace&&!r.patternFill;l.save(),l.transform(...r.textMatrix),l.translate(r.x,r.y+r.textRise),u>0?l.scale(h,-1):l.scale(h,1);let v;if(r.patternFill){l.save();const L=r.fillColor.getPattern(l,this,A0(l),Tl.FILL);v=Pn(l),l.restore(),l.fillStyle=L}let A=r.lineWidth;const S=r.textMatrixScale;if(S===0||A===0){const L=r.textRenderingMode&il.FILL_STROKE_MASK;(L===il.STROKE||L===il.FILL_STROKE)&&(A=this.getSinglePixelWidth())}else A/=S;if(c!==1&&(l.scale(c,c),A/=c),l.lineWidth=A,n.isInvalidPDFjsFont){const L=[];let M=0;for(const D of t)L.push(D.unicode),M+=D.width;l.fillText(L.join(""),0,0),r.x+=M*b*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 M=!1;const D=(L.isSpace?p:0)+d,P=L.fontChar,T=L.accent;let z,N,K=L.width;if(f){const F=L.vmetric||y,_=-(L.vmetric?F[1]:K*.5)*b,V=F[2]*b;K=F?-F[0]:K,z=_/c,N=(E+V)/c}else z=E/c,N=0;if(n.remeasure&&K>0){const F=l.measureText(P).width*1e3/a*c;if(K<F&&this.isFontSubpixelAAEnabled){const _=K/F;M=!0,l.save(),l.scale(_,1),z/=_}else K!==F&&(z+=(K-F)/2e3*a/c)}if(this.contentVisible&&(L.isInFont||n.missingFile)){if(w&&!T)l.fillText(P,z,N);else if(this.paintChar(P,z,N,v),T){const F=z+a*T.offset.x/c,_=N-a*T.offset.y/c;this.paintChar(T.fontChar,F,_,v)}}const q=f?K*b-D*u:K*b+D*u;E+=q,M&&l.restore()}f?r.y-=E:r.x+=E*h,l.restore(),this.compose()}showType3Text(t){const r=this.ctx,n=this.current,a=n.font,l=n.fontSize,c=n.fontDirection,d=a.vertical?1:-1,p=n.charSpacing,u=n.wordSpacing,h=n.textHScale*c,m=n.fontMatrix||AY,f=t.length,x=n.textRenderingMode===il.INVISIBLE;let y,b,w,v;if(!(x||l===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,r.save(),r.transform(...n.textMatrix),r.translate(n.x,n.y),r.scale(h,c),y=0;y<f;++y){if(b=t[y],typeof b=="number"){v=d*b*l/1e3,this.ctx.translate(v,0),n.x+=v*h;continue}const A=(b.isSpace?u:0)+p,S=a.charProcOperatorList[b.operatorListId];if(!S){Nr(`Type3 character "${b.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=b,this.save(),r.scale(l,l),r.transform(...m),this.executeOperatorList(S),this.restore()),w=jo.applyTransform([b.width,0],m)[0]*l+A,r.translate(w,0),n.x+=w*h}r.restore(),this.processingType3=null}}setCharWidth(t,r){}setCharWidthAndBounds(t,r,n,a,l,c){this.ctx.rect(n,a,l-n,c-a),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let r;if(t[0]==="TilingPattern"){const n=t[1],a=this.baseTransform||Pn(this.ctx),l={createCanvasGraphics:c=>new d8(c,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};r=new BX(t,n,this.ctx,l,a)}else r=this._getPattern(t[1],t[2]);return r}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,r,n){const a=jo.makeHexColor(t,r,n);this.ctx.strokeStyle=a,this.current.strokeColor=a}setFillRGBColor(t,r,n){const a=jo.makeHexColor(t,r,n);this.ctx.fillStyle=a,this.current.fillColor=a,this.current.patternFill=!1}_getPattern(t,r=null){let n;return this.cachedPatterns.has(t)?n=this.cachedPatterns.get(t):(n=uNt(this.getObject(t)),this.cachedPatterns.set(t,n)),r&&(n.matrix=r),n}shadingFill(t){if(!this.contentVisible)return;const r=this.ctx;this.save();const n=this._getPattern(t);r.fillStyle=n.getPattern(r,this,A0(r),Tl.SHADING);const a=A0(r);if(a){const{width:l,height:c}=r.canvas,[d,p,u,h]=jo.getAxialAlignedBoundingBox([0,0,l,c],a);this.ctx.fillRect(d,p,u-d,h-p)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Gi("Should not call beginInlineImage")}beginImageData(){Gi("Should not call beginImageData")}paintFormXObjectBegin(t,r){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=Pn(this.ctx),r)){const n=r[2]-r[0],a=r[3]-r[1];this.ctx.rect(r[0],r[1],n,a),this.current.updateRectMinMax(Pn(this.ctx),r),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 r=this.ctx;t.isolated||jM("TODO: Support non-isolated groups."),t.knockout&&Nr("Knockout groups not supported.");const n=Pn(r);if(t.matrix&&r.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let a=jo.getAxialAlignedBoundingBox(t.bbox,Pn(r));const l=[0,0,r.canvas.width,r.canvas.height];a=jo.intersect(a,l)||[0,0,0,0];const c=Math.floor(a[0]),d=Math.floor(a[1]),p=Math.max(Math.ceil(a[2])-c,1),u=Math.max(Math.ceil(a[3])-d,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(-c,-d),f.transform(...n),t.smask?this.smaskStack.push({canvas:m.canvas,context:f,offsetX:c,offsetY:d,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(r.setTransform(1,0,0,1,0,0),r.translate(c,d),r.save()),uy(r,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(r),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const r=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const a=Pn(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...a);const l=jo.getAxialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],a);this.ctx.drawImage(r.canvas,0,0),this.ctx.restore(),this.compose(l)}}beginAnnotation(t,r,n,a,l){if(this.#e(),f$(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),r){const c=r[2]-r[0],d=r[3]-r[1];if(l&&this.annotationCanvasMap){n=n.slice(),n[4]-=r[0],n[5]-=r[1],r=r.slice(),r[0]=r[1]=0,r[2]=c,r[3]=d;const[p,u]=jo.singularValueDecompose2dScale(Pn(this.ctx)),{viewportScale:h}=this,m=Math.ceil(c*this.outputScaleX*h),f=Math.ceil(d*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,d*u),f$(this.ctx)}else f$(this.ctx),this.ctx.rect(r[0],r[1],c,d),this.ctx.clip(),this.endPath()}this.current=new kme(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),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 r=t.count;t=this.getObject(t.data,t),t.count=r;const n=this.ctx,a=this.processingType3;if(a&&(a.compiled===void 0&&(a.compiled=xNt(t)),a.compiled)){a.compiled(n);return}const l=this._createMaskCanvas(t),c=l.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(c,l.offsetX,l.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(t,r,n=0,a=0,l,c){if(!this.contentVisible)return;t=this.getObject(t.data,t);const d=this.ctx;d.save();const p=Pn(d);d.transform(r,n,a,l,0,0);const u=this._createMaskCanvas(t);d.setTransform(1,0,0,1,u.offsetX-p[4],u.offsetY-p[5]);for(let h=0,m=c.length;h<m;h+=2){const f=jo.transform(p,[r,n,a,l,c[h],c[h+1]]),[x,y]=jo.applyTransform([0,0],f);d.drawImage(u.canvas,x,y)}d.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const r=this.ctx,n=this.current.fillColor,a=this.current.patternFill;for(const l of t){const{data:c,width:d,height:p,transform:u}=l,h=this.cachedCanvases.getCanvas("maskCanvas",d,p),m=h.context;m.save();const f=this.getObject(c,l);Eme(m,f),m.globalCompositeOperation="source-in",m.fillStyle=a?n.getPattern(m,this,A0(r),Tl.FILL):n,m.fillRect(0,0,d,p),m.restore(),r.save(),r.transform(...u),r.scale(1,-1),g$(r,h.canvas,0,0,d,p,0,-1,1,1),r.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const r=this.getObject(t);if(!r){Nr("Dependent image isn't ready yet");return}this.paintInlineImageXObject(r)}paintImageXObjectRepeat(t,r,n,a){if(!this.contentVisible)return;const l=this.getObject(t);if(!l){Nr("Dependent image isn't ready yet");return}const c=l.width,d=l.height,p=[];for(let u=0,h=a.length;u<h;u+=2)p.push({transform:[r,0,0,n,a[u],a[u+1]],x:0,y:0,w:c,h:d});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:r,width:n,height:a}=t,l=this.cachedCanvases.getCanvas("inlineImage",n,a),c=l.context;return c.filter=this.current.transferMaps,c.drawImage(r,0,0),c.filter="none",l.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const r=t.width,n=t.height,a=this.ctx;if(this.save(),!ul){const{filter:d}=a;d!=="none"&&d!==""&&(a.filter="none")}a.scale(1/r,-1/n);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",r,n).context;Sme(p,t),l=this.applyTransferMapsToCanvas(p)}const c=this._scaleImage(l,A0(a));a.imageSmoothingEnabled=Lme(Pn(a),t.interpolate),g$(a,c.img,0,0,c.paintWidth,c.paintHeight,0,-n,r,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,r){if(!this.contentVisible)return;const n=this.ctx;let a;if(t.bitmap)a=t.bitmap;else{const l=t.width,c=t.height,p=this.cachedCanvases.getCanvas("inlineImage",l,c).context;Sme(p,t),a=this.applyTransferMapsToCanvas(p)}for(const l of r)n.save(),n.transform(...l.transform),n.scale(1,-1),g$(n,a,l.x,l.y,l.w,l.h,0,-1,1,1),n.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,r){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,r){t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const r=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const n=this.ctx;this.pendingClip&&(r||(this.pendingClip===Ime?n.clip("evenodd"):n.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),n.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Pn(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const r=Math.abs(t[0]*t[3]-t[2]*t[1]),n=Math.hypot(t[0],t[2]),a=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(n,a)/r}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:r,b:n,c:a,d:l}=this.ctx.getTransform();let c,d;if(n===0&&a===0){const p=Math.abs(r),u=Math.abs(l);if(p===u)if(t===0)c=d=1/p;else{const h=p*t;c=d=h<1?1/h:1}else if(t===0)c=1/p,d=1/u;else{const h=p*t,m=u*t;c=h<1?1/h:1,d=m<1?1/m:1}}else{const p=Math.abs(r*l-n*a),u=Math.hypot(r,n),h=Math.hypot(a,l);if(t===0)c=h/p,d=u/p;else{const m=t*p;c=h>m?h/m:1,d=u>m?u/m:1}}this._cachedScaleForStroking[0]=c,this._cachedScaleForStroking[1]=d}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:r}=this,{lineWidth:n}=this.current,[a,l]=this.getScaleForStroking();if(r.lineWidth=n||1,a===1&&l===1){r.stroke();return}const c=r.getLineDash();if(t&&r.save(),r.scale(a,l),c.length>0){const d=Math.max(a,l);r.setLineDash(c.map(p=>p/d)),r.lineDashOffset/=d}r.stroke(),t&&r.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 X1)d8.prototype[e]!==void 0&&(d8.prototype[X1[e]]=d8.prototype[e]);class ov{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 x$={DATA:1,ERROR:2},Ca={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function qc(e){switch(e instanceof Error||typeof e=="object"&&e!==null||Gi('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new p5(e.message);case"MissingPDFException":return new d5(e.message);case"PasswordException":return new kY(e.message,e.code);case"UnexpectedResponseException":return new MM(e.message,e.status);case"UnknownErrorException":return new SY(e.message,e.details);default:return new SY(e.message,e.toString())}}class wb{constructor(t,r,n){this.sourceName=t,this.targetName=r,this.comObj=n,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 d=l.callbackId,p=this.callbackCapabilities[d];if(!p)throw new Error(`Cannot resolve callback ${d}`);if(delete this.callbackCapabilities[d],l.callback===x$.DATA)p.resolve(l.data);else if(l.callback===x$.ERROR)p.reject(qc(l.reason));else throw new Error("Unexpected callback case");return}const c=this.actionHandler[l.action];if(!c)throw new Error(`Unknown action from worker: ${l.action}`);if(l.callbackId){const d=this.sourceName,p=l.sourceName;new Promise(function(u){u(c(l.data))}).then(function(u){n.postMessage({sourceName:d,targetName:p,callback:x$.DATA,callbackId:l.callbackId,data:u})},function(u){n.postMessage({sourceName:d,targetName:p,callback:x$.ERROR,callbackId:l.callbackId,reason:qc(u)})});return}if(l.streamId){this.#e(l);return}c(l.data)},n.addEventListener("message",this._onComObjOnMessage)}on(t,r){const n=this.actionHandler;if(n[t])throw new Error(`There is already an actionName called "${t}"`);n[t]=r}send(t,r,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:r},n)}sendWithPromise(t,r,n){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:r},n)}catch(c){l.reject(c)}return l.promise}sendWithStream(t,r,n,a){const l=this.streamId++,c=this.sourceName,d=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:c,targetName:d,action:t,streamId:l,data:r,desiredSize:u.desiredSize},a),h.promise},pull:u=>{const h=Promise.withResolvers();return this.streamControllers[l].pullCall=h,p.postMessage({sourceName:c,targetName:d,stream:Ca.PULL,streamId:l,desiredSize:u.desiredSize}),h.promise},cancel:u=>{Wa(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:c,targetName:d,stream:Ca.CANCEL,streamId:l,reason:qc(u)}),h.promise}},n)}#e(t){const r=t.streamId,n=this.sourceName,a=t.sourceName,l=this.comObj,c=this,d=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:n,targetName:a,stream:Ca.ENQUEUE,streamId:r,chunk:u},m)},close(){this.isCancelled||(this.isCancelled=!0,l.postMessage({sourceName:n,targetName:a,stream:Ca.CLOSE,streamId:r}),delete c.streamSinks[r])},error(u){Wa(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,l.postMessage({sourceName:n,targetName:a,stream:Ca.ERROR,streamId:r,reason:qc(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[r]=p,new Promise(function(u){u(d(t.data,p))}).then(function(){l.postMessage({sourceName:n,targetName:a,stream:Ca.START_COMPLETE,streamId:r,success:!0})},function(u){l.postMessage({sourceName:n,targetName:a,stream:Ca.START_COMPLETE,streamId:r,reason:qc(u)})})}#t(t){const r=t.streamId,n=this.sourceName,a=t.sourceName,l=this.comObj,c=this.streamControllers[r],d=this.streamSinks[r];switch(t.stream){case Ca.START_COMPLETE:t.success?c.startCall.resolve():c.startCall.reject(qc(t.reason));break;case Ca.PULL_COMPLETE:t.success?c.pullCall.resolve():c.pullCall.reject(qc(t.reason));break;case Ca.PULL:if(!d){l.postMessage({sourceName:n,targetName:a,stream:Ca.PULL_COMPLETE,streamId:r,success:!0});break}d.desiredSize<=0&&t.desiredSize>0&&d.sinkCapability.resolve(),d.desiredSize=t.desiredSize,new Promise(function(p){p(d.onPull?.())}).then(function(){l.postMessage({sourceName:n,targetName:a,stream:Ca.PULL_COMPLETE,streamId:r,success:!0})},function(p){l.postMessage({sourceName:n,targetName:a,stream:Ca.PULL_COMPLETE,streamId:r,reason:qc(p)})});break;case Ca.ENQUEUE:if(Wa(c,"enqueue should have stream controller"),c.isClosed)break;c.controller.enqueue(t.chunk);break;case Ca.CLOSE:if(Wa(c,"close should have stream controller"),c.isClosed)break;c.isClosed=!0,c.controller.close(),this.#o(c,r);break;case Ca.ERROR:Wa(c,"error should have stream controller"),c.controller.error(qc(t.reason)),this.#o(c,r);break;case Ca.CANCEL_COMPLETE:t.success?c.cancelCall.resolve():c.cancelCall.reject(qc(t.reason)),this.#o(c,r);break;case Ca.CANCEL:if(!d)break;new Promise(function(p){p(d.onCancel?.(qc(t.reason)))}).then(function(){l.postMessage({sourceName:n,targetName:a,stream:Ca.CANCEL_COMPLETE,streamId:r,success:!0})},function(p){l.postMessage({sourceName:n,targetName:a,stream:Ca.CANCEL_COMPLETE,streamId:r,reason:qc(p)})}),d.sinkCapability.reject(qc(t.reason)),d.isCancelled=!0,delete this.streamSinks[r];break;default:throw new Error("Unexpected stream case")}}async#o(t,r){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[r]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}class vNt{#e;#t;constructor({parsedData:t,rawData:r}){this.#e=t,this.#t=r}getRaw(){return this.#t}get(t){return this.#e.get(t)??null}getAll(){return vX(this.#e)}has(t){return this.#e.has(t)}}const Sm=Symbol("INTERNAL");class CNt{#e=!1;#t=!1;#o=!1;#i=!0;constructor(t,{name:r,intent:n,usage:a}){this.#e=!!(t&Nd.DISPLAY),this.#t=!!(t&Nd.PRINT),this.name=r,this.intent=n,this.usage=a}get visible(){if(this.#o)return this.#i;if(!this.#i)return!1;const{print:t,view:r}=this.usage;return this.#e?r?.viewState!=="OFF":this.#t?t?.printState!=="OFF":!0}_setVisible(t,r,n=!1){t!==Sm&&Gi("Internal method `_setVisible` called."),this.#o=n,this.#i=r}}class ANt{#e=null;#t=new Map;#o=null;#i=null;constructor(t,r=Nd.DISPLAY){if(this.renderingIntent=r,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,this.#i=t.order;for(const n of t.groups)this.#t.set(n.id,new CNt(r,n));if(t.baseState==="OFF")for(const n of this.#t.values())n._setVisible(Sm,!1);for(const n of t.on)this.#t.get(n)._setVisible(Sm,!0);for(const n of t.off)this.#t.get(n)._setVisible(Sm,!1);this.#o=this.getHash()}}#s(t){const r=t.length;if(r<2)return!0;const n=t[0];for(let a=1;a<r;a++){const l=t[a];let c;if(Array.isArray(l))c=this.#s(l);else if(this.#t.has(l))c=this.#t.get(l).visible;else return Nr(`Optional content group not found: ${l}`),!0;switch(n){case"And":if(!c)return!1;break;case"Or":if(c)return!0;break;case"Not":return!c;default:return!0}}return n==="And"}isVisible(t){if(this.#t.size===0)return!0;if(!t)return jM("Optional content group not defined."),!0;if(t.type==="OCG")return this.#t.has(t.id)?this.#t.get(t.id).visible:(Nr(`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 r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(this.#t.get(r).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(!this.#t.get(r).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(!this.#t.get(r).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const r of t.ids){if(!this.#t.has(r))return Nr(`Optional content group not found: ${r}`),!0;if(this.#t.get(r).visible)return!1}return!0}return Nr(`Unknown optional content policy ${t.policy}.`),!0}return Nr(`Unknown group type ${t.type}.`),!0}setVisibility(t,r=!0){const n=this.#t.get(t);if(!n){Nr(`Optional content group not found: ${t}`);return}n._setVisible(Sm,!!r,!0),this.#e=null}setOCGState({state:t,preserveRB:r}){let n;for(const a of t){switch(a){case"ON":case"OFF":case"Toggle":n=a;continue}const l=this.#t.get(a);if(l)switch(n){case"ON":l._setVisible(Sm,!0);break;case"OFF":l._setVisible(Sm,!1);break;case"Toggle":l._setVisible(Sm,!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?vX(this.#t):null}getGroup(t){return this.#t.get(t)||null}getHash(){if(this.#e!==null)return this.#e;const t=new eRe;for(const[r,n]of this.#t)t.update(`${r}:${n.visible}`);return this.#e=t.hexdigest()}}class $Nt{constructor(t,{disableRange:r=!1,disableStream:n=!1}){Wa(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:a,initialData:l,progressiveDone:c,contentDispositionFilename:d}=t;if(this._queuedChunks=[],this._progressiveDone=c,this._contentDispositionFilename=d,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=!n,this._isRangeSupported=!r,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:r}){const n=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const a=this._rangeReaders.some(function(l){return l._begin!==t?!1:(l._enqueue(n),!0)});Wa(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 r=this._rangeReaders.indexOf(t);r>=0&&this._rangeReaders.splice(r,1)}getFullReader(){Wa(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new kNt(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;const n=new SNt(this,t,r);return this._pdfDataRangeTransport.requestDataRange(t,r),this._rangeReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeReaders.slice(0))r.cancel(t);this._pdfDataRangeTransport.abort()}}class kNt{constructor(t,r,n=!1,a=null){this._stream=t,this._done=n||!1,this._filename=SX(a)?a:null,this._queuedChunks=r||[],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 r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class SNt{constructor(t,r,n){this._stream=t,this._begin=r,this._end=n,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 n of this._requests)n.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 r=this._queuedChunk;return this._queuedChunk=null,{value:r,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 r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function ENt(e){let t=!0,r=n("filename\\*","i").exec(e);if(r){r=r[1];let h=d(r);return h=unescape(h),h=p(h),h=u(h),l(h)}if(r=c(e),r){const h=u(r);return l(h)}if(r=n("filename","i").exec(e),r){r=r[1];let h=d(r);return h=u(h),l(h)}function n(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=BM(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 c(h){const m=[];let f;const x=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=x.exec(h))!==null;){let[,b,w,v]=f;if(b=parseInt(b,10),b in m){if(b===0)break;continue}m[b]=[w,v]}const y=[];for(let b=0;b<m.length&&b in m;++b){let[w,v]=m[b];v=d(v),w&&(v=unescape(v),b===0&&(v=p(v))),y.push(v)}return y.join("")}function d(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(b,w){return String.fromCharCode(parseInt(w,16))}),a(f,y);try{y=atob(y)}catch{}return a(f,y)})}return""}function PX({getResponseHeader:e,isHttp:t,rangeChunkSize:r,disableRange:n}){const a={allowRangeRequests:!1,suggestedLength:void 0},l=parseInt(e("Content-Length"),10);return!Number.isInteger(l)||(a.suggestedLength=l,l<=2*r)||n||!t||e("Accept-Ranges")!=="bytes"||(e("Content-Encoding")||"identity")!=="identity"||(a.allowRangeRequests=!0),a}function DX(e){const t=e("Content-Disposition");if(t){let r=ENt(t);if(r.includes("%"))try{r=decodeURIComponent(r)}catch{}if(SX(r))return r}return null}function FM(e,t){return e===404||e===0&&t.startsWith("file:")?new d5('Missing PDF "'+t+'".'):new MM(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)}function rRe(e){return e===200||e===206}function iRe(e,t,r){return{method:"GET",headers:e,signal:r.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function nRe(e){const t=new Headers;for(const r in e){const n=e[r];n!==void 0&&t.append(r,n)}return t}function aRe(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(Nr(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}class jme{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 Wa(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new LNt(this),this._fullRequestReader}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;const n=new INt(this,t,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class LNt{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const r=t.source;this._withCredentials=r.withCredentials||!1,this._contentLength=r.length,this._headersCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.disableRange,this._headers=nRe(this._stream.httpHeaders);const n=r.url;fetch(n,iRe(this._headers,this._withCredentials,this._abortController)).then(a=>{if(!rRe(a.status))throw FM(a.status,n);this._reader=a.body.getReader(),this._headersCapability.resolve();const l=p=>a.headers.get(p),{allowRangeRequests:c,suggestedLength:d}=PX({getResponseHeader:l,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=c,this._contentLength=d||this._contentLength,this._filename=DX(l),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new p5("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:r}=await this._reader.read();return r?{value:t,done:r}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:aRe(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class INt{constructor(t,r,n){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=nRe(this._stream.httpHeaders),this._headers.append("Range",`bytes=${r}-${n-1}`);const l=a.url;fetch(l,iRe(this._headers,this._withCredentials,this._abortController)).then(c=>{if(!rRe(c.status))throw FM(c.status,l);this._readCapability.resolve(),this._reader=c.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:r}=await this._reader.read();return r?{value:t,done:r}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:aRe(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}const n_=200,a_=206;function jNt(e){const t=e.response;return typeof t!="string"?t:BM(t).buffer}class MNt{constructor(t,r={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&r.httpHeaders||Object.create(null),this.withCredentials=r.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,r,n){const a={begin:t,end:r};for(const l in n)a[l]=n[l];return this.request(a)}requestFull(t){return this.request(t)}request(t){const r=new XMLHttpRequest,n=this.currXhrId++,a=this.pendingRequests[n]={xhr:r};r.open("GET",this.url),r.withCredentials=this.withCredentials;for(const l in this.httpHeaders){const c=this.httpHeaders[l];c!==void 0&&r.setRequestHeader(l,c)}return this.isHttp&&"begin"in t&&"end"in t?(r.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),a.expectedStatus=a_):a.expectedStatus=n_,r.responseType="arraybuffer",t.onError&&(r.onerror=function(l){t.onError(r.status)}),r.onreadystatechange=this.onStateChange.bind(this,n),r.onprogress=this.onProgress.bind(this,n),a.onHeadersReceived=t.onHeadersReceived,a.onDone=t.onDone,a.onError=t.onError,a.onProgress=t.onProgress,r.send(null),n}onProgress(t,r){const n=this.pendingRequests[t];n&&n.onProgress?.(r)}onStateChange(t,r){const n=this.pendingRequests[t];if(!n)return;const a=n.xhr;if(a.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),a.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],a.status===0&&this.isHttp){n.onError?.(a.status);return}const l=a.status||n_;if(!(l===n_&&n.expectedStatus===a_)&&l!==n.expectedStatus){n.onError?.(a.status);return}const d=jNt(a);if(l===a_){const p=a.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(p);n.onDone({begin:parseInt(u[1],10),chunk:d})}else d?n.onDone({begin:0,chunk:d}):n.onError?.(a.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const r=this.pendingRequests[t].xhr;delete this.pendingRequests[t],r.abort()}}class BNt{constructor(t){this._source=t,this._manager=new MNt(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const r=this._rangeRequestReaders.indexOf(t);r>=0&&this._rangeRequestReaders.splice(r,1)}getFullReader(){return Wa(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new PNt(this._manager,this._source),this._fullRequestReader}getRangeReader(t,r){const n=new DNt(this._manager,t,r);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class PNt{constructor(t,r){this._manager=t;const n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=r.url,this._fullRequestId=t.requestFull(n),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._contentLength=r.length,this._rangeChunkSize=r.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,r=this._manager.getRequestXhr(t),n=c=>r.getResponseHeader(c),{allowRangeRequests:a,suggestedLength:l}=PX({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=l||this._contentLength,this._filename=DX(n),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 r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=FM(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const r of this._requests)r.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 r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class DNt{constructor(t,r,n){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(r,n,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 r=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:r,done:!1}):this._queuedChunk=r,this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=FM(t,this._url);for(const r of this._requests)r.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 r=this._queuedChunk;return this._queuedChunk=null,{value:r,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 r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const sRe=/^file:\/\/\/[a-zA-Z]:\//;function TNt(e){const t=Rh.get("url"),r=t.parse(e);return r.protocol==="file:"||r.host?r:/^[a-z]:[/\\]/i.test(e)?t.parse(`file:///${e}`):(r.host||(r.protocol="file:"),r)}class zNt{constructor(t){this.source=t,this.url=TNt(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 Wa(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new ONt(this):new RNt(this),this._fullRequestReader}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;const n=this.isFsUrl?new NNt(this,t,r):new FNt(this,t,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class lRe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const r=t.source;this._contentLength=r.length,this._loaded=0,this._filename=null,this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.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",r=>{this._error(r)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new p5("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class cRe{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 r=t.source;this._isStreamingSupported=!r.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",r=>{this._error(r)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function BL(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class RNt extends lRe{constructor(t){super(t);const r=n=>{if(n.statusCode===404){const d=new d5(`Missing PDF "${this._url}".`);this._storedError=d,this._headersCapability.reject(d);return}this._headersCapability.resolve(),this._setReadableStream(n);const a=d=>this._readableStream.headers[d.toLowerCase()],{allowRangeRequests:l,suggestedLength:c}=PX({getResponseHeader:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=l,this._contentLength=c||this._contentLength,this._filename=DX(a)};if(this._request=null,this._url.protocol==="http:"){const n=Rh.get("http");this._request=n.request(BL(this._url,t.httpHeaders),r)}else{const n=Rh.get("https");this._request=n.request(BL(this._url,t.httpHeaders),r)}this._request.on("error",n=>{this._storedError=n,this._headersCapability.reject(n)}),this._request.end()}}class FNt extends cRe{constructor(t,r,n){super(t),this._httpHeaders={};for(const l in t.httpHeaders){const c=t.httpHeaders[l];c!==void 0&&(this._httpHeaders[l]=c)}this._httpHeaders.Range=`bytes=${r}-${n-1}`;const a=l=>{if(l.statusCode===404){const c=new d5(`Missing PDF "${this._url}".`);this._storedError=c;return}this._setReadableStream(l)};if(this._request=null,this._url.protocol==="http:"){const l=Rh.get("http");this._request=l.request(BL(this._url,this._httpHeaders),a)}else{const l=Rh.get("https");this._request=l.request(BL(this._url,this._httpHeaders),a)}this._request.on("error",l=>{this._storedError=l}),this._request.end()}}class ONt extends lRe{constructor(t){super(t);let r=decodeURIComponent(this._url.path);sRe.test(this._url.href)&&(r=r.replace(/^\//,""));const n=Rh.get("fs");n.promises.lstat(r).then(a=>{this._contentLength=a.size,this._setReadableStream(n.createReadStream(r)),this._headersCapability.resolve()},a=>{a.code==="ENOENT"&&(a=new d5(`Missing PDF "${r}".`)),this._storedError=a,this._headersCapability.reject(a)})}}class NNt extends cRe{constructor(t,r,n){super(t);let a=decodeURIComponent(this._url.path);sRe.test(this._url.href)&&(a=a.replace(/^\//,""));const l=Rh.get("fs");this._setReadableStream(l.createReadStream(a,{start:r,end:n-1}))}}const HNt=1e5,rc=30,_Nt=.8;let PL=class Nu{#e=Promise.withResolvers();#t=null;#o=!1;#i=!!globalThis.FontInspector?.enabled;#s=null;#r=null;#n=0;#l=0;#d=null;#p=null;#h=0;#c=0;#a=Object.create(null);#m=[];#f=null;#u=[];#y=new WeakMap;#g=null;static#b=new Map;static#v=new Map;static#A=null;static#k=new Set;constructor({textContentSource:t,container:r,viewport:n}){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=r,this.#c=n.scale*(globalThis.devicePixelRatio||1),this.#h=n.rotation,this.#r={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null};const{pageWidth:a,pageHeight:l,pageX:c,pageY:d}=n.rawDims;this.#g=[1,0,0,-1,-c,d+l],this.#l=a,this.#n=l,Nu.#x(),H4(r,n),this.#e.promise.catch(()=>{}).then(()=>{Nu.#k.delete(this),this.#r=null,this.#a=null})}render(){const t=()=>{this.#d.read().then(({value:r,done:n})=>{if(n){this.#e.resolve();return}this.#s??=r.lang,Object.assign(this.#a,r.styles),this.#S(r.items),t()},this.#e.reject)};return this.#d=this.#f.getReader(),Nu.#k.add(this),t(),this.#e.promise}update({viewport:t,onBefore:r=null}){const n=t.scale*(globalThis.devicePixelRatio||1),a=t.rotation;if(a!==this.#h&&(r?.(),this.#h=a,H4(this.#p,{rotation:a})),n!==this.#c){r?.(),this.#c=n;const l={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:Nu.#w(this.#s)};for(const c of this.#u)l.properties=this.#y.get(c),l.div=c,this.#$(l)}}cancel(){const t=new p5("TextLayer task cancelled.");this.#d?.cancel(t).catch(()=>{}),this.#d=null,this.#e.reject(t)}get textDivs(){return this.#u}get textContentItemsStr(){return this.#m}#S(t){if(this.#o)return;this.#r.ctx??=Nu.#w(this.#s);const r=this.#u,n=this.#m;for(const a of t){if(r.length>HNt){Nr("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}n.push(a.str),this.#j(a)}}#j(t){const r=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};this.#u.push(r);const a=jo.transform(this.#g,t.transform);let l=Math.atan2(a[1],a[0]);const c=this.#a[t.fontName];c.vertical&&(l+=Math.PI/2);const d=this.#i&&c.fontSubstitution||c.fontFamily,p=Math.hypot(a[2],a[3]),u=p*Nu.#C(d,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=r.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}${(Nu.#A*p).toFixed(2)}px)`,x.fontFamily=d,n.fontSize=p,r.setAttribute("role","presentation"),r.textContent=t.str,r.dir=t.dir,this.#i&&(r.dataset.fontName=c.fontSubstitutionLoadedName||t.fontName),l!==0&&(n.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 b=Math.abs(t.transform[0]),w=Math.abs(t.transform[3]);b!==w&&Math.max(b,w)/Math.min(b,w)>1.5&&(y=!0)}if(y&&(n.canvasWidth=c.vertical?t.height:t.width),this.#y.set(r,n),this.#r.div=r,this.#r.properties=n,this.#$(this.#r),n.hasText&&this.#t.append(r),n.hasEOL){const b=document.createElement("br");b.setAttribute("role","presentation"),this.#t.append(b)}}#$(t){const{div:r,properties:n,ctx:a,prevFontSize:l,prevFontFamily:c}=t,{style:d}=r;let p="";if(Nu.#A>1&&(p=`scale(${1/Nu.#A})`),n.canvasWidth!==0&&n.hasText){const{fontFamily:u}=d,{canvasWidth:h,fontSize:m}=n;(l!==m||c!==u)&&(a.font=`${m*this.#c}px ${u}`,t.prevFontSize=m,t.prevFontFamily=u);const{width:f}=a.measureText(r.textContent);f>0&&(p=`scaleX(${h*this.#c/f}) ${p}`)}n.angle!==0&&(p=`rotate(${n.angle}deg) ${p}`),p.length>0&&(d.transform=p)}static cleanup(){if(!(this.#k.size>0)){this.#b.clear();for(const{canvas:t}of this.#v.values())t.remove();this.#v.clear()}}static#w(t=null){let r=this.#v.get(t||="");if(!r){const n=document.createElement("canvas");n.className="hiddenCanvasElement",n.lang=t,document.body.append(n),r=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#v.set(t,r)}return r}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,r){const n=this.#b.get(t);if(n)return n;const a=this.#w(r),l=a.font;a.canvas.width=a.canvas.height=rc,a.font=`${rc}px ${t}`;const c=a.measureText("");let d=c.fontBoundingBoxAscent,p=Math.abs(c.fontBoundingBoxDescent);if(d){const m=d/(d+p);return this.#b.set(t,m),a.canvas.width=a.canvas.height=0,a.font=l,m}a.strokeStyle="red",a.clearRect(0,0,rc,rc),a.strokeText("g",0,0);let u=a.getImageData(0,0,rc,rc).data;p=0;for(let m=u.length-1-3;m>=0;m-=4)if(u[m]>0){p=Math.ceil(m/4/rc);break}a.clearRect(0,0,rc,rc),a.strokeText("A",0,rc),u=a.getImageData(0,0,rc,rc).data,d=0;for(let m=0,f=u.length;m<f;m+=4)if(u[m]>0){d=rc-Math.floor(m/4/rc);break}a.canvas.width=a.canvas.height=0,a.font=l;const h=d?d/(d+p):_Nt;return this.#b.set(t,h),h}};function VNt(){Jze("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:e,container:t,viewport:r,...n}=arguments[0],a=Object.keys(n);a.length>0&&Nr("Ignoring `renderTextLayer` parameters: "+a.join(", "));const l=new PL({textContentSource:e,container:t,viewport:r}),{textDivs:c,textContentItemsStr:d}=l;return{promise:l.render(),textDivs:c,textContentItemsStr:d}}function QNt(){Jze("`updateTextLayer`, please use `TextLayer` instead.")}class rv{static textContent(t){const r=[],n={items:r,styles:Object.create(null)};function a(l){if(!l)return;let c=null;const d=l.name;if(d==="#text")c=l.value;else if(rv.shouldBuildText(d))l?.attributes?.textContent?c=l.attributes.textContent:l.value&&(c=l.value);else return;if(c!==null&&r.push({str:c}),!!l.children)for(const p of l.children)a(p)}return a(t),n}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const UNt=65536,WNt=100,GNt=5e3,YNt=ul?nNt:WOt,KNt=ul?aNt:qze,qNt=ul?iNt:UOt,ZNt=ul?sNt:Zze;function JNt(e={}){typeof e=="string"||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t=new TX,{docId:r}=t,n=e.url?XNt(e.url):null,a=e.data?eHt(e.data):null,l=e.httpHeaders||null,c=e.withCredentials===!0,d=e.password??null,p=e.range instanceof dRe?e.range:null,u=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:UNt;let h=e.worker instanceof Ud?e.worker:null;const m=e.verbosity,f=typeof e.docBaseUrl=="string"&&!kX(e.docBaseUrl)?e.docBaseUrl:null,x=typeof e.cMapUrl=="string"?e.cMapUrl:null,y=e.cMapPacked!==!1,b=e.CMapReaderFactory||KNt,w=typeof e.standardFontDataUrl=="string"?e.standardFontDataUrl:null,v=e.StandardFontDataFactory||ZNt,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:!ul,L=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,M=typeof e.disableFontFace=="boolean"?e.disableFontFace:ul,D=e.fontExtraProperties===!0,P=e.enableXfa===!0,T=e.ownerDocument||globalThis.document,z=e.disableRange===!0,N=e.disableStream===!0,K=e.disableAutoFetch===!0,q=e.pdfBug===!0,F=e.enableHWA===!0,_=p?p.length:e.length??NaN,V=typeof e.useSystemFonts=="boolean"?e.useSystemFonts:!ul&&!M,O=typeof e.useWorkerFetch=="boolean"?e.useWorkerFetch:b===qze&&v===Zze&&x&&w&&bb(x,document.baseURI)&&bb(w,document.baseURI),R=e.canvasFactory||new YNt({ownerDocument:T,enableHWA:F}),H=e.filterFactory||new qNt({docId:r,ownerDocument:T}),ee=null;DOt(m);const Y={canvasFactory:R,filterFactory:H};if(O||(Y.cMapReaderFactory=new b({baseUrl:x,isCompressed:y}),Y.standardFontDataFactory=new v({baseUrl:w})),!h){const J={verbosity:m,port:ov.workerPort};h=J.port?Ud.fromPort(J):new Ud(J),t._worker=h}const G={docId:r,apiVersion:"4.4.168",data:a,password:d,disableAutoFetch:K,rangeChunkSize:u,length:_,docBaseUrl:f,enableXfa:P,evaluatorOptions:{maxImageSize:S,disableFontFace:M,ignoreErrors:A,isEvalSupported:E,isOffscreenCanvasSupported:I,canvasMaxAreaInBytes:L,fontExtraProperties:D,useSystemFonts:V,cMapUrl:O?x:null,standardFontDataUrl:O?w:null}},X={disableFontFace:M,fontExtraProperties:D,ownerDocument:T,pdfBug:q,styleElement:ee,loadingParams:{disableAutoFetch:K,enableXfa:P}};return h.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const J=h.messageHandler.sendWithPromise("GetDocRequest",G,a?[a.buffer]:null);let ie;if(p)ie=new $Nt(p,{disableRange:z,disableStream:N});else if(!a){if(!n)throw new Error("getDocument - no `url` parameter provided.");ie=(me=>ul?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&bb(me.url)?new jme(me):new zNt(me):bb(me.url)?new jme(me):new BNt(me))({url:n,length:_,httpHeaders:l,withCredentials:c,rangeChunkSize:u,disableRange:z,disableStream:N})}return J.then(ye=>{if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const me=new wb(r,ye,h.port),de=new iHt(me,t,ie,X,Y);t._transport=de,me.send("Ready",null)})}).catch(t._capability.reject),t}function XNt(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(ul&&typeof e=="string")return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function eHt(e){if(ul&&typeof AE<"u"&&e instanceof AE)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 BM(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 Mme(e){return typeof e=="object"&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0}class TX{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${TX.#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 dRe=class{constructor(t,r,n=!1,a=null){this.length=t,this.initialData=r,this.progressiveDone=n,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,r){for(const n of this._rangeListeners)n(t,r)}onDataProgress(t,r){this._readyCapability.promise.then(()=>{for(const n of this._progressListeners)n(t,r)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const r of this._progressiveReadListeners)r(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,r){Gi("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class tHt{constructor(t,r){this._pdfInfo=t,this._transport=r}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 mi(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:r}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(r)}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 oHt{#e=null;#t=!1;constructor(t,r,n,a=!1){this._pageIndex=t,this._pageInfo=r,this._transport=n,this._stats=a?new xme:null,this._pdfBug=a,this.commonObjs=n.commonObjs,this.objs=new pRe,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:r=this.rotate,offsetX:n=0,offsetY:a=0,dontFlip:l=!1}={}){return new hC({viewBox:this.view,scale:t,rotation:r,offsetX:n,offsetY:a,dontFlip:l})}getAnnotations({intent:t="display"}={}){const{renderingIntent:r}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,r)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return mi(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:r,intent:n="display",annotationMode:a=Fm.ENABLE,transform:l=null,background:c=null,optionalContentConfigPromise:d=null,annotationCanvasMap:p=null,pageColors:u=null,printAnnotationStorage:h=null}){this._stats?.time("Overall");const m=this._transport.getRenderingIntent(n,a,h),{renderingIntent:f,cacheKey:x}=m;this.#t=!1,this.#i(),d||=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 b=!!(f&Nd.PRINT);y.displayReadyCapability||(y.displayReadyCapability=Promise.withResolvers(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(m));const w=S=>{y.renderTasks.delete(v),(this._maybeCleanupAfterRender||b)&&(this.#t=!0),this.#o(!b),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 W6({callback:w,params:{canvasContext:t,viewport:r,transform:l,background:c},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:p,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!b,pdfBug:this._pdfBug,pageColors:u});(y.renderTasks||=new Set).add(v);const A=v.task;return Promise.all([y.displayReadyCapability.promise,d]).then(([S,E])=>{if(this.destroyed){w();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(w),A}getOperatorList({intent:t="display",annotationMode:r=Fm.ENABLE,printAnnotationStorage:n=null}={}){function a(){c.operatorList.lastChunk&&(c.opListReadCapability.resolve(c.operatorList),c.renderTasks.delete(d))}const l=this._transport.getRenderingIntent(t,r,n,!0);let c=this._intentStates.get(l.cacheKey);c||(c=Object.create(null),this._intentStates.set(l.cacheKey,c));let d;return c.opListReadCapability||(d=Object.create(null),d.operatorListChanged=a,c.opListReadCapability=Promise.withResolvers(),(c.renderTasks||=new Set).add(d),c.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(l)),c.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:r=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:r===!0},{highWaterMark:100,size(a){return a.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(n=>rv.textContent(n));const r=this.streamTextContent(t);return new Promise(function(n,a){function l(){c.read().then(function({value:p,done:u}){if(u){n(d);return}d.lang??=p.lang,Object.assign(d.styles,p.styles),d.items.push(...p.items),l()},a)}const c=r.getReader(),d={items:[],styles:Object.create(null),lang:null};l()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const r of this._intentStates.values())if(this._abortOperatorList({intentState:r,reason:new Error("Page was destroyed."),force:!0}),!r.opListReadCapability)for(const n of r.renderTasks)t.push(n.completed),n.cancel();return this.objs.clear(),this.#t=!1,this.#i(),Promise.all(t)}cleanup(t=!1){this.#t=!0;const r=this.#o(!1);return t&&r&&(this._stats&&=new xme),r}#o(t=!1){if(this.#i(),!this.#t||this.destroyed)return!1;if(t)return this.#e=setTimeout(()=>{this.#e=null,this.#o(!1)},GNt),!1;for(const{renderTasks:r,operatorList:n}of this._intentStates.values())if(r.size>0||!n.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,r){const n=this._intentStates.get(r);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(t))}_renderPageChunk(t,r){for(let n=0,a=t.length;n<a;n++)r.operatorList.fnArray.push(t.fnArray[n]),r.operatorList.argsArray.push(t.argsArray[n]);r.operatorList.lastChunk=t.lastChunk,r.operatorList.separateAnnots=t.separateAnnots;for(const n of r.renderTasks)n.operatorListChanged();t.lastChunk&&this.#o(!0)}_pumpOperatorList({renderingIntent:t,cacheKey:r,annotationStorageSerializable:n}){const{map:a,transfer:l}=n,d=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:r,annotationStorage:a},l).getReader(),p=this._intentStates.get(r);p.streamReader=d;const u=()=>{d.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:r,force:n=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!n){if(t.renderTasks.size>0)return;if(r instanceof $X){let a=WNt;r.extraDelay>0&&r.extraDelay<1e3&&(a+=r.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:r,force:!0})},a);return}}if(t.streamReader.cancel(new p5(r.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 rHt{#e=new Set;#t=Promise.resolve();postMessage(t,r){const n={data:structuredClone(t,r?{transfer:r}:null)};this.#t.then(()=>{for(const a of this.#e)a.call(this,n)})}addEventListener(t,r){this.#e.add(r)}removeEventListener(t,r){this.#e.delete(r)}terminate(){this.#e.clear()}}const N0={isWorkerDisabled:!1,fakeWorkerId:0};ul&&(N0.isWorkerDisabled=!0,ov.workerSrc||="./pdf.worker.mjs"),N0.isSameOrigin=function(e,t){let r;try{if(r=new URL(e),!r.origin||r.origin==="null")return!1}catch{return!1}const n=new URL(t,r);return r.origin===n.origin},N0.createCDNWrapper=function(e){const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};class Ud{static#e;constructor({name:t=null,port:r=null,verbosity:n=TOt()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=n,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,r){if(Ud.#e?.has(r))throw new Error("Cannot use more than one PDFWorker per port.");(Ud.#e||=new WeakMap).set(r,this),this._initializeFromPort(r);return}this._initialize()}get promise(){return ul?Promise.all([Rh.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 wb("main","worker",t),this._messageHandler.on("ready",function(){}),this.#t()}_initialize(){if(N0.isWorkerDisabled||Ud.#o){this._setupFakeWorker();return}let{workerSrc:t}=Ud;try{N0.isSameOrigin(window.location.href,t)||(t=N0.createCDNWrapper(new URL(t,window.location).href));const r=new Worker(t,{type:"module"}),n=new wb("main","worker",r),a=()=>{l.abort(),n.destroy(),r.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},l=new AbortController;r.addEventListener("error",()=>{this._webWorker||a()},{signal:l.signal}),n.on("test",d=>{if(l.abort(),this.destroyed||!d){a();return}this._messageHandler=n,this._port=r,this._webWorker=r,this.#t()}),n.on("ready",d=>{if(l.abort(),this.destroyed){a();return}try{c()}catch{this._setupFakeWorker()}});const c=()=>{const d=new Uint8Array;n.send("test",d,[d.buffer])};c();return}catch{jM("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){N0.isWorkerDisabled||(Nr("Setting up fake worker."),N0.isWorkerDisabled=!0),Ud._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const r=new rHt;this._port=r;const n=`fake${N0.fakeWorkerId++}`,a=new wb(n+"_worker",n,r);t.setup(a,r),this._messageHandler=new wb(n,n+"_worker",r),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),Ud.#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 r=this.#e?.get(t.port);if(r){if(r._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return r}return new Ud(t)}static get workerSrc(){if(ov.workerSrc)return ov.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#o(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return mi(this,"_setupFakeWorkerGlobal",(async()=>this.#o?this.#o:(await import(this.workerSrc)).WorkerMessageHandler)())}}class iHt{#e=new Map;#t=new Map;#o=new Map;#i=new Map;#s=null;constructor(t,r,n,a,l){this.messageHandler=t,this.loadingTask=r,this.commonObjs=new pRe,this.fontLoader=new oNt({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=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#r(t,r=null){const n=this.#e.get(t);if(n)return n;const a=this.messageHandler.sendWithPromise(t,r);return this.#e.set(t,a),a}get annotationStorage(){return mi(this,"annotationStorage",new MX)}getRenderingIntent(t,r=Fm.ENABLE,n=null,a=!1){let l=Nd.DISPLAY,c=EY;switch(t){case"any":l=Nd.ANY;break;case"display":break;case"print":l=Nd.PRINT;break;default:Nr(`getRenderingIntent - invalid intent: ${t}`)}switch(r){case Fm.DISABLE:l+=Nd.ANNOTATIONS_DISABLE;break;case Fm.ENABLE:break;case Fm.ENABLE_FORMS:l+=Nd.ANNOTATIONS_FORMS;break;case Fm.ENABLE_STORAGE:l+=Nd.ANNOTATIONS_STORAGE,c=(l&Nd.PRINT&&n instanceof tRe?n:this.annotationStorage).serializable;break;default:Nr(`getRenderingIntent - invalid annotationMode: ${r}`)}return a&&(l+=Nd.OPLIST),{renderingIntent:l,cacheKey:`${l}_${c.hash}`,annotationStorageSerializable:c}}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 n of this.#t.values())t.push(n._destroy());this.#t.clear(),this.#o.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const r=this.messageHandler.sendWithPromise("Terminate",null);return t.push(r),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),PL.cleanup(),this._networkStream?.cancelAllRequests(new p5("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:r}=this;t.on("GetReader",(n,a)=>{Wa(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:c}){if(c){a.close();return}Wa(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(c=>{if(!this.destroyed)throw c})}}),t.on("ReaderHeadersReady",n=>{const a=Promise.withResolvers(),l=this._fullReader;return l.headersReady.then(()=>{(!l.isStreamingSupported||!l.isRangeSupported)&&(this._lastProgress&&r.onProgress?.(this._lastProgress),l.onProgress=c=>{r.onProgress?.({loaded:c.loaded,total:c.total})}),a.resolve({isStreamingSupported:l.isStreamingSupported,isRangeSupported:l.isRangeSupported,contentLength:l.contentLength})},a.reject),a.promise}),t.on("GetRangeReader",(n,a)=>{Wa(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const l=this._networkStream.getRangeReader(n.begin,n.end);if(!l){a.close();return}a.onPull=()=>{l.read().then(function({value:c,done:d}){if(d){a.close();return}Wa(c instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(c),1,[c])}).catch(c=>{a.error(c)})},a.onCancel=c=>{l.cancel(c),a.ready.catch(d=>{if(!this.destroyed)throw d})}}),t.on("GetDoc",({pdfInfo:n})=>{this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,r._capability.resolve(new tHt(n,this))}),t.on("DocException",function(n){let a;switch(n.name){case"PasswordException":a=new kY(n.message,n.code);break;case"InvalidPDFException":a=new Gze(n.message);break;case"MissingPDFException":a=new d5(n.message);break;case"UnexpectedResponseException":a=new MM(n.message,n.status);break;case"UnknownErrorException":a=new SY(n.message,n.details);break;default:Gi("DocException - expected a valid Error.")}r._capability.reject(a)}),t.on("PasswordRequest",n=>{if(this.#s=Promise.withResolvers(),r.onPassword){const a=l=>{l instanceof Error?this.#s.reject(l):this.#s.resolve({password:l})};try{r.onPassword(a,n.code)}catch(l){this.#s.reject(l)}}else this.#s.reject(new kY(n.message,n.code));return this.#s.promise}),t.on("DataLoaded",n=>{r.onProgress?.({loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),t.on("StartRenderPage",n=>{if(this.destroyed)return;this.#t.get(n.pageIndex)._startRenderPage(n.transparency,n.cacheKey)}),t.on("commonobj",([n,a,l])=>{if(this.destroyed||this.commonObjs.has(n))return null;switch(a){case"Font":const{disableFontFace:c,fontExtraProperties:d,pdfBug:p}=this._params;if("error"in l){const f=l.error;Nr(`Error during font loading: ${f}`),this.commonObjs.resolve(n,f);break}const u=p&&globalThis.FontInspector?.enabled?(f,x)=>globalThis.FontInspector.fontAdded(f,x):null,h=new rNt(l,{disableFontFace:c,inspectFont:u});this.fontLoader.bind(h).catch(()=>t.sendWithPromise("FontFallback",{id:n})).finally(()=>{!d&&h.data&&(h.data=null),this.commonObjs.resolve(n,h)});break;case"CopyLocalImage":const{imageRef:m}=l;Wa(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(n,structuredClone(x)),x.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,l);break;default:throw new Error(`Got unknown common object type ${a}`)}return null}),t.on("obj",([n,a,l,c])=>{if(this.destroyed)return;const d=this.#t.get(a);if(!d.objs.has(n)){if(d._intentStates.size===0){c?.bitmap?.close();return}switch(l){case"Image":d.objs.resolve(n,c),c?.dataLen>jOt&&(d._maybeCleanupAfterRender=!0);break;case"Pattern":d.objs.resolve(n,c);break;default:throw new Error(`Got unknown object type ${l}`)}}}),t.on("DocProgress",n=>{this.destroyed||r.onProgress?.({loaded:n.loaded,total:n.total})}),t.on("FetchBuiltInCMap",n=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(n):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),t.on("FetchStandardFontData",n=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(n):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Nr("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:r}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},r).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const r=t-1,n=this.#o.get(r);if(n)return n;const a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:r}).then(l=>{if(this.destroyed)throw new Error("Transport destroyed");l.refStr&&this.#i.set(l.refStr,t);const c=new oHt(r,l,this,this._params.pdfBug);return this.#t.set(r,c),c});return this.#o.set(r,a),a}getPageIndex(t){return Mme(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:r})}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(r=>new ANt(r,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",r=this.#e.get(t);if(r)return r;const n=this.messageHandler.sendWithPromise(t,null).then(a=>({info:a[0],metadata:a[1]?new vNt(a[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(t,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const r of this.#t.values())if(!r.cleanup())throw new Error(`startCleanup: Page ${r.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),PL.cleanup()}}cachedPageNumber(t){if(!Mme(t))return null;const r=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return this.#i.get(r)??null}}const y$=Symbol("INITIAL_DATA");class pRe{#e=Object.create(null);#t(t){return this.#e[t]||={...Promise.withResolvers(),data:y$}}get(t,r=null){if(r){const a=this.#t(t);return a.promise.then(()=>r(a.data)),null}const n=this.#e[t];if(!n||n.data===y$)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return n.data}has(t){const r=this.#e[t];return!!r&&r.data!==y$}resolve(t,r=null){const n=this.#t(t);n.data=r,n.resolve()}clear(){for(const t in this.#e){const{data:r}=this.#e[t];r?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const t in this.#e){const{data:r}=this.#e[t];r!==y$&&(yield[t,r])}}}class nHt{#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:r}=this.#e;return t.form||t.canvas&&r?.size>0}}class W6{#e=null;static#t=new WeakSet;constructor({callback:t,params:r,objs:n,commonObjs:a,annotationCanvasMap:l,operatorList:c,pageIndex:d,canvasFactory:p,filterFactory:u,useRequestAnimationFrame:h=!1,pdfBug:m=!1,pageColors:f=null}){this.callback=t,this.params=r,this.objs=n,this.commonObjs=a,this.annotationCanvasMap=l,this.operatorListIdx=null,this.operatorList=c,this._pageIndex=d,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 nHt(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=r.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:r}){if(this.cancelled)return;if(this._canvas){if(W6.#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.");W6.#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:n,viewport:a,transform:l,background:c}=this.params;this.gfx=new d8(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:r},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:l,viewport:a,transparency:t,background:c}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,r=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),W6.#t.delete(this._canvas),this.callback(t||new $X(`Rendering cancelled, page ${this._pageIndex+1}`,r))}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(),W6.#t.delete(this._canvas),this.callback())))}}const aHt="4.4.168",sHt="19fbc8998";function Bme(e){return Math.floor(Math.max(0,Math.min(1,e))*255).toString(16).padStart(2,"0")}function hy(e){return Math.max(0,Math.min(255,255*e))}class Pme{static CMYK_G([t,r,n,a]){return["G",1-Math.min(1,.3*t+.59*n+.11*r+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=hy(t),[t,t,t]}static G_HTML([t]){const r=Bme(t);return`#${r}${r}${r}`}static RGB_G([t,r,n]){return["G",.3*t+.59*r+.11*n]}static RGB_rgb(t){return t.map(hy)}static RGB_HTML(t){return`#${t.map(Bme).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,r,n,a]){return["RGB",1-Math.min(1,t+a),1-Math.min(1,n+a),1-Math.min(1,r+a)]}static CMYK_rgb([t,r,n,a]){return[hy(1-Math.min(1,t+a)),hy(1-Math.min(1,n+a)),hy(1-Math.min(1,r+a))]}static CMYK_HTML(t){const r=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(r)}static RGB_CMYK([t,r,n]){const a=1-t,l=1-r,c=1-n,d=Math.min(a,l,c);return["CMYK",a,l,c,d]}}class uRe{static setupStorage(t,r,n,a,l){const c=a.getValue(r,{value:null});switch(n.name){case"textarea":if(c.value!==null&&(t.textContent=c.value),l==="print")break;t.addEventListener("input",d=>{a.setValue(r,{value:d.target.value})});break;case"input":if(n.attributes.type==="radio"||n.attributes.type==="checkbox"){if(c.value===n.attributes.xfaOn?t.setAttribute("checked",!0):c.value===n.attributes.xfaOff&&t.removeAttribute("checked"),l==="print")break;t.addEventListener("change",d=>{a.setValue(r,{value:d.target.checked?d.target.getAttribute("xfaOn"):d.target.getAttribute("xfaOff")})})}else{if(c.value!==null&&t.setAttribute("value",c.value),l==="print")break;t.addEventListener("input",d=>{a.setValue(r,{value:d.target.value})})}break;case"select":if(c.value!==null){t.setAttribute("value",c.value);for(const d of n.children)d.attributes.value===c.value?d.attributes.selected=!0:d.attributes.hasOwnProperty("selected")&&delete d.attributes.selected}t.addEventListener("input",d=>{const p=d.target.options,u=p.selectedIndex===-1?"":p[p.selectedIndex].value;a.setValue(r,{value:u})});break}}static setAttributes({html:t,element:r,storage:n=null,intent:a,linkService:l}){const{attributes:c}=r,d=t instanceof HTMLAnchorElement;c.type==="radio"&&(c.name=`${c.name}-${a}`);for(const[p,u]of Object.entries(c))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:(!d||p!=="href"&&p!=="newWindow")&&t.setAttribute(p,u)}d&&l.addLinkAttributes(t,c.href,c.newWindow),n&&c.dataId&&this.setupStorage(t,c.dataId,r,n)}static render(t){const r=t.annotationStorage,n=t.linkService,a=t.xfaHtml,l=t.intent||"display",c=document.createElement(a.name);a.attributes&&this.setAttributes({html:c,element:a,intent:l,linkService:n});const d=l!=="richText",p=t.div;if(p.append(c),t.viewport){const m=`matrix(${t.viewport.transform.join(",")})`;p.style.transform=m}d&&p.setAttribute("class","xfaLayer xfaFont");const u=[];if(a.children.length===0){if(a.value){const m=document.createTextNode(a.value);c.append(m),d&&rv.shouldBuildText(a.name)&&u.push(m)}return{textDivs:u}}const h=[[a,-1,c]];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:b}=y;if(b==="#text"){const v=document.createTextNode(y.value);u.push(v),x.append(v);continue}const w=y?.attributes?.xmlns?document.createElementNS(y.attributes.xmlns,b):document.createElement(b);if(x.append(w),y.attributes&&this.setAttributes({html:w,element:y,storage:r,intent:l,linkService:n}),y.children?.length>0)h.push([y,-1,w]);else if(y.value){const v=document.createTextNode(y.value);d&&rv.shouldBuildText(b)&&u.push(v),w.append(v)}}for(const m of p.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:u}}static update(t){const r=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=r,t.div.hidden=!1}}const fC=1e3,lHt=9,_4=new WeakSet;function u2(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class cHt{static create(t){switch(t.data.annotationType){case Ha.LINK:return new hRe(t);case Ha.TEXT:return new dHt(t);case Ha.WIDGET:switch(t.data.fieldType){case"Tx":return new pHt(t);case"Btn":return t.data.radioButton?new mRe(t):t.data.checkBox?new hHt(t):new mHt(t);case"Ch":return new gHt(t);case"Sig":return new uHt(t)}return new u5(t);case Ha.POPUP:return new MY(t);case Ha.FREETEXT:return new gRe(t);case Ha.LINE:return new xHt(t);case Ha.SQUARE:return new yHt(t);case Ha.CIRCLE:return new bHt(t);case Ha.POLYLINE:return new fRe(t);case Ha.CARET:return new vHt(t);case Ha.INK:return new xRe(t);case Ha.POLYGON:return new wHt(t);case Ha.HIGHLIGHT:return new CHt(t);case Ha.UNDERLINE:return new AHt(t);case Ha.SQUIGGLY:return new $Ht(t);case Ha.STRIKEOUT:return new kHt(t);case Ha.STAMP:return new yRe(t);case Ha.FILEATTACHMENT:return new SHt(t);default:return new ua(t)}}}class ua{#e=null;#t=!1;#o=null;constructor(t,{isRenderable:r=!1,ignoreBorder:n=!1,createQuadrilaterals:a=!1}={}){this.isRenderable=r,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,r&&(this.container=this._createContainer(n)),a&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:r,richText:n}){return!!(t?.str||r?.str||n?.str)}get hasPopupData(){return ua._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};const{rect:r}=t;r&&this.#i(r),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:r},data:{rect:n,rotation:a},parent:{viewport:{rawDims:{pageWidth:l,pageHeight:c,pageX:d,pageY:p}}}}=this;n?.splice(0,4,...t);const{width:u,height:h}=u2(t);r.left=`${100*(t[0]-d)/l}%`,r.top=`${100*(c-t[3]+p)/c}%`,a===0?(r.width=`${100*u/l}%`,r.height=`${100*h/c}%`):this.setRotation(a)}_createContainer(t){const{data:r,parent:{page:n,viewport:a}}=this,l=document.createElement("section");l.setAttribute("data-annotation-id",r.id),this instanceof u5||(l.tabIndex=fC);const{style:c}=l;if(c.zIndex=this.parent.zIndex++,r.popupRef&&l.setAttribute("aria-haspopup","dialog"),r.alternativeText&&(l.title=r.alternativeText),r.noRotate&&l.classList.add("norotate"),!r.rect||this instanceof MY){const{rotation:b}=r;return!r.hasOwnCanvas&&b!==0&&this.setRotation(b,l),l}const{width:d,height:p}=u2(r.rect);if(!t&&r.borderStyle.width>0){c.borderWidth=`${r.borderStyle.width}px`;const b=r.borderStyle.horizontalCornerRadius,w=r.borderStyle.verticalCornerRadius;if(b>0||w>0){const A=`calc(${b}px * var(--scale-factor)) / calc(${w}px * var(--scale-factor))`;c.borderRadius=A}else if(this instanceof mRe){const A=`calc(${d}px * var(--scale-factor)) / calc(${p}px * var(--scale-factor))`;c.borderRadius=A}switch(r.borderStyle.style){case py.SOLID:c.borderStyle="solid";break;case py.DASHED:c.borderStyle="dashed";break;case py.BEVELED:Nr("Unimplemented border style: beveled");break;case py.INSET:Nr("Unimplemented border style: inset");break;case py.UNDERLINE:c.borderBottomStyle="solid";break}const v=r.borderColor||null;v?(this.#t=!0,c.borderColor=jo.makeHexColor(v[0]|0,v[1]|0,v[2]|0)):c.borderWidth=0}const u=jo.normalizeRect([r.rect[0],n.view[3]-r.rect[1]+n.view[1],r.rect[2],n.view[3]-r.rect[3]+n.view[1]]),{pageWidth:h,pageHeight:m,pageX:f,pageY:x}=a.rawDims;c.left=`${100*(u[0]-f)/h}%`,c.top=`${100*(u[1]-x)/m}%`;const{rotation:y}=r;return r.hasOwnCanvas||y===0?(c.width=`${100*d/h}%`,c.height=`${100*p/m}%`):this.setRotation(y,l),l}setRotation(t,r=this.container){if(!this.data.rect)return;const{pageWidth:n,pageHeight:a}=this.parent.viewport.rawDims,{width:l,height:c}=u2(this.data.rect);let d,p;t%180===0?(d=100*l/n,p=100*c/a):(d=100*c/n,p=100*l/a),r.style.width=`${d}%`,r.style.height=`${p}%`,r.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(r,n,a)=>{const l=a.detail[r],c=l[0],d=l.slice(1);a.target.style[n]=Pme[`${c}_HTML`](d),this.annotationStorage.setValue(this.data.id,{[n]:Pme[`${c}_rgb`](d)})};return mi(this,"_commonActions",{display:r=>{const{display:n}=r.detail,a=n%2===1;this.container.style.visibility=a?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:a,noPrint:n===1||n===2})},print:r=>{this.annotationStorage.setValue(this.data.id,{noPrint:!r.detail.print})},hidden:r=>{const{hidden:n}=r.detail;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:n,noView:n})},focus:r=>{setTimeout(()=>r.target.focus({preventScroll:!1}),0)},userName:r=>{r.target.title=r.detail.userName},readonly:r=>{r.target.disabled=r.detail.readonly},required:r=>{this._setRequired(r.target,r.detail.required)},bgColor:r=>{t("bgColor","backgroundColor",r)},fillColor:r=>{t("fillColor","backgroundColor",r)},fgColor:r=>{t("fgColor","color",r)},textColor:r=>{t("textColor","color",r)},borderColor:r=>{t("borderColor","borderColor",r)},strokeColor:r=>{t("strokeColor","borderColor",r)},rotation:r=>{const n=r.detail.rotation;this.setRotation(n),this.annotationStorage.setValue(this.data.id,{rotation:n})}})}_dispatchEventFromSandbox(t,r){const n=this._commonActions;for(const a of Object.keys(r.detail))(t[a]||n[a])?.(r)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const r=this.annotationStorage.getRawValue(this.data.id);if(!r)return;const n=this._commonActions;for(const[a,l]of Object.entries(r)){const c=n[a];if(c){const d={detail:{[a]:l},target:t};c(d),delete r[a]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[r,n,a,l]=this.data.rect.map(b=>Math.fround(b));if(t.length===8){const[b,w,v,A]=t.subarray(2,6);if(a===b&&l===w&&r===v&&n===A)return}const{style:c}=this.container;let d;if(this.#t){const{borderColor:b,borderWidth:w}=c;c.borderWidth=0,d=["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="${b}" stroke-width="${w}">`],this.container.classList.add("hasBorder")}const p=a-r,u=l-n,{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 b=2,w=t.length;b<w;b+=8){const v=t[b],A=t[b+1],S=t[b+2],E=t[b+3],I=h.createElement("rect"),L=(S-r)/p,M=(l-A)/u,D=(v-S)/p,P=(A-E)/u;I.setAttribute("x",L),I.setAttribute("y",M),I.setAttribute("width",D),I.setAttribute("height",P),x.append(I),d?.push(`<rect vector-effect="non-scaling-stroke" x="${L}" y="${M}" width="${D}" height="${P}"/>`)}this.#t&&(d.push("</g></svg>')"),c.backgroundImage=d.join("")),this.container.append(m),this.container.style.clipPath=`url(#${y})`}_createPopup(){const{container:t,data:r}=this;t.setAttribute("aria-haspopup","dialog");const n=this.#o=new MY({data:{color:r.color,titleObj:r.titleObj,modificationDate:r.modificationDate,contentsObj:r.contentsObj,richText:r.richText,parentRect:r.rect,borderStyle:0,id:`popup_${r.id}`,rotation:r.rotation},parent:this.parent,elements:[this]});this.parent.div.append(n.render())}render(){Gi("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,r=null){const n=[];if(this._fieldObjects){const a=this._fieldObjects[t];if(a)for(const{page:l,id:c,exportValues:d}of a){if(l===-1||c===r)continue;const p=typeof d=="string"?d:null,u=document.querySelector(`[data-element-id="${c}"]`);if(u&&!_4.has(u)){Nr(`_getElementsByName - element not allowed: ${c}`);continue}n.push({id:c,exportValue:p,domElement:u})}return n}for(const a of document.getElementsByName(t)){const{exportValue:l}=a,c=a.getAttribute("data-element-id");c!==r&&_4.has(a)&&n.push({id:c,exportValue:l,domElement:a})}return n}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 r of t)r.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:r}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:r})})}}class hRe extends ua{constructor(t,r=null){super(t,{isRenderable:!0,ignoreBorder:!!r?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:r}=this,n=document.createElement("a");n.setAttribute("data-element-id",t.id);let a=!1;return t.url?(r.addLinkAttributes(n,t.url,t.newWindow),a=!0):t.action?(this._bindNamedAction(n,t.action),a=!0):t.attachment?(this.#t(n,t.attachment,t.attachmentDest),a=!0):t.setOCGState?(this.#o(n,t.setOCGState),a=!0):t.dest?(this._bindLink(n,t.dest),a=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,t),a=!0),t.resetForm?(this._bindResetFormAction(n,t.resetForm),a=!0):this.isTooltipOnly&&!a&&(this._bindLink(n,""),a=!0)),this.container.classList.add("linkAnnotation"),a&&this.container.append(n),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(t,r){t.href=this.linkService.getDestinationHash(r),t.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||r==="")&&this.#e()}_bindNamedAction(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(r),!1),this.#e()}#t(t,r,n=null){t.href=this.linkService.getAnchorUrl(""),r.description&&(t.title=r.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(r.content,r.filename,n),!1),this.#e()}#o(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(r),!1),this.#e()}_bindJSAction(t,r){t.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const a of Object.keys(r.actions)){const l=n.get(a);l&&(t[l]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:a}}),!1))}t.onclick||(t.onclick=()=>!1),this.#e()}_bindResetFormAction(t,r){const n=t.onclick;if(n||(t.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){Nr('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(t.onclick=()=>!1);return}t.onclick=()=>{n?.();const{fields:a,refs:l,include:c}=r,d=[];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)===c&&d.push(f)}else for(const h of Object.values(this._fieldObjects))d.push(...h);const p=this.annotationStorage,u=[];for(const h of d){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(!_4.has(f)){Nr(`_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 dHt extends ua{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 u5 extends ua{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return vc.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,r,n,a,l){n.includes("mouse")?t.addEventListener(n,c=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(c),shift:c.shiftKey,modifier:this._getKeyModifier(c)}})}):t.addEventListener(n,c=>{if(n==="blur"){if(!r.focused||!c.relatedTarget)return;r.focused=!1}else if(n==="focus"){if(r.focused)return;r.focused=!0}l&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(c)}})})}_setEventListeners(t,r,n,a){for(const[l,c]of n)(c==="Action"||this.data.actions?.[c])&&((c==="Focus"||c==="Blur")&&(r||={focused:!1}),this._setEventListener(t,r,l,c,a),c==="Focus"&&!this.data.actions?.Blur?this._setEventListener(t,r,"blur","Blur",null):c==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(t,r,"focus","Focus",null))}_setBackgroundColor(t){const r=this.data.backgroundColor||null;t.style.backgroundColor=r===null?"transparent":jo.makeHexColor(r[0],r[1],r[2])}_setTextStyle(t){const r=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||lHt,l=t.style;let c;const d=2,p=u=>Math.round(10*u)/10;if(this.data.multiLine){const u=Math.abs(this.data.rect[3]-this.data.rect[1]-d),h=Math.round(u/(t_*a))||1,m=u/h;c=Math.min(a,p(m/t_))}else{const u=Math.abs(this.data.rect[3]-this.data.rect[1]-d);c=Math.min(a,p(u/t_))}l.fontSize=`calc(${c}px * var(--scale-factor))`,l.color=jo.makeHexColor(n[0],n[1],n[2]),this.data.textAlignment!==null&&(l.textAlign=r[this.data.textAlignment])}_setRequired(t,r){r?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",r)}}class pHt extends u5{constructor(t){const r=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:r})}setPropertyOnSiblings(t,r,n,a){const l=this.annotationStorage;for(const c of this._getElementsByName(t.name,t.id))c.domElement&&(c.domElement[r]=n),l.setValue(c.id,{[a]:n})}render(){const t=this.annotationStorage,r=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const a=t.getValue(r,{value:this.data.fieldValue});let l=a.value||"";const c=t.getValue(r,{charLimit:this.data.maxLen}).charLimit;c&&l.length>c&&(l=l.slice(0,c));let d=a.formattedValue||this.data.textContent?.join(`
247
247
  `)||null;d&&this.data.comb&&(d=d.replaceAll(/\s+/g,""));const p={userValue:l,formattedValue:d,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=d??l,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",d??l),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),_4.add(n),n.setAttribute("data-element-id",r),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=fC,this._setRequired(n,this.data.required),c&&(n.maxLength=c),n.addEventListener("input",h=>{t.setValue(r,{value:h.target.value}),this.setPropertyOnSiblings(n,"value",h.target.value,"value"),p.formattedValue=null}),n.addEventListener("resetform",h=>{const m=this.data.defaultFieldValue??"";n.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){n.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)}),n.addEventListener("updatefromsandbox",m=>{this.showElementAndHideCanvas(m.target);const f={value(x){p.userValue=x.detail.value??"",t.setValue(r,{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(r,{formattedValue:y})},selRange(x){x.target.setSelectionRange(...x.detail.selRange)},charLimit:x=>{const{charLimit:y}=x.detail,{target:b}=x;if(y===0){b.removeAttribute("maxLength");return}b.setAttribute("maxLength",y);let w=p.userValue;!w||w.length<=y||(w=w.slice(0,y),b.value=p.userValue=w,t.setValue(r,{value:w}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:w,willCommit:!0,commitKey:1,selStart:b.selectionStart,selEnd:b.selectionEnd}}))}};this._dispatchEventFromSandbox(f,m)}),n.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:r,name:"Keystroke",value:x,willCommit:!0,commitKey:f,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}))});const h=u;u=null,n.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:r,name:"Keystroke",value:f,willCommit:!0,commitKey:p.commitKey,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}),h(m)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",m=>{p.lastCommittedValue=null;const{data:f,target:x}=m,{value:y,selectionStart:b,selectionEnd:w}=x;let v=b,A=w;switch(m.inputType){case"deleteWordBackward":{const S=y.substring(0,b).match(/\w*[^\w]*$/);S&&(v-=S[0].length);break}case"deleteWordForward":{const S=y.substring(b).match(/^[^\w]*\w*/);S&&(A+=S[0].length);break}case"deleteContentBackward":b===w&&(v-=1);break;case"deleteContentForward":b===w&&(A+=1);break}m.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:y,change:f||"",willCommit:!1,selStart:v,selEnd:A}})}),this._setEventListeners(n,p,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],m=>m.target.value)}if(u&&n.addEventListener("blur",u),this.data.comb){const m=(this.data.rect[2]-this.data.rect[0])/c;n.classList.add("comb"),n.style.letterSpacing=`calc(${m}px * var(--scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class uHt extends u5{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class hHt extends u5{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,r=this.data,n=r.id;let a=t.getValue(n,{value:r.exportValue===r.fieldValue}).value;typeof a=="string"&&(a=a!=="Off",t.setValue(n,{value:a})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const l=document.createElement("input");return _4.add(l),l.setAttribute("data-element-id",n),l.disabled=r.readOnly,this._setRequired(l,this.data.required),l.type="checkbox",l.name=r.fieldName,a&&l.setAttribute("checked",!0),l.setAttribute("exportValue",r.exportValue),l.tabIndex=fC,l.addEventListener("change",c=>{const{name:d,checked:p}=c.target;for(const u of this._getElementsByName(d,n)){const h=p&&u.exportValue===r.exportValue;u.domElement&&(u.domElement.checked=h),t.setValue(u.id,{value:h})}t.setValue(n,{value:p})}),l.addEventListener("resetform",c=>{const d=r.defaultFieldValue||"Off";c.target.checked=d===r.exportValue}),this.enableScripting&&this.hasJSActions&&(l.addEventListener("updatefromsandbox",c=>{const d={value(p){p.target.checked=p.detail.value!=="Off",t.setValue(n,{value:p.target.checked})}};this._dispatchEventFromSandbox(d,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)),this._setBackgroundColor(l),this._setDefaultPropertiesFromJS(l),this.container.append(l),this.container}}class mRe extends u5{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,r=this.data,n=r.id;let a=t.getValue(n,{value:r.fieldValue===r.buttonValue}).value;if(typeof a=="string"&&(a=a!==r.buttonValue,t.setValue(n,{value:a})),a)for(const c of this._getElementsByName(r.fieldName,n))t.setValue(c.id,{value:!1});const l=document.createElement("input");if(_4.add(l),l.setAttribute("data-element-id",n),l.disabled=r.readOnly,this._setRequired(l,this.data.required),l.type="radio",l.name=r.fieldName,a&&l.setAttribute("checked",!0),l.tabIndex=fC,l.addEventListener("change",c=>{const{name:d,checked:p}=c.target;for(const u of this._getElementsByName(d,n))t.setValue(u.id,{value:!1});t.setValue(n,{value:p})}),l.addEventListener("resetform",c=>{const d=r.defaultFieldValue;c.target.checked=d!=null&&d===r.buttonValue}),this.enableScripting&&this.hasJSActions){const c=r.buttonValue;l.addEventListener("updatefromsandbox",d=>{const p={value:u=>{const h=c===u.detail.value;for(const m of this._getElementsByName(u.target.name)){const f=h&&m.id===n;m.domElement&&(m.domElement.checked=f),t.setValue(m.id,{value:f})}}};this._dispatchEventFromSandbox(p,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)}return this._setBackgroundColor(l),this._setDefaultPropertiesFromJS(l),this.container.append(l),this.container}}class mHt extends hRe{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const r=t.lastChild;return this.enableScripting&&this.hasJSActions&&r&&(this._setDefaultPropertiesFromJS(r),r.addEventListener("updatefromsandbox",n=>{this._dispatchEventFromSandbox({},n)})),t}}class gHt extends u5{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,r=this.data.id,n=t.getValue(r,{value:this.data.fieldValue}),a=document.createElement("select");_4.add(a),a.setAttribute("data-element-id",r),a.disabled=this.data.readOnly,this._setRequired(a,this.data.required),a.name=this.data.fieldName,a.tabIndex=fC;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,n.value.includes(h.exportValue)&&(m.setAttribute("selected",!0),l=!1),a.append(m)}let c=null;if(l){const h=document.createElement("option");h.value=" ",h.setAttribute("hidden",!0),h.setAttribute("selected",!0),a.prepend(h),c=()=>{h.remove(),a.removeEventListener("input",c),c=null},a.addEventListener("input",c)}const d=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=d(!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){c?.();const x=f.detail.value,y=new Set(Array.isArray(x)?x:[x]);for(const b of a.options)b.selected=y.has(b.value);t.setValue(r,{value:d(!0)}),p=d(!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,w=>w.selected)===-1&&(x[0].selected=!0),t.setValue(r,{value:d(!0),items:u(f)}),p=d(!1)},clear(f){for(;a.length!==0;)a.remove(0);t.setValue(r,{value:null,items:[]}),p=d(!1)},insert(f){const{index:x,displayValue:y,exportValue:b}=f.detail.insert,w=a.children[x],v=document.createElement("option");v.textContent=y,v.value=b,w?w.before(v):a.append(v),t.setValue(r,{value:d(!0),items:u(f)}),p=d(!1)},items(f){const{items:x}=f.detail;for(;a.length!==0;)a.remove(0);for(const y of x){const{displayValue:b,exportValue:w}=y,v=document.createElement("option");v.textContent=b,v.value=w,a.append(v)}a.options.length>0&&(a.options[0].selected=!0),t.setValue(r,{value:d(!0),items:u(f)}),p=d(!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(r,{value:d(!0)}),p=d(!1)},editable(f){f.target.disabled=!f.detail.editable}};this._dispatchEventFromSandbox(m,h)}),a.addEventListener("input",h=>{const m=d(!0),f=d(!1);t.setValue(r,{value:m}),h.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,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(r,{value:d(!0)})}),this.data.combo&&this._setTextStyle(a),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class MY extends ua{constructor(t){const{data:r,elements:n}=t;super(t,{isRenderable:ua._hasPopupData(r)}),this.elements=n,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new fHt({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}),r=[];for(const n of this.elements)n.popup=t,r.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",r.map(n=>`${Kze}${n}`).join(",")),this.container}}class fHt{#e=this.#j.bind(this);#t=this.#C.bind(this);#o=this.#x.bind(this);#i=this.#w.bind(this);#s=null;#r=null;#n=null;#l=null;#d=null;#p=null;#h=null;#c=!1;#a=null;#m=null;#f=null;#u=null;#y=null;#g=null;#b=!1;constructor({container:t,color:r,elements:n,titleObj:a,modificationDate:l,contentsObj:c,richText:d,parent:p,rect:u,parentRect:h,open:m}){this.#r=t,this.#y=a,this.#n=c,this.#u=d,this.#p=p,this.#s=r,this.#f=u,this.#h=h,this.#d=n,this.#l=Xze.toDateObject(l),this.trigger=n.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 n)f.container?.addEventListener("keydown",this.#e);this.#r.hidden=!0,m&&this.#w()}render(){if(this.#a)return;const t=this.#a=document.createElement("div");if(t.className="popup",this.#s){const l=t.style.outlineColor=jo.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=jo.makeHexColor(...this.#s.map(d=>Math.floor(.7*(255-d)+d)))}const r=document.createElement("span");r.className="header";const n=document.createElement("h1");if(r.append(n),{dir:n.dir,str:n.textContent}=this.#y,t.append(r),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()})),r.append(l)}const a=this.#v;if(a)uRe.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,r=this.#n;return t?.str&&(!r?.str||r.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 r=[],n={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:r}]}},a={style:{color:this.#k,fontSize:this.#A?`calc(${this.#A}px * var(--scale-factor))`:""}};for(const l of t.split(`
248
248
  `))r.push({name:"span",value:l,attributes:a});return n}_formatContents({str:t,dir:r}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=r;const a=t.split(/(?:\r\n?|\n)/);for(let l=0,c=a.length;l<c;++l){const d=a[l];n.append(document.createTextNode(d)),l<c-1&&n.append(document.createElement("br"))}return n}#j(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&this.#c)&&this.#w()}updateEdited({rect:t,popupContent:r}){this.#g||={contentsObj:this.#n,richText:this.#u},t&&(this.#m=null),r&&(this.#u=this.#S(r),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:r,pageHeight:n,pageX:a,pageY:l}}}=this.#p;let c=!!this.#h,d=c?this.#h:this.#f;for(const y of this.#d)if(!d||jo.intersect(y.data.rect,d)!==null){d=y.data.rect,c=!0;break}const p=jo.normalizeRect([d[0],t[3]-d[1]+t[1],d[2],t[3]-d[3]+t[1]]),h=c?d[2]-d[0]+5:0,m=p[0]+h,f=p[1];this.#m=[100*(m-a)/r,100*(f-l)/n];const{style:x}=this.#r;x.left=`${this.#m[0]}%`,x.top=`${this.#m[1]}%`}#w(){this.#c=!this.#c,this.#c?(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.#c&&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.#c||!this.isVisible)&&(this.#r.hidden=!0,this.#r.style.zIndex=parseInt(this.#r.style.zIndex)-1e3)}forceHide(){this.#b=this.isVisible,this.#b&&(this.#r.hidden=!0)}maybeShow(){this.#b&&(this.#a||this.#x(),this.#b=!1,this.#r.hidden=!1)}get isVisible(){return this.#r.hidden===!1}}class gRe extends ua{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=ai.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 r of this.textContent){const n=document.createElement("span");n.textContent=r,t.append(n)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}class xHt extends ua{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:r,height:n}=u2(t.rect),a=this.svgFactory.create(r,n,!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 yHt extends ua{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:r,height:n}=u2(t.rect),a=this.svgFactory.create(r,n,!0),l=t.borderStyle.width,c=this.#e=this.svgFactory.createElement("svg:rect");return c.setAttribute("x",l/2),c.setAttribute("y",l/2),c.setAttribute("width",r-l),c.setAttribute("height",n-l),c.setAttribute("stroke-width",l||1),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),a.append(c),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class bHt extends ua{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:r,height:n}=u2(t.rect),a=this.svgFactory.create(r,n,!0),l=t.borderStyle.width,c=this.#e=this.svgFactory.createElement("svg:ellipse");return c.setAttribute("cx",r/2),c.setAttribute("cy",n/2),c.setAttribute("rx",r/2-l/2),c.setAttribute("ry",n/2-l/2),c.setAttribute("stroke-width",l||1),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),a.append(c),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class fRe extends ua{#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:r,borderStyle:n,popupRef:a}}=this;if(!r)return this.container;const{width:l,height:c}=u2(t),d=this.svgFactory.create(l,c,!0);let p=[];for(let h=0,m=r.length;h<m;h+=2){const f=r[h]-t[0],x=t[3]-r[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",n.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),d.append(u),this.container.append(d),!a&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class wHt extends fRe{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class vHt extends ua{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 xRe extends ua{#e=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=ai.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:r,borderStyle:n,popupRef:a}}=this,{width:l,height:c}=u2(t),d=this.svgFactory.create(l,c,!0);for(const p of r){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",n.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),!a&&this.hasPopupData&&this._createPopup(),d.append(h)}return this.container.append(d),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class CHt extends ua{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 AHt extends ua{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 $Ht extends ua{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 kHt extends ua{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 yRe extends ua{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 SHt extends ua{#e=null;constructor(t){super(t,{isRenderable:!0});const{file:r}=this.data;this.filename=r.filename,this.content=r.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...r})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:r}=this;let n;r.hasAppearance||r.fillAlpha===0?n=document.createElement("div"):(n=document.createElement("img"),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(r.name)?"paperclip":"pushpin"}.svg`,r.fillAlpha&&r.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(r.fillAlpha*100)}%);`)),n.addEventListener("dblclick",this.#t.bind(this)),this.#e=n;const{isMac:a}=vc.platform;return t.addEventListener("keydown",l=>{l.key==="Enter"&&(a?l.metaKey:l.ctrlKey)&&this.#t()}),!r.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea"),t.append(n),t}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}let EHt=class{#e=null;#t=null;#o=new Map;constructor({div:t,accessibilityManager:r,annotationCanvasMap:n,annotationEditorUIManager:a,page:l,viewport:c}){this.div=t,this.#e=r,this.#t=n,this.page=l,this.viewport=c,this.zIndex=0,this._annotationEditorUIManager=a}#i(t,r){const n=t.firstChild||t;n.id=`${Kze}${r}`,this.div.append(t),this.#e?.moveElementInDOM(this.div,t,n,!1)}async render(t){const{annotations:r}=t,n=this.div;H4(n,this.viewport);const a=new Map,l={data:null,layer:n,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new AX,annotationStorage:t.annotationStorage||new MX,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const c of r){if(c.noHTML)continue;const d=c.annotationType===Ha.POPUP;if(d){const h=a.get(c.id);if(!h)continue;l.elements=h}else{const{width:h,height:m}=u2(c.rect);if(h<=0||m<=0)continue}l.data=c;const p=cHt.create(l);if(!p.isRenderable)continue;if(!d&&c.popupRef){const h=a.get(c.popupRef);h?h.push(p):a.set(c.popupRef,[p])}const u=p.render();c.hidden&&(u.style.visibility="hidden"),this.#i(u,c.id),p.annotationEditorType>0&&(this.#o.set(p.data.id,p),this._annotationEditorUIManager?.renderAnnotationElement(p))}this.#s()}update({viewport:t}){const r=this.div;this.viewport=t,H4(r,{rotation:t.rotation}),this.#s(),r.hidden=!1}#s(){if(!this.#t)return;const t=this.div;for(const[r,n]of this.#t){const a=t.querySelector(`[data-annotation-id="${r}"]`);if(!a)continue;n.className="annotationContent";const{firstChild:l}=a;l?l.nodeName==="CANVAS"?l.replaceWith(n):l.classList.contains("annotationContent")?l.after(n):l.before(n):a.append(n)}this.#t.clear()}getEditableAnnotations(){return Array.from(this.#o.values())}getEditableAnnotation(t){return this.#o.get(t)}};const b$=/\r\n?|\n/g;class Va extends ur{#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`;#d;#p=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=Va.prototype,r=l=>l.isEmpty(),n=yg.TRANSLATE_SMALL,a=yg.TRANSLATE_BIG;return mi(this,"_keyboardManager",new mC([[["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:[-n,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-a,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[n,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[a,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-a],checker:r}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,n],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,a],checker:r}]]))}static _type="freetext";static _editorType=ai.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.#r=t.color||Va._defaultColor||ur._defaultLineColor,this.#d=t.fontSize||Va._defaultFontSize}static initialize(t,r){ur.initialize(t,r,{strings:["pdfjs-free-text-default-content"]});const n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,r){switch(t){case gr.FREETEXT_SIZE:Va._defaultFontSize=r;break;case gr.FREETEXT_COLOR:Va._defaultColor=r;break}}updateParams(t,r){switch(t){case gr.FREETEXT_SIZE:this.#h(r);break;case gr.FREETEXT_COLOR:this.#c(r);break}}static get defaultPropertiesToUpdate(){return[[gr.FREETEXT_SIZE,Va._defaultFontSize],[gr.FREETEXT_COLOR,Va._defaultColor||ur._defaultLineColor]]}get propertiesToUpdate(){return[[gr.FREETEXT_SIZE,this.#d],[gr.FREETEXT_COLOR,this.#r]]}#h(t){const r=a=>{this.editorDiv.style.fontSize=`calc(${a}px * var(--scale-factor))`,this.translate(0,-(a-this.#d)*this.parentScale),this.#d=a,this.#m()},n=this.#d;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:gr.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#c(t){const r=a=>{this.#r=this.editorDiv.style.color=a},n=this.#r;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:gr.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,r){this._uiManager.translateSelectedEditors(t,r,!0)}getInitialTranslation(){const t=this.parentScale;return[-Va._internalPadding*t,-(Va._internalPadding+this.#d)*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(ai.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 r of this.editorDiv.childNodes)t.push(Va.#f(r));return t.join(`
249
249
  `)}#m(){const[t,r]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:a,div:l}=this,c=l.style.display,d=l.classList.contains("hidden");l.classList.remove("hidden"),l.style.display="hidden",a.div.append(this.div),n=l.getBoundingClientRect(),l.remove(),l.style.display=c,l.classList.toggle("hidden",d)}this.rotation%180===this.parentRotation%180?(this.width=n.width/t,this.height=n.height/r):(this.width=n.height/t,this.height=n.width/r),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#n,r=this.#n=this.#a().trimEnd();if(t===r)return;const n=a=>{if(this.#n=a,!a){this.remove();return}this.#u(),this._uiManager.rebuild(this),this.#m()};this.addCommands({cmd:()=>{n(r)},undo:()=>{n(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){Va._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,r;this.width&&(t=this.x,r=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(),ur._l10nPromise.get("pdfjs-free-text-default-content").then(a=>this.editorDiv?.setAttribute("default-content",a)),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#d}px * var(--scale-factor))`,n.color=this.#r,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),ML(this,this.div,["dblclick","keydown"]),this.width){const[a,l]=this.parentDimensions;if(this.annotationElementId){const{position:c}=this.#p;let[d,p]=this.getInitialTranslation();[d,p]=this.pageTranslationToScreen(d,p);const[u,h]=this.pageDimensions,[m,f]=this.pageTranslation;let x,y;switch(this.rotation){case 0:x=t+(c[0]-m)/u,y=r+this.height-(c[1]-f)/h;break;case 90:x=t+(c[0]-m)/u,y=r-(c[1]-f)/h,[d,p]=[p,-d];break;case 180:x=t-this.width+(c[0]-m)/u,y=r-(c[1]-f)/h,[d,p]=[-d,-p];break;case 270:x=t+(c[0]-m-this.height*h)/u,y=r+(c[1]-f-this.width*u)/h,[d,p]=[-p,d];break}this.setAt(x*a,y*l,d,p)}else this.setAt(t*a,r*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(b$,"")}editorDivPaste(t){const r=t.clipboardData||window.clipboardData,{types:n}=r;if(n.length===1&&n[0]==="text/plain")return;t.preventDefault();const a=Va.#g(r.getData("text")||"").replaceAll(b$,`
@@ -354,7 +354,7 @@ Initiate your first transfer to start earning yield.`,insuredFundsTooltip:"Secur
354
354
  The KYB info is required to comply with financial regulations and uphold the security of our customers.`,stepSubText:"Enter business details to complete verification."},link_card:{footNote:{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:{subTitle:"To set up your dashboard, we must connect with your QuickBooks account."},company_officer:{subTitle:`Enter proof of identity to complete verification.
355
355
  The KYC info is required to comply with the Bank Secrecy Act and Anti-Money Laundering regulations.`},company_details:{subTitle:`Enter business details to complete verification.
356
356
  The KYB info is required to comply with financial regulations and uphold the security of our customers.`}},sections:{link_payment_account:{subText:"Log in securely to your bank and start managing your payments right away",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"},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",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:{subHeader:"Securely add your preferred payment method to activate your account.",addNewCard:"Link a new card",protectedCardNo:"****"},connectLedger:{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",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:{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."]}},pageSubtitle:"Required foundation for both AI Agents"},officerVerification:{introBody:"Upload a government-issued ID below. Zeni AI reads the document and autofills your details automatically — no manual typing required.",aiCallout:{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:{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",body:"On every purchase. No annual fees, no foreign transaction fees, no complexity. Credit based on your financial health — no personal guarantee."},businessChecking:{value:"2.5% APY",body:"FDIC insured up to $3M through Thread Bank sweep network. Interest compounded daily. No minimums, unlimited accounts."},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:{body:"Free domestic transfers, free USD international wires, $0 ACH fees. AI auto-fills invoice details and handles all journal entries automatically."},reimbursements:{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",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."},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"},chrome:{skipLabel:"Skip for now",skipToDashboardDisabledTooltip:"Connect QuickBooks to activate your dashboard",skipToDashboardPendingVerificationTooltip:"Verify your bank account to activate your dashboard",skipToDashboardLoginRequiredTooltip:"Re-login to your bank account to activate your dashboard"},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:{ctaLabel:"Continue to activation",pageSubtitle:"Required foundation for both AI Agents"},officerVerifyPage:{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:{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"},qbo_connection:{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",requiredText:"Please connect Quickbooks to sync your financial data",errorText:"Unable to connect quickbooks. Please try again."},company_officer:{subTitle:"Enter proof of identity to complete verification."},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.'}},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:{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:{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"}},footer:"All of this happens automatically, every day."},cfoCard:{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:{accountingSettings:{heading:"Account Settings",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:{subTitle:"Track and categorize transactions by project. Turning this off hides project fields and columns across the workspace."}},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:{subTitle:"Select the account used to track charges while using Zeni Bill Pay",bankChargesAndFeesLabel:"Bank Charges & Fees Account:",billPayExpenseAccount:"Bill Pay Expense Account"},reimbursementsSection:{subTitle:"Select the account used to track charges while using Zeni Reimbursements",mileageLabel:"Mileage Account:",reimbursementsExpenseAccount:"Mileage Expense Account"},vendorSection:{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:{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",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",accountPlaceholders:"Select accounts",categoryPlaceholder:"Select Category",boxPlaceholder:"Select box"},tooltip:'The "__account__" recommendation is __based__',noOptions:{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.",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."},maybeLaterButton:"Maybe Later",thresholdPlaceholder:"Enter threshold amount",helpText:"You can always update this later in Settings > Accounting."},globalControls:{title:"Global Threshold Controls",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."}},accountsTable:{subtitle:"Capitalizable Accounts",overrideBanner:"All accounts using user-set threshold: __value__",headers:{threshold:"Threshold",matchStrength:"Match Strength",effectiveThreshold:"Effective Threshold",learnedThreshold:"Learned Threshold",userOverride:"User Override"},classification:{prepaid:"Prepaid"},matchPattern:{LABEL:"Strong",TYPE_ONLY:"Weak"},sourceBadge:{override:"Override",learned:"Learned"},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."}},defaultCurrencySymbol:"$"}},jeSchedules:{scheduleList:{defaultDownloadFileName:"__tenant__ Schedules.xlsx",tableHeaders:{balanceAsOfToday:"Balance as of today",endMonth:"End Month",expenseCategory:"Expense Category",assetId:"Asset ID"},noData:"No Schedules Found",heading:{expenseSchedules:"Expense Schedules",searchPlaceholder:"Search Schedules"},getSchedules:{selectSchedule:"Select Schedule:",getSchedules:"Get Schedules"},scheduleStatus:{draft:"Draft"}},scheduleDetails:{jeSchedule:"JE Schedule",showTransactionTooltip:"Show Transaction",scheduleTransactionsHeader:{vendorName:"Vendor Name",expenseCategory:"Expense Category:"},sequenceSchedule:{header:"Schedule Sequence",notCreated:"Once details are entered, the schedule sequence will be displayed here.",sequenceHeaders:{runningBalance:"Running Balance (as of today)",jeLink:""},accruedSequenceHeader:{jePostingDate:"Accrual Posting Date",runningBalance:"Accrual Balance",jeLink:""},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",accumulatedDepreciationCategory:"Accumulated Depreciation Category:",accumulatedDepreciationCategoryPlaceholder:"Select accumulated depreciation category",assetId:"Asset ID:",assetIdPlaceholder:"Add asset ID",postingDate:"Posting Date:",postingDatePlaceholder:"Select posting date",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",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"},labels:{estimatedMonthlyAmount:"Estimated Monthly Amount:",accruedExpenseCategory:"Accrued Expense Category:",startingBalance:"Starting Balance:"},placeholders:{selectVendor:"Search and select vendor",addBalance:"Add Balance",selectAccruedExpenseCat:"Select accrued expense category"}},linkBillExpenseDetails:{tableHeaders:{transactionAttachment:""},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"},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:{searchPlaceholder:"Search vendor",viewRecipts:"View receipts",vendorDropdown:{recommendedCustomer:"Recommended Customer",allCustomers:"AllCustomers",fromOldName:'Change name from "__old_name__"',toNewName:' to "__new_name__"'},invoice:"invoice",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.
357
- `,redirectToQBO:"Redirect to QBO",mergeInQBOSteppedContent:{step1:{navigateTo:"Navigate to ",andSelectThe:" and Select the ",tab:" tab."},step2:{lineText:"Find and open the vendor profile you want to keep. Then Select ",andCopy:" and copy",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 "},step2:{click:"Click ",next:" next to the ",sourceInfo:" that will be the source "},step3:{onThe:"On the ",page:" page, under ",click:", click "},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 ",text:" . At the prompt to confirm the action, click "},step7:{onThe:"On the ",duplicateResolution:"Duplicate Resolution Status",text:" page, the merge is queued for process. "},step8:{click:"Click ",processText:" to process the merge or the ",haltText:" link to halt the merge process. "},step9:{the:"The ",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:{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 comment",unResolveComment:"reopened a comment",newActivity:"performed new activity on your message",newRepliesAdded:"replied to a comment",newCommentAdded:"added a comment"},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",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:{placeholder:{replyAComment:"Reply to comment...",addANewComment:"Add a new comment..."},tooltip:{resolveComment:"Resolve comment",unResolveComment:"Re-open comment"}}},expenseAutomation:{common:{numbers:{maximumCount:999}},overview:{confidenceScoreDescription:"Higher score means you're close to finish.",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.",byHumans:"by Humans",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:{month_end_insights:"Month end insights"},transactions:{header:{memoReceipt:"Memo | Receipt",receipt:"Receipt",toFrom:"To/From"},searchPlaceholder:"Search by vendor, amount, date, or memo",tabs:{autoCategorized:"Auto-categorized"},transactionGroupFilter:{transactionGroupLabel:"Transaction Group"},subTitles:{review:{item1:{pre:"",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:"",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"},amountOperators:{isEqual:"Is equal",inBetween:"In between",placeholder:"Select operator"},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"},addProject:"Add Project",transactionActivityLog:{noLogsFound:"No Activity logs found",transactionIngested:"Transaction ingested.",aiBookkeeperAdded:"AI Bookkeeper added the",userUpdatedDetails:"Updated the transaction details.",linePrefix:"Line #"},transferDrawer:{debitAccountLabel:"Debit Account:",creditAccountLabel:"Credit Account:",keepExpense:"Keep {transactionType}",convert:"Convert",convertToTransfer:"Convert {transactionType} to Transfer",convertToCreditCard:"Convert {transactionType} to Credit Card Payment",transferDrawerSubtitle:"The current {transactionType} will be deleted and replaced with a transfer entry",creditCardPaymentDrawerSubtitle:"The current {transactionType} will be deleted and replaced with a credit card payment entry",groupHeadingAllAccounts:"All Accounts",noEligibleAccountsDropdownLine2:"Connect an account or keep this as an expense."},transactionTypeDropdown:{multilineNotEligibleTooltip:"Multiline transactions are not eligible for transfer entry."}},jeSchedules:{subTitles:{item1:{pre:"",bold:"",prefixIconName:"",post:"Please review the following journal entries below and correct or post them."},item2:{pre:"",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:{period:"Amortization Period",balance:"Running balance (as of today)",months:"Remaining Months",amountForMonth:"Amount(for this month)",entry:"Entry",monthlyAmount:"Monthly Amount",reversesOn:"Reverses on",reversesOnMatch:"Reverses on match",scheduledAndPosted:"Scheduled + Posted",startMonth:"Start Month",amount:"Amount",memo:"Memo"},scheduleCot:{recommendedMethod:"Recommended method",monthLifeSuffix:"-mo life",methodByType:{prepaid_expenses:"Straight-line amortization",fixed_assets:"Straight-line depreciation",accrued_expenses:"Accrual",deferred_revenue:"Straight-line recognition"},credit:"Credit",debit:"Debit"},oneTimeAccrualType:"Accrual",lifecycleLabel:{prepaid_expenses:"Prepaid Schedule",fixed_assets:"Fixed Asset Schedule",accrued_expenses:"Accrued Schedule",deferred_revenue:"Deferred Revenue Schedule"},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.'},resolveErrors:{heading:"This entry could not be posted",vendor_deleted:'Vendor "_deleted_field_" was deleted. Update it in Review.',debit_category_deleted:'Category "_deleted_field_" was deleted. Update it in Review.',credit_category_deleted:'Accumulated depreciation category "_deleted_field_" was deleted. Update it in Review.',qbo_error:"QuickBooks rejected this entry. Try posting again.",qbo_authorization_error:"The QuickBooks connection expired. Reconnect it, then post again.",qbo_invalid_company_status_error:"The QuickBooks subscription is inactive. Resolve it, then post again.",qbo_book_close_date_error:"The books are closed for this date. Reopen the period or move the date."},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!",kpiStrip:{aiAccountant:"AI Accountant Created",manual:"Manual Created",schedules:"schedules",total:"Total this close",typeLabels:{fixed_assets:"Fixed Asset",prepaid_expenses:"Prepaid",accrued_expenses:"Accrual",deferred_revenue:"Revenue Accrual"}},typeFilter:{prepaid_expenses:"Prepaid",fixed_assets:"Fixed Asset",accrued_expenses:"Accrual",deferred_revenue:"Deferred Revenue",all:"All"},groups:{createdInsight:"Auto-posted or manually recorded",failedPostings:"Failed Postings",pendingReviewInsight:"Input requested before posting"},tabs:{schedules:"Review Schedules",actualMatching:"Actual Matching",existingSchedules:"Existing Schedules"},actualMatching:{matchNew:"Match new",undoReversal:"Undo reversal",continueMatch:"Continue match",openBill:"Open bill",openCharge:"Open charge",openTransaction:"Open {type}",kpi:{actualsReceived:"Actuals received ({month})",ofExpected:"of {count} expected",vendorsStillPending:"{count} vendors still pending",vendorStillPending:"1 vendor still pending",autoReversed:"Auto-reversed",cleared:"{amount} cleared",pendingReview:"Pending review",estMinutesToClear:"Est. {minutes} min to clear",variance:"Variance (actual vs accrued)",varianceFooter:"avg {percent} per match · {amount} net"},groups:{reversed:"REVERSED"},groupSubtitles:{reversed:"AI Accountant and Human User · {amount}",pendingReview:"Variance above threshold or ambiguous match · {amount}"},columns:{received:"Received",vendor:"Vendor",type:"Type",service:"Service",reverses:"Reverses",matchTier:"Match tier",reversedBy:"Reversed by",accrued:"Accrued",actual:"Actual",variance:"Variance"},reversedBy:{aiAccountant:"AI Accountant",humanUser:"Human User"},matchTier:{exact:"Exact match",fuzzy:"Fuzzy",aiAccountant:"AI Accountant",manual:"Manual"},reversesCount:"{count} accruals",groupedOpenAccrual:"Open accrual",groupedMenuAria:"Accruals in this match",lifecycle:{pendingReview:"PENDING REVIEW",autoReversed:"AUTO-REVERSED"},emptyState:{title:"No matches this close",subTitle:"Reversed and pending-review accruals for this close will show up here."},matchModal:{title:"Match transactions to accruals",subtitle:"Select one bill or expense line and one or more posted accruals to reverse.",leftTitle:"Transactions",rightTitle:"Accruals",selectedLabel:"selected",leftSearchPlaceholder:"Search bills, expenses, and checks",rightSearchPlaceholder:"Search posted accruals",emptyLeft:"No transactions found",emptyRight:"No posted accruals found",confirm:"Confirm Match",maxAccruals:"You can match up to 50 accruals at once.",conflict:"Could not reverse this accrual",vendorLock:"Only accruals for the selected vendor can be matched.",selectLineHint:"Select a line on this bill",previewEmpty:"Pick at least one transaction and one accrual to preview the match.",accrualJeTitle:"Accrual journal entry being reversed",reversalJeTitle:"Reversal journal entry",reversalJeNote:"One per accrual · mirrors its amount",transactionMatchedTitle:"Transaction matched",columnDate:"Date",columnAccount:"Account",columnDebit:"Debit",columnCredit:"Credit",lastDayOfMonth:"last day",reversesLabel:"_REV Reverses",vsAccrued:"vs. accrued {amount} · variance posts to {account}",accruedExpensesFallback:"Accrued Expenses"},matchDetail:{service:"service",accrued:"Accrued",actual:"Actual",variance:"Variance",accrualJes:"Accrual journal entries",leftovers:"Not reversed",reversalFailed:"Reversal failed",undoFailed:"Undo failed",loadErrorTitle:"Couldn't load this match",loadErrorSubTitle:"Refresh to try again.",reversalJe:"Reversal journal entry",matchedBill:"Matched bill",matchedCharge:"Matched charge",matchedTransaction:"Matched {type}",statusAutoReversed:"Auto-reversed",statusPendingReview:"Pending review",statusManuallyReversed:"Manually reversed"}},newSchedule:{title:"New Schedule",oneTimeAccrualTitle:"New one-time accrual",oneTimeAccrualSubtitle:"Posts directly to the books",recurringTitle:"New recurring schedule",recurringSubtitle:"Posts monthly entries starting {month}",reviewSchedule:"Review schedule",scheduleDetails:{title:"Schedule Details",oneTimeAccrual:"One time accrual",oneTimeAccrualDescription:"Single JE this month",recurringSchedule:"Recurring Schedule"},scheduleType:{title:"Schedule type",subtitle:"What is this schedule spreading?",fixedAssetDescription:"Depreciate a purchase",prepaid:"Prepaid",prepaidDescription:"Amortize a prepayment",accrual:"Accrual",accrualDescription:"Recurring estimate",deferredRevenueDescription:"Recognize over time",deferredRevenue:"Deferred Revenue",fixedAsset:"Fixed Asset"},baseTransaction:{title:"Base Transaction",subtitleFixedAsset:"The purchase being capitalized",subtitlePrepaid:"The prepayment being spread",searchPlaceholder:"Search by vendor, amount, date and memo",noResults:"Nothing matched your search... Try again.",aiAccountantInsight:"AI Accountant spreads {amount} over {months} months ≈ {amountPerMonth}/mo."},fields:{numberOfMonths:"No. of Month",amountPerMonth:"Amount Per Month",sourceOrTrigger:"Source / trigger",addVendor:"Add vendor",selectStartMonth:"Select start month",selectPostingDate:"Select posting date",selectMonths:"Select months",addAccumulatedDepreciationCategory:"Add accumulated depreciation category",addAssetId:"Add asset ID",addSourceOrTrigger:"Add Source / trigger",selectServiceMonth:"Select service month",accrualCategory:"Accrual Category",addAccrualCategory:"Add accrual category",memoPrefix:"Accrue",estimatedMonthlyAmount:"Estimated Monthly Amount",startingBalance:"Starting Balance",addStartingBalance:"Add balance",accumulatedDepreciationCategory:"Accumulated Depreciation Category",serviceMonth:"Service month",postingDate:"Posting Date",addCategory:"Add category",startMonth:"Start Month",addAmount:"Add amount",category:"Category",addClass:"Add class",assetId:"Asset ID",addMemo:"Add memo",vendor:"Vendor",amount:"Amount",class:"Class",memo:"Memo"},oneTimeAccrual:{postAccrual:"Post accrual",reverseNextMonth:"Reverse next month",reverseNextMonthOff:"Off — accrual stays open until a matching bill arrives from this vendor and clears it.",reverseNextMonthOn:"A reversing JE will post on {date} automatically — use this when no matching bill is expected (e.g., estimated bonus, true-up).",reverseNextMonthOnNoServiceMonth:"A reversing JE will post on the 1st of the month after the service month automatically — use this when no matching bill is expected (e.g., estimated bonus, true-up)."},journalEntryPreview:{title:"Journal Entry Preview",debit:"DR",credit:"CR",autoReversesOnBillMatch:"Auto-reverses when a matching bill arrives from {vendor}.",autoReversesOnDate:"Auto-reverses on {date}."},schedulePreview:{title:"Schedule preview",posts:"Posts",postsValue:"{amount} × {months} months",window:"Window",windowValue:"{start} → {end}",totalCommitted:"Total committed",eachEntry:"Each entry",eachEntryValue:"DR {debit} · CR {credit}",autoPostSuffix:" will auto-post each month until the schedule completes.",autoPostPrefix:"AI Accountant",class:"Class"},newButtonLabel:"New"},accrualDetail:{accrualTypeMonthly:"Monthly Accrual",estimatedBy:"Estimated by",editAmount:"Edit amount",statusLabels:{draft:"Pending Review",posting:"Posting",posted:"Posted",posting_blocked:"Posting Blocked",reversing:"Reversing",reversed:"Reversed",reverted:"Reverted"},details:{title:"Accrual Details",servicePeriod:"Service Period",servicePeriodValue:"{month} Service",accrualType:"Accrual Type",liabilityAccount:"Liability Account",autoReversal:"Auto Reversal",reverseNextMonthOption:"Reverse Next Month",onInvoiceMatch:"On Invoice Match",onDate:"On {date}",monthsOfHistoryUsed:"Months of History Used",monthsValue:"{months} months",expenseCategory:"Expense Category",postingDate:"Posting Date",department:"Department",memo:"Memo"},calculationBreakdown:{title:"Calculation Breakdown",calculationMethod:"Calculation Method",weight:"Weight",weightedValue:"Weighted Value",recommendedAccrual:"Recommended Accrual",invoiceAmount:"Invoice Amount",month:"Month"},journalEntryPreview:{title:"Journal Entry Preview",postedTitle:"Posted Journal Entry",reversedTitle:"Reversed Journal Entry",autoReversalEnabled:"Enabled"},billingPattern:{title:"Billing Pattern",avgAmount:"Avg Amount",lastBill:"Last Bill",consistency:"Consistency",billingLag:"Billing lag",monthsTracked:"Months Tracked",percentValue:"{percent}%",serviceMonthMarker:"This service month",noHistoryTitle:"No vendor billing history",noHistoryDescription:"This accrual was entered manually, so there is no vendor profile behind it to chart. The AI Accountant builds one only for the vendors it accrues automatically.",daysValue:"{days} days"},actions:{skipThisMonth:"Skip This Month",approveAndPost:"Approve & Post"},statusStates:{reversed:"Entry reversed"},feedback:{title:"Why skip this accrual?",subtitle:"Tell us why {amount} shouldn't be accrued for {vendor} this month — AI Accountant learns from this.",reasons:{no_activity:"No activity this month",paused:"Vendor paused / off-boarded",too_small:"Not material",need_invoice:"Wait for actual invoice",other_ignore:"Something else"},revert:{title:"Why revert this accrual?",subtitle:"This deletes the {amount} journal entry for {vendor} from the books. AI Accountant learns from the reason.",submit:"Revert Accrual",reasons:{amount_off:"Amount was wrong",wrong_period:"Wrong period",not_accrual:"Shouldn't be accrued",duplicate:"Duplicate",other_revert:"Something else"}},ignoreSchedule:{title:"Why ignore this schedule?",subtitle:"Tell us why this schedule isn't needed — AI Accountant learns from this.",submit:"Ignore Schedule",reasons:{not_needed:"Not needed",wrong_account:"Wrong account",duplicate:"Duplicate",already_handled:"Already handled",other_ignore:"Something else"}},revertSchedule:{title:"Why revert this schedule?",subtitle:"This deletes the posted journal entry from the books and removes the schedule. AI Accountant learns from the reason.",submit:"Revert Schedule",reasons:{amount_off:"Amount was wrong",wrong_period:"Wrong period",duplicate:"Duplicate",created_by_mistake:"Created by mistake",other_revert:"Something else"}},noteLabel:"Add a note (optional)",notePlaceholder:"Anything else we should know?",submit:"Submit Feedback"}},existingSchedules:{downloadCompletedSchedules:"Download Completed Schedules",downloadRange:{title:"Download Completed Schedules",subtitle:"Completed schedules are matched on when they started, not when they finished, so search from before the schedules you are looking for began.",fromLabel:"Started on or after",fromPlaceholder:"Select a month",throughToday:"Includes everything up to today, {today}"},kpi:{ongoingSchedules:"Ongoing schedules",monthlyPosting:"Monthly posting",remainingBalance:"Remaining Balance",toDepreciateAmortize:"to depreciate / amortize",posted:"Posted",typeAbbreviations:{fixed_assets:"Fixed",prepaid_expenses:"Prepaid",deferred_revenue:"Deferred rev",accrued_expenses:"Accrued"}}},searchPlaceholder:"Search for schedules",addCategory:"Add Category"},missingReceipts:{searchPlaceholder:"Search for transactions",subTitles:{pre:"",preLink:"",post:"will do the best to automatically match receipts with the correct transactions. Forward all receipts to {receiptsEmail}",postLink:"{receiptsEmail}"},allDoneText:{subTitle:"All receipts uploaded, like magic!"}},fluxAnalysis:{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",post:"will learn from it."}},sectionTitle:{generalExpense:"General Expenses"},reviewedBy:"Reviewed by",remarksBy:"Remarks by",viewVendorDetails:"View Vendor Details",emptyPageTexts:{youDidIt:"You did it!",allReviewed:"All flux reviewed!"},stepsBanner:{collapsedTitle:"Quick steps for Flux Analysis",step1:{title:"Review Variances",description:"Compare vendor-wise spend across months and drill down into categories and classes."},step2:{descriptionPrefix:"Once variances are confirmed,",descriptionSuffix:"select vendors and mark as reviewed."}}},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",matchProgress:"AI Progress",lastReconciled:"Last Reconciled",excludedAccountTitle:"Excluded Accounts"},matchProgressLegend:{byHuman:"by human"},progressBar:{byHumans:"by humans"},stepsBanner:{collapsedTitle:"Quick steps for Bank Reconciliation",step1:{title:"Connect Bank Account",line1AfterIcon:"to add a bank account or",line2:"upload a bank statement."},step2:{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"},statsCards:{autoMatched:"AI Accountant Auto-matched",needsReview:"Needs Review",accountsDone:"Accounts Reconciled",timeSavedByAi:"Time saved by AI Accountant",ofTotalTxn:"of _total_ transactions",acrossAccounts:"across _count_ accounts",ofTotalAccounts:"of _total_ Accounts",hrsSuffix:"hrs"},connectAccountsBanner:{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",reconcileViaQBO:"Reconcile via QBO",balanceSyncInProgress:"Balance sync",statementSyncInProgress:"Statement sync",autoReconInProgress:"Auto-reconciliation",statementParseError:"Statement parse",statementValidationFailed:"Statement validation",statementProcessingFailed:"Statement processing",failed:"failed",isInProgress:"is in progress",booksClosedTooltip:"Books closed. Reopen to reconcile again."},tooltips:{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"}},drawer:{uploadDropZoneSuffix:"your statement",uploadDropZoneSupportingText:{single_account:"Upload a statement for a single account.",multi_account:"Upload a statement containing multiple accounts."},statementAccountScopeOptions:{single_account:"Single Account",multi_account:"Multiple Accounts"},labels:{lastUpdated:"Last Updated:",lastSync:"Last Sync:"},values:{bank:"Bank",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"},fileValidationFailed:{heading:"File Validation failed",description:"We couldn't process your statement. Please check the file and try uploading again."},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}`},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."}}},statementProcessing:{steps:["Uploaded file","Reading document structure","Identifying statement type","Extracting account details","Determining opening & closing balances","Verifying statement details","Gathering transactions","Finalizing Reconciliation"],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:"Taking longer than expected...",actionNeeded:"Action needed",continueInBackground:"Continue in Background",accountMapping:{headerSubtitle:e=>`Almost done — assign each of the ${e} cards to a ledger account to finish.`,headerSubtitleAccounts:e=>`Almost done — assign each of the ${e} accounts to a ledger account to finish.`,banner:(e,t)=>`I've extracted all charges from this combined ${e} statement — it covers ${t} cards. Assign each card to a ledger account to file everything. You won't need to upload this file again.`,bannerAccounts:(e,t)=>`I've extracted all charges from this combined ${e} statement — it covers ${t} accounts. Assign each account to a ledger account to file everything. You won't need to upload this file again.`,aiMatched:"AI matched",ledgerAccountLabel:"Ledger account",ledgerAccountPlaceholder:"Select ledger account",overrideWarning:"This account has an ongoing reconciliation. Selecting it will override the existing work.",transactionSummary:(e,t)=>`${e} transactions • ${t} in new charges`,deleteRowAriaLabel:"Remove card mapping",deleteConfirmation:{heading:"Remove this card?",headingAccount:"Remove this account?",description:"The transactions from this card will be excluded from this combined statement, you can still map the remaining cards.",descriptionAccount:"The transactions from this account will be excluded from this combined statement, you can still map the remaining accounts."}},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.",continueParsing:"Continue Parsing"}},statementParseInfo:{statementPeriodAndBalances:"Statement period & balances",statementValuesFootnote:"These values are copied directly from the statement.",from:"From:",to:"To:",credits:"Deposits",calculatedValues:"Calculated values",calculatedValuesFootnote:"These values are calculated from transactions in the statement.",extractedTransactions:"Extracted transactions",addTransaction:"Add transaction",totalsDoNotAddUp:"The totals do not add up.",reparseStatement:"Re-parse statement",retryParsing:"Retry Parsing",cancelConfirmation:{heading:"Are you sure?",description:"You have unsaved changes. If you cancel now, your changes will be lost"},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"},closingBalanceMismatchConfirmation:{heading:"Closing balance doesn’t match",descriptionBeforeStatementAmount:"The closing balance on your statement is ",forAccountDescriptionBeforeStatementAmount:"For {accountName}, the closing balance on your statement is ",descriptionBetweenAmounts:", but the transactions you’ve added total ",reviewHint:"Please review the transactions and add, remove, or edit any that are incorrect.",reviewTransactions:"Review transactions",continueAnyway:"Continue anyway",descriptionAfterTransactionsAmount:"."},aiSummary:{accountRecognized:"Account recognized",transactionsExtracted:"Transactions extracted",exceptionsDetected:"Exceptions detected",fieldsCaptured:"Fields captured",validated:"Validated",openingDate:"Opening date"}},tabs:{},review:{allDoneText:{title:"High five!",subTitle:"All transactions reviewed!"},header:{match:"Record or Match",amount:"Amount",memo:"Memo"},transactionDirection:{credit:"Credit",debit:"Debit"},matchesCount:"__count__ Matches",matchedFoundCount:"__count__ Matches Found",matchesFoundFullInfo:"for this bank transaction within the last 90 days",bankDetail:"Bank Detail",creditCardDetail:"Credit Card Detail",formLabels:{match:"Match",categorize:"Categorize",selectCard:"Select Card",allBankAccounts:"All bank accounts",allCreditCards:"All credit cards",addCategory:"Add Category",addClass:"Add Class",addMemo:"Add Memo"}},reconcile:{allDoneText:{title:"Ta-da!",subTitle:"No transactions found for reconciliation!"},header:{clearedDate:"Cleared Date",amount:"Amount",memo:"Memo"}},subTitles:{review:{item1:{pre:"",bold:"",prefixIconName:"",post:"Please review these transactions because the general ledger balance doesn't match the bank balance."},item2:{pre:"",post:"suggest updating these transactions to resolve the ledger discrepancies, which will help auto-adjust the variance."}},reconcile:{item1:{pre:"",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:"",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."}}},recommendationFeedback:{title:"Help me get this right next time.",skipLabel:"Skip Feedback",yourSelection:"Your Selection",reasonPlaceholder:'e.g. "Always put Amazon under Software Subscription, not Office Supplies"',submitHintPrefix:"Press ",submitHintKey:"Enter/Return",submitHintSuffix:" to submit",dimensionLabels:{vendor:"Payee Recommendation",category:"Category Recommendation",class:"Class Recommendation"}}},aiCfo:{pageView:{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."},routines:{title:"Scheduled Tasks",am:"am",pm:"pm",subtitle:"Work that runs on a schedule and emails you the answer. A saved skill, or a one-off you write here.",empty:"You don’t have any scheduled tasks yet.",loading:"Loading scheduled tasks…",loadFailed:"Couldn’t load scheduled tasks. Please try again.",newRoutine:"New scheduled task",capReached:"You’ve reached the limit of __max__ scheduled tasks. Delete one to add another.",everyDayAt:"Every day at __time__",everyWeekAt:"Every __weekday__ at __time__",everyMonthAt:"Every month on the __day__ at __time__",unknownSchedule:"On a schedule this app doesn’t recognise",weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ordinalSuffixes:{one:"st",two:"nd",few:"rd",other:"th"},unknownScheduleHint:"This scheduled task uses a schedule set up elsewhere. You can pause or delete it here, or contact support to change it.",inTimezone:"__schedule__ (__timezone__)",nextRun:"Next __date__",neverRun:"Hasn’t run yet",lastRunSucceeded:"Last run __date__",lastRunSucceededNoDate:"Last run succeeded",lastRunFailedNoDate:"Last run failed",lastRunTimeoutNoDate:"Last run timed out",lastRunFailed:"Last run failed __date__",lastRunTimeout:"Last run timed out __date__",pausedBadge:"Paused",autoPaused:"Paused after repeated failures",adHocBadge:"Prompt",brokenSkill:"The skill this ran was deleted",pause:"Pause",resume:"Resume",pauseRoutine:"Pause __name__",resumeRoutine:"Resume __name__",editRoutine:"Edit __name__",deleteRoutine:"Delete __name__",openThread:"Open conversation",run:"Run now",runRoutine:"Run __name__ now",running:"Running…",runQueued:"Started. The answer appears in the conversation, and is emailed when it finishes.",runFailed:"Couldn’t start this scheduled task. Please try again.",history:"History",hideHistory:"Hide history",historyLoading:"Loading runs…",historyFailed:"Couldn’t load this scheduled task’s runs.",historyEmpty:"No runs yet.",runManual:"Manual",runScheduled:"Automatic",runInFlight:"Running",runInProgressNotice:"Running — this usually takes 1–3 minutes. The answer appears here and is emailed when it finishes.",runSucceeded:"Succeeded",runFailedStatus:"Failed",runTimedOut:"Timed out",runUnknownStatus:"Unknown",runAt:"__date__ at __time__",runAttempt:"Attempt __n__",openRun:"Open",openRunLabel:"Open the conversation for the run on __date__",backToRoutines:"Scheduled Tasks",configuration:"Configuration",enabledLabel:"Status",enabledOn:"Active",enabledOff:"Paused",enabledOnHint:"Runs on its schedule.",enabledOffHint:"Paused — it will not run.",scheduleRow:"Schedule",oneOffSource:"A prompt you wrote",instructionsHeading:"Instructions",showAll:"Show all",showLess:"Show less",runsHeading:"History",successRatio:"__succeeded__ of the last __total__ succeeded",neverRunStatus:"Hasn’t run yet",openRoutine:"Open __name__",openRoutinePage:"Open scheduled task settings",breadcrumbRoot:"Scheduled Tasks",edit:"Edit",runRowLabel:"Run · __when__",newRuns:"__count__ new",scheduledSection:"SCHEDULED",cadenceDaily:"Daily",cadenceWeekly:"Weekly",cadenceMonthly:"Monthly",cadenceCustom:"Custom",showRuns:"Show runs",hideRuns:"Hide runs",panelRuns:"Runs",panelDetails:"Details",panelSkill:"Skill",composerPlaceholder:"What do you want on a schedule?",composerSubmit:"Draft scheduled task",composerExamples:["Summarise last week’s spend and flag anything unusual","Send me the cash position every Monday morning","List invoices over 60 days past due"],deleteConfirm:"Delete scheduled task",deleteConfirmBody:"It stops running and stops emailing you. The skill it runs is not affected.",deleting:"Deleting…",deleteFailed:"Couldn’t delete this scheduled task. Please try again.",saveFailed:"Couldn’t save this scheduled task. Please try again.",nameLabel:"Name",namePlaceholder:"Monday spend review",sourceLabel:"What it runs",sourceSkill:"A saved skill",sourcePrompt:"Something I write here",promptPlaceholder:"Summarise last week’s spend and flag anything unusual.",promptHint:"Runs exactly as written, every time. It won’t appear in the / menu.",skillLabel:"Skill",skillHint:"Pinned to the version you pick, so editing the skill later won’t change what runs.",cadenceLabel:"How often",daily:"Every day",weekly:"Every week",monthly:"Every month",weekdayLabel:"Day of week",dayOfMonthLabel:"Day of month",dayOfMonthHint:"A month that’s too short runs on its last day instead.",hourLabel:"Hour",minuteLabel:"Minute",timeLabel:"At",scheduleLabel:"Schedule",runsSummary:"Runs __schedule__",timezoneLabel:"Timezone",timezonePlaceholder:"Search timezones…",timezoneHint:"The time above is in this timezone.",timezoneInvalid:"That isn’t a timezone we recognise.",skillPlaceholder:"Search skills…",skillUnknown:"Pick a skill from the list.",templateLabel:"Start from a skill",templatePlaceholder:"Optional — search skills…",templateHint:"Copies that skill’s instructions below, where you can edit them. The scheduled task then runs your edited copy, not the skill.",templateLoading:"Loading that skill’s instructions…",templateFailed:"Couldn’t load that skill’s instructions. You can still write your own.",skillInstructionsLabel:"What it will run",skillInstructionsLoading:"Loading…",skillInstructionsFailed:"Couldn’t load this skill’s instructions.",editACopy:"Edit a copy instead",editACopyHint:"Runs the skill as written. To change it for this scheduled task only, edit a copy.",noMatches:"No matches",deliveryNote:"The answer is emailed to you when it finishes.",save:"Save scheduled task",saving:"Saving…"},skills:{subtitle:"Ready-made analyses you can run in a new chat. Zeni's are available to everyone; yours are your company's own.",byZeni:"By Zeni",byTenant:"Your company",empty:"No skills are available yet.",emptyTenant:"Your company hasn’t added any skills yet.",loading:"Loading skills…",loadingPrompt:"Loading this skill’s instructions…",loadFailed:"Couldn’t load skills. Please try again.",detailLoadFailed:"Couldn’t load this skill. Please try again.",back:"All skills",backToSkill:"Back to skill",audienceCurrentPrivate:"Only you can use this skill.",audienceCurrentTenant:"Everyone at your company can use this skill.",publish:"Share with company",unpublish:"Make private",publishing:"Sharing…",unpublishing:"Making private…",publishFailed:"Couldn’t change who can use this. Please try again.",run:"Run skill",runHint:"Runs this skill in a new chat.",instructionsHeading:"What this skill tells the agent",tenantBadge:"Shared",lastUpdated:"Updated __date__",neverUpdated:"Not updated yet",newSkill:"New skill",fork:"Copy to my skills",forkHint:"Starts a new skill of your own from this one.",forkNameSeed:"__name__ copy",deleteConfirm:"Delete this skill?",deleteConfirmBody:"It stops appearing in the / menu for everyone who can run it. Its name becomes available again.",deleting:"Deleting…",deleteFailed:"Couldn’t delete this skill. Please try again.",namePlaceholder:"Cash burn summary",nameHint:"How people find this skill — the / command is set from this name when you save.",nameHandleHint:"Runs as /{handle} — type / then any part of the name.",audienceLabel:"Who can use this",audiencePrivate:"Only me",audiencePrivateHint:"Stays in your own / menu.",audienceTenant:"Everyone at my company",audienceTenantHint:"Appears in every colleague's / menu.",audiencePublishWarning:"Published skills run with the permissions of whoever uses them. Only publish a prompt you would be comfortable running as any colleague.",descriptionPlaceholder:"One line on what this skill does",descriptionHint:"Shown under the name in the / menu.",instructionsLabel:"Instructions",instructionsPlaceholder:"Tell the agent exactly what to do. Be specific about the period, the accounts and the format you want back.",instructionsHint:"The agent receives this verbatim. Written like a brief, not a search query.",charCount:"__count__ characters",create:"Create skill",creating:"Creating…",saveNewVersion:"Save new version",saveFailed:"Couldn’t save this skill. Please try again.",unsavedTitle:"Discard your changes?",unsavedBody:"This skill has edits that haven’t been saved.",keepEditing:"Keep editing",nameRequired:"A name is required.",instructionsRequired:"Instructions are required.",instructionsTooShort:"Instructions need at least __min__ characters.",renameWarning:"Renaming changes the / command. The old one stops working.",historyHeading:"Version history",historyLoading:"Loading history…",historyFailed:"Couldn’t load version history.",historyEmpty:"No earlier versions.",versionLabel:"Version __version__",restore:"Restore",restoreHint:"Brings this version’s instructions back as a new version. Nothing is overwritten.",restoreLoading:"Loading this version…",restoreFailed:"Couldn’t load that version. Please try again.",emptyTenantCta:"Write your first skill, or copy one of Zeni’s."},texts:{generating:"Generating...",artifactFallbackTitle:"Financial visualization",downloadArtifactImage:"Download chart as image",saveToSkill:"Save to Skill",savedToSkill:"Saved — run it with /{command}",saveToSkillFailed:"Couldn't save. Please try again.",createSkillCommandDescription:"Turn this conversation into a reusable skill",createSkillCommandExampleHint:"that compares vendor spend month over month",downloadTableFailed:"Couldn’t download the table. Please try again.",downloadTableTooLarge:"This table is too large to export. Try narrowing the question to a shorter period or fewer categories.",downloadArtifactImageFailed:"Couldn’t download the chart. Please try again.",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",createdCardsTableRecommendedLimitHeader:"Recommended Limit"},interactiveForm:{noMatches:"No matches",cardPolicy:{limits:{transactionLimitHelperText:"Maximum amount per single transaction",amountPlaceholder:"$0"}},cardsCreation:{step1Title:"Based on your last 3 months of spend, here are the cards. Review and confirm.",step1AddRowPlaceholder:"Add something else",step1ColumnAvgMonthlySpend:"Avg monthly spend",step2Title:"Who should these cards be assigned to? Suggested owners based on past spend.",step2Cta:"Create cards",cardTypeOptions:{virtual:{label:"Virtual card",description:"Issued instantly"}}}},chainOfThoughts:{reasoning:"Thinking"},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"},exports:{downloading:"Preparing download",errors:{expired:"This file is no longer available. Ask the question again to regenerate it.",generic:"Could not download the file. Please try again."}},input:{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."},placeholder:"Ask AI CFO a question and get clear answers.",placeholderWithSkills:"Ask a question, or type / to run a Skill.",placeholderWithSkillsAndUpload:"Ask a question, type / for Skills, or attach a file.",placeholderWithUpload:"Ask a question, or attach a file to analyze."},loading:{discoveryTips:{excelExport:"Tip: Ask for any analysis as an Excel file and I'll attach a download.",followUps:"Tip: Ask follow-up questions in the same chat — I keep the conversation's context.",skills:"Tip: Type / in the message box to run Skills like flux analysis and cash forecasts.",uploads:"Tip: Attach a CSV or spreadsheet and I'll analyze it alongside your books."}},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",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",aiCardsAgent:"AI Cards Agent",aiBillsAgent:"AI Bills Agent",aiExpenseAgent:"AI Expenses Agent",aiBankingAgent:"AI Banking Agent",aiAccountantAgent:"AI Accountant Agent",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:{table:{bookClose:"Book Close",accuracy:"Accuracy"},actions:{onboard:"Onboard",evaluate:"Evaluate",fullPipeline:"Full Pipeline",retrain:"Retrain",offboard:"Offboard",cancelOnboarding:"Cancel Onboarding"},jobTriggerDialog:{title:"Trigger Job",datesInstruction:"Please provide start and end dates.",singleDescription:"__companyName__. __datesInstruction__",singleDescriptionOffboard:"__companyName__ will be offboarded from AI Accountant."},drawer:{enrollmentDetails:"Enrollment Details",onboarded:"Onboarded",modelAccuracy:"Model Accuracy",noAccuracyData:"No accuracy data available",jobHistory:"Job History",loadingJobs:"Loading jobs...",noJobsFound:"No jobs found",operation:"Operation"},summary:{totalCustomers:"Total Customers",avgAccuracy:"Avg Accuracy"},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.",evaluateAllDialogDescription:"__count__ unonboarded customer(s) will be evaluated. Please provide start and end dates."}},cardsShutdown:{bannerDescription:"We're sunsetting Zeni Cards on {date} and partnering with Ramp as our recommended corporate cards provider. Here's what's changing, key dates, and how to apply.",bannerDescriptionWithoutDate:"We're sunsetting Zeni Cards and partnering with Ramp as our recommended corporate cards provider. Here's what's changing, key dates, and how to apply.",introBody:"We're sunsetting Zeni Cards on {date} as we focus on our core AI accounting and bookkeeping platform. To keep your financial operations running without interruption, we recommend Ramp as your corporate card provider.",introBodyWithoutDate:"We're sunsetting Zeni Cards as we focus on our core AI accounting and bookkeeping platform. To keep your financial operations running without interruption, we recommend Ramp as your corporate card provider.",programEnds:"Program ends {date}",applicationDisclaimer:"Ramp reviews each application independently. Approval, card limits, and implementation timing aren't guaranteed and depend on the information provided during the application.",whatThisMeansTitle:"What this means for you",meansProgramEnd:"Your current Zeni Card program is expected to end on {date}.",meansApplicationRequired:"Moving to Ramp is not automatic. Your business will need to complete a new Ramp application, and Ramp will conduct its standard business and identity review.",meansImplementation:"If approved, Zeni and Ramp will coordinate with you on card setup, policies, approvals, and implementation.",meansControllerSupport:"Your Zeni controller will remain available to help you understand the transition and next steps.",whatToDoNowTitle:"What to do now",watchForInvitationTitle:"Watch for your Ramp invitation",watchForInvitationBody:"Look out for an email from Ramp titled “You’ve been invited” to review and complete your pre-filled application.",loopInControllerTitle:"Loop in your Zeni controller",loopInControllerBody:"Share any card limits, approval rules, expense policies, or timing constraints during setup.",needHelpPrefix:"Need help? Reach us at ",needHelpSuffix:"."},invoicingOverview:{revenueMetricOverTime:"Revenue - {metric} Over Time",mrrMovement:"MRR Movement",mrrMovementNewSubscriptions:"New Subscriptions",mrrMovementExpansions:"Expansions",mrrMovementNewChange:"New MRR Change",customerMovement:"Customer Movement",customerMovementSubtitle:"All status transitions this month",netCustomerChange:"Net customer change",totalActiveCustomers:"Total active customers",customerChurnRate:"Customer churn rate",revenueByPlan:"Revenue by Plan",noPlanData:"No plan data available.",noRecentSubscriptions:"No recent subscriptions.",kpiActiveSubs:"Active Subs",metricChurnRate:"Churn Rate",tabRecentSubscriptions:"Recent Subscriptions",tabMonthlyMrrBreakdown:"Monthly MRR Breakdown",pillPaused:"Paused",pillResumed:"Resumed",pillReactivated:"Reactivated",alertFailedPayments:"Failed Payments",alertNeedsAction:"Needs action",alertUpcomingInvoices:"Upcoming Invoices",alertNext7Days:"Next 7 days",alertPastDueInvoices:"Past Due Invoices",nrrTitle:"Net Revenue Retention (NRR)",nrrSubtitle:"Trailing 12 months · benchmark for SaaS health",nrrFootnote:"NRR over 112% means existing customers are growing faster than they’re churning — typically a sign of strong product-market fit. Healthy SaaS benchmark is >100%.",grrTitle:"Gross Revenue Retention (GRR)",grrSubtitle:"Excludes expansion · pure retention signal",grrFootnote:"GRR caps at 100% — it strips out upsell to show how much revenue you’d retain without expansion. Best-in-class SaaS sits at 90%+. Below 80% signals a churn problem.",startingArr:"Starting ARR",expansionsArr:"Expansions ARR",contraction:"Contraction",churn:"Churn",endingArr:"Ending ARR",nrr:"NRR",retainedArr:"Retained ARR",grr:"GRR",summaryNewMrr:"New MRR",summaryExpansion:"Expansion",summaryChurnedMrr:"Churned MRR",summaryNetMrrChange:"Net MRR Change",summaryEndingMrr:"Ending MRR",colAutoCollect:"Auto Collect",autoCollectOn:"ON",autoCollectOff:"OFF",cadenceAnnual:"Annual",since:"Since"},invoicingCommon:{minimumQuantityAllowed:"Minimum 1 allowed",zipPlaceholder:"94105",usage:"Usage",pricing:"Pricing",subFamilyCode:"Price Point Code",productCode:"Product Code",columnTarget:"Target",labelBillingPeriod:"Billing Period",labelPricingModel:"Pricing Model",addOns:"Add-ons",oneTimeChargesTab:"One-time Charges",importCsvFile:"Import CSV File",pluralSuffix:"s",description:"Description",subFamilyId:"Price Point ID",itemDetails:"Item Details",name:"Name",externalName:"External Name",unit:"Unit",itemApplicability:"Item Applicability",applicableItems:"Applicable Items",timestamps:"Timestamps",updatedAt:"Updated At",addOn:"Add-on",coupons:"Coupons",oneTimeCharge:"One-time Charge",cancelSubscription:"Cancel Subscription",nameShownOnInvoices:"Name shown on invoices",placeholderPriceZero:"0.00",trialPeriod:"Trial Period",labelFreeQuantity:"Free Quantity",invoiceNotes:"Invoice Notes",invoiceName:"Invoice Name",placeholderAddInvoiceName:"Add invoice name",appendedToInvoiceLineItem:"Appended to invoice line item",addInvoiceNotes:"Add invoice notes",checkmark:"✓",yourCompany:"Your Company",thankYouForYourBusiness:"Thank you for your business.",onReceipt:"On receipt",net:"Net ",newSuffix:"—NEW",invoiceNumber:"Invoice #",poNumberLabel:"PO #",logoAlt:"Logo",taxIdLabel:"Tax ID: ",billedTo:"Billed To",amount2:"Amount (",paymentLinkNoItemizedInvoice:"Payment link — no itemized invoice",qtyLabel:"Qty: ",subtotal:"Subtotal",amountDue:"Amount Due (",signatureAlt:"Signature",currencySymbolEur:"€",currencySymbolGbp:"£",currencySymbolInr:"₹",createCoupon:"Create Coupon",couponDetails:"Coupon Details",couponId:"Coupon ID",couponCodeLabel:"Coupon Code",applyOn:"Apply On",discountType:"Discount Type",maxRedemptions:"Max Redemptions",validFrom:"Valid From",validTill:"Valid Till",dueOnReceipt:"Due on receipt",createInvoice:"Create Invoice",customerDetails:"Customer Details",billingFrequency:"Billing Frequency",openCustomerInNewTab:"Open customer in new tab",openSubscriptionInNewTab:"Open subscription in new tab",openInvoiceInNewTab:"Open invoice in new tab",allocated:"Allocated",refunded:"Refunded",referenceInvoice:"Reference Invoice",subTotal:"Sub Total",noLineItems:"No line items.",creditNote:"Credit Note",preparing:"Preparing…",bankAccountAch:"Bank Account (ACH)",connectViaPlaid:"Connect via Plaid — lower fees, 2–4 day settlement",loading:"Loading…",creditDebitCard:"Credit / Debit Card",cardMethodDescription:"Visa, Mastercard, Amex — instant settlement",cardSetupFailed:"Card setup failed.",failedToSaveCard:"Failed to save card.",expiry:"Expiry",saveCard:"Save Card",newSubscription:"New Subscription",outstanding:"Outstanding",namePlaceholder:"James Johnson",firstNamePlaceholder:"James",lastNamePlaceholder:"Johnson",emailPlaceholder:"billing@acme.com",phonePlaceholder:"(555) 000-0000",companyPlaceholder:"Acme Corp",billingDetails:"Billing Details",vatNumber:"VAT Number",vatNumberPlaceholder:"US-EIN-12-3456789",autoCollectionDescription:"Enabling this automatically charges the customer each billing cycle.",autoCollection:"Auto Collection",netTerms:"Net Terms",selectNetTerm:"Select net term",preferredCurrency:"Preferred Currency",taxability:"Taxability",selectTaxability:"Select taxability",invoiceNotesHint:"Default note to appear on invoices",invoiceNotesPlaceholder:"Default notes to appear on invoices…",addStreetAddress:"Add street address",floorSuiteOffice:"Floor/Suite/Office",city:"City",addCity:"Add city",state:"State",addState:"Add state",addCountry:"Add country",zipCode:"ZIP Code",yourVendor:"Your vendor",createCustomerLabel:"Create Customer",of:" of ",free:" free",code:"Code",redemptions:"Redemptions",slashSeparator:" / ",duration:"Duration",daysPastDue:"Days Past Due",nextRetry:"Next Retry",attempts:"Attempts",line1:"Line 1",line2:"Line 2",recordPayment:"Record Payment",arrowSeparator:" → ",shippingAddress:"Shipping Address",poNumber:"PO Number",poNumber2:"PO number",refunds:"Refunds",gateway:"Gateway",referenceNumber:"Reference Number",subscriptionDetails:"Subscription Details",addShippingAddressButton:"Add shipping address",addBusinessAddressButton:"Add business address",addPoNumber:"Add PO number",shipLine1Placeholder:"123 Main St",shipLine2Placeholder:"Suite 200",cityPlaceholder:"San Francisco",statePlaceholder:"CA",createSubscriptionLabel:"Create Subscription",cardStatus:"Card Status",creditNumber:"Credit Number",dateIssued:"Date Issued",creditedAgainst:"Credited Against",totalCredits:"Total Credits",daySuffix:"d",trial:"Trial",amount:"Amount",all:"All"},invoicingAuditLog:{timeColumnHeader:"Time",actorColumnHeader:"Actor",detailColumnHeader:"Detail",noAuditEntriesMatchSearch:"No audit entries match your search.",noAuditActivityYet:"No audit activity yet.",searchActionTargetActorPlaceholder:"Search action, target, or actor"},invoicingCatalog:{addOnsNoun:"add-ons",oneTimeChargesNoun:"one-time charges",plansNoun:"plans",itemsNoun:"items",addItem:"Add Item",addAddOn:"Add Add-on",addOneTimeCharge:"Add One-time Charge",periodSingular:"1 ${label}",periodPlural:"${period} ${label}s",productColumnHeader:"Product",itemTypeColumnHeader:"Item Type",activePlansKpi:"Active Plans",activeProductsKpi:"Active Products",avgPlanPriceKpi:"Avg Plan Price",noMatchSearch:"No ${tabNoun} match your search.",noItemsYet:"No ${tabNoun} yet.",emptyStateDescription:"Bring in your historical product catalog data by importing your product catalog csv file",emptyStateTitle:"No Product Catalog Yet",searchPlaceholder:"Search ${tabNoun}"},invoicingCatalogDetail:{oneSpace:"1 ",activeSubFamilies:"Active Price points",archivedSubFamilies:"Archived Price points",lowestActiveSubFamilyPrice:"Lowest Price Point Price",priceTiers:"Price / Tiers",catalogItemNotFound:"Catalog item not found.",itemNamePlaceholder:"Item name",externalNamePlaceholder:"External name",addDescriptionPlaceholder:"Add a description",lineItemDescription:"Line Item Description",itemFamily:"Item Family",restrictedPrefix:"Restricted (",itemsSuffix:" items)",subFamilies:"Price points",noSubFamilies:"No Price points.",archivedAt:"Archived At",archiveSubFamily:"Archive price point",archiveSubFamilyBlocked:"Cannot archive while subscriptions reference this price point.",duplicateSubFamily:"Duplicate price point",subscriptionsUseSubFamilyBanner:"{count} subscriptions use this price point. To change pricing, create a new price point."},invoicingCatalogForm:{trialUnitDay:"Day",periodUnitWeek:"Week",pricingModelFlatFee:"Flat fee",pricingModelPerUnit:"Per unit",pricingModelTiered:"Tiered",pricingModelVolume:"Volume",pricingModelStairstep:"Stairstep",tierTypePerUnit:"Per Unit",tierTypeFlatFee:"Flat Fee",tierTypePackage:"Package",trialEndActivateSubscription:"Activate Subscription",prorationPartialTerm:"Partial Term",prorationFullTerm:"Full Term",applicabilityAll:"All add-ons & charges",applicabilityRestricted:"Restricted — Select applicable items",applicableItemsEmptyPlaceholder:"No add-ons or charges available",selectApplicableItemsPlaceholder:"Select applicable items",validationProductFamilyRequired:"Enter a Product Family name for this catalog item.",validationSubFamilyNameRequired:"Add at least one price point and enter a name for each one.",titleEditCatalogItem:"Edit Catalog Item",titleCreatePlan:"Create Plan",titleCreateOneTimeCharge:"Create One-time Charge",titleCreateAddon:"Create Add-on",sectionPlanAndProductFamilyDetails:"Plan and Product Family Details",productCodeExample:"Optional. Generated from Product Family when left blank.",placeholderAddProductCode:"Add product code",customerFacingName:"Customer facing name",labelProductFamily:"Product Family",placeholderAddProductFamily:"Add product family",labelPricePointName:"Price point name",placeholderAddSubFamilyName:"e.g. Growth Monthly",subFamilyCodeExample:"Optional. Generated from the price point name when left blank.",placeholderAddSubFamilyCode:"Add price point code",forInternalUseOnly:"For internal use only",subFamilyDetailsTitle:"Price Points",pricePointsRequiredHint:"Add at least one price point to create this plan. Add more for different billing frequencies (e.g. monthly, annual) or currencies.",addNewLink:"Add another price point",subFamilyNumberPrefix:"Price Point",removeSubFamilyConfirmation:"Remove this price point?",labelSubFamily:"Price Point",placeholderAddSubFamily:"Add price point",labelAddTiers:"Add Tiers",tierColumnTo:"To (blank for unlimited)",tierColumnPackageSize:"Package size",infinity:"∞",removeTierX:"✕",addTierLink:"Add Tier",hintAddBillingPeriod:"Add billing period",placeholderTrialPeriodExample:"e.g. 14",labelTrialEndAction:"Trial End Action",hintBillingCyclesUnlimited:"Keep it blank for unlimited cycles",placeholderAddBillingCycles:"Add number of billing cycles",labelProrationType:"Proration Type",labelFlags:"Flags",selectFlagsPlaceholder:"Select flags",labelShowDescriptionInQuotes:"Show Description in Quotes",lineItemDescriptionHint:"Shown below the line-item name when invoice descriptions are enabled",subFamilyInvoiceNotesHint:"Shown in the invoice Notes section when this price point is billed",nameShownOnInvoiceLineItem:"Name shown on the invoice line item",sectionAccountingIntegration:"Accounting Integration",skuQboExample:"QBO Product code. Example: BASIC-M",labelSku:"SKU",placeholderAddSku:"Add SKU",placeholderAddAccountingCode:"Add accounting code",placeholderSelectIncomeAccount:"Select income account"},invoicingCouponForm:{enterCouponIdError:"Enter a Coupon ID.",enterCouponNameError:"Enter a name for this coupon.",editCouponTitle:"Edit Coupon",couponIdPlaceholder:"e.g. WELCOME20",namePlaceholder:"e.g. Welcome 20% Off",discountPercentagePlaceholder:"e.g. 20",discountPercentageLabel:"Discount Percentage",discountAmountLabel:"Discount Amount",freeQuantityPlaceholder:"e.g. 1",durationLimitsSectionTitle:"Duration & Limits",durationTypeLabel:"Duration Type",periodPlaceholder:"e.g. 3",periodUnitLabel:"Period Unit",maxRedemptionsPlaceholder:"Add max redemptions",discountsAccountLabel:"Discounts Account",discountsAccountPlaceholder:"Select income account"},invoicingCreateInvoice:{selectPaymentTerm:"Select payment term",net7:"Net 7",net15:"Net 15",net30:"Net 30",net45:"Net 45",net60:"Net 60",selectBillingFrequency:"Select billing frequency",halfYearly:"Half-yearly",annually:"Annually",addAtLeastOneLineItem:"Add at least one line item with a description and unit price.",step1CustomerAndType:"Step 1: Customer and Type",step2InvoiceDetails:"Step 2: Invoice Details",step1Subtitle:"How would you like to create an invoice? Select a customer and choose the invoice type.",step2Subtitle:"Set dates, line items, and additional details.",invoiceJpg:"Invoice.jpg",livePreviewSuffix:" - Live Preview",paymentLink:"Payment link",paymentLinkCalloutText:"A payment link will be generated and sent to the customer — no itemized invoice document is required.",chooseExistingCustomerHint:"Choose an existing customer or create one first",searchOrTypeCustomerName:"Search or type a customer name",pleaseSelectCustomer:"Please select a customer to continue.",invoiceType:"Invoice Type",selectAnInvoiceType:"Select an invoice type",oneTimeInvoiceDescription:"Send a one-time invoice with a built-in payment link.",oneTimeInvoiceTitle:"One-time Invoice",recurringSeriesDescription:"Automatically generate recurring invoices on a set schedule.",recurringSeriesTitle:"Recurring Series",paymentLinkOnlyDescription:"Send only a payment link with a single amount — No itemized invoice.",paymentLinkOnlyTitle:"Payment Link Only",general:"General",setInvoiceDatesHint:"Set the invoice dates and additional details.",selectInvoiceDate:"Select invoice date",paymentTerms:"Payment Terms",usdUsDollar:"USD — US Dollar",soNumber:"SO Number",addSoNumber:"Add SO number",exampleSoNumber:"Example: SO-2026-001",exampleMemo:"Example: thank you for your business",unitPriceLabel:"Unit Price (",useDescriptionAs:"Use description as",addQuantity:"Add quantity",addPrice:"Add price",removeLine:"Remove line",addLine:"Add Line",unitPriceInDollars:"Unit price in dollars"},invoicingCreditDetail:{allocatedAt:"Allocated At",creditNoteNotFound:"Credit note not found.",creditNoteTitlePrefix:"Credit Note ",creditNoteDetails:"Credit Note Details",creditNoteId:"Credit Note ID",creditNoteNumber:"Credit Note Number",priceType:"Price Type",amounts:"Amounts",amountAvailable:"Amount Available",amountAllocated:"Amount Allocated",amountRefunded:"Amount Refunded",allocations:"Allocations",noAllocations:"No allocations.",linkedRefunds:"Linked Refunds"},invoicingCreditList:{noCreditNotesMatchSearch:"No credit notes match your search.",noCreditNotesYet:"No credit notes yet.",createCreditNoteButton:"Create Credit Note",emptyStateDescription:"Bring in your historical credit note data by importing your credit note csv file",emptyStateTitle:"No Credit Notes Yet",searchPlaceholder:"Search by customer or credit note"},invoicingCustomerDetail:{paymentMethodSavedTitle:"Payment method saved",paymentMethodSavedDescription:"The payment method has been added and is now the default. Existing payment methods are kept, and future invoices can be collected automatically.",addPaymentMethod:"Add Payment Method",addPaymentMethodSubtitle:"Securely add a bank account or card to collect invoice payments.",connectStripeNotice:"Connect a Stripe account in Settings › Payment Destination before adding a payment method.",securedByStripeAndPlaid:"Secured by Stripe & Plaid.",countryAustralia:"Australia",countryCanada:"Canada",countryGermany:"Germany",countryFrance:"France",countryUnitedKingdom:"United Kingdom",countryIndia:"India",countryJapan:"Japan",countrySingapore:"Singapore",countryUnitedStates:"United States",netTermsDueImmediately:"Due immediately",createPromotionalCreditsSubtitle:"Add promotional credits to this customer&apos;s balance. Credits are applied automatically on the next invoice before tax.",currentPromotionalCreditsBalance:"Current balance",promotionalCreditAmountRequired:"Enter a positive amount.",promotionalCreditDescriptionRequired:"Description is required.",promotionalCreditDescriptionPlaceholder:"e.g. Welcome bonus",promotionalCreditsAddedTitle:"Promotional credits added",promotionalCreditsAddedDescription:"The customer's promotional credit balance has been updated.",customerSince:"Customer Since",sincePrefix:"Since ",lifetimeValue:"Lifetime Value",promotionalCredits:"Promotional Credits",refundableCredits:"Refundable Credits",excessPayments:"Excess Payments",unbilledCharges:"Unbilled Charges",maskedDigitsPrefix:"•••• ",maskedDigitsMiddle:" •••• ",expires:"Expires",customerNotFound:"Customer not found.",taxable:"taxable",netDashPrefix:"Net-",streetAddress:"Street Address",balances:"Balances",connectStripeTooltip:"Connect a Stripe account in Settings › Payment Destination first",paymentMethods:"Payment Methods",connectStripeBefore:"Connect your Stripe account in",settingsPaymentDestination:"Settings › Payment Destination",connectStripeAfter:"to add payment methods.",invoicePaymentDetails:"Invoice payment details:",customerEmailPlaceholder:"customer@email.com",emailPaymentLinkTooltip:"Email the customer a link to add their payment details",collectAchHint:"We will email the customer to provide their ACH details.",paymentLinkSentTo:"Payment link sent to ",copyPaymentLink:"Copy payment link",sendPaymentLinkFailed:"Failed to send payment link.",default:"Default",noPaymentMethodOnFile:"No payment method on file",previewEmailHeading:"Preview email",previewEmailSubtitle:"Edit the subject and message; the preview updates as you type.",previewEmailFrameTitle:"Rendered payment link email preview",previewEmailLoading:"Loading the branded email preview…",previewEmailUnavailable:"The email preview is unavailable right now. You can still send the payment link.",previewEmailFailed:"Could not load the email preview.",previewEmailRetry:"Retry",previewEmailSend:"Send email",previewEmailMessageLabel:"Message",previewEmailSubjectRequired:"Enter an email subject.",previewEmailBodyRequired:"Enter an email message.",sending:"Sending…",noSubscriptions:"No subscriptions.",recentInvoices:"Recent Invoices",noInvoices:"No invoices.",addNoteAboutCustomer:"Add a note about this customer"},invoicingCustomerForm:{validationEnterEmail:"Enter an email for this customer.",customerDetailsDescription:"Primary contact for billing and invoices",customerTypeLabel:"Customer Type",billingAddressSectionDescription:"Enter your company's official billing address for invoicing.",addSecondaryInfoPlaceholder:"Add secondary info (Optional)",addressSecondaryHint:"Example: Address on your driver&apos;s license",addBillingAddressButton:"Add billing address",billingSettingsDescription:"Tax IDs, currency, and payment defaults",billingSettingsTitle:"Billing Settings",customerTypeResidential:"Residential",netTermImmediate:"Immediate",taxabilityExempt:"Exempt"},invoicingCustomerList:{noCustomersMatchSearch:"No customers match your search.",noCustomersYet:"No customers yet.",importCustomersDescription:"Bring in your historical customers by importing your customers csv file",noCustomerYetTitle:"No Customer Yet"},invoicingDataImport:{inSync:"In Sync",skippedSuffix:" Skipped",warningsSuffix:" Warnings",newImport:"New Import",chargebeeImportFailed:"Chargebee import failed",chargebeeImportInProgress:"Chargebee import in progress",csvImportFailed:"CSV import failed",csvImportInProgress:"CSV import in progress",viewDetails:"View details",records:"records",bulletSeparator:" • ",lastImportReversible:"Last import is reversible",recordsBulletSeparator:"records • ",rollback:"Rollback",importedModules:"Imported Modules",module:"Module",recordsColumn:"Records",lastImported:"Last Imported",loadingImportStatus:"Loading import status…",noImportedRecords:"No imported records yet. Start a new import to populate this table.",templateProductCatalogPlans:"Product Catalog (Plans)",templateCouponsAndDiscounts:"Coupons & Discounts",chargebeeStepSettingsImportExport:"Chargebee → Settings → Import & Export → Export",chargebeeStepDetailModulesList:"Plans, add-ons, one-time charges, customers, subscriptions, invoices, credit notes",chargebeeStepDetailPickAllTime:'Pick "All time" range. CSV format. Default columns are fine.',chargebeeStepExportModule:"Export the module you want",chargebeeStepDropCsvFiles:"Drop the .CSV files above",capsuleIssuesSuffix:" Issues",capsuleReady:"Ready",scanningCaptionCsv:"Larger exports can take a few minutes — you can leave this page, it keeps running.",scanningCaptionChargebee:"This can take a moment for larger accounts — you can leave this page, it keeps running.",scanningLabelCsv:"Reading your uploaded files…",defaultImportErrorMessage:"Something went wrong during import.",backToDataImport:"Back to Data Import",migrateHeading:"Migrate from Chargebee → Zeni",migrateSubtitle:"Connect Chargebee or drop your CSV exports — we’ll handle the rest.",connectWithChargebee:"Connect with Chargebee",importFromChargebee:"Import from Chargebee",connectedToChargebee:"Connected to {site}",chargebeeConnectedLabel:"Connected to Chargebee",buttonFetchFromChargebee:"Fetch from Chargebee",chargebeeNotConnectedMessage:"Connect Chargebee in Invoicing Settings → Integrations to fetch data automatically.",buttonGoToIntegrations:"Connect Chargebee in Settings",connectPullEverything:"Pull everything automatically — fully linked, no CSV juggling.",connectingToChargebee:"Connecting to Chargebee…",fieldLabelChargebeeSite:"Chargebee site",sitePlaceholderAcme:"acme",fieldHintSiteSubdomain:`The subdomain in your Chargebee URL — e.g. acme in
357
+ `,redirectToQBO:"Redirect to QBO",mergeInQBOSteppedContent:{step1:{navigateTo:"Navigate to ",andSelectThe:" and Select the ",tab:" tab."},step2:{lineText:"Find and open the vendor profile you want to keep. Then Select ",andCopy:" and copy",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 "},step2:{click:"Click ",next:" next to the ",sourceInfo:" that will be the source "},step3:{onThe:"On the ",page:" page, under ",click:", click "},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 ",text:" . At the prompt to confirm the action, click "},step7:{onThe:"On the ",duplicateResolution:"Duplicate Resolution Status",text:" page, the merge is queued for process. "},step8:{click:"Click ",processText:" to process the merge or the ",haltText:" link to halt the merge process. "},step9:{the:"The ",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:{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 comment",unResolveComment:"reopened a comment",newActivity:"performed new activity on your message",newRepliesAdded:"replied to a comment",newCommentAdded:"added a comment"},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",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:{placeholder:{replyAComment:"Reply to comment...",addANewComment:"Add a new comment..."},tooltip:{resolveComment:"Resolve comment",unResolveComment:"Re-open comment"}}},expenseAutomation:{common:{numbers:{maximumCount:999}},overview:{confidenceScoreDescription:"Higher score means you're close to finish.",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.",byHumans:"by Humans",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:{month_end_insights:"Month end insights"},transactions:{header:{memoReceipt:"Memo | Receipt",receipt:"Receipt",toFrom:"To/From"},searchPlaceholder:"Search by vendor, amount, date, or memo",tabs:{autoCategorized:"Auto-categorized"},transactionGroupFilter:{transactionGroupLabel:"Transaction Group"},subTitles:{review:{item1:{pre:"",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:"",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"},amountOperators:{isEqual:"Is equal",inBetween:"In between",placeholder:"Select operator"},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"},addProject:"Add Project",transactionActivityLog:{noLogsFound:"No Activity logs found",transactionIngested:"Transaction ingested.",aiBookkeeperAdded:"AI Bookkeeper added the",userUpdatedDetails:"Updated the transaction details.",linePrefix:"Line #"},transferDrawer:{debitAccountLabel:"Debit Account:",creditAccountLabel:"Credit Account:",keepExpense:"Keep {transactionType}",convert:"Convert",convertToTransfer:"Convert {transactionType} to Transfer",convertToCreditCard:"Convert {transactionType} to Credit Card Payment",transferDrawerSubtitle:"The current {transactionType} will be deleted and replaced with a transfer entry",creditCardPaymentDrawerSubtitle:"The current {transactionType} will be deleted and replaced with a credit card payment entry",groupHeadingAllAccounts:"All Accounts",noEligibleAccountsDropdownLine2:"Connect an account or keep this as an expense."},transactionTypeDropdown:{multilineNotEligibleTooltip:"Multiline transactions are not eligible for transfer entry."}},jeSchedules:{subTitles:{item1:{pre:"",bold:"",prefixIconName:"",post:"Please review the following journal entries below and correct or post them."},item2:{pre:"",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:{period:"Amortization Period",balance:"Running balance (as of today)",months:"Remaining Months",amountForMonth:"Amount(for this month)",entry:"Entry",monthlyAmount:"Monthly Amount",reversesOn:"Reverses on",reversesOnMatch:"Reverses on match",scheduledAndPosted:"Scheduled + Posted",startMonth:"Start Month",amount:"Amount",memo:"Memo"},scheduleCot:{recommendedMethod:"Recommended method",monthLifeSuffix:"-mo life",methodByType:{prepaid_expenses:"Straight-line amortization",fixed_assets:"Straight-line depreciation",accrued_expenses:"Accrual",deferred_revenue:"Straight-line recognition"},credit:"Credit",debit:"Debit"},oneTimeAccrualType:"Accrual",lifecycleLabel:{prepaid_expenses:"Prepaid Schedule",fixed_assets:"Fixed Asset Schedule",accrued_expenses:"Accrued Schedule",deferred_revenue:"Deferred Revenue Schedule"},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.'},resolveErrors:{heading:"This entry could not be posted",vendor_deleted:'Vendor "_deleted_field_" was deleted. Update it in Review.',debit_category_deleted:'Category "_deleted_field_" was deleted. Update it in Review.',credit_category_deleted:'Accumulated depreciation category "_deleted_field_" was deleted. Update it in Review.',qbo_error:"QuickBooks rejected this entry. Try posting again.",qbo_authorization_error:"The QuickBooks connection expired. Reconnect it, then post again.",qbo_invalid_company_status_error:"The QuickBooks subscription is inactive. Resolve it, then post again.",qbo_book_close_date_error:"The books are closed for this date. Reopen the period or move the date."},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!",kpiStrip:{aiAccountant:"AI Accountant Created",manual:"Manual Created",schedules:"schedules",total:"Total this close",typeLabels:{fixed_assets:"Fixed Asset",prepaid_expenses:"Prepaid",accrued_expenses:"Accrual",deferred_revenue:"Revenue Accrual"}},typeFilter:{prepaid_expenses:"Prepaid",fixed_assets:"Fixed Asset",accrued_expenses:"Accrual",deferred_revenue:"Deferred Revenue",all:"All"},groups:{createdInsight:"Auto-posted or manually recorded",failedPostings:"Failed Postings",pendingReviewInsight:"Input requested before posting"},tabs:{schedules:"Review Schedules",actualMatching:"Actual Matching",existingSchedules:"Existing Schedules"},actualMatching:{matchNew:"Match new",undoReversal:"Undo reversal",continueMatch:"Continue match",openBill:"Open bill",openCharge:"Open charge",openTransaction:"Open {type}",kpi:{actualsReceived:"Actuals received ({month})",ofExpected:"of {count} expected",vendorsStillPending:"{count} vendors still pending",vendorStillPending:"1 vendor still pending",autoReversed:"Auto-reversed",cleared:"{amount} cleared",pendingReview:"Pending review",estMinutesToClear:"Est. {minutes} min to clear",variance:"Variance (actual vs accrued)",varianceFooter:"avg {percent} per match · {amount} net"},groups:{reversed:"REVERSED"},groupSubtitles:{reversed:"AI Accountant and Human User · {amount}",pendingReview:"Variance above threshold or ambiguous match · {amount}"},columns:{received:"Received",vendor:"Vendor",type:"Type",service:"Service",reverses:"Reverses",matchTier:"Match tier",reversedBy:"Reversed by",accrued:"Accrued",actual:"Actual",variance:"Variance"},reversedBy:{aiAccountant:"AI Accountant",humanUser:"Human User"},matchTier:{exact:"Exact match",fuzzy:"Fuzzy",aiAccountant:"AI Accountant",manual:"Manual"},reversesCount:"{count} accruals",groupedOpenAccrual:"Open accrual",groupedMenuAria:"Accruals in this match",lifecycle:{pendingReview:"PENDING REVIEW",autoReversed:"AUTO-REVERSED"},emptyState:{title:"No matches this close",subTitle:"Reversed and pending-review accruals for this close will show up here."},matchModal:{title:"Match transactions to accruals",subtitle:"Select one bill or expense line and one or more posted accruals to reverse.",leftTitle:"Transactions",rightTitle:"Accruals",selectedLabel:"selected",leftSearchPlaceholder:"Search bills, expenses, and checks",rightSearchPlaceholder:"Search posted accruals",emptyLeft:"No transactions found",emptyRight:"No posted accruals found",confirm:"Confirm Match",maxAccruals:"You can match up to 50 accruals at once.",conflict:"Could not reverse this accrual",vendorLock:"Only accruals for the selected vendor can be matched.",selectLineHint:"Select a line on this bill",previewEmpty:"Pick at least one transaction and one accrual to preview the match.",accrualJeTitle:"Accrual journal entry being reversed",reversalJeTitle:"Reversal journal entry",reversalJeNote:"One per accrual · mirrors its amount",transactionMatchedTitle:"Transaction matched",columnDate:"Date",columnAccount:"Account",columnDebit:"Debit",columnCredit:"Credit",lastDayOfMonth:"last day",reversesLabel:"_REV Reverses",vsAccrued:"vs. accrued {amount} · variance posts to {account}",accruedExpensesFallback:"Accrued Expenses"},matchDetail:{service:"service",accrued:"Accrued",actual:"Actual",variance:"Variance",accrualJes:"Accrual journal entries",leftovers:"Not reversed",reversalFailed:"Reversal failed",undoFailed:"Undo failed",loadErrorTitle:"Couldn't load this match",loadErrorSubTitle:"Refresh to try again.",reversalJe:"Reversal journal entry",matchedBill:"Matched bill",matchedCharge:"Matched charge",matchedTransaction:"Matched {type}",statusAutoReversed:"Auto-reversed",statusPendingReview:"Pending review",statusManuallyReversed:"Manually reversed"}},newSchedule:{title:"New Schedule",oneTimeAccrualTitle:"New one-time accrual",oneTimeAccrualSubtitle:"Posts directly to the books",recurringTitle:"New recurring schedule",recurringSubtitle:"Posts monthly entries starting {month}",reviewSchedule:"Review schedule",scheduleDetails:{title:"Schedule Details",oneTimeAccrual:"One time accrual",oneTimeAccrualDescription:"Single JE this month",recurringSchedule:"Recurring Schedule"},scheduleType:{title:"Schedule type",subtitle:"What is this schedule spreading?",fixedAssetDescription:"Depreciate a purchase",prepaid:"Prepaid",prepaidDescription:"Amortize a prepayment",accrual:"Accrual",accrualDescription:"Recurring estimate",deferredRevenueDescription:"Recognize over time",deferredRevenue:"Deferred Revenue",fixedAsset:"Fixed Asset"},baseTransaction:{title:"Base Transaction",subtitleFixedAsset:"The purchase being capitalized",subtitlePrepaid:"The prepayment being spread",searchPlaceholder:"Search by vendor, amount, date and memo",noResults:"Nothing matched your search... Try again.",aiAccountantInsight:"AI Accountant spreads {amount} over {months} months ≈ {amountPerMonth}/mo."},fields:{numberOfMonths:"No. of Month",amountPerMonth:"Amount Per Month",sourceOrTrigger:"Source / trigger",addVendor:"Add vendor",selectStartMonth:"Select start month",selectPostingDate:"Select posting date",selectMonths:"Select months",addAccumulatedDepreciationCategory:"Add accumulated depreciation category",addAssetId:"Add asset ID",addSourceOrTrigger:"Add Source / trigger",selectServiceMonth:"Select service month",accrualCategory:"Accrual Category",addAccrualCategory:"Add accrual category",memoPrefix:"Accrue",estimatedMonthlyAmount:"Estimated Monthly Amount",startingBalance:"Starting Balance",addStartingBalance:"Add balance",accumulatedDepreciationCategory:"Accumulated Depreciation Category",serviceMonth:"Service month",postingDate:"Posting Date",addCategory:"Add category",startMonth:"Start Month",addAmount:"Add amount",category:"Category",addClass:"Add class",assetId:"Asset ID",addMemo:"Add memo",vendor:"Vendor",amount:"Amount",class:"Class",memo:"Memo"},oneTimeAccrual:{postAccrual:"Post accrual",reverseNextMonth:"Reverse next month",reverseNextMonthOff:"Off — accrual stays open until a matching bill arrives from this vendor and clears it.",reverseNextMonthOn:"A reversing JE will post on {date} automatically — use this when no matching bill is expected (e.g., estimated bonus, true-up).",reverseNextMonthOnNoServiceMonth:"A reversing JE will post on the 1st of the month after the service month automatically — use this when no matching bill is expected (e.g., estimated bonus, true-up)."},journalEntryPreview:{title:"Journal Entry Preview",debit:"DR",credit:"CR",autoReversesOnBillMatch:"Auto-reverses when a matching bill arrives from {vendor}.",autoReversesOnDate:"Auto-reverses on {date}."},schedulePreview:{title:"Schedule preview",posts:"Posts",postsValue:"{amount} × {months} months",window:"Window",windowValue:"{start} → {end}",totalCommitted:"Total committed",eachEntry:"Each entry",eachEntryValue:"DR {debit} · CR {credit}",autoPostSuffix:" will auto-post each month until the schedule completes.",autoPostPrefix:"AI Accountant",class:"Class"},newButtonLabel:"New"},accrualDetail:{accrualTypeMonthly:"Monthly Accrual",estimatedBy:"Estimated by",editAmount:"Edit amount",statusLabels:{draft:"Pending Review",posting:"Posting",posted:"Posted",posting_blocked:"Posting Blocked",reversing:"Reversing",reversed:"Reversed",reverted:"Reverted"},details:{title:"Accrual Details",servicePeriod:"Service Period",servicePeriodValue:"{month} Service",accrualType:"Accrual Type",liabilityAccount:"Liability Account",autoReversal:"Auto Reversal",reverseNextMonthOption:"Reverse Next Month",onInvoiceMatch:"On Invoice Match",onDate:"On {date}",monthsOfHistoryUsed:"Months of History Used",monthsValue:"{months} months",expenseCategory:"Expense Category",postingDate:"Posting Date",department:"Department",memo:"Memo"},calculationBreakdown:{title:"Calculation Breakdown",calculationMethod:"Calculation Method",weight:"Weight",weightedValue:"Weighted Value",recommendedAccrual:"Recommended Accrual",invoiceAmount:"Invoice Amount",month:"Month"},journalEntryPreview:{title:"Journal Entry Preview",postedTitle:"Posted Journal Entry",reversedTitle:"Reversed Journal Entry",autoReversalEnabled:"Enabled"},billingPattern:{title:"Billing Pattern",avgAmount:"Avg Amount",lastBill:"Last Bill",consistency:"Consistency",billingLag:"Billing lag",monthsTracked:"Months Tracked",percentValue:"{percent}%",serviceMonthMarker:"This service month",noHistoryTitle:"No vendor billing history",noHistoryDescription:"This accrual was entered manually, so there is no vendor profile behind it to chart. The AI Accountant builds one only for the vendors it accrues automatically.",daysValue:"{days} days"},actions:{skipThisMonth:"Skip This Month",approveAndPost:"Approve & Post"},statusStates:{reversed:"Entry reversed"},feedback:{title:"Why skip this accrual?",subtitle:"Tell us why {amount} shouldn't be accrued for {vendor} this month — AI Accountant learns from this.",reasons:{no_activity:"No activity this month",paused:"Vendor paused / off-boarded",too_small:"Not material",need_invoice:"Wait for actual invoice",other_ignore:"Something else"},revert:{title:"Why revert this accrual?",subtitle:"This deletes the {amount} journal entry for {vendor} from the books. AI Accountant learns from the reason.",submit:"Revert Accrual",reasons:{amount_off:"Amount was wrong",wrong_period:"Wrong period",not_accrual:"Shouldn't be accrued",duplicate:"Duplicate",other_revert:"Something else"}},ignoreSchedule:{title:"Why ignore this schedule?",subtitle:"Tell us why this schedule isn't needed — AI Accountant learns from this.",submit:"Ignore Schedule",reasons:{not_needed:"Not needed",wrong_account:"Wrong account",duplicate:"Duplicate",already_handled:"Already handled",other_ignore:"Something else"}},revertSchedule:{title:"Why revert this schedule?",subtitle:"This deletes the posted journal entry from the books and removes the schedule. AI Accountant learns from the reason.",submit:"Revert Schedule",reasons:{amount_off:"Amount was wrong",wrong_period:"Wrong period",duplicate:"Duplicate",created_by_mistake:"Created by mistake",other_revert:"Something else"}},noteLabel:"Add a note (optional)",notePlaceholder:"Anything else we should know?",submit:"Submit Feedback"}},existingSchedules:{downloadCompletedSchedules:"Download Completed Schedules",downloadRange:{title:"Download Completed Schedules",subtitle:"Completed schedules are matched on when they started, not when they finished, so search from before the schedules you are looking for began.",fromLabel:"Started on or after",fromPlaceholder:"Select a month",throughToday:"Includes everything up to today, {today}"},kpi:{ongoingSchedules:"Ongoing schedules",monthlyPosting:"Monthly posting",remainingBalance:"Remaining Balance",toDepreciateAmortize:"to depreciate / amortize",posted:"Posted",typeAbbreviations:{fixed_assets:"Fixed",prepaid_expenses:"Prepaid",deferred_revenue:"Deferred rev",accrued_expenses:"Accrued"}}},searchPlaceholder:"Search for schedules",addCategory:"Add Category"},missingReceipts:{searchPlaceholder:"Search for transactions",subTitles:{pre:"",preLink:"",post:"will do the best to automatically match receipts with the correct transactions. Forward all receipts to {receiptsEmail}",postLink:"{receiptsEmail}"},allDoneText:{subTitle:"All receipts uploaded, like magic!"}},fluxAnalysis:{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",post:"will learn from it."}},sectionTitle:{generalExpense:"General Expenses"},reviewedBy:"Reviewed by",remarksBy:"Remarks by",viewVendorDetails:"View Vendor Details",emptyPageTexts:{youDidIt:"You did it!",allReviewed:"All flux reviewed!"},stepsBanner:{collapsedTitle:"Quick steps for Flux Analysis",step1:{title:"Review Variances",description:"Compare vendor-wise spend across months and drill down into categories and classes."},step2:{descriptionPrefix:"Once variances are confirmed,",descriptionSuffix:"select vendors and mark as reviewed."}}},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",matchProgress:"AI Progress",lastReconciled:"Last Reconciled",excludedAccountTitle:"Excluded Accounts"},matchProgressLegend:{byHuman:"by human"},progressBar:{byHumans:"by humans"},stepsBanner:{collapsedTitle:"Quick steps for Bank Reconciliation",step1:{title:"Connect Bank Account",line1AfterIcon:"to add a bank account or",line2:"upload a bank statement."},step2:{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"},statsCards:{autoMatched:"AI Accountant Auto-matched",needsReview:"Needs Review",accountsDone:"Accounts Reconciled",timeSavedByAi:"Time saved by AI Accountant",ofTotalTxn:"of _total_ transactions",acrossAccounts:"across _count_ accounts",ofTotalAccounts:"of _total_ Accounts",hrsSuffix:"hrs"},connectAccountsBanner:{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",reconcileViaQBO:"Reconcile via QBO",balanceSyncInProgress:"Balance sync",statementSyncInProgress:"Statement sync",autoReconInProgress:"Auto-reconciliation",statementParseError:"Statement parse",statementValidationFailed:"Statement validation",statementProcessingFailed:"Statement processing",failed:"failed",isInProgress:"is in progress",booksClosedTooltip:"Books closed. Reopen to reconcile again."},tooltips:{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"}},drawer:{uploadDropZoneSuffix:"your statement",uploadDropZoneSupportingText:{single_account:"Upload a statement for a single account.",multi_account:"Upload a statement containing multiple accounts."},statementAccountScopeOptions:{single_account:"Single Account",multi_account:"Multiple Accounts"},labels:{lastUpdated:"Last Updated:",lastSync:"Last Sync:"},values:{bank:"Bank",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"},fileValidationFailed:{heading:"File Validation failed",description:"We couldn't process your statement. Please check the file and try uploading again."},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}`},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."}}},statementProcessing:{steps:["Uploaded file","Reading document structure","Identifying statement type","Extracting account details","Determining opening & closing balances","Verifying statement details","Gathering transactions","Finalizing Reconciliation"],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:"Taking longer than expected...",actionNeeded:"Action needed",continueInBackground:"Continue in Background",accountMapping:{headerSubtitle:e=>`Almost done — assign each of the ${e} cards to a ledger account to finish.`,headerSubtitleAccounts:e=>`Almost done — assign each of the ${e} accounts to a ledger account to finish.`,banner:(e,t)=>`I've extracted all charges from this combined ${e} statement — it covers ${t} cards. Assign each card to a ledger account to file everything. You won't need to upload this file again.`,bannerAccounts:(e,t)=>`I've extracted all charges from this combined ${e} statement — it covers ${t} accounts. Assign each account to a ledger account to file everything. You won't need to upload this file again.`,aiMatched:"AI matched",ledgerAccountLabel:"Ledger account",ledgerAccountPlaceholder:"Select ledger account",overrideWarning:"This account has an ongoing reconciliation. Selecting it will override the existing work.",transactionSummary:(e,t)=>`${e} transactions • ${t} in new charges`,deleteRowAriaLabel:"Remove card mapping",deleteConfirmation:{heading:"Remove this card?",headingAccount:"Remove this account?",description:"The transactions from this card will be excluded from this combined statement, you can still map the remaining cards.",descriptionAccount:"The transactions from this account will be excluded from this combined statement, you can still map the remaining accounts."}},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.",continueParsing:"Continue Parsing"}},statementParseInfo:{statementPeriodAndBalances:"Statement period & balances",statementValuesFootnote:"These values are copied directly from the statement.",from:"From:",to:"To:",credits:"Deposits",calculatedValues:"Calculated values",calculatedValuesFootnote:"These values are calculated from transactions in the statement.",extractedTransactions:"Extracted transactions",addTransaction:"Add transaction",totalsDoNotAddUp:"The totals do not add up.",reparseStatement:"Re-parse statement",retryParsing:"Retry Parsing",cancelConfirmation:{heading:"Are you sure?",description:"You have unsaved changes. If you cancel now, your changes will be lost"},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"},closingBalanceMismatchConfirmation:{heading:"Closing balance doesn’t match",descriptionBeforeStatementAmount:"The closing balance on your statement is ",forAccountDescriptionBeforeStatementAmount:"For {accountName}, the closing balance on your statement is ",descriptionBetweenAmounts:", but the transactions you’ve added total ",reviewHint:"Please review the transactions and add, remove, or edit any that are incorrect.",reviewTransactions:"Review transactions",continueAnyway:"Continue anyway",descriptionAfterTransactionsAmount:"."},aiSummary:{accountRecognized:"Account recognized",transactionsExtracted:"Transactions extracted",exceptionsDetected:"Exceptions detected",fieldsCaptured:"Fields captured",validated:"Validated",openingDate:"Opening date"}},tabs:{},review:{allDoneText:{title:"High five!",subTitle:"All transactions reviewed!"},header:{match:"Record or Match",amount:"Amount",memo:"Memo"},transactionDirection:{credit:"Credit",debit:"Debit"},matchesCount:"__count__ Matches",matchedFoundCount:"__count__ Matches Found",matchesFoundFullInfo:"for this bank transaction within the last 90 days",bankDetail:"Bank Detail",creditCardDetail:"Credit Card Detail",formLabels:{match:"Match",categorize:"Categorize",selectCard:"Select Card",allBankAccounts:"All bank accounts",allCreditCards:"All credit cards",addCategory:"Add Category",addClass:"Add Class",addMemo:"Add Memo"}},reconcile:{allDoneText:{title:"Ta-da!",subTitle:"No transactions found for reconciliation!"},header:{clearedDate:"Cleared Date",amount:"Amount",memo:"Memo"}},subTitles:{review:{item1:{pre:"",bold:"",prefixIconName:"",post:"Please review these transactions because the general ledger balance doesn't match the bank balance."},item2:{pre:"",post:"suggest updating these transactions to resolve the ledger discrepancies, which will help auto-adjust the variance."}},reconcile:{item1:{pre:"",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:"",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."}}},recommendationFeedback:{title:"Help me get this right next time.",skipLabel:"Skip Feedback",yourSelection:"Your Selection",reasonPlaceholder:'e.g. "Always put Amazon under Software Subscription, not Office Supplies"',submitHintPrefix:"Press ",submitHintKey:"Enter/Return",submitHintSuffix:" to submit",dimensionLabels:{vendor:"Payee Recommendation",category:"Category Recommendation",class:"Class Recommendation"}}},aiCfo:{pageView:{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."},routines:{title:"Scheduled Tasks",am:"am",pm:"pm",subtitle:"Work that runs on a schedule and emails you the answer. A saved skill, or a one-off you write here.",empty:"You don’t have any scheduled tasks yet.",loading:"Loading scheduled tasks…",loadFailed:"Couldn’t load scheduled tasks. Please try again.",newRoutine:"New scheduled task",capReached:"You’ve reached the limit of __max__ scheduled tasks. Delete one to add another.",everyDayAt:"Every day at __time__",everyWeekAt:"Every __weekday__ at __time__",everyMonthAt:"Every month on the __day__ at __time__",unknownSchedule:"On a schedule this app doesn’t recognise",weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ordinalSuffixes:{one:"st",two:"nd",few:"rd",other:"th"},unknownScheduleHint:"This scheduled task uses a schedule set up elsewhere. You can pause or delete it here, or contact support to change it.",inTimezone:"__schedule__ (__timezone__)",nextRun:"Next __date__",neverRun:"Hasn’t run yet",lastRunSucceeded:"Last run __date__",lastRunSucceededNoDate:"Last run succeeded",lastRunFailedNoDate:"Last run failed",lastRunTimeoutNoDate:"Last run timed out",lastRunFailed:"Last run failed __date__",lastRunTimeout:"Last run timed out __date__",pausedBadge:"Paused",autoPaused:"Paused after repeated failures",adHocBadge:"Prompt",brokenSkill:"The skill this ran was deleted",pause:"Pause",resume:"Resume",pauseRoutine:"Pause __name__",resumeRoutine:"Resume __name__",editRoutine:"Edit __name__",deleteRoutine:"Delete __name__",openThread:"Open conversation",run:"Run now",runRoutine:"Run __name__ now",running:"Running…",runQueued:"Started. The answer appears in the conversation, and is emailed when it finishes.",runFailed:"Couldn’t start this scheduled task. Please try again.",history:"History",hideHistory:"Hide history",historyLoading:"Loading runs…",historyFailed:"Couldn’t load this scheduled task’s runs.",historyEmpty:"No runs yet.",runManual:"Manual",runScheduled:"Automatic",runInFlight:"Running",runInProgressNotice:"Running — this usually takes 1–3 minutes. The answer appears here and is emailed when it finishes.",runSucceeded:"Succeeded",runFailedStatus:"Failed",runTimedOut:"Timed out",runUnknownStatus:"Unknown",runAt:"__date__ at __time__",runAttempt:"Attempt __n__",openRun:"Open",openRunLabel:"Open the conversation for the run on __date__",backToRoutines:"Scheduled Tasks",configuration:"Configuration",enabledLabel:"Status",enabledOn:"Active",enabledOff:"Paused",enabledOnHint:"Runs on its schedule.",enabledOffHint:"Paused — it will not run.",scheduleRow:"Schedule",oneOffSource:"A prompt you wrote",instructionsHeading:"Instructions",showAll:"Show all",showLess:"Show less",runsHeading:"History",successRatio:"__succeeded__ of the last __total__ succeeded",neverRunStatus:"Hasn’t run yet",openRoutine:"Open __name__",openRoutinePage:"Open scheduled task settings",breadcrumbRoot:"Scheduled Tasks",edit:"Edit",runRowLabel:"Run · __when__",newRuns:"__count__ new",scheduledSection:"SCHEDULED",cadenceDaily:"Daily",cadenceWeekly:"Weekly",cadenceMonthly:"Monthly",cadenceCustom:"Custom",showRuns:"Show runs",hideRuns:"Hide runs",panelRuns:"Runs",panelDetails:"Details",panelSkill:"Skill",composerPlaceholder:"What do you want on a schedule?",composerSubmit:"Draft scheduled task",composerExamples:["Summarise last week’s spend and flag anything unusual","Send me the cash position every Monday morning","List invoices over 60 days past due"],deleteConfirm:"Delete scheduled task",deleteConfirmBody:"It stops running and stops emailing you. The skill it runs is not affected.",deleting:"Deleting…",deleteFailed:"Couldn’t delete this scheduled task. Please try again.",saveFailed:"Couldn’t save this scheduled task. Please try again.",nameLabel:"Name",namePlaceholder:"Monday spend review",sourceLabel:"What it runs",sourceSkill:"A saved skill",sourcePrompt:"Something I write here",promptPlaceholder:"Summarise last week’s spend and flag anything unusual.",promptHint:"Runs exactly as written, every time. It won’t appear in the / menu.",skillLabel:"Skill",skillHint:"Pinned to the version you pick, so editing the skill later won’t change what runs.",cadenceLabel:"How often",daily:"Every day",weekly:"Every week",monthly:"Every month",weekdayLabel:"Day of week",dayOfMonthLabel:"Day of month",dayOfMonthHint:"A month that’s too short runs on its last day instead.",hourLabel:"Hour",minuteLabel:"Minute",timeLabel:"At",scheduleLabel:"Schedule",runsSummary:"Runs __schedule__",timezoneLabel:"Timezone",timezonePlaceholder:"Search timezones…",timezoneHint:"The time above is in this timezone.",timezoneInvalid:"That isn’t a timezone we recognise.",skillPlaceholder:"Search skills…",skillUnknown:"Pick a skill from the list.",templateLabel:"Start from a skill",templatePlaceholder:"Optional — search skills…",templateHint:"Copies that skill’s instructions below, where you can edit them. The scheduled task then runs your edited copy, not the skill.",templateLoading:"Loading that skill’s instructions…",templateFailed:"Couldn’t load that skill’s instructions. You can still write your own.",skillInstructionsLabel:"What it will run",skillInstructionsLoading:"Loading…",skillInstructionsFailed:"Couldn’t load this skill’s instructions.",editACopy:"Edit a copy instead",editACopyHint:"Runs the skill as written. To change it for this scheduled task only, edit a copy.",noMatches:"No matches",deliveryNote:"The answer is emailed to you when it finishes.",save:"Save scheduled task",saving:"Saving…"},skills:{subtitle:"Ready-made analyses you can run in a new chat. Zeni's are available to everyone; yours are your company's own.",byZeni:"By Zeni",byTenant:"Your company",empty:"No skills are available yet.",emptyTenant:"Your company hasn’t added any skills yet.",loading:"Loading skills…",loadingPrompt:"Loading this skill’s instructions…",loadFailed:"Couldn’t load skills. Please try again.",detailLoadFailed:"Couldn’t load this skill. Please try again.",back:"All skills",backToSkill:"Back to skill",audienceCurrentPrivate:"Only you can use this skill.",audienceCurrentTenant:"Everyone at your company can use this skill.",publish:"Share with company",unpublish:"Make private",publishing:"Sharing…",unpublishing:"Making private…",publishFailed:"Couldn’t change who can use this. Please try again.",run:"Run skill",runHint:"Runs this skill in a new chat.",instructionsHeading:"What this skill tells the agent",tenantBadge:"Shared",lastUpdated:"Updated __date__",neverUpdated:"Not updated yet",newSkill:"New skill",fork:"Copy to my skills",forkHint:"Starts a new skill of your own from this one.",forkNameSeed:"__name__ copy",deleteConfirm:"Delete this skill?",deleteConfirmBody:"It stops appearing in the / menu for everyone who can run it. Its name becomes available again.",deleting:"Deleting…",deleteFailed:"Couldn’t delete this skill. Please try again.",namePlaceholder:"Cash burn summary",nameHint:"How people find this skill — the / command is set from this name when you save.",nameHandleHint:"Runs as /{handle} — type / then any part of the name.",audienceLabel:"Who can use this",audiencePrivate:"Only me",audiencePrivateHint:"Stays in your own / menu.",audienceTenant:"Everyone at my company",audienceTenantHint:"Appears in every colleague's / menu.",audiencePublishWarning:"Published skills run with the permissions of whoever uses them. Only publish a prompt you would be comfortable running as any colleague.",descriptionPlaceholder:"One line on what this skill does",descriptionHint:"Shown under the name in the / menu.",instructionsLabel:"Instructions",instructionsPlaceholder:"Tell the agent exactly what to do. Be specific about the period, the accounts and the format you want back.",instructionsHint:"The agent receives this verbatim. Written like a brief, not a search query.",charCount:"__count__ characters",create:"Create skill",creating:"Creating…",saveNewVersion:"Save new version",saveFailed:"Couldn’t save this skill. Please try again.",unsavedTitle:"Discard your changes?",unsavedBody:"This skill has edits that haven’t been saved.",keepEditing:"Keep editing",nameRequired:"A name is required.",instructionsRequired:"Instructions are required.",instructionsTooShort:"Instructions need at least __min__ characters.",renameWarning:"Renaming changes the / command. The old one stops working.",historyHeading:"Version history",historyLoading:"Loading history…",historyFailed:"Couldn’t load version history.",historyEmpty:"No earlier versions.",versionLabel:"Version __version__",restore:"Restore",restoreHint:"Brings this version’s instructions back as a new version. Nothing is overwritten.",restoreLoading:"Loading this version…",restoreFailed:"Couldn’t load that version. Please try again.",emptyTenantCta:"Write your first skill, or copy one of Zeni’s."},texts:{generating:"Generating...",artifactFallbackTitle:"Financial visualization",downloadArtifactImage:"Download chart as image",saveToSkill:"Save to Skill",savedToSkill:"Saved — run it with /{command}",saveToSkillFailed:"Couldn't save. Please try again.",createSkillCommandDescription:"Turn this conversation into a reusable skill",createSkillCommandExampleHint:"that compares vendor spend month over month",downloadTableFailed:"Couldn’t download the table. Please try again.",downloadTableTooLarge:"This table is too large to export. Try narrowing the question to a shorter period or fewer categories.",downloadArtifactImageFailed:"Couldn’t download the chart. Please try again.",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",createdCardsTableRecommendedLimitHeader:"Recommended Limit"},interactiveForm:{noMatches:"No matches",cardPolicy:{limits:{transactionLimitHelperText:"Maximum amount per single transaction",amountPlaceholder:"$0"}},cardsCreation:{step1Title:"Based on your last 3 months of spend, here are the cards. Review and confirm.",step1AddRowPlaceholder:"Add something else",step1ColumnAvgMonthlySpend:"Avg monthly spend",step2Title:"Who should these cards be assigned to? Suggested owners based on past spend.",step2Cta:"Create cards",cardTypeOptions:{virtual:{label:"Virtual card",description:"Issued instantly"}}}},chainOfThoughts:{reasoning:"Thinking"},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"},exports:{downloading:"Preparing download",errors:{expired:"This file is no longer available. Ask the question again to regenerate it.",generic:"Could not download the file. Please try again."}},input:{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."},placeholder:"Ask AI CFO a question and get clear answers.",placeholderWithSkills:"Ask a question, or type / to run a Skill.",placeholderWithSkillsAndUpload:"Ask a question, type / for Skills, or attach a file.",placeholderWithUpload:"Ask a question, or attach a file to analyze."},loading:{discoveryTips:{excelExport:"Tip: Ask for any analysis as an Excel file and I'll attach a download.",followUps:"Tip: Ask follow-up questions in the same chat — I keep the conversation's context.",skills:"Tip: Type / in the message box to run Skills like flux analysis and cash forecasts.",uploads:"Tip: Attach a CSV or spreadsheet and I'll analyze it alongside your books."}},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",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",aiCardsAgent:"AI Cards Agent",aiBillsAgent:"AI Bills Agent",aiExpenseAgent:"AI Expenses Agent",aiBankingAgent:"AI Banking Agent",aiAccountantAgent:"AI Accountant Agent",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:{table:{bookClose:"Book Close",accuracy:"Accuracy"},actions:{onboard:"Onboard",evaluate:"Evaluate",fullPipeline:"Full Pipeline",retrain:"Retrain",offboard:"Offboard",cancelOnboarding:"Cancel Onboarding"},jobTriggerDialog:{title:"Trigger Job",datesInstruction:"Please provide start and end dates.",singleDescription:"__companyName__. __datesInstruction__",singleDescriptionOffboard:"__companyName__ will be offboarded from AI Accountant."},drawer:{enrollmentDetails:"Enrollment Details",onboarded:"Onboarded",modelAccuracy:"Model Accuracy",noAccuracyData:"No accuracy data available",jobHistory:"Job History",loadingJobs:"Loading jobs...",noJobsFound:"No jobs found",operation:"Operation"},summary:{totalCustomers:"Total Customers",avgAccuracy:"Avg Accuracy"},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.",evaluateAllDialogDescription:"__count__ unonboarded customer(s) will be evaluated. Please provide start and end dates."}},cardsShutdown:{bannerDescription:"We're sunsetting Zeni Cards on {date} and partnering with Ramp as our recommended corporate cards provider. Here's what's changing and how to apply.",bannerDescriptionWithoutDate:"We're sunsetting Zeni Cards and partnering with Ramp as our recommended corporate cards provider. Here's what's changing and how to apply.",introBody:"We're sunsetting Zeni Cards on {date} as we focus on our core AI accounting and bookkeeping platform. To keep your financial operations running without interruption, we recommend Ramp as your corporate card provider.",introBodyWithoutDate:"We're sunsetting Zeni Cards as we focus on our core AI accounting and bookkeeping platform. To keep your financial operations running without interruption, we recommend Ramp as your corporate card provider.",programEnds:"Program ends {date}",applicationDisclaimer:"Ramp reviews each application independently. Approval, card limits, and implementation timing aren't guaranteed and depend on the information provided during the application.",whatThisMeansTitle:"What this means for you",meansProgramEnd:"Your current Zeni Card program is expected to end on {date}.",meansApplicationRequired:"Moving to Ramp is not automatic. Your business will need to complete a new Ramp application, and Ramp will conduct its standard business and identity review.",meansImplementation:"If approved, Zeni and Ramp will coordinate with you on card setup, policies, approvals, and implementation.",meansControllerSupport:"Your Zeni controller will remain available to help you understand the transition and next steps.",whatToDoNowTitle:"What to do now",watchForInvitationTitle:"Watch for your Ramp invitation",watchForInvitationBody:"Look out for an email from Ramp titled “You’ve been invited” to review and complete your pre-filled application.",loopInControllerTitle:"Loop in your Zeni controller",loopInControllerBody:"Share any card limits, approval rules, expense policies, or timing constraints during setup.",needHelpPrefix:"Need help? Reach us at ",needHelpSuffix:"."},invoicingOverview:{revenueMetricOverTime:"Revenue - {metric} Over Time",mrrMovement:"MRR Movement",mrrMovementNewSubscriptions:"New Subscriptions",mrrMovementExpansions:"Expansions",mrrMovementNewChange:"New MRR Change",customerMovement:"Customer Movement",customerMovementSubtitle:"All status transitions this month",netCustomerChange:"Net customer change",totalActiveCustomers:"Total active customers",customerChurnRate:"Customer churn rate",revenueByPlan:"Revenue by Plan",noPlanData:"No plan data available.",noRecentSubscriptions:"No recent subscriptions.",kpiActiveSubs:"Active Subs",metricChurnRate:"Churn Rate",tabRecentSubscriptions:"Recent Subscriptions",tabMonthlyMrrBreakdown:"Monthly MRR Breakdown",pillPaused:"Paused",pillResumed:"Resumed",pillReactivated:"Reactivated",alertFailedPayments:"Failed Payments",alertNeedsAction:"Needs action",alertUpcomingInvoices:"Upcoming Invoices",alertNext7Days:"Next 7 days",alertPastDueInvoices:"Past Due Invoices",nrrTitle:"Net Revenue Retention (NRR)",nrrSubtitle:"Trailing 12 months · benchmark for SaaS health",nrrFootnote:"NRR over 112% means existing customers are growing faster than they’re churning — typically a sign of strong product-market fit. Healthy SaaS benchmark is >100%.",grrTitle:"Gross Revenue Retention (GRR)",grrSubtitle:"Excludes expansion · pure retention signal",grrFootnote:"GRR caps at 100% — it strips out upsell to show how much revenue you’d retain without expansion. Best-in-class SaaS sits at 90%+. Below 80% signals a churn problem.",startingArr:"Starting ARR",expansionsArr:"Expansions ARR",contraction:"Contraction",churn:"Churn",endingArr:"Ending ARR",nrr:"NRR",retainedArr:"Retained ARR",grr:"GRR",summaryNewMrr:"New MRR",summaryExpansion:"Expansion",summaryChurnedMrr:"Churned MRR",summaryNetMrrChange:"Net MRR Change",summaryEndingMrr:"Ending MRR",colAutoCollect:"Auto Collect",autoCollectOn:"ON",autoCollectOff:"OFF",cadenceAnnual:"Annual",since:"Since"},invoicingCommon:{minimumQuantityAllowed:"Minimum 1 allowed",zipPlaceholder:"94105",usage:"Usage",pricing:"Pricing",subFamilyCode:"Price Point Code",productCode:"Product Code",columnTarget:"Target",labelBillingPeriod:"Billing Period",labelPricingModel:"Pricing Model",addOns:"Add-ons",oneTimeChargesTab:"One-time Charges",importCsvFile:"Import CSV File",pluralSuffix:"s",description:"Description",subFamilyId:"Price Point ID",itemDetails:"Item Details",name:"Name",externalName:"External Name",unit:"Unit",itemApplicability:"Item Applicability",applicableItems:"Applicable Items",timestamps:"Timestamps",updatedAt:"Updated At",addOn:"Add-on",coupons:"Coupons",oneTimeCharge:"One-time Charge",cancelSubscription:"Cancel Subscription",nameShownOnInvoices:"Name shown on invoices",placeholderPriceZero:"0.00",trialPeriod:"Trial Period",labelFreeQuantity:"Free Quantity",invoiceNotes:"Invoice Notes",invoiceName:"Invoice Name",placeholderAddInvoiceName:"Add invoice name",appendedToInvoiceLineItem:"Appended to invoice line item",addInvoiceNotes:"Add invoice notes",checkmark:"✓",yourCompany:"Your Company",thankYouForYourBusiness:"Thank you for your business.",onReceipt:"On receipt",net:"Net ",newSuffix:"—NEW",invoiceNumber:"Invoice #",poNumberLabel:"PO #",logoAlt:"Logo",taxIdLabel:"Tax ID: ",billedTo:"Billed To",amount2:"Amount (",paymentLinkNoItemizedInvoice:"Payment link — no itemized invoice",qtyLabel:"Qty: ",subtotal:"Subtotal",amountDue:"Amount Due (",signatureAlt:"Signature",currencySymbolEur:"€",currencySymbolGbp:"£",currencySymbolInr:"₹",createCoupon:"Create Coupon",couponDetails:"Coupon Details",couponId:"Coupon ID",couponCodeLabel:"Coupon Code",applyOn:"Apply On",discountType:"Discount Type",maxRedemptions:"Max Redemptions",validFrom:"Valid From",validTill:"Valid Till",dueOnReceipt:"Due on receipt",createInvoice:"Create Invoice",customerDetails:"Customer Details",billingFrequency:"Billing Frequency",openCustomerInNewTab:"Open customer in new tab",openSubscriptionInNewTab:"Open subscription in new tab",openInvoiceInNewTab:"Open invoice in new tab",allocated:"Allocated",refunded:"Refunded",referenceInvoice:"Reference Invoice",subTotal:"Sub Total",noLineItems:"No line items.",creditNote:"Credit Note",preparing:"Preparing…",bankAccountAch:"Bank Account (ACH)",connectViaPlaid:"Connect via Plaid — lower fees, 2–4 day settlement",loading:"Loading…",creditDebitCard:"Credit / Debit Card",cardMethodDescription:"Visa, Mastercard, Amex — instant settlement",cardSetupFailed:"Card setup failed.",failedToSaveCard:"Failed to save card.",expiry:"Expiry",saveCard:"Save Card",newSubscription:"New Subscription",outstanding:"Outstanding",namePlaceholder:"James Johnson",firstNamePlaceholder:"James",lastNamePlaceholder:"Johnson",emailPlaceholder:"billing@acme.com",phonePlaceholder:"(555) 000-0000",companyPlaceholder:"Acme Corp",billingDetails:"Billing Details",vatNumber:"VAT Number",vatNumberPlaceholder:"US-EIN-12-3456789",autoCollectionDescription:"Enabling this automatically charges the customer each billing cycle.",autoCollection:"Auto Collection",netTerms:"Net Terms",selectNetTerm:"Select net term",preferredCurrency:"Preferred Currency",taxability:"Taxability",selectTaxability:"Select taxability",invoiceNotesHint:"Default note to appear on invoices",invoiceNotesPlaceholder:"Default notes to appear on invoices…",addStreetAddress:"Add street address",floorSuiteOffice:"Floor/Suite/Office",city:"City",addCity:"Add city",state:"State",addState:"Add state",addCountry:"Add country",zipCode:"ZIP Code",yourVendor:"Your vendor",createCustomerLabel:"Create Customer",of:" of ",free:" free",code:"Code",redemptions:"Redemptions",slashSeparator:" / ",duration:"Duration",daysPastDue:"Days Past Due",nextRetry:"Next Retry",attempts:"Attempts",line1:"Line 1",line2:"Line 2",recordPayment:"Record Payment",arrowSeparator:" → ",shippingAddress:"Shipping Address",poNumber:"PO Number",poNumber2:"PO number",refunds:"Refunds",gateway:"Gateway",referenceNumber:"Reference Number",subscriptionDetails:"Subscription Details",addShippingAddressButton:"Add shipping address",addBusinessAddressButton:"Add business address",addPoNumber:"Add PO number",shipLine1Placeholder:"123 Main St",shipLine2Placeholder:"Suite 200",cityPlaceholder:"San Francisco",statePlaceholder:"CA",createSubscriptionLabel:"Create Subscription",cardStatus:"Card Status",creditNumber:"Credit Number",dateIssued:"Date Issued",creditedAgainst:"Credited Against",totalCredits:"Total Credits",daySuffix:"d",trial:"Trial",amount:"Amount",all:"All"},invoicingAuditLog:{timeColumnHeader:"Time",actorColumnHeader:"Actor",detailColumnHeader:"Detail",noAuditEntriesMatchSearch:"No audit entries match your search.",noAuditActivityYet:"No audit activity yet.",searchActionTargetActorPlaceholder:"Search action, target, or actor"},invoicingCatalog:{addOnsNoun:"add-ons",oneTimeChargesNoun:"one-time charges",plansNoun:"plans",itemsNoun:"items",addItem:"Add Item",addAddOn:"Add Add-on",addOneTimeCharge:"Add One-time Charge",periodSingular:"1 ${label}",periodPlural:"${period} ${label}s",productColumnHeader:"Product",itemTypeColumnHeader:"Item Type",activePlansKpi:"Active Plans",activeProductsKpi:"Active Products",avgPlanPriceKpi:"Avg Plan Price",noMatchSearch:"No ${tabNoun} match your search.",noItemsYet:"No ${tabNoun} yet.",emptyStateDescription:"Bring in your historical product catalog data by importing your product catalog csv file",emptyStateTitle:"No Product Catalog Yet",searchPlaceholder:"Search ${tabNoun}"},invoicingCatalogDetail:{oneSpace:"1 ",activeSubFamilies:"Active Price points",archivedSubFamilies:"Archived Price points",lowestActiveSubFamilyPrice:"Lowest Price Point Price",priceTiers:"Price / Tiers",catalogItemNotFound:"Catalog item not found.",itemNamePlaceholder:"Item name",externalNamePlaceholder:"External name",addDescriptionPlaceholder:"Add a description",lineItemDescription:"Line Item Description",itemFamily:"Item Family",restrictedPrefix:"Restricted (",itemsSuffix:" items)",subFamilies:"Price points",noSubFamilies:"No Price points.",archivedAt:"Archived At",archiveSubFamily:"Archive price point",archiveSubFamilyBlocked:"Cannot archive while subscriptions reference this price point.",duplicateSubFamily:"Duplicate price point",subscriptionsUseSubFamilyBanner:"{count} subscriptions use this price point. To change pricing, create a new price point."},invoicingCatalogForm:{trialUnitDay:"Day",periodUnitWeek:"Week",pricingModelFlatFee:"Flat fee",pricingModelPerUnit:"Per unit",pricingModelTiered:"Tiered",pricingModelVolume:"Volume",pricingModelStairstep:"Stairstep",tierTypePerUnit:"Per Unit",tierTypeFlatFee:"Flat Fee",tierTypePackage:"Package",trialEndActivateSubscription:"Activate Subscription",prorationPartialTerm:"Partial Term",prorationFullTerm:"Full Term",applicabilityAll:"All add-ons & charges",applicabilityRestricted:"Restricted — Select applicable items",applicableItemsEmptyPlaceholder:"No add-ons or charges available",selectApplicableItemsPlaceholder:"Select applicable items",validationProductFamilyRequired:"Enter a Product Family name for this catalog item.",validationSubFamilyNameRequired:"Add at least one price point and enter a name for each one.",titleEditCatalogItem:"Edit Catalog Item",titleCreatePlan:"Create Plan",titleCreateOneTimeCharge:"Create One-time Charge",titleCreateAddon:"Create Add-on",sectionPlanAndProductFamilyDetails:"Plan and Product Family Details",productCodeExample:"Optional. Generated from Product Family when left blank.",placeholderAddProductCode:"Add product code",customerFacingName:"Customer facing name",labelProductFamily:"Product Family",placeholderAddProductFamily:"Add product family",labelPricePointName:"Price point name",placeholderAddSubFamilyName:"e.g. Growth Monthly",subFamilyCodeExample:"Optional. Generated from the price point name when left blank.",placeholderAddSubFamilyCode:"Add price point code",forInternalUseOnly:"For internal use only",subFamilyDetailsTitle:"Price Points",pricePointsRequiredHint:"Add at least one price point to create this plan. Add more for different billing frequencies (e.g. monthly, annual) or currencies.",addNewLink:"Add another price point",subFamilyNumberPrefix:"Price Point",removeSubFamilyConfirmation:"Remove this price point?",labelSubFamily:"Price Point",placeholderAddSubFamily:"Add price point",labelAddTiers:"Add Tiers",tierColumnTo:"To (blank for unlimited)",tierColumnPackageSize:"Package size",infinity:"∞",removeTierX:"✕",addTierLink:"Add Tier",hintAddBillingPeriod:"Add billing period",placeholderTrialPeriodExample:"e.g. 14",labelTrialEndAction:"Trial End Action",hintBillingCyclesUnlimited:"Keep it blank for unlimited cycles",placeholderAddBillingCycles:"Add number of billing cycles",labelProrationType:"Proration Type",labelFlags:"Flags",selectFlagsPlaceholder:"Select flags",labelShowDescriptionInQuotes:"Show Description in Quotes",lineItemDescriptionHint:"Shown below the line-item name when invoice descriptions are enabled",subFamilyInvoiceNotesHint:"Shown in the invoice Notes section when this price point is billed",nameShownOnInvoiceLineItem:"Name shown on the invoice line item",sectionAccountingIntegration:"Accounting Integration",skuQboExample:"QBO Product code. Example: BASIC-M",labelSku:"SKU",placeholderAddSku:"Add SKU",placeholderAddAccountingCode:"Add accounting code",placeholderSelectIncomeAccount:"Select income account"},invoicingCouponForm:{enterCouponIdError:"Enter a Coupon ID.",enterCouponNameError:"Enter a name for this coupon.",editCouponTitle:"Edit Coupon",couponIdPlaceholder:"e.g. WELCOME20",namePlaceholder:"e.g. Welcome 20% Off",discountPercentagePlaceholder:"e.g. 20",discountPercentageLabel:"Discount Percentage",discountAmountLabel:"Discount Amount",freeQuantityPlaceholder:"e.g. 1",durationLimitsSectionTitle:"Duration & Limits",durationTypeLabel:"Duration Type",periodPlaceholder:"e.g. 3",periodUnitLabel:"Period Unit",maxRedemptionsPlaceholder:"Add max redemptions",discountsAccountLabel:"Discounts Account",discountsAccountPlaceholder:"Select income account"},invoicingCreateInvoice:{selectPaymentTerm:"Select payment term",net7:"Net 7",net15:"Net 15",net30:"Net 30",net45:"Net 45",net60:"Net 60",selectBillingFrequency:"Select billing frequency",halfYearly:"Half-yearly",annually:"Annually",addAtLeastOneLineItem:"Add at least one line item with a description and unit price.",step1CustomerAndType:"Step 1: Customer and Type",step2InvoiceDetails:"Step 2: Invoice Details",step1Subtitle:"How would you like to create an invoice? Select a customer and choose the invoice type.",step2Subtitle:"Set dates, line items, and additional details.",invoiceJpg:"Invoice.jpg",livePreviewSuffix:" - Live Preview",paymentLink:"Payment link",paymentLinkCalloutText:"A payment link will be generated and sent to the customer — no itemized invoice document is required.",chooseExistingCustomerHint:"Choose an existing customer or create one first",searchOrTypeCustomerName:"Search or type a customer name",pleaseSelectCustomer:"Please select a customer to continue.",invoiceType:"Invoice Type",selectAnInvoiceType:"Select an invoice type",oneTimeInvoiceDescription:"Send a one-time invoice with a built-in payment link.",oneTimeInvoiceTitle:"One-time Invoice",recurringSeriesDescription:"Automatically generate recurring invoices on a set schedule.",recurringSeriesTitle:"Recurring Series",paymentLinkOnlyDescription:"Send only a payment link with a single amount — No itemized invoice.",paymentLinkOnlyTitle:"Payment Link Only",general:"General",setInvoiceDatesHint:"Set the invoice dates and additional details.",selectInvoiceDate:"Select invoice date",paymentTerms:"Payment Terms",usdUsDollar:"USD — US Dollar",soNumber:"SO Number",addSoNumber:"Add SO number",exampleSoNumber:"Example: SO-2026-001",exampleMemo:"Example: thank you for your business",unitPriceLabel:"Unit Price (",useDescriptionAs:"Use description as",addQuantity:"Add quantity",addPrice:"Add price",removeLine:"Remove line",addLine:"Add Line",unitPriceInDollars:"Unit price in dollars"},invoicingCreditDetail:{allocatedAt:"Allocated At",creditNoteNotFound:"Credit note not found.",creditNoteTitlePrefix:"Credit Note ",creditNoteDetails:"Credit Note Details",creditNoteId:"Credit Note ID",creditNoteNumber:"Credit Note Number",priceType:"Price Type",amounts:"Amounts",amountAvailable:"Amount Available",amountAllocated:"Amount Allocated",amountRefunded:"Amount Refunded",allocations:"Allocations",noAllocations:"No allocations.",linkedRefunds:"Linked Refunds"},invoicingCreditList:{noCreditNotesMatchSearch:"No credit notes match your search.",noCreditNotesYet:"No credit notes yet.",createCreditNoteButton:"Create Credit Note",emptyStateDescription:"Bring in your historical credit note data by importing your credit note csv file",emptyStateTitle:"No Credit Notes Yet",searchPlaceholder:"Search by customer or credit note"},invoicingCustomerDetail:{paymentMethodSavedTitle:"Payment method saved",paymentMethodSavedDescription:"The payment method has been added and is now the default. Existing payment methods are kept, and future invoices can be collected automatically.",addPaymentMethod:"Add Payment Method",addPaymentMethodSubtitle:"Securely add a bank account or card to collect invoice payments.",connectStripeNotice:"Connect a Stripe account in Settings › Payment Destination before adding a payment method.",securedByStripeAndPlaid:"Secured by Stripe & Plaid.",countryAustralia:"Australia",countryCanada:"Canada",countryGermany:"Germany",countryFrance:"France",countryUnitedKingdom:"United Kingdom",countryIndia:"India",countryJapan:"Japan",countrySingapore:"Singapore",countryUnitedStates:"United States",netTermsDueImmediately:"Due immediately",createPromotionalCreditsSubtitle:"Add promotional credits to this customer&apos;s balance. Credits are applied automatically on the next invoice before tax.",currentPromotionalCreditsBalance:"Current balance",promotionalCreditAmountRequired:"Enter a positive amount.",promotionalCreditDescriptionRequired:"Description is required.",promotionalCreditDescriptionPlaceholder:"e.g. Welcome bonus",promotionalCreditsAddedTitle:"Promotional credits added",promotionalCreditsAddedDescription:"The customer's promotional credit balance has been updated.",customerSince:"Customer Since",sincePrefix:"Since ",lifetimeValue:"Lifetime Value",promotionalCredits:"Promotional Credits",refundableCredits:"Refundable Credits",excessPayments:"Excess Payments",unbilledCharges:"Unbilled Charges",maskedDigitsPrefix:"•••• ",maskedDigitsMiddle:" •••• ",expires:"Expires",customerNotFound:"Customer not found.",taxable:"taxable",netDashPrefix:"Net-",streetAddress:"Street Address",balances:"Balances",connectStripeTooltip:"Connect a Stripe account in Settings › Payment Destination first",paymentMethods:"Payment Methods",connectStripeBefore:"Connect your Stripe account in",settingsPaymentDestination:"Settings › Payment Destination",connectStripeAfter:"to add payment methods.",invoicePaymentDetails:"Invoice payment details:",customerEmailPlaceholder:"customer@email.com",emailPaymentLinkTooltip:"Email the customer a link to add their payment details",collectAchHint:"We will email the customer to provide their ACH details.",paymentLinkSentTo:"Payment link sent to ",copyPaymentLink:"Copy payment link",sendPaymentLinkFailed:"Failed to send payment link.",default:"Default",noPaymentMethodOnFile:"No payment method on file",previewEmailHeading:"Preview email",previewEmailSubtitle:"Edit the subject and message; the preview updates as you type.",previewEmailFrameTitle:"Rendered payment link email preview",previewEmailLoading:"Loading the branded email preview…",previewEmailUnavailable:"The email preview is unavailable right now. You can still send the payment link.",previewEmailFailed:"Could not load the email preview.",previewEmailRetry:"Retry",previewEmailSend:"Send email",previewEmailMessageLabel:"Message",previewEmailSubjectRequired:"Enter an email subject.",previewEmailBodyRequired:"Enter an email message.",sending:"Sending…",noSubscriptions:"No subscriptions.",recentInvoices:"Recent Invoices",noInvoices:"No invoices.",addNoteAboutCustomer:"Add a note about this customer"},invoicingCustomerForm:{validationEnterEmail:"Enter an email for this customer.",customerDetailsDescription:"Primary contact for billing and invoices",customerTypeLabel:"Customer Type",billingAddressSectionDescription:"Enter your company's official billing address for invoicing.",addSecondaryInfoPlaceholder:"Add secondary info (Optional)",addressSecondaryHint:"Example: Address on your driver&apos;s license",addBillingAddressButton:"Add billing address",billingSettingsDescription:"Tax IDs, currency, and payment defaults",billingSettingsTitle:"Billing Settings",customerTypeResidential:"Residential",netTermImmediate:"Immediate",taxabilityExempt:"Exempt"},invoicingCustomerList:{noCustomersMatchSearch:"No customers match your search.",noCustomersYet:"No customers yet.",importCustomersDescription:"Bring in your historical customers by importing your customers csv file",noCustomerYetTitle:"No Customer Yet"},invoicingDataImport:{inSync:"In Sync",skippedSuffix:" Skipped",warningsSuffix:" Warnings",newImport:"New Import",chargebeeImportFailed:"Chargebee import failed",chargebeeImportInProgress:"Chargebee import in progress",csvImportFailed:"CSV import failed",csvImportInProgress:"CSV import in progress",viewDetails:"View details",records:"records",bulletSeparator:" • ",lastImportReversible:"Last import is reversible",recordsBulletSeparator:"records • ",rollback:"Rollback",importedModules:"Imported Modules",module:"Module",recordsColumn:"Records",lastImported:"Last Imported",loadingImportStatus:"Loading import status…",noImportedRecords:"No imported records yet. Start a new import to populate this table.",templateProductCatalogPlans:"Product Catalog (Plans)",templateCouponsAndDiscounts:"Coupons & Discounts",chargebeeStepSettingsImportExport:"Chargebee → Settings → Import & Export → Export",chargebeeStepDetailModulesList:"Plans, add-ons, one-time charges, customers, subscriptions, invoices, credit notes",chargebeeStepDetailPickAllTime:'Pick "All time" range. CSV format. Default columns are fine.',chargebeeStepExportModule:"Export the module you want",chargebeeStepDropCsvFiles:"Drop the .CSV files above",capsuleIssuesSuffix:" Issues",capsuleReady:"Ready",scanningCaptionCsv:"Larger exports can take a few minutes — you can leave this page, it keeps running.",scanningCaptionChargebee:"This can take a moment for larger accounts — you can leave this page, it keeps running.",scanningLabelCsv:"Reading your uploaded files…",defaultImportErrorMessage:"Something went wrong during import.",backToDataImport:"Back to Data Import",migrateHeading:"Migrate from Chargebee → Zeni",migrateSubtitle:"Connect Chargebee or drop your CSV exports — we’ll handle the rest.",connectWithChargebee:"Connect with Chargebee",importFromChargebee:"Import from Chargebee",connectedToChargebee:"Connected to {site}",chargebeeConnectedLabel:"Connected to Chargebee",buttonFetchFromChargebee:"Fetch from Chargebee",chargebeeNotConnectedMessage:"Connect Chargebee in Invoicing Settings → Integrations to fetch data automatically.",buttonGoToIntegrations:"Connect Chargebee in Settings",connectPullEverything:"Pull everything automatically — fully linked, no CSV juggling.",connectingToChargebee:"Connecting to Chargebee…",fieldLabelChargebeeSite:"Chargebee site",sitePlaceholderAcme:"acme",fieldHintSiteSubdomain:`The subdomain in your Chargebee URL — e.g. acme in
358
358
  acme.chargebee.com.`,fieldLabelApiKey:"API key",fieldLabelApiKeySavedSuffix:" (saved)",apiKeyPlaceholderUsingSaved:"Using saved API key",apiKeyPlaceholderLive:"live_xxxxxxxxxxxxxxxx",fieldHintApiKeyReuse:"Leave blank to reuse your saved API key.",fieldHintApiKeyLocation:"Settings → Configure Chargebee → API Keys & Webhooks.",connectReadOnlyAccess:`Read-only access. We never store your billing data without
359
359
  confirmation.`,dividerOrImportCsv:"or import from CSV instead",downloadBlankTemplateHeader:"Don’t have a Chargebee export yet? Download a blank template",buttonDownloadAllZip:"Download All (Zip)",csvExtensionSuffix:".csv",orExportDirectly:"Or export directly from Chargebee",followStepsBelow:"Follow the steps below",stepDetailLetterSeparator:". ",uploadingExtractingFiles:"Uploading & extracting your files…",dropzoneStrongDropOrUpload:"Drop or upload",dropzoneTitleRest:`your CSV or ZIP exports
360
360
  here`,dropzoneMetaSupportedFiles:"Chargebee .zip bundles and individual .csv files are both supported",recordsSuffix:" records",afterSkippingPrefix:"After skipping ",issuesRollbackSuffix:` issues · Rollback
@@ -23906,7 +23906,7 @@ to {
23906
23906
  ${({isMenuVisible:e})=>e===!1?pe`
23907
23907
  display: none;
23908
23908
  `:null};
23909
- `,P_e=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)"})))),K5e=g.lazy(()=>r4(()=>import("./index-lKgP1B52.js"),__vite__mapDeps([13,5,1,6])));function GVo({src:e,autoPlay:t=!0,config:r,controls:n=!0,height:a="100%",isModalOpen:l,loop:c=!1,muted:d=!1,showPlayButton:p=!1,style:u,thumbnail:h,width:m="100%",onEnded:f,onModalClose:x,onPlay:y}){const b=je(),[w,v]=g.useState(!1);g.useEffect(()=>{l===!0&&t?v(!0):l===!1&&v(!1)},[l,t]);const A={};r?.youtube&&(A.youtube=r.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?Fn.createPortal(s.jsx(JVo,{windowSize:b,role:"presentation",children:s.jsx(cr,{onClickAway:E,children:s.jsx(XVo,{windowSize:b,"data-testid":"video-player-modal",children:s.jsxs(eQo,{children:[p&&!w&&s.jsxs(s.Fragment,{children:[h!=null&&h!==""&&s.jsx(ZVo,{src:h,alt:"Video thumbnail"}),s.jsx(KVo,{onClick:S,children:s.jsx(qVo,{windowSize:b})})]}),(!p||w)&&s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:"100%",height:"100%"}}),children:s.jsx(K5e,{src:e,playing:w,controls:n,muted:d,loop:c,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(K5e,{src:e,playing:w,controls:n,muted:d,loop:c,width:m,height:a,style:u,light:p&&!w?h??!0:!1,onEnded:I,onPlay:L,config:A})})}const YVo=_t`
23909
+ `,P_e=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)"})))),K5e=g.lazy(()=>r4(()=>import("./index-B84g_66Z.js"),__vite__mapDeps([13,5,1,6])));function GVo({src:e,autoPlay:t=!0,config:r,controls:n=!0,height:a="100%",isModalOpen:l,loop:c=!1,muted:d=!1,showPlayButton:p=!1,style:u,thumbnail:h,width:m="100%",onEnded:f,onModalClose:x,onPlay:y}){const b=je(),[w,v]=g.useState(!1);g.useEffect(()=>{l===!0&&t?v(!0):l===!1&&v(!1)},[l,t]);const A={};r?.youtube&&(A.youtube=r.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?Fn.createPortal(s.jsx(JVo,{windowSize:b,role:"presentation",children:s.jsx(cr,{onClickAway:E,children:s.jsx(XVo,{windowSize:b,"data-testid":"video-player-modal",children:s.jsxs(eQo,{children:[p&&!w&&s.jsxs(s.Fragment,{children:[h!=null&&h!==""&&s.jsx(ZVo,{src:h,alt:"Video thumbnail"}),s.jsx(KVo,{onClick:S,children:s.jsx(qVo,{windowSize:b})})]}),(!p||w)&&s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:"100%",height:"100%"}}),children:s.jsx(K5e,{src:e,playing:w,controls:n,muted:d,loop:c,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(K5e,{src:e,playing:w,controls:n,muted:d,loop:c,width:m,height:a,style:u,light:p&&!w?h??!0:!1,onEnded:I,onPlay:L,config:A})})}const YVo=_t`
23910
23910
  0% {
23911
23911
  transform: rotate(0deg);
23912
23912
  }
@@ -97014,7 +97014,7 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
97014
97014
  `,Bvi=i(HX)`
97015
97015
  color: ${e=>e.theme.colors.alert};
97016
97016
  margin-top: ${o.sp2};
97017
- `;var Pvi=pet();const Lw=Xq(Pvi);class Dvi{getSignedInUser(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t!=null)return this.readEncryptedJSON(this.ZENI_SIGNED_IN_USER,t)}getShowNegativeAmountInParenthesis(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);return t==null?!1:this.readEncryptedJSON(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,t)??!1}getShowNegativeAmountInParenthesisPDF(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);return t==null?!0:this.readEncryptedJSON(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,t)??!0}getSignedInUserTenant(t){return this.getSignedInUserTenants()?.find(r=>r.tenantEmailDomain===t)}getSignedInUserTenantWithId(t){return this.getSignedInUserTenants()?.find(r=>r.tenantId===t)}getForceRefreshedComponents(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);return t==null?[]:this.readEncryptedJSON(this.ZENI_FORCE_REFRESHED_COMPONENTS,t)??[]}saveForceRefreshedComponents(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);r!=null?window.localStorage.setItem(this.ZENI_FORCE_REFRESHED_COMPONENTS,this.encrypt(JSON.stringify(t),r)):console.warn("Can't update the force refreshed components when the user is logged out!")}saveSignedInUserWithSession(t,r){if(t==null||r==null)throw new Error("Can't accept nil for user or session Id");window.localStorage.getItem(this.ZENI_SESSION_ID)!==r&&this.clearSessionKeyedEntries(),window.localStorage.setItem(this.ZENI_SESSION_ID,r),window.localStorage.setItem(this.ZENI_SIGNED_IN_USER,this.encrypt(JSON.stringify(t),r))}saveSignedInUserTenants(t,r){const n=r??window.localStorage.getItem(this.ZENI_SESSION_ID);n!=null?window.localStorage.setItem(this.ZENI_SIGNED_IN_USER_TENANTS,this.encrypt(JSON.stringify(t),n)):console.warn("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesis(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);if(r!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.encrypt(JSON.stringify(t),r));else throw new Error("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesisPDF(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);if(r!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.encrypt(JSON.stringify(t),r));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(r=>window.localStorage.getItem(r)!=null).reduce((r,n)=>r&&n)}clearAll(){this.ALL_IDs.forEach(t=>window.localStorage.removeItem(t))}setTheme(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);r!=null&&window.localStorage.setItem(this.ZENI_THEME,this.encrypt(t,r))}getTheme(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t==null)return;const r=this.readEncryptedString(this.ZENI_THEME,t);if(r!=null){if(r!=="light"&&r!=="dark"){window.localStorage.removeItem(this.ZENI_THEME);return}return r}}encrypt(t,r){return Lw.AES.encrypt(t,r).toString()}decrypt(t,r){try{const n=Lw.AES.decrypt(t,r).toString(Lw.enc.Utf8);return n===""?void 0:n}catch{return}}readEncryptedString(t,r){const n=window.localStorage.getItem(t);if(n==null)return;const a=this.decrypt(n,r);return a==null&&window.localStorage.removeItem(t),a}readEncryptedJSON(t,r){const n=this.readEncryptedString(t,r);if(n!=null)try{const a=JSON.parse(n);if(a===null){window.localStorage.removeItem(t);return}return a}catch{window.localStorage.removeItem(t);return}}getSignedInUserTenants(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t!=null)return this.readEncryptedJSON(this.ZENI_SIGNED_IN_USER_TENANTS,t)}clearSessionKeyedEntries(){this.SESSION_KEYED_IDs.forEach(t=>window.localStorage.removeItem(t))}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";SESSION_KEYED_IDs=[this.ZENI_SIGNED_IN_USER_TENANTS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.ZENI_THEME,this.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 As=new Dvi,Tvi=({children:e})=>{const t=iet("(prefers-color-scheme: dark)"),[r,n]=$.useState({dark:t});g.useEffect(()=>{const p=As.getTheme()==null?t:As.getTheme()==="dark";r.dark!==p&&n({dark:p})},[r,t]);const a=()=>{const p=!r.dark;As.setTheme(p?"dark":"light"),n({...r,dark:p})},l=r.dark?OMo():FMo(),c=typeof window<"u"?window.__NONCE__:void 0,d=c!=null&&c.length>0?c:void 0;return Co.jsx(eko,{dark:r.dark,webAppTheme:l,toggle:a,nonce:d,children:e})},zvi=["sandbox","production"],Rvi=e=>X4(e,zvi),Fvi=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"}},Ovi=["development","staging","production"],Nvi=e=>X4(e,Ovi),Hvi=e=>{switch(e){case"QA":case"PUNE":case"SUNNYVALE":case"DELHI":case"MOHALI":return"staging";case"PROD":case"NEXT":return"production";default:return"development"}},_vi=["DEV","QA","PUNE","SUNNYVALE","DELHI","MOHALI","PROD","NEXT"],Vvi=e=>X4(e,_vi),o1=Vvi("QA"),Pv=()=>o1==="DEV"||o1==="QA"||o1==="PUNE"||o1==="SUNNYVALE"||o1==="DELHI"||o1==="MOHALI",Joe="https://zeni-webapp-qa.uc.r.appspot.com",Qvi="ed1936cb971f6aad4104ddbe708f812c",u4n=Rvi(Fvi(o1)),Uvi=Nvi(Hvi(o1));function Wvi(e,t){return Lw.AES.decrypt(e,t).toString(Lw.enc.Utf8)}const Gvi="ZENI-WEB-APP-",jZe=o1==="DEV"||o1==="QA"?.2:.8,Sa={sentryDsn:"",sentryTraceSamplingRate:jZe,googleClientId:"",googleMapsAPIKey:"",microsoftClientId:"",mixpanelToken:"",pusherClientSecret:"",pusherCluster:"",quickbooksKey:"",appUrl:"",featureClientSecret:"",featureClientSecretCockpit:"",cardVaultId:"",stripeKey:"",qboRedirectionUrl:"",mixpanelUrl:"",mixpanelHMUrl:""};let J4,Xoe;function Yvi(e){Sa.sentryDsn=e.keys.SENTRY_DSN,Sa.sentryTraceSamplingRate=e.keys.SENTRY_TRACE_SAMPLE_RATES!=null?parseInt(e.keys.SENTRY_TRACE_SAMPLE_RATES):jZe,Sa.googleClientId=e.keys.GOOGLE_CLIENT_ID,Sa.googleMapsAPIKey=e.keys.GOOGLE_MAP_KEY,Sa.microsoftClientId=e.keys.MICROSOFT_CLIENT_ID,Sa.mixpanelToken=e.keys.MIXPANEL_TOKEN,Sa.pusherClientSecret=e.keys.PUSHER_CLIENT_SECRET,Sa.pusherCluster=e.keys.PUSHER_CLUSTER,Sa.quickbooksKey=e.keys.QUICKBOOK_TOKEN,Sa.appUrl=e.keys.WEB_ENDPOINT,Sa.featureClientSecret=e.keys.STATSIG_CLIENT_SECRET,Sa.featureClientSecretCockpit=e.keys.STATSIG_CLIENT_SECRET_COCKPIT,Sa.cardVaultId=e.keys.UNIT_VAULT_ID,Sa.stripeKey=e.keys.STRIPE_KEY,Sa.qboRedirectionUrl=e.keys.QBO_URL,Sa.mixpanelUrl=e.keys.MIXPANEL_URL,Sa.mixpanelHMUrl=e.keys.MIXPANEL_HM_URL,Xoe=e.externalEndPoints,J4=e.apiEndPoints,Kvi()}function Kvi(){try{const e=new Set;if(J4!=null){for(const t of Object.values(J4))if(typeof t=="string"&&t.startsWith("http"))try{e.add(new URL(t).origin)}catch{}}for(const t of e){const r=document.createElement("link");r.rel="preconnect",r.href=t,r.crossOrigin="anonymous",document.head.appendChild(r)}}catch{}}async function qvi(){const t=encodeURIComponent(JSON.stringify({environment:o1}));try{const r=await fetch(`${Joe}/api/keys?query=${t}`);if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return await r.json()}catch(r){return console.error("Error fetching details:",r),null}}let $$e=!1;function Kb(){$$e||(Yu.init(Qvi,{api_host:Xoe.mixpanelBaseUrl,ignore_dnt:!0,store_google:!1,track_marketing:!1}),$$e=!0)}let k$e=!1,S$e=!1;function MZe(){if(k$e)return;k$e=!0,Kb();const e=pl.extractUtmParamsFromUrl();Object.keys(e).length>0&&Yu.register(e),Pv()&&console.log(`[UTM] first-touch bootstrap: ${JSON.stringify(e)}`)}function Zvi(){return Yu?.persistence?.props??null}const Jvi=new Set(["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"]);function Xvi(){const e=Zvi();if(e==null)return;const t=Object.keys(e).filter(r=>r.startsWith("utm_")||Jvi.has(r));for(const r of t)Yu.unregister(r);Pv()&&t.length>0&&console.log(`[UTM] cleared from cookie: ${JSON.stringify(t)}`)}function eCi(){S$e||(S$e=!0,Xvi())}class t4{identify(t,r){if(Kb(),this.#o=t,t!=null&&r!=null&&(t4.#t==null||HXe({userId:t,traits:r},t4.#t)!==!0)){const{$email:n,...a}={...r};Yu.identify(t),n&&n!=null&&Yu.people.set_once({$email:n}),Yu.people.set(a),t4.#t={userId:t,traits:r},Pv()&&console.log(`*** Called people set with userId ${t} traits ${JSON.stringify(r)} `)}}identifyUserAndCompany(t,r,n,a,l){throw Error("Use identify in the web-app!!")}track(t,r){if(Kb(),this.#o==null){console.error("user is not identified :(, so can not fire event");return}MZe();const n={distinct_id:this.#o,...r};Yu.track(t,n),eCi(),Pv()&&console.log(`*** firing ${t} with props ${JSON.stringify(r)}`)}alias(t,r){Kb(),Yu.alias(t,r)}reset(){Kb(),Yu.reset(),this.#o=void 0,t4.#t=void 0}static get analytics(){return this.#e}static#e=new pl.Analytics(new t4);static#t;#o}const Vm=t4.analytics;function tCi(){MZe()}const oCi=()=>{const e=gj(),t=yh(r=>r.companyState);if(e.pathname.includes("/management/parent/")){const r=e.pathname.split("/")[3],n=t.companiesById[r];if(n!=null)return`${n.companyInfo.name} ${W.getLocalizedStrings().cockpit.cockpitHeaderSubsidiaryText}`}if(e.pathname.includes("management/month-end-report/company/")){const r=e.pathname.split("/")[4],n=t.companiesById[r];if(n!=null)return n.companyInfo.name}},E$e=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}},h4n=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 rCi(e,t){return{updateDownloadStateHandler:r=>{e(_Xe(r))},onZeniLogoClick:()=>{t.themeState.toggle()},onLogOutClick:()=>{e(_W()),e(VW(!1)),As.clearAll();const r=t.locationHook.state?.origin??"/";t.navigate(r,{replace:!0})},onNewCustomerClick:()=>{t.navigate("/onboarding/new"),Vm?.trackOnboardingNewCustomerStarted()},onThreadClick:(r,n,a)=>{const l=r.entityType.split(".");if(l.length===2){const c=ACe(l[0]);if(c!=null){const d=E$e(c);t.navigate(`/${d}`),a(r,n)}else console.warn(`Invalid navigation target in thread: ${l[0]}`)}},onNotificationClick:(r,n,a)=>{const l=r.entityType.split(".");if(r.isGlobalComment&&l.length===2){const c=ACe(l[0]);if(c!=null){const d=E$e(c);t.navigate(`/${d}`),a(r,n)}else console.warn(`Invalid navigation target in notification: ${l[0]}`)}}}}function iCi(e,t){const{signedInUser:r,cockpitHeader:n}=t,a=e.tenantState.currentTenantId,c=bj(e)?.companyName??"",d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:a??""};return{signedInUser:r,cockpitHeader:n,downloadState:e.companyViewState.downloadState,downloadParams:{currentTenantCompanyName:c,cockpitEndPoint:`${Joe}/cockpitTabs`,authParams:d}}}const nCi=zJe(iCi,rCi)(Ani);function aCi(){const e=ONe(),t=As.getSignedInUser(),r=eZ(),n=gj(),a=oCi(),l=yh(p=>VXe(p)),c={tabsFileType:"excel",tabs:["management","subscription","portfolio","onboarding","healthMonitor"],filterByTabs:l.filterByTabs,timezone:QXe()},d=n.pathname.split("/")[1];return Co.jsx(nCi,{locationHook:n,themeState:e,signedInUser:t,cockpitHeader:a,allTabsViews:l,defaultOptions:c,analytics:Vm,currentTab:d,navigate:r})}const sCi=["/management/*","/subscription/*","/onboarding/*","/portfolio/*","/audit/*","/health-monitor/*","/task-manager/*","/ai-accountant/*","/credit-agent/*"];function lCi({appContent:e}){const t=sCi.filter(r=>RJe(r)).length===0;return Co.jsxs(Co.Fragment,{children:[t?null:Co.jsx(aCi,{}),Co.jsx(Co.Fragment,{children:e})]})}const cCi="cockpit",BZe="init-enter";function dCi({location:e,visitedUrl:t}){const{pathname:r}=e;return g.useLayoutEffect(()=>{const n=t.get(r||BZe);L$e(n!==void 0?n:0)}),null}const pCi=g.memo(dCi,(e,t)=>{const{location:r,visitedUrl:n}=e,{location:a}=t,l=r.pathname||BZe,c=uCi();return n.set(l,c),!((a.pathname!==r.pathname||a.search!==r.search)&&a.hash==="")}),L$e=(e=0)=>window.requestAnimationFrame(()=>{window.scrollTo(0,e)}),uCi=()=>{let e=0;return document!=null&&document.documentElement!==null&&(e=document.documentElement.scrollTop),window.pageYOffset||e},PZe=e=>g.lazy(async()=>{const t=e.toString(),r=As.getForceRefreshedComponents(),n=new Set(r),a=n.has(t);try{const l=await e();return n.delete(t),As.saveForceRefreshedComponents(Array.from(n)),l}catch(l){throw a||(n.add(t),As.saveForceRefreshedComponents(Array.from(n)),location.reload()),l}}),hCi=PZe(()=>r4(()=>import("./ScreenRoutes-BYm2ki6f.js").then(e=>e.S),__vite__mapDeps([14,5,1,6,15,8,16,17,7,2,4,9,11]))),mCi=PZe(()=>r4(()=>import("./SignInScreen-DFK5dZ2x.js"),__vite__mapDeps([18,15,1,6,8,5,16,17,19,20,21,7])));function gCi(){const e=g.useRef();e.current==null&&(e.current=new Map);const t=eZ(),r=gj();return g.useEffect(()=>{tCi()},[]),g.useEffect(()=>{const n="signin/auth";As.isSignedIn()===!1&&!r.pathname.includes(n)&&t(n,{replace:!0,state:{...r.state,message:"...",origin:r.pathname}})}),Co.jsxs(yCi,{children:[Co.jsx(pCi,{visitedUrl:e.current,location:r}),Co.jsx(fCi,{})]})}const fCi=()=>{const e=As.isSignedIn(),t=As.getSignedInUser(),r=e&&N$e(t),n=yh(p=>bj(p)),a={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:n.tenantId??""},l=yh(p=>UXe(p)),d=yh(p=>WXe(p)).map(p=>({companyId:p.companyId,tenantId:p.tenantId,companyName:p.name}));return Co.jsx(gUr,{roomId:cCi,authParams:a,users:l,companies:d,authUrlEndPoint:`${J4.tenantMicroServiceBaseUrl}/1.0/commenting/auth`,fetchZeniUsers:!1,commentingUsersUrlEndPoint:`${J4.tenantMicroServiceBaseUrl}/1.0/users/zeni-users`,autoConnect:r,withRoomProvider:!1,loggedInUser:t,withThreadsProvider:!0,filter:{application:"cockpit"},children:Co.jsx(xCi,{})})},xCi=()=>Co.jsx(g.Suspense,{fallback:Co.jsx(bCi,{children:Co.jsx(Ao,{size:"Large",start:!0})}),children:Co.jsxs(FJe,{children:[Co.jsx(hT,{path:"/",element:Co.jsx(OJe,{to:"management",replace:!0})}),Co.jsx(hT,{path:"/signin/auth",element:Co.jsx(mCi,{})}),Co.jsx(hT,{path:"*",element:Co.jsx(lCi,{appContent:Co.jsx(hCi,{})})})]})}),yCi=eo("div")``,bCi=eo("div")`
97017
+ `;var Pvi=pet();const Lw=Xq(Pvi);class Dvi{getSignedInUser(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t!=null)return this.readEncryptedJSON(this.ZENI_SIGNED_IN_USER,t)}getShowNegativeAmountInParenthesis(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);return t==null?!1:this.readEncryptedJSON(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,t)??!1}getShowNegativeAmountInParenthesisPDF(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);return t==null?!0:this.readEncryptedJSON(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,t)??!0}getSignedInUserTenant(t){return this.getSignedInUserTenants()?.find(r=>r.tenantEmailDomain===t)}getSignedInUserTenantWithId(t){return this.getSignedInUserTenants()?.find(r=>r.tenantId===t)}getForceRefreshedComponents(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);return t==null?[]:this.readEncryptedJSON(this.ZENI_FORCE_REFRESHED_COMPONENTS,t)??[]}saveForceRefreshedComponents(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);r!=null?window.localStorage.setItem(this.ZENI_FORCE_REFRESHED_COMPONENTS,this.encrypt(JSON.stringify(t),r)):console.warn("Can't update the force refreshed components when the user is logged out!")}saveSignedInUserWithSession(t,r){if(t==null||r==null)throw new Error("Can't accept nil for user or session Id");window.localStorage.getItem(this.ZENI_SESSION_ID)!==r&&this.clearSessionKeyedEntries(),window.localStorage.setItem(this.ZENI_SESSION_ID,r),window.localStorage.setItem(this.ZENI_SIGNED_IN_USER,this.encrypt(JSON.stringify(t),r))}saveSignedInUserTenants(t,r){const n=r??window.localStorage.getItem(this.ZENI_SESSION_ID);n!=null?window.localStorage.setItem(this.ZENI_SIGNED_IN_USER_TENANTS,this.encrypt(JSON.stringify(t),n)):console.warn("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesis(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);if(r!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.encrypt(JSON.stringify(t),r));else throw new Error("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesisPDF(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);if(r!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.encrypt(JSON.stringify(t),r));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(r=>window.localStorage.getItem(r)!=null).reduce((r,n)=>r&&n)}clearAll(){this.ALL_IDs.forEach(t=>window.localStorage.removeItem(t))}setTheme(t){const r=window.localStorage.getItem(this.ZENI_SESSION_ID);r!=null&&window.localStorage.setItem(this.ZENI_THEME,this.encrypt(t,r))}getTheme(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t==null)return;const r=this.readEncryptedString(this.ZENI_THEME,t);if(r!=null){if(r!=="light"&&r!=="dark"){window.localStorage.removeItem(this.ZENI_THEME);return}return r}}encrypt(t,r){return Lw.AES.encrypt(t,r).toString()}decrypt(t,r){try{const n=Lw.AES.decrypt(t,r).toString(Lw.enc.Utf8);return n===""?void 0:n}catch{return}}readEncryptedString(t,r){const n=window.localStorage.getItem(t);if(n==null)return;const a=this.decrypt(n,r);return a==null&&window.localStorage.removeItem(t),a}readEncryptedJSON(t,r){const n=this.readEncryptedString(t,r);if(n!=null)try{const a=JSON.parse(n);if(a===null){window.localStorage.removeItem(t);return}return a}catch{window.localStorage.removeItem(t);return}}getSignedInUserTenants(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t!=null)return this.readEncryptedJSON(this.ZENI_SIGNED_IN_USER_TENANTS,t)}clearSessionKeyedEntries(){this.SESSION_KEYED_IDs.forEach(t=>window.localStorage.removeItem(t))}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";SESSION_KEYED_IDs=[this.ZENI_SIGNED_IN_USER_TENANTS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.ZENI_THEME,this.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 As=new Dvi,Tvi=({children:e})=>{const t=iet("(prefers-color-scheme: dark)"),[r,n]=$.useState({dark:t});g.useEffect(()=>{const p=As.getTheme()==null?t:As.getTheme()==="dark";r.dark!==p&&n({dark:p})},[r,t]);const a=()=>{const p=!r.dark;As.setTheme(p?"dark":"light"),n({...r,dark:p})},l=r.dark?OMo():FMo(),c=typeof window<"u"?window.__NONCE__:void 0,d=c!=null&&c.length>0?c:void 0;return Co.jsx(eko,{dark:r.dark,webAppTheme:l,toggle:a,nonce:d,children:e})},zvi=["sandbox","production"],Rvi=e=>X4(e,zvi),Fvi=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"}},Ovi=["development","staging","production"],Nvi=e=>X4(e,Ovi),Hvi=e=>{switch(e){case"QA":case"PUNE":case"SUNNYVALE":case"DELHI":case"MOHALI":return"staging";case"PROD":case"NEXT":return"production";default:return"development"}},_vi=["DEV","QA","PUNE","SUNNYVALE","DELHI","MOHALI","PROD","NEXT"],Vvi=e=>X4(e,_vi),o1=Vvi("DEV"),Pv=()=>o1==="DEV"||o1==="QA"||o1==="PUNE"||o1==="SUNNYVALE"||o1==="DELHI"||o1==="MOHALI",Joe="https://zeni-webapp-dev.uc.r.appspot.com",Qvi="63d3a2406505a5737a2b4debdb513f20",u4n=Rvi(Fvi(o1)),Uvi=Nvi(Hvi(o1));function Wvi(e,t){return Lw.AES.decrypt(e,t).toString(Lw.enc.Utf8)}const Gvi="ZENI-WEB-APP-",jZe=o1==="DEV"||o1==="QA"?.2:.8,Sa={sentryDsn:"",sentryTraceSamplingRate:jZe,googleClientId:"",googleMapsAPIKey:"",microsoftClientId:"",mixpanelToken:"",pusherClientSecret:"",pusherCluster:"",quickbooksKey:"",appUrl:"",featureClientSecret:"",featureClientSecretCockpit:"",cardVaultId:"",stripeKey:"",qboRedirectionUrl:"",mixpanelUrl:"",mixpanelHMUrl:""};let J4,Xoe;function Yvi(e){Sa.sentryDsn=e.keys.SENTRY_DSN,Sa.sentryTraceSamplingRate=e.keys.SENTRY_TRACE_SAMPLE_RATES!=null?parseInt(e.keys.SENTRY_TRACE_SAMPLE_RATES):jZe,Sa.googleClientId=e.keys.GOOGLE_CLIENT_ID,Sa.googleMapsAPIKey=e.keys.GOOGLE_MAP_KEY,Sa.microsoftClientId=e.keys.MICROSOFT_CLIENT_ID,Sa.mixpanelToken=e.keys.MIXPANEL_TOKEN,Sa.pusherClientSecret=e.keys.PUSHER_CLIENT_SECRET,Sa.pusherCluster=e.keys.PUSHER_CLUSTER,Sa.quickbooksKey=e.keys.QUICKBOOK_TOKEN,Sa.appUrl=e.keys.WEB_ENDPOINT,Sa.featureClientSecret=e.keys.STATSIG_CLIENT_SECRET,Sa.featureClientSecretCockpit=e.keys.STATSIG_CLIENT_SECRET_COCKPIT,Sa.cardVaultId=e.keys.UNIT_VAULT_ID,Sa.stripeKey=e.keys.STRIPE_KEY,Sa.qboRedirectionUrl=e.keys.QBO_URL,Sa.mixpanelUrl=e.keys.MIXPANEL_URL,Sa.mixpanelHMUrl=e.keys.MIXPANEL_HM_URL,Xoe=e.externalEndPoints,J4=e.apiEndPoints,Kvi()}function Kvi(){try{const e=new Set;if(J4!=null){for(const t of Object.values(J4))if(typeof t=="string"&&t.startsWith("http"))try{e.add(new URL(t).origin)}catch{}}for(const t of e){const r=document.createElement("link");r.rel="preconnect",r.href=t,r.crossOrigin="anonymous",document.head.appendChild(r)}}catch{}}async function qvi(){const t=encodeURIComponent(JSON.stringify({environment:o1}));try{const r=await fetch(`${Joe}/api/keys?query=${t}`);if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return await r.json()}catch(r){return console.error("Error fetching details:",r),null}}let $$e=!1;function Kb(){$$e||(Yu.init(Qvi,{api_host:Xoe.mixpanelBaseUrl,ignore_dnt:!0,store_google:!1,track_marketing:!1}),$$e=!0)}let k$e=!1,S$e=!1;function MZe(){if(k$e)return;k$e=!0,Kb();const e=pl.extractUtmParamsFromUrl();Object.keys(e).length>0&&Yu.register(e),Pv()&&console.log(`[UTM] first-touch bootstrap: ${JSON.stringify(e)}`)}function Zvi(){return Yu?.persistence?.props??null}const Jvi=new Set(["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"]);function Xvi(){const e=Zvi();if(e==null)return;const t=Object.keys(e).filter(r=>r.startsWith("utm_")||Jvi.has(r));for(const r of t)Yu.unregister(r);Pv()&&t.length>0&&console.log(`[UTM] cleared from cookie: ${JSON.stringify(t)}`)}function eCi(){S$e||(S$e=!0,Xvi())}class t4{identify(t,r){if(Kb(),this.#o=t,t!=null&&r!=null&&(t4.#t==null||HXe({userId:t,traits:r},t4.#t)!==!0)){const{$email:n,...a}={...r};Yu.identify(t),n&&n!=null&&Yu.people.set_once({$email:n}),Yu.people.set(a),t4.#t={userId:t,traits:r},Pv()&&console.log(`*** Called people set with userId ${t} traits ${JSON.stringify(r)} `)}}identifyUserAndCompany(t,r,n,a,l){throw Error("Use identify in the web-app!!")}track(t,r){if(Kb(),this.#o==null){console.error("user is not identified :(, so can not fire event");return}MZe();const n={distinct_id:this.#o,...r};Yu.track(t,n),eCi(),Pv()&&console.log(`*** firing ${t} with props ${JSON.stringify(r)}`)}alias(t,r){Kb(),Yu.alias(t,r)}reset(){Kb(),Yu.reset(),this.#o=void 0,t4.#t=void 0}static get analytics(){return this.#e}static#e=new pl.Analytics(new t4);static#t;#o}const Vm=t4.analytics;function tCi(){MZe()}const oCi=()=>{const e=gj(),t=yh(r=>r.companyState);if(e.pathname.includes("/management/parent/")){const r=e.pathname.split("/")[3],n=t.companiesById[r];if(n!=null)return`${n.companyInfo.name} ${W.getLocalizedStrings().cockpit.cockpitHeaderSubsidiaryText}`}if(e.pathname.includes("management/month-end-report/company/")){const r=e.pathname.split("/")[4],n=t.companiesById[r];if(n!=null)return n.companyInfo.name}},E$e=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}},h4n=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 rCi(e,t){return{updateDownloadStateHandler:r=>{e(_Xe(r))},onZeniLogoClick:()=>{t.themeState.toggle()},onLogOutClick:()=>{e(_W()),e(VW(!1)),As.clearAll();const r=t.locationHook.state?.origin??"/";t.navigate(r,{replace:!0})},onNewCustomerClick:()=>{t.navigate("/onboarding/new"),Vm?.trackOnboardingNewCustomerStarted()},onThreadClick:(r,n,a)=>{const l=r.entityType.split(".");if(l.length===2){const c=ACe(l[0]);if(c!=null){const d=E$e(c);t.navigate(`/${d}`),a(r,n)}else console.warn(`Invalid navigation target in thread: ${l[0]}`)}},onNotificationClick:(r,n,a)=>{const l=r.entityType.split(".");if(r.isGlobalComment&&l.length===2){const c=ACe(l[0]);if(c!=null){const d=E$e(c);t.navigate(`/${d}`),a(r,n)}else console.warn(`Invalid navigation target in notification: ${l[0]}`)}}}}function iCi(e,t){const{signedInUser:r,cockpitHeader:n}=t,a=e.tenantState.currentTenantId,c=bj(e)?.companyName??"",d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:a??""};return{signedInUser:r,cockpitHeader:n,downloadState:e.companyViewState.downloadState,downloadParams:{currentTenantCompanyName:c,cockpitEndPoint:`${Joe}/cockpitTabs`,authParams:d}}}const nCi=zJe(iCi,rCi)(Ani);function aCi(){const e=ONe(),t=As.getSignedInUser(),r=eZ(),n=gj(),a=oCi(),l=yh(p=>VXe(p)),c={tabsFileType:"excel",tabs:["management","subscription","portfolio","onboarding","healthMonitor"],filterByTabs:l.filterByTabs,timezone:QXe()},d=n.pathname.split("/")[1];return Co.jsx(nCi,{locationHook:n,themeState:e,signedInUser:t,cockpitHeader:a,allTabsViews:l,defaultOptions:c,analytics:Vm,currentTab:d,navigate:r})}const sCi=["/management/*","/subscription/*","/onboarding/*","/portfolio/*","/audit/*","/health-monitor/*","/task-manager/*","/ai-accountant/*","/credit-agent/*"];function lCi({appContent:e}){const t=sCi.filter(r=>RJe(r)).length===0;return Co.jsxs(Co.Fragment,{children:[t?null:Co.jsx(aCi,{}),Co.jsx(Co.Fragment,{children:e})]})}const cCi="cockpit",BZe="init-enter";function dCi({location:e,visitedUrl:t}){const{pathname:r}=e;return g.useLayoutEffect(()=>{const n=t.get(r||BZe);L$e(n!==void 0?n:0)}),null}const pCi=g.memo(dCi,(e,t)=>{const{location:r,visitedUrl:n}=e,{location:a}=t,l=r.pathname||BZe,c=uCi();return n.set(l,c),!((a.pathname!==r.pathname||a.search!==r.search)&&a.hash==="")}),L$e=(e=0)=>window.requestAnimationFrame(()=>{window.scrollTo(0,e)}),uCi=()=>{let e=0;return document!=null&&document.documentElement!==null&&(e=document.documentElement.scrollTop),window.pageYOffset||e},PZe=e=>g.lazy(async()=>{const t=e.toString(),r=As.getForceRefreshedComponents(),n=new Set(r),a=n.has(t);try{const l=await e();return n.delete(t),As.saveForceRefreshedComponents(Array.from(n)),l}catch(l){throw a||(n.add(t),As.saveForceRefreshedComponents(Array.from(n)),location.reload()),l}}),hCi=PZe(()=>r4(()=>import("./ScreenRoutes-CUdw31xk.js").then(e=>e.S),__vite__mapDeps([14,5,1,6,15,8,16,17,7,2,4,9,11]))),mCi=PZe(()=>r4(()=>import("./SignInScreen-iQrcvFVn.js"),__vite__mapDeps([18,15,1,6,8,5,16,17,19,20,21,7])));function gCi(){const e=g.useRef();e.current==null&&(e.current=new Map);const t=eZ(),r=gj();return g.useEffect(()=>{tCi()},[]),g.useEffect(()=>{const n="signin/auth";As.isSignedIn()===!1&&!r.pathname.includes(n)&&t(n,{replace:!0,state:{...r.state,message:"...",origin:r.pathname}})}),Co.jsxs(yCi,{children:[Co.jsx(pCi,{visitedUrl:e.current,location:r}),Co.jsx(fCi,{})]})}const fCi=()=>{const e=As.isSignedIn(),t=As.getSignedInUser(),r=e&&N$e(t),n=yh(p=>bj(p)),a={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:n.tenantId??""},l=yh(p=>UXe(p)),d=yh(p=>WXe(p)).map(p=>({companyId:p.companyId,tenantId:p.tenantId,companyName:p.name}));return Co.jsx(gUr,{roomId:cCi,authParams:a,users:l,companies:d,authUrlEndPoint:`${J4.tenantMicroServiceBaseUrl}/1.0/commenting/auth`,fetchZeniUsers:!1,commentingUsersUrlEndPoint:`${J4.tenantMicroServiceBaseUrl}/1.0/users/zeni-users`,autoConnect:r,withRoomProvider:!1,loggedInUser:t,withThreadsProvider:!0,filter:{application:"cockpit"},children:Co.jsx(xCi,{})})},xCi=()=>Co.jsx(g.Suspense,{fallback:Co.jsx(bCi,{children:Co.jsx(Ao,{size:"Large",start:!0})}),children:Co.jsxs(FJe,{children:[Co.jsx(hT,{path:"/",element:Co.jsx(OJe,{to:"management",replace:!0})}),Co.jsx(hT,{path:"/signin/auth",element:Co.jsx(mCi,{})}),Co.jsx(hT,{path:"*",element:Co.jsx(lCi,{appContent:Co.jsx(hCi,{})})})]})}),yCi=eo("div")``,bCi=eo("div")`
97018
97018
  display: flex;
97019
97019
  flex: 1 1 auto;
97020
97020
  flex-direction: row;
@@ -97025,4 +97025,4 @@ ${e}`,Sci=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
97025
97025
  background-color: ${e=>e.theme.colors.background};
97026
97026
  `;function wCi(){W.updateAppLocaleID("en"),$Ci();const e=kCi(),[t,r]=g.useState(!1),n=g.useCallback(l=>{l.data?.type==="UPDATE_READY"?r(!0):l.data?.type==="HIDE_UPDATE_POPUP"&&r(!1)},[]);g.useEffect(()=>("serviceWorker"in navigator&&(navigator.serviceWorker.addEventListener("message",n),navigator.serviceWorker.addEventListener("controllerchange",()=>{r(!1)})),()=>{navigator.serviceWorker.removeEventListener("message",n)}),[n]);const a=()=>{r(!1),window.location.reload()};return Co.jsx(Tvi,{children:Co.jsx(NJe,{store:e,children:Co.jsx(C_t,{children:Co.jsxs(Wpo,{children:[t?Co.jsx(y7o,{onPrimaryClick:a}):null,Co.jsx(CCi,{})]})})})})}const hb=new GXe,vCi=()=>{const e=As.getSignedInUser(),t=yh(L=>bj(L)),r=yh(L=>ZXe(L,t.companyId)),n=gj(),a=eZ(),l=HJe(),[c,d]=g.useState(null),p=IBr(e?.userId),u=t?.excludedResources?.fetchState=="Completed"?t.excludedResources.resources:[];g.useEffect(()=>()=>{l(Bre())},[]);const h=yh(L=>JXe(L)),m=t?.externalConnections?.accounting[0]?.connectionName,f=()=>{l(Bre())},x=g.useMemo(()=>XXe(t.userRole),[t.userRole]),y=yh(L=>L.companyViewState.zeniUsers),b=g.useMemo(()=>{const L=y.fetchState==="Error"&&eet(y.error);return L&&console.warn("Auto-logout triggered due to invalid session"),L},[y.fetchState,y.error]),w=g.useMemo(()=>{const L=y.fetchState==="Error"&&tet(y.error)===!0;return L&&console.warn("Page is not accessible, show 404"),L},[y.fetchState,y.error]),v=g.useRef(!1);g.useEffect(()=>(b&&!v.current&&(v.current=!0,A()),()=>{v.current=!1}),[b]),g.useEffect(()=>{w&&window.open("/page-not-found","_self")},[w]);const A=g.useCallback(()=>{d(null),hb.stop(),l(_W()),l(VW(!1)),As.clearAll();const L=n.state?.origin??"/";a(L,{replace:!0})},[l,d,n,a]),S=g.useCallback((L="manual")=>{L==="auto-logout"?wBo({idleTimeoutMinutes:p.idleTimeoutMinutes}):ABo(),d(null),hb.stop(),l(_W()),l(VW(!1)),As.clearAll(),window.location.href="/signin/auth"},[l,d,p.idleTimeoutMinutes]);g.useEffect(()=>{if(e?.zeniSessionId!=null)return hb.start({idleTimeoutMinutes:p.idleTimeoutMinutes,warningDurationSeconds:p.warningDurationSeconds,heartbeatIntervalMinutes:p.heartbeatIntervalMinutes,isAutoLogoutEnabled:p.isAutoLogoutEnabled},{onHeartbeat:()=>l(oet()),onWarningStart:L=>{Vm.trackSessionTimeoutPopupShown(L),d(L)},onWarningTick:d,onAutoLogout:()=>{Vm.trackSessionTimeoutAutoLogout(),S("auto-logout")},onSessionExtended:()=>d(null)}),()=>hb.stop()},[e?.zeniSessionId,p.isAutoLogoutEnabled,p.idleTimeoutMinutes,p.warningDurationSeconds,p.heartbeatIntervalMinutes,l,S,d]);const E=g.useMemo(()=>As.getSignedInUser(),[]),I=g.useMemo(()=>({userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:t.tenantId??""}),[E,t.tenantId]);return Co.jsxs(nuo,{globalInfo:{loggedInUser:e,loggedInUserRole:t?.userRole,excludedResources:u,loggedInUserRoleMap:x,currentTenant:t,connectionName:m,controllersList:r},children:[Co.jsx(qpo,{toolkit:{analytics:Vm,sentry:aJe,authParams:I},children:Co.jsxs(apo,{endPoint:{url:Joe},children:[Co.jsx(LCr,{isOnDashboard:!1,showSnackbar:h.isSnackbarOpen,snackbar:{message:h.message,messageType:h.messageType,onRemoveSnackbar:f,showStatusIcon:h.showStatusIcon}}),Co.jsx(gCi,{})]})}),c!=null&&e!=null?Co.jsx(sii,{secondsRemaining:c,onContinueSession:()=>{Vm.trackSessionTimeoutClicked("continue",c),hb.continueSession()},onSignOut:()=>{Vm.trackSessionTimeoutClicked("sign_out",c),S()}}):null]})},CCi=()=>{const e=As.isSignedIn(),r=yh(n=>bj(n)).companyId;return Co.jsx(u2o,{isUserSignedIn:e,featureGateCustomFields:{companyId:r},zeniFeatureConfig:{currentFeatureEnv:Uvi,featureClientSecret:Sa.featureClientSecretCockpit,providerEndPoint:Xoe.statsigBaseUrl},children:Co.jsx(vCi,{})})},ACi=iJe(wCi);function $Ci(){console.log("Initialize any 3rd party libs!")}let FW=null;function kCi(){return FW===null&&(FW=SCi(),YXe().catch(e=>{console.error("Failed to load feature epics:",e),nJe(e,{tags:{critical:"true",module:"epicManager"}}),alert(`The application failed to load required modules. Some features may not work correctly.
97027
97027
 
97028
- Please refresh the page to try again.`)})),FW}function SCi(){console.warn(`initializing epic state with url ${JSON.stringify(J4)}`);const e=As.getSignedInUser(),t=KXe(J4,e?.userId,e?.zeniSessionId,void 0,Pv()),r=qXe();return r.userId!=null&&Vm.identify(r.userId,{tenant_id:r.tenantId}),t}const I$e="zeni-chunk-reload-at",ECi=6e4,LCi=["Failed to fetch dynamically imported module","error loading dynamically imported module","Importing a module script failed"];function ICi(){window.addEventListener("vite:preloadError",e=>{const t=e;j$e(t.payload)&&t.preventDefault()}),window.addEventListener("unhandledrejection",e=>{jCi(e.reason)&&j$e(e.reason)})}function j$e(e){try{const t=Number(sessionStorage.getItem(I$e))||0;if(Date.now()-t<ECi)return!1;sessionStorage.setItem(I$e,String(Date.now()))}catch{return!1}return console.warn("[chunk-load] Stale chunk detected — hard-reloading:",e),window.location.reload(),!0}function jCi(e){const t=String(e?.message??e??"");return LCi.some(r=>t.includes(r))}const MCi=!!(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}$/)),BCi="QA",PCi="https://zeni-webapp-qa.uc.r.appspot.com",M$e=`/service-worker.js?v=${Date.now()}&env=${BCi}&endpoint=${encodeURIComponent(PCi)}`;function DCi(e){if("serviceWorker"in navigator){if(new URL("https://qa.app.zeni.ai",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{MCi?TCi(M$e):DZe(M$e)})}}function DZe(e,t){navigator.serviceWorker.register(e).then(r=>{r.onupdatefound=()=>{const n=r.installing;n!=null&&(n.onstatechange=()=>{n.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"}),r.waiting?.postMessage({type:"SKIP_WAITING"})):console.log("Content is cached for offline use."))})},r.waiting&&r.waiting.postMessage({type:"SKIP_WAITING"}),navigator.serviceWorker.addEventListener("controllerchange",()=>{console.log("New service worker activated."),r.active?.postMessage({type:"CLIENTS_CLAIM"})})}).catch(r=>{console.error("Error during service worker registration:",r)})}function TCi(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(r=>{const n=r.headers.get("content-type");r.status===404||n!=null&&!n.includes("javascript")?navigator.serviceWorker.ready.then(a=>{a.unregister().then(()=>window.location.reload())}):DZe(e)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}const zCi=As.getSignedInUser(),RCi=zCi?.zeniSessionId;async function FCi(){try{const e=await qvi(),t=Wvi(e,Gvi+o1);Yvi(JSON.parse(t)),het.createRoot(document.getElementById("root")).render(Co.jsx($.StrictMode,{children:Co.jsx(_Je,{basename:"/cockpit",children:Co.jsx(ACi,{})})})),OCi()}catch(e){console.error("Error initializing app:",e)}}function OCi(){const e=()=>{sJe({dsn:Sa.sentryDsn,integrations:[lJe(),cJe({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:Sa.sentryTraceSamplingRate,replaysSessionSampleRate:0,replaysOnErrorSampleRate:1,beforeSendTransaction(t){return t.breadcrumbs&&(t.breadcrumbs=t.breadcrumbs.filter(r=>r.category!=="console"?!0:(r.message??"").toLowerCase().includes("called people set")||Array.isArray(r.data?.arguments)&&r.data.arguments.some(a=>typeof a=="string"&&a.toLowerCase().includes("called people set"))?!1:(Array.isArray(r.data?.arguments)&&(r.data.arguments=r.data.arguments.map(a=>{if(typeof a=="string"&&a.includes("user_roles"))try{const l=a.match(/\{.*\}/s);if(l!==null){const c=JSON.parse(l[0]);if(c.user_roles!=null)return delete c.user_roles,a.replace(l[0],JSON.stringify(c))}}catch{}return a})),!0))),t}}),dJe("session-id",RCi)};typeof requestIdleCallback=="function"?requestIdleCallback(e):setTimeout(e,0)}ICi();FCi();DCi();export{o4n as $,j as A,n4n as B,r4n as C,sAi as D,lt as E,i4n as F,W as G,t4n as H,Dqi as I,Ao as J,PFe as K,l4n as L,e4n as M,kRi as N,fUr as O,d4n as P,SRi as Q,Xfn as R,zFe as S,c4n as T,Jfn as U,Kfn as V,PZe as W,VMi as X,Joe as Y,Pqi as Z,rrn as _,Vm as a,p4n as a0,E$e as b,Gfn as c,Sa as d,Zfn as e,a4n as f,h4n as g,n0 as h,je as i,s4n as j,C as k,Yfn as l,qfn as m,o as n,kC as o,qzi as p,u4n as q,PMo as r,sQi as s,pl as t,tCi as u,_Mi as v,_5 as w,EEi as x,Us as y,As as z};
97028
+ Please refresh the page to try again.`)})),FW}function SCi(){console.warn(`initializing epic state with url ${JSON.stringify(J4)}`);const e=As.getSignedInUser(),t=KXe(J4,e?.userId,e?.zeniSessionId,void 0,Pv()),r=qXe();return r.userId!=null&&Vm.identify(r.userId,{tenant_id:r.tenantId}),t}const I$e="zeni-chunk-reload-at",ECi=6e4,LCi=["Failed to fetch dynamically imported module","error loading dynamically imported module","Importing a module script failed"];function ICi(){window.addEventListener("vite:preloadError",e=>{const t=e;j$e(t.payload)&&t.preventDefault()}),window.addEventListener("unhandledrejection",e=>{jCi(e.reason)&&j$e(e.reason)})}function j$e(e){try{const t=Number(sessionStorage.getItem(I$e))||0;if(Date.now()-t<ECi)return!1;sessionStorage.setItem(I$e,String(Date.now()))}catch{return!1}return console.warn("[chunk-load] Stale chunk detected — hard-reloading:",e),window.location.reload(),!0}function jCi(e){const t=String(e?.message??e??"");return LCi.some(r=>t.includes(r))}const MCi=!!(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}$/)),BCi="DEV",PCi="https://zeni-webapp-dev.uc.r.appspot.com",M$e=`/service-worker.js?v=${Date.now()}&env=${BCi}&endpoint=${encodeURIComponent(PCi)}`;function DCi(e){if("serviceWorker"in navigator){if(new URL("https://dev.app.zeni.ai",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{MCi?TCi(M$e):DZe(M$e)})}}function DZe(e,t){navigator.serviceWorker.register(e).then(r=>{r.onupdatefound=()=>{const n=r.installing;n!=null&&(n.onstatechange=()=>{n.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"}),r.waiting?.postMessage({type:"SKIP_WAITING"})):console.log("Content is cached for offline use."))})},r.waiting&&r.waiting.postMessage({type:"SKIP_WAITING"}),navigator.serviceWorker.addEventListener("controllerchange",()=>{console.log("New service worker activated."),r.active?.postMessage({type:"CLIENTS_CLAIM"})})}).catch(r=>{console.error("Error during service worker registration:",r)})}function TCi(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(r=>{const n=r.headers.get("content-type");r.status===404||n!=null&&!n.includes("javascript")?navigator.serviceWorker.ready.then(a=>{a.unregister().then(()=>window.location.reload())}):DZe(e)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}const zCi=As.getSignedInUser(),RCi=zCi?.zeniSessionId;async function FCi(){try{const e=await qvi(),t=Wvi(e,Gvi+o1);Yvi(JSON.parse(t)),het.createRoot(document.getElementById("root")).render(Co.jsx($.StrictMode,{children:Co.jsx(_Je,{basename:"/cockpit",children:Co.jsx(ACi,{})})})),OCi()}catch(e){console.error("Error initializing app:",e)}}function OCi(){const e=()=>{sJe({dsn:Sa.sentryDsn,integrations:[lJe(),cJe({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:Sa.sentryTraceSamplingRate,replaysSessionSampleRate:0,replaysOnErrorSampleRate:1,beforeSendTransaction(t){return t.breadcrumbs&&(t.breadcrumbs=t.breadcrumbs.filter(r=>r.category!=="console"?!0:(r.message??"").toLowerCase().includes("called people set")||Array.isArray(r.data?.arguments)&&r.data.arguments.some(a=>typeof a=="string"&&a.toLowerCase().includes("called people set"))?!1:(Array.isArray(r.data?.arguments)&&(r.data.arguments=r.data.arguments.map(a=>{if(typeof a=="string"&&a.includes("user_roles"))try{const l=a.match(/\{.*\}/s);if(l!==null){const c=JSON.parse(l[0]);if(c.user_roles!=null)return delete c.user_roles,a.replace(l[0],JSON.stringify(c))}}catch{}return a})),!0))),t}}),dJe("session-id",RCi)};typeof requestIdleCallback=="function"?requestIdleCallback(e):setTimeout(e,0)}ICi();FCi();DCi();export{o4n as $,j as A,n4n as B,r4n as C,sAi as D,lt as E,i4n as F,W as G,t4n as H,Dqi as I,Ao as J,PFe as K,l4n as L,e4n as M,kRi as N,fUr as O,d4n as P,SRi as Q,Xfn as R,zFe as S,c4n as T,Jfn as U,Kfn as V,PZe as W,VMi as X,Joe as Y,Pqi as Z,rrn as _,Vm as a,p4n as a0,E$e as b,Gfn as c,Sa as d,Zfn as e,a4n as f,h4n as g,n0 as h,je as i,s4n as j,C as k,Yfn as l,qfn as m,o as n,kC as o,qzi as p,u4n as q,PMo as r,sQi as s,pl as t,tCi as u,_Mi as v,_5 as w,EEi as x,Us as y,As as z};