@zeniai/web-cockpit-ui 2.0.92-qa → 2.0.93-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/assets/{CreditAgentRoutes-DjToLzKG.js → CreditAgentRoutes-CZZSVWOP.js} +2 -2
  2. package/dist/assets/{Preview-DnPI6GDf.js → Preview-BSTKEBbJ.js} +1 -1
  3. package/dist/assets/{ScreenRoutes-p9MT5EeN.js → ScreenRoutes-CNd21hfH.js} +46 -46
  4. package/dist/assets/{SignInScreen-B0f3Jy36.js → SignInScreen-CRHQ8OnU.js} +1 -1
  5. package/dist/assets/{analytics-CcB3OKaY.js → analytics-R16_Exat.js} +1 -1
  6. package/dist/assets/{analyticsHelper-BvbP9wK1.js → analyticsHelper-CQILqzn0.js} +1 -1
  7. package/dist/assets/{core-d8-Yrhuc.js → core-C-BvKSHF.js} +1 -1
  8. package/dist/assets/{dash.all.min-CNga_j58.js → dash.all.min-CaieTgkS.js} +1 -1
  9. package/dist/assets/{empty-bx2HGpHa.js → empty-B9bTdnzW.js} +1 -1
  10. package/dist/assets/{empty-CpSA_6fK.js → empty-DCrqM1RS.js} +1 -1
  11. package/dist/assets/epic-BN1eY58B.js +2 -0
  12. package/dist/assets/{index-XIXzhqvh.js → index-B7A7Bq2L.js} +1 -1
  13. package/dist/assets/{index-C-Uvb2Dc.js → index-C7WL4CHp.js} +173 -159
  14. package/dist/assets/{index-BmZs8Wda.js → index-CX9wa_uF.js} +2 -2
  15. package/dist/assets/{index-C-JLTbu7.js → index-Csk7zXgi.js} +1 -1
  16. package/dist/assets/{index-DcCBjLLo.js → index-DHJ37yIA.js} +1 -1
  17. package/dist/assets/{index-DPi_T3J5.js → index-DkxpWxmH.js} +1 -1
  18. package/dist/assets/{index-DvVQ7iui.js → index-FfXn1jJZ.js} +1 -1
  19. package/dist/assets/{lexical-DLkcCulk.js → lexical-46kddbXs.js} +1 -1
  20. package/dist/assets/{liveblocks-CwbFcd2s.js → liveblocks-3VYKPeI8.js} +1 -1
  21. package/dist/assets/{lottie-DBVfaNGp.js → lottie-abtTF1Wk.js} +1 -1
  22. package/dist/assets/{mui-B6CYK1HV.js → mui-rEjY64BN.js} +1 -1
  23. package/dist/assets/{react-B-BHfQOq.js → react-8YaHGfrj.js} +1 -1
  24. package/dist/assets/{react-wCBEw1nY.js → react-BItXTjSE.js} +1 -1
  25. package/dist/assets/{react-6FsYguWt.js → react-CVbn6iDw.js} +1 -1
  26. package/dist/assets/{react-HGhAIjhc.js → react-D0CeM3Sq.js} +1 -1
  27. package/dist/assets/{react-CFZ3AbF5.js → react-DuG7xkeH.js} +1 -1
  28. package/dist/assets/{react-3OF2zoCt.js → react-NMCykv0c.js} +1 -1
  29. package/dist/assets/{react-BH463Uzi.js → react-riIYQDaq.js} +1 -1
  30. package/dist/assets/{react-DHKYYFws.js → react-sDuEJMaJ.js} +2 -2
  31. package/dist/assets/{recharts-BTW6KatO.js → recharts-6O0k3Sgn.js} +1 -1
  32. package/dist/assets/{sentry-k0r53PTl.js → sentry-CR3PzqvD.js} +1 -1
  33. package/dist/assets/{url-CixlfFG-.js → url-kOslY_9p.js} +1 -1
  34. package/dist/assets/{url-DIVWW8cr.js → url-mBOiBJLr.js} +1 -1
  35. package/dist/assets/{utils-CGEMyUD7.js → utils-CMlimj8x.js} +1 -1
  36. package/dist/assets/{zeni-epic-state-BOTTndD7.js → zeni-epic-state-Dx-mgwwn.js} +4 -4
  37. package/dist/index.html +1 -1
  38. package/package.json +3 -3
  39. package/dist/assets/epic-C2Ax7GBk.js +0 -2
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/empty-bx2HGpHa.js","assets/sentry-k0r53PTl.js","assets/empty-CpSA_6fK.js","assets/index-C-JLTbu7.js","assets/index-DPi_T3J5.js","assets/zeni-epic-state-BOTTndD7.js","assets/core-d8-Yrhuc.js","assets/utils-CGEMyUD7.js","assets/recharts-BTW6KatO.js","assets/url-CixlfFG-.js","assets/index-XIXzhqvh.js","assets/index-DvVQ7iui.js","assets/url-DIVWW8cr.js","assets/index-BmZs8Wda.js","assets/ScreenRoutes-p9MT5EeN.js","assets/liveblocks-CwbFcd2s.js","assets/analyticsHelper-BvbP9wK1.js","assets/mui-B6CYK1HV.js","assets/SignInScreen-B0f3Jy36.js","assets/analytics-CcB3OKaY.js","assets/lottie-DBVfaNGp.js","assets/lexical-DLkcCulk.js"])))=>i.map(i=>d[i]);
2
- import{a as g,b as $,R as MNe,c as A4,p as G2,r as fd,g as cW,e as uJ,f as BNe,s as hJ,w as DNe,i as PNe,S as TNe,j as zNe,k as RNe,l as FNe,m as ONe}from"./sentry-k0r53PTl.js";import{j as yo,_ as k8e,a as Jd,u as S8e,T as NNe,C as HNe,b as _Ne,c as FE,d as OE,e as VNe,f as E8e,g as QNe,h as UNe,L as WNe,i as mJ,k as GNe,l as YNe,P as KNe,m as qNe,n as ZNe,o as L8e,p as JNe,q as XNe,I as gJ,r as eHe,s as tHe,t as oHe,v as rHe,w as iHe,x as nHe,y as I8e,z as aHe,A as sHe,B as lHe}from"./liveblocks-CwbFcd2s.js";import{f as j8e,R as G3,r as Hn,P as $n,u as NE,g as Ru,h as dHe,i as pW,j as cHe,k as pHe,l as kB,N as uHe,m as hHe,n as mHe,B as gHe}from"./core-d8-Yrhuc.js";import{H as J$,ba as Y3,bb as fHe,bc as fJ,bd as V4,be as Qr,bf as M8e,bg as HE,bh as Dr,bi as xHe,bj as yHe,bk as Y7,bl as ym,bm as uW,bn as B8e,bo as wHe,bp as k1,bq as bHe,br as hW,bs as D8e,bt as Yi,bu as K7,bv as mu,bw as vHe,bx as CHe,by as AHe,bz as P8e,bA as g_,bB as $He,bC as kHe,bD as SHe,bE as EHe,bF as mW,bG as T8e,bH as wm,bI as LHe,bJ as z8e,bK as f_,bL as xJ,bM as yJ,bN as wJ,bO as wl,bP as gW,bQ as fW,bR as R6,bS as xW,bT as yW,bU as wW,bV as bW,bW as IHe,bX as X$,bY as jHe,bZ as R8e,b_ as vW,b$ as MHe,c0 as h0,c1 as Rw,c2 as Fw,c3 as BHe,c4 as DHe,c5 as PHe,c6 as THe,c7 as zHe,c8 as RHe,c9 as FHe,ca as wv,cb as OHe,cc as NHe,cd as HHe,ce as _He,cf as VHe,cg as QHe,ch as UHe,ci as WHe,cj as GHe,ck as YHe,cl as KHe,cm as qHe,cn as ZHe,co as JHe,cp as F8e,cq as XHe,cr as bJ,cs as e_e,ct as t_e,cu as Ty,cv as O8e,cw as o_e,cx as N8e,cy as CW,cz as r_e,cA as vJ,cB as i_e,cC as CJ,cD as H8e,cE as _8e,cF as V8e,cG as Q8e,cH as U8e,cI as n_e,cJ as W8e,cK as a_e,cL as s_e,cM as l_e,cN as G8e,cO as x_,cP as d_e,cQ as Y8e,cR as K8e,cS as c_e,cT as p_e,cU as u_e,cV as h_e,cW as m_e,cX as g_e,cY as f_e,cZ as x_e,v as y_e,c_ as _E,c$ as y_,d0 as w_,d1 as w_e,d2 as b_e,d3 as v_e,d4 as C_e,d5 as A_e,d6 as $_e,d7 as k_e,d8 as S_e,d9 as E_e,da as L_e,db as AJ,dc as I_e,dd as j_e,de as M_e,df as B_e,dg as D_e}from"./zeni-epic-state-BOTTndD7.js";import{T as q8e,j as To,n,c as he,k as Nt,G as Ow,C as Z8e,u as J8e,a as P_e}from"./mui-B6CYK1HV.js";import{r as T_e,m as gu}from"./analytics-CcB3OKaY.js";import{L as b_}from"./lottie-DBVfaNGp.js";import{r as fa}from"./lexical-DLkcCulk.js";import{E as Oi,c as VE,P as z_e,R as v_,F as ek,X as Wd,Y as Gd,G as P0,H as tk,I as QE,J as T0,K as X8e,L as R_e,M as F_e,N as Q4,O as AW,Q as $W,S as Nw,U as O_e}from"./recharts-BTW6KatO.js";import{r as N_e}from"./utils-CGEMyUD7.js";(function(){try{var e=typeof window<"u"?window:typeof A4<"u"?A4:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c05afd7f-3463-4c0b-8920-cc80f2d0a95e",e._sentryDebugIdIdentifier="sentry-dbid-c05afd7f-3463-4c0b-8920-cc80f2d0a95e")}catch{}})();(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function o(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(a){if(a.ep)return;a.ep=!0;const l=o(a);fetch(a.href,l)}})();var bv={},$J;function H_e(){if($J)return bv;$J=1;var e=j8e();return bv.createRoot=e.createRoot,bv.hydrateRoot=e.hydrateRoot,bv}var __e=H_e(),td=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof A4<"u"?A4:typeof self<"u"?self:{};function Mr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kJ={exports:{}},F8={},SJ;function V_e(){if(SJ)return F8;SJ=1;var e=$,t=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function d(c,p,u){var h,m={},f=null,x=null;u!==void 0&&(f=""+u),p.key!==void 0&&(f=""+p.key),p.ref!==void 0&&(x=p.ref);for(h in p)i.call(p,h)&&!l.hasOwnProperty(h)&&(m[h]=p[h]);if(c&&c.defaultProps)for(h in p=c.defaultProps,p)m[h]===void 0&&(m[h]=p[h]);return{$$typeof:t,type:c,key:f,ref:x,props:m,_owner:a.current}}return F8.Fragment=o,F8.jsx=d,F8.jsxs=d,F8}var EJ;function e9e(){return EJ||(EJ=1,kJ.exports=V_e()),kJ.exports}var s=e9e();const Q_e=g.createContext(null),SB={didCatch:!1,error:null};let U_e=class extends g.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=SB}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var o,i,a=arguments.length,l=new Array(a),d=0;d<a;d++)l[d]=arguments[d];(o=(i=this.props).onReset)===null||o===void 0||o.call(i,{args:l,reason:"imperative-api"}),this.setState(SB)}}componentDidCatch(t,o){var i,a;(i=(a=this.props).onError)===null||i===void 0||i.call(a,t,o)}componentDidUpdate(t,o){const{didCatch:i}=this.state,{resetKeys:a}=this.props;if(i&&o.error!==null&&W_e(t.resetKeys,a)){var l,d;(l=(d=this.props).onReset)===null||l===void 0||l.call(d,{next:a,prev:t.resetKeys,reason:"keys"}),this.setState(SB)}}render(){const{children:t,fallbackRender:o,FallbackComponent:i,fallback:a}=this.props,{didCatch:l,error:d}=this.state;let c=t;if(l){const p={error:d,resetErrorBoundary:this.resetErrorBoundary};if(typeof o=="function")c=o(p);else if(i)c=g.createElement(i,p);else if(a!==void 0)c=a;else throw d}return g.createElement(Q_e.Provider,{value:{didCatch:l,error:d,resetErrorBoundary:this.resetErrorBoundary}},c)}};function W_e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((o,i)=>!Object.is(o,t[i]))}var C_={exports:{}},G_e=C_.exports,LJ;function Y_e(){return LJ||(LJ=1,function(e){(function(t,o){e.exports?e.exports=o():t.numeral=o()})(G_e,function(){var t,o,i="2.0.6",a={},l={},d={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},c={currentLocale:d.currentLocale,zeroFormat:d.zeroFormat,nullFormat:d.nullFormat,defaultFormat:d.defaultFormat,scalePercentBy100:d.scalePercentBy100};function p(u,h){this._input=u,this._value=h}return t=function(u){var h,m,f,x;if(t.isNumeral(u))h=u.value();else if(u===0||typeof u>"u")h=0;else if(u===null||o.isNaN(u))h=null;else if(typeof u=="string")if(c.zeroFormat&&u===c.zeroFormat)h=0;else if(c.nullFormat&&u===c.nullFormat||!u.replace(/[^0-9]+/g,"").length)h=null;else{for(m in a)if(x=typeof a[m].regexps.unformat=="function"?a[m].regexps.unformat():a[m].regexps.unformat,x&&u.match(x)){f=a[m].unformat;break}f=f||t._.stringToNumber,h=f(u)}else h=Number(u)||null;return new p(u,h)},t.version=i,t.isNumeral=function(u){return u instanceof p},t._=o={numberToFormat:function(u,h,m){var f=l[t.options.currentLocale],x=!1,y=!1,w=0,b="",v=1e12,A=1e9,S=1e6,E=1e3,j="",L=!1,M,D,P,T,z,R,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")&&(b=" "),h=h.replace(new RegExp(b+"a[kmbt]?"),""),D>=v&&!M||M==="t"?(b+=f.abbreviations.trillion,u=u/v):D<v&&D>=A&&!M||M==="b"?(b+=f.abbreviations.billion,u=u/A):D<A&&D>=S&&!M||M==="m"?(b+=f.abbreviations.million,u=u/S):(D<S&&D>=E&&!M||M==="k")&&(b+=f.abbreviations.thousand,u=u/E)),t._.includes(h,"[.]")&&(y=!0,h=h.replace("[.]",".")),P=u.toString().split(".")[0],T=h.split(".")[1],R=h.indexOf(","),w=(h.split(".")[0].split(",")[0].match(/0/g)||[]).length,T?(t._.includes(T,"[")?(T=T.replace("]",""),T=T.split("["),j=t._.toFixed(u,T[0].length+T[1].length,m,T[1].length)):j=t._.toFixed(u,T.length,m),P=j.split(".")[0],t._.includes(j,".")?j=f.delimiters.decimal+j.split(".")[1]:j="",y&&Number(j.slice(1))===0&&(j="")):P=t._.toFixed(u,0,m),b&&!M&&Number(P)>=1e3&&b!==f.abbreviations.trillion)switch(P=String(Number(P)/1e3),b){case f.abbreviations.thousand:b=f.abbreviations.million;break;case f.abbreviations.million:b=f.abbreviations.billion;break;case f.abbreviations.billion:b=f.abbreviations.trillion;break}if(t._.includes(P,"-")&&(P=P.slice(1),L=!0),P.length<w)for(var Z=w-P.length;Z>0;Z--)P="0"+P;return R>-1&&(P=P.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),h.indexOf(".")===0&&(P=""),K=P+j+(b||""),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[c.currentLocale],m=u,f={thousand:3,million:6,billion:9,trillion:12},x,y,w;if(c.zeroFormat&&u===c.zeroFormat)y=0;else if(c.nullFormat&&u===c.nullFormat||!u.replace(/[^0-9]+/g,"").length)y=null;else{y=1,h.delimiters.decimal!=="."&&(u=u.replace(/\./g,"").replace(h.delimiters.decimal,"."));for(x in f)if(w=new RegExp("[^a-zA-Z]"+h.abbreviations[x]+"(?:\\)|(\\"+h.currency.symbol+")?(?:\\))?)?$"),m.match(w)){y*=Math.pow(10,f[x]);break}y*=(u.split("-").length+Math.min(u.split("(").length-1,u.split(")").length-1))%2?1:-1,u=u.replace(/[^0-9\.]+/g,""),y*=Number(u)}return y},isNaN:function(u){return typeof u=="number"&&isNaN(u)},includes:function(u,h){return u.indexOf(h)!==-1},insert:function(u,h,m){return u.slice(0,m)+h+u.slice(m)},reduce:function(u,h){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof h!="function")throw new TypeError(h+" is not a function");var m=Object(u),f=m.length>>>0,x=0,y;if(arguments.length===3)y=arguments[2];else{for(;x<f&&!(x in m);)x++;if(x>=f)throw new TypeError("Reduce of empty array with no initial value");y=m[x++]}for(;x<f;x++)x in m&&(y=h(y,m[x],x,m));return y},multiplier:function(u){var h=u.toString().split(".");return h.length<2?1:Math.pow(10,h[1].length)},correctionFactor:function(){var u=Array.prototype.slice.call(arguments);return u.reduce(function(h,m){var f=o.multiplier(m);return h>f?h:f},1)},toFixed:function(u,h,m,f){var x=u.toString().split("."),y=h-(f||0),w,b,v,A;return x.length===2?w=Math.min(Math.max(x[1].length,y),h):w=y,v=Math.pow(10,w),A=(m(u+"e+"+w)/v).toFixed(w),f>h-w&&(b=new RegExp("\\.?0{1,"+(f-(h-w))+"}$"),A=A.replace(b,"")),A}},t.options=c,t.formats=a,t.locales=l,t.locale=function(u){return u&&(c.currentLocale=u.toLowerCase()),c.currentLocale},t.localeData=function(u){if(!u)return l[c.currentLocale];if(u=u.toLowerCase(),!l[u])throw new Error("Unknown locale : "+u);return l[u]},t.reset=function(){for(var u in d)c[u]=d[u]},t.zeroFormat=function(u){c.zeroFormat=typeof u=="string"?u:null},t.nullFormat=function(u){c.nullFormat=typeof u=="string"?u:null},t.defaultFormat=function(u){c.defaultFormat=typeof u=="string"?u:"0.0"},t.register=function(u,h,m){if(h=h.toLowerCase(),this[u+"s"][h])throw new TypeError(h+" "+u+" already registered.");return this[u+"s"][h]=m,m},t.validate=function(u,h){var m,f,x,y,w,b,v,A;if(typeof u!="string"&&(u+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",u)),u=u.trim(),u.match(/^\d+$/))return!0;if(u==="")return!1;try{v=t.localeData(h)}catch{v=t.localeData(t.locale())}return x=v.currency.symbol,w=v.abbreviations,m=v.delimiters.decimal,v.delimiters.thousands==="."?f="\\.":f=v.delimiters.thousands,A=u.match(/^[^\d]+/),A!==null&&(u=u.substr(1),A[0]!==x)||(A=u.match(/[^\d]+$/),A!==null&&(u=u.slice(0,-1),A[0]!==w.thousand&&A[0]!==w.million&&A[0]!==w.billion&&A[0]!==w.trillion))?!1:(b=new RegExp(f+"{2}"),u.match(/[^\d.,]/g)?!1:(y=u.split(m),y.length>2?!1:y.length<2?!!y[0].match(/^\d+.*\d$/)&&!y[0].match(b):y[0].length===1?!!y[0].match(/^\d+$/)&&!y[0].match(b)&&!!y[1].match(/^\d+$/):!!y[0].match(/^\d+.*\d$/)&&!y[0].match(b)&&!!y[1].match(/^\d+$/)))},t.fn=p.prototype={clone:function(){return t(this)},format:function(u,h){var m=this._value,f=u||c.defaultFormat,x,y,w;if(h=h||Math.round,m===0&&c.zeroFormat!==null)y=c.zeroFormat;else if(m===null&&c.nullFormat!==null)y=c.nullFormat;else{for(x in a)if(f.match(a[x].regexps.format)){w=a[x].format;break}w=w||t._.numberToFormat,y=w(m,f,h)}return y},value:function(){return this._value},input:function(){return this._input},set:function(u){return this._value=Number(u),this},add:function(u){var h=o.correctionFactor.call(null,this._value,u);function m(f,x,y,w){return f+Math.round(h*x)}return this._value=o.reduce([this._value,u],m,0)/h,this},subtract:function(u){var h=o.correctionFactor.call(null,this._value,u);function m(f,x,y,w){return f-Math.round(h*x)}return this._value=o.reduce([u],m,Math.round(this._value*h))/h,this},multiply:function(u){function h(m,f,x,y){var w=o.correctionFactor(m,f);return Math.round(m*w)*Math.round(f*w)/Math.round(w*w)}return this._value=o.reduce([this._value,u],h,1),this},divide:function(u){function h(m,f,x,y){var w=o.correctionFactor(m,f);return Math.round(m*w)/Math.round(f*w)}return this._value=o.reduce([this._value,u],h),this},difference:function(u){return Math.abs(t(this._value).subtract(u).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(u){var h=u%10;return~~(u%100/10)===1?"th":h===1?"st":h===2?"nd":h===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(u,h,m){var f=t._.includes(h," BPS")?" ":"",x;return u=u*1e4,h=h.replace(/\s?BPS/,""),x=t._.numberToFormat(u,h,m),t._.includes(x,")")?(x=x.split(""),x.splice(-1,0,f+"BPS"),x=x.join("")):x=x+f+"BPS",x},unformat:function(u){return+(t._.stringToNumber(u)*1e-4).toFixed(15)}})}(),function(){var u={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},h={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},m=u.suffixes.concat(h.suffixes.filter(function(x){return u.suffixes.indexOf(x)<0})),f=m.join("|");f="("+f.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(x,y,w){var b,v=t._.includes(y,"ib")?h:u,A=t._.includes(y," b")||t._.includes(y," ib")?" ":"",S,E,j;for(y=y.replace(/\s?i?b/,""),S=0;S<=v.suffixes.length;S++)if(E=Math.pow(v.base,S),j=Math.pow(v.base,S+1),x===null||x===0||x>=E&&x<j){A+=v.suffixes[S],E>0&&(x=x/E);break}return b=t._.numberToFormat(x,y,w),b+A},unformat:function(x){var y=t._.stringToNumber(x),w,b;if(y){for(w=u.suffixes.length-1;w>=0;w--){if(t._.includes(x,u.suffixes[w])){b=Math.pow(u.base,w);break}if(t._.includes(x,h.suffixes[w])){b=Math.pow(h.base,w);break}}y*=b||1}return y}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(u,h,m){var f=t.locales[t.options.currentLocale],x={before:h.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:h.match(/([\+|\-|\)|\s|\$]*)$/)[0]},y,w,b;for(h=h.replace(/\s?\$\s?/,""),y=t._.numberToFormat(u,h,m),u>=0?(x.before=x.before.replace(/[\-\(]/,""),x.after=x.after.replace(/[\-\)]/,"")):u<0&&!t._.includes(x.before,"-")&&!t._.includes(x.before,"(")&&(x.before="-"+x.before),b=0;b<x.before.length;b++)switch(w=x.before[b],w){case"$":y=t._.insert(y,f.currency.symbol,b);break;case" ":y=t._.insert(y," ",b+f.currency.symbol.length-1);break}for(b=x.after.length-1;b>=0;b--)switch(w=x.after[b],w){case"$":y=b===x.after.length-1?y+f.currency.symbol:t._.insert(y,f.currency.symbol,-(x.after.length-(1+b)));break;case" ":y=b===x.after.length-1?y+" ":t._.insert(y," ",-(x.after.length-(1+b)+f.currency.symbol.length-1));break}return y}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(u,h,m){var f,x=typeof u=="number"&&!t._.isNaN(u)?u.toExponential():"0e+0",y=x.split("e");return h=h.replace(/e[\+|\-]{1}0/,""),f=t._.numberToFormat(Number(y[0]),h,m),f+"e"+y[1]},unformat:function(u){var h=t._.includes(u,"e+")?u.split("e+"):u.split("e-"),m=Number(h[0]),f=Number(h[1]);f=t._.includes(u,"e-")?f*=-1:f;function x(y,w,b,v){var A=t._.correctionFactor(y,w),S=y*A*(w*A)/(A*A);return S}return t._.reduce([m,Math.pow(10,f)],x,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(u,h,m){var f=t.locales[t.options.currentLocale],x,y=t._.includes(h," o")?" ":"";return h=h.replace(/\s?o/,""),y+=f.ordinal(u),x=t._.numberToFormat(u,h,m),x+y}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(u,h,m){var f=t._.includes(h," %")?" ":"",x;return t.options.scalePercentBy100&&(u=u*100),h=h.replace(/\s?\%/,""),x=t._.numberToFormat(u,h,m),t._.includes(x,")")?(x=x.split(""),x.splice(-1,0,f+"%"),x=x.join("")):x=x+f+"%",x},unformat:function(u){var h=t._.stringToNumber(u);return t.options.scalePercentBy100?h*.01:h}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(u,h,m){var f=Math.floor(u/60/60),x=Math.floor((u-f*60*60)/60),y=Math.round(u-f*60*60-x*60);return f+":"+(x<10?"0"+x:x)+":"+(y<10?"0"+y:y)},unformat:function(u){var h=u.split(":"),m=0;return h.length===3?(m=m+Number(h[0])*60*60,m=m+Number(h[1])*60,m=m+Number(h[2])):h.length===2&&(m=m+Number(h[0])*60,m=m+Number(h[1])),Number(m)}})}(),t})}(C_)),C_.exports}var K_e=Y_e();const y0=Mr(K_e);function $0(e,...t){const o=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(i=>o.searchParams.append("args[]",i)),`Minified MUI error #${e}; visit ${o} for the full message.`}const w0="$$material";function q_e(e){for(var t=0,o,i=0,a=e.length;a>=4;++i,a-=4)o=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,o=(o&65535)*1540483477+((o>>>16)*59797<<16),o^=o>>>24,t=(o&65535)*1540483477+((o>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(i+2)&255)<<16;case 2:t^=(e.charCodeAt(i+1)&255)<<8;case 1:t^=e.charCodeAt(i)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Z_e={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 J_e(e){var t=Object.create(null);return function(o){return t[o]===void 0&&(t[o]=e(o)),t[o]}}var X_e=/[A-Z]|^ms/g,eVe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,t9e=function(e){return e.charCodeAt(1)===45},IJ=function(e){return e!=null&&typeof e!="boolean"},EB=J_e(function(e){return t9e(e)?e:e.replace(X_e,"-$&").toLowerCase()}),jJ=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(eVe,function(o,i,a){return Uh={name:i,styles:a,next:Uh},i})}return Z_e[e]!==1&&!t9e(e)&&typeof t=="number"&&t!==0?t+"px":t};function ok(e,t,o){if(o==null)return"";var i=o;if(i.__emotion_styles!==void 0)return i;switch(typeof o){case"boolean":return"";case"object":{var a=o;if(a.anim===1)return Uh={name:a.name,styles:a.styles,next:Uh},a.name;var l=o;if(l.styles!==void 0){var d=l.next;if(d!==void 0)for(;d!==void 0;)Uh={name:d.name,styles:d.styles,next:Uh},d=d.next;var c=l.styles+";";return c}return tVe(e,t,o)}}var p=o;return p}function tVe(e,t,o){var i="";if(Array.isArray(o))for(var a=0;a<o.length;a++)i+=ok(e,t,o[a])+";";else for(var l in o){var d=o[l];if(typeof d!="object"){var c=d;IJ(c)&&(i+=EB(l)+":"+jJ(l,c)+";")}else if(Array.isArray(d)&&typeof d[0]=="string"&&t==null)for(var p=0;p<d.length;p++)IJ(d[p])&&(i+=EB(l)+":"+jJ(l,d[p])+";");else{var u=ok(e,t,d);switch(l){case"animation":case"animationName":{i+=EB(l)+":"+u+";";break}default:i+=l+"{"+u+"}"}}}return i}var MJ=/label:\s*([^\s;{]+)\s*(;|$)/g,Uh;function oVe(e,t,o){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var i=!0,a="";Uh=void 0;var l=e[0];if(l==null||l.raw===void 0)i=!1,a+=ok(o,t,l);else{var d=l;a+=d[0]}for(var c=1;c<e.length;c++)if(a+=ok(o,t,e[c]),i){var p=l;a+=p[c]}MJ.lastIndex=0;for(var u="",h;(h=MJ.exec(a))!==null;)u+="-"+h[1];var m=q_e(a)+u;return{name:m,styles:a,next:Uh}}var LB={exports:{}},IB,BJ;function rVe(){if(BJ)return IB;BJ=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return IB=e,IB}var jB,DJ;function iVe(){if(DJ)return jB;DJ=1;var e=rVe();function t(){}function o(){}return o.resetWarningCache=t,jB=function(){function i(d,c,p,u,h,m){if(m!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}i.isRequired=i;function a(){return i}var l={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:o,resetWarningCache:t};return l.PropTypes=l,l},jB}var PJ;function kW(){return PJ||(PJ=1,LB.exports=iVe()()),LB.exports}var nVe=kW();const zt=Mr(nVe);function aVe(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 sVe(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 lVe=function(){function e(o){var i=this;this._insertTag=function(a){var l;i.tags.length===0?i.insertionPoint?l=i.insertionPoint.nextSibling:i.prepend?l=i.container.firstChild:l=i.before:l=i.tags[i.tags.length-1].nextSibling,i.container.insertBefore(a,l),i.tags.push(a)},this.isSpeedy=o.speedy===void 0?!0:o.speedy,this.tags=[],this.ctr=0,this.nonce=o.nonce,this.key=o.key,this.container=o.container,this.prepend=o.prepend,this.insertionPoint=o.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(o){o.forEach(this._insertTag)},t.insert=function(o){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(sVe(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=aVe(i);try{a.insertRule(o,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(o));this.ctr++},t.flush=function(){this.tags.forEach(function(o){var i;return(i=o.parentNode)==null?void 0:i.removeChild(o)}),this.tags=[],this.ctr=0},e}(),Fs="-ms-",rk="-moz-",pi="-webkit-",o9e="comm",SW="rule",EW="decl",dVe="@import",r9e="@keyframes",cVe="@layer",pVe=Math.abs,UE=String.fromCharCode,uVe=Object.assign;function hVe(e,t){return xs(e,0)^45?(((t<<2^xs(e,0))<<2^xs(e,1))<<2^xs(e,2))<<2^xs(e,3):0}function i9e(e){return e.trim()}function mVe(e,t){return(e=t.exec(e))?e[0]:e}function ui(e,t,o){return e.replace(t,o)}function A_(e,t){return e.indexOf(t)}function xs(e,t){return e.charCodeAt(t)|0}function zy(e,t,o){return e.slice(t,o)}function fu(e){return e.length}function LW(e){return e.length}function vv(e,t){return t.push(e),e}function gVe(e,t){return e.map(t).join("")}var WE=1,q7=1,n9e=0,cd=0,ua=0,F6="";function GE(e,t,o,i,a,l,d){return{value:e,root:t,parent:o,type:i,props:a,children:l,line:WE,column:q7,length:d,return:""}}function O8(e,t){return uVe(GE("",null,null,"",null,null,0),e,{length:-e.length},t)}function fVe(){return ua}function xVe(){return ua=cd>0?xs(F6,--cd):0,q7--,ua===10&&(q7=1,WE--),ua}function _d(){return ua=cd<n9e?xs(F6,cd++):0,q7++,ua===10&&(q7=1,WE++),ua}function Qu(){return xs(F6,cd)}function y$(){return cd}function Hw(e,t){return zy(F6,e,t)}function Ry(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 a9e(e){return WE=q7=1,n9e=fu(F6=e),cd=0,[]}function s9e(e){return F6="",e}function w$(e){return i9e(Hw(cd-1,$_(e===91?e+2:e===40?e+1:e)))}function yVe(e){for(;(ua=Qu())&&ua<33;)_d();return Ry(e)>2||Ry(ua)>3?"":" "}function wVe(e,t){for(;--t&&_d()&&!(ua<48||ua>102||ua>57&&ua<65||ua>70&&ua<97););return Hw(e,y$()+(t<6&&Qu()==32&&_d()==32))}function $_(e){for(;_d();)switch(ua){case e:return cd;case 34:case 39:e!==34&&e!==39&&$_(ua);break;case 40:e===41&&$_(e);break;case 92:_d();break}return cd}function bVe(e,t){for(;_d()&&e+ua!==57&&!(e+ua===84&&Qu()===47););return"/*"+Hw(t,cd-1)+"*"+UE(e===47?e:_d())}function vVe(e){for(;!Ry(Qu());)_d();return Hw(e,cd)}function CVe(e){return s9e(b$("",null,null,null,[""],e=a9e(e),0,[0],e))}function b$(e,t,o,i,a,l,d,c,p){for(var u=0,h=0,m=d,f=0,x=0,y=0,w=1,b=1,v=1,A=0,S="",E=a,j=l,L=i,M=S;b;)switch(y=A,A=_d()){case 40:if(y!=108&&xs(M,m-1)==58){A_(M+=ui(w$(A),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:M+=w$(A);break;case 9:case 10:case 13:case 32:M+=yVe(y);break;case 92:M+=wVe(y$()-1,7);continue;case 47:switch(Qu()){case 42:case 47:vv(AVe(bVe(_d(),y$()),t,o),p);break;default:M+="/"}break;case 123*w:c[u++]=fu(M)*v;case 125*w:case 59:case 0:switch(A){case 0:case 125:b=0;case 59+h:v==-1&&(M=ui(M,/\f/g,"")),x>0&&fu(M)-m&&vv(x>32?zJ(M+";",i,o,m-1):zJ(ui(M," ","")+";",i,o,m-2),p);break;case 59:M+=";";default:if(vv(L=TJ(M,t,o,u,h,a,c,S,E=[],j=[],m),l),A===123)if(h===0)b$(M,t,L,L,E,l,m,c,j);else switch(f===99&&xs(M,3)===110?100:f){case 100:case 108:case 109:case 115:b$(e,L,L,i&&vv(TJ(e,L,L,0,0,a,c,S,a,E=[],m),j),a,j,m,c,i?E:j);break;default:b$(M,L,L,L,[""],j,0,c,j)}}u=h=x=0,w=v=1,S=M="",m=d;break;case 58:m=1+fu(M),x=y;default:if(w<1){if(A==123)--w;else if(A==125&&w++==0&&xVe()==125)continue}switch(M+=UE(A),A*w){case 38:v=h>0?1:(M+="\f",-1);break;case 44:c[u++]=(fu(M)-1)*v,v=1;break;case 64:Qu()===45&&(M+=w$(_d())),f=Qu(),h=m=fu(S=M+=vVe(y$())),A++;break;case 45:y===45&&fu(M)==2&&(w=0)}}return l}function TJ(e,t,o,i,a,l,d,c,p,u,h){for(var m=a-1,f=a===0?l:[""],x=LW(f),y=0,w=0,b=0;y<i;++y)for(var v=0,A=zy(e,m+1,m=pVe(w=d[y])),S=e;v<x;++v)(S=i9e(w>0?f[v]+" "+A:ui(A,/&\f/g,f[v])))&&(p[b++]=S);return GE(e,t,o,a===0?SW:c,p,u,h)}function AVe(e,t,o){return GE(e,t,o,o9e,UE(fVe()),zy(e,2,-2),0)}function zJ(e,t,o,i){return GE(e,t,o,EW,zy(e,0,i),zy(e,i+1,-1),i)}function S7(e,t){for(var o="",i=LW(e),a=0;a<i;a++)o+=t(e[a],a,e,t)||"";return o}function $Ve(e,t,o,i){switch(e.type){case cVe:if(e.children.length)break;case dVe:case EW:return e.return=e.return||e.value;case o9e:return"";case r9e:return e.return=e.value+"{"+S7(e.children,i)+"}";case SW:e.value=e.props.join(",")}return fu(o=S7(e.children,i))?e.return=e.value+"{"+o+"}":""}function kVe(e){var t=LW(e);return function(o,i,a,l){for(var d="",c=0;c<t;c++)d+=e[c](o,i,a,l)||"";return d}}function SVe(e){return function(t){t.root||(t=t.return)&&e(t)}}var EVe=function(e,t,o){for(var i=0,a=0;i=a,a=Qu(),i===38&&a===12&&(t[o]=1),!Ry(a);)_d();return Hw(e,cd)},LVe=function(e,t){var o=-1,i=44;do switch(Ry(i)){case 0:i===38&&Qu()===12&&(t[o]=1),e[o]+=EVe(cd-1,t,o);break;case 2:e[o]+=w$(i);break;case 4:if(i===44){e[++o]=Qu()===58?"&\f":"",t[o]=e[o].length;break}default:e[o]+=UE(i)}while(i=_d());return e},IVe=function(e,t){return s9e(LVe(a9e(e),t))},RJ=new WeakMap,jVe=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,o=e.parent,i=e.column===o.column&&e.line===o.line;o.type!=="rule";)if(o=o.parent,!o)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!RJ.get(o))&&!i){RJ.set(e,!0);for(var a=[],l=IVe(t,a),d=o.props,c=0,p=0;c<l.length;c++)for(var u=0;u<d.length;u++,p++)e.props[p]=a[c]?l[c].replace(/&\f/g,d[u]):d[u]+" "+l[c]}}},MVe=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function l9e(e,t){switch(hVe(e,t)){case 5103:return pi+"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 pi+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return pi+e+rk+e+Fs+e+e;case 6828:case 4268:return pi+e+Fs+e+e;case 6165:return pi+e+Fs+"flex-"+e+e;case 5187:return pi+e+ui(e,/(\w+).+(:[^]+)/,pi+"box-$1$2"+Fs+"flex-$1$2")+e;case 5443:return pi+e+Fs+"flex-item-"+ui(e,/flex-|-self/,"")+e;case 4675:return pi+e+Fs+"flex-line-pack"+ui(e,/align-content|flex-|-self/,"")+e;case 5548:return pi+e+Fs+ui(e,"shrink","negative")+e;case 5292:return pi+e+Fs+ui(e,"basis","preferred-size")+e;case 6060:return pi+"box-"+ui(e,"-grow","")+pi+e+Fs+ui(e,"grow","positive")+e;case 4554:return pi+ui(e,/([^-])(transform)/g,"$1"+pi+"$2")+e;case 6187:return ui(ui(ui(e,/(zoom-|grab)/,pi+"$1"),/(image-set)/,pi+"$1"),e,"")+e;case 5495:case 3959:return ui(e,/(image-set\([^]*)/,pi+"$1$`$1");case 4968:return ui(ui(e,/(.+:)(flex-)?(.*)/,pi+"box-pack:$3"+Fs+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+pi+e+e;case 4095:case 3583:case 4068:case 2532:return ui(e,/(.+)-inline(.+)/,pi+"$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(fu(e)-1-t>6)switch(xs(e,t+1)){case 109:if(xs(e,t+4)!==45)break;case 102:return ui(e,/(.+:)(.+)-([^]+)/,"$1"+pi+"$2-$3$1"+rk+(xs(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~A_(e,"stretch")?l9e(ui(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(xs(e,t+1)!==115)break;case 6444:switch(xs(e,fu(e)-3-(~A_(e,"!important")&&10))){case 107:return ui(e,":",":"+pi)+e;case 101:return ui(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+pi+(xs(e,14)===45?"inline-":"")+"box$3$1"+pi+"$2$3$1"+Fs+"$2box$3")+e}break;case 5936:switch(xs(e,t+11)){case 114:return pi+e+Fs+ui(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return pi+e+Fs+ui(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return pi+e+Fs+ui(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return pi+e+Fs+e+e}return e}var BVe=function(e,t,o,i){if(e.length>-1&&!e.return)switch(e.type){case EW:e.return=l9e(e.value,e.length);break;case r9e:return S7([O8(e,{value:ui(e.value,"@","@"+pi)})],i);case SW:if(e.length)return gVe(e.props,function(a){switch(mVe(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return S7([O8(e,{props:[ui(a,/:(read-\w+)/,":"+rk+"$1")]})],i);case"::placeholder":return S7([O8(e,{props:[ui(a,/:(plac\w+)/,":"+pi+"input-$1")]}),O8(e,{props:[ui(a,/:(plac\w+)/,":"+rk+"$1")]}),O8(e,{props:[ui(a,/:(plac\w+)/,Fs+"input-$1")]})],i)}return""})}},DVe=[BVe],d9e=function(e){var t=e.key;if(t==="css"){var o=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(o,function(y){var w=y.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=e.stylisPlugins||DVe,a={},l,d=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(y){for(var w=y.getAttribute("data-emotion").split(" "),b=1;b<w.length;b++)a[w[b]]=!0;d.push(y)});var c,p=[jVe,MVe];{var u,h=[$Ve,SVe(function(y){u.insert(y)})],m=kVe(p.concat(i,h)),f=function(y){return S7(CVe(y),m)};c=function(y,w,b,v){u=b,f(y?y+"{"+w.styles+"}":w.styles),v&&(x.inserted[w.name]=!0)}}var x={key:t,sheet:new lVe({key:t,container:l,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:c};return x.sheet.hydrate(d),x};function PVe(e){return e==null||Object.keys(e).length===0}function c9e(e){const{styles:t,defaultTheme:o={}}=e,i=typeof t=="function"?a=>t(PVe(a)?o:a):t;return s.jsx(Ow,{styles:i})}function TVe(e,t){return n(e,t)}function zVe(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const FJ=[];function nm(e){return FJ[0]=e,oVe(FJ)}var OJ={exports:{}},Bi={},NJ;function RVe(){if(NJ)return Bi;NJ=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),d=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function y(w){if(typeof w=="object"&&w!==null){var b=w.$$typeof;switch(b){case e:switch(w=w.type,w){case o:case a:case i:case p:case u:case f:return w;default:switch(w=w&&w.$$typeof,w){case d:case c:case m:case h:return w;case l:return w;default:return b}}case t:return b}}}return Bi.ContextConsumer=l,Bi.ContextProvider=d,Bi.Element=e,Bi.ForwardRef=c,Bi.Fragment=o,Bi.Lazy=m,Bi.Memo=h,Bi.Portal=t,Bi.Profiler=a,Bi.StrictMode=i,Bi.Suspense=p,Bi.SuspenseList=u,Bi.isContextConsumer=function(w){return y(w)===l},Bi.isContextProvider=function(w){return y(w)===d},Bi.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Bi.isForwardRef=function(w){return y(w)===c},Bi.isFragment=function(w){return y(w)===o},Bi.isLazy=function(w){return y(w)===m},Bi.isMemo=function(w){return y(w)===h},Bi.isPortal=function(w){return y(w)===t},Bi.isProfiler=function(w){return y(w)===a},Bi.isStrictMode=function(w){return y(w)===i},Bi.isSuspense=function(w){return y(w)===p},Bi.isSuspenseList=function(w){return y(w)===u},Bi.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===o||w===a||w===i||w===p||w===u||typeof w=="object"&&w!==null&&(w.$$typeof===m||w.$$typeof===h||w.$$typeof===d||w.$$typeof===l||w.$$typeof===c||w.$$typeof===x||w.getModuleId!==void 0)},Bi.typeOf=y,Bi}var HJ;function FVe(){return HJ||(HJ=1,OJ.exports=RVe()),OJ.exports}var p9e=FVe();function o0(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 u9e(e){if(g.isValidElement(e)||p9e.isValidElementType(e)||!o0(e))return e;const t={};return Object.keys(e).forEach(o=>{t[o]=u9e(e[o])}),t}function Zs(e,t,o={clone:!0}){const i=o.clone?{...e}:e;return o0(e)&&o0(t)&&Object.keys(t).forEach(a=>{g.isValidElement(t[a])||p9e.isValidElementType(t[a])?i[a]=t[a]:o0(t[a])&&Object.prototype.hasOwnProperty.call(e,a)&&o0(e[a])?i[a]=Zs(e[a],t[a],o):o.clone?i[a]=o0(t[a])?u9e(t[a]):t[a]:i[a]=t[a]}),i}const OVe=e=>{const t=Object.keys(e).map(o=>({key:o,val:e[o]}))||[];return t.sort((o,i)=>o.val-i.val),t.reduce((o,i)=>({...o,[i.key]:i.val}),{})};function NVe(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:o="px",step:i=5,...a}=e,l=OVe(t),d=Object.keys(l);function c(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${o})`}function p(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-i/100}${o})`}function u(f,x){const y=d.indexOf(x);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${o}) and (max-width:${(y!==-1&&typeof t[d[y]]=="number"?t[d[y]]:x)-i/100}${o})`}function h(f){return d.indexOf(f)+1<d.length?u(f,d[d.indexOf(f)+1]):c(f)}function m(f){const x=d.indexOf(f);return x===0?c(d[1]):x===d.length-1?p(d[x]):u(f,d[d.indexOf(f)+1]).replace("@media","@media not all and")}return{keys:d,values:l,up:c,down:p,between:u,only:h,not:m,unit:o,...a}}function _J(e,t){if(!e.containerQueries)return t;const o=Object.keys(t).filter(i=>i.startsWith("@container")).sort((i,a)=>{const l=/min-width:\s*([0-9.]+)/;return+(i.match(l)?.[1]||0)-+(a.match(l)?.[1]||0)});return o.length?o.reduce((i,a)=>{const l=t[a];return delete i[a],i[a]=l,i},{...t}):t}function HVe(e,t){return t==="@"||t.startsWith("@")&&(e.some(o=>t.startsWith(`@${o}`))||!!t.match(/^@\d/))}function _Ve(e,t){const o=t.match(/^@([^/]+)?\/?(.+)?$/);if(!o)return null;const[,i,a]=o,l=Number.isNaN(+i)?i||0:+i;return e.containerQueries(a).up(l)}function VVe(e){const t=(l,d)=>l.replace("@media",d?`@container ${d}`:"@container");function o(l,d){l.up=(...c)=>t(e.breakpoints.up(...c),d),l.down=(...c)=>t(e.breakpoints.down(...c),d),l.between=(...c)=>t(e.breakpoints.between(...c),d),l.only=(...c)=>t(e.breakpoints.only(...c),d),l.not=(...c)=>{const p=t(e.breakpoints.not(...c),d);return p.includes("not all and")?p.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):p}}const i={},a=l=>(o(i,l),i);return o(a),{...e,containerQueries:a}}const QVe={borderRadius:4};function sy(e,t){return t?Zs(e,t,{clone:!1}):e}const YE={xs:0,sm:600,md:900,lg:1200,xl:1536},VJ={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${YE[e]}px)`},UVe={containerQueries:e=>({up:t=>{let o=typeof t=="number"?t:YE[t]||t;return typeof o=="number"&&(o=`${o}px`),e?`@container ${e} (min-width:${o})`:`@container (min-width:${o})`}})};function k0(e,t,o){const i=e.theme||{};if(Array.isArray(t)){const a=i.breakpoints||VJ;return t.reduce((l,d,c)=>(l[a.up(a.keys[c])]=o(t[c]),l),{})}if(typeof t=="object"){const a=i.breakpoints||VJ;return Object.keys(t).reduce((l,d)=>{if(HVe(a.keys,d)){const c=_Ve(i.containerQueries?i:UVe,d);c&&(l[c]=o(t[d],d))}else if(Object.keys(a.values||YE).includes(d)){const c=a.up(d);l[c]=o(t[d],d)}else{const c=d;l[c]=t[c]}return l},{})}return o(t)}function WVe(e={}){return e.keys?.reduce((t,o)=>{const i=e.up(o);return t[i]={},t},{})||{}}function QJ(e,t){return e.reduce((o,i)=>{const a=o[i];return(!a||Object.keys(a).length===0)&&delete o[i],o},t)}function or(e){if(typeof e!="string")throw new Error($0(7));return e.charAt(0).toUpperCase()+e.slice(1)}function KE(e,t,o=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&o){const i=`vars.${t}`.split(".").reduce((a,l)=>a&&a[l]?a[l]:null,e);if(i!=null)return i}return t.split(".").reduce((i,a)=>i&&i[a]!=null?i[a]:null,e)}function ik(e,t,o,i=o){let a;return typeof e=="function"?a=e(o):Array.isArray(e)?a=e[o]||i:a=KE(e,o)||i,t&&(a=t(a,i,e)),a}function ta(e){const{prop:t,cssProperty:o=e.prop,themeKey:i,transform:a}=e,l=d=>{if(d[t]==null)return null;const c=d[t],p=d.theme,u=KE(p,i)||{};return k0(d,c,h=>{let m=ik(u,a,h);return h===m&&typeof h=="string"&&(m=ik(u,a,`${t}${h==="default"?"":or(h)}`,h)),o===!1?m:{[o]:m}})};return l.propTypes={},l.filterProps=[t],l}function GVe(e){const t={};return o=>(t[o]===void 0&&(t[o]=e(o)),t[o])}const YVe={m:"margin",p:"padding"},KVe={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},UJ={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},qVe=GVe(e=>{if(e.length>2)if(UJ[e])e=UJ[e];else return[e];const[t,o]=e.split(""),i=YVe[t],a=KVe[o]||"";return Array.isArray(a)?a.map(l=>i+l):[i+a]}),IW=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],jW=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...IW,...jW];function _w(e,t,o,i){const a=KE(e,t,!0)??o;return typeof a=="number"||typeof a=="string"?l=>typeof l=="string"?l:typeof a=="string"?a.startsWith("var(")&&l===0?0:a.startsWith("var(")&&l===1?a:`calc(${l} * ${a})`:a*l:Array.isArray(a)?l=>{if(typeof l=="string")return l;const d=Math.abs(l),c=a[d];return l>=0?c:typeof c=="number"?-c:typeof c=="string"&&c.startsWith("var(")?`calc(-1 * ${c})`:`-${c}`}:typeof a=="function"?a:()=>{}}function MW(e){return _w(e,"spacing",8)}function Vw(e,t){return typeof t=="string"||t==null?t:e(t)}function ZVe(e,t){return o=>e.reduce((i,a)=>(i[a]=Vw(t,o),i),{})}function JVe(e,t,o,i){if(!t.includes(o))return null;const a=qVe(o),l=ZVe(a,i),d=e[o];return k0(e,d,l)}function h9e(e,t){const o=MW(e.theme);return Object.keys(e).map(i=>JVe(e,t,i,o)).reduce(sy,{})}function jn(e){return h9e(e,IW)}jn.propTypes={};jn.filterProps=IW;function Mn(e){return h9e(e,jW)}Mn.propTypes={};Mn.filterProps=jW;function m9e(e=8,t=MW({spacing:e})){if(e.mui)return e;const o=(...i)=>(i.length===0?[1]:i).map(a=>{const l=t(a);return typeof l=="number"?`${l}px`:l}).join(" ");return o.mui=!0,o}function qE(...e){const t=e.reduce((i,a)=>(a.filterProps.forEach(l=>{i[l]=a}),i),{}),o=i=>Object.keys(i).reduce((a,l)=>t[l]?sy(a,t[l](i)):a,{});return o.propTypes={},o.filterProps=e.reduce((i,a)=>i.concat(a.filterProps),[]),o}function Ec(e){return typeof e!="number"?e:`${e}px solid`}function Kc(e,t){return ta({prop:e,themeKey:"borders",transform:t})}const XVe=Kc("border",Ec),eQe=Kc("borderTop",Ec),tQe=Kc("borderRight",Ec),oQe=Kc("borderBottom",Ec),rQe=Kc("borderLeft",Ec),iQe=Kc("borderColor"),nQe=Kc("borderTopColor"),aQe=Kc("borderRightColor"),sQe=Kc("borderBottomColor"),lQe=Kc("borderLeftColor"),dQe=Kc("outline",Ec),cQe=Kc("outlineColor"),ZE=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=_w(e.theme,"shape.borderRadius",4),o=i=>({borderRadius:Vw(t,i)});return k0(e,e.borderRadius,o)}return null};ZE.propTypes={};ZE.filterProps=["borderRadius"];qE(XVe,eQe,tQe,oQe,rQe,iQe,nQe,aQe,sQe,lQe,ZE,dQe,cQe);const JE=e=>{if(e.gap!==void 0&&e.gap!==null){const t=_w(e.theme,"spacing",8),o=i=>({gap:Vw(t,i)});return k0(e,e.gap,o)}return null};JE.propTypes={};JE.filterProps=["gap"];const XE=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=_w(e.theme,"spacing",8),o=i=>({columnGap:Vw(t,i)});return k0(e,e.columnGap,o)}return null};XE.propTypes={};XE.filterProps=["columnGap"];const eL=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=_w(e.theme,"spacing",8),o=i=>({rowGap:Vw(t,i)});return k0(e,e.rowGap,o)}return null};eL.propTypes={};eL.filterProps=["rowGap"];const pQe=ta({prop:"gridColumn"}),uQe=ta({prop:"gridRow"}),hQe=ta({prop:"gridAutoFlow"}),mQe=ta({prop:"gridAutoColumns"}),gQe=ta({prop:"gridAutoRows"}),fQe=ta({prop:"gridTemplateColumns"}),xQe=ta({prop:"gridTemplateRows"}),yQe=ta({prop:"gridTemplateAreas"}),wQe=ta({prop:"gridArea"});qE(JE,XE,eL,pQe,uQe,hQe,mQe,gQe,fQe,xQe,yQe,wQe);function E7(e,t){return t==="grey"?t:e}const bQe=ta({prop:"color",themeKey:"palette",transform:E7}),vQe=ta({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:E7}),CQe=ta({prop:"backgroundColor",themeKey:"palette",transform:E7});qE(bQe,vQe,CQe);function Rd(e){return e<=1&&e!==0?`${e*100}%`:e}const AQe=ta({prop:"width",transform:Rd}),BW=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=o=>{const i=e.theme?.breakpoints?.values?.[o]||YE[o];return i?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:Rd(o)}};return k0(e,e.maxWidth,t)}return null};BW.filterProps=["maxWidth"];const $Qe=ta({prop:"minWidth",transform:Rd}),kQe=ta({prop:"height",transform:Rd}),SQe=ta({prop:"maxHeight",transform:Rd}),EQe=ta({prop:"minHeight",transform:Rd});ta({prop:"size",cssProperty:"width",transform:Rd});ta({prop:"size",cssProperty:"height",transform:Rd});const LQe=ta({prop:"boxSizing"});qE(AQe,BW,$Qe,kQe,SQe,EQe,LQe);const tL={border:{themeKey:"borders",transform:Ec},borderTop:{themeKey:"borders",transform:Ec},borderRight:{themeKey:"borders",transform:Ec},borderBottom:{themeKey:"borders",transform:Ec},borderLeft:{themeKey:"borders",transform:Ec},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Ec},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:ZE},color:{themeKey:"palette",transform:E7},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:E7},backgroundColor:{themeKey:"palette",transform:E7},p:{style:Mn},pt:{style:Mn},pr:{style:Mn},pb:{style:Mn},pl:{style:Mn},px:{style:Mn},py:{style:Mn},padding:{style:Mn},paddingTop:{style:Mn},paddingRight:{style:Mn},paddingBottom:{style:Mn},paddingLeft:{style:Mn},paddingX:{style:Mn},paddingY:{style:Mn},paddingInline:{style:Mn},paddingInlineStart:{style:Mn},paddingInlineEnd:{style:Mn},paddingBlock:{style:Mn},paddingBlockStart:{style:Mn},paddingBlockEnd:{style:Mn},m:{style:jn},mt:{style:jn},mr:{style:jn},mb:{style:jn},ml:{style:jn},mx:{style:jn},my:{style:jn},margin:{style:jn},marginTop:{style:jn},marginRight:{style:jn},marginBottom:{style:jn},marginLeft:{style:jn},marginX:{style:jn},marginY:{style:jn},marginInline:{style:jn},marginInlineStart:{style:jn},marginInlineEnd:{style:jn},marginBlock:{style:jn},marginBlockStart:{style:jn},marginBlockEnd:{style:jn},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:JE},rowGap:{style:eL},columnGap:{style:XE},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Rd},maxWidth:{style:BW},minWidth:{transform:Rd},height:{transform:Rd},maxHeight:{transform:Rd},minHeight:{transform:Rd},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 IQe(...e){const t=e.reduce((i,a)=>i.concat(Object.keys(a)),[]),o=new Set(t);return e.every(i=>o.size===Object.keys(i).length)}function jQe(e,t){return typeof e=="function"?e(t):e}function MQe(){function e(o,i,a,l){const d={[o]:i,theme:a},c=l[o];if(!c)return{[o]:i};const{cssProperty:p=o,themeKey:u,transform:h,style:m}=c;if(i==null)return null;if(u==="typography"&&i==="inherit")return{[o]:i};const f=KE(a,u)||{};return m?m(d):k0(d,i,x=>{let y=ik(f,h,x);return x===y&&typeof x=="string"&&(y=ik(f,h,`${o}${x==="default"?"":or(x)}`,x)),p===!1?y:{[p]:y}})}function t(o){const{sx:i,theme:a={},nested:l}=o||{};if(!i)return null;const d=a.unstable_sxConfig??tL;function c(p){let u=p;if(typeof p=="function")u=p(a);else if(typeof p!="object")return p;if(!u)return null;const h=WVe(a.breakpoints),m=Object.keys(h);let f=h;return Object.keys(u).forEach(x=>{const y=jQe(u[x],a);if(y!=null)if(typeof y=="object")if(d[x])f=sy(f,e(x,y,a,d));else{const w=k0({theme:a},y,b=>({[x]:b}));IQe(w,y)?f[x]=t({sx:y,theme:a,nested:!0}):f=sy(f,w)}else f=sy(f,e(x,y,a,d))}),!l&&a.modularCssLayers?{"@layer sx":_J(a,QJ(m,f))}:_J(a,QJ(m,f))}return Array.isArray(i)?i.map(c):c(i)}return t}const $4=MQe();$4.filterProps=["sx"];function BQe(e,t){const o=this;if(o.vars){if(!o.colorSchemes?.[e]||typeof o.getColorSchemeSelector!="function")return{};let i=o.getColorSchemeSelector(e);return i==="&"?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return o.palette.mode===e?t:{}}function DW(e={},...t){const{breakpoints:o={},palette:i={},spacing:a,shape:l={},...d}=e,c=NVe(o),p=m9e(a);let u=Zs({breakpoints:c,direction:"ltr",components:{},palette:{mode:"light",...i},spacing:p,shape:{...QVe,...l}},d);return u=VVe(u),u.applyStyles=BQe,u=t.reduce((h,m)=>Zs(h,m),u),u.unstable_sxConfig={...tL,...d?.unstable_sxConfig},u.unstable_sx=function(h){return $4({sx:h,theme:this})},u}function DQe(e){return Object.keys(e).length===0}function PW(e=null){const t=g.useContext(q8e);return!t||DQe(t)?e:t}const PQe=DW();function g9e(e=PQe){return PW(e)}function WJ(e){const t=nm(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function f9e({styles:e,themeId:t,defaultTheme:o={}}){const i=g9e(o),a=t&&i[t]||i;let l=typeof e=="function"?e(a):e;return a.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>WJ(typeof d=="function"?d(a):d)):l=WJ(l)),s.jsx(c9e,{styles:l})}const GJ=e=>e,TQe=()=>{let e=GJ;return{configure(t){e=t},generate(t){return e(t)},reset(){e=GJ}}},zQe=TQe();function x9e(e){var t,o,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(o=x9e(e[t]))&&(i&&(i+=" "),i+=o)}else for(o in e)e[o]&&(i&&(i+=" "),i+=o);return i}function Oo(){for(var e,t,o=0,i="",a=arguments.length;o<a;o++)(e=arguments[o])&&(t=x9e(e))&&(i&&(i+=" "),i+=t);return i}const RQe={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 li(e,t,o="Mui"){const i=RQe[t];return i?`${o}-${i}`:`${zQe.generate(e)}-${t}`}function Xr(e,t,o="Mui"){const i={};return t.forEach(a=>{i[a]=li(e,a,o)}),i}function y9e(e){const{variants:t,...o}=e,i={variants:t,style:nm(o),isProcessed:!0};return i.style===o||t&&t.forEach(a=>{typeof a.style!="function"&&(a.style=nm(a.style))}),i}const FQe=DW();function MB(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function K3(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function OQe(e){return e?(t,o)=>o[e]:null}function NQe(e,t,o){e.theme=VQe(e.theme)?o:e.theme[t]||e.theme}function v$(e,t,o){const i=typeof t=="function"?t(e):t;if(Array.isArray(i))return i.flatMap(a=>v$(e,a,o));if(Array.isArray(i?.variants)){let a;if(i.isProcessed)a=o?K3(i.style,o):i.style;else{const{variants:l,...d}=i;a=o?K3(nm(d),o):d}return w9e(e,i.variants,[a],o)}return i?.isProcessed?o?K3(nm(i.style),o):i.style:o?K3(nm(i),o):i}function w9e(e,t,o=[],i=void 0){let a;e:for(let l=0;l<t.length;l+=1){const d=t[l];if(typeof d.props=="function"){if(a??={...e,...e.ownerState,ownerState:e.ownerState},!d.props(a))continue}else for(const c in d.props)if(e[c]!==d.props[c]&&e.ownerState?.[c]!==d.props[c])continue e;typeof d.style=="function"?(a??={...e,...e.ownerState,ownerState:e.ownerState},o.push(i?K3(nm(d.style(a)),i):d.style(a))):o.push(i?K3(nm(d.style),i):d.style)}return o}function HQe(e={}){const{themeId:t,defaultTheme:o=FQe,rootShouldForwardProp:i=MB,slotShouldForwardProp:a=MB}=e;function l(d){NQe(d,t,o)}return(d,c={})=>{zVe(d,j=>j.filter(L=>L!==$4));const{name:p,slot:u,skipVariantsResolver:h,skipSx:m,overridesResolver:f=OQe(UQe(u)),...x}=c,y=p&&p.startsWith("Mui")||u?"components":"custom",w=h!==void 0?h:u&&u!=="Root"&&u!=="root"||!1,b=m||!1;let v=MB;u==="Root"||u==="root"?v=i:u?v=a:QQe(d)&&(v=void 0);const A=TVe(d,{shouldForwardProp:v,label:_Qe(),...x}),S=j=>{if(j.__emotion_real===j)return j;if(typeof j=="function")return function(L){return v$(L,j,L.theme.modularCssLayers?y:void 0)};if(o0(j)){const L=y9e(j);return function(M){return L.variants?v$(M,L,M.theme.modularCssLayers?y:void 0):M.theme.modularCssLayers?K3(L.style,y):L.style}}return j},E=(...j)=>{const L=[],M=j.map(S),D=[];if(L.push(l),p&&f&&D.push(function(z){const R=z.theme.components?.[p]?.styleOverrides;if(!R)return null;const K={};for(const Z in R)K[Z]=v$(z,R[Z],z.theme.modularCssLayers?"theme":void 0);return f(z,K)}),p&&!w&&D.push(function(z){const R=z.theme?.components?.[p]?.variants;return R?w9e(z,R,[],z.theme.modularCssLayers?"theme":void 0):null}),b||D.push($4),Array.isArray(M[0])){const z=M.shift(),R=new Array(L.length).fill(""),K=new Array(D.length).fill("");let Z;Z=[...R,...z,...K],Z.raw=[...R,...z.raw,...K],L.unshift(Z)}const P=[...L,...M,...D],T=A(...P);return d.muiName&&(T.muiName=d.muiName),T};return A.withConfig&&(E.withConfig=A.withConfig),E}}function _Qe(e,t){return void 0}function VQe(e){for(const t in e)return!1;return!0}function QQe(e){return typeof e=="string"&&e.charCodeAt(0)>96}function UQe(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function k_(e,t,o=!1){const i={...t};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const l=a;if(l==="components"||l==="slots")i[l]={...e[l],...i[l]};else if(l==="componentsProps"||l==="slotProps"){const d=e[l],c=t[l];if(!c)i[l]=d||{};else if(!d)i[l]=c;else{i[l]={...c};for(const p in d)if(Object.prototype.hasOwnProperty.call(d,p)){const u=p;i[l][u]=k_(d[u],c[u],o)}}}else l==="className"&&o&&t.className?i.className=Oo(e?.className,t?.className):l==="style"&&o&&t.style?i.style={...e?.style,...t?.style}:i[l]===void 0&&(i[l]=e[l])}return i}const Yd=typeof window<"u"?g.useLayoutEffect:g.useEffect;function WQe(e,t=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,o))}function TW(e,t=0,o=1){return WQe(e,t,o)}function GQe(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let o=e.match(t);return o&&o[0].length===1&&(o=o.map(i=>i+i)),o?`rgb${o.length===4?"a":""}(${o.map((i,a)=>a<3?parseInt(i,16):Math.round(parseInt(i,16)/255*1e3)/1e3).join(", ")})`:""}function bm(e){if(e.type)return e;if(e.charAt(0)==="#")return bm(GQe(e));const t=e.indexOf("("),o=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(o))throw new Error($0(9,e));let i=e.substring(t+1,e.length-1),a;if(o==="color"){if(i=i.split(" "),a=i.shift(),i.length===4&&i[3].charAt(0)==="/"&&(i[3]=i[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(a))throw new Error($0(10,a))}else i=i.split(",");return i=i.map(l=>parseFloat(l)),{type:o,values:i,colorSpace:a}}const YQe=e=>{const t=bm(e);return t.values.slice(0,3).map((o,i)=>t.type.includes("hsl")&&i!==0?`${o}%`:o).join(" ")},jx=(e,t)=>{try{return YQe(e)}catch{return e}};function oL(e){const{type:t,colorSpace:o}=e;let{values:i}=e;return t.includes("rgb")?i=i.map((a,l)=>l<3?parseInt(a,10):a):t.includes("hsl")&&(i[1]=`${i[1]}%`,i[2]=`${i[2]}%`),t.includes("color")?i=`${o} ${i.join(" ")}`:i=`${i.join(", ")}`,`${t}(${i})`}function b9e(e){e=bm(e);const{values:t}=e,o=t[0],i=t[1]/100,a=t[2]/100,l=i*Math.min(a,1-a),d=(u,h=(u+o/30)%12)=>a-l*Math.max(Math.min(h-3,9-h,1),-1);let c="rgb";const p=[Math.round(d(0)*255),Math.round(d(8)*255),Math.round(d(4)*255)];return e.type==="hsla"&&(c+="a",p.push(t[3])),oL({type:c,values:p})}function S_(e){e=bm(e);let t=e.type==="hsl"||e.type==="hsla"?bm(b9e(e)).values:e.values;return t=t.map(o=>(e.type!=="color"&&(o/=255),o<=.03928?o/12.92:((o+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function KQe(e,t){const o=S_(e),i=S_(t);return(Math.max(o,i)+.05)/(Math.min(o,i)+.05)}function nk(e,t){return e=bm(e),t=TW(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,oL(e)}function _g(e,t,o){try{return nk(e,t)}catch{return e}}function rL(e,t){if(e=bm(e),t=TW(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let o=0;o<3;o+=1)e.values[o]*=1-t;return oL(e)}function Ai(e,t,o){try{return rL(e,t)}catch{return e}}function iL(e,t){if(e=bm(e),t=TW(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let o=0;o<3;o+=1)e.values[o]+=(255-e.values[o])*t;else if(e.type.includes("color"))for(let o=0;o<3;o+=1)e.values[o]+=(1-e.values[o])*t;return oL(e)}function $i(e,t,o){try{return iL(e,t)}catch{return e}}function qQe(e,t=.15){return S_(e)>.5?rL(e,t):iL(e,t)}function Cv(e,t,o){try{return qQe(e,t)}catch{return e}}const v9e=g.createContext(null);function zW(){return g.useContext(v9e)}const ZQe=typeof Symbol=="function"&&Symbol.for,JQe=ZQe?Symbol.for("mui.nested"):"__THEME_NESTED__";function XQe(e,t){return typeof t=="function"?t(e):{...e,...t}}function eUe(e){const{children:t,theme:o}=e,i=zW(),a=g.useMemo(()=>{const l=i===null?{...o}:XQe(i,o);return l!=null&&(l[JQe]=i!==null),l},[o,i]);return s.jsx(v9e.Provider,{value:a,children:t})}const C9e=g.createContext();function tUe({value:e,...t}){return s.jsx(C9e.Provider,{value:e??!0,...t})}const O6=()=>g.useContext(C9e)??!1,A9e=g.createContext(void 0);function oUe({value:e,children:t}){return s.jsx(A9e.Provider,{value:e,children:t})}function rUe(e){const{theme:t,name:o,props:i}=e;if(!t||!t.components||!t.components[o])return i;const a=t.components[o];return a.defaultProps?k_(a.defaultProps,i,t.components.mergeClassNameAndStyle):!a.styleOverrides&&!a.variants?k_(a,i,t.components.mergeClassNameAndStyle):i}function iUe({props:e,name:t}){const o=g.useContext(A9e);return rUe({props:e,name:t,theme:{components:o}})}let YJ=0;function nUe(e){const[t,o]=g.useState(e),i=e||t;return g.useEffect(()=>{t==null&&(YJ+=1,o(`mui-${YJ}`))},[t]),i}const aUe={...MNe},KJ=aUe.useId;function nL(e){if(KJ!==void 0){const t=KJ();return e??t}return nUe(e)}function sUe(e){const t=PW(),o=nL()||"",{modularCssLayers:i}=e;let a="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||t!==null?a="":typeof i=="string"?a=i.replace(/mui(?!\.)/g,a):a=`@layer ${a};`,Yd(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(a){if(d&&d.hasAttribute?.("data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===o)return;const c=document.createElement("style");c.setAttribute("data-mui-layer-order",o),c.textContent=a,l.prepend(c)}else l.querySelector(`style[data-mui-layer-order="${o}"]`)?.remove()},[a,o]),a?s.jsx(f9e,{styles:a}):null}const qJ={};function ZJ(e,t,o,i=!1){return g.useMemo(()=>{const a=e&&t[e]||t;if(typeof o=="function"){const l=o(a),d=e?{...t,[e]:l}:l;return i?()=>d:d}return e?{...t,[e]:o}:{...t,...o}},[e,t,o,i])}function $9e(e){const{children:t,theme:o,themeId:i}=e,a=PW(qJ),l=zW()||qJ,d=ZJ(i,a,o),c=ZJ(i,l,o,!0),p=(i?d[i]:d).direction==="rtl",u=sUe(d);return s.jsx(eUe,{theme:c,children:s.jsx(q8e.Provider,{value:d,children:s.jsx(tUe,{value:p,children:s.jsxs(oUe,{value:i?d[i].components:d.components,children:[u,t]})})})})}const JJ={theme:void 0};function lUe(e){let t,o;return function(i){let a=t;return(a===void 0||i.theme!==o)&&(JJ.theme=i.theme,a=y9e(e(JJ)),t=a,o=i.theme),a}}const RW="mode",FW="color-scheme",dUe="data-color-scheme";function cUe(e){const{defaultMode:t="system",defaultLightColorScheme:o="light",defaultDarkColorScheme:i="dark",modeStorageKey:a=RW,colorSchemeStorageKey:l=FW,attribute:d=dUe,colorSchemeNode:c="document.documentElement",nonce:p}=e||{};let u="",h=d;if(d==="class"&&(h=".%s"),d==="data"&&(h="[data-%s]"),h.startsWith(".")){const f=h.substring(1);u+=`${c}.classList.remove('${f}'.replace('%s', light), '${f}'.replace('%s', dark));
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/empty-B9bTdnzW.js","assets/sentry-CR3PzqvD.js","assets/empty-DCrqM1RS.js","assets/index-Csk7zXgi.js","assets/index-DkxpWxmH.js","assets/zeni-epic-state-Dx-mgwwn.js","assets/core-C-BvKSHF.js","assets/utils-CMlimj8x.js","assets/recharts-6O0k3Sgn.js","assets/url-kOslY_9p.js","assets/index-B7A7Bq2L.js","assets/index-FfXn1jJZ.js","assets/url-mBOiBJLr.js","assets/index-CX9wa_uF.js","assets/ScreenRoutes-CNd21hfH.js","assets/liveblocks-3VYKPeI8.js","assets/analyticsHelper-CQILqzn0.js","assets/mui-rEjY64BN.js","assets/SignInScreen-CRHQ8OnU.js","assets/analytics-R16_Exat.js","assets/lottie-abtTF1Wk.js","assets/lexical-46kddbXs.js"])))=>i.map(i=>d[i]);
2
+ import{a as g,b as $,R as MNe,c as A4,p as G2,r as fd,g as cW,e as uJ,f as BNe,s as hJ,w as DNe,i as PNe,S as TNe,j as zNe,k as RNe,l as FNe,m as ONe}from"./sentry-CR3PzqvD.js";import{j as yo,_ as k8e,a as Jd,u as S8e,T as NNe,C as HNe,b as _Ne,c as FE,d as OE,e as VNe,f as E8e,g as QNe,h as UNe,L as WNe,i as mJ,k as GNe,l as YNe,P as KNe,m as qNe,n as ZNe,o as L8e,p as JNe,q as XNe,I as gJ,r as eHe,s as tHe,t as oHe,v as rHe,w as iHe,x as nHe,y as I8e,z as aHe,A as sHe,B as lHe}from"./liveblocks-3VYKPeI8.js";import{f as j8e,R as G3,r as Hn,P as $n,u as NE,g as Ru,h as dHe,i as pW,j as cHe,k as pHe,l as kB,N as uHe,m as hHe,n as mHe,B as gHe}from"./core-C-BvKSHF.js";import{H as J$,ba as Y3,bb as fHe,bc as fJ,bd as V4,be as Qr,bf as M8e,bg as HE,bh as Dr,bi as xHe,bj as yHe,bk as Y7,bl as ym,bm as uW,bn as B8e,bo as wHe,bp as k1,bq as bHe,br as hW,bs as D8e,bt as Yi,bu as K7,bv as mu,bw as vHe,bx as CHe,by as AHe,bz as P8e,bA as g_,bB as $He,bC as kHe,bD as SHe,bE as EHe,bF as mW,bG as T8e,bH as wm,bI as LHe,bJ as z8e,bK as f_,bL as xJ,bM as yJ,bN as wJ,bO as wl,bP as gW,bQ as fW,bR as R6,bS as xW,bT as yW,bU as wW,bV as bW,bW as IHe,bX as X$,bY as jHe,bZ as R8e,b_ as vW,b$ as MHe,c0 as h0,c1 as Rw,c2 as Fw,c3 as BHe,c4 as DHe,c5 as PHe,c6 as THe,c7 as zHe,c8 as RHe,c9 as FHe,ca as wv,cb as OHe,cc as NHe,cd as HHe,ce as _He,cf as VHe,cg as QHe,ch as UHe,ci as WHe,cj as GHe,ck as YHe,cl as KHe,cm as qHe,cn as ZHe,co as JHe,cp as F8e,cq as XHe,cr as bJ,cs as e_e,ct as t_e,cu as Ty,cv as O8e,cw as o_e,cx as N8e,cy as CW,cz as r_e,cA as vJ,cB as i_e,cC as CJ,cD as H8e,cE as _8e,cF as V8e,cG as Q8e,cH as U8e,cI as n_e,cJ as W8e,cK as a_e,cL as s_e,cM as l_e,cN as G8e,cO as x_,cP as d_e,cQ as Y8e,cR as K8e,cS as c_e,cT as p_e,cU as u_e,cV as h_e,cW as m_e,cX as g_e,cY as f_e,cZ as x_e,v as y_e,c_ as _E,c$ as y_,d0 as w_,d1 as w_e,d2 as b_e,d3 as v_e,d4 as C_e,d5 as A_e,d6 as $_e,d7 as k_e,d8 as S_e,d9 as E_e,da as L_e,db as AJ,dc as I_e,dd as j_e,de as M_e,df as B_e,dg as D_e}from"./zeni-epic-state-Dx-mgwwn.js";import{T as q8e,j as To,n,c as he,k as Nt,G as Ow,C as Z8e,u as J8e,a as P_e}from"./mui-rEjY64BN.js";import{r as T_e,m as gu}from"./analytics-R16_Exat.js";import{L as b_}from"./lottie-abtTF1Wk.js";import{r as fa}from"./lexical-46kddbXs.js";import{E as Oi,c as VE,P as z_e,R as v_,F as ek,X as Wd,Y as Gd,G as P0,H as tk,I as QE,J as T0,K as X8e,L as R_e,M as F_e,N as Q4,O as AW,Q as $W,S as Nw,U as O_e}from"./recharts-6O0k3Sgn.js";import{r as N_e}from"./utils-CMlimj8x.js";(function(){try{var e=typeof window<"u"?window:typeof A4<"u"?A4:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eebc4847-07cf-48aa-bbd9-8c3cb7292bc5",e._sentryDebugIdIdentifier="sentry-dbid-eebc4847-07cf-48aa-bbd9-8c3cb7292bc5")}catch{}})();(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function o(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(a){if(a.ep)return;a.ep=!0;const l=o(a);fetch(a.href,l)}})();var bv={},$J;function H_e(){if($J)return bv;$J=1;var e=j8e();return bv.createRoot=e.createRoot,bv.hydrateRoot=e.hydrateRoot,bv}var __e=H_e(),td=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof A4<"u"?A4:typeof self<"u"?self:{};function Mr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kJ={exports:{}},F8={},SJ;function V_e(){if(SJ)return F8;SJ=1;var e=$,t=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function d(c,p,u){var h,m={},f=null,x=null;u!==void 0&&(f=""+u),p.key!==void 0&&(f=""+p.key),p.ref!==void 0&&(x=p.ref);for(h in p)i.call(p,h)&&!l.hasOwnProperty(h)&&(m[h]=p[h]);if(c&&c.defaultProps)for(h in p=c.defaultProps,p)m[h]===void 0&&(m[h]=p[h]);return{$$typeof:t,type:c,key:f,ref:x,props:m,_owner:a.current}}return F8.Fragment=o,F8.jsx=d,F8.jsxs=d,F8}var EJ;function e9e(){return EJ||(EJ=1,kJ.exports=V_e()),kJ.exports}var s=e9e();const Q_e=g.createContext(null),SB={didCatch:!1,error:null};let U_e=class extends g.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=SB}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var o,i,a=arguments.length,l=new Array(a),d=0;d<a;d++)l[d]=arguments[d];(o=(i=this.props).onReset)===null||o===void 0||o.call(i,{args:l,reason:"imperative-api"}),this.setState(SB)}}componentDidCatch(t,o){var i,a;(i=(a=this.props).onError)===null||i===void 0||i.call(a,t,o)}componentDidUpdate(t,o){const{didCatch:i}=this.state,{resetKeys:a}=this.props;if(i&&o.error!==null&&W_e(t.resetKeys,a)){var l,d;(l=(d=this.props).onReset)===null||l===void 0||l.call(d,{next:a,prev:t.resetKeys,reason:"keys"}),this.setState(SB)}}render(){const{children:t,fallbackRender:o,FallbackComponent:i,fallback:a}=this.props,{didCatch:l,error:d}=this.state;let c=t;if(l){const p={error:d,resetErrorBoundary:this.resetErrorBoundary};if(typeof o=="function")c=o(p);else if(i)c=g.createElement(i,p);else if(a!==void 0)c=a;else throw d}return g.createElement(Q_e.Provider,{value:{didCatch:l,error:d,resetErrorBoundary:this.resetErrorBoundary}},c)}};function W_e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((o,i)=>!Object.is(o,t[i]))}var C_={exports:{}},G_e=C_.exports,LJ;function Y_e(){return LJ||(LJ=1,function(e){(function(t,o){e.exports?e.exports=o():t.numeral=o()})(G_e,function(){var t,o,i="2.0.6",a={},l={},d={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},c={currentLocale:d.currentLocale,zeroFormat:d.zeroFormat,nullFormat:d.nullFormat,defaultFormat:d.defaultFormat,scalePercentBy100:d.scalePercentBy100};function p(u,h){this._input=u,this._value=h}return t=function(u){var h,m,f,x;if(t.isNumeral(u))h=u.value();else if(u===0||typeof u>"u")h=0;else if(u===null||o.isNaN(u))h=null;else if(typeof u=="string")if(c.zeroFormat&&u===c.zeroFormat)h=0;else if(c.nullFormat&&u===c.nullFormat||!u.replace(/[^0-9]+/g,"").length)h=null;else{for(m in a)if(x=typeof a[m].regexps.unformat=="function"?a[m].regexps.unformat():a[m].regexps.unformat,x&&u.match(x)){f=a[m].unformat;break}f=f||t._.stringToNumber,h=f(u)}else h=Number(u)||null;return new p(u,h)},t.version=i,t.isNumeral=function(u){return u instanceof p},t._=o={numberToFormat:function(u,h,m){var f=l[t.options.currentLocale],x=!1,y=!1,w=0,b="",v=1e12,A=1e9,S=1e6,E=1e3,j="",L=!1,M,D,P,T,z,R,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")&&(b=" "),h=h.replace(new RegExp(b+"a[kmbt]?"),""),D>=v&&!M||M==="t"?(b+=f.abbreviations.trillion,u=u/v):D<v&&D>=A&&!M||M==="b"?(b+=f.abbreviations.billion,u=u/A):D<A&&D>=S&&!M||M==="m"?(b+=f.abbreviations.million,u=u/S):(D<S&&D>=E&&!M||M==="k")&&(b+=f.abbreviations.thousand,u=u/E)),t._.includes(h,"[.]")&&(y=!0,h=h.replace("[.]",".")),P=u.toString().split(".")[0],T=h.split(".")[1],R=h.indexOf(","),w=(h.split(".")[0].split(",")[0].match(/0/g)||[]).length,T?(t._.includes(T,"[")?(T=T.replace("]",""),T=T.split("["),j=t._.toFixed(u,T[0].length+T[1].length,m,T[1].length)):j=t._.toFixed(u,T.length,m),P=j.split(".")[0],t._.includes(j,".")?j=f.delimiters.decimal+j.split(".")[1]:j="",y&&Number(j.slice(1))===0&&(j="")):P=t._.toFixed(u,0,m),b&&!M&&Number(P)>=1e3&&b!==f.abbreviations.trillion)switch(P=String(Number(P)/1e3),b){case f.abbreviations.thousand:b=f.abbreviations.million;break;case f.abbreviations.million:b=f.abbreviations.billion;break;case f.abbreviations.billion:b=f.abbreviations.trillion;break}if(t._.includes(P,"-")&&(P=P.slice(1),L=!0),P.length<w)for(var Z=w-P.length;Z>0;Z--)P="0"+P;return R>-1&&(P=P.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),h.indexOf(".")===0&&(P=""),K=P+j+(b||""),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[c.currentLocale],m=u,f={thousand:3,million:6,billion:9,trillion:12},x,y,w;if(c.zeroFormat&&u===c.zeroFormat)y=0;else if(c.nullFormat&&u===c.nullFormat||!u.replace(/[^0-9]+/g,"").length)y=null;else{y=1,h.delimiters.decimal!=="."&&(u=u.replace(/\./g,"").replace(h.delimiters.decimal,"."));for(x in f)if(w=new RegExp("[^a-zA-Z]"+h.abbreviations[x]+"(?:\\)|(\\"+h.currency.symbol+")?(?:\\))?)?$"),m.match(w)){y*=Math.pow(10,f[x]);break}y*=(u.split("-").length+Math.min(u.split("(").length-1,u.split(")").length-1))%2?1:-1,u=u.replace(/[^0-9\.]+/g,""),y*=Number(u)}return y},isNaN:function(u){return typeof u=="number"&&isNaN(u)},includes:function(u,h){return u.indexOf(h)!==-1},insert:function(u,h,m){return u.slice(0,m)+h+u.slice(m)},reduce:function(u,h){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof h!="function")throw new TypeError(h+" is not a function");var m=Object(u),f=m.length>>>0,x=0,y;if(arguments.length===3)y=arguments[2];else{for(;x<f&&!(x in m);)x++;if(x>=f)throw new TypeError("Reduce of empty array with no initial value");y=m[x++]}for(;x<f;x++)x in m&&(y=h(y,m[x],x,m));return y},multiplier:function(u){var h=u.toString().split(".");return h.length<2?1:Math.pow(10,h[1].length)},correctionFactor:function(){var u=Array.prototype.slice.call(arguments);return u.reduce(function(h,m){var f=o.multiplier(m);return h>f?h:f},1)},toFixed:function(u,h,m,f){var x=u.toString().split("."),y=h-(f||0),w,b,v,A;return x.length===2?w=Math.min(Math.max(x[1].length,y),h):w=y,v=Math.pow(10,w),A=(m(u+"e+"+w)/v).toFixed(w),f>h-w&&(b=new RegExp("\\.?0{1,"+(f-(h-w))+"}$"),A=A.replace(b,"")),A}},t.options=c,t.formats=a,t.locales=l,t.locale=function(u){return u&&(c.currentLocale=u.toLowerCase()),c.currentLocale},t.localeData=function(u){if(!u)return l[c.currentLocale];if(u=u.toLowerCase(),!l[u])throw new Error("Unknown locale : "+u);return l[u]},t.reset=function(){for(var u in d)c[u]=d[u]},t.zeroFormat=function(u){c.zeroFormat=typeof u=="string"?u:null},t.nullFormat=function(u){c.nullFormat=typeof u=="string"?u:null},t.defaultFormat=function(u){c.defaultFormat=typeof u=="string"?u:"0.0"},t.register=function(u,h,m){if(h=h.toLowerCase(),this[u+"s"][h])throw new TypeError(h+" "+u+" already registered.");return this[u+"s"][h]=m,m},t.validate=function(u,h){var m,f,x,y,w,b,v,A;if(typeof u!="string"&&(u+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",u)),u=u.trim(),u.match(/^\d+$/))return!0;if(u==="")return!1;try{v=t.localeData(h)}catch{v=t.localeData(t.locale())}return x=v.currency.symbol,w=v.abbreviations,m=v.delimiters.decimal,v.delimiters.thousands==="."?f="\\.":f=v.delimiters.thousands,A=u.match(/^[^\d]+/),A!==null&&(u=u.substr(1),A[0]!==x)||(A=u.match(/[^\d]+$/),A!==null&&(u=u.slice(0,-1),A[0]!==w.thousand&&A[0]!==w.million&&A[0]!==w.billion&&A[0]!==w.trillion))?!1:(b=new RegExp(f+"{2}"),u.match(/[^\d.,]/g)?!1:(y=u.split(m),y.length>2?!1:y.length<2?!!y[0].match(/^\d+.*\d$/)&&!y[0].match(b):y[0].length===1?!!y[0].match(/^\d+$/)&&!y[0].match(b)&&!!y[1].match(/^\d+$/):!!y[0].match(/^\d+.*\d$/)&&!y[0].match(b)&&!!y[1].match(/^\d+$/)))},t.fn=p.prototype={clone:function(){return t(this)},format:function(u,h){var m=this._value,f=u||c.defaultFormat,x,y,w;if(h=h||Math.round,m===0&&c.zeroFormat!==null)y=c.zeroFormat;else if(m===null&&c.nullFormat!==null)y=c.nullFormat;else{for(x in a)if(f.match(a[x].regexps.format)){w=a[x].format;break}w=w||t._.numberToFormat,y=w(m,f,h)}return y},value:function(){return this._value},input:function(){return this._input},set:function(u){return this._value=Number(u),this},add:function(u){var h=o.correctionFactor.call(null,this._value,u);function m(f,x,y,w){return f+Math.round(h*x)}return this._value=o.reduce([this._value,u],m,0)/h,this},subtract:function(u){var h=o.correctionFactor.call(null,this._value,u);function m(f,x,y,w){return f-Math.round(h*x)}return this._value=o.reduce([u],m,Math.round(this._value*h))/h,this},multiply:function(u){function h(m,f,x,y){var w=o.correctionFactor(m,f);return Math.round(m*w)*Math.round(f*w)/Math.round(w*w)}return this._value=o.reduce([this._value,u],h,1),this},divide:function(u){function h(m,f,x,y){var w=o.correctionFactor(m,f);return Math.round(m*w)/Math.round(f*w)}return this._value=o.reduce([this._value,u],h),this},difference:function(u){return Math.abs(t(this._value).subtract(u).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(u){var h=u%10;return~~(u%100/10)===1?"th":h===1?"st":h===2?"nd":h===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(u,h,m){var f=t._.includes(h," BPS")?" ":"",x;return u=u*1e4,h=h.replace(/\s?BPS/,""),x=t._.numberToFormat(u,h,m),t._.includes(x,")")?(x=x.split(""),x.splice(-1,0,f+"BPS"),x=x.join("")):x=x+f+"BPS",x},unformat:function(u){return+(t._.stringToNumber(u)*1e-4).toFixed(15)}})}(),function(){var u={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},h={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},m=u.suffixes.concat(h.suffixes.filter(function(x){return u.suffixes.indexOf(x)<0})),f=m.join("|");f="("+f.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(x,y,w){var b,v=t._.includes(y,"ib")?h:u,A=t._.includes(y," b")||t._.includes(y," ib")?" ":"",S,E,j;for(y=y.replace(/\s?i?b/,""),S=0;S<=v.suffixes.length;S++)if(E=Math.pow(v.base,S),j=Math.pow(v.base,S+1),x===null||x===0||x>=E&&x<j){A+=v.suffixes[S],E>0&&(x=x/E);break}return b=t._.numberToFormat(x,y,w),b+A},unformat:function(x){var y=t._.stringToNumber(x),w,b;if(y){for(w=u.suffixes.length-1;w>=0;w--){if(t._.includes(x,u.suffixes[w])){b=Math.pow(u.base,w);break}if(t._.includes(x,h.suffixes[w])){b=Math.pow(h.base,w);break}}y*=b||1}return y}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(u,h,m){var f=t.locales[t.options.currentLocale],x={before:h.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:h.match(/([\+|\-|\)|\s|\$]*)$/)[0]},y,w,b;for(h=h.replace(/\s?\$\s?/,""),y=t._.numberToFormat(u,h,m),u>=0?(x.before=x.before.replace(/[\-\(]/,""),x.after=x.after.replace(/[\-\)]/,"")):u<0&&!t._.includes(x.before,"-")&&!t._.includes(x.before,"(")&&(x.before="-"+x.before),b=0;b<x.before.length;b++)switch(w=x.before[b],w){case"$":y=t._.insert(y,f.currency.symbol,b);break;case" ":y=t._.insert(y," ",b+f.currency.symbol.length-1);break}for(b=x.after.length-1;b>=0;b--)switch(w=x.after[b],w){case"$":y=b===x.after.length-1?y+f.currency.symbol:t._.insert(y,f.currency.symbol,-(x.after.length-(1+b)));break;case" ":y=b===x.after.length-1?y+" ":t._.insert(y," ",-(x.after.length-(1+b)+f.currency.symbol.length-1));break}return y}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(u,h,m){var f,x=typeof u=="number"&&!t._.isNaN(u)?u.toExponential():"0e+0",y=x.split("e");return h=h.replace(/e[\+|\-]{1}0/,""),f=t._.numberToFormat(Number(y[0]),h,m),f+"e"+y[1]},unformat:function(u){var h=t._.includes(u,"e+")?u.split("e+"):u.split("e-"),m=Number(h[0]),f=Number(h[1]);f=t._.includes(u,"e-")?f*=-1:f;function x(y,w,b,v){var A=t._.correctionFactor(y,w),S=y*A*(w*A)/(A*A);return S}return t._.reduce([m,Math.pow(10,f)],x,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(u,h,m){var f=t.locales[t.options.currentLocale],x,y=t._.includes(h," o")?" ":"";return h=h.replace(/\s?o/,""),y+=f.ordinal(u),x=t._.numberToFormat(u,h,m),x+y}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(u,h,m){var f=t._.includes(h," %")?" ":"",x;return t.options.scalePercentBy100&&(u=u*100),h=h.replace(/\s?\%/,""),x=t._.numberToFormat(u,h,m),t._.includes(x,")")?(x=x.split(""),x.splice(-1,0,f+"%"),x=x.join("")):x=x+f+"%",x},unformat:function(u){var h=t._.stringToNumber(u);return t.options.scalePercentBy100?h*.01:h}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(u,h,m){var f=Math.floor(u/60/60),x=Math.floor((u-f*60*60)/60),y=Math.round(u-f*60*60-x*60);return f+":"+(x<10?"0"+x:x)+":"+(y<10?"0"+y:y)},unformat:function(u){var h=u.split(":"),m=0;return h.length===3?(m=m+Number(h[0])*60*60,m=m+Number(h[1])*60,m=m+Number(h[2])):h.length===2&&(m=m+Number(h[0])*60,m=m+Number(h[1])),Number(m)}})}(),t})}(C_)),C_.exports}var K_e=Y_e();const y0=Mr(K_e);function $0(e,...t){const o=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(i=>o.searchParams.append("args[]",i)),`Minified MUI error #${e}; visit ${o} for the full message.`}const w0="$$material";function q_e(e){for(var t=0,o,i=0,a=e.length;a>=4;++i,a-=4)o=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,o=(o&65535)*1540483477+((o>>>16)*59797<<16),o^=o>>>24,t=(o&65535)*1540483477+((o>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(i+2)&255)<<16;case 2:t^=(e.charCodeAt(i+1)&255)<<8;case 1:t^=e.charCodeAt(i)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Z_e={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 J_e(e){var t=Object.create(null);return function(o){return t[o]===void 0&&(t[o]=e(o)),t[o]}}var X_e=/[A-Z]|^ms/g,eVe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,t9e=function(e){return e.charCodeAt(1)===45},IJ=function(e){return e!=null&&typeof e!="boolean"},EB=J_e(function(e){return t9e(e)?e:e.replace(X_e,"-$&").toLowerCase()}),jJ=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(eVe,function(o,i,a){return Uh={name:i,styles:a,next:Uh},i})}return Z_e[e]!==1&&!t9e(e)&&typeof t=="number"&&t!==0?t+"px":t};function ok(e,t,o){if(o==null)return"";var i=o;if(i.__emotion_styles!==void 0)return i;switch(typeof o){case"boolean":return"";case"object":{var a=o;if(a.anim===1)return Uh={name:a.name,styles:a.styles,next:Uh},a.name;var l=o;if(l.styles!==void 0){var d=l.next;if(d!==void 0)for(;d!==void 0;)Uh={name:d.name,styles:d.styles,next:Uh},d=d.next;var c=l.styles+";";return c}return tVe(e,t,o)}}var p=o;return p}function tVe(e,t,o){var i="";if(Array.isArray(o))for(var a=0;a<o.length;a++)i+=ok(e,t,o[a])+";";else for(var l in o){var d=o[l];if(typeof d!="object"){var c=d;IJ(c)&&(i+=EB(l)+":"+jJ(l,c)+";")}else if(Array.isArray(d)&&typeof d[0]=="string"&&t==null)for(var p=0;p<d.length;p++)IJ(d[p])&&(i+=EB(l)+":"+jJ(l,d[p])+";");else{var u=ok(e,t,d);switch(l){case"animation":case"animationName":{i+=EB(l)+":"+u+";";break}default:i+=l+"{"+u+"}"}}}return i}var MJ=/label:\s*([^\s;{]+)\s*(;|$)/g,Uh;function oVe(e,t,o){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var i=!0,a="";Uh=void 0;var l=e[0];if(l==null||l.raw===void 0)i=!1,a+=ok(o,t,l);else{var d=l;a+=d[0]}for(var c=1;c<e.length;c++)if(a+=ok(o,t,e[c]),i){var p=l;a+=p[c]}MJ.lastIndex=0;for(var u="",h;(h=MJ.exec(a))!==null;)u+="-"+h[1];var m=q_e(a)+u;return{name:m,styles:a,next:Uh}}var LB={exports:{}},IB,BJ;function rVe(){if(BJ)return IB;BJ=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return IB=e,IB}var jB,DJ;function iVe(){if(DJ)return jB;DJ=1;var e=rVe();function t(){}function o(){}return o.resetWarningCache=t,jB=function(){function i(d,c,p,u,h,m){if(m!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}i.isRequired=i;function a(){return i}var l={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:o,resetWarningCache:t};return l.PropTypes=l,l},jB}var PJ;function kW(){return PJ||(PJ=1,LB.exports=iVe()()),LB.exports}var nVe=kW();const zt=Mr(nVe);function aVe(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 sVe(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 lVe=function(){function e(o){var i=this;this._insertTag=function(a){var l;i.tags.length===0?i.insertionPoint?l=i.insertionPoint.nextSibling:i.prepend?l=i.container.firstChild:l=i.before:l=i.tags[i.tags.length-1].nextSibling,i.container.insertBefore(a,l),i.tags.push(a)},this.isSpeedy=o.speedy===void 0?!0:o.speedy,this.tags=[],this.ctr=0,this.nonce=o.nonce,this.key=o.key,this.container=o.container,this.prepend=o.prepend,this.insertionPoint=o.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(o){o.forEach(this._insertTag)},t.insert=function(o){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(sVe(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=aVe(i);try{a.insertRule(o,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(o));this.ctr++},t.flush=function(){this.tags.forEach(function(o){var i;return(i=o.parentNode)==null?void 0:i.removeChild(o)}),this.tags=[],this.ctr=0},e}(),Fs="-ms-",rk="-moz-",pi="-webkit-",o9e="comm",SW="rule",EW="decl",dVe="@import",r9e="@keyframes",cVe="@layer",pVe=Math.abs,UE=String.fromCharCode,uVe=Object.assign;function hVe(e,t){return xs(e,0)^45?(((t<<2^xs(e,0))<<2^xs(e,1))<<2^xs(e,2))<<2^xs(e,3):0}function i9e(e){return e.trim()}function mVe(e,t){return(e=t.exec(e))?e[0]:e}function ui(e,t,o){return e.replace(t,o)}function A_(e,t){return e.indexOf(t)}function xs(e,t){return e.charCodeAt(t)|0}function zy(e,t,o){return e.slice(t,o)}function fu(e){return e.length}function LW(e){return e.length}function vv(e,t){return t.push(e),e}function gVe(e,t){return e.map(t).join("")}var WE=1,q7=1,n9e=0,cd=0,ua=0,F6="";function GE(e,t,o,i,a,l,d){return{value:e,root:t,parent:o,type:i,props:a,children:l,line:WE,column:q7,length:d,return:""}}function O8(e,t){return uVe(GE("",null,null,"",null,null,0),e,{length:-e.length},t)}function fVe(){return ua}function xVe(){return ua=cd>0?xs(F6,--cd):0,q7--,ua===10&&(q7=1,WE--),ua}function _d(){return ua=cd<n9e?xs(F6,cd++):0,q7++,ua===10&&(q7=1,WE++),ua}function Qu(){return xs(F6,cd)}function y$(){return cd}function Hw(e,t){return zy(F6,e,t)}function Ry(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 a9e(e){return WE=q7=1,n9e=fu(F6=e),cd=0,[]}function s9e(e){return F6="",e}function w$(e){return i9e(Hw(cd-1,$_(e===91?e+2:e===40?e+1:e)))}function yVe(e){for(;(ua=Qu())&&ua<33;)_d();return Ry(e)>2||Ry(ua)>3?"":" "}function wVe(e,t){for(;--t&&_d()&&!(ua<48||ua>102||ua>57&&ua<65||ua>70&&ua<97););return Hw(e,y$()+(t<6&&Qu()==32&&_d()==32))}function $_(e){for(;_d();)switch(ua){case e:return cd;case 34:case 39:e!==34&&e!==39&&$_(ua);break;case 40:e===41&&$_(e);break;case 92:_d();break}return cd}function bVe(e,t){for(;_d()&&e+ua!==57&&!(e+ua===84&&Qu()===47););return"/*"+Hw(t,cd-1)+"*"+UE(e===47?e:_d())}function vVe(e){for(;!Ry(Qu());)_d();return Hw(e,cd)}function CVe(e){return s9e(b$("",null,null,null,[""],e=a9e(e),0,[0],e))}function b$(e,t,o,i,a,l,d,c,p){for(var u=0,h=0,m=d,f=0,x=0,y=0,w=1,b=1,v=1,A=0,S="",E=a,j=l,L=i,M=S;b;)switch(y=A,A=_d()){case 40:if(y!=108&&xs(M,m-1)==58){A_(M+=ui(w$(A),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:M+=w$(A);break;case 9:case 10:case 13:case 32:M+=yVe(y);break;case 92:M+=wVe(y$()-1,7);continue;case 47:switch(Qu()){case 42:case 47:vv(AVe(bVe(_d(),y$()),t,o),p);break;default:M+="/"}break;case 123*w:c[u++]=fu(M)*v;case 125*w:case 59:case 0:switch(A){case 0:case 125:b=0;case 59+h:v==-1&&(M=ui(M,/\f/g,"")),x>0&&fu(M)-m&&vv(x>32?zJ(M+";",i,o,m-1):zJ(ui(M," ","")+";",i,o,m-2),p);break;case 59:M+=";";default:if(vv(L=TJ(M,t,o,u,h,a,c,S,E=[],j=[],m),l),A===123)if(h===0)b$(M,t,L,L,E,l,m,c,j);else switch(f===99&&xs(M,3)===110?100:f){case 100:case 108:case 109:case 115:b$(e,L,L,i&&vv(TJ(e,L,L,0,0,a,c,S,a,E=[],m),j),a,j,m,c,i?E:j);break;default:b$(M,L,L,L,[""],j,0,c,j)}}u=h=x=0,w=v=1,S=M="",m=d;break;case 58:m=1+fu(M),x=y;default:if(w<1){if(A==123)--w;else if(A==125&&w++==0&&xVe()==125)continue}switch(M+=UE(A),A*w){case 38:v=h>0?1:(M+="\f",-1);break;case 44:c[u++]=(fu(M)-1)*v,v=1;break;case 64:Qu()===45&&(M+=w$(_d())),f=Qu(),h=m=fu(S=M+=vVe(y$())),A++;break;case 45:y===45&&fu(M)==2&&(w=0)}}return l}function TJ(e,t,o,i,a,l,d,c,p,u,h){for(var m=a-1,f=a===0?l:[""],x=LW(f),y=0,w=0,b=0;y<i;++y)for(var v=0,A=zy(e,m+1,m=pVe(w=d[y])),S=e;v<x;++v)(S=i9e(w>0?f[v]+" "+A:ui(A,/&\f/g,f[v])))&&(p[b++]=S);return GE(e,t,o,a===0?SW:c,p,u,h)}function AVe(e,t,o){return GE(e,t,o,o9e,UE(fVe()),zy(e,2,-2),0)}function zJ(e,t,o,i){return GE(e,t,o,EW,zy(e,0,i),zy(e,i+1,-1),i)}function S7(e,t){for(var o="",i=LW(e),a=0;a<i;a++)o+=t(e[a],a,e,t)||"";return o}function $Ve(e,t,o,i){switch(e.type){case cVe:if(e.children.length)break;case dVe:case EW:return e.return=e.return||e.value;case o9e:return"";case r9e:return e.return=e.value+"{"+S7(e.children,i)+"}";case SW:e.value=e.props.join(",")}return fu(o=S7(e.children,i))?e.return=e.value+"{"+o+"}":""}function kVe(e){var t=LW(e);return function(o,i,a,l){for(var d="",c=0;c<t;c++)d+=e[c](o,i,a,l)||"";return d}}function SVe(e){return function(t){t.root||(t=t.return)&&e(t)}}var EVe=function(e,t,o){for(var i=0,a=0;i=a,a=Qu(),i===38&&a===12&&(t[o]=1),!Ry(a);)_d();return Hw(e,cd)},LVe=function(e,t){var o=-1,i=44;do switch(Ry(i)){case 0:i===38&&Qu()===12&&(t[o]=1),e[o]+=EVe(cd-1,t,o);break;case 2:e[o]+=w$(i);break;case 4:if(i===44){e[++o]=Qu()===58?"&\f":"",t[o]=e[o].length;break}default:e[o]+=UE(i)}while(i=_d());return e},IVe=function(e,t){return s9e(LVe(a9e(e),t))},RJ=new WeakMap,jVe=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,o=e.parent,i=e.column===o.column&&e.line===o.line;o.type!=="rule";)if(o=o.parent,!o)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!RJ.get(o))&&!i){RJ.set(e,!0);for(var a=[],l=IVe(t,a),d=o.props,c=0,p=0;c<l.length;c++)for(var u=0;u<d.length;u++,p++)e.props[p]=a[c]?l[c].replace(/&\f/g,d[u]):d[u]+" "+l[c]}}},MVe=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function l9e(e,t){switch(hVe(e,t)){case 5103:return pi+"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 pi+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return pi+e+rk+e+Fs+e+e;case 6828:case 4268:return pi+e+Fs+e+e;case 6165:return pi+e+Fs+"flex-"+e+e;case 5187:return pi+e+ui(e,/(\w+).+(:[^]+)/,pi+"box-$1$2"+Fs+"flex-$1$2")+e;case 5443:return pi+e+Fs+"flex-item-"+ui(e,/flex-|-self/,"")+e;case 4675:return pi+e+Fs+"flex-line-pack"+ui(e,/align-content|flex-|-self/,"")+e;case 5548:return pi+e+Fs+ui(e,"shrink","negative")+e;case 5292:return pi+e+Fs+ui(e,"basis","preferred-size")+e;case 6060:return pi+"box-"+ui(e,"-grow","")+pi+e+Fs+ui(e,"grow","positive")+e;case 4554:return pi+ui(e,/([^-])(transform)/g,"$1"+pi+"$2")+e;case 6187:return ui(ui(ui(e,/(zoom-|grab)/,pi+"$1"),/(image-set)/,pi+"$1"),e,"")+e;case 5495:case 3959:return ui(e,/(image-set\([^]*)/,pi+"$1$`$1");case 4968:return ui(ui(e,/(.+:)(flex-)?(.*)/,pi+"box-pack:$3"+Fs+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+pi+e+e;case 4095:case 3583:case 4068:case 2532:return ui(e,/(.+)-inline(.+)/,pi+"$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(fu(e)-1-t>6)switch(xs(e,t+1)){case 109:if(xs(e,t+4)!==45)break;case 102:return ui(e,/(.+:)(.+)-([^]+)/,"$1"+pi+"$2-$3$1"+rk+(xs(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~A_(e,"stretch")?l9e(ui(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(xs(e,t+1)!==115)break;case 6444:switch(xs(e,fu(e)-3-(~A_(e,"!important")&&10))){case 107:return ui(e,":",":"+pi)+e;case 101:return ui(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+pi+(xs(e,14)===45?"inline-":"")+"box$3$1"+pi+"$2$3$1"+Fs+"$2box$3")+e}break;case 5936:switch(xs(e,t+11)){case 114:return pi+e+Fs+ui(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return pi+e+Fs+ui(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return pi+e+Fs+ui(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return pi+e+Fs+e+e}return e}var BVe=function(e,t,o,i){if(e.length>-1&&!e.return)switch(e.type){case EW:e.return=l9e(e.value,e.length);break;case r9e:return S7([O8(e,{value:ui(e.value,"@","@"+pi)})],i);case SW:if(e.length)return gVe(e.props,function(a){switch(mVe(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return S7([O8(e,{props:[ui(a,/:(read-\w+)/,":"+rk+"$1")]})],i);case"::placeholder":return S7([O8(e,{props:[ui(a,/:(plac\w+)/,":"+pi+"input-$1")]}),O8(e,{props:[ui(a,/:(plac\w+)/,":"+rk+"$1")]}),O8(e,{props:[ui(a,/:(plac\w+)/,Fs+"input-$1")]})],i)}return""})}},DVe=[BVe],d9e=function(e){var t=e.key;if(t==="css"){var o=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(o,function(y){var w=y.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=e.stylisPlugins||DVe,a={},l,d=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(y){for(var w=y.getAttribute("data-emotion").split(" "),b=1;b<w.length;b++)a[w[b]]=!0;d.push(y)});var c,p=[jVe,MVe];{var u,h=[$Ve,SVe(function(y){u.insert(y)})],m=kVe(p.concat(i,h)),f=function(y){return S7(CVe(y),m)};c=function(y,w,b,v){u=b,f(y?y+"{"+w.styles+"}":w.styles),v&&(x.inserted[w.name]=!0)}}var x={key:t,sheet:new lVe({key:t,container:l,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:c};return x.sheet.hydrate(d),x};function PVe(e){return e==null||Object.keys(e).length===0}function c9e(e){const{styles:t,defaultTheme:o={}}=e,i=typeof t=="function"?a=>t(PVe(a)?o:a):t;return s.jsx(Ow,{styles:i})}function TVe(e,t){return n(e,t)}function zVe(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const FJ=[];function nm(e){return FJ[0]=e,oVe(FJ)}var OJ={exports:{}},Bi={},NJ;function RVe(){if(NJ)return Bi;NJ=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),d=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function y(w){if(typeof w=="object"&&w!==null){var b=w.$$typeof;switch(b){case e:switch(w=w.type,w){case o:case a:case i:case p:case u:case f:return w;default:switch(w=w&&w.$$typeof,w){case d:case c:case m:case h:return w;case l:return w;default:return b}}case t:return b}}}return Bi.ContextConsumer=l,Bi.ContextProvider=d,Bi.Element=e,Bi.ForwardRef=c,Bi.Fragment=o,Bi.Lazy=m,Bi.Memo=h,Bi.Portal=t,Bi.Profiler=a,Bi.StrictMode=i,Bi.Suspense=p,Bi.SuspenseList=u,Bi.isContextConsumer=function(w){return y(w)===l},Bi.isContextProvider=function(w){return y(w)===d},Bi.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Bi.isForwardRef=function(w){return y(w)===c},Bi.isFragment=function(w){return y(w)===o},Bi.isLazy=function(w){return y(w)===m},Bi.isMemo=function(w){return y(w)===h},Bi.isPortal=function(w){return y(w)===t},Bi.isProfiler=function(w){return y(w)===a},Bi.isStrictMode=function(w){return y(w)===i},Bi.isSuspense=function(w){return y(w)===p},Bi.isSuspenseList=function(w){return y(w)===u},Bi.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===o||w===a||w===i||w===p||w===u||typeof w=="object"&&w!==null&&(w.$$typeof===m||w.$$typeof===h||w.$$typeof===d||w.$$typeof===l||w.$$typeof===c||w.$$typeof===x||w.getModuleId!==void 0)},Bi.typeOf=y,Bi}var HJ;function FVe(){return HJ||(HJ=1,OJ.exports=RVe()),OJ.exports}var p9e=FVe();function o0(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 u9e(e){if(g.isValidElement(e)||p9e.isValidElementType(e)||!o0(e))return e;const t={};return Object.keys(e).forEach(o=>{t[o]=u9e(e[o])}),t}function Zs(e,t,o={clone:!0}){const i=o.clone?{...e}:e;return o0(e)&&o0(t)&&Object.keys(t).forEach(a=>{g.isValidElement(t[a])||p9e.isValidElementType(t[a])?i[a]=t[a]:o0(t[a])&&Object.prototype.hasOwnProperty.call(e,a)&&o0(e[a])?i[a]=Zs(e[a],t[a],o):o.clone?i[a]=o0(t[a])?u9e(t[a]):t[a]:i[a]=t[a]}),i}const OVe=e=>{const t=Object.keys(e).map(o=>({key:o,val:e[o]}))||[];return t.sort((o,i)=>o.val-i.val),t.reduce((o,i)=>({...o,[i.key]:i.val}),{})};function NVe(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:o="px",step:i=5,...a}=e,l=OVe(t),d=Object.keys(l);function c(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${o})`}function p(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-i/100}${o})`}function u(f,x){const y=d.indexOf(x);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${o}) and (max-width:${(y!==-1&&typeof t[d[y]]=="number"?t[d[y]]:x)-i/100}${o})`}function h(f){return d.indexOf(f)+1<d.length?u(f,d[d.indexOf(f)+1]):c(f)}function m(f){const x=d.indexOf(f);return x===0?c(d[1]):x===d.length-1?p(d[x]):u(f,d[d.indexOf(f)+1]).replace("@media","@media not all and")}return{keys:d,values:l,up:c,down:p,between:u,only:h,not:m,unit:o,...a}}function _J(e,t){if(!e.containerQueries)return t;const o=Object.keys(t).filter(i=>i.startsWith("@container")).sort((i,a)=>{const l=/min-width:\s*([0-9.]+)/;return+(i.match(l)?.[1]||0)-+(a.match(l)?.[1]||0)});return o.length?o.reduce((i,a)=>{const l=t[a];return delete i[a],i[a]=l,i},{...t}):t}function HVe(e,t){return t==="@"||t.startsWith("@")&&(e.some(o=>t.startsWith(`@${o}`))||!!t.match(/^@\d/))}function _Ve(e,t){const o=t.match(/^@([^/]+)?\/?(.+)?$/);if(!o)return null;const[,i,a]=o,l=Number.isNaN(+i)?i||0:+i;return e.containerQueries(a).up(l)}function VVe(e){const t=(l,d)=>l.replace("@media",d?`@container ${d}`:"@container");function o(l,d){l.up=(...c)=>t(e.breakpoints.up(...c),d),l.down=(...c)=>t(e.breakpoints.down(...c),d),l.between=(...c)=>t(e.breakpoints.between(...c),d),l.only=(...c)=>t(e.breakpoints.only(...c),d),l.not=(...c)=>{const p=t(e.breakpoints.not(...c),d);return p.includes("not all and")?p.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):p}}const i={},a=l=>(o(i,l),i);return o(a),{...e,containerQueries:a}}const QVe={borderRadius:4};function sy(e,t){return t?Zs(e,t,{clone:!1}):e}const YE={xs:0,sm:600,md:900,lg:1200,xl:1536},VJ={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${YE[e]}px)`},UVe={containerQueries:e=>({up:t=>{let o=typeof t=="number"?t:YE[t]||t;return typeof o=="number"&&(o=`${o}px`),e?`@container ${e} (min-width:${o})`:`@container (min-width:${o})`}})};function k0(e,t,o){const i=e.theme||{};if(Array.isArray(t)){const a=i.breakpoints||VJ;return t.reduce((l,d,c)=>(l[a.up(a.keys[c])]=o(t[c]),l),{})}if(typeof t=="object"){const a=i.breakpoints||VJ;return Object.keys(t).reduce((l,d)=>{if(HVe(a.keys,d)){const c=_Ve(i.containerQueries?i:UVe,d);c&&(l[c]=o(t[d],d))}else if(Object.keys(a.values||YE).includes(d)){const c=a.up(d);l[c]=o(t[d],d)}else{const c=d;l[c]=t[c]}return l},{})}return o(t)}function WVe(e={}){return e.keys?.reduce((t,o)=>{const i=e.up(o);return t[i]={},t},{})||{}}function QJ(e,t){return e.reduce((o,i)=>{const a=o[i];return(!a||Object.keys(a).length===0)&&delete o[i],o},t)}function or(e){if(typeof e!="string")throw new Error($0(7));return e.charAt(0).toUpperCase()+e.slice(1)}function KE(e,t,o=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&o){const i=`vars.${t}`.split(".").reduce((a,l)=>a&&a[l]?a[l]:null,e);if(i!=null)return i}return t.split(".").reduce((i,a)=>i&&i[a]!=null?i[a]:null,e)}function ik(e,t,o,i=o){let a;return typeof e=="function"?a=e(o):Array.isArray(e)?a=e[o]||i:a=KE(e,o)||i,t&&(a=t(a,i,e)),a}function ta(e){const{prop:t,cssProperty:o=e.prop,themeKey:i,transform:a}=e,l=d=>{if(d[t]==null)return null;const c=d[t],p=d.theme,u=KE(p,i)||{};return k0(d,c,h=>{let m=ik(u,a,h);return h===m&&typeof h=="string"&&(m=ik(u,a,`${t}${h==="default"?"":or(h)}`,h)),o===!1?m:{[o]:m}})};return l.propTypes={},l.filterProps=[t],l}function GVe(e){const t={};return o=>(t[o]===void 0&&(t[o]=e(o)),t[o])}const YVe={m:"margin",p:"padding"},KVe={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},UJ={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},qVe=GVe(e=>{if(e.length>2)if(UJ[e])e=UJ[e];else return[e];const[t,o]=e.split(""),i=YVe[t],a=KVe[o]||"";return Array.isArray(a)?a.map(l=>i+l):[i+a]}),IW=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],jW=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...IW,...jW];function _w(e,t,o,i){const a=KE(e,t,!0)??o;return typeof a=="number"||typeof a=="string"?l=>typeof l=="string"?l:typeof a=="string"?a.startsWith("var(")&&l===0?0:a.startsWith("var(")&&l===1?a:`calc(${l} * ${a})`:a*l:Array.isArray(a)?l=>{if(typeof l=="string")return l;const d=Math.abs(l),c=a[d];return l>=0?c:typeof c=="number"?-c:typeof c=="string"&&c.startsWith("var(")?`calc(-1 * ${c})`:`-${c}`}:typeof a=="function"?a:()=>{}}function MW(e){return _w(e,"spacing",8)}function Vw(e,t){return typeof t=="string"||t==null?t:e(t)}function ZVe(e,t){return o=>e.reduce((i,a)=>(i[a]=Vw(t,o),i),{})}function JVe(e,t,o,i){if(!t.includes(o))return null;const a=qVe(o),l=ZVe(a,i),d=e[o];return k0(e,d,l)}function h9e(e,t){const o=MW(e.theme);return Object.keys(e).map(i=>JVe(e,t,i,o)).reduce(sy,{})}function jn(e){return h9e(e,IW)}jn.propTypes={};jn.filterProps=IW;function Mn(e){return h9e(e,jW)}Mn.propTypes={};Mn.filterProps=jW;function m9e(e=8,t=MW({spacing:e})){if(e.mui)return e;const o=(...i)=>(i.length===0?[1]:i).map(a=>{const l=t(a);return typeof l=="number"?`${l}px`:l}).join(" ");return o.mui=!0,o}function qE(...e){const t=e.reduce((i,a)=>(a.filterProps.forEach(l=>{i[l]=a}),i),{}),o=i=>Object.keys(i).reduce((a,l)=>t[l]?sy(a,t[l](i)):a,{});return o.propTypes={},o.filterProps=e.reduce((i,a)=>i.concat(a.filterProps),[]),o}function Ec(e){return typeof e!="number"?e:`${e}px solid`}function Kc(e,t){return ta({prop:e,themeKey:"borders",transform:t})}const XVe=Kc("border",Ec),eQe=Kc("borderTop",Ec),tQe=Kc("borderRight",Ec),oQe=Kc("borderBottom",Ec),rQe=Kc("borderLeft",Ec),iQe=Kc("borderColor"),nQe=Kc("borderTopColor"),aQe=Kc("borderRightColor"),sQe=Kc("borderBottomColor"),lQe=Kc("borderLeftColor"),dQe=Kc("outline",Ec),cQe=Kc("outlineColor"),ZE=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=_w(e.theme,"shape.borderRadius",4),o=i=>({borderRadius:Vw(t,i)});return k0(e,e.borderRadius,o)}return null};ZE.propTypes={};ZE.filterProps=["borderRadius"];qE(XVe,eQe,tQe,oQe,rQe,iQe,nQe,aQe,sQe,lQe,ZE,dQe,cQe);const JE=e=>{if(e.gap!==void 0&&e.gap!==null){const t=_w(e.theme,"spacing",8),o=i=>({gap:Vw(t,i)});return k0(e,e.gap,o)}return null};JE.propTypes={};JE.filterProps=["gap"];const XE=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=_w(e.theme,"spacing",8),o=i=>({columnGap:Vw(t,i)});return k0(e,e.columnGap,o)}return null};XE.propTypes={};XE.filterProps=["columnGap"];const eL=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=_w(e.theme,"spacing",8),o=i=>({rowGap:Vw(t,i)});return k0(e,e.rowGap,o)}return null};eL.propTypes={};eL.filterProps=["rowGap"];const pQe=ta({prop:"gridColumn"}),uQe=ta({prop:"gridRow"}),hQe=ta({prop:"gridAutoFlow"}),mQe=ta({prop:"gridAutoColumns"}),gQe=ta({prop:"gridAutoRows"}),fQe=ta({prop:"gridTemplateColumns"}),xQe=ta({prop:"gridTemplateRows"}),yQe=ta({prop:"gridTemplateAreas"}),wQe=ta({prop:"gridArea"});qE(JE,XE,eL,pQe,uQe,hQe,mQe,gQe,fQe,xQe,yQe,wQe);function E7(e,t){return t==="grey"?t:e}const bQe=ta({prop:"color",themeKey:"palette",transform:E7}),vQe=ta({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:E7}),CQe=ta({prop:"backgroundColor",themeKey:"palette",transform:E7});qE(bQe,vQe,CQe);function Rd(e){return e<=1&&e!==0?`${e*100}%`:e}const AQe=ta({prop:"width",transform:Rd}),BW=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=o=>{const i=e.theme?.breakpoints?.values?.[o]||YE[o];return i?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:Rd(o)}};return k0(e,e.maxWidth,t)}return null};BW.filterProps=["maxWidth"];const $Qe=ta({prop:"minWidth",transform:Rd}),kQe=ta({prop:"height",transform:Rd}),SQe=ta({prop:"maxHeight",transform:Rd}),EQe=ta({prop:"minHeight",transform:Rd});ta({prop:"size",cssProperty:"width",transform:Rd});ta({prop:"size",cssProperty:"height",transform:Rd});const LQe=ta({prop:"boxSizing"});qE(AQe,BW,$Qe,kQe,SQe,EQe,LQe);const tL={border:{themeKey:"borders",transform:Ec},borderTop:{themeKey:"borders",transform:Ec},borderRight:{themeKey:"borders",transform:Ec},borderBottom:{themeKey:"borders",transform:Ec},borderLeft:{themeKey:"borders",transform:Ec},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Ec},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:ZE},color:{themeKey:"palette",transform:E7},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:E7},backgroundColor:{themeKey:"palette",transform:E7},p:{style:Mn},pt:{style:Mn},pr:{style:Mn},pb:{style:Mn},pl:{style:Mn},px:{style:Mn},py:{style:Mn},padding:{style:Mn},paddingTop:{style:Mn},paddingRight:{style:Mn},paddingBottom:{style:Mn},paddingLeft:{style:Mn},paddingX:{style:Mn},paddingY:{style:Mn},paddingInline:{style:Mn},paddingInlineStart:{style:Mn},paddingInlineEnd:{style:Mn},paddingBlock:{style:Mn},paddingBlockStart:{style:Mn},paddingBlockEnd:{style:Mn},m:{style:jn},mt:{style:jn},mr:{style:jn},mb:{style:jn},ml:{style:jn},mx:{style:jn},my:{style:jn},margin:{style:jn},marginTop:{style:jn},marginRight:{style:jn},marginBottom:{style:jn},marginLeft:{style:jn},marginX:{style:jn},marginY:{style:jn},marginInline:{style:jn},marginInlineStart:{style:jn},marginInlineEnd:{style:jn},marginBlock:{style:jn},marginBlockStart:{style:jn},marginBlockEnd:{style:jn},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:JE},rowGap:{style:eL},columnGap:{style:XE},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Rd},maxWidth:{style:BW},minWidth:{transform:Rd},height:{transform:Rd},maxHeight:{transform:Rd},minHeight:{transform:Rd},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 IQe(...e){const t=e.reduce((i,a)=>i.concat(Object.keys(a)),[]),o=new Set(t);return e.every(i=>o.size===Object.keys(i).length)}function jQe(e,t){return typeof e=="function"?e(t):e}function MQe(){function e(o,i,a,l){const d={[o]:i,theme:a},c=l[o];if(!c)return{[o]:i};const{cssProperty:p=o,themeKey:u,transform:h,style:m}=c;if(i==null)return null;if(u==="typography"&&i==="inherit")return{[o]:i};const f=KE(a,u)||{};return m?m(d):k0(d,i,x=>{let y=ik(f,h,x);return x===y&&typeof x=="string"&&(y=ik(f,h,`${o}${x==="default"?"":or(x)}`,x)),p===!1?y:{[p]:y}})}function t(o){const{sx:i,theme:a={},nested:l}=o||{};if(!i)return null;const d=a.unstable_sxConfig??tL;function c(p){let u=p;if(typeof p=="function")u=p(a);else if(typeof p!="object")return p;if(!u)return null;const h=WVe(a.breakpoints),m=Object.keys(h);let f=h;return Object.keys(u).forEach(x=>{const y=jQe(u[x],a);if(y!=null)if(typeof y=="object")if(d[x])f=sy(f,e(x,y,a,d));else{const w=k0({theme:a},y,b=>({[x]:b}));IQe(w,y)?f[x]=t({sx:y,theme:a,nested:!0}):f=sy(f,w)}else f=sy(f,e(x,y,a,d))}),!l&&a.modularCssLayers?{"@layer sx":_J(a,QJ(m,f))}:_J(a,QJ(m,f))}return Array.isArray(i)?i.map(c):c(i)}return t}const $4=MQe();$4.filterProps=["sx"];function BQe(e,t){const o=this;if(o.vars){if(!o.colorSchemes?.[e]||typeof o.getColorSchemeSelector!="function")return{};let i=o.getColorSchemeSelector(e);return i==="&"?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return o.palette.mode===e?t:{}}function DW(e={},...t){const{breakpoints:o={},palette:i={},spacing:a,shape:l={},...d}=e,c=NVe(o),p=m9e(a);let u=Zs({breakpoints:c,direction:"ltr",components:{},palette:{mode:"light",...i},spacing:p,shape:{...QVe,...l}},d);return u=VVe(u),u.applyStyles=BQe,u=t.reduce((h,m)=>Zs(h,m),u),u.unstable_sxConfig={...tL,...d?.unstable_sxConfig},u.unstable_sx=function(h){return $4({sx:h,theme:this})},u}function DQe(e){return Object.keys(e).length===0}function PW(e=null){const t=g.useContext(q8e);return!t||DQe(t)?e:t}const PQe=DW();function g9e(e=PQe){return PW(e)}function WJ(e){const t=nm(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function f9e({styles:e,themeId:t,defaultTheme:o={}}){const i=g9e(o),a=t&&i[t]||i;let l=typeof e=="function"?e(a):e;return a.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>WJ(typeof d=="function"?d(a):d)):l=WJ(l)),s.jsx(c9e,{styles:l})}const GJ=e=>e,TQe=()=>{let e=GJ;return{configure(t){e=t},generate(t){return e(t)},reset(){e=GJ}}},zQe=TQe();function x9e(e){var t,o,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(o=x9e(e[t]))&&(i&&(i+=" "),i+=o)}else for(o in e)e[o]&&(i&&(i+=" "),i+=o);return i}function Oo(){for(var e,t,o=0,i="",a=arguments.length;o<a;o++)(e=arguments[o])&&(t=x9e(e))&&(i&&(i+=" "),i+=t);return i}const RQe={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 li(e,t,o="Mui"){const i=RQe[t];return i?`${o}-${i}`:`${zQe.generate(e)}-${t}`}function Xr(e,t,o="Mui"){const i={};return t.forEach(a=>{i[a]=li(e,a,o)}),i}function y9e(e){const{variants:t,...o}=e,i={variants:t,style:nm(o),isProcessed:!0};return i.style===o||t&&t.forEach(a=>{typeof a.style!="function"&&(a.style=nm(a.style))}),i}const FQe=DW();function MB(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function K3(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function OQe(e){return e?(t,o)=>o[e]:null}function NQe(e,t,o){e.theme=VQe(e.theme)?o:e.theme[t]||e.theme}function v$(e,t,o){const i=typeof t=="function"?t(e):t;if(Array.isArray(i))return i.flatMap(a=>v$(e,a,o));if(Array.isArray(i?.variants)){let a;if(i.isProcessed)a=o?K3(i.style,o):i.style;else{const{variants:l,...d}=i;a=o?K3(nm(d),o):d}return w9e(e,i.variants,[a],o)}return i?.isProcessed?o?K3(nm(i.style),o):i.style:o?K3(nm(i),o):i}function w9e(e,t,o=[],i=void 0){let a;e:for(let l=0;l<t.length;l+=1){const d=t[l];if(typeof d.props=="function"){if(a??={...e,...e.ownerState,ownerState:e.ownerState},!d.props(a))continue}else for(const c in d.props)if(e[c]!==d.props[c]&&e.ownerState?.[c]!==d.props[c])continue e;typeof d.style=="function"?(a??={...e,...e.ownerState,ownerState:e.ownerState},o.push(i?K3(nm(d.style(a)),i):d.style(a))):o.push(i?K3(nm(d.style),i):d.style)}return o}function HQe(e={}){const{themeId:t,defaultTheme:o=FQe,rootShouldForwardProp:i=MB,slotShouldForwardProp:a=MB}=e;function l(d){NQe(d,t,o)}return(d,c={})=>{zVe(d,j=>j.filter(L=>L!==$4));const{name:p,slot:u,skipVariantsResolver:h,skipSx:m,overridesResolver:f=OQe(UQe(u)),...x}=c,y=p&&p.startsWith("Mui")||u?"components":"custom",w=h!==void 0?h:u&&u!=="Root"&&u!=="root"||!1,b=m||!1;let v=MB;u==="Root"||u==="root"?v=i:u?v=a:QQe(d)&&(v=void 0);const A=TVe(d,{shouldForwardProp:v,label:_Qe(),...x}),S=j=>{if(j.__emotion_real===j)return j;if(typeof j=="function")return function(L){return v$(L,j,L.theme.modularCssLayers?y:void 0)};if(o0(j)){const L=y9e(j);return function(M){return L.variants?v$(M,L,M.theme.modularCssLayers?y:void 0):M.theme.modularCssLayers?K3(L.style,y):L.style}}return j},E=(...j)=>{const L=[],M=j.map(S),D=[];if(L.push(l),p&&f&&D.push(function(z){const R=z.theme.components?.[p]?.styleOverrides;if(!R)return null;const K={};for(const Z in R)K[Z]=v$(z,R[Z],z.theme.modularCssLayers?"theme":void 0);return f(z,K)}),p&&!w&&D.push(function(z){const R=z.theme?.components?.[p]?.variants;return R?w9e(z,R,[],z.theme.modularCssLayers?"theme":void 0):null}),b||D.push($4),Array.isArray(M[0])){const z=M.shift(),R=new Array(L.length).fill(""),K=new Array(D.length).fill("");let Z;Z=[...R,...z,...K],Z.raw=[...R,...z.raw,...K],L.unshift(Z)}const P=[...L,...M,...D],T=A(...P);return d.muiName&&(T.muiName=d.muiName),T};return A.withConfig&&(E.withConfig=A.withConfig),E}}function _Qe(e,t){return void 0}function VQe(e){for(const t in e)return!1;return!0}function QQe(e){return typeof e=="string"&&e.charCodeAt(0)>96}function UQe(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function k_(e,t,o=!1){const i={...t};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const l=a;if(l==="components"||l==="slots")i[l]={...e[l],...i[l]};else if(l==="componentsProps"||l==="slotProps"){const d=e[l],c=t[l];if(!c)i[l]=d||{};else if(!d)i[l]=c;else{i[l]={...c};for(const p in d)if(Object.prototype.hasOwnProperty.call(d,p)){const u=p;i[l][u]=k_(d[u],c[u],o)}}}else l==="className"&&o&&t.className?i.className=Oo(e?.className,t?.className):l==="style"&&o&&t.style?i.style={...e?.style,...t?.style}:i[l]===void 0&&(i[l]=e[l])}return i}const Yd=typeof window<"u"?g.useLayoutEffect:g.useEffect;function WQe(e,t=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,o))}function TW(e,t=0,o=1){return WQe(e,t,o)}function GQe(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let o=e.match(t);return o&&o[0].length===1&&(o=o.map(i=>i+i)),o?`rgb${o.length===4?"a":""}(${o.map((i,a)=>a<3?parseInt(i,16):Math.round(parseInt(i,16)/255*1e3)/1e3).join(", ")})`:""}function bm(e){if(e.type)return e;if(e.charAt(0)==="#")return bm(GQe(e));const t=e.indexOf("("),o=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(o))throw new Error($0(9,e));let i=e.substring(t+1,e.length-1),a;if(o==="color"){if(i=i.split(" "),a=i.shift(),i.length===4&&i[3].charAt(0)==="/"&&(i[3]=i[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(a))throw new Error($0(10,a))}else i=i.split(",");return i=i.map(l=>parseFloat(l)),{type:o,values:i,colorSpace:a}}const YQe=e=>{const t=bm(e);return t.values.slice(0,3).map((o,i)=>t.type.includes("hsl")&&i!==0?`${o}%`:o).join(" ")},jx=(e,t)=>{try{return YQe(e)}catch{return e}};function oL(e){const{type:t,colorSpace:o}=e;let{values:i}=e;return t.includes("rgb")?i=i.map((a,l)=>l<3?parseInt(a,10):a):t.includes("hsl")&&(i[1]=`${i[1]}%`,i[2]=`${i[2]}%`),t.includes("color")?i=`${o} ${i.join(" ")}`:i=`${i.join(", ")}`,`${t}(${i})`}function b9e(e){e=bm(e);const{values:t}=e,o=t[0],i=t[1]/100,a=t[2]/100,l=i*Math.min(a,1-a),d=(u,h=(u+o/30)%12)=>a-l*Math.max(Math.min(h-3,9-h,1),-1);let c="rgb";const p=[Math.round(d(0)*255),Math.round(d(8)*255),Math.round(d(4)*255)];return e.type==="hsla"&&(c+="a",p.push(t[3])),oL({type:c,values:p})}function S_(e){e=bm(e);let t=e.type==="hsl"||e.type==="hsla"?bm(b9e(e)).values:e.values;return t=t.map(o=>(e.type!=="color"&&(o/=255),o<=.03928?o/12.92:((o+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function KQe(e,t){const o=S_(e),i=S_(t);return(Math.max(o,i)+.05)/(Math.min(o,i)+.05)}function nk(e,t){return e=bm(e),t=TW(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,oL(e)}function _g(e,t,o){try{return nk(e,t)}catch{return e}}function rL(e,t){if(e=bm(e),t=TW(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let o=0;o<3;o+=1)e.values[o]*=1-t;return oL(e)}function Ai(e,t,o){try{return rL(e,t)}catch{return e}}function iL(e,t){if(e=bm(e),t=TW(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let o=0;o<3;o+=1)e.values[o]+=(255-e.values[o])*t;else if(e.type.includes("color"))for(let o=0;o<3;o+=1)e.values[o]+=(1-e.values[o])*t;return oL(e)}function $i(e,t,o){try{return iL(e,t)}catch{return e}}function qQe(e,t=.15){return S_(e)>.5?rL(e,t):iL(e,t)}function Cv(e,t,o){try{return qQe(e,t)}catch{return e}}const v9e=g.createContext(null);function zW(){return g.useContext(v9e)}const ZQe=typeof Symbol=="function"&&Symbol.for,JQe=ZQe?Symbol.for("mui.nested"):"__THEME_NESTED__";function XQe(e,t){return typeof t=="function"?t(e):{...e,...t}}function eUe(e){const{children:t,theme:o}=e,i=zW(),a=g.useMemo(()=>{const l=i===null?{...o}:XQe(i,o);return l!=null&&(l[JQe]=i!==null),l},[o,i]);return s.jsx(v9e.Provider,{value:a,children:t})}const C9e=g.createContext();function tUe({value:e,...t}){return s.jsx(C9e.Provider,{value:e??!0,...t})}const O6=()=>g.useContext(C9e)??!1,A9e=g.createContext(void 0);function oUe({value:e,children:t}){return s.jsx(A9e.Provider,{value:e,children:t})}function rUe(e){const{theme:t,name:o,props:i}=e;if(!t||!t.components||!t.components[o])return i;const a=t.components[o];return a.defaultProps?k_(a.defaultProps,i,t.components.mergeClassNameAndStyle):!a.styleOverrides&&!a.variants?k_(a,i,t.components.mergeClassNameAndStyle):i}function iUe({props:e,name:t}){const o=g.useContext(A9e);return rUe({props:e,name:t,theme:{components:o}})}let YJ=0;function nUe(e){const[t,o]=g.useState(e),i=e||t;return g.useEffect(()=>{t==null&&(YJ+=1,o(`mui-${YJ}`))},[t]),i}const aUe={...MNe},KJ=aUe.useId;function nL(e){if(KJ!==void 0){const t=KJ();return e??t}return nUe(e)}function sUe(e){const t=PW(),o=nL()||"",{modularCssLayers:i}=e;let a="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||t!==null?a="":typeof i=="string"?a=i.replace(/mui(?!\.)/g,a):a=`@layer ${a};`,Yd(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(a){if(d&&d.hasAttribute?.("data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===o)return;const c=document.createElement("style");c.setAttribute("data-mui-layer-order",o),c.textContent=a,l.prepend(c)}else l.querySelector(`style[data-mui-layer-order="${o}"]`)?.remove()},[a,o]),a?s.jsx(f9e,{styles:a}):null}const qJ={};function ZJ(e,t,o,i=!1){return g.useMemo(()=>{const a=e&&t[e]||t;if(typeof o=="function"){const l=o(a),d=e?{...t,[e]:l}:l;return i?()=>d:d}return e?{...t,[e]:o}:{...t,...o}},[e,t,o,i])}function $9e(e){const{children:t,theme:o,themeId:i}=e,a=PW(qJ),l=zW()||qJ,d=ZJ(i,a,o),c=ZJ(i,l,o,!0),p=(i?d[i]:d).direction==="rtl",u=sUe(d);return s.jsx(eUe,{theme:c,children:s.jsx(q8e.Provider,{value:d,children:s.jsx(tUe,{value:p,children:s.jsxs(oUe,{value:i?d[i].components:d.components,children:[u,t]})})})})}const JJ={theme:void 0};function lUe(e){let t,o;return function(i){let a=t;return(a===void 0||i.theme!==o)&&(JJ.theme=i.theme,a=y9e(e(JJ)),t=a,o=i.theme),a}}const RW="mode",FW="color-scheme",dUe="data-color-scheme";function cUe(e){const{defaultMode:t="system",defaultLightColorScheme:o="light",defaultDarkColorScheme:i="dark",modeStorageKey:a=RW,colorSchemeStorageKey:l=FW,attribute:d=dUe,colorSchemeNode:c="document.documentElement",nonce:p}=e||{};let u="",h=d;if(d==="class"&&(h=".%s"),d==="data"&&(h="[data-%s]"),h.startsWith(".")){const f=h.substring(1);u+=`${c}.classList.remove('${f}'.replace('%s', light), '${f}'.replace('%s', dark));
3
3
  ${c}.classList.add('${f}'.replace('%s', colorScheme));`}const m=h.match(/\[([^[\]]+)\]/);if(m){const[f,x]=m[1].split("=");x||(u+=`${c}.removeAttribute('${f}'.replace('%s', light));
4
4
  ${c}.removeAttribute('${f}'.replace('%s', dark));`),u+=`
5
5
  ${c}.setAttribute('${f}'.replace('%s', colorScheme), ${x?`${x}.replace('%s', colorScheme)`:'""'});`}else h!==".%s"&&(u+=`${c}.setAttribute('${h}', colorScheme);`);return s.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(function() {
@@ -74,7 +74,7 @@ export default theme;`}function aX(e){return typeof e=="number"?`${(e*100).toFix
74
74
  `});++i<e.length;)i&&o.push({type:"text",value:`
75
75
  `}),o.push(e[i]);return t&&e.length>0&&o.push({type:"text",value:`
76
76
  `}),o}function eoe(e){let t=0,o=e.charCodeAt(t);for(;o===9||o===32;)t++,o=e.charCodeAt(t);return e.slice(t)}function toe(e,t){const o=xXe(e,t),i=o.one(e,void 0),a=sXe(o),l=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return a&&l.children.push({type:"text",value:`
77
- `},a),l}function CXe(e,t){return e&&"run"in e?async function(o,i){const a=toe(o,{file:i,...t});await e.run(a,i)}:function(o,i){return toe(o,{file:i,...e||t})}}function ooe(e){if(e)throw e}var IP,roe;function AXe(){if(roe)return IP;roe=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,o=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=function(p){return typeof Array.isArray=="function"?Array.isArray(p):t.call(p)==="[object Array]"},l=function(p){if(!p||t.call(p)!=="[object Object]")return!1;var u=e.call(p,"constructor"),h=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!u&&!h)return!1;var m;for(m in p);return typeof m>"u"||e.call(p,m)},d=function(p,u){o&&u.name==="__proto__"?o(p,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):p[u.name]=u.newValue},c=function(p,u){if(u==="__proto__")if(e.call(p,u)){if(i)return i(p,u).value}else return;return p[u]};return IP=function p(){var u,h,m,f,x,y,w=arguments[0],b=1,v=arguments.length,A=!1;for(typeof w=="boolean"&&(A=w,w=arguments[1]||{},b=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});b<v;++b)if(u=arguments[b],u!=null)for(h in u)m=c(w,h),f=c(u,h),w!==f&&(A&&f&&(l(f)||(x=a(f)))?(x?(x=!1,y=m&&a(m)?m:[]):y=m&&l(m)?m:{},d(w,{name:h,newValue:p(A,y,f)})):typeof f<"u"&&d(w,{name:h,newValue:f}));return w},IP}var $Xe=AXe();const jP=Mr($Xe);function W_(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 kXe(){const e=[],t={run:o,use:i};return t;function o(...a){let l=-1;const d=a.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);c(null,...a);function c(p,...u){const h=e[++l];let m=-1;if(p){d(p);return}for(;++m<a.length;)(u[m]===null||u[m]===void 0)&&(u[m]=a[m]);a=u,h?SXe(h,c)(...u):d(null,...u)}}function i(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function SXe(e,t){let o;return i;function i(...d){const c=e.length>d.length;let p;c&&d.push(a);try{p=e.apply(this,d)}catch(u){const h=u;if(c&&o)throw h;return a(h)}c||(p&&p.then&&typeof p.then=="function"?p.then(l,a):p instanceof Error?a(p):l(p))}function a(d,...c){o||(o=!0,t(d,...c))}function l(d){a(null,d)}}const pu={basename:EXe,dirname:LXe,extname:IXe,join:jXe,sep:"/"};function EXe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Jw(e);let o=0,i=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){o=a+1;break}}else i<0&&(l=!0,i=a+1);return i<0?"":e.slice(o,i)}if(t===e)return"";let d=-1,c=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){o=a+1;break}}else d<0&&(l=!0,d=a+1),c>-1&&(e.codePointAt(a)===t.codePointAt(c--)?c<0&&(i=a):(c=-1,i=d));return o===i?i=d:i<0&&(i=e.length),e.slice(o,i)}function LXe(e){if(Jw(e),e.length===0)return".";let t=-1,o=e.length,i;for(;--o;)if(e.codePointAt(o)===47){if(i){t=o;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function IXe(e){Jw(e);let t=e.length,o=-1,i=0,a=-1,l=0,d;for(;t--;){const c=e.codePointAt(t);if(c===47){if(d){i=t+1;break}continue}o<0&&(d=!0,o=t+1),c===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||o<0||l===0||l===1&&a===o-1&&a===i+1?"":e.slice(a,o)}function jXe(...e){let t=-1,o;for(;++t<e.length;)Jw(e[t]),e[t]&&(o=o===void 0?e[t]:o+"/"+e[t]);return o===void 0?".":MXe(o)}function MXe(e){Jw(e);const t=e.codePointAt(0)===47;let o=BXe(e,!t);return o.length===0&&!t&&(o="."),o.length>0&&e.codePointAt(e.length-1)===47&&(o+="/"),t?"/"+o:o}function BXe(e,t){let o="",i=0,a=-1,l=0,d=-1,c,p;for(;++d<=e.length;){if(d<e.length)c=e.codePointAt(d);else{if(c===47)break;c=47}if(c===47){if(!(a===d-1||l===1))if(a!==d-1&&l===2){if(o.length<2||i!==2||o.codePointAt(o.length-1)!==46||o.codePointAt(o.length-2)!==46){if(o.length>2){if(p=o.lastIndexOf("/"),p!==o.length-1){p<0?(o="",i=0):(o=o.slice(0,p),i=o.length-1-o.lastIndexOf("/")),a=d,l=0;continue}}else if(o.length>0){o="",i=0,a=d,l=0;continue}}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(a+1,d):o=e.slice(a+1,d),i=d-a-1;a=d,l=0}else c===46&&l>-1?l++:l=-1}return o}function Jw(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const DXe={cwd:PXe};function PXe(){return"/"}function G_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function TXe(e){if(typeof e=="string")e=new URL(e);else if(!G_(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return zXe(e)}function zXe(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let o=-1;for(;++o<t.length;)if(t.codePointAt(o)===37&&t.codePointAt(o+1)===50){const i=t.codePointAt(o+2);if(i===70||i===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const MP=["history","path","basename","stem","extname","dirname"];class eye{constructor(t){let o;t?G_(t)?o={path:t}:typeof t=="string"||RXe(t)?o={value:t}:o=t:o={},this.cwd="cwd"in o?"":DXe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<MP.length;){const l=MP[i];l in o&&o[l]!==void 0&&o[l]!==null&&(this[l]=l==="history"?[...o[l]]:o[l])}let a;for(a in o)MP.includes(a)||(this[a]=o[a])}get basename(){return typeof this.path=="string"?pu.basename(this.path):void 0}set basename(t){DP(t,"basename"),BP(t,"basename"),this.path=pu.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?pu.dirname(this.path):void 0}set dirname(t){ioe(this.basename,"dirname"),this.path=pu.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?pu.extname(this.path):void 0}set extname(t){if(BP(t,"extname"),ioe(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pu.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){G_(t)&&(t=TXe(t)),DP(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?pu.basename(this.path,this.extname):void 0}set stem(t){DP(t,"stem"),BP(t,"stem"),this.path=pu.join(this.dirname||"",t+(this.extname||""))}fail(t,o,i){const a=this.message(t,o,i);throw a.fatal=!0,a}info(t,o,i){const a=this.message(t,o,i);return a.fatal=void 0,a}message(t,o,i){const a=new el(t,o,i);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function BP(e,t){if(e&&e.includes(pu.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+pu.sep+"`")}function DP(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ioe(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function RXe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const FXe=function(e){const t=this.constructor.prototype,o=t[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,t),i},OXe={}.hasOwnProperty;let NXe=class tye extends FXe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=kXe()}copy(){const t=new tye;let o=-1;for(;++o<this.attachers.length;){const i=this.attachers[o];t.use(...i)}return t.data(jP(!0,{},this.namespace)),t}data(t,o){return typeof t=="string"?arguments.length===2?(zP("data",this.frozen),this.namespace[t]=o,this):OXe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(zP("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[o,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const a=o.call(t,...i);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const o=jv(t),i=this.parser||this.Parser;return PP("parse",i),i(String(o),o)}process(t,o){const i=this;return this.freeze(),PP("process",this.parser||this.Parser),TP("process",this.compiler||this.Compiler),o?a(void 0,o):new Promise(a);function a(l,d){const c=jv(t),p=i.parse(c);i.run(p,c,function(h,m,f){if(h||!m||!f)return u(h);const x=m,y=i.stringify(x,f);VXe(y)?f.value=y:f.result=y,u(h,f)});function u(h,m){h||!m?d(h):l?l(m):o(void 0,m)}}}processSync(t){let o=!1,i;return this.freeze(),PP("processSync",this.parser||this.Parser),TP("processSync",this.compiler||this.Compiler),this.process(t,a),aoe("processSync","process",o),i;function a(l,d){o=!0,ooe(l),i=d}}run(t,o,i){noe(t),this.freeze();const a=this.transformers;return!i&&typeof o=="function"&&(i=o,o=void 0),i?l(void 0,i):new Promise(l);function l(d,c){const p=jv(o);a.run(t,p,u);function u(h,m,f){const x=m||t;h?c(h):d?d(x):i(void 0,x,f)}}}runSync(t,o){let i=!1,a;return this.run(t,o,l),aoe("runSync","run",i),a;function l(d,c){ooe(d),a=c,i=!0}}stringify(t,o){this.freeze();const i=jv(o),a=this.compiler||this.Compiler;return TP("stringify",a),noe(t),a(t,i)}use(t,...o){const i=this.attachers,a=this.namespace;if(zP("use",this.frozen),t!=null)if(typeof t=="function")p(t,o);else if(typeof t=="object")Array.isArray(t)?c(t):d(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(u){if(typeof u=="function")p(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[h,...m]=u;p(h,m)}else d(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function d(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(u.plugins),u.settings&&(a.settings=jP(!0,a.settings,u.settings))}function c(u){let h=-1;if(u!=null)if(Array.isArray(u))for(;++h<u.length;){const m=u[h];l(m)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function p(u,h){let m=-1,f=-1;for(;++m<i.length;)if(i[m][0]===u){f=m;break}if(f===-1)i.push([u,...h]);else if(h.length>0){let[x,...y]=h;const w=i[f][1];W_(w)&&W_(x)&&(x=jP(!0,w,x)),i[f]=[u,x,...y]}}}};const HXe=new NXe().freeze();function PP(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function TP(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function zP(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function noe(e){if(!W_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function aoe(e,t,o){if(!o)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function jv(e){return _Xe(e)?e:new eye(e)}function _Xe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function VXe(e){return typeof e=="string"||QXe(e)}function QXe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const UXe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",soe=[],loe={allowDangerousHtml:!0},WXe=/^(https?|ircs?|mailto|xmpp)$/i,GXe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function YXe(e){const t=KXe(e),o=qXe(e);return ZXe(t.runSync(t.parse(o),o),e)}function KXe(e){const t=e.rehypePlugins||soe,o=e.remarkPlugins||soe,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...loe}:loe;return HXe().use(EJe).use(o).use(CXe,i).use(t)}function qXe(e){const t=e.children||"",o=new eye;return typeof t=="string"&&(o.value=t),o}function ZXe(e,t){const o=t.allowedElements,i=t.allowElement,a=t.components,l=t.disallowedElements,d=t.skipHtml,c=t.unwrapDisallowed,p=t.urlTransform||JXe;for(const h of GXe)Object.hasOwn(t,h.from)&&""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+UXe+h.id;return $G(e,u),cqe(e,{Fragment:s.Fragment,components:a,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function u(h,m,f){if(h.type==="raw"&&f&&typeof m=="number")return d?f.children.splice(m,1):f.children[m]={type:"text",value:h.value},m;if(h.type==="element"){let x;for(x in SP)if(Object.hasOwn(SP,x)&&Object.hasOwn(h.properties,x)){const y=h.properties[x],w=SP[x];(w===null||w.includes(h.tagName))&&(h.properties[x]=p(String(y||""),x,h))}}if(h.type==="element"){let x=o?!o.includes(h.tagName):l?l.includes(h.tagName):!1;if(!x&&i&&typeof m=="number"&&(x=!i(h,m,f)),x&&f&&typeof m=="number")return c&&h.children?f.children.splice(m,1,...h.children):f.children.splice(m,1),m}}}function JXe(e){const t=e.indexOf(":"),o=e.indexOf("?"),i=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||o!==-1&&t>o||i!==-1&&t>i||WXe.test(e.slice(0,t))?e:""}function doe(e,t){const o=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,a=o.indexOf(t);for(;a!==-1;)i++,a=o.indexOf(t,a+t.length);return i}function XXe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function eet(e,t,o){const i=bL((o||{}).ignore||[]),a=tet(t);let l=-1;for(;++l<a.length;)Xxe(e,"text",d);function d(p,u){let h=-1,m;for(;++h<u.length;){const f=u[h],x=m?m.children:void 0;if(i(f,x?x.indexOf(f):void 0,m))return;m=f}if(m)return c(p,u)}function c(p,u){const h=u[u.length-1],m=a[l][0],f=a[l][1];let x=0;const y=h.children.indexOf(p);let w=!1,b=[];m.lastIndex=0;let v=m.exec(p.value);for(;v;){const A=v.index,S={index:v.index,input:v.input,stack:[...u,p]};let E=f(...v,S);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?m.lastIndex=A+1:(x!==A&&b.push({type:"text",value:p.value.slice(x,A)}),Array.isArray(E)?b.push(...E):E&&b.push(E),x=A+v[0].length,w=!0),!m.global)break;v=m.exec(p.value)}return w?(x<p.value.length&&b.push({type:"text",value:p.value.slice(x)}),h.children.splice(y,1,...b)):b=[p],y+b.length}}function tet(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const o=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<o.length;){const a=o[i];t.push([oet(a[0]),ret(a[1])])}return t}function oet(e){return typeof e=="string"?new RegExp(XXe(e),"g"):e}function ret(e){return typeof e=="function"?e:function(){return e}}const RP="phrasing",FP=["autolink","link","image","label"];function iet(){return{transforms:[uet],enter:{literalAutolink:aet,literalAutolinkEmail:OP,literalAutolinkHttp:OP,literalAutolinkWww:OP},exit:{literalAutolink:pet,literalAutolinkEmail:cet,literalAutolinkHttp:set,literalAutolinkWww:det}}}function net(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:RP,notInConstruct:FP},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:RP,notInConstruct:FP},{character:":",before:"[ps]",after:"\\/",inConstruct:RP,notInConstruct:FP}]}}function aet(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function OP(e){this.config.enter.autolinkProtocol.call(this,e)}function set(e){this.config.exit.autolinkProtocol.call(this,e)}function det(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function cet(e){this.config.exit.autolinkEmail.call(this,e)}function pet(e){this.exit(e)}function uet(e){eet(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,het],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),met]],{ignore:["link","linkReference"]})}function het(e,t,o,i,a){let l="";if(!oye(a)||(/^w/i.test(t)&&(o=t+o,t="",l="http://"),!get(o)))return!1;const d=fet(o+i);if(!d[0])return!1;const c={type:"link",title:null,url:l+t+d[0],children:[{type:"text",value:t+d[0]}]};return d[1]?[c,{type:"text",value:d[1]}]:c}function met(e,t,o,i){return!oye(i,!0)||/[-\d_]$/.test(o)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+o,children:[{type:"text",value:t+"@"+o}]}}function get(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function fet(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let o=t[0],i=o.indexOf(")");const a=doe(e,"(");let l=doe(e,")");for(;i!==-1&&a>l;)e+=o.slice(0,i+1),o=o.slice(i+1),i=o.indexOf(")"),l++;return[e,o]}function oye(e,t){const o=e.input.charCodeAt(e.index-1);return(e.index===0||S4(o)||xL(o))&&(!t||o!==47)}rye.peek=ket;function xet(){this.buffer()}function yet(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function wet(){this.buffer()}function bet(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function vet(e){const t=this.resume(),o=this.stack[this.stack.length-1];o.type,o.identifier=z1(this.sliceSerialize(e)).toLowerCase(),o.label=t}function Cet(e){this.exit(e)}function Aet(e){const t=this.resume(),o=this.stack[this.stack.length-1];o.type,o.identifier=z1(this.sliceSerialize(e)).toLowerCase(),o.label=t}function $et(e){this.exit(e)}function ket(){return"["}function rye(e,t,o,i){const a=o.createTracker(i);let l=a.move("[^");const d=o.enter("footnoteReference"),c=o.enter("reference");return l+=a.move(o.safe(o.associationId(e),{after:"]",before:l})),c(),d(),l+=a.move("]"),l}function Eet(){return{enter:{gfmFootnoteCallString:xet,gfmFootnoteCall:yet,gfmFootnoteDefinitionLabelString:wet,gfmFootnoteDefinition:bet},exit:{gfmFootnoteCallString:vet,gfmFootnoteCall:Cet,gfmFootnoteDefinitionLabelString:Aet,gfmFootnoteDefinition:$et}}}function Let(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:o,footnoteReference:rye},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function o(i,a,l,d){const c=l.createTracker(d);let p=c.move("[^");const u=l.enter("footnoteDefinition"),h=l.enter("label");return p+=c.move(l.safe(l.associationId(i),{before:p,after:"]"})),h(),p+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),p+=c.move((t?`
77
+ `},a),l}function CXe(e,t){return e&&"run"in e?async function(o,i){const a=toe(o,{file:i,...t});await e.run(a,i)}:function(o,i){return toe(o,{file:i,...e||t})}}function ooe(e){if(e)throw e}var IP,roe;function AXe(){if(roe)return IP;roe=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,o=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=function(p){return typeof Array.isArray=="function"?Array.isArray(p):t.call(p)==="[object Array]"},l=function(p){if(!p||t.call(p)!=="[object Object]")return!1;var u=e.call(p,"constructor"),h=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!u&&!h)return!1;var m;for(m in p);return typeof m>"u"||e.call(p,m)},d=function(p,u){o&&u.name==="__proto__"?o(p,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):p[u.name]=u.newValue},c=function(p,u){if(u==="__proto__")if(e.call(p,u)){if(i)return i(p,u).value}else return;return p[u]};return IP=function p(){var u,h,m,f,x,y,w=arguments[0],b=1,v=arguments.length,A=!1;for(typeof w=="boolean"&&(A=w,w=arguments[1]||{},b=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});b<v;++b)if(u=arguments[b],u!=null)for(h in u)m=c(w,h),f=c(u,h),w!==f&&(A&&f&&(l(f)||(x=a(f)))?(x?(x=!1,y=m&&a(m)?m:[]):y=m&&l(m)?m:{},d(w,{name:h,newValue:p(A,y,f)})):typeof f<"u"&&d(w,{name:h,newValue:f}));return w},IP}var $Xe=AXe();const jP=Mr($Xe);function W_(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 kXe(){const e=[],t={run:o,use:i};return t;function o(...a){let l=-1;const d=a.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);c(null,...a);function c(p,...u){const h=e[++l];let m=-1;if(p){d(p);return}for(;++m<a.length;)(u[m]===null||u[m]===void 0)&&(u[m]=a[m]);a=u,h?SXe(h,c)(...u):d(null,...u)}}function i(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function SXe(e,t){let o;return i;function i(...d){const c=e.length>d.length;let p;c&&d.push(a);try{p=e.apply(this,d)}catch(u){const h=u;if(c&&o)throw h;return a(h)}c||(p&&p.then&&typeof p.then=="function"?p.then(l,a):p instanceof Error?a(p):l(p))}function a(d,...c){o||(o=!0,t(d,...c))}function l(d){a(null,d)}}const pu={basename:EXe,dirname:LXe,extname:IXe,join:jXe,sep:"/"};function EXe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Jw(e);let o=0,i=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){o=a+1;break}}else i<0&&(l=!0,i=a+1);return i<0?"":e.slice(o,i)}if(t===e)return"";let d=-1,c=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){o=a+1;break}}else d<0&&(l=!0,d=a+1),c>-1&&(e.codePointAt(a)===t.codePointAt(c--)?c<0&&(i=a):(c=-1,i=d));return o===i?i=d:i<0&&(i=e.length),e.slice(o,i)}function LXe(e){if(Jw(e),e.length===0)return".";let t=-1,o=e.length,i;for(;--o;)if(e.codePointAt(o)===47){if(i){t=o;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function IXe(e){Jw(e);let t=e.length,o=-1,i=0,a=-1,l=0,d;for(;t--;){const c=e.codePointAt(t);if(c===47){if(d){i=t+1;break}continue}o<0&&(d=!0,o=t+1),c===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||o<0||l===0||l===1&&a===o-1&&a===i+1?"":e.slice(a,o)}function jXe(...e){let t=-1,o;for(;++t<e.length;)Jw(e[t]),e[t]&&(o=o===void 0?e[t]:o+"/"+e[t]);return o===void 0?".":MXe(o)}function MXe(e){Jw(e);const t=e.codePointAt(0)===47;let o=BXe(e,!t);return o.length===0&&!t&&(o="."),o.length>0&&e.codePointAt(e.length-1)===47&&(o+="/"),t?"/"+o:o}function BXe(e,t){let o="",i=0,a=-1,l=0,d=-1,c,p;for(;++d<=e.length;){if(d<e.length)c=e.codePointAt(d);else{if(c===47)break;c=47}if(c===47){if(!(a===d-1||l===1))if(a!==d-1&&l===2){if(o.length<2||i!==2||o.codePointAt(o.length-1)!==46||o.codePointAt(o.length-2)!==46){if(o.length>2){if(p=o.lastIndexOf("/"),p!==o.length-1){p<0?(o="",i=0):(o=o.slice(0,p),i=o.length-1-o.lastIndexOf("/")),a=d,l=0;continue}}else if(o.length>0){o="",i=0,a=d,l=0;continue}}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(a+1,d):o=e.slice(a+1,d),i=d-a-1;a=d,l=0}else c===46&&l>-1?l++:l=-1}return o}function Jw(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const DXe={cwd:PXe};function PXe(){return"/"}function G_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function TXe(e){if(typeof e=="string")e=new URL(e);else if(!G_(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return zXe(e)}function zXe(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let o=-1;for(;++o<t.length;)if(t.codePointAt(o)===37&&t.codePointAt(o+1)===50){const i=t.codePointAt(o+2);if(i===70||i===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const MP=["history","path","basename","stem","extname","dirname"];let eye=class{constructor(t){let o;t?G_(t)?o={path:t}:typeof t=="string"||RXe(t)?o={value:t}:o=t:o={},this.cwd="cwd"in o?"":DXe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<MP.length;){const l=MP[i];l in o&&o[l]!==void 0&&o[l]!==null&&(this[l]=l==="history"?[...o[l]]:o[l])}let a;for(a in o)MP.includes(a)||(this[a]=o[a])}get basename(){return typeof this.path=="string"?pu.basename(this.path):void 0}set basename(t){DP(t,"basename"),BP(t,"basename"),this.path=pu.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?pu.dirname(this.path):void 0}set dirname(t){ioe(this.basename,"dirname"),this.path=pu.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?pu.extname(this.path):void 0}set extname(t){if(BP(t,"extname"),ioe(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pu.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){G_(t)&&(t=TXe(t)),DP(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?pu.basename(this.path,this.extname):void 0}set stem(t){DP(t,"stem"),BP(t,"stem"),this.path=pu.join(this.dirname||"",t+(this.extname||""))}fail(t,o,i){const a=this.message(t,o,i);throw a.fatal=!0,a}info(t,o,i){const a=this.message(t,o,i);return a.fatal=void 0,a}message(t,o,i){const a=new el(t,o,i);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}};function BP(e,t){if(e&&e.includes(pu.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+pu.sep+"`")}function DP(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ioe(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function RXe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const FXe=function(e){const t=this.constructor.prototype,o=t[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,t),i},OXe={}.hasOwnProperty;let NXe=class tye extends FXe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=kXe()}copy(){const t=new tye;let o=-1;for(;++o<this.attachers.length;){const i=this.attachers[o];t.use(...i)}return t.data(jP(!0,{},this.namespace)),t}data(t,o){return typeof t=="string"?arguments.length===2?(zP("data",this.frozen),this.namespace[t]=o,this):OXe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(zP("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[o,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const a=o.call(t,...i);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const o=jv(t),i=this.parser||this.Parser;return PP("parse",i),i(String(o),o)}process(t,o){const i=this;return this.freeze(),PP("process",this.parser||this.Parser),TP("process",this.compiler||this.Compiler),o?a(void 0,o):new Promise(a);function a(l,d){const c=jv(t),p=i.parse(c);i.run(p,c,function(h,m,f){if(h||!m||!f)return u(h);const x=m,y=i.stringify(x,f);VXe(y)?f.value=y:f.result=y,u(h,f)});function u(h,m){h||!m?d(h):l?l(m):o(void 0,m)}}}processSync(t){let o=!1,i;return this.freeze(),PP("processSync",this.parser||this.Parser),TP("processSync",this.compiler||this.Compiler),this.process(t,a),aoe("processSync","process",o),i;function a(l,d){o=!0,ooe(l),i=d}}run(t,o,i){noe(t),this.freeze();const a=this.transformers;return!i&&typeof o=="function"&&(i=o,o=void 0),i?l(void 0,i):new Promise(l);function l(d,c){const p=jv(o);a.run(t,p,u);function u(h,m,f){const x=m||t;h?c(h):d?d(x):i(void 0,x,f)}}}runSync(t,o){let i=!1,a;return this.run(t,o,l),aoe("runSync","run",i),a;function l(d,c){ooe(d),a=c,i=!0}}stringify(t,o){this.freeze();const i=jv(o),a=this.compiler||this.Compiler;return TP("stringify",a),noe(t),a(t,i)}use(t,...o){const i=this.attachers,a=this.namespace;if(zP("use",this.frozen),t!=null)if(typeof t=="function")p(t,o);else if(typeof t=="object")Array.isArray(t)?c(t):d(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(u){if(typeof u=="function")p(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[h,...m]=u;p(h,m)}else d(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function d(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(u.plugins),u.settings&&(a.settings=jP(!0,a.settings,u.settings))}function c(u){let h=-1;if(u!=null)if(Array.isArray(u))for(;++h<u.length;){const m=u[h];l(m)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function p(u,h){let m=-1,f=-1;for(;++m<i.length;)if(i[m][0]===u){f=m;break}if(f===-1)i.push([u,...h]);else if(h.length>0){let[x,...y]=h;const w=i[f][1];W_(w)&&W_(x)&&(x=jP(!0,w,x)),i[f]=[u,x,...y]}}}};const HXe=new NXe().freeze();function PP(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function TP(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function zP(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function noe(e){if(!W_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function aoe(e,t,o){if(!o)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function jv(e){return _Xe(e)?e:new eye(e)}function _Xe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function VXe(e){return typeof e=="string"||QXe(e)}function QXe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const UXe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",soe=[],loe={allowDangerousHtml:!0},WXe=/^(https?|ircs?|mailto|xmpp)$/i,GXe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function YXe(e){const t=KXe(e),o=qXe(e);return ZXe(t.runSync(t.parse(o),o),e)}function KXe(e){const t=e.rehypePlugins||soe,o=e.remarkPlugins||soe,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...loe}:loe;return HXe().use(EJe).use(o).use(CXe,i).use(t)}function qXe(e){const t=e.children||"",o=new eye;return typeof t=="string"&&(o.value=t),o}function ZXe(e,t){const o=t.allowedElements,i=t.allowElement,a=t.components,l=t.disallowedElements,d=t.skipHtml,c=t.unwrapDisallowed,p=t.urlTransform||JXe;for(const h of GXe)Object.hasOwn(t,h.from)&&""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+UXe+h.id;return $G(e,u),cqe(e,{Fragment:s.Fragment,components:a,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function u(h,m,f){if(h.type==="raw"&&f&&typeof m=="number")return d?f.children.splice(m,1):f.children[m]={type:"text",value:h.value},m;if(h.type==="element"){let x;for(x in SP)if(Object.hasOwn(SP,x)&&Object.hasOwn(h.properties,x)){const y=h.properties[x],w=SP[x];(w===null||w.includes(h.tagName))&&(h.properties[x]=p(String(y||""),x,h))}}if(h.type==="element"){let x=o?!o.includes(h.tagName):l?l.includes(h.tagName):!1;if(!x&&i&&typeof m=="number"&&(x=!i(h,m,f)),x&&f&&typeof m=="number")return c&&h.children?f.children.splice(m,1,...h.children):f.children.splice(m,1),m}}}function JXe(e){const t=e.indexOf(":"),o=e.indexOf("?"),i=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||o!==-1&&t>o||i!==-1&&t>i||WXe.test(e.slice(0,t))?e:""}function doe(e,t){const o=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,a=o.indexOf(t);for(;a!==-1;)i++,a=o.indexOf(t,a+t.length);return i}function XXe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function eet(e,t,o){const i=bL((o||{}).ignore||[]),a=tet(t);let l=-1;for(;++l<a.length;)Xxe(e,"text",d);function d(p,u){let h=-1,m;for(;++h<u.length;){const f=u[h],x=m?m.children:void 0;if(i(f,x?x.indexOf(f):void 0,m))return;m=f}if(m)return c(p,u)}function c(p,u){const h=u[u.length-1],m=a[l][0],f=a[l][1];let x=0;const y=h.children.indexOf(p);let w=!1,b=[];m.lastIndex=0;let v=m.exec(p.value);for(;v;){const A=v.index,S={index:v.index,input:v.input,stack:[...u,p]};let E=f(...v,S);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?m.lastIndex=A+1:(x!==A&&b.push({type:"text",value:p.value.slice(x,A)}),Array.isArray(E)?b.push(...E):E&&b.push(E),x=A+v[0].length,w=!0),!m.global)break;v=m.exec(p.value)}return w?(x<p.value.length&&b.push({type:"text",value:p.value.slice(x)}),h.children.splice(y,1,...b)):b=[p],y+b.length}}function tet(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const o=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<o.length;){const a=o[i];t.push([oet(a[0]),ret(a[1])])}return t}function oet(e){return typeof e=="string"?new RegExp(XXe(e),"g"):e}function ret(e){return typeof e=="function"?e:function(){return e}}const RP="phrasing",FP=["autolink","link","image","label"];function iet(){return{transforms:[uet],enter:{literalAutolink:aet,literalAutolinkEmail:OP,literalAutolinkHttp:OP,literalAutolinkWww:OP},exit:{literalAutolink:pet,literalAutolinkEmail:cet,literalAutolinkHttp:set,literalAutolinkWww:det}}}function net(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:RP,notInConstruct:FP},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:RP,notInConstruct:FP},{character:":",before:"[ps]",after:"\\/",inConstruct:RP,notInConstruct:FP}]}}function aet(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function OP(e){this.config.enter.autolinkProtocol.call(this,e)}function set(e){this.config.exit.autolinkProtocol.call(this,e)}function det(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function cet(e){this.config.exit.autolinkEmail.call(this,e)}function pet(e){this.exit(e)}function uet(e){eet(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,het],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),met]],{ignore:["link","linkReference"]})}function het(e,t,o,i,a){let l="";if(!oye(a)||(/^w/i.test(t)&&(o=t+o,t="",l="http://"),!get(o)))return!1;const d=fet(o+i);if(!d[0])return!1;const c={type:"link",title:null,url:l+t+d[0],children:[{type:"text",value:t+d[0]}]};return d[1]?[c,{type:"text",value:d[1]}]:c}function met(e,t,o,i){return!oye(i,!0)||/[-\d_]$/.test(o)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+o,children:[{type:"text",value:t+"@"+o}]}}function get(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function fet(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let o=t[0],i=o.indexOf(")");const a=doe(e,"(");let l=doe(e,")");for(;i!==-1&&a>l;)e+=o.slice(0,i+1),o=o.slice(i+1),i=o.indexOf(")"),l++;return[e,o]}function oye(e,t){const o=e.input.charCodeAt(e.index-1);return(e.index===0||S4(o)||xL(o))&&(!t||o!==47)}rye.peek=ket;function xet(){this.buffer()}function yet(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function wet(){this.buffer()}function bet(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function vet(e){const t=this.resume(),o=this.stack[this.stack.length-1];o.type,o.identifier=z1(this.sliceSerialize(e)).toLowerCase(),o.label=t}function Cet(e){this.exit(e)}function Aet(e){const t=this.resume(),o=this.stack[this.stack.length-1];o.type,o.identifier=z1(this.sliceSerialize(e)).toLowerCase(),o.label=t}function $et(e){this.exit(e)}function ket(){return"["}function rye(e,t,o,i){const a=o.createTracker(i);let l=a.move("[^");const d=o.enter("footnoteReference"),c=o.enter("reference");return l+=a.move(o.safe(o.associationId(e),{after:"]",before:l})),c(),d(),l+=a.move("]"),l}function Eet(){return{enter:{gfmFootnoteCallString:xet,gfmFootnoteCall:yet,gfmFootnoteDefinitionLabelString:wet,gfmFootnoteDefinition:bet},exit:{gfmFootnoteCallString:vet,gfmFootnoteCall:Cet,gfmFootnoteDefinitionLabelString:Aet,gfmFootnoteDefinition:$et}}}function Let(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:o,footnoteReference:rye},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function o(i,a,l,d){const c=l.createTracker(d);let p=c.move("[^");const u=l.enter("footnoteDefinition"),h=l.enter("label");return p+=c.move(l.safe(l.associationId(i),{before:p,after:"]"})),h(),p+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),p+=c.move((t?`
78
78
  `:" ")+l.indentLines(l.containerFlow(i,c.current()),t?iye:Iet))),u(),p}}function Iet(e,t,o){return t===0?e:iye(e,t,o)}function iye(e,t,o){return(o?"":" ")+e}const jet=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];nye.peek=Tet;function Met(){return{canContainEols:["delete"],enter:{strikethrough:Det},exit:{strikethrough:Pet}}}function Bet(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:jet}],handlers:{delete:nye}}}function Det(e){this.enter({type:"delete",children:[]},e)}function Pet(e){this.exit(e)}function nye(e,t,o,i){const a=o.createTracker(i),l=o.enter("strikethrough");let d=a.move("~~");return d+=o.containerPhrasing(e,{...a.current(),before:d,after:"~"}),d+=a.move("~~"),l(),d}function Tet(){return"~"}function zet(e){return e.length}function Ret(e,t){const o=t||{},i=(o.align||[]).concat(),a=o.stringLength||zet,l=[],d=[],c=[],p=[];let u=0,h=-1;for(;++h<e.length;){const w=[],b=[];let v=-1;for(e[h].length>u&&(u=e[h].length);++v<e[h].length;){const A=Fet(e[h][v]);if(o.alignDelimiters!==!1){const S=a(A);b[v]=S,(p[v]===void 0||S>p[v])&&(p[v]=S)}w.push(A)}d[h]=w,c[h]=b}let m=-1;if(typeof i=="object"&&"length"in i)for(;++m<u;)l[m]=coe(i[m]);else{const w=coe(i);for(;++m<u;)l[m]=w}m=-1;const f=[],x=[];for(;++m<u;){const w=l[m];let b="",v="";w===99?(b=":",v=":"):w===108?b=":":w===114&&(v=":");let A=o.alignDelimiters===!1?1:Math.max(1,p[m]-b.length-v.length);const S=b+"-".repeat(A)+v;o.alignDelimiters!==!1&&(A=b.length+A+v.length,A>p[m]&&(p[m]=A),x[m]=A),f[m]=S}d.splice(1,0,f),c.splice(1,0,x),h=-1;const y=[];for(;++h<d.length;){const w=d[h],b=c[h];m=-1;const v=[];for(;++m<u;){const A=w[m]||"";let S="",E="";if(o.alignDelimiters!==!1){const j=p[m]-(b[m]||0),L=l[m];L===114?S=" ".repeat(j):L===99?j%2?(S=" ".repeat(j/2+.5),E=" ".repeat(j/2-.5)):(S=" ".repeat(j/2),E=S):E=" ".repeat(j)}o.delimiterStart!==!1&&!m&&v.push("|"),o.padding!==!1&&!(o.alignDelimiters===!1&&A==="")&&(o.delimiterStart!==!1||m)&&v.push(" "),o.alignDelimiters!==!1&&v.push(S),v.push(A),o.alignDelimiters!==!1&&v.push(E),o.padding!==!1&&v.push(" "),(o.delimiterEnd!==!1||m!==u-1)&&v.push("|")}y.push(o.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return y.join(`
79
79
  `)}function Fet(e){return e==null?"":String(e)}function coe(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Oet(e,t,o,i){const a=o.enter("blockquote"),l=o.createTracker(i);l.move("> "),l.shift(2);const d=o.indentLines(o.containerFlow(e,l.current()),Net);return a(),d}function Net(e,t,o){return">"+(o?"":" ")+e}function Het(e,t){return poe(e,t.inConstruct,!0)&&!poe(e,t.notInConstruct,!1)}function poe(e,t,o){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return o;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function uoe(e,t,o,i){let a=-1;for(;++a<o.unsafe.length;)if(o.unsafe[a].character===`
80
80
  `&&Het(o.stack,o.unsafe[a]))return/[ \t]/.test(i.before)?"":" ";return`\\
@@ -89,7 +89,7 @@ export default theme;`}function aX(e){return typeof e=="number"?`${(e*100).toFix
89
89
  `))+1))}const d="#".repeat(a),c=o.enter("headingAtx"),p=o.enter("phrasing");l.move(d+" ");let u=o.containerPhrasing(e,{before:"# ",after:`
90
90
  `,...l.current()});return/^[\t ]/.test(u)&&(u=_y(u.charCodeAt(0))+u.slice(1)),u=u?d+" "+u:d,o.options.closeAtx&&(u+=" "+d),p(),c(),u}sye.peek=Jet;function sye(e){return e.value||""}function Jet(){return"<"}lye.peek=Xet;function lye(e,t,o,i){const a=kG(o),l=a==='"'?"Quote":"Apostrophe",d=o.enter("image");let c=o.enter("label");const p=o.createTracker(i);let u=p.move("![");return u+=p.move(o.safe(e.alt,{before:u,after:"]",...p.current()})),u+=p.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=o.enter("destinationLiteral"),u+=p.move("<"),u+=p.move(o.safe(e.url,{before:u,after:">",...p.current()})),u+=p.move(">")):(c=o.enter("destinationRaw"),u+=p.move(o.safe(e.url,{before:u,after:e.title?" ":")",...p.current()}))),c(),e.title&&(c=o.enter(`title${l}`),u+=p.move(" "+a),u+=p.move(o.safe(e.title,{before:u,after:a,...p.current()})),u+=p.move(a),c()),u+=p.move(")"),d(),u}function Xet(){return"!"}dye.peek=ett;function dye(e,t,o,i){const a=e.referenceType,l=o.enter("imageReference");let d=o.enter("label");const c=o.createTracker(i);let p=c.move("![");const u=o.safe(e.alt,{before:p,after:"]",...c.current()});p+=c.move(u+"]["),d();const h=o.stack;o.stack=[],d=o.enter("reference");const m=o.safe(o.associationId(e),{before:p,after:"]",...c.current()});return d(),o.stack=h,l(),a==="full"||!u||u!==m?p+=c.move(m+"]"):a==="shortcut"?p=p.slice(0,-1):p+=c.move("]"),p}function ett(){return"!"}cye.peek=ttt;function cye(e,t,o){let i=e.value||"",a="`",l=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(i);)a+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++l<o.unsafe.length;){const d=o.unsafe[l],c=o.compilePattern(d);let p;if(d.atBreak)for(;p=c.exec(i);){let u=p.index;i.charCodeAt(u)===10&&i.charCodeAt(u-1)===13&&u--,i=i.slice(0,u)+" "+i.slice(p.index+1)}}return a+i+a}function ttt(){return"`"}function pye(e,t){const o=xG(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(o===e.url||"mailto:"+o===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}uye.peek=ott;function uye(e,t,o,i){const a=kG(o),l=a==='"'?"Quote":"Apostrophe",d=o.createTracker(i);let c,p;if(pye(e,o)){const h=o.stack;o.stack=[],c=o.enter("autolink");let m=d.move("<");return m+=d.move(o.containerPhrasing(e,{before:m,after:">",...d.current()})),m+=d.move(">"),c(),o.stack=h,m}c=o.enter("link"),p=o.enter("label");let u=d.move("[");return u+=d.move(o.containerPhrasing(e,{before:u,after:"](",...d.current()})),u+=d.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=o.enter("destinationLiteral"),u+=d.move("<"),u+=d.move(o.safe(e.url,{before:u,after:">",...d.current()})),u+=d.move(">")):(p=o.enter("destinationRaw"),u+=d.move(o.safe(e.url,{before:u,after:e.title?" ":")",...d.current()}))),p(),e.title&&(p=o.enter(`title${l}`),u+=d.move(" "+a),u+=d.move(o.safe(e.title,{before:u,after:a,...d.current()})),u+=d.move(a),p()),u+=d.move(")"),c(),u}function ott(e,t,o){return pye(e,o)?"<":"["}hye.peek=rtt;function hye(e,t,o,i){const a=e.referenceType,l=o.enter("linkReference");let d=o.enter("label");const c=o.createTracker(i);let p=c.move("[");const u=o.containerPhrasing(e,{before:p,after:"]",...c.current()});p+=c.move(u+"]["),d();const h=o.stack;o.stack=[],d=o.enter("reference");const m=o.safe(o.associationId(e),{before:p,after:"]",...c.current()});return d(),o.stack=h,l(),a==="full"||!u||u!==m?p+=c.move(m+"]"):a==="shortcut"?p=p.slice(0,-1):p+=c.move("]"),p}function rtt(){return"["}function SG(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function itt(e){const t=SG(e),o=e.options.bulletOther;if(!o)return t==="*"?"-":"*";if(o!=="*"&&o!=="+"&&o!=="-")throw new Error("Cannot serialize items with `"+o+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(o===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+o+"`) to be different");return o}function ntt(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function mye(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function att(e,t,o,i){const a=o.enter("list"),l=o.bulletCurrent;let d=e.ordered?ntt(o):SG(o);const c=e.ordered?d==="."?")":".":itt(o);let p=t&&o.bulletLastUsed?d===o.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&h&&(!h.children||!h.children[0])&&o.stack[o.stack.length-1]==="list"&&o.stack[o.stack.length-2]==="listItem"&&o.stack[o.stack.length-3]==="list"&&o.stack[o.stack.length-4]==="listItem"&&o.indexStack[o.indexStack.length-1]===0&&o.indexStack[o.indexStack.length-2]===0&&o.indexStack[o.indexStack.length-3]===0&&(p=!0),mye(o)===d&&h){let m=-1;for(;++m<e.children.length;){const f=e.children[m];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(d=c),o.bulletCurrent=d;const u=o.containerFlow(e,i);return o.bulletLastUsed=d,o.bulletCurrent=l,a(),u}function stt(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function ltt(e,t,o,i){const a=stt(o);let l=o.bulletCurrent||SG(o);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(o.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let d=l.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(d=Math.ceil(d/4)*4);const c=o.createTracker(i);c.move(l+" ".repeat(d-l.length)),c.shift(d);const p=o.enter("listItem"),u=o.indentLines(o.containerFlow(e,c.current()),h);return p(),u;function h(m,f,x){return f?(x?"":" ".repeat(d))+m:(x?l:l+" ".repeat(d-l.length))+m}}function dtt(e,t,o,i){const a=o.enter("paragraph"),l=o.enter("phrasing"),d=o.containerPhrasing(e,i);return l(),a(),d}const ctt=bL(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ptt(e,t,o,i){return(e.children.some(function(a){return ctt(a)})?o.containerPhrasing:o.containerFlow).call(o,e,i)}function utt(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}gye.peek=htt;function gye(e,t,o,i){const a=utt(o),l=o.enter("strong"),d=o.createTracker(i),c=d.move(a+a);let p=d.move(o.containerPhrasing(e,{after:a,before:c,...d.current()}));const u=p.charCodeAt(0),h=yk(i.before.charCodeAt(i.before.length-1),u,a);h.inside&&(p=_y(u)+p.slice(1));const m=p.charCodeAt(p.length-1),f=yk(i.after.charCodeAt(0),m,a);f.inside&&(p=p.slice(0,-1)+_y(m));const x=d.move(a+a);return l(),o.attentionEncodeSurroundingInfo={after:f.outside,before:h.outside},c+p+x}function htt(e,t,o){return o.options.strong||"*"}function mtt(e,t,o,i){return o.safe(e.value,i)}function gtt(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function ftt(e,t,o){const i=(mye(o)+(o.options.ruleSpaces?" ":"")).repeat(gtt(o));return o.options.ruleSpaces?i.slice(0,-1):i}const fye={blockquote:Oet,break:uoe,code:Uet,definition:Get,emphasis:aye,hardBreak:uoe,heading:Zet,html:sye,image:lye,imageReference:dye,inlineCode:cye,link:uye,linkReference:hye,list:att,listItem:ltt,paragraph:dtt,root:ptt,strong:gye,text:mtt,thematicBreak:ftt};function xtt(){return{enter:{table:ytt,tableData:hoe,tableHeader:hoe,tableRow:btt},exit:{codeText:vtt,table:wtt,tableData:NP,tableHeader:NP,tableRow:NP}}}function ytt(e){const t=e._align;this.enter({type:"table",align:t.map(function(o){return o==="none"?null:o}),children:[]},e),this.data.inTable=!0}function wtt(e){this.exit(e),this.data.inTable=void 0}function btt(e){this.enter({type:"tableRow",children:[]},e)}function NP(e){this.exit(e)}function hoe(e){this.enter({type:"tableCell",children:[]},e)}function vtt(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ctt));const o=this.stack[this.stack.length-1];o.type,o.value=t,this.exit(e)}function Ctt(e,t){return t==="|"?t:e}function Att(e){const t=e||{},o=t.tableCellPadding,i=t.tablePipeAlign,a=t.stringLength,l=o?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
91
91
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:d,tableCell:p,tableRow:c}};function d(x,y,w,b){return u(h(x,w,b),x.align)}function c(x,y,w,b){const v=m(x,w,b),A=u([v]);return A.slice(0,A.indexOf(`
92
- `))}function p(x,y,w,b){const v=w.enter("tableCell"),A=w.enter("phrasing"),S=w.containerPhrasing(x,{...b,before:l,after:l});return A(),v(),S}function u(x,y){return Ret(x,{align:y,alignDelimiters:i,padding:o,stringLength:a})}function h(x,y,w){const b=x.children;let v=-1;const A=[],S=y.enter("table");for(;++v<b.length;)A[v]=m(b[v],y,w);return S(),A}function m(x,y,w){const b=x.children;let v=-1;const A=[],S=y.enter("tableRow");for(;++v<b.length;)A[v]=p(b[v],x,y,w);return S(),A}function f(x,y,w){let b=fye.inlineCode(x,y,w);return w.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function $tt(){return{exit:{taskListCheckValueChecked:moe,taskListCheckValueUnchecked:moe,paragraph:Stt}}}function ktt(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ett}}}function moe(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Stt(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const o=this.stack[this.stack.length-1];o.type;const i=o.children[0];if(i&&i.type==="text"){const a=t.children;let l=-1,d;for(;++l<a.length;){const c=a[l];if(c.type==="paragraph"){d=c;break}}d===o&&(i.value=i.value.slice(1),i.value.length===0?o.children.shift():o.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,o.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function Ett(e,t,o,i){const a=e.children[0],l=typeof e.checked=="boolean"&&a&&a.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",c=o.createTracker(i);l&&c.move(d);let p=fye.listItem(e,t,o,{...i,...c.current()});return l&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),p;function u(h){return h+d}}function Ltt(){return[iet(),Eet(),Met(),xtt(),$tt()]}function Itt(e){return{extensions:[net(),Let(e),Bet(),Att(e),ktt()]}}const jtt={tokenize:ztt,partial:!0},xye={tokenize:Rtt,partial:!0},yye={tokenize:Ftt,partial:!0},wye={tokenize:Ott,partial:!0},Mtt={tokenize:Ntt,partial:!0},bye={name:"wwwAutolink",tokenize:Ptt,previous:Cye},vye={name:"protocolAutolink",tokenize:Ttt,previous:Aye},F0={name:"emailAutolink",tokenize:Dtt,previous:$ye},l2={};function Btt(){return{text:l2}}let Vg=48;for(;Vg<123;)l2[Vg]=F0,Vg++,Vg===58?Vg=65:Vg===91&&(Vg=97);l2[43]=F0;l2[45]=F0;l2[46]=F0;l2[95]=F0;l2[72]=[F0,vye];l2[104]=[F0,vye];l2[87]=[F0,bye];l2[119]=[F0,bye];function Dtt(e,t,o){const i=this;let a,l;return d;function d(m){return!Y_(m)||!$ye.call(i,i.previous)||EG(i.events)?o(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return Y_(m)?(e.consume(m),c):m===64?(e.consume(m),p):o(m)}function p(m){return m===46?e.check(Mtt,h,u)(m):m===45||m===95||Gs(m)?(l=!0,e.consume(m),p):h(m)}function u(m){return e.consume(m),a=!0,p}function h(m){return l&&a&&bl(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):o(m)}}function Ptt(e,t,o){const i=this;return a;function a(d){return d!==87&&d!==119||!Cye.call(i,i.previous)||EG(i.events)?o(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(jtt,e.attempt(xye,e.attempt(yye,l),o),o)(d))}function l(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(d)}}function Ttt(e,t,o){const i=this;let a="",l=!1;return d;function d(m){return(m===72||m===104)&&Aye.call(i,i.previous)&&!EG(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(m),e.consume(m),c):o(m)}function c(m){if(bl(m)&&a.length<5)return a+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const f=a.toLowerCase();if(f==="http"||f==="https")return e.consume(m),p}return o(m)}function p(m){return m===47?(e.consume(m),l?u:(l=!0,p)):o(m)}function u(m){return m===null||gk(m)||_i(m)||S4(m)||xL(m)?o(m):e.attempt(xye,e.attempt(yye,h),o)(m)}function h(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function ztt(e,t,o){let i=0;return a;function a(d){return(d===87||d===119)&&i<3?(i++,e.consume(d),a):d===46&&i===3?(e.consume(d),l):o(d)}function l(d){return d===null?o(d):t(d)}}function Rtt(e,t,o){let i,a,l;return d;function d(u){return u===46||u===95?e.check(wye,p,c)(u):u===null||_i(u)||S4(u)||u!==45&&xL(u)?p(u):(l=!0,e.consume(u),d)}function c(u){return u===95?i=!0:(a=i,i=void 0),e.consume(u),d}function p(u){return a||i||!l?o(u):t(u)}}function Ftt(e,t){let o=0,i=0;return a;function a(d){return d===40?(o++,e.consume(d),a):d===41&&i<o?l(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(wye,t,l)(d):d===null||_i(d)||S4(d)?t(d):(e.consume(d),a)}function l(d){return d===41&&i++,e.consume(d),a}}function Ott(e,t,o){return i;function i(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),i):c===38?(e.consume(c),l):c===93?(e.consume(c),a):c===60||c===null||_i(c)||S4(c)?t(c):o(c)}function a(c){return c===null||c===40||c===91||_i(c)||S4(c)?t(c):i(c)}function l(c){return bl(c)?d(c):o(c)}function d(c){return c===59?(e.consume(c),i):bl(c)?(e.consume(c),d):o(c)}}function Ntt(e,t,o){return i;function i(l){return e.consume(l),a}function a(l){return Gs(l)?o(l):t(l)}}function Cye(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||_i(e)}function Aye(e){return!bl(e)}function $ye(e){return!(e===47||Y_(e))}function Y_(e){return e===43||e===45||e===46||e===95||Gs(e)}function EG(e){let t=e.length,o=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){o=!0;break}if(i._gfmAutolinkLiteralWalkedInto){o=!1;break}}return e.length>0&&!o&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),o}const Htt={tokenize:Ktt,partial:!0};function _tt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Wtt,continuation:{tokenize:Gtt},exit:Ytt}},text:{91:{name:"gfmFootnoteCall",tokenize:Utt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Vtt,resolveTo:Qtt}}}}function Vtt(e,t,o){const i=this;let a=i.events.length;const l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let d;for(;a--;){const p=i.events[a][1];if(p.type==="labelImage"){d=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return c;function c(p){if(!d||!d._balanced)return o(p);const u=z1(i.sliceSerialize({start:d.end,end:i.now()}));return u.codePointAt(0)!==94||!l.includes(u.slice(1))?o(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),t(p))}}function Qtt(e,t){let o=e.length;for(;o--;)if(e[o][1].type==="labelImage"&&e[o][0]==="enter"){e[o][1];break}e[o+1][1].type="data",e[o+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[o+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[o+3][1].end),end:Object.assign({},e[o+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[e[o+1],e[o+2],["enter",i,t],e[o+3],e[o+4],["enter",a,t],["exit",a,t],["enter",l,t],["enter",d,t],["exit",d,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(o,e.length-o+1,...c),e}function Utt(e,t,o){const i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l=0,d;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),p}function p(m){return m!==94?o(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(m){if(l>999||m===93&&!d||m===null||m===91||_i(m))return o(m);if(m===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return a.includes(z1(i.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):o(m)}return _i(m)||(d=!0),l++,e.consume(m),m===92?h:u}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,u):u(m)}}function Wtt(e,t,o){const i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l,d=0,c;return p;function p(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):o(y)}function h(y){if(d>999||y===93&&!c||y===null||y===91||_i(y))return o(y);if(y===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return l=z1(i.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return _i(y)||(c=!0),d++,e.consume(y),y===92?m:h}function m(y){return y===91||y===92||y===93?(e.consume(y),d++,h):h(y)}function f(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),a.includes(l)||a.push(l),Zr(e,x,"gfmFootnoteDefinitionWhitespace")):o(y)}function x(y){return t(y)}}function Gtt(e,t,o){return e.check(Zw,t,e.attempt(Htt,t,o))}function Ytt(e){e.exit("gfmFootnoteDefinition")}function Ktt(e,t,o){const i=this;return Zr(e,a,"gfmFootnoteDefinitionIndent",5);function a(l){const d=i.events[i.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?t(l):o(l)}}function qtt(e){let t=(e||{}).singleTilde;const o={name:"strikethrough",tokenize:a,resolveAll:i};return t==null&&(t=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function i(l,d){let c=-1;for(;++c<l.length;)if(l[c][0]==="enter"&&l[c][1].type==="strikethroughSequenceTemporary"&&l[c][1]._close){let p=c;for(;p--;)if(l[p][0]==="exit"&&l[p][1].type==="strikethroughSequenceTemporary"&&l[p][1]._open&&l[c][1].end.offset-l[c][1].start.offset===l[p][1].end.offset-l[p][1].start.offset){l[c][1].type="strikethroughSequence",l[p][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},l[p][1].start),end:Object.assign({},l[c][1].end)},h={type:"strikethroughText",start:Object.assign({},l[p][1].end),end:Object.assign({},l[c][1].start)},m=[["enter",u,d],["enter",l[p][1],d],["exit",l[p][1],d],["enter",h,d]],f=d.parser.constructs.insideSpan.null;f&&Qd(m,m.length,0,yL(f,l.slice(p+1,c),d)),Qd(m,m.length,0,[["exit",h,d],["enter",l[c][1],d],["exit",l[c][1],d],["exit",u,d]]),Qd(l,p-1,c-p+3,m),c=p+m.length-2;break}}for(c=-1;++c<l.length;)l[c][1].type==="strikethroughSequenceTemporary"&&(l[c][1].type="data");return l}function a(l,d,c){const p=this.previous,u=this.events;let h=0;return m;function m(x){return p===126&&u[u.length-1][1].type!=="characterEscape"?c(x):(l.enter("strikethroughSequenceTemporary"),f(x))}function f(x){const y=r6(p);if(x===126)return h>1?c(x):(l.consume(x),h++,f);if(h<2&&!t)return c(x);const w=l.exit("strikethroughSequenceTemporary"),b=r6(x);return w._open=!b||b===2&&!!y,w._close=!y||y===2&&!!b,d(x)}}}let Ztt=class{constructor(){this.map=[]}add(t,o,i){Jtt(this,t,o,i)}consume(t){if(this.map.sort(function(l,d){return l[0]-d[0]}),this.map.length===0)return;let o=this.map.length;const i=[];for(;o>0;)o-=1,i.push(t.slice(this.map[o][0]+this.map[o][1]),this.map[o][2]),t.length=this.map[o][0];i.push(t.slice()),t.length=0;let a=i.pop();for(;a;){for(const l of a)t.push(l);a=i.pop()}this.map.length=0}};function Jtt(e,t,o,i){let a=0;if(!(o===0&&i.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=o,e.map[a][2].push(...i);return}a+=1}e.map.push([t,o,i])}}function Xtt(e,t){let o=!1;const i=[];for(;t<e.length;){const a=e[t];if(o){if(a[0]==="enter")a[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=i.length-1;i[l]=i[l]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(o=!0);t+=1}return i}function eot(){return{flow:{null:{name:"table",tokenize:tot,resolveAll:oot}}}}function tot(e,t,o){const i=this;let a=0,l=0,d;return c;function c(T){let z=i.events.length-1;for(;z>-1;){const Z=i.events[z][1].type;if(Z==="lineEnding"||Z==="linePrefix")z--;else break}const R=z>-1?i.events[z][1].type:null,K=R==="tableHead"||R==="tableRow"?L:p;return K===L&&i.parser.lazy[i.now().line]?o(T):K(T)}function p(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(d=!0,l+=1),h(T)}function h(T){return T===null?o(T):Fo(T)?l>1?(l=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),x):o(T):Pr(T)?Zr(e,h,"whitespace")(T):(l+=1,d&&(d=!1,a+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),d=!0,h):(e.enter("data"),m(T)))}function m(T){return T===null||T===124||_i(T)?(e.exit("data"),h(T)):(e.consume(T),T===92?f:m)}function f(T){return T===92||T===124?(e.consume(T),m):m(T)}function x(T){return i.interrupt=!1,i.parser.lazy[i.now().line]?o(T):(e.enter("tableDelimiterRow"),d=!1,Pr(T)?Zr(e,y,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):y(T))}function y(T){return T===45||T===58?b(T):T===124?(d=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),w):j(T)}function w(T){return Pr(T)?Zr(e,b,"whitespace")(T):b(T)}function b(T){return T===58?(l+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),v):T===45?(l+=1,v(T)):T===null||Fo(T)?E(T):j(T)}function v(T){return T===45?(e.enter("tableDelimiterFiller"),A(T)):j(T)}function A(T){return T===45?(e.consume(T),A):T===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(T))}function S(T){return Pr(T)?Zr(e,E,"whitespace")(T):E(T)}function E(T){return T===124?y(T):T===null||Fo(T)?!d||a!==l?j(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):j(T)}function j(T){return o(T)}function L(T){return e.enter("tableRow"),M(T)}function M(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),M):T===null||Fo(T)?(e.exit("tableRow"),t(T)):Pr(T)?Zr(e,M,"whitespace")(T):(e.enter("data"),D(T))}function D(T){return T===null||T===124||_i(T)?(e.exit("data"),M(T)):(e.consume(T),T===92?P:D)}function P(T){return T===92||T===124?(e.consume(T),D):D(T)}}function oot(e,t){let o=-1,i=!0,a=0,l=[0,0,0,0],d=[0,0,0,0],c=!1,p=0,u,h,m;const f=new Ztt;for(;++o<e.length;){const x=e[o],y=x[1];x[0]==="enter"?y.type==="tableHead"?(c=!1,p!==0&&(goe(f,t,p,u,h),h=void 0,p=0),u={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},f.add(o,0,[["enter",u,t]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(i=!0,m=void 0,l=[0,0,0,0],d=[0,o+1,0,0],c&&(c=!1,h={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},f.add(o,0,[["enter",h,t]])),a=y.type==="tableDelimiterRow"?2:h?3:1):a&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(i=!1,d[2]===0&&(l[1]!==0&&(d[0]=d[1],m=Mv(f,t,l,a,void 0,m),l=[0,0,0,0]),d[2]=o)):y.type==="tableCellDivider"&&(i?i=!1:(l[1]!==0&&(d[0]=d[1],m=Mv(f,t,l,a,void 0,m)),l=d,d=[l[1],o,0,0])):y.type==="tableHead"?(c=!0,p=o):y.type==="tableRow"||y.type==="tableDelimiterRow"?(p=o,l[1]!==0?(d[0]=d[1],m=Mv(f,t,l,a,o,m)):d[1]!==0&&(m=Mv(f,t,d,a,o,m)),a=0):a&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(d[3]=o)}for(p!==0&&goe(f,t,p,u,h),f.consume(t.events),o=-1;++o<t.events.length;){const x=t.events[o];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=Xtt(t.events,o))}return e}function Mv(e,t,o,i,a,l){const d=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";o[0]!==0&&(l.end=Object.assign({},t7(t.events,o[0])),e.add(o[0],0,[["exit",l,t]]));const p=t7(t.events,o[1]);if(l={type:d,start:Object.assign({},p),end:Object.assign({},p)},e.add(o[1],0,[["enter",l,t]]),o[2]!==0){const u=t7(t.events,o[2]),h=t7(t.events,o[3]),m={type:c,start:Object.assign({},u),end:Object.assign({},h)};if(e.add(o[2],0,[["enter",m,t]]),i!==2){const f=t.events[o[2]],x=t.events[o[3]];if(f[1].end=Object.assign({},x[1].end),f[1].type="chunkText",f[1].contentType="text",o[3]>o[2]+1){const y=o[2]+1,w=o[3]-o[2]-1;e.add(y,w,[])}}e.add(o[3]+1,0,[["exit",m,t]])}return a!==void 0&&(l.end=Object.assign({},t7(t.events,a)),e.add(a,0,[["exit",l,t]]),l=void 0),l}function goe(e,t,o,i,a){const l=[],d=t7(t.events,o);a&&(a.end=Object.assign({},d),l.push(["exit",a,t])),i.end=Object.assign({},d),l.push(["exit",i,t]),e.add(o+1,0,l)}function t7(e,t){const o=e[t],i=o[0]==="enter"?"start":"end";return o[1][i]}const rot={name:"tasklistCheck",tokenize:not};function iot(){return{text:{91:rot}}}function not(e,t,o){const i=this;return a;function a(p){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?o(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),l)}function l(p){return _i(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),d):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),d):o(p)}function d(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):o(p)}function c(p){return Fo(p)?t(p):Pr(p)?e.check({tokenize:aot},t,o)(p):o(p)}}function aot(e,t,o){return Zr(e,i,"whitespace");function i(a){return a===null?o(a):t(a)}}function sot(e){return Pxe([Btt(),_tt(),qtt(e),eot(),iot()])}const lot={};function dot(e){const t=this,o=e||lot,i=t.data(),a=i.micromarkExtensions||(i.micromarkExtensions=[]),l=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),d=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);a.push(sot(o)),l.push(Ltt()),d.push(Itt(o))}var HP,foe;function cot(){if(foe)return HP;foe=1;var e=J1(),t=function(){return e.Date.now()};return HP=t,HP}var _P,xoe;function pot(){if(xoe)return _P;xoe=1;var e=/\s/;function t(o){for(var i=o.length;i--&&e.test(o.charAt(i)););return i}return _P=t,_P}var VP,yoe;function uot(){if(yoe)return VP;yoe=1;var e=pot(),t=/^\s+/;function o(i){return i&&i.slice(0,e(i)+1).replace(t,"")}return VP=o,VP}var QP,woe;function Xw(){if(woe)return QP;woe=1;var e=H6(),t=z0(),o="[object Symbol]";function i(a){return typeof a=="symbol"||t(a)&&e(a)==o}return QP=i,QP}var UP,boe;function kye(){if(boe)return UP;boe=1;var e=uot(),t=X1(),o=Xw(),i=NaN,a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,d=/^0o[0-7]+$/i,c=parseInt;function p(u){if(typeof u=="number")return u;if(o(u))return i;if(t(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=t(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=e(u);var m=l.test(u);return m||d.test(u)?c(u.slice(2),m?2:8):a.test(u)?i:+u}return UP=p,UP}var WP,voe;function Sye(){if(voe)return WP;voe=1;var e=X1(),t=cot(),o=kye(),i="Expected a function",a=Math.max,l=Math.min;function d(c,p,u){var h,m,f,x,y,w,b=0,v=!1,A=!1,S=!0;if(typeof c!="function")throw new TypeError(i);p=o(p)||0,e(u)&&(v=!!u.leading,A="maxWait"in u,f=A?a(o(u.maxWait)||0,p):f,S="trailing"in u?!!u.trailing:S);function E(K){var Z=h,O=m;return h=m=void 0,b=K,x=c.apply(O,Z),x}function j(K){return b=K,y=setTimeout(D,p),v?E(K):x}function L(K){var Z=K-w,O=K-b,Q=p-Z;return A?l(Q,f-O):Q}function M(K){var Z=K-w,O=K-b;return w===void 0||Z>=p||Z<0||A&&O>=f}function D(){var K=t();if(M(K))return P(K);y=setTimeout(D,L(K))}function P(K){return y=void 0,S&&h?E(K):(h=m=void 0,x)}function T(){y!==void 0&&clearTimeout(y),b=0,h=w=m=y=void 0}function z(){return y===void 0?x:P(t())}function R(){var K=t(),Z=M(K);if(h=arguments,m=this,w=K,Z){if(y===void 0)return j(w);if(A)return clearTimeout(y),y=setTimeout(D,p),E(w)}return y===void 0&&(y=setTimeout(D,p)),x}return R.cancel=T,R.flush=z,R}return WP=d,WP}var hot=Sye();const U6=Mr(hot);var GP,Coe;function Eye(){if(Coe)return GP;Coe=1;function e(){}return GP=e,GP}var mot=Eye();const CL=Mr(mot);var q5={},Z5={},Aoe={},$oe={},koe;function ma(){return koe||(koe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Log=e.LogLevel=void 0;const t=" DEBUG ",o=" INFO ",i=" WARN ",a=" ERROR ";function l(c){return c.unshift("[Statsig]"),c}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class d{static info(...p){d.level>=e.LogLevel.Info&&console.info(o,...l(p))}static debug(...p){d.level>=e.LogLevel.Debug&&console.debug(t,...l(p))}static warn(...p){d.level>=e.LogLevel.Warn&&console.warn(i,...l(p))}static error(...p){d.level>=e.LogLevel.Error&&console.error(a,...l(p))}}e.Log=d,d.level=e.LogLevel.Warn}($oe)),$oe}var Soe;function d4(){return Soe||(Soe=1,function(e){var t,o,i;Object.defineProperty(e,"__esModule",{value:!0}),e._getInstance=e._getStatsigGlobalFlag=e._getStatsigGlobal=void 0;const a=ma(),l=()=>{try{return typeof __STATSIG__<"u"?__STATSIG__:f}catch{return f}};e._getStatsigGlobal=l;const d=x=>(0,e._getStatsigGlobal)()[x];e._getStatsigGlobalFlag=d;const c=x=>{const y=(0,e._getStatsigGlobal)();return x?y.instances&&y.instances[x]:(y.instances&&Object.keys(y.instances).length>1&&a.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),y.firstInstance)};e._getInstance=c;const p="__STATSIG__",u=typeof window<"u"?window:{},h=typeof td<"u"?td:{},m=typeof globalThis<"u"?globalThis:{},f=(i=(o=(t=u[p])!==null&&t!==void 0?t:h[p])!==null&&o!==void 0?o:m[p])!==null&&i!==void 0?i:{instance:e._getInstance};u[p]=f,h[p]=f,m[p]=f}(Aoe)),Aoe}var Eoe={},Loe;function K_(){return Loe||(Loe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Diagnostics=void 0;const t=new Map,o="start",i="end",a="statsig::diagnostics";e.Diagnostics={_getMarkers:u=>t.get(u),_markInitOverallStart:u=>{c(u,l({},o,"overall"))},_markInitOverallEnd:(u,h,m)=>{c(u,l({success:h,error:h?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:m},i,"overall"))},_markInitNetworkReqStart:(u,h)=>{c(u,l(h,o,"initialize","network_request"))},_markInitNetworkReqEnd:(u,h)=>{c(u,l(h,i,"initialize","network_request"))},_markInitProcessStart:u=>{c(u,l({},o,"initialize","process"))},_markInitProcessEnd:(u,h)=>{c(u,l(h,i,"initialize","process"))},_clearMarkers:u=>{t.delete(u)},_formatError(u){if(u&&typeof u=="object")return{code:p(u,"code"),name:p(u,"name"),message:p(u,"message")}},_getDiagnosticsData(u,h,m,f){var x;return{success:u?.ok===!0,statusCode:u?.status,sdkRegion:(x=u?.headers)===null||x===void 0?void 0:x.get("x-statsig-region"),isDelta:m.includes('"is_delta":true')===!0?!0:void 0,attempt:h,error:e.Diagnostics._formatError(f)}},_enqueueDiagnosticsEvent(u,h,m,f){const x=e.Diagnostics._getMarkers(m);if(x==null||x.length<=0)return-1;const y=x[x.length-1].timestamp-x[0].timestamp;e.Diagnostics._clearMarkers(m);const w=d(u,{context:"initialize",markers:x.slice(),statsigOptions:f});return h.enqueue(w),y}};function l(u,h,m,f){return Object.assign({key:m,action:h,step:f,timestamp:Date.now()},u)}function d(u,h){return{eventName:a,user:u,value:null,metadata:h,time:Date.now()}}function c(u,h){var m;const f=(m=t.get(u))!==null&&m!==void 0?m:[];f.push(h),t.set(u,f)}function p(u,h){if(h in u)return u[h]}}(Eoe)),Eoe}var Qg={},G8={},Y8={},Ioe;function got(){if(Ioe)return Y8;Ioe=1,Object.defineProperty(Y8,"__esModule",{value:!0}),Y8.EventBatch=void 0;let e=class{constructor(t){this.attempts=0,this.createdAt=Date.now(),this.events=t}incrementAttempts(){this.attempts++}};return Y8.EventBatch=e,Y8}var Bv={},joe;function LG(){return joe||(joe=1,Object.defineProperty(Bv,"__esModule",{value:!0}),Bv.EventRetryConstants=void 0,Bv.EventRetryConstants={MAX_RETRY_ATTEMPTS:8,DEFAULT_BATCH_SIZE:100,MAX_PENDING_BATCHES:40,TICK_INTERVAL_MS:1e3,QUICK_FLUSH_WINDOW_MS:200,MAX_LOCAL_STORAGE:500,get MAX_QUEUED_EVENTS(){return this.DEFAULT_BATCH_SIZE*this.MAX_PENDING_BATCHES}}),Bv}var Moe;function fot(){if(Moe)return G8;Moe=1,Object.defineProperty(G8,"__esModule",{value:!0}),G8.BatchQueue=void 0;const e=got(),t=LG();class o{constructor(a=t.EventRetryConstants.DEFAULT_BATCH_SIZE){this._batches=[],this._batchSize=a}batchSize(){return this._batchSize}requeueBatch(a){return this._enqueueBatch(a)}hasFullBatch(){return this._batches.some(a=>a.events.length>=this._batchSize)}takeNextBatch(){return this._batches.shift()}takeAllBatches(){const a=this._batches;return this._batches=[],a}createBatches(a){let l=0,d=0;for(;l<a.length;){const c=a.slice(l,l+this._batchSize);d+=this._enqueueBatch(new e.EventBatch(c)),l+=this._batchSize}return d}_enqueueBatch(a){this._batches.push(a);let l=0;for(;this._batches.length>t.EventRetryConstants.MAX_PENDING_BATCHES;){const d=this._batches.shift();d&&(l+=d.events.length)}return l}}return G8.BatchQueue=o,G8}var Ug={},Boe={},Wg={},Doe;function IG(){if(Doe)return Wg;Doe=1,Object.defineProperty(Wg,"__esModule",{value:!0}),Wg._isTypeMatch=Wg._typeOf=void 0;function e(o){return Array.isArray(o)?"array":typeof o}Wg._typeOf=e;function t(o,i){const a=l=>Array.isArray(l)?"array":l===null?"null":typeof l;return a(o)===a(i)}return Wg._isTypeMatch=t,Wg}var Poe;function G4(){return Poe||(Poe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._getSortedObject=e._DJB2Object=e._DJB2=void 0;const t=IG(),o=l=>{let d=0;for(let c=0;c<l.length;c++){const p=l.charCodeAt(c);d=(d<<5)-d+p,d=d&d}return String(d>>>0)};e._DJB2=o;const i=(l,d)=>(0,e._DJB2)(JSON.stringify((0,e._getSortedObject)(l,d)));e._DJB2Object=i;const a=(l,d)=>{if(l==null)return null;const c=Object.keys(l).sort(),p={};return c.forEach(u=>{const h=l[u];if(d===0||(0,t._typeOf)(h)!=="object"){p[u]=h;return}p[u]=(0,e._getSortedObject)(h,d!=null?d-1:d)}),p};e._getSortedObject=a}(Boe)),Boe}var Toe;function AL(){if(Toe)return Ug;Toe=1,Object.defineProperty(Ug,"__esModule",{value:!0}),Ug._getStorageKey=Ug._getUserStorageKey=void 0;const e=G4();function t(i,a,l){var d;if(l)return l(i,a);const c=a&&a.customIDs?a.customIDs:{},p=[`uid:${(d=a?.userID)!==null&&d!==void 0?d:""}`,`cids:${Object.keys(c).sort((u,h)=>u.localeCompare(h)).map(u=>`${u}-${c[u]}`).join(",")}`,`k:${i}`];return(0,e._DJB2)(p.join("|"))}Ug._getUserStorageKey=t;function o(i,a,l){return a?t(i,a,l):(0,e._DJB2)(`k:${i}`)}return Ug._getStorageKey=o,Ug}var Gg={},Yg={},zoe={},Roe;function eb(){return Roe||(Roe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkParam=e.NetworkDefault=e.Endpoint=void 0,e.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},e.NetworkDefault={[e.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[e.Endpoint._initialize]:"https://featureassets.org/v1",[e.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}}(zoe)),zoe}var K8={},Foe;function $L(){if(Foe)return K8;Foe=1,Object.defineProperty(K8,"__esModule",{value:!0}),K8.SDKType=void 0;const e={};let t;return K8.SDKType={_get:o=>{var i;return((i=e[o])!==null&&i!==void 0?i:"js-mono")+(t??"")},_setClientType(o,i){e[o]=i},_setBindingType(o){(!t||t==="-react")&&(t="-"+o)}},K8}var Ooe={},Noe;function Vy(){return Noe||(Noe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.33.0";let t={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>t,add:o=>{t=Object.assign(Object.assign({},t),o)}}}(Ooe)),Ooe}var Hoe={},_oe={},Voe;function d2(){return Voe||(Voe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._cloneObject=e._getUnloadEvent=e._getCurrentPageUrlSafe=e._addDocumentEventListenerSafe=e._addWindowEventListenerSafe=e._isServerEnv=e._getDocumentSafe=e._getWindowSafe=void 0;const t=ma(),o=()=>typeof window<"u"?window:null;e._getWindowSafe=o;const i=()=>{var h;return(h=(0,e._getWindowSafe)()?.document)!==null&&h!==void 0?h:null};e._getDocumentSafe=i;const a=()=>{if((0,e._getDocumentSafe)()!==null)return!1;const h=typeof G2<"u"&&G2.versions!=null&&G2.versions.node!=null;return typeof EdgeRuntime=="string"||h};e._isServerEnv=a;const l=(h,m)=>{const f=(0,e._getWindowSafe)();typeof f?.addEventListener=="function"&&f.addEventListener(h,m)};e._addWindowEventListenerSafe=l;const d=(h,m)=>{const f=(0,e._getDocumentSafe)();typeof f?.addEventListener=="function"&&f.addEventListener(h,m)};e._addDocumentEventListenerSafe=d;const c=()=>{var h;try{return(h=(0,e._getWindowSafe)())===null||h===void 0?void 0:h.location.href.split(/[?#]/)[0]}catch{return}};e._getCurrentPageUrlSafe=c;const p=()=>{const h=(0,e._getWindowSafe)();return h&&"onpagehide"in h?"pagehide":"beforeunload"};e._getUnloadEvent=p;const u=(h,m)=>{try{return JSON.parse(JSON.stringify(m))}catch{return t.Log.error(`Failed to clone object ${h}`),null}};e._cloneObject=u}(_oe)),_oe}var Qoe;function tb(){return Qoe||(Qoe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._notifyVisibilityChanged=e._subscribeToVisiblityChanged=e._isUnloading=e._isCurrentlyVisible=void 0;const t=d2(),o="foreground",i="background",a=[];let l=o,d=!1;const c=()=>l===o;e._isCurrentlyVisible=c;const p=()=>d;e._isUnloading=p;const u=m=>{a.unshift(m)};e._subscribeToVisiblityChanged=u;const h=m=>{m!==l&&(l=m,a.forEach(f=>f(m)))};e._notifyVisibilityChanged=h,(0,t._addWindowEventListenerSafe)("focus",()=>{d=!1,(0,e._notifyVisibilityChanged)(o)}),(0,t._addWindowEventListenerSafe)("blur",()=>(0,e._notifyVisibilityChanged)(i)),(0,t._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,e._notifyVisibilityChanged)(document.visibilityState==="visible"?o:i)}),(0,t._addWindowEventListenerSafe)((0,t._getUnloadEvent)(),()=>{d=!0,(0,e._notifyVisibilityChanged)(i)})}(Hoe)),Hoe}var Uoe;function xot(){if(Uoe)return Yg;Uoe=1;var e=Yg&&Yg.__awaiter||function(c,p,u,h){function m(f){return f instanceof u?f:new u(function(x){x(f)})}return new(u||(u=Promise))(function(f,x){function y(v){try{b(h.next(v))}catch(A){x(A)}}function w(v){try{b(h.throw(v))}catch(A){x(A)}}function b(v){v.done?f(v.value):m(v.value).then(y,w)}b((h=h.apply(c,p||[])).next())})};Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.EventSender=void 0;const t=ma(),o=eb(),i=$L(),a=Vy(),l=tb();let d=class{constructor(c,p,u,h,m){this._sdkKey=c,this._network=p,this._emitter=u,this._options=m,this._logEventUrlConfig=h}setLogEventCompressionMode(c){this._network.setLogEventCompressionMode(c)}sendBatch(c){return e(this,void 0,void 0,function*(){var p,u,h;let m="event_sender_unexpected_exception";const f={};try{const x=(0,l._isUnloading)()&&this._network.isBeaconSupported()&&((u=(p=this._options)===null||p===void 0?void 0:p.networkConfig)===null||u===void 0?void 0:u.networkOverrideFunc)==null;m="event_sender_pre_logs_flushed_emitter_exception",this._emitter({name:"pre_logs_flushed",events:c.events}),m=x?"event_sender_unexpected_exception":"event_sender_post_exception";const y=x?this._sendEventsViaBeacon(c,f):yield this._sendEventsViaPost(c,f);return y.success?(m="event_sender_logs_flushed_emitter_exception",this._emitter({name:"logs_flushed",events:c.events}),y):Object.assign(Object.assign(Object.assign({success:!1,statusCode:y.statusCode,failurePath:y.failurePath},y.failureErrorMessage?{failureErrorMessage:y.failureErrorMessage}:{}),y.failureDiagnosticBucket?{failureDiagnosticBucket:y.failureDiagnosticBucket}:{}),y.failureDiagnosticMetadata?{failureDiagnosticMetadata:y.failureDiagnosticMetadata}:{})}catch(x){return t.Log.warn("Failed to send batch:",x),Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:(h=f.path)!==null&&h!==void 0?h:m},f.errorMessage?{failureErrorMessage:f.errorMessage}:{}),f.diagnosticBucket?{failureDiagnosticBucket:f.diagnosticBucket}:{}),f.diagnosticMetadata?{failureDiagnosticMetadata:f.diagnosticMetadata}:{})}})}_sendEventsViaPost(c,p){return e(this,void 0,void 0,function*(){var u,h;const m=yield this._network.post(this._getRequestData(c),p),f=(u=m?.code)!==null&&u!==void 0?u:-1;return f===-1?Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:(h=p.path)!==null&&h!==void 0?h:m===void 0?"event_sender_post_returned_undefined":"event_sender_post_returned_null"},p.errorMessage?{failureErrorMessage:p.errorMessage}:{}),p.diagnosticBucket?{failureDiagnosticBucket:p.diagnosticBucket}:{}),p.diagnosticMetadata?{failureDiagnosticMetadata:p.diagnosticMetadata}:{}):{success:f>=200&&f<300,statusCode:f}})}_sendEventsViaBeacon(c,p){var u;const h=this._network.beacon(this._getRequestData(c),p);return Object.assign(Object.assign(Object.assign({success:h,statusCode:h?200:-1,failurePath:h?void 0:(u=p.path)!==null&&u!==void 0?u:"beacon_send_false"},!h&&p.errorMessage?{failureErrorMessage:p.errorMessage}:{}),!h&&p.diagnosticBucket?{failureDiagnosticBucket:p.diagnosticBucket}:{}),!h&&p.diagnosticMetadata?{failureDiagnosticMetadata:p.diagnosticMetadata}:{})}_getRequestData(c){return{sdkKey:this._sdkKey,data:{events:c.events},urlConfig:this._logEventUrlConfig,retries:3,preserveFailedStatusCode:!0,isCompressable:!0,params:{[o.NetworkParam.EventCount]:String(c.events.length)},headers:{"statsig-event-count":String(c.events.length),"statsig-retry-count":String(c.attempts),"statsig-sdk-type":i.SDKType._get(this._sdkKey),"statsig-sdk-version":a.SDK_VERSION},credentials:"same-origin"}}};return Yg.EventSender=d,Yg}var q8={},Woe;function yot(){if(Woe)return q8;Woe=1,Object.defineProperty(q8,"__esModule",{value:!0}),q8.FlushInterval=void 0;const e=1e3,t=6e4;let o=class{constructor(){this._currentIntervalMs=e,this._lastFlushAttemptTime=Date.now()}getCurrentIntervalMs(){return this._currentIntervalMs}markFlushAttempt(){this._lastFlushAttemptTime=Date.now()}getTimeSinceLastAttempt(){return Date.now()-this._lastFlushAttemptTime}hasReachedMaxInterval(){return this.getTimeSinceLastAttempt()>=t}getTimeTillMaxInterval(){return t-this.getTimeSinceLastAttempt()}hasCompletelyRecoveredFromBackoff(){return this._currentIntervalMs<=e}adjustForSuccess(){const i=this._currentIntervalMs;i!==e&&(this._currentIntervalMs=Math.max(e,Math.floor(i/2)))}adjustForFailure(){const i=this._currentIntervalMs;this._currentIntervalMs=Math.min(t,i*2)}getTimeUntilNextFlush(){return this.getCurrentIntervalMs()-this.getTimeSinceLastAttempt()}};return q8.FlushInterval=o,q8}var Z8={},Goe;function wot(){if(Goe)return Z8;Goe=1,Object.defineProperty(Z8,"__esModule",{value:!0}),Z8.FlushType=void 0;var e;return function(t){t.ScheduledMaxTime="scheduled:max_time",t.ScheduledFullBatch="scheduled:full_batch",t.Limit="limit",t.Manual="manual",t.Shutdown="shutdown"}(e||(Z8.FlushType=e={})),Z8}var Dv={},I2={},Kg={},Yoe;function bot(){if(Yoe)return Kg;Yoe=1;var e=Kg&&Kg.__awaiter||function(c,p,u,h){function m(f){return f instanceof u?f:new u(function(x){x(f)})}return new(u||(u=Promise))(function(f,x){function y(v){try{b(h.next(v))}catch(A){x(A)}}function w(v){try{b(h.throw(v))}catch(A){x(A)}}function b(v){v.done?f(v.value):m(v.value).then(y,w)}b((h=h.apply(c,p||[])).next())})};Object.defineProperty(Kg,"__esModule",{value:!0}),Kg._fetchTxtRecords=void 0;const t=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),o="https://cloudflare-dns.com/dns-query",i=["i","e","d"],a=200;function l(c){return e(this,void 0,void 0,function*(){const p=yield c(o,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:t});if(!p.ok){const m=new Error("Failed to fetch TXT records from DNS");throw m.name="DnsTxtFetchError",m}const u=yield p.arrayBuffer(),h=new Uint8Array(u);return d(h)})}Kg._fetchTxtRecords=l;function d(c){const p=c.findIndex((h,m)=>m<a&&String.fromCharCode(h)==="="&&i.includes(String.fromCharCode(c[m-1])));if(p===-1){const h=new Error("Failed to parse TXT records from DNS");throw h.name="DnsTxtParseError",h}let u="";for(let h=p-1;h<c.length;h++)u+=String.fromCharCode(c[h]);return u.split(",")}return Kg}var Koe={},qoe;function E0(){return qoe||(qoe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._setObjectInStorage=e._getObjectFromStorage=e.Storage=void 0;const t=ma(),o=d2(),i={},a={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:m=>i[m]?i[m]:null,setItem:(m,f)=>{i[m]=f},removeItem:m=>{delete i[m]},getAllKeys:()=>Object.keys(i)};let l=null;try{const m=(0,o._getWindowSafe)();m&&m.localStorage&&typeof m.localStorage.getItem=="function"&&(l={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:f=>m.localStorage.getItem(f),setItem:(f,x)=>m.localStorage.setItem(f,x),removeItem:f=>m.localStorage.removeItem(f),getAllKeys:()=>Object.keys(m.localStorage)})}catch{t.Log.warn("Failed to setup localStorageProvider.")}let d=l??a,c=d;function p(m){try{return m()}catch(f){if(f instanceof Error&&f.name==="SecurityError")return e.Storage._setProvider(a),null;throw f}}e.Storage={isReady:()=>c.isReady(),isReadyResolver:()=>c.isReadyResolver(),getProviderName:()=>c.getProviderName(),getItem:m=>p(()=>c.getItem(m)),setItem:(m,f)=>p(()=>c.setItem(m,f)),removeItem:m=>c.removeItem(m),getAllKeys:()=>c.getAllKeys(),_setProvider:m=>{d=m,c=m},_setDisabled:m=>{m?c=a:c=d}};function u(m){const f=e.Storage.getItem(m);try{return JSON.parse(f??"null")}catch{return t.Log.error(`Failed to parse value for key "${m}"`),null}}e._getObjectFromStorage=u;function h(m,f){e.Storage.setItem(m,JSON.stringify(f))}e._setObjectInStorage=h}(Koe)),Koe}var Zoe;function vot(){if(Zoe)return I2;Zoe=1;var e=I2&&I2.__awaiter||function(x,y,w,b){function v(A){return A instanceof w?A:new w(function(S){S(A)})}return new(w||(w=Promise))(function(A,S){function E(M){try{L(b.next(M))}catch(D){S(D)}}function j(M){try{L(b.throw(M))}catch(D){S(D)}}function L(M){M.done?A(M.value):v(M.value).then(E,j)}L((b=b.apply(x,y||[])).next())})};Object.defineProperty(I2,"__esModule",{value:!0}),I2._isDomainFailure=I2.NetworkFallbackResolver=void 0;const t=bot(),o=G4(),i=ma(),a=E0(),l=10080*60*1e3,d=14400*1e3;let c=class{constructor(x){var y;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=(y=x.networkConfig)===null||y===void 0?void 0:y.networkOverrideFunc}setErrorBoundary(x){this._errorBoundary=x}tryBumpExpiryTime(x,y){var w;const b=(w=this._fallbackInfo)===null||w===void 0?void 0:w[y.endpoint];b&&(b.expiryTime=Date.now()+l,h(x,Object.assign(Object.assign({},this._fallbackInfo),{[y.endpoint]:b})))}getActiveFallbackUrl(x,y){var w,b;if(y.customUrl!=null&&y.fallbackUrls!=null)return null;let v=this._fallbackInfo;v==null&&(v=(w=m(x))!==null&&w!==void 0?w:{},this._fallbackInfo=v);const A=v[y.endpoint];return!A||Date.now()>((b=A.expiryTime)!==null&&b!==void 0?b:0)||y.getChecksum()!==A.urlConfigChecksum?(delete v[y.endpoint],this._fallbackInfo=v,h(x,this._fallbackInfo),null):A.url?A.url:null}tryFetchUpdatedFallbackInfo(x,y,w,b){return e(this,void 0,void 0,function*(){var v,A;try{if(!p(w,b))return!1;const S=y.customUrl==null&&y.fallbackUrls==null?yield this._tryFetchFallbackUrlsFromNetwork(y):y.fallbackUrls,E=this._pickNewFallbackUrl((v=this._fallbackInfo)===null||v===void 0?void 0:v[y.endpoint],S);return E?(this._updateFallbackInfoWithNewUrl(x,y,E),!0):!1}catch(S){return(A=this._errorBoundary)===null||A===void 0||A.logError("tryFetchUpdatedFallbackInfo",S),!1}})}_updateFallbackInfoWithNewUrl(x,y,w){var b,v,A;const S={urlConfigChecksum:y.getChecksum(),url:w,expiryTime:Date.now()+l,previous:[]},E=y.endpoint,j=(b=this._fallbackInfo)===null||b===void 0?void 0:b[E];j&&S.previous.push(...j.previous),S.previous.length>10&&(S.previous=[]);const L=(A=(v=this._fallbackInfo)===null||v===void 0?void 0:v[E])===null||A===void 0?void 0:A.url;L!=null&&S.previous.push(L),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[E]:S}),h(x,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(x){return e(this,void 0,void 0,function*(){var y;const w=this._dnsQueryCooldowns[x.endpoint];if(w&&Date.now()<w)return null;this._dnsQueryCooldowns[x.endpoint]=Date.now()+d;const b=[],v=yield(0,t._fetchTxtRecords)((y=this._networkOverrideFunc)!==null&&y!==void 0?y:fetch),A=f(x.defaultUrl);for(const S of v){if(!S.startsWith(x.endpointDnsKey+"="))continue;const E=S.split("=");if(E.length>1){let j=E[1];j.endsWith("/")&&(j=j.slice(0,-1)),b.push(`https://${j}${A}`)}}return b})}_pickNewFallbackUrl(x,y){var w;if(y==null)return null;const b=new Set((w=x?.previous)!==null&&w!==void 0?w:[]),v=x?.url;let A=null;for(const S of y){const E=S.endsWith("/")?S.slice(0,-1):S;if(!b.has(S)&&E!==v){A=E;break}}return A}};I2.NetworkFallbackResolver=c;function p(x,y){var w;const b=(w=x?.toLowerCase())!==null&&w!==void 0?w:"";return y||b.includes("uncaught exception")||b.includes("failed to fetch")||b.includes("networkerror when attempting to fetch resource")}I2._isDomainFailure=p;function u(x){return`statsig.network_fallback.${(0,o._DJB2)(x)}`}function h(x,y){const w=u(x);if(!y||Object.keys(y).length===0){a.Storage.removeItem(w);return}a.Storage.setItem(w,JSON.stringify(y))}function m(x){const y=u(x),w=a.Storage.getItem(y);if(!w)return null;try{return JSON.parse(w)}catch{return i.Log.error("Failed to parse FallbackInfo"),null}}function f(x){try{return new URL(x).pathname}catch{return null}}return I2}var J8={},Joe;function Lye(){if(Joe)return J8;Joe=1,Object.defineProperty(J8,"__esModule",{value:!0}),J8.SDKFlags=void 0;const e={};return J8.SDKFlags={setFlags:(t,o)=>{e[t]=o},get:(t,o)=>{var i,a;return(a=(i=e[t])===null||i===void 0?void 0:i[o])!==null&&a!==void 0?a:!1}},J8}var Xoe={},X8={},ere;function jG(){if(ere)return X8;ere=1,Object.defineProperty(X8,"__esModule",{value:!0}),X8.getUUID=void 0;function e(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();let t=new Date().getTime(),o=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,i=>{let a=Math.random()*16;return t>0?(a=(t+a)%16|0,t=Math.floor(t/16)):(a=(o+a)%16|0,o=Math.floor(o/16)),(i==="x"?a:a&7|8).toString(16)})}return X8.getUUID=e,X8}var tre;function ob(){return tre||(tre=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigSession=e.SessionID=void 0;const t=AL(),o=ma(),i=E0(),a=jG(),l=tb(),d=1800*1e3,c=14400*1e3,p=15e3,u={};(0,l._subscribeToVisiblityChanged)(E=>{E==="background"&&Object.values(u).forEach(j=>w(j))}),e.SessionID={get:E=>e.StatsigSession.get(E).data.sessionID},e.StatsigSession={get:(E,j=!0)=>{u[E]==null&&(u[E]=A(E));const L=u[E];return h(L,j)},overrideInitialSessionID:(E,j)=>{const L=Date.now(),M={data:{sessionID:E,startTime:L,lastUpdate:L},sdkKey:j,lastPersistedAt:Date.now(),storageKey:y(j)};w(M),u[j]=M},checkForIdleSession:E=>{const j=u[E];j&&m(j)&&w(j)}};function h(E,j){const L=Date.now();return m(E)?w(E):j&&(E.data.lastUpdate=L,b(E)),E}function m(E){var j;const L=E.data,M=f(L)||x(L);return M&&(E.data=S(),(j=__STATSIG__==null?void 0:__STATSIG__.instance(E.sdkKey))===null||j===void 0||j.$emt({name:"session_expired"})),M}function f({lastUpdate:E}){return Date.now()-E>d}function x({startTime:E}){return Date.now()-E>c}function y(E){return`statsig.session_id.${(0,t._getStorageKey)(E)}`}function w(E){try{(0,i._setObjectInStorage)(E.storageKey,E.data),E.lastPersistedAt=Date.now()}catch{o.Log.warn("Failed to save SessionID")}}function b(E){Date.now()-E.lastPersistedAt>p&&w(E)}function v(E){return(0,i._getObjectFromStorage)(E)}function A(E){const j=y(E),L=v(j);return L&&L.sessionID&&L.startTime&&L.lastUpdate?{data:L,sdkKey:E,lastPersistedAt:0,storageKey:j}:{data:S(),sdkKey:E,lastPersistedAt:0,storageKey:j}}function S(){return{sessionID:(0,a.getUUID)(),startTime:Date.now(),lastUpdate:Date.now()}}}(Xoe)),Xoe}var qg={},ore;function rb(){if(ore)return qg;ore=1,Object.defineProperty(qg,"__esModule",{value:!0}),qg.getCookieName=qg.StableID=void 0;const e=AL(),t=ma(),o=d2(),i=E0(),a=jG(),l={},d={},c={};qg.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:y=>{if(c[y])return null;if(l[y]!=null)return l[y];let w=null;return w=m(y),w!=null?(l[y]=w,u(w,y),w):(w=h(y),w==null&&(w=(0,a.getUUID)()),u(w,y),f(w,y),l[y]=w,w)},setOverride:(y,w)=>{l[w]=y,u(y,w),f(y,w)},_setCookiesEnabled:(y,w)=>{d[y]=w},_setDisabled:(y,w)=>{c[y]=w}};function p(y){return`statsig.stable_id.${(0,e._getStorageKey)(y)}`}function u(y,w){const b=p(w);try{(0,i._setObjectInStorage)(b,y)}catch{t.Log.warn("Failed to save StableID to storage")}}function h(y){const w=p(y);return(0,i._getObjectFromStorage)(w)}function m(y){if(!d[y]||(0,o._getDocumentSafe)()==null)return null;const w=document.cookie.split(";");for(const b of w){const[v,A]=b.trim().split("=");if(v===x(y))return decodeURIComponent(A)}return null}function f(y,w){if(!d[w]||(0,o._getDocumentSafe)()==null)return;const b=new Date;b.setFullYear(b.getFullYear()+1),document.cookie=`${x(w)}=${encodeURIComponent(y)}; expires=${b.toUTCString()}; path=/`}function x(y){return`statsig.stable_id.${(0,e._getStorageKey)(y)}`}return qg.getCookieName=x,qg}var Pv={},rre;function Iye(){return rre||(rre=1,Object.defineProperty(Pv,"__esModule",{value:!0}),Pv.ErrorTag=void 0,Pv.ErrorTag={NetworkError:"NetworkError"}),Pv}var J5={},ire;function ib(){return ire||(ire=1,Object.defineProperty(J5,"__esModule",{value:!0}),J5.LoggingEnabledOption=J5.LogEventCompressionMode=void 0,J5.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},J5.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}),J5}var nre;function jye(){return nre||(nre=1,function(e){var t=Dv&&Dv.__awaiter||function(N,H,ee,Y){function G(J){return J instanceof ee?J:new ee(function(X){X(J)})}return new(ee||(ee=Promise))(function(J,X){function ie(de){try{me(Y.next(de))}catch(ce){X(ce)}}function we(de){try{me(Y.throw(de))}catch(ce){X(ce)}}function me(de){de.done?J(de.value):G(de.value).then(ie,we)}me((Y=Y.apply(N,H||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkCore=e.RETRYABLE_CODES=void 0,d4();const o=d4(),i=K_(),a=ma(),l=eb(),d=vot(),c=Lye(),p=$L(),u=d2(),h=ob(),m=rb(),f=Iye(),x=Vy(),y=ib(),w=tb(),b=1e4,v=500,A=3e4,S=1e3,E=50,j=E/S;e.RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);let L=class{constructor(N,H){this._emitter=H,this._errorBoundary=null,this._timeout=b,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,N&&(this._options=N),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new d.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(N))}setLogEventCompressionMode(N){this._options.logEventCompressionMode=N}setErrorBoundary(N){this._errorBoundary=N,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(N)}isBeaconSupported(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}getLastUsedInitUrlAndReset(){const N=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,N}beacon(N,H){if(!M(N))return H&&(H.path="beacon_invalid_sdk_key"),!1;const ee=this._getInternalRequestArgs("POST",N),Y=this._getPopulatedURL(ee),G=navigator;try{const J=G.sendBeacon.bind(G)(Y,ee.body);return J||H&&(H.path="beacon_send_false"),J}catch(J){throw H&&(H.path="beacon_send_exception"),J}}post(N,H){return t(this,void 0,void 0,function*(){const ee=this._getInternalRequestArgs("POST",N);return this._tryEncodeBody(ee),yield this._tryToCompressBody(ee),this._sendRequest(ee,H)})}get(N){const H=this._getInternalRequestArgs("GET",N);return this._sendRequest(H)}_sendRequest(N,H){return t(this,void 0,void 0,function*(){var ee,Y,G,J;if(!M(N))return H&&(H.path="network_invalid_sdk_key"),null;if(this._netConfig.preventAllNetworkTraffic)return H&&(H.path="network_prevent_all_network_traffic"),null;const{method:X,body:ie,retries:we,attempt:me}=N,de=N.urlConfig.endpoint;if(this._isRateLimited(de))return a.Log.warn(`Request to ${de} was blocked because you are making requests too frequently.`),H&&(H.path="network_rate_limited"),null;const ce=me??1;let fe=!1;const Ae=this._getPopulatedURL(N),le=Date.now();let pe=null;const ae=(0,w._isUnloading)();try{const be={method:X,body:ie,headers:Object.assign({},N.headers),priority:N.priority,keepalive:ae};Q(N,ce);const ue=this._leakyBucket[de];ue&&(ue.lastRequestTime=Date.now(),this._leakyBucket[de]=ue);const se=(ee=this._netConfig.networkOverrideFunc)!==null&&ee!==void 0?ee:fetch;let ge;if(pe=yield Promise.race([se(Ae,be).finally(()=>clearTimeout(ge)),new Promise(($e,Ve)=>{ge=setTimeout(()=>{fe=!0,Ve(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!pe.ok){const $e=yield pe.text().catch(()=>"No Text"),Ve=new Error(`NetworkError: ${Ae} ${$e}`);throw Ve.name="NetworkError",Ve}const Ee=yield pe.text();return _(N,pe,ce,Ee),this._fallbackResolver.tryBumpExpiryTime(N.sdkKey,N.urlConfig),{body:Ee,code:pe.status}}catch(be){const ue=T(be),se=z(ue??"",fe);if(_(N,pe,ce,"",be),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(N.sdkKey,N.urlConfig,ue,se))&&(N.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(N.sdkKey,N.urlConfig)),!we||ce>we||!e.RETRYABLE_CODES.has((Y=pe?.status)!==null&&Y!==void 0?Y:500)){(G=this._emitter)===null||G===void 0||G.call(this,{name:"error",error:be,tag:f.ErrorTag.NetworkError,requestArgs:N});const ge=`A networking error occurred during ${X} request to ${Ae}.`;if(a.Log.error(ge,ue,be),(J=this._errorBoundary)===null||J===void 0||J.attachErrorIfNoneExists(ge),N.preserveFailedStatusCode&&pe!=null)return{body:null,code:pe.status};if(pe==null&&H){H.path=se?"network_request_timed_out_no_response":"network_request_exception_no_response",ue&&(H.errorMessage=ue);try{const Ee=R(N,Ae,se,Date.now()-le);H.diagnosticBucket=Ee.bucket,H.diagnosticMetadata=Ee.metadata}catch{}}return null}return yield F(ce),this._sendRequest(Object.assign(Object.assign({},N),{retries:we,attempt:ce+1}),H)}})}_getLogEventCompressionMode(N){let H=N?.logEventCompressionMode;return!H&&N?.disableCompression===!0&&(H=y.LogEventCompressionMode.Disabled),H||(H=y.LogEventCompressionMode.Enabled),H}_isRateLimited(N){var H;const ee=Date.now(),Y=(H=this._leakyBucket[N])!==null&&H!==void 0?H:{count:0,lastRequestTime:ee},G=ee-Y.lastRequestTime,J=Math.floor(G*j);return Y.count=Math.max(0,Y.count-J),Y.count>=E?!0:(Y.count+=1,Y.lastRequestTime=ee,this._leakyBucket[N]=Y,!1)}_getPopulatedURL(N){var H;const ee=(H=N.fallbackUrl)!==null&&H!==void 0?H:N.urlConfig.getUrl();(N.urlConfig.endpoint===l.Endpoint._initialize||N.urlConfig.endpoint===l.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=ee);const Y=Object.assign({[l.NetworkParam.SdkKey]:N.sdkKey,[l.NetworkParam.SdkType]:p.SDKType._get(N.sdkKey),[l.NetworkParam.SdkVersion]:x.SDK_VERSION,[l.NetworkParam.Time]:String(Date.now()),[l.NetworkParam.SessionID]:h.SessionID.get(N.sdkKey)},N.params),G=Object.keys(Y).map(J=>`${encodeURIComponent(J)}=${encodeURIComponent(Y[J])}`).join("&");return`${ee}${G?`?${G}`:""}`}_tryEncodeBody(N){var H;const ee=(0,u._getWindowSafe)(),Y=N.body;if(!(!N.isStatsigEncodable||this._options.disableStatsigEncoding||typeof Y!="string"||(0,o._getStatsigGlobalFlag)("no-encode")!=null||!ee?.btoa))try{N.body=ee.btoa(Y).split("").reverse().join(""),N.params=Object.assign(Object.assign({},(H=N.params)!==null&&H!==void 0?H:{}),{[l.NetworkParam.StatsigEncoded]:"1"})}catch(G){a.Log.warn(`Request encoding failed for ${N.urlConfig.getUrl()}`,G)}}_tryToCompressBody(N){return t(this,void 0,void 0,function*(){var H;const ee=N.body;if(!(typeof ee!="string"||!P(N,this._options)))try{const Y=new TextEncoder().encode(ee),G=new CompressionStream("gzip"),J=G.writable.getWriter();J.write(Y).catch(a.Log.error),J.close().catch(a.Log.error);const X=G.readable.getReader(),ie=[];let we;for(;!(we=yield X.read()).done;)ie.push(we.value);const me=ie.reduce((fe,Ae)=>fe+Ae.length,0),de=new Uint8Array(me);let ce=0;for(const fe of ie)de.set(fe,ce),ce+=fe.length;N.body=de,N.params=Object.assign(Object.assign({},(H=N.params)!==null&&H!==void 0?H:{}),{[l.NetworkParam.IsGzipped]:"1"})}catch(Y){a.Log.warn(`Request compression failed for ${N.urlConfig.getUrl()}`,Y)}})}_getInternalRequestArgs(N,H){const ee=this._fallbackResolver.getActiveFallbackUrl(H.sdkKey,H.urlConfig),Y=Object.assign(Object.assign({},H),{method:N,fallbackUrl:ee});return"data"in H&&D(Y,H.data),Y}};e.NetworkCore=L;const M=N=>N.sdkKey?!0:(a.Log.warn("Unable to make request without an SDK key"),!1),D=(N,H)=>{const{sdkKey:ee,fallbackUrl:Y}=N,G=m.StableID.get(ee),J=h.SessionID.get(ee),X=p.SDKType._get(ee);N.body=JSON.stringify(Object.assign(Object.assign({},H),{statsigMetadata:Object.assign(Object.assign({},x.StatsigMetadataProvider.get()),{stableID:G,sessionID:J,sdkType:X,fallbackUrl:Y})}))};function P(N,H){if(!N.isCompressable||(0,o._getStatsigGlobalFlag)("no-compress")!=null||typeof CompressionStream>"u"||typeof TextEncoder>"u")return!1;const ee=N.urlConfig.customUrl!=null||N.urlConfig.fallbackUrls!=null,Y=c.SDKFlags.get(N.sdkKey,"enable_log_event_compression")===!0;switch(H.logEventCompressionMode){case y.LogEventCompressionMode.Disabled:return!1;case y.LogEventCompressionMode.Enabled:return!(ee&&!Y);case y.LogEventCompressionMode.Forced:return!0;default:return!1}}function T(N){return typeof N=="string"?N:N instanceof Error?`${N.name}: ${N.message}`:"Unknown Error"}function z(N,H){return N.includes("Timeout")||H}function R(N,H,ee,Y){var G,J,X;const ie=(0,u._getWindowSafe)(),we=ie?.document,me=typeof navigator<"u"?navigator:null,de=(0,w._isUnloading)(),ce=me&&typeof me.onLine=="boolean"?String(me.onLine):"unknown",fe=(G=we?.visibilityState)!==null&&G!==void 0?G:"unknown",Ae=Object.keys((J=N.headers)!==null&&J!==void 0?J:{}).length>0,le=K(H,(X=ie?.location)===null||X===void 0?void 0:X.origin),pe=N.urlConfig.customUrl!=null,ae=N.fallbackUrl!=null,be=O(Y,[250,1e3,5e3,1e4]),ue=O(Z(N.body),[16384,65536,262144,1048576]);let se="unknown_no_response";return ee?se="timeout":ce==="false"?se="browser_offline":de?se="page_unloading":fe==="hidden"?se="page_hidden":le&&Ae?se="cross_origin_custom_headers_preflight_risk":pe||ae?se="custom_url_no_response":Y<250&&(se="immediate_network_rejection"),{bucket:se,metadata:{elapsedMsBucket:be,bodySizeBucket:ue,online:ce,visibilityState:fe,isUnloading:String(de),crossOrigin:String(le),hasCustomUrl:String(pe)}}}function K(N,H){return H?!N.startsWith(`${H}/`)&&!N.startsWith(`${H}?`)&&N!==H:!0}function Z(N){return N==null?0:typeof N=="string"?N.length:N instanceof Uint8Array?N.byteLength:typeof Blob<"u"&&N instanceof Blob?N.size:-1}function O(N,H){if(N<0)return"unknown";for(const ee of H)if(N<ee)return`<${ee}`;return`>=${H[H.length-1]}`}function Q(N,H){N.urlConfig.endpoint===l.Endpoint._initialize&&i.Diagnostics._markInitNetworkReqStart(N.sdkKey,{attempt:H})}function _(N,H,ee,Y,G){N.urlConfig.endpoint===l.Endpoint._initialize&&i.Diagnostics._markInitNetworkReqEnd(N.sdkKey,i.Diagnostics._getDiagnosticsData(H,ee,Y,G))}function F(N){return t(this,void 0,void 0,function*(){yield new Promise(H=>setTimeout(H,Math.min(v*(N*N),A)))})}}(Dv)),Dv}var are;function Cot(){if(are)return Gg;are=1;var e=Gg&&Gg.__awaiter||function(y,w,b,v){function A(S){return S instanceof b?S:new b(function(E){E(S)})}return new(b||(b=Promise))(function(S,E){function j(D){try{M(v.next(D))}catch(P){E(P)}}function L(D){try{M(v.throw(D))}catch(P){E(P)}}function M(D){D.done?S(D.value):A(D.value).then(j,L)}M((v=v.apply(y,w||[])).next())})};Object.defineProperty(Gg,"__esModule",{value:!0}),Gg.FlushCoordinator=void 0;const t=LG(),o=xot(),i=yot(),a=wot(),l=G4(),d=ma(),c=jye(),p=d2(),u=ob(),h=ib(),m=E0(),f=new Set(["network_request_timed_out_no_response","network_request_exception_no_response","event_sender_post_returned_null","event_sender_post_returned_undefined","event_sender_post_exception"]);let x=class{constructor(y,w,b,v,A,S,E,j,L,M){this._cooldownTimer=null,this._maxIntervalTimer=null,this._hasRunQuickFlush=!1,this._currentFlushPromise=null,this._creationTime=Date.now(),this._isShuttingDown=!1,this._storageKey=null,this._flushInterval=new i.FlushInterval,this._batchQueue=y,this._pendingEvents=w,this._onPrepareFlush=b,this._errorBoundary=M,this._sdkKey=v,this._loggingEnabled=L,this._eventSender=new o.EventSender(v,A,S,E,j)}setLoggingEnabled(y){this._loggingEnabled=y}setLogEventCompressionMode(y){this._eventSender.setLogEventCompressionMode(y)}startScheduledFlushCycle(){this._scheduleNextFlush()}stopScheduledFlushCycle(){this._clearAllTimers()}addEvent(y){this._pendingEvents.addToPendingEventsQueue(y),!this._currentFlushPromise&&this._pendingEvents.hasEventsForFullBatch()&&this.processLimitFlush()}processManualFlush(){return e(this,void 0,void 0,function*(){return this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(a.FlushType.Manual).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()}),this._currentFlushPromise})}processShutdown(){return e(this,void 0,void 0,function*(){return this._isShuttingDown=!0,this._clearAllTimers(),this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(a.FlushType.Shutdown).catch(y=>{d.Log.error(`Error during shutdown flush: ${y}`)}).finally(()=>{this._currentFlushPromise=null}),this._currentFlushPromise})}_executeFlush(y){return e(this,void 0,void 0,function*(){this._clearAllTimers();try{this._prepareQueueForFlush(y);const w=this._batchQueue.takeAllBatches();if(w.length===0)return;yield Promise.all(w.map(b=>this._processOneBatch(b,y)))}finally{this._isShuttingDown||this._scheduleNextFlush()}})}checkQuickFlush(){this._hasRunQuickFlush||Date.now()-this._creationTime>t.EventRetryConstants.QUICK_FLUSH_WINDOW_MS||(this._hasRunQuickFlush=!0,setTimeout(()=>{this.processManualFlush().catch(y=>{d.Log.warn("Quick flush failed:",y)})},t.EventRetryConstants.QUICK_FLUSH_WINDOW_MS))}_attemptScheduledFlush(){if(this._currentFlushPromise){this._scheduleNextFlush();return}const y=this.containsAtLeastOneFullBatch(),w=this._flushInterval.hasReachedMaxInterval();if(!y&&!w){this._scheduleNoopPollTick();return}this._flushInterval.markFlushAttempt();let b;y?b=a.FlushType.ScheduledFullBatch:b=a.FlushType.ScheduledMaxTime,this._currentFlushPromise=this._processNextBatch(b).then(()=>{}).catch(v=>{d.Log.error("Error during scheduled flush:",v)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})}processLimitFlush(){this._flushInterval.hasCompletelyRecoveredFromBackoff()&&(this._currentFlushPromise||(this._currentFlushPromise=this._processLimitFlushInternal().catch(y=>{d.Log.error("Error during limit flush",y)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})))}_processLimitFlushInternal(){return e(this,void 0,void 0,function*(){if(yield this._processNextBatch(a.FlushType.Limit))for(;this._flushInterval.hasCompletelyRecoveredFromBackoff()&&this.containsAtLeastOneFullBatch()&&(yield this._processNextBatch(a.FlushType.Limit)););})}_scheduleNextFlush(){if(this._clearAllTimers(),this._isShuttingDown)return;const y=Math.max(0,this._flushInterval.getTimeUntilNextFlush());this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,u.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},y);const w=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,u.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},w)}_clearAllTimers(){this._cooldownTimer!==null&&(clearTimeout(this._cooldownTimer),this._cooldownTimer=null),this._maxIntervalTimer!==null&&(clearTimeout(this._maxIntervalTimer),this._maxIntervalTimer=null)}_scheduleNoopPollTick(){if(this._clearAllTimers(),this._isShuttingDown)return;this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,u.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},t.EventRetryConstants.TICK_INTERVAL_MS);const y=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,u.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},y)}_processNextBatch(y){return e(this,void 0,void 0,function*(){this._prepareQueueForFlush(y);const w=this._batchQueue.takeNextBatch();return w?this._processOneBatch(w,y):!1})}_processOneBatch(y,w){return e(this,void 0,void 0,function*(){if(this._loggingEnabled!==h.LoggingEnabledOption.always&&(0,p._isServerEnv)())return this._flushInterval.adjustForSuccess(),!0;const b=yield this._eventSender.sendBatch(y);return b.success?(this._flushInterval.adjustForSuccess(),!0):(this._flushInterval.adjustForFailure(),this._handleFailure(y,w,b.statusCode,b.failurePath,b.failureErrorMessage,b.failureDiagnosticBucket,b.failureDiagnosticMetadata),!1)})}_prepareQueueForFlush(y){this._onPrepareFlush();const w=this.convertPendingEventsToBatches();w>0&&(d.Log.warn(`Dropped ${w} events`),this._errorBoundary.logDroppedEvents(w,"Batch queue limit reached during batching",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:t.EventRetryConstants.MAX_PENDING_BATCHES,flushType:y,retries:"dropped before batching"}))}containsAtLeastOneFullBatch(){return this._pendingEvents.hasEventsForFullBatch()||this._batchQueue.hasFullBatch()}convertPendingEventsToBatches(){if(this._pendingEvents.isEmpty())return 0;const y=this._pendingEvents.takeAll();return this._batchQueue.createBatches(y)}_isRetryableBatch(y,w){return!!(c.RETRYABLE_CODES.has(y)||y===-1&&w&&f.has(w))}_handleFailure(y,w,b,v,A,S,E){if(w===a.FlushType.Shutdown){d.Log.warn(`${w} flush failed during shutdown. ${y.events.length} event(s) will be saved to storage for retry in next session.`),this._saveShutdownFailedEventsToStorage(y.events);return}if(!this._isRetryableBatch(b,v)){d.Log.warn(`${w} flush failed after ${y.attempts} attempt(s). ${y.events.length} event(s) will be dropped. Non-retryable error: ${b}`),this._errorBoundary.logEventRequestFailure(y.events.length,"non-retryable error",w,b,y.attempts,v,A,S,E);return}if(y.attempts>=t.EventRetryConstants.MAX_RETRY_ATTEMPTS){d.Log.warn(`${w} flush failed after ${y.attempts} attempt(s). ${y.events.length} event(s) will be dropped.`),this._errorBoundary.logEventRequestFailure(y.events.length,"max retry attempts exceeded",w,b,y.attempts,v,A,S,E);return}y.incrementAttempts();const j=this._batchQueue.requeueBatch(y);j>0&&(d.Log.warn(`Failed to requeue batch : dropped ${j} events due to full queue`),this._errorBoundary.logDroppedEvents(j,"Batch queue limit reached during requeue",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:t.EventRetryConstants.MAX_PENDING_BATCHES,flushType:w,retries:y.attempts}))}loadAndRetryShutdownFailedEvents(){return e(this,void 0,void 0,function*(){const y=this._getStorageKey();try{m.Storage.isReady()||(yield m.Storage.isReadyResolver());const w=this._getShutdownFailedEventsFromStorage(y);if(w.length===0)return;d.Log.debug(`Loading ${w.length} failed shutdown event(s) from storage for retry`),m.Storage.removeItem(y),w.forEach(b=>{this.addEvent(b)}),yield this.processManualFlush()}catch(w){d.Log.warn("Failed to load and retry failed shutdown events:",w)}})}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.failed_shutdown_events.${(0,l._DJB2)(this._sdkKey)}`),this._storageKey}_saveShutdownFailedEventsToStorage(y){const w=this._getStorageKey();try{let b=[...this._getShutdownFailedEventsFromStorage(w),...y];b.length>t.EventRetryConstants.MAX_LOCAL_STORAGE&&(b=b.slice(-t.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,m._setObjectInStorage)(w,b),d.Log.debug(`Saved ${y.length} failed shutdown event(s) to storage (total stored: ${b.length})`)}catch(b){d.Log.warn("Unable to save failed shutdown events to storage:",b)}}_getShutdownFailedEventsFromStorage(y){try{const w=(0,m._getObjectFromStorage)(y);return Array.isArray(w)?w:[]}catch{return[]}}};return Gg.FlushCoordinator=x,Gg}var e9={},sre;function Aot(){if(sre)return e9;sre=1,Object.defineProperty(e9,"__esModule",{value:!0}),e9.PendingEvents=void 0;const e=ma();let t=class{constructor(o){this._pendingEvents=[],this._batchSize=o}addToPendingEventsQueue(o){this._pendingEvents.push(o),e.Log.debug("Enqueued Event:",o)}hasEventsForFullBatch(){return this._pendingEvents.length>=this._batchSize}takeAll(){const o=this._pendingEvents;return this._pendingEvents=[],o}isEmpty(){return this._pendingEvents.length===0}};return e9.PendingEvents=t,e9}var Ed={},lre;function Mye(){if(lre)return Ed;lre=1,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed._createLayerParameterExposure=Ed._createConfigExposure=Ed._mapExposures=Ed._createGateExposure=Ed._isExposureEvent=void 0;const e="statsig::config_exposure",t="statsig::gate_exposure",o="statsig::layer_exposure",i=(h,m,f,x,y)=>(f.bootstrapMetadata&&(x.bootstrapMetadata=f.bootstrapMetadata),{eventName:h,user:m,value:null,metadata:u(f,x),secondaryExposures:y,time:Date.now()}),a=({eventName:h})=>h===t||h===e||h===o;Ed._isExposureEvent=a;const l=(h,m,f)=>{var x,y,w;const b={gate:m.name,gateValue:String(m.value),ruleID:m.ruleID};return((x=m.__evaluation)===null||x===void 0?void 0:x.version)!=null&&(b.configVersion=m.__evaluation.version),i(t,h,m.details,b,d((w=(y=m.__evaluation)===null||y===void 0?void 0:y.secondary_exposures)!==null&&w!==void 0?w:[],f))};Ed._createGateExposure=l;function d(h,m){return h.map(f=>typeof f=="string"?(m??{})[f]:f).filter(f=>f!=null)}Ed._mapExposures=d;const c=(h,m,f)=>{var x,y,w,b;const v={config:m.name,ruleID:m.ruleID};return((x=m.__evaluation)===null||x===void 0?void 0:x.version)!=null&&(v.configVersion=m.__evaluation.version),((y=m.__evaluation)===null||y===void 0?void 0:y.passed)!=null&&(v.rulePassed=String(m.__evaluation.passed)),i(e,h,m.details,v,d((b=(w=m.__evaluation)===null||w===void 0?void 0:w.secondary_exposures)!==null&&b!==void 0?b:[],f))};Ed._createConfigExposure=c;const p=(h,m,f,x)=>{var y,w,b,v,A,S,E;const j=m.__evaluation,L=((y=j?.explicit_parameters)===null||y===void 0?void 0:y.includes(f))===!0;let M="",D=(w=j?.undelegated_secondary_exposures)!==null&&w!==void 0?w:[];L&&(M=(b=j.allocated_experiment_name)!==null&&b!==void 0?b:"",D=(v=j.secondary_exposures)!==null&&v!==void 0?v:[]);const P=(A=m.__evaluation)===null||A===void 0?void 0:A.parameter_rule_ids,T={config:m.name,parameterName:f,ruleID:(S=P?.[f])!==null&&S!==void 0?S:m.ruleID,allocatedExperiment:M,isExplicitParameter:String(L)};return((E=m.__evaluation)===null||E===void 0?void 0:E.version)!=null&&(T.configVersion=m.__evaluation.version),i(o,h,m.details,T,d(D,x))};Ed._createLayerParameterExposure=p;const u=(h,m)=>(m.reason=h.reason,h.lcut&&(m.lcut=String(h.lcut)),h.receivedAt&&(m.receivedAt=String(h.receivedAt)),m);return Ed}var t9={},dre;function Bye(){if(dre)return t9;dre=1,Object.defineProperty(t9,"__esModule",{value:!0}),t9.UrlConfiguration=void 0;const e=G4(),t=eb(),o={[t.Endpoint._initialize]:"i",[t.Endpoint._rgstr]:"e",[t.Endpoint._download_config_specs]:"d"};let i=class{constructor(a,l,d,c){this.customUrl=null,this.fallbackUrls=null,this.endpoint=a,this.endpointDnsKey=o[a],l&&(this.customUrl=l),!l&&d&&(this.customUrl=d.endsWith("/")?`${d}${a}`:`${d}/${a}`),c&&(this.fallbackUrls=c);const p=t.NetworkDefault[a];this.defaultUrl=`${p}/${a}`}getUrl(){var a;return(a=this.customUrl)!==null&&a!==void 0?a:this.defaultUrl}getChecksum(){var a;const l=((a=this.fallbackUrls)!==null&&a!==void 0?a:[]).sort().join(",");return(0,e._DJB2)(this.customUrl+l)}};return t9.UrlConfiguration=i,t9}var cre;function Pye(){if(cre)return Qg;cre=1;var e=Qg&&Qg.__awaiter||function(S,E,j,L){function M(D){return D instanceof j?D:new j(function(P){P(D)})}return new(j||(j=Promise))(function(D,P){function T(K){try{R(L.next(K))}catch(Z){P(Z)}}function z(K){try{R(L.throw(K))}catch(Z){P(Z)}}function R(K){K.done?D(K.value):M(K.value).then(T,z)}R((L=L.apply(S,E||[])).next())})};Object.defineProperty(Qg,"__esModule",{value:!0}),Qg.EventLogger=void 0;const t=fot(),o=AL(),i=LG(),a=Cot(),l=G4(),d=ma(),c=eb(),p=Aot(),u=d2(),h=Mye(),m=ib(),f=E0(),x=Bye(),y=tb(),w=1e3,b=6e5,v={};let A=class Dye{static _safeFlushAndForget(E){var j;(j=v[E])===null||j===void 0||j.flush().catch(()=>{})}constructor(E,j,L,M,D){var P;this._sdkKey=E,this._emitter=j,this._network=L,this._options=M,this._errorBoundary=D,this._pendingEvents=null,this._batchQueue=null,this._flushCoordinator=null,this._lastExposureTimeMap={},this._nonExposedChecks={},this._isShuttingDown=!1,this._storageKey=null,this._pendingCompressionMode=null,this._loggingEnabled=(P=M?.loggingEnabled)!==null&&P!==void 0?P:M?.disableLogging===!0?m.LoggingEnabledOption.disabled:m.LoggingEnabledOption.browserOnly,M?.loggingEnabled&&M.disableLogging!==void 0&&d.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging.");const T=M?.networkConfig;this._logEventUrlConfig=new x.UrlConfiguration(c.Endpoint._rgstr,T?.logEventUrl,T?.api,T?.logEventFallbackUrls)}setLogEventCompressionMode(E){this._flushCoordinator?this._flushCoordinator.setLogEventCompressionMode(E):this._pendingCompressionMode=E}setLoggingEnabled(E){const j=this._loggingEnabled==="disabled",L=E!=="disabled";if(this._loggingEnabled=E,this._flushCoordinator&&this._flushCoordinator.setLoggingEnabled(E),j&&L){const M=this._loadStoredEvents();d.Log.debug(`Loaded ${M.length} stored event(s) from storage`),M.length>0&&(M.forEach(D=>{this._initFlushCoordinator().addEvent(D)}),this.flush().catch(D=>{d.Log.warn("Failed to flush events after enabling logging:",D)}))}}enqueue(E){var j;if(!this._shouldLogEvent(E))return;const L=this._normalizeEvent(E);if(this._loggingEnabled==="disabled"){this._storeEventToStorage(L);return}this._initFlushCoordinator().addEvent(L),(j=this._flushCoordinator)===null||j===void 0||j.checkQuickFlush()}incrementNonExposureCount(E){var j;const L=(j=this._nonExposedChecks[E])!==null&&j!==void 0?j:0;this._nonExposedChecks[E]=L+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var E;const j=(0,u._isServerEnv)();if(j&&((E=this._options)===null||E===void 0?void 0:E.loggingEnabled)!=="always")return;const L=this._initFlushCoordinator();v[this._sdkKey]=this,j||(0,y._subscribeToVisiblityChanged)(M=>{M==="background"?Dye._safeFlushAndForget(this._sdkKey):M==="foreground"&&L.startScheduledFlushCycle()}),L.loadAndRetryShutdownFailedEvents().catch(M=>{d.Log.warn("Failed to load failed shutdown events:",M)}),L.startScheduledFlushCycle()}stop(){return e(this,void 0,void 0,function*(){this._isShuttingDown=!0,this._flushCoordinator&&(yield this._flushCoordinator.processShutdown()),delete v[this._sdkKey],this._flushCoordinator=null,this._pendingEvents=null,this._batchQueue=null})}flush(){return e(this,void 0,void 0,function*(){if(this._flushCoordinator)return this._flushCoordinator.processManualFlush()})}appendAndResetNonExposedChecks(){if(Object.keys(this._nonExposedChecks).length===0)return;const E=Object.assign({},this._nonExposedChecks);this._nonExposedChecks={};const j=this._normalizeEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:E}});this._flushCoordinator&&this._flushCoordinator.addEvent(j)}_shouldLogEvent(E){var j;if(((j=this._options)===null||j===void 0?void 0:j.loggingEnabled)!=="always"&&(0,u._isServerEnv)())return!1;if(!(0,h._isExposureEvent)(E))return!0;const L=E.user?E.user:{statsigEnvironment:void 0},M=(0,o._getUserStorageKey)(this._sdkKey,L),D=E.metadata?E.metadata:{},P=[E.eventName,M,D.gate,D.config,D.ruleID,D.allocatedExperiment,D.parameterName,String(D.isExplicitParameter),D.reason].join("|"),T=this._lastExposureTimeMap[P],z=Date.now();return T&&z-T<b?!1:(Object.keys(this._lastExposureTimeMap).length>w&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[P]=z,!0)}_getCurrentPageUrl(){var E;if(((E=this._options)===null||E===void 0?void 0:E.includeCurrentPageUrlWithEvents)!==!1)return(0,u._getCurrentPageUrlSafe)()}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.pending_events.${(0,l._DJB2)(this._sdkKey)}`),this._storageKey}_initFlushCoordinator(){var E,j;if(this._flushCoordinator)return this._flushCoordinator;const L=(j=(E=this._options)===null||E===void 0?void 0:E.loggingBufferMaxSize)!==null&&j!==void 0?j:i.EventRetryConstants.DEFAULT_BATCH_SIZE;return this._pendingEvents=new p.PendingEvents(L),this._batchQueue=new t.BatchQueue(L),this._flushCoordinator=new a.FlushCoordinator(this._batchQueue,this._pendingEvents,()=>this.appendAndResetNonExposedChecks(),this._sdkKey,this._network,this._emitter,this._logEventUrlConfig,this._options,this._loggingEnabled,this._errorBoundary),this._pendingCompressionMode&&(this._flushCoordinator.setLogEventCompressionMode(this._pendingCompressionMode),this._pendingCompressionMode=null),this._flushCoordinator}_storeEventToStorage(E){const j=this._getStorageKey();try{let L=this._getEventsFromStorage(j);L.push(E),L.length>i.EventRetryConstants.MAX_LOCAL_STORAGE&&(L=L.slice(-i.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,f._setObjectInStorage)(j,L)}catch{d.Log.warn("Unable to save events to storage")}}_getEventsFromStorage(E){try{const j=(0,f._getObjectFromStorage)(E);return Array.isArray(j)?j:[]}catch{return[]}}_loadStoredEvents(){const E=this._getStorageKey(),j=this._getEventsFromStorage(E);return j.length>0&&f.Storage.removeItem(E),j}_normalizeEvent(E){E.user&&(E.user=Object.assign({},E.user),delete E.user.privateAttributes);const j={},L=this._getCurrentPageUrl();return L&&(j.statsigMetadata={currentPage:L}),Object.assign(Object.assign({},E),j)}};return Qg.EventLogger=A,Qg}var o9={},pre;function $ot(){if(pre)return o9;pre=1,Object.defineProperty(o9,"__esModule",{value:!0}),o9.PrecomputedEvaluationsContextHandle=void 0;const e=ma(),t=d2(),o=ob(),i=rb();class a{constructor(d,c,p,u,h,m){this._sdkKey=d,this._getOptions=c,this._getErrorBoundary=p,this._getValues=u,this._getUser=h,this._getSdkInstanceID=m}get sdkKey(){return this._sdkKey}get options(){return this._getOptions()}get errorBoundary(){return this._getErrorBoundary()}get values(){return this._getValues()}get user(){let d=(0,t._cloneObject)("StatsigUser",this._getUser());return d==null&&(e.Log.error("Failed to clone user"),d={}),d}getSession(d=!0){return o.StatsigSession.get(this._sdkKey,d)}get stableID(){return i.StableID.get(this._sdkKey)}get sdkInstanceID(){return this._getSdkInstanceID()}toContext(d=!0){return{sdkKey:this.sdkKey,options:this.options,values:this.values,user:this.user,errorBoundary:this.errorBoundary,session:this.getSession(d),stableID:this.stableID,sdkInstanceID:this.sdkInstanceID}}}return o9.PrecomputedEvaluationsContextHandle=a,o9}var j2={},M2={},ure;function Tye(){if(ure)return M2;ure=1,Object.defineProperty(M2,"__esModule",{value:!0}),M2._getUnitIDFromUser=M2._getFullUserHash=M2._normalizeUser=void 0;const e=G4(),t=ma(),o=d2();function i(d,c,p){const u=(0,o._cloneObject)("StatsigUser",d);return u==null?(t.Log.error("Failed to clone user"),{statsigEnvironment:void 0}):(c!=null&&c.environment!=null?u.statsigEnvironment=c.environment:p!=null&&(u.statsigEnvironment={tier:p}),u)}M2._normalizeUser=i;function a(d){return d?(0,e._DJB2Object)(d):null}M2._getFullUserHash=a;function l(d,c){var p,u,h;if(typeof c!="string")return d.userID;const m=c.toLowerCase();return m!=="userid"?(u=(p=d.customIDs)===null||p===void 0?void 0:p[c])!==null&&u!==void 0?u:(h=d.customIDs)===null||h===void 0?void 0:h[m]:d.userID}return M2._getUnitIDFromUser=l,M2}var r9={},hre;function zye(){if(hre)return r9;hre=1,Object.defineProperty(r9,"__esModule",{value:!0}),r9._typedJsonParse=void 0;const e=ma();function t(o,i,a){try{const l=JSON.parse(o);if(l&&typeof l=="object"&&i in l)return l}catch{}return e.Log.error(`Failed to parse ${a}`),null}return r9._typedJsonParse=t,r9}var mre;function kot(){if(mre)return j2;mre=1;var e=j2&&j2.__awaiter||function(f,x,y,w){function b(v){return v instanceof y?v:new y(function(A){A(v)})}return new(y||(y=Promise))(function(v,A){function S(L){try{j(w.next(L))}catch(M){A(M)}}function E(L){try{j(w.throw(L))}catch(M){A(M)}}function j(L){L.done?v(L.value):b(L.value).then(S,E)}j((w=w.apply(f,x||[])).next())})};Object.defineProperty(j2,"__esModule",{value:!0}),j2._makeDataAdapterResult=j2.DataAdapterCore=void 0;const t=ma(),o=rb(),i=Tye(),a=E0(),l=zye(),d=10,c=8;let p=class{constructor(f,x){this._adapterName=f,this._cacheSuffix=x,this._options=null,this._sdkKey=null,this._cacheLimit=d,this._lastModifiedStoreKey=`statsig.last_modified_time.${x}`,this._inMemoryCache=new h}attach(f,x,y){this._sdkKey=f,this._options=x}getDataSync(f){const x=f&&(0,i._normalizeUser)(f,this._options),y=this._getCacheKey(x),w=this._inMemoryCache.get(y,x);if(w&&this._getIsCacheValueValid(w))return w;const b=this._loadFromCache(y);return b&&this._getIsCacheValueValid(b)?(this._inMemoryCache.add(y,b,this._cacheLimit),this._inMemoryCache.get(y,x)):null}setData(f,x){const y=x&&(0,i._normalizeUser)(x,this._options),w=this._getCacheKey(y);this._inMemoryCache.add(w,u("Bootstrap",f,null,y),this._cacheLimit)}_getIsCacheValueValid(f){return f.stableID==null||f.stableID===o.StableID.get(this._getSdkKey())}_getDataAsyncImpl(f,x,y){return e(this,void 0,void 0,function*(){a.Storage.isReady()||(yield a.Storage.isReadyResolver());const w=f??this.getDataSync(x),b=[this._fetchAndPrepFromNetwork(w,x,y)];return y?.timeoutMs&&b.push(new Promise(v=>setTimeout(v,y.timeoutMs)).then(()=>(t.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(b)})}_prefetchDataImpl(f,x){return e(this,void 0,void 0,function*(){const y=f&&(0,i._normalizeUser)(f,this._options),w=this._getCacheKey(y),b=yield this._getDataAsyncImpl(null,y,x);b&&this._inMemoryCache.add(w,Object.assign(Object.assign({},b),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(f,x,y){return e(this,void 0,void 0,function*(){var w;const b=(w=f?.data)!==null&&w!==void 0?w:null,v=f!=null&&this._isCachedResultValidFor204(f,x),A=yield this._fetchFromNetwork(b,x,y,v);if(!A)return t.Log.debug("No response returned for latest value"),null;const S=(0,l._typedJsonParse)(A,"has_updates","Response"),E=this._getSdkKey(),j=o.StableID.get(E);let L=null;if(S?.has_updates===!0)L=u("Network",A,j,x);else if(b&&S?.has_updates===!1)L=u("NetworkNotModified",b,j,x);else return null;const M=this._getCacheKey(x);return this._inMemoryCache.add(M,L,this._cacheLimit),this._writeToCache(M,L),L})}_getSdkKey(){return this._sdkKey!=null?this._sdkKey:(t.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(f){var x;const y=(x=a.Storage.getItem)===null||x===void 0?void 0:x.call(a.Storage,f);if(y==null)return null;const w=(0,l._typedJsonParse)(y,"source","Cached Result");return w?Object.assign(Object.assign({},w),{source:"Cache"}):null}_writeToCache(f,x){const y=JSON.stringify(x);for(let w=0;w<c;w++)try{a.Storage.setItem(f,y);break}catch(b){if(!(b instanceof Error)||!(b.toString().includes("QuotaExceededError")||b.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw b;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(f,this._cacheLimit-1)}this._runLocalStorageCacheEviction(f)}_runLocalStorageCacheEviction(f,x=this._cacheLimit){var y;const w=(y=(0,a._getObjectFromStorage)(this._lastModifiedStoreKey))!==null&&y!==void 0?y:{};w[f]=Date.now();const b=m(w,x);for(const v of b)delete w[v],a.Storage.removeItem(v);(0,a._setObjectInStorage)(this._lastModifiedStoreKey,w)}};j2.DataAdapterCore=p;function u(f,x,y,w){return{source:f,data:x,receivedAt:Date.now(),stableID:y,fullUserHash:(0,i._getFullUserHash)(w)}}j2._makeDataAdapterResult=u;class h{constructor(){this._data={}}get(x,y){var w;const b=this._data[x],v=b?.stableID,A=(w=y?.customIDs)===null||w===void 0?void 0:w.stableID;return A&&v&&A!==v?(t.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):b}add(x,y,w){const b=m(this._data,w-1);for(const v of b)delete this._data[v];this._data[x]=y}merge(x){this._data=Object.assign(Object.assign({},this._data),x)}}function m(f,x){const y=Object.keys(f);return y.length<=x?[]:x===0?y:y.sort((w,b)=>{const v=f[w],A=f[b];return typeof v=="object"&&typeof A=="object"?v.receivedAt-A.receivedAt:v-A}).slice(0,y.length-x)}return j2}var gre={},fre;function Sot(){return fre||(fre=1,Object.defineProperty(gre,"__esModule",{value:!0})),gre}var Tv={},xre;function Rye(){return xre||(xre=1,function(e){var t=Tv&&Tv.__awaiter||function(m,f,x,y){function w(b){return b instanceof x?b:new x(function(v){v(b)})}return new(x||(x=Promise))(function(b,v){function A(j){try{E(y.next(j))}catch(L){v(L)}}function S(j){try{E(y.throw(j))}catch(L){v(L)}}function E(j){j.done?b(j.value):w(j.value).then(A,S)}E((y=y.apply(m,f||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorBoundary=e.EXCEPTION_ENDPOINT=void 0;const o=ma(),i=$L(),a=Vy();e.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";const l="[Statsig] UnknownError";let d=class{constructor(m,f,x,y){this._sdkKey=m,this._options=f,this._emitter=x,this._lastSeenError=y,this._seen=new Set}wrap(m,f){try{const x=m;u(x).forEach(y=>{const w=x[y];"$EB"in w||(x[y]=(...b)=>this._capture(f?`${f}:${y}`:y,()=>w.apply(m,b)),x[y].$EB=!0)})}catch(x){this._onError("eb:wrap",x)}}logError(m,f){this._onError(m,f)}logDroppedEvents(m,f,x){const y={eventCount:String(m),reason:f};x&&Object.keys(x).forEach(w=>{y[w]=String(x[w])}),this._onError("statsig::log_event_dropped_event_count",new Error(f),!0,y)}logEventRequestFailure(m,f,x,y,w,b,v,A,S){const E={eventCount:String(m),flushType:x,statusCode:String(y),reason:f,retries:String(w)};b&&(E.failurePath=b),typeof v=="string"&&v.length>0&&(E.failureErrorMessage=v),typeof A=="string"&&A.length>0&&(E.failureDiagnosticBucket=A),S&&Object.keys(S).forEach(j=>{const L=S[j];L.length>0&&(E[`failureDiagnostic_${j}`]=L)}),this._onError("statsig::log_event_failed",new Error(f),!0,E)}getLastSeenErrorAndReset(){const m=this._lastSeenError;return this._lastSeenError=void 0,m??null}attachErrorIfNoneExists(m){this._lastSeenError||(this._lastSeenError=c(m))}_capture(m,f){try{const x=f();return x&&x instanceof Promise?x.catch(y=>this._onError(m,y)):x}catch(x){return this._onError(m,x),null}}_onError(m,f,x=!1,y){try{o.Log.warn(`Caught error in ${m}`,{error:f}),t(this,void 0,void 0,function*(){var w,b,v,A,S,E,j;const L=f||Error(l),M=L instanceof Error,D=M?L.name:"No Name",P=c(L);if(this._lastSeenError=P,!x&&this._seen.has(D))return;if(this._seen.add(D),!((b=(w=this._options)===null||w===void 0?void 0:w.networkConfig)===null||b===void 0)&&b.preventAllNetworkTraffic){(v=this._emitter)===null||v===void 0||v.call(this,{name:"error",error:f,tag:m});return}const T=i.SDKType._get(this._sdkKey),z=a.StatsigMetadataProvider.get(),R=M?L.stack:p(L),K=Object.assign(Object.assign({tag:m,exception:D,info:R,statsigOptions:h(this._options)},Object.assign(Object.assign({},z),{sdkType:T})),y??{}),Z=(A=this._options)===null||A===void 0?void 0:A.networkConfig;yield((S=Z?.networkOverrideFunc)!==null&&S!==void 0?S:fetch)((E=Z?.sdkExceptionUrl)!==null&&E!==void 0?E:e.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(T),"STATSIG-SDK-VERSION":String(z.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(K)}),(j=this._emitter)===null||j===void 0||j.call(this,{name:"error",error:f,tag:m})}).then(()=>{}).catch(()=>{})}catch{}}};e.ErrorBoundary=d;function c(m){return m instanceof Error?m:typeof m=="string"?new Error(m):new Error("An unknown error occurred.")}function p(m){try{return JSON.stringify(m)}catch{return l}}function u(m){const f=new Set;let x=Object.getPrototypeOf(m);for(;x&&x!==Object.prototype;)Object.getOwnPropertyNames(x).filter(y=>typeof x?.[y]=="function").forEach(y=>f.add(y)),x=Object.getPrototypeOf(x);return Array.from(f)}function h(m){if(!m)return{};const f={};return Object.keys(m).forEach(x=>{const y=x,w=m[y];switch(typeof w){case"number":case"bigint":case"boolean":f[String(y)]=w;break;case"string":w.length<50?f[String(y)]=w:f[String(y)]="set";break;case"object":y==="environment"?f.environment=w:y==="networkConfig"?f.networkConfig=w:f[String(y)]=w!=null?"set":"unset";break}}),f}}(Tv)),Tv}var yre={},wre;function Eot(){return wre||(wre=1,Object.defineProperty(yre,"__esModule",{value:!0})),yre}var bre={},vre;function Lot(){return vre||(vre=1,Object.defineProperty(bre,"__esModule",{value:!0})),bre}var Cre={},Are;function Iot(){return Are||(Are=1,Object.defineProperty(Cre,"__esModule",{value:!0})),Cre}var Zg={},$re;function Fye(){if($re)return Zg;$re=1,Object.defineProperty(Zg,"__esModule",{value:!0}),Zg.createMemoKey=Zg.MemoPrefix=void 0,Zg.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};const e=new Set([]),t=new Set(["userPersistedValues"]);function o(i,a,l){let d=`${i}|${a}`;if(!l)return d;for(const c of Object.keys(l)){if(t.has(c))return;e.has(c)?d+=`|${c}=true`:d+=`|${c}=${l[c]}`}return d}return Zg.createMemoKey=o,Zg}var kre={},Sre;function jot(){return Sre||(Sre=1,Object.defineProperty(kre,"__esModule",{value:!0})),kre}var Ere={},Lre;function Mot(){return Lre||(Lre=1,Object.defineProperty(Ere,"__esModule",{value:!0})),Ere}var Ire={},jre;function Bot(){return jre||(jre=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._fastApproxSizeOf=void 0;const t=2,o=1,i=(a,l)=>{let d=0;const c=Object.keys(a);for(let p=0;p<c.length;p++){const u=c[p],h=a[u];if(d+=u.length,typeof h=="object"&&h!==null?d+=(0,e._fastApproxSizeOf)(h,l)+t:d+=String(h).length+o,d>=l)return d}return d};e._fastApproxSizeOf=i}(Ire)),Ire}var Jg={},Mre;function Dot(){if(Mre)return Jg;Mre=1;var e=Jg&&Jg.__awaiter||function(y,w,b,v){function A(S){return S instanceof b?S:new b(function(E){E(S)})}return new(b||(b=Promise))(function(S,E){function j(D){try{M(v.next(D))}catch(P){E(P)}}function L(D){try{M(v.throw(D))}catch(P){E(P)}}function M(D){D.done?S(D.value):A(D.value).then(j,L)}M((v=v.apply(y,w||[])).next())})};Object.defineProperty(Jg,"__esModule",{value:!0}),Jg.StatsigClientBase=void 0,d4();const t=d4(),o=Rye(),i=Pye(),a=ma(),l=Fye(),d=d2(),c=ob(),p=rb(),u=ib(),h=E0(),m=3e3;let f=class{constructor(y,w,b,v){var A,S,E,j;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const L=this.$emt.bind(this);v?.logLevel!=null&&(a.Log.level=v.logLevel),v?.disableStorage&&h.Storage._setDisabled(!0),v?.initialSessionID&&c.StatsigSession.overrideInitialSessionID(v.initialSessionID,y),v?.storageProvider&&h.Storage._setProvider(v.storageProvider),v?.enableCookies&&p.StableID._setCookiesEnabled(y,v.enableCookies),v?.disableStableID&&p.StableID._setDisabled(y,!0),this._sdkKey=y,this._options=v??{},this._memoCache={},this.overrideAdapter=(A=v?.overrideAdapter)!==null&&A!==void 0?A:null,this._errorBoundary=new o.ErrorBoundary(y,v,L),this._logger=new i.EventLogger(y,L,b,v,this._errorBoundary),this._errorBoundary.wrap(this),this._errorBoundary.wrap(w),this._errorBoundary.wrap(this._logger),b.setErrorBoundary(this._errorBoundary),this.dataAdapter=w,this.dataAdapter.attach(y,v,b),this.storageProvider=h.Storage,(j=(E=(S=this.overrideAdapter)===null||S===void 0?void 0:S.loadFromStorage)===null||E===void 0?void 0:E.call(S))===null||j===void 0||j.catch(M=>this._errorBoundary.logError("OA::loadFromStorage",M)),this._primeReadyRipcord(),x(y,this)}updateRuntimeOptions(y){y.loggingEnabled?(this._options.loggingEnabled=y.loggingEnabled,this._logger.setLoggingEnabled(y.loggingEnabled)):y.disableLogging!=null&&(this._options.disableLogging=y.disableLogging,this._logger.setLoggingEnabled(y.disableLogging?"disabled":"browser-only")),y.disableStorage!=null&&(this._options.disableStorage=y.disableStorage,h.Storage._setDisabled(y.disableStorage)),y.enableCookies!=null&&(this._options.enableCookies=y.enableCookies,p.StableID._setCookiesEnabled(this._sdkKey,y.enableCookies)),y.logEventCompressionMode?this._logger.setLogEventCompressionMode(y.logEventCompressionMode):y.disableCompression&&this._logger.setLogEventCompressionMode(u.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return e(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(y,w){this._listeners[y]||(this._listeners[y]=[]),this._listeners[y].push(w)}off(y,w){if(this._listeners[y]){const b=this._listeners[y].indexOf(w);b!==-1&&this._listeners[y].splice(b,1)}}$on(y,w){w.__isInternal=!0,this.on(y,w)}$emt(y){var w;const b=v=>{try{v(y)}catch(A){if(v.__isInternal===!0){this._errorBoundary.logError(`__emit:${y.name}`,A);return}a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",y)}};this._listeners[y.name]&&this._listeners[y.name].forEach(v=>b(v)),(w=this._listeners["*"])===null||w===void 0||w.forEach(b)}_setStatus(y,w){this.loadingStatus=y,this._memoCache={},this.$emt({name:"values_updated",status:y,values:w})}_enqueueExposure(y,w,b){if(b?.disableExposureLog===!0){this._logger.incrementNonExposureCount(y);return}this._logger.enqueue(w)}_memoize(y,w){return(b,v)=>{if(this._options.disableEvaluationMemoization)return w(b,v);const A=(0,l.createMemoKey)(y,b,v);return A?(A in this._memoCache||(Object.keys(this._memoCache).length>=m&&(this._memoCache={}),this._memoCache[A]=w(b,v)),this._memoCache[A]):w(b,v)}}};Jg.StatsigClientBase=f;function x(y,w){var b;if((0,d._isServerEnv)())return;const v=(0,t._getStatsigGlobal)(),A=(b=v.instances)!==null&&b!==void 0?b:{},S=w;A[y]!=null&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),A[y]=S,v.firstInstance||(v.firstInstance=S),v.instances=A,__STATSIG__=v}return Jg}var zv={},Bre;function Pot(){return Bre||(Bre=1,Object.defineProperty(zv,"__esModule",{value:!0}),zv.DataAdapterCachePrefix=void 0,zv.DataAdapterCachePrefix="statsig.cached"),zv}var Dre={},Pre;function Tot(){return Pre||(Pre=1,Object.defineProperty(Dre,"__esModule",{value:!0})),Dre}var il={},Tre;function zot(){if(Tre)return il;Tre=1,Object.defineProperty(il,"__esModule",{value:!0}),il._makeTypedGet=il._mergeOverride=il._makeLayer=il._makeExperiment=il._makeDynamicConfig=il._makeFeatureGate=void 0;const e=ma(),t=IG();function o(u,h,m,f){var x;return{name:u,details:h,ruleID:(x=m?.rule_id)!==null&&x!==void 0?x:"",__evaluation:m,value:f}}function i(u,h,m){var f;return Object.assign(Object.assign({},o(u,h,m,m?.value===!0)),{idType:(f=m?.id_type)!==null&&f!==void 0?f:null})}il._makeFeatureGate=i;function a(u,h,m){var f,x;const y=(f=m?.value)!==null&&f!==void 0?f:{};return Object.assign(Object.assign({},o(u,h,m,y)),{idType:(x=m?.id_type)!==null&&x!==void 0?x:null,get:p(u,m?.value)})}il._makeDynamicConfig=a;function l(u,h,m){var f;const x=a(u,h,m);return Object.assign(Object.assign({},x),{groupName:(f=m?.group_name)!==null&&f!==void 0?f:null})}il._makeExperiment=l;function d(u,h,m,f){var x,y;return Object.assign(Object.assign({},o(u,h,m,void 0)),{get:p(u,m?.value,f),groupName:(x=m?.group_name)!==null&&x!==void 0?x:null,__value:(y=m?.value)!==null&&y!==void 0?y:{}})}il._makeLayer=d;function c(u,h,m,f){return Object.assign(Object.assign(Object.assign({},u),h),{get:p(u.name,m,f)})}il._mergeOverride=c;function p(u,h,m){return(f,x)=>{var y;const w=(y=h?.[f])!==null&&y!==void 0?y:null;return w==null?x??null:x!=null&&!(0,t._isTypeMatch)(w,x)?(e.Log.warn(`Parameter type mismatch. '${u}.${f}' was found to be type '${typeof w}' but fallback/return type is '${typeof x}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),x??null):(m?.(f),w)}}return il._makeTypedGet=p,il}var zre={},Rre;function Rot(){return Rre||(Rre=1,Object.defineProperty(zre,"__esModule",{value:!0})),zre}var Xg={},Fre;function Fot(){if(Fre)return Xg;Fre=1,Object.defineProperty(Xg,"__esModule",{value:!0}),Xg.UPDATE_DETAIL_ERROR_MESSAGES=Xg.createUpdateDetails=void 0;const e=(t,o,i,a,l,d)=>({duration:i,source:o,success:t,error:a,sourceUrl:l,warnings:d});return Xg.createUpdateDetails=e,Xg.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."},Xg}var Ore;function On(){return Ore||(Ore=1,function(e){var t=Z5&&Z5.__createBinding||(Object.create?function(u,h,m,f){f===void 0&&(f=m);var x=Object.getOwnPropertyDescriptor(h,m);(!x||("get"in x?!h.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(u,f,x)}:function(u,h,m,f){f===void 0&&(f=m),u[f]=h[m]}),o=Z5&&Z5.__exportStar||function(u,h){for(var m in u)m!=="default"&&!Object.prototype.hasOwnProperty.call(h,m)&&t(h,u,m)};Object.defineProperty(e,"__esModule",{value:!0}),e.Storage=e.Log=e.EventLogger=e.Diagnostics=void 0,d4();const i=d4(),a=K_();Object.defineProperty(e,"Diagnostics",{enumerable:!0,get:function(){return a.Diagnostics}});const l=Pye();Object.defineProperty(e,"EventLogger",{enumerable:!0,get:function(){return l.EventLogger}});const d=ma();Object.defineProperty(e,"Log",{enumerable:!0,get:function(){return d.Log}});const c=Vy(),p=E0();Object.defineProperty(e,"Storage",{enumerable:!0,get:function(){return p.Storage}}),o(d4(),e),o(AL(),e),o($ot(),e),o(kot(),e),o(K_(),e),o(Sot(),e),o(Rye(),e),o(Eot(),e),o(Lot(),e),o(G4(),e),o(Iot(),e),o(ma(),e),o(Fye(),e),o(eb(),e),o(jye(),e),o(jot(),e),o(Mot(),e),o(d2(),e),o($L(),e),o(ob(),e),o(Bot(),e),o(rb(),e),o(Dot(),e),o(Iye(),e),o(Pot(),e),o(Mye(),e),o(Vy(),e),o(ib(),e),o(Tot(),e),o(zot(),e),o(Rot(),e),o(Tye(),e),o(E0(),e),o(zye(),e),o(IG(),e),o(Bye(),e),o(jG(),e),o(tb(),e),o(Fot(),e),o(Lye(),e),Object.assign((0,i._getStatsigGlobal)(),{Log:d.Log,SDK_VERSION:c.SDK_VERSION})}(Z5)),Z5}var Rv={},e3={},Nre;function Tm(){if(Nre)return e3;Nre=1,Object.defineProperty(e3,"__esModule",{value:!0}),e3.isNoopClient=e3.NoopEvaluationsClient=void 0;const e=On(),t={success:!1,error:Error("NoClient"),duration:0,source:"Uninitialized",sourceUrl:null},o=()=>{},i=()=>t,a=()=>Promise.resolve(),l=()=>Promise.resolve(t),d={reason:"Error:NoClient"},c=x=>(...y)=>{const w=typeof y[0]=="string"?y[0]:y[1];switch(x){case"gate":return(0,e._makeFeatureGate)(w,d,null);case"config":return(0,e._makeDynamicConfig)(w,d,null);case"layer":return(0,e._makeLayer)(w,d,null);case"param_store":return{name:w}}},p={attach:o,getDataSync:()=>null,getDataAsync:()=>Promise.resolve(null),setData:o,setDataLegacy:o,prefetchData:a},u={sdkKey:"",options:{},values:null,user:{userID:""},errorBoundary:{},session:{data:{sessionID:"",startTime:0,lastUpdate:0},sdkKey:"",lastPersistedAt:0,storageKey:""},stableID:"",storageProvider:e.Storage,sdkInstanceID:""},h=new e.PrecomputedEvaluationsContextHandle("",()=>({}),()=>({}),()=>null,()=>({userID:""}),()=>""),m={isNoop:!0,loadingStatus:"Uninitialized",initializeSync:i,initializeAsync:l,shutdown:a,flush:a,updateRuntimeOptions:o,updateUserSync:i,updateUserAsync:l,getContext:()=>Object.assign({},u),getContextHandle:()=>h,checkGate:()=>!1,getFeatureGate:c("gate"),getDynamicConfig:c("config"),getExperiment:c("config"),getLayer:c("layer"),getParameterStore:c("param_store"),logEvent:o,on:o,off:o,$on:o,$emt:o,dataAdapter:p};e3.NoopEvaluationsClient=m;function f(x){return"isNoop"in x}return e3.isNoopClient=f,e3}var Hre;function c2(){if(Hre)return Rv;Hre=1,Object.defineProperty(Rv,"__esModule",{value:!0});const e=$,t=Tm();return Rv.default=(0,e.createContext)({renderVersion:0,client:t.NoopEvaluationsClient,isLoading:!0}),Rv}var i9={},n9={},X5={},ef={},Fv={},a9={},_re;function Oot(){if(_re)return a9;_re=1,Object.defineProperty(a9,"__esModule",{value:!0}),a9.V1InitializeContainer=void 0;const e=On();let t=class{constructor(o){this._values=o}getGate(o){return this._getResultFromLookup(this._values.feature_gates,o)}getConfig(o){return this._getResultFromLookup(this._values.dynamic_configs,o)}getLayer(o){return this._getResultFromLookup(this._values.layer_configs,o)}getParamStore(o){return this._getResultFromLookup(this._values.param_stores,o)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(o,i){var a,l;return o&&(l=(a=o[i])!==null&&a!==void 0?a:o[(0,e._DJB2)(i)])!==null&&l!==void 0?l:null}};return a9.V1InitializeContainer=t,a9}var s9={},Vre;function Not(){if(Vre)return s9;Vre=1,Object.defineProperty(s9,"__esModule",{value:!0}),s9.V2InitializeContainer=void 0;const e=On();let t=class{constructor(o){this._values=o}getGate(o){var i,a,l;const d=this._getResultFromLookup(this._values.feature_gates,o);return d?{name:o,value:d.v===!0,rule_id:(i=d.r)!==null&&i!==void 0?i:"default",secondary_exposures:(a=d.s)!==null&&a!==void 0?a:[],id_type:(l=d.i)!==null&&l!==void 0?l:""}:null}getConfig(o){var i,a,l,d;const c=this._getResultFromLookup(this._values.dynamic_configs,o);return c?{name:o,value:(i=this._values.values[c.v])!==null&&i!==void 0?i:{},rule_id:c.r,secondary_exposures:(a=c.s)!==null&&a!==void 0?a:[],id_type:(l=c.i)!==null&&l!==void 0?l:"",is_user_in_experiment:c.ue===!0,passed:c.p===!0,group_name:(d=c.gn)!==null&&d!==void 0?d:void 0,is_experiment_active:c.ea===!0,group:c.r,is_device_based:c.i==="stableID"}:null}getLayer(o){var i,a,l,d,c,p;const u=this._getResultFromLookup(this._values.layer_configs,o);return u?{name:o,value:(i=this._values.values[u.v])!==null&&i!==void 0?i:{},rule_id:u.r,secondary_exposures:(a=u.s)!==null&&a!==void 0?a:[],is_user_in_experiment:u.ue===!0,group_name:(l=u.gn)!==null&&l!==void 0?l:void 0,is_experiment_active:u.ea===!0,group:u.r,is_device_based:u.i==="stableID",allocated_experiment_name:(d=u.ae)!==null&&d!==void 0?d:"",explicit_parameters:(c=u.ep)!==null&&c!==void 0?c:[],undelegated_secondary_exposures:(p=u.us)!==null&&p!==void 0?p:[],parameter_rule_ids:u.pr}:null}getParamStore(o){return this._getResultFromLookup(this._values.param_stores,o)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(o,i){var a,l;return o&&(l=(a=o[i])!==null&&a!==void 0?a:o[(0,e._DJB2)(i)])!==null&&l!==void 0?l:null}};return s9.V2InitializeContainer=t,s9}var Qre;function Hot(){if(Qre)return Fv;Qre=1,Object.defineProperty(Fv,"__esModule",{value:!0});const e=On(),t=Oot(),o=Not();let i=class{constructor(a,l){this._sdkKey=a,this._options=l,this._valuesForExternalUse=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._valuesForExternalUse=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._valuesForExternalUse}setValues(a,l){var d,c;if(!a)return!1;const p=(0,e._typedJsonParse)(a.data,"has_updates","EvaluationResponse");return p==null?!1:(this._source=a.source,p?.has_updates!==!0||((d=p.time)!==null&&d!==void 0?d:0)<this._lcut||(this._valuesForExternalUse=(0,e._typedJsonParse)(a.data,"has_updates","EvaluationResponse"),this._lcut=p.time,this._receivedAt=a.receivedAt,p.response_format==="init-v2"?this._values=new o.V2InitializeContainer(p):this._values=new t.V1InitializeContainer(p),this._bootstrapMetadata=this._extractBootstrapMetadata(a.source,p),a.source&&p.user&&this._setWarningState(l,p),e.SDKFlags.setFlags(this._sdkKey,(c=p.sdk_flags)!==null&&c!==void 0?c:{})),!0)}getWarnings(){if(this._warnings.size!==0)return Array.from(this._warnings)}getGate(a){const l=this._values?this._values.getGate(a):null;return this._getDetailedStoreResult(l)}getConfig(a){const l=this._values?this._values.getConfig(a):null;return this._getDetailedStoreResult(l)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(a){const l=this._values?this._values.getLayer(a):null;return this._getDetailedStoreResult(l)}getParamStore(a){const l=this._values?this._values.getParamStore(a):null;return this._getDetailedStoreResult(l)}getSource(){return this._source}getExposureMapping(){var a;return(a=this._values)===null||a===void 0?void 0:a.getExposureMapping()}_extractBootstrapMetadata(a,l){if(a!=="Bootstrap")return null;const d={};return l.user&&(d.user=l.user),l.sdkInfo&&(d.generatorSDKInfo=l.sdkInfo),d.lcut=l.time,d}_getDetailedStoreResult(a){return{result:a,details:this._getDetails(a==null)}}_setWarningState(a,l){var d,c,p;const u=e.StableID.get(this._sdkKey);if(((d=a.customIDs)===null||d===void 0?void 0:d.stableID)!==u&&(!((c=a.customIDs)===null||c===void 0)&&c.stableID||u)){this._warnings.add("StableIDMismatch");return}if("user"in l){let h=l.user,m=Object.assign(Object.assign({},a),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});!((p=this._options)===null||p===void 0)&&p.disableStableID&&(m=Object.assign(Object.assign({},m),{customIDs:Object.assign(Object.assign({},m.customIDs),{stableID:void 0})}),h=Object.assign(Object.assign({},h),{customIDs:Object.assign(Object.assign({},h.customIDs),{stableID:void 0})})),(0,e._getFullUserHash)(m)!==(0,e._getFullUserHash)(h)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if(this._source==="Uninitialized"||this._source==="NoValues")return{reason:this._source};const a={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(a.warnings=Array.from(this._warnings)),a}_getDetails(a){var l,d;const c=this.getCurrentSourceDetails();let p=c.reason;const u=(l=c.warnings)!==null&&l!==void 0?l:[];this._source==="Bootstrap"&&u.length>0&&(p=p+u[0]),p!=="Uninitialized"&&p!=="NoValues"&&(p=`${p}:${a?"Unrecognized":"Recognized"}`);const h=this._source==="Bootstrap"&&(d=this._bootstrapMetadata)!==null&&d!==void 0?d:void 0;return h&&(c.bootstrapMetadata=h),Object.assign(Object.assign({},c),{reason:p})}};return Fv.default=i,Fv}var tf={},l9={},Ure;function _ot(){if(Ure)return l9;Ure=1,Object.defineProperty(l9,"__esModule",{value:!0}),l9._resolveDeltasResponse=void 0;const e=On(),t=2;function o(d,c){const p=(0,e._typedJsonParse)(c,"checksum","DeltasEvaluationResponse");if(!p)return{hadBadDeltaChecksum:!0};const u=i(d,p),h=a(u),m=(0,e._DJB2Object)({feature_gates:h.feature_gates,dynamic_configs:h.dynamic_configs,layer_configs:h.layer_configs},t);return m===p.checksumV2?JSON.stringify(h):{hadBadDeltaChecksum:!0,badChecksum:m,badMergedConfigs:h,badFullResponse:p.deltas_full_response}}l9._resolveDeltasResponse=o;function i(d,c){return Object.assign(Object.assign(Object.assign({},d),c),{feature_gates:Object.assign(Object.assign({},d.feature_gates),c.feature_gates),layer_configs:Object.assign(Object.assign({},d.layer_configs),c.layer_configs),dynamic_configs:Object.assign(Object.assign({},d.dynamic_configs),c.dynamic_configs)})}function a(d){const c=d;return l(d.deleted_gates,c.feature_gates),delete c.deleted_gates,l(d.deleted_configs,c.dynamic_configs),delete c.deleted_configs,l(d.deleted_layers,c.layer_configs),delete c.deleted_layers,c}function l(d,c){d?.forEach(p=>{delete c[p]})}return l9}var Wre;function Oye(){if(Wre)return tf;Wre=1;var e=tf&&tf.__awaiter||function(a,l,d,c){function p(u){return u instanceof d?u:new d(function(h){h(u)})}return new(d||(d=Promise))(function(u,h){function m(y){try{x(c.next(y))}catch(w){h(w)}}function f(y){try{x(c.throw(y))}catch(w){h(w)}}function x(y){y.done?u(y.value):p(y.value).then(m,f)}x((c=c.apply(a,l||[])).next())})};Object.defineProperty(tf,"__esModule",{value:!0});const t=On(),o=_ot();class i extends t.NetworkCore{constructor(l,d){super(l,d);const c=l?.networkConfig;this._option=l,this._initializeUrlConfig=new t.UrlConfiguration(t.Endpoint._initialize,c?.initializeUrl,c?.api,c?.initializeFallbackUrls)}fetchEvaluations(l,d,c,p,u){return e(this,void 0,void 0,function*(){var h,m,f,x,y,w;const b=d?(0,t._typedJsonParse)(d,"has_updates","InitializeResponse"):null;let v={user:p,hash:(f=(m=(h=this._option)===null||h===void 0?void 0:h.networkConfig)===null||m===void 0?void 0:m.initializeHashAlgorithm)!==null&&f!==void 0?f:"djb2",deltasResponseRequested:!1,full_checksum:null};if(b?.has_updates){const A=b?.hash_used!==((w=(y=(x=this._option)===null||x===void 0?void 0:x.networkConfig)===null||y===void 0?void 0:y.initializeHashAlgorithm)!==null&&w!==void 0?w:"djb2");v=Object.assign(Object.assign({},v),{sinceTime:u&&!A?b.time:0,previousDerivedFields:"derived_fields"in b&&u?b.derived_fields:{},deltasResponseRequested:!0,full_checksum:b.full_checksum,partialUserMatchSinceTime:A?0:b.time})}return this._fetchEvaluations(l,b,v,c)})}_fetchEvaluations(l,d,c,p){return e(this,void 0,void 0,function*(){var u,h;const m=yield this.post({sdkKey:l,urlConfig:this._initializeUrlConfig,data:c,retries:2,isStatsigEncodable:!0,priority:p});if(m?.code===204)return'{"has_updates": false}';if(m?.code!==200)return(u=m?.body)!==null&&u!==void 0?u:null;if(d?.has_updates!==!0||((h=m.body)===null||h===void 0?void 0:h.includes('"is_delta":true'))!==!0||c.deltasResponseRequested!==!0)return m.body;const f=(0,o._resolveDeltasResponse)(d,m.body);return typeof f=="string"?f:this._fetchEvaluations(l,d,Object.assign(Object.assign(Object.assign({},c),f),{deltasResponseRequested:!1}),p)})}}return tf.default=i,tf}var d9={},Gre;function Vot(){if(Gre)return d9;Gre=1,Object.defineProperty(d9,"__esModule",{value:!0}),d9._makeParamStoreGetter=void 0;const e=On(),t={disableExposureLog:!0};function o(h){return h==null||h.disableExposureLog===!1}function i(h,m){return m!=null&&!(0,e._isTypeMatch)(h,m)}function a(h,m){return h.value}function l(h,m,f){return h.getFeatureGate(m.gate_name,o(f)?void 0:t).value?m.pass_value:m.fail_value}function d(h,m,f,x){const y=h.getDynamicConfig(m.config_name,o(x)?void 0:t).get(m.param_name);return i(y,f)?f:y}function c(h,m,f,x){const y=h.getExperiment(m.experiment_name,o(x)?void 0:t).get(m.param_name);return i(y,f)?f:y}function p(h,m,f,x){const y=h.getLayer(m.layer_name,o(x)?void 0:t).get(m.param_name);return i(y,f)?f:y}function u(h,m,f){return(x,y)=>{if(m==null)return y;const w=m[x];if(w==null||y!=null&&(0,e._typeOf)(y)!==w.param_type)return y;switch(w.ref_type){case"static":return a(w);case"gate":return l(h,w,f);case"dynamic_config":return d(h,w,y,f);case"experiment":return c(h,w,y,f);case"layer":return p(h,w,y,f);default:return y}}}return d9._makeParamStoreGetter=u,d9}var t3={},Yre;function Qot(){if(Yre)return t3;Yre=1;var e=t3&&t3.__awaiter||function(a,l,d,c){function p(u){return u instanceof d?u:new d(function(h){h(u)})}return new(d||(d=Promise))(function(u,h){function m(y){try{x(c.next(y))}catch(w){h(w)}}function f(y){try{x(c.throw(y))}catch(w){h(w)}}function x(y){y.done?u(y.value):p(y.value).then(m,f)}x((c=c.apply(a,l||[])).next())})};Object.defineProperty(t3,"__esModule",{value:!0}),t3.StatsigEvaluationsDataAdapter=void 0;const t=On(),o=Oye();let i=class extends t.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(a,l,d){super.attach(a,l,d),d!==null&&d instanceof o.default?this._network=d:this._network=new o.default(l??{})}getDataAsync(a,l,d){return this._getDataAsyncImpl(a,(0,t._normalizeUser)(l,this._options),d)}prefetchData(a,l){return this._prefetchDataImpl(a,l)}setData(a){const l=(0,t._typedJsonParse)(a,"has_updates","data");l&&"user"in l?super.setData(a,l.user):t.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(a,l){super.setData(a,l)}_fetchFromNetwork(a,l,d,c){return e(this,void 0,void 0,function*(){var p;return(yield(p=this._network)===null||p===void 0?void 0:p.fetchEvaluations(this._getSdkKey(),a,d?.priority,l,c))??null})}_getCacheKey(a){var l;const d=(0,t._getStorageKey)(this._getSdkKey(),a,(l=this._options)===null||l===void 0?void 0:l.customUserCacheKeyFunc);return`${t.DataAdapterCachePrefix}.${this._cacheSuffix}.${d}`}_isCachedResultValidFor204(a,l){return a.fullUserHash!=null&&a.fullUserHash===(0,t._getFullUserHash)(l)}};return t3.StatsigEvaluationsDataAdapter=i,t3}var Kre;function Uot(){if(Kre)return ef;Kre=1;var e=ef&&ef.__awaiter||function(c,p,u,h){function m(f){return f instanceof u?f:new u(function(x){x(f)})}return new(u||(u=Promise))(function(f,x){function y(v){try{b(h.next(v))}catch(A){x(A)}}function w(v){try{b(h.throw(v))}catch(A){x(A)}}function b(v){v.done?f(v.value):m(v.value).then(y,w)}b((h=h.apply(c,p||[])).next())})};Object.defineProperty(ef,"__esModule",{value:!0});const t=On(),o=Hot(),i=Oye(),a=Vot(),l=Qot();let d=class q_ extends t.StatsigClientBase{static instance(p){const u=(0,t._getStatsigGlobal)().instance(p);return u instanceof q_?u:(t.Log.warn((0,t._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new q_(p??"",{}))}constructor(p,u,h=null){var m,f;t.SDKType._setClientType(p,"javascript-client");const x=new i.default(h,w=>{this.$emt(w)});super(p,(m=h?.dataAdapter)!==null&&m!==void 0?m:new l.StatsigEvaluationsDataAdapter,x,h),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(t.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(t.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(t.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(t.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(t.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(t.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new o.default(p,h??null),this._network=x,this._user=this._configureUser(u,h),this._sdkInstanceID=(0,t.getUUID)(),this._contextHandle=new t.PrecomputedEvaluationsContextHandle(p,()=>this._options,()=>this._errorBoundary,()=>this._store.getValues(),()=>this._user,()=>this._sdkInstanceID);const y=(f=h?.plugins)!==null&&f!==void 0?f:[];for(const w of y)w.bind(this)}initializeSync(p){var u;return this.loadingStatus!=="Uninitialized"?(0,t.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...(u=this._store.getWarnings())!==null&&u!==void 0?u:[]]):(this._logger.start(),this.updateUserSync(this._user,p))}initializeAsync(p){return e(this,void 0,void 0,function*(){return this._initializePromise?this._initializePromise:(this._initializePromise=this._initializeAsyncImpl(p),this._initializePromise)})}updateUserSync(p,u){const h=performance.now();try{return this._updateUserSyncImpl(p,u,h)}catch(m){const f=m instanceof Error?m:new Error(String(m));return this._createErrorUpdateDetails(f,h)}}_updateUserSyncImpl(p,u,h){var m;const f=[...(m=this._store.getWarnings())!==null&&m!==void 0?m:[]];this._resetForUser(p);const x=this.dataAdapter.getDataSync(this._user);x==null&&f.push("NoCachedValues"),this._store.setValues(x,this._user),this._finalizeUpdate(x);const y=u?.disableBackgroundCacheRefresh;return y===!0||y==null&&x?.source==="Bootstrap"?(0,t.createUpdateDetails)(!0,this._store.getSource(),performance.now()-h,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),f):(this._runPostUpdate(x??null,this._user),(0,t.createUpdateDetails)(!0,this._store.getSource(),performance.now()-h,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),f))}updateUserAsync(p,u){return e(this,void 0,void 0,function*(){const h=performance.now();try{return yield this._updateUserAsyncImpl(p,u)}catch(m){const f=m instanceof Error?m:new Error(String(m));return this._createErrorUpdateDetails(f,h)}})}_updateUserAsyncImpl(p,u){return e(this,void 0,void 0,function*(){this._resetForUser(p);const h=this._user;t.Diagnostics._markInitOverallStart(this._sdkKey);let m=this.dataAdapter.getDataSync(h);if(this._store.setValues(m,this._user),this._setStatus("Loading",m),m=yield this.dataAdapter.getDataAsync(m,h,u),h!==this._user)return(0,t.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let f=!1;m!=null&&(t.Diagnostics._markInitProcessStart(this._sdkKey),f=this._store.setValues(m,this._user),t.Diagnostics._markInitProcessEnd(this._sdkKey,{success:f})),this._finalizeUpdate(m),f||(this._errorBoundary.attachErrorIfNoneExists(t.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),t.Diagnostics._markInitOverallEnd(this._sdkKey,f,this._store.getCurrentSourceDetails());const x=t.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,t.createUpdateDetails)(f,this._store.getSource(),x,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){let p=(0,t._cloneObject)("StatsigUser",this._user);return p==null&&(t.Log.error("Failed to clone user"),p={}),{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:p,errorBoundary:this._errorBoundary,session:t.StatsigSession.get(this._sdkKey),stableID:t.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}getContextHandle(){return this._contextHandle}checkGate(p,u){return this.getFeatureGate(p,u).value}logEvent(p,u,h){const m=typeof p=="string"?{eventName:p,value:u,metadata:h}:p;this.$emt({name:"log_event_called",event:m}),this._logger.enqueue(Object.assign(Object.assign({},m),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(p){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:p}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{this.loadingStatus==="Loading"&&this._finalizeUpdate(null)})}_initializeAsyncImpl(p){return e(this,void 0,void 0,function*(){return t.Storage.isReady()||(yield t.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,p)})}_createErrorUpdateDetails(p,u){var h;return(0,t.createUpdateDetails)(!1,this._store.getSource(),performance.now()-u,p,null,[...(h=this._store.getWarnings())!==null&&h!==void 0?h:[]])}_finalizeUpdate(p){this._store.finalize(),this._setStatus("Ready",p)}_runPostUpdate(p,u){this.dataAdapter.getDataAsync(p,u,{priority:"low"}).catch(h=>{t.Log.error("An error occurred after update.",h)})}_resetForUser(p){this._logger.reset(),this._store.reset(),this._user=this._configureUser(p,this._options)}_configureUser(p,u){var h,m,f;const x=(0,t._normalizeUser)(p,u),y=(h=x.customIDs)===null||h===void 0?void 0:h.stableID;if(y){const w=(f=(m=this.storageProvider).isReadyResolver)===null||f===void 0?void 0:f.call(m);w?w.then(()=>t.StableID.setOverride(y,this._sdkKey),()=>t.StableID.setOverride(y,this._sdkKey)):t.StableID.setOverride(y,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(x.analyticsOnlyMetadata=Object.assign(Object.assign({},x.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),x}_getFeatureGateImpl(p,u){var h,m;const{result:f,details:x}=this._store.getGate(p);this._checkUserHasIdForEvaluation(f?.id_type,p,"Gate"),this._checkInitializationStatus(x.reason);const y=(0,t._makeFeatureGate)(p,x,f),w=(m=(h=this.overrideAdapter)===null||h===void 0?void 0:h.getGateOverride)===null||m===void 0?void 0:m.call(h,y,this._user,u),b=w??y;return this._enqueueExposure(p,(0,t._createGateExposure)(this._user,b,this._store.getExposureMapping()),u),this.$emt({name:"gate_evaluation",gate:b}),b}_getDynamicConfigImpl(p,u){var h,m;const{result:f,details:x}=this._store.getConfig(p);this._checkUserHasIdForEvaluation(f?.id_type,p,"Dynamic config"),this._checkInitializationStatus(x.reason);const y=(0,t._makeDynamicConfig)(p,x,f),w=(m=(h=this.overrideAdapter)===null||h===void 0?void 0:h.getDynamicConfigOverride)===null||m===void 0?void 0:m.call(h,y,this._user,u),b=w??y;return this._enqueueExposure(p,(0,t._createConfigExposure)(this._user,b,this._store.getExposureMapping()),u),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:b}),b}_getExperimentImpl(p,u){var h,m,f,x;const{result:y,details:w}=this._store.getConfig(p);this._checkUserHasIdForEvaluation(y?.id_type,p,"Experiment"),this._checkInitializationStatus(w.reason);const b=(0,t._makeExperiment)(p,w,y);b.__evaluation!=null&&(b.__evaluation.secondary_exposures=(0,t._mapExposures)((m=(h=b.__evaluation)===null||h===void 0?void 0:h.secondary_exposures)!==null&&m!==void 0?m:[],this._store.getExposureMapping()));const v=(x=(f=this.overrideAdapter)===null||f===void 0?void 0:f.getExperimentOverride)===null||x===void 0?void 0:x.call(f,b,this._user,u),A=v??b;return this._enqueueExposure(p,(0,t._createConfigExposure)(this._user,A,this._store.getExposureMapping()),u),this.$emt({name:"experiment_evaluation",experiment:A}),A}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(p,u){var h,m,f;const{result:x,details:y}=this._store.getLayer(p),w=(0,t._makeLayer)(p,y,x),b=(m=(h=this.overrideAdapter)===null||h===void 0?void 0:h.getLayerOverride)===null||m===void 0?void 0:m.call(h,w,this._user,u);u?.disableExposureLog&&this._logger.incrementNonExposureCount(p);const v=(0,t._mergeOverride)(w,b,(f=b?.__value)!==null&&f!==void 0?f:w.__value,A=>{u?.disableExposureLog||this._enqueueExposure(p,(0,t._createLayerParameterExposure)(this._user,v,A,this._store.getExposureMapping()),u)});return this.$emt({name:"layer_evaluation",layer:v}),v}_getParameterStoreImpl(p,u){var h,m;const{result:f,details:x}=this._store.getParamStore(p);this._logger.incrementNonExposureCount(p);const y={name:p,details:x,__configuration:f,get:(0,a._makeParamStoreGetter)(this,f,u)},w=(m=(h=this.overrideAdapter)===null||h===void 0?void 0:h.getParamStoreOverride)===null||m===void 0?void 0:m.call(h,y,u);return w!=null&&(y.__configuration=w.config,y.details=w.details,y.get=(0,a._makeParamStoreGetter)(this,w.config,u)),y}_checkUserHasIdForEvaluation(p,u,h){p&&((0,t._getUnitIDFromUser)(this._user,p)||t.Log.warn(`The user does not have the required id_type "${p}" for ${h} "${u}"`))}_checkInitializationStatus(p){(p==="Uninitialized"||p.startsWith("Loading"))&&t.Log.warn(`SDK initialization has not completed. Reason: ${p}`)}};return ef.default=d,ef}var qre;function MG(){return qre||(qre=1,function(e){var t=X5&&X5.__createBinding||(Object.create?function(d,c,p,u){u===void 0&&(u=p);var h=Object.getOwnPropertyDescriptor(c,p);(!h||("get"in h?!c.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return c[p]}}),Object.defineProperty(d,u,h)}:function(d,c,p,u){u===void 0&&(u=p),d[u]=c[p]}),o=X5&&X5.__exportStar||function(d,c){for(var p in d)p!=="default"&&!Object.prototype.hasOwnProperty.call(c,p)&&t(c,d,p)};Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigClient=void 0;const i=On(),a=Uot();e.StatsigClient=a.default,o(On(),e);const l=Object.assign((0,i._getStatsigGlobal)(),{StatsigClient:a.default});e.default=l}(X5)),X5}var c9={},Zre;function Nye(){if(Zre)return c9;Zre=1,Object.defineProperty(c9,"__esModule",{value:!0}),c9.useStatsigInternalClientFactoryAsync=void 0;const e=$,t=On();function o(i,a){const l=(0,e.useMemo)(()=>{var p;return(p=(0,t._getInstance)(a.sdkKey))!==null&&p!==void 0?p:i(a)},[]),[d,c]=(0,e.useState)(l.loadingStatus!=="Ready");return(0,e.useMemo)(()=>{l.loadingStatus!=="Ready"&&l.initializeAsync().catch(t.Log.error).finally(()=>c(!1))},[]),{client:l,isLoading:d}}return c9.useStatsigInternalClientFactoryAsync=o,c9}var Jre;function Hye(){if(Jre)return n9;Jre=1,Object.defineProperty(n9,"__esModule",{value:!0}),n9.useClientAsyncInit=void 0;const e=MG(),t=Nye();function o(i,a,l=null){return(0,t.useStatsigInternalClientFactoryAsync)(d=>new e.StatsigClient(d.sdkKey,d.initialUser,d.statsigOptions),{sdkKey:i,initialUser:a,statsigOptions:l})}return n9.useClientAsyncInit=o,n9}var Xre;function Wot(){if(Xre)return i9;Xre=1,Object.defineProperty(i9,"__esModule",{value:!0}),i9.StatsigProvider=void 0;const e=e9e(),t=$,o=On(),i=c2(),a=Hye();function l(h){return"client"in h?(("sdkKey"in h||"user"in h)&&o.Log.warn("Both client and configuration props (sdkKey, user) were provided to StatsigProvider. The client prop will be used and the configuration props will be ignored."),(0,e.jsx)(c,Object.assign({},h))):(0,e.jsx)(d,Object.assign({},h))}i9.StatsigProvider=l;function d(h){const[m,f]=(0,t.useState)(0),x=(0,a.useClientAsyncInit)(h.sdkKey,h.user,h.options).client,[y,w]=(0,t.useState)(!u(x));p(x,f,w);const b=(0,t.useMemo)(()=>({renderVersion:m,client:x,isLoading:y}),[m,x,y]);return(0,e.jsx)(i.default.Provider,{value:b,children:h.loadingComponent==null||!b.isLoading?h.children:h.loadingComponent})}function c(h){const[m,f]=(0,t.useState)(0),x=h.client,[y,w]=(0,t.useState)(!u(x));p(x,f,w);const b=(0,t.useMemo)(()=>({renderVersion:m,client:x,isLoading:y}),[m,x,y]);return(0,e.jsx)(i.default.Provider,{value:b,children:h.loadingComponent==null||!b.isLoading?h.children:h.loadingComponent})}function p(h,m,f){(0,t.useEffect)(()=>{const x=()=>{m(y=>y+1),f(!u(h))};return o.SDKType._setBindingType("react"),h.$on("values_updated",x),()=>{h.flush().catch(y=>o.Log.error("An error occurred during flush",y)),h.off("values_updated",x)}},[h,m])}function u(h){return"isNoop"in h||h.loadingStatus==="Ready"}return i9}var p9={},u9={},eie;function _ye(){if(eie)return u9;eie=1,Object.defineProperty(u9,"__esModule",{value:!0}),u9.useStatsigInternalClientFactoryBootstrap=void 0;const e=$,t=On();function o(i,a){const l=(0,e.useRef)((0,t._getInstance)(a.sdkKey));return(0,e.useMemo)(()=>{if(l.current)return l.current;const d=i(a);return l.current=d,a.useLegacyFormat?d.dataAdapter.setDataLegacy(a.initialValues,a.initialUser):d.dataAdapter.setData(a.initialValues),d.initializeSync(),d},[])}return u9.useStatsigInternalClientFactoryBootstrap=o,u9}var tie;function Got(){if(tie)return p9;tie=1,Object.defineProperty(p9,"__esModule",{value:!0}),p9.useClientBootstrapInit=void 0;const e=MG(),t=_ye();function o(i,a,l,d=null,c){return(0,t.useStatsigInternalClientFactoryBootstrap)(p=>new e.StatsigClient(p.sdkKey,p.initialUser,p.statsigOptions),{sdkKey:i,initialUser:a,initialValues:l,statsigOptions:d,useLegacyFormat:c})}return p9.useClientBootstrapInit=o,p9}var Ov={},oie;function Yot(){if(oie)return Ov;oie=1,Object.defineProperty(Ov,"__esModule",{value:!0});const e=$,t=On(),o=Tm(),i=c2();function a(l,d){const{client:c,renderVersion:p}=(0,e.useContext)(i.default);return(0,e.useMemo)(()=>(0,o.isNoopClient)(c)?(t.Log.warn(`useDynamicConfig hook failed to find a valid StatsigClient for dynamic config '${l}'.`),o.NoopEvaluationsClient.getDynamicConfig(l,d)):c.getDynamicConfig(l,d),[l,c,p,...d?Object.values(d):[]])}return Ov.default=a,Ov}var Nv={},rie;function Kot(){if(rie)return Nv;rie=1,Object.defineProperty(Nv,"__esModule",{value:!0});const e=$,t=On(),o=Tm(),i=c2();function a(l,d){const{client:c,renderVersion:p}=(0,e.useContext)(i.default);return(0,e.useMemo)(()=>(0,o.isNoopClient)(c)?(t.Log.warn(`useExperiment hook failed to find a valid Statsig client for experiment '${l}'.`),o.NoopEvaluationsClient.getExperiment(l,d)):c.getExperiment(l,d),[l,c,p,...d?Object.values(d):[]])}return Nv.default=a,Nv}var Hv={},iie;function qot(){if(iie)return Hv;iie=1,Object.defineProperty(Hv,"__esModule",{value:!0});const e=$,t=On(),o=Tm(),i=c2();function a(l,d){const{client:c,renderVersion:p}=(0,e.useContext)(i.default);return(0,e.useMemo)(()=>(0,o.isNoopClient)(c)?(t.Log.warn(`useFeatureGate hook failed to find a valid StatsigClient for gate '${l}'.`),o.NoopEvaluationsClient.getFeatureGate(l,d)):c.getFeatureGate(l,d),[l,c,p,...d?Object.values(d):[]])}return Hv.default=a,Hv}var _v={},nie;function Zot(){if(nie)return _v;nie=1,Object.defineProperty(_v,"__esModule",{value:!0});const e=$,t=On(),o=Tm(),i=c2();function a(l,d){const{client:c,renderVersion:p}=(0,e.useContext)(i.default);return(0,e.useMemo)(()=>(0,o.isNoopClient)(c)?(t.Log.warn(`useGateValue hook failed to find a valid StatsigClient for gate '${l}'.`),o.NoopEvaluationsClient.checkGate(l,d)):c.checkGate(l,d),[l,c,p,...d?Object.values(d):[]])}return _v.default=a,_v}var Vv={},aie;function Jot(){if(aie)return Vv;aie=1,Object.defineProperty(Vv,"__esModule",{value:!0});const e=$,t=On(),o=Tm(),i=c2();function a(l,d){const{client:c,renderVersion:p}=(0,e.useContext)(i.default);return(0,e.useMemo)(()=>(0,o.isNoopClient)(c)?(t.Log.warn(`useLayer hook failed to find a valid Statsig client for layer '${l}'.`),o.NoopEvaluationsClient.getLayer(l,d)):c.getLayer(l,d),[l,c,p,...d?Object.values(d):[]])}return Vv.default=a,Vv}var Qv={},sie;function Xot(){if(sie)return Qv;sie=1,Object.defineProperty(Qv,"__esModule",{value:!0});const e=$,t=On(),o=Tm(),i=c2();function a(l,d){const{client:c,renderVersion:p}=(0,e.useContext)(i.default);return(0,e.useMemo)(()=>(0,o.isNoopClient)(c)?(t.Log.warn(`useParameterStore hook failed to find a valid StatsigClient for parameter store '${l}'.`),o.NoopEvaluationsClient.getParameterStore(l,d)):c.getParameterStore(l,d),[l,c,p,...d?Object.values(d):[]])}return Qv.default=a,Qv}var h9={},lie;function Vye(){if(lie)return h9;lie=1,Object.defineProperty(h9,"__esModule",{value:!0}),h9.useStatsigClient=void 0;const e=$,t=On(),o=Tm(),i=c2();function a(){const{client:l,renderVersion:d,isLoading:c}=(0,e.useContext)(i.default),p=(0,e.useMemo)(()=>(0,o.isNoopClient)(l)?(t.Log.warn("Attempting to retrieve a StatsigClient but none was set."),o.NoopEvaluationsClient):l,[l,d]),u=[p,d],h=(0,e.useCallback)((v,A)=>p.checkGate(v,A),u),m=(0,e.useCallback)((v,A)=>p.getFeatureGate(v,A),u),f=(0,e.useCallback)((v,A)=>p.getDynamicConfig(v,A),u),x=(0,e.useCallback)((v,A)=>p.getExperiment(v,A),u),y=(0,e.useCallback)((v,A)=>p.getLayer(v,A),u),w=(0,e.useCallback)((v,A)=>p.getParameterStore(v,A),u),b=(0,e.useCallback)((v,A,S)=>typeof v=="string"?p.logEvent(v,A,S):p.logEvent(v),u);return(0,e.useMemo)(()=>({client:p,checkGate:h,getFeatureGate:m,getDynamicConfig:f,getExperiment:x,getLayer:y,getParameterStore:w,logEvent:b,isLoading:c}),[p,h,m,f,x,y,w,b,c])}return h9.useStatsigClient=a,h9}var m9={},die;function ert(){if(die)return m9;die=1,Object.defineProperty(m9,"__esModule",{value:!0}),m9.useStatsigUser=void 0;const e=$,t=c2(),o=Vye();function i(l){return l.getContextHandle().user}function a(){const{client:l}=(0,o.useStatsigClient)(),{renderVersion:d}=(0,e.useContext)(t.default);return{user:(0,e.useMemo)(()=>i(l),[l,d]),updateUserSync:(0,e.useCallback)(c=>(typeof c=="function"&&(c=c(i(l))),l.updateUserSync(c)),[l]),updateUserAsync:(0,e.useCallback)(c=>(typeof c=="function"&&(c=c(i(l))),l.updateUserAsync(c)),[l])}}return m9.useStatsigUser=a,m9}var cie;function trt(){return cie||(cie=1,function(e){var t=q5&&q5.__createBinding||(Object.create?function(A,S,E,j){j===void 0&&(j=E);var L=Object.getOwnPropertyDescriptor(S,E);(!L||("get"in L?!S.__esModule:L.writable||L.configurable))&&(L={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(A,j,L)}:function(A,S,E,j){j===void 0&&(j=E),A[j]=S[E]}),o=q5&&q5.__exportStar||function(A,S){for(var E in A)E!=="default"&&!Object.prototype.hasOwnProperty.call(S,E)&&t(S,A,E)};Object.defineProperty(e,"__esModule",{value:!0}),e.useStatsigUser=e.useStatsigInternalClientFactoryBootstrap=e.useStatsigInternalClientFactoryAsync=e.useStatsigClient=e.useParameterStore=e.useLayer=e.useGateValue=e.useFeatureGate=e.useExperiment=e.useDynamicConfig=e.useClientBootstrapInit=e.useClientAsyncInit=e.StatsigProvider=e.StatsigContext=void 0;const i=On(),a=c2();e.StatsigContext=a.default;const l=Wot();Object.defineProperty(e,"StatsigProvider",{enumerable:!0,get:function(){return l.StatsigProvider}});const d=Hye();Object.defineProperty(e,"useClientAsyncInit",{enumerable:!0,get:function(){return d.useClientAsyncInit}});const c=Got();Object.defineProperty(e,"useClientBootstrapInit",{enumerable:!0,get:function(){return c.useClientBootstrapInit}});const p=Yot();e.useDynamicConfig=p.default;const u=Kot();e.useExperiment=u.default;const h=qot();e.useFeatureGate=h.default;const m=Zot();e.useGateValue=m.default;const f=Jot();e.useLayer=f.default;const x=Xot();e.useParameterStore=x.default;const y=Vye();Object.defineProperty(e,"useStatsigClient",{enumerable:!0,get:function(){return y.useStatsigClient}});const w=Nye();Object.defineProperty(e,"useStatsigInternalClientFactoryAsync",{enumerable:!0,get:function(){return w.useStatsigInternalClientFactoryAsync}});const b=_ye();Object.defineProperty(e,"useStatsigInternalClientFactoryBootstrap",{enumerable:!0,get:function(){return b.useStatsigInternalClientFactoryBootstrap}});const v=ert();Object.defineProperty(e,"useStatsigUser",{enumerable:!0,get:function(){return v.useStatsigUser}}),o(MG(),e),Object.assign((0,i._getStatsigGlobal)(),{StatsigContext:a.default,StatsigProvider:l.StatsigProvider,useClientAsyncInit:d.useClientAsyncInit,useClientBootstrapInit:c.useClientBootstrapInit,useDynamicConfig:p.default,useExperiment:u.default,useFeatureGate:h.default,useGateValue:m.default,useLayer:f.default,useParameterStore:x.default,useStatsigClient:y.useStatsigClient,useStatsigInternalClientFactoryAsync:w.useStatsigInternalClientFactoryAsync,useStatsigInternalClientFactoryBootstrap:b.useStatsigInternalClientFactoryBootstrap,useStatsigUser:v.useStatsigUser})}(q5)),q5}var wk=trt(),YP,pie;function Qye(){if(pie)return YP;pie=1;function e(t,o){for(var i=-1,a=t==null?0:t.length;++i<a&&o(t[i],i,t)!==!1;);return t}return YP=e,YP}var KP,uie;function Uye(){if(uie)return KP;uie=1;var e=U4(),t=function(){try{var o=e(Object,"defineProperty");return o({},"",{}),o}catch{}}();return KP=t,KP}var qP,hie;function BG(){if(hie)return qP;hie=1;var e=Uye();function t(o,i,a){i=="__proto__"&&e?e(o,i,{configurable:!0,enumerable:!0,value:a,writable:!0}):o[i]=a}return qP=t,qP}var ZP,mie;function DG(){if(mie)return ZP;mie=1;var e=BG(),t=sL(),o=Object.prototype,i=o.hasOwnProperty;function a(l,d,c){var p=l[d];(!(i.call(l,d)&&t(p,c))||c===void 0&&!(d in l))&&e(l,d,c)}return ZP=a,ZP}var JP,gie;function nb(){if(gie)return JP;gie=1;var e=DG(),t=BG();function o(i,a,l,d){var c=!l;l||(l={});for(var p=-1,u=a.length;++p<u;){var h=a[p],m=d?d(l[h],i[h],h,l,i):void 0;m===void 0&&(m=i[h]),c?t(l,h,m):e(l,h,m)}return l}return JP=o,JP}var XP,fie;function ort(){if(fie)return XP;fie=1;var e=nb(),t=Uw();function o(i,a){return i&&e(a,t(a),i)}return XP=o,XP}var eT,xie;function rrt(){if(xie)return eT;xie=1;function e(t){var o=[];if(t!=null)for(var i in Object(t))o.push(i);return o}return eT=e,eT}var tT,yie;function irt(){if(yie)return tT;yie=1;var e=X1(),t=JW(),o=rrt(),i=Object.prototype,a=i.hasOwnProperty;function l(d){if(!e(d))return o(d);var c=t(d),p=[];for(var u in d)u=="constructor"&&(c||!a.call(d,u))||p.push(u);return p}return tT=l,tT}var oT,wie;function PG(){if(wie)return oT;wie=1;var e=W9e(),t=irt(),o=_6();function i(a){return o(a)?e(a,!0):t(a)}return oT=i,oT}var rT,bie;function nrt(){if(bie)return rT;bie=1;var e=nb(),t=PG();function o(i,a){return i&&e(a,t(a),i)}return rT=o,rT}var E$={exports:{}};E$.exports;var vie;function art(){return vie||(vie=1,function(e,t){var o=J1(),i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,l=a&&a.exports===i,d=l?o.Buffer:void 0,c=d?d.allocUnsafe:void 0;function p(u,h){if(h)return u.slice();var m=u.length,f=c?c(m):new u.constructor(m);return u.copy(f),f}e.exports=p}(E$,E$.exports)),E$.exports}var iT,Cie;function srt(){if(Cie)return iT;Cie=1;function e(t,o){var i=-1,a=t.length;for(o||(o=Array(a));++i<a;)o[i]=t[i];return o}return iT=e,iT}var nT,Aie;function lrt(){if(Aie)return nT;Aie=1;var e=nb(),t=GW();function o(i,a){return e(i,t(i),a)}return nT=o,nT}var aT,$ie;function TG(){if($ie)return aT;$ie=1;var e=G9e(),t=e(Object.getPrototypeOf,Object);return aT=t,aT}var sT,kie;function Wye(){if(kie)return sT;kie=1;var e=UW(),t=TG(),o=GW(),i=V9e(),a=Object.getOwnPropertySymbols,l=a?function(d){for(var c=[];d;)e(c,o(d)),d=t(d);return c}:i;return sT=l,sT}var lT,Sie;function drt(){if(Sie)return lT;Sie=1;var e=nb(),t=Wye();function o(i,a){return e(i,t(i),a)}return lT=o,lT}var dT,Eie;function zG(){if(Eie)return dT;Eie=1;var e=_9e(),t=Wye(),o=PG();function i(a){return e(a,o,t)}return dT=i,dT}var cT,Lie;function crt(){if(Lie)return cT;Lie=1;var e=Object.prototype,t=e.hasOwnProperty;function o(i){var a=i.length,l=new i.constructor(a);return a&&typeof i[0]=="string"&&t.call(i,"index")&&(l.index=i.index,l.input=i.input),l}return cT=o,cT}var pT,Iie;function RG(){if(Iie)return pT;Iie=1;var e=H9e();function t(o){var i=new o.constructor(o.byteLength);return new e(i).set(new e(o)),i}return pT=t,pT}var uT,jie;function prt(){if(jie)return uT;jie=1;var e=RG();function t(o,i){var a=i?e(o.buffer):o.buffer;return new o.constructor(a,o.byteOffset,o.byteLength)}return uT=t,uT}var hT,Mie;function urt(){if(Mie)return hT;Mie=1;var e=/\w*$/;function t(o){var i=new o.constructor(o.source,e.exec(o));return i.lastIndex=o.lastIndex,i}return hT=t,hT}var mT,Bie;function hrt(){if(Bie)return mT;Bie=1;var e=N6(),t=e?e.prototype:void 0,o=t?t.valueOf:void 0;function i(a){return o?Object(o.call(a)):{}}return mT=i,mT}var gT,Die;function mrt(){if(Die)return gT;Die=1;var e=RG();function t(o,i){var a=i?e(o.buffer):o.buffer;return new o.constructor(a,o.byteOffset,o.length)}return gT=t,gT}var fT,Pie;function grt(){if(Pie)return fT;Pie=1;var e=RG(),t=prt(),o=urt(),i=hrt(),a=mrt(),l="[object Boolean]",d="[object Date]",c="[object Map]",p="[object Number]",u="[object RegExp]",h="[object Set]",m="[object String]",f="[object Symbol]",x="[object ArrayBuffer]",y="[object DataView]",w="[object Float32Array]",b="[object Float64Array]",v="[object Int8Array]",A="[object Int16Array]",S="[object Int32Array]",E="[object Uint8Array]",j="[object Uint8ClampedArray]",L="[object Uint16Array]",M="[object Uint32Array]";function D(P,T,z){var R=P.constructor;switch(T){case x:return e(P);case l:case d:return new R(+P);case y:return t(P,z);case w:case b:case v:case A:case S:case E:case j:case L:case M:return a(P,z);case c:return new R;case p:case m:return new R(P);case u:return o(P);case h:return new R;case f:return i(P)}}return fT=D,fT}var xT,Tie;function frt(){if(Tie)return xT;Tie=1;var e=X1(),t=Object.create,o=function(){function i(){}return function(a){if(!e(a))return{};if(t)return t(a);i.prototype=a;var l=new i;return i.prototype=void 0,l}}();return xT=o,xT}var yT,zie;function xrt(){if(zie)return yT;zie=1;var e=frt(),t=TG(),o=JW();function i(a){return typeof a.constructor=="function"&&!o(a)?e(t(a)):{}}return yT=i,yT}var wT,Rie;function yrt(){if(Rie)return wT;Rie=1;var e=hL(),t=z0(),o="[object Map]";function i(a){return t(a)&&e(a)==o}return wT=i,wT}var bT,Fie;function wrt(){if(Fie)return bT;Fie=1;var e=yrt(),t=uL(),o=ZW(),i=o&&o.isMap,a=i?t(i):e;return bT=a,bT}var vT,Oie;function brt(){if(Oie)return vT;Oie=1;var e=hL(),t=z0(),o="[object Set]";function i(a){return t(a)&&e(a)==o}return vT=i,vT}var CT,Nie;function vrt(){if(Nie)return CT;Nie=1;var e=brt(),t=uL(),o=ZW(),i=o&&o.isSet,a=i?t(i):e;return CT=a,CT}var AT,Hie;function Gye(){if(Hie)return AT;Hie=1;var e=VW(),t=Qye(),o=DG(),i=ort(),a=nrt(),l=art(),d=srt(),c=lrt(),p=drt(),u=Y9e(),h=zG(),m=hL(),f=crt(),x=grt(),y=xrt(),w=Ls(),b=KW(),v=wrt(),A=X1(),S=vrt(),E=Uw(),j=PG(),L=1,M=2,D=4,P="[object Arguments]",T="[object Array]",z="[object Boolean]",R="[object Date]",K="[object Error]",Z="[object Function]",O="[object GeneratorFunction]",Q="[object Map]",_="[object Number]",F="[object Object]",N="[object RegExp]",H="[object Set]",ee="[object String]",Y="[object Symbol]",G="[object WeakMap]",J="[object ArrayBuffer]",X="[object DataView]",ie="[object Float32Array]",we="[object Float64Array]",me="[object Int8Array]",de="[object Int16Array]",ce="[object Int32Array]",fe="[object Uint8Array]",Ae="[object Uint8ClampedArray]",le="[object Uint16Array]",pe="[object Uint32Array]",ae={};ae[P]=ae[T]=ae[J]=ae[X]=ae[z]=ae[R]=ae[ie]=ae[we]=ae[me]=ae[de]=ae[ce]=ae[Q]=ae[_]=ae[F]=ae[N]=ae[H]=ae[ee]=ae[Y]=ae[fe]=ae[Ae]=ae[le]=ae[pe]=!0,ae[K]=ae[Z]=ae[G]=!1;function be(ue,se,ge,Ee,$e,Ve){var Le,He=se&L,De=se&M,Me=se&D;if(ge&&(Le=$e?ge(ue,Ee,$e,Ve):ge(ue)),Le!==void 0)return Le;if(!A(ue))return ue;var Pe=w(ue);if(Pe){if(Le=f(ue),!He)return d(ue,Le)}else{var ze=m(ue),Be=ze==Z||ze==O;if(b(ue))return l(ue,He);if(ze==F||ze==P||Be&&!$e){if(Le=De||Be?{}:y(ue),!He)return De?p(ue,a(Le,ue)):c(ue,i(Le,ue))}else{if(!ae[ze])return $e?ue:{};Le=x(ue,ze,He)}}Ve||(Ve=new e);var _e=Ve.get(ue);if(_e)return _e;Ve.set(ue,Le),S(ue)?ue.forEach(function(ut){Le.add(be(ut,se,ge,ut,ue,Ve))}):v(ue)&&ue.forEach(function(ut,xt){Le.set(xt,be(ut,se,ge,xt,ue,Ve))});var tt=Me?De?h:u:De?j:E,rt=Pe?void 0:tt(ue);return t(rt||ue,function(ut,xt){rt&&(xt=ut,ut=ue[xt]),o(Le,xt,be(ut,se,ge,xt,ue,Ve))}),Le}return AT=be,AT}var $T,_ie;function Crt(){if(_ie)return $T;_ie=1;var e=Gye(),t=1,o=4;function i(a){return e(a,t|o)}return $T=i,$T}var Art=Crt();const Kn=Mr(Art);var Vie,Qie;function $rt(){return Qie||(Qie=1,Vie=function(e,t,o,i){var a=typeof i<"u"?[i,e]:[e],l=new Blob(a,{type:o||"application/octet-stream"});if(typeof window.navigator.msSaveBlob<"u")window.navigator.msSaveBlob(l,t);else{var d=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(l):window.webkitURL.createObjectURL(l),c=document.createElement("a");c.style.display="none",c.href=d,c.setAttribute("download",t),typeof c.download>"u"&&c.setAttribute("target","_blank"),document.body.appendChild(c),c.click(),setTimeout(function(){document.body.removeChild(c),window.URL.revokeObjectURL(d)},200)}}),Vie}var krt=$rt();const kL=Mr(krt);var kT,Uie;function Srt(){if(Uie)return kT;Uie=1;var e=Object.prototype,t=e.hasOwnProperty;function o(i,a){return i!=null&&t.call(i,a)}return kT=o,kT}var ST,Wie;function FG(){if(Wie)return ST;Wie=1;var e=Ls(),t=Xw(),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;function a(l,d){if(e(l))return!1;var c=typeof l;return c=="number"||c=="symbol"||c=="boolean"||l==null||t(l)?!0:i.test(l)||!o.test(l)||d!=null&&l in Object(d)}return ST=a,ST}var ET,Gie;function Ert(){if(Gie)return ET;Gie=1;var e=_W(),t="Expected a function";function o(i,a){if(typeof i!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var l=function(){var d=arguments,c=a?a.apply(this,d):d[0],p=l.cache;if(p.has(c))return p.get(c);var u=i.apply(this,d);return l.cache=p.set(c,u)||p,u};return l.cache=new(o.Cache||e),l}return o.Cache=e,ET=o,ET}var LT,Yie;function Lrt(){if(Yie)return LT;Yie=1;var e=Ert(),t=500;function o(i){var a=e(i,function(d){return l.size===t&&l.clear(),d}),l=a.cache;return a}return LT=o,LT}var IT,Kie;function Irt(){if(Kie)return IT;Kie=1;var e=Lrt(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,i=e(function(a){var l=[];return a.charCodeAt(0)===46&&l.push(""),a.replace(t,function(d,c,p,u){l.push(p?u.replace(o,"$1"):c||d)}),l});return IT=i,IT}var jT,qie;function Y4(){if(qie)return jT;qie=1;function e(t,o){for(var i=-1,a=t==null?0:t.length,l=Array(a);++i<a;)l[i]=o(t[i],i,t);return l}return jT=e,jT}var MT,Zie;function Yye(){if(Zie)return MT;Zie=1;var e=N6(),t=Y4(),o=Ls(),i=Xw(),a=e?e.prototype:void 0,l=a?a.toString:void 0;function d(c){if(typeof c=="string")return c;if(o(c))return t(c,d)+"";if(i(c))return l?l.call(c):"";var p=c+"";return p=="0"&&1/c==-1/0?"-0":p}return MT=d,MT}var BT,Jie;function Kye(){if(Jie)return BT;Jie=1;var e=Yye();function t(o){return o==null?"":e(o)}return BT=t,BT}var DT,Xie;function W6(){if(Xie)return DT;Xie=1;var e=Ls(),t=FG(),o=Irt(),i=Kye();function a(l,d){return e(l)?l:t(l,d)?[l]:o(i(l))}return DT=a,DT}var PT,ene;function G6(){if(ene)return PT;ene=1;var e=Xw();function t(o){if(typeof o=="string"||e(o))return o;var i=o+"";return i=="0"&&1/o==-1/0?"-0":i}return PT=t,PT}var TT,tne;function qye(){if(tne)return TT;tne=1;var e=W6(),t=YW(),o=Ls(),i=Qw(),a=qW(),l=G6();function d(c,p,u){p=e(p,c);for(var h=-1,m=p.length,f=!1;++h<m;){var x=l(p[h]);if(!(f=c!=null&&u(c,x)))break;c=c[x]}return f||++h!=m?f:(m=c==null?0:c.length,!!m&&a(m)&&i(x,m)&&(o(c)||t(c)))}return TT=d,TT}var zT,one;function jrt(){if(one)return zT;one=1;var e=Srt(),t=qye();function o(i,a){return i!=null&&t(i,a,e)}return zT=o,zT}var Mrt=jrt();const Yt=Mr(Mrt);var ab=e=>e.type==="checkbox",p7=e=>e instanceof Date,xl=e=>e==null;const Zye=e=>typeof e=="object";var Ma=e=>!xl(e)&&!Array.isArray(e)&&Zye(e)&&!p7(e),Jye=e=>Ma(e)&&e.target?ab(e.target)?e.target.checked:e.target.value:e,Brt=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Xye=(e,t)=>e.has(Brt(t)),Drt=e=>{const t=e.constructor&&e.constructor.prototype;return Ma(t)&&t.hasOwnProperty("isPrototypeOf")},OG=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Xl(e){let t;const o=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(OG&&(e instanceof Blob||e instanceof FileList))&&(o||Ma(e)))if(t=o?[]:{},!Array.isArray(e)&&!Drt(e))t=e;else for(const i in e)t[i]=Xl(e[i]);else return e;return t}var Y6=e=>Array.isArray(e)?e.filter(Boolean):[],tn=e=>e===void 0,to=(e,t,o)=>{if(!t||!Ma(e))return o;const i=Y6(t.split(/[,[\].]+?/)).reduce((a,l)=>xl(a)?a:a[l],e);return tn(i)||i===e?tn(e[t])?o:e[t]:i};const bk={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},zc={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},B2={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ewe=$.createContext(null),Wt=()=>$.useContext(ewe),Vi=e=>{const{children:t,...o}=e;return $.createElement(ewe.Provider,{value:o},t)};var twe=(e,t,o,i=!0)=>{const a={defaultValues:t._defaultValues};for(const l in e)Object.defineProperty(a,l,{get:()=>{const d=l;return t._proxyFormState[d]!==zc.all&&(t._proxyFormState[d]=!i||zc.all),o&&(o[d]=!0),e[d]}});return a},Dd=e=>Ma(e)&&!Object.keys(e).length,owe=(e,t,o,i)=>{o(e);const{name:a,...l}=e;return Dd(l)||Object.keys(l).length>=Object.keys(t).length||Object.keys(l).find(d=>t[d]===(!i||zc.all))},Fd=e=>Array.isArray(e)?e:[e],rwe=(e,t,o)=>o&&t?e===t:!e||!t||e===t||Fd(e).some(i=>i&&(i.startsWith(t)||t.startsWith(i)));function SL(e){const t=$.useRef(e);t.current=e,$.useEffect(()=>{const o=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{o&&o.unsubscribe()}},[e.disabled])}function Prt(e){const t=Wt(),{control:o=t.control,disabled:i,name:a,exact:l}=e||{},[d,c]=$.useState(o._formState),p=$.useRef(!0),u=$.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),h=$.useRef(a);return h.current=a,SL({disabled:i,next:m=>p.current&&rwe(h.current,m.name,l)&&owe(m,u.current,o._updateFormState)&&c({...o._formState,...m}),subject:o._subjects.state}),$.useEffect(()=>(p.current=!0,u.current.isValid&&o._updateValid(!0),()=>{p.current=!1}),[o]),twe(d,o,u.current,!1)}var Fu=e=>typeof e=="string",iwe=(e,t,o,i,a)=>Fu(e)?(i&&t.watch.add(e),to(o,e,a)):Array.isArray(e)?e.map(l=>(i&&t.watch.add(l),to(o,l))):(i&&(t.watchAll=!0),o);function NG(e){const t=Wt(),{control:o=t.control,name:i,defaultValue:a,disabled:l,exact:d}=e||{},c=$.useRef(i);c.current=i,SL({disabled:l,subject:o._subjects.values,next:h=>{rwe(c.current,h.name,d)&&u(Xl(iwe(c.current,o._names,h.values||o._formValues,!1,a)))}});const[p,u]=$.useState(o._getWatch(i,a));return $.useEffect(()=>o._removeUnmounted()),p}var HG=e=>/^\w*$/.test(e),nwe=e=>Y6(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Fi(e,t,o){let i=-1;const a=HG(t)?[t]:nwe(t),l=a.length,d=l-1;for(;++i<l;){const c=a[i];let p=o;if(i!==d){const u=e[c];p=Ma(u)||Array.isArray(u)?u:isNaN(+a[i+1])?{}:[]}e[c]=p,e=e[c]}return e}function Trt(e){const t=Wt(),{name:o,control:i=t.control,shouldUnregister:a}=e,l=Xye(i._names.array,o),d=NG({control:i,name:o,defaultValue:to(i._formValues,o,to(i._defaultValues,o,e.defaultValue)),exact:!0}),c=Prt({control:i,name:o}),p=$.useRef(i.register(o,{...e.rules,value:d}));return $.useEffect(()=>{const u=i._options.shouldUnregister||a,h=(m,f)=>{const x=to(i._fields,m);x&&(x._f.mount=f)};if(h(o,!0),u){const m=Xl(to(i._options.defaultValues,o));Fi(i._defaultValues,o,m),tn(to(i._formValues,o))&&Fi(i._formValues,o,m)}return()=>{(l?u&&!i._state.action:u)?i.unregister(o):h(o,!1)}},[o,i,l,a]),{field:{name:o,value:d,onChange:$.useCallback(u=>p.current.onChange({target:{value:Jye(u),name:o},type:bk.CHANGE}),[o]),onBlur:$.useCallback(()=>p.current.onBlur({target:{value:to(i._formValues,o),name:o},type:bk.BLUR}),[o,i]),ref:u=>{const h=to(i._fields,o);h&&u&&(h._f.ref={focus:()=>u.focus(),select:()=>u.select(),setCustomValidity:m=>u.setCustomValidity(m),reportValidity:()=>u.reportValidity()})}},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!to(c.errors,o)},isDirty:{enumerable:!0,get:()=>!!to(c.dirtyFields,o)},isTouched:{enumerable:!0,get:()=>!!to(c.touchedFields,o)},error:{enumerable:!0,get:()=>to(c.errors,o)}})}}const zr=e=>e.render(Trt(e));var zrt=(e,t,o,i,a)=>t?{...o[e],types:{...o[e]&&o[e].types?o[e].types:{},[i]:a||!0}}:{};const vk=(e,t,o)=>{for(const i of o||Object.keys(e)){const a=to(e,i);if(a){const{_f:l,...d}=a;if(l&&t(l.name)){if(l.ref.focus){l.ref.focus();break}else if(l.refs&&l.refs[0].focus){l.refs[0].focus();break}}else Ma(d)&&vk(d,t)}}};var ph=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const o=(Math.random()*16+e)%16|0;return(t=="x"?o:o&3|8).toString(16)})},RT=(e,t,o={})=>o.shouldFocus||tn(o.shouldFocus)?o.focusName||`${e}.${tn(o.focusIndex)?t:o.focusIndex}.`:"",Z_=e=>({isOnSubmit:!e||e===zc.onSubmit,isOnBlur:e===zc.onBlur,isOnChange:e===zc.onChange,isOnAll:e===zc.all,isOnTouch:e===zc.onTouched}),J_=(e,t,o)=>!o&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length)))),awe=(e,t,o)=>{const i=Y6(to(e,o));return Fi(i,"root",t[o]),Fi(e,o,i),e},I7=e=>typeof e=="boolean",_G=e=>e.type==="file",Wh=e=>typeof e=="function",Ck=e=>{if(!OG)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},L$=e=>Fu(e),VG=e=>e.type==="radio",Ak=e=>e instanceof RegExp;const rne={value:!1,isValid:!1},ine={value:!0,isValid:!0};var swe=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(o=>o&&o.checked&&!o.disabled).map(o=>o.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!tn(e[0].attributes.value)?tn(e[0].value)||e[0].value===""?ine:{value:e[0].value,isValid:!0}:ine:rne}return rne};const nne={isValid:!1,value:null};var lwe=e=>Array.isArray(e)?e.reduce((t,o)=>o&&o.checked&&!o.disabled?{isValid:!0,value:o.value}:t,nne):nne;function ane(e,t,o="validate"){if(L$(e)||Array.isArray(e)&&e.every(L$)||I7(e)&&!e)return{type:o,message:L$(e)?e:"",ref:t}}var of=e=>Ma(e)&&!Ak(e)?e:{value:e,message:""},X_=async(e,t,o,i,a)=>{const{ref:l,refs:d,required:c,maxLength:p,minLength:u,min:h,max:m,pattern:f,validate:x,name:y,valueAsNumber:w,mount:b,disabled:v}=e._f,A=to(t,y);if(!b||v)return{};const S=d?d[0]:l,E=R=>{i&&S.reportValidity&&(S.setCustomValidity(I7(R)?"":R||""),S.reportValidity())},j={},L=VG(l),M=ab(l),D=L||M,P=(w||_G(l))&&tn(l.value)&&tn(A)||Ck(l)&&l.value===""||A===""||Array.isArray(A)&&!A.length,T=zrt.bind(null,y,o,j),z=(R,K,Z,O=B2.maxLength,Q=B2.minLength)=>{const _=R?K:Z;j[y]={type:R?O:Q,message:_,ref:l,...T(R?O:Q,_)}};if(a?!Array.isArray(A)||!A.length:c&&(!D&&(P||xl(A))||I7(A)&&!A||M&&!swe(d).isValid||L&&!lwe(d).isValid)){const{value:R,message:K}=L$(c)?{value:!!c,message:c}:of(c);if(R&&(j[y]={type:B2.required,message:K,ref:S,...T(B2.required,K)},!o))return E(K),j}if(!P&&(!xl(h)||!xl(m))){let R,K;const Z=of(m),O=of(h);if(!xl(A)&&!isNaN(A)){const Q=l.valueAsNumber||A&&+A;xl(Z.value)||(R=Q>Z.value),xl(O.value)||(K=Q<O.value)}else{const Q=l.valueAsDate||new Date(A),_=H=>new Date(new Date().toDateString()+" "+H),F=l.type=="time",N=l.type=="week";Fu(Z.value)&&A&&(R=F?_(A)>_(Z.value):N?A>Z.value:Q>new Date(Z.value)),Fu(O.value)&&A&&(K=F?_(A)<_(O.value):N?A<O.value:Q<new Date(O.value))}if((R||K)&&(z(!!R,Z.message,O.message,B2.max,B2.min),!o))return E(j[y].message),j}if((p||u)&&!P&&(Fu(A)||a&&Array.isArray(A))){const R=of(p),K=of(u),Z=!xl(R.value)&&A.length>+R.value,O=!xl(K.value)&&A.length<+K.value;if((Z||O)&&(z(Z,R.message,K.message),!o))return E(j[y].message),j}if(f&&!P&&Fu(A)){const{value:R,message:K}=of(f);if(Ak(R)&&!A.match(R)&&(j[y]={type:B2.pattern,message:K,ref:l,...T(B2.pattern,K)},!o))return E(K),j}if(x){if(Wh(x)){const R=await x(A,t),K=ane(R,S);if(K&&(j[y]={...K,...T(B2.validate,K.message)},!o))return E(K.message),j}else if(Ma(x)){let R={};for(const K in x){if(!Dd(R)&&!o)break;const Z=ane(await x[K](A,t),S,K);Z&&(R={...Z,...T(K,Z.message)},E(Z.message),o&&(j[y]=R))}if(!Dd(R)&&(j[y]={ref:S,...R},!o))return j}}return E(!0),j};function FT(e,t){return[...e,...Fd(t)]}var OT=e=>Array.isArray(e)?e.map(()=>{}):void 0;function NT(e,t,o){return[...e.slice(0,t),...Fd(o),...e.slice(t)]}var HT=(e,t,o)=>Array.isArray(e)?(tn(e[o])&&(e[o]=void 0),e.splice(o,0,e.splice(t,1)[0]),e):[];function _T(e,t){return[...Fd(t),...Fd(e)]}function Rrt(e,t){let o=0;const i=[...e];for(const a of t)i.splice(a-o,1),o++;return Y6(i).length?i:[]}var VT=(e,t)=>tn(t)?[]:Rrt(e,Fd(t).sort((o,i)=>o-i)),QT=(e,t,o)=>{e[t]=[e[o],e[o]=e[t]][0]};function Frt(e,t){const o=t.slice(0,-1).length;let i=0;for(;i<o;)e=tn(e)?i++:e[t[i++]];return e}function Ort(e){for(const t in e)if(!tn(e[t]))return!1;return!0}function Ka(e,t){const o=Array.isArray(t)?t:HG(t)?[t]:nwe(t),i=o.length===1?e:Frt(e,o),a=o.length-1,l=o[a];return i&&delete i[l],a!==0&&(Ma(i)&&Dd(i)||Array.isArray(i)&&Ort(i))&&Ka(e,o.slice(0,-1)),e}var sne=(e,t,o)=>(e[t]=o,e);function dwe(e){const t=Wt(),{control:o=t.control,name:i,keyName:a="id",shouldUnregister:l}=e,[d,c]=$.useState(o._getFieldArray(i)),p=$.useRef(o._getFieldArray(i).map(ph)),u=$.useRef(d),h=$.useRef(i),m=$.useRef(!1);h.current=i,u.current=d,o._names.array.add(i),e.rules&&o.register(i,e.rules),SL({next:({values:j,name:L})=>{if(L===h.current||!L){const M=to(j,h.current);Array.isArray(M)&&(c(M),p.current=M.map(ph))}},subject:o._subjects.array});const f=$.useCallback(j=>{m.current=!0,o._updateFieldArray(i,j)},[o,i]),x=(j,L)=>{const M=Fd(Xl(j)),D=FT(o._getFieldArray(i),M);o._names.focus=RT(i,D.length-1,L),p.current=FT(p.current,M.map(ph)),f(D),c(D),o._updateFieldArray(i,D,FT,{argA:OT(j)})},y=(j,L)=>{const M=Fd(Xl(j)),D=_T(o._getFieldArray(i),M);o._names.focus=RT(i,0,L),p.current=_T(p.current,M.map(ph)),f(D),c(D),o._updateFieldArray(i,D,_T,{argA:OT(j)})},w=j=>{const L=VT(o._getFieldArray(i),j);p.current=VT(p.current,j),f(L),c(L),o._updateFieldArray(i,L,VT,{argA:j})},b=(j,L,M)=>{const D=Fd(Xl(L)),P=NT(o._getFieldArray(i),j,D);o._names.focus=RT(i,j,M),p.current=NT(p.current,j,D.map(ph)),f(P),c(P),o._updateFieldArray(i,P,NT,{argA:j,argB:OT(L)})},v=(j,L)=>{const M=o._getFieldArray(i);QT(M,j,L),QT(p.current,j,L),f(M),c(M),o._updateFieldArray(i,M,QT,{argA:j,argB:L},!1)},A=(j,L)=>{const M=o._getFieldArray(i);HT(M,j,L),HT(p.current,j,L),f(M),c(M),o._updateFieldArray(i,M,HT,{argA:j,argB:L},!1)},S=(j,L)=>{const M=Xl(L),D=sne(o._getFieldArray(i),j,M);p.current=[...D].map((P,T)=>!P||T===j?ph():p.current[T]),f(D),c([...D]),o._updateFieldArray(i,D,sne,{argA:j,argB:M},!0,!1)},E=j=>{const L=Fd(Xl(j));p.current=L.map(ph),f([...L]),c([...L]),o._updateFieldArray(i,[...L],M=>M,{},!0,!1)};return $.useEffect(()=>{if(o._state.action=!1,J_(i,o._names)&&o._subjects.state.next({...o._formState}),m.current&&(!Z_(o._options.mode).isOnSubmit||o._formState.isSubmitted))if(o._options.resolver)o._executeSchema([i]).then(j=>{const L=to(j.errors,i),M=to(o._formState.errors,i);(M?!L&&M.type:L&&L.type)&&(L?Fi(o._formState.errors,i,L):Ka(o._formState.errors,i),o._subjects.state.next({errors:o._formState.errors}))});else{const j=to(o._fields,i);j&&j._f&&X_(j,o._formValues,o._options.criteriaMode===zc.all,o._options.shouldUseNativeValidation,!0).then(L=>!Dd(L)&&o._subjects.state.next({errors:awe(o._formState.errors,L,i)}))}o._subjects.values.next({name:i,values:{...o._formValues}}),o._names.focus&&vk(o._fields,j=>!!j&&j.startsWith(o._names.focus||"")),o._names.focus="",o._updateValid()},[d,i,o]),$.useEffect(()=>(!to(o._formValues,i)&&o._updateFieldArray(i),()=>{(o._options.shouldUnregister||l)&&o.unregister(i)}),[i,o,a,l]),{swap:$.useCallback(v,[f,i,o]),move:$.useCallback(A,[f,i,o]),prepend:$.useCallback(y,[f,i,o]),append:$.useCallback(x,[f,i,o]),remove:$.useCallback(w,[f,i,o]),insert:$.useCallback(b,[f,i,o]),update:$.useCallback(S,[f,i,o]),replace:$.useCallback(E,[f,i,o]),fields:$.useMemo(()=>d.map((j,L)=>({...j,[a]:p.current[L]||ph()})),[d,a])}}function UT(){let e=[];return{get observers(){return e},next:t=>{for(const o of e)o.next&&o.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(o=>o!==t)}}),unsubscribe:()=>{e=[]}}}var $k=e=>xl(e)||!Zye(e);function X3(e,t){if($k(e)||$k(t))return e===t;if(p7(e)&&p7(t))return e.getTime()===t.getTime();const o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;for(const a of o){const l=e[a];if(!i.includes(a))return!1;if(a!=="ref"){const d=t[a];if(p7(l)&&p7(d)||Ma(l)&&Ma(d)||Array.isArray(l)&&Array.isArray(d)?!X3(l,d):l!==d)return!1}}return!0}var cwe=e=>e.type==="select-multiple",Nrt=e=>VG(e)||ab(e),WT=e=>Ck(e)&&e.isConnected,pwe=e=>{for(const t in e)if(Wh(e[t]))return!0;return!1};function kk(e,t={}){const o=Array.isArray(e);if(Ma(e)||o)for(const i in e)Array.isArray(e[i])||Ma(e[i])&&!pwe(e[i])?(t[i]=Array.isArray(e[i])?[]:{},kk(e[i],t[i])):xl(e[i])||(t[i]=!0);return t}function uwe(e,t,o){const i=Array.isArray(e);if(Ma(e)||i)for(const a in e)Array.isArray(e[a])||Ma(e[a])&&!pwe(e[a])?tn(t)||$k(o[a])?o[a]=Array.isArray(e[a])?kk(e[a],[]):{...kk(e[a])}:uwe(e[a],xl(t)?{}:t[a],o[a]):o[a]=!X3(e[a],t[a]);return o}var GT=(e,t)=>uwe(e,t,kk(t)),hwe=(e,{valueAsNumber:t,valueAsDate:o,setValueAs:i})=>tn(e)?e:t?e===""?NaN:e&&+e:o&&Fu(e)?new Date(e):i?i(e):e;function YT(e){const t=e.ref;if(!(e.refs?e.refs.every(o=>o.disabled):t.disabled))return _G(t)?t.files:VG(t)?lwe(e.refs).value:cwe(t)?[...t.selectedOptions].map(({value:o})=>o):ab(t)?swe(e.refs).value:hwe(tn(t.value)?e.ref.value:t.value,e)}var Hrt=(e,t,o,i)=>{const a={};for(const l of e){const d=to(t,l);d&&Fi(a,l,d._f)}return{criteriaMode:o,names:[...e],fields:a,shouldUseNativeValidation:i}},g9=e=>tn(e)?e:Ak(e)?e.source:Ma(e)?Ak(e.value)?e.value.source:e.value:e,_rt=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function lne(e,t,o){const i=to(e,o);if(i||HG(o))return{error:i,name:o};const a=o.split(".");for(;a.length;){const l=a.join("."),d=to(t,l),c=to(e,l);if(d&&!Array.isArray(d)&&o!==l)return{name:o};if(c&&c.type)return{name:l,error:c};a.pop()}return{name:o}}var Vrt=(e,t,o,i,a)=>a.isOnAll?!1:!o&&a.isOnTouch?!(t||e):(o?i.isOnBlur:a.isOnBlur)?!e:(o?i.isOnChange:a.isOnChange)?e:!0,Qrt=(e,t)=>!Y6(to(e,t)).length&&Ka(e,t);const Urt={mode:zc.onSubmit,reValidateMode:zc.onChange,shouldFocusError:!0};function Wrt(e={},t){let o={...Urt,...e},i={submitCount:0,isDirty:!1,isLoading:Wh(o.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},a={},l=Ma(o.defaultValues)||Ma(o.values)?Xl(o.defaultValues||o.values)||{}:{},d=o.shouldUnregister?{}:Xl(l),c={action:!1,mount:!1,watch:!1},p={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,h=0;const m={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:UT(),array:UT(),state:UT()},x=e.resetOptions&&e.resetOptions.keepDirtyValues,y=Z_(o.mode),w=Z_(o.reValidateMode),b=o.criteriaMode===zc.all,v=le=>pe=>{clearTimeout(h),h=setTimeout(le,pe)},A=async le=>{if(m.isValid||le){const pe=o.resolver?Dd((await P()).errors):await z(a,!0);pe!==i.isValid&&f.state.next({isValid:pe})}},S=le=>m.isValidating&&f.state.next({isValidating:le}),E=(le,pe=[],ae,be,ue=!0,se=!0)=>{if(be&&ae){if(c.action=!0,se&&Array.isArray(to(a,le))){const ge=ae(to(a,le),be.argA,be.argB);ue&&Fi(a,le,ge)}if(se&&Array.isArray(to(i.errors,le))){const ge=ae(to(i.errors,le),be.argA,be.argB);ue&&Fi(i.errors,le,ge),Qrt(i.errors,le)}if(m.touchedFields&&se&&Array.isArray(to(i.touchedFields,le))){const ge=ae(to(i.touchedFields,le),be.argA,be.argB);ue&&Fi(i.touchedFields,le,ge)}m.dirtyFields&&(i.dirtyFields=GT(l,d)),f.state.next({name:le,isDirty:K(le,pe),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else Fi(d,le,pe)},j=(le,pe)=>{Fi(i.errors,le,pe),f.state.next({errors:i.errors})},L=(le,pe,ae,be)=>{const ue=to(a,le);if(ue){const se=to(d,le,tn(ae)?to(l,le):ae);tn(se)||be&&be.defaultChecked||pe?Fi(d,le,pe?se:YT(ue._f)):Q(le,se),c.mount&&A()}},M=(le,pe,ae,be,ue)=>{let se=!1,ge=!1;const Ee={name:le};if(!ae||be){m.isDirty&&(ge=i.isDirty,i.isDirty=Ee.isDirty=K(),se=ge!==Ee.isDirty);const $e=X3(to(l,le),pe);ge=to(i.dirtyFields,le),$e?Ka(i.dirtyFields,le):Fi(i.dirtyFields,le,!0),Ee.dirtyFields=i.dirtyFields,se=se||m.dirtyFields&&ge!==!$e}if(ae){const $e=to(i.touchedFields,le);$e||(Fi(i.touchedFields,le,ae),Ee.touchedFields=i.touchedFields,se=se||m.touchedFields&&$e!==ae)}return se&&ue&&f.state.next(Ee),se?Ee:{}},D=(le,pe,ae,be)=>{const ue=to(i.errors,le),se=m.isValid&&I7(pe)&&i.isValid!==pe;if(e.delayError&&ae?(u=v(()=>j(le,ae)),u(e.delayError)):(clearTimeout(h),u=null,ae?Fi(i.errors,le,ae):Ka(i.errors,le)),(ae?!X3(ue,ae):ue)||!Dd(be)||se){const ge={...be,...se&&I7(pe)?{isValid:pe}:{},errors:i.errors,name:le};i={...i,...ge},f.state.next(ge)}S(!1)},P=async le=>o.resolver(d,o.context,Hrt(le||p.mount,a,o.criteriaMode,o.shouldUseNativeValidation)),T=async le=>{const{errors:pe}=await P();if(le)for(const ae of le){const be=to(pe,ae);be?Fi(i.errors,ae,be):Ka(i.errors,ae)}else i.errors=pe;return pe},z=async(le,pe,ae={valid:!0})=>{for(const be in le){const ue=le[be];if(ue){const{_f:se,...ge}=ue;if(se){const Ee=p.array.has(se.name),$e=await X_(ue,d,b,o.shouldUseNativeValidation&&!pe,Ee);if($e[se.name]&&(ae.valid=!1,pe))break;!pe&&(to($e,se.name)?Ee?awe(i.errors,$e,se.name):Fi(i.errors,se.name,$e[se.name]):Ka(i.errors,se.name))}ge&&await z(ge,pe,ae)}}return ae.valid},R=()=>{for(const le of p.unMount){const pe=to(a,le);pe&&(pe._f.refs?pe._f.refs.every(ae=>!WT(ae)):!WT(pe._f.ref))&&ie(le)}p.unMount=new Set},K=(le,pe)=>(le&&pe&&Fi(d,le,pe),!X3(ee(),l)),Z=(le,pe,ae)=>iwe(le,p,{...c.mount?d:tn(pe)?l:Fu(le)?{[le]:pe}:pe},ae,pe),O=le=>Y6(to(c.mount?d:l,le,e.shouldUnregister?to(l,le,[]):[])),Q=(le,pe,ae={})=>{const be=to(a,le);let ue=pe;if(be){const se=be._f;se&&(!se.disabled&&Fi(d,le,hwe(pe,se)),ue=Ck(se.ref)&&xl(pe)?"":pe,cwe(se.ref)?[...se.ref.options].forEach(ge=>ge.selected=ue.includes(ge.value)):se.refs?ab(se.ref)?se.refs.length>1?se.refs.forEach(ge=>(!ge.defaultChecked||!ge.disabled)&&(ge.checked=Array.isArray(ue)?!!ue.find(Ee=>Ee===ge.value):ue===ge.value)):se.refs[0]&&(se.refs[0].checked=!!ue):se.refs.forEach(ge=>ge.checked=ge.value===ue):_G(se.ref)?se.ref.value="":(se.ref.value=ue,se.ref.type||f.values.next({name:le,values:{...d}})))}(ae.shouldDirty||ae.shouldTouch)&&M(le,ue,ae.shouldTouch,ae.shouldDirty,!0),ae.shouldValidate&&H(le)},_=(le,pe,ae)=>{for(const be in pe){const ue=pe[be],se=`${le}.${be}`,ge=to(a,se);(p.array.has(le)||!$k(ue)||ge&&!ge._f)&&!p7(ue)?_(se,ue,ae):Q(se,ue,ae)}},F=(le,pe,ae={})=>{const be=to(a,le),ue=p.array.has(le),se=Xl(pe);Fi(d,le,se),ue?(f.array.next({name:le,values:{...d}}),(m.isDirty||m.dirtyFields)&&ae.shouldDirty&&f.state.next({name:le,dirtyFields:GT(l,d),isDirty:K(le,se)})):be&&!be._f&&!xl(se)?_(le,se,ae):Q(le,se,ae),J_(le,p)&&f.state.next({...i}),f.values.next({name:le,values:{...d}}),!c.mount&&t()},N=async le=>{const pe=le.target;let ae=pe.name,be=!0;const ue=to(a,ae),se=()=>pe.type?YT(ue._f):Jye(le);if(ue){let ge,Ee;const $e=se(),Ve=le.type===bk.BLUR||le.type===bk.FOCUS_OUT,Le=!_rt(ue._f)&&!o.resolver&&!to(i.errors,ae)&&!ue._f.deps||Vrt(Ve,to(i.touchedFields,ae),i.isSubmitted,w,y),He=J_(ae,p,Ve);Fi(d,ae,$e),Ve?(ue._f.onBlur&&ue._f.onBlur(le),u&&u(0)):ue._f.onChange&&ue._f.onChange(le);const De=M(ae,$e,Ve,!1),Me=!Dd(De)||He;if(!Ve&&f.values.next({name:ae,type:le.type,values:{...d}}),Le)return m.isValid&&A(),Me&&f.state.next({name:ae,...He?{}:De});if(!Ve&&He&&f.state.next({...i}),S(!0),o.resolver){const{errors:Pe}=await P([ae]),ze=lne(i.errors,a,ae),Be=lne(Pe,a,ze.name||ae);ge=Be.error,ae=Be.name,Ee=Dd(Pe)}else ge=(await X_(ue,d,b,o.shouldUseNativeValidation))[ae],be=isNaN($e)||$e===to(d,ae,$e),be&&(ge?Ee=!1:m.isValid&&(Ee=await z(a,!0)));be&&(ue._f.deps&&H(ue._f.deps),D(ae,Ee,ge,De))}},H=async(le,pe={})=>{let ae,be;const ue=Fd(le);if(S(!0),o.resolver){const se=await T(tn(le)?le:ue);ae=Dd(se),be=le?!ue.some(ge=>to(se,ge)):ae}else le?(be=(await Promise.all(ue.map(async se=>{const ge=to(a,se);return await z(ge&&ge._f?{[se]:ge}:ge)}))).every(Boolean),!(!be&&!i.isValid)&&A()):be=ae=await z(a);return f.state.next({...!Fu(le)||m.isValid&&ae!==i.isValid?{}:{name:le},...o.resolver||!le?{isValid:ae}:{},errors:i.errors,isValidating:!1}),pe.shouldFocus&&!be&&vk(a,se=>se&&to(i.errors,se),le?ue:p.mount),be},ee=le=>{const pe={...l,...c.mount?d:{}};return tn(le)?pe:Fu(le)?to(pe,le):le.map(ae=>to(pe,ae))},Y=(le,pe)=>({invalid:!!to((pe||i).errors,le),isDirty:!!to((pe||i).dirtyFields,le),isTouched:!!to((pe||i).touchedFields,le),error:to((pe||i).errors,le)}),G=le=>{le&&Fd(le).forEach(pe=>Ka(i.errors,pe)),f.state.next({errors:le?i.errors:{}})},J=(le,pe,ae)=>{const be=(to(a,le,{_f:{}})._f||{}).ref;Fi(i.errors,le,{...pe,ref:be}),f.state.next({name:le,errors:i.errors,isValid:!1}),ae&&ae.shouldFocus&&be&&be.focus&&be.focus()},X=(le,pe)=>Wh(le)?f.values.subscribe({next:ae=>le(Z(void 0,pe),ae)}):Z(le,pe,!0),ie=(le,pe={})=>{for(const ae of le?Fd(le):p.mount)p.mount.delete(ae),p.array.delete(ae),pe.keepValue||(Ka(a,ae),Ka(d,ae)),!pe.keepError&&Ka(i.errors,ae),!pe.keepDirty&&Ka(i.dirtyFields,ae),!pe.keepTouched&&Ka(i.touchedFields,ae),!o.shouldUnregister&&!pe.keepDefaultValue&&Ka(l,ae);f.values.next({values:{...d}}),f.state.next({...i,...pe.keepDirty?{isDirty:K()}:{}}),!pe.keepIsValid&&A()},we=(le,pe={})=>{let ae=to(a,le);const be=I7(pe.disabled);return Fi(a,le,{...ae||{},_f:{...ae&&ae._f?ae._f:{ref:{name:le}},name:le,mount:!0,...pe}}),p.mount.add(le),ae?be&&Fi(d,le,pe.disabled?void 0:to(d,le,YT(ae._f))):L(le,!0,pe.value),{...be?{disabled:pe.disabled}:{},...o.shouldUseNativeValidation?{required:!!pe.required,min:g9(pe.min),max:g9(pe.max),minLength:g9(pe.minLength),maxLength:g9(pe.maxLength),pattern:g9(pe.pattern)}:{},name:le,onChange:N,onBlur:N,ref:ue=>{if(ue){we(le,pe),ae=to(a,le);const se=tn(ue.value)&&ue.querySelectorAll&&ue.querySelectorAll("input,select,textarea")[0]||ue,ge=Nrt(se),Ee=ae._f.refs||[];if(ge?Ee.find($e=>$e===se):se===ae._f.ref)return;Fi(a,le,{_f:{...ae._f,...ge?{refs:[...Ee.filter(WT),se,...Array.isArray(to(l,le))?[{}]:[]],ref:{type:se.type,name:le}}:{ref:se}}}),L(le,!1,void 0,se)}else ae=to(a,le,{}),ae._f&&(ae._f.mount=!1),(o.shouldUnregister||pe.shouldUnregister)&&!(Xye(p.array,le)&&c.action)&&p.unMount.add(le)}}},me=()=>o.shouldFocusError&&vk(a,le=>le&&to(i.errors,le),p.mount),de=(le,pe)=>async ae=>{ae&&(ae.preventDefault&&ae.preventDefault(),ae.persist&&ae.persist());let be=Xl(d);if(f.state.next({isSubmitting:!0}),o.resolver){const{errors:ue,values:se}=await P();i.errors=ue,be=se}else await z(a);Ka(i.errors,"root"),Dd(i.errors)?(f.state.next({errors:{}}),await le(be,ae)):(pe&&await pe({...i.errors},ae),me(),setTimeout(me)),f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Dd(i.errors),submitCount:i.submitCount+1,errors:i.errors})},ce=(le,pe={})=>{to(a,le)&&(tn(pe.defaultValue)?F(le,to(l,le)):(F(le,pe.defaultValue),Fi(l,le,pe.defaultValue)),pe.keepTouched||Ka(i.touchedFields,le),pe.keepDirty||(Ka(i.dirtyFields,le),i.isDirty=pe.defaultValue?K(le,to(l,le)):K()),pe.keepError||(Ka(i.errors,le),m.isValid&&A()),f.state.next({...i}))},fe=(le,pe={})=>{const ae=le||l,be=Xl(ae),ue=le&&!Dd(le)?be:l;if(pe.keepDefaultValues||(l=ae),!pe.keepValues){if(pe.keepDirtyValues||x)for(const se of p.mount)to(i.dirtyFields,se)?Fi(ue,se,to(d,se)):F(se,to(ue,se));else{if(OG&&tn(le))for(const se of p.mount){const ge=to(a,se);if(ge&&ge._f){const Ee=Array.isArray(ge._f.refs)?ge._f.refs[0]:ge._f.ref;if(Ck(Ee)){const $e=Ee.closest("form");if($e){$e.reset();break}}}}a={}}d=e.shouldUnregister?pe.keepDefaultValues?Xl(l):{}:be,f.array.next({values:{...ue}}),f.values.next({values:{...ue}})}p={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!c.mount&&t(),c.mount=!m.isValid||!!pe.keepIsValid,c.watch=!!e.shouldUnregister,f.state.next({submitCount:pe.keepSubmitCount?i.submitCount:0,isDirty:pe.keepDirty?i.isDirty:!!(pe.keepDefaultValues&&!X3(le,l)),isSubmitted:pe.keepIsSubmitted?i.isSubmitted:!1,dirtyFields:pe.keepDirtyValues?i.dirtyFields:pe.keepDefaultValues&&le?GT(l,le):{},touchedFields:pe.keepTouched?i.touchedFields:{},errors:pe.keepErrors?i.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},Ae=(le,pe)=>fe(Wh(le)?le(d):le,pe);return{control:{register:we,unregister:ie,getFieldState:Y,_executeSchema:P,_getWatch:Z,_getDirty:K,_updateValid:A,_removeUnmounted:R,_updateFieldArray:E,_getFieldArray:O,_reset:fe,_resetDefaultValues:()=>Wh(o.defaultValues)&&o.defaultValues().then(le=>{Ae(le,o.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:le=>{i={...i,...le}},_subjects:f,_proxyFormState:m,get _fields(){return a},get _formValues(){return d},get _state(){return c},set _state(le){c=le},get _defaultValues(){return l},get _names(){return p},set _names(le){p=le},get _formState(){return i},set _formState(le){i=le},get _options(){return o},set _options(le){o={...o,...le}}},trigger:H,register:we,handleSubmit:de,watch:X,setValue:F,getValues:ee,reset:Ae,resetField:ce,clearErrors:G,unregister:ie,setError:J,setFocus:(le,pe={})=>{const ae=to(a,le),be=ae&&ae._f;if(be){const ue=be.refs?be.refs[0]:be.ref;ue.focus&&(ue.focus(),pe.shouldSelect&&ue.select())}},getFieldState:Y}}function Qi(e={}){const t=$.useRef(),[o,i]=$.useState({isDirty:!1,isValidating:!1,isLoading:Wh(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Wh(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Wrt(e,()=>i(l=>({...l}))),formState:o});const a=t.current.control;return a._options=e,SL({subject:a._subjects.state,next:l=>{owe(l,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),$.useEffect(()=>{e.values&&!X3(e.values,a._defaultValues)?a._reset(e.values,a._options.resetOptions):a._resetDefaultValues()},[e.values,a]),$.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=twe(o,a),t.current}function rf(){}function Grt(){return!0}function f9(e){return!!(e||"").match(/\d/)}function dne(e){return e==null}function cne(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Yrt(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}function Krt(e,t,o){var i=Yrt(o),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(i,"$1"+t)}function eV(e,t){t===void 0&&(t=!0);var o=e[0]==="-",i=o&&t;e=e.replace("-","");var a=e.split("."),l=a[0],d=a[1]||"";return{beforeDecimal:l,afterDecimal:d,hasNagation:o,addNegation:i}}function qrt(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var o=e.split("."),i=o[0].replace(/^0+/,"")||"0",a=o[1]||"";return(t?"-":"")+i+(a?"."+a:"")}function mwe(e,t,o){for(var i="",a=o?"0":"",l=0;l<=t-1;l++)i+=e[l]||a;return i}function pne(e,t){return Array(t+1).join(e)}function Zrt(e){e+="";var t=e[0]==="-"?"-":"";t&&(e=e.substring(1));var o=e.split(/[eE]/g),i=o[0],a=o[1];if(a=Number(a),!a)return t+i;i=i.replace(".","");var l=1+a,d=i.length;return l<0?i="0."+pne("0",Math.abs(l))+i:l>=d?i=i+pne("0",l-d):i=(i.substring(0,l)||"0")+"."+i.substring(l),t+i}function Jrt(e,t,o){if(["","-"].indexOf(e)!==-1)return e;var i=e.indexOf(".")!==-1&&t,a=eV(e),l=a.beforeDecimal,d=a.afterDecimal,c=a.hasNagation,p=parseFloat("0."+(d||"0")),u=d.length<=t?"0."+d:p.toFixed(t),h=u.split("."),m=l.split("").reverse().reduce(function(w,b,v){return w.length>v?(Number(w[0])+Number(b)).toString()+w.substring(1,w.length):b+w},h[0]),f=mwe(h[1]||"",Math.min(t,d.length),o),x=c?"-":"",y=i?".":"";return""+x+m+y+f}function une(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var o=e.createTextRange();return o.move("character",t),o.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function Xrt(e,t){for(var o=0,i=0,a=e.length,l=t.length;e[o]===t[o]&&o<a;)o++;for(;e[a-1-i]===t[l-1-i]&&l-i>o&&a-i>o;)i++;return{start:o,end:a-i}}function KT(e,t,o){return Math.min(Math.max(e,t),o)}function hne(e){return Math.max(e.selectionStart,e.selectionEnd)}function eit(e){return e||typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function tit(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)===-1&&(o[i]=e[i]);return o}var oit={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:rf,onChange:rf,onKeyDown:rf,onMouseUp:rf,onFocus:rf,onBlur:rf,isAllowed:Grt},sb=function(e){function t(o){e.call(this,o);var i=o.defaultValue;this.validateProps();var a=this.formatValueProp(i);this.state={value:a,numAsString:this.removeFormatting(a),mounted:!1},this.selectionBeforeInput={selectionStart:0,selectionEnd:0},this.onChange=this.onChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.componentDidMount=function(){this.setState({mounted:!0})},t.prototype.componentDidUpdate=function(o){this.updateValueIfRequired(o)},t.prototype.componentWillUnmount=function(){clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout)},t.prototype.updateValueIfRequired=function(o){var i=this,a=i.props,l=i.state,d=i.focusedElm,c=l.value,p=l.numAsString;if(p===void 0&&(p=""),o!==a){this.validateProps();var u=this.formatNumString(p),h=dne(a.value)?u:this.formatValueProp(),m=this.removeFormatting(h),f=parseFloat(m),x=parseFloat(p);((!isNaN(f)||!isNaN(x))&&f!==x||u!==c||d===null&&h!==c)&&this.updateValue({formattedValue:h,numAsString:m,input:d,source:"prop",event:null})}},t.prototype.getFloatString=function(o){o===void 0&&(o="");var i=this.props,a=i.decimalScale,l=this.getSeparators(),d=l.decimalSeparator,c=this.getNumberRegex(!0),p=o[0]==="-";p&&(o=o.replace("-","")),d&&a===0&&(o=o.split(d)[0]),o=(o.match(c)||[]).join("").replace(d,".");var u=o.indexOf(".");return u!==-1&&(o=o.substring(0,u)+"."+o.substring(u+1,o.length).replace(new RegExp(cne(d),"g"),"")),p&&(o="-"+o),o},t.prototype.getNumberRegex=function(o,i){var a=this.props,l=a.format,d=a.decimalScale,c=a.customNumerals,p=this.getSeparators(),u=p.decimalSeparator;return new RegExp("[0-9"+(c?c.join(""):"")+"]"+(u&&d!==0&&!i&&!l?"|"+cne(u):""),o?"g":void 0)},t.prototype.getSeparators=function(){var o=this.props,i=o.decimalSeparator,a=this.props,l=a.thousandSeparator,d=a.allowedDecimalSeparators;return l===!0&&(l=","),d||(d=[i,"."]),{decimalSeparator:i,thousandSeparator:l,allowedDecimalSeparators:d}},t.prototype.getMaskAtIndex=function(o){var i=this.props,a=i.mask;return a===void 0&&(a=" "),typeof a=="string"?a:a[o]||" "},t.prototype.getValueObject=function(o,i){var a=parseFloat(i);return{formattedValue:o,value:i,floatValue:isNaN(a)?void 0:a}},t.prototype.validateProps=function(){var o=this.props,i=o.mask,a=this.getSeparators(),l=a.decimalSeparator,d=a.thousandSeparator;if(l===d)throw new Error(`
92
+ `))}function p(x,y,w,b){const v=w.enter("tableCell"),A=w.enter("phrasing"),S=w.containerPhrasing(x,{...b,before:l,after:l});return A(),v(),S}function u(x,y){return Ret(x,{align:y,alignDelimiters:i,padding:o,stringLength:a})}function h(x,y,w){const b=x.children;let v=-1;const A=[],S=y.enter("table");for(;++v<b.length;)A[v]=m(b[v],y,w);return S(),A}function m(x,y,w){const b=x.children;let v=-1;const A=[],S=y.enter("tableRow");for(;++v<b.length;)A[v]=p(b[v],x,y,w);return S(),A}function f(x,y,w){let b=fye.inlineCode(x,y,w);return w.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function $tt(){return{exit:{taskListCheckValueChecked:moe,taskListCheckValueUnchecked:moe,paragraph:Stt}}}function ktt(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ett}}}function moe(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Stt(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const o=this.stack[this.stack.length-1];o.type;const i=o.children[0];if(i&&i.type==="text"){const a=t.children;let l=-1,d;for(;++l<a.length;){const c=a[l];if(c.type==="paragraph"){d=c;break}}d===o&&(i.value=i.value.slice(1),i.value.length===0?o.children.shift():o.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,o.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function Ett(e,t,o,i){const a=e.children[0],l=typeof e.checked=="boolean"&&a&&a.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",c=o.createTracker(i);l&&c.move(d);let p=fye.listItem(e,t,o,{...i,...c.current()});return l&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),p;function u(h){return h+d}}function Ltt(){return[iet(),Eet(),Met(),xtt(),$tt()]}function Itt(e){return{extensions:[net(),Let(e),Bet(),Att(e),ktt()]}}const jtt={tokenize:ztt,partial:!0},xye={tokenize:Rtt,partial:!0},yye={tokenize:Ftt,partial:!0},wye={tokenize:Ott,partial:!0},Mtt={tokenize:Ntt,partial:!0},bye={name:"wwwAutolink",tokenize:Ptt,previous:Cye},vye={name:"protocolAutolink",tokenize:Ttt,previous:Aye},F0={name:"emailAutolink",tokenize:Dtt,previous:$ye},l2={};function Btt(){return{text:l2}}let Vg=48;for(;Vg<123;)l2[Vg]=F0,Vg++,Vg===58?Vg=65:Vg===91&&(Vg=97);l2[43]=F0;l2[45]=F0;l2[46]=F0;l2[95]=F0;l2[72]=[F0,vye];l2[104]=[F0,vye];l2[87]=[F0,bye];l2[119]=[F0,bye];function Dtt(e,t,o){const i=this;let a,l;return d;function d(m){return!Y_(m)||!$ye.call(i,i.previous)||EG(i.events)?o(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return Y_(m)?(e.consume(m),c):m===64?(e.consume(m),p):o(m)}function p(m){return m===46?e.check(Mtt,h,u)(m):m===45||m===95||Gs(m)?(l=!0,e.consume(m),p):h(m)}function u(m){return e.consume(m),a=!0,p}function h(m){return l&&a&&bl(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):o(m)}}function Ptt(e,t,o){const i=this;return a;function a(d){return d!==87&&d!==119||!Cye.call(i,i.previous)||EG(i.events)?o(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(jtt,e.attempt(xye,e.attempt(yye,l),o),o)(d))}function l(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(d)}}function Ttt(e,t,o){const i=this;let a="",l=!1;return d;function d(m){return(m===72||m===104)&&Aye.call(i,i.previous)&&!EG(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(m),e.consume(m),c):o(m)}function c(m){if(bl(m)&&a.length<5)return a+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const f=a.toLowerCase();if(f==="http"||f==="https")return e.consume(m),p}return o(m)}function p(m){return m===47?(e.consume(m),l?u:(l=!0,p)):o(m)}function u(m){return m===null||gk(m)||_i(m)||S4(m)||xL(m)?o(m):e.attempt(xye,e.attempt(yye,h),o)(m)}function h(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function ztt(e,t,o){let i=0;return a;function a(d){return(d===87||d===119)&&i<3?(i++,e.consume(d),a):d===46&&i===3?(e.consume(d),l):o(d)}function l(d){return d===null?o(d):t(d)}}function Rtt(e,t,o){let i,a,l;return d;function d(u){return u===46||u===95?e.check(wye,p,c)(u):u===null||_i(u)||S4(u)||u!==45&&xL(u)?p(u):(l=!0,e.consume(u),d)}function c(u){return u===95?i=!0:(a=i,i=void 0),e.consume(u),d}function p(u){return a||i||!l?o(u):t(u)}}function Ftt(e,t){let o=0,i=0;return a;function a(d){return d===40?(o++,e.consume(d),a):d===41&&i<o?l(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(wye,t,l)(d):d===null||_i(d)||S4(d)?t(d):(e.consume(d),a)}function l(d){return d===41&&i++,e.consume(d),a}}function Ott(e,t,o){return i;function i(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),i):c===38?(e.consume(c),l):c===93?(e.consume(c),a):c===60||c===null||_i(c)||S4(c)?t(c):o(c)}function a(c){return c===null||c===40||c===91||_i(c)||S4(c)?t(c):i(c)}function l(c){return bl(c)?d(c):o(c)}function d(c){return c===59?(e.consume(c),i):bl(c)?(e.consume(c),d):o(c)}}function Ntt(e,t,o){return i;function i(l){return e.consume(l),a}function a(l){return Gs(l)?o(l):t(l)}}function Cye(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||_i(e)}function Aye(e){return!bl(e)}function $ye(e){return!(e===47||Y_(e))}function Y_(e){return e===43||e===45||e===46||e===95||Gs(e)}function EG(e){let t=e.length,o=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){o=!0;break}if(i._gfmAutolinkLiteralWalkedInto){o=!1;break}}return e.length>0&&!o&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),o}const Htt={tokenize:Ktt,partial:!0};function _tt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Wtt,continuation:{tokenize:Gtt},exit:Ytt}},text:{91:{name:"gfmFootnoteCall",tokenize:Utt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Vtt,resolveTo:Qtt}}}}function Vtt(e,t,o){const i=this;let a=i.events.length;const l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let d;for(;a--;){const p=i.events[a][1];if(p.type==="labelImage"){d=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return c;function c(p){if(!d||!d._balanced)return o(p);const u=z1(i.sliceSerialize({start:d.end,end:i.now()}));return u.codePointAt(0)!==94||!l.includes(u.slice(1))?o(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),t(p))}}function Qtt(e,t){let o=e.length;for(;o--;)if(e[o][1].type==="labelImage"&&e[o][0]==="enter"){e[o][1];break}e[o+1][1].type="data",e[o+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[o+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[o+3][1].end),end:Object.assign({},e[o+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[e[o+1],e[o+2],["enter",i,t],e[o+3],e[o+4],["enter",a,t],["exit",a,t],["enter",l,t],["enter",d,t],["exit",d,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(o,e.length-o+1,...c),e}function Utt(e,t,o){const i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l=0,d;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),p}function p(m){return m!==94?o(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(m){if(l>999||m===93&&!d||m===null||m===91||_i(m))return o(m);if(m===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return a.includes(z1(i.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):o(m)}return _i(m)||(d=!0),l++,e.consume(m),m===92?h:u}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,u):u(m)}}function Wtt(e,t,o){const i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l,d=0,c;return p;function p(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):o(y)}function h(y){if(d>999||y===93&&!c||y===null||y===91||_i(y))return o(y);if(y===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return l=z1(i.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return _i(y)||(c=!0),d++,e.consume(y),y===92?m:h}function m(y){return y===91||y===92||y===93?(e.consume(y),d++,h):h(y)}function f(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),a.includes(l)||a.push(l),Zr(e,x,"gfmFootnoteDefinitionWhitespace")):o(y)}function x(y){return t(y)}}function Gtt(e,t,o){return e.check(Zw,t,e.attempt(Htt,t,o))}function Ytt(e){e.exit("gfmFootnoteDefinition")}function Ktt(e,t,o){const i=this;return Zr(e,a,"gfmFootnoteDefinitionIndent",5);function a(l){const d=i.events[i.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?t(l):o(l)}}function qtt(e){let t=(e||{}).singleTilde;const o={name:"strikethrough",tokenize:a,resolveAll:i};return t==null&&(t=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function i(l,d){let c=-1;for(;++c<l.length;)if(l[c][0]==="enter"&&l[c][1].type==="strikethroughSequenceTemporary"&&l[c][1]._close){let p=c;for(;p--;)if(l[p][0]==="exit"&&l[p][1].type==="strikethroughSequenceTemporary"&&l[p][1]._open&&l[c][1].end.offset-l[c][1].start.offset===l[p][1].end.offset-l[p][1].start.offset){l[c][1].type="strikethroughSequence",l[p][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},l[p][1].start),end:Object.assign({},l[c][1].end)},h={type:"strikethroughText",start:Object.assign({},l[p][1].end),end:Object.assign({},l[c][1].start)},m=[["enter",u,d],["enter",l[p][1],d],["exit",l[p][1],d],["enter",h,d]],f=d.parser.constructs.insideSpan.null;f&&Qd(m,m.length,0,yL(f,l.slice(p+1,c),d)),Qd(m,m.length,0,[["exit",h,d],["enter",l[c][1],d],["exit",l[c][1],d],["exit",u,d]]),Qd(l,p-1,c-p+3,m),c=p+m.length-2;break}}for(c=-1;++c<l.length;)l[c][1].type==="strikethroughSequenceTemporary"&&(l[c][1].type="data");return l}function a(l,d,c){const p=this.previous,u=this.events;let h=0;return m;function m(x){return p===126&&u[u.length-1][1].type!=="characterEscape"?c(x):(l.enter("strikethroughSequenceTemporary"),f(x))}function f(x){const y=r6(p);if(x===126)return h>1?c(x):(l.consume(x),h++,f);if(h<2&&!t)return c(x);const w=l.exit("strikethroughSequenceTemporary"),b=r6(x);return w._open=!b||b===2&&!!y,w._close=!y||y===2&&!!b,d(x)}}}class Ztt{constructor(){this.map=[]}add(t,o,i){Jtt(this,t,o,i)}consume(t){if(this.map.sort(function(l,d){return l[0]-d[0]}),this.map.length===0)return;let o=this.map.length;const i=[];for(;o>0;)o-=1,i.push(t.slice(this.map[o][0]+this.map[o][1]),this.map[o][2]),t.length=this.map[o][0];i.push(t.slice()),t.length=0;let a=i.pop();for(;a;){for(const l of a)t.push(l);a=i.pop()}this.map.length=0}}function Jtt(e,t,o,i){let a=0;if(!(o===0&&i.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=o,e.map[a][2].push(...i);return}a+=1}e.map.push([t,o,i])}}function Xtt(e,t){let o=!1;const i=[];for(;t<e.length;){const a=e[t];if(o){if(a[0]==="enter")a[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=i.length-1;i[l]=i[l]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(o=!0);t+=1}return i}function eot(){return{flow:{null:{name:"table",tokenize:tot,resolveAll:oot}}}}function tot(e,t,o){const i=this;let a=0,l=0,d;return c;function c(T){let z=i.events.length-1;for(;z>-1;){const Z=i.events[z][1].type;if(Z==="lineEnding"||Z==="linePrefix")z--;else break}const R=z>-1?i.events[z][1].type:null,K=R==="tableHead"||R==="tableRow"?L:p;return K===L&&i.parser.lazy[i.now().line]?o(T):K(T)}function p(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(d=!0,l+=1),h(T)}function h(T){return T===null?o(T):Fo(T)?l>1?(l=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),x):o(T):Pr(T)?Zr(e,h,"whitespace")(T):(l+=1,d&&(d=!1,a+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),d=!0,h):(e.enter("data"),m(T)))}function m(T){return T===null||T===124||_i(T)?(e.exit("data"),h(T)):(e.consume(T),T===92?f:m)}function f(T){return T===92||T===124?(e.consume(T),m):m(T)}function x(T){return i.interrupt=!1,i.parser.lazy[i.now().line]?o(T):(e.enter("tableDelimiterRow"),d=!1,Pr(T)?Zr(e,y,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):y(T))}function y(T){return T===45||T===58?b(T):T===124?(d=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),w):j(T)}function w(T){return Pr(T)?Zr(e,b,"whitespace")(T):b(T)}function b(T){return T===58?(l+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),v):T===45?(l+=1,v(T)):T===null||Fo(T)?E(T):j(T)}function v(T){return T===45?(e.enter("tableDelimiterFiller"),A(T)):j(T)}function A(T){return T===45?(e.consume(T),A):T===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(T))}function S(T){return Pr(T)?Zr(e,E,"whitespace")(T):E(T)}function E(T){return T===124?y(T):T===null||Fo(T)?!d||a!==l?j(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):j(T)}function j(T){return o(T)}function L(T){return e.enter("tableRow"),M(T)}function M(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),M):T===null||Fo(T)?(e.exit("tableRow"),t(T)):Pr(T)?Zr(e,M,"whitespace")(T):(e.enter("data"),D(T))}function D(T){return T===null||T===124||_i(T)?(e.exit("data"),M(T)):(e.consume(T),T===92?P:D)}function P(T){return T===92||T===124?(e.consume(T),D):D(T)}}function oot(e,t){let o=-1,i=!0,a=0,l=[0,0,0,0],d=[0,0,0,0],c=!1,p=0,u,h,m;const f=new Ztt;for(;++o<e.length;){const x=e[o],y=x[1];x[0]==="enter"?y.type==="tableHead"?(c=!1,p!==0&&(goe(f,t,p,u,h),h=void 0,p=0),u={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},f.add(o,0,[["enter",u,t]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(i=!0,m=void 0,l=[0,0,0,0],d=[0,o+1,0,0],c&&(c=!1,h={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},f.add(o,0,[["enter",h,t]])),a=y.type==="tableDelimiterRow"?2:h?3:1):a&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(i=!1,d[2]===0&&(l[1]!==0&&(d[0]=d[1],m=Mv(f,t,l,a,void 0,m),l=[0,0,0,0]),d[2]=o)):y.type==="tableCellDivider"&&(i?i=!1:(l[1]!==0&&(d[0]=d[1],m=Mv(f,t,l,a,void 0,m)),l=d,d=[l[1],o,0,0])):y.type==="tableHead"?(c=!0,p=o):y.type==="tableRow"||y.type==="tableDelimiterRow"?(p=o,l[1]!==0?(d[0]=d[1],m=Mv(f,t,l,a,o,m)):d[1]!==0&&(m=Mv(f,t,d,a,o,m)),a=0):a&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(d[3]=o)}for(p!==0&&goe(f,t,p,u,h),f.consume(t.events),o=-1;++o<t.events.length;){const x=t.events[o];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=Xtt(t.events,o))}return e}function Mv(e,t,o,i,a,l){const d=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";o[0]!==0&&(l.end=Object.assign({},t7(t.events,o[0])),e.add(o[0],0,[["exit",l,t]]));const p=t7(t.events,o[1]);if(l={type:d,start:Object.assign({},p),end:Object.assign({},p)},e.add(o[1],0,[["enter",l,t]]),o[2]!==0){const u=t7(t.events,o[2]),h=t7(t.events,o[3]),m={type:c,start:Object.assign({},u),end:Object.assign({},h)};if(e.add(o[2],0,[["enter",m,t]]),i!==2){const f=t.events[o[2]],x=t.events[o[3]];if(f[1].end=Object.assign({},x[1].end),f[1].type="chunkText",f[1].contentType="text",o[3]>o[2]+1){const y=o[2]+1,w=o[3]-o[2]-1;e.add(y,w,[])}}e.add(o[3]+1,0,[["exit",m,t]])}return a!==void 0&&(l.end=Object.assign({},t7(t.events,a)),e.add(a,0,[["exit",l,t]]),l=void 0),l}function goe(e,t,o,i,a){const l=[],d=t7(t.events,o);a&&(a.end=Object.assign({},d),l.push(["exit",a,t])),i.end=Object.assign({},d),l.push(["exit",i,t]),e.add(o+1,0,l)}function t7(e,t){const o=e[t],i=o[0]==="enter"?"start":"end";return o[1][i]}const rot={name:"tasklistCheck",tokenize:not};function iot(){return{text:{91:rot}}}function not(e,t,o){const i=this;return a;function a(p){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?o(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),l)}function l(p){return _i(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),d):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),d):o(p)}function d(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):o(p)}function c(p){return Fo(p)?t(p):Pr(p)?e.check({tokenize:aot},t,o)(p):o(p)}}function aot(e,t,o){return Zr(e,i,"whitespace");function i(a){return a===null?o(a):t(a)}}function sot(e){return Pxe([Btt(),_tt(),qtt(e),eot(),iot()])}const lot={};function dot(e){const t=this,o=e||lot,i=t.data(),a=i.micromarkExtensions||(i.micromarkExtensions=[]),l=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),d=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);a.push(sot(o)),l.push(Ltt()),d.push(Itt(o))}var HP,foe;function cot(){if(foe)return HP;foe=1;var e=J1(),t=function(){return e.Date.now()};return HP=t,HP}var _P,xoe;function pot(){if(xoe)return _P;xoe=1;var e=/\s/;function t(o){for(var i=o.length;i--&&e.test(o.charAt(i)););return i}return _P=t,_P}var VP,yoe;function uot(){if(yoe)return VP;yoe=1;var e=pot(),t=/^\s+/;function o(i){return i&&i.slice(0,e(i)+1).replace(t,"")}return VP=o,VP}var QP,woe;function Xw(){if(woe)return QP;woe=1;var e=H6(),t=z0(),o="[object Symbol]";function i(a){return typeof a=="symbol"||t(a)&&e(a)==o}return QP=i,QP}var UP,boe;function kye(){if(boe)return UP;boe=1;var e=uot(),t=X1(),o=Xw(),i=NaN,a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,d=/^0o[0-7]+$/i,c=parseInt;function p(u){if(typeof u=="number")return u;if(o(u))return i;if(t(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=t(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=e(u);var m=l.test(u);return m||d.test(u)?c(u.slice(2),m?2:8):a.test(u)?i:+u}return UP=p,UP}var WP,voe;function Sye(){if(voe)return WP;voe=1;var e=X1(),t=cot(),o=kye(),i="Expected a function",a=Math.max,l=Math.min;function d(c,p,u){var h,m,f,x,y,w,b=0,v=!1,A=!1,S=!0;if(typeof c!="function")throw new TypeError(i);p=o(p)||0,e(u)&&(v=!!u.leading,A="maxWait"in u,f=A?a(o(u.maxWait)||0,p):f,S="trailing"in u?!!u.trailing:S);function E(K){var Z=h,O=m;return h=m=void 0,b=K,x=c.apply(O,Z),x}function j(K){return b=K,y=setTimeout(D,p),v?E(K):x}function L(K){var Z=K-w,O=K-b,Q=p-Z;return A?l(Q,f-O):Q}function M(K){var Z=K-w,O=K-b;return w===void 0||Z>=p||Z<0||A&&O>=f}function D(){var K=t();if(M(K))return P(K);y=setTimeout(D,L(K))}function P(K){return y=void 0,S&&h?E(K):(h=m=void 0,x)}function T(){y!==void 0&&clearTimeout(y),b=0,h=w=m=y=void 0}function z(){return y===void 0?x:P(t())}function R(){var K=t(),Z=M(K);if(h=arguments,m=this,w=K,Z){if(y===void 0)return j(w);if(A)return clearTimeout(y),y=setTimeout(D,p),E(w)}return y===void 0&&(y=setTimeout(D,p)),x}return R.cancel=T,R.flush=z,R}return WP=d,WP}var hot=Sye();const U6=Mr(hot);var GP,Coe;function Eye(){if(Coe)return GP;Coe=1;function e(){}return GP=e,GP}var mot=Eye();const CL=Mr(mot);var q5={},Z5={},Aoe={},$oe={},koe;function ma(){return koe||(koe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Log=e.LogLevel=void 0;const t=" DEBUG ",o=" INFO ",i=" WARN ",a=" ERROR ";function l(c){return c.unshift("[Statsig]"),c}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class d{static info(...p){d.level>=e.LogLevel.Info&&console.info(o,...l(p))}static debug(...p){d.level>=e.LogLevel.Debug&&console.debug(t,...l(p))}static warn(...p){d.level>=e.LogLevel.Warn&&console.warn(i,...l(p))}static error(...p){d.level>=e.LogLevel.Error&&console.error(a,...l(p))}}e.Log=d,d.level=e.LogLevel.Warn}($oe)),$oe}var Soe;function d4(){return Soe||(Soe=1,function(e){var t,o,i;Object.defineProperty(e,"__esModule",{value:!0}),e._getInstance=e._getStatsigGlobalFlag=e._getStatsigGlobal=void 0;const a=ma(),l=()=>{try{return typeof __STATSIG__<"u"?__STATSIG__:f}catch{return f}};e._getStatsigGlobal=l;const d=x=>(0,e._getStatsigGlobal)()[x];e._getStatsigGlobalFlag=d;const c=x=>{const y=(0,e._getStatsigGlobal)();return x?y.instances&&y.instances[x]:(y.instances&&Object.keys(y.instances).length>1&&a.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),y.firstInstance)};e._getInstance=c;const p="__STATSIG__",u=typeof window<"u"?window:{},h=typeof td<"u"?td:{},m=typeof globalThis<"u"?globalThis:{},f=(i=(o=(t=u[p])!==null&&t!==void 0?t:h[p])!==null&&o!==void 0?o:m[p])!==null&&i!==void 0?i:{instance:e._getInstance};u[p]=f,h[p]=f,m[p]=f}(Aoe)),Aoe}var Eoe={},Loe;function K_(){return Loe||(Loe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Diagnostics=void 0;const t=new Map,o="start",i="end",a="statsig::diagnostics";e.Diagnostics={_getMarkers:u=>t.get(u),_markInitOverallStart:u=>{c(u,l({},o,"overall"))},_markInitOverallEnd:(u,h,m)=>{c(u,l({success:h,error:h?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:m},i,"overall"))},_markInitNetworkReqStart:(u,h)=>{c(u,l(h,o,"initialize","network_request"))},_markInitNetworkReqEnd:(u,h)=>{c(u,l(h,i,"initialize","network_request"))},_markInitProcessStart:u=>{c(u,l({},o,"initialize","process"))},_markInitProcessEnd:(u,h)=>{c(u,l(h,i,"initialize","process"))},_clearMarkers:u=>{t.delete(u)},_formatError(u){if(u&&typeof u=="object")return{code:p(u,"code"),name:p(u,"name"),message:p(u,"message")}},_getDiagnosticsData(u,h,m,f){var x;return{success:u?.ok===!0,statusCode:u?.status,sdkRegion:(x=u?.headers)===null||x===void 0?void 0:x.get("x-statsig-region"),isDelta:m.includes('"is_delta":true')===!0?!0:void 0,attempt:h,error:e.Diagnostics._formatError(f)}},_enqueueDiagnosticsEvent(u,h,m,f){const x=e.Diagnostics._getMarkers(m);if(x==null||x.length<=0)return-1;const y=x[x.length-1].timestamp-x[0].timestamp;e.Diagnostics._clearMarkers(m);const w=d(u,{context:"initialize",markers:x.slice(),statsigOptions:f});return h.enqueue(w),y}};function l(u,h,m,f){return Object.assign({key:m,action:h,step:f,timestamp:Date.now()},u)}function d(u,h){return{eventName:a,user:u,value:null,metadata:h,time:Date.now()}}function c(u,h){var m;const f=(m=t.get(u))!==null&&m!==void 0?m:[];f.push(h),t.set(u,f)}function p(u,h){if(h in u)return u[h]}}(Eoe)),Eoe}var Qg={},G8={},Y8={},Ioe;function got(){if(Ioe)return Y8;Ioe=1,Object.defineProperty(Y8,"__esModule",{value:!0}),Y8.EventBatch=void 0;let e=class{constructor(t){this.attempts=0,this.createdAt=Date.now(),this.events=t}incrementAttempts(){this.attempts++}};return Y8.EventBatch=e,Y8}var Bv={},joe;function LG(){return joe||(joe=1,Object.defineProperty(Bv,"__esModule",{value:!0}),Bv.EventRetryConstants=void 0,Bv.EventRetryConstants={MAX_RETRY_ATTEMPTS:8,DEFAULT_BATCH_SIZE:100,MAX_PENDING_BATCHES:40,TICK_INTERVAL_MS:1e3,QUICK_FLUSH_WINDOW_MS:200,MAX_LOCAL_STORAGE:500,get MAX_QUEUED_EVENTS(){return this.DEFAULT_BATCH_SIZE*this.MAX_PENDING_BATCHES}}),Bv}var Moe;function fot(){if(Moe)return G8;Moe=1,Object.defineProperty(G8,"__esModule",{value:!0}),G8.BatchQueue=void 0;const e=got(),t=LG();class o{constructor(a=t.EventRetryConstants.DEFAULT_BATCH_SIZE){this._batches=[],this._batchSize=a}batchSize(){return this._batchSize}requeueBatch(a){return this._enqueueBatch(a)}hasFullBatch(){return this._batches.some(a=>a.events.length>=this._batchSize)}takeNextBatch(){return this._batches.shift()}takeAllBatches(){const a=this._batches;return this._batches=[],a}createBatches(a){let l=0,d=0;for(;l<a.length;){const c=a.slice(l,l+this._batchSize);d+=this._enqueueBatch(new e.EventBatch(c)),l+=this._batchSize}return d}_enqueueBatch(a){this._batches.push(a);let l=0;for(;this._batches.length>t.EventRetryConstants.MAX_PENDING_BATCHES;){const d=this._batches.shift();d&&(l+=d.events.length)}return l}}return G8.BatchQueue=o,G8}var Ug={},Boe={},Wg={},Doe;function IG(){if(Doe)return Wg;Doe=1,Object.defineProperty(Wg,"__esModule",{value:!0}),Wg._isTypeMatch=Wg._typeOf=void 0;function e(o){return Array.isArray(o)?"array":typeof o}Wg._typeOf=e;function t(o,i){const a=l=>Array.isArray(l)?"array":l===null?"null":typeof l;return a(o)===a(i)}return Wg._isTypeMatch=t,Wg}var Poe;function G4(){return Poe||(Poe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._getSortedObject=e._DJB2Object=e._DJB2=void 0;const t=IG(),o=l=>{let d=0;for(let c=0;c<l.length;c++){const p=l.charCodeAt(c);d=(d<<5)-d+p,d=d&d}return String(d>>>0)};e._DJB2=o;const i=(l,d)=>(0,e._DJB2)(JSON.stringify((0,e._getSortedObject)(l,d)));e._DJB2Object=i;const a=(l,d)=>{if(l==null)return null;const c=Object.keys(l).sort(),p={};return c.forEach(u=>{const h=l[u];if(d===0||(0,t._typeOf)(h)!=="object"){p[u]=h;return}p[u]=(0,e._getSortedObject)(h,d!=null?d-1:d)}),p};e._getSortedObject=a}(Boe)),Boe}var Toe;function AL(){if(Toe)return Ug;Toe=1,Object.defineProperty(Ug,"__esModule",{value:!0}),Ug._getStorageKey=Ug._getUserStorageKey=void 0;const e=G4();function t(i,a,l){var d;if(l)return l(i,a);const c=a&&a.customIDs?a.customIDs:{},p=[`uid:${(d=a?.userID)!==null&&d!==void 0?d:""}`,`cids:${Object.keys(c).sort((u,h)=>u.localeCompare(h)).map(u=>`${u}-${c[u]}`).join(",")}`,`k:${i}`];return(0,e._DJB2)(p.join("|"))}Ug._getUserStorageKey=t;function o(i,a,l){return a?t(i,a,l):(0,e._DJB2)(`k:${i}`)}return Ug._getStorageKey=o,Ug}var Gg={},Yg={},zoe={},Roe;function eb(){return Roe||(Roe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkParam=e.NetworkDefault=e.Endpoint=void 0,e.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},e.NetworkDefault={[e.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[e.Endpoint._initialize]:"https://featureassets.org/v1",[e.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}}(zoe)),zoe}var K8={},Foe;function $L(){if(Foe)return K8;Foe=1,Object.defineProperty(K8,"__esModule",{value:!0}),K8.SDKType=void 0;const e={};let t;return K8.SDKType={_get:o=>{var i;return((i=e[o])!==null&&i!==void 0?i:"js-mono")+(t??"")},_setClientType(o,i){e[o]=i},_setBindingType(o){(!t||t==="-react")&&(t="-"+o)}},K8}var Ooe={},Noe;function Vy(){return Noe||(Noe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.33.0";let t={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>t,add:o=>{t=Object.assign(Object.assign({},t),o)}}}(Ooe)),Ooe}var Hoe={},_oe={},Voe;function d2(){return Voe||(Voe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._cloneObject=e._getUnloadEvent=e._getCurrentPageUrlSafe=e._addDocumentEventListenerSafe=e._addWindowEventListenerSafe=e._isServerEnv=e._getDocumentSafe=e._getWindowSafe=void 0;const t=ma(),o=()=>typeof window<"u"?window:null;e._getWindowSafe=o;const i=()=>{var h;return(h=(0,e._getWindowSafe)()?.document)!==null&&h!==void 0?h:null};e._getDocumentSafe=i;const a=()=>{if((0,e._getDocumentSafe)()!==null)return!1;const h=typeof G2<"u"&&G2.versions!=null&&G2.versions.node!=null;return typeof EdgeRuntime=="string"||h};e._isServerEnv=a;const l=(h,m)=>{const f=(0,e._getWindowSafe)();typeof f?.addEventListener=="function"&&f.addEventListener(h,m)};e._addWindowEventListenerSafe=l;const d=(h,m)=>{const f=(0,e._getDocumentSafe)();typeof f?.addEventListener=="function"&&f.addEventListener(h,m)};e._addDocumentEventListenerSafe=d;const c=()=>{var h;try{return(h=(0,e._getWindowSafe)())===null||h===void 0?void 0:h.location.href.split(/[?#]/)[0]}catch{return}};e._getCurrentPageUrlSafe=c;const p=()=>{const h=(0,e._getWindowSafe)();return h&&"onpagehide"in h?"pagehide":"beforeunload"};e._getUnloadEvent=p;const u=(h,m)=>{try{return JSON.parse(JSON.stringify(m))}catch{return t.Log.error(`Failed to clone object ${h}`),null}};e._cloneObject=u}(_oe)),_oe}var Qoe;function tb(){return Qoe||(Qoe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._notifyVisibilityChanged=e._subscribeToVisiblityChanged=e._isUnloading=e._isCurrentlyVisible=void 0;const t=d2(),o="foreground",i="background",a=[];let l=o,d=!1;const c=()=>l===o;e._isCurrentlyVisible=c;const p=()=>d;e._isUnloading=p;const u=m=>{a.unshift(m)};e._subscribeToVisiblityChanged=u;const h=m=>{m!==l&&(l=m,a.forEach(f=>f(m)))};e._notifyVisibilityChanged=h,(0,t._addWindowEventListenerSafe)("focus",()=>{d=!1,(0,e._notifyVisibilityChanged)(o)}),(0,t._addWindowEventListenerSafe)("blur",()=>(0,e._notifyVisibilityChanged)(i)),(0,t._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,e._notifyVisibilityChanged)(document.visibilityState==="visible"?o:i)}),(0,t._addWindowEventListenerSafe)((0,t._getUnloadEvent)(),()=>{d=!0,(0,e._notifyVisibilityChanged)(i)})}(Hoe)),Hoe}var Uoe;function xot(){if(Uoe)return Yg;Uoe=1;var e=Yg&&Yg.__awaiter||function(c,p,u,h){function m(f){return f instanceof u?f:new u(function(x){x(f)})}return new(u||(u=Promise))(function(f,x){function y(v){try{b(h.next(v))}catch(A){x(A)}}function w(v){try{b(h.throw(v))}catch(A){x(A)}}function b(v){v.done?f(v.value):m(v.value).then(y,w)}b((h=h.apply(c,p||[])).next())})};Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.EventSender=void 0;const t=ma(),o=eb(),i=$L(),a=Vy(),l=tb();let d=class{constructor(c,p,u,h,m){this._sdkKey=c,this._network=p,this._emitter=u,this._options=m,this._logEventUrlConfig=h}setLogEventCompressionMode(c){this._network.setLogEventCompressionMode(c)}sendBatch(c){return e(this,void 0,void 0,function*(){var p,u,h;let m="event_sender_unexpected_exception";const f={};try{const x=(0,l._isUnloading)()&&this._network.isBeaconSupported()&&((u=(p=this._options)===null||p===void 0?void 0:p.networkConfig)===null||u===void 0?void 0:u.networkOverrideFunc)==null;m="event_sender_pre_logs_flushed_emitter_exception",this._emitter({name:"pre_logs_flushed",events:c.events}),m=x?"event_sender_unexpected_exception":"event_sender_post_exception";const y=x?this._sendEventsViaBeacon(c,f):yield this._sendEventsViaPost(c,f);return y.success?(m="event_sender_logs_flushed_emitter_exception",this._emitter({name:"logs_flushed",events:c.events}),y):Object.assign(Object.assign(Object.assign({success:!1,statusCode:y.statusCode,failurePath:y.failurePath},y.failureErrorMessage?{failureErrorMessage:y.failureErrorMessage}:{}),y.failureDiagnosticBucket?{failureDiagnosticBucket:y.failureDiagnosticBucket}:{}),y.failureDiagnosticMetadata?{failureDiagnosticMetadata:y.failureDiagnosticMetadata}:{})}catch(x){return t.Log.warn("Failed to send batch:",x),Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:(h=f.path)!==null&&h!==void 0?h:m},f.errorMessage?{failureErrorMessage:f.errorMessage}:{}),f.diagnosticBucket?{failureDiagnosticBucket:f.diagnosticBucket}:{}),f.diagnosticMetadata?{failureDiagnosticMetadata:f.diagnosticMetadata}:{})}})}_sendEventsViaPost(c,p){return e(this,void 0,void 0,function*(){var u,h;const m=yield this._network.post(this._getRequestData(c),p),f=(u=m?.code)!==null&&u!==void 0?u:-1;return f===-1?Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:(h=p.path)!==null&&h!==void 0?h:m===void 0?"event_sender_post_returned_undefined":"event_sender_post_returned_null"},p.errorMessage?{failureErrorMessage:p.errorMessage}:{}),p.diagnosticBucket?{failureDiagnosticBucket:p.diagnosticBucket}:{}),p.diagnosticMetadata?{failureDiagnosticMetadata:p.diagnosticMetadata}:{}):{success:f>=200&&f<300,statusCode:f}})}_sendEventsViaBeacon(c,p){var u;const h=this._network.beacon(this._getRequestData(c),p);return Object.assign(Object.assign(Object.assign({success:h,statusCode:h?200:-1,failurePath:h?void 0:(u=p.path)!==null&&u!==void 0?u:"beacon_send_false"},!h&&p.errorMessage?{failureErrorMessage:p.errorMessage}:{}),!h&&p.diagnosticBucket?{failureDiagnosticBucket:p.diagnosticBucket}:{}),!h&&p.diagnosticMetadata?{failureDiagnosticMetadata:p.diagnosticMetadata}:{})}_getRequestData(c){return{sdkKey:this._sdkKey,data:{events:c.events},urlConfig:this._logEventUrlConfig,retries:3,preserveFailedStatusCode:!0,isCompressable:!0,params:{[o.NetworkParam.EventCount]:String(c.events.length)},headers:{"statsig-event-count":String(c.events.length),"statsig-retry-count":String(c.attempts),"statsig-sdk-type":i.SDKType._get(this._sdkKey),"statsig-sdk-version":a.SDK_VERSION},credentials:"same-origin"}}};return Yg.EventSender=d,Yg}var q8={},Woe;function yot(){if(Woe)return q8;Woe=1,Object.defineProperty(q8,"__esModule",{value:!0}),q8.FlushInterval=void 0;const e=1e3,t=6e4;let o=class{constructor(){this._currentIntervalMs=e,this._lastFlushAttemptTime=Date.now()}getCurrentIntervalMs(){return this._currentIntervalMs}markFlushAttempt(){this._lastFlushAttemptTime=Date.now()}getTimeSinceLastAttempt(){return Date.now()-this._lastFlushAttemptTime}hasReachedMaxInterval(){return this.getTimeSinceLastAttempt()>=t}getTimeTillMaxInterval(){return t-this.getTimeSinceLastAttempt()}hasCompletelyRecoveredFromBackoff(){return this._currentIntervalMs<=e}adjustForSuccess(){const i=this._currentIntervalMs;i!==e&&(this._currentIntervalMs=Math.max(e,Math.floor(i/2)))}adjustForFailure(){const i=this._currentIntervalMs;this._currentIntervalMs=Math.min(t,i*2)}getTimeUntilNextFlush(){return this.getCurrentIntervalMs()-this.getTimeSinceLastAttempt()}};return q8.FlushInterval=o,q8}var Z8={},Goe;function wot(){if(Goe)return Z8;Goe=1,Object.defineProperty(Z8,"__esModule",{value:!0}),Z8.FlushType=void 0;var e;return function(t){t.ScheduledMaxTime="scheduled:max_time",t.ScheduledFullBatch="scheduled:full_batch",t.Limit="limit",t.Manual="manual",t.Shutdown="shutdown"}(e||(Z8.FlushType=e={})),Z8}var Dv={},I2={},Kg={},Yoe;function bot(){if(Yoe)return Kg;Yoe=1;var e=Kg&&Kg.__awaiter||function(c,p,u,h){function m(f){return f instanceof u?f:new u(function(x){x(f)})}return new(u||(u=Promise))(function(f,x){function y(v){try{b(h.next(v))}catch(A){x(A)}}function w(v){try{b(h.throw(v))}catch(A){x(A)}}function b(v){v.done?f(v.value):m(v.value).then(y,w)}b((h=h.apply(c,p||[])).next())})};Object.defineProperty(Kg,"__esModule",{value:!0}),Kg._fetchTxtRecords=void 0;const t=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),o="https://cloudflare-dns.com/dns-query",i=["i","e","d"],a=200;function l(c){return e(this,void 0,void 0,function*(){const p=yield c(o,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:t});if(!p.ok){const m=new Error("Failed to fetch TXT records from DNS");throw m.name="DnsTxtFetchError",m}const u=yield p.arrayBuffer(),h=new Uint8Array(u);return d(h)})}Kg._fetchTxtRecords=l;function d(c){const p=c.findIndex((h,m)=>m<a&&String.fromCharCode(h)==="="&&i.includes(String.fromCharCode(c[m-1])));if(p===-1){const h=new Error("Failed to parse TXT records from DNS");throw h.name="DnsTxtParseError",h}let u="";for(let h=p-1;h<c.length;h++)u+=String.fromCharCode(c[h]);return u.split(",")}return Kg}var Koe={},qoe;function E0(){return qoe||(qoe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._setObjectInStorage=e._getObjectFromStorage=e.Storage=void 0;const t=ma(),o=d2(),i={},a={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:m=>i[m]?i[m]:null,setItem:(m,f)=>{i[m]=f},removeItem:m=>{delete i[m]},getAllKeys:()=>Object.keys(i)};let l=null;try{const m=(0,o._getWindowSafe)();m&&m.localStorage&&typeof m.localStorage.getItem=="function"&&(l={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:f=>m.localStorage.getItem(f),setItem:(f,x)=>m.localStorage.setItem(f,x),removeItem:f=>m.localStorage.removeItem(f),getAllKeys:()=>Object.keys(m.localStorage)})}catch{t.Log.warn("Failed to setup localStorageProvider.")}let d=l??a,c=d;function p(m){try{return m()}catch(f){if(f instanceof Error&&f.name==="SecurityError")return e.Storage._setProvider(a),null;throw f}}e.Storage={isReady:()=>c.isReady(),isReadyResolver:()=>c.isReadyResolver(),getProviderName:()=>c.getProviderName(),getItem:m=>p(()=>c.getItem(m)),setItem:(m,f)=>p(()=>c.setItem(m,f)),removeItem:m=>c.removeItem(m),getAllKeys:()=>c.getAllKeys(),_setProvider:m=>{d=m,c=m},_setDisabled:m=>{m?c=a:c=d}};function u(m){const f=e.Storage.getItem(m);try{return JSON.parse(f??"null")}catch{return t.Log.error(`Failed to parse value for key "${m}"`),null}}e._getObjectFromStorage=u;function h(m,f){e.Storage.setItem(m,JSON.stringify(f))}e._setObjectInStorage=h}(Koe)),Koe}var Zoe;function vot(){if(Zoe)return I2;Zoe=1;var e=I2&&I2.__awaiter||function(x,y,w,b){function v(A){return A instanceof w?A:new w(function(S){S(A)})}return new(w||(w=Promise))(function(A,S){function E(M){try{L(b.next(M))}catch(D){S(D)}}function j(M){try{L(b.throw(M))}catch(D){S(D)}}function L(M){M.done?A(M.value):v(M.value).then(E,j)}L((b=b.apply(x,y||[])).next())})};Object.defineProperty(I2,"__esModule",{value:!0}),I2._isDomainFailure=I2.NetworkFallbackResolver=void 0;const t=bot(),o=G4(),i=ma(),a=E0(),l=10080*60*1e3,d=14400*1e3;let c=class{constructor(x){var y;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=(y=x.networkConfig)===null||y===void 0?void 0:y.networkOverrideFunc}setErrorBoundary(x){this._errorBoundary=x}tryBumpExpiryTime(x,y){var w;const b=(w=this._fallbackInfo)===null||w===void 0?void 0:w[y.endpoint];b&&(b.expiryTime=Date.now()+l,h(x,Object.assign(Object.assign({},this._fallbackInfo),{[y.endpoint]:b})))}getActiveFallbackUrl(x,y){var w,b;if(y.customUrl!=null&&y.fallbackUrls!=null)return null;let v=this._fallbackInfo;v==null&&(v=(w=m(x))!==null&&w!==void 0?w:{},this._fallbackInfo=v);const A=v[y.endpoint];return!A||Date.now()>((b=A.expiryTime)!==null&&b!==void 0?b:0)||y.getChecksum()!==A.urlConfigChecksum?(delete v[y.endpoint],this._fallbackInfo=v,h(x,this._fallbackInfo),null):A.url?A.url:null}tryFetchUpdatedFallbackInfo(x,y,w,b){return e(this,void 0,void 0,function*(){var v,A;try{if(!p(w,b))return!1;const S=y.customUrl==null&&y.fallbackUrls==null?yield this._tryFetchFallbackUrlsFromNetwork(y):y.fallbackUrls,E=this._pickNewFallbackUrl((v=this._fallbackInfo)===null||v===void 0?void 0:v[y.endpoint],S);return E?(this._updateFallbackInfoWithNewUrl(x,y,E),!0):!1}catch(S){return(A=this._errorBoundary)===null||A===void 0||A.logError("tryFetchUpdatedFallbackInfo",S),!1}})}_updateFallbackInfoWithNewUrl(x,y,w){var b,v,A;const S={urlConfigChecksum:y.getChecksum(),url:w,expiryTime:Date.now()+l,previous:[]},E=y.endpoint,j=(b=this._fallbackInfo)===null||b===void 0?void 0:b[E];j&&S.previous.push(...j.previous),S.previous.length>10&&(S.previous=[]);const L=(A=(v=this._fallbackInfo)===null||v===void 0?void 0:v[E])===null||A===void 0?void 0:A.url;L!=null&&S.previous.push(L),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[E]:S}),h(x,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(x){return e(this,void 0,void 0,function*(){var y;const w=this._dnsQueryCooldowns[x.endpoint];if(w&&Date.now()<w)return null;this._dnsQueryCooldowns[x.endpoint]=Date.now()+d;const b=[],v=yield(0,t._fetchTxtRecords)((y=this._networkOverrideFunc)!==null&&y!==void 0?y:fetch),A=f(x.defaultUrl);for(const S of v){if(!S.startsWith(x.endpointDnsKey+"="))continue;const E=S.split("=");if(E.length>1){let j=E[1];j.endsWith("/")&&(j=j.slice(0,-1)),b.push(`https://${j}${A}`)}}return b})}_pickNewFallbackUrl(x,y){var w;if(y==null)return null;const b=new Set((w=x?.previous)!==null&&w!==void 0?w:[]),v=x?.url;let A=null;for(const S of y){const E=S.endsWith("/")?S.slice(0,-1):S;if(!b.has(S)&&E!==v){A=E;break}}return A}};I2.NetworkFallbackResolver=c;function p(x,y){var w;const b=(w=x?.toLowerCase())!==null&&w!==void 0?w:"";return y||b.includes("uncaught exception")||b.includes("failed to fetch")||b.includes("networkerror when attempting to fetch resource")}I2._isDomainFailure=p;function u(x){return`statsig.network_fallback.${(0,o._DJB2)(x)}`}function h(x,y){const w=u(x);if(!y||Object.keys(y).length===0){a.Storage.removeItem(w);return}a.Storage.setItem(w,JSON.stringify(y))}function m(x){const y=u(x),w=a.Storage.getItem(y);if(!w)return null;try{return JSON.parse(w)}catch{return i.Log.error("Failed to parse FallbackInfo"),null}}function f(x){try{return new URL(x).pathname}catch{return null}}return I2}var J8={},Joe;function Lye(){if(Joe)return J8;Joe=1,Object.defineProperty(J8,"__esModule",{value:!0}),J8.SDKFlags=void 0;const e={};return J8.SDKFlags={setFlags:(t,o)=>{e[t]=o},get:(t,o)=>{var i,a;return(a=(i=e[t])===null||i===void 0?void 0:i[o])!==null&&a!==void 0?a:!1}},J8}var Xoe={},X8={},ere;function jG(){if(ere)return X8;ere=1,Object.defineProperty(X8,"__esModule",{value:!0}),X8.getUUID=void 0;function e(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();let t=new Date().getTime(),o=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,i=>{let a=Math.random()*16;return t>0?(a=(t+a)%16|0,t=Math.floor(t/16)):(a=(o+a)%16|0,o=Math.floor(o/16)),(i==="x"?a:a&7|8).toString(16)})}return X8.getUUID=e,X8}var tre;function ob(){return tre||(tre=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigSession=e.SessionID=void 0;const t=AL(),o=ma(),i=E0(),a=jG(),l=tb(),d=1800*1e3,c=14400*1e3,p=15e3,u={};(0,l._subscribeToVisiblityChanged)(E=>{E==="background"&&Object.values(u).forEach(j=>w(j))}),e.SessionID={get:E=>e.StatsigSession.get(E).data.sessionID},e.StatsigSession={get:(E,j=!0)=>{u[E]==null&&(u[E]=A(E));const L=u[E];return h(L,j)},overrideInitialSessionID:(E,j)=>{const L=Date.now(),M={data:{sessionID:E,startTime:L,lastUpdate:L},sdkKey:j,lastPersistedAt:Date.now(),storageKey:y(j)};w(M),u[j]=M},checkForIdleSession:E=>{const j=u[E];j&&m(j)&&w(j)}};function h(E,j){const L=Date.now();return m(E)?w(E):j&&(E.data.lastUpdate=L,b(E)),E}function m(E){var j;const L=E.data,M=f(L)||x(L);return M&&(E.data=S(),(j=__STATSIG__==null?void 0:__STATSIG__.instance(E.sdkKey))===null||j===void 0||j.$emt({name:"session_expired"})),M}function f({lastUpdate:E}){return Date.now()-E>d}function x({startTime:E}){return Date.now()-E>c}function y(E){return`statsig.session_id.${(0,t._getStorageKey)(E)}`}function w(E){try{(0,i._setObjectInStorage)(E.storageKey,E.data),E.lastPersistedAt=Date.now()}catch{o.Log.warn("Failed to save SessionID")}}function b(E){Date.now()-E.lastPersistedAt>p&&w(E)}function v(E){return(0,i._getObjectFromStorage)(E)}function A(E){const j=y(E),L=v(j);return L&&L.sessionID&&L.startTime&&L.lastUpdate?{data:L,sdkKey:E,lastPersistedAt:0,storageKey:j}:{data:S(),sdkKey:E,lastPersistedAt:0,storageKey:j}}function S(){return{sessionID:(0,a.getUUID)(),startTime:Date.now(),lastUpdate:Date.now()}}}(Xoe)),Xoe}var qg={},ore;function rb(){if(ore)return qg;ore=1,Object.defineProperty(qg,"__esModule",{value:!0}),qg.getCookieName=qg.StableID=void 0;const e=AL(),t=ma(),o=d2(),i=E0(),a=jG(),l={},d={},c={};qg.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:y=>{if(c[y])return null;if(l[y]!=null)return l[y];let w=null;return w=m(y),w!=null?(l[y]=w,u(w,y),w):(w=h(y),w==null&&(w=(0,a.getUUID)()),u(w,y),f(w,y),l[y]=w,w)},setOverride:(y,w)=>{l[w]=y,u(y,w),f(y,w)},_setCookiesEnabled:(y,w)=>{d[y]=w},_setDisabled:(y,w)=>{c[y]=w}};function p(y){return`statsig.stable_id.${(0,e._getStorageKey)(y)}`}function u(y,w){const b=p(w);try{(0,i._setObjectInStorage)(b,y)}catch{t.Log.warn("Failed to save StableID to storage")}}function h(y){const w=p(y);return(0,i._getObjectFromStorage)(w)}function m(y){if(!d[y]||(0,o._getDocumentSafe)()==null)return null;const w=document.cookie.split(";");for(const b of w){const[v,A]=b.trim().split("=");if(v===x(y))return decodeURIComponent(A)}return null}function f(y,w){if(!d[w]||(0,o._getDocumentSafe)()==null)return;const b=new Date;b.setFullYear(b.getFullYear()+1),document.cookie=`${x(w)}=${encodeURIComponent(y)}; expires=${b.toUTCString()}; path=/`}function x(y){return`statsig.stable_id.${(0,e._getStorageKey)(y)}`}return qg.getCookieName=x,qg}var Pv={},rre;function Iye(){return rre||(rre=1,Object.defineProperty(Pv,"__esModule",{value:!0}),Pv.ErrorTag=void 0,Pv.ErrorTag={NetworkError:"NetworkError"}),Pv}var J5={},ire;function ib(){return ire||(ire=1,Object.defineProperty(J5,"__esModule",{value:!0}),J5.LoggingEnabledOption=J5.LogEventCompressionMode=void 0,J5.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},J5.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}),J5}var nre;function jye(){return nre||(nre=1,function(e){var t=Dv&&Dv.__awaiter||function(N,H,ee,Y){function G(J){return J instanceof ee?J:new ee(function(X){X(J)})}return new(ee||(ee=Promise))(function(J,X){function ie(de){try{me(Y.next(de))}catch(ce){X(ce)}}function we(de){try{me(Y.throw(de))}catch(ce){X(ce)}}function me(de){de.done?J(de.value):G(de.value).then(ie,we)}me((Y=Y.apply(N,H||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkCore=e.RETRYABLE_CODES=void 0,d4();const o=d4(),i=K_(),a=ma(),l=eb(),d=vot(),c=Lye(),p=$L(),u=d2(),h=ob(),m=rb(),f=Iye(),x=Vy(),y=ib(),w=tb(),b=1e4,v=500,A=3e4,S=1e3,E=50,j=E/S;e.RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);let L=class{constructor(N,H){this._emitter=H,this._errorBoundary=null,this._timeout=b,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,N&&(this._options=N),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new d.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(N))}setLogEventCompressionMode(N){this._options.logEventCompressionMode=N}setErrorBoundary(N){this._errorBoundary=N,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(N)}isBeaconSupported(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}getLastUsedInitUrlAndReset(){const N=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,N}beacon(N,H){if(!M(N))return H&&(H.path="beacon_invalid_sdk_key"),!1;const ee=this._getInternalRequestArgs("POST",N),Y=this._getPopulatedURL(ee),G=navigator;try{const J=G.sendBeacon.bind(G)(Y,ee.body);return J||H&&(H.path="beacon_send_false"),J}catch(J){throw H&&(H.path="beacon_send_exception"),J}}post(N,H){return t(this,void 0,void 0,function*(){const ee=this._getInternalRequestArgs("POST",N);return this._tryEncodeBody(ee),yield this._tryToCompressBody(ee),this._sendRequest(ee,H)})}get(N){const H=this._getInternalRequestArgs("GET",N);return this._sendRequest(H)}_sendRequest(N,H){return t(this,void 0,void 0,function*(){var ee,Y,G,J;if(!M(N))return H&&(H.path="network_invalid_sdk_key"),null;if(this._netConfig.preventAllNetworkTraffic)return H&&(H.path="network_prevent_all_network_traffic"),null;const{method:X,body:ie,retries:we,attempt:me}=N,de=N.urlConfig.endpoint;if(this._isRateLimited(de))return a.Log.warn(`Request to ${de} was blocked because you are making requests too frequently.`),H&&(H.path="network_rate_limited"),null;const ce=me??1;let fe=!1;const Ae=this._getPopulatedURL(N),le=Date.now();let pe=null;const ae=(0,w._isUnloading)();try{const be={method:X,body:ie,headers:Object.assign({},N.headers),priority:N.priority,keepalive:ae};Q(N,ce);const ue=this._leakyBucket[de];ue&&(ue.lastRequestTime=Date.now(),this._leakyBucket[de]=ue);const se=(ee=this._netConfig.networkOverrideFunc)!==null&&ee!==void 0?ee:fetch;let ge;if(pe=yield Promise.race([se(Ae,be).finally(()=>clearTimeout(ge)),new Promise(($e,Ve)=>{ge=setTimeout(()=>{fe=!0,Ve(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!pe.ok){const $e=yield pe.text().catch(()=>"No Text"),Ve=new Error(`NetworkError: ${Ae} ${$e}`);throw Ve.name="NetworkError",Ve}const Ee=yield pe.text();return _(N,pe,ce,Ee),this._fallbackResolver.tryBumpExpiryTime(N.sdkKey,N.urlConfig),{body:Ee,code:pe.status}}catch(be){const ue=T(be),se=z(ue??"",fe);if(_(N,pe,ce,"",be),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(N.sdkKey,N.urlConfig,ue,se))&&(N.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(N.sdkKey,N.urlConfig)),!we||ce>we||!e.RETRYABLE_CODES.has((Y=pe?.status)!==null&&Y!==void 0?Y:500)){(G=this._emitter)===null||G===void 0||G.call(this,{name:"error",error:be,tag:f.ErrorTag.NetworkError,requestArgs:N});const ge=`A networking error occurred during ${X} request to ${Ae}.`;if(a.Log.error(ge,ue,be),(J=this._errorBoundary)===null||J===void 0||J.attachErrorIfNoneExists(ge),N.preserveFailedStatusCode&&pe!=null)return{body:null,code:pe.status};if(pe==null&&H){H.path=se?"network_request_timed_out_no_response":"network_request_exception_no_response",ue&&(H.errorMessage=ue);try{const Ee=R(N,Ae,se,Date.now()-le);H.diagnosticBucket=Ee.bucket,H.diagnosticMetadata=Ee.metadata}catch{}}return null}return yield F(ce),this._sendRequest(Object.assign(Object.assign({},N),{retries:we,attempt:ce+1}),H)}})}_getLogEventCompressionMode(N){let H=N?.logEventCompressionMode;return!H&&N?.disableCompression===!0&&(H=y.LogEventCompressionMode.Disabled),H||(H=y.LogEventCompressionMode.Enabled),H}_isRateLimited(N){var H;const ee=Date.now(),Y=(H=this._leakyBucket[N])!==null&&H!==void 0?H:{count:0,lastRequestTime:ee},G=ee-Y.lastRequestTime,J=Math.floor(G*j);return Y.count=Math.max(0,Y.count-J),Y.count>=E?!0:(Y.count+=1,Y.lastRequestTime=ee,this._leakyBucket[N]=Y,!1)}_getPopulatedURL(N){var H;const ee=(H=N.fallbackUrl)!==null&&H!==void 0?H:N.urlConfig.getUrl();(N.urlConfig.endpoint===l.Endpoint._initialize||N.urlConfig.endpoint===l.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=ee);const Y=Object.assign({[l.NetworkParam.SdkKey]:N.sdkKey,[l.NetworkParam.SdkType]:p.SDKType._get(N.sdkKey),[l.NetworkParam.SdkVersion]:x.SDK_VERSION,[l.NetworkParam.Time]:String(Date.now()),[l.NetworkParam.SessionID]:h.SessionID.get(N.sdkKey)},N.params),G=Object.keys(Y).map(J=>`${encodeURIComponent(J)}=${encodeURIComponent(Y[J])}`).join("&");return`${ee}${G?`?${G}`:""}`}_tryEncodeBody(N){var H;const ee=(0,u._getWindowSafe)(),Y=N.body;if(!(!N.isStatsigEncodable||this._options.disableStatsigEncoding||typeof Y!="string"||(0,o._getStatsigGlobalFlag)("no-encode")!=null||!ee?.btoa))try{N.body=ee.btoa(Y).split("").reverse().join(""),N.params=Object.assign(Object.assign({},(H=N.params)!==null&&H!==void 0?H:{}),{[l.NetworkParam.StatsigEncoded]:"1"})}catch(G){a.Log.warn(`Request encoding failed for ${N.urlConfig.getUrl()}`,G)}}_tryToCompressBody(N){return t(this,void 0,void 0,function*(){var H;const ee=N.body;if(!(typeof ee!="string"||!P(N,this._options)))try{const Y=new TextEncoder().encode(ee),G=new CompressionStream("gzip"),J=G.writable.getWriter();J.write(Y).catch(a.Log.error),J.close().catch(a.Log.error);const X=G.readable.getReader(),ie=[];let we;for(;!(we=yield X.read()).done;)ie.push(we.value);const me=ie.reduce((fe,Ae)=>fe+Ae.length,0),de=new Uint8Array(me);let ce=0;for(const fe of ie)de.set(fe,ce),ce+=fe.length;N.body=de,N.params=Object.assign(Object.assign({},(H=N.params)!==null&&H!==void 0?H:{}),{[l.NetworkParam.IsGzipped]:"1"})}catch(Y){a.Log.warn(`Request compression failed for ${N.urlConfig.getUrl()}`,Y)}})}_getInternalRequestArgs(N,H){const ee=this._fallbackResolver.getActiveFallbackUrl(H.sdkKey,H.urlConfig),Y=Object.assign(Object.assign({},H),{method:N,fallbackUrl:ee});return"data"in H&&D(Y,H.data),Y}};e.NetworkCore=L;const M=N=>N.sdkKey?!0:(a.Log.warn("Unable to make request without an SDK key"),!1),D=(N,H)=>{const{sdkKey:ee,fallbackUrl:Y}=N,G=m.StableID.get(ee),J=h.SessionID.get(ee),X=p.SDKType._get(ee);N.body=JSON.stringify(Object.assign(Object.assign({},H),{statsigMetadata:Object.assign(Object.assign({},x.StatsigMetadataProvider.get()),{stableID:G,sessionID:J,sdkType:X,fallbackUrl:Y})}))};function P(N,H){if(!N.isCompressable||(0,o._getStatsigGlobalFlag)("no-compress")!=null||typeof CompressionStream>"u"||typeof TextEncoder>"u")return!1;const ee=N.urlConfig.customUrl!=null||N.urlConfig.fallbackUrls!=null,Y=c.SDKFlags.get(N.sdkKey,"enable_log_event_compression")===!0;switch(H.logEventCompressionMode){case y.LogEventCompressionMode.Disabled:return!1;case y.LogEventCompressionMode.Enabled:return!(ee&&!Y);case y.LogEventCompressionMode.Forced:return!0;default:return!1}}function T(N){return typeof N=="string"?N:N instanceof Error?`${N.name}: ${N.message}`:"Unknown Error"}function z(N,H){return N.includes("Timeout")||H}function R(N,H,ee,Y){var G,J,X;const ie=(0,u._getWindowSafe)(),we=ie?.document,me=typeof navigator<"u"?navigator:null,de=(0,w._isUnloading)(),ce=me&&typeof me.onLine=="boolean"?String(me.onLine):"unknown",fe=(G=we?.visibilityState)!==null&&G!==void 0?G:"unknown",Ae=Object.keys((J=N.headers)!==null&&J!==void 0?J:{}).length>0,le=K(H,(X=ie?.location)===null||X===void 0?void 0:X.origin),pe=N.urlConfig.customUrl!=null,ae=N.fallbackUrl!=null,be=O(Y,[250,1e3,5e3,1e4]),ue=O(Z(N.body),[16384,65536,262144,1048576]);let se="unknown_no_response";return ee?se="timeout":ce==="false"?se="browser_offline":de?se="page_unloading":fe==="hidden"?se="page_hidden":le&&Ae?se="cross_origin_custom_headers_preflight_risk":pe||ae?se="custom_url_no_response":Y<250&&(se="immediate_network_rejection"),{bucket:se,metadata:{elapsedMsBucket:be,bodySizeBucket:ue,online:ce,visibilityState:fe,isUnloading:String(de),crossOrigin:String(le),hasCustomUrl:String(pe)}}}function K(N,H){return H?!N.startsWith(`${H}/`)&&!N.startsWith(`${H}?`)&&N!==H:!0}function Z(N){return N==null?0:typeof N=="string"?N.length:N instanceof Uint8Array?N.byteLength:typeof Blob<"u"&&N instanceof Blob?N.size:-1}function O(N,H){if(N<0)return"unknown";for(const ee of H)if(N<ee)return`<${ee}`;return`>=${H[H.length-1]}`}function Q(N,H){N.urlConfig.endpoint===l.Endpoint._initialize&&i.Diagnostics._markInitNetworkReqStart(N.sdkKey,{attempt:H})}function _(N,H,ee,Y,G){N.urlConfig.endpoint===l.Endpoint._initialize&&i.Diagnostics._markInitNetworkReqEnd(N.sdkKey,i.Diagnostics._getDiagnosticsData(H,ee,Y,G))}function F(N){return t(this,void 0,void 0,function*(){yield new Promise(H=>setTimeout(H,Math.min(v*(N*N),A)))})}}(Dv)),Dv}var are;function Cot(){if(are)return Gg;are=1;var e=Gg&&Gg.__awaiter||function(y,w,b,v){function A(S){return S instanceof b?S:new b(function(E){E(S)})}return new(b||(b=Promise))(function(S,E){function j(D){try{M(v.next(D))}catch(P){E(P)}}function L(D){try{M(v.throw(D))}catch(P){E(P)}}function M(D){D.done?S(D.value):A(D.value).then(j,L)}M((v=v.apply(y,w||[])).next())})};Object.defineProperty(Gg,"__esModule",{value:!0}),Gg.FlushCoordinator=void 0;const t=LG(),o=xot(),i=yot(),a=wot(),l=G4(),d=ma(),c=jye(),p=d2(),u=ob(),h=ib(),m=E0(),f=new Set(["network_request_timed_out_no_response","network_request_exception_no_response","event_sender_post_returned_null","event_sender_post_returned_undefined","event_sender_post_exception"]);let x=class{constructor(y,w,b,v,A,S,E,j,L,M){this._cooldownTimer=null,this._maxIntervalTimer=null,this._hasRunQuickFlush=!1,this._currentFlushPromise=null,this._creationTime=Date.now(),this._isShuttingDown=!1,this._storageKey=null,this._flushInterval=new i.FlushInterval,this._batchQueue=y,this._pendingEvents=w,this._onPrepareFlush=b,this._errorBoundary=M,this._sdkKey=v,this._loggingEnabled=L,this._eventSender=new o.EventSender(v,A,S,E,j)}setLoggingEnabled(y){this._loggingEnabled=y}setLogEventCompressionMode(y){this._eventSender.setLogEventCompressionMode(y)}startScheduledFlushCycle(){this._scheduleNextFlush()}stopScheduledFlushCycle(){this._clearAllTimers()}addEvent(y){this._pendingEvents.addToPendingEventsQueue(y),!this._currentFlushPromise&&this._pendingEvents.hasEventsForFullBatch()&&this.processLimitFlush()}processManualFlush(){return e(this,void 0,void 0,function*(){return this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(a.FlushType.Manual).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()}),this._currentFlushPromise})}processShutdown(){return e(this,void 0,void 0,function*(){return this._isShuttingDown=!0,this._clearAllTimers(),this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(a.FlushType.Shutdown).catch(y=>{d.Log.error(`Error during shutdown flush: ${y}`)}).finally(()=>{this._currentFlushPromise=null}),this._currentFlushPromise})}_executeFlush(y){return e(this,void 0,void 0,function*(){this._clearAllTimers();try{this._prepareQueueForFlush(y);const w=this._batchQueue.takeAllBatches();if(w.length===0)return;yield Promise.all(w.map(b=>this._processOneBatch(b,y)))}finally{this._isShuttingDown||this._scheduleNextFlush()}})}checkQuickFlush(){this._hasRunQuickFlush||Date.now()-this._creationTime>t.EventRetryConstants.QUICK_FLUSH_WINDOW_MS||(this._hasRunQuickFlush=!0,setTimeout(()=>{this.processManualFlush().catch(y=>{d.Log.warn("Quick flush failed:",y)})},t.EventRetryConstants.QUICK_FLUSH_WINDOW_MS))}_attemptScheduledFlush(){if(this._currentFlushPromise){this._scheduleNextFlush();return}const y=this.containsAtLeastOneFullBatch(),w=this._flushInterval.hasReachedMaxInterval();if(!y&&!w){this._scheduleNoopPollTick();return}this._flushInterval.markFlushAttempt();let b;y?b=a.FlushType.ScheduledFullBatch:b=a.FlushType.ScheduledMaxTime,this._currentFlushPromise=this._processNextBatch(b).then(()=>{}).catch(v=>{d.Log.error("Error during scheduled flush:",v)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})}processLimitFlush(){this._flushInterval.hasCompletelyRecoveredFromBackoff()&&(this._currentFlushPromise||(this._currentFlushPromise=this._processLimitFlushInternal().catch(y=>{d.Log.error("Error during limit flush",y)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})))}_processLimitFlushInternal(){return e(this,void 0,void 0,function*(){if(yield this._processNextBatch(a.FlushType.Limit))for(;this._flushInterval.hasCompletelyRecoveredFromBackoff()&&this.containsAtLeastOneFullBatch()&&(yield this._processNextBatch(a.FlushType.Limit)););})}_scheduleNextFlush(){if(this._clearAllTimers(),this._isShuttingDown)return;const y=Math.max(0,this._flushInterval.getTimeUntilNextFlush());this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,u.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},y);const w=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,u.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},w)}_clearAllTimers(){this._cooldownTimer!==null&&(clearTimeout(this._cooldownTimer),this._cooldownTimer=null),this._maxIntervalTimer!==null&&(clearTimeout(this._maxIntervalTimer),this._maxIntervalTimer=null)}_scheduleNoopPollTick(){if(this._clearAllTimers(),this._isShuttingDown)return;this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,u.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},t.EventRetryConstants.TICK_INTERVAL_MS);const y=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,u.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},y)}_processNextBatch(y){return e(this,void 0,void 0,function*(){this._prepareQueueForFlush(y);const w=this._batchQueue.takeNextBatch();return w?this._processOneBatch(w,y):!1})}_processOneBatch(y,w){return e(this,void 0,void 0,function*(){if(this._loggingEnabled!==h.LoggingEnabledOption.always&&(0,p._isServerEnv)())return this._flushInterval.adjustForSuccess(),!0;const b=yield this._eventSender.sendBatch(y);return b.success?(this._flushInterval.adjustForSuccess(),!0):(this._flushInterval.adjustForFailure(),this._handleFailure(y,w,b.statusCode,b.failurePath,b.failureErrorMessage,b.failureDiagnosticBucket,b.failureDiagnosticMetadata),!1)})}_prepareQueueForFlush(y){this._onPrepareFlush();const w=this.convertPendingEventsToBatches();w>0&&(d.Log.warn(`Dropped ${w} events`),this._errorBoundary.logDroppedEvents(w,"Batch queue limit reached during batching",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:t.EventRetryConstants.MAX_PENDING_BATCHES,flushType:y,retries:"dropped before batching"}))}containsAtLeastOneFullBatch(){return this._pendingEvents.hasEventsForFullBatch()||this._batchQueue.hasFullBatch()}convertPendingEventsToBatches(){if(this._pendingEvents.isEmpty())return 0;const y=this._pendingEvents.takeAll();return this._batchQueue.createBatches(y)}_isRetryableBatch(y,w){return!!(c.RETRYABLE_CODES.has(y)||y===-1&&w&&f.has(w))}_handleFailure(y,w,b,v,A,S,E){if(w===a.FlushType.Shutdown){d.Log.warn(`${w} flush failed during shutdown. ${y.events.length} event(s) will be saved to storage for retry in next session.`),this._saveShutdownFailedEventsToStorage(y.events);return}if(!this._isRetryableBatch(b,v)){d.Log.warn(`${w} flush failed after ${y.attempts} attempt(s). ${y.events.length} event(s) will be dropped. Non-retryable error: ${b}`),this._errorBoundary.logEventRequestFailure(y.events.length,"non-retryable error",w,b,y.attempts,v,A,S,E);return}if(y.attempts>=t.EventRetryConstants.MAX_RETRY_ATTEMPTS){d.Log.warn(`${w} flush failed after ${y.attempts} attempt(s). ${y.events.length} event(s) will be dropped.`),this._errorBoundary.logEventRequestFailure(y.events.length,"max retry attempts exceeded",w,b,y.attempts,v,A,S,E);return}y.incrementAttempts();const j=this._batchQueue.requeueBatch(y);j>0&&(d.Log.warn(`Failed to requeue batch : dropped ${j} events due to full queue`),this._errorBoundary.logDroppedEvents(j,"Batch queue limit reached during requeue",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:t.EventRetryConstants.MAX_PENDING_BATCHES,flushType:w,retries:y.attempts}))}loadAndRetryShutdownFailedEvents(){return e(this,void 0,void 0,function*(){const y=this._getStorageKey();try{m.Storage.isReady()||(yield m.Storage.isReadyResolver());const w=this._getShutdownFailedEventsFromStorage(y);if(w.length===0)return;d.Log.debug(`Loading ${w.length} failed shutdown event(s) from storage for retry`),m.Storage.removeItem(y),w.forEach(b=>{this.addEvent(b)}),yield this.processManualFlush()}catch(w){d.Log.warn("Failed to load and retry failed shutdown events:",w)}})}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.failed_shutdown_events.${(0,l._DJB2)(this._sdkKey)}`),this._storageKey}_saveShutdownFailedEventsToStorage(y){const w=this._getStorageKey();try{let b=[...this._getShutdownFailedEventsFromStorage(w),...y];b.length>t.EventRetryConstants.MAX_LOCAL_STORAGE&&(b=b.slice(-t.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,m._setObjectInStorage)(w,b),d.Log.debug(`Saved ${y.length} failed shutdown event(s) to storage (total stored: ${b.length})`)}catch(b){d.Log.warn("Unable to save failed shutdown events to storage:",b)}}_getShutdownFailedEventsFromStorage(y){try{const w=(0,m._getObjectFromStorage)(y);return Array.isArray(w)?w:[]}catch{return[]}}};return Gg.FlushCoordinator=x,Gg}var e9={},sre;function Aot(){if(sre)return e9;sre=1,Object.defineProperty(e9,"__esModule",{value:!0}),e9.PendingEvents=void 0;const e=ma();let t=class{constructor(o){this._pendingEvents=[],this._batchSize=o}addToPendingEventsQueue(o){this._pendingEvents.push(o),e.Log.debug("Enqueued Event:",o)}hasEventsForFullBatch(){return this._pendingEvents.length>=this._batchSize}takeAll(){const o=this._pendingEvents;return this._pendingEvents=[],o}isEmpty(){return this._pendingEvents.length===0}};return e9.PendingEvents=t,e9}var Ed={},lre;function Mye(){if(lre)return Ed;lre=1,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed._createLayerParameterExposure=Ed._createConfigExposure=Ed._mapExposures=Ed._createGateExposure=Ed._isExposureEvent=void 0;const e="statsig::config_exposure",t="statsig::gate_exposure",o="statsig::layer_exposure",i=(h,m,f,x,y)=>(f.bootstrapMetadata&&(x.bootstrapMetadata=f.bootstrapMetadata),{eventName:h,user:m,value:null,metadata:u(f,x),secondaryExposures:y,time:Date.now()}),a=({eventName:h})=>h===t||h===e||h===o;Ed._isExposureEvent=a;const l=(h,m,f)=>{var x,y,w;const b={gate:m.name,gateValue:String(m.value),ruleID:m.ruleID};return((x=m.__evaluation)===null||x===void 0?void 0:x.version)!=null&&(b.configVersion=m.__evaluation.version),i(t,h,m.details,b,d((w=(y=m.__evaluation)===null||y===void 0?void 0:y.secondary_exposures)!==null&&w!==void 0?w:[],f))};Ed._createGateExposure=l;function d(h,m){return h.map(f=>typeof f=="string"?(m??{})[f]:f).filter(f=>f!=null)}Ed._mapExposures=d;const c=(h,m,f)=>{var x,y,w,b;const v={config:m.name,ruleID:m.ruleID};return((x=m.__evaluation)===null||x===void 0?void 0:x.version)!=null&&(v.configVersion=m.__evaluation.version),((y=m.__evaluation)===null||y===void 0?void 0:y.passed)!=null&&(v.rulePassed=String(m.__evaluation.passed)),i(e,h,m.details,v,d((b=(w=m.__evaluation)===null||w===void 0?void 0:w.secondary_exposures)!==null&&b!==void 0?b:[],f))};Ed._createConfigExposure=c;const p=(h,m,f,x)=>{var y,w,b,v,A,S,E;const j=m.__evaluation,L=((y=j?.explicit_parameters)===null||y===void 0?void 0:y.includes(f))===!0;let M="",D=(w=j?.undelegated_secondary_exposures)!==null&&w!==void 0?w:[];L&&(M=(b=j.allocated_experiment_name)!==null&&b!==void 0?b:"",D=(v=j.secondary_exposures)!==null&&v!==void 0?v:[]);const P=(A=m.__evaluation)===null||A===void 0?void 0:A.parameter_rule_ids,T={config:m.name,parameterName:f,ruleID:(S=P?.[f])!==null&&S!==void 0?S:m.ruleID,allocatedExperiment:M,isExplicitParameter:String(L)};return((E=m.__evaluation)===null||E===void 0?void 0:E.version)!=null&&(T.configVersion=m.__evaluation.version),i(o,h,m.details,T,d(D,x))};Ed._createLayerParameterExposure=p;const u=(h,m)=>(m.reason=h.reason,h.lcut&&(m.lcut=String(h.lcut)),h.receivedAt&&(m.receivedAt=String(h.receivedAt)),m);return Ed}var t9={},dre;function Bye(){if(dre)return t9;dre=1,Object.defineProperty(t9,"__esModule",{value:!0}),t9.UrlConfiguration=void 0;const e=G4(),t=eb(),o={[t.Endpoint._initialize]:"i",[t.Endpoint._rgstr]:"e",[t.Endpoint._download_config_specs]:"d"};let i=class{constructor(a,l,d,c){this.customUrl=null,this.fallbackUrls=null,this.endpoint=a,this.endpointDnsKey=o[a],l&&(this.customUrl=l),!l&&d&&(this.customUrl=d.endsWith("/")?`${d}${a}`:`${d}/${a}`),c&&(this.fallbackUrls=c);const p=t.NetworkDefault[a];this.defaultUrl=`${p}/${a}`}getUrl(){var a;return(a=this.customUrl)!==null&&a!==void 0?a:this.defaultUrl}getChecksum(){var a;const l=((a=this.fallbackUrls)!==null&&a!==void 0?a:[]).sort().join(",");return(0,e._DJB2)(this.customUrl+l)}};return t9.UrlConfiguration=i,t9}var cre;function Pye(){if(cre)return Qg;cre=1;var e=Qg&&Qg.__awaiter||function(S,E,j,L){function M(D){return D instanceof j?D:new j(function(P){P(D)})}return new(j||(j=Promise))(function(D,P){function T(K){try{R(L.next(K))}catch(Z){P(Z)}}function z(K){try{R(L.throw(K))}catch(Z){P(Z)}}function R(K){K.done?D(K.value):M(K.value).then(T,z)}R((L=L.apply(S,E||[])).next())})};Object.defineProperty(Qg,"__esModule",{value:!0}),Qg.EventLogger=void 0;const t=fot(),o=AL(),i=LG(),a=Cot(),l=G4(),d=ma(),c=eb(),p=Aot(),u=d2(),h=Mye(),m=ib(),f=E0(),x=Bye(),y=tb(),w=1e3,b=6e5,v={};let A=class Dye{static _safeFlushAndForget(E){var j;(j=v[E])===null||j===void 0||j.flush().catch(()=>{})}constructor(E,j,L,M,D){var P;this._sdkKey=E,this._emitter=j,this._network=L,this._options=M,this._errorBoundary=D,this._pendingEvents=null,this._batchQueue=null,this._flushCoordinator=null,this._lastExposureTimeMap={},this._nonExposedChecks={},this._isShuttingDown=!1,this._storageKey=null,this._pendingCompressionMode=null,this._loggingEnabled=(P=M?.loggingEnabled)!==null&&P!==void 0?P:M?.disableLogging===!0?m.LoggingEnabledOption.disabled:m.LoggingEnabledOption.browserOnly,M?.loggingEnabled&&M.disableLogging!==void 0&&d.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging.");const T=M?.networkConfig;this._logEventUrlConfig=new x.UrlConfiguration(c.Endpoint._rgstr,T?.logEventUrl,T?.api,T?.logEventFallbackUrls)}setLogEventCompressionMode(E){this._flushCoordinator?this._flushCoordinator.setLogEventCompressionMode(E):this._pendingCompressionMode=E}setLoggingEnabled(E){const j=this._loggingEnabled==="disabled",L=E!=="disabled";if(this._loggingEnabled=E,this._flushCoordinator&&this._flushCoordinator.setLoggingEnabled(E),j&&L){const M=this._loadStoredEvents();d.Log.debug(`Loaded ${M.length} stored event(s) from storage`),M.length>0&&(M.forEach(D=>{this._initFlushCoordinator().addEvent(D)}),this.flush().catch(D=>{d.Log.warn("Failed to flush events after enabling logging:",D)}))}}enqueue(E){var j;if(!this._shouldLogEvent(E))return;const L=this._normalizeEvent(E);if(this._loggingEnabled==="disabled"){this._storeEventToStorage(L);return}this._initFlushCoordinator().addEvent(L),(j=this._flushCoordinator)===null||j===void 0||j.checkQuickFlush()}incrementNonExposureCount(E){var j;const L=(j=this._nonExposedChecks[E])!==null&&j!==void 0?j:0;this._nonExposedChecks[E]=L+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var E;const j=(0,u._isServerEnv)();if(j&&((E=this._options)===null||E===void 0?void 0:E.loggingEnabled)!=="always")return;const L=this._initFlushCoordinator();v[this._sdkKey]=this,j||(0,y._subscribeToVisiblityChanged)(M=>{M==="background"?Dye._safeFlushAndForget(this._sdkKey):M==="foreground"&&L.startScheduledFlushCycle()}),L.loadAndRetryShutdownFailedEvents().catch(M=>{d.Log.warn("Failed to load failed shutdown events:",M)}),L.startScheduledFlushCycle()}stop(){return e(this,void 0,void 0,function*(){this._isShuttingDown=!0,this._flushCoordinator&&(yield this._flushCoordinator.processShutdown()),delete v[this._sdkKey],this._flushCoordinator=null,this._pendingEvents=null,this._batchQueue=null})}flush(){return e(this,void 0,void 0,function*(){if(this._flushCoordinator)return this._flushCoordinator.processManualFlush()})}appendAndResetNonExposedChecks(){if(Object.keys(this._nonExposedChecks).length===0)return;const E=Object.assign({},this._nonExposedChecks);this._nonExposedChecks={};const j=this._normalizeEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:E}});this._flushCoordinator&&this._flushCoordinator.addEvent(j)}_shouldLogEvent(E){var j;if(((j=this._options)===null||j===void 0?void 0:j.loggingEnabled)!=="always"&&(0,u._isServerEnv)())return!1;if(!(0,h._isExposureEvent)(E))return!0;const L=E.user?E.user:{statsigEnvironment:void 0},M=(0,o._getUserStorageKey)(this._sdkKey,L),D=E.metadata?E.metadata:{},P=[E.eventName,M,D.gate,D.config,D.ruleID,D.allocatedExperiment,D.parameterName,String(D.isExplicitParameter),D.reason].join("|"),T=this._lastExposureTimeMap[P],z=Date.now();return T&&z-T<b?!1:(Object.keys(this._lastExposureTimeMap).length>w&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[P]=z,!0)}_getCurrentPageUrl(){var E;if(((E=this._options)===null||E===void 0?void 0:E.includeCurrentPageUrlWithEvents)!==!1)return(0,u._getCurrentPageUrlSafe)()}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.pending_events.${(0,l._DJB2)(this._sdkKey)}`),this._storageKey}_initFlushCoordinator(){var E,j;if(this._flushCoordinator)return this._flushCoordinator;const L=(j=(E=this._options)===null||E===void 0?void 0:E.loggingBufferMaxSize)!==null&&j!==void 0?j:i.EventRetryConstants.DEFAULT_BATCH_SIZE;return this._pendingEvents=new p.PendingEvents(L),this._batchQueue=new t.BatchQueue(L),this._flushCoordinator=new a.FlushCoordinator(this._batchQueue,this._pendingEvents,()=>this.appendAndResetNonExposedChecks(),this._sdkKey,this._network,this._emitter,this._logEventUrlConfig,this._options,this._loggingEnabled,this._errorBoundary),this._pendingCompressionMode&&(this._flushCoordinator.setLogEventCompressionMode(this._pendingCompressionMode),this._pendingCompressionMode=null),this._flushCoordinator}_storeEventToStorage(E){const j=this._getStorageKey();try{let L=this._getEventsFromStorage(j);L.push(E),L.length>i.EventRetryConstants.MAX_LOCAL_STORAGE&&(L=L.slice(-i.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,f._setObjectInStorage)(j,L)}catch{d.Log.warn("Unable to save events to storage")}}_getEventsFromStorage(E){try{const j=(0,f._getObjectFromStorage)(E);return Array.isArray(j)?j:[]}catch{return[]}}_loadStoredEvents(){const E=this._getStorageKey(),j=this._getEventsFromStorage(E);return j.length>0&&f.Storage.removeItem(E),j}_normalizeEvent(E){E.user&&(E.user=Object.assign({},E.user),delete E.user.privateAttributes);const j={},L=this._getCurrentPageUrl();return L&&(j.statsigMetadata={currentPage:L}),Object.assign(Object.assign({},E),j)}};return Qg.EventLogger=A,Qg}var o9={},pre;function $ot(){if(pre)return o9;pre=1,Object.defineProperty(o9,"__esModule",{value:!0}),o9.PrecomputedEvaluationsContextHandle=void 0;const e=ma(),t=d2(),o=ob(),i=rb();class a{constructor(d,c,p,u,h,m){this._sdkKey=d,this._getOptions=c,this._getErrorBoundary=p,this._getValues=u,this._getUser=h,this._getSdkInstanceID=m}get sdkKey(){return this._sdkKey}get options(){return this._getOptions()}get errorBoundary(){return this._getErrorBoundary()}get values(){return this._getValues()}get user(){let d=(0,t._cloneObject)("StatsigUser",this._getUser());return d==null&&(e.Log.error("Failed to clone user"),d={}),d}getSession(d=!0){return o.StatsigSession.get(this._sdkKey,d)}get stableID(){return i.StableID.get(this._sdkKey)}get sdkInstanceID(){return this._getSdkInstanceID()}toContext(d=!0){return{sdkKey:this.sdkKey,options:this.options,values:this.values,user:this.user,errorBoundary:this.errorBoundary,session:this.getSession(d),stableID:this.stableID,sdkInstanceID:this.sdkInstanceID}}}return o9.PrecomputedEvaluationsContextHandle=a,o9}var j2={},M2={},ure;function Tye(){if(ure)return M2;ure=1,Object.defineProperty(M2,"__esModule",{value:!0}),M2._getUnitIDFromUser=M2._getFullUserHash=M2._normalizeUser=void 0;const e=G4(),t=ma(),o=d2();function i(d,c,p){const u=(0,o._cloneObject)("StatsigUser",d);return u==null?(t.Log.error("Failed to clone user"),{statsigEnvironment:void 0}):(c!=null&&c.environment!=null?u.statsigEnvironment=c.environment:p!=null&&(u.statsigEnvironment={tier:p}),u)}M2._normalizeUser=i;function a(d){return d?(0,e._DJB2Object)(d):null}M2._getFullUserHash=a;function l(d,c){var p,u,h;if(typeof c!="string")return d.userID;const m=c.toLowerCase();return m!=="userid"?(u=(p=d.customIDs)===null||p===void 0?void 0:p[c])!==null&&u!==void 0?u:(h=d.customIDs)===null||h===void 0?void 0:h[m]:d.userID}return M2._getUnitIDFromUser=l,M2}var r9={},hre;function zye(){if(hre)return r9;hre=1,Object.defineProperty(r9,"__esModule",{value:!0}),r9._typedJsonParse=void 0;const e=ma();function t(o,i,a){try{const l=JSON.parse(o);if(l&&typeof l=="object"&&i in l)return l}catch{}return e.Log.error(`Failed to parse ${a}`),null}return r9._typedJsonParse=t,r9}var mre;function kot(){if(mre)return j2;mre=1;var e=j2&&j2.__awaiter||function(f,x,y,w){function b(v){return v instanceof y?v:new y(function(A){A(v)})}return new(y||(y=Promise))(function(v,A){function S(L){try{j(w.next(L))}catch(M){A(M)}}function E(L){try{j(w.throw(L))}catch(M){A(M)}}function j(L){L.done?v(L.value):b(L.value).then(S,E)}j((w=w.apply(f,x||[])).next())})};Object.defineProperty(j2,"__esModule",{value:!0}),j2._makeDataAdapterResult=j2.DataAdapterCore=void 0;const t=ma(),o=rb(),i=Tye(),a=E0(),l=zye(),d=10,c=8;let p=class{constructor(f,x){this._adapterName=f,this._cacheSuffix=x,this._options=null,this._sdkKey=null,this._cacheLimit=d,this._lastModifiedStoreKey=`statsig.last_modified_time.${x}`,this._inMemoryCache=new h}attach(f,x,y){this._sdkKey=f,this._options=x}getDataSync(f){const x=f&&(0,i._normalizeUser)(f,this._options),y=this._getCacheKey(x),w=this._inMemoryCache.get(y,x);if(w&&this._getIsCacheValueValid(w))return w;const b=this._loadFromCache(y);return b&&this._getIsCacheValueValid(b)?(this._inMemoryCache.add(y,b,this._cacheLimit),this._inMemoryCache.get(y,x)):null}setData(f,x){const y=x&&(0,i._normalizeUser)(x,this._options),w=this._getCacheKey(y);this._inMemoryCache.add(w,u("Bootstrap",f,null,y),this._cacheLimit)}_getIsCacheValueValid(f){return f.stableID==null||f.stableID===o.StableID.get(this._getSdkKey())}_getDataAsyncImpl(f,x,y){return e(this,void 0,void 0,function*(){a.Storage.isReady()||(yield a.Storage.isReadyResolver());const w=f??this.getDataSync(x),b=[this._fetchAndPrepFromNetwork(w,x,y)];return y?.timeoutMs&&b.push(new Promise(v=>setTimeout(v,y.timeoutMs)).then(()=>(t.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(b)})}_prefetchDataImpl(f,x){return e(this,void 0,void 0,function*(){const y=f&&(0,i._normalizeUser)(f,this._options),w=this._getCacheKey(y),b=yield this._getDataAsyncImpl(null,y,x);b&&this._inMemoryCache.add(w,Object.assign(Object.assign({},b),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(f,x,y){return e(this,void 0,void 0,function*(){var w;const b=(w=f?.data)!==null&&w!==void 0?w:null,v=f!=null&&this._isCachedResultValidFor204(f,x),A=yield this._fetchFromNetwork(b,x,y,v);if(!A)return t.Log.debug("No response returned for latest value"),null;const S=(0,l._typedJsonParse)(A,"has_updates","Response"),E=this._getSdkKey(),j=o.StableID.get(E);let L=null;if(S?.has_updates===!0)L=u("Network",A,j,x);else if(b&&S?.has_updates===!1)L=u("NetworkNotModified",b,j,x);else return null;const M=this._getCacheKey(x);return this._inMemoryCache.add(M,L,this._cacheLimit),this._writeToCache(M,L),L})}_getSdkKey(){return this._sdkKey!=null?this._sdkKey:(t.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(f){var x;const y=(x=a.Storage.getItem)===null||x===void 0?void 0:x.call(a.Storage,f);if(y==null)return null;const w=(0,l._typedJsonParse)(y,"source","Cached Result");return w?Object.assign(Object.assign({},w),{source:"Cache"}):null}_writeToCache(f,x){const y=JSON.stringify(x);for(let w=0;w<c;w++)try{a.Storage.setItem(f,y);break}catch(b){if(!(b instanceof Error)||!(b.toString().includes("QuotaExceededError")||b.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw b;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(f,this._cacheLimit-1)}this._runLocalStorageCacheEviction(f)}_runLocalStorageCacheEviction(f,x=this._cacheLimit){var y;const w=(y=(0,a._getObjectFromStorage)(this._lastModifiedStoreKey))!==null&&y!==void 0?y:{};w[f]=Date.now();const b=m(w,x);for(const v of b)delete w[v],a.Storage.removeItem(v);(0,a._setObjectInStorage)(this._lastModifiedStoreKey,w)}};j2.DataAdapterCore=p;function u(f,x,y,w){return{source:f,data:x,receivedAt:Date.now(),stableID:y,fullUserHash:(0,i._getFullUserHash)(w)}}j2._makeDataAdapterResult=u;class h{constructor(){this._data={}}get(x,y){var w;const b=this._data[x],v=b?.stableID,A=(w=y?.customIDs)===null||w===void 0?void 0:w.stableID;return A&&v&&A!==v?(t.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):b}add(x,y,w){const b=m(this._data,w-1);for(const v of b)delete this._data[v];this._data[x]=y}merge(x){this._data=Object.assign(Object.assign({},this._data),x)}}function m(f,x){const y=Object.keys(f);return y.length<=x?[]:x===0?y:y.sort((w,b)=>{const v=f[w],A=f[b];return typeof v=="object"&&typeof A=="object"?v.receivedAt-A.receivedAt:v-A}).slice(0,y.length-x)}return j2}var gre={},fre;function Sot(){return fre||(fre=1,Object.defineProperty(gre,"__esModule",{value:!0})),gre}var Tv={},xre;function Rye(){return xre||(xre=1,function(e){var t=Tv&&Tv.__awaiter||function(m,f,x,y){function w(b){return b instanceof x?b:new x(function(v){v(b)})}return new(x||(x=Promise))(function(b,v){function A(j){try{E(y.next(j))}catch(L){v(L)}}function S(j){try{E(y.throw(j))}catch(L){v(L)}}function E(j){j.done?b(j.value):w(j.value).then(A,S)}E((y=y.apply(m,f||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorBoundary=e.EXCEPTION_ENDPOINT=void 0;const o=ma(),i=$L(),a=Vy();e.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";const l="[Statsig] UnknownError";let d=class{constructor(m,f,x,y){this._sdkKey=m,this._options=f,this._emitter=x,this._lastSeenError=y,this._seen=new Set}wrap(m,f){try{const x=m;u(x).forEach(y=>{const w=x[y];"$EB"in w||(x[y]=(...b)=>this._capture(f?`${f}:${y}`:y,()=>w.apply(m,b)),x[y].$EB=!0)})}catch(x){this._onError("eb:wrap",x)}}logError(m,f){this._onError(m,f)}logDroppedEvents(m,f,x){const y={eventCount:String(m),reason:f};x&&Object.keys(x).forEach(w=>{y[w]=String(x[w])}),this._onError("statsig::log_event_dropped_event_count",new Error(f),!0,y)}logEventRequestFailure(m,f,x,y,w,b,v,A,S){const E={eventCount:String(m),flushType:x,statusCode:String(y),reason:f,retries:String(w)};b&&(E.failurePath=b),typeof v=="string"&&v.length>0&&(E.failureErrorMessage=v),typeof A=="string"&&A.length>0&&(E.failureDiagnosticBucket=A),S&&Object.keys(S).forEach(j=>{const L=S[j];L.length>0&&(E[`failureDiagnostic_${j}`]=L)}),this._onError("statsig::log_event_failed",new Error(f),!0,E)}getLastSeenErrorAndReset(){const m=this._lastSeenError;return this._lastSeenError=void 0,m??null}attachErrorIfNoneExists(m){this._lastSeenError||(this._lastSeenError=c(m))}_capture(m,f){try{const x=f();return x&&x instanceof Promise?x.catch(y=>this._onError(m,y)):x}catch(x){return this._onError(m,x),null}}_onError(m,f,x=!1,y){try{o.Log.warn(`Caught error in ${m}`,{error:f}),t(this,void 0,void 0,function*(){var w,b,v,A,S,E,j;const L=f||Error(l),M=L instanceof Error,D=M?L.name:"No Name",P=c(L);if(this._lastSeenError=P,!x&&this._seen.has(D))return;if(this._seen.add(D),!((b=(w=this._options)===null||w===void 0?void 0:w.networkConfig)===null||b===void 0)&&b.preventAllNetworkTraffic){(v=this._emitter)===null||v===void 0||v.call(this,{name:"error",error:f,tag:m});return}const T=i.SDKType._get(this._sdkKey),z=a.StatsigMetadataProvider.get(),R=M?L.stack:p(L),K=Object.assign(Object.assign({tag:m,exception:D,info:R,statsigOptions:h(this._options)},Object.assign(Object.assign({},z),{sdkType:T})),y??{}),Z=(A=this._options)===null||A===void 0?void 0:A.networkConfig;yield((S=Z?.networkOverrideFunc)!==null&&S!==void 0?S:fetch)((E=Z?.sdkExceptionUrl)!==null&&E!==void 0?E:e.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(T),"STATSIG-SDK-VERSION":String(z.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(K)}),(j=this._emitter)===null||j===void 0||j.call(this,{name:"error",error:f,tag:m})}).then(()=>{}).catch(()=>{})}catch{}}};e.ErrorBoundary=d;function c(m){return m instanceof Error?m:typeof m=="string"?new Error(m):new Error("An unknown error occurred.")}function p(m){try{return JSON.stringify(m)}catch{return l}}function u(m){const f=new Set;let x=Object.getPrototypeOf(m);for(;x&&x!==Object.prototype;)Object.getOwnPropertyNames(x).filter(y=>typeof x?.[y]=="function").forEach(y=>f.add(y)),x=Object.getPrototypeOf(x);return Array.from(f)}function h(m){if(!m)return{};const f={};return Object.keys(m).forEach(x=>{const y=x,w=m[y];switch(typeof w){case"number":case"bigint":case"boolean":f[String(y)]=w;break;case"string":w.length<50?f[String(y)]=w:f[String(y)]="set";break;case"object":y==="environment"?f.environment=w:y==="networkConfig"?f.networkConfig=w:f[String(y)]=w!=null?"set":"unset";break}}),f}}(Tv)),Tv}var yre={},wre;function Eot(){return wre||(wre=1,Object.defineProperty(yre,"__esModule",{value:!0})),yre}var bre={},vre;function Lot(){return vre||(vre=1,Object.defineProperty(bre,"__esModule",{value:!0})),bre}var Cre={},Are;function Iot(){return Are||(Are=1,Object.defineProperty(Cre,"__esModule",{value:!0})),Cre}var Zg={},$re;function Fye(){if($re)return Zg;$re=1,Object.defineProperty(Zg,"__esModule",{value:!0}),Zg.createMemoKey=Zg.MemoPrefix=void 0,Zg.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};const e=new Set([]),t=new Set(["userPersistedValues"]);function o(i,a,l){let d=`${i}|${a}`;if(!l)return d;for(const c of Object.keys(l)){if(t.has(c))return;e.has(c)?d+=`|${c}=true`:d+=`|${c}=${l[c]}`}return d}return Zg.createMemoKey=o,Zg}var kre={},Sre;function jot(){return Sre||(Sre=1,Object.defineProperty(kre,"__esModule",{value:!0})),kre}var Ere={},Lre;function Mot(){return Lre||(Lre=1,Object.defineProperty(Ere,"__esModule",{value:!0})),Ere}var Ire={},jre;function Bot(){return jre||(jre=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._fastApproxSizeOf=void 0;const t=2,o=1,i=(a,l)=>{let d=0;const c=Object.keys(a);for(let p=0;p<c.length;p++){const u=c[p],h=a[u];if(d+=u.length,typeof h=="object"&&h!==null?d+=(0,e._fastApproxSizeOf)(h,l)+t:d+=String(h).length+o,d>=l)return d}return d};e._fastApproxSizeOf=i}(Ire)),Ire}var Jg={},Mre;function Dot(){if(Mre)return Jg;Mre=1;var e=Jg&&Jg.__awaiter||function(y,w,b,v){function A(S){return S instanceof b?S:new b(function(E){E(S)})}return new(b||(b=Promise))(function(S,E){function j(D){try{M(v.next(D))}catch(P){E(P)}}function L(D){try{M(v.throw(D))}catch(P){E(P)}}function M(D){D.done?S(D.value):A(D.value).then(j,L)}M((v=v.apply(y,w||[])).next())})};Object.defineProperty(Jg,"__esModule",{value:!0}),Jg.StatsigClientBase=void 0,d4();const t=d4(),o=Rye(),i=Pye(),a=ma(),l=Fye(),d=d2(),c=ob(),p=rb(),u=ib(),h=E0(),m=3e3;let f=class{constructor(y,w,b,v){var A,S,E,j;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const L=this.$emt.bind(this);v?.logLevel!=null&&(a.Log.level=v.logLevel),v?.disableStorage&&h.Storage._setDisabled(!0),v?.initialSessionID&&c.StatsigSession.overrideInitialSessionID(v.initialSessionID,y),v?.storageProvider&&h.Storage._setProvider(v.storageProvider),v?.enableCookies&&p.StableID._setCookiesEnabled(y,v.enableCookies),v?.disableStableID&&p.StableID._setDisabled(y,!0),this._sdkKey=y,this._options=v??{},this._memoCache={},this.overrideAdapter=(A=v?.overrideAdapter)!==null&&A!==void 0?A:null,this._errorBoundary=new o.ErrorBoundary(y,v,L),this._logger=new i.EventLogger(y,L,b,v,this._errorBoundary),this._errorBoundary.wrap(this),this._errorBoundary.wrap(w),this._errorBoundary.wrap(this._logger),b.setErrorBoundary(this._errorBoundary),this.dataAdapter=w,this.dataAdapter.attach(y,v,b),this.storageProvider=h.Storage,(j=(E=(S=this.overrideAdapter)===null||S===void 0?void 0:S.loadFromStorage)===null||E===void 0?void 0:E.call(S))===null||j===void 0||j.catch(M=>this._errorBoundary.logError("OA::loadFromStorage",M)),this._primeReadyRipcord(),x(y,this)}updateRuntimeOptions(y){y.loggingEnabled?(this._options.loggingEnabled=y.loggingEnabled,this._logger.setLoggingEnabled(y.loggingEnabled)):y.disableLogging!=null&&(this._options.disableLogging=y.disableLogging,this._logger.setLoggingEnabled(y.disableLogging?"disabled":"browser-only")),y.disableStorage!=null&&(this._options.disableStorage=y.disableStorage,h.Storage._setDisabled(y.disableStorage)),y.enableCookies!=null&&(this._options.enableCookies=y.enableCookies,p.StableID._setCookiesEnabled(this._sdkKey,y.enableCookies)),y.logEventCompressionMode?this._logger.setLogEventCompressionMode(y.logEventCompressionMode):y.disableCompression&&this._logger.setLogEventCompressionMode(u.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return e(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(y,w){this._listeners[y]||(this._listeners[y]=[]),this._listeners[y].push(w)}off(y,w){if(this._listeners[y]){const b=this._listeners[y].indexOf(w);b!==-1&&this._listeners[y].splice(b,1)}}$on(y,w){w.__isInternal=!0,this.on(y,w)}$emt(y){var w;const b=v=>{try{v(y)}catch(A){if(v.__isInternal===!0){this._errorBoundary.logError(`__emit:${y.name}`,A);return}a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",y)}};this._listeners[y.name]&&this._listeners[y.name].forEach(v=>b(v)),(w=this._listeners["*"])===null||w===void 0||w.forEach(b)}_setStatus(y,w){this.loadingStatus=y,this._memoCache={},this.$emt({name:"values_updated",status:y,values:w})}_enqueueExposure(y,w,b){if(b?.disableExposureLog===!0){this._logger.incrementNonExposureCount(y);return}this._logger.enqueue(w)}_memoize(y,w){return(b,v)=>{if(this._options.disableEvaluationMemoization)return w(b,v);const A=(0,l.createMemoKey)(y,b,v);return A?(A in this._memoCache||(Object.keys(this._memoCache).length>=m&&(this._memoCache={}),this._memoCache[A]=w(b,v)),this._memoCache[A]):w(b,v)}}};Jg.StatsigClientBase=f;function x(y,w){var b;if((0,d._isServerEnv)())return;const v=(0,t._getStatsigGlobal)(),A=(b=v.instances)!==null&&b!==void 0?b:{},S=w;A[y]!=null&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),A[y]=S,v.firstInstance||(v.firstInstance=S),v.instances=A,__STATSIG__=v}return Jg}var zv={},Bre;function Pot(){return Bre||(Bre=1,Object.defineProperty(zv,"__esModule",{value:!0}),zv.DataAdapterCachePrefix=void 0,zv.DataAdapterCachePrefix="statsig.cached"),zv}var Dre={},Pre;function Tot(){return Pre||(Pre=1,Object.defineProperty(Dre,"__esModule",{value:!0})),Dre}var il={},Tre;function zot(){if(Tre)return il;Tre=1,Object.defineProperty(il,"__esModule",{value:!0}),il._makeTypedGet=il._mergeOverride=il._makeLayer=il._makeExperiment=il._makeDynamicConfig=il._makeFeatureGate=void 0;const e=ma(),t=IG();function o(u,h,m,f){var x;return{name:u,details:h,ruleID:(x=m?.rule_id)!==null&&x!==void 0?x:"",__evaluation:m,value:f}}function i(u,h,m){var f;return Object.assign(Object.assign({},o(u,h,m,m?.value===!0)),{idType:(f=m?.id_type)!==null&&f!==void 0?f:null})}il._makeFeatureGate=i;function a(u,h,m){var f,x;const y=(f=m?.value)!==null&&f!==void 0?f:{};return Object.assign(Object.assign({},o(u,h,m,y)),{idType:(x=m?.id_type)!==null&&x!==void 0?x:null,get:p(u,m?.value)})}il._makeDynamicConfig=a;function l(u,h,m){var f;const x=a(u,h,m);return Object.assign(Object.assign({},x),{groupName:(f=m?.group_name)!==null&&f!==void 0?f:null})}il._makeExperiment=l;function d(u,h,m,f){var x,y;return Object.assign(Object.assign({},o(u,h,m,void 0)),{get:p(u,m?.value,f),groupName:(x=m?.group_name)!==null&&x!==void 0?x:null,__value:(y=m?.value)!==null&&y!==void 0?y:{}})}il._makeLayer=d;function c(u,h,m,f){return Object.assign(Object.assign(Object.assign({},u),h),{get:p(u.name,m,f)})}il._mergeOverride=c;function p(u,h,m){return(f,x)=>{var y;const w=(y=h?.[f])!==null&&y!==void 0?y:null;return w==null?x??null:x!=null&&!(0,t._isTypeMatch)(w,x)?(e.Log.warn(`Parameter type mismatch. '${u}.${f}' was found to be type '${typeof w}' but fallback/return type is '${typeof x}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),x??null):(m?.(f),w)}}return il._makeTypedGet=p,il}var zre={},Rre;function Rot(){return Rre||(Rre=1,Object.defineProperty(zre,"__esModule",{value:!0})),zre}var Xg={},Fre;function Fot(){if(Fre)return Xg;Fre=1,Object.defineProperty(Xg,"__esModule",{value:!0}),Xg.UPDATE_DETAIL_ERROR_MESSAGES=Xg.createUpdateDetails=void 0;const e=(t,o,i,a,l,d)=>({duration:i,source:o,success:t,error:a,sourceUrl:l,warnings:d});return Xg.createUpdateDetails=e,Xg.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."},Xg}var Ore;function On(){return Ore||(Ore=1,function(e){var t=Z5&&Z5.__createBinding||(Object.create?function(u,h,m,f){f===void 0&&(f=m);var x=Object.getOwnPropertyDescriptor(h,m);(!x||("get"in x?!h.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(u,f,x)}:function(u,h,m,f){f===void 0&&(f=m),u[f]=h[m]}),o=Z5&&Z5.__exportStar||function(u,h){for(var m in u)m!=="default"&&!Object.prototype.hasOwnProperty.call(h,m)&&t(h,u,m)};Object.defineProperty(e,"__esModule",{value:!0}),e.Storage=e.Log=e.EventLogger=e.Diagnostics=void 0,d4();const i=d4(),a=K_();Object.defineProperty(e,"Diagnostics",{enumerable:!0,get:function(){return a.Diagnostics}});const l=Pye();Object.defineProperty(e,"EventLogger",{enumerable:!0,get:function(){return l.EventLogger}});const d=ma();Object.defineProperty(e,"Log",{enumerable:!0,get:function(){return d.Log}});const c=Vy(),p=E0();Object.defineProperty(e,"Storage",{enumerable:!0,get:function(){return p.Storage}}),o(d4(),e),o(AL(),e),o($ot(),e),o(kot(),e),o(K_(),e),o(Sot(),e),o(Rye(),e),o(Eot(),e),o(Lot(),e),o(G4(),e),o(Iot(),e),o(ma(),e),o(Fye(),e),o(eb(),e),o(jye(),e),o(jot(),e),o(Mot(),e),o(d2(),e),o($L(),e),o(ob(),e),o(Bot(),e),o(rb(),e),o(Dot(),e),o(Iye(),e),o(Pot(),e),o(Mye(),e),o(Vy(),e),o(ib(),e),o(Tot(),e),o(zot(),e),o(Rot(),e),o(Tye(),e),o(E0(),e),o(zye(),e),o(IG(),e),o(Bye(),e),o(jG(),e),o(tb(),e),o(Fot(),e),o(Lye(),e),Object.assign((0,i._getStatsigGlobal)(),{Log:d.Log,SDK_VERSION:c.SDK_VERSION})}(Z5)),Z5}var Rv={},e3={},Nre;function Tm(){if(Nre)return e3;Nre=1,Object.defineProperty(e3,"__esModule",{value:!0}),e3.isNoopClient=e3.NoopEvaluationsClient=void 0;const e=On(),t={success:!1,error:Error("NoClient"),duration:0,source:"Uninitialized",sourceUrl:null},o=()=>{},i=()=>t,a=()=>Promise.resolve(),l=()=>Promise.resolve(t),d={reason:"Error:NoClient"},c=x=>(...y)=>{const w=typeof y[0]=="string"?y[0]:y[1];switch(x){case"gate":return(0,e._makeFeatureGate)(w,d,null);case"config":return(0,e._makeDynamicConfig)(w,d,null);case"layer":return(0,e._makeLayer)(w,d,null);case"param_store":return{name:w}}},p={attach:o,getDataSync:()=>null,getDataAsync:()=>Promise.resolve(null),setData:o,setDataLegacy:o,prefetchData:a},u={sdkKey:"",options:{},values:null,user:{userID:""},errorBoundary:{},session:{data:{sessionID:"",startTime:0,lastUpdate:0},sdkKey:"",lastPersistedAt:0,storageKey:""},stableID:"",storageProvider:e.Storage,sdkInstanceID:""},h=new e.PrecomputedEvaluationsContextHandle("",()=>({}),()=>({}),()=>null,()=>({userID:""}),()=>""),m={isNoop:!0,loadingStatus:"Uninitialized",initializeSync:i,initializeAsync:l,shutdown:a,flush:a,updateRuntimeOptions:o,updateUserSync:i,updateUserAsync:l,getContext:()=>Object.assign({},u),getContextHandle:()=>h,checkGate:()=>!1,getFeatureGate:c("gate"),getDynamicConfig:c("config"),getExperiment:c("config"),getLayer:c("layer"),getParameterStore:c("param_store"),logEvent:o,on:o,off:o,$on:o,$emt:o,dataAdapter:p};e3.NoopEvaluationsClient=m;function f(x){return"isNoop"in x}return e3.isNoopClient=f,e3}var Hre;function c2(){if(Hre)return Rv;Hre=1,Object.defineProperty(Rv,"__esModule",{value:!0});const e=$,t=Tm();return Rv.default=(0,e.createContext)({renderVersion:0,client:t.NoopEvaluationsClient,isLoading:!0}),Rv}var i9={},n9={},X5={},ef={},Fv={},a9={},_re;function Oot(){if(_re)return a9;_re=1,Object.defineProperty(a9,"__esModule",{value:!0}),a9.V1InitializeContainer=void 0;const e=On();let t=class{constructor(o){this._values=o}getGate(o){return this._getResultFromLookup(this._values.feature_gates,o)}getConfig(o){return this._getResultFromLookup(this._values.dynamic_configs,o)}getLayer(o){return this._getResultFromLookup(this._values.layer_configs,o)}getParamStore(o){return this._getResultFromLookup(this._values.param_stores,o)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(o,i){var a,l;return o&&(l=(a=o[i])!==null&&a!==void 0?a:o[(0,e._DJB2)(i)])!==null&&l!==void 0?l:null}};return a9.V1InitializeContainer=t,a9}var s9={},Vre;function Not(){if(Vre)return s9;Vre=1,Object.defineProperty(s9,"__esModule",{value:!0}),s9.V2InitializeContainer=void 0;const e=On();let t=class{constructor(o){this._values=o}getGate(o){var i,a,l;const d=this._getResultFromLookup(this._values.feature_gates,o);return d?{name:o,value:d.v===!0,rule_id:(i=d.r)!==null&&i!==void 0?i:"default",secondary_exposures:(a=d.s)!==null&&a!==void 0?a:[],id_type:(l=d.i)!==null&&l!==void 0?l:""}:null}getConfig(o){var i,a,l,d;const c=this._getResultFromLookup(this._values.dynamic_configs,o);return c?{name:o,value:(i=this._values.values[c.v])!==null&&i!==void 0?i:{},rule_id:c.r,secondary_exposures:(a=c.s)!==null&&a!==void 0?a:[],id_type:(l=c.i)!==null&&l!==void 0?l:"",is_user_in_experiment:c.ue===!0,passed:c.p===!0,group_name:(d=c.gn)!==null&&d!==void 0?d:void 0,is_experiment_active:c.ea===!0,group:c.r,is_device_based:c.i==="stableID"}:null}getLayer(o){var i,a,l,d,c,p;const u=this._getResultFromLookup(this._values.layer_configs,o);return u?{name:o,value:(i=this._values.values[u.v])!==null&&i!==void 0?i:{},rule_id:u.r,secondary_exposures:(a=u.s)!==null&&a!==void 0?a:[],is_user_in_experiment:u.ue===!0,group_name:(l=u.gn)!==null&&l!==void 0?l:void 0,is_experiment_active:u.ea===!0,group:u.r,is_device_based:u.i==="stableID",allocated_experiment_name:(d=u.ae)!==null&&d!==void 0?d:"",explicit_parameters:(c=u.ep)!==null&&c!==void 0?c:[],undelegated_secondary_exposures:(p=u.us)!==null&&p!==void 0?p:[],parameter_rule_ids:u.pr}:null}getParamStore(o){return this._getResultFromLookup(this._values.param_stores,o)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(o,i){var a,l;return o&&(l=(a=o[i])!==null&&a!==void 0?a:o[(0,e._DJB2)(i)])!==null&&l!==void 0?l:null}};return s9.V2InitializeContainer=t,s9}var Qre;function Hot(){if(Qre)return Fv;Qre=1,Object.defineProperty(Fv,"__esModule",{value:!0});const e=On(),t=Oot(),o=Not();let i=class{constructor(a,l){this._sdkKey=a,this._options=l,this._valuesForExternalUse=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._valuesForExternalUse=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._valuesForExternalUse}setValues(a,l){var d,c;if(!a)return!1;const p=(0,e._typedJsonParse)(a.data,"has_updates","EvaluationResponse");return p==null?!1:(this._source=a.source,p?.has_updates!==!0||((d=p.time)!==null&&d!==void 0?d:0)<this._lcut||(this._valuesForExternalUse=(0,e._typedJsonParse)(a.data,"has_updates","EvaluationResponse"),this._lcut=p.time,this._receivedAt=a.receivedAt,p.response_format==="init-v2"?this._values=new o.V2InitializeContainer(p):this._values=new t.V1InitializeContainer(p),this._bootstrapMetadata=this._extractBootstrapMetadata(a.source,p),a.source&&p.user&&this._setWarningState(l,p),e.SDKFlags.setFlags(this._sdkKey,(c=p.sdk_flags)!==null&&c!==void 0?c:{})),!0)}getWarnings(){if(this._warnings.size!==0)return Array.from(this._warnings)}getGate(a){const l=this._values?this._values.getGate(a):null;return this._getDetailedStoreResult(l)}getConfig(a){const l=this._values?this._values.getConfig(a):null;return this._getDetailedStoreResult(l)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(a){const l=this._values?this._values.getLayer(a):null;return this._getDetailedStoreResult(l)}getParamStore(a){const l=this._values?this._values.getParamStore(a):null;return this._getDetailedStoreResult(l)}getSource(){return this._source}getExposureMapping(){var a;return(a=this._values)===null||a===void 0?void 0:a.getExposureMapping()}_extractBootstrapMetadata(a,l){if(a!=="Bootstrap")return null;const d={};return l.user&&(d.user=l.user),l.sdkInfo&&(d.generatorSDKInfo=l.sdkInfo),d.lcut=l.time,d}_getDetailedStoreResult(a){return{result:a,details:this._getDetails(a==null)}}_setWarningState(a,l){var d,c,p;const u=e.StableID.get(this._sdkKey);if(((d=a.customIDs)===null||d===void 0?void 0:d.stableID)!==u&&(!((c=a.customIDs)===null||c===void 0)&&c.stableID||u)){this._warnings.add("StableIDMismatch");return}if("user"in l){let h=l.user,m=Object.assign(Object.assign({},a),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});!((p=this._options)===null||p===void 0)&&p.disableStableID&&(m=Object.assign(Object.assign({},m),{customIDs:Object.assign(Object.assign({},m.customIDs),{stableID:void 0})}),h=Object.assign(Object.assign({},h),{customIDs:Object.assign(Object.assign({},h.customIDs),{stableID:void 0})})),(0,e._getFullUserHash)(m)!==(0,e._getFullUserHash)(h)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if(this._source==="Uninitialized"||this._source==="NoValues")return{reason:this._source};const a={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(a.warnings=Array.from(this._warnings)),a}_getDetails(a){var l,d;const c=this.getCurrentSourceDetails();let p=c.reason;const u=(l=c.warnings)!==null&&l!==void 0?l:[];this._source==="Bootstrap"&&u.length>0&&(p=p+u[0]),p!=="Uninitialized"&&p!=="NoValues"&&(p=`${p}:${a?"Unrecognized":"Recognized"}`);const h=this._source==="Bootstrap"&&(d=this._bootstrapMetadata)!==null&&d!==void 0?d:void 0;return h&&(c.bootstrapMetadata=h),Object.assign(Object.assign({},c),{reason:p})}};return Fv.default=i,Fv}var tf={},l9={},Ure;function _ot(){if(Ure)return l9;Ure=1,Object.defineProperty(l9,"__esModule",{value:!0}),l9._resolveDeltasResponse=void 0;const e=On(),t=2;function o(d,c){const p=(0,e._typedJsonParse)(c,"checksum","DeltasEvaluationResponse");if(!p)return{hadBadDeltaChecksum:!0};const u=i(d,p),h=a(u),m=(0,e._DJB2Object)({feature_gates:h.feature_gates,dynamic_configs:h.dynamic_configs,layer_configs:h.layer_configs},t);return m===p.checksumV2?JSON.stringify(h):{hadBadDeltaChecksum:!0,badChecksum:m,badMergedConfigs:h,badFullResponse:p.deltas_full_response}}l9._resolveDeltasResponse=o;function i(d,c){return Object.assign(Object.assign(Object.assign({},d),c),{feature_gates:Object.assign(Object.assign({},d.feature_gates),c.feature_gates),layer_configs:Object.assign(Object.assign({},d.layer_configs),c.layer_configs),dynamic_configs:Object.assign(Object.assign({},d.dynamic_configs),c.dynamic_configs)})}function a(d){const c=d;return l(d.deleted_gates,c.feature_gates),delete c.deleted_gates,l(d.deleted_configs,c.dynamic_configs),delete c.deleted_configs,l(d.deleted_layers,c.layer_configs),delete c.deleted_layers,c}function l(d,c){d?.forEach(p=>{delete c[p]})}return l9}var Wre;function Oye(){if(Wre)return tf;Wre=1;var e=tf&&tf.__awaiter||function(a,l,d,c){function p(u){return u instanceof d?u:new d(function(h){h(u)})}return new(d||(d=Promise))(function(u,h){function m(y){try{x(c.next(y))}catch(w){h(w)}}function f(y){try{x(c.throw(y))}catch(w){h(w)}}function x(y){y.done?u(y.value):p(y.value).then(m,f)}x((c=c.apply(a,l||[])).next())})};Object.defineProperty(tf,"__esModule",{value:!0});const t=On(),o=_ot();class i extends t.NetworkCore{constructor(l,d){super(l,d);const c=l?.networkConfig;this._option=l,this._initializeUrlConfig=new t.UrlConfiguration(t.Endpoint._initialize,c?.initializeUrl,c?.api,c?.initializeFallbackUrls)}fetchEvaluations(l,d,c,p,u){return e(this,void 0,void 0,function*(){var h,m,f,x,y,w;const b=d?(0,t._typedJsonParse)(d,"has_updates","InitializeResponse"):null;let v={user:p,hash:(f=(m=(h=this._option)===null||h===void 0?void 0:h.networkConfig)===null||m===void 0?void 0:m.initializeHashAlgorithm)!==null&&f!==void 0?f:"djb2",deltasResponseRequested:!1,full_checksum:null};if(b?.has_updates){const A=b?.hash_used!==((w=(y=(x=this._option)===null||x===void 0?void 0:x.networkConfig)===null||y===void 0?void 0:y.initializeHashAlgorithm)!==null&&w!==void 0?w:"djb2");v=Object.assign(Object.assign({},v),{sinceTime:u&&!A?b.time:0,previousDerivedFields:"derived_fields"in b&&u?b.derived_fields:{},deltasResponseRequested:!0,full_checksum:b.full_checksum,partialUserMatchSinceTime:A?0:b.time})}return this._fetchEvaluations(l,b,v,c)})}_fetchEvaluations(l,d,c,p){return e(this,void 0,void 0,function*(){var u,h;const m=yield this.post({sdkKey:l,urlConfig:this._initializeUrlConfig,data:c,retries:2,isStatsigEncodable:!0,priority:p});if(m?.code===204)return'{"has_updates": false}';if(m?.code!==200)return(u=m?.body)!==null&&u!==void 0?u:null;if(d?.has_updates!==!0||((h=m.body)===null||h===void 0?void 0:h.includes('"is_delta":true'))!==!0||c.deltasResponseRequested!==!0)return m.body;const f=(0,o._resolveDeltasResponse)(d,m.body);return typeof f=="string"?f:this._fetchEvaluations(l,d,Object.assign(Object.assign(Object.assign({},c),f),{deltasResponseRequested:!1}),p)})}}return tf.default=i,tf}var d9={},Gre;function Vot(){if(Gre)return d9;Gre=1,Object.defineProperty(d9,"__esModule",{value:!0}),d9._makeParamStoreGetter=void 0;const e=On(),t={disableExposureLog:!0};function o(h){return h==null||h.disableExposureLog===!1}function i(h,m){return m!=null&&!(0,e._isTypeMatch)(h,m)}function a(h,m){return h.value}function l(h,m,f){return h.getFeatureGate(m.gate_name,o(f)?void 0:t).value?m.pass_value:m.fail_value}function d(h,m,f,x){const y=h.getDynamicConfig(m.config_name,o(x)?void 0:t).get(m.param_name);return i(y,f)?f:y}function c(h,m,f,x){const y=h.getExperiment(m.experiment_name,o(x)?void 0:t).get(m.param_name);return i(y,f)?f:y}function p(h,m,f,x){const y=h.getLayer(m.layer_name,o(x)?void 0:t).get(m.param_name);return i(y,f)?f:y}function u(h,m,f){return(x,y)=>{if(m==null)return y;const w=m[x];if(w==null||y!=null&&(0,e._typeOf)(y)!==w.param_type)return y;switch(w.ref_type){case"static":return a(w);case"gate":return l(h,w,f);case"dynamic_config":return d(h,w,y,f);case"experiment":return c(h,w,y,f);case"layer":return p(h,w,y,f);default:return y}}}return d9._makeParamStoreGetter=u,d9}var t3={},Yre;function Qot(){if(Yre)return t3;Yre=1;var e=t3&&t3.__awaiter||function(a,l,d,c){function p(u){return u instanceof d?u:new d(function(h){h(u)})}return new(d||(d=Promise))(function(u,h){function m(y){try{x(c.next(y))}catch(w){h(w)}}function f(y){try{x(c.throw(y))}catch(w){h(w)}}function x(y){y.done?u(y.value):p(y.value).then(m,f)}x((c=c.apply(a,l||[])).next())})};Object.defineProperty(t3,"__esModule",{value:!0}),t3.StatsigEvaluationsDataAdapter=void 0;const t=On(),o=Oye();let i=class extends t.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(a,l,d){super.attach(a,l,d),d!==null&&d instanceof o.default?this._network=d:this._network=new o.default(l??{})}getDataAsync(a,l,d){return this._getDataAsyncImpl(a,(0,t._normalizeUser)(l,this._options),d)}prefetchData(a,l){return this._prefetchDataImpl(a,l)}setData(a){const l=(0,t._typedJsonParse)(a,"has_updates","data");l&&"user"in l?super.setData(a,l.user):t.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(a,l){super.setData(a,l)}_fetchFromNetwork(a,l,d,c){return e(this,void 0,void 0,function*(){var p;return(yield(p=this._network)===null||p===void 0?void 0:p.fetchEvaluations(this._getSdkKey(),a,d?.priority,l,c))??null})}_getCacheKey(a){var l;const d=(0,t._getStorageKey)(this._getSdkKey(),a,(l=this._options)===null||l===void 0?void 0:l.customUserCacheKeyFunc);return`${t.DataAdapterCachePrefix}.${this._cacheSuffix}.${d}`}_isCachedResultValidFor204(a,l){return a.fullUserHash!=null&&a.fullUserHash===(0,t._getFullUserHash)(l)}};return t3.StatsigEvaluationsDataAdapter=i,t3}var Kre;function Uot(){if(Kre)return ef;Kre=1;var e=ef&&ef.__awaiter||function(c,p,u,h){function m(f){return f instanceof u?f:new u(function(x){x(f)})}return new(u||(u=Promise))(function(f,x){function y(v){try{b(h.next(v))}catch(A){x(A)}}function w(v){try{b(h.throw(v))}catch(A){x(A)}}function b(v){v.done?f(v.value):m(v.value).then(y,w)}b((h=h.apply(c,p||[])).next())})};Object.defineProperty(ef,"__esModule",{value:!0});const t=On(),o=Hot(),i=Oye(),a=Vot(),l=Qot();let d=class q_ extends t.StatsigClientBase{static instance(p){const u=(0,t._getStatsigGlobal)().instance(p);return u instanceof q_?u:(t.Log.warn((0,t._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new q_(p??"",{}))}constructor(p,u,h=null){var m,f;t.SDKType._setClientType(p,"javascript-client");const x=new i.default(h,w=>{this.$emt(w)});super(p,(m=h?.dataAdapter)!==null&&m!==void 0?m:new l.StatsigEvaluationsDataAdapter,x,h),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(t.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(t.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(t.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(t.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(t.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(t.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new o.default(p,h??null),this._network=x,this._user=this._configureUser(u,h),this._sdkInstanceID=(0,t.getUUID)(),this._contextHandle=new t.PrecomputedEvaluationsContextHandle(p,()=>this._options,()=>this._errorBoundary,()=>this._store.getValues(),()=>this._user,()=>this._sdkInstanceID);const y=(f=h?.plugins)!==null&&f!==void 0?f:[];for(const w of y)w.bind(this)}initializeSync(p){var u;return this.loadingStatus!=="Uninitialized"?(0,t.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...(u=this._store.getWarnings())!==null&&u!==void 0?u:[]]):(this._logger.start(),this.updateUserSync(this._user,p))}initializeAsync(p){return e(this,void 0,void 0,function*(){return this._initializePromise?this._initializePromise:(this._initializePromise=this._initializeAsyncImpl(p),this._initializePromise)})}updateUserSync(p,u){const h=performance.now();try{return this._updateUserSyncImpl(p,u,h)}catch(m){const f=m instanceof Error?m:new Error(String(m));return this._createErrorUpdateDetails(f,h)}}_updateUserSyncImpl(p,u,h){var m;const f=[...(m=this._store.getWarnings())!==null&&m!==void 0?m:[]];this._resetForUser(p);const x=this.dataAdapter.getDataSync(this._user);x==null&&f.push("NoCachedValues"),this._store.setValues(x,this._user),this._finalizeUpdate(x);const y=u?.disableBackgroundCacheRefresh;return y===!0||y==null&&x?.source==="Bootstrap"?(0,t.createUpdateDetails)(!0,this._store.getSource(),performance.now()-h,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),f):(this._runPostUpdate(x??null,this._user),(0,t.createUpdateDetails)(!0,this._store.getSource(),performance.now()-h,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),f))}updateUserAsync(p,u){return e(this,void 0,void 0,function*(){const h=performance.now();try{return yield this._updateUserAsyncImpl(p,u)}catch(m){const f=m instanceof Error?m:new Error(String(m));return this._createErrorUpdateDetails(f,h)}})}_updateUserAsyncImpl(p,u){return e(this,void 0,void 0,function*(){this._resetForUser(p);const h=this._user;t.Diagnostics._markInitOverallStart(this._sdkKey);let m=this.dataAdapter.getDataSync(h);if(this._store.setValues(m,this._user),this._setStatus("Loading",m),m=yield this.dataAdapter.getDataAsync(m,h,u),h!==this._user)return(0,t.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let f=!1;m!=null&&(t.Diagnostics._markInitProcessStart(this._sdkKey),f=this._store.setValues(m,this._user),t.Diagnostics._markInitProcessEnd(this._sdkKey,{success:f})),this._finalizeUpdate(m),f||(this._errorBoundary.attachErrorIfNoneExists(t.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),t.Diagnostics._markInitOverallEnd(this._sdkKey,f,this._store.getCurrentSourceDetails());const x=t.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,t.createUpdateDetails)(f,this._store.getSource(),x,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){let p=(0,t._cloneObject)("StatsigUser",this._user);return p==null&&(t.Log.error("Failed to clone user"),p={}),{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:p,errorBoundary:this._errorBoundary,session:t.StatsigSession.get(this._sdkKey),stableID:t.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}getContextHandle(){return this._contextHandle}checkGate(p,u){return this.getFeatureGate(p,u).value}logEvent(p,u,h){const m=typeof p=="string"?{eventName:p,value:u,metadata:h}:p;this.$emt({name:"log_event_called",event:m}),this._logger.enqueue(Object.assign(Object.assign({},m),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(p){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:p}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{this.loadingStatus==="Loading"&&this._finalizeUpdate(null)})}_initializeAsyncImpl(p){return e(this,void 0,void 0,function*(){return t.Storage.isReady()||(yield t.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,p)})}_createErrorUpdateDetails(p,u){var h;return(0,t.createUpdateDetails)(!1,this._store.getSource(),performance.now()-u,p,null,[...(h=this._store.getWarnings())!==null&&h!==void 0?h:[]])}_finalizeUpdate(p){this._store.finalize(),this._setStatus("Ready",p)}_runPostUpdate(p,u){this.dataAdapter.getDataAsync(p,u,{priority:"low"}).catch(h=>{t.Log.error("An error occurred after update.",h)})}_resetForUser(p){this._logger.reset(),this._store.reset(),this._user=this._configureUser(p,this._options)}_configureUser(p,u){var h,m,f;const x=(0,t._normalizeUser)(p,u),y=(h=x.customIDs)===null||h===void 0?void 0:h.stableID;if(y){const w=(f=(m=this.storageProvider).isReadyResolver)===null||f===void 0?void 0:f.call(m);w?w.then(()=>t.StableID.setOverride(y,this._sdkKey),()=>t.StableID.setOverride(y,this._sdkKey)):t.StableID.setOverride(y,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(x.analyticsOnlyMetadata=Object.assign(Object.assign({},x.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),x}_getFeatureGateImpl(p,u){var h,m;const{result:f,details:x}=this._store.getGate(p);this._checkUserHasIdForEvaluation(f?.id_type,p,"Gate"),this._checkInitializationStatus(x.reason);const y=(0,t._makeFeatureGate)(p,x,f),w=(m=(h=this.overrideAdapter)===null||h===void 0?void 0:h.getGateOverride)===null||m===void 0?void 0:m.call(h,y,this._user,u),b=w??y;return this._enqueueExposure(p,(0,t._createGateExposure)(this._user,b,this._store.getExposureMapping()),u),this.$emt({name:"gate_evaluation",gate:b}),b}_getDynamicConfigImpl(p,u){var h,m;const{result:f,details:x}=this._store.getConfig(p);this._checkUserHasIdForEvaluation(f?.id_type,p,"Dynamic config"),this._checkInitializationStatus(x.reason);const y=(0,t._makeDynamicConfig)(p,x,f),w=(m=(h=this.overrideAdapter)===null||h===void 0?void 0:h.getDynamicConfigOverride)===null||m===void 0?void 0:m.call(h,y,this._user,u),b=w??y;return this._enqueueExposure(p,(0,t._createConfigExposure)(this._user,b,this._store.getExposureMapping()),u),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:b}),b}_getExperimentImpl(p,u){var h,m,f,x;const{result:y,details:w}=this._store.getConfig(p);this._checkUserHasIdForEvaluation(y?.id_type,p,"Experiment"),this._checkInitializationStatus(w.reason);const b=(0,t._makeExperiment)(p,w,y);b.__evaluation!=null&&(b.__evaluation.secondary_exposures=(0,t._mapExposures)((m=(h=b.__evaluation)===null||h===void 0?void 0:h.secondary_exposures)!==null&&m!==void 0?m:[],this._store.getExposureMapping()));const v=(x=(f=this.overrideAdapter)===null||f===void 0?void 0:f.getExperimentOverride)===null||x===void 0?void 0:x.call(f,b,this._user,u),A=v??b;return this._enqueueExposure(p,(0,t._createConfigExposure)(this._user,A,this._store.getExposureMapping()),u),this.$emt({name:"experiment_evaluation",experiment:A}),A}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(p,u){var h,m,f;const{result:x,details:y}=this._store.getLayer(p),w=(0,t._makeLayer)(p,y,x),b=(m=(h=this.overrideAdapter)===null||h===void 0?void 0:h.getLayerOverride)===null||m===void 0?void 0:m.call(h,w,this._user,u);u?.disableExposureLog&&this._logger.incrementNonExposureCount(p);const v=(0,t._mergeOverride)(w,b,(f=b?.__value)!==null&&f!==void 0?f:w.__value,A=>{u?.disableExposureLog||this._enqueueExposure(p,(0,t._createLayerParameterExposure)(this._user,v,A,this._store.getExposureMapping()),u)});return this.$emt({name:"layer_evaluation",layer:v}),v}_getParameterStoreImpl(p,u){var h,m;const{result:f,details:x}=this._store.getParamStore(p);this._logger.incrementNonExposureCount(p);const y={name:p,details:x,__configuration:f,get:(0,a._makeParamStoreGetter)(this,f,u)},w=(m=(h=this.overrideAdapter)===null||h===void 0?void 0:h.getParamStoreOverride)===null||m===void 0?void 0:m.call(h,y,u);return w!=null&&(y.__configuration=w.config,y.details=w.details,y.get=(0,a._makeParamStoreGetter)(this,w.config,u)),y}_checkUserHasIdForEvaluation(p,u,h){p&&((0,t._getUnitIDFromUser)(this._user,p)||t.Log.warn(`The user does not have the required id_type "${p}" for ${h} "${u}"`))}_checkInitializationStatus(p){(p==="Uninitialized"||p.startsWith("Loading"))&&t.Log.warn(`SDK initialization has not completed. Reason: ${p}`)}};return ef.default=d,ef}var qre;function MG(){return qre||(qre=1,function(e){var t=X5&&X5.__createBinding||(Object.create?function(d,c,p,u){u===void 0&&(u=p);var h=Object.getOwnPropertyDescriptor(c,p);(!h||("get"in h?!c.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return c[p]}}),Object.defineProperty(d,u,h)}:function(d,c,p,u){u===void 0&&(u=p),d[u]=c[p]}),o=X5&&X5.__exportStar||function(d,c){for(var p in d)p!=="default"&&!Object.prototype.hasOwnProperty.call(c,p)&&t(c,d,p)};Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigClient=void 0;const i=On(),a=Uot();e.StatsigClient=a.default,o(On(),e);const l=Object.assign((0,i._getStatsigGlobal)(),{StatsigClient:a.default});e.default=l}(X5)),X5}var c9={},Zre;function Nye(){if(Zre)return c9;Zre=1,Object.defineProperty(c9,"__esModule",{value:!0}),c9.useStatsigInternalClientFactoryAsync=void 0;const e=$,t=On();function o(i,a){const l=(0,e.useMemo)(()=>{var p;return(p=(0,t._getInstance)(a.sdkKey))!==null&&p!==void 0?p:i(a)},[]),[d,c]=(0,e.useState)(l.loadingStatus!=="Ready");return(0,e.useMemo)(()=>{l.loadingStatus!=="Ready"&&l.initializeAsync().catch(t.Log.error).finally(()=>c(!1))},[]),{client:l,isLoading:d}}return c9.useStatsigInternalClientFactoryAsync=o,c9}var Jre;function Hye(){if(Jre)return n9;Jre=1,Object.defineProperty(n9,"__esModule",{value:!0}),n9.useClientAsyncInit=void 0;const e=MG(),t=Nye();function o(i,a,l=null){return(0,t.useStatsigInternalClientFactoryAsync)(d=>new e.StatsigClient(d.sdkKey,d.initialUser,d.statsigOptions),{sdkKey:i,initialUser:a,statsigOptions:l})}return n9.useClientAsyncInit=o,n9}var Xre;function Wot(){if(Xre)return i9;Xre=1,Object.defineProperty(i9,"__esModule",{value:!0}),i9.StatsigProvider=void 0;const e=e9e(),t=$,o=On(),i=c2(),a=Hye();function l(h){return"client"in h?(("sdkKey"in h||"user"in h)&&o.Log.warn("Both client and configuration props (sdkKey, user) were provided to StatsigProvider. The client prop will be used and the configuration props will be ignored."),(0,e.jsx)(c,Object.assign({},h))):(0,e.jsx)(d,Object.assign({},h))}i9.StatsigProvider=l;function d(h){const[m,f]=(0,t.useState)(0),x=(0,a.useClientAsyncInit)(h.sdkKey,h.user,h.options).client,[y,w]=(0,t.useState)(!u(x));p(x,f,w);const b=(0,t.useMemo)(()=>({renderVersion:m,client:x,isLoading:y}),[m,x,y]);return(0,e.jsx)(i.default.Provider,{value:b,children:h.loadingComponent==null||!b.isLoading?h.children:h.loadingComponent})}function c(h){const[m,f]=(0,t.useState)(0),x=h.client,[y,w]=(0,t.useState)(!u(x));p(x,f,w);const b=(0,t.useMemo)(()=>({renderVersion:m,client:x,isLoading:y}),[m,x,y]);return(0,e.jsx)(i.default.Provider,{value:b,children:h.loadingComponent==null||!b.isLoading?h.children:h.loadingComponent})}function p(h,m,f){(0,t.useEffect)(()=>{const x=()=>{m(y=>y+1),f(!u(h))};return o.SDKType._setBindingType("react"),h.$on("values_updated",x),()=>{h.flush().catch(y=>o.Log.error("An error occurred during flush",y)),h.off("values_updated",x)}},[h,m])}function u(h){return"isNoop"in h||h.loadingStatus==="Ready"}return i9}var p9={},u9={},eie;function _ye(){if(eie)return u9;eie=1,Object.defineProperty(u9,"__esModule",{value:!0}),u9.useStatsigInternalClientFactoryBootstrap=void 0;const e=$,t=On();function o(i,a){const l=(0,e.useRef)((0,t._getInstance)(a.sdkKey));return(0,e.useMemo)(()=>{if(l.current)return l.current;const d=i(a);return l.current=d,a.useLegacyFormat?d.dataAdapter.setDataLegacy(a.initialValues,a.initialUser):d.dataAdapter.setData(a.initialValues),d.initializeSync(),d},[])}return u9.useStatsigInternalClientFactoryBootstrap=o,u9}var tie;function Got(){if(tie)return p9;tie=1,Object.defineProperty(p9,"__esModule",{value:!0}),p9.useClientBootstrapInit=void 0;const e=MG(),t=_ye();function o(i,a,l,d=null,c){return(0,t.useStatsigInternalClientFactoryBootstrap)(p=>new e.StatsigClient(p.sdkKey,p.initialUser,p.statsigOptions),{sdkKey:i,initialUser:a,initialValues:l,statsigOptions:d,useLegacyFormat:c})}return p9.useClientBootstrapInit=o,p9}var Ov={},oie;function Yot(){if(oie)return Ov;oie=1,Object.defineProperty(Ov,"__esModule",{value:!0});const e=$,t=On(),o=Tm(),i=c2();function a(l,d){const{client:c,renderVersion:p}=(0,e.useContext)(i.default);return(0,e.useMemo)(()=>(0,o.isNoopClient)(c)?(t.Log.warn(`useDynamicConfig hook failed to find a valid StatsigClient for dynamic config '${l}'.`),o.NoopEvaluationsClient.getDynamicConfig(l,d)):c.getDynamicConfig(l,d),[l,c,p,...d?Object.values(d):[]])}return Ov.default=a,Ov}var Nv={},rie;function Kot(){if(rie)return Nv;rie=1,Object.defineProperty(Nv,"__esModule",{value:!0});const e=$,t=On(),o=Tm(),i=c2();function a(l,d){const{client:c,renderVersion:p}=(0,e.useContext)(i.default);return(0,e.useMemo)(()=>(0,o.isNoopClient)(c)?(t.Log.warn(`useExperiment hook failed to find a valid Statsig client for experiment '${l}'.`),o.NoopEvaluationsClient.getExperiment(l,d)):c.getExperiment(l,d),[l,c,p,...d?Object.values(d):[]])}return Nv.default=a,Nv}var Hv={},iie;function qot(){if(iie)return Hv;iie=1,Object.defineProperty(Hv,"__esModule",{value:!0});const e=$,t=On(),o=Tm(),i=c2();function a(l,d){const{client:c,renderVersion:p}=(0,e.useContext)(i.default);return(0,e.useMemo)(()=>(0,o.isNoopClient)(c)?(t.Log.warn(`useFeatureGate hook failed to find a valid StatsigClient for gate '${l}'.`),o.NoopEvaluationsClient.getFeatureGate(l,d)):c.getFeatureGate(l,d),[l,c,p,...d?Object.values(d):[]])}return Hv.default=a,Hv}var _v={},nie;function Zot(){if(nie)return _v;nie=1,Object.defineProperty(_v,"__esModule",{value:!0});const e=$,t=On(),o=Tm(),i=c2();function a(l,d){const{client:c,renderVersion:p}=(0,e.useContext)(i.default);return(0,e.useMemo)(()=>(0,o.isNoopClient)(c)?(t.Log.warn(`useGateValue hook failed to find a valid StatsigClient for gate '${l}'.`),o.NoopEvaluationsClient.checkGate(l,d)):c.checkGate(l,d),[l,c,p,...d?Object.values(d):[]])}return _v.default=a,_v}var Vv={},aie;function Jot(){if(aie)return Vv;aie=1,Object.defineProperty(Vv,"__esModule",{value:!0});const e=$,t=On(),o=Tm(),i=c2();function a(l,d){const{client:c,renderVersion:p}=(0,e.useContext)(i.default);return(0,e.useMemo)(()=>(0,o.isNoopClient)(c)?(t.Log.warn(`useLayer hook failed to find a valid Statsig client for layer '${l}'.`),o.NoopEvaluationsClient.getLayer(l,d)):c.getLayer(l,d),[l,c,p,...d?Object.values(d):[]])}return Vv.default=a,Vv}var Qv={},sie;function Xot(){if(sie)return Qv;sie=1,Object.defineProperty(Qv,"__esModule",{value:!0});const e=$,t=On(),o=Tm(),i=c2();function a(l,d){const{client:c,renderVersion:p}=(0,e.useContext)(i.default);return(0,e.useMemo)(()=>(0,o.isNoopClient)(c)?(t.Log.warn(`useParameterStore hook failed to find a valid StatsigClient for parameter store '${l}'.`),o.NoopEvaluationsClient.getParameterStore(l,d)):c.getParameterStore(l,d),[l,c,p,...d?Object.values(d):[]])}return Qv.default=a,Qv}var h9={},lie;function Vye(){if(lie)return h9;lie=1,Object.defineProperty(h9,"__esModule",{value:!0}),h9.useStatsigClient=void 0;const e=$,t=On(),o=Tm(),i=c2();function a(){const{client:l,renderVersion:d,isLoading:c}=(0,e.useContext)(i.default),p=(0,e.useMemo)(()=>(0,o.isNoopClient)(l)?(t.Log.warn("Attempting to retrieve a StatsigClient but none was set."),o.NoopEvaluationsClient):l,[l,d]),u=[p,d],h=(0,e.useCallback)((v,A)=>p.checkGate(v,A),u),m=(0,e.useCallback)((v,A)=>p.getFeatureGate(v,A),u),f=(0,e.useCallback)((v,A)=>p.getDynamicConfig(v,A),u),x=(0,e.useCallback)((v,A)=>p.getExperiment(v,A),u),y=(0,e.useCallback)((v,A)=>p.getLayer(v,A),u),w=(0,e.useCallback)((v,A)=>p.getParameterStore(v,A),u),b=(0,e.useCallback)((v,A,S)=>typeof v=="string"?p.logEvent(v,A,S):p.logEvent(v),u);return(0,e.useMemo)(()=>({client:p,checkGate:h,getFeatureGate:m,getDynamicConfig:f,getExperiment:x,getLayer:y,getParameterStore:w,logEvent:b,isLoading:c}),[p,h,m,f,x,y,w,b,c])}return h9.useStatsigClient=a,h9}var m9={},die;function ert(){if(die)return m9;die=1,Object.defineProperty(m9,"__esModule",{value:!0}),m9.useStatsigUser=void 0;const e=$,t=c2(),o=Vye();function i(l){return l.getContextHandle().user}function a(){const{client:l}=(0,o.useStatsigClient)(),{renderVersion:d}=(0,e.useContext)(t.default);return{user:(0,e.useMemo)(()=>i(l),[l,d]),updateUserSync:(0,e.useCallback)(c=>(typeof c=="function"&&(c=c(i(l))),l.updateUserSync(c)),[l]),updateUserAsync:(0,e.useCallback)(c=>(typeof c=="function"&&(c=c(i(l))),l.updateUserAsync(c)),[l])}}return m9.useStatsigUser=a,m9}var cie;function trt(){return cie||(cie=1,function(e){var t=q5&&q5.__createBinding||(Object.create?function(A,S,E,j){j===void 0&&(j=E);var L=Object.getOwnPropertyDescriptor(S,E);(!L||("get"in L?!S.__esModule:L.writable||L.configurable))&&(L={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(A,j,L)}:function(A,S,E,j){j===void 0&&(j=E),A[j]=S[E]}),o=q5&&q5.__exportStar||function(A,S){for(var E in A)E!=="default"&&!Object.prototype.hasOwnProperty.call(S,E)&&t(S,A,E)};Object.defineProperty(e,"__esModule",{value:!0}),e.useStatsigUser=e.useStatsigInternalClientFactoryBootstrap=e.useStatsigInternalClientFactoryAsync=e.useStatsigClient=e.useParameterStore=e.useLayer=e.useGateValue=e.useFeatureGate=e.useExperiment=e.useDynamicConfig=e.useClientBootstrapInit=e.useClientAsyncInit=e.StatsigProvider=e.StatsigContext=void 0;const i=On(),a=c2();e.StatsigContext=a.default;const l=Wot();Object.defineProperty(e,"StatsigProvider",{enumerable:!0,get:function(){return l.StatsigProvider}});const d=Hye();Object.defineProperty(e,"useClientAsyncInit",{enumerable:!0,get:function(){return d.useClientAsyncInit}});const c=Got();Object.defineProperty(e,"useClientBootstrapInit",{enumerable:!0,get:function(){return c.useClientBootstrapInit}});const p=Yot();e.useDynamicConfig=p.default;const u=Kot();e.useExperiment=u.default;const h=qot();e.useFeatureGate=h.default;const m=Zot();e.useGateValue=m.default;const f=Jot();e.useLayer=f.default;const x=Xot();e.useParameterStore=x.default;const y=Vye();Object.defineProperty(e,"useStatsigClient",{enumerable:!0,get:function(){return y.useStatsigClient}});const w=Nye();Object.defineProperty(e,"useStatsigInternalClientFactoryAsync",{enumerable:!0,get:function(){return w.useStatsigInternalClientFactoryAsync}});const b=_ye();Object.defineProperty(e,"useStatsigInternalClientFactoryBootstrap",{enumerable:!0,get:function(){return b.useStatsigInternalClientFactoryBootstrap}});const v=ert();Object.defineProperty(e,"useStatsigUser",{enumerable:!0,get:function(){return v.useStatsigUser}}),o(MG(),e),Object.assign((0,i._getStatsigGlobal)(),{StatsigContext:a.default,StatsigProvider:l.StatsigProvider,useClientAsyncInit:d.useClientAsyncInit,useClientBootstrapInit:c.useClientBootstrapInit,useDynamicConfig:p.default,useExperiment:u.default,useFeatureGate:h.default,useGateValue:m.default,useLayer:f.default,useParameterStore:x.default,useStatsigClient:y.useStatsigClient,useStatsigInternalClientFactoryAsync:w.useStatsigInternalClientFactoryAsync,useStatsigInternalClientFactoryBootstrap:b.useStatsigInternalClientFactoryBootstrap,useStatsigUser:v.useStatsigUser})}(q5)),q5}var wk=trt(),YP,pie;function Qye(){if(pie)return YP;pie=1;function e(t,o){for(var i=-1,a=t==null?0:t.length;++i<a&&o(t[i],i,t)!==!1;);return t}return YP=e,YP}var KP,uie;function Uye(){if(uie)return KP;uie=1;var e=U4(),t=function(){try{var o=e(Object,"defineProperty");return o({},"",{}),o}catch{}}();return KP=t,KP}var qP,hie;function BG(){if(hie)return qP;hie=1;var e=Uye();function t(o,i,a){i=="__proto__"&&e?e(o,i,{configurable:!0,enumerable:!0,value:a,writable:!0}):o[i]=a}return qP=t,qP}var ZP,mie;function DG(){if(mie)return ZP;mie=1;var e=BG(),t=sL(),o=Object.prototype,i=o.hasOwnProperty;function a(l,d,c){var p=l[d];(!(i.call(l,d)&&t(p,c))||c===void 0&&!(d in l))&&e(l,d,c)}return ZP=a,ZP}var JP,gie;function nb(){if(gie)return JP;gie=1;var e=DG(),t=BG();function o(i,a,l,d){var c=!l;l||(l={});for(var p=-1,u=a.length;++p<u;){var h=a[p],m=d?d(l[h],i[h],h,l,i):void 0;m===void 0&&(m=i[h]),c?t(l,h,m):e(l,h,m)}return l}return JP=o,JP}var XP,fie;function ort(){if(fie)return XP;fie=1;var e=nb(),t=Uw();function o(i,a){return i&&e(a,t(a),i)}return XP=o,XP}var eT,xie;function rrt(){if(xie)return eT;xie=1;function e(t){var o=[];if(t!=null)for(var i in Object(t))o.push(i);return o}return eT=e,eT}var tT,yie;function irt(){if(yie)return tT;yie=1;var e=X1(),t=JW(),o=rrt(),i=Object.prototype,a=i.hasOwnProperty;function l(d){if(!e(d))return o(d);var c=t(d),p=[];for(var u in d)u=="constructor"&&(c||!a.call(d,u))||p.push(u);return p}return tT=l,tT}var oT,wie;function PG(){if(wie)return oT;wie=1;var e=W9e(),t=irt(),o=_6();function i(a){return o(a)?e(a,!0):t(a)}return oT=i,oT}var rT,bie;function nrt(){if(bie)return rT;bie=1;var e=nb(),t=PG();function o(i,a){return i&&e(a,t(a),i)}return rT=o,rT}var E$={exports:{}};E$.exports;var vie;function art(){return vie||(vie=1,function(e,t){var o=J1(),i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,l=a&&a.exports===i,d=l?o.Buffer:void 0,c=d?d.allocUnsafe:void 0;function p(u,h){if(h)return u.slice();var m=u.length,f=c?c(m):new u.constructor(m);return u.copy(f),f}e.exports=p}(E$,E$.exports)),E$.exports}var iT,Cie;function srt(){if(Cie)return iT;Cie=1;function e(t,o){var i=-1,a=t.length;for(o||(o=Array(a));++i<a;)o[i]=t[i];return o}return iT=e,iT}var nT,Aie;function lrt(){if(Aie)return nT;Aie=1;var e=nb(),t=GW();function o(i,a){return e(i,t(i),a)}return nT=o,nT}var aT,$ie;function TG(){if($ie)return aT;$ie=1;var e=G9e(),t=e(Object.getPrototypeOf,Object);return aT=t,aT}var sT,kie;function Wye(){if(kie)return sT;kie=1;var e=UW(),t=TG(),o=GW(),i=V9e(),a=Object.getOwnPropertySymbols,l=a?function(d){for(var c=[];d;)e(c,o(d)),d=t(d);return c}:i;return sT=l,sT}var lT,Sie;function drt(){if(Sie)return lT;Sie=1;var e=nb(),t=Wye();function o(i,a){return e(i,t(i),a)}return lT=o,lT}var dT,Eie;function zG(){if(Eie)return dT;Eie=1;var e=_9e(),t=Wye(),o=PG();function i(a){return e(a,o,t)}return dT=i,dT}var cT,Lie;function crt(){if(Lie)return cT;Lie=1;var e=Object.prototype,t=e.hasOwnProperty;function o(i){var a=i.length,l=new i.constructor(a);return a&&typeof i[0]=="string"&&t.call(i,"index")&&(l.index=i.index,l.input=i.input),l}return cT=o,cT}var pT,Iie;function RG(){if(Iie)return pT;Iie=1;var e=H9e();function t(o){var i=new o.constructor(o.byteLength);return new e(i).set(new e(o)),i}return pT=t,pT}var uT,jie;function prt(){if(jie)return uT;jie=1;var e=RG();function t(o,i){var a=i?e(o.buffer):o.buffer;return new o.constructor(a,o.byteOffset,o.byteLength)}return uT=t,uT}var hT,Mie;function urt(){if(Mie)return hT;Mie=1;var e=/\w*$/;function t(o){var i=new o.constructor(o.source,e.exec(o));return i.lastIndex=o.lastIndex,i}return hT=t,hT}var mT,Bie;function hrt(){if(Bie)return mT;Bie=1;var e=N6(),t=e?e.prototype:void 0,o=t?t.valueOf:void 0;function i(a){return o?Object(o.call(a)):{}}return mT=i,mT}var gT,Die;function mrt(){if(Die)return gT;Die=1;var e=RG();function t(o,i){var a=i?e(o.buffer):o.buffer;return new o.constructor(a,o.byteOffset,o.length)}return gT=t,gT}var fT,Pie;function grt(){if(Pie)return fT;Pie=1;var e=RG(),t=prt(),o=urt(),i=hrt(),a=mrt(),l="[object Boolean]",d="[object Date]",c="[object Map]",p="[object Number]",u="[object RegExp]",h="[object Set]",m="[object String]",f="[object Symbol]",x="[object ArrayBuffer]",y="[object DataView]",w="[object Float32Array]",b="[object Float64Array]",v="[object Int8Array]",A="[object Int16Array]",S="[object Int32Array]",E="[object Uint8Array]",j="[object Uint8ClampedArray]",L="[object Uint16Array]",M="[object Uint32Array]";function D(P,T,z){var R=P.constructor;switch(T){case x:return e(P);case l:case d:return new R(+P);case y:return t(P,z);case w:case b:case v:case A:case S:case E:case j:case L:case M:return a(P,z);case c:return new R;case p:case m:return new R(P);case u:return o(P);case h:return new R;case f:return i(P)}}return fT=D,fT}var xT,Tie;function frt(){if(Tie)return xT;Tie=1;var e=X1(),t=Object.create,o=function(){function i(){}return function(a){if(!e(a))return{};if(t)return t(a);i.prototype=a;var l=new i;return i.prototype=void 0,l}}();return xT=o,xT}var yT,zie;function xrt(){if(zie)return yT;zie=1;var e=frt(),t=TG(),o=JW();function i(a){return typeof a.constructor=="function"&&!o(a)?e(t(a)):{}}return yT=i,yT}var wT,Rie;function yrt(){if(Rie)return wT;Rie=1;var e=hL(),t=z0(),o="[object Map]";function i(a){return t(a)&&e(a)==o}return wT=i,wT}var bT,Fie;function wrt(){if(Fie)return bT;Fie=1;var e=yrt(),t=uL(),o=ZW(),i=o&&o.isMap,a=i?t(i):e;return bT=a,bT}var vT,Oie;function brt(){if(Oie)return vT;Oie=1;var e=hL(),t=z0(),o="[object Set]";function i(a){return t(a)&&e(a)==o}return vT=i,vT}var CT,Nie;function vrt(){if(Nie)return CT;Nie=1;var e=brt(),t=uL(),o=ZW(),i=o&&o.isSet,a=i?t(i):e;return CT=a,CT}var AT,Hie;function Gye(){if(Hie)return AT;Hie=1;var e=VW(),t=Qye(),o=DG(),i=ort(),a=nrt(),l=art(),d=srt(),c=lrt(),p=drt(),u=Y9e(),h=zG(),m=hL(),f=crt(),x=grt(),y=xrt(),w=Ls(),b=KW(),v=wrt(),A=X1(),S=vrt(),E=Uw(),j=PG(),L=1,M=2,D=4,P="[object Arguments]",T="[object Array]",z="[object Boolean]",R="[object Date]",K="[object Error]",Z="[object Function]",O="[object GeneratorFunction]",Q="[object Map]",_="[object Number]",F="[object Object]",N="[object RegExp]",H="[object Set]",ee="[object String]",Y="[object Symbol]",G="[object WeakMap]",J="[object ArrayBuffer]",X="[object DataView]",ie="[object Float32Array]",we="[object Float64Array]",me="[object Int8Array]",de="[object Int16Array]",ce="[object Int32Array]",fe="[object Uint8Array]",Ae="[object Uint8ClampedArray]",le="[object Uint16Array]",pe="[object Uint32Array]",ae={};ae[P]=ae[T]=ae[J]=ae[X]=ae[z]=ae[R]=ae[ie]=ae[we]=ae[me]=ae[de]=ae[ce]=ae[Q]=ae[_]=ae[F]=ae[N]=ae[H]=ae[ee]=ae[Y]=ae[fe]=ae[Ae]=ae[le]=ae[pe]=!0,ae[K]=ae[Z]=ae[G]=!1;function be(ue,se,ge,Ee,$e,Ve){var Le,He=se&L,De=se&M,Me=se&D;if(ge&&(Le=$e?ge(ue,Ee,$e,Ve):ge(ue)),Le!==void 0)return Le;if(!A(ue))return ue;var Pe=w(ue);if(Pe){if(Le=f(ue),!He)return d(ue,Le)}else{var ze=m(ue),Be=ze==Z||ze==O;if(b(ue))return l(ue,He);if(ze==F||ze==P||Be&&!$e){if(Le=De||Be?{}:y(ue),!He)return De?p(ue,a(Le,ue)):c(ue,i(Le,ue))}else{if(!ae[ze])return $e?ue:{};Le=x(ue,ze,He)}}Ve||(Ve=new e);var _e=Ve.get(ue);if(_e)return _e;Ve.set(ue,Le),S(ue)?ue.forEach(function(ut){Le.add(be(ut,se,ge,ut,ue,Ve))}):v(ue)&&ue.forEach(function(ut,xt){Le.set(xt,be(ut,se,ge,xt,ue,Ve))});var tt=Me?De?h:u:De?j:E,rt=Pe?void 0:tt(ue);return t(rt||ue,function(ut,xt){rt&&(xt=ut,ut=ue[xt]),o(Le,xt,be(ut,se,ge,xt,ue,Ve))}),Le}return AT=be,AT}var $T,_ie;function Crt(){if(_ie)return $T;_ie=1;var e=Gye(),t=1,o=4;function i(a){return e(a,t|o)}return $T=i,$T}var Art=Crt();const Kn=Mr(Art);var Vie,Qie;function $rt(){return Qie||(Qie=1,Vie=function(e,t,o,i){var a=typeof i<"u"?[i,e]:[e],l=new Blob(a,{type:o||"application/octet-stream"});if(typeof window.navigator.msSaveBlob<"u")window.navigator.msSaveBlob(l,t);else{var d=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(l):window.webkitURL.createObjectURL(l),c=document.createElement("a");c.style.display="none",c.href=d,c.setAttribute("download",t),typeof c.download>"u"&&c.setAttribute("target","_blank"),document.body.appendChild(c),c.click(),setTimeout(function(){document.body.removeChild(c),window.URL.revokeObjectURL(d)},200)}}),Vie}var krt=$rt();const kL=Mr(krt);var kT,Uie;function Srt(){if(Uie)return kT;Uie=1;var e=Object.prototype,t=e.hasOwnProperty;function o(i,a){return i!=null&&t.call(i,a)}return kT=o,kT}var ST,Wie;function FG(){if(Wie)return ST;Wie=1;var e=Ls(),t=Xw(),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;function a(l,d){if(e(l))return!1;var c=typeof l;return c=="number"||c=="symbol"||c=="boolean"||l==null||t(l)?!0:i.test(l)||!o.test(l)||d!=null&&l in Object(d)}return ST=a,ST}var ET,Gie;function Ert(){if(Gie)return ET;Gie=1;var e=_W(),t="Expected a function";function o(i,a){if(typeof i!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var l=function(){var d=arguments,c=a?a.apply(this,d):d[0],p=l.cache;if(p.has(c))return p.get(c);var u=i.apply(this,d);return l.cache=p.set(c,u)||p,u};return l.cache=new(o.Cache||e),l}return o.Cache=e,ET=o,ET}var LT,Yie;function Lrt(){if(Yie)return LT;Yie=1;var e=Ert(),t=500;function o(i){var a=e(i,function(d){return l.size===t&&l.clear(),d}),l=a.cache;return a}return LT=o,LT}var IT,Kie;function Irt(){if(Kie)return IT;Kie=1;var e=Lrt(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,i=e(function(a){var l=[];return a.charCodeAt(0)===46&&l.push(""),a.replace(t,function(d,c,p,u){l.push(p?u.replace(o,"$1"):c||d)}),l});return IT=i,IT}var jT,qie;function Y4(){if(qie)return jT;qie=1;function e(t,o){for(var i=-1,a=t==null?0:t.length,l=Array(a);++i<a;)l[i]=o(t[i],i,t);return l}return jT=e,jT}var MT,Zie;function Yye(){if(Zie)return MT;Zie=1;var e=N6(),t=Y4(),o=Ls(),i=Xw(),a=e?e.prototype:void 0,l=a?a.toString:void 0;function d(c){if(typeof c=="string")return c;if(o(c))return t(c,d)+"";if(i(c))return l?l.call(c):"";var p=c+"";return p=="0"&&1/c==-1/0?"-0":p}return MT=d,MT}var BT,Jie;function Kye(){if(Jie)return BT;Jie=1;var e=Yye();function t(o){return o==null?"":e(o)}return BT=t,BT}var DT,Xie;function W6(){if(Xie)return DT;Xie=1;var e=Ls(),t=FG(),o=Irt(),i=Kye();function a(l,d){return e(l)?l:t(l,d)?[l]:o(i(l))}return DT=a,DT}var PT,ene;function G6(){if(ene)return PT;ene=1;var e=Xw();function t(o){if(typeof o=="string"||e(o))return o;var i=o+"";return i=="0"&&1/o==-1/0?"-0":i}return PT=t,PT}var TT,tne;function qye(){if(tne)return TT;tne=1;var e=W6(),t=YW(),o=Ls(),i=Qw(),a=qW(),l=G6();function d(c,p,u){p=e(p,c);for(var h=-1,m=p.length,f=!1;++h<m;){var x=l(p[h]);if(!(f=c!=null&&u(c,x)))break;c=c[x]}return f||++h!=m?f:(m=c==null?0:c.length,!!m&&a(m)&&i(x,m)&&(o(c)||t(c)))}return TT=d,TT}var zT,one;function jrt(){if(one)return zT;one=1;var e=Srt(),t=qye();function o(i,a){return i!=null&&t(i,a,e)}return zT=o,zT}var Mrt=jrt();const Yt=Mr(Mrt);var ab=e=>e.type==="checkbox",p7=e=>e instanceof Date,xl=e=>e==null;const Zye=e=>typeof e=="object";var Ma=e=>!xl(e)&&!Array.isArray(e)&&Zye(e)&&!p7(e),Jye=e=>Ma(e)&&e.target?ab(e.target)?e.target.checked:e.target.value:e,Brt=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Xye=(e,t)=>e.has(Brt(t)),Drt=e=>{const t=e.constructor&&e.constructor.prototype;return Ma(t)&&t.hasOwnProperty("isPrototypeOf")},OG=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Xl(e){let t;const o=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(OG&&(e instanceof Blob||e instanceof FileList))&&(o||Ma(e)))if(t=o?[]:{},!Array.isArray(e)&&!Drt(e))t=e;else for(const i in e)t[i]=Xl(e[i]);else return e;return t}var Y6=e=>Array.isArray(e)?e.filter(Boolean):[],tn=e=>e===void 0,to=(e,t,o)=>{if(!t||!Ma(e))return o;const i=Y6(t.split(/[,[\].]+?/)).reduce((a,l)=>xl(a)?a:a[l],e);return tn(i)||i===e?tn(e[t])?o:e[t]:i};const bk={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},zc={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},B2={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ewe=$.createContext(null),Wt=()=>$.useContext(ewe),Vi=e=>{const{children:t,...o}=e;return $.createElement(ewe.Provider,{value:o},t)};var twe=(e,t,o,i=!0)=>{const a={defaultValues:t._defaultValues};for(const l in e)Object.defineProperty(a,l,{get:()=>{const d=l;return t._proxyFormState[d]!==zc.all&&(t._proxyFormState[d]=!i||zc.all),o&&(o[d]=!0),e[d]}});return a},Dd=e=>Ma(e)&&!Object.keys(e).length,owe=(e,t,o,i)=>{o(e);const{name:a,...l}=e;return Dd(l)||Object.keys(l).length>=Object.keys(t).length||Object.keys(l).find(d=>t[d]===(!i||zc.all))},Fd=e=>Array.isArray(e)?e:[e],rwe=(e,t,o)=>o&&t?e===t:!e||!t||e===t||Fd(e).some(i=>i&&(i.startsWith(t)||t.startsWith(i)));function SL(e){const t=$.useRef(e);t.current=e,$.useEffect(()=>{const o=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{o&&o.unsubscribe()}},[e.disabled])}function Prt(e){const t=Wt(),{control:o=t.control,disabled:i,name:a,exact:l}=e||{},[d,c]=$.useState(o._formState),p=$.useRef(!0),u=$.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),h=$.useRef(a);return h.current=a,SL({disabled:i,next:m=>p.current&&rwe(h.current,m.name,l)&&owe(m,u.current,o._updateFormState)&&c({...o._formState,...m}),subject:o._subjects.state}),$.useEffect(()=>(p.current=!0,u.current.isValid&&o._updateValid(!0),()=>{p.current=!1}),[o]),twe(d,o,u.current,!1)}var Fu=e=>typeof e=="string",iwe=(e,t,o,i,a)=>Fu(e)?(i&&t.watch.add(e),to(o,e,a)):Array.isArray(e)?e.map(l=>(i&&t.watch.add(l),to(o,l))):(i&&(t.watchAll=!0),o);function NG(e){const t=Wt(),{control:o=t.control,name:i,defaultValue:a,disabled:l,exact:d}=e||{},c=$.useRef(i);c.current=i,SL({disabled:l,subject:o._subjects.values,next:h=>{rwe(c.current,h.name,d)&&u(Xl(iwe(c.current,o._names,h.values||o._formValues,!1,a)))}});const[p,u]=$.useState(o._getWatch(i,a));return $.useEffect(()=>o._removeUnmounted()),p}var HG=e=>/^\w*$/.test(e),nwe=e=>Y6(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Fi(e,t,o){let i=-1;const a=HG(t)?[t]:nwe(t),l=a.length,d=l-1;for(;++i<l;){const c=a[i];let p=o;if(i!==d){const u=e[c];p=Ma(u)||Array.isArray(u)?u:isNaN(+a[i+1])?{}:[]}e[c]=p,e=e[c]}return e}function Trt(e){const t=Wt(),{name:o,control:i=t.control,shouldUnregister:a}=e,l=Xye(i._names.array,o),d=NG({control:i,name:o,defaultValue:to(i._formValues,o,to(i._defaultValues,o,e.defaultValue)),exact:!0}),c=Prt({control:i,name:o}),p=$.useRef(i.register(o,{...e.rules,value:d}));return $.useEffect(()=>{const u=i._options.shouldUnregister||a,h=(m,f)=>{const x=to(i._fields,m);x&&(x._f.mount=f)};if(h(o,!0),u){const m=Xl(to(i._options.defaultValues,o));Fi(i._defaultValues,o,m),tn(to(i._formValues,o))&&Fi(i._formValues,o,m)}return()=>{(l?u&&!i._state.action:u)?i.unregister(o):h(o,!1)}},[o,i,l,a]),{field:{name:o,value:d,onChange:$.useCallback(u=>p.current.onChange({target:{value:Jye(u),name:o},type:bk.CHANGE}),[o]),onBlur:$.useCallback(()=>p.current.onBlur({target:{value:to(i._formValues,o),name:o},type:bk.BLUR}),[o,i]),ref:u=>{const h=to(i._fields,o);h&&u&&(h._f.ref={focus:()=>u.focus(),select:()=>u.select(),setCustomValidity:m=>u.setCustomValidity(m),reportValidity:()=>u.reportValidity()})}},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!to(c.errors,o)},isDirty:{enumerable:!0,get:()=>!!to(c.dirtyFields,o)},isTouched:{enumerable:!0,get:()=>!!to(c.touchedFields,o)},error:{enumerable:!0,get:()=>to(c.errors,o)}})}}const zr=e=>e.render(Trt(e));var zrt=(e,t,o,i,a)=>t?{...o[e],types:{...o[e]&&o[e].types?o[e].types:{},[i]:a||!0}}:{};const vk=(e,t,o)=>{for(const i of o||Object.keys(e)){const a=to(e,i);if(a){const{_f:l,...d}=a;if(l&&t(l.name)){if(l.ref.focus){l.ref.focus();break}else if(l.refs&&l.refs[0].focus){l.refs[0].focus();break}}else Ma(d)&&vk(d,t)}}};var ph=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const o=(Math.random()*16+e)%16|0;return(t=="x"?o:o&3|8).toString(16)})},RT=(e,t,o={})=>o.shouldFocus||tn(o.shouldFocus)?o.focusName||`${e}.${tn(o.focusIndex)?t:o.focusIndex}.`:"",Z_=e=>({isOnSubmit:!e||e===zc.onSubmit,isOnBlur:e===zc.onBlur,isOnChange:e===zc.onChange,isOnAll:e===zc.all,isOnTouch:e===zc.onTouched}),J_=(e,t,o)=>!o&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length)))),awe=(e,t,o)=>{const i=Y6(to(e,o));return Fi(i,"root",t[o]),Fi(e,o,i),e},I7=e=>typeof e=="boolean",_G=e=>e.type==="file",Wh=e=>typeof e=="function",Ck=e=>{if(!OG)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},L$=e=>Fu(e),VG=e=>e.type==="radio",Ak=e=>e instanceof RegExp;const rne={value:!1,isValid:!1},ine={value:!0,isValid:!0};var swe=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(o=>o&&o.checked&&!o.disabled).map(o=>o.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!tn(e[0].attributes.value)?tn(e[0].value)||e[0].value===""?ine:{value:e[0].value,isValid:!0}:ine:rne}return rne};const nne={isValid:!1,value:null};var lwe=e=>Array.isArray(e)?e.reduce((t,o)=>o&&o.checked&&!o.disabled?{isValid:!0,value:o.value}:t,nne):nne;function ane(e,t,o="validate"){if(L$(e)||Array.isArray(e)&&e.every(L$)||I7(e)&&!e)return{type:o,message:L$(e)?e:"",ref:t}}var of=e=>Ma(e)&&!Ak(e)?e:{value:e,message:""},X_=async(e,t,o,i,a)=>{const{ref:l,refs:d,required:c,maxLength:p,minLength:u,min:h,max:m,pattern:f,validate:x,name:y,valueAsNumber:w,mount:b,disabled:v}=e._f,A=to(t,y);if(!b||v)return{};const S=d?d[0]:l,E=R=>{i&&S.reportValidity&&(S.setCustomValidity(I7(R)?"":R||""),S.reportValidity())},j={},L=VG(l),M=ab(l),D=L||M,P=(w||_G(l))&&tn(l.value)&&tn(A)||Ck(l)&&l.value===""||A===""||Array.isArray(A)&&!A.length,T=zrt.bind(null,y,o,j),z=(R,K,Z,O=B2.maxLength,Q=B2.minLength)=>{const _=R?K:Z;j[y]={type:R?O:Q,message:_,ref:l,...T(R?O:Q,_)}};if(a?!Array.isArray(A)||!A.length:c&&(!D&&(P||xl(A))||I7(A)&&!A||M&&!swe(d).isValid||L&&!lwe(d).isValid)){const{value:R,message:K}=L$(c)?{value:!!c,message:c}:of(c);if(R&&(j[y]={type:B2.required,message:K,ref:S,...T(B2.required,K)},!o))return E(K),j}if(!P&&(!xl(h)||!xl(m))){let R,K;const Z=of(m),O=of(h);if(!xl(A)&&!isNaN(A)){const Q=l.valueAsNumber||A&&+A;xl(Z.value)||(R=Q>Z.value),xl(O.value)||(K=Q<O.value)}else{const Q=l.valueAsDate||new Date(A),_=H=>new Date(new Date().toDateString()+" "+H),F=l.type=="time",N=l.type=="week";Fu(Z.value)&&A&&(R=F?_(A)>_(Z.value):N?A>Z.value:Q>new Date(Z.value)),Fu(O.value)&&A&&(K=F?_(A)<_(O.value):N?A<O.value:Q<new Date(O.value))}if((R||K)&&(z(!!R,Z.message,O.message,B2.max,B2.min),!o))return E(j[y].message),j}if((p||u)&&!P&&(Fu(A)||a&&Array.isArray(A))){const R=of(p),K=of(u),Z=!xl(R.value)&&A.length>+R.value,O=!xl(K.value)&&A.length<+K.value;if((Z||O)&&(z(Z,R.message,K.message),!o))return E(j[y].message),j}if(f&&!P&&Fu(A)){const{value:R,message:K}=of(f);if(Ak(R)&&!A.match(R)&&(j[y]={type:B2.pattern,message:K,ref:l,...T(B2.pattern,K)},!o))return E(K),j}if(x){if(Wh(x)){const R=await x(A,t),K=ane(R,S);if(K&&(j[y]={...K,...T(B2.validate,K.message)},!o))return E(K.message),j}else if(Ma(x)){let R={};for(const K in x){if(!Dd(R)&&!o)break;const Z=ane(await x[K](A,t),S,K);Z&&(R={...Z,...T(K,Z.message)},E(Z.message),o&&(j[y]=R))}if(!Dd(R)&&(j[y]={ref:S,...R},!o))return j}}return E(!0),j};function FT(e,t){return[...e,...Fd(t)]}var OT=e=>Array.isArray(e)?e.map(()=>{}):void 0;function NT(e,t,o){return[...e.slice(0,t),...Fd(o),...e.slice(t)]}var HT=(e,t,o)=>Array.isArray(e)?(tn(e[o])&&(e[o]=void 0),e.splice(o,0,e.splice(t,1)[0]),e):[];function _T(e,t){return[...Fd(t),...Fd(e)]}function Rrt(e,t){let o=0;const i=[...e];for(const a of t)i.splice(a-o,1),o++;return Y6(i).length?i:[]}var VT=(e,t)=>tn(t)?[]:Rrt(e,Fd(t).sort((o,i)=>o-i)),QT=(e,t,o)=>{e[t]=[e[o],e[o]=e[t]][0]};function Frt(e,t){const o=t.slice(0,-1).length;let i=0;for(;i<o;)e=tn(e)?i++:e[t[i++]];return e}function Ort(e){for(const t in e)if(!tn(e[t]))return!1;return!0}function Ka(e,t){const o=Array.isArray(t)?t:HG(t)?[t]:nwe(t),i=o.length===1?e:Frt(e,o),a=o.length-1,l=o[a];return i&&delete i[l],a!==0&&(Ma(i)&&Dd(i)||Array.isArray(i)&&Ort(i))&&Ka(e,o.slice(0,-1)),e}var sne=(e,t,o)=>(e[t]=o,e);function dwe(e){const t=Wt(),{control:o=t.control,name:i,keyName:a="id",shouldUnregister:l}=e,[d,c]=$.useState(o._getFieldArray(i)),p=$.useRef(o._getFieldArray(i).map(ph)),u=$.useRef(d),h=$.useRef(i),m=$.useRef(!1);h.current=i,u.current=d,o._names.array.add(i),e.rules&&o.register(i,e.rules),SL({next:({values:j,name:L})=>{if(L===h.current||!L){const M=to(j,h.current);Array.isArray(M)&&(c(M),p.current=M.map(ph))}},subject:o._subjects.array});const f=$.useCallback(j=>{m.current=!0,o._updateFieldArray(i,j)},[o,i]),x=(j,L)=>{const M=Fd(Xl(j)),D=FT(o._getFieldArray(i),M);o._names.focus=RT(i,D.length-1,L),p.current=FT(p.current,M.map(ph)),f(D),c(D),o._updateFieldArray(i,D,FT,{argA:OT(j)})},y=(j,L)=>{const M=Fd(Xl(j)),D=_T(o._getFieldArray(i),M);o._names.focus=RT(i,0,L),p.current=_T(p.current,M.map(ph)),f(D),c(D),o._updateFieldArray(i,D,_T,{argA:OT(j)})},w=j=>{const L=VT(o._getFieldArray(i),j);p.current=VT(p.current,j),f(L),c(L),o._updateFieldArray(i,L,VT,{argA:j})},b=(j,L,M)=>{const D=Fd(Xl(L)),P=NT(o._getFieldArray(i),j,D);o._names.focus=RT(i,j,M),p.current=NT(p.current,j,D.map(ph)),f(P),c(P),o._updateFieldArray(i,P,NT,{argA:j,argB:OT(L)})},v=(j,L)=>{const M=o._getFieldArray(i);QT(M,j,L),QT(p.current,j,L),f(M),c(M),o._updateFieldArray(i,M,QT,{argA:j,argB:L},!1)},A=(j,L)=>{const M=o._getFieldArray(i);HT(M,j,L),HT(p.current,j,L),f(M),c(M),o._updateFieldArray(i,M,HT,{argA:j,argB:L},!1)},S=(j,L)=>{const M=Xl(L),D=sne(o._getFieldArray(i),j,M);p.current=[...D].map((P,T)=>!P||T===j?ph():p.current[T]),f(D),c([...D]),o._updateFieldArray(i,D,sne,{argA:j,argB:M},!0,!1)},E=j=>{const L=Fd(Xl(j));p.current=L.map(ph),f([...L]),c([...L]),o._updateFieldArray(i,[...L],M=>M,{},!0,!1)};return $.useEffect(()=>{if(o._state.action=!1,J_(i,o._names)&&o._subjects.state.next({...o._formState}),m.current&&(!Z_(o._options.mode).isOnSubmit||o._formState.isSubmitted))if(o._options.resolver)o._executeSchema([i]).then(j=>{const L=to(j.errors,i),M=to(o._formState.errors,i);(M?!L&&M.type:L&&L.type)&&(L?Fi(o._formState.errors,i,L):Ka(o._formState.errors,i),o._subjects.state.next({errors:o._formState.errors}))});else{const j=to(o._fields,i);j&&j._f&&X_(j,o._formValues,o._options.criteriaMode===zc.all,o._options.shouldUseNativeValidation,!0).then(L=>!Dd(L)&&o._subjects.state.next({errors:awe(o._formState.errors,L,i)}))}o._subjects.values.next({name:i,values:{...o._formValues}}),o._names.focus&&vk(o._fields,j=>!!j&&j.startsWith(o._names.focus||"")),o._names.focus="",o._updateValid()},[d,i,o]),$.useEffect(()=>(!to(o._formValues,i)&&o._updateFieldArray(i),()=>{(o._options.shouldUnregister||l)&&o.unregister(i)}),[i,o,a,l]),{swap:$.useCallback(v,[f,i,o]),move:$.useCallback(A,[f,i,o]),prepend:$.useCallback(y,[f,i,o]),append:$.useCallback(x,[f,i,o]),remove:$.useCallback(w,[f,i,o]),insert:$.useCallback(b,[f,i,o]),update:$.useCallback(S,[f,i,o]),replace:$.useCallback(E,[f,i,o]),fields:$.useMemo(()=>d.map((j,L)=>({...j,[a]:p.current[L]||ph()})),[d,a])}}function UT(){let e=[];return{get observers(){return e},next:t=>{for(const o of e)o.next&&o.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(o=>o!==t)}}),unsubscribe:()=>{e=[]}}}var $k=e=>xl(e)||!Zye(e);function X3(e,t){if($k(e)||$k(t))return e===t;if(p7(e)&&p7(t))return e.getTime()===t.getTime();const o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;for(const a of o){const l=e[a];if(!i.includes(a))return!1;if(a!=="ref"){const d=t[a];if(p7(l)&&p7(d)||Ma(l)&&Ma(d)||Array.isArray(l)&&Array.isArray(d)?!X3(l,d):l!==d)return!1}}return!0}var cwe=e=>e.type==="select-multiple",Nrt=e=>VG(e)||ab(e),WT=e=>Ck(e)&&e.isConnected,pwe=e=>{for(const t in e)if(Wh(e[t]))return!0;return!1};function kk(e,t={}){const o=Array.isArray(e);if(Ma(e)||o)for(const i in e)Array.isArray(e[i])||Ma(e[i])&&!pwe(e[i])?(t[i]=Array.isArray(e[i])?[]:{},kk(e[i],t[i])):xl(e[i])||(t[i]=!0);return t}function uwe(e,t,o){const i=Array.isArray(e);if(Ma(e)||i)for(const a in e)Array.isArray(e[a])||Ma(e[a])&&!pwe(e[a])?tn(t)||$k(o[a])?o[a]=Array.isArray(e[a])?kk(e[a],[]):{...kk(e[a])}:uwe(e[a],xl(t)?{}:t[a],o[a]):o[a]=!X3(e[a],t[a]);return o}var GT=(e,t)=>uwe(e,t,kk(t)),hwe=(e,{valueAsNumber:t,valueAsDate:o,setValueAs:i})=>tn(e)?e:t?e===""?NaN:e&&+e:o&&Fu(e)?new Date(e):i?i(e):e;function YT(e){const t=e.ref;if(!(e.refs?e.refs.every(o=>o.disabled):t.disabled))return _G(t)?t.files:VG(t)?lwe(e.refs).value:cwe(t)?[...t.selectedOptions].map(({value:o})=>o):ab(t)?swe(e.refs).value:hwe(tn(t.value)?e.ref.value:t.value,e)}var Hrt=(e,t,o,i)=>{const a={};for(const l of e){const d=to(t,l);d&&Fi(a,l,d._f)}return{criteriaMode:o,names:[...e],fields:a,shouldUseNativeValidation:i}},g9=e=>tn(e)?e:Ak(e)?e.source:Ma(e)?Ak(e.value)?e.value.source:e.value:e,_rt=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function lne(e,t,o){const i=to(e,o);if(i||HG(o))return{error:i,name:o};const a=o.split(".");for(;a.length;){const l=a.join("."),d=to(t,l),c=to(e,l);if(d&&!Array.isArray(d)&&o!==l)return{name:o};if(c&&c.type)return{name:l,error:c};a.pop()}return{name:o}}var Vrt=(e,t,o,i,a)=>a.isOnAll?!1:!o&&a.isOnTouch?!(t||e):(o?i.isOnBlur:a.isOnBlur)?!e:(o?i.isOnChange:a.isOnChange)?e:!0,Qrt=(e,t)=>!Y6(to(e,t)).length&&Ka(e,t);const Urt={mode:zc.onSubmit,reValidateMode:zc.onChange,shouldFocusError:!0};function Wrt(e={},t){let o={...Urt,...e},i={submitCount:0,isDirty:!1,isLoading:Wh(o.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},a={},l=Ma(o.defaultValues)||Ma(o.values)?Xl(o.defaultValues||o.values)||{}:{},d=o.shouldUnregister?{}:Xl(l),c={action:!1,mount:!1,watch:!1},p={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,h=0;const m={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:UT(),array:UT(),state:UT()},x=e.resetOptions&&e.resetOptions.keepDirtyValues,y=Z_(o.mode),w=Z_(o.reValidateMode),b=o.criteriaMode===zc.all,v=le=>pe=>{clearTimeout(h),h=setTimeout(le,pe)},A=async le=>{if(m.isValid||le){const pe=o.resolver?Dd((await P()).errors):await z(a,!0);pe!==i.isValid&&f.state.next({isValid:pe})}},S=le=>m.isValidating&&f.state.next({isValidating:le}),E=(le,pe=[],ae,be,ue=!0,se=!0)=>{if(be&&ae){if(c.action=!0,se&&Array.isArray(to(a,le))){const ge=ae(to(a,le),be.argA,be.argB);ue&&Fi(a,le,ge)}if(se&&Array.isArray(to(i.errors,le))){const ge=ae(to(i.errors,le),be.argA,be.argB);ue&&Fi(i.errors,le,ge),Qrt(i.errors,le)}if(m.touchedFields&&se&&Array.isArray(to(i.touchedFields,le))){const ge=ae(to(i.touchedFields,le),be.argA,be.argB);ue&&Fi(i.touchedFields,le,ge)}m.dirtyFields&&(i.dirtyFields=GT(l,d)),f.state.next({name:le,isDirty:K(le,pe),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else Fi(d,le,pe)},j=(le,pe)=>{Fi(i.errors,le,pe),f.state.next({errors:i.errors})},L=(le,pe,ae,be)=>{const ue=to(a,le);if(ue){const se=to(d,le,tn(ae)?to(l,le):ae);tn(se)||be&&be.defaultChecked||pe?Fi(d,le,pe?se:YT(ue._f)):Q(le,se),c.mount&&A()}},M=(le,pe,ae,be,ue)=>{let se=!1,ge=!1;const Ee={name:le};if(!ae||be){m.isDirty&&(ge=i.isDirty,i.isDirty=Ee.isDirty=K(),se=ge!==Ee.isDirty);const $e=X3(to(l,le),pe);ge=to(i.dirtyFields,le),$e?Ka(i.dirtyFields,le):Fi(i.dirtyFields,le,!0),Ee.dirtyFields=i.dirtyFields,se=se||m.dirtyFields&&ge!==!$e}if(ae){const $e=to(i.touchedFields,le);$e||(Fi(i.touchedFields,le,ae),Ee.touchedFields=i.touchedFields,se=se||m.touchedFields&&$e!==ae)}return se&&ue&&f.state.next(Ee),se?Ee:{}},D=(le,pe,ae,be)=>{const ue=to(i.errors,le),se=m.isValid&&I7(pe)&&i.isValid!==pe;if(e.delayError&&ae?(u=v(()=>j(le,ae)),u(e.delayError)):(clearTimeout(h),u=null,ae?Fi(i.errors,le,ae):Ka(i.errors,le)),(ae?!X3(ue,ae):ue)||!Dd(be)||se){const ge={...be,...se&&I7(pe)?{isValid:pe}:{},errors:i.errors,name:le};i={...i,...ge},f.state.next(ge)}S(!1)},P=async le=>o.resolver(d,o.context,Hrt(le||p.mount,a,o.criteriaMode,o.shouldUseNativeValidation)),T=async le=>{const{errors:pe}=await P();if(le)for(const ae of le){const be=to(pe,ae);be?Fi(i.errors,ae,be):Ka(i.errors,ae)}else i.errors=pe;return pe},z=async(le,pe,ae={valid:!0})=>{for(const be in le){const ue=le[be];if(ue){const{_f:se,...ge}=ue;if(se){const Ee=p.array.has(se.name),$e=await X_(ue,d,b,o.shouldUseNativeValidation&&!pe,Ee);if($e[se.name]&&(ae.valid=!1,pe))break;!pe&&(to($e,se.name)?Ee?awe(i.errors,$e,se.name):Fi(i.errors,se.name,$e[se.name]):Ka(i.errors,se.name))}ge&&await z(ge,pe,ae)}}return ae.valid},R=()=>{for(const le of p.unMount){const pe=to(a,le);pe&&(pe._f.refs?pe._f.refs.every(ae=>!WT(ae)):!WT(pe._f.ref))&&ie(le)}p.unMount=new Set},K=(le,pe)=>(le&&pe&&Fi(d,le,pe),!X3(ee(),l)),Z=(le,pe,ae)=>iwe(le,p,{...c.mount?d:tn(pe)?l:Fu(le)?{[le]:pe}:pe},ae,pe),O=le=>Y6(to(c.mount?d:l,le,e.shouldUnregister?to(l,le,[]):[])),Q=(le,pe,ae={})=>{const be=to(a,le);let ue=pe;if(be){const se=be._f;se&&(!se.disabled&&Fi(d,le,hwe(pe,se)),ue=Ck(se.ref)&&xl(pe)?"":pe,cwe(se.ref)?[...se.ref.options].forEach(ge=>ge.selected=ue.includes(ge.value)):se.refs?ab(se.ref)?se.refs.length>1?se.refs.forEach(ge=>(!ge.defaultChecked||!ge.disabled)&&(ge.checked=Array.isArray(ue)?!!ue.find(Ee=>Ee===ge.value):ue===ge.value)):se.refs[0]&&(se.refs[0].checked=!!ue):se.refs.forEach(ge=>ge.checked=ge.value===ue):_G(se.ref)?se.ref.value="":(se.ref.value=ue,se.ref.type||f.values.next({name:le,values:{...d}})))}(ae.shouldDirty||ae.shouldTouch)&&M(le,ue,ae.shouldTouch,ae.shouldDirty,!0),ae.shouldValidate&&H(le)},_=(le,pe,ae)=>{for(const be in pe){const ue=pe[be],se=`${le}.${be}`,ge=to(a,se);(p.array.has(le)||!$k(ue)||ge&&!ge._f)&&!p7(ue)?_(se,ue,ae):Q(se,ue,ae)}},F=(le,pe,ae={})=>{const be=to(a,le),ue=p.array.has(le),se=Xl(pe);Fi(d,le,se),ue?(f.array.next({name:le,values:{...d}}),(m.isDirty||m.dirtyFields)&&ae.shouldDirty&&f.state.next({name:le,dirtyFields:GT(l,d),isDirty:K(le,se)})):be&&!be._f&&!xl(se)?_(le,se,ae):Q(le,se,ae),J_(le,p)&&f.state.next({...i}),f.values.next({name:le,values:{...d}}),!c.mount&&t()},N=async le=>{const pe=le.target;let ae=pe.name,be=!0;const ue=to(a,ae),se=()=>pe.type?YT(ue._f):Jye(le);if(ue){let ge,Ee;const $e=se(),Ve=le.type===bk.BLUR||le.type===bk.FOCUS_OUT,Le=!_rt(ue._f)&&!o.resolver&&!to(i.errors,ae)&&!ue._f.deps||Vrt(Ve,to(i.touchedFields,ae),i.isSubmitted,w,y),He=J_(ae,p,Ve);Fi(d,ae,$e),Ve?(ue._f.onBlur&&ue._f.onBlur(le),u&&u(0)):ue._f.onChange&&ue._f.onChange(le);const De=M(ae,$e,Ve,!1),Me=!Dd(De)||He;if(!Ve&&f.values.next({name:ae,type:le.type,values:{...d}}),Le)return m.isValid&&A(),Me&&f.state.next({name:ae,...He?{}:De});if(!Ve&&He&&f.state.next({...i}),S(!0),o.resolver){const{errors:Pe}=await P([ae]),ze=lne(i.errors,a,ae),Be=lne(Pe,a,ze.name||ae);ge=Be.error,ae=Be.name,Ee=Dd(Pe)}else ge=(await X_(ue,d,b,o.shouldUseNativeValidation))[ae],be=isNaN($e)||$e===to(d,ae,$e),be&&(ge?Ee=!1:m.isValid&&(Ee=await z(a,!0)));be&&(ue._f.deps&&H(ue._f.deps),D(ae,Ee,ge,De))}},H=async(le,pe={})=>{let ae,be;const ue=Fd(le);if(S(!0),o.resolver){const se=await T(tn(le)?le:ue);ae=Dd(se),be=le?!ue.some(ge=>to(se,ge)):ae}else le?(be=(await Promise.all(ue.map(async se=>{const ge=to(a,se);return await z(ge&&ge._f?{[se]:ge}:ge)}))).every(Boolean),!(!be&&!i.isValid)&&A()):be=ae=await z(a);return f.state.next({...!Fu(le)||m.isValid&&ae!==i.isValid?{}:{name:le},...o.resolver||!le?{isValid:ae}:{},errors:i.errors,isValidating:!1}),pe.shouldFocus&&!be&&vk(a,se=>se&&to(i.errors,se),le?ue:p.mount),be},ee=le=>{const pe={...l,...c.mount?d:{}};return tn(le)?pe:Fu(le)?to(pe,le):le.map(ae=>to(pe,ae))},Y=(le,pe)=>({invalid:!!to((pe||i).errors,le),isDirty:!!to((pe||i).dirtyFields,le),isTouched:!!to((pe||i).touchedFields,le),error:to((pe||i).errors,le)}),G=le=>{le&&Fd(le).forEach(pe=>Ka(i.errors,pe)),f.state.next({errors:le?i.errors:{}})},J=(le,pe,ae)=>{const be=(to(a,le,{_f:{}})._f||{}).ref;Fi(i.errors,le,{...pe,ref:be}),f.state.next({name:le,errors:i.errors,isValid:!1}),ae&&ae.shouldFocus&&be&&be.focus&&be.focus()},X=(le,pe)=>Wh(le)?f.values.subscribe({next:ae=>le(Z(void 0,pe),ae)}):Z(le,pe,!0),ie=(le,pe={})=>{for(const ae of le?Fd(le):p.mount)p.mount.delete(ae),p.array.delete(ae),pe.keepValue||(Ka(a,ae),Ka(d,ae)),!pe.keepError&&Ka(i.errors,ae),!pe.keepDirty&&Ka(i.dirtyFields,ae),!pe.keepTouched&&Ka(i.touchedFields,ae),!o.shouldUnregister&&!pe.keepDefaultValue&&Ka(l,ae);f.values.next({values:{...d}}),f.state.next({...i,...pe.keepDirty?{isDirty:K()}:{}}),!pe.keepIsValid&&A()},we=(le,pe={})=>{let ae=to(a,le);const be=I7(pe.disabled);return Fi(a,le,{...ae||{},_f:{...ae&&ae._f?ae._f:{ref:{name:le}},name:le,mount:!0,...pe}}),p.mount.add(le),ae?be&&Fi(d,le,pe.disabled?void 0:to(d,le,YT(ae._f))):L(le,!0,pe.value),{...be?{disabled:pe.disabled}:{},...o.shouldUseNativeValidation?{required:!!pe.required,min:g9(pe.min),max:g9(pe.max),minLength:g9(pe.minLength),maxLength:g9(pe.maxLength),pattern:g9(pe.pattern)}:{},name:le,onChange:N,onBlur:N,ref:ue=>{if(ue){we(le,pe),ae=to(a,le);const se=tn(ue.value)&&ue.querySelectorAll&&ue.querySelectorAll("input,select,textarea")[0]||ue,ge=Nrt(se),Ee=ae._f.refs||[];if(ge?Ee.find($e=>$e===se):se===ae._f.ref)return;Fi(a,le,{_f:{...ae._f,...ge?{refs:[...Ee.filter(WT),se,...Array.isArray(to(l,le))?[{}]:[]],ref:{type:se.type,name:le}}:{ref:se}}}),L(le,!1,void 0,se)}else ae=to(a,le,{}),ae._f&&(ae._f.mount=!1),(o.shouldUnregister||pe.shouldUnregister)&&!(Xye(p.array,le)&&c.action)&&p.unMount.add(le)}}},me=()=>o.shouldFocusError&&vk(a,le=>le&&to(i.errors,le),p.mount),de=(le,pe)=>async ae=>{ae&&(ae.preventDefault&&ae.preventDefault(),ae.persist&&ae.persist());let be=Xl(d);if(f.state.next({isSubmitting:!0}),o.resolver){const{errors:ue,values:se}=await P();i.errors=ue,be=se}else await z(a);Ka(i.errors,"root"),Dd(i.errors)?(f.state.next({errors:{}}),await le(be,ae)):(pe&&await pe({...i.errors},ae),me(),setTimeout(me)),f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Dd(i.errors),submitCount:i.submitCount+1,errors:i.errors})},ce=(le,pe={})=>{to(a,le)&&(tn(pe.defaultValue)?F(le,to(l,le)):(F(le,pe.defaultValue),Fi(l,le,pe.defaultValue)),pe.keepTouched||Ka(i.touchedFields,le),pe.keepDirty||(Ka(i.dirtyFields,le),i.isDirty=pe.defaultValue?K(le,to(l,le)):K()),pe.keepError||(Ka(i.errors,le),m.isValid&&A()),f.state.next({...i}))},fe=(le,pe={})=>{const ae=le||l,be=Xl(ae),ue=le&&!Dd(le)?be:l;if(pe.keepDefaultValues||(l=ae),!pe.keepValues){if(pe.keepDirtyValues||x)for(const se of p.mount)to(i.dirtyFields,se)?Fi(ue,se,to(d,se)):F(se,to(ue,se));else{if(OG&&tn(le))for(const se of p.mount){const ge=to(a,se);if(ge&&ge._f){const Ee=Array.isArray(ge._f.refs)?ge._f.refs[0]:ge._f.ref;if(Ck(Ee)){const $e=Ee.closest("form");if($e){$e.reset();break}}}}a={}}d=e.shouldUnregister?pe.keepDefaultValues?Xl(l):{}:be,f.array.next({values:{...ue}}),f.values.next({values:{...ue}})}p={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!c.mount&&t(),c.mount=!m.isValid||!!pe.keepIsValid,c.watch=!!e.shouldUnregister,f.state.next({submitCount:pe.keepSubmitCount?i.submitCount:0,isDirty:pe.keepDirty?i.isDirty:!!(pe.keepDefaultValues&&!X3(le,l)),isSubmitted:pe.keepIsSubmitted?i.isSubmitted:!1,dirtyFields:pe.keepDirtyValues?i.dirtyFields:pe.keepDefaultValues&&le?GT(l,le):{},touchedFields:pe.keepTouched?i.touchedFields:{},errors:pe.keepErrors?i.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},Ae=(le,pe)=>fe(Wh(le)?le(d):le,pe);return{control:{register:we,unregister:ie,getFieldState:Y,_executeSchema:P,_getWatch:Z,_getDirty:K,_updateValid:A,_removeUnmounted:R,_updateFieldArray:E,_getFieldArray:O,_reset:fe,_resetDefaultValues:()=>Wh(o.defaultValues)&&o.defaultValues().then(le=>{Ae(le,o.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:le=>{i={...i,...le}},_subjects:f,_proxyFormState:m,get _fields(){return a},get _formValues(){return d},get _state(){return c},set _state(le){c=le},get _defaultValues(){return l},get _names(){return p},set _names(le){p=le},get _formState(){return i},set _formState(le){i=le},get _options(){return o},set _options(le){o={...o,...le}}},trigger:H,register:we,handleSubmit:de,watch:X,setValue:F,getValues:ee,reset:Ae,resetField:ce,clearErrors:G,unregister:ie,setError:J,setFocus:(le,pe={})=>{const ae=to(a,le),be=ae&&ae._f;if(be){const ue=be.refs?be.refs[0]:be.ref;ue.focus&&(ue.focus(),pe.shouldSelect&&ue.select())}},getFieldState:Y}}function Qi(e={}){const t=$.useRef(),[o,i]=$.useState({isDirty:!1,isValidating:!1,isLoading:Wh(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Wh(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Wrt(e,()=>i(l=>({...l}))),formState:o});const a=t.current.control;return a._options=e,SL({subject:a._subjects.state,next:l=>{owe(l,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),$.useEffect(()=>{e.values&&!X3(e.values,a._defaultValues)?a._reset(e.values,a._options.resetOptions):a._resetDefaultValues()},[e.values,a]),$.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=twe(o,a),t.current}function rf(){}function Grt(){return!0}function f9(e){return!!(e||"").match(/\d/)}function dne(e){return e==null}function cne(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Yrt(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}function Krt(e,t,o){var i=Yrt(o),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(i,"$1"+t)}function eV(e,t){t===void 0&&(t=!0);var o=e[0]==="-",i=o&&t;e=e.replace("-","");var a=e.split("."),l=a[0],d=a[1]||"";return{beforeDecimal:l,afterDecimal:d,hasNagation:o,addNegation:i}}function qrt(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var o=e.split("."),i=o[0].replace(/^0+/,"")||"0",a=o[1]||"";return(t?"-":"")+i+(a?"."+a:"")}function mwe(e,t,o){for(var i="",a=o?"0":"",l=0;l<=t-1;l++)i+=e[l]||a;return i}function pne(e,t){return Array(t+1).join(e)}function Zrt(e){e+="";var t=e[0]==="-"?"-":"";t&&(e=e.substring(1));var o=e.split(/[eE]/g),i=o[0],a=o[1];if(a=Number(a),!a)return t+i;i=i.replace(".","");var l=1+a,d=i.length;return l<0?i="0."+pne("0",Math.abs(l))+i:l>=d?i=i+pne("0",l-d):i=(i.substring(0,l)||"0")+"."+i.substring(l),t+i}function Jrt(e,t,o){if(["","-"].indexOf(e)!==-1)return e;var i=e.indexOf(".")!==-1&&t,a=eV(e),l=a.beforeDecimal,d=a.afterDecimal,c=a.hasNagation,p=parseFloat("0."+(d||"0")),u=d.length<=t?"0."+d:p.toFixed(t),h=u.split("."),m=l.split("").reverse().reduce(function(w,b,v){return w.length>v?(Number(w[0])+Number(b)).toString()+w.substring(1,w.length):b+w},h[0]),f=mwe(h[1]||"",Math.min(t,d.length),o),x=c?"-":"",y=i?".":"";return""+x+m+y+f}function une(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var o=e.createTextRange();return o.move("character",t),o.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function Xrt(e,t){for(var o=0,i=0,a=e.length,l=t.length;e[o]===t[o]&&o<a;)o++;for(;e[a-1-i]===t[l-1-i]&&l-i>o&&a-i>o;)i++;return{start:o,end:a-i}}function KT(e,t,o){return Math.min(Math.max(e,t),o)}function hne(e){return Math.max(e.selectionStart,e.selectionEnd)}function eit(e){return e||typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function tit(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)===-1&&(o[i]=e[i]);return o}var oit={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:rf,onChange:rf,onKeyDown:rf,onMouseUp:rf,onFocus:rf,onBlur:rf,isAllowed:Grt},sb=function(e){function t(o){e.call(this,o);var i=o.defaultValue;this.validateProps();var a=this.formatValueProp(i);this.state={value:a,numAsString:this.removeFormatting(a),mounted:!1},this.selectionBeforeInput={selectionStart:0,selectionEnd:0},this.onChange=this.onChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.componentDidMount=function(){this.setState({mounted:!0})},t.prototype.componentDidUpdate=function(o){this.updateValueIfRequired(o)},t.prototype.componentWillUnmount=function(){clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout)},t.prototype.updateValueIfRequired=function(o){var i=this,a=i.props,l=i.state,d=i.focusedElm,c=l.value,p=l.numAsString;if(p===void 0&&(p=""),o!==a){this.validateProps();var u=this.formatNumString(p),h=dne(a.value)?u:this.formatValueProp(),m=this.removeFormatting(h),f=parseFloat(m),x=parseFloat(p);((!isNaN(f)||!isNaN(x))&&f!==x||u!==c||d===null&&h!==c)&&this.updateValue({formattedValue:h,numAsString:m,input:d,source:"prop",event:null})}},t.prototype.getFloatString=function(o){o===void 0&&(o="");var i=this.props,a=i.decimalScale,l=this.getSeparators(),d=l.decimalSeparator,c=this.getNumberRegex(!0),p=o[0]==="-";p&&(o=o.replace("-","")),d&&a===0&&(o=o.split(d)[0]),o=(o.match(c)||[]).join("").replace(d,".");var u=o.indexOf(".");return u!==-1&&(o=o.substring(0,u)+"."+o.substring(u+1,o.length).replace(new RegExp(cne(d),"g"),"")),p&&(o="-"+o),o},t.prototype.getNumberRegex=function(o,i){var a=this.props,l=a.format,d=a.decimalScale,c=a.customNumerals,p=this.getSeparators(),u=p.decimalSeparator;return new RegExp("[0-9"+(c?c.join(""):"")+"]"+(u&&d!==0&&!i&&!l?"|"+cne(u):""),o?"g":void 0)},t.prototype.getSeparators=function(){var o=this.props,i=o.decimalSeparator,a=this.props,l=a.thousandSeparator,d=a.allowedDecimalSeparators;return l===!0&&(l=","),d||(d=[i,"."]),{decimalSeparator:i,thousandSeparator:l,allowedDecimalSeparators:d}},t.prototype.getMaskAtIndex=function(o){var i=this.props,a=i.mask;return a===void 0&&(a=" "),typeof a=="string"?a:a[o]||" "},t.prototype.getValueObject=function(o,i){var a=parseFloat(i);return{formattedValue:o,value:i,floatValue:isNaN(a)?void 0:a}},t.prototype.validateProps=function(){var o=this.props,i=o.mask,a=this.getSeparators(),l=a.decimalSeparator,d=a.thousandSeparator;if(l===d)throw new Error(`
93
93
  Decimal separator can't be same as thousand separator.
94
94
  thousandSeparator: `+d+` (thousandSeparator = {true} is same as thousandSeparator = ",")
95
95
  decimalSeparator: `+l+` (default value for decimalSeparator is .)
@@ -243,7 +243,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
243
243
  `+se:"")+"\n```"},regExp:/^```(\w{1,10})?\s/,replace:Z(ue=>t.$createCodeNode(ue?ue[1]:void 0)),type:"element"},H={dependencies:[o.ListNode,o.ListItemNode],export:(ue,se)=>o.$isListNode(ue)?Q(ue,se,0):null,regExp:/^(\s*)[-*+]\s/,replace:O("bullet"),type:"element"},ee={dependencies:[o.ListNode,o.ListItemNode],export:(ue,se)=>o.$isListNode(ue)?Q(ue,se,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:O("check"),type:"element"},Y={dependencies:[o.ListNode,o.ListItemNode],export:(ue,se)=>o.$isListNode(ue)?Q(ue,se,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:O("number"),type:"element"},G={format:["code"],tag:"`",type:"text-format"},J={format:["highlight"],tag:"==",type:"text-format"},X={format:["bold","italic"],tag:"***",type:"text-format"},ie={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},we={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"},fe={format:["italic"],intraword:!1,tag:"_",type:"text-format"},Ae={dependencies:[l.LinkNode],export:(ue,se,ge)=>{if(!l.$isLinkNode(ue))return null;se=(se=ue.getTitle())?`[${ue.getTextContent()}](${ue.getURL()} "${se}")`:`[${ue.getTextContent()}](${ue.getURL()})`;const Ee=ue.getFirstChild();return ue.getChildrenSize()===1&&e.$isTextNode(Ee)?ge(Ee,se):se},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(ue,se)=>{const[,ge,Ee,$e]=se;se=l.$createLinkNode(Ee,{title:$e});const Ve=e.$createTextNode(ge);Ve.setFormat(ue.getFormat()),se.append(Ve),ue.replace(se)},trigger:")",type:"text-match"},le=[_,F,N,H,Y],pe=[G,X,ie,we,me,J,ce,fe,de],ae=[Ae],be=[...le,...pe,...ae];return Xi.$convertFromMarkdownString=function(ue,se=be,ge){return M(se)(ue,ge)},Xi.$convertToMarkdownString=function(ue=be,se){return u(ue)(se)},Xi.BOLD_ITALIC_STAR=X,Xi.BOLD_ITALIC_UNDERSCORE=ie,Xi.BOLD_STAR=we,Xi.BOLD_UNDERSCORE=me,Xi.CHECK_LIST=ee,Xi.CODE=N,Xi.ELEMENT_TRANSFORMERS=le,Xi.HEADING=_,Xi.HIGHLIGHT=J,Xi.INLINE_CODE=G,Xi.ITALIC_STAR=ce,Xi.ITALIC_UNDERSCORE=fe,Xi.LINK=Ae,Xi.ORDERED_LIST=Y,Xi.QUOTE=F,Xi.STRIKETHROUGH=de,Xi.TEXT_FORMAT_TRANSFORMERS=pe,Xi.TEXT_MATCH_TRANSFORMERS=ae,Xi.TRANSFORMERS=be,Xi.UNORDERED_LIST=H,Xi.registerMarkdownShortcuts=function(ue,se=be){let ge=c(se),Ee=d(ge.textFormat,({tag:Ve})=>Ve[Ve.length-1]),$e=d(ge.textMatch,({trigger:Ve})=>Ve);for(let Ve of se)if(se=Ve.type,(se==="element"||se==="text-match")&&!ue.hasNodes(Ve.dependencies))throw Error("Minified Lexical error #79; visit https://lexical.dev/docs/error?code=79 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");return ue.registerUpdateListener(({tags:Ve,dirtyLeaves:Le,editorState:He,prevEditorState:De})=>{if(!Ve.has("historic")){var Me=He.read(e.$getSelection);if(Ve=De.read(e.$getSelection),e.$isRangeSelection(Ve)&&e.$isRangeSelection(Me)&&Me.isCollapsed()){De=Me.anchor.key;var Pe=Me.anchor.offset,ze=He._nodeMap.get(De);e.$isTextNode(ze)&&Le.has(De)&&(Pe===1||Pe===Ve.anchor.offset+1)&&ue.update(()=>{if(!ze.hasFormat("code")){var Be=ze.getParent();if(Be!==null&&!t.$isCodeNode(Be)){var _e=Me.anchor.offset;e:{var tt=ge.element,rt=Be.getParent();if(e.$isRootOrShadowRoot(rt)&&Be.getFirstChild()===ze&&(rt=ze.getTextContent(),rt[_e-1]===" ")){for(let{regExp:It,replace:Dt}of tt)if((tt=rt.match(It))&&tt[0].length===_e){rt=ze.getNextSiblings();let[no,Po]=ze.splitText(_e);no.remove(),rt=Po?[Po,...rt]:rt,Dt(Be,rt,tt,!1),Be=!0;break e}}Be=!1}if(!Be){e:{if(tt=ze.getTextContent(),Be=$e[tt[_e-1]],Be!=null){_e<tt.length&&(tt=tt.slice(0,_e));for(xt of Be)if(Be=tt.match(xt.regExp),Be!==null){tt=Be.index||0,rt=tt+Be[0].length;var ut=void 0;tt===0?[ut]=ze.splitText(rt):[,ut]=ze.splitText(tt,rt),ut.selectNext(0,0),xt.replace(ut,Be);var xt=!0;break e}}xt=!1}if(!xt)e:{rt=ze.getTextContent(),--_e;var dt=rt[_e];if(xt=Ee[dt])for(let It of xt){var{tag:Ft}=It;xt=Ft.length;let Dt=_e-xt+1;if(!(1<xt&&!K(rt,Dt,Ft,0,xt)||rt[Dt-1]===" ")&&(ut=rt[_e+1],It.intraword!==!1||!ut||p.test(ut))){Be=ut=ze,tt=R(rt,Dt,Ft);for(var ho=Be;0>tt&&(ho=ho.getPreviousSibling())&&!e.$isLineBreakNode(ho);)e.$isTextNode(ho)&&(tt=ho.getTextContent(),Be=ho,tt=R(tt,tt.length,Ft));if(!(0>tt||Be===ut&&tt+xt===Dt||(Ft=Be.getTextContent(),0<tt&&Ft[tt-1]===dt||(ho=Ft[tt-1],It.intraword===!1&&ho&&!p.test(ho))))){rt=ut.getTextContent(),rt=rt.slice(0,Dt)+rt.slice(_e+1),ut.setTextContent(rt),rt=Be===ut?rt:Ft,Be.setTextContent(rt.slice(0,tt)+rt.slice(tt+xt)),rt=e.$getSelection(),dt=e.$createRangeSelection(),e.$setSelection(dt),_e=_e-xt*(Be===ut?2:1)+1,dt.anchor.set(Be.__key,tt,"text"),dt.focus.set(ut.__key,_e,"text");for(let no of It.format)dt.hasFormat(no)||dt.formatText(no);dt.anchor.set(dt.focus.key,dt.focus.offset,dt.focus.type);for(let no of It.format)dt.hasFormat(no)&&dt.toggleFormat(no);e.$isRangeSelection(rt)&&(dt.format=rt.format);break e}}}}}}}})}}})},Xi}var rO,G1e;function EEe(){return G1e||(G1e=1,rO=_Et()),rO}var VEt=EEe(),iO={},Y1e;function QEt(){if(Y1e)return iO;Y1e=1;var e=Xd(),t=fd();return iO.AutoFocusPlugin=function({defaultSelection:o}){let[i]=e.useLexicalComposerContext();return t.useEffect(()=>{i.focus(()=>{let a=document.activeElement,l=i.getRootElement();l===null||a!==null&&l.contains(a)||l.focus({preventScroll:!0})},{defaultSelection:o})},[o,i]),null},iO}var nO,K1e;function UEt(){return K1e||(K1e=1,nO=QEt()),nO}var WEt=UEt(),hC={},pf={},aO={},q1e;function GEt(){if(q1e)return aO;q1e=1;var e=Xd(),t=fa(),o=fd();function i(a,l){return a.getEditorState().read(()=>{let d=t.$getNodeByKey(l);return d===null?!1:d.isSelected()})}return aO.useLexicalNodeSelection=function(a){let[l]=e.useLexicalComposerContext(),[d,c]=o.useState(()=>i(l,a));o.useEffect(()=>{let h=!0,m=l.registerUpdateListener(()=>{h&&c(i(l,a))});return()=>{h=!1,m()}},[l,a]);let p=o.useCallback(h=>{l.update(()=>{let m=t.$getSelection();t.$isNodeSelection(m)||(m=t.$createNodeSelection(),t.$setSelection(m)),h?m.add(a):m.delete(a)})},[l,a]),u=o.useCallback(()=>{l.update(()=>{const h=t.$getSelection();t.$isNodeSelection(h)&&h.clear()})},[l]);return[d,p,u]},aO}var sO,Z1e;function YEt(){return Z1e||(Z1e=1,sO=GEt()),sO}var J1e;function KEt(){if(J1e)return pf;J1e=1;var e=Xd(),t=YEt(),o=yd(),i=fa(),a=fd();let l=i.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function d({nodeKey:m}){let[f]=e.useLexicalComposerContext(),[x,y,w]=t.useLexicalNodeSelection(m),b=a.useCallback(v=>(x&&i.$isNodeSelection(i.$getSelection())&&(v.preventDefault(),v=i.$getNodeByKey(m),h(v)&&v.remove(),y(!1)),!1),[x,m,y]);return a.useEffect(()=>o.mergeRegister(f.registerCommand(i.CLICK_COMMAND,v=>{let A=f.getElementByKey(m);return v.target===A?(v.shiftKey||w(),y(!x),!0):!1},i.COMMAND_PRIORITY_LOW),f.registerCommand(i.KEY_DELETE_COMMAND,b,i.COMMAND_PRIORITY_LOW),f.registerCommand(i.KEY_BACKSPACE_COMMAND,b,i.COMMAND_PRIORITY_LOW)),[w,f,x,m,b,y]),a.useEffect(()=>{let v=f.getElementByKey(m);v!==null&&(v.className=x?"selected":"")},[f,x,m]),null}class c extends i.DecoratorNode{static getType(){return"horizontalrule"}static clone(f){return new c(f.__key)}static importJSON(){return u()}static importDOM(){return{hr:()=>({conversion:p,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
244
244
  `}isInline(){return!1}updateDOM(){return!1}decorate(){return a.createElement(d,{nodeKey:this.__key})}}function p(){return{node:u()}}function u(){return i.$applyNodeReplacement(new c)}function h(m){return m instanceof c}return pf.$createHorizontalRuleNode=u,pf.$isHorizontalRuleNode=h,pf.HorizontalRuleNode=c,pf.INSERT_HORIZONTAL_RULE_COMMAND=l,pf}var lO,X1e;function qEt(){return X1e||(X1e=1,lO=KEt()),lO}var epe;function ZEt(){if(epe)return hC;epe=1;var e=EEe(),t=Xd(),o=qEt(),i=fd();let a=[{dependencies:[o.HorizontalRuleNode],export:l=>o.$isHorizontalRuleNode(l)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(l,d,c,p)=>{d=o.$createHorizontalRuleNode(),p||l.getNextSibling()!=null?l.replace(d):l.insertBefore(d),d.selectNext()},type:"element"},...e.TRANSFORMERS];return hC.DEFAULT_TRANSFORMERS=a,hC.MarkdownShortcutPlugin=function({transformers:l=a}){let[d]=t.useLexicalComposerContext();return i.useEffect(()=>e.registerMarkdownShortcuts(d,l),[d,l]),null},hC}var dO,tpe;function JEt(){return tpe||(tpe=1,dO=ZEt()),dO}var XEt=JEt(),ii={},ope;function eLt(){if(ope)return ii;ope=1;var e=fa(),t=yd();let o={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class i extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(N){let H=new i(N.__headerState,N.__colSpan,N.__width,N.__key);return H.__rowSpan=N.__rowSpan,H}static importDOM(){return{td:()=>({conversion:a,priority:0}),th:()=>({conversion:a,priority:0})}}static importJSON(N){let H=l(N.headerState,N.colSpan,N.width||void 0);return H.__rowSpan=N.rowSpan,H}constructor(N=o.NO_STATUS,H=1,ee,Y){super(H,Y),this.__headerState=N,this.__width=ee}createDOM(N){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,N.theme.tableCell,this.hasHeader()&&N.theme.tableCellHeader),H}exportDOM(N){if({element:N}=super.exportDOM(N),N){let H=this.getParentOrThrow().getChildrenSize();N.style.border="1px solid black",1<this.__colSpan&&(N.colSpan=this.__colSpan),1<this.__rowSpan&&(N.rowSpan=this.__rowSpan),N.style.width=`${this.getWidth()||Math.max(90,700/H)}px`,N.style.verticalAlign="top",N.style.textAlign="start",this.hasHeader()&&(N.style.backgroundColor="#f2f3f5")}return{element:N}}exportJSON(){return{...super.exportJSON(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(N){return this.getWritable().__headerState=N,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(N){return this.getWritable().__width=N,this.__width}getWidth(){return this.getLatest().__width}toggleHeaderStyle(N){let H=this.getWritable();return H.__headerState=(H.__headerState&N)===N?H.__headerState-N:H.__headerState+N,H}hasHeaderState(N){return(this.getHeaderStyles()&N)===N}hasHeader(){return this.getLatest().__headerState!==o.NO_STATUS}updateDOM(N){return N.__headerState!==this.__headerState||N.__width!==this.__width||N.__colSpan!==this.__colSpan||N.__rowSpan!==this.__rowSpan}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function a(F){var N=F.nodeName.toLowerCase();return N=l(N==="th"?o.ROW:o.NO_STATUS),N.__colSpan=F.colSpan,N.__rowSpan=F.rowSpan,{forChild:(H,ee)=>d(ee)&&!e.$isElementNode(H)?(ee=e.$createParagraphNode(),e.$isLineBreakNode(H)&&H.getTextContent()===`
245
245
  `?null:(ee.append(H),ee)):H,node:N}}function l(F,N=1,H){return e.$applyNodeReplacement(new i(F,N,H))}function d(F){return F instanceof i}class c extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(N){return new c(N.__height,N.__key)}static importDOM(){return{tr:()=>({conversion:p,priority:0})}}static importJSON(N){return u(N.height)}constructor(N,H){super(H),this.__height=N}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(N){let H=document.createElement("tr");return this.__height&&(H.style.height=`${this.__height}px`),t.addClassNamesToElement(H,N.theme.tableRow),H}isShadowRoot(){return!0}setHeight(N){return this.getWritable().__height=N,this.__height}getHeight(){return this.getLatest().__height}updateDOM(N){return N.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function p(){return{node:u()}}function u(F){return e.$applyNodeReplacement(new c(F))}function h(F){return F instanceof c}function m(F){throw Error(`Minified Lexical error #${F}; visit https://lexical.dev/docs/error?code=${F} 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(N,H){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=H,this.editor=N,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(N=>N())}trackTableGrid(){let N=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=w(ee)}})});this.editor.update(()=>{let H=this.editor.getElementByKey(this.tableNodeKey);if(!H)throw Error("Expected to find TableElement in DOM");this.grid=w(H),N.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 N=e.$getNodeByKey(this.tableNodeKey);if(!z(N))throw Error("Expected TableNode.");if(N=this.editor.getElementByKey(this.tableNodeKey),!N)throw Error("Expected to find TableElement in DOM");N=w(N),b(N,null),e.$setSelection(null),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){this.editor.update(()=>{let N=this.editor.getElementByKey(this.tableNodeKey);if(!N)throw Error("Expected to find TableElement in DOM");N.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){this.editor.update(()=>{let N=this.editor.getElementByKey(this.tableNodeKey);if(!N)throw Error("Expected to find TableElement in DOM");N.classList.add("disable-selection"),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(N){N!=null&&N.gridKey===this.tableNodeKey?(this.gridSelection=N,this.isHighlightingCells=!0,this.disableHighlightStyle(),b(this.grid,this.gridSelection)):N==null&&this.clearHighlight()}setFocusCellForSelection(N,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=N.x;let Y=N.y;if(this.focusCell=N,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(N.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&d(ee)&&(ee=ee.getKey(),this.gridSelection=this.gridSelection.clone()||e.DEPRECATED_$createGridSelection(),this.focusCellNodeKey=ee,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),b(this.grid,this.gridSelection)))})}setAnchorCellForSelection(N){this.isHighlightingCells=!1,this.anchorCell=N,this.anchorX=N.x,this.anchorY=N.y,this.editor.update(()=>{var H=e.$getNearestNodeFromDOMNode(N.elem);d(H)&&(H=H.getKey(),this.gridSelection=e.DEPRECATED_$createGridSelection(),this.anchorCellNodeKey=H)})}formatCells(N){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(J=>{d(J)&&J.getTextContentSize()!==0&&(Y.set(J.getKey(),0,"element"),G.set(J.getKey(),J.getChildrenSize(),"element"),ee.formatText(N))}),e.$setSelection(H),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){this.editor.update(()=>{let N=e.$getNodeByKey(this.tableNodeKey);if(!z(N))throw Error("Expected TableNode.");var H=e.$getSelection();e.DEPRECATED_$isGridSelection(H)||m(11),H=H.getNodes().filter(d),H.length===this.grid.columns*this.grid.rows?(N.selectPrevious(),N.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(J=>{J!==Y&&J.remove()})}}),b(this.grid,null),e.$setSelection(null),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function y(F){for(;F!=null;){let N=F.nodeName;if(N==="TD"||N==="TH"){if(F=F._cell,F===void 0)break;return F}F=F.parentNode}return null}function w(F){let N=[],H={cells:N,columns:0,rows:0};var ee=F.firstChild;let Y=F=0;for(N.length=0;ee!=null;){var G=ee.nodeName;if(G==="TD"||G==="TH")G={elem:ee,highlighted:!1,x:F,y:Y},ee._cell=G,N[Y]===void 0&&(N[Y]=[]),N[Y][F]=G;else if(G=ee.firstChild,G!=null){ee=G;continue}if(G=ee.nextSibling,G!=null)F++,ee=G;else if(G=ee.parentNode,G!=null){if(ee=G.nextSibling,ee==null)break;Y++,F=0}}return H.columns=F+1,H.rows=Y+1,H}function b(F,N){let H=[],ee=new Set(N?N.getNodes():[]);return v(F,(Y,G)=>{let J=Y.elem;ee.has(G)?(Y.highlighted=!0,J.style.setProperty("background-color","rgb(172, 206, 247)"),J.style.setProperty("caret-color","transparent"),H.push(Y)):(Y.highlighted=!1,J.style.removeProperty("background-color"),J.style.removeProperty("caret-color"),J.getAttribute("style")||J.removeAttribute("style"))}),H}function v(F,N){({cells:F}=F);for(let H=0;H<F.length;H++){let ee=F[H];for(let Y=0;Y<ee.length;Y++){let G=ee[Y],J=e.$getNearestNodeFromDOMNode(G.elem);J!==null&&N(G,J,{x:Y,y:H})}}}function A(F){F.disableHighlightStyle(),v(F.grid,N=>{let H=N.elem;N.highlighted=!0,H.style.setProperty("background-color","rgb(172, 206, 247)"),H.style.setProperty("caret-color","transparent")})}function S(F){F.enableHighlightStyle(),v(F.grid,N=>{let H=N.elem;N.highlighted=!1,H.style.removeProperty("background-color"),H.style.removeProperty("caret-color"),H.getAttribute("style")||H.removeAttribute("style")})}let E=(F,N,H,ee,Y)=>{const G=Y==="forward";switch(Y){case"backward":case"forward":return H!==(G?F.grid.columns-1:0)?M(N.getCellNodeFromCordsOrThrow(H+(G?1:-1),ee,F.grid)):ee!==(G?F.grid.rows-1:0)?M(N.getCellNodeFromCordsOrThrow(G?0:F.grid.columns-1,ee+(G?1:-1),F.grid)):G?N.selectNext():N.selectPrevious(),!0;case"up":return ee!==0?M(N.getCellNodeFromCordsOrThrow(H,ee-1,F.grid)):N.selectPrevious(),!0;case"down":return ee!==F.grid.rows-1?M(N.getCellNodeFromCordsOrThrow(H,ee+1,F.grid)):N.selectNext(),!0;default:return!1}},j=(F,N,H,ee,Y)=>{const G=Y==="forward";switch(Y){case"backward":case"forward":return H!==(G?F.grid.columns-1:0)&&F.setFocusCellForSelection(N.getCellFromCordsOrThrow(H+(G?1:-1),ee,F.grid)),!0;case"up":return ee!==0?(F.setFocusCellForSelection(N.getCellFromCordsOrThrow(H,ee-1,F.grid)),!0):!1;case"down":return ee!==F.grid.rows-1?(F.setFocusCellForSelection(N.getCellFromCordsOrThrow(H,ee+1,F.grid)),!0):!1;default:return!1}};function L(F,N){if(e.$isRangeSelection(F)||e.DEPRECATED_$isGridSelection(F)){let H=N.isParentOf(F.anchor.getNode());return F=N.isParentOf(F.focus.getNode()),H&&F}return!1}function M(F){let N=F.getChildren().find(H=>e.$isParagraphNode(H));e.$isParagraphNode(N)?N.selectEnd():F.selectEnd()}class D extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(N){return new D(N.__key)}static importDOM(){return{table:()=>({conversion:P,priority:1})}}static importJSON(){return T()}constructor(N){super(N)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(N){let H=document.createElement("table");return t.addClassNamesToElement(H,N.theme.table),H}updateDOM(){return!1}exportDOM(N){return{...super.exportDOM(N),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 J=0;J<H;J++){let X=document.createElement("col");Y.append(X)}return ee.replaceChildren(Y,G),ee}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(N,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:J})=>e.$getNearestNodeFromDOMNode(J)===N),G!==-1)return{x:G,y:H}}throw Error("Cell not found in table.")}getCellFromCords(N,H,ee){return{cells:ee}=ee,H=ee[H],H==null?null:(N=H[N],N??null)}getCellFromCordsOrThrow(N,H,ee){if(N=this.getCellFromCords(N,H,ee),!N)throw Error("Cell not found at cords.");return N}getCellNodeFromCords(N,H,ee){return N=this.getCellFromCords(N,H,ee),N==null?null:(N=e.$getNearestNodeFromDOMNode(N.elem),d(N)?N:null)}getCellNodeFromCordsOrThrow(N,H,ee){if(N=this.getCellNodeFromCords(N,H,ee),!N)throw Error("Node at cords not TableCellNode.");return N}canSelectBefore(){return!0}canIndent(){return!1}}function P(){return{node:T()}}function T(){return e.$applyNodeReplacement(new D)}function z(F){return F instanceof D}function R(F){if(F=t.$findMatchingParent(F,N=>h(N)),h(F))return F;throw Error("Expected table cell to be inside of table row.")}function K(F){if(F=t.$findMatchingParent(F,N=>z(N)),z(F))return F;throw Error("Expected table cell to be inside of table.")}function Z(F,N){let H=K(F),{x:ee,y:Y}=H.getCordsFromCellNode(F,N);return{above:H.getCellNodeFromCords(ee,Y-1,N),below:H.getCellNodeFromCords(ee,Y+1,N),left:H.getCellNodeFromCords(ee-1,Y,N),right:H.getCellNodeFromCords(ee+1,Y,N)}}function O(F){F=F.getFirstDescendant(),F===null&&m(124),F.getParentOrThrow().selectStart()}function Q(F,N){let H=F.getFirstChild();H!==null?H.insertBefore(N):F.append(N)}let _=e.createCommand("INSERT_TABLE_COMMAND");return ii.$createTableCellNode=l,ii.$createTableNode=T,ii.$createTableNodeWithDimensions=function(F,N,H=!0){let ee=T();for(let G=0;G<F;G++){let J=u();for(let X=0;X<N;X++){var Y=o.NO_STATUS;typeof H=="object"?(G===0&&H.rows&&(Y|=o.ROW),X===0&&H.columns&&(Y|=o.COLUMN)):H&&(G===0&&(Y|=o.ROW),X===0&&(Y|=o.COLUMN)),Y=l(Y);let ie=e.$createParagraphNode();ie.append(e.$createTextNode()),Y.append(ie),J.append(Y)}ee.append(J)}return ee},ii.$createTableRowNode=u,ii.$deleteTableColumn=function(F,N){let H=F.getChildren();for(let Y=0;Y<H.length;Y++){var ee=H[Y];if(h(ee)){if(ee=ee.getChildren(),N>=ee.length||0>N)throw Error("Table column target index out of range");ee[N].remove()}}return F},ii.$deleteTableColumn__EXPERIMENTAL=function(){var F=e.$getSelection();e.$isRangeSelection(F)||e.DEPRECATED_$isGridSelection(F)||m(118);var N=F.anchor.getNode();F=F.focus.getNode();let[H,,ee]=e.DEPRECATED_$getNodeTriplet(N);[N]=e.DEPRECATED_$getNodeTriplet(F);let[Y,G,J]=e.DEPRECATED_$computeGridMap(ee,H,N);var{startColumn:X}=G;let{startRow:ie,startColumn:we}=J;F=Math.min(X,we),X=Math.max(X+H.__colSpan-1,we+N.__colSpan-1);let me=X-F+1;if(Y[0].length===X-F+1)ee.selectPrevious(),ee.remove();else{var de=Y.length;for(let ce=0;ce<de;ce++)for(let fe=F;fe<=X;fe++){let{cell:Ae,startColumn:le}=Y[ce][fe];le<F?fe===F&&Ae.setColSpan(Ae.__colSpan-Math.min(me,Ae.__colSpan-(F-le))):le+Ae.__colSpan-1>X?fe===X&&Ae.setColSpan(Ae.__colSpan-(X-le+1)):Ae.remove()}F=Y[ie],N=F[we+N.__colSpan],N!==void 0?({cell:N}=N,O(N)):({cell:N}=F[we-1],O(N))}},ii.$deleteTableRow__EXPERIMENTAL=function(){var F=e.$getSelection();e.$isRangeSelection(F)||e.DEPRECATED_$isGridSelection(F)||m(118);var N=F.anchor.getNode();F=F.focus.getNode();let[H,,ee]=e.DEPRECATED_$getNodeTriplet(N);[F]=e.DEPRECATED_$getNodeTriplet(F);let[Y,G,J]=e.DEPRECATED_$computeGridMap(ee,H,F);({startRow:N}=G);var{startRow:X}=J;if(F=X+F.__rowSpan-1,Y.length===F-N+1)ee.remove();else{X=Y[0].length;var ie=Y[F+1],we=ee.getChildAtIndex(F+1);for(let de=F;de>=N;de--){for(var me=X-1;0<=me;me--){let{cell:ce,startRow:fe,startColumn:Ae}=Y[de][me];if(Ae===me&&(de===N&&fe<N&&ce.setRowSpan(ce.__rowSpan-(fe-N)),fe>=N&&fe+ce.__rowSpan-1>F))if(ce.setRowSpan(ce.__rowSpan-(F-fe+1)),we===null&&m(122),me===0)Q(we,ce);else{let{cell:le}=ie[me-1];le.insertAfter(ce)}}me=ee.getChildAtIndex(de),e.DEPRECATED_$isGridRowNode(me)||m(123),me.remove()}ie!==void 0?({cell:N}=ie[0],O(N)):({cell:N}=Y[N-1][0],O(N))}},ii.$getElementGridForTableNode=function(F,N){if(F=F.getElementByKey(N.getKey()),F==null)throw Error("Table Element Not Found");return w(F)},ii.$getTableCellNodeFromLexicalNode=function(F){return F=t.$findMatchingParent(F,N=>d(N)),d(F)?F:null},ii.$getTableColumnIndexFromTableCellNode=function(F){return R(F).getChildren().findIndex(N=>N.is(F))},ii.$getTableNodeFromLexicalNodeOrThrow=K,ii.$getTableRowIndexFromTableCellNode=function(F){let N=R(F);return K(N).getChildren().findIndex(H=>H.is(N))},ii.$getTableRowNodeFromTableCellNodeOrThrow=R,ii.$insertTableColumn=function(F,N,H=!0,ee,Y){let G=F.getChildren();for(let ie=0;ie<G.length;ie++){let we=G[ie];if(h(we))for(let me=0;me<ee;me++){var J=we.getChildren();if(N>=J.length||0>N)throw Error("Table column target index out of range");J=J[N],d(J)||m(12);let{left:de,right:ce}=Z(J,Y);var X=o.NO_STATUS;(de&&de.hasHeaderState(o.ROW)||ce&&ce.hasHeaderState(o.ROW))&&(X|=o.ROW),X=l(X),X.append(e.$createParagraphNode()),H?J.insertAfter(X):J.insertBefore(X)}}return F},ii.$insertTableColumn__EXPERIMENTAL=function(F=!0){function N(){let me=l(o.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,J]=e.DEPRECATED_$computeGridMap(Y,ee,ee);H=G.length;var{startColumn:X}=J;F=F?X+ee.__colSpan-1:X-1,X=Y.getFirstChild(),e.DEPRECATED_$isGridRowNode(X)||m(120);let ie=null;var we=X;e:for(X=0;X<H;X++){X!==0&&(we=we.getNextSibling(),e.DEPRECATED_$isGridRowNode(we)||m(121));let me=G[X];if(0>F){Q(we,N());continue}let{cell:de,startColumn:ce,startRow:fe}=me[F];if(ce+de.__colSpan-1<=F){let Ae=de,le=fe,pe=F;for(;le!==X&&1<Ae.__rowSpan;)if(pe-=de.__colSpan,0<=pe){let{cell:ae,startRow:be}=me[pe];Ae=ae,le=be}else{we.append(N());continue e}Ae.insertAfter(N())}else de.setColSpan(de.__colSpan+1)}ie!==null&&O(ie)},ii.$insertTableRow=function(F,N,H=!0,ee,Y){var G=F.getChildren();if(N>=G.length||0>N)throw Error("Table row target index out of range");if(N=G[N],h(N))for(G=0;G<ee;G++){let X=N.getChildren(),ie=X.length,we=u();for(let me=0;me<ie;me++){var J=X[me];d(J)||m(12);let{above:de,below:ce}=Z(J,Y);J=o.NO_STATUS;let fe=de&&de.getWidth()||ce&&ce.getWidth()||void 0;(de&&de.hasHeaderState(o.COLUMN)||ce&&ce.hasHeaderState(o.COLUMN))&&(J|=o.COLUMN),J=l(J,1,fe),J.append(e.$createParagraphNode()),we.append(J)}H?N.insertAfter(we):N.insertBefore(we)}else throw Error("Row before insertion index does not exist.");return F},ii.$insertTableRow__EXPERIMENTAL=function(F=!0){var N=e.$getSelection();e.$isRangeSelection(N)||e.DEPRECATED_$isGridSelection(N)||m(118),N=N.focus.getNode();let[H,,ee]=e.DEPRECATED_$getNodeTriplet(N),[Y,G]=e.DEPRECATED_$computeGridMap(ee,H,H);N=Y[0].length;var{startRow:J}=G;if(F){F=J+H.__rowSpan-1;var X=Y[F];J=u();for(var ie=0;ie<N;ie++){let{cell:we,startRow:me}=X[ie];me+we.__rowSpan-1<=F?J.append(l(o.NO_STATUS)):we.setRowSpan(we.__rowSpan+1)}N=ee.getChildAtIndex(F),e.DEPRECATED_$isGridRowNode(N)||m(119),N.insertAfter(J)}else{for(X=Y[J],F=u(),ie=0;ie<N;ie++){let{cell:we,startRow:me}=X[ie];me===J?F.append(l(o.NO_STATUS)):we.setRowSpan(we.__rowSpan+1)}N=ee.getChildAtIndex(J),e.DEPRECATED_$isGridRowNode(N)||m(119),N.insertBefore(F)}},ii.$isTableCellNode=d,ii.$isTableNode=z,ii.$isTableRowNode=h,ii.$removeTableRowAtIndex=function(F,N){let H=F.getChildren();if(N>=H.length||0>N)throw Error("Expected table cell to be inside of table row.");return H[N].remove(),F},ii.$unmergeCell=function(){var F=e.$getSelection();e.$isRangeSelection(F)||e.DEPRECATED_$isGridSelection(F)||m(118),F=F.anchor.getNode();let[N,H,ee]=e.DEPRECATED_$getNodeTriplet(F);F=N.__colSpan;let Y=N.__rowSpan;if(1<F){for(var G=1;G<F;G++)N.insertAfter(l(o.NO_STATUS));N.setColSpan(1)}if(1<Y){let[ie,we]=e.DEPRECATED_$computeGridMap(ee,N,N),{startColumn:me,startRow:de}=we;for(G=1;G<Y;G++){let ce=de+G,fe=ie[ce];var J=H.getNextSibling();e.DEPRECATED_$isGridRowNode(J)||m(125);var X=null;for(let Ae=0;Ae<me;Ae++){let le=fe[Ae],pe=le.cell;le.startRow===ce&&(X=pe),1<pe.__colSpan&&(Ae+=pe.__colSpan-1)}if(X===null)for(X=0;X<F;X++)Q(J,l(o.NO_STATUS));else for(J=0;J<F;J++)X.insertAfter(l(o.NO_STATUS))}N.setRowSpan(1)}},ii.INSERT_TABLE_COMMAND=_,ii.TableCellHeaderStates=o,ii.TableCellNode=i,ii.TableNode=D,ii.TableRowNode=c,ii.TableSelection=x,ii.applyTableHandlers=function(F,N,H){let ee=H.getRootElement();if(ee===null)throw Error("No root element.");let Y=new x(H,F.getKey());N.__lexicalTableSelection=Y;let G=!1,J=!1;N.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)}),N.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)}),N.addEventListener("mousemove",de=>{if(J&&(de.preventDefault(),de.stopPropagation(),de.stopImmediatePropagation()),G){let ce=y(de.target);if(ce!==null){let fe=ce.x,Ae=ce.y;G&&(Y.anchorX!==fe||Y.anchorY!==Ae||Y.isHighlightingCells)&&(de.preventDefault(),Y.setFocusCellForSelection(ce))}}}),N.addEventListener("mouseleave",()=>{});let X=de=>{de.button===0&&H.update(()=>{var ce=e.$getSelection();const fe=de.target;if(fe instanceof Node){if(e.DEPRECATED_$isGridSelection(ce)&&ce.gridKey===Y.tableNodeKey&&ee.contains(fe))return Y.clearHighlight();ce=e.$getNearestNodeFromDOMNode(fe),ce!==null&&t.$findMatchingParent(ce,e.DEPRECATED_$isGridNode)&&(G=!0)}})};window.addEventListener("mousedown",X),Y.listenersToRemove.add(()=>window.removeEventListener("mousedown",X));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)),N.addEventListener("mouseup",ie),Y.listenersToRemove.add(()=>N.removeEventListener("mouseup",ie)),Y.listenersToRemove.add(H.registerCommand(e.KEY_ARROW_DOWN_COMMAND,de=>{var ce=e.$getSelection();if(!L(ce,F))return!1;if(e.$isRangeSelection(ce)){if(ce.isCollapsed()){var fe=t.$findMatchingParent(ce.anchor.getNode(),le=>d(le));if(!d(fe))return!1;var Ae=F.getCordsFromCellNode(fe,Y.grid);if(ce=t.$findMatchingParent(ce.anchor.getNode(),le=>e.$isElementNode(le)),ce==null)throw Error("Expected BlockNode Parent");if((fe=fe.getLastChild())&&ce.isParentOf(fe)||ce===fe||de.shiftKey)return de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),de.shiftKey?(Y.setAnchorCellForSelection(F.getCellFromCordsOrThrow(Ae.x,Ae.y,Y.grid)),j(Y,F,Ae.x,Ae.y,"down")):E(Y,F,Ae.x,Ae.y,"down")}}else if(e.DEPRECATED_$isGridSelection(ce)&&de.shiftKey)return Ae=ce.focus.getNode(),d(Ae)?(Ae=F.getCordsFromCellNode(Ae,Y.grid),de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),j(Y,F,Ae.x,Ae.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,F))return!1;if(e.$isRangeSelection(ce)){if(ce.isCollapsed()){var fe=t.$findMatchingParent(ce.anchor.getNode(),le=>d(le));if(!d(fe))return!1;var Ae=F.getCordsFromCellNode(fe,Y.grid);if(ce=t.$findMatchingParent(ce.anchor.getNode(),le=>e.$isElementNode(le)),ce==null)throw Error("Expected BlockNode Parent");if((fe=fe.getLastChild())&&ce.isParentOf(fe)||ce===fe||de.shiftKey)return de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),de.shiftKey?(Y.setAnchorCellForSelection(F.getCellFromCordsOrThrow(Ae.x,Ae.y,Y.grid)),j(Y,F,Ae.x,Ae.y,"up")):E(Y,F,Ae.x,Ae.y,"up")}}else if(e.DEPRECATED_$isGridSelection(ce)&&de.shiftKey)return Ae=ce.focus.getNode(),d(Ae)?(Ae=F.getCordsFromCellNode(Ae,Y.grid),de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),j(Y,F,Ae.x,Ae.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,F))return!1;if(e.$isRangeSelection(ce)){if(ce.isCollapsed()){var fe=t.$findMatchingParent(ce.anchor.getNode(),Ae=>d(Ae));if(!d(fe))return!1;if(fe=F.getCordsFromCellNode(fe,Y.grid),t.$findMatchingParent(ce.anchor.getNode(),Ae=>e.$isElementNode(Ae))==null)throw Error("Expected BlockNode Parent");if(ce.anchor.offset===0||de.shiftKey)return de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),de.shiftKey?(Y.setAnchorCellForSelection(F.getCellFromCordsOrThrow(fe.x,fe.y,Y.grid)),j(Y,F,fe.x,fe.y,"backward")):E(Y,F,fe.x,fe.y,"backward")}}else if(e.DEPRECATED_$isGridSelection(ce)&&de.shiftKey)return ce=ce.focus.getNode(),d(ce)?(ce=F.getCordsFromCellNode(ce,Y.grid),de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),j(Y,F,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,F))return!1;if(e.$isRangeSelection(ce)){if(ce.isCollapsed()){var fe=t.$findMatchingParent(ce.anchor.getNode(),Ae=>d(Ae));if(!d(fe))return!1;if(fe=F.getCordsFromCellNode(fe,Y.grid),t.$findMatchingParent(ce.anchor.getNode(),Ae=>e.$isElementNode(Ae))==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(F.getCellFromCordsOrThrow(fe.x,fe.y,Y.grid)),j(Y,F,fe.x,fe.y,"forward")):E(Y,F,fe.x,fe.y,"forward")}}else if(e.DEPRECATED_$isGridSelection(ce)&&de.shiftKey)return ce=ce.focus.getNode(),d(ce)?(ce=F.getCordsFromCellNode(ce,Y.grid),de.preventDefault(),de.stopImmediatePropagation(),de.stopPropagation(),j(Y,F,ce.x,ce.y,"forward")):!1;return!1},e.COMMAND_PRIORITY_HIGH));let we=de=>()=>{var ce=e.$getSelection();if(!L(ce,F))return!1;if(e.DEPRECATED_$isGridSelection(ce))return Y.clearText(),!0;if(e.$isRangeSelection(ce)){const le=t.$findMatchingParent(ce.anchor.getNode(),pe=>d(pe));if(!d(le))return!1;var fe=ce.anchor.getNode(),Ae=ce.focus.getNode();if(fe=F.isParentOf(fe),Ae=F.isParentOf(Ae),fe&&!Ae||Ae&&!fe)return Y.clearText(),!0;if(fe=(Ae=t.$findMatchingParent(ce.anchor.getNode(),pe=>e.$isElementNode(pe)))&&t.$findMatchingParent(Ae,pe=>e.$isElementNode(pe)&&d(pe.getParent())),!e.$isElementNode(fe)||!e.$isElementNode(Ae))return!1;if(de===e.DELETE_LINE_COMMAND&&fe.getPreviousSibling()===null)return!0;if((de===e.DELETE_CHARACTER_COMMAND||de===e.DELETE_WORD_COMMAND)&&ce.isCollapsed()&&ce.anchor.offset===0&&Ae!==fe){ce=Ae.getChildren();const pe=e.$createParagraphNode();return ce.forEach(ae=>pe.append(ae)),Ae.replace(pe),Ae.getWritable().__parent=le.getKey(),!0}}return!1};[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(de=>{Y.listenersToRemove.add(H.registerCommand(de,we(de),e.COMMAND_PRIORITY_CRITICAL))});let me=de=>{const ce=e.$getSelection();return L(ce,F)?e.DEPRECATED_$isGridSelection(ce)?(de.preventDefault(),de.stopPropagation(),Y.clearText(),!0):(e.$isRangeSelection(ce)&&(de=t.$findMatchingParent(ce.anchor.getNode(),fe=>d(fe)),d(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,F)?e.DEPRECATED_$isGridSelection(ce)?(Y.formatCells(de),!0):(e.$isRangeSelection(ce)&&(de=t.$findMatchingParent(ce.anchor.getNode(),fe=>d(fe)),d(de)),!1):!1},e.COMMAND_PRIORITY_CRITICAL)),Y.listenersToRemove.add(H.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var de=e.$getSelection();return L(de,F)&&(e.DEPRECATED_$isGridSelection(de)?Y.clearHighlight():e.$isRangeSelection(de)&&(de=t.$findMatchingParent(de.anchor.getNode(),ce=>d(ce)),d(de))),!1},e.COMMAND_PRIORITY_CRITICAL)),Y.listenersToRemove.add(H.registerCommand(e.KEY_TAB_COMMAND,de=>{var ce=e.$getSelection();if(!L(ce,F))return!1;if(e.$isRangeSelection(ce)){let fe=t.$findMatchingParent(ce.anchor.getNode(),Ae=>d(Ae));if(!d(fe))return!1;if(ce.isCollapsed())return ce=F.getCordsFromCellNode(fe,Y.grid),de.preventDefault(),E(Y,F,ce.x,ce.y,de.shiftKey?"backward":"forward"),!0}return!1},e.COMMAND_PRIORITY_HIGH)),Y.listenersToRemove.add(H.registerCommand(e.FOCUS_COMMAND,()=>F.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 fe=de.anchor.getNode(),Ae=de.focus.getNode();fe=F.isParentOf(fe);var le=F.isParentOf(Ae);if(Ae=fe&&!le||le&&!fe,fe=fe&&le&&!F.isSelected(),Ae)return ce=de.isBackward(),fe=e.$createRangeSelection(),Ae=F.getKey(),fe.anchor.set(de.anchor.key,de.anchor.offset,de.anchor.type),fe.focus.set(Ae,ce?0:F.getChildrenSize(),"element"),J=!0,e.$setSelection(fe),A(Y),!0;if(fe&&({grid:fe}=Y,de.getNodes().filter(d).length===fe.rows*fe.columns)){fe=e.DEPRECATED_$createGridSelection(),Ae=F.getKey(),le=F.getFirstChildOrThrow().getFirstChild();let pe=F.getLastChildOrThrow().getLastChild();if(le!=null&&pe!=null)return fe.set(Ae,le.getKey(),pe.getKey()),e.$setSelection(fe),Y.updateTableGridSelection(fe),!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&&!F.isSelected()?(S(Y),J=!1):!Y.hasHijackedSelectionStyles&&F.isSelected()&&A(Y),!1)},e.COMMAND_PRIORITY_CRITICAL)),Y},ii.getCellFromTarget=y,ii.getTableSelectionFromTableElement=function(F){return F.__lexicalTableSelection},ii}var cO,rpe;function tLt(){return rpe||(rpe=1,cO=eLt()),cO}var pO=tLt(),mC={},ipe;function oLt(){if(ipe)return mC;ipe=1;var e=KL(),t=Xd(),o=yd(),i=fa(),a=fd();function l(f,x){for(let y=0;y<x.length;y++){let w=x[y](f);if(w)return w}return null}let d=/[.,;\s]/;function c(f){f=f.getPreviousSibling(),i.$isElementNode(f)&&(f=f.getLastDescendant());var x;return!(x=f===null||i.$isLineBreakNode(f))&&(x=i.$isTextNode(f))&&(f=f.getTextContent(),x=d.test(f[f.length-1])),x}function p(f){return f=f.getNextSibling(),i.$isElementNode(f)&&(f=f.getFirstDescendant()),f===null||i.$isLineBreakNode(f)||i.$isTextNode(f)&&d.test(f.getTextContent()[0])}function u(f,x,y){var w=f.getChildren();let b=w.length;for(let v=0;v<b;v++){let A=w[v];if(!i.$isTextNode(A)||!A.isSimpleText()){h(f),y(null,f.getURL());return}}w=f.getTextContent(),x=l(w,x),x===null||x.text!==w?(h(f),y(null,f.getURL())):c(f)&&p(f)?(w=f.getURL(),w!==x.url&&(f.setURL(x.url),y(x.url,w)),x.attributes&&(w=f.getRel(),w!==x.attributes.rel&&(f.setRel(x.attributes.rel||null),y(x.attributes.rel||null,w)),w=f.getTarget(),w!==x.attributes.target&&(f.setTarget(x.attributes.target||null),y(x.attributes.target||null,w)))):(h(f),y(null,f.getURL()))}function h(f){let x=f.getChildren();var y=x.length;for(--y;0<=y;y--)f.insertAfter(x[y]);return f.remove(),x.map(w=>w.getLatest())}function m(f,x,y){a.useEffect(()=>{if(!f.hasNodes([e.AutoLinkNode]))throw Error("Minified Lexical error #77; visit https://lexical.dev/docs/error?code=77 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");let w=(b,v)=>{y&&y(b,v)};return o.mergeRegister(f.registerNodeTransform(i.TextNode,b=>{var v=b.getParentOrThrow(),A=b.getPreviousSibling();if(e.$isAutoLinkNode(v))u(v,x,w);else if(!e.$isLinkNode(v)){if(b.isSimpleText()&&(d.test(b.getTextContent()[0])||!e.$isAutoLinkNode(A))){A=v=b.getTextContent();let P=0,T=b;for(var S;(S=l(A,x))&&S!==null;){let z=S.index,R=S.length,K=z+R;var E=P+z,j=P+K,L=v,M=b;if((0<E?d.test(L[E-1]):c(M))&&(j<L.length?d.test(L[j]):p(M))){var D=void 0;P+z===0?[D,T]=T.splitText(P+R):[,D,T]=T.splitText(P+z,P+z+R),E=e.$createAutoLinkNode(S.url,S.attributes),j=i.$createTextNode(S.text),j.setFormat(D.getFormat()),j.setDetail(D.getDetail()),E.append(j),D.replace(E),y&&y(S.url,null),P=0}else P+=K;A=A.substring(K)}}v=b.getPreviousSibling(),S=b.getNextSibling(),D=b.getTextContent(),e.$isAutoLinkNode(v)&&!d.test(D[0])&&(v.append(b),u(v,x,w),b=v.getURL(),y&&y(null,b)),e.$isAutoLinkNode(S)&&!d.test(D[D.length-1])&&(h(S),u(S,x,w),b=S.getURL(),y&&y(null,b))}}))},[f,x,y])}return mC.AutoLinkPlugin=function({matchers:f,onChange:x}){let[y]=t.useLexicalComposerContext();return m(y,f,x),null},mC.createLinkMatcherWithRegExp=function(f,x=y=>y){return y=>{let w=f.exec(y);return w===null?null:{index:w.index,length:w[0].length,text:w[0],url:x(y)}}},mC}var uO,npe;function rLt(){return npe||(npe=1,uO=oLt()),uO}var iLt=rLt(),yy={};yy.d=(e,t)=>{for(var o in t)yy.o(t,o)&&!yy.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})};yy.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Zo=globalThis.pdfjsLib={};yy.d(Zo,{AbortException:()=>J4,AnnotationEditorLayer:()=>W2,AnnotationEditorParamsType:()=>rr,AnnotationEditorType:()=>qr,AnnotationEditorUIManager:()=>$m,AnnotationLayer:()=>ojt,AnnotationMode:()=>Oh,CMapCompressionType:()=>XV,ColorPicker:()=>uu,DOMSVGFactory:()=>PY,DrawLayer:()=>Hs,FeatureTest:()=>od,GlobalWorkerOptions:()=>lw,ImageKind:()=>R$,InvalidPDFException:()=>IEe,MissingPDFException:()=>Z4,OPS:()=>E1,Outliner:()=>sQ,PDFDataRangeTransport:()=>WEe,PDFDateString:()=>TEe,PDFWorker:()=>kc,PasswordResponses:()=>lLt,PermissionFlag:()=>sLt,PixelsPerInch:()=>u6,RenderingCancelledException:()=>TY,TextLayer:()=>dS,UnexpectedResponseException:()=>XL,Util:()=>$o,VerbosityLevel:()=>qL,XfaLayer:()=>YEe,build:()=>zIt,createValidAbsoluteUrl:()=>uLt,fetchData:()=>nI,getDocument:()=>EIt,getFilenameFromUrl:()=>CLt,getPdfFilenameFromUrl:()=>ALt,getXfaPageViewport:()=>$Lt,isDataScheme:()=>zY,isPdfFile:()=>RY,noContextMenu:()=>ld,normalizeUnicode:()=>yLt,renderTextLayer:()=>yIt,setLayerDimensions:()=>j4,shadow:()=>ni,updateTextLayer:()=>wIt,version:()=>TIt});const Ks=typeof G2=="object"&&G2+""=="[object process]"&&!G2.versions.nw&&!(G2.versions.electron&&G2.type&&G2.type!=="browser"),LEe=[1,0,0,1,0,0],JV=[.001,0,0,.001,0,0],nLt=1e7,hO=1.35,vc={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},Oh={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},aLt="pdfjs_internal_editor_",qr={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},rr={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},sLt={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Ns={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},R$={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Aa={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},M9={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},qL={ERRORS:0,WARNINGS:1,INFOS:5},XV={NONE:0,BINARY:1},E1={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},lLt={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let ZL=qL.WARNINGS;function dLt(e){Number.isInteger(e)&&(ZL=e)}function cLt(){return ZL}function JL(e){ZL>=qL.INFOS&&console.log(`Info: ${e}`)}function Ir(e){ZL>=qL.WARNINGS&&console.log(`Warning: ${e}`)}function Pi(e){throw new Error(e)}function Ea(e,t){e||Pi(t)}function pLt(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function uLt(e,t=null,o=null){if(!e)return null;try{if(o&&typeof e=="string"&&(o.addDefaultProtocol&&e.startsWith("www.")&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),o.tryConvertEncoding))try{e=xLt(e)}catch{}const i=t?new URL(e,t):new URL(e);if(pLt(i))return i}catch{}return null}function ni(e,t,o,i=!1){return Object.defineProperty(e,t,{value:o,enumerable:!i,configurable:!0,writable:!1}),o}const Om=function(){function t(o,i){this.constructor===t&&Pi("Cannot initialize BaseException."),this.message=o,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class eQ extends Om{constructor(t,o){super(t,"PasswordException"),this.code=o}}class tQ extends Om{constructor(t,o){super(t,"UnknownErrorException"),this.details=o}}class IEe extends Om{constructor(t){super(t,"InvalidPDFException")}}class Z4 extends Om{constructor(t){super(t,"MissingPDFException")}}class XL extends Om{constructor(t,o){super(t,"UnexpectedResponseException"),this.status=o}}class hLt extends Om{constructor(t){super(t,"FormatError")}}class J4 extends Om{constructor(t){super(t,"AbortException")}}function jEe(e){(typeof e!="object"||e?.length===void 0)&&Pi("Invalid argument for bytesToString");const t=e.length,o=8192;if(t<o)return String.fromCharCode.apply(null,e);const i=[];for(let a=0;a<t;a+=o){const l=Math.min(a+o,t),d=e.subarray(a,l);i.push(String.fromCharCode.apply(null,d))}return i.join("")}function eI(e){typeof e!="string"&&Pi("Invalid argument for stringToBytes");const t=e.length,o=new Uint8Array(t);for(let i=0;i<t;++i)o[i]=e.charCodeAt(i)&255;return o}function mLt(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function BY(e){const t=Object.create(null);for(const[o,i]of e)t[o]=i;return t}function gLt(){const e=new Uint8Array(4);return e[0]=1,new Uint32Array(e.buffer,0,1)[0]===1}function fLt(){try{return new Function(""),!0}catch{return!1}}class od{static get isLittleEndian(){return ni(this,"isLittleEndian",gLt())}static get isEvalSupported(){return ni(this,"isEvalSupported",fLt())}static get isOffscreenCanvasSupported(){return ni(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&typeof navigator?.platform=="string"?ni(this,"platform",{isMac:navigator.platform.includes("Mac")}):ni(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){return ni(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const mO=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0"));class $o{static makeHexColor(t,o,i){return`#${mO[t]}${mO[o]}${mO[i]}`}static scaleMinMax(t,o){let i;t[0]?(t[0]<0&&(i=o[0],o[0]=o[2],o[2]=i),o[0]*=t[0],o[2]*=t[0],t[3]<0&&(i=o[1],o[1]=o[3],o[3]=i),o[1]*=t[3],o[3]*=t[3]):(i=o[0],o[0]=o[1],o[1]=i,i=o[2],o[2]=o[3],o[3]=i,t[1]<0&&(i=o[1],o[1]=o[3],o[3]=i),o[1]*=t[1],o[3]*=t[1],t[2]<0&&(i=o[0],o[0]=o[2],o[2]=i),o[0]*=t[2],o[2]*=t[2]),o[0]+=t[4],o[1]+=t[5],o[2]+=t[4],o[3]+=t[5]}static transform(t,o){return[t[0]*o[0]+t[2]*o[1],t[1]*o[0]+t[3]*o[1],t[0]*o[2]+t[2]*o[3],t[1]*o[2]+t[3]*o[3],t[0]*o[4]+t[2]*o[5]+t[4],t[1]*o[4]+t[3]*o[5]+t[5]]}static applyTransform(t,o){const i=t[0]*o[0]+t[1]*o[2]+o[4],a=t[0]*o[1]+t[1]*o[3]+o[5];return[i,a]}static applyInverseTransform(t,o){const i=o[0]*o[3]-o[1]*o[2],a=(t[0]*o[3]-t[1]*o[2]+o[2]*o[5]-o[4]*o[3])/i,l=(-t[0]*o[1]+t[1]*o[0]+o[4]*o[1]-o[5]*o[0])/i;return[a,l]}static getAxialAlignedBoundingBox(t,o){const i=this.applyTransform(t,o),a=this.applyTransform(t.slice(2,4),o),l=this.applyTransform([t[0],t[3]],o),d=this.applyTransform([t[2],t[1]],o);return[Math.min(i[0],a[0],l[0],d[0]),Math.min(i[1],a[1],l[1],d[1]),Math.max(i[0],a[0],l[0],d[0]),Math.max(i[1],a[1],l[1],d[1])]}static inverseTransform(t){const o=t[0]*t[3]-t[1]*t[2];return[t[3]/o,-t[1]/o,-t[2]/o,t[0]/o,(t[2]*t[5]-t[4]*t[3])/o,(t[4]*t[1]-t[5]*t[0])/o]}static singularValueDecompose2dScale(t){const o=[t[0],t[2],t[1],t[3]],i=t[0]*o[0]+t[1]*o[2],a=t[0]*o[1]+t[1]*o[3],l=t[2]*o[0]+t[3]*o[2],d=t[2]*o[1]+t[3]*o[3],c=(i+d)/2,p=Math.sqrt((i+d)**2-4*(i*d-l*a))/2,u=c+p||1,h=c-p||1;return[Math.sqrt(u),Math.sqrt(h)]}static normalizeRect(t){const o=t.slice(0);return t[0]>t[2]&&(o[0]=t[2],o[2]=t[0]),t[1]>t[3]&&(o[1]=t[3],o[3]=t[1]),o}static intersect(t,o){const i=Math.max(Math.min(t[0],t[2]),Math.min(o[0],o[2])),a=Math.min(Math.max(t[0],t[2]),Math.max(o[0],o[2]));if(i>a)return null;const l=Math.max(Math.min(t[1],t[3]),Math.min(o[1],o[3])),d=Math.min(Math.max(t[1],t[3]),Math.max(o[1],o[3]));return l>d?null:[i,l,a,d]}static#e(t,o,i,a,l,d,c,p,u,h){if(u<=0||u>=1)return;const m=1-u,f=u*u,x=f*u,y=m*(m*(m*t+3*u*o)+3*f*i)+x*a,w=m*(m*(m*l+3*u*d)+3*f*c)+x*p;h[0]=Math.min(h[0],y),h[1]=Math.min(h[1],w),h[2]=Math.max(h[2],y),h[3]=Math.max(h[3],w)}static#t(t,o,i,a,l,d,c,p,u,h,m,f){if(Math.abs(u)<1e-12){Math.abs(h)>=1e-12&&this.#e(t,o,i,a,l,d,c,p,-m/h,f);return}const x=h**2-4*m*u;if(x<0)return;const y=Math.sqrt(x),w=2*u;this.#e(t,o,i,a,l,d,c,p,(-h+y)/w,f),this.#e(t,o,i,a,l,d,c,p,(-h-y)/w,f)}static bezierBoundingBox(t,o,i,a,l,d,c,p,u){return u?(u[0]=Math.min(u[0],t,c),u[1]=Math.min(u[1],o,p),u[2]=Math.max(u[2],t,c),u[3]=Math.max(u[3],o,p)):u=[Math.min(t,c),Math.min(o,p),Math.max(t,c),Math.max(o,p)],this.#t(t,i,l,c,o,a,d,p,3*(-t+3*(i-l)+c),6*(t-2*i+l),3*(i-t),u),this.#t(t,i,l,c,o,a,d,p,3*(-o+3*(a-d)+p),6*(o-2*a+d),3*(a-o),u),u}}function xLt(e){return decodeURIComponent(escape(e))}let gO=null,ape=null;function yLt(e){return gO||(gO=/([\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,ape=new Map([["ſt","ſt"]])),e.replaceAll(gO,(t,o,i)=>o?o.normalize("NFKC"):ape.get(i))}function wLt(){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 jEe(e)}const MEe="pdfjs_internal_id_",T2={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 tI{constructor(){this.constructor===tI&&Pi("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,o){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,o,i,a,l){return"none"}destroy(t=!1){}}class oI{#e=!1;constructor({enableHWA:t=!1}={}){this.constructor===oI&&Pi("Cannot initialize BaseCanvasFactory."),this.#e=t}create(t,o){if(t<=0||o<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,o);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!this.#e})}}reset(t,o,i){if(!t.canvas)throw new Error("Canvas is not specified");if(o<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=o,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,o){Pi("Abstract method `_createCanvas` called.")}}class rI{constructor({baseUrl:t=null,isCompressed:o=!0}){this.constructor===rI&&Pi("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=o}async fetch({name:t}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const o=this.baseUrl+t+(this.isCompressed?".bcmap":""),i=this.isCompressed?XV.BINARY:XV.NONE;return this._fetchData(o,i).catch(a=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${o}`)})}_fetchData(t,o){Pi("Abstract method `_fetchData` called.")}}class iI{constructor({baseUrl:t=null}){this.constructor===iI&&Pi("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const o=`${this.baseUrl}${t}`;return this._fetchData(o).catch(i=>{throw new Error(`Unable to load font data at: ${o}`)})}_fetchData(t){Pi("Abstract method `_fetchData` called.")}}class DY{constructor(){this.constructor===DY&&Pi("Cannot initialize BaseSVGFactory.")}create(t,o,i=!1){if(t<=0||o<=0)throw new Error("Invalid SVG dimensions");const a=this._createSVG("svg:svg");return a.setAttribute("version","1.1"),i||(a.setAttribute("width",`${t}px`),a.setAttribute("height",`${o}px`)),a.setAttribute("preserveAspectRatio","none"),a.setAttribute("viewBox",`0 0 ${t} ${o}`),a}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Pi("Abstract method `_createSVG` called.")}}const _2="http://www.w3.org/2000/svg";class u6{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}class bLt extends tI{#e;#t;#o;#i;#s;#r=0;constructor({docId:t,ownerDocument:o=globalThis.document}={}){super(),this.#o=t,this.#i=o}get#n(){return this.#e||=new Map}get#l(){return this.#s||=new Map}get#c(){if(!this.#t){const t=this.#i.createElement("div"),{style:o}=t;o.visibility="hidden",o.contain="strict",o.width=o.height=0,o.position="absolute",o.top=o.left=0,o.zIndex=-1;const i=this.#i.createElementNS(_2,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#t=this.#i.createElementNS(_2,"defs"),t.append(i),i.append(this.#t),this.#i.body.append(t)}return this.#t}#p(t){if(t.length===1){const p=t[0],u=new Array(256);for(let m=0;m<256;m++)u[m]=p[m]/255;const h=u.join(",");return[h,h,h]}const[o,i,a]=t,l=new Array(256),d=new Array(256),c=new Array(256);for(let p=0;p<256;p++)l[p]=o[p]/255,d[p]=i[p]/255,c[p]=a[p]/255;return[l.join(","),d.join(","),c.join(",")]}addFilter(t){if(!t)return"none";let o=this.#n.get(t);if(o)return o;const[i,a,l]=this.#p(t),d=t.length===1?i:`${i}${a}${l}`;if(o=this.#n.get(d),o)return this.#n.set(t,o),o;const c=`g_${this.#o}_transfer_map_${this.#r++}`,p=`url(#${c})`;this.#n.set(t,p),this.#n.set(d,p);const u=this.#a(c);return this.#f(i,a,l,u),p}addHCMFilter(t,o){const i=`${t}-${o}`,a="base";let l=this.#l.get(a);if(l?.key===i||(l?(l.filter?.remove(),l.key=i,l.url="none",l.filter=null):(l={key:i,url:"none",filter:null},this.#l.set(a,l)),!t||!o))return l.url;const d=this.#y(t);t=$o.makeHexColor(...d);const c=this.#y(o);if(o=$o.makeHexColor(...c),this.#c.style.color="",t==="#000000"&&o==="#ffffff"||t===o)return l.url;const p=new Array(256);for(let x=0;x<=255;x++){const y=x/255;p[x]=y<=.03928?y/12.92:((y+.055)/1.055)**2.4}const u=p.join(","),h=`g_${this.#o}_hcm_filter`,m=l.filter=this.#a(h);this.#f(u,u,u,m),this.#d(m);const f=(x,y)=>{const w=d[x]/255,b=c[x]/255,v=new Array(y+1);for(let A=0;A<=y;A++)v[A]=w+A/y*(b-w);return v.join(",")};return this.#f(f(0,5),f(1,5),f(2,5),m),l.url=`url(#${h})`,l.url}addAlphaFilter(t){let o=this.#n.get(t);if(o)return o;const[i]=this.#p([t]),a=`alpha_${i}`;if(o=this.#n.get(a),o)return this.#n.set(t,o),o;const l=`g_${this.#o}_alpha_map_${this.#r++}`,d=`url(#${l})`;this.#n.set(t,d),this.#n.set(a,d);const c=this.#a(l);return this.#u(i,c),d}addLuminosityFilter(t){let o=this.#n.get(t||"luminosity");if(o)return o;let i,a;if(t?([i]=this.#p([t]),a=`luminosity_${i}`):a="luminosity",o=this.#n.get(a),o)return this.#n.set(t,o),o;const l=`g_${this.#o}_luminosity_map_${this.#r++}`,d=`url(#${l})`;this.#n.set(t,d),this.#n.set(a,d);const c=this.#a(l);return this.#h(c),t&&this.#u(i,c),d}addHighlightHCMFilter(t,o,i,a,l){const d=`${o}-${i}-${a}-${l}`;let c=this.#l.get(t);if(c?.key===d||(c?(c.filter?.remove(),c.key=d,c.url="none",c.filter=null):(c={key:d,url:"none",filter:null},this.#l.set(t,c)),!o||!i))return c.url;const[p,u]=[o,i].map(this.#y.bind(this));let h=Math.round(.2126*p[0]+.7152*p[1]+.0722*p[2]),m=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),[f,x]=[a,l].map(this.#y.bind(this));m<h&&([h,m,f,x]=[m,h,x,f]),this.#c.style.color="";const y=(v,A,S)=>{const E=new Array(256),j=(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*j),z=L+P*M;for(let R=D;R<=T;R++)E[R]=z;D=T+1}for(let P=D;P<256;P++)E[P]=E[D-1];return E.join(",")},w=`g_${this.#o}_hcm_${t}_filter`,b=c.filter=this.#a(w);return this.#d(b),this.#f(y(f[0],x[0],5),y(f[1],x[1],5),y(f[2],x[2],5),b),c.url=`url(#${w})`,c.url}destroy(t=!1){t&&this.#l.size!==0||(this.#t&&(this.#t.parentNode.parentNode.remove(),this.#t=null),this.#e&&(this.#e.clear(),this.#e=null),this.#r=0)}#h(t){const o=this.#i.createElementNS(_2,"feColorMatrix");o.setAttribute("type","matrix"),o.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(o)}#d(t){const o=this.#i.createElementNS(_2,"feColorMatrix");o.setAttribute("type","matrix"),o.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(o)}#a(t){const o=this.#i.createElementNS(_2,"filter");return o.setAttribute("color-interpolation-filters","sRGB"),o.setAttribute("id",t),this.#c.append(o),o}#m(t,o,i){const a=this.#i.createElementNS(_2,o);a.setAttribute("type","discrete"),a.setAttribute("tableValues",i),t.append(a)}#f(t,o,i,a){const l=this.#i.createElementNS(_2,"feComponentTransfer");a.append(l),this.#m(l,"feFuncR",t),this.#m(l,"feFuncG",o),this.#m(l,"feFuncB",i)}#u(t,o){const i=this.#i.createElementNS(_2,"feComponentTransfer");o.append(i),this.#m(i,"feFuncA",t)}#y(t){return this.#c.style.color=t,FY(getComputedStyle(this.#c).getPropertyValue("color"))}}class vLt extends oI{constructor({ownerDocument:t=globalThis.document,enableHWA:o=!1}={}){super({enableHWA:o}),this._document=t}_createCanvas(t,o){const i=this._document.createElement("canvas");return i.width=t,i.height=o,i}}async function nI(e,t="text"){if(Tx(e,document.baseURI)){const o=await fetch(e);if(!o.ok)throw new Error(o.statusText);switch(t){case"arraybuffer":return o.arrayBuffer();case"blob":return o.blob();case"json":return o.json()}return o.text()}return new Promise((o,i)=>{const a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType=t,a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE){if(a.status===200||a.status===0){switch(t){case"arraybuffer":case"blob":case"json":o(a.response);return}o(a.responseText);return}i(new Error(a.statusText))}},a.send(null)})}class BEe extends rI{_fetchData(t,o){return nI(t,this.isCompressed?"arraybuffer":"text").then(i=>({cMapData:i instanceof ArrayBuffer?new Uint8Array(i):eI(i),compressionType:o}))}}class DEe extends iI{_fetchData(t){return nI(t,"arraybuffer").then(o=>new Uint8Array(o))}}class PY extends DY{_createSVG(t){return document.createElementNS(_2,t)}}class mb{constructor({viewBox:t,scale:o,rotation:i,offsetX:a=0,offsetY:l=0,dontFlip:d=!1}){this.viewBox=t,this.scale=o,this.rotation=i,this.offsetX=a,this.offsetY=l;const c=(t[2]+t[0])/2,p=(t[3]+t[1])/2;let u,h,m,f;switch(i%=360,i<0&&(i+=360),i){case 180:u=-1,h=0,m=0,f=1;break;case 90:u=0,h=1,m=1,f=0;break;case 270:u=0,h=-1,m=-1,f=0;break;case 0:u=1,h=0,m=0,f=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}d&&(m=-m,f=-f);let x,y,w,b;u===0?(x=Math.abs(p-t[1])*o+a,y=Math.abs(c-t[0])*o+l,w=(t[3]-t[1])*o,b=(t[2]-t[0])*o):(x=Math.abs(c-t[0])*o+a,y=Math.abs(p-t[1])*o+l,w=(t[2]-t[0])*o,b=(t[3]-t[1])*o),this.transform=[u*o,h*o,m*o,f*o,x-u*o*c-m*o*p,y-h*o*c-f*o*p],this.width=w,this.height=b}get rawDims(){const{viewBox:t}=this;return ni(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:o=this.rotation,offsetX:i=this.offsetX,offsetY:a=this.offsetY,dontFlip:l=!1}={}){return new mb({viewBox:this.viewBox.slice(),scale:t,rotation:o,offsetX:i,offsetY:a,dontFlip:l})}convertToViewportPoint(t,o){return $o.applyTransform([t,o],this.transform)}convertToViewportRectangle(t){const o=$o.applyTransform([t[0],t[1]],this.transform),i=$o.applyTransform([t[2],t[3]],this.transform);return[o[0],o[1],i[0],i[1]]}convertToPdfPoint(t,o){return $o.applyInverseTransform([t,o],this.transform)}}class TY extends Om{constructor(t,o=0){super(t,"RenderingCancelledException"),this.extraDelay=o}}function zY(e){const t=e.length;let o=0;for(;o<t&&e[o].trim()==="";)o++;return e.substring(o,o+5).toLowerCase()==="data:"}function RY(e){return typeof e=="string"&&/\.pdf$/i.test(e)}function CLt(e){return[e]=e.split(/[#?]/,1),e.substring(e.lastIndexOf("/")+1)}function ALt(e,t="document.pdf"){if(typeof e!="string")return t;if(zY(e))return Ir('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const o=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,a=o.exec(e);let l=i.exec(a[1])||i.exec(a[2])||i.exec(a[3]);if(l&&(l=l[0],l.includes("%")))try{l=i.exec(decodeURIComponent(l))[0]}catch{}return l||t}class spe{started=Object.create(null);times=[];time(t){t in this.started&&Ir(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||Ir(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let o=0;for(const{name:i}of this.times)o=Math.max(i.length,o);for(const{name:i,start:a,end:l}of this.times)t.push(`${i.padEnd(o)} ${l-a}ms
246
- `);return t.join("")}}function Tx(e,t){try{const{protocol:o}=t?new URL(e,t):new URL(e);return o==="http:"||o==="https:"}catch{return!1}}function ld(e){e.preventDefault()}function PEe(e){console.log("Deprecated API usage: "+e)}let lpe;class TEe{static toDateObject(t){if(!t||typeof t!="string")return null;lpe||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const o=lpe.exec(t);if(!o)return null;const i=parseInt(o[1],10);let a=parseInt(o[2],10);a=a>=1&&a<=12?a-1:0;let l=parseInt(o[3],10);l=l>=1&&l<=31?l:1;let d=parseInt(o[4],10);d=d>=0&&d<=23?d:0;let c=parseInt(o[5],10);c=c>=0&&c<=59?c:0;let p=parseInt(o[6],10);p=p>=0&&p<=59?p:0;const u=o[7]||"Z";let h=parseInt(o[8],10);h=h>=0&&h<=23?h:0;let m=parseInt(o[9],10)||0;return m=m>=0&&m<=59?m:0,u==="-"?(d+=h,c+=m):u==="+"&&(d-=h,c-=m),new Date(Date.UTC(i,a,l,d,c,p))}}function $Lt(e,{scale:t=1,rotation:o=0}){const{width:i,height:a}=e.attributes.style,l=[0,0,parseInt(i),parseInt(a)];return new mb({viewBox:l,scale:t,rotation:o})}function FY(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):(Ir(`Not a valid color format: "${e}"`),[0,0,0])}function kLt(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const o of e.keys()){t.style.color=o;const i=window.getComputedStyle(t).color;e.set(o,FY(i))}t.remove()}function An(e){const{a:t,b:o,c:i,d:a,e:l,f:d}=e.getTransform();return[t,o,i,a,l,d]}function z2(e){const{a:t,b:o,c:i,d:a,e:l,f:d}=e.getTransform().invertSelf();return[t,o,i,a,l,d]}function j4(e,t,o=!1,i=!0){if(t instanceof mb){const{pageWidth:a,pageHeight:l}=t.rawDims,{style:d}=e,c=od.isCSSRoundSupported,p=`var(--scale-factor) * ${a}px`,u=`var(--scale-factor) * ${l}px`,h=c?`round(${p}, 1px)`:`calc(${p})`,m=c?`round(${u}, 1px)`:`calc(${u})`;!o||t.rotation%180===0?(d.width=h,d.height=m):(d.width=m,d.height=h)}i&&e.setAttribute("data-main-rotation",t.rotation)}class OY{#e=null;#t=null;#o;#i=null;constructor(t){this.#o=t}render(){const t=this.#e=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");const o=this.#o._uiManager._signal;t.addEventListener("contextmenu",ld,{signal:o}),t.addEventListener("pointerdown",OY.#s,{signal:o});const i=this.#i=document.createElement("div");i.className="buttons",t.append(i);const a=this.#o.toolbarPosition;if(a){const{style:l}=t,d=this.#o._uiManager.direction==="ltr"?1-a[0]:a[0];l.insetInlineEnd=`${100*d}%`,l.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return this.#c(),t}static#s(t){t.stopPropagation()}#r(t){this.#o._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}#n(t){this.#o._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}#l(t){const o=this.#o._uiManager._signal;t.addEventListener("focusin",this.#r.bind(this),{capture:!0,signal:o}),t.addEventListener("focusout",this.#n.bind(this),{capture:!0,signal:o}),t.addEventListener("contextmenu",ld,{signal:o})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden")}#c(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id",`pdfjs-editor-remove-${this.#o.editorType}-button`),this.#l(t),t.addEventListener("click",o=>{this.#o._uiManager.delete()},{signal:this.#o._uiManager._signal}),this.#i.append(t)}get#p(){const t=document.createElement("div");return t.className="divider",t}addAltTextButton(t){this.#l(t),this.#i.prepend(t,this.#p)}addColorPicker(t){this.#t=t;const o=t.renderButton();this.#l(o),this.#i.prepend(o,this.#p)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class SLt{#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",ld,{signal:this.#o._signal});const o=this.#e=document.createElement("div");return o.className="buttons",t.append(o),this.#r(),t}#s(t,o){let i=0,a=0;for(const l of t){const d=l.y+l.height;if(d<i)continue;const c=l.x+(o?l.width:0);if(d>i){a=c,i=d;continue}o?c>a&&(a=c):c<a&&(a=c)}return[o?1-a:a,i]}show(t,o,i){const[a,l]=this.#s(o,i),{style:d}=this.#t||=this.#i();t.append(this.#t),d.insetInlineEnd=`${100*a}%`,d.top=`calc(${100*l}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#r(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const o=document.createElement("span");t.append(o),o.className="visuallyHidden",o.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=this.#o._signal;t.addEventListener("contextmenu",ld,{signal:i}),t.addEventListener("click",()=>{this.#o.highlightSelection("floating_button")},{signal:i}),this.#e.append(t)}}function sS(e,t,o){for(const i of o)t.addEventListener(i,e[i].bind(e))}function ELt(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")}class LLt{#e=0;get id(){return`${aLt}${this.#e++}`}}class NY{#e=wLt();#t=0;#o=null;static get _isSVGFittingCanvas(){const t='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),a=new Image;a.src=t;const l=a.decode().then(()=>(i.drawImage(a,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return ni(this,"_isSVGFittingCanvas",l)}async#i(t,o){this.#o||=new Map;let i=this.#o.get(t);if(i===null)return null;if(i?.bitmap)return i.refCounter+=1,i;try{i||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let a;if(typeof o=="string"?(i.url=o,a=await nI(o,"blob")):a=i.file=o,a.type==="image/svg+xml"){const l=NY._isSVGFittingCanvas,d=new FileReader,c=new Image,p=new Promise((u,h)=>{c.onload=()=>{i.bitmap=c,i.isSvg=!0,u()},d.onload=async()=>{const m=i.svgUrl=d.result;c.src=await l?`${m}#svgView(preserveAspectRatio(none))`:m},c.onerror=d.onerror=h});d.readAsDataURL(a),await p}else i.bitmap=await createImageBitmap(a);i.refCounter=1}catch(a){console.error(a),i=null}return this.#o.set(t,i),i&&this.#o.set(i.id,i),i}async getFromFile(t){const{lastModified:o,name:i,size:a,type:l}=t;return this.#i(`${o}_${i}_${a}_${l}`,t)}async getFromUrl(t){return this.#i(t,t)}async getFromId(t){this.#o||=new Map;const o=this.#o.get(t);return o?o.bitmap?(o.refCounter+=1,o):o.file?this.getFromFile(o.file):this.getFromUrl(o.url):null}getSvgUrl(t){const o=this.#o.get(t);return o?.isSvg?o.svgUrl:null}deleteId(t){this.#o||=new Map;const o=this.#o.get(t);o&&(o.refCounter-=1,o.refCounter===0&&(o.bitmap=null))}isValidId(t){return t.startsWith(`image_${this.#e}_`)}}class ILt{#e=[];#t=!1;#o;#i=-1;constructor(t=128){this.#o=t}add({cmd:t,undo:o,post:i,mustExec:a,type:l=NaN,overwriteIfSameType:d=!1,keepUndo:c=!1}){if(a&&t(),this.#t)return;const p={cmd:t,undo:o,post:i,type:l};if(this.#i===-1){this.#e.length>0&&(this.#e.length=0),this.#i=0,this.#e.push(p);return}if(d&&this.#e[this.#i].type===l){c&&(p.undo=this.#e[this.#i].undo),this.#e[this.#i]=p;return}const u=this.#i+1;u===this.#o?this.#e.splice(0,1):(this.#i=u,u<this.#e.length&&this.#e.splice(u)),this.#e.push(p)}undo(){if(this.#i===-1)return;this.#t=!0;const{undo:t,post:o}=this.#e[this.#i];t(),o?.(),this.#t=!1,this.#i-=1}redo(){if(this.#i<this.#e.length-1){this.#i+=1,this.#t=!0;const{cmd:t,post:o}=this.#e[this.#i];t(),o?.(),this.#t=!1}}hasSomethingToUndo(){return this.#i!==-1}hasSomethingToRedo(){return this.#i<this.#e.length-1}destroy(){this.#e=null}}class gb{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:o}=od.platform;for(const[i,a,l={}]of t)for(const d of i){const c=d.startsWith("mac+");o&&c?(this.callbacks.set(d.slice(4),{callback:a,options:l}),this.allKeys.add(d.split("+").at(-1))):!o&&!c&&(this.callbacks.set(d,{callback:a,options:l}),this.allKeys.add(d.split("+").at(-1)))}}#e(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const o=this.buffer.join("+");return this.buffer.length=0,o}exec(t,o){if(!this.allKeys.has(o.key))return;const i=this.callbacks.get(this.#e(o));if(!i)return;const{callback:a,options:{bubbles:l=!1,args:d=[],checker:c=null}}=i;c&&!c(t,o)||(a.bind(t,...d,o)(),l||(o.stopPropagation(),o.preventDefault()))}}class HY{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return kLt(t),ni(this,"_colors",t)}convert(t){const o=FY(t);if(!window.matchMedia("(forced-colors: active)").matches)return o;for(const[i,a]of this._colors)if(a.every((l,d)=>l===o[d]))return HY._colorsMapping.get(i);return o}getHexCode(t){const o=this._colors.get(t);return o?$o.makeHexColor(...o):t}}class $m{#e=new AbortController;#t=null;#o=new Map;#i=new Map;#s=null;#r=null;#n=null;#l=new ILt;#c=0;#p=new Set;#h=null;#d=null;#a=new Set;#m=!1;#f=null;#u=null;#y=null;#g=!1;#w=null;#v=new LLt;#A=!1;#k=!1;#S=null;#j=null;#$=null;#b=qr.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);#D=this.cut.bind(this);#z=this.paste.bind(this);#P=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=$m.prototype,o=d=>d.#H.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&d.hasSomethingToControl(),i=(d,{target:c})=>{if(c instanceof HTMLInputElement){const{type:p}=c;return p!=="text"&&p!=="number"}return!0},a=this.TRANSLATE_SMALL,l=this.TRANSLATE_BIG;return ni(this,"_keyboardManager",new gb([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(d,{target:c})=>!(c instanceof HTMLButtonElement)&&d.#H.contains(c)&&!d.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(d,{target:c})=>!(c instanceof HTMLButtonElement)&&d.#H.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-a,0],checker:o}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-l,0],checker:o}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[a,0],checker:o}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[l,0],checker:o}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-a],checker:o}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-l],checker:o}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,a],checker:o}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,l],checker:o}]]))}constructor(t,o,i,a,l,d,c,p,u){this._signal=this.#e.signal,this.#H=t,this.#q=o,this.#s=i,this._eventBus=a,this._eventBus._on("editingaction",this.#U),this._eventBus._on("pagechanging",this.#_),this._eventBus._on("scalechanging",this.#N),this._eventBus._on("rotationchanging",this.#R),this.#ie(),this.#le(),this.#Z(),this.#r=l.annotationStorage,this.#f=l.filterFactory,this.#E=d,this.#y=c||null,this.#m=p,this.#$=u||null,this.viewParameters={realScale:u6.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#e?.abort(),this.#e=null,this._signal=null,this._eventBus._off("editingaction",this.#U),this._eventBus._off("pagechanging",this.#_),this._eventBus._off("scalechanging",this.#N),this._eventBus._off("rotationchanging",this.#R);for(const t of this.#i.values())t.destroy();this.#i.clear(),this.#o.clear(),this.#a.clear(),this.#t=null,this.#x.clear(),this.#l.destroy(),this.#s?.destroy(),this.#w?.hide(),this.#w=null,this.#u&&(clearTimeout(this.#u),this.#u=null),this.#F&&(clearTimeout(this.#F),this.#F=null)}async mlGuess(t){return this.#$?.guess(t)||null}get hasMLManager(){return!!this.#$}get hcmFilter(){return ni(this,"hcmFilter",this.#E?this.#f.addHCMFilter(this.#E.foreground,this.#E.background):"none")}get direction(){return ni(this,"direction",getComputedStyle(this.#H).direction)}get highlightColors(){return ni(this,"highlightColors",this.#y?new Map(this.#y.split(",").map(t=>t.split("=").map(o=>o.trim()))):null)}get highlightColorNames(){return ni(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.#c=t-1}focusMainContainer(){this.#H.focus()}findParent(t,o){for(const i of this.#i.values()){const{x:a,y:l,width:d,height:c}=i.div.getBoundingClientRect();if(t>=a&&t<=a+d&&o>=l&&o<=l+c)return i}return null}disableUserSelect(t=!1){this.#q.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#a.add(t)}removeShouldRescale(t){this.#a.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*u6.PDF_TO_CSS_UNITS;for(const o of this.#a)o.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#G({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}highlightSelection(t=""){const o=document.getSelection();if(!o||o.isCollapsed)return;const{anchorNode:i,anchorOffset:a,focusNode:l,focusOffset:d}=o,c=o.toString(),u=this.#G(o).closest(".textLayer"),h=this.getSelectionBoxes(u);if(h){o.empty(),this.#b===qr.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:qr.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const m of this.#i.values())if(m.hasTextLayer(u)){m.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:h,anchorNode:i,anchorOffset:a,focusNode:l,focusOffset:d,text:c});break}}}#oe(){const t=document.getSelection();if(!t||t.isCollapsed)return;const i=this.#G(t).closest(".textLayer"),a=this.getSelectionBoxes(i);a&&(this.#w||=new SLt(this),this.#w.show(i,a,this.direction==="ltr"))}addToAnnotationStorage(t){!t.isEmpty()&&this.#r&&!this.#r.has(t.id)&&this.#r.setValue(t.id,t)}#re(){const t=document.getSelection();if(!t||t.isCollapsed){this.#C&&(this.#w?.hide(),this.#C=null,this.#I({hasSelectedText:!1}));return}const{anchorNode:o}=t;if(o===this.#C)return;if(!this.#G(t).closest(".textLayer")){this.#C&&(this.#w?.hide(),this.#C=null,this.#I({hasSelectedText:!1}));return}if(this.#w?.hide(),this.#C=o,this.#I({hasSelectedText:!0}),!(this.#b!==qr.HIGHLIGHT&&this.#b!==qr.NONE)&&(this.#b===qr.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#g=this.isShiftKeyDown,!this.isShiftKeyDown)){const l=this._signal,d=c=>{c.type==="pointerup"&&c.button!==0||(window.removeEventListener("pointerup",d),window.removeEventListener("blur",d),c.type==="pointerup"&&this.#Y("main_toolbar"))};window.addEventListener("pointerup",d,{signal:l}),window.addEventListener("blur",d,{signal:l})}}#Y(t=""){this.#b===qr.HIGHLIGHT?this.highlightSelection(t):this.#m&&this.#oe()}#ie(){document.addEventListener("selectionchange",this.#re.bind(this),{signal:this._signal})}#ne(){const t=this._signal;window.addEventListener("focus",this.#M,{signal:t}),window.addEventListener("blur",this.#B,{signal:t})}#ae(){window.removeEventListener("focus",this.#M),window.removeEventListener("blur",this.#B)}blur(){if(this.isShiftKeyDown=!1,this.#g&&(this.#g=!1,this.#Y("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const o of this.#x)if(o.div.contains(t)){this.#S=[o,t],o._focusEventsAllowed=!1;break}}focus(){if(!this.#S)return;const[t,o]=this.#S;this.#S=null,o.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),o.focus()}#Z(){const t=this._signal;window.addEventListener("keydown",this.#P,{signal:t}),window.addEventListener("keyup",this.#Q,{signal:t})}#se(){window.removeEventListener("keydown",this.#P),window.removeEventListener("keyup",this.#Q)}#J(){const t=this._signal;document.addEventListener("copy",this.#T,{signal:t}),document.addEventListener("cut",this.#D,{signal:t}),document.addEventListener("paste",this.#z,{signal:t})}#X(){document.removeEventListener("copy",this.#T),document.removeEventListener("cut",this.#D),document.removeEventListener("paste",this.#z)}#le(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#Z(),this.#J()}removeEditListeners(){this.#se(),this.#X()}dragOver(t){for(const{type:o}of t.dataTransfer.items)for(const i of this.#d)if(i.isHandlingMimeForPasting(o)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const o of t.dataTransfer.items)for(const i of this.#d)if(i.isHandlingMimeForPasting(o.type)){i.paste(o,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const o=[];for(const i of this.#x){const a=i.serialize(!0);a&&o.push(a)}o.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(o))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:o}=t;for(const l of o.items)for(const d of this.#d)if(d.isHandlingMimeForPasting(l.type)){d.paste(l,this.currentLayer);return}let i=o.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(l){Ir(`paste: "${l.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();const a=this.currentLayer;try{const l=[];for(const p of i){const u=a.deserialize(p);if(!u)return;l.push(u)}const d=()=>{for(const p of l)this.#ee(p);this.#te(l)},c=()=>{for(const p of l)p.remove()};this.addCommands({cmd:d,undo:c,mustExec:!0})}catch(l){Ir(`paste: "${l.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),this.#b!==qr.NONE&&!this.isEditorHandlingKeyboard&&$m._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(([i,a])=>this.#K[i]!==a)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#K,t)}),this.#b===qr.HIGHLIGHT&&t.hasSelectedEditor===!1&&this.#O([[rr.HIGHLIGHT_FREE,!0]]))}#O(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#ne(),this.#J(),this.#I({isEditing:this.#b!==qr.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.#d){this.#d=t;for(const o of this.#d)this.#O(o.defaultPropertiesToUpdate)}}getId(){return this.#v.id}get currentLayer(){return this.#i.get(this.#c)}getLayer(t){return this.#i.get(t)}get currentPageIndex(){return this.#c}addLayer(t){this.#i.set(t.pageIndex,t),this.#A?t.enable():t.disable()}removeLayer(t){this.#i.delete(t.pageIndex)}updateMode(t,o=null,i=!1){if(this.#b!==t){if(this.#b=t,t===qr.NONE){this.setEditingState(!1),this.#ce();return}this.setEditingState(!0),this.#de(),this.unselectAll();for(const a of this.#i.values())a.updateMode(t);if(!o&&i){this.addNewEditorFromKeyboard();return}if(o){for(const a of this.#o.values())if(a.annotationElementId===o){this.setSelected(a),a.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#b&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,o){if(this.#d){switch(t){case rr.CREATE:this.currentLayer.addNewEditor();return;case rr.HIGHLIGHT_DEFAULT_COLOR:this.#j?.updateColor(o);break;case rr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#L||=new Map).set(t,o),this.showAllEditors("highlight",o);break}for(const i of this.#x)i.updateParams(t,o);for(const i of this.#d)i.updateDefaultParams(t,o)}}showAllEditors(t,o,i=!1){for(const l of this.#o.values())l.editorType===t&&l.show(o);(this.#L?.get(rr.HIGHLIGHT_SHOW_ALL)??!0)!==o&&this.#O([[rr.HIGHLIGHT_SHOW_ALL,o]])}enableWaiting(t=!1){if(this.#k!==t){this.#k=t;for(const o of this.#i.values())t?o.disableClick():o.enableClick(),o.div.classList.toggle("waiting",t)}}#de(){if(!this.#A){this.#A=!0;for(const t of this.#i.values())t.enable();for(const t of this.#o.values())t.enable()}}#ce(){if(this.unselectAll(),this.#A){this.#A=!1;for(const t of this.#i.values())t.disable();for(const t of this.#o.values())t.disable()}}getEditors(t){const o=[];for(const i of this.#o.values())i.pageIndex===t&&o.push(i);return o}getEditor(t){return this.#o.get(t)}addEditor(t){this.#o.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#u&&clearTimeout(this.#u),this.#u=setTimeout(()=>{this.focusMainContainer(),this.#u=null},0)),this.#o.delete(t.id),this.unselect(t),(!t.annotationElementId||!this.#p.has(t.annotationElementId))&&this.#r?.remove(t.id)}addDeletedAnnotationElement(t){this.#p.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#p.has(t)}removeDeletedAnnotationElement(t){this.#p.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#ee(t){const o=this.#i.get(t.pageIndex);o?o.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#t!==t&&(this.#t=t,t&&this.#O(t.propertiesToUpdate))}get#pe(){let t=null;for(t of this.#x);return t}updateUI(t){this.#pe===t&&this.#O(t.propertiesToUpdate)}toggleSelected(t){if(this.#x.has(t)){this.#x.delete(t),t.unselect(),this.#I({hasSelectedEditor:this.hasSelection});return}this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#I({hasSelectedEditor:!0})}setSelected(t){for(const o of this.#x)o!==t&&o.unselect();this.#x.clear(),this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#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],o=()=>{for(const a of t)a.remove()},i=()=>{for(const a of t)this.#ee(a)};this.addCommands({cmd:o,undo:i,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#te(t){for(const o of this.#x)o.unselect();this.#x.clear();for(const o of t)o.isEmpty()||(this.#x.add(o),o.select());this.#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.#b!==qr.NONE))&&this.hasSelection){for(const t of this.#x)t.unselect();this.#x.clear(),this.#I({hasSelectedEditor:!1})}}translateSelectedEditors(t,o,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#V[0]+=t,this.#V[1]+=o;const[a,l]=this.#V,d=[...this.#x],c=1e3;this.#F&&clearTimeout(this.#F),this.#F=setTimeout(()=>{this.#F=null,this.#V[0]=this.#V[1]=0,this.addCommands({cmd:()=>{for(const p of d)this.#o.has(p.id)&&p.translateInPage(a,l)},undo:()=>{for(const p of d)this.#o.has(p.id)&&p.translateInPage(-a,-l)},mustExec:!1})},c);for(const p of d)p.translateInPage(t,o)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#h=new Map;for(const t of this.#x)this.#h.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#h)return!1;this.disableUserSelect(!1);const t=this.#h;this.#h=null;let o=!1;for(const[{x:a,y:l,pageIndex:d},c]of t)c.newX=a,c.newY=l,c.newPageIndex=d,o||=a!==c.savedX||l!==c.savedY||d!==c.savedPageIndex;if(!o)return!1;const i=(a,l,d,c)=>{if(this.#o.has(a.id)){const p=this.#i.get(c);p?a._setParentAndPosition(p,l,d):(a.pageIndex=c,a.x=l,a.y=d)}};return this.addCommands({cmd:()=>{for(const[a,{newX:l,newY:d,newPageIndex:c}]of t)i(a,l,d,c)},undo:()=>{for(const[a,{savedX:l,savedY:d,savedPageIndex:c}]of t)i(a,l,d,c)},mustExec:!0}),!0}dragSelectedEditors(t,o){if(this.#h)for(const i of this.#h.keys())i.drag(t,o)}rebuild(t){if(t.parent===null){const o=this.getLayer(t.pageIndex);o?(o.changeParent(t),o.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#x.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#t===t}getActive(){return this.#t}getMode(){return this.#b}get imageManager(){return ni(this,"imageManager",new NY)}getSelectionBoxes(t){if(!t)return null;const o=document.getSelection();for(let u=0,h=o.rangeCount;u<h;u++)if(!t.contains(o.getRangeAt(u).commonAncestorContainer))return null;const{x:i,y:a,width:l,height:d}=t.getBoundingClientRect();let c;switch(t.getAttribute("data-main-rotation")){case"90":c=(u,h,m,f)=>({x:(h-a)/d,y:1-(u+m-i)/l,width:f/d,height:m/l});break;case"180":c=(u,h,m,f)=>({x:1-(u+m-i)/l,y:1-(h+f-a)/d,width:m/l,height:f/d});break;case"270":c=(u,h,m,f)=>({x:1-(h+f-a)/d,y:(u-i)/l,width:f/d,height:m/l});break;default:c=(u,h,m,f)=>({x:(u-i)/l,y:(h-a)/d,width:m/l,height:f/d});break}const p=[];for(let u=0,h=o.rangeCount;u<h;u++){const m=o.getRangeAt(u);if(!m.collapsed)for(const{x:f,y:x,width:y,height:w}of m.getClientRects())y===0||w===0||p.push(c(f,x,y,w))}return p.length===0?null:p}addChangedExistingAnnotation({annotationElementId:t,id:o}){(this.#n||=new Map).set(t,o)}removeChangedExistingAnnotation({annotationElementId:t}){this.#n?.delete(t)}renderAnnotationElement(t){const o=this.#n?.get(t.data.id);if(!o)return;const i=this.#r.getRawValue(o);i&&(this.#b===qr.NONE&&!i.hasBeenModified||i.renderAnnotationElement(t))}}class o4{#e="";#t=!1;#o=null;#i=null;#s=null;#r=!1;#n=null;static _l10nPromise=null;constructor(t){this.#n=t}static initialize(t){o4._l10nPromise||=t}async render(){const t=this.#o=document.createElement("button");t.className="altText";const o=await o4._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=o,t.setAttribute("aria-label",o),t.tabIndex="0";const i=this.#n._uiManager._signal;t.addEventListener("contextmenu",ld,{signal:i}),t.addEventListener("pointerdown",l=>l.stopPropagation(),{signal:i});const a=l=>{l.preventDefault(),this.#n._uiManager.editAltText(this.#n)};return t.addEventListener("click",a,{capture:!0,signal:i}),t.addEventListener("keydown",l=>{l.target===t&&l.key==="Enter"&&(this.#r=!0,a(l))},{signal:i}),await this.#l(),t}finish(){this.#o&&(this.#o.focus({focusVisible:this.#r}),this.#r=!1)}isEmpty(){return!this.#e&&!this.#t}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:t,decorative:o}){this.#e===t&&this.#t===o||(this.#e=t,this.#t=o,this.#l())}toggle(t=!1){this.#o&&(!t&&this.#s&&(clearTimeout(this.#s),this.#s=null),this.#o.disabled=!t)}destroy(){this.#o?.remove(),this.#o=null,this.#i=null}async#l(){const t=this.#o;if(!t)return;if(!this.#e&&!this.#t){t.classList.remove("done"),this.#i?.remove();return}t.classList.add("done"),o4._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(a=>{t.setAttribute("aria-label",a)});let o=this.#i;if(!o){this.#i=o=document.createElement("span"),o.className="tooltip",o.setAttribute("role","tooltip");const a=o.id=`alt-text-tooltip-${this.#n.id}`;t.setAttribute("aria-describedby",a);const l=100,d=this.#n._uiManager._signal;d.addEventListener("abort",()=>{clearTimeout(this.#s),this.#s=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#s=setTimeout(()=>{this.#s=null,this.#i.classList.add("show"),this.#n._reportTelemetry({action:"alt_text_tooltip"})},l)},{signal:d}),t.addEventListener("mouseleave",()=>{this.#s&&(clearTimeout(this.#s),this.#s=null),this.#i?.classList.remove("show")},{signal:d})}o.innerText=this.#t?await o4._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):this.#e,o.parentNode||t.append(o),this.#n.getImageForAltText()?.setAttribute("aria-describedby",o.id)}}class Jo{#e=null;#t=null;#o=null;#i=!1;#s=!1;#r=null;#n=null;#l=this.focusin.bind(this);#c=this.focusout.bind(this);#p=null;#h="";#d=!1;#a=null;#m=!1;#f=!1;#u=!1;#y=null;#g=0;#w=0;#v=null;_initialOptions=Object.create(null);_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#A=!1;#k=Jo._zIndex++;static _borderLineWidth=-1;static _colorManager=new HY;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=Jo.prototype._resizeWithKeyboard,o=$m.TRANSLATE_SMALL,i=$m.TRANSLATE_BIG;return ni(this,"_resizerKeyboardManager",new gb([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-o,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[o,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-o]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,o]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],Jo.prototype._stopResizingWithKeyboard]]))}constructor(t){this.constructor===Jo&&Pi("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:o,rawDims:{pageWidth:i,pageHeight:a,pageX:l,pageY:d}}=this.parent.viewport;this.rotation=o,this.pageRotation=(360+o-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,a],this.pageTranslation=[l,d];const[c,p]=this.parentDimensions;this.x=t.x/c,this.y=t.y/p,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return ni(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const o=new jLt({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});o.annotationElementId=t.annotationElementId,o.deleted=!0,o._uiManager.addToAnnotationStorage(o)}static initialize(t,o,i){if(Jo._l10nPromise||=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(l=>[l,t.get(l.replaceAll(/([A-Z])/g,d=>`-${d.toLowerCase()}`))])),i?.strings)for(const l of i.strings)Jo._l10nPromise.set(l,t.get(l));if(Jo._borderLineWidth!==-1)return;const a=getComputedStyle(document.documentElement);Jo._borderLineWidth=parseFloat(a.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,o){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,o){Pi("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#A}set _isDraggable(t){this.#A=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,o]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*o/(t*2),this.y+=this.width*t/(o*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*o/(t*2),this.y-=this.width*t/(o*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#k}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#P(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#d?this.#d=!1:this.parent.setSelected(this))}focusout(t){!this._focusEventsAllowed||!this.isAttachedToDOM||t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,o,i,a){const[l,d]=this.parentDimensions;[i,a]=this.screenToPageTranslation(i,a),this.x=(t+i)/l,this.y=(o+a)/d,this.fixAndSetPosition()}#S([t,o],i,a){[i,a]=this.screenToPageTranslation(i,a),this.x+=i/t,this.y+=a/o,this.fixAndSetPosition()}translate(t,o){this.#S(this.parentDimensions,t,o)}translateInPage(t,o){this.#a||=[this.x,this.y],this.#S(this.pageDimensions,t,o),this.div.scrollIntoView({block:"nearest"})}drag(t,o){this.#a||=[this.x,this.y];const[i,a]=this.parentDimensions;if(this.x+=t/i,this.y+=o/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:h}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,h)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:l,y:d}=this;const[c,p]=this.getBaseTranslation();l+=c,d+=p,this.div.style.left=`${(100*l).toFixed(2)}%`,this.div.style.top=`${(100*d).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#a&&(this.#a[0]!==this.x||this.#a[1]!==this.y)}getBaseTranslation(){const[t,o]=this.parentDimensions,{_borderLineWidth:i}=Jo,a=i/t,l=i/o;switch(this.rotation){case 90:return[-a,l];case 180:return[a,l];case 270:return[a,-l];default:return[-a,-l]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const[o,i]=this.pageDimensions;let{x:a,y:l,width:d,height:c}=this;if(d*=o,c*=i,a*=o,l*=i,this._mustFixPosition)switch(t){case 0:a=Math.max(0,Math.min(o-d,a)),l=Math.max(0,Math.min(i-c,l));break;case 90:a=Math.max(0,Math.min(o-c,a)),l=Math.min(i,Math.max(d,l));break;case 180:a=Math.min(o,Math.max(d,a)),l=Math.min(i,Math.max(c,l));break;case 270:a=Math.min(o,Math.max(c,a)),l=Math.max(0,Math.min(i-d,l));break}this.x=a/=o,this.y=l/=i;const[p,u]=this.getBaseTranslation();a+=p,l+=u;const{style:h}=this.div;h.left=`${(100*a).toFixed(2)}%`,h.top=`${(100*l).toFixed(2)}%`,this.moveInDOM()}static#j(t,o,i){switch(i){case 90:return[o,-t];case 180:return[-t,-o];case 270:return[-o,t];default:return[t,o]}}screenToPageTranslation(t,o){return Jo.#j(t,o,this.parentRotation)}pageTranslationToScreen(t,o){return Jo.#j(t,o,360-this.parentRotation)}#$(t){switch(t){case 90:{const[o,i]=this.pageDimensions;return[0,-o/i,i/o,0]}case 180:return[-1,0,0,-1];case 270:{const[o,i]=this.pageDimensions;return[0,o/i,-i/o,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[o,i]}=this,a=o*t,l=i*t;return od.isCSSRoundSupported?[Math.round(a),Math.round(l)]:[a,l]}setDims(t,o){const[i,a]=this.parentDimensions;this.div.style.width=`${(100*t/i).toFixed(2)}%`,this.#s||(this.div.style.height=`${(100*o/a).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:o,width:i}=t,a=i.endsWith("%"),l=!this.#s&&o.endsWith("%");if(a&&l)return;const[d,c]=this.parentDimensions;a||(t.width=`${(100*parseFloat(i)/d).toFixed(2)}%`),!this.#s&&!l&&(t.height=`${(100*parseFloat(o)/c).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#b(){if(this.#r)return;this.#r=document.createElement("div"),this.#r.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],o=this._uiManager._signal;for(const i of t){const a=document.createElement("div");this.#r.append(a),a.classList.add("resizer",i),a.setAttribute("data-resizer-name",i),a.addEventListener("pointerdown",this.#x.bind(this,i),{signal:o}),a.addEventListener("contextmenu",ld,{signal:o}),a.tabIndex=-1}this.div.prepend(this.#r)}#x(t,o){o.preventDefault();const{isMac:i}=od.platform;if(o.button!==0||o.ctrlKey&&i)return;this.#o?.toggle(!1);const a=this.#E.bind(this,t),l=this._isDraggable;this._isDraggable=!1;const d=this._uiManager._signal,c={passive:!0,capture:!0,signal:d};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",a,c),window.addEventListener("contextmenu",ld,{signal:d});const p=this.x,u=this.y,h=this.width,m=this.height,f=this.parent.div.style.cursor,x=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(o.target).cursor;const y=()=>{this.parent.togglePointerEvents(!0),this.#o?.toggle(!0),this._isDraggable=l,window.removeEventListener("pointerup",y),window.removeEventListener("blur",y),window.removeEventListener("pointermove",a,c),window.removeEventListener("contextmenu",ld),this.parent.div.style.cursor=f,this.div.style.cursor=x,this.#C(p,u,h,m)};window.addEventListener("pointerup",y,{signal:d}),window.addEventListener("blur",y,{signal:d})}#C(t,o,i,a){const l=this.x,d=this.y,c=this.width,p=this.height;l===t&&d===o&&c===i&&p===a||this.addCommands({cmd:()=>{this.width=c,this.height=p,this.x=l,this.y=d;const[u,h]=this.parentDimensions;this.setDims(u*c,h*p),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=a,this.x=t,this.y=o;const[u,h]=this.parentDimensions;this.setDims(u*i,h*a),this.fixAndSetPosition()},mustExec:!0})}#E(t,o){const[i,a]=this.parentDimensions,l=this.x,d=this.y,c=this.width,p=this.height,u=Jo.MIN_SIZE/i,h=Jo.MIN_SIZE/a,m=_=>Math.round(_*1e4)/1e4,f=this.#$(this.rotation),x=(_,F)=>[f[0]*_+f[2]*F,f[1]*_+f[3]*F],y=this.#$(360-this.rotation),w=(_,F)=>[y[0]*_+y[2]*F,y[1]*_+y[3]*F];let b,v,A=!1,S=!1;switch(t){case"topLeft":A=!0,b=(_,F)=>[0,0],v=(_,F)=>[_,F];break;case"topMiddle":b=(_,F)=>[_/2,0],v=(_,F)=>[_/2,F];break;case"topRight":A=!0,b=(_,F)=>[_,0],v=(_,F)=>[0,F];break;case"middleRight":S=!0,b=(_,F)=>[_,F/2],v=(_,F)=>[0,F/2];break;case"bottomRight":A=!0,b=(_,F)=>[_,F],v=(_,F)=>[0,0];break;case"bottomMiddle":b=(_,F)=>[_/2,F],v=(_,F)=>[_/2,0];break;case"bottomLeft":A=!0,b=(_,F)=>[0,F],v=(_,F)=>[_,0];break;case"middleLeft":S=!0,b=(_,F)=>[0,F/2],v=(_,F)=>[_,F/2];break}const E=b(c,p),j=v(c,p);let L=x(...j);const M=m(l+L[0]),D=m(d+L[1]);let P=1,T=1,[z,R]=this.screenToPageTranslation(o.movementX,o.movementY);if([z,R]=w(z/i,R/a),A){const _=Math.hypot(c,p);P=T=Math.max(Math.min(Math.hypot(j[0]-E[0]-z,j[1]-E[1]-R)/_,1/c,1/p),u/c,h/p)}else S?P=Math.max(u,Math.min(1,Math.abs(j[0]-E[0]-z)))/c:T=Math.max(h,Math.min(1,Math.abs(j[1]-E[1]-R)))/p;const K=m(c*P),Z=m(p*T);L=x(...v(K,Z));const O=M-L[0],Q=D-L[1];this.width=K,this.height=Z,this.x=O,this.y=Q,this.setDims(i*K,a*Z),this.fixAndSetPosition()}altTextFinish(){this.#o?.finish()}async addEditToolbar(){return this.#p||this.#f?this.#p:(this.#p=new OY(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||(o4.initialize(Jo._l10nPromise),this.#o=new o4(this),this.#e&&(this.#o.data=this.#e,this.#e=null),await this.addEditToolbar())}get altTextData(){return this.#o?.data}set altTextData(t){this.#o&&(this.#o.data=t)}hasAltText(){return!this.#o?.isEmpty()}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#i?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",this.#l,{signal:t}),this.div.addEventListener("focusout",this.#c,{signal:t});const[o,i]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*i/o).toFixed(2)}%`,this.div.style.maxHeight=`${(100*o/i).toFixed(2)}%`);const[a,l]=this.getInitialTranslation();return this.translate(a,l),sS(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:o}=od.platform;if(t.button!==0||t.ctrlKey&&o){t.preventDefault();return}if(this.#d=!0,this._isDraggable){this.#B(t);return}this.#L(t)}#L(t){const{isMac:o}=od.platform;t.ctrlKey&&!o||t.shiftKey||t.metaKey&&o?this.parent.toggleSelected(this):this.parent.setSelected(this)}#B(t){const o=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let i,a;const l=this._uiManager._signal;o&&(this.div.classList.add("moving"),i={passive:!0,capture:!0,signal:l},this.#g=t.clientX,this.#w=t.clientY,a=c=>{const{clientX:p,clientY:u}=c,[h,m]=this.screenToPageTranslation(p-this.#g,u-this.#w);this.#g=p,this.#w=u,this._uiManager.dragSelectedEditors(h,m)},window.addEventListener("pointermove",a,i));const d=()=>{window.removeEventListener("pointerup",d),window.removeEventListener("blur",d),o&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",a,i)),this.#d=!1,this._uiManager.endDragSession()||this.#L(t)};window.addEventListener("pointerup",d,{signal:l}),window.addEventListener("blur",d,{signal:l})}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,o,i){t.changeParent(this),this.x=o,this.y=i,this.fixAndSetPosition()}getRect(t,o,i=this.rotation){const a=this.parentScale,[l,d]=this.pageDimensions,[c,p]=this.pageTranslation,u=t/a,h=o/a,m=this.x*l,f=this.y*d,x=this.width*l,y=this.height*d;switch(i){case 0:return[m+u+c,d-f-h-y+p,m+u+x+c,d-f-h+p];case 90:return[m+h+c,d-f+u+p,m+h+y+c,d-f+u+x+p];case 180:return[m-u-x+c,d-f+h+p,m-u+c,d-f+h+y+p];case 270:return[m-h-y+c,d-f-u-x+p,m-h+c,d-f-u+p];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,o){const[i,a,l,d]=t,c=l-i,p=d-a;switch(this.rotation){case 0:return[i,o-d,c,p];case 90:return[i,o-a,p,c];case 180:return[l,o-a,c,p];case 270:return[l,o-d,p,c];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#f=!0}disableEditMode(){this.#f=!1}isInEditMode(){return this.#f}shouldGetKeyboardEvents(){return this.#u}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){const t=this._uiManager._signal;this.div?.addEventListener("focusin",this.#l,{signal:t}),this.div?.addEventListener("focusout",this.#c,{signal:t})}rotate(t){}serialize(t=!1,o=null){Pi("An editor must be serializable")}static deserialize(t,o,i){const a=new this.prototype.constructor({parent:o,id:o.getNextId(),uiManager:i});a.rotation=t.rotation,a.#e=t.accessibilityData;const[l,d]=a.pageDimensions,[c,p,u,h]=a.getRectInCurrentCoords(t.rect,d);return a.x=c/l,a.y=p/d,a.width=u/l,a.height=h/d,a}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",this.#l),this.div.removeEventListener("focusout",this.#c),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#y&&(clearTimeout(this.#y),this.#y=null),this.#P(),this.removeEditToolbar(),this.#v){for(const t of this.#v.values())clearTimeout(t);this.#v=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#b(),this.#r.classList.remove("hidden"),sS(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),this.#n={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const o=this.#r.children;if(!this.#t){this.#t=Array.from(o);const d=this.#M.bind(this),c=this.#T.bind(this),p=this._uiManager._signal;for(const u of this.#t){const h=u.getAttribute("data-resizer-name");u.setAttribute("role","spinbutton"),u.addEventListener("keydown",d,{signal:p}),u.addEventListener("blur",c,{signal:p}),u.addEventListener("focus",this.#D.bind(this,h),{signal:p}),Jo._l10nPromise.get(`pdfjs-editor-resizer-label-${h}`).then(m=>u.setAttribute("aria-label",m))}}const i=this.#t[0];let a=0;for(const d of o){if(d===i)break;a++}const l=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(l!==a){if(l<a)for(let c=0;c<a-l;c++)this.#r.append(this.#r.firstChild);else if(l>a)for(let c=0;c<l-a;c++)this.#r.firstChild.before(this.#r.lastChild);let d=0;for(const c of o){const u=this.#t[d++].getAttribute("data-resizer-name");Jo._l10nPromise.get(`pdfjs-editor-resizer-label-${u}`).then(h=>c.setAttribute("aria-label",h))}}this.#z(0),this.#u=!0,this.#r.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#M(t){Jo._resizerKeyboardManager.exec(this,t)}#T(t){this.#u&&t.relatedTarget?.parentNode!==this.#r&&this.#P()}#D(t){this.#h=this.#u?t:""}#z(t){if(this.#t)for(const o of this.#t)o.tabIndex=t}_resizeWithKeyboard(t,o){this.#u&&this.#E(this.#h,{movementX:t,movementY:o})}#P(){if(this.#u=!1,this.#z(-1),this.#n){const{savedX:t,savedY:o,savedWidth:i,savedHeight:a}=this.#n;this.#C(t,o,i,a),this.#n=null}}_stopResizingWithKeyboard(){this.#P(),this.div.focus()}select(){if(this.makeResizable(),this.div?.classList.add("selectedEditor"),!this.#p){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this.#p?.show()});return}this.#p?.show()}unselect(){this.#r?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this.#p?.hide()}updateParams(t,o){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#m}set isEditing(t){this.#m=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,o){this.#s=!0;const i=t/o,{style:a}=this.div;a.aspectRatio=i,a.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,o=!1){if(o){this.#v||=new Map;const{action:i}=t;let a=this.#v.get(i);a&&clearTimeout(a),a=setTimeout(()=>{this._reportTelemetry(t),this.#v.delete(i),this.#v.size===0&&(this.#v=null)},Jo._telemetryTimeout),this.#v.set(i,a);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#i=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#i=!0}renderAnnotationElement(t){let o=t.container.querySelector(".annotationContent");if(!o)o=document.createElement("div"),o.classList.add("annotationContent",this.editorType),t.container.prepend(o);else if(o.nodeName==="CANVAS"){const i=o;o=document.createElement("div"),o.classList.add("annotationContent",this.editorType),i.before(o)}return o}resetAnnotationElement(t){const{firstChild:o}=t.container;o.nodeName==="DIV"&&o.classList.contains("annotationContent")&&o.remove()}}class jLt extends Jo{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const dpe=3285377520,uc=4294901760,nu=65535;class zEe{constructor(t){this.h1=t?t&4294967295:dpe,this.h2=t?t&4294967295:dpe}update(t){let o,i;if(typeof t=="string"){o=new Uint8Array(t.length*2),i=0;for(let w=0,b=t.length;w<b;w++){const v=t.charCodeAt(w);v<=255?o[i++]=v:(o[i++]=v>>>8,o[i++]=v&255)}}else if(ArrayBuffer.isView(t))o=t.slice(),i=o.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const a=i>>2,l=i-a*4,d=new Uint32Array(o.buffer,0,a);let c=0,p=0,u=this.h1,h=this.h2;const m=3432918353,f=461845907,x=m&nu,y=f&nu;for(let w=0;w<a;w++)w&1?(c=d[w],c=c*m&uc|c*x&nu,c=c<<15|c>>>17,c=c*f&uc|c*y&nu,u^=c,u=u<<13|u>>>19,u=u*5+3864292196):(p=d[w],p=p*m&uc|p*x&nu,p=p<<15|p>>>17,p=p*f&uc|p*y&nu,h^=p,h=h<<13|h>>>19,h=h*5+3864292196);switch(c=0,l){case 3:c^=o[a*4+2]<<16;case 2:c^=o[a*4+1]<<8;case 1:c^=o[a*4],c=c*m&uc|c*x&nu,c=c<<15|c>>>17,c=c*f&uc|c*y&nu,a&1?u^=c:h^=c}this.h1=u,this.h2=h}hexdigest(){let t=this.h1,o=this.h2;return t^=o>>>1,t=t*3981806797&uc|t*36045&nu,o=o*4283543511&uc|((o<<16|t>>>16)*2950163797&uc)>>>16,t^=o>>>1,t=t*444984403&uc|t*60499&nu,o=o*3301882366&uc|((o<<16|t>>>16)*3120437893&uc)>>>16,t^=o>>>1,(t>>>0).toString(16).padStart(8,"0")+(o>>>0).toString(16).padStart(8,"0")}}const oQ=Object.freeze({map:null,hash:"",transfer:void 0});class _Y{#e=!1;#t=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,o){const i=this.#t.get(t);return i===void 0?o:Object.assign(o,i)}getRawValue(t){return this.#t.get(t)}remove(t){if(this.#t.delete(t),this.#t.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const o of this.#t.values())if(o instanceof Jo)return;this.onAnnotationEditor(null)}}setValue(t,o){const i=this.#t.get(t);let a=!1;if(i!==void 0)for(const[l,d]of Object.entries(o))i[l]!==d&&(a=!0,i[l]=d);else a=!0,this.#t.set(t,o);a&&this.#o(),o instanceof Jo&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(o.constructor._type)}has(t){return this.#t.has(t)}getAll(){return this.#t.size>0?BY(this.#t):null}setAll(t){for(const[o,i]of Object.entries(t))this.setValue(o,i)}get size(){return this.#t.size}#o(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new REe(this)}get serializable(){if(this.#t.size===0)return oQ;const t=new Map,o=new zEe,i=[],a=Object.create(null);let l=!1;for(const[d,c]of this.#t){const p=c instanceof Jo?c.serialize(!1,a):c;p&&(t.set(d,p),o.update(`${d}:${JSON.stringify(p)}`),l||=!!p.bitmap)}if(l)for(const d of t.values())d.bitmap&&i.push(d.bitmap);return t.size>0?{map:t,hash:o.hexdigest(),transfer:i}:oQ}get editorStats(){let t=null;const o=new Map;for(const i of this.#t.values()){if(!(i instanceof Jo))continue;const a=i.telemetryFinalData;if(!a)continue;const{type:l}=a;o.has(l)||o.set(l,Object.getPrototypeOf(i).constructor),t||=Object.create(null);const d=t[l]||=new Map;for(const[c,p]of Object.entries(a)){if(c==="type")continue;let u=d.get(c);u||(u=new Map,d.set(c,u));const h=u.get(p)??0;u.set(p,h+1)}}for(const[i,a]of o)t[i]=a.computeTelemetryFinalData(t[i]);return t}}class REe extends _Y{#e;constructor(t){super();const{map:o,hash:i,transfer:a}=t.serializable,l=structuredClone(o,a?{transfer:a}:null);this.#e={map:l,hash:i,transfer:a}}get print(){Pi("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}}class MLt{#e=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:o=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const o=this.styleElement.sheet;o.insertRule(t,o.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,_inspectFont:o}){if(!(!t||this.#e.has(t.loadedName))){if(Ea(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:a,style:l}=t,d=new FontFace(i,a,l);this.addNativeFontFace(d);try{await d.load(),this.#e.add(i),o?.(t)}catch{Ir(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(d)}return}Pi("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const i=t.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(a){throw Ir(`Failed to load font '${i.family}': '${a}'.`),t.disableFontFace=!0,a}}return}const o=t.createFontFaceRule();if(o){if(this.insertRule(o),this.isSyncFontLoadingSupported)return;await new Promise(i=>{const a=this._queueLoadingCallback(i);this._prepareFontLoadEvent(t,a)})}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return ni(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(Ks||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),ni(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){function o(){for(Ea(!a.done,"completeRequest() cannot be called twice."),a.done=!0;i.length>0&&i[0].done;){const l=i.shift();setTimeout(l.callback,0)}}const{loadingRequests:i}=this,a={done:!1,complete:o,callback:t};return i.push(a),a}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return ni(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,o){function i(E,j){return E.charCodeAt(j)<<24|E.charCodeAt(j+1)<<16|E.charCodeAt(j+2)<<8|E.charCodeAt(j+3)&255}function a(E,j,L,M){const D=E.substring(0,j),P=E.substring(j+L);return D+M+P}let l,d;const c=this._document.createElement("canvas");c.width=1,c.height=1;const p=c.getContext("2d");let u=0;function h(E,j){if(++u>30){Ir("Load test font never loaded."),j();return}if(p.font="30px "+E,p.fillText(".",0,20),p.getImageData(0,0,1,1).data[3]>0){j();return}setTimeout(h.bind(null,E,j))}const m=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=a(f,976,m.length,m);const y=16,w=1482184792;let b=i(f,y);for(l=0,d=m.length-3;l<d;l+=4)b=b-w+i(m,l)|0;l<m.length&&(b=b-w+i(m+"XXX",l)|0),f=a(f,y,4,mLt(b));const v=`url(data:font/opentype;base64,${btoa(f)});`,A=`@font-face {font-family:"${m}";src:${v}}`;this.insertRule(A);const S=this._document.createElement("div");S.style.visibility="hidden",S.style.width=S.style.height="10px",S.style.position="absolute",S.style.top=S.style.left="0px";for(const E of[t.loadedName,m]){const j=this._document.createElement("span");j.textContent="Hi",j.style.fontFamily=E,S.append(j)}this._document.body.append(S),h(m,()=>{S.remove(),o.complete()})}}class BLt{constructor(t,{disableFontFace:o=!1,inspectFont:i=null}){this.compiledGlyphs=Object.create(null);for(const a in t)this[a]=t[a];this.disableFontFace=o===!0,this._inspectFont=i}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const o={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(o.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,o)}return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=jEe(this.data),o=`url(data:${this.mimetype};base64,${btoa(t)});`;let i;if(!this.cssFontInfo)i=`@font-face {font-family:"${this.loadedName}";src:${o}}`;else{let a=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(a+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${a}src:${o}}`}return this._inspectFont?.(this,o),i}getPathGenerator(t,o){if(this.compiledGlyphs[o]!==void 0)return this.compiledGlyphs[o];let i;try{i=t.get(this.loadedName+"_path_"+o)}catch(l){Ir(`getPathGenerator - ignoring character: "${l}".`)}if(!Array.isArray(i)||i.length===0)return this.compiledGlyphs[o]=function(l,d){};const a=[];for(let l=0,d=i.length;l<d;)switch(i[l++]){case T2.BEZIER_CURVE_TO:{const[c,p,u,h,m,f]=i.slice(l,l+6);a.push(x=>x.bezierCurveTo(c,p,u,h,m,f)),l+=6}break;case T2.MOVE_TO:{const[c,p]=i.slice(l,l+2);a.push(u=>u.moveTo(c,p)),l+=2}break;case T2.LINE_TO:{const[c,p]=i.slice(l,l+2);a.push(u=>u.lineTo(c,p)),l+=2}break;case T2.QUADRATIC_CURVE_TO:{const[c,p,u,h]=i.slice(l,l+4);a.push(m=>m.quadraticCurveTo(c,p,u,h)),l+=4}break;case T2.RESTORE:a.push(c=>c.restore());break;case T2.SAVE:a.push(c=>c.save());break;case T2.SCALE:Ea(a.length===2,"Scale command is only valid at the third position.");break;case T2.TRANSFORM:{const[c,p,u,h,m,f]=i.slice(l,l+6);a.push(x=>x.transform(c,p,u,h,m,f)),l+=6}break;case T2.TRANSLATE:{const[c,p]=i.slice(l,l+2);a.push(u=>u.translate(c,p)),l+=2}break}return this.compiledGlyphs[o]=function(d,c){a[0](d),a[1](d),d.scale(c,-c);for(let p=2,u=a.length;p<u;p++)a[p](d)}}}if(Ks){var rQ=Promise.withResolvers(),iQ=null;(async()=>{const t=await Y3(()=>import("./empty-bx2HGpHa.js").then(c=>c.e),__vite__mapDeps([0,1,2])),o=await Y3(()=>import("./index-C-JLTbu7.js").then(c=>c.i),__vite__mapDeps([3,1,4,5,6,7,8,9])),i=await Y3(()=>import("./index-XIXzhqvh.js").then(c=>c.i),__vite__mapDeps([10,1,11,4,5,6,7,8,9])),a=await Y3(()=>import("./url-DIVWW8cr.js").then(c=>c.u),__vite__mapDeps([12,1,9,7,5,6,8]));let l,d;return new Map(Object.entries({fs:t,http:o,https:i,url:a,canvas:l,path2d:d}))})().then(t=>{iQ=t,rQ.resolve()},t=>{Ir(`loadPackages: ${t}`),iQ=new Map,rQ.resolve()})}class t2{static get promise(){return rQ.promise}static get(t){return iQ?.get(t)}}const FEe=function(e){return t2.get("fs").promises.readFile(e).then(o=>new Uint8Array(o))};class DLt extends tI{}class PLt extends oI{_createCanvas(t,o){return t2.get("canvas").createCanvas(t,o)}}class TLt extends rI{_fetchData(t,o){return FEe(t).then(i=>({cMapData:i,compressionType:o}))}}class zLt extends iI{_fetchData(t){return FEe(t)}}const yl={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function nQ(e,t){if(!t)return;const o=t[2]-t[0],i=t[3]-t[1],a=new Path2D;a.rect(t[0],t[1],o,i),e.clip(a)}class fb{constructor(){this.constructor===fb&&Pi("Cannot initialize BaseShadingPattern.")}getPattern(){Pi("Abstract method `getPattern` called.")}}class RLt extends fb{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let o;this._type==="axial"?o=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(o=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)o.addColorStop(i[0],i[1]);return o}getPattern(t,o,i,a){let l;if(a===yl.STROKE||a===yl.FILL){const d=o.current.getClippedPathBoundingBox(a,An(t))||[0,0,0,0],c=Math.ceil(d[2]-d[0])||1,p=Math.ceil(d[3]-d[1])||1,u=o.cachedCanvases.getCanvas("pattern",c,p,!0),h=u.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-d[0],-d[1]),i=$o.transform(i,[1,0,0,1,d[0],d[1]]),h.transform(...o.baseTransform),this.matrix&&h.transform(...this.matrix),nQ(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),l=t.createPattern(u.canvas,"no-repeat");const m=new DOMMatrix(i);l.setTransform(m)}else nQ(t,this._bbox),l=this._createGradient(t);return l}}function fO(e,t,o,i,a,l,d,c){const p=t.coords,u=t.colors,h=e.data,m=e.width*4;let f;p[o+1]>p[i+1]&&(f=o,o=i,i=f,f=l,l=d,d=f),p[i+1]>p[a+1]&&(f=i,i=a,a=f,f=d,d=c,c=f),p[o+1]>p[i+1]&&(f=o,o=i,i=f,f=l,l=d,d=f);const x=(p[o]+t.offsetX)*t.scaleX,y=(p[o+1]+t.offsetY)*t.scaleY,w=(p[i]+t.offsetX)*t.scaleX,b=(p[i+1]+t.offsetY)*t.scaleY,v=(p[a]+t.offsetX)*t.scaleX,A=(p[a+1]+t.offsetY)*t.scaleY;if(y>=A)return;const S=u[l],E=u[l+1],j=u[l+2],L=u[d],M=u[d+1],D=u[d+2],P=u[c],T=u[c+1],z=u[c+2],R=Math.round(y),K=Math.round(A);let Z,O,Q,_,F,N,H,ee;for(let Y=R;Y<=K;Y++){if(Y<b){const we=Y<y?0:(y-Y)/(y-b);Z=x-(x-w)*we,O=S-(S-L)*we,Q=E-(E-M)*we,_=j-(j-D)*we}else{let we;Y>A?we=1:b===A?we=0:we=(b-Y)/(b-A),Z=w-(w-v)*we,O=L-(L-P)*we,Q=M-(M-T)*we,_=D-(D-z)*we}let G;Y<y?G=0:Y>A?G=1:G=(y-Y)/(y-A),F=x-(x-v)*G,N=S-(S-P)*G,H=E-(E-T)*G,ee=j-(j-z)*G;const J=Math.round(Math.min(Z,F)),X=Math.round(Math.max(Z,F));let ie=m*Y+J*4;for(let we=J;we<=X;we++)G=(Z-we)/(Z-F),G<0?G=0:G>1&&(G=1),h[ie++]=O-(O-N)*G|0,h[ie++]=Q-(Q-H)*G|0,h[ie++]=_-(_-ee)*G|0,h[ie++]=255}}function FLt(e,t,o){const i=t.coords,a=t.colors;let l,d;switch(t.type){case"lattice":const c=t.verticesPerRow,p=Math.floor(i.length/c)-1,u=c-1;for(l=0;l<p;l++){let h=l*c;for(let m=0;m<u;m++,h++)fO(e,o,i[h],i[h+1],i[h+c],a[h],a[h+1],a[h+c]),fO(e,o,i[h+c+1],i[h+1],i[h+c],a[h+c+1],a[h+1],a[h+c])}break;case"triangles":for(l=0,d=i.length;l<d;l+=3)fO(e,o,i[l],i[l+1],i[l+2],a[l],a[l+1],a[l+2]);break;default:throw new Error("illegal figure")}}class OLt extends fb{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,o,i){const c=Math.floor(this._bounds[0]),p=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-c,h=Math.ceil(this._bounds[3])-p,m=Math.min(Math.ceil(Math.abs(u*t[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(h*t[1]*1.1)),3e3),x=u/m,y=h/f,w={coords:this._coords,colors:this._colors,offsetX:-c,offsetY:-p,scaleX:1/x,scaleY:1/y},b=m+2*2,v=f+2*2,A=i.getCanvas("mesh",b,v,!1),S=A.context,E=S.createImageData(m,f);if(o){const L=E.data;for(let M=0,D=L.length;M<D;M+=4)L[M]=o[0],L[M+1]=o[1],L[M+2]=o[2],L[M+3]=255}for(const L of this._figures)FLt(E,L,w);return S.putImageData(E,2,2),{canvas:A.canvas,offsetX:c-2*x,offsetY:p-2*y,scaleX:x,scaleY:y}}getPattern(t,o,i,a){nQ(t,this._bbox);let l;if(a===yl.SHADING)l=$o.singularValueDecompose2dScale(An(t));else if(l=$o.singularValueDecompose2dScale(o.baseTransform),this.matrix){const c=$o.singularValueDecompose2dScale(this.matrix);l=[l[0]*c[0],l[1]*c[1]]}const d=this._createMeshCanvas(l,a===yl.SHADING?null:this._background,o.cachedCanvases);return a!==yl.SHADING&&(t.setTransform(...o.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(d.offsetX,d.offsetY),t.scale(d.scaleX,d.scaleY),t.createPattern(d.canvas,"no-repeat")}}class NLt extends fb{getPattern(){return"hotpink"}}function HLt(e){switch(e[0]){case"RadialAxial":return new RLt(e);case"Mesh":return new OLt(e);case"Dummy":return new NLt}throw new Error(`Unknown IR type: ${e[0]}`)}const cpe={COLORED:1,UNCOLORED:2};class VY{static MAX_PATTERN_SIZE=3e3;constructor(t,o,i,a,l){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=o,this.ctx=i,this.canvasGraphicsFactory=a,this.baseTransform=l}createPatternCanvas(t){const o=this.operatorList,i=this.bbox,a=this.xstep,l=this.ystep,d=this.paintType,c=this.tilingType,p=this.color,u=this.canvasGraphicsFactory;JL("TilingType: "+c);const h=i[0],m=i[1],f=i[2],x=i[3],y=$o.singularValueDecompose2dScale(this.matrix),w=$o.singularValueDecompose2dScale(this.baseTransform),b=[y[0]*w[0],y[1]*w[1]],v=this.getSizeAndScale(a,this.ctx.canvas.width,b[0]),A=this.getSizeAndScale(l,this.ctx.canvas.height,b[1]),S=t.cachedCanvases.getCanvas("pattern",v.size,A.size,!0),E=S.context,j=u.createCanvasGraphics(E);j.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(j,d,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)),j.transform(v.scale,0,0,A.scale,0,0),E.save(),this.clipBbox(j,L,M,D,P),j.baseTransform=An(j.ctx),j.executeOperatorList(o),j.endDrawing(),{canvas:S.canvas,scaleX:v.scale,scaleY:A.scale,offsetX:L,offsetY:M}}getSizeAndScale(t,o,i){t=Math.abs(t);const a=Math.max(VY.MAX_PATTERN_SIZE,o);let l=Math.ceil(t*i);return l>=a?l=a:i=l/t,{scale:i,size:l}}clipBbox(t,o,i,a,l){const d=a-o,c=l-i;t.ctx.rect(o,i,d,c),t.current.updateRectMinMax(An(t.ctx),[o,i,a,l]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,o,i){const a=t.ctx,l=t.current;switch(o){case cpe.COLORED:const d=this.ctx;a.fillStyle=d.fillStyle,a.strokeStyle=d.strokeStyle,l.fillColor=d.fillStyle,l.strokeColor=d.strokeStyle;break;case cpe.UNCOLORED:const c=$o.makeHexColor(i[0],i[1],i[2]);a.fillStyle=c,a.strokeStyle=c,l.fillColor=c,l.strokeColor=c;break;default:throw new hLt(`Unsupported paint type: ${o}`)}}getPattern(t,o,i,a){let l=i;a!==yl.SHADING&&(l=$o.transform(l,o.baseTransform),this.matrix&&(l=$o.transform(l,this.matrix)));const d=this.createPatternCanvas(o);let c=new DOMMatrix(l);c=c.translate(d.offsetX,d.offsetY),c=c.scale(1/d.scaleX,1/d.scaleY);const p=t.createPattern(d.canvas,"repeat");return p.setTransform(c),p}}function _Lt({src:e,srcPos:t=0,dest:o,width:i,height:a,nonBlackColor:l=4294967295,inverseDecode:d=!1}){const c=od.isLittleEndian?4278190080:255,[p,u]=d?[l,c]:[c,l],h=i>>3,m=i&7,f=e.length;o=new Uint32Array(o.buffer);let x=0;for(let y=0;y<a;y++){for(const b=t+h;t<b;t++){const v=t<f?e[t]:255;o[x++]=v&128?u:p,o[x++]=v&64?u:p,o[x++]=v&32?u:p,o[x++]=v&16?u:p,o[x++]=v&8?u:p,o[x++]=v&4?u:p,o[x++]=v&2?u:p,o[x++]=v&1?u:p}if(m===0)continue;const w=t<f?e[t++]:255;for(let b=0;b<m;b++)o[x++]=w&1<<7-b?u:p}return{srcPos:t,destPos:x}}const ppe=16,upe=100,VLt=15,hpe=10,mpe=1e3,Yl=16;function QLt(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(i,a){t.translate(i,a),this.__originalTranslate(i,a)},e.scale=function(i,a){t.scale(i,a),this.__originalScale(i,a)},e.transform=function(i,a,l,d,c,p){t.transform(i,a,l,d,c,p),this.__originalTransform(i,a,l,d,c,p)},e.setTransform=function(i,a,l,d,c,p){t.setTransform(i,a,l,d,c,p),this.__originalSetTransform(i,a,l,d,c,p)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(i){t.rotate(i),this.__originalRotate(i)},e.clip=function(i){t.clip(i),this.__originalClip(i)},e.moveTo=function(o,i){t.moveTo(o,i),this.__originalMoveTo(o,i)},e.lineTo=function(o,i){t.lineTo(o,i),this.__originalLineTo(o,i)},e.bezierCurveTo=function(o,i,a,l,d,c){t.bezierCurveTo(o,i,a,l,d,c),this.__originalBezierCurveTo(o,i,a,l,d,c)},e.rect=function(o,i,a,l){t.rect(o,i,a,l),this.__originalRect(o,i,a,l)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class ULt{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,o,i){let a;return this.cache[t]!==void 0?(a=this.cache[t],this.canvasFactory.reset(a,o,i)):(a=this.canvasFactory.create(o,i),this.cache[t]=a),a}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const o=this.cache[t];this.canvasFactory.destroy(o),delete this.cache[t]}}}function gC(e,t,o,i,a,l,d,c,p,u){const[h,m,f,x,y,w]=An(e);if(m===0&&f===0){const A=d*h+y,S=Math.round(A),E=c*x+w,j=Math.round(E),L=(d+p)*h+y,M=Math.abs(Math.round(L)-S)||1,D=(c+u)*x+w,P=Math.abs(Math.round(D)-j)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(x),S,j),e.drawImage(t,o,i,a,l,0,0,M,P),e.setTransform(h,m,f,x,y,w),[M,P]}if(h===0&&x===0){const A=c*f+y,S=Math.round(A),E=d*m+w,j=Math.round(E),L=(c+u)*f+y,M=Math.abs(Math.round(L)-S)||1,D=(d+p)*m+w,P=Math.abs(Math.round(D)-j)||1;return e.setTransform(0,Math.sign(m),Math.sign(f),0,S,j),e.drawImage(t,o,i,a,l,0,0,P,M),e.setTransform(h,m,f,x,y,w),[P,M]}e.drawImage(t,o,i,a,l,d,c,p,u);const b=Math.hypot(h,m),v=Math.hypot(f,x);return[b*p,v*u]}function WLt(e){const{width:t,height:o}=e;if(t>mpe||o>mpe)return null;const i=1e3,a=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),l=t+1;let d=new Uint8Array(l*(o+1)),c,p,u;const h=t+7&-8;let m=new Uint8Array(h*o),f=0;for(const v of e.data){let A=128;for(;A>0;)m[f++]=v&A?0:255,A>>=1}let x=0;for(f=0,m[f]!==0&&(d[0]=1,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(d[p]=m[f]?2:1,++x),f++;for(m[f]!==0&&(d[p]=2,++x),c=1;c<o;c++){f=c*h,u=c*l,m[f-h]!==m[f]&&(d[u]=m[f]?1:8,++x);let v=(m[f]?4:0)+(m[f-h]?8:0);for(p=1;p<t;p++)v=(v>>2)+(m[f+1]?4:0)+(m[f-h+1]?8:0),a[v]&&(d[u+p]=a[v],++x),f++;if(m[f-h]!==m[f]&&(d[u+p]=m[f]?2:4,++x),x>i)return null}for(f=h*(o-1),u=c*l,m[f]!==0&&(d[u]=8,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(d[u+p]=m[f]?4:8,++x),f++;if(m[f]!==0&&(d[u+p]=4,++x),x>i)return null;const y=new Int32Array([0,l,-1,0,-l,0,0,0,1]),w=new Path2D;for(c=0;x&&c<=o;c++){let v=c*l;const A=v+t;for(;v<A&&!d[v];)v++;if(v===A)continue;w.moveTo(v%l,c);const S=v;let E=d[v];do{const j=y[E];do v+=j;while(!d[v]);const L=d[v];L!==5&&L!==10?(E=L,d[v]=0):(E=L&51*E>>4,d[v]&=E>>2|E<<2),w.lineTo(v%l,v/l|0),d[v]||--x}while(S!==v);--c}return m=null,d=null,function(v){v.save(),v.scale(1/t,-1/o),v.translate(0,-o),v.fill(w),v.beginPath(),v.restore()}}class gpe{constructor(t,o){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=LEe,this.textMatrixScale=1,this.fontMatrix=JV,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=Ns.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,o])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,o){this.x=t,this.y=o}updatePathMinMax(t,o,i){[o,i]=$o.applyTransform([o,i],t),this.minX=Math.min(this.minX,o),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,o),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,o){const i=$o.applyTransform(o,t),a=$o.applyTransform(o.slice(2),t),l=$o.applyTransform([o[0],o[3]],t),d=$o.applyTransform([o[2],o[1]],t);this.minX=Math.min(this.minX,i[0],a[0],l[0],d[0]),this.minY=Math.min(this.minY,i[1],a[1],l[1],d[1]),this.maxX=Math.max(this.maxX,i[0],a[0],l[0],d[0]),this.maxY=Math.max(this.maxY,i[1],a[1],l[1],d[1])}updateScalingPathMinMax(t,o){$o.scaleMinMax(t,o),this.minX=Math.min(this.minX,o[0]),this.minY=Math.min(this.minY,o[1]),this.maxX=Math.max(this.maxX,o[2]),this.maxY=Math.max(this.maxY,o[3])}updateCurvePathMinMax(t,o,i,a,l,d,c,p,u,h){const m=$o.bezierBoundingBox(o,i,a,l,d,c,p,u,h);h||this.updateRectMinMax(t,m)}getPathBoundingBox(t=yl.FILL,o=null){const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===yl.STROKE){o||Pi("Stroke bounding box must include transform.");const a=$o.singularValueDecompose2dScale(o),l=a[0]*this.lineWidth/2,d=a[1]*this.lineWidth/2;i[0]-=l,i[1]-=d,i[2]+=l,i[3]+=d}return i}updateClipFromPath(){const t=$o.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=yl.FILL,o=null){return $o.intersect(this.clipBox,this.getPathBoundingBox(t,o))}}function fpe(e,t){if(typeof ImageData<"u"&&t instanceof ImageData){e.putImageData(t,0,0);return}const o=t.height,i=t.width,a=o%Yl,l=(o-a)/Yl,d=a===0?l:l+1,c=e.createImageData(i,Yl);let p=0,u;const h=t.data,m=c.data;let f,x,y,w;if(t.kind===R$.GRAYSCALE_1BPP){const b=h.byteLength,v=new Uint32Array(m.buffer,0,m.byteLength>>2),A=v.length,S=i+7>>3,E=4294967295,j=od.isLittleEndian?4278190080:255;for(f=0;f<d;f++){for(y=f<l?Yl:a,u=0,x=0;x<y;x++){const L=b-p;let M=0;const D=L>S?i:L*8-7,P=D&-8;let T=0,z=0;for(;M<P;M+=8)z=h[p++],v[u++]=z&128?E:j,v[u++]=z&64?E:j,v[u++]=z&32?E:j,v[u++]=z&16?E:j,v[u++]=z&8?E:j,v[u++]=z&4?E:j,v[u++]=z&2?E:j,v[u++]=z&1?E:j;for(;M<D;M++)T===0&&(z=h[p++],T=128),v[u++]=z&T?E:j,T>>=1}for(;u<A;)v[u++]=0;e.putImageData(c,0,f*Yl)}}else if(t.kind===R$.RGBA_32BPP){for(x=0,w=i*Yl*4,f=0;f<l;f++)m.set(h.subarray(p,p+w)),p+=w,e.putImageData(c,0,x),x+=Yl;f<d&&(w=i*a*4,m.set(h.subarray(p,p+w)),e.putImageData(c,0,x))}else if(t.kind===R$.RGB_24BPP)for(y=Yl,w=i*y,f=0;f<d;f++){for(f>=l&&(y=a,w=i*y),u=0,x=w;x--;)m[u++]=h[p++],m[u++]=h[p++],m[u++]=h[p++],m[u++]=255;e.putImageData(c,0,f*Yl)}else throw new Error(`bad image kind: ${t.kind}`)}function xpe(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}const o=t.height,i=t.width,a=o%Yl,l=(o-a)/Yl,d=a===0?l:l+1,c=e.createImageData(i,Yl);let p=0;const u=t.data,h=c.data;for(let m=0;m<d;m++){const f=m<l?Yl:a;({srcPos:p}=_Lt({src:u,srcPos:p,dest:h,width:i,height:f,nonBlackColor:0})),e.putImageData(c,0,m*Yl)}}function B9(e,t){const o=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of o)e[i]!==void 0&&(t[i]=e[i]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function fC(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),!Ks){const{filter:t}=e;t!=="none"&&t!==""&&(e.filter="none")}}function ype(e,t){if(t)return!0;const o=$o.singularValueDecompose2dScale(e);o[0]=Math.fround(o[0]),o[1]=Math.fround(o[1]);const i=Math.fround((globalThis.devicePixelRatio||1)*u6.PDF_TO_CSS_UNITS);return o[0]<=i&&o[1]<=i}const GLt=["butt","round","square"],YLt=["miter","round","bevel"],KLt={},wpe={};class D7{constructor(t,o,i,a,l,{optionalContentConfig:d,markedContentStack:c=null},p,u){this.ctx=t,this.current=new gpe(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=o,this.objs=i,this.canvasFactory=a,this.filterFactory=l,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=c||[],this.optionalContentConfig=d,this.cachedCanvases=new ULt(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=p,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=u,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,o=null){return typeof t=="string"?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):o}beginDrawing({transform:t,viewport:o,transparency:i=!1,background:a=null}){const l=this.ctx.canvas.width,d=this.ctx.canvas.height,c=this.ctx.fillStyle;if(this.ctx.fillStyle=a||"#ffffff",this.ctx.fillRect(0,0,l,d),this.ctx.fillStyle=c,i){const p=this.cachedCanvases.getCanvas("transparent",l,d);this.compositeCtx=this.ctx,this.transparentCanvas=p.canvas,this.ctx=p.context,this.ctx.save(),this.ctx.transform(...An(this.compositeCtx))}this.ctx.save(),fC(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...o.transform),this.viewportScale=o.scale,this.baseTransform=An(this.ctx)}executeOperatorList(t,o,i,a){const l=t.argsArray,d=t.fnArray;let c=o||0;const p=l.length;if(p===c)return c;const u=p-c>hpe&&typeof i=="function",h=u?Date.now()+VLt:0;let m=0;const f=this.commonObjs,x=this.objs;let y;for(;;){if(a!==void 0&&c===a.nextBreakPoint)return a.breakIt(c,i),c;if(y=d[c],y!==E1.dependency)this[y].apply(this,l[c]);else for(const w of l[c]){const b=w.startsWith("g_")?f:x;if(!b.has(w))return b.get(w,i),c}if(c++,c===p)return c;if(u&&++m>hpe){if(Date.now()>h)return i(),c;m=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const o of t.values())typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement&&(o.width=o.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const o=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=o}}}_scaleImage(t,o){const i=t.width,a=t.height;let l=Math.max(Math.hypot(o[0],o[1]),1),d=Math.max(Math.hypot(o[2],o[3]),1),c=i,p=a,u="prescale1",h,m;for(;l>2&&c>1||d>2&&p>1;){let f=c,x=p;l>2&&c>1&&(f=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c/2),l/=c/f),d>2&&p>1&&(x=p>=16384?Math.floor(p/2)-1||1:Math.ceil(p)/2,d/=p/x),h=this.cachedCanvases.getCanvas(u,f,x),m=h.context,m.clearRect(0,0,f,x),m.drawImage(t,0,0,c,p,0,0,f,x),t=h.canvas,c=f,p=x,u=u==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:c,paintHeight:p}}_createMaskCanvas(t){const o=this.ctx,{width:i,height:a}=t,l=this.current.fillColor,d=this.current.patternFill,c=An(o);let p,u,h,m;if((t.bitmap||t.data)&&t.count>1){const D=t.bitmap||t.data.buffer;u=JSON.stringify(d?c:[c.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&&!d){const T=Math.round(Math.min(c[0],c[2])+c[4]),z=Math.round(Math.min(c[1],c[3])+c[5]);return{canvas:P,offsetX:T,offsetY:z}}h=P}h||(m=this.cachedCanvases.getCanvas("maskCanvas",i,a),xpe(m.context,t));let f=$o.transform(c,[1/i,0,0,-1/a,0,0]);f=$o.transform(f,[1,0,0,1,0,-a]);const[x,y,w,b]=$o.getAxialAlignedBoundingBox([0,0,i,a],f),v=Math.round(w-x)||1,A=Math.round(b-y)||1,S=this.cachedCanvases.getCanvas("fillCanvas",v,A),E=S.context,j=x,L=y;E.translate(-j,-L),E.transform(...f),h||(h=this._scaleImage(m.canvas,z2(E)),h=h.img,p&&d&&p.set(u,h)),E.imageSmoothingEnabled=ype(An(E),t.interpolate),gC(E,h,0,0,h.width,h.height,0,0,i,a),E.globalCompositeOperation="source-in";const M=$o.transform(z2(E),[1,0,0,1,-j,-L]);return E.fillStyle=d?l.getPattern(o,this,M,yl.FILL):l,E.fillRect(0,0,i,a),p&&!d&&(this.cachedCanvases.delete("fillCanvas"),p.set(u,S.canvas)),{canvas:S.canvas,offsetX:Math.round(j),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=GLt[t]}setLineJoin(t){this.ctx.lineJoin=YLt[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,o){const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(t),i.lineDashOffset=o)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[o,i]of t)switch(o){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,o=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(i,t,o);this.suspendedCtx=this.ctx,this.ctx=a.context;const l=this.ctx;l.setTransform(...An(this.suspendedCtx)),B9(this.suspendedCtx,l),QLt(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(),B9(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const o=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,o,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,o,i,a){const l=a[0],d=a[1],c=a[2]-l,p=a[3]-d;c===0||p===0||(this.genericComposeSMask(o.context,i,c,p,o.subtype,o.backdrop,o.transferMap,l,d,o.offsetX,o.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,o,i,a,l,d,c,p,u,h,m){let f=t.canvas,x=p-h,y=u-m;if(d){if(x<0||y<0||x+i>f.width||y+a>f.height){const b=this.cachedCanvases.getCanvas("maskExtension",i,a),v=b.context;v.drawImage(f,-x,-y),d.some(A=>A!==0)&&(v.globalCompositeOperation="destination-atop",v.fillStyle=$o.makeHexColor(...d),v.fillRect(0,0,i,a),v.globalCompositeOperation="source-over"),f=b.canvas,x=y=0}else if(d.some(b=>b!==0)){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const b=new Path2D;b.rect(x,y,i,a),t.clip(b),t.globalCompositeOperation="destination-atop",t.fillStyle=$o.makeHexColor(...d),t.fillRect(x,y,i,a),t.restore()}}o.save(),o.globalAlpha=1,o.setTransform(1,0,0,1,0,0),l==="Alpha"&&c?o.filter=this.filterFactory.addAlphaFilter(c):l==="Luminosity"&&(o.filter=this.filterFactory.addLuminosityFilter(c));const w=new Path2D;w.rect(p,u,i,a),o.clip(w),o.globalCompositeOperation="destination-in",o.drawImage(f,x,y,i,a,p,u,i,a),o.restore()}save(){this.inSMaskMode?(B9(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(),B9(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,o,i,a,l,d){this.ctx.transform(t,o,i,a,l,d),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,o,i){const a=this.ctx,l=this.current;let d=l.x,c=l.y,p,u;const h=An(a),m=h[0]===0&&h[3]===0||h[1]===0&&h[2]===0,f=m?i.slice(0):null;for(let x=0,y=0,w=t.length;x<w;x++)switch(t[x]|0){case E1.rectangle:d=o[y++],c=o[y++];const b=o[y++],v=o[y++],A=d+b,S=c+v;a.moveTo(d,c),b===0||v===0?a.lineTo(A,S):(a.lineTo(A,c),a.lineTo(A,S),a.lineTo(d,S)),m||l.updateRectMinMax(h,[d,c,A,S]),a.closePath();break;case E1.moveTo:d=o[y++],c=o[y++],a.moveTo(d,c),m||l.updatePathMinMax(h,d,c);break;case E1.lineTo:d=o[y++],c=o[y++],a.lineTo(d,c),m||l.updatePathMinMax(h,d,c);break;case E1.curveTo:p=d,u=c,d=o[y+4],c=o[y+5],a.bezierCurveTo(o[y],o[y+1],o[y+2],o[y+3],d,c),l.updateCurvePathMinMax(h,p,u,o[y],o[y+1],o[y+2],o[y+3],d,c,f),y+=6;break;case E1.curveTo2:p=d,u=c,a.bezierCurveTo(d,c,o[y],o[y+1],o[y+2],o[y+3]),l.updateCurvePathMinMax(h,p,u,d,c,o[y],o[y+1],o[y+2],o[y+3],f),d=o[y+2],c=o[y+3],y+=4;break;case E1.curveTo3:p=d,u=c,d=o[y+2],c=o[y+3],a.bezierCurveTo(o[y],o[y+1],d,c,d,c),l.updateCurvePathMinMax(h,p,u,o[y],o[y+1],d,c,d,c,f),y+=4;break;case E1.closePath:a.closePath();break}m&&l.updateScalingPathMinMax(h,f),l.setCurrentPoint(d,c)}closePath(){this.ctx.closePath()}stroke(t=!0){const o=this.ctx,i=this.current.strokeColor;o.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof i=="object"&&i?.getPattern?(o.save(),o.strokeStyle=i.getPattern(o,this,z2(o),yl.STROKE),this.rescaleAndStroke(!1),o.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),o.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){const o=this.ctx,i=this.current.fillColor,a=this.current.patternFill;let l=!1;a&&(o.save(),o.fillStyle=i.getPattern(o,this,z2(o),yl.FILL),l=!0);const d=this.current.getClippedPathBoundingBox();this.contentVisible&&d!==null&&(this.pendingEOFill?(o.fill("evenodd"),this.pendingEOFill=!1):o.fill()),l&&o.restore(),t&&this.consumePath(d)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=KLt}eoClip(){this.pendingClip=wpe}beginText(){this.current.textMatrix=LEe,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,o=this.ctx;if(t===void 0){o.beginPath();return}o.save(),o.beginPath();for(const i of t)o.setTransform(...i.transform),o.translate(i.x,i.y),i.addToPath(o,i.fontSize);o.restore(),o.clip(),o.beginPath(),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,o){const i=this.commonObjs.get(t),a=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(a.fontMatrix=i.fontMatrix||JV,(a.fontMatrix[0]===0||a.fontMatrix[3]===0)&&Ir("Invalid font matrix for font "+t),o<0?(o=-o,a.fontDirection=-1):a.fontDirection=1,this.current.font=i,this.current.fontSize=o,i.isType3Font)return;const l=i.loadedName||"sans-serif",d=i.systemFontInfo?.css||`"${l}", ${i.fallbackName}`;let c="normal";i.black?c="900":i.bold&&(c="bold");const p=i.italic?"italic":"normal";let u=o;o<ppe?u=ppe:o>upe&&(u=upe),this.current.fontSizeScale=o/u,this.ctx.font=`${p} ${c} ${u}px ${d}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,o){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=o}setLeadingMoveText(t,o){this.setLeading(-o),this.moveText(t,o)}setTextMatrix(t,o,i,a,l,d){this.current.textMatrix=[t,o,i,a,l,d],this.current.textMatrixScale=Math.hypot(t,o),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,o,i,a){const l=this.ctx,d=this.current,c=d.font,p=d.textRenderingMode,u=d.fontSize/d.fontSizeScale,h=p&Ns.FILL_STROKE_MASK,m=!!(p&Ns.ADD_TO_PATH_FLAG),f=d.patternFill&&!c.missingFile;let x;(c.disableFontFace||m||f)&&(x=c.getPathGenerator(this.commonObjs,t)),c.disableFontFace||f?(l.save(),l.translate(o,i),l.beginPath(),x(l,u),a&&l.setTransform(...a),(h===Ns.FILL||h===Ns.FILL_STROKE)&&l.fill(),(h===Ns.STROKE||h===Ns.FILL_STROKE)&&l.stroke(),l.restore()):((h===Ns.FILL||h===Ns.FILL_STROKE)&&l.fillText(t,o,i),(h===Ns.STROKE||h===Ns.FILL_STROKE)&&l.strokeText(t,o,i)),m&&(this.pendingTextPaths||=[]).push({transform:An(l),x:o,y:i,fontSize:u,addToPath:x})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const o=t.getImageData(0,0,10,10).data;let i=!1;for(let a=3;a<o.length;a+=4)if(o[a]>0&&o[a]<255){i=!0;break}return ni(this,"isFontSubpixelAAEnabled",i)}showText(t){const o=this.current,i=o.font;if(i.isType3Font)return this.showType3Text(t);const a=o.fontSize;if(a===0)return;const l=this.ctx,d=o.fontSizeScale,c=o.charSpacing,p=o.wordSpacing,u=o.fontDirection,h=o.textHScale*u,m=t.length,f=i.vertical,x=f?1:-1,y=i.defaultVMetrics,w=a*o.fontMatrix[0],b=o.textRenderingMode===Ns.FILL&&!i.disableFontFace&&!o.patternFill;l.save(),l.transform(...o.textMatrix),l.translate(o.x,o.y+o.textRise),u>0?l.scale(h,-1):l.scale(h,1);let v;if(o.patternFill){l.save();const L=o.fillColor.getPattern(l,this,z2(l),yl.FILL);v=An(l),l.restore(),l.fillStyle=L}let A=o.lineWidth;const S=o.textMatrixScale;if(S===0||A===0){const L=o.textRenderingMode&Ns.FILL_STROKE_MASK;(L===Ns.STROKE||L===Ns.FILL_STROKE)&&(A=this.getSinglePixelWidth())}else A/=S;if(d!==1&&(l.scale(d,d),A/=d),l.lineWidth=A,i.isInvalidPDFjsFont){const L=[];let M=0;for(const D of t)L.push(D.unicode),M+=D.width;l.fillText(L.join(""),0,0),o.x+=M*w*h,l.restore(),this.compose();return}let E=0,j;for(j=0;j<m;++j){const L=t[j];if(typeof L=="number"){E+=x*L*a/1e3;continue}let M=!1;const D=(L.isSpace?p:0)+c,P=L.fontChar,T=L.accent;let z,R,K=L.width;if(f){const O=L.vmetric||y,Q=-(L.vmetric?O[1]:K*.5)*w,_=O[2]*w;K=O?-O[0]:K,z=Q/d,R=(E+_)/d}else z=E/d,R=0;if(i.remeasure&&K>0){const O=l.measureText(P).width*1e3/a*d;if(K<O&&this.isFontSubpixelAAEnabled){const Q=K/O;M=!0,l.save(),l.scale(Q,1),z/=Q}else K!==O&&(z+=(K-O)/2e3*a/d)}if(this.contentVisible&&(L.isInFont||i.missingFile)){if(b&&!T)l.fillText(P,z,R);else if(this.paintChar(P,z,R,v),T){const O=z+a*T.offset.x/d,Q=R-a*T.offset.y/d;this.paintChar(T.fontChar,O,Q,v)}}const Z=f?K*w-D*u:K*w+D*u;E+=Z,M&&l.restore()}f?o.y-=E:o.x+=E*h,l.restore(),this.compose()}showType3Text(t){const o=this.ctx,i=this.current,a=i.font,l=i.fontSize,d=i.fontDirection,c=a.vertical?1:-1,p=i.charSpacing,u=i.wordSpacing,h=i.textHScale*d,m=i.fontMatrix||JV,f=t.length,x=i.textRenderingMode===Ns.INVISIBLE;let y,w,b,v;if(!(x||l===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,o.save(),o.transform(...i.textMatrix),o.translate(i.x,i.y),o.scale(h,d),y=0;y<f;++y){if(w=t[y],typeof w=="number"){v=c*w*l/1e3,this.ctx.translate(v,0),i.x+=v*h;continue}const A=(w.isSpace?u:0)+p,S=a.charProcOperatorList[w.operatorListId];if(!S){Ir(`Type3 character "${w.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=w,this.save(),o.scale(l,l),o.transform(...m),this.executeOperatorList(S),this.restore()),b=$o.applyTransform([w.width,0],m)[0]*l+A,o.translate(b,0),i.x+=b*h}o.restore(),this.processingType3=null}}setCharWidth(t,o){}setCharWidthAndBounds(t,o,i,a,l,d){this.ctx.rect(i,a,l-i,d-a),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let o;if(t[0]==="TilingPattern"){const i=t[1],a=this.baseTransform||An(this.ctx),l={createCanvasGraphics:d=>new D7(d,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};o=new VY(t,i,this.ctx,l,a)}else o=this._getPattern(t[1],t[2]);return o}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,o,i){const a=$o.makeHexColor(t,o,i);this.ctx.strokeStyle=a,this.current.strokeColor=a}setFillRGBColor(t,o,i){const a=$o.makeHexColor(t,o,i);this.ctx.fillStyle=a,this.current.fillColor=a,this.current.patternFill=!1}_getPattern(t,o=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=HLt(this.getObject(t)),this.cachedPatterns.set(t,i)),o&&(i.matrix=o),i}shadingFill(t){if(!this.contentVisible)return;const o=this.ctx;this.save();const i=this._getPattern(t);o.fillStyle=i.getPattern(o,this,z2(o),yl.SHADING);const a=z2(o);if(a){const{width:l,height:d}=o.canvas,[c,p,u,h]=$o.getAxialAlignedBoundingBox([0,0,l,d],a);this.ctx.fillRect(c,p,u-c,h-p)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Pi("Should not call beginInlineImage")}beginImageData(){Pi("Should not call beginImageData")}paintFormXObjectBegin(t,o){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=An(this.ctx),o)){const i=o[2]-o[0],a=o[3]-o[1];this.ctx.rect(o[0],o[1],i,a),this.current.updateRectMinMax(An(this.ctx),o),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const o=this.ctx;t.isolated||JL("TODO: Support non-isolated groups."),t.knockout&&Ir("Knockout groups not supported.");const i=An(o);if(t.matrix&&o.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let a=$o.getAxialAlignedBoundingBox(t.bbox,An(o));const l=[0,0,o.canvas.width,o.canvas.height];a=$o.intersect(a,l)||[0,0,0,0];const d=Math.floor(a[0]),c=Math.floor(a[1]),p=Math.max(Math.ceil(a[2])-d,1),u=Math.max(Math.ceil(a[3])-c,1);this.current.startNewPathAndClipBox([0,0,p,u]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);const m=this.cachedCanvases.getCanvas(h,p,u),f=m.context;f.translate(-d,-c),f.transform(...i),t.smask?this.smaskStack.push({canvas:m.canvas,context:f,offsetX:d,offsetY:c,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(o.setTransform(1,0,0,1,0,0),o.translate(d,c),o.save()),B9(o,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(o),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const o=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const a=An(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...a);const l=$o.getAxialAlignedBoundingBox([0,0,o.canvas.width,o.canvas.height],a);this.ctx.drawImage(o.canvas,0,0),this.ctx.restore(),this.compose(l)}}beginAnnotation(t,o,i,a,l){if(this.#e(),fC(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),o){const d=o[2]-o[0],c=o[3]-o[1];if(l&&this.annotationCanvasMap){i=i.slice(),i[4]-=o[0],i[5]-=o[1],o=o.slice(),o[0]=o[1]=0,o[2]=d,o[3]=c;const[p,u]=$o.singularValueDecompose2dScale(An(this.ctx)),{viewportScale:h}=this,m=Math.ceil(d*this.outputScaleX*h),f=Math.ceil(c*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(m,f);const{canvas:x,context:y}=this.annotationCanvas;this.annotationCanvasMap.set(t,x),this.annotationCanvas.savedCtx=this.ctx,this.ctx=y,this.ctx.save(),this.ctx.setTransform(p,0,0,-u,0,c*u),fC(this.ctx)}else fC(this.ctx),this.ctx.rect(o[0],o[1],d,c),this.ctx.clip(),this.endPath()}this.current=new gpe(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...a)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const o=t.count;t=this.getObject(t.data,t),t.count=o;const i=this.ctx,a=this.processingType3;if(a&&(a.compiled===void 0&&(a.compiled=WLt(t)),a.compiled)){a.compiled(i);return}const l=this._createMaskCanvas(t),d=l.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(d,l.offsetX,l.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,o,i=0,a=0,l,d){if(!this.contentVisible)return;t=this.getObject(t.data,t);const c=this.ctx;c.save();const p=An(c);c.transform(o,i,a,l,0,0);const u=this._createMaskCanvas(t);c.setTransform(1,0,0,1,u.offsetX-p[4],u.offsetY-p[5]);for(let h=0,m=d.length;h<m;h+=2){const f=$o.transform(p,[o,i,a,l,d[h],d[h+1]]),[x,y]=$o.applyTransform([0,0],f);c.drawImage(u.canvas,x,y)}c.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const o=this.ctx,i=this.current.fillColor,a=this.current.patternFill;for(const l of t){const{data:d,width:c,height:p,transform:u}=l,h=this.cachedCanvases.getCanvas("maskCanvas",c,p),m=h.context;m.save();const f=this.getObject(d,l);xpe(m,f),m.globalCompositeOperation="source-in",m.fillStyle=a?i.getPattern(m,this,z2(o),yl.FILL):i,m.fillRect(0,0,c,p),m.restore(),o.save(),o.transform(...u),o.scale(1,-1),gC(o,h.canvas,0,0,c,p,0,-1,1,1),o.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const o=this.getObject(t);if(!o){Ir("Dependent image isn't ready yet");return}this.paintInlineImageXObject(o)}paintImageXObjectRepeat(t,o,i,a){if(!this.contentVisible)return;const l=this.getObject(t);if(!l){Ir("Dependent image isn't ready yet");return}const d=l.width,c=l.height,p=[];for(let u=0,h=a.length;u<h;u+=2)p.push({transform:[o,0,0,i,a[u],a[u+1]],x:0,y:0,w:d,h:c});this.paintInlineImageXObjectGroup(l,p)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:o,width:i,height:a}=t,l=this.cachedCanvases.getCanvas("inlineImage",i,a),d=l.context;return d.filter=this.current.transferMaps,d.drawImage(o,0,0),d.filter="none",l.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const o=t.width,i=t.height,a=this.ctx;if(this.save(),!Ks){const{filter:c}=a;c!=="none"&&c!==""&&(a.filter="none")}a.scale(1/o,-1/i);let l;if(t.bitmap)l=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)l=t;else{const p=this.cachedCanvases.getCanvas("inlineImage",o,i).context;fpe(p,t),l=this.applyTransferMapsToCanvas(p)}const d=this._scaleImage(l,z2(a));a.imageSmoothingEnabled=ype(An(a),t.interpolate),gC(a,d.img,0,0,d.paintWidth,d.paintHeight,0,-i,o,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,o){if(!this.contentVisible)return;const i=this.ctx;let a;if(t.bitmap)a=t.bitmap;else{const l=t.width,d=t.height,p=this.cachedCanvases.getCanvas("inlineImage",l,d).context;fpe(p,t),a=this.applyTransferMapsToCanvas(p)}for(const l of o)i.save(),i.transform(...l.transform),i.scale(1,-1),gC(i,a,l.x,l.y,l.w,l.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,o){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,o){t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(o)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const o=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(o||(this.pendingClip===wpe?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=An(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const o=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),a=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,a)/o}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:o,b:i,c:a,d:l}=this.ctx.getTransform();let d,c;if(i===0&&a===0){const p=Math.abs(o),u=Math.abs(l);if(p===u)if(t===0)d=c=1/p;else{const h=p*t;d=c=h<1?1/h:1}else if(t===0)d=1/p,c=1/u;else{const h=p*t,m=u*t;d=h<1?1/h:1,c=m<1?1/m:1}}else{const p=Math.abs(o*l-i*a),u=Math.hypot(o,i),h=Math.hypot(a,l);if(t===0)d=h/p,c=u/p;else{const m=t*p;d=h>m?h/m:1,c=u>m?u/m:1}}this._cachedScaleForStroking[0]=d,this._cachedScaleForStroking[1]=c}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:o}=this,{lineWidth:i}=this.current,[a,l]=this.getScaleForStroking();if(o.lineWidth=i||1,a===1&&l===1){o.stroke();return}const d=o.getLineDash();if(t&&o.save(),o.scale(a,l),d.length>0){const c=Math.max(a,l);o.setLineDash(d.map(p=>p/c)),o.lineDashOffset/=c}o.stroke(),t&&o.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const e in E1)D7.prototype[e]!==void 0&&(D7.prototype[E1[e]]=D7.prototype[e]);class lw{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 xC={DATA:1,ERROR:2},na={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Id(e){switch(e instanceof Error||typeof e=="object"&&e!==null||Pi('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new J4(e.message);case"MissingPDFException":return new Z4(e.message);case"PasswordException":return new eQ(e.message,e.code);case"UnexpectedResponseException":return new XL(e.message,e.status);case"UnknownErrorException":return new tQ(e.message,e.details);default:return new tQ(e.message,e.toString())}}class zx{constructor(t,o,i){this.sourceName=t,this.targetName=o,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=a=>{const l=a.data;if(l.targetName!==this.sourceName)return;if(l.stream){this.#t(l);return}if(l.callback){const c=l.callbackId,p=this.callbackCapabilities[c];if(!p)throw new Error(`Cannot resolve callback ${c}`);if(delete this.callbackCapabilities[c],l.callback===xC.DATA)p.resolve(l.data);else if(l.callback===xC.ERROR)p.reject(Id(l.reason));else throw new Error("Unexpected callback case");return}const d=this.actionHandler[l.action];if(!d)throw new Error(`Unknown action from worker: ${l.action}`);if(l.callbackId){const c=this.sourceName,p=l.sourceName;new Promise(function(u){u(d(l.data))}).then(function(u){i.postMessage({sourceName:c,targetName:p,callback:xC.DATA,callbackId:l.callbackId,data:u})},function(u){i.postMessage({sourceName:c,targetName:p,callback:xC.ERROR,callbackId:l.callbackId,reason:Id(u)})});return}if(l.streamId){this.#e(l);return}d(l.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,o){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=o}send(t,o,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:o},i)}sendWithPromise(t,o,i){const a=this.callbackId++,l=Promise.withResolvers();this.callbackCapabilities[a]=l;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:a,data:o},i)}catch(d){l.reject(d)}return l.promise}sendWithStream(t,o,i,a){const l=this.streamId++,d=this.sourceName,c=this.targetName,p=this.comObj;return new ReadableStream({start:u=>{const h=Promise.withResolvers();return this.streamControllers[l]={controller:u,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},p.postMessage({sourceName:d,targetName:c,action:t,streamId:l,data:o,desiredSize:u.desiredSize},a),h.promise},pull:u=>{const h=Promise.withResolvers();return this.streamControllers[l].pullCall=h,p.postMessage({sourceName:d,targetName:c,stream:na.PULL,streamId:l,desiredSize:u.desiredSize}),h.promise},cancel:u=>{Ea(u instanceof Error,"cancel must have a valid reason");const h=Promise.withResolvers();return this.streamControllers[l].cancelCall=h,this.streamControllers[l].isClosed=!0,p.postMessage({sourceName:d,targetName:c,stream:na.CANCEL,streamId:l,reason:Id(u)}),h.promise}},i)}#e(t){const o=t.streamId,i=this.sourceName,a=t.sourceName,l=this.comObj,d=this,c=this.actionHandler[t.action],p={enqueue(u,h=1,m){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=h,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),l.postMessage({sourceName:i,targetName:a,stream:na.ENQUEUE,streamId:o,chunk:u},m)},close(){this.isCancelled||(this.isCancelled=!0,l.postMessage({sourceName:i,targetName:a,stream:na.CLOSE,streamId:o}),delete d.streamSinks[o])},error(u){Ea(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,l.postMessage({sourceName:i,targetName:a,stream:na.ERROR,streamId:o,reason:Id(u)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};p.sinkCapability.resolve(),p.ready=p.sinkCapability.promise,this.streamSinks[o]=p,new Promise(function(u){u(c(t.data,p))}).then(function(){l.postMessage({sourceName:i,targetName:a,stream:na.START_COMPLETE,streamId:o,success:!0})},function(u){l.postMessage({sourceName:i,targetName:a,stream:na.START_COMPLETE,streamId:o,reason:Id(u)})})}#t(t){const o=t.streamId,i=this.sourceName,a=t.sourceName,l=this.comObj,d=this.streamControllers[o],c=this.streamSinks[o];switch(t.stream){case na.START_COMPLETE:t.success?d.startCall.resolve():d.startCall.reject(Id(t.reason));break;case na.PULL_COMPLETE:t.success?d.pullCall.resolve():d.pullCall.reject(Id(t.reason));break;case na.PULL:if(!c){l.postMessage({sourceName:i,targetName:a,stream:na.PULL_COMPLETE,streamId:o,success:!0});break}c.desiredSize<=0&&t.desiredSize>0&&c.sinkCapability.resolve(),c.desiredSize=t.desiredSize,new Promise(function(p){p(c.onPull?.())}).then(function(){l.postMessage({sourceName:i,targetName:a,stream:na.PULL_COMPLETE,streamId:o,success:!0})},function(p){l.postMessage({sourceName:i,targetName:a,stream:na.PULL_COMPLETE,streamId:o,reason:Id(p)})});break;case na.ENQUEUE:if(Ea(d,"enqueue should have stream controller"),d.isClosed)break;d.controller.enqueue(t.chunk);break;case na.CLOSE:if(Ea(d,"close should have stream controller"),d.isClosed)break;d.isClosed=!0,d.controller.close(),this.#o(d,o);break;case na.ERROR:Ea(d,"error should have stream controller"),d.controller.error(Id(t.reason)),this.#o(d,o);break;case na.CANCEL_COMPLETE:t.success?d.cancelCall.resolve():d.cancelCall.reject(Id(t.reason)),this.#o(d,o);break;case na.CANCEL:if(!c)break;new Promise(function(p){p(c.onCancel?.(Id(t.reason)))}).then(function(){l.postMessage({sourceName:i,targetName:a,stream:na.CANCEL_COMPLETE,streamId:o,success:!0})},function(p){l.postMessage({sourceName:i,targetName:a,stream:na.CANCEL_COMPLETE,streamId:o,reason:Id(p)})}),c.sinkCapability.reject(Id(t.reason)),c.isCancelled=!0,delete this.streamSinks[o];break;default:throw new Error("Unexpected stream case")}}async#o(t,o){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[o]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}class qLt{#e;#t;constructor({parsedData:t,rawData:o}){this.#e=t,this.#t=o}getRaw(){return this.#t}get(t){return this.#e.get(t)??null}getAll(){return BY(this.#e)}has(t){return this.#e.has(t)}}const Sh=Symbol("INTERNAL");class ZLt{#e=!1;#t=!1;#o=!1;#i=!0;constructor(t,{name:o,intent:i,usage:a}){this.#e=!!(t&vc.DISPLAY),this.#t=!!(t&vc.PRINT),this.name=o,this.intent=i,this.usage=a}get visible(){if(this.#o)return this.#i;if(!this.#i)return!1;const{print:t,view:o}=this.usage;return this.#e?o?.viewState!=="OFF":this.#t?t?.printState!=="OFF":!0}_setVisible(t,o,i=!1){t!==Sh&&Pi("Internal method `_setVisible` called."),this.#o=i,this.#i=o}}class JLt{#e=null;#t=new Map;#o=null;#i=null;constructor(t,o=vc.DISPLAY){if(this.renderingIntent=o,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,this.#i=t.order;for(const i of t.groups)this.#t.set(i.id,new ZLt(o,i));if(t.baseState==="OFF")for(const i of this.#t.values())i._setVisible(Sh,!1);for(const i of t.on)this.#t.get(i)._setVisible(Sh,!0);for(const i of t.off)this.#t.get(i)._setVisible(Sh,!1);this.#o=this.getHash()}}#s(t){const o=t.length;if(o<2)return!0;const i=t[0];for(let a=1;a<o;a++){const l=t[a];let d;if(Array.isArray(l))d=this.#s(l);else if(this.#t.has(l))d=this.#t.get(l).visible;else return Ir(`Optional content group not found: ${l}`),!0;switch(i){case"And":if(!d)return!1;break;case"Or":if(d)return!0;break;case"Not":return!d;default:return!0}}return i==="And"}isVisible(t){if(this.#t.size===0)return!0;if(!t)return JL("Optional content group not defined."),!0;if(t.type==="OCG")return this.#t.has(t.id)?this.#t.get(t.id).visible:(Ir(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return this.#s(t.expression);if(!t.policy||t.policy==="AnyOn"){for(const o of t.ids){if(!this.#t.has(o))return Ir(`Optional content group not found: ${o}`),!0;if(this.#t.get(o).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const o of t.ids){if(!this.#t.has(o))return Ir(`Optional content group not found: ${o}`),!0;if(!this.#t.get(o).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const o of t.ids){if(!this.#t.has(o))return Ir(`Optional content group not found: ${o}`),!0;if(!this.#t.get(o).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const o of t.ids){if(!this.#t.has(o))return Ir(`Optional content group not found: ${o}`),!0;if(this.#t.get(o).visible)return!1}return!0}return Ir(`Unknown optional content policy ${t.policy}.`),!0}return Ir(`Unknown group type ${t.type}.`),!0}setVisibility(t,o=!0){const i=this.#t.get(t);if(!i){Ir(`Optional content group not found: ${t}`);return}i._setVisible(Sh,!!o,!0),this.#e=null}setOCGState({state:t,preserveRB:o}){let i;for(const a of t){switch(a){case"ON":case"OFF":case"Toggle":i=a;continue}const l=this.#t.get(a);if(l)switch(i){case"ON":l._setVisible(Sh,!0);break;case"OFF":l._setVisible(Sh,!1);break;case"Toggle":l._setVisible(Sh,!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?BY(this.#t):null}getGroup(t){return this.#t.get(t)||null}getHash(){if(this.#e!==null)return this.#e;const t=new zEe;for(const[o,i]of this.#t)t.update(`${o}:${i.visible}`);return this.#e=t.hexdigest()}}class XLt{constructor(t,{disableRange:o=!1,disableStream:i=!1}){Ea(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:a,initialData:l,progressiveDone:d,contentDispositionFilename:c}=t;if(this._queuedChunks=[],this._progressiveDone=d,this._contentDispositionFilename=c,l?.length>0){const p=l instanceof Uint8Array&&l.byteLength===l.buffer.byteLength?l.buffer:new Uint8Array(l).buffer;this._queuedChunks.push(p)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!o,this._contentLength=a,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((p,u)=>{this._onReceiveData({begin:p,chunk:u})}),t.addProgressListener((p,u)=>{this._onProgress({loaded:p,total:u})}),t.addProgressiveReadListener(p=>{this._onReceiveData({chunk:p})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:o}){const i=o instanceof Uint8Array&&o.byteLength===o.buffer.byteLength?o.buffer:new Uint8Array(o).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{const a=this._rangeReaders.some(function(l){return l._begin!==t?!1:(l._enqueue(i),!0)});Ea(a,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){t.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const o=this._rangeReaders.indexOf(t);o>=0&&this._rangeReaders.splice(o,1)}getFullReader(){Ea(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new eIt(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,o){if(o<=this._progressiveDataLength)return null;const i=new tIt(this,t,o);return this._pdfDataRangeTransport.requestDataRange(t,o),this._rangeReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeReaders.slice(0))o.cancel(t);this._pdfDataRangeTransport.abort()}}class eIt{constructor(t,o,i=!1,a=null){this._stream=t,this._done=i||!1,this._filename=RY(a)?a:null,this._queuedChunks=o||[],this._loaded=0;for(const l of this._queuedChunks)this._loaded+=l.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class tIt{constructor(t,o,i){this._stream=t,this._begin=o,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const o=this._queuedChunk;return this._queuedChunk=null,{value:o,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function oIt(e){let t=!0,o=i("filename\\*","i").exec(e);if(o){o=o[1];let h=c(o);return h=unescape(h),h=p(h),h=u(h),l(h)}if(o=d(e),o){const h=u(o);return l(h)}if(o=i("filename","i").exec(e),o){o=o[1];let h=c(o);return h=u(h),l(h)}function i(h,m){return new RegExp("(?:^|;)\\s*"+h+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',m)}function a(h,m){if(h){if(!/^[\x00-\xFF]+$/.test(m))return m;try{const f=new TextDecoder(h,{fatal:!0}),x=eI(m);m=f.decode(x),t=!1}catch{}}return m}function l(h){return t&&/[\x80-\xff]/.test(h)&&(h=a("utf-8",h),t&&(h=a("iso-8859-1",h))),h}function d(h){const m=[];let f;const x=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=x.exec(h))!==null;){let[,w,b,v]=f;if(w=parseInt(w,10),w in m){if(w===0)break;continue}m[w]=[b,v]}const y=[];for(let w=0;w<m.length&&w in m;++w){let[b,v]=m[w];v=c(v),b&&(v=unescape(v),w===0&&(v=p(v))),y.push(v)}return y.join("")}function c(h){if(h.startsWith('"')){const m=h.slice(1).split('\\"');for(let f=0;f<m.length;++f){const x=m[f].indexOf('"');x!==-1&&(m[f]=m[f].slice(0,x),m.length=f+1),m[f]=m[f].replaceAll(/\\(.)/g,"$1")}h=m.join('"')}return h}function p(h){const m=h.indexOf("'");if(m===-1)return h;const f=h.slice(0,m),y=h.slice(m+1).replace(/^[^']*'/,"");return a(f,y)}function u(h){return!h.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(h)?h:h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(m,f,x,y){if(x==="q"||x==="Q")return y=y.replaceAll("_"," "),y=y.replaceAll(/=([0-9a-fA-F]{2})/g,function(w,b){return String.fromCharCode(parseInt(b,16))}),a(f,y);try{y=atob(y)}catch{}return a(f,y)})}return""}function QY({getResponseHeader:e,isHttp:t,rangeChunkSize:o,disableRange:i}){const a={allowRangeRequests:!1,suggestedLength:void 0},l=parseInt(e("Content-Length"),10);return!Number.isInteger(l)||(a.suggestedLength=l,l<=2*o)||i||!t||e("Accept-Ranges")!=="bytes"||(e("Content-Encoding")||"identity")!=="identity"||(a.allowRangeRequests=!0),a}function UY(e){const t=e("Content-Disposition");if(t){let o=oIt(t);if(o.includes("%"))try{o=decodeURIComponent(o)}catch{}if(RY(o))return o}return null}function aI(e,t){return e===404||e===0&&t.startsWith("file:")?new Z4('Missing PDF "'+t+'".'):new XL(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)}function OEe(e){return e===200||e===206}function NEe(e,t,o){return{method:"GET",headers:e,signal:o.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function HEe(e){const t=new Headers;for(const o in e){const i=e[o];i!==void 0&&t.append(o,i)}return t}function _Ee(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(Ir(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}class bpe{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 Ea(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new rIt(this),this._fullRequestReader}getRangeReader(t,o){if(o<=this._progressiveDataLength)return null;const i=new iIt(this,t,o);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeRequestReaders.slice(0))o.cancel(t)}}class rIt{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const o=t.source;this._withCredentials=o.withCredentials||!1,this._contentLength=o.length,this._headersCapability=Promise.withResolvers(),this._disableRange=o.disableRange||!1,this._rangeChunkSize=o.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!o.disableStream,this._isRangeSupported=!o.disableRange,this._headers=HEe(this._stream.httpHeaders);const i=o.url;fetch(i,NEe(this._headers,this._withCredentials,this._abortController)).then(a=>{if(!OEe(a.status))throw aI(a.status,i);this._reader=a.body.getReader(),this._headersCapability.resolve();const l=p=>a.headers.get(p),{allowRangeRequests:d,suggestedLength:c}=QY({getResponseHeader:l,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=d,this._contentLength=c||this._contentLength,this._filename=UY(l),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new J4("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:o}=await this._reader.read();return o?{value:t,done:o}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:_Ee(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class iIt{constructor(t,o,i){this._stream=t,this._reader=null,this._loaded=0;const a=t.source;this._withCredentials=a.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!a.disableStream,this._abortController=new AbortController,this._headers=HEe(this._stream.httpHeaders),this._headers.append("Range",`bytes=${o}-${i-1}`);const l=a.url;fetch(l,NEe(this._headers,this._withCredentials,this._abortController)).then(d=>{if(!OEe(d.status))throw aI(d.status,l);this._readCapability.resolve(),this._reader=d.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:o}=await this._reader.read();return o?{value:t,done:o}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:_Ee(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}const xO=200,yO=206;function nIt(e){const t=e.response;return typeof t!="string"?t:eI(t).buffer}class aIt{constructor(t,o={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&o.httpHeaders||Object.create(null),this.withCredentials=o.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,o,i){const a={begin:t,end:o};for(const l in i)a[l]=i[l];return this.request(a)}requestFull(t){return this.request(t)}request(t){const o=new XMLHttpRequest,i=this.currXhrId++,a=this.pendingRequests[i]={xhr:o};o.open("GET",this.url),o.withCredentials=this.withCredentials;for(const l in this.httpHeaders){const d=this.httpHeaders[l];d!==void 0&&o.setRequestHeader(l,d)}return this.isHttp&&"begin"in t&&"end"in t?(o.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),a.expectedStatus=yO):a.expectedStatus=xO,o.responseType="arraybuffer",t.onError&&(o.onerror=function(l){t.onError(o.status)}),o.onreadystatechange=this.onStateChange.bind(this,i),o.onprogress=this.onProgress.bind(this,i),a.onHeadersReceived=t.onHeadersReceived,a.onDone=t.onDone,a.onError=t.onError,a.onProgress=t.onProgress,o.send(null),i}onProgress(t,o){const i=this.pendingRequests[t];i&&i.onProgress?.(o)}onStateChange(t,o){const i=this.pendingRequests[t];if(!i)return;const a=i.xhr;if(a.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),a.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],a.status===0&&this.isHttp){i.onError?.(a.status);return}const l=a.status||xO;if(!(l===xO&&i.expectedStatus===yO)&&l!==i.expectedStatus){i.onError?.(a.status);return}const c=nIt(a);if(l===yO){const p=a.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(p);i.onDone({begin:parseInt(u[1],10),chunk:c})}else c?i.onDone({begin:0,chunk:c}):i.onError?.(a.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const o=this.pendingRequests[t].xhr;delete this.pendingRequests[t],o.abort()}}class sIt{constructor(t){this._source=t,this._manager=new aIt(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const o=this._rangeRequestReaders.indexOf(t);o>=0&&this._rangeRequestReaders.splice(o,1)}getFullReader(){return Ea(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new lIt(this._manager,this._source),this._fullRequestReader}getRangeReader(t,o){const i=new dIt(this._manager,t,o);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeRequestReaders.slice(0))o.cancel(t)}}class lIt{constructor(t,o){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=o.url,this._fullRequestId=t.requestFull(i),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=o.disableRange||!1,this._contentLength=o.length,this._rangeChunkSize=o.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,o=this._manager.getRequestXhr(t),i=d=>o.getResponseHeader(d),{allowRangeRequests:a,suggestedLength:l}=QY({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=l||this._contentLength,this._filename=UY(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=aI(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const o of this._requests)o.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class dIt{constructor(t,o,i){this._manager=t;const a={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(o,i,a),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const o=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:o,done:!1}):this._queuedChunk=o,this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=aI(t,this._url);for(const o of this._requests)o.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const o=this._queuedChunk;return this._queuedChunk=null,{value:o,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const VEe=/^file:\/\/\/[a-zA-Z]:\//;function cIt(e){const t=t2.get("url"),o=t.parse(e);return o.protocol==="file:"||o.host?o:/^[a-z]:[/\\]/i.test(e)?t.parse(`file:///${e}`):(o.host||(o.protocol="file:"),o)}class pIt{constructor(t){this.source=t,this.url=cIt(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 Ea(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new mIt(this):new uIt(this),this._fullRequestReader}getRangeReader(t,o){if(o<=this._progressiveDataLength)return null;const i=this.isFsUrl?new gIt(this,t,o):new hIt(this,t,o);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeRequestReaders.slice(0))o.cancel(t)}}class QEe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const o=t.source;this._contentLength=o.length,this._loaded=0,this._filename=null,this._disableRange=o.disableRange||!1,this._rangeChunkSize=o.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!o.disableStream,this._isRangeSupported=!o.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",o=>{this._error(o)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new J4("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class UEe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const o=t.source;this._isStreamingSupported=!o.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",o=>{this._error(o)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function lS(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class uIt extends QEe{constructor(t){super(t);const o=i=>{if(i.statusCode===404){const c=new Z4(`Missing PDF "${this._url}".`);this._storedError=c,this._headersCapability.reject(c);return}this._headersCapability.resolve(),this._setReadableStream(i);const a=c=>this._readableStream.headers[c.toLowerCase()],{allowRangeRequests:l,suggestedLength:d}=QY({getResponseHeader:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=l,this._contentLength=d||this._contentLength,this._filename=UY(a)};if(this._request=null,this._url.protocol==="http:"){const i=t2.get("http");this._request=i.request(lS(this._url,t.httpHeaders),o)}else{const i=t2.get("https");this._request=i.request(lS(this._url,t.httpHeaders),o)}this._request.on("error",i=>{this._storedError=i,this._headersCapability.reject(i)}),this._request.end()}}class hIt extends UEe{constructor(t,o,i){super(t),this._httpHeaders={};for(const l in t.httpHeaders){const d=t.httpHeaders[l];d!==void 0&&(this._httpHeaders[l]=d)}this._httpHeaders.Range=`bytes=${o}-${i-1}`;const a=l=>{if(l.statusCode===404){const d=new Z4(`Missing PDF "${this._url}".`);this._storedError=d;return}this._setReadableStream(l)};if(this._request=null,this._url.protocol==="http:"){const l=t2.get("http");this._request=l.request(lS(this._url,this._httpHeaders),a)}else{const l=t2.get("https");this._request=l.request(lS(this._url,this._httpHeaders),a)}this._request.on("error",l=>{this._storedError=l}),this._request.end()}}class mIt extends QEe{constructor(t){super(t);let o=decodeURIComponent(this._url.path);VEe.test(this._url.href)&&(o=o.replace(/^\//,""));const i=t2.get("fs");i.promises.lstat(o).then(a=>{this._contentLength=a.size,this._setReadableStream(i.createReadStream(o)),this._headersCapability.resolve()},a=>{a.code==="ENOENT"&&(a=new Z4(`Missing PDF "${o}".`)),this._storedError=a,this._headersCapability.reject(a)})}}class gIt extends UEe{constructor(t,o,i){super(t);let a=decodeURIComponent(this._url.path);VEe.test(this._url.href)&&(a=a.replace(/^\//,""));const l=t2.get("fs");this._setReadableStream(l.createReadStream(a,{start:o,end:i-1}))}}const fIt=1e5,Nl=30,xIt=.8;let dS=class du{#e=Promise.withResolvers();#t=null;#o=!1;#i=!!globalThis.FontInspector?.enabled;#s=null;#r=null;#n=0;#l=0;#c=null;#p=null;#h=0;#d=0;#a=Object.create(null);#m=[];#f=null;#u=[];#y=new WeakMap;#g=null;static#w=new Map;static#v=new Map;static#A=null;static#k=new Set;constructor({textContentSource:t,container:o,viewport:i}){if(t instanceof ReadableStream)this.#f=t;else if(typeof t=="object")this.#f=new ReadableStream({start(p){p.enqueue(t),p.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#p=o,this.#d=i.scale*(globalThis.devicePixelRatio||1),this.#h=i.rotation,this.#r={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null};const{pageWidth:a,pageHeight:l,pageX:d,pageY:c}=i.rawDims;this.#g=[1,0,0,-1,-d,c+l],this.#l=a,this.#n=l,du.#x(),j4(o,i),this.#e.promise.catch(()=>{}).then(()=>{du.#k.delete(this),this.#r=null,this.#a=null})}render(){const t=()=>{this.#c.read().then(({value:o,done:i})=>{if(i){this.#e.resolve();return}this.#s??=o.lang,Object.assign(this.#a,o.styles),this.#S(o.items),t()},this.#e.reject)};return this.#c=this.#f.getReader(),du.#k.add(this),t(),this.#e.promise}update({viewport:t,onBefore:o=null}){const i=t.scale*(globalThis.devicePixelRatio||1),a=t.rotation;if(a!==this.#h&&(o?.(),this.#h=a,j4(this.#p,{rotation:a})),i!==this.#d){o?.(),this.#d=i;const l={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:du.#b(this.#s)};for(const d of this.#u)l.properties=this.#y.get(d),l.div=d,this.#$(l)}}cancel(){const t=new J4("TextLayer task cancelled.");this.#c?.cancel(t).catch(()=>{}),this.#c=null,this.#e.reject(t)}get textDivs(){return this.#u}get textContentItemsStr(){return this.#m}#S(t){if(this.#o)return;this.#r.ctx??=du.#b(this.#s);const o=this.#u,i=this.#m;for(const a of t){if(o.length>fIt){Ir("Ignoring additional textDivs for performance reasons."),this.#o=!0;return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const l=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),a.id!==null&&this.#t.setAttribute("id",`${a.id}`),l.append(this.#t)}else a.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}i.push(a.str),this.#j(a)}}#j(t){const o=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};this.#u.push(o);const a=$o.transform(this.#g,t.transform);let l=Math.atan2(a[1],a[0]);const d=this.#a[t.fontName];d.vertical&&(l+=Math.PI/2);const c=this.#i&&d.fontSubstitution||d.fontFamily,p=Math.hypot(a[2],a[3]),u=p*du.#C(c,this.#s);let h,m;l===0?(h=a[4],m=a[5]-u):(h=a[4]+u*Math.sin(l),m=a[5]-u*Math.cos(l));const f="calc(var(--scale-factor)*",x=o.style;this.#t===this.#p?(x.left=`${(100*h/this.#l).toFixed(2)}%`,x.top=`${(100*m/this.#n).toFixed(2)}%`):(x.left=`${f}${h.toFixed(2)}px)`,x.top=`${f}${m.toFixed(2)}px)`),x.fontSize=`${f}${(du.#A*p).toFixed(2)}px)`,x.fontFamily=c,i.fontSize=p,o.setAttribute("role","presentation"),o.textContent=t.str,o.dir=t.dir,this.#i&&(o.dataset.fontName=d.fontSubstitutionLoadedName||t.fontName),l!==0&&(i.angle=l*(180/Math.PI));let y=!1;if(t.str.length>1)y=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const w=Math.abs(t.transform[0]),b=Math.abs(t.transform[3]);w!==b&&Math.max(w,b)/Math.min(w,b)>1.5&&(y=!0)}if(y&&(i.canvasWidth=d.vertical?t.height:t.width),this.#y.set(o,i),this.#r.div=o,this.#r.properties=i,this.#$(this.#r),i.hasText&&this.#t.append(o),i.hasEOL){const w=document.createElement("br");w.setAttribute("role","presentation"),this.#t.append(w)}}#$(t){const{div:o,properties:i,ctx:a,prevFontSize:l,prevFontFamily:d}=t,{style:c}=o;let p="";if(du.#A>1&&(p=`scale(${1/du.#A})`),i.canvasWidth!==0&&i.hasText){const{fontFamily:u}=c,{canvasWidth:h,fontSize:m}=i;(l!==m||d!==u)&&(a.font=`${m*this.#d}px ${u}`,t.prevFontSize=m,t.prevFontFamily=u);const{width:f}=a.measureText(o.textContent);f>0&&(p=`scaleX(${h*this.#d/f}) ${p}`)}i.angle!==0&&(p=`rotate(${i.angle}deg) ${p}`),p.length>0&&(c.transform=p)}static cleanup(){if(!(this.#k.size>0)){this.#w.clear();for(const{canvas:t}of this.#v.values())t.remove();this.#v.clear()}}static#b(t=null){let o=this.#v.get(t||="");if(!o){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),o=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#v.set(t,o)}return o}static#x(){if(this.#A!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),this.#A=t.getBoundingClientRect().height,t.remove()}static#C(t,o){const i=this.#w.get(t);if(i)return i;const a=this.#b(o),l=a.font;a.canvas.width=a.canvas.height=Nl,a.font=`${Nl}px ${t}`;const d=a.measureText("");let c=d.fontBoundingBoxAscent,p=Math.abs(d.fontBoundingBoxDescent);if(c){const m=c/(c+p);return this.#w.set(t,m),a.canvas.width=a.canvas.height=0,a.font=l,m}a.strokeStyle="red",a.clearRect(0,0,Nl,Nl),a.strokeText("g",0,0);let u=a.getImageData(0,0,Nl,Nl).data;p=0;for(let m=u.length-1-3;m>=0;m-=4)if(u[m]>0){p=Math.ceil(m/4/Nl);break}a.clearRect(0,0,Nl,Nl),a.strokeText("A",0,Nl),u=a.getImageData(0,0,Nl,Nl).data,c=0;for(let m=0,f=u.length;m<f;m+=4)if(u[m]>0){c=Nl-Math.floor(m/4/Nl);break}a.canvas.width=a.canvas.height=0,a.font=l;const h=c?c/(c+p):xIt;return this.#w.set(t,h),h}};function yIt(){PEe("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:e,container:t,viewport:o,...i}=arguments[0],a=Object.keys(i);a.length>0&&Ir("Ignoring `renderTextLayer` parameters: "+a.join(", "));const l=new dS({textContentSource:e,container:t,viewport:o}),{textDivs:d,textContentItemsStr:c}=l;return{promise:l.render(),textDivs:d,textContentItemsStr:c}}function wIt(){PEe("`updateTextLayer`, please use `TextLayer` instead.")}class dw{static textContent(t){const o=[],i={items:o,styles:Object.create(null)};function a(l){if(!l)return;let d=null;const c=l.name;if(c==="#text")d=l.value;else if(dw.shouldBuildText(c))l?.attributes?.textContent?d=l.attributes.textContent:l.value&&(d=l.value);else return;if(d!==null&&o.push({str:d}),!!l.children)for(const p of l.children)a(p)}return a(t),i}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const bIt=65536,vIt=100,CIt=5e3,AIt=Ks?PLt:vLt,$It=Ks?TLt:BEe,kIt=Ks?DLt:bLt,SIt=Ks?zLt:DEe;function EIt(e={}){typeof e=="string"||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t=new WY,{docId:o}=t,i=e.url?LIt(e.url):null,a=e.data?IIt(e.data):null,l=e.httpHeaders||null,d=e.withCredentials===!0,c=e.password??null,p=e.range instanceof WEe?e.range:null,u=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:bIt;let h=e.worker instanceof kc?e.worker:null;const m=e.verbosity,f=typeof e.docBaseUrl=="string"&&!zY(e.docBaseUrl)?e.docBaseUrl:null,x=typeof e.cMapUrl=="string"?e.cMapUrl:null,y=e.cMapPacked!==!1,w=e.CMapReaderFactory||$It,b=typeof e.standardFontDataUrl=="string"?e.standardFontDataUrl:null,v=e.StandardFontDataFactory||SIt,A=e.stopAtErrors!==!0,S=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,E=e.isEvalSupported!==!1,j=typeof e.isOffscreenCanvasSupported=="boolean"?e.isOffscreenCanvasSupported:!Ks,L=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,M=typeof e.disableFontFace=="boolean"?e.disableFontFace:Ks,D=e.fontExtraProperties===!0,P=e.enableXfa===!0,T=e.ownerDocument||globalThis.document,z=e.disableRange===!0,R=e.disableStream===!0,K=e.disableAutoFetch===!0,Z=e.pdfBug===!0,O=e.enableHWA===!0,Q=p?p.length:e.length??NaN,_=typeof e.useSystemFonts=="boolean"?e.useSystemFonts:!Ks&&!M,F=typeof e.useWorkerFetch=="boolean"?e.useWorkerFetch:w===BEe&&v===DEe&&x&&b&&Tx(x,document.baseURI)&&Tx(b,document.baseURI),N=e.canvasFactory||new AIt({ownerDocument:T,enableHWA:O}),H=e.filterFactory||new kIt({docId:o,ownerDocument:T}),ee=null;dLt(m);const Y={canvasFactory:N,filterFactory:H};if(F||(Y.cMapReaderFactory=new w({baseUrl:x,isCompressed:y}),Y.standardFontDataFactory=new v({baseUrl:b})),!h){const X={verbosity:m,port:lw.workerPort};h=X.port?kc.fromPort(X):new kc(X),t._worker=h}const G={docId:o,apiVersion:"4.4.168",data:a,password:c,disableAutoFetch:K,rangeChunkSize:u,length:Q,docBaseUrl:f,enableXfa:P,evaluatorOptions:{maxImageSize:S,disableFontFace:M,ignoreErrors:A,isEvalSupported:E,isOffscreenCanvasSupported:j,canvasMaxAreaInBytes:L,fontExtraProperties:D,useSystemFonts:_,cMapUrl:F?x:null,standardFontDataUrl:F?b:null}},J={disableFontFace:M,fontExtraProperties:D,ownerDocument:T,pdfBug:Z,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 X=h.messageHandler.sendWithPromise("GetDocRequest",G,a?[a.buffer]:null);let ie;if(p)ie=new XLt(p,{disableRange:z,disableStream:R});else if(!a){if(!i)throw new Error("getDocument - no `url` parameter provided.");ie=(me=>Ks?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&Tx(me.url)?new bpe(me):new pIt(me):Tx(me.url)?new bpe(me):new sIt(me))({url:i,length:Q,httpHeaders:l,withCredentials:d,rangeChunkSize:u,disableRange:z,disableStream:R})}return X.then(we=>{if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const me=new zx(o,we,h.port),de=new DIt(me,t,ie,J,Y);t._transport=de,me.send("Ready",null)})}).catch(t._capability.reject),t}function LIt(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(Ks&&typeof e=="string")return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function IIt(e){if(Ks&&typeof J$<"u"&&e instanceof J$)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 eI(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 vpe(e){return typeof e=="object"&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0}class WY{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${WY.#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 WEe=class{constructor(t,o,i=!1,a=null){this.length=t,this.initialData=o,this.progressiveDone=i,this.contentDispositionFilename=a,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,o){for(const i of this._rangeListeners)i(t,o)}onDataProgress(t,o){this._readyCapability.promise.then(()=>{for(const i of this._progressListeners)i(t,o)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const o of this._progressiveReadListeners)o(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,o){Pi("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class jIt{constructor(t,o){this._pdfInfo=t,this._transport=o}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return ni(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:o}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(o)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class MIt{#e=null;#t=!1;constructor(t,o,i,a=!1){this._pageIndex=t,this._pageInfo=o,this._transport=i,this._stats=a?new spe:null,this._pdfBug=a,this.commonObjs=i.commonObjs,this.objs=new GEe,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:o=this.rotate,offsetX:i=0,offsetY:a=0,dontFlip:l=!1}={}){return new mb({viewBox:this.view,scale:t,rotation:o,offsetX:i,offsetY:a,dontFlip:l})}getAnnotations({intent:t="display"}={}){const{renderingIntent:o}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,o)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return ni(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:o,intent:i="display",annotationMode:a=Oh.ENABLE,transform:l=null,background:d=null,optionalContentConfigPromise:c=null,annotationCanvasMap:p=null,pageColors:u=null,printAnnotationStorage:h=null}){this._stats?.time("Overall");const m=this._transport.getRenderingIntent(i,a,h),{renderingIntent:f,cacheKey:x}=m;this.#t=!1,this.#i(),c||=this._transport.getOptionalContentConfig(f);let y=this._intentStates.get(x);y||(y=Object.create(null),this._intentStates.set(x,y)),y.streamReaderCancelTimeout&&(clearTimeout(y.streamReaderCancelTimeout),y.streamReaderCancelTimeout=null);const w=!!(f&vc.PRINT);y.displayReadyCapability||(y.displayReadyCapability=Promise.withResolvers(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(m));const b=S=>{y.renderTasks.delete(v),(this._maybeCleanupAfterRender||w)&&(this.#t=!0),this.#o(!w),S?(v.capability.reject(S),this._abortOperatorList({intentState:y,reason:S instanceof Error?S:new Error(S)})):v.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},v=new f7({callback:b,params:{canvasContext:t,viewport:o,transform:l,background:d},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:p,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!w,pdfBug:this._pdfBug,pageColors:u});(y.renderTasks||=new Set).add(v);const A=v.task;return Promise.all([y.displayReadyCapability.promise,c]).then(([S,E])=>{if(this.destroyed){b();return}if(this._stats?.time("Rendering"),!(E.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");v.initializeGraphics({transparency:S,optionalContentConfig:E}),v.operatorListChanged()}).catch(b),A}getOperatorList({intent:t="display",annotationMode:o=Oh.ENABLE,printAnnotationStorage:i=null}={}){function a(){d.operatorList.lastChunk&&(d.opListReadCapability.resolve(d.operatorList),d.renderTasks.delete(c))}const l=this._transport.getRenderingIntent(t,o,i,!0);let d=this._intentStates.get(l.cacheKey);d||(d=Object.create(null),this._intentStates.set(l.cacheKey,d));let c;return d.opListReadCapability||(c=Object.create(null),c.operatorListChanged=a,d.opListReadCapability=Promise.withResolvers(),(d.renderTasks||=new Set).add(c),d.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(l)),d.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:o=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:o===!0},{highWaterMark:100,size(a){return a.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>dw.textContent(i));const o=this.streamTextContent(t);return new Promise(function(i,a){function l(){d.read().then(function({value:p,done:u}){if(u){i(c);return}c.lang??=p.lang,Object.assign(c.styles,p.styles),c.items.push(...p.items),l()},a)}const d=o.getReader(),c={items:[],styles:Object.create(null),lang:null};l()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const o of this._intentStates.values())if(this._abortOperatorList({intentState:o,reason:new Error("Page was destroyed."),force:!0}),!o.opListReadCapability)for(const i of o.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),this.#t=!1,this.#i(),Promise.all(t)}cleanup(t=!1){this.#t=!0;const o=this.#o(!1);return t&&o&&(this._stats&&=new spe),o}#o(t=!1){if(this.#i(),!this.#t||this.destroyed)return!1;if(t)return this.#e=setTimeout(()=>{this.#e=null,this.#o(!1)},CIt),!1;for(const{renderTasks:o,operatorList:i}of this._intentStates.values())if(o.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}#i(){this.#e&&(clearTimeout(this.#e),this.#e=null)}_startRenderPage(t,o){const i=this._intentStates.get(o);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,o){for(let i=0,a=t.length;i<a;i++)o.operatorList.fnArray.push(t.fnArray[i]),o.operatorList.argsArray.push(t.argsArray[i]);o.operatorList.lastChunk=t.lastChunk,o.operatorList.separateAnnots=t.separateAnnots;for(const i of o.renderTasks)i.operatorListChanged();t.lastChunk&&this.#o(!0)}_pumpOperatorList({renderingIntent:t,cacheKey:o,annotationStorageSerializable:i}){const{map:a,transfer:l}=i,c=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:o,annotationStorage:a},l).getReader(),p=this._intentStates.get(o);p.streamReader=c;const u=()=>{c.read().then(({value:h,done:m})=>{if(m){p.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,p),u())},h=>{if(p.streamReader=null,!this._transport.destroyed){if(p.operatorList){p.operatorList.lastChunk=!0;for(const m of p.renderTasks)m.operatorListChanged();this.#o(!0)}if(p.displayReadyCapability)p.displayReadyCapability.reject(h);else if(p.opListReadCapability)p.opListReadCapability.reject(h);else throw h}})};u()}_abortOperatorList({intentState:t,reason:o,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(o instanceof TY){let a=vIt;o.extraDelay>0&&o.extraDelay<1e3&&(a+=o.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:o,force:!0})},a);return}}if(t.streamReader.cancel(new J4(o.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[a,l]of this._intentStates)if(l===t){this._intentStates.delete(a);break}this.cleanup()}}}get stats(){return this._stats}}class BIt{#e=new Set;#t=Promise.resolve();postMessage(t,o){const i={data:structuredClone(t,o?{transfer:o}:null)};this.#t.then(()=>{for(const a of this.#e)a.call(this,i)})}addEventListener(t,o){this.#e.add(o)}removeEventListener(t,o){this.#e.delete(o)}terminate(){this.#e.clear()}}const q2={isWorkerDisabled:!1,fakeWorkerId:0};Ks&&(q2.isWorkerDisabled=!0,lw.workerSrc||="./pdf.worker.mjs"),q2.isSameOrigin=function(e,t){let o;try{if(o=new URL(e),!o.origin||o.origin==="null")return!1}catch{return!1}const i=new URL(t,o);return o.origin===i.origin},q2.createCDNWrapper=function(e){const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};class kc{static#e;constructor({name:t=null,port:o=null,verbosity:i=cLt()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,o){if(kc.#e?.has(o))throw new Error("Cannot use more than one PDFWorker per port.");(kc.#e||=new WeakMap).set(o,this),this._initializeFromPort(o);return}this._initialize()}get promise(){return Ks?Promise.all([t2.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 zx("main","worker",t),this._messageHandler.on("ready",function(){}),this.#t()}_initialize(){if(q2.isWorkerDisabled||kc.#o){this._setupFakeWorker();return}let{workerSrc:t}=kc;try{q2.isSameOrigin(window.location.href,t)||(t=q2.createCDNWrapper(new URL(t,window.location).href));const o=new Worker(t,{type:"module"}),i=new zx("main","worker",o),a=()=>{l.abort(),i.destroy(),o.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},l=new AbortController;o.addEventListener("error",()=>{this._webWorker||a()},{signal:l.signal}),i.on("test",c=>{if(l.abort(),this.destroyed||!c){a();return}this._messageHandler=i,this._port=o,this._webWorker=o,this.#t()}),i.on("ready",c=>{if(l.abort(),this.destroyed){a();return}try{d()}catch{this._setupFakeWorker()}});const d=()=>{const c=new Uint8Array;i.send("test",c,[c.buffer])};d();return}catch{JL("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){q2.isWorkerDisabled||(Ir("Setting up fake worker."),q2.isWorkerDisabled=!0),kc._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const o=new BIt;this._port=o;const i=`fake${q2.fakeWorkerId++}`,a=new zx(i+"_worker",i,o);t.setup(a,o),this._messageHandler=new zx(i,i+"_worker",o),this.#t()}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),kc.#e?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const o=this.#e?.get(t.port);if(o){if(o._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return o}return new kc(t)}static get workerSrc(){if(lw.workerSrc)return lw.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#o(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return ni(this,"_setupFakeWorkerGlobal",(async()=>this.#o?this.#o:(await import(this.workerSrc)).WorkerMessageHandler)())}}class DIt{#e=new Map;#t=new Map;#o=new Map;#i=new Map;#s=null;constructor(t,o,i,a,l){this.messageHandler=t,this.loadingTask=o,this.commonObjs=new GEe,this.fontLoader=new MLt({ownerDocument:a.ownerDocument,styleElement:a.styleElement}),this.loadingParams=a.loadingParams,this._params=a,this.canvasFactory=l.canvasFactory,this.filterFactory=l.filterFactory,this.cMapReaderFactory=l.cMapReaderFactory,this.standardFontDataFactory=l.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#r(t,o=null){const i=this.#e.get(t);if(i)return i;const a=this.messageHandler.sendWithPromise(t,o);return this.#e.set(t,a),a}get annotationStorage(){return ni(this,"annotationStorage",new _Y)}getRenderingIntent(t,o=Oh.ENABLE,i=null,a=!1){let l=vc.DISPLAY,d=oQ;switch(t){case"any":l=vc.ANY;break;case"display":break;case"print":l=vc.PRINT;break;default:Ir(`getRenderingIntent - invalid intent: ${t}`)}switch(o){case Oh.DISABLE:l+=vc.ANNOTATIONS_DISABLE;break;case Oh.ENABLE:break;case Oh.ENABLE_FORMS:l+=vc.ANNOTATIONS_FORMS;break;case Oh.ENABLE_STORAGE:l+=vc.ANNOTATIONS_STORAGE,d=(l&vc.PRINT&&i instanceof REe?i:this.annotationStorage).serializable;break;default:Ir(`getRenderingIntent - invalid annotationMode: ${o}`)}return a&&(l+=vc.OPLIST),{renderingIntent:l,cacheKey:`${l}_${d.hash}`,annotationStorageSerializable:d}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#s?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const i of this.#t.values())t.push(i._destroy());this.#t.clear(),this.#o.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const o=this.messageHandler.sendWithPromise("Terminate",null);return t.push(o),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),dS.cleanup(),this._networkStream?.cancelAllRequests(new J4("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:o}=this;t.on("GetReader",(i,a)=>{Ea(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=l=>{this._lastProgress={loaded:l.loaded,total:l.total}},a.onPull=()=>{this._fullReader.read().then(function({value:l,done:d}){if(d){a.close();return}Ea(l instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(l),1,[l])}).catch(l=>{a.error(l)})},a.onCancel=l=>{this._fullReader.cancel(l),a.ready.catch(d=>{if(!this.destroyed)throw d})}}),t.on("ReaderHeadersReady",i=>{const a=Promise.withResolvers(),l=this._fullReader;return l.headersReady.then(()=>{(!l.isStreamingSupported||!l.isRangeSupported)&&(this._lastProgress&&o.onProgress?.(this._lastProgress),l.onProgress=d=>{o.onProgress?.({loaded:d.loaded,total:d.total})}),a.resolve({isStreamingSupported:l.isStreamingSupported,isRangeSupported:l.isRangeSupported,contentLength:l.contentLength})},a.reject),a.promise}),t.on("GetRangeReader",(i,a)=>{Ea(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const l=this._networkStream.getRangeReader(i.begin,i.end);if(!l){a.close();return}a.onPull=()=>{l.read().then(function({value:d,done:c}){if(c){a.close();return}Ea(d instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(d),1,[d])}).catch(d=>{a.error(d)})},a.onCancel=d=>{l.cancel(d),a.ready.catch(c=>{if(!this.destroyed)throw c})}}),t.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,o._capability.resolve(new jIt(i,this))}),t.on("DocException",function(i){let a;switch(i.name){case"PasswordException":a=new eQ(i.message,i.code);break;case"InvalidPDFException":a=new IEe(i.message);break;case"MissingPDFException":a=new Z4(i.message);break;case"UnexpectedResponseException":a=new XL(i.message,i.status);break;case"UnknownErrorException":a=new tQ(i.message,i.details);break;default:Pi("DocException - expected a valid Error.")}o._capability.reject(a)}),t.on("PasswordRequest",i=>{if(this.#s=Promise.withResolvers(),o.onPassword){const a=l=>{l instanceof Error?this.#s.reject(l):this.#s.resolve({password:l})};try{o.onPassword(a,i.code)}catch(l){this.#s.reject(l)}}else this.#s.reject(new eQ(i.message,i.code));return this.#s.promise}),t.on("DataLoaded",i=>{o.onProgress?.({loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),t.on("StartRenderPage",i=>{if(this.destroyed)return;this.#t.get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),t.on("commonobj",([i,a,l])=>{if(this.destroyed||this.commonObjs.has(i))return null;switch(a){case"Font":const{disableFontFace:d,fontExtraProperties:c,pdfBug:p}=this._params;if("error"in l){const f=l.error;Ir(`Error during font loading: ${f}`),this.commonObjs.resolve(i,f);break}const u=p&&globalThis.FontInspector?.enabled?(f,x)=>globalThis.FontInspector.fontAdded(f,x):null,h=new BLt(l,{disableFontFace:d,inspectFont:u});this.fontLoader.bind(h).catch(()=>t.sendWithPromise("FontFallback",{id:i})).finally(()=>{!c&&h.data&&(h.data=null),this.commonObjs.resolve(i,h)});break;case"CopyLocalImage":const{imageRef:m}=l;Ea(m,"The imageRef must be defined.");for(const f of this.#t.values())for(const[,x]of f.objs)if(x?.ref===m)return x.dataLen?(this.commonObjs.resolve(i,structuredClone(x)),x.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,l);break;default:throw new Error(`Got unknown common object type ${a}`)}return null}),t.on("obj",([i,a,l,d])=>{if(this.destroyed)return;const c=this.#t.get(a);if(!c.objs.has(i)){if(c._intentStates.size===0){d?.bitmap?.close();return}switch(l){case"Image":c.objs.resolve(i,d),d?.dataLen>nLt&&(c._maybeCleanupAfterRender=!0);break;case"Pattern":c.objs.resolve(i,d);break;default:throw new Error(`Got unknown object type ${l}`)}}}),t.on("DocProgress",i=>{this.destroyed||o.onProgress?.({loaded:i.loaded,total:i.total})}),t.on("FetchBuiltInCMap",i=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(i):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),t.on("FetchStandardFontData",i=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(i):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Ir("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:o}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},o).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const o=t-1,i=this.#o.get(o);if(i)return i;const a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:o}).then(l=>{if(this.destroyed)throw new Error("Transport destroyed");l.refStr&&this.#i.set(l.refStr,t);const d=new MIt(o,l,this,this._params.pdfBug);return this.#t.set(o,d),d});return this.#o.set(o,a),a}getPageIndex(t){return vpe(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,o){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:o})}getFieldObjects(){return this.#r("GetFieldObjects")}hasJSActions(){return this.#r("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#r("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#r("GetOptionalContentConfig").then(o=>new JLt(o,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",o=this.#e.get(t);if(o)return o;const i=this.messageHandler.sendWithPromise(t,null).then(a=>({info:a[0],metadata:a[1]?new qLt(a[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const o of this.#t.values())if(!o.cleanup())throw new Error(`startCleanup: Page ${o.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),dS.cleanup()}}cachedPageNumber(t){if(!vpe(t))return null;const o=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return this.#i.get(o)??null}}const yC=Symbol("INITIAL_DATA");class GEe{#e=Object.create(null);#t(t){return this.#e[t]||={...Promise.withResolvers(),data:yC}}get(t,o=null){if(o){const a=this.#t(t);return a.promise.then(()=>o(a.data)),null}const i=this.#e[t];if(!i||i.data===yC)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const o=this.#e[t];return!!o&&o.data!==yC}resolve(t,o=null){const i=this.#t(t);i.data=o,i.resolve()}clear(){for(const t in this.#e){const{data:o}=this.#e[t];o?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const t in this.#e){const{data:o}=this.#e[t];o!==yC&&(yield[t,o])}}}class PIt{#e=null;constructor(t){this.#e=t,this.onContinue=null}get promise(){return this.#e.capability.promise}cancel(t=0){this.#e.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#e.operatorList;if(!t)return!1;const{annotationCanvasMap:o}=this.#e;return t.form||t.canvas&&o?.size>0}}class f7{#e=null;static#t=new WeakSet;constructor({callback:t,params:o,objs:i,commonObjs:a,annotationCanvasMap:l,operatorList:d,pageIndex:c,canvasFactory:p,filterFactory:u,useRequestAnimationFrame:h=!1,pdfBug:m=!1,pageColors:f=null}){this.callback=t,this.params=o,this.objs=i,this.commonObjs=a,this.annotationCanvasMap=l,this.operatorListIdx=null,this.operatorList=d,this._pageIndex=c,this.canvasFactory=p,this.filterFactory=u,this._pdfBug=m,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=h===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new PIt(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=o.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:o}){if(this.cancelled)return;if(this._canvas){if(f7.#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.");f7.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:a,transform:l,background:d}=this.params;this.gfx=new D7(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:o},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:l,viewport:a,transparency:t,background:d}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,o=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),f7.#t.delete(this._canvas),this.callback(t||new TY(`Rendering cancelled, page ${this._pageIndex+1}`,o))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),f7.#t.delete(this._canvas),this.callback())))}}const TIt="4.4.168",zIt="19fbc8998";function Cpe(e){return Math.floor(Math.max(0,Math.min(1,e))*255).toString(16).padStart(2,"0")}function D9(e){return Math.max(0,Math.min(255,255*e))}class Ape{static CMYK_G([t,o,i,a]){return["G",1-Math.min(1,.3*t+.59*i+.11*o+a)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=D9(t),[t,t,t]}static G_HTML([t]){const o=Cpe(t);return`#${o}${o}${o}`}static RGB_G([t,o,i]){return["G",.3*t+.59*o+.11*i]}static RGB_rgb(t){return t.map(D9)}static RGB_HTML(t){return`#${t.map(Cpe).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,o,i,a]){return["RGB",1-Math.min(1,t+a),1-Math.min(1,i+a),1-Math.min(1,o+a)]}static CMYK_rgb([t,o,i,a]){return[D9(1-Math.min(1,t+a)),D9(1-Math.min(1,i+a)),D9(1-Math.min(1,o+a))]}static CMYK_HTML(t){const o=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(o)}static RGB_CMYK([t,o,i]){const a=1-t,l=1-o,d=1-i,c=Math.min(a,l,d);return["CMYK",a,l,d,c]}}class YEe{static setupStorage(t,o,i,a,l){const d=a.getValue(o,{value:null});switch(i.name){case"textarea":if(d.value!==null&&(t.textContent=d.value),l==="print")break;t.addEventListener("input",c=>{a.setValue(o,{value:c.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(d.value===i.attributes.xfaOn?t.setAttribute("checked",!0):d.value===i.attributes.xfaOff&&t.removeAttribute("checked"),l==="print")break;t.addEventListener("change",c=>{a.setValue(o,{value:c.target.checked?c.target.getAttribute("xfaOn"):c.target.getAttribute("xfaOff")})})}else{if(d.value!==null&&t.setAttribute("value",d.value),l==="print")break;t.addEventListener("input",c=>{a.setValue(o,{value:c.target.value})})}break;case"select":if(d.value!==null){t.setAttribute("value",d.value);for(const c of i.children)c.attributes.value===d.value?c.attributes.selected=!0:c.attributes.hasOwnProperty("selected")&&delete c.attributes.selected}t.addEventListener("input",c=>{const p=c.target.options,u=p.selectedIndex===-1?"":p[p.selectedIndex].value;a.setValue(o,{value:u})});break}}static setAttributes({html:t,element:o,storage:i=null,intent:a,linkService:l}){const{attributes:d}=o,c=t instanceof HTMLAnchorElement;d.type==="radio"&&(d.name=`${d.name}-${a}`);for(const[p,u]of Object.entries(d))if(u!=null)switch(p){case"class":u.length&&t.setAttribute(p,u.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",u);break;case"style":Object.assign(t.style,u);break;case"textContent":t.textContent=u;break;default:(!c||p!=="href"&&p!=="newWindow")&&t.setAttribute(p,u)}c&&l.addLinkAttributes(t,d.href,d.newWindow),i&&d.dataId&&this.setupStorage(t,d.dataId,o,i)}static render(t){const o=t.annotationStorage,i=t.linkService,a=t.xfaHtml,l=t.intent||"display",d=document.createElement(a.name);a.attributes&&this.setAttributes({html:d,element:a,intent:l,linkService:i});const c=l!=="richText",p=t.div;if(p.append(d),t.viewport){const m=`matrix(${t.viewport.transform.join(",")})`;p.style.transform=m}c&&p.setAttribute("class","xfaLayer xfaFont");const u=[];if(a.children.length===0){if(a.value){const m=document.createTextNode(a.value);d.append(m),c&&dw.shouldBuildText(a.name)&&u.push(m)}return{textDivs:u}}const h=[[a,-1,d]];for(;h.length>0;){const[m,f,x]=h.at(-1);if(f+1===m.children.length){h.pop();continue}const y=m.children[++h.at(-1)[1]];if(y===null)continue;const{name:w}=y;if(w==="#text"){const v=document.createTextNode(y.value);u.push(v),x.append(v);continue}const b=y?.attributes?.xmlns?document.createElementNS(y.attributes.xmlns,w):document.createElement(w);if(x.append(b),y.attributes&&this.setAttributes({html:b,element:y,storage:o,intent:l,linkService:i}),y.children?.length>0)h.push([y,-1,b]);else if(y.value){const v=document.createTextNode(y.value);c&&dw.shouldBuildText(w)&&u.push(v),b.append(v)}}for(const m of p.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:u}}static update(t){const o=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=o,t.div.hidden=!1}}const xb=1e3,RIt=9,M4=new WeakSet;function v0(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class FIt{static create(t){switch(t.data.annotationType){case Aa.LINK:return new KEe(t);case Aa.TEXT:return new OIt(t);case Aa.WIDGET:switch(t.data.fieldType){case"Tx":return new NIt(t);case"Btn":return t.data.radioButton?new qEe(t):t.data.checkBox?new _It(t):new VIt(t);case"Ch":return new QIt(t);case"Sig":return new HIt(t)}return new X4(t);case Aa.POPUP:return new aQ(t);case Aa.FREETEXT:return new ZEe(t);case Aa.LINE:return new WIt(t);case Aa.SQUARE:return new GIt(t);case Aa.CIRCLE:return new YIt(t);case Aa.POLYLINE:return new JEe(t);case Aa.CARET:return new qIt(t);case Aa.INK:return new XEe(t);case Aa.POLYGON:return new KIt(t);case Aa.HIGHLIGHT:return new ZIt(t);case Aa.UNDERLINE:return new JIt(t);case Aa.SQUIGGLY:return new XIt(t);case Aa.STRIKEOUT:return new ejt(t);case Aa.STAMP:return new eLe(t);case Aa.FILEATTACHMENT:return new tjt(t);default:return new ea(t)}}}class ea{#e=null;#t=!1;#o=null;constructor(t,{isRenderable:o=!1,ignoreBorder:i=!1,createQuadrilaterals:a=!1}={}){this.isRenderable=o,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,o&&(this.container=this._createContainer(i)),a&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:o,richText:i}){return!!(t?.str||o?.str||i?.str)}get hasPopupData(){return ea._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};const{rect:o}=t;o&&this.#i(o),this.#o?.popup.updateEdited(t)}resetEdited(){this.#e&&(this.#i(this.#e.rect),this.#o?.popup.resetEdited(),this.#e=null)}#i(t){const{container:{style:o},data:{rect:i,rotation:a},parent:{viewport:{rawDims:{pageWidth:l,pageHeight:d,pageX:c,pageY:p}}}}=this;i?.splice(0,4,...t);const{width:u,height:h}=v0(t);o.left=`${100*(t[0]-c)/l}%`,o.top=`${100*(d-t[3]+p)/d}%`,a===0?(o.width=`${100*u/l}%`,o.height=`${100*h/d}%`):this.setRotation(a)}_createContainer(t){const{data:o,parent:{page:i,viewport:a}}=this,l=document.createElement("section");l.setAttribute("data-annotation-id",o.id),this instanceof X4||(l.tabIndex=xb);const{style:d}=l;if(d.zIndex=this.parent.zIndex++,o.popupRef&&l.setAttribute("aria-haspopup","dialog"),o.alternativeText&&(l.title=o.alternativeText),o.noRotate&&l.classList.add("norotate"),!o.rect||this instanceof aQ){const{rotation:w}=o;return!o.hasOwnCanvas&&w!==0&&this.setRotation(w,l),l}const{width:c,height:p}=v0(o.rect);if(!t&&o.borderStyle.width>0){d.borderWidth=`${o.borderStyle.width}px`;const w=o.borderStyle.horizontalCornerRadius,b=o.borderStyle.verticalCornerRadius;if(w>0||b>0){const A=`calc(${w}px * var(--scale-factor)) / calc(${b}px * var(--scale-factor))`;d.borderRadius=A}else if(this instanceof qEe){const A=`calc(${c}px * var(--scale-factor)) / calc(${p}px * var(--scale-factor))`;d.borderRadius=A}switch(o.borderStyle.style){case M9.SOLID:d.borderStyle="solid";break;case M9.DASHED:d.borderStyle="dashed";break;case M9.BEVELED:Ir("Unimplemented border style: beveled");break;case M9.INSET:Ir("Unimplemented border style: inset");break;case M9.UNDERLINE:d.borderBottomStyle="solid";break}const v=o.borderColor||null;v?(this.#t=!0,d.borderColor=$o.makeHexColor(v[0]|0,v[1]|0,v[2]|0)):d.borderWidth=0}const u=$o.normalizeRect([o.rect[0],i.view[3]-o.rect[1]+i.view[1],o.rect[2],i.view[3]-o.rect[3]+i.view[1]]),{pageWidth:h,pageHeight:m,pageX:f,pageY:x}=a.rawDims;d.left=`${100*(u[0]-f)/h}%`,d.top=`${100*(u[1]-x)/m}%`;const{rotation:y}=o;return o.hasOwnCanvas||y===0?(d.width=`${100*c/h}%`,d.height=`${100*p/m}%`):this.setRotation(y,l),l}setRotation(t,o=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:a}=this.parent.viewport.rawDims,{width:l,height:d}=v0(this.data.rect);let c,p;t%180===0?(c=100*l/i,p=100*d/a):(c=100*d/i,p=100*l/a),o.style.width=`${c}%`,o.style.height=`${p}%`,o.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(o,i,a)=>{const l=a.detail[o],d=l[0],c=l.slice(1);a.target.style[i]=Ape[`${d}_HTML`](c),this.annotationStorage.setValue(this.data.id,{[i]:Ape[`${d}_rgb`](c)})};return ni(this,"_commonActions",{display:o=>{const{display:i}=o.detail,a=i%2===1;this.container.style.visibility=a?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:a,noPrint:i===1||i===2})},print:o=>{this.annotationStorage.setValue(this.data.id,{noPrint:!o.detail.print})},hidden:o=>{const{hidden:i}=o.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:o=>{setTimeout(()=>o.target.focus({preventScroll:!1}),0)},userName:o=>{o.target.title=o.detail.userName},readonly:o=>{o.target.disabled=o.detail.readonly},required:o=>{this._setRequired(o.target,o.detail.required)},bgColor:o=>{t("bgColor","backgroundColor",o)},fillColor:o=>{t("fillColor","backgroundColor",o)},fgColor:o=>{t("fgColor","color",o)},textColor:o=>{t("textColor","color",o)},borderColor:o=>{t("borderColor","borderColor",o)},strokeColor:o=>{t("strokeColor","borderColor",o)},rotation:o=>{const i=o.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(t,o){const i=this._commonActions;for(const a of Object.keys(o.detail))(t[a]||i[a])?.(o)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const o=this.annotationStorage.getRawValue(this.data.id);if(!o)return;const i=this._commonActions;for(const[a,l]of Object.entries(o)){const d=i[a];if(d){const c={detail:{[a]:l},target:t};d(c),delete o[a]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[o,i,a,l]=this.data.rect.map(w=>Math.fround(w));if(t.length===8){const[w,b,v,A]=t.subarray(2,6);if(a===w&&l===b&&o===v&&i===A)return}const{style:d}=this.container;let c;if(this.#t){const{borderColor:w,borderWidth:b}=d;d.borderWidth=0,c=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${w}" stroke-width="${b}">`],this.container.classList.add("hasBorder")}const p=a-o,u=l-i,{svgFactory:h}=this,m=h.createElement("svg");m.classList.add("quadrilateralsContainer"),m.setAttribute("width",0),m.setAttribute("height",0);const f=h.createElement("defs");m.append(f);const x=h.createElement("clipPath"),y=`clippath_${this.data.id}`;x.setAttribute("id",y),x.setAttribute("clipPathUnits","objectBoundingBox"),f.append(x);for(let w=2,b=t.length;w<b;w+=8){const v=t[w],A=t[w+1],S=t[w+2],E=t[w+3],j=h.createElement("rect"),L=(S-o)/p,M=(l-A)/u,D=(v-S)/p,P=(A-E)/u;j.setAttribute("x",L),j.setAttribute("y",M),j.setAttribute("width",D),j.setAttribute("height",P),x.append(j),c?.push(`<rect vector-effect="non-scaling-stroke" x="${L}" y="${M}" width="${D}" height="${P}"/>`)}this.#t&&(c.push("</g></svg>')"),d.backgroundImage=c.join("")),this.container.append(m),this.container.style.clipPath=`url(#${y})`}_createPopup(){const{container:t,data:o}=this;t.setAttribute("aria-haspopup","dialog");const i=this.#o=new aQ({data:{color:o.color,titleObj:o.titleObj,modificationDate:o.modificationDate,contentsObj:o.contentsObj,richText:o.richText,parentRect:o.rect,borderStyle:0,id:`popup_${o.id}`,rotation:o.rotation},parent:this.parent,elements:[this]});this.parent.div.append(i.render())}render(){Pi("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,o=null){const i=[];if(this._fieldObjects){const a=this._fieldObjects[t];if(a)for(const{page:l,id:d,exportValues:c}of a){if(l===-1||d===o)continue;const p=typeof c=="string"?c:null,u=document.querySelector(`[data-element-id="${d}"]`);if(u&&!M4.has(u)){Ir(`_getElementsByName - element not allowed: ${d}`);continue}i.push({id:d,exportValue:p,domElement:u})}return i}for(const a of document.getElementsByName(t)){const{exportValue:l}=a,d=a.getAttribute("data-element-id");d!==o&&M4.has(a)&&i.push({id:d,exportValue:l,domElement:a})}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const o of t)o.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:o}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:o})})}}class KEe extends ea{constructor(t,o=null){super(t,{isRenderable:!0,ignoreBorder:!!o?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:o}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let a=!1;return t.url?(o.addLinkAttributes(i,t.url,t.newWindow),a=!0):t.action?(this._bindNamedAction(i,t.action),a=!0):t.attachment?(this.#t(i,t.attachment,t.attachmentDest),a=!0):t.setOCGState?(this.#o(i,t.setOCGState),a=!0):t.dest?(this._bindLink(i,t.dest),a=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),a=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),a=!0):this.isTooltipOnly&&!a&&(this._bindLink(i,""),a=!0)),this.container.classList.add("linkAnnotation"),a&&this.container.append(i),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(t,o){t.href=this.linkService.getDestinationHash(o),t.onclick=()=>(o&&this.linkService.goToDestination(o),!1),(o||o==="")&&this.#e()}_bindNamedAction(t,o){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(o),!1),this.#e()}#t(t,o,i=null){t.href=this.linkService.getAnchorUrl(""),o.description&&(t.title=o.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(o.content,o.filename,i),!1),this.#e()}#o(t,o){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(o),!1),this.#e()}_bindJSAction(t,o){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const a of Object.keys(o.actions)){const l=i.get(a);l&&(t[l]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o.id,name:a}}),!1))}t.onclick||(t.onclick=()=>!1),this.#e()}_bindResetFormAction(t,o){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){Ir('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(t.onclick=()=>!1);return}t.onclick=()=>{i?.();const{fields:a,refs:l,include:d}=o,c=[];if(a.length!==0||l.length!==0){const h=new Set(l);for(const m of a){const f=this._fieldObjects[m]||[];for(const{id:x}of f)h.add(x)}for(const m of Object.values(this._fieldObjects))for(const f of m)h.has(f.id)===d&&c.push(f)}else for(const h of Object.values(this._fieldObjects))c.push(...h);const p=this.annotationStorage,u=[];for(const h of c){const{id:m}=h;switch(u.push(m),h.type){case"text":{const x=h.defaultValue||"";p.setValue(m,{value:x});break}case"checkbox":case"radiobutton":{const x=h.defaultValue===h.exportValues;p.setValue(m,{value:x});break}case"combobox":case"listbox":{const x=h.defaultValue||"";p.setValue(m,{value:x});break}default:continue}const f=document.querySelector(`[data-element-id="${m}"]`);if(f){if(!M4.has(f)){Ir(`_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 OIt extends ea{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 X4 extends ea{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return od.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,o,i,a,l){i.includes("mouse")?t.addEventListener(i,d=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(d),shift:d.shiftKey,modifier:this._getKeyModifier(d)}})}):t.addEventListener(i,d=>{if(i==="blur"){if(!o.focused||!d.relatedTarget)return;o.focused=!1}else if(i==="focus"){if(o.focused)return;o.focused=!0}l&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(d)}})})}_setEventListeners(t,o,i,a){for(const[l,d]of i)(d==="Action"||this.data.actions?.[d])&&((d==="Focus"||d==="Blur")&&(o||={focused:!1}),this._setEventListener(t,o,l,d,a),d==="Focus"&&!this.data.actions?.Blur?this._setEventListener(t,o,"blur","Blur",null):d==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(t,o,"focus","Focus",null))}_setBackgroundColor(t){const o=this.data.backgroundColor||null;t.style.backgroundColor=o===null?"transparent":$o.makeHexColor(o[0],o[1],o[2])}_setTextStyle(t){const o=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||RIt,l=t.style;let d;const c=2,p=u=>Math.round(10*u)/10;if(this.data.multiLine){const u=Math.abs(this.data.rect[3]-this.data.rect[1]-c),h=Math.round(u/(hO*a))||1,m=u/h;d=Math.min(a,p(m/hO))}else{const u=Math.abs(this.data.rect[3]-this.data.rect[1]-c);d=Math.min(a,p(u/hO))}l.fontSize=`calc(${d}px * var(--scale-factor))`,l.color=$o.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(l.textAlign=o[this.data.textAlignment])}_setRequired(t,o){o?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",o)}}class NIt extends X4{constructor(t){const o=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:o})}setPropertyOnSiblings(t,o,i,a){const l=this.annotationStorage;for(const d of this._getElementsByName(t.name,t.id))d.domElement&&(d.domElement[o]=i),l.setValue(d.id,{[a]:i})}render(){const t=this.annotationStorage,o=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const a=t.getValue(o,{value:this.data.fieldValue});let l=a.value||"";const d=t.getValue(o,{charLimit:this.data.maxLen}).charLimit;d&&l.length>d&&(l=l.slice(0,d));let c=a.formattedValue||this.data.textContent?.join(`
246
+ `);return t.join("")}}function Tx(e,t){try{const{protocol:o}=t?new URL(e,t):new URL(e);return o==="http:"||o==="https:"}catch{return!1}}function ld(e){e.preventDefault()}function PEe(e){console.log("Deprecated API usage: "+e)}let lpe;class TEe{static toDateObject(t){if(!t||typeof t!="string")return null;lpe||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const o=lpe.exec(t);if(!o)return null;const i=parseInt(o[1],10);let a=parseInt(o[2],10);a=a>=1&&a<=12?a-1:0;let l=parseInt(o[3],10);l=l>=1&&l<=31?l:1;let d=parseInt(o[4],10);d=d>=0&&d<=23?d:0;let c=parseInt(o[5],10);c=c>=0&&c<=59?c:0;let p=parseInt(o[6],10);p=p>=0&&p<=59?p:0;const u=o[7]||"Z";let h=parseInt(o[8],10);h=h>=0&&h<=23?h:0;let m=parseInt(o[9],10)||0;return m=m>=0&&m<=59?m:0,u==="-"?(d+=h,c+=m):u==="+"&&(d-=h,c-=m),new Date(Date.UTC(i,a,l,d,c,p))}}function $Lt(e,{scale:t=1,rotation:o=0}){const{width:i,height:a}=e.attributes.style,l=[0,0,parseInt(i),parseInt(a)];return new mb({viewBox:l,scale:t,rotation:o})}function FY(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):(Ir(`Not a valid color format: "${e}"`),[0,0,0])}function kLt(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const o of e.keys()){t.style.color=o;const i=window.getComputedStyle(t).color;e.set(o,FY(i))}t.remove()}function An(e){const{a:t,b:o,c:i,d:a,e:l,f:d}=e.getTransform();return[t,o,i,a,l,d]}function z2(e){const{a:t,b:o,c:i,d:a,e:l,f:d}=e.getTransform().invertSelf();return[t,o,i,a,l,d]}function j4(e,t,o=!1,i=!0){if(t instanceof mb){const{pageWidth:a,pageHeight:l}=t.rawDims,{style:d}=e,c=od.isCSSRoundSupported,p=`var(--scale-factor) * ${a}px`,u=`var(--scale-factor) * ${l}px`,h=c?`round(${p}, 1px)`:`calc(${p})`,m=c?`round(${u}, 1px)`:`calc(${u})`;!o||t.rotation%180===0?(d.width=h,d.height=m):(d.width=m,d.height=h)}i&&e.setAttribute("data-main-rotation",t.rotation)}class OY{#e=null;#t=null;#o;#i=null;constructor(t){this.#o=t}render(){const t=this.#e=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");const o=this.#o._uiManager._signal;t.addEventListener("contextmenu",ld,{signal:o}),t.addEventListener("pointerdown",OY.#s,{signal:o});const i=this.#i=document.createElement("div");i.className="buttons",t.append(i);const a=this.#o.toolbarPosition;if(a){const{style:l}=t,d=this.#o._uiManager.direction==="ltr"?1-a[0]:a[0];l.insetInlineEnd=`${100*d}%`,l.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return this.#c(),t}static#s(t){t.stopPropagation()}#r(t){this.#o._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}#n(t){this.#o._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}#l(t){const o=this.#o._uiManager._signal;t.addEventListener("focusin",this.#r.bind(this),{capture:!0,signal:o}),t.addEventListener("focusout",this.#n.bind(this),{capture:!0,signal:o}),t.addEventListener("contextmenu",ld,{signal:o})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden")}#c(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id",`pdfjs-editor-remove-${this.#o.editorType}-button`),this.#l(t),t.addEventListener("click",o=>{this.#o._uiManager.delete()},{signal:this.#o._uiManager._signal}),this.#i.append(t)}get#p(){const t=document.createElement("div");return t.className="divider",t}addAltTextButton(t){this.#l(t),this.#i.prepend(t,this.#p)}addColorPicker(t){this.#t=t;const o=t.renderButton();this.#l(o),this.#i.prepend(o,this.#p)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class SLt{#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",ld,{signal:this.#o._signal});const o=this.#e=document.createElement("div");return o.className="buttons",t.append(o),this.#r(),t}#s(t,o){let i=0,a=0;for(const l of t){const d=l.y+l.height;if(d<i)continue;const c=l.x+(o?l.width:0);if(d>i){a=c,i=d;continue}o?c>a&&(a=c):c<a&&(a=c)}return[o?1-a:a,i]}show(t,o,i){const[a,l]=this.#s(o,i),{style:d}=this.#t||=this.#i();t.append(this.#t),d.insetInlineEnd=`${100*a}%`,d.top=`calc(${100*l}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#r(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const o=document.createElement("span");t.append(o),o.className="visuallyHidden",o.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=this.#o._signal;t.addEventListener("contextmenu",ld,{signal:i}),t.addEventListener("click",()=>{this.#o.highlightSelection("floating_button")},{signal:i}),this.#e.append(t)}}function sS(e,t,o){for(const i of o)t.addEventListener(i,e[i].bind(e))}function ELt(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")}class LLt{#e=0;get id(){return`${aLt}${this.#e++}`}}class NY{#e=wLt();#t=0;#o=null;static get _isSVGFittingCanvas(){const t='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),a=new Image;a.src=t;const l=a.decode().then(()=>(i.drawImage(a,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return ni(this,"_isSVGFittingCanvas",l)}async#i(t,o){this.#o||=new Map;let i=this.#o.get(t);if(i===null)return null;if(i?.bitmap)return i.refCounter+=1,i;try{i||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let a;if(typeof o=="string"?(i.url=o,a=await nI(o,"blob")):a=i.file=o,a.type==="image/svg+xml"){const l=NY._isSVGFittingCanvas,d=new FileReader,c=new Image,p=new Promise((u,h)=>{c.onload=()=>{i.bitmap=c,i.isSvg=!0,u()},d.onload=async()=>{const m=i.svgUrl=d.result;c.src=await l?`${m}#svgView(preserveAspectRatio(none))`:m},c.onerror=d.onerror=h});d.readAsDataURL(a),await p}else i.bitmap=await createImageBitmap(a);i.refCounter=1}catch(a){console.error(a),i=null}return this.#o.set(t,i),i&&this.#o.set(i.id,i),i}async getFromFile(t){const{lastModified:o,name:i,size:a,type:l}=t;return this.#i(`${o}_${i}_${a}_${l}`,t)}async getFromUrl(t){return this.#i(t,t)}async getFromId(t){this.#o||=new Map;const o=this.#o.get(t);return o?o.bitmap?(o.refCounter+=1,o):o.file?this.getFromFile(o.file):this.getFromUrl(o.url):null}getSvgUrl(t){const o=this.#o.get(t);return o?.isSvg?o.svgUrl:null}deleteId(t){this.#o||=new Map;const o=this.#o.get(t);o&&(o.refCounter-=1,o.refCounter===0&&(o.bitmap=null))}isValidId(t){return t.startsWith(`image_${this.#e}_`)}}class ILt{#e=[];#t=!1;#o;#i=-1;constructor(t=128){this.#o=t}add({cmd:t,undo:o,post:i,mustExec:a,type:l=NaN,overwriteIfSameType:d=!1,keepUndo:c=!1}){if(a&&t(),this.#t)return;const p={cmd:t,undo:o,post:i,type:l};if(this.#i===-1){this.#e.length>0&&(this.#e.length=0),this.#i=0,this.#e.push(p);return}if(d&&this.#e[this.#i].type===l){c&&(p.undo=this.#e[this.#i].undo),this.#e[this.#i]=p;return}const u=this.#i+1;u===this.#o?this.#e.splice(0,1):(this.#i=u,u<this.#e.length&&this.#e.splice(u)),this.#e.push(p)}undo(){if(this.#i===-1)return;this.#t=!0;const{undo:t,post:o}=this.#e[this.#i];t(),o?.(),this.#t=!1,this.#i-=1}redo(){if(this.#i<this.#e.length-1){this.#i+=1,this.#t=!0;const{cmd:t,post:o}=this.#e[this.#i];t(),o?.(),this.#t=!1}}hasSomethingToUndo(){return this.#i!==-1}hasSomethingToRedo(){return this.#i<this.#e.length-1}destroy(){this.#e=null}}class gb{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:o}=od.platform;for(const[i,a,l={}]of t)for(const d of i){const c=d.startsWith("mac+");o&&c?(this.callbacks.set(d.slice(4),{callback:a,options:l}),this.allKeys.add(d.split("+").at(-1))):!o&&!c&&(this.callbacks.set(d,{callback:a,options:l}),this.allKeys.add(d.split("+").at(-1)))}}#e(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const o=this.buffer.join("+");return this.buffer.length=0,o}exec(t,o){if(!this.allKeys.has(o.key))return;const i=this.callbacks.get(this.#e(o));if(!i)return;const{callback:a,options:{bubbles:l=!1,args:d=[],checker:c=null}}=i;c&&!c(t,o)||(a.bind(t,...d,o)(),l||(o.stopPropagation(),o.preventDefault()))}}class HY{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return kLt(t),ni(this,"_colors",t)}convert(t){const o=FY(t);if(!window.matchMedia("(forced-colors: active)").matches)return o;for(const[i,a]of this._colors)if(a.every((l,d)=>l===o[d]))return HY._colorsMapping.get(i);return o}getHexCode(t){const o=this._colors.get(t);return o?$o.makeHexColor(...o):t}}class $m{#e=new AbortController;#t=null;#o=new Map;#i=new Map;#s=null;#r=null;#n=null;#l=new ILt;#c=0;#p=new Set;#h=null;#d=null;#a=new Set;#m=!1;#f=null;#u=null;#y=null;#g=!1;#w=null;#v=new LLt;#A=!1;#k=!1;#S=null;#j=null;#$=null;#b=qr.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);#D=this.cut.bind(this);#z=this.paste.bind(this);#P=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=$m.prototype,o=d=>d.#H.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&d.hasSomethingToControl(),i=(d,{target:c})=>{if(c instanceof HTMLInputElement){const{type:p}=c;return p!=="text"&&p!=="number"}return!0},a=this.TRANSLATE_SMALL,l=this.TRANSLATE_BIG;return ni(this,"_keyboardManager",new gb([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(d,{target:c})=>!(c instanceof HTMLButtonElement)&&d.#H.contains(c)&&!d.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(d,{target:c})=>!(c instanceof HTMLButtonElement)&&d.#H.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-a,0],checker:o}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-l,0],checker:o}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[a,0],checker:o}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[l,0],checker:o}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-a],checker:o}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-l],checker:o}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,a],checker:o}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,l],checker:o}]]))}constructor(t,o,i,a,l,d,c,p,u){this._signal=this.#e.signal,this.#H=t,this.#q=o,this.#s=i,this._eventBus=a,this._eventBus._on("editingaction",this.#U),this._eventBus._on("pagechanging",this.#_),this._eventBus._on("scalechanging",this.#N),this._eventBus._on("rotationchanging",this.#R),this.#ie(),this.#le(),this.#Z(),this.#r=l.annotationStorage,this.#f=l.filterFactory,this.#E=d,this.#y=c||null,this.#m=p,this.#$=u||null,this.viewParameters={realScale:u6.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#e?.abort(),this.#e=null,this._signal=null,this._eventBus._off("editingaction",this.#U),this._eventBus._off("pagechanging",this.#_),this._eventBus._off("scalechanging",this.#N),this._eventBus._off("rotationchanging",this.#R);for(const t of this.#i.values())t.destroy();this.#i.clear(),this.#o.clear(),this.#a.clear(),this.#t=null,this.#x.clear(),this.#l.destroy(),this.#s?.destroy(),this.#w?.hide(),this.#w=null,this.#u&&(clearTimeout(this.#u),this.#u=null),this.#F&&(clearTimeout(this.#F),this.#F=null)}async mlGuess(t){return this.#$?.guess(t)||null}get hasMLManager(){return!!this.#$}get hcmFilter(){return ni(this,"hcmFilter",this.#E?this.#f.addHCMFilter(this.#E.foreground,this.#E.background):"none")}get direction(){return ni(this,"direction",getComputedStyle(this.#H).direction)}get highlightColors(){return ni(this,"highlightColors",this.#y?new Map(this.#y.split(",").map(t=>t.split("=").map(o=>o.trim()))):null)}get highlightColorNames(){return ni(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.#c=t-1}focusMainContainer(){this.#H.focus()}findParent(t,o){for(const i of this.#i.values()){const{x:a,y:l,width:d,height:c}=i.div.getBoundingClientRect();if(t>=a&&t<=a+d&&o>=l&&o<=l+c)return i}return null}disableUserSelect(t=!1){this.#q.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#a.add(t)}removeShouldRescale(t){this.#a.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*u6.PDF_TO_CSS_UNITS;for(const o of this.#a)o.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#G({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}highlightSelection(t=""){const o=document.getSelection();if(!o||o.isCollapsed)return;const{anchorNode:i,anchorOffset:a,focusNode:l,focusOffset:d}=o,c=o.toString(),u=this.#G(o).closest(".textLayer"),h=this.getSelectionBoxes(u);if(h){o.empty(),this.#b===qr.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:qr.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const m of this.#i.values())if(m.hasTextLayer(u)){m.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:h,anchorNode:i,anchorOffset:a,focusNode:l,focusOffset:d,text:c});break}}}#oe(){const t=document.getSelection();if(!t||t.isCollapsed)return;const i=this.#G(t).closest(".textLayer"),a=this.getSelectionBoxes(i);a&&(this.#w||=new SLt(this),this.#w.show(i,a,this.direction==="ltr"))}addToAnnotationStorage(t){!t.isEmpty()&&this.#r&&!this.#r.has(t.id)&&this.#r.setValue(t.id,t)}#re(){const t=document.getSelection();if(!t||t.isCollapsed){this.#C&&(this.#w?.hide(),this.#C=null,this.#I({hasSelectedText:!1}));return}const{anchorNode:o}=t;if(o===this.#C)return;if(!this.#G(t).closest(".textLayer")){this.#C&&(this.#w?.hide(),this.#C=null,this.#I({hasSelectedText:!1}));return}if(this.#w?.hide(),this.#C=o,this.#I({hasSelectedText:!0}),!(this.#b!==qr.HIGHLIGHT&&this.#b!==qr.NONE)&&(this.#b===qr.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#g=this.isShiftKeyDown,!this.isShiftKeyDown)){const l=this._signal,d=c=>{c.type==="pointerup"&&c.button!==0||(window.removeEventListener("pointerup",d),window.removeEventListener("blur",d),c.type==="pointerup"&&this.#Y("main_toolbar"))};window.addEventListener("pointerup",d,{signal:l}),window.addEventListener("blur",d,{signal:l})}}#Y(t=""){this.#b===qr.HIGHLIGHT?this.highlightSelection(t):this.#m&&this.#oe()}#ie(){document.addEventListener("selectionchange",this.#re.bind(this),{signal:this._signal})}#ne(){const t=this._signal;window.addEventListener("focus",this.#M,{signal:t}),window.addEventListener("blur",this.#B,{signal:t})}#ae(){window.removeEventListener("focus",this.#M),window.removeEventListener("blur",this.#B)}blur(){if(this.isShiftKeyDown=!1,this.#g&&(this.#g=!1,this.#Y("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const o of this.#x)if(o.div.contains(t)){this.#S=[o,t],o._focusEventsAllowed=!1;break}}focus(){if(!this.#S)return;const[t,o]=this.#S;this.#S=null,o.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),o.focus()}#Z(){const t=this._signal;window.addEventListener("keydown",this.#P,{signal:t}),window.addEventListener("keyup",this.#Q,{signal:t})}#se(){window.removeEventListener("keydown",this.#P),window.removeEventListener("keyup",this.#Q)}#J(){const t=this._signal;document.addEventListener("copy",this.#T,{signal:t}),document.addEventListener("cut",this.#D,{signal:t}),document.addEventListener("paste",this.#z,{signal:t})}#X(){document.removeEventListener("copy",this.#T),document.removeEventListener("cut",this.#D),document.removeEventListener("paste",this.#z)}#le(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#Z(),this.#J()}removeEditListeners(){this.#se(),this.#X()}dragOver(t){for(const{type:o}of t.dataTransfer.items)for(const i of this.#d)if(i.isHandlingMimeForPasting(o)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const o of t.dataTransfer.items)for(const i of this.#d)if(i.isHandlingMimeForPasting(o.type)){i.paste(o,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const o=[];for(const i of this.#x){const a=i.serialize(!0);a&&o.push(a)}o.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(o))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:o}=t;for(const l of o.items)for(const d of this.#d)if(d.isHandlingMimeForPasting(l.type)){d.paste(l,this.currentLayer);return}let i=o.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(l){Ir(`paste: "${l.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();const a=this.currentLayer;try{const l=[];for(const p of i){const u=a.deserialize(p);if(!u)return;l.push(u)}const d=()=>{for(const p of l)this.#ee(p);this.#te(l)},c=()=>{for(const p of l)p.remove()};this.addCommands({cmd:d,undo:c,mustExec:!0})}catch(l){Ir(`paste: "${l.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),this.#b!==qr.NONE&&!this.isEditorHandlingKeyboard&&$m._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(([i,a])=>this.#K[i]!==a)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#K,t)}),this.#b===qr.HIGHLIGHT&&t.hasSelectedEditor===!1&&this.#O([[rr.HIGHLIGHT_FREE,!0]]))}#O(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#ne(),this.#J(),this.#I({isEditing:this.#b!==qr.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.#d){this.#d=t;for(const o of this.#d)this.#O(o.defaultPropertiesToUpdate)}}getId(){return this.#v.id}get currentLayer(){return this.#i.get(this.#c)}getLayer(t){return this.#i.get(t)}get currentPageIndex(){return this.#c}addLayer(t){this.#i.set(t.pageIndex,t),this.#A?t.enable():t.disable()}removeLayer(t){this.#i.delete(t.pageIndex)}updateMode(t,o=null,i=!1){if(this.#b!==t){if(this.#b=t,t===qr.NONE){this.setEditingState(!1),this.#ce();return}this.setEditingState(!0),this.#de(),this.unselectAll();for(const a of this.#i.values())a.updateMode(t);if(!o&&i){this.addNewEditorFromKeyboard();return}if(o){for(const a of this.#o.values())if(a.annotationElementId===o){this.setSelected(a),a.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#b&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,o){if(this.#d){switch(t){case rr.CREATE:this.currentLayer.addNewEditor();return;case rr.HIGHLIGHT_DEFAULT_COLOR:this.#j?.updateColor(o);break;case rr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#L||=new Map).set(t,o),this.showAllEditors("highlight",o);break}for(const i of this.#x)i.updateParams(t,o);for(const i of this.#d)i.updateDefaultParams(t,o)}}showAllEditors(t,o,i=!1){for(const l of this.#o.values())l.editorType===t&&l.show(o);(this.#L?.get(rr.HIGHLIGHT_SHOW_ALL)??!0)!==o&&this.#O([[rr.HIGHLIGHT_SHOW_ALL,o]])}enableWaiting(t=!1){if(this.#k!==t){this.#k=t;for(const o of this.#i.values())t?o.disableClick():o.enableClick(),o.div.classList.toggle("waiting",t)}}#de(){if(!this.#A){this.#A=!0;for(const t of this.#i.values())t.enable();for(const t of this.#o.values())t.enable()}}#ce(){if(this.unselectAll(),this.#A){this.#A=!1;for(const t of this.#i.values())t.disable();for(const t of this.#o.values())t.disable()}}getEditors(t){const o=[];for(const i of this.#o.values())i.pageIndex===t&&o.push(i);return o}getEditor(t){return this.#o.get(t)}addEditor(t){this.#o.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#u&&clearTimeout(this.#u),this.#u=setTimeout(()=>{this.focusMainContainer(),this.#u=null},0)),this.#o.delete(t.id),this.unselect(t),(!t.annotationElementId||!this.#p.has(t.annotationElementId))&&this.#r?.remove(t.id)}addDeletedAnnotationElement(t){this.#p.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#p.has(t)}removeDeletedAnnotationElement(t){this.#p.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#ee(t){const o=this.#i.get(t.pageIndex);o?o.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#t!==t&&(this.#t=t,t&&this.#O(t.propertiesToUpdate))}get#pe(){let t=null;for(t of this.#x);return t}updateUI(t){this.#pe===t&&this.#O(t.propertiesToUpdate)}toggleSelected(t){if(this.#x.has(t)){this.#x.delete(t),t.unselect(),this.#I({hasSelectedEditor:this.hasSelection});return}this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#I({hasSelectedEditor:!0})}setSelected(t){for(const o of this.#x)o!==t&&o.unselect();this.#x.clear(),this.#x.add(t),t.select(),this.#O(t.propertiesToUpdate),this.#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],o=()=>{for(const a of t)a.remove()},i=()=>{for(const a of t)this.#ee(a)};this.addCommands({cmd:o,undo:i,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#te(t){for(const o of this.#x)o.unselect();this.#x.clear();for(const o of t)o.isEmpty()||(this.#x.add(o),o.select());this.#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.#b!==qr.NONE))&&this.hasSelection){for(const t of this.#x)t.unselect();this.#x.clear(),this.#I({hasSelectedEditor:!1})}}translateSelectedEditors(t,o,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#V[0]+=t,this.#V[1]+=o;const[a,l]=this.#V,d=[...this.#x],c=1e3;this.#F&&clearTimeout(this.#F),this.#F=setTimeout(()=>{this.#F=null,this.#V[0]=this.#V[1]=0,this.addCommands({cmd:()=>{for(const p of d)this.#o.has(p.id)&&p.translateInPage(a,l)},undo:()=>{for(const p of d)this.#o.has(p.id)&&p.translateInPage(-a,-l)},mustExec:!1})},c);for(const p of d)p.translateInPage(t,o)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#h=new Map;for(const t of this.#x)this.#h.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#h)return!1;this.disableUserSelect(!1);const t=this.#h;this.#h=null;let o=!1;for(const[{x:a,y:l,pageIndex:d},c]of t)c.newX=a,c.newY=l,c.newPageIndex=d,o||=a!==c.savedX||l!==c.savedY||d!==c.savedPageIndex;if(!o)return!1;const i=(a,l,d,c)=>{if(this.#o.has(a.id)){const p=this.#i.get(c);p?a._setParentAndPosition(p,l,d):(a.pageIndex=c,a.x=l,a.y=d)}};return this.addCommands({cmd:()=>{for(const[a,{newX:l,newY:d,newPageIndex:c}]of t)i(a,l,d,c)},undo:()=>{for(const[a,{savedX:l,savedY:d,savedPageIndex:c}]of t)i(a,l,d,c)},mustExec:!0}),!0}dragSelectedEditors(t,o){if(this.#h)for(const i of this.#h.keys())i.drag(t,o)}rebuild(t){if(t.parent===null){const o=this.getLayer(t.pageIndex);o?(o.changeParent(t),o.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#x.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#t===t}getActive(){return this.#t}getMode(){return this.#b}get imageManager(){return ni(this,"imageManager",new NY)}getSelectionBoxes(t){if(!t)return null;const o=document.getSelection();for(let u=0,h=o.rangeCount;u<h;u++)if(!t.contains(o.getRangeAt(u).commonAncestorContainer))return null;const{x:i,y:a,width:l,height:d}=t.getBoundingClientRect();let c;switch(t.getAttribute("data-main-rotation")){case"90":c=(u,h,m,f)=>({x:(h-a)/d,y:1-(u+m-i)/l,width:f/d,height:m/l});break;case"180":c=(u,h,m,f)=>({x:1-(u+m-i)/l,y:1-(h+f-a)/d,width:m/l,height:f/d});break;case"270":c=(u,h,m,f)=>({x:1-(h+f-a)/d,y:(u-i)/l,width:f/d,height:m/l});break;default:c=(u,h,m,f)=>({x:(u-i)/l,y:(h-a)/d,width:m/l,height:f/d});break}const p=[];for(let u=0,h=o.rangeCount;u<h;u++){const m=o.getRangeAt(u);if(!m.collapsed)for(const{x:f,y:x,width:y,height:w}of m.getClientRects())y===0||w===0||p.push(c(f,x,y,w))}return p.length===0?null:p}addChangedExistingAnnotation({annotationElementId:t,id:o}){(this.#n||=new Map).set(t,o)}removeChangedExistingAnnotation({annotationElementId:t}){this.#n?.delete(t)}renderAnnotationElement(t){const o=this.#n?.get(t.data.id);if(!o)return;const i=this.#r.getRawValue(o);i&&(this.#b===qr.NONE&&!i.hasBeenModified||i.renderAnnotationElement(t))}}class o4{#e="";#t=!1;#o=null;#i=null;#s=null;#r=!1;#n=null;static _l10nPromise=null;constructor(t){this.#n=t}static initialize(t){o4._l10nPromise||=t}async render(){const t=this.#o=document.createElement("button");t.className="altText";const o=await o4._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=o,t.setAttribute("aria-label",o),t.tabIndex="0";const i=this.#n._uiManager._signal;t.addEventListener("contextmenu",ld,{signal:i}),t.addEventListener("pointerdown",l=>l.stopPropagation(),{signal:i});const a=l=>{l.preventDefault(),this.#n._uiManager.editAltText(this.#n)};return t.addEventListener("click",a,{capture:!0,signal:i}),t.addEventListener("keydown",l=>{l.target===t&&l.key==="Enter"&&(this.#r=!0,a(l))},{signal:i}),await this.#l(),t}finish(){this.#o&&(this.#o.focus({focusVisible:this.#r}),this.#r=!1)}isEmpty(){return!this.#e&&!this.#t}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:t,decorative:o}){this.#e===t&&this.#t===o||(this.#e=t,this.#t=o,this.#l())}toggle(t=!1){this.#o&&(!t&&this.#s&&(clearTimeout(this.#s),this.#s=null),this.#o.disabled=!t)}destroy(){this.#o?.remove(),this.#o=null,this.#i=null}async#l(){const t=this.#o;if(!t)return;if(!this.#e&&!this.#t){t.classList.remove("done"),this.#i?.remove();return}t.classList.add("done"),o4._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(a=>{t.setAttribute("aria-label",a)});let o=this.#i;if(!o){this.#i=o=document.createElement("span"),o.className="tooltip",o.setAttribute("role","tooltip");const a=o.id=`alt-text-tooltip-${this.#n.id}`;t.setAttribute("aria-describedby",a);const l=100,d=this.#n._uiManager._signal;d.addEventListener("abort",()=>{clearTimeout(this.#s),this.#s=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#s=setTimeout(()=>{this.#s=null,this.#i.classList.add("show"),this.#n._reportTelemetry({action:"alt_text_tooltip"})},l)},{signal:d}),t.addEventListener("mouseleave",()=>{this.#s&&(clearTimeout(this.#s),this.#s=null),this.#i?.classList.remove("show")},{signal:d})}o.innerText=this.#t?await o4._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):this.#e,o.parentNode||t.append(o),this.#n.getImageForAltText()?.setAttribute("aria-describedby",o.id)}}class Jo{#e=null;#t=null;#o=null;#i=!1;#s=!1;#r=null;#n=null;#l=this.focusin.bind(this);#c=this.focusout.bind(this);#p=null;#h="";#d=!1;#a=null;#m=!1;#f=!1;#u=!1;#y=null;#g=0;#w=0;#v=null;_initialOptions=Object.create(null);_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#A=!1;#k=Jo._zIndex++;static _borderLineWidth=-1;static _colorManager=new HY;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=Jo.prototype._resizeWithKeyboard,o=$m.TRANSLATE_SMALL,i=$m.TRANSLATE_BIG;return ni(this,"_resizerKeyboardManager",new gb([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-o,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[o,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-o]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,o]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],Jo.prototype._stopResizingWithKeyboard]]))}constructor(t){this.constructor===Jo&&Pi("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:o,rawDims:{pageWidth:i,pageHeight:a,pageX:l,pageY:d}}=this.parent.viewport;this.rotation=o,this.pageRotation=(360+o-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,a],this.pageTranslation=[l,d];const[c,p]=this.parentDimensions;this.x=t.x/c,this.y=t.y/p,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return ni(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const o=new jLt({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});o.annotationElementId=t.annotationElementId,o.deleted=!0,o._uiManager.addToAnnotationStorage(o)}static initialize(t,o,i){if(Jo._l10nPromise||=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(l=>[l,t.get(l.replaceAll(/([A-Z])/g,d=>`-${d.toLowerCase()}`))])),i?.strings)for(const l of i.strings)Jo._l10nPromise.set(l,t.get(l));if(Jo._borderLineWidth!==-1)return;const a=getComputedStyle(document.documentElement);Jo._borderLineWidth=parseFloat(a.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,o){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,o){Pi("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#A}set _isDraggable(t){this.#A=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,o]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*o/(t*2),this.y+=this.width*t/(o*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*o/(t*2),this.y-=this.width*t/(o*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#k}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#P(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#d?this.#d=!1:this.parent.setSelected(this))}focusout(t){!this._focusEventsAllowed||!this.isAttachedToDOM||t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,o,i,a){const[l,d]=this.parentDimensions;[i,a]=this.screenToPageTranslation(i,a),this.x=(t+i)/l,this.y=(o+a)/d,this.fixAndSetPosition()}#S([t,o],i,a){[i,a]=this.screenToPageTranslation(i,a),this.x+=i/t,this.y+=a/o,this.fixAndSetPosition()}translate(t,o){this.#S(this.parentDimensions,t,o)}translateInPage(t,o){this.#a||=[this.x,this.y],this.#S(this.pageDimensions,t,o),this.div.scrollIntoView({block:"nearest"})}drag(t,o){this.#a||=[this.x,this.y];const[i,a]=this.parentDimensions;if(this.x+=t/i,this.y+=o/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:h}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,h)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:l,y:d}=this;const[c,p]=this.getBaseTranslation();l+=c,d+=p,this.div.style.left=`${(100*l).toFixed(2)}%`,this.div.style.top=`${(100*d).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#a&&(this.#a[0]!==this.x||this.#a[1]!==this.y)}getBaseTranslation(){const[t,o]=this.parentDimensions,{_borderLineWidth:i}=Jo,a=i/t,l=i/o;switch(this.rotation){case 90:return[-a,l];case 180:return[a,l];case 270:return[a,-l];default:return[-a,-l]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const[o,i]=this.pageDimensions;let{x:a,y:l,width:d,height:c}=this;if(d*=o,c*=i,a*=o,l*=i,this._mustFixPosition)switch(t){case 0:a=Math.max(0,Math.min(o-d,a)),l=Math.max(0,Math.min(i-c,l));break;case 90:a=Math.max(0,Math.min(o-c,a)),l=Math.min(i,Math.max(d,l));break;case 180:a=Math.min(o,Math.max(d,a)),l=Math.min(i,Math.max(c,l));break;case 270:a=Math.min(o,Math.max(c,a)),l=Math.max(0,Math.min(i-d,l));break}this.x=a/=o,this.y=l/=i;const[p,u]=this.getBaseTranslation();a+=p,l+=u;const{style:h}=this.div;h.left=`${(100*a).toFixed(2)}%`,h.top=`${(100*l).toFixed(2)}%`,this.moveInDOM()}static#j(t,o,i){switch(i){case 90:return[o,-t];case 180:return[-t,-o];case 270:return[-o,t];default:return[t,o]}}screenToPageTranslation(t,o){return Jo.#j(t,o,this.parentRotation)}pageTranslationToScreen(t,o){return Jo.#j(t,o,360-this.parentRotation)}#$(t){switch(t){case 90:{const[o,i]=this.pageDimensions;return[0,-o/i,i/o,0]}case 180:return[-1,0,0,-1];case 270:{const[o,i]=this.pageDimensions;return[0,o/i,-i/o,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[o,i]}=this,a=o*t,l=i*t;return od.isCSSRoundSupported?[Math.round(a),Math.round(l)]:[a,l]}setDims(t,o){const[i,a]=this.parentDimensions;this.div.style.width=`${(100*t/i).toFixed(2)}%`,this.#s||(this.div.style.height=`${(100*o/a).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:o,width:i}=t,a=i.endsWith("%"),l=!this.#s&&o.endsWith("%");if(a&&l)return;const[d,c]=this.parentDimensions;a||(t.width=`${(100*parseFloat(i)/d).toFixed(2)}%`),!this.#s&&!l&&(t.height=`${(100*parseFloat(o)/c).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#b(){if(this.#r)return;this.#r=document.createElement("div"),this.#r.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],o=this._uiManager._signal;for(const i of t){const a=document.createElement("div");this.#r.append(a),a.classList.add("resizer",i),a.setAttribute("data-resizer-name",i),a.addEventListener("pointerdown",this.#x.bind(this,i),{signal:o}),a.addEventListener("contextmenu",ld,{signal:o}),a.tabIndex=-1}this.div.prepend(this.#r)}#x(t,o){o.preventDefault();const{isMac:i}=od.platform;if(o.button!==0||o.ctrlKey&&i)return;this.#o?.toggle(!1);const a=this.#E.bind(this,t),l=this._isDraggable;this._isDraggable=!1;const d=this._uiManager._signal,c={passive:!0,capture:!0,signal:d};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",a,c),window.addEventListener("contextmenu",ld,{signal:d});const p=this.x,u=this.y,h=this.width,m=this.height,f=this.parent.div.style.cursor,x=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(o.target).cursor;const y=()=>{this.parent.togglePointerEvents(!0),this.#o?.toggle(!0),this._isDraggable=l,window.removeEventListener("pointerup",y),window.removeEventListener("blur",y),window.removeEventListener("pointermove",a,c),window.removeEventListener("contextmenu",ld),this.parent.div.style.cursor=f,this.div.style.cursor=x,this.#C(p,u,h,m)};window.addEventListener("pointerup",y,{signal:d}),window.addEventListener("blur",y,{signal:d})}#C(t,o,i,a){const l=this.x,d=this.y,c=this.width,p=this.height;l===t&&d===o&&c===i&&p===a||this.addCommands({cmd:()=>{this.width=c,this.height=p,this.x=l,this.y=d;const[u,h]=this.parentDimensions;this.setDims(u*c,h*p),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=a,this.x=t,this.y=o;const[u,h]=this.parentDimensions;this.setDims(u*i,h*a),this.fixAndSetPosition()},mustExec:!0})}#E(t,o){const[i,a]=this.parentDimensions,l=this.x,d=this.y,c=this.width,p=this.height,u=Jo.MIN_SIZE/i,h=Jo.MIN_SIZE/a,m=_=>Math.round(_*1e4)/1e4,f=this.#$(this.rotation),x=(_,F)=>[f[0]*_+f[2]*F,f[1]*_+f[3]*F],y=this.#$(360-this.rotation),w=(_,F)=>[y[0]*_+y[2]*F,y[1]*_+y[3]*F];let b,v,A=!1,S=!1;switch(t){case"topLeft":A=!0,b=(_,F)=>[0,0],v=(_,F)=>[_,F];break;case"topMiddle":b=(_,F)=>[_/2,0],v=(_,F)=>[_/2,F];break;case"topRight":A=!0,b=(_,F)=>[_,0],v=(_,F)=>[0,F];break;case"middleRight":S=!0,b=(_,F)=>[_,F/2],v=(_,F)=>[0,F/2];break;case"bottomRight":A=!0,b=(_,F)=>[_,F],v=(_,F)=>[0,0];break;case"bottomMiddle":b=(_,F)=>[_/2,F],v=(_,F)=>[_/2,0];break;case"bottomLeft":A=!0,b=(_,F)=>[0,F],v=(_,F)=>[_,0];break;case"middleLeft":S=!0,b=(_,F)=>[0,F/2],v=(_,F)=>[_,F/2];break}const E=b(c,p),j=v(c,p);let L=x(...j);const M=m(l+L[0]),D=m(d+L[1]);let P=1,T=1,[z,R]=this.screenToPageTranslation(o.movementX,o.movementY);if([z,R]=w(z/i,R/a),A){const _=Math.hypot(c,p);P=T=Math.max(Math.min(Math.hypot(j[0]-E[0]-z,j[1]-E[1]-R)/_,1/c,1/p),u/c,h/p)}else S?P=Math.max(u,Math.min(1,Math.abs(j[0]-E[0]-z)))/c:T=Math.max(h,Math.min(1,Math.abs(j[1]-E[1]-R)))/p;const K=m(c*P),Z=m(p*T);L=x(...v(K,Z));const O=M-L[0],Q=D-L[1];this.width=K,this.height=Z,this.x=O,this.y=Q,this.setDims(i*K,a*Z),this.fixAndSetPosition()}altTextFinish(){this.#o?.finish()}async addEditToolbar(){return this.#p||this.#f?this.#p:(this.#p=new OY(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||(o4.initialize(Jo._l10nPromise),this.#o=new o4(this),this.#e&&(this.#o.data=this.#e,this.#e=null),await this.addEditToolbar())}get altTextData(){return this.#o?.data}set altTextData(t){this.#o&&(this.#o.data=t)}hasAltText(){return!this.#o?.isEmpty()}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#i?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",this.#l,{signal:t}),this.div.addEventListener("focusout",this.#c,{signal:t});const[o,i]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*i/o).toFixed(2)}%`,this.div.style.maxHeight=`${(100*o/i).toFixed(2)}%`);const[a,l]=this.getInitialTranslation();return this.translate(a,l),sS(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:o}=od.platform;if(t.button!==0||t.ctrlKey&&o){t.preventDefault();return}if(this.#d=!0,this._isDraggable){this.#B(t);return}this.#L(t)}#L(t){const{isMac:o}=od.platform;t.ctrlKey&&!o||t.shiftKey||t.metaKey&&o?this.parent.toggleSelected(this):this.parent.setSelected(this)}#B(t){const o=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let i,a;const l=this._uiManager._signal;o&&(this.div.classList.add("moving"),i={passive:!0,capture:!0,signal:l},this.#g=t.clientX,this.#w=t.clientY,a=c=>{const{clientX:p,clientY:u}=c,[h,m]=this.screenToPageTranslation(p-this.#g,u-this.#w);this.#g=p,this.#w=u,this._uiManager.dragSelectedEditors(h,m)},window.addEventListener("pointermove",a,i));const d=()=>{window.removeEventListener("pointerup",d),window.removeEventListener("blur",d),o&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",a,i)),this.#d=!1,this._uiManager.endDragSession()||this.#L(t)};window.addEventListener("pointerup",d,{signal:l}),window.addEventListener("blur",d,{signal:l})}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,o,i){t.changeParent(this),this.x=o,this.y=i,this.fixAndSetPosition()}getRect(t,o,i=this.rotation){const a=this.parentScale,[l,d]=this.pageDimensions,[c,p]=this.pageTranslation,u=t/a,h=o/a,m=this.x*l,f=this.y*d,x=this.width*l,y=this.height*d;switch(i){case 0:return[m+u+c,d-f-h-y+p,m+u+x+c,d-f-h+p];case 90:return[m+h+c,d-f+u+p,m+h+y+c,d-f+u+x+p];case 180:return[m-u-x+c,d-f+h+p,m-u+c,d-f+h+y+p];case 270:return[m-h-y+c,d-f-u-x+p,m-h+c,d-f-u+p];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,o){const[i,a,l,d]=t,c=l-i,p=d-a;switch(this.rotation){case 0:return[i,o-d,c,p];case 90:return[i,o-a,p,c];case 180:return[l,o-a,c,p];case 270:return[l,o-d,p,c];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#f=!0}disableEditMode(){this.#f=!1}isInEditMode(){return this.#f}shouldGetKeyboardEvents(){return this.#u}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){const t=this._uiManager._signal;this.div?.addEventListener("focusin",this.#l,{signal:t}),this.div?.addEventListener("focusout",this.#c,{signal:t})}rotate(t){}serialize(t=!1,o=null){Pi("An editor must be serializable")}static deserialize(t,o,i){const a=new this.prototype.constructor({parent:o,id:o.getNextId(),uiManager:i});a.rotation=t.rotation,a.#e=t.accessibilityData;const[l,d]=a.pageDimensions,[c,p,u,h]=a.getRectInCurrentCoords(t.rect,d);return a.x=c/l,a.y=p/d,a.width=u/l,a.height=h/d,a}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",this.#l),this.div.removeEventListener("focusout",this.#c),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#y&&(clearTimeout(this.#y),this.#y=null),this.#P(),this.removeEditToolbar(),this.#v){for(const t of this.#v.values())clearTimeout(t);this.#v=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#b(),this.#r.classList.remove("hidden"),sS(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),this.#n={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const o=this.#r.children;if(!this.#t){this.#t=Array.from(o);const d=this.#M.bind(this),c=this.#T.bind(this),p=this._uiManager._signal;for(const u of this.#t){const h=u.getAttribute("data-resizer-name");u.setAttribute("role","spinbutton"),u.addEventListener("keydown",d,{signal:p}),u.addEventListener("blur",c,{signal:p}),u.addEventListener("focus",this.#D.bind(this,h),{signal:p}),Jo._l10nPromise.get(`pdfjs-editor-resizer-label-${h}`).then(m=>u.setAttribute("aria-label",m))}}const i=this.#t[0];let a=0;for(const d of o){if(d===i)break;a++}const l=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(l!==a){if(l<a)for(let c=0;c<a-l;c++)this.#r.append(this.#r.firstChild);else if(l>a)for(let c=0;c<l-a;c++)this.#r.firstChild.before(this.#r.lastChild);let d=0;for(const c of o){const u=this.#t[d++].getAttribute("data-resizer-name");Jo._l10nPromise.get(`pdfjs-editor-resizer-label-${u}`).then(h=>c.setAttribute("aria-label",h))}}this.#z(0),this.#u=!0,this.#r.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#M(t){Jo._resizerKeyboardManager.exec(this,t)}#T(t){this.#u&&t.relatedTarget?.parentNode!==this.#r&&this.#P()}#D(t){this.#h=this.#u?t:""}#z(t){if(this.#t)for(const o of this.#t)o.tabIndex=t}_resizeWithKeyboard(t,o){this.#u&&this.#E(this.#h,{movementX:t,movementY:o})}#P(){if(this.#u=!1,this.#z(-1),this.#n){const{savedX:t,savedY:o,savedWidth:i,savedHeight:a}=this.#n;this.#C(t,o,i,a),this.#n=null}}_stopResizingWithKeyboard(){this.#P(),this.div.focus()}select(){if(this.makeResizable(),this.div?.classList.add("selectedEditor"),!this.#p){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this.#p?.show()});return}this.#p?.show()}unselect(){this.#r?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this.#p?.hide()}updateParams(t,o){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#m}set isEditing(t){this.#m=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,o){this.#s=!0;const i=t/o,{style:a}=this.div;a.aspectRatio=i,a.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,o=!1){if(o){this.#v||=new Map;const{action:i}=t;let a=this.#v.get(i);a&&clearTimeout(a),a=setTimeout(()=>{this._reportTelemetry(t),this.#v.delete(i),this.#v.size===0&&(this.#v=null)},Jo._telemetryTimeout),this.#v.set(i,a);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#i=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#i=!0}renderAnnotationElement(t){let o=t.container.querySelector(".annotationContent");if(!o)o=document.createElement("div"),o.classList.add("annotationContent",this.editorType),t.container.prepend(o);else if(o.nodeName==="CANVAS"){const i=o;o=document.createElement("div"),o.classList.add("annotationContent",this.editorType),i.before(o)}return o}resetAnnotationElement(t){const{firstChild:o}=t.container;o.nodeName==="DIV"&&o.classList.contains("annotationContent")&&o.remove()}}class jLt extends Jo{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const dpe=3285377520,uc=4294901760,nu=65535;class zEe{constructor(t){this.h1=t?t&4294967295:dpe,this.h2=t?t&4294967295:dpe}update(t){let o,i;if(typeof t=="string"){o=new Uint8Array(t.length*2),i=0;for(let w=0,b=t.length;w<b;w++){const v=t.charCodeAt(w);v<=255?o[i++]=v:(o[i++]=v>>>8,o[i++]=v&255)}}else if(ArrayBuffer.isView(t))o=t.slice(),i=o.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const a=i>>2,l=i-a*4,d=new Uint32Array(o.buffer,0,a);let c=0,p=0,u=this.h1,h=this.h2;const m=3432918353,f=461845907,x=m&nu,y=f&nu;for(let w=0;w<a;w++)w&1?(c=d[w],c=c*m&uc|c*x&nu,c=c<<15|c>>>17,c=c*f&uc|c*y&nu,u^=c,u=u<<13|u>>>19,u=u*5+3864292196):(p=d[w],p=p*m&uc|p*x&nu,p=p<<15|p>>>17,p=p*f&uc|p*y&nu,h^=p,h=h<<13|h>>>19,h=h*5+3864292196);switch(c=0,l){case 3:c^=o[a*4+2]<<16;case 2:c^=o[a*4+1]<<8;case 1:c^=o[a*4],c=c*m&uc|c*x&nu,c=c<<15|c>>>17,c=c*f&uc|c*y&nu,a&1?u^=c:h^=c}this.h1=u,this.h2=h}hexdigest(){let t=this.h1,o=this.h2;return t^=o>>>1,t=t*3981806797&uc|t*36045&nu,o=o*4283543511&uc|((o<<16|t>>>16)*2950163797&uc)>>>16,t^=o>>>1,t=t*444984403&uc|t*60499&nu,o=o*3301882366&uc|((o<<16|t>>>16)*3120437893&uc)>>>16,t^=o>>>1,(t>>>0).toString(16).padStart(8,"0")+(o>>>0).toString(16).padStart(8,"0")}}const oQ=Object.freeze({map:null,hash:"",transfer:void 0});class _Y{#e=!1;#t=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,o){const i=this.#t.get(t);return i===void 0?o:Object.assign(o,i)}getRawValue(t){return this.#t.get(t)}remove(t){if(this.#t.delete(t),this.#t.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const o of this.#t.values())if(o instanceof Jo)return;this.onAnnotationEditor(null)}}setValue(t,o){const i=this.#t.get(t);let a=!1;if(i!==void 0)for(const[l,d]of Object.entries(o))i[l]!==d&&(a=!0,i[l]=d);else a=!0,this.#t.set(t,o);a&&this.#o(),o instanceof Jo&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(o.constructor._type)}has(t){return this.#t.has(t)}getAll(){return this.#t.size>0?BY(this.#t):null}setAll(t){for(const[o,i]of Object.entries(t))this.setValue(o,i)}get size(){return this.#t.size}#o(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new REe(this)}get serializable(){if(this.#t.size===0)return oQ;const t=new Map,o=new zEe,i=[],a=Object.create(null);let l=!1;for(const[d,c]of this.#t){const p=c instanceof Jo?c.serialize(!1,a):c;p&&(t.set(d,p),o.update(`${d}:${JSON.stringify(p)}`),l||=!!p.bitmap)}if(l)for(const d of t.values())d.bitmap&&i.push(d.bitmap);return t.size>0?{map:t,hash:o.hexdigest(),transfer:i}:oQ}get editorStats(){let t=null;const o=new Map;for(const i of this.#t.values()){if(!(i instanceof Jo))continue;const a=i.telemetryFinalData;if(!a)continue;const{type:l}=a;o.has(l)||o.set(l,Object.getPrototypeOf(i).constructor),t||=Object.create(null);const d=t[l]||=new Map;for(const[c,p]of Object.entries(a)){if(c==="type")continue;let u=d.get(c);u||(u=new Map,d.set(c,u));const h=u.get(p)??0;u.set(p,h+1)}}for(const[i,a]of o)t[i]=a.computeTelemetryFinalData(t[i]);return t}}class REe extends _Y{#e;constructor(t){super();const{map:o,hash:i,transfer:a}=t.serializable,l=structuredClone(o,a?{transfer:a}:null);this.#e={map:l,hash:i,transfer:a}}get print(){Pi("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}}class MLt{#e=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:o=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const o=this.styleElement.sheet;o.insertRule(t,o.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,_inspectFont:o}){if(!(!t||this.#e.has(t.loadedName))){if(Ea(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:a,style:l}=t,d=new FontFace(i,a,l);this.addNativeFontFace(d);try{await d.load(),this.#e.add(i),o?.(t)}catch{Ir(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(d)}return}Pi("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const i=t.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(a){throw Ir(`Failed to load font '${i.family}': '${a}'.`),t.disableFontFace=!0,a}}return}const o=t.createFontFaceRule();if(o){if(this.insertRule(o),this.isSyncFontLoadingSupported)return;await new Promise(i=>{const a=this._queueLoadingCallback(i);this._prepareFontLoadEvent(t,a)})}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return ni(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(Ks||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),ni(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){function o(){for(Ea(!a.done,"completeRequest() cannot be called twice."),a.done=!0;i.length>0&&i[0].done;){const l=i.shift();setTimeout(l.callback,0)}}const{loadingRequests:i}=this,a={done:!1,complete:o,callback:t};return i.push(a),a}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return ni(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,o){function i(E,j){return E.charCodeAt(j)<<24|E.charCodeAt(j+1)<<16|E.charCodeAt(j+2)<<8|E.charCodeAt(j+3)&255}function a(E,j,L,M){const D=E.substring(0,j),P=E.substring(j+L);return D+M+P}let l,d;const c=this._document.createElement("canvas");c.width=1,c.height=1;const p=c.getContext("2d");let u=0;function h(E,j){if(++u>30){Ir("Load test font never loaded."),j();return}if(p.font="30px "+E,p.fillText(".",0,20),p.getImageData(0,0,1,1).data[3]>0){j();return}setTimeout(h.bind(null,E,j))}const m=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=a(f,976,m.length,m);const y=16,w=1482184792;let b=i(f,y);for(l=0,d=m.length-3;l<d;l+=4)b=b-w+i(m,l)|0;l<m.length&&(b=b-w+i(m+"XXX",l)|0),f=a(f,y,4,mLt(b));const v=`url(data:font/opentype;base64,${btoa(f)});`,A=`@font-face {font-family:"${m}";src:${v}}`;this.insertRule(A);const S=this._document.createElement("div");S.style.visibility="hidden",S.style.width=S.style.height="10px",S.style.position="absolute",S.style.top=S.style.left="0px";for(const E of[t.loadedName,m]){const j=this._document.createElement("span");j.textContent="Hi",j.style.fontFamily=E,S.append(j)}this._document.body.append(S),h(m,()=>{S.remove(),o.complete()})}}class BLt{constructor(t,{disableFontFace:o=!1,inspectFont:i=null}){this.compiledGlyphs=Object.create(null);for(const a in t)this[a]=t[a];this.disableFontFace=o===!0,this._inspectFont=i}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const o={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(o.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,o)}return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=jEe(this.data),o=`url(data:${this.mimetype};base64,${btoa(t)});`;let i;if(!this.cssFontInfo)i=`@font-face {font-family:"${this.loadedName}";src:${o}}`;else{let a=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(a+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${a}src:${o}}`}return this._inspectFont?.(this,o),i}getPathGenerator(t,o){if(this.compiledGlyphs[o]!==void 0)return this.compiledGlyphs[o];let i;try{i=t.get(this.loadedName+"_path_"+o)}catch(l){Ir(`getPathGenerator - ignoring character: "${l}".`)}if(!Array.isArray(i)||i.length===0)return this.compiledGlyphs[o]=function(l,d){};const a=[];for(let l=0,d=i.length;l<d;)switch(i[l++]){case T2.BEZIER_CURVE_TO:{const[c,p,u,h,m,f]=i.slice(l,l+6);a.push(x=>x.bezierCurveTo(c,p,u,h,m,f)),l+=6}break;case T2.MOVE_TO:{const[c,p]=i.slice(l,l+2);a.push(u=>u.moveTo(c,p)),l+=2}break;case T2.LINE_TO:{const[c,p]=i.slice(l,l+2);a.push(u=>u.lineTo(c,p)),l+=2}break;case T2.QUADRATIC_CURVE_TO:{const[c,p,u,h]=i.slice(l,l+4);a.push(m=>m.quadraticCurveTo(c,p,u,h)),l+=4}break;case T2.RESTORE:a.push(c=>c.restore());break;case T2.SAVE:a.push(c=>c.save());break;case T2.SCALE:Ea(a.length===2,"Scale command is only valid at the third position.");break;case T2.TRANSFORM:{const[c,p,u,h,m,f]=i.slice(l,l+6);a.push(x=>x.transform(c,p,u,h,m,f)),l+=6}break;case T2.TRANSLATE:{const[c,p]=i.slice(l,l+2);a.push(u=>u.translate(c,p)),l+=2}break}return this.compiledGlyphs[o]=function(d,c){a[0](d),a[1](d),d.scale(c,-c);for(let p=2,u=a.length;p<u;p++)a[p](d)}}}if(Ks){var rQ=Promise.withResolvers(),iQ=null;(async()=>{const t=await Y3(()=>import("./empty-B9bTdnzW.js").then(c=>c.e),__vite__mapDeps([0,1,2])),o=await Y3(()=>import("./index-Csk7zXgi.js").then(c=>c.i),__vite__mapDeps([3,1,4,5,6,7,8,9])),i=await Y3(()=>import("./index-B7A7Bq2L.js").then(c=>c.i),__vite__mapDeps([10,1,11,4,5,6,7,8,9])),a=await Y3(()=>import("./url-mBOiBJLr.js").then(c=>c.u),__vite__mapDeps([12,1,9,7,5,6,8]));let l,d;return new Map(Object.entries({fs:t,http:o,https:i,url:a,canvas:l,path2d:d}))})().then(t=>{iQ=t,rQ.resolve()},t=>{Ir(`loadPackages: ${t}`),iQ=new Map,rQ.resolve()})}class t2{static get promise(){return rQ.promise}static get(t){return iQ?.get(t)}}const FEe=function(e){return t2.get("fs").promises.readFile(e).then(o=>new Uint8Array(o))};class DLt extends tI{}class PLt extends oI{_createCanvas(t,o){return t2.get("canvas").createCanvas(t,o)}}class TLt extends rI{_fetchData(t,o){return FEe(t).then(i=>({cMapData:i,compressionType:o}))}}class zLt extends iI{_fetchData(t){return FEe(t)}}const yl={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function nQ(e,t){if(!t)return;const o=t[2]-t[0],i=t[3]-t[1],a=new Path2D;a.rect(t[0],t[1],o,i),e.clip(a)}class fb{constructor(){this.constructor===fb&&Pi("Cannot initialize BaseShadingPattern.")}getPattern(){Pi("Abstract method `getPattern` called.")}}class RLt extends fb{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let o;this._type==="axial"?o=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(o=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)o.addColorStop(i[0],i[1]);return o}getPattern(t,o,i,a){let l;if(a===yl.STROKE||a===yl.FILL){const d=o.current.getClippedPathBoundingBox(a,An(t))||[0,0,0,0],c=Math.ceil(d[2]-d[0])||1,p=Math.ceil(d[3]-d[1])||1,u=o.cachedCanvases.getCanvas("pattern",c,p,!0),h=u.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-d[0],-d[1]),i=$o.transform(i,[1,0,0,1,d[0],d[1]]),h.transform(...o.baseTransform),this.matrix&&h.transform(...this.matrix),nQ(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),l=t.createPattern(u.canvas,"no-repeat");const m=new DOMMatrix(i);l.setTransform(m)}else nQ(t,this._bbox),l=this._createGradient(t);return l}}function fO(e,t,o,i,a,l,d,c){const p=t.coords,u=t.colors,h=e.data,m=e.width*4;let f;p[o+1]>p[i+1]&&(f=o,o=i,i=f,f=l,l=d,d=f),p[i+1]>p[a+1]&&(f=i,i=a,a=f,f=d,d=c,c=f),p[o+1]>p[i+1]&&(f=o,o=i,i=f,f=l,l=d,d=f);const x=(p[o]+t.offsetX)*t.scaleX,y=(p[o+1]+t.offsetY)*t.scaleY,w=(p[i]+t.offsetX)*t.scaleX,b=(p[i+1]+t.offsetY)*t.scaleY,v=(p[a]+t.offsetX)*t.scaleX,A=(p[a+1]+t.offsetY)*t.scaleY;if(y>=A)return;const S=u[l],E=u[l+1],j=u[l+2],L=u[d],M=u[d+1],D=u[d+2],P=u[c],T=u[c+1],z=u[c+2],R=Math.round(y),K=Math.round(A);let Z,O,Q,_,F,N,H,ee;for(let Y=R;Y<=K;Y++){if(Y<b){const we=Y<y?0:(y-Y)/(y-b);Z=x-(x-w)*we,O=S-(S-L)*we,Q=E-(E-M)*we,_=j-(j-D)*we}else{let we;Y>A?we=1:b===A?we=0:we=(b-Y)/(b-A),Z=w-(w-v)*we,O=L-(L-P)*we,Q=M-(M-T)*we,_=D-(D-z)*we}let G;Y<y?G=0:Y>A?G=1:G=(y-Y)/(y-A),F=x-(x-v)*G,N=S-(S-P)*G,H=E-(E-T)*G,ee=j-(j-z)*G;const J=Math.round(Math.min(Z,F)),X=Math.round(Math.max(Z,F));let ie=m*Y+J*4;for(let we=J;we<=X;we++)G=(Z-we)/(Z-F),G<0?G=0:G>1&&(G=1),h[ie++]=O-(O-N)*G|0,h[ie++]=Q-(Q-H)*G|0,h[ie++]=_-(_-ee)*G|0,h[ie++]=255}}function FLt(e,t,o){const i=t.coords,a=t.colors;let l,d;switch(t.type){case"lattice":const c=t.verticesPerRow,p=Math.floor(i.length/c)-1,u=c-1;for(l=0;l<p;l++){let h=l*c;for(let m=0;m<u;m++,h++)fO(e,o,i[h],i[h+1],i[h+c],a[h],a[h+1],a[h+c]),fO(e,o,i[h+c+1],i[h+1],i[h+c],a[h+c+1],a[h+1],a[h+c])}break;case"triangles":for(l=0,d=i.length;l<d;l+=3)fO(e,o,i[l],i[l+1],i[l+2],a[l],a[l+1],a[l+2]);break;default:throw new Error("illegal figure")}}class OLt extends fb{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,o,i){const c=Math.floor(this._bounds[0]),p=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-c,h=Math.ceil(this._bounds[3])-p,m=Math.min(Math.ceil(Math.abs(u*t[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(h*t[1]*1.1)),3e3),x=u/m,y=h/f,w={coords:this._coords,colors:this._colors,offsetX:-c,offsetY:-p,scaleX:1/x,scaleY:1/y},b=m+2*2,v=f+2*2,A=i.getCanvas("mesh",b,v,!1),S=A.context,E=S.createImageData(m,f);if(o){const L=E.data;for(let M=0,D=L.length;M<D;M+=4)L[M]=o[0],L[M+1]=o[1],L[M+2]=o[2],L[M+3]=255}for(const L of this._figures)FLt(E,L,w);return S.putImageData(E,2,2),{canvas:A.canvas,offsetX:c-2*x,offsetY:p-2*y,scaleX:x,scaleY:y}}getPattern(t,o,i,a){nQ(t,this._bbox);let l;if(a===yl.SHADING)l=$o.singularValueDecompose2dScale(An(t));else if(l=$o.singularValueDecompose2dScale(o.baseTransform),this.matrix){const c=$o.singularValueDecompose2dScale(this.matrix);l=[l[0]*c[0],l[1]*c[1]]}const d=this._createMeshCanvas(l,a===yl.SHADING?null:this._background,o.cachedCanvases);return a!==yl.SHADING&&(t.setTransform(...o.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(d.offsetX,d.offsetY),t.scale(d.scaleX,d.scaleY),t.createPattern(d.canvas,"no-repeat")}}class NLt extends fb{getPattern(){return"hotpink"}}function HLt(e){switch(e[0]){case"RadialAxial":return new RLt(e);case"Mesh":return new OLt(e);case"Dummy":return new NLt}throw new Error(`Unknown IR type: ${e[0]}`)}const cpe={COLORED:1,UNCOLORED:2};class VY{static MAX_PATTERN_SIZE=3e3;constructor(t,o,i,a,l){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=o,this.ctx=i,this.canvasGraphicsFactory=a,this.baseTransform=l}createPatternCanvas(t){const o=this.operatorList,i=this.bbox,a=this.xstep,l=this.ystep,d=this.paintType,c=this.tilingType,p=this.color,u=this.canvasGraphicsFactory;JL("TilingType: "+c);const h=i[0],m=i[1],f=i[2],x=i[3],y=$o.singularValueDecompose2dScale(this.matrix),w=$o.singularValueDecompose2dScale(this.baseTransform),b=[y[0]*w[0],y[1]*w[1]],v=this.getSizeAndScale(a,this.ctx.canvas.width,b[0]),A=this.getSizeAndScale(l,this.ctx.canvas.height,b[1]),S=t.cachedCanvases.getCanvas("pattern",v.size,A.size,!0),E=S.context,j=u.createCanvasGraphics(E);j.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(j,d,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)),j.transform(v.scale,0,0,A.scale,0,0),E.save(),this.clipBbox(j,L,M,D,P),j.baseTransform=An(j.ctx),j.executeOperatorList(o),j.endDrawing(),{canvas:S.canvas,scaleX:v.scale,scaleY:A.scale,offsetX:L,offsetY:M}}getSizeAndScale(t,o,i){t=Math.abs(t);const a=Math.max(VY.MAX_PATTERN_SIZE,o);let l=Math.ceil(t*i);return l>=a?l=a:i=l/t,{scale:i,size:l}}clipBbox(t,o,i,a,l){const d=a-o,c=l-i;t.ctx.rect(o,i,d,c),t.current.updateRectMinMax(An(t.ctx),[o,i,a,l]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,o,i){const a=t.ctx,l=t.current;switch(o){case cpe.COLORED:const d=this.ctx;a.fillStyle=d.fillStyle,a.strokeStyle=d.strokeStyle,l.fillColor=d.fillStyle,l.strokeColor=d.strokeStyle;break;case cpe.UNCOLORED:const c=$o.makeHexColor(i[0],i[1],i[2]);a.fillStyle=c,a.strokeStyle=c,l.fillColor=c,l.strokeColor=c;break;default:throw new hLt(`Unsupported paint type: ${o}`)}}getPattern(t,o,i,a){let l=i;a!==yl.SHADING&&(l=$o.transform(l,o.baseTransform),this.matrix&&(l=$o.transform(l,this.matrix)));const d=this.createPatternCanvas(o);let c=new DOMMatrix(l);c=c.translate(d.offsetX,d.offsetY),c=c.scale(1/d.scaleX,1/d.scaleY);const p=t.createPattern(d.canvas,"repeat");return p.setTransform(c),p}}function _Lt({src:e,srcPos:t=0,dest:o,width:i,height:a,nonBlackColor:l=4294967295,inverseDecode:d=!1}){const c=od.isLittleEndian?4278190080:255,[p,u]=d?[l,c]:[c,l],h=i>>3,m=i&7,f=e.length;o=new Uint32Array(o.buffer);let x=0;for(let y=0;y<a;y++){for(const b=t+h;t<b;t++){const v=t<f?e[t]:255;o[x++]=v&128?u:p,o[x++]=v&64?u:p,o[x++]=v&32?u:p,o[x++]=v&16?u:p,o[x++]=v&8?u:p,o[x++]=v&4?u:p,o[x++]=v&2?u:p,o[x++]=v&1?u:p}if(m===0)continue;const w=t<f?e[t++]:255;for(let b=0;b<m;b++)o[x++]=w&1<<7-b?u:p}return{srcPos:t,destPos:x}}const ppe=16,upe=100,VLt=15,hpe=10,mpe=1e3,Yl=16;function QLt(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(i,a){t.translate(i,a),this.__originalTranslate(i,a)},e.scale=function(i,a){t.scale(i,a),this.__originalScale(i,a)},e.transform=function(i,a,l,d,c,p){t.transform(i,a,l,d,c,p),this.__originalTransform(i,a,l,d,c,p)},e.setTransform=function(i,a,l,d,c,p){t.setTransform(i,a,l,d,c,p),this.__originalSetTransform(i,a,l,d,c,p)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(i){t.rotate(i),this.__originalRotate(i)},e.clip=function(i){t.clip(i),this.__originalClip(i)},e.moveTo=function(o,i){t.moveTo(o,i),this.__originalMoveTo(o,i)},e.lineTo=function(o,i){t.lineTo(o,i),this.__originalLineTo(o,i)},e.bezierCurveTo=function(o,i,a,l,d,c){t.bezierCurveTo(o,i,a,l,d,c),this.__originalBezierCurveTo(o,i,a,l,d,c)},e.rect=function(o,i,a,l){t.rect(o,i,a,l),this.__originalRect(o,i,a,l)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class ULt{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,o,i){let a;return this.cache[t]!==void 0?(a=this.cache[t],this.canvasFactory.reset(a,o,i)):(a=this.canvasFactory.create(o,i),this.cache[t]=a),a}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const o=this.cache[t];this.canvasFactory.destroy(o),delete this.cache[t]}}}function gC(e,t,o,i,a,l,d,c,p,u){const[h,m,f,x,y,w]=An(e);if(m===0&&f===0){const A=d*h+y,S=Math.round(A),E=c*x+w,j=Math.round(E),L=(d+p)*h+y,M=Math.abs(Math.round(L)-S)||1,D=(c+u)*x+w,P=Math.abs(Math.round(D)-j)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(x),S,j),e.drawImage(t,o,i,a,l,0,0,M,P),e.setTransform(h,m,f,x,y,w),[M,P]}if(h===0&&x===0){const A=c*f+y,S=Math.round(A),E=d*m+w,j=Math.round(E),L=(c+u)*f+y,M=Math.abs(Math.round(L)-S)||1,D=(d+p)*m+w,P=Math.abs(Math.round(D)-j)||1;return e.setTransform(0,Math.sign(m),Math.sign(f),0,S,j),e.drawImage(t,o,i,a,l,0,0,P,M),e.setTransform(h,m,f,x,y,w),[P,M]}e.drawImage(t,o,i,a,l,d,c,p,u);const b=Math.hypot(h,m),v=Math.hypot(f,x);return[b*p,v*u]}function WLt(e){const{width:t,height:o}=e;if(t>mpe||o>mpe)return null;const i=1e3,a=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),l=t+1;let d=new Uint8Array(l*(o+1)),c,p,u;const h=t+7&-8;let m=new Uint8Array(h*o),f=0;for(const v of e.data){let A=128;for(;A>0;)m[f++]=v&A?0:255,A>>=1}let x=0;for(f=0,m[f]!==0&&(d[0]=1,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(d[p]=m[f]?2:1,++x),f++;for(m[f]!==0&&(d[p]=2,++x),c=1;c<o;c++){f=c*h,u=c*l,m[f-h]!==m[f]&&(d[u]=m[f]?1:8,++x);let v=(m[f]?4:0)+(m[f-h]?8:0);for(p=1;p<t;p++)v=(v>>2)+(m[f+1]?4:0)+(m[f-h+1]?8:0),a[v]&&(d[u+p]=a[v],++x),f++;if(m[f-h]!==m[f]&&(d[u+p]=m[f]?2:4,++x),x>i)return null}for(f=h*(o-1),u=c*l,m[f]!==0&&(d[u]=8,++x),p=1;p<t;p++)m[f]!==m[f+1]&&(d[u+p]=m[f]?4:8,++x),f++;if(m[f]!==0&&(d[u+p]=4,++x),x>i)return null;const y=new Int32Array([0,l,-1,0,-l,0,0,0,1]),w=new Path2D;for(c=0;x&&c<=o;c++){let v=c*l;const A=v+t;for(;v<A&&!d[v];)v++;if(v===A)continue;w.moveTo(v%l,c);const S=v;let E=d[v];do{const j=y[E];do v+=j;while(!d[v]);const L=d[v];L!==5&&L!==10?(E=L,d[v]=0):(E=L&51*E>>4,d[v]&=E>>2|E<<2),w.lineTo(v%l,v/l|0),d[v]||--x}while(S!==v);--c}return m=null,d=null,function(v){v.save(),v.scale(1/t,-1/o),v.translate(0,-o),v.fill(w),v.beginPath(),v.restore()}}class gpe{constructor(t,o){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=LEe,this.textMatrixScale=1,this.fontMatrix=JV,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=Ns.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,o])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,o){this.x=t,this.y=o}updatePathMinMax(t,o,i){[o,i]=$o.applyTransform([o,i],t),this.minX=Math.min(this.minX,o),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,o),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,o){const i=$o.applyTransform(o,t),a=$o.applyTransform(o.slice(2),t),l=$o.applyTransform([o[0],o[3]],t),d=$o.applyTransform([o[2],o[1]],t);this.minX=Math.min(this.minX,i[0],a[0],l[0],d[0]),this.minY=Math.min(this.minY,i[1],a[1],l[1],d[1]),this.maxX=Math.max(this.maxX,i[0],a[0],l[0],d[0]),this.maxY=Math.max(this.maxY,i[1],a[1],l[1],d[1])}updateScalingPathMinMax(t,o){$o.scaleMinMax(t,o),this.minX=Math.min(this.minX,o[0]),this.minY=Math.min(this.minY,o[1]),this.maxX=Math.max(this.maxX,o[2]),this.maxY=Math.max(this.maxY,o[3])}updateCurvePathMinMax(t,o,i,a,l,d,c,p,u,h){const m=$o.bezierBoundingBox(o,i,a,l,d,c,p,u,h);h||this.updateRectMinMax(t,m)}getPathBoundingBox(t=yl.FILL,o=null){const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===yl.STROKE){o||Pi("Stroke bounding box must include transform.");const a=$o.singularValueDecompose2dScale(o),l=a[0]*this.lineWidth/2,d=a[1]*this.lineWidth/2;i[0]-=l,i[1]-=d,i[2]+=l,i[3]+=d}return i}updateClipFromPath(){const t=$o.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=yl.FILL,o=null){return $o.intersect(this.clipBox,this.getPathBoundingBox(t,o))}}function fpe(e,t){if(typeof ImageData<"u"&&t instanceof ImageData){e.putImageData(t,0,0);return}const o=t.height,i=t.width,a=o%Yl,l=(o-a)/Yl,d=a===0?l:l+1,c=e.createImageData(i,Yl);let p=0,u;const h=t.data,m=c.data;let f,x,y,w;if(t.kind===R$.GRAYSCALE_1BPP){const b=h.byteLength,v=new Uint32Array(m.buffer,0,m.byteLength>>2),A=v.length,S=i+7>>3,E=4294967295,j=od.isLittleEndian?4278190080:255;for(f=0;f<d;f++){for(y=f<l?Yl:a,u=0,x=0;x<y;x++){const L=b-p;let M=0;const D=L>S?i:L*8-7,P=D&-8;let T=0,z=0;for(;M<P;M+=8)z=h[p++],v[u++]=z&128?E:j,v[u++]=z&64?E:j,v[u++]=z&32?E:j,v[u++]=z&16?E:j,v[u++]=z&8?E:j,v[u++]=z&4?E:j,v[u++]=z&2?E:j,v[u++]=z&1?E:j;for(;M<D;M++)T===0&&(z=h[p++],T=128),v[u++]=z&T?E:j,T>>=1}for(;u<A;)v[u++]=0;e.putImageData(c,0,f*Yl)}}else if(t.kind===R$.RGBA_32BPP){for(x=0,w=i*Yl*4,f=0;f<l;f++)m.set(h.subarray(p,p+w)),p+=w,e.putImageData(c,0,x),x+=Yl;f<d&&(w=i*a*4,m.set(h.subarray(p,p+w)),e.putImageData(c,0,x))}else if(t.kind===R$.RGB_24BPP)for(y=Yl,w=i*y,f=0;f<d;f++){for(f>=l&&(y=a,w=i*y),u=0,x=w;x--;)m[u++]=h[p++],m[u++]=h[p++],m[u++]=h[p++],m[u++]=255;e.putImageData(c,0,f*Yl)}else throw new Error(`bad image kind: ${t.kind}`)}function xpe(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}const o=t.height,i=t.width,a=o%Yl,l=(o-a)/Yl,d=a===0?l:l+1,c=e.createImageData(i,Yl);let p=0;const u=t.data,h=c.data;for(let m=0;m<d;m++){const f=m<l?Yl:a;({srcPos:p}=_Lt({src:u,srcPos:p,dest:h,width:i,height:f,nonBlackColor:0})),e.putImageData(c,0,m*Yl)}}function B9(e,t){const o=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of o)e[i]!==void 0&&(t[i]=e[i]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function fC(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),!Ks){const{filter:t}=e;t!=="none"&&t!==""&&(e.filter="none")}}function ype(e,t){if(t)return!0;const o=$o.singularValueDecompose2dScale(e);o[0]=Math.fround(o[0]),o[1]=Math.fround(o[1]);const i=Math.fround((globalThis.devicePixelRatio||1)*u6.PDF_TO_CSS_UNITS);return o[0]<=i&&o[1]<=i}const GLt=["butt","round","square"],YLt=["miter","round","bevel"],KLt={},wpe={};class D7{constructor(t,o,i,a,l,{optionalContentConfig:d,markedContentStack:c=null},p,u){this.ctx=t,this.current=new gpe(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=o,this.objs=i,this.canvasFactory=a,this.filterFactory=l,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=c||[],this.optionalContentConfig=d,this.cachedCanvases=new ULt(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=p,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=u,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,o=null){return typeof t=="string"?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):o}beginDrawing({transform:t,viewport:o,transparency:i=!1,background:a=null}){const l=this.ctx.canvas.width,d=this.ctx.canvas.height,c=this.ctx.fillStyle;if(this.ctx.fillStyle=a||"#ffffff",this.ctx.fillRect(0,0,l,d),this.ctx.fillStyle=c,i){const p=this.cachedCanvases.getCanvas("transparent",l,d);this.compositeCtx=this.ctx,this.transparentCanvas=p.canvas,this.ctx=p.context,this.ctx.save(),this.ctx.transform(...An(this.compositeCtx))}this.ctx.save(),fC(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...o.transform),this.viewportScale=o.scale,this.baseTransform=An(this.ctx)}executeOperatorList(t,o,i,a){const l=t.argsArray,d=t.fnArray;let c=o||0;const p=l.length;if(p===c)return c;const u=p-c>hpe&&typeof i=="function",h=u?Date.now()+VLt:0;let m=0;const f=this.commonObjs,x=this.objs;let y;for(;;){if(a!==void 0&&c===a.nextBreakPoint)return a.breakIt(c,i),c;if(y=d[c],y!==E1.dependency)this[y].apply(this,l[c]);else for(const w of l[c]){const b=w.startsWith("g_")?f:x;if(!b.has(w))return b.get(w,i),c}if(c++,c===p)return c;if(u&&++m>hpe){if(Date.now()>h)return i(),c;m=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const o of t.values())typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement&&(o.width=o.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const o=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=o}}}_scaleImage(t,o){const i=t.width,a=t.height;let l=Math.max(Math.hypot(o[0],o[1]),1),d=Math.max(Math.hypot(o[2],o[3]),1),c=i,p=a,u="prescale1",h,m;for(;l>2&&c>1||d>2&&p>1;){let f=c,x=p;l>2&&c>1&&(f=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c/2),l/=c/f),d>2&&p>1&&(x=p>=16384?Math.floor(p/2)-1||1:Math.ceil(p)/2,d/=p/x),h=this.cachedCanvases.getCanvas(u,f,x),m=h.context,m.clearRect(0,0,f,x),m.drawImage(t,0,0,c,p,0,0,f,x),t=h.canvas,c=f,p=x,u=u==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:c,paintHeight:p}}_createMaskCanvas(t){const o=this.ctx,{width:i,height:a}=t,l=this.current.fillColor,d=this.current.patternFill,c=An(o);let p,u,h,m;if((t.bitmap||t.data)&&t.count>1){const D=t.bitmap||t.data.buffer;u=JSON.stringify(d?c:[c.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&&!d){const T=Math.round(Math.min(c[0],c[2])+c[4]),z=Math.round(Math.min(c[1],c[3])+c[5]);return{canvas:P,offsetX:T,offsetY:z}}h=P}h||(m=this.cachedCanvases.getCanvas("maskCanvas",i,a),xpe(m.context,t));let f=$o.transform(c,[1/i,0,0,-1/a,0,0]);f=$o.transform(f,[1,0,0,1,0,-a]);const[x,y,w,b]=$o.getAxialAlignedBoundingBox([0,0,i,a],f),v=Math.round(w-x)||1,A=Math.round(b-y)||1,S=this.cachedCanvases.getCanvas("fillCanvas",v,A),E=S.context,j=x,L=y;E.translate(-j,-L),E.transform(...f),h||(h=this._scaleImage(m.canvas,z2(E)),h=h.img,p&&d&&p.set(u,h)),E.imageSmoothingEnabled=ype(An(E),t.interpolate),gC(E,h,0,0,h.width,h.height,0,0,i,a),E.globalCompositeOperation="source-in";const M=$o.transform(z2(E),[1,0,0,1,-j,-L]);return E.fillStyle=d?l.getPattern(o,this,M,yl.FILL):l,E.fillRect(0,0,i,a),p&&!d&&(this.cachedCanvases.delete("fillCanvas"),p.set(u,S.canvas)),{canvas:S.canvas,offsetX:Math.round(j),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=GLt[t]}setLineJoin(t){this.ctx.lineJoin=YLt[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,o){const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(t),i.lineDashOffset=o)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[o,i]of t)switch(o){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,o=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(i,t,o);this.suspendedCtx=this.ctx,this.ctx=a.context;const l=this.ctx;l.setTransform(...An(this.suspendedCtx)),B9(this.suspendedCtx,l),QLt(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(),B9(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const o=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,o,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,o,i,a){const l=a[0],d=a[1],c=a[2]-l,p=a[3]-d;c===0||p===0||(this.genericComposeSMask(o.context,i,c,p,o.subtype,o.backdrop,o.transferMap,l,d,o.offsetX,o.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,o,i,a,l,d,c,p,u,h,m){let f=t.canvas,x=p-h,y=u-m;if(d){if(x<0||y<0||x+i>f.width||y+a>f.height){const b=this.cachedCanvases.getCanvas("maskExtension",i,a),v=b.context;v.drawImage(f,-x,-y),d.some(A=>A!==0)&&(v.globalCompositeOperation="destination-atop",v.fillStyle=$o.makeHexColor(...d),v.fillRect(0,0,i,a),v.globalCompositeOperation="source-over"),f=b.canvas,x=y=0}else if(d.some(b=>b!==0)){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const b=new Path2D;b.rect(x,y,i,a),t.clip(b),t.globalCompositeOperation="destination-atop",t.fillStyle=$o.makeHexColor(...d),t.fillRect(x,y,i,a),t.restore()}}o.save(),o.globalAlpha=1,o.setTransform(1,0,0,1,0,0),l==="Alpha"&&c?o.filter=this.filterFactory.addAlphaFilter(c):l==="Luminosity"&&(o.filter=this.filterFactory.addLuminosityFilter(c));const w=new Path2D;w.rect(p,u,i,a),o.clip(w),o.globalCompositeOperation="destination-in",o.drawImage(f,x,y,i,a,p,u,i,a),o.restore()}save(){this.inSMaskMode?(B9(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(),B9(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,o,i,a,l,d){this.ctx.transform(t,o,i,a,l,d),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,o,i){const a=this.ctx,l=this.current;let d=l.x,c=l.y,p,u;const h=An(a),m=h[0]===0&&h[3]===0||h[1]===0&&h[2]===0,f=m?i.slice(0):null;for(let x=0,y=0,w=t.length;x<w;x++)switch(t[x]|0){case E1.rectangle:d=o[y++],c=o[y++];const b=o[y++],v=o[y++],A=d+b,S=c+v;a.moveTo(d,c),b===0||v===0?a.lineTo(A,S):(a.lineTo(A,c),a.lineTo(A,S),a.lineTo(d,S)),m||l.updateRectMinMax(h,[d,c,A,S]),a.closePath();break;case E1.moveTo:d=o[y++],c=o[y++],a.moveTo(d,c),m||l.updatePathMinMax(h,d,c);break;case E1.lineTo:d=o[y++],c=o[y++],a.lineTo(d,c),m||l.updatePathMinMax(h,d,c);break;case E1.curveTo:p=d,u=c,d=o[y+4],c=o[y+5],a.bezierCurveTo(o[y],o[y+1],o[y+2],o[y+3],d,c),l.updateCurvePathMinMax(h,p,u,o[y],o[y+1],o[y+2],o[y+3],d,c,f),y+=6;break;case E1.curveTo2:p=d,u=c,a.bezierCurveTo(d,c,o[y],o[y+1],o[y+2],o[y+3]),l.updateCurvePathMinMax(h,p,u,d,c,o[y],o[y+1],o[y+2],o[y+3],f),d=o[y+2],c=o[y+3],y+=4;break;case E1.curveTo3:p=d,u=c,d=o[y+2],c=o[y+3],a.bezierCurveTo(o[y],o[y+1],d,c,d,c),l.updateCurvePathMinMax(h,p,u,o[y],o[y+1],d,c,d,c,f),y+=4;break;case E1.closePath:a.closePath();break}m&&l.updateScalingPathMinMax(h,f),l.setCurrentPoint(d,c)}closePath(){this.ctx.closePath()}stroke(t=!0){const o=this.ctx,i=this.current.strokeColor;o.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof i=="object"&&i?.getPattern?(o.save(),o.strokeStyle=i.getPattern(o,this,z2(o),yl.STROKE),this.rescaleAndStroke(!1),o.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),o.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){const o=this.ctx,i=this.current.fillColor,a=this.current.patternFill;let l=!1;a&&(o.save(),o.fillStyle=i.getPattern(o,this,z2(o),yl.FILL),l=!0);const d=this.current.getClippedPathBoundingBox();this.contentVisible&&d!==null&&(this.pendingEOFill?(o.fill("evenodd"),this.pendingEOFill=!1):o.fill()),l&&o.restore(),t&&this.consumePath(d)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=KLt}eoClip(){this.pendingClip=wpe}beginText(){this.current.textMatrix=LEe,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,o=this.ctx;if(t===void 0){o.beginPath();return}o.save(),o.beginPath();for(const i of t)o.setTransform(...i.transform),o.translate(i.x,i.y),i.addToPath(o,i.fontSize);o.restore(),o.clip(),o.beginPath(),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,o){const i=this.commonObjs.get(t),a=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(a.fontMatrix=i.fontMatrix||JV,(a.fontMatrix[0]===0||a.fontMatrix[3]===0)&&Ir("Invalid font matrix for font "+t),o<0?(o=-o,a.fontDirection=-1):a.fontDirection=1,this.current.font=i,this.current.fontSize=o,i.isType3Font)return;const l=i.loadedName||"sans-serif",d=i.systemFontInfo?.css||`"${l}", ${i.fallbackName}`;let c="normal";i.black?c="900":i.bold&&(c="bold");const p=i.italic?"italic":"normal";let u=o;o<ppe?u=ppe:o>upe&&(u=upe),this.current.fontSizeScale=o/u,this.ctx.font=`${p} ${c} ${u}px ${d}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,o){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=o}setLeadingMoveText(t,o){this.setLeading(-o),this.moveText(t,o)}setTextMatrix(t,o,i,a,l,d){this.current.textMatrix=[t,o,i,a,l,d],this.current.textMatrixScale=Math.hypot(t,o),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,o,i,a){const l=this.ctx,d=this.current,c=d.font,p=d.textRenderingMode,u=d.fontSize/d.fontSizeScale,h=p&Ns.FILL_STROKE_MASK,m=!!(p&Ns.ADD_TO_PATH_FLAG),f=d.patternFill&&!c.missingFile;let x;(c.disableFontFace||m||f)&&(x=c.getPathGenerator(this.commonObjs,t)),c.disableFontFace||f?(l.save(),l.translate(o,i),l.beginPath(),x(l,u),a&&l.setTransform(...a),(h===Ns.FILL||h===Ns.FILL_STROKE)&&l.fill(),(h===Ns.STROKE||h===Ns.FILL_STROKE)&&l.stroke(),l.restore()):((h===Ns.FILL||h===Ns.FILL_STROKE)&&l.fillText(t,o,i),(h===Ns.STROKE||h===Ns.FILL_STROKE)&&l.strokeText(t,o,i)),m&&(this.pendingTextPaths||=[]).push({transform:An(l),x:o,y:i,fontSize:u,addToPath:x})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const o=t.getImageData(0,0,10,10).data;let i=!1;for(let a=3;a<o.length;a+=4)if(o[a]>0&&o[a]<255){i=!0;break}return ni(this,"isFontSubpixelAAEnabled",i)}showText(t){const o=this.current,i=o.font;if(i.isType3Font)return this.showType3Text(t);const a=o.fontSize;if(a===0)return;const l=this.ctx,d=o.fontSizeScale,c=o.charSpacing,p=o.wordSpacing,u=o.fontDirection,h=o.textHScale*u,m=t.length,f=i.vertical,x=f?1:-1,y=i.defaultVMetrics,w=a*o.fontMatrix[0],b=o.textRenderingMode===Ns.FILL&&!i.disableFontFace&&!o.patternFill;l.save(),l.transform(...o.textMatrix),l.translate(o.x,o.y+o.textRise),u>0?l.scale(h,-1):l.scale(h,1);let v;if(o.patternFill){l.save();const L=o.fillColor.getPattern(l,this,z2(l),yl.FILL);v=An(l),l.restore(),l.fillStyle=L}let A=o.lineWidth;const S=o.textMatrixScale;if(S===0||A===0){const L=o.textRenderingMode&Ns.FILL_STROKE_MASK;(L===Ns.STROKE||L===Ns.FILL_STROKE)&&(A=this.getSinglePixelWidth())}else A/=S;if(d!==1&&(l.scale(d,d),A/=d),l.lineWidth=A,i.isInvalidPDFjsFont){const L=[];let M=0;for(const D of t)L.push(D.unicode),M+=D.width;l.fillText(L.join(""),0,0),o.x+=M*w*h,l.restore(),this.compose();return}let E=0,j;for(j=0;j<m;++j){const L=t[j];if(typeof L=="number"){E+=x*L*a/1e3;continue}let M=!1;const D=(L.isSpace?p:0)+c,P=L.fontChar,T=L.accent;let z,R,K=L.width;if(f){const O=L.vmetric||y,Q=-(L.vmetric?O[1]:K*.5)*w,_=O[2]*w;K=O?-O[0]:K,z=Q/d,R=(E+_)/d}else z=E/d,R=0;if(i.remeasure&&K>0){const O=l.measureText(P).width*1e3/a*d;if(K<O&&this.isFontSubpixelAAEnabled){const Q=K/O;M=!0,l.save(),l.scale(Q,1),z/=Q}else K!==O&&(z+=(K-O)/2e3*a/d)}if(this.contentVisible&&(L.isInFont||i.missingFile)){if(b&&!T)l.fillText(P,z,R);else if(this.paintChar(P,z,R,v),T){const O=z+a*T.offset.x/d,Q=R-a*T.offset.y/d;this.paintChar(T.fontChar,O,Q,v)}}const Z=f?K*w-D*u:K*w+D*u;E+=Z,M&&l.restore()}f?o.y-=E:o.x+=E*h,l.restore(),this.compose()}showType3Text(t){const o=this.ctx,i=this.current,a=i.font,l=i.fontSize,d=i.fontDirection,c=a.vertical?1:-1,p=i.charSpacing,u=i.wordSpacing,h=i.textHScale*d,m=i.fontMatrix||JV,f=t.length,x=i.textRenderingMode===Ns.INVISIBLE;let y,w,b,v;if(!(x||l===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,o.save(),o.transform(...i.textMatrix),o.translate(i.x,i.y),o.scale(h,d),y=0;y<f;++y){if(w=t[y],typeof w=="number"){v=c*w*l/1e3,this.ctx.translate(v,0),i.x+=v*h;continue}const A=(w.isSpace?u:0)+p,S=a.charProcOperatorList[w.operatorListId];if(!S){Ir(`Type3 character "${w.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=w,this.save(),o.scale(l,l),o.transform(...m),this.executeOperatorList(S),this.restore()),b=$o.applyTransform([w.width,0],m)[0]*l+A,o.translate(b,0),i.x+=b*h}o.restore(),this.processingType3=null}}setCharWidth(t,o){}setCharWidthAndBounds(t,o,i,a,l,d){this.ctx.rect(i,a,l-i,d-a),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let o;if(t[0]==="TilingPattern"){const i=t[1],a=this.baseTransform||An(this.ctx),l={createCanvasGraphics:d=>new D7(d,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};o=new VY(t,i,this.ctx,l,a)}else o=this._getPattern(t[1],t[2]);return o}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,o,i){const a=$o.makeHexColor(t,o,i);this.ctx.strokeStyle=a,this.current.strokeColor=a}setFillRGBColor(t,o,i){const a=$o.makeHexColor(t,o,i);this.ctx.fillStyle=a,this.current.fillColor=a,this.current.patternFill=!1}_getPattern(t,o=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=HLt(this.getObject(t)),this.cachedPatterns.set(t,i)),o&&(i.matrix=o),i}shadingFill(t){if(!this.contentVisible)return;const o=this.ctx;this.save();const i=this._getPattern(t);o.fillStyle=i.getPattern(o,this,z2(o),yl.SHADING);const a=z2(o);if(a){const{width:l,height:d}=o.canvas,[c,p,u,h]=$o.getAxialAlignedBoundingBox([0,0,l,d],a);this.ctx.fillRect(c,p,u-c,h-p)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Pi("Should not call beginInlineImage")}beginImageData(){Pi("Should not call beginImageData")}paintFormXObjectBegin(t,o){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=An(this.ctx),o)){const i=o[2]-o[0],a=o[3]-o[1];this.ctx.rect(o[0],o[1],i,a),this.current.updateRectMinMax(An(this.ctx),o),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const o=this.ctx;t.isolated||JL("TODO: Support non-isolated groups."),t.knockout&&Ir("Knockout groups not supported.");const i=An(o);if(t.matrix&&o.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let a=$o.getAxialAlignedBoundingBox(t.bbox,An(o));const l=[0,0,o.canvas.width,o.canvas.height];a=$o.intersect(a,l)||[0,0,0,0];const d=Math.floor(a[0]),c=Math.floor(a[1]),p=Math.max(Math.ceil(a[2])-d,1),u=Math.max(Math.ceil(a[3])-c,1);this.current.startNewPathAndClipBox([0,0,p,u]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);const m=this.cachedCanvases.getCanvas(h,p,u),f=m.context;f.translate(-d,-c),f.transform(...i),t.smask?this.smaskStack.push({canvas:m.canvas,context:f,offsetX:d,offsetY:c,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(o.setTransform(1,0,0,1,0,0),o.translate(d,c),o.save()),B9(o,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(o),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const o=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const a=An(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...a);const l=$o.getAxialAlignedBoundingBox([0,0,o.canvas.width,o.canvas.height],a);this.ctx.drawImage(o.canvas,0,0),this.ctx.restore(),this.compose(l)}}beginAnnotation(t,o,i,a,l){if(this.#e(),fC(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),o){const d=o[2]-o[0],c=o[3]-o[1];if(l&&this.annotationCanvasMap){i=i.slice(),i[4]-=o[0],i[5]-=o[1],o=o.slice(),o[0]=o[1]=0,o[2]=d,o[3]=c;const[p,u]=$o.singularValueDecompose2dScale(An(this.ctx)),{viewportScale:h}=this,m=Math.ceil(d*this.outputScaleX*h),f=Math.ceil(c*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(m,f);const{canvas:x,context:y}=this.annotationCanvas;this.annotationCanvasMap.set(t,x),this.annotationCanvas.savedCtx=this.ctx,this.ctx=y,this.ctx.save(),this.ctx.setTransform(p,0,0,-u,0,c*u),fC(this.ctx)}else fC(this.ctx),this.ctx.rect(o[0],o[1],d,c),this.ctx.clip(),this.endPath()}this.current=new gpe(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...a)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const o=t.count;t=this.getObject(t.data,t),t.count=o;const i=this.ctx,a=this.processingType3;if(a&&(a.compiled===void 0&&(a.compiled=WLt(t)),a.compiled)){a.compiled(i);return}const l=this._createMaskCanvas(t),d=l.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(d,l.offsetX,l.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,o,i=0,a=0,l,d){if(!this.contentVisible)return;t=this.getObject(t.data,t);const c=this.ctx;c.save();const p=An(c);c.transform(o,i,a,l,0,0);const u=this._createMaskCanvas(t);c.setTransform(1,0,0,1,u.offsetX-p[4],u.offsetY-p[5]);for(let h=0,m=d.length;h<m;h+=2){const f=$o.transform(p,[o,i,a,l,d[h],d[h+1]]),[x,y]=$o.applyTransform([0,0],f);c.drawImage(u.canvas,x,y)}c.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const o=this.ctx,i=this.current.fillColor,a=this.current.patternFill;for(const l of t){const{data:d,width:c,height:p,transform:u}=l,h=this.cachedCanvases.getCanvas("maskCanvas",c,p),m=h.context;m.save();const f=this.getObject(d,l);xpe(m,f),m.globalCompositeOperation="source-in",m.fillStyle=a?i.getPattern(m,this,z2(o),yl.FILL):i,m.fillRect(0,0,c,p),m.restore(),o.save(),o.transform(...u),o.scale(1,-1),gC(o,h.canvas,0,0,c,p,0,-1,1,1),o.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const o=this.getObject(t);if(!o){Ir("Dependent image isn't ready yet");return}this.paintInlineImageXObject(o)}paintImageXObjectRepeat(t,o,i,a){if(!this.contentVisible)return;const l=this.getObject(t);if(!l){Ir("Dependent image isn't ready yet");return}const d=l.width,c=l.height,p=[];for(let u=0,h=a.length;u<h;u+=2)p.push({transform:[o,0,0,i,a[u],a[u+1]],x:0,y:0,w:d,h:c});this.paintInlineImageXObjectGroup(l,p)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:o,width:i,height:a}=t,l=this.cachedCanvases.getCanvas("inlineImage",i,a),d=l.context;return d.filter=this.current.transferMaps,d.drawImage(o,0,0),d.filter="none",l.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const o=t.width,i=t.height,a=this.ctx;if(this.save(),!Ks){const{filter:c}=a;c!=="none"&&c!==""&&(a.filter="none")}a.scale(1/o,-1/i);let l;if(t.bitmap)l=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)l=t;else{const p=this.cachedCanvases.getCanvas("inlineImage",o,i).context;fpe(p,t),l=this.applyTransferMapsToCanvas(p)}const d=this._scaleImage(l,z2(a));a.imageSmoothingEnabled=ype(An(a),t.interpolate),gC(a,d.img,0,0,d.paintWidth,d.paintHeight,0,-i,o,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,o){if(!this.contentVisible)return;const i=this.ctx;let a;if(t.bitmap)a=t.bitmap;else{const l=t.width,d=t.height,p=this.cachedCanvases.getCanvas("inlineImage",l,d).context;fpe(p,t),a=this.applyTransferMapsToCanvas(p)}for(const l of o)i.save(),i.transform(...l.transform),i.scale(1,-1),gC(i,a,l.x,l.y,l.w,l.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,o){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,o){t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(o)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const o=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(o||(this.pendingClip===wpe?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=An(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const o=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),a=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,a)/o}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:o,b:i,c:a,d:l}=this.ctx.getTransform();let d,c;if(i===0&&a===0){const p=Math.abs(o),u=Math.abs(l);if(p===u)if(t===0)d=c=1/p;else{const h=p*t;d=c=h<1?1/h:1}else if(t===0)d=1/p,c=1/u;else{const h=p*t,m=u*t;d=h<1?1/h:1,c=m<1?1/m:1}}else{const p=Math.abs(o*l-i*a),u=Math.hypot(o,i),h=Math.hypot(a,l);if(t===0)d=h/p,c=u/p;else{const m=t*p;d=h>m?h/m:1,c=u>m?u/m:1}}this._cachedScaleForStroking[0]=d,this._cachedScaleForStroking[1]=c}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:o}=this,{lineWidth:i}=this.current,[a,l]=this.getScaleForStroking();if(o.lineWidth=i||1,a===1&&l===1){o.stroke();return}const d=o.getLineDash();if(t&&o.save(),o.scale(a,l),d.length>0){const c=Math.max(a,l);o.setLineDash(d.map(p=>p/c)),o.lineDashOffset/=c}o.stroke(),t&&o.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const e in E1)D7.prototype[e]!==void 0&&(D7.prototype[E1[e]]=D7.prototype[e]);class lw{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 xC={DATA:1,ERROR:2},na={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Id(e){switch(e instanceof Error||typeof e=="object"&&e!==null||Pi('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new J4(e.message);case"MissingPDFException":return new Z4(e.message);case"PasswordException":return new eQ(e.message,e.code);case"UnexpectedResponseException":return new XL(e.message,e.status);case"UnknownErrorException":return new tQ(e.message,e.details);default:return new tQ(e.message,e.toString())}}class zx{constructor(t,o,i){this.sourceName=t,this.targetName=o,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=a=>{const l=a.data;if(l.targetName!==this.sourceName)return;if(l.stream){this.#t(l);return}if(l.callback){const c=l.callbackId,p=this.callbackCapabilities[c];if(!p)throw new Error(`Cannot resolve callback ${c}`);if(delete this.callbackCapabilities[c],l.callback===xC.DATA)p.resolve(l.data);else if(l.callback===xC.ERROR)p.reject(Id(l.reason));else throw new Error("Unexpected callback case");return}const d=this.actionHandler[l.action];if(!d)throw new Error(`Unknown action from worker: ${l.action}`);if(l.callbackId){const c=this.sourceName,p=l.sourceName;new Promise(function(u){u(d(l.data))}).then(function(u){i.postMessage({sourceName:c,targetName:p,callback:xC.DATA,callbackId:l.callbackId,data:u})},function(u){i.postMessage({sourceName:c,targetName:p,callback:xC.ERROR,callbackId:l.callbackId,reason:Id(u)})});return}if(l.streamId){this.#e(l);return}d(l.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,o){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=o}send(t,o,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:o},i)}sendWithPromise(t,o,i){const a=this.callbackId++,l=Promise.withResolvers();this.callbackCapabilities[a]=l;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:a,data:o},i)}catch(d){l.reject(d)}return l.promise}sendWithStream(t,o,i,a){const l=this.streamId++,d=this.sourceName,c=this.targetName,p=this.comObj;return new ReadableStream({start:u=>{const h=Promise.withResolvers();return this.streamControllers[l]={controller:u,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},p.postMessage({sourceName:d,targetName:c,action:t,streamId:l,data:o,desiredSize:u.desiredSize},a),h.promise},pull:u=>{const h=Promise.withResolvers();return this.streamControllers[l].pullCall=h,p.postMessage({sourceName:d,targetName:c,stream:na.PULL,streamId:l,desiredSize:u.desiredSize}),h.promise},cancel:u=>{Ea(u instanceof Error,"cancel must have a valid reason");const h=Promise.withResolvers();return this.streamControllers[l].cancelCall=h,this.streamControllers[l].isClosed=!0,p.postMessage({sourceName:d,targetName:c,stream:na.CANCEL,streamId:l,reason:Id(u)}),h.promise}},i)}#e(t){const o=t.streamId,i=this.sourceName,a=t.sourceName,l=this.comObj,d=this,c=this.actionHandler[t.action],p={enqueue(u,h=1,m){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=h,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),l.postMessage({sourceName:i,targetName:a,stream:na.ENQUEUE,streamId:o,chunk:u},m)},close(){this.isCancelled||(this.isCancelled=!0,l.postMessage({sourceName:i,targetName:a,stream:na.CLOSE,streamId:o}),delete d.streamSinks[o])},error(u){Ea(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,l.postMessage({sourceName:i,targetName:a,stream:na.ERROR,streamId:o,reason:Id(u)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};p.sinkCapability.resolve(),p.ready=p.sinkCapability.promise,this.streamSinks[o]=p,new Promise(function(u){u(c(t.data,p))}).then(function(){l.postMessage({sourceName:i,targetName:a,stream:na.START_COMPLETE,streamId:o,success:!0})},function(u){l.postMessage({sourceName:i,targetName:a,stream:na.START_COMPLETE,streamId:o,reason:Id(u)})})}#t(t){const o=t.streamId,i=this.sourceName,a=t.sourceName,l=this.comObj,d=this.streamControllers[o],c=this.streamSinks[o];switch(t.stream){case na.START_COMPLETE:t.success?d.startCall.resolve():d.startCall.reject(Id(t.reason));break;case na.PULL_COMPLETE:t.success?d.pullCall.resolve():d.pullCall.reject(Id(t.reason));break;case na.PULL:if(!c){l.postMessage({sourceName:i,targetName:a,stream:na.PULL_COMPLETE,streamId:o,success:!0});break}c.desiredSize<=0&&t.desiredSize>0&&c.sinkCapability.resolve(),c.desiredSize=t.desiredSize,new Promise(function(p){p(c.onPull?.())}).then(function(){l.postMessage({sourceName:i,targetName:a,stream:na.PULL_COMPLETE,streamId:o,success:!0})},function(p){l.postMessage({sourceName:i,targetName:a,stream:na.PULL_COMPLETE,streamId:o,reason:Id(p)})});break;case na.ENQUEUE:if(Ea(d,"enqueue should have stream controller"),d.isClosed)break;d.controller.enqueue(t.chunk);break;case na.CLOSE:if(Ea(d,"close should have stream controller"),d.isClosed)break;d.isClosed=!0,d.controller.close(),this.#o(d,o);break;case na.ERROR:Ea(d,"error should have stream controller"),d.controller.error(Id(t.reason)),this.#o(d,o);break;case na.CANCEL_COMPLETE:t.success?d.cancelCall.resolve():d.cancelCall.reject(Id(t.reason)),this.#o(d,o);break;case na.CANCEL:if(!c)break;new Promise(function(p){p(c.onCancel?.(Id(t.reason)))}).then(function(){l.postMessage({sourceName:i,targetName:a,stream:na.CANCEL_COMPLETE,streamId:o,success:!0})},function(p){l.postMessage({sourceName:i,targetName:a,stream:na.CANCEL_COMPLETE,streamId:o,reason:Id(p)})}),c.sinkCapability.reject(Id(t.reason)),c.isCancelled=!0,delete this.streamSinks[o];break;default:throw new Error("Unexpected stream case")}}async#o(t,o){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[o]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}class qLt{#e;#t;constructor({parsedData:t,rawData:o}){this.#e=t,this.#t=o}getRaw(){return this.#t}get(t){return this.#e.get(t)??null}getAll(){return BY(this.#e)}has(t){return this.#e.has(t)}}const Sh=Symbol("INTERNAL");class ZLt{#e=!1;#t=!1;#o=!1;#i=!0;constructor(t,{name:o,intent:i,usage:a}){this.#e=!!(t&vc.DISPLAY),this.#t=!!(t&vc.PRINT),this.name=o,this.intent=i,this.usage=a}get visible(){if(this.#o)return this.#i;if(!this.#i)return!1;const{print:t,view:o}=this.usage;return this.#e?o?.viewState!=="OFF":this.#t?t?.printState!=="OFF":!0}_setVisible(t,o,i=!1){t!==Sh&&Pi("Internal method `_setVisible` called."),this.#o=i,this.#i=o}}class JLt{#e=null;#t=new Map;#o=null;#i=null;constructor(t,o=vc.DISPLAY){if(this.renderingIntent=o,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,this.#i=t.order;for(const i of t.groups)this.#t.set(i.id,new ZLt(o,i));if(t.baseState==="OFF")for(const i of this.#t.values())i._setVisible(Sh,!1);for(const i of t.on)this.#t.get(i)._setVisible(Sh,!0);for(const i of t.off)this.#t.get(i)._setVisible(Sh,!1);this.#o=this.getHash()}}#s(t){const o=t.length;if(o<2)return!0;const i=t[0];for(let a=1;a<o;a++){const l=t[a];let d;if(Array.isArray(l))d=this.#s(l);else if(this.#t.has(l))d=this.#t.get(l).visible;else return Ir(`Optional content group not found: ${l}`),!0;switch(i){case"And":if(!d)return!1;break;case"Or":if(d)return!0;break;case"Not":return!d;default:return!0}}return i==="And"}isVisible(t){if(this.#t.size===0)return!0;if(!t)return JL("Optional content group not defined."),!0;if(t.type==="OCG")return this.#t.has(t.id)?this.#t.get(t.id).visible:(Ir(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return this.#s(t.expression);if(!t.policy||t.policy==="AnyOn"){for(const o of t.ids){if(!this.#t.has(o))return Ir(`Optional content group not found: ${o}`),!0;if(this.#t.get(o).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const o of t.ids){if(!this.#t.has(o))return Ir(`Optional content group not found: ${o}`),!0;if(!this.#t.get(o).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const o of t.ids){if(!this.#t.has(o))return Ir(`Optional content group not found: ${o}`),!0;if(!this.#t.get(o).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const o of t.ids){if(!this.#t.has(o))return Ir(`Optional content group not found: ${o}`),!0;if(this.#t.get(o).visible)return!1}return!0}return Ir(`Unknown optional content policy ${t.policy}.`),!0}return Ir(`Unknown group type ${t.type}.`),!0}setVisibility(t,o=!0){const i=this.#t.get(t);if(!i){Ir(`Optional content group not found: ${t}`);return}i._setVisible(Sh,!!o,!0),this.#e=null}setOCGState({state:t,preserveRB:o}){let i;for(const a of t){switch(a){case"ON":case"OFF":case"Toggle":i=a;continue}const l=this.#t.get(a);if(l)switch(i){case"ON":l._setVisible(Sh,!0);break;case"OFF":l._setVisible(Sh,!1);break;case"Toggle":l._setVisible(Sh,!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?BY(this.#t):null}getGroup(t){return this.#t.get(t)||null}getHash(){if(this.#e!==null)return this.#e;const t=new zEe;for(const[o,i]of this.#t)t.update(`${o}:${i.visible}`);return this.#e=t.hexdigest()}}class XLt{constructor(t,{disableRange:o=!1,disableStream:i=!1}){Ea(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:a,initialData:l,progressiveDone:d,contentDispositionFilename:c}=t;if(this._queuedChunks=[],this._progressiveDone=d,this._contentDispositionFilename=c,l?.length>0){const p=l instanceof Uint8Array&&l.byteLength===l.buffer.byteLength?l.buffer:new Uint8Array(l).buffer;this._queuedChunks.push(p)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!o,this._contentLength=a,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((p,u)=>{this._onReceiveData({begin:p,chunk:u})}),t.addProgressListener((p,u)=>{this._onProgress({loaded:p,total:u})}),t.addProgressiveReadListener(p=>{this._onReceiveData({chunk:p})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:o}){const i=o instanceof Uint8Array&&o.byteLength===o.buffer.byteLength?o.buffer:new Uint8Array(o).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{const a=this._rangeReaders.some(function(l){return l._begin!==t?!1:(l._enqueue(i),!0)});Ea(a,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){t.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const o=this._rangeReaders.indexOf(t);o>=0&&this._rangeReaders.splice(o,1)}getFullReader(){Ea(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new eIt(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,o){if(o<=this._progressiveDataLength)return null;const i=new tIt(this,t,o);return this._pdfDataRangeTransport.requestDataRange(t,o),this._rangeReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeReaders.slice(0))o.cancel(t);this._pdfDataRangeTransport.abort()}}class eIt{constructor(t,o,i=!1,a=null){this._stream=t,this._done=i||!1,this._filename=RY(a)?a:null,this._queuedChunks=o||[],this._loaded=0;for(const l of this._queuedChunks)this._loaded+=l.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class tIt{constructor(t,o,i){this._stream=t,this._begin=o,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const o=this._queuedChunk;return this._queuedChunk=null,{value:o,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function oIt(e){let t=!0,o=i("filename\\*","i").exec(e);if(o){o=o[1];let h=c(o);return h=unescape(h),h=p(h),h=u(h),l(h)}if(o=d(e),o){const h=u(o);return l(h)}if(o=i("filename","i").exec(e),o){o=o[1];let h=c(o);return h=u(h),l(h)}function i(h,m){return new RegExp("(?:^|;)\\s*"+h+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',m)}function a(h,m){if(h){if(!/^[\x00-\xFF]+$/.test(m))return m;try{const f=new TextDecoder(h,{fatal:!0}),x=eI(m);m=f.decode(x),t=!1}catch{}}return m}function l(h){return t&&/[\x80-\xff]/.test(h)&&(h=a("utf-8",h),t&&(h=a("iso-8859-1",h))),h}function d(h){const m=[];let f;const x=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=x.exec(h))!==null;){let[,w,b,v]=f;if(w=parseInt(w,10),w in m){if(w===0)break;continue}m[w]=[b,v]}const y=[];for(let w=0;w<m.length&&w in m;++w){let[b,v]=m[w];v=c(v),b&&(v=unescape(v),w===0&&(v=p(v))),y.push(v)}return y.join("")}function c(h){if(h.startsWith('"')){const m=h.slice(1).split('\\"');for(let f=0;f<m.length;++f){const x=m[f].indexOf('"');x!==-1&&(m[f]=m[f].slice(0,x),m.length=f+1),m[f]=m[f].replaceAll(/\\(.)/g,"$1")}h=m.join('"')}return h}function p(h){const m=h.indexOf("'");if(m===-1)return h;const f=h.slice(0,m),y=h.slice(m+1).replace(/^[^']*'/,"");return a(f,y)}function u(h){return!h.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(h)?h:h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(m,f,x,y){if(x==="q"||x==="Q")return y=y.replaceAll("_"," "),y=y.replaceAll(/=([0-9a-fA-F]{2})/g,function(w,b){return String.fromCharCode(parseInt(b,16))}),a(f,y);try{y=atob(y)}catch{}return a(f,y)})}return""}function QY({getResponseHeader:e,isHttp:t,rangeChunkSize:o,disableRange:i}){const a={allowRangeRequests:!1,suggestedLength:void 0},l=parseInt(e("Content-Length"),10);return!Number.isInteger(l)||(a.suggestedLength=l,l<=2*o)||i||!t||e("Accept-Ranges")!=="bytes"||(e("Content-Encoding")||"identity")!=="identity"||(a.allowRangeRequests=!0),a}function UY(e){const t=e("Content-Disposition");if(t){let o=oIt(t);if(o.includes("%"))try{o=decodeURIComponent(o)}catch{}if(RY(o))return o}return null}function aI(e,t){return e===404||e===0&&t.startsWith("file:")?new Z4('Missing PDF "'+t+'".'):new XL(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)}function OEe(e){return e===200||e===206}function NEe(e,t,o){return{method:"GET",headers:e,signal:o.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function HEe(e){const t=new Headers;for(const o in e){const i=e[o];i!==void 0&&t.append(o,i)}return t}function _Ee(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(Ir(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}class bpe{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 Ea(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new rIt(this),this._fullRequestReader}getRangeReader(t,o){if(o<=this._progressiveDataLength)return null;const i=new iIt(this,t,o);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeRequestReaders.slice(0))o.cancel(t)}}class rIt{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const o=t.source;this._withCredentials=o.withCredentials||!1,this._contentLength=o.length,this._headersCapability=Promise.withResolvers(),this._disableRange=o.disableRange||!1,this._rangeChunkSize=o.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!o.disableStream,this._isRangeSupported=!o.disableRange,this._headers=HEe(this._stream.httpHeaders);const i=o.url;fetch(i,NEe(this._headers,this._withCredentials,this._abortController)).then(a=>{if(!OEe(a.status))throw aI(a.status,i);this._reader=a.body.getReader(),this._headersCapability.resolve();const l=p=>a.headers.get(p),{allowRangeRequests:d,suggestedLength:c}=QY({getResponseHeader:l,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=d,this._contentLength=c||this._contentLength,this._filename=UY(l),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new J4("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:o}=await this._reader.read();return o?{value:t,done:o}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:_Ee(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class iIt{constructor(t,o,i){this._stream=t,this._reader=null,this._loaded=0;const a=t.source;this._withCredentials=a.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!a.disableStream,this._abortController=new AbortController,this._headers=HEe(this._stream.httpHeaders),this._headers.append("Range",`bytes=${o}-${i-1}`);const l=a.url;fetch(l,NEe(this._headers,this._withCredentials,this._abortController)).then(d=>{if(!OEe(d.status))throw aI(d.status,l);this._readCapability.resolve(),this._reader=d.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:o}=await this._reader.read();return o?{value:t,done:o}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:_Ee(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}const xO=200,yO=206;function nIt(e){const t=e.response;return typeof t!="string"?t:eI(t).buffer}class aIt{constructor(t,o={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&o.httpHeaders||Object.create(null),this.withCredentials=o.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,o,i){const a={begin:t,end:o};for(const l in i)a[l]=i[l];return this.request(a)}requestFull(t){return this.request(t)}request(t){const o=new XMLHttpRequest,i=this.currXhrId++,a=this.pendingRequests[i]={xhr:o};o.open("GET",this.url),o.withCredentials=this.withCredentials;for(const l in this.httpHeaders){const d=this.httpHeaders[l];d!==void 0&&o.setRequestHeader(l,d)}return this.isHttp&&"begin"in t&&"end"in t?(o.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),a.expectedStatus=yO):a.expectedStatus=xO,o.responseType="arraybuffer",t.onError&&(o.onerror=function(l){t.onError(o.status)}),o.onreadystatechange=this.onStateChange.bind(this,i),o.onprogress=this.onProgress.bind(this,i),a.onHeadersReceived=t.onHeadersReceived,a.onDone=t.onDone,a.onError=t.onError,a.onProgress=t.onProgress,o.send(null),i}onProgress(t,o){const i=this.pendingRequests[t];i&&i.onProgress?.(o)}onStateChange(t,o){const i=this.pendingRequests[t];if(!i)return;const a=i.xhr;if(a.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),a.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],a.status===0&&this.isHttp){i.onError?.(a.status);return}const l=a.status||xO;if(!(l===xO&&i.expectedStatus===yO)&&l!==i.expectedStatus){i.onError?.(a.status);return}const c=nIt(a);if(l===yO){const p=a.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(p);i.onDone({begin:parseInt(u[1],10),chunk:c})}else c?i.onDone({begin:0,chunk:c}):i.onError?.(a.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const o=this.pendingRequests[t].xhr;delete this.pendingRequests[t],o.abort()}}class sIt{constructor(t){this._source=t,this._manager=new aIt(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const o=this._rangeRequestReaders.indexOf(t);o>=0&&this._rangeRequestReaders.splice(o,1)}getFullReader(){return Ea(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new lIt(this._manager,this._source),this._fullRequestReader}getRangeReader(t,o){const i=new dIt(this._manager,t,o);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeRequestReaders.slice(0))o.cancel(t)}}class lIt{constructor(t,o){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=o.url,this._fullRequestId=t.requestFull(i),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=o.disableRange||!1,this._contentLength=o.length,this._rangeChunkSize=o.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,o=this._manager.getRequestXhr(t),i=d=>o.getResponseHeader(d),{allowRangeRequests:a,suggestedLength:l}=QY({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=l||this._contentLength,this._filename=UY(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=aI(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const o of this._requests)o.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class dIt{constructor(t,o,i){this._manager=t;const a={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(o,i,a),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const o=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:o,done:!1}):this._queuedChunk=o,this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=aI(t,this._url);for(const o of this._requests)o.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const o=this._queuedChunk;return this._queuedChunk=null,{value:o,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const VEe=/^file:\/\/\/[a-zA-Z]:\//;function cIt(e){const t=t2.get("url"),o=t.parse(e);return o.protocol==="file:"||o.host?o:/^[a-z]:[/\\]/i.test(e)?t.parse(`file:///${e}`):(o.host||(o.protocol="file:"),o)}class pIt{constructor(t){this.source=t,this.url=cIt(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 Ea(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new mIt(this):new uIt(this),this._fullRequestReader}getRangeReader(t,o){if(o<=this._progressiveDataLength)return null;const i=this.isFsUrl?new gIt(this,t,o):new hIt(this,t,o);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const o of this._rangeRequestReaders.slice(0))o.cancel(t)}}class QEe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const o=t.source;this._contentLength=o.length,this._loaded=0,this._filename=null,this._disableRange=o.disableRange||!1,this._rangeChunkSize=o.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!o.disableStream,this._isRangeSupported=!o.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",o=>{this._error(o)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new J4("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class UEe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const o=t.source;this._isStreamingSupported=!o.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",o=>{this._error(o)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function lS(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class uIt extends QEe{constructor(t){super(t);const o=i=>{if(i.statusCode===404){const c=new Z4(`Missing PDF "${this._url}".`);this._storedError=c,this._headersCapability.reject(c);return}this._headersCapability.resolve(),this._setReadableStream(i);const a=c=>this._readableStream.headers[c.toLowerCase()],{allowRangeRequests:l,suggestedLength:d}=QY({getResponseHeader:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=l,this._contentLength=d||this._contentLength,this._filename=UY(a)};if(this._request=null,this._url.protocol==="http:"){const i=t2.get("http");this._request=i.request(lS(this._url,t.httpHeaders),o)}else{const i=t2.get("https");this._request=i.request(lS(this._url,t.httpHeaders),o)}this._request.on("error",i=>{this._storedError=i,this._headersCapability.reject(i)}),this._request.end()}}class hIt extends UEe{constructor(t,o,i){super(t),this._httpHeaders={};for(const l in t.httpHeaders){const d=t.httpHeaders[l];d!==void 0&&(this._httpHeaders[l]=d)}this._httpHeaders.Range=`bytes=${o}-${i-1}`;const a=l=>{if(l.statusCode===404){const d=new Z4(`Missing PDF "${this._url}".`);this._storedError=d;return}this._setReadableStream(l)};if(this._request=null,this._url.protocol==="http:"){const l=t2.get("http");this._request=l.request(lS(this._url,this._httpHeaders),a)}else{const l=t2.get("https");this._request=l.request(lS(this._url,this._httpHeaders),a)}this._request.on("error",l=>{this._storedError=l}),this._request.end()}}class mIt extends QEe{constructor(t){super(t);let o=decodeURIComponent(this._url.path);VEe.test(this._url.href)&&(o=o.replace(/^\//,""));const i=t2.get("fs");i.promises.lstat(o).then(a=>{this._contentLength=a.size,this._setReadableStream(i.createReadStream(o)),this._headersCapability.resolve()},a=>{a.code==="ENOENT"&&(a=new Z4(`Missing PDF "${o}".`)),this._storedError=a,this._headersCapability.reject(a)})}}class gIt extends UEe{constructor(t,o,i){super(t);let a=decodeURIComponent(this._url.path);VEe.test(this._url.href)&&(a=a.replace(/^\//,""));const l=t2.get("fs");this._setReadableStream(l.createReadStream(a,{start:o,end:i-1}))}}const fIt=1e5,Nl=30,xIt=.8;let dS=class du{#e=Promise.withResolvers();#t=null;#o=!1;#i=!!globalThis.FontInspector?.enabled;#s=null;#r=null;#n=0;#l=0;#c=null;#p=null;#h=0;#d=0;#a=Object.create(null);#m=[];#f=null;#u=[];#y=new WeakMap;#g=null;static#w=new Map;static#v=new Map;static#A=null;static#k=new Set;constructor({textContentSource:t,container:o,viewport:i}){if(t instanceof ReadableStream)this.#f=t;else if(typeof t=="object")this.#f=new ReadableStream({start(p){p.enqueue(t),p.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#p=o,this.#d=i.scale*(globalThis.devicePixelRatio||1),this.#h=i.rotation,this.#r={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null};const{pageWidth:a,pageHeight:l,pageX:d,pageY:c}=i.rawDims;this.#g=[1,0,0,-1,-d,c+l],this.#l=a,this.#n=l,du.#x(),j4(o,i),this.#e.promise.catch(()=>{}).then(()=>{du.#k.delete(this),this.#r=null,this.#a=null})}render(){const t=()=>{this.#c.read().then(({value:o,done:i})=>{if(i){this.#e.resolve();return}this.#s??=o.lang,Object.assign(this.#a,o.styles),this.#S(o.items),t()},this.#e.reject)};return this.#c=this.#f.getReader(),du.#k.add(this),t(),this.#e.promise}update({viewport:t,onBefore:o=null}){const i=t.scale*(globalThis.devicePixelRatio||1),a=t.rotation;if(a!==this.#h&&(o?.(),this.#h=a,j4(this.#p,{rotation:a})),i!==this.#d){o?.(),this.#d=i;const l={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:du.#b(this.#s)};for(const d of this.#u)l.properties=this.#y.get(d),l.div=d,this.#$(l)}}cancel(){const t=new J4("TextLayer task cancelled.");this.#c?.cancel(t).catch(()=>{}),this.#c=null,this.#e.reject(t)}get textDivs(){return this.#u}get textContentItemsStr(){return this.#m}#S(t){if(this.#o)return;this.#r.ctx??=du.#b(this.#s);const o=this.#u,i=this.#m;for(const a of t){if(o.length>fIt){Ir("Ignoring additional textDivs for performance reasons."),this.#o=!0;return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const l=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),a.id!==null&&this.#t.setAttribute("id",`${a.id}`),l.append(this.#t)}else a.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}i.push(a.str),this.#j(a)}}#j(t){const o=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};this.#u.push(o);const a=$o.transform(this.#g,t.transform);let l=Math.atan2(a[1],a[0]);const d=this.#a[t.fontName];d.vertical&&(l+=Math.PI/2);const c=this.#i&&d.fontSubstitution||d.fontFamily,p=Math.hypot(a[2],a[3]),u=p*du.#C(c,this.#s);let h,m;l===0?(h=a[4],m=a[5]-u):(h=a[4]+u*Math.sin(l),m=a[5]-u*Math.cos(l));const f="calc(var(--scale-factor)*",x=o.style;this.#t===this.#p?(x.left=`${(100*h/this.#l).toFixed(2)}%`,x.top=`${(100*m/this.#n).toFixed(2)}%`):(x.left=`${f}${h.toFixed(2)}px)`,x.top=`${f}${m.toFixed(2)}px)`),x.fontSize=`${f}${(du.#A*p).toFixed(2)}px)`,x.fontFamily=c,i.fontSize=p,o.setAttribute("role","presentation"),o.textContent=t.str,o.dir=t.dir,this.#i&&(o.dataset.fontName=d.fontSubstitutionLoadedName||t.fontName),l!==0&&(i.angle=l*(180/Math.PI));let y=!1;if(t.str.length>1)y=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const w=Math.abs(t.transform[0]),b=Math.abs(t.transform[3]);w!==b&&Math.max(w,b)/Math.min(w,b)>1.5&&(y=!0)}if(y&&(i.canvasWidth=d.vertical?t.height:t.width),this.#y.set(o,i),this.#r.div=o,this.#r.properties=i,this.#$(this.#r),i.hasText&&this.#t.append(o),i.hasEOL){const w=document.createElement("br");w.setAttribute("role","presentation"),this.#t.append(w)}}#$(t){const{div:o,properties:i,ctx:a,prevFontSize:l,prevFontFamily:d}=t,{style:c}=o;let p="";if(du.#A>1&&(p=`scale(${1/du.#A})`),i.canvasWidth!==0&&i.hasText){const{fontFamily:u}=c,{canvasWidth:h,fontSize:m}=i;(l!==m||d!==u)&&(a.font=`${m*this.#d}px ${u}`,t.prevFontSize=m,t.prevFontFamily=u);const{width:f}=a.measureText(o.textContent);f>0&&(p=`scaleX(${h*this.#d/f}) ${p}`)}i.angle!==0&&(p=`rotate(${i.angle}deg) ${p}`),p.length>0&&(c.transform=p)}static cleanup(){if(!(this.#k.size>0)){this.#w.clear();for(const{canvas:t}of this.#v.values())t.remove();this.#v.clear()}}static#b(t=null){let o=this.#v.get(t||="");if(!o){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),o=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#v.set(t,o)}return o}static#x(){if(this.#A!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),this.#A=t.getBoundingClientRect().height,t.remove()}static#C(t,o){const i=this.#w.get(t);if(i)return i;const a=this.#b(o),l=a.font;a.canvas.width=a.canvas.height=Nl,a.font=`${Nl}px ${t}`;const d=a.measureText("");let c=d.fontBoundingBoxAscent,p=Math.abs(d.fontBoundingBoxDescent);if(c){const m=c/(c+p);return this.#w.set(t,m),a.canvas.width=a.canvas.height=0,a.font=l,m}a.strokeStyle="red",a.clearRect(0,0,Nl,Nl),a.strokeText("g",0,0);let u=a.getImageData(0,0,Nl,Nl).data;p=0;for(let m=u.length-1-3;m>=0;m-=4)if(u[m]>0){p=Math.ceil(m/4/Nl);break}a.clearRect(0,0,Nl,Nl),a.strokeText("A",0,Nl),u=a.getImageData(0,0,Nl,Nl).data,c=0;for(let m=0,f=u.length;m<f;m+=4)if(u[m]>0){c=Nl-Math.floor(m/4/Nl);break}a.canvas.width=a.canvas.height=0,a.font=l;const h=c?c/(c+p):xIt;return this.#w.set(t,h),h}};function yIt(){PEe("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:e,container:t,viewport:o,...i}=arguments[0],a=Object.keys(i);a.length>0&&Ir("Ignoring `renderTextLayer` parameters: "+a.join(", "));const l=new dS({textContentSource:e,container:t,viewport:o}),{textDivs:d,textContentItemsStr:c}=l;return{promise:l.render(),textDivs:d,textContentItemsStr:c}}function wIt(){PEe("`updateTextLayer`, please use `TextLayer` instead.")}class dw{static textContent(t){const o=[],i={items:o,styles:Object.create(null)};function a(l){if(!l)return;let d=null;const c=l.name;if(c==="#text")d=l.value;else if(dw.shouldBuildText(c))l?.attributes?.textContent?d=l.attributes.textContent:l.value&&(d=l.value);else return;if(d!==null&&o.push({str:d}),!!l.children)for(const p of l.children)a(p)}return a(t),i}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const bIt=65536,vIt=100,CIt=5e3,AIt=Ks?PLt:vLt,$It=Ks?TLt:BEe,kIt=Ks?DLt:bLt,SIt=Ks?zLt:DEe;function EIt(e={}){typeof e=="string"||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t=new WY,{docId:o}=t,i=e.url?LIt(e.url):null,a=e.data?IIt(e.data):null,l=e.httpHeaders||null,d=e.withCredentials===!0,c=e.password??null,p=e.range instanceof WEe?e.range:null,u=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:bIt;let h=e.worker instanceof kc?e.worker:null;const m=e.verbosity,f=typeof e.docBaseUrl=="string"&&!zY(e.docBaseUrl)?e.docBaseUrl:null,x=typeof e.cMapUrl=="string"?e.cMapUrl:null,y=e.cMapPacked!==!1,w=e.CMapReaderFactory||$It,b=typeof e.standardFontDataUrl=="string"?e.standardFontDataUrl:null,v=e.StandardFontDataFactory||SIt,A=e.stopAtErrors!==!0,S=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,E=e.isEvalSupported!==!1,j=typeof e.isOffscreenCanvasSupported=="boolean"?e.isOffscreenCanvasSupported:!Ks,L=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,M=typeof e.disableFontFace=="boolean"?e.disableFontFace:Ks,D=e.fontExtraProperties===!0,P=e.enableXfa===!0,T=e.ownerDocument||globalThis.document,z=e.disableRange===!0,R=e.disableStream===!0,K=e.disableAutoFetch===!0,Z=e.pdfBug===!0,O=e.enableHWA===!0,Q=p?p.length:e.length??NaN,_=typeof e.useSystemFonts=="boolean"?e.useSystemFonts:!Ks&&!M,F=typeof e.useWorkerFetch=="boolean"?e.useWorkerFetch:w===BEe&&v===DEe&&x&&b&&Tx(x,document.baseURI)&&Tx(b,document.baseURI),N=e.canvasFactory||new AIt({ownerDocument:T,enableHWA:O}),H=e.filterFactory||new kIt({docId:o,ownerDocument:T}),ee=null;dLt(m);const Y={canvasFactory:N,filterFactory:H};if(F||(Y.cMapReaderFactory=new w({baseUrl:x,isCompressed:y}),Y.standardFontDataFactory=new v({baseUrl:b})),!h){const X={verbosity:m,port:lw.workerPort};h=X.port?kc.fromPort(X):new kc(X),t._worker=h}const G={docId:o,apiVersion:"4.4.168",data:a,password:c,disableAutoFetch:K,rangeChunkSize:u,length:Q,docBaseUrl:f,enableXfa:P,evaluatorOptions:{maxImageSize:S,disableFontFace:M,ignoreErrors:A,isEvalSupported:E,isOffscreenCanvasSupported:j,canvasMaxAreaInBytes:L,fontExtraProperties:D,useSystemFonts:_,cMapUrl:F?x:null,standardFontDataUrl:F?b:null}},J={disableFontFace:M,fontExtraProperties:D,ownerDocument:T,pdfBug:Z,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 X=h.messageHandler.sendWithPromise("GetDocRequest",G,a?[a.buffer]:null);let ie;if(p)ie=new XLt(p,{disableRange:z,disableStream:R});else if(!a){if(!i)throw new Error("getDocument - no `url` parameter provided.");ie=(me=>Ks?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&Tx(me.url)?new bpe(me):new pIt(me):Tx(me.url)?new bpe(me):new sIt(me))({url:i,length:Q,httpHeaders:l,withCredentials:d,rangeChunkSize:u,disableRange:z,disableStream:R})}return X.then(we=>{if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const me=new zx(o,we,h.port),de=new DIt(me,t,ie,J,Y);t._transport=de,me.send("Ready",null)})}).catch(t._capability.reject),t}function LIt(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(Ks&&typeof e=="string")return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function IIt(e){if(Ks&&typeof J$<"u"&&e instanceof J$)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 eI(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 vpe(e){return typeof e=="object"&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0}class WY{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${WY.#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 WEe=class{constructor(t,o,i=!1,a=null){this.length=t,this.initialData=o,this.progressiveDone=i,this.contentDispositionFilename=a,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,o){for(const i of this._rangeListeners)i(t,o)}onDataProgress(t,o){this._readyCapability.promise.then(()=>{for(const i of this._progressListeners)i(t,o)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const o of this._progressiveReadListeners)o(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,o){Pi("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class jIt{constructor(t,o){this._pdfInfo=t,this._transport=o}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return ni(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:o}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(o)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class MIt{#e=null;#t=!1;constructor(t,o,i,a=!1){this._pageIndex=t,this._pageInfo=o,this._transport=i,this._stats=a?new spe:null,this._pdfBug=a,this.commonObjs=i.commonObjs,this.objs=new GEe,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:o=this.rotate,offsetX:i=0,offsetY:a=0,dontFlip:l=!1}={}){return new mb({viewBox:this.view,scale:t,rotation:o,offsetX:i,offsetY:a,dontFlip:l})}getAnnotations({intent:t="display"}={}){const{renderingIntent:o}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,o)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return ni(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:o,intent:i="display",annotationMode:a=Oh.ENABLE,transform:l=null,background:d=null,optionalContentConfigPromise:c=null,annotationCanvasMap:p=null,pageColors:u=null,printAnnotationStorage:h=null}){this._stats?.time("Overall");const m=this._transport.getRenderingIntent(i,a,h),{renderingIntent:f,cacheKey:x}=m;this.#t=!1,this.#i(),c||=this._transport.getOptionalContentConfig(f);let y=this._intentStates.get(x);y||(y=Object.create(null),this._intentStates.set(x,y)),y.streamReaderCancelTimeout&&(clearTimeout(y.streamReaderCancelTimeout),y.streamReaderCancelTimeout=null);const w=!!(f&vc.PRINT);y.displayReadyCapability||(y.displayReadyCapability=Promise.withResolvers(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(m));const b=S=>{y.renderTasks.delete(v),(this._maybeCleanupAfterRender||w)&&(this.#t=!0),this.#o(!w),S?(v.capability.reject(S),this._abortOperatorList({intentState:y,reason:S instanceof Error?S:new Error(S)})):v.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},v=new f7({callback:b,params:{canvasContext:t,viewport:o,transform:l,background:d},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:p,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!w,pdfBug:this._pdfBug,pageColors:u});(y.renderTasks||=new Set).add(v);const A=v.task;return Promise.all([y.displayReadyCapability.promise,c]).then(([S,E])=>{if(this.destroyed){b();return}if(this._stats?.time("Rendering"),!(E.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");v.initializeGraphics({transparency:S,optionalContentConfig:E}),v.operatorListChanged()}).catch(b),A}getOperatorList({intent:t="display",annotationMode:o=Oh.ENABLE,printAnnotationStorage:i=null}={}){function a(){d.operatorList.lastChunk&&(d.opListReadCapability.resolve(d.operatorList),d.renderTasks.delete(c))}const l=this._transport.getRenderingIntent(t,o,i,!0);let d=this._intentStates.get(l.cacheKey);d||(d=Object.create(null),this._intentStates.set(l.cacheKey,d));let c;return d.opListReadCapability||(c=Object.create(null),c.operatorListChanged=a,d.opListReadCapability=Promise.withResolvers(),(d.renderTasks||=new Set).add(c),d.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(l)),d.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:o=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:o===!0},{highWaterMark:100,size(a){return a.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>dw.textContent(i));const o=this.streamTextContent(t);return new Promise(function(i,a){function l(){d.read().then(function({value:p,done:u}){if(u){i(c);return}c.lang??=p.lang,Object.assign(c.styles,p.styles),c.items.push(...p.items),l()},a)}const d=o.getReader(),c={items:[],styles:Object.create(null),lang:null};l()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const o of this._intentStates.values())if(this._abortOperatorList({intentState:o,reason:new Error("Page was destroyed."),force:!0}),!o.opListReadCapability)for(const i of o.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),this.#t=!1,this.#i(),Promise.all(t)}cleanup(t=!1){this.#t=!0;const o=this.#o(!1);return t&&o&&(this._stats&&=new spe),o}#o(t=!1){if(this.#i(),!this.#t||this.destroyed)return!1;if(t)return this.#e=setTimeout(()=>{this.#e=null,this.#o(!1)},CIt),!1;for(const{renderTasks:o,operatorList:i}of this._intentStates.values())if(o.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}#i(){this.#e&&(clearTimeout(this.#e),this.#e=null)}_startRenderPage(t,o){const i=this._intentStates.get(o);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,o){for(let i=0,a=t.length;i<a;i++)o.operatorList.fnArray.push(t.fnArray[i]),o.operatorList.argsArray.push(t.argsArray[i]);o.operatorList.lastChunk=t.lastChunk,o.operatorList.separateAnnots=t.separateAnnots;for(const i of o.renderTasks)i.operatorListChanged();t.lastChunk&&this.#o(!0)}_pumpOperatorList({renderingIntent:t,cacheKey:o,annotationStorageSerializable:i}){const{map:a,transfer:l}=i,c=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:o,annotationStorage:a},l).getReader(),p=this._intentStates.get(o);p.streamReader=c;const u=()=>{c.read().then(({value:h,done:m})=>{if(m){p.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,p),u())},h=>{if(p.streamReader=null,!this._transport.destroyed){if(p.operatorList){p.operatorList.lastChunk=!0;for(const m of p.renderTasks)m.operatorListChanged();this.#o(!0)}if(p.displayReadyCapability)p.displayReadyCapability.reject(h);else if(p.opListReadCapability)p.opListReadCapability.reject(h);else throw h}})};u()}_abortOperatorList({intentState:t,reason:o,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(o instanceof TY){let a=vIt;o.extraDelay>0&&o.extraDelay<1e3&&(a+=o.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:o,force:!0})},a);return}}if(t.streamReader.cancel(new J4(o.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[a,l]of this._intentStates)if(l===t){this._intentStates.delete(a);break}this.cleanup()}}}get stats(){return this._stats}}class BIt{#e=new Set;#t=Promise.resolve();postMessage(t,o){const i={data:structuredClone(t,o?{transfer:o}:null)};this.#t.then(()=>{for(const a of this.#e)a.call(this,i)})}addEventListener(t,o){this.#e.add(o)}removeEventListener(t,o){this.#e.delete(o)}terminate(){this.#e.clear()}}const q2={isWorkerDisabled:!1,fakeWorkerId:0};Ks&&(q2.isWorkerDisabled=!0,lw.workerSrc||="./pdf.worker.mjs"),q2.isSameOrigin=function(e,t){let o;try{if(o=new URL(e),!o.origin||o.origin==="null")return!1}catch{return!1}const i=new URL(t,o);return o.origin===i.origin},q2.createCDNWrapper=function(e){const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};class kc{static#e;constructor({name:t=null,port:o=null,verbosity:i=cLt()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,o){if(kc.#e?.has(o))throw new Error("Cannot use more than one PDFWorker per port.");(kc.#e||=new WeakMap).set(o,this),this._initializeFromPort(o);return}this._initialize()}get promise(){return Ks?Promise.all([t2.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 zx("main","worker",t),this._messageHandler.on("ready",function(){}),this.#t()}_initialize(){if(q2.isWorkerDisabled||kc.#o){this._setupFakeWorker();return}let{workerSrc:t}=kc;try{q2.isSameOrigin(window.location.href,t)||(t=q2.createCDNWrapper(new URL(t,window.location).href));const o=new Worker(t,{type:"module"}),i=new zx("main","worker",o),a=()=>{l.abort(),i.destroy(),o.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},l=new AbortController;o.addEventListener("error",()=>{this._webWorker||a()},{signal:l.signal}),i.on("test",c=>{if(l.abort(),this.destroyed||!c){a();return}this._messageHandler=i,this._port=o,this._webWorker=o,this.#t()}),i.on("ready",c=>{if(l.abort(),this.destroyed){a();return}try{d()}catch{this._setupFakeWorker()}});const d=()=>{const c=new Uint8Array;i.send("test",c,[c.buffer])};d();return}catch{JL("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){q2.isWorkerDisabled||(Ir("Setting up fake worker."),q2.isWorkerDisabled=!0),kc._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const o=new BIt;this._port=o;const i=`fake${q2.fakeWorkerId++}`,a=new zx(i+"_worker",i,o);t.setup(a,o),this._messageHandler=new zx(i,i+"_worker",o),this.#t()}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),kc.#e?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const o=this.#e?.get(t.port);if(o){if(o._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return o}return new kc(t)}static get workerSrc(){if(lw.workerSrc)return lw.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#o(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return ni(this,"_setupFakeWorkerGlobal",(async()=>this.#o?this.#o:(await import(this.workerSrc)).WorkerMessageHandler)())}}class DIt{#e=new Map;#t=new Map;#o=new Map;#i=new Map;#s=null;constructor(t,o,i,a,l){this.messageHandler=t,this.loadingTask=o,this.commonObjs=new GEe,this.fontLoader=new MLt({ownerDocument:a.ownerDocument,styleElement:a.styleElement}),this.loadingParams=a.loadingParams,this._params=a,this.canvasFactory=l.canvasFactory,this.filterFactory=l.filterFactory,this.cMapReaderFactory=l.cMapReaderFactory,this.standardFontDataFactory=l.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#r(t,o=null){const i=this.#e.get(t);if(i)return i;const a=this.messageHandler.sendWithPromise(t,o);return this.#e.set(t,a),a}get annotationStorage(){return ni(this,"annotationStorage",new _Y)}getRenderingIntent(t,o=Oh.ENABLE,i=null,a=!1){let l=vc.DISPLAY,d=oQ;switch(t){case"any":l=vc.ANY;break;case"display":break;case"print":l=vc.PRINT;break;default:Ir(`getRenderingIntent - invalid intent: ${t}`)}switch(o){case Oh.DISABLE:l+=vc.ANNOTATIONS_DISABLE;break;case Oh.ENABLE:break;case Oh.ENABLE_FORMS:l+=vc.ANNOTATIONS_FORMS;break;case Oh.ENABLE_STORAGE:l+=vc.ANNOTATIONS_STORAGE,d=(l&vc.PRINT&&i instanceof REe?i:this.annotationStorage).serializable;break;default:Ir(`getRenderingIntent - invalid annotationMode: ${o}`)}return a&&(l+=vc.OPLIST),{renderingIntent:l,cacheKey:`${l}_${d.hash}`,annotationStorageSerializable:d}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#s?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const i of this.#t.values())t.push(i._destroy());this.#t.clear(),this.#o.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const o=this.messageHandler.sendWithPromise("Terminate",null);return t.push(o),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),dS.cleanup(),this._networkStream?.cancelAllRequests(new J4("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:o}=this;t.on("GetReader",(i,a)=>{Ea(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=l=>{this._lastProgress={loaded:l.loaded,total:l.total}},a.onPull=()=>{this._fullReader.read().then(function({value:l,done:d}){if(d){a.close();return}Ea(l instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(l),1,[l])}).catch(l=>{a.error(l)})},a.onCancel=l=>{this._fullReader.cancel(l),a.ready.catch(d=>{if(!this.destroyed)throw d})}}),t.on("ReaderHeadersReady",i=>{const a=Promise.withResolvers(),l=this._fullReader;return l.headersReady.then(()=>{(!l.isStreamingSupported||!l.isRangeSupported)&&(this._lastProgress&&o.onProgress?.(this._lastProgress),l.onProgress=d=>{o.onProgress?.({loaded:d.loaded,total:d.total})}),a.resolve({isStreamingSupported:l.isStreamingSupported,isRangeSupported:l.isRangeSupported,contentLength:l.contentLength})},a.reject),a.promise}),t.on("GetRangeReader",(i,a)=>{Ea(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const l=this._networkStream.getRangeReader(i.begin,i.end);if(!l){a.close();return}a.onPull=()=>{l.read().then(function({value:d,done:c}){if(c){a.close();return}Ea(d instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(d),1,[d])}).catch(d=>{a.error(d)})},a.onCancel=d=>{l.cancel(d),a.ready.catch(c=>{if(!this.destroyed)throw c})}}),t.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,o._capability.resolve(new jIt(i,this))}),t.on("DocException",function(i){let a;switch(i.name){case"PasswordException":a=new eQ(i.message,i.code);break;case"InvalidPDFException":a=new IEe(i.message);break;case"MissingPDFException":a=new Z4(i.message);break;case"UnexpectedResponseException":a=new XL(i.message,i.status);break;case"UnknownErrorException":a=new tQ(i.message,i.details);break;default:Pi("DocException - expected a valid Error.")}o._capability.reject(a)}),t.on("PasswordRequest",i=>{if(this.#s=Promise.withResolvers(),o.onPassword){const a=l=>{l instanceof Error?this.#s.reject(l):this.#s.resolve({password:l})};try{o.onPassword(a,i.code)}catch(l){this.#s.reject(l)}}else this.#s.reject(new eQ(i.message,i.code));return this.#s.promise}),t.on("DataLoaded",i=>{o.onProgress?.({loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),t.on("StartRenderPage",i=>{if(this.destroyed)return;this.#t.get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),t.on("commonobj",([i,a,l])=>{if(this.destroyed||this.commonObjs.has(i))return null;switch(a){case"Font":const{disableFontFace:d,fontExtraProperties:c,pdfBug:p}=this._params;if("error"in l){const f=l.error;Ir(`Error during font loading: ${f}`),this.commonObjs.resolve(i,f);break}const u=p&&globalThis.FontInspector?.enabled?(f,x)=>globalThis.FontInspector.fontAdded(f,x):null,h=new BLt(l,{disableFontFace:d,inspectFont:u});this.fontLoader.bind(h).catch(()=>t.sendWithPromise("FontFallback",{id:i})).finally(()=>{!c&&h.data&&(h.data=null),this.commonObjs.resolve(i,h)});break;case"CopyLocalImage":const{imageRef:m}=l;Ea(m,"The imageRef must be defined.");for(const f of this.#t.values())for(const[,x]of f.objs)if(x?.ref===m)return x.dataLen?(this.commonObjs.resolve(i,structuredClone(x)),x.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,l);break;default:throw new Error(`Got unknown common object type ${a}`)}return null}),t.on("obj",([i,a,l,d])=>{if(this.destroyed)return;const c=this.#t.get(a);if(!c.objs.has(i)){if(c._intentStates.size===0){d?.bitmap?.close();return}switch(l){case"Image":c.objs.resolve(i,d),d?.dataLen>nLt&&(c._maybeCleanupAfterRender=!0);break;case"Pattern":c.objs.resolve(i,d);break;default:throw new Error(`Got unknown object type ${l}`)}}}),t.on("DocProgress",i=>{this.destroyed||o.onProgress?.({loaded:i.loaded,total:i.total})}),t.on("FetchBuiltInCMap",i=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(i):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),t.on("FetchStandardFontData",i=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(i):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Ir("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:o}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},o).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const o=t-1,i=this.#o.get(o);if(i)return i;const a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:o}).then(l=>{if(this.destroyed)throw new Error("Transport destroyed");l.refStr&&this.#i.set(l.refStr,t);const d=new MIt(o,l,this,this._params.pdfBug);return this.#t.set(o,d),d});return this.#o.set(o,a),a}getPageIndex(t){return vpe(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,o){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:o})}getFieldObjects(){return this.#r("GetFieldObjects")}hasJSActions(){return this.#r("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#r("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#r("GetOptionalContentConfig").then(o=>new JLt(o,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",o=this.#e.get(t);if(o)return o;const i=this.messageHandler.sendWithPromise(t,null).then(a=>({info:a[0],metadata:a[1]?new qLt(a[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const o of this.#t.values())if(!o.cleanup())throw new Error(`startCleanup: Page ${o.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),dS.cleanup()}}cachedPageNumber(t){if(!vpe(t))return null;const o=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return this.#i.get(o)??null}}const yC=Symbol("INITIAL_DATA");class GEe{#e=Object.create(null);#t(t){return this.#e[t]||={...Promise.withResolvers(),data:yC}}get(t,o=null){if(o){const a=this.#t(t);return a.promise.then(()=>o(a.data)),null}const i=this.#e[t];if(!i||i.data===yC)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const o=this.#e[t];return!!o&&o.data!==yC}resolve(t,o=null){const i=this.#t(t);i.data=o,i.resolve()}clear(){for(const t in this.#e){const{data:o}=this.#e[t];o?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const t in this.#e){const{data:o}=this.#e[t];o!==yC&&(yield[t,o])}}}class PIt{#e=null;constructor(t){this.#e=t,this.onContinue=null}get promise(){return this.#e.capability.promise}cancel(t=0){this.#e.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#e.operatorList;if(!t)return!1;const{annotationCanvasMap:o}=this.#e;return t.form||t.canvas&&o?.size>0}}class f7{#e=null;static#t=new WeakSet;constructor({callback:t,params:o,objs:i,commonObjs:a,annotationCanvasMap:l,operatorList:d,pageIndex:c,canvasFactory:p,filterFactory:u,useRequestAnimationFrame:h=!1,pdfBug:m=!1,pageColors:f=null}){this.callback=t,this.params=o,this.objs=i,this.commonObjs=a,this.annotationCanvasMap=l,this.operatorListIdx=null,this.operatorList=d,this._pageIndex=c,this.canvasFactory=p,this.filterFactory=u,this._pdfBug=m,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=h===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new PIt(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=o.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:o}){if(this.cancelled)return;if(this._canvas){if(f7.#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.");f7.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:a,transform:l,background:d}=this.params;this.gfx=new D7(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:o},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:l,viewport:a,transparency:t,background:d}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,o=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),f7.#t.delete(this._canvas),this.callback(t||new TY(`Rendering cancelled, page ${this._pageIndex+1}`,o))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),f7.#t.delete(this._canvas),this.callback())))}}const TIt="4.4.168",zIt="19fbc8998";function Cpe(e){return Math.floor(Math.max(0,Math.min(1,e))*255).toString(16).padStart(2,"0")}function D9(e){return Math.max(0,Math.min(255,255*e))}class Ape{static CMYK_G([t,o,i,a]){return["G",1-Math.min(1,.3*t+.59*i+.11*o+a)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=D9(t),[t,t,t]}static G_HTML([t]){const o=Cpe(t);return`#${o}${o}${o}`}static RGB_G([t,o,i]){return["G",.3*t+.59*o+.11*i]}static RGB_rgb(t){return t.map(D9)}static RGB_HTML(t){return`#${t.map(Cpe).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,o,i,a]){return["RGB",1-Math.min(1,t+a),1-Math.min(1,i+a),1-Math.min(1,o+a)]}static CMYK_rgb([t,o,i,a]){return[D9(1-Math.min(1,t+a)),D9(1-Math.min(1,i+a)),D9(1-Math.min(1,o+a))]}static CMYK_HTML(t){const o=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(o)}static RGB_CMYK([t,o,i]){const a=1-t,l=1-o,d=1-i,c=Math.min(a,l,d);return["CMYK",a,l,d,c]}}class YEe{static setupStorage(t,o,i,a,l){const d=a.getValue(o,{value:null});switch(i.name){case"textarea":if(d.value!==null&&(t.textContent=d.value),l==="print")break;t.addEventListener("input",c=>{a.setValue(o,{value:c.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(d.value===i.attributes.xfaOn?t.setAttribute("checked",!0):d.value===i.attributes.xfaOff&&t.removeAttribute("checked"),l==="print")break;t.addEventListener("change",c=>{a.setValue(o,{value:c.target.checked?c.target.getAttribute("xfaOn"):c.target.getAttribute("xfaOff")})})}else{if(d.value!==null&&t.setAttribute("value",d.value),l==="print")break;t.addEventListener("input",c=>{a.setValue(o,{value:c.target.value})})}break;case"select":if(d.value!==null){t.setAttribute("value",d.value);for(const c of i.children)c.attributes.value===d.value?c.attributes.selected=!0:c.attributes.hasOwnProperty("selected")&&delete c.attributes.selected}t.addEventListener("input",c=>{const p=c.target.options,u=p.selectedIndex===-1?"":p[p.selectedIndex].value;a.setValue(o,{value:u})});break}}static setAttributes({html:t,element:o,storage:i=null,intent:a,linkService:l}){const{attributes:d}=o,c=t instanceof HTMLAnchorElement;d.type==="radio"&&(d.name=`${d.name}-${a}`);for(const[p,u]of Object.entries(d))if(u!=null)switch(p){case"class":u.length&&t.setAttribute(p,u.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",u);break;case"style":Object.assign(t.style,u);break;case"textContent":t.textContent=u;break;default:(!c||p!=="href"&&p!=="newWindow")&&t.setAttribute(p,u)}c&&l.addLinkAttributes(t,d.href,d.newWindow),i&&d.dataId&&this.setupStorage(t,d.dataId,o,i)}static render(t){const o=t.annotationStorage,i=t.linkService,a=t.xfaHtml,l=t.intent||"display",d=document.createElement(a.name);a.attributes&&this.setAttributes({html:d,element:a,intent:l,linkService:i});const c=l!=="richText",p=t.div;if(p.append(d),t.viewport){const m=`matrix(${t.viewport.transform.join(",")})`;p.style.transform=m}c&&p.setAttribute("class","xfaLayer xfaFont");const u=[];if(a.children.length===0){if(a.value){const m=document.createTextNode(a.value);d.append(m),c&&dw.shouldBuildText(a.name)&&u.push(m)}return{textDivs:u}}const h=[[a,-1,d]];for(;h.length>0;){const[m,f,x]=h.at(-1);if(f+1===m.children.length){h.pop();continue}const y=m.children[++h.at(-1)[1]];if(y===null)continue;const{name:w}=y;if(w==="#text"){const v=document.createTextNode(y.value);u.push(v),x.append(v);continue}const b=y?.attributes?.xmlns?document.createElementNS(y.attributes.xmlns,w):document.createElement(w);if(x.append(b),y.attributes&&this.setAttributes({html:b,element:y,storage:o,intent:l,linkService:i}),y.children?.length>0)h.push([y,-1,b]);else if(y.value){const v=document.createTextNode(y.value);c&&dw.shouldBuildText(w)&&u.push(v),b.append(v)}}for(const m of p.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:u}}static update(t){const o=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=o,t.div.hidden=!1}}const xb=1e3,RIt=9,M4=new WeakSet;function v0(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class FIt{static create(t){switch(t.data.annotationType){case Aa.LINK:return new KEe(t);case Aa.TEXT:return new OIt(t);case Aa.WIDGET:switch(t.data.fieldType){case"Tx":return new NIt(t);case"Btn":return t.data.radioButton?new qEe(t):t.data.checkBox?new _It(t):new VIt(t);case"Ch":return new QIt(t);case"Sig":return new HIt(t)}return new X4(t);case Aa.POPUP:return new aQ(t);case Aa.FREETEXT:return new ZEe(t);case Aa.LINE:return new WIt(t);case Aa.SQUARE:return new GIt(t);case Aa.CIRCLE:return new YIt(t);case Aa.POLYLINE:return new JEe(t);case Aa.CARET:return new qIt(t);case Aa.INK:return new XEe(t);case Aa.POLYGON:return new KIt(t);case Aa.HIGHLIGHT:return new ZIt(t);case Aa.UNDERLINE:return new JIt(t);case Aa.SQUIGGLY:return new XIt(t);case Aa.STRIKEOUT:return new ejt(t);case Aa.STAMP:return new eLe(t);case Aa.FILEATTACHMENT:return new tjt(t);default:return new ea(t)}}}class ea{#e=null;#t=!1;#o=null;constructor(t,{isRenderable:o=!1,ignoreBorder:i=!1,createQuadrilaterals:a=!1}={}){this.isRenderable=o,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,o&&(this.container=this._createContainer(i)),a&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:o,richText:i}){return!!(t?.str||o?.str||i?.str)}get hasPopupData(){return ea._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};const{rect:o}=t;o&&this.#i(o),this.#o?.popup.updateEdited(t)}resetEdited(){this.#e&&(this.#i(this.#e.rect),this.#o?.popup.resetEdited(),this.#e=null)}#i(t){const{container:{style:o},data:{rect:i,rotation:a},parent:{viewport:{rawDims:{pageWidth:l,pageHeight:d,pageX:c,pageY:p}}}}=this;i?.splice(0,4,...t);const{width:u,height:h}=v0(t);o.left=`${100*(t[0]-c)/l}%`,o.top=`${100*(d-t[3]+p)/d}%`,a===0?(o.width=`${100*u/l}%`,o.height=`${100*h/d}%`):this.setRotation(a)}_createContainer(t){const{data:o,parent:{page:i,viewport:a}}=this,l=document.createElement("section");l.setAttribute("data-annotation-id",o.id),this instanceof X4||(l.tabIndex=xb);const{style:d}=l;if(d.zIndex=this.parent.zIndex++,o.popupRef&&l.setAttribute("aria-haspopup","dialog"),o.alternativeText&&(l.title=o.alternativeText),o.noRotate&&l.classList.add("norotate"),!o.rect||this instanceof aQ){const{rotation:w}=o;return!o.hasOwnCanvas&&w!==0&&this.setRotation(w,l),l}const{width:c,height:p}=v0(o.rect);if(!t&&o.borderStyle.width>0){d.borderWidth=`${o.borderStyle.width}px`;const w=o.borderStyle.horizontalCornerRadius,b=o.borderStyle.verticalCornerRadius;if(w>0||b>0){const A=`calc(${w}px * var(--scale-factor)) / calc(${b}px * var(--scale-factor))`;d.borderRadius=A}else if(this instanceof qEe){const A=`calc(${c}px * var(--scale-factor)) / calc(${p}px * var(--scale-factor))`;d.borderRadius=A}switch(o.borderStyle.style){case M9.SOLID:d.borderStyle="solid";break;case M9.DASHED:d.borderStyle="dashed";break;case M9.BEVELED:Ir("Unimplemented border style: beveled");break;case M9.INSET:Ir("Unimplemented border style: inset");break;case M9.UNDERLINE:d.borderBottomStyle="solid";break}const v=o.borderColor||null;v?(this.#t=!0,d.borderColor=$o.makeHexColor(v[0]|0,v[1]|0,v[2]|0)):d.borderWidth=0}const u=$o.normalizeRect([o.rect[0],i.view[3]-o.rect[1]+i.view[1],o.rect[2],i.view[3]-o.rect[3]+i.view[1]]),{pageWidth:h,pageHeight:m,pageX:f,pageY:x}=a.rawDims;d.left=`${100*(u[0]-f)/h}%`,d.top=`${100*(u[1]-x)/m}%`;const{rotation:y}=o;return o.hasOwnCanvas||y===0?(d.width=`${100*c/h}%`,d.height=`${100*p/m}%`):this.setRotation(y,l),l}setRotation(t,o=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:a}=this.parent.viewport.rawDims,{width:l,height:d}=v0(this.data.rect);let c,p;t%180===0?(c=100*l/i,p=100*d/a):(c=100*d/i,p=100*l/a),o.style.width=`${c}%`,o.style.height=`${p}%`,o.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(o,i,a)=>{const l=a.detail[o],d=l[0],c=l.slice(1);a.target.style[i]=Ape[`${d}_HTML`](c),this.annotationStorage.setValue(this.data.id,{[i]:Ape[`${d}_rgb`](c)})};return ni(this,"_commonActions",{display:o=>{const{display:i}=o.detail,a=i%2===1;this.container.style.visibility=a?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:a,noPrint:i===1||i===2})},print:o=>{this.annotationStorage.setValue(this.data.id,{noPrint:!o.detail.print})},hidden:o=>{const{hidden:i}=o.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:o=>{setTimeout(()=>o.target.focus({preventScroll:!1}),0)},userName:o=>{o.target.title=o.detail.userName},readonly:o=>{o.target.disabled=o.detail.readonly},required:o=>{this._setRequired(o.target,o.detail.required)},bgColor:o=>{t("bgColor","backgroundColor",o)},fillColor:o=>{t("fillColor","backgroundColor",o)},fgColor:o=>{t("fgColor","color",o)},textColor:o=>{t("textColor","color",o)},borderColor:o=>{t("borderColor","borderColor",o)},strokeColor:o=>{t("strokeColor","borderColor",o)},rotation:o=>{const i=o.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(t,o){const i=this._commonActions;for(const a of Object.keys(o.detail))(t[a]||i[a])?.(o)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const o=this.annotationStorage.getRawValue(this.data.id);if(!o)return;const i=this._commonActions;for(const[a,l]of Object.entries(o)){const d=i[a];if(d){const c={detail:{[a]:l},target:t};d(c),delete o[a]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[o,i,a,l]=this.data.rect.map(w=>Math.fround(w));if(t.length===8){const[w,b,v,A]=t.subarray(2,6);if(a===w&&l===b&&o===v&&i===A)return}const{style:d}=this.container;let c;if(this.#t){const{borderColor:w,borderWidth:b}=d;d.borderWidth=0,c=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${w}" stroke-width="${b}">`],this.container.classList.add("hasBorder")}const p=a-o,u=l-i,{svgFactory:h}=this,m=h.createElement("svg");m.classList.add("quadrilateralsContainer"),m.setAttribute("width",0),m.setAttribute("height",0);const f=h.createElement("defs");m.append(f);const x=h.createElement("clipPath"),y=`clippath_${this.data.id}`;x.setAttribute("id",y),x.setAttribute("clipPathUnits","objectBoundingBox"),f.append(x);for(let w=2,b=t.length;w<b;w+=8){const v=t[w],A=t[w+1],S=t[w+2],E=t[w+3],j=h.createElement("rect"),L=(S-o)/p,M=(l-A)/u,D=(v-S)/p,P=(A-E)/u;j.setAttribute("x",L),j.setAttribute("y",M),j.setAttribute("width",D),j.setAttribute("height",P),x.append(j),c?.push(`<rect vector-effect="non-scaling-stroke" x="${L}" y="${M}" width="${D}" height="${P}"/>`)}this.#t&&(c.push("</g></svg>')"),d.backgroundImage=c.join("")),this.container.append(m),this.container.style.clipPath=`url(#${y})`}_createPopup(){const{container:t,data:o}=this;t.setAttribute("aria-haspopup","dialog");const i=this.#o=new aQ({data:{color:o.color,titleObj:o.titleObj,modificationDate:o.modificationDate,contentsObj:o.contentsObj,richText:o.richText,parentRect:o.rect,borderStyle:0,id:`popup_${o.id}`,rotation:o.rotation},parent:this.parent,elements:[this]});this.parent.div.append(i.render())}render(){Pi("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,o=null){const i=[];if(this._fieldObjects){const a=this._fieldObjects[t];if(a)for(const{page:l,id:d,exportValues:c}of a){if(l===-1||d===o)continue;const p=typeof c=="string"?c:null,u=document.querySelector(`[data-element-id="${d}"]`);if(u&&!M4.has(u)){Ir(`_getElementsByName - element not allowed: ${d}`);continue}i.push({id:d,exportValue:p,domElement:u})}return i}for(const a of document.getElementsByName(t)){const{exportValue:l}=a,d=a.getAttribute("data-element-id");d!==o&&M4.has(a)&&i.push({id:d,exportValue:l,domElement:a})}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const o of t)o.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:o}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:o})})}}class KEe extends ea{constructor(t,o=null){super(t,{isRenderable:!0,ignoreBorder:!!o?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:o}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let a=!1;return t.url?(o.addLinkAttributes(i,t.url,t.newWindow),a=!0):t.action?(this._bindNamedAction(i,t.action),a=!0):t.attachment?(this.#t(i,t.attachment,t.attachmentDest),a=!0):t.setOCGState?(this.#o(i,t.setOCGState),a=!0):t.dest?(this._bindLink(i,t.dest),a=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),a=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),a=!0):this.isTooltipOnly&&!a&&(this._bindLink(i,""),a=!0)),this.container.classList.add("linkAnnotation"),a&&this.container.append(i),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(t,o){t.href=this.linkService.getDestinationHash(o),t.onclick=()=>(o&&this.linkService.goToDestination(o),!1),(o||o==="")&&this.#e()}_bindNamedAction(t,o){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(o),!1),this.#e()}#t(t,o,i=null){t.href=this.linkService.getAnchorUrl(""),o.description&&(t.title=o.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(o.content,o.filename,i),!1),this.#e()}#o(t,o){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(o),!1),this.#e()}_bindJSAction(t,o){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const a of Object.keys(o.actions)){const l=i.get(a);l&&(t[l]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o.id,name:a}}),!1))}t.onclick||(t.onclick=()=>!1),this.#e()}_bindResetFormAction(t,o){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){Ir('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(t.onclick=()=>!1);return}t.onclick=()=>{i?.();const{fields:a,refs:l,include:d}=o,c=[];if(a.length!==0||l.length!==0){const h=new Set(l);for(const m of a){const f=this._fieldObjects[m]||[];for(const{id:x}of f)h.add(x)}for(const m of Object.values(this._fieldObjects))for(const f of m)h.has(f.id)===d&&c.push(f)}else for(const h of Object.values(this._fieldObjects))c.push(...h);const p=this.annotationStorage,u=[];for(const h of c){const{id:m}=h;switch(u.push(m),h.type){case"text":{const x=h.defaultValue||"";p.setValue(m,{value:x});break}case"checkbox":case"radiobutton":{const x=h.defaultValue===h.exportValues;p.setValue(m,{value:x});break}case"combobox":case"listbox":{const x=h.defaultValue||"";p.setValue(m,{value:x});break}default:continue}const f=document.querySelector(`[data-element-id="${m}"]`);if(f){if(!M4.has(f)){Ir(`_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 OIt extends ea{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 X4 extends ea{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return od.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,o,i,a,l){i.includes("mouse")?t.addEventListener(i,d=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(d),shift:d.shiftKey,modifier:this._getKeyModifier(d)}})}):t.addEventListener(i,d=>{if(i==="blur"){if(!o.focused||!d.relatedTarget)return;o.focused=!1}else if(i==="focus"){if(o.focused)return;o.focused=!0}l&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:l(d)}})})}_setEventListeners(t,o,i,a){for(const[l,d]of i)(d==="Action"||this.data.actions?.[d])&&((d==="Focus"||d==="Blur")&&(o||={focused:!1}),this._setEventListener(t,o,l,d,a),d==="Focus"&&!this.data.actions?.Blur?this._setEventListener(t,o,"blur","Blur",null):d==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(t,o,"focus","Focus",null))}_setBackgroundColor(t){const o=this.data.backgroundColor||null;t.style.backgroundColor=o===null?"transparent":$o.makeHexColor(o[0],o[1],o[2])}_setTextStyle(t){const o=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||RIt,l=t.style;let d;const c=2,p=u=>Math.round(10*u)/10;if(this.data.multiLine){const u=Math.abs(this.data.rect[3]-this.data.rect[1]-c),h=Math.round(u/(hO*a))||1,m=u/h;d=Math.min(a,p(m/hO))}else{const u=Math.abs(this.data.rect[3]-this.data.rect[1]-c);d=Math.min(a,p(u/hO))}l.fontSize=`calc(${d}px * var(--scale-factor))`,l.color=$o.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(l.textAlign=o[this.data.textAlignment])}_setRequired(t,o){o?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",o)}}class NIt extends X4{constructor(t){const o=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:o})}setPropertyOnSiblings(t,o,i,a){const l=this.annotationStorage;for(const d of this._getElementsByName(t.name,t.id))d.domElement&&(d.domElement[o]=i),l.setValue(d.id,{[a]:i})}render(){const t=this.annotationStorage,o=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const a=t.getValue(o,{value:this.data.fieldValue});let l=a.value||"";const d=t.getValue(o,{charLimit:this.data.maxLen}).charLimit;d&&l.length>d&&(l=l.slice(0,d));let c=a.formattedValue||this.data.textContent?.join(`
247
247
  `)||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const p={userValue:l,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=c??l,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",c??l),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),M4.add(i),i.setAttribute("data-element-id",o),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=xb,this._setRequired(i,this.data.required),d&&(i.maxLength=d),i.addEventListener("input",h=>{t.setValue(o,{value:h.target.value}),this.setPropertyOnSiblings(i,"value",h.target.value,"value"),p.formattedValue=null}),i.addEventListener("resetform",h=>{const m=this.data.defaultFieldValue??"";i.value=p.userValue=m,p.formattedValue=null});let u=h=>{const{formattedValue:m}=p;m!=null&&(h.target.value=m),h.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",m=>{if(p.focused)return;const{target:f}=m;p.userValue&&(f.value=p.userValue),p.lastCommittedValue=f.value,p.commitKey=1,this.data.actions?.Focus||(p.focused=!0)}),i.addEventListener("updatefromsandbox",m=>{this.showElementAndHideCanvas(m.target);const f={value(x){p.userValue=x.detail.value??"",t.setValue(o,{value:p.userValue.toString()}),x.target.value=p.userValue},formattedValue(x){const{formattedValue:y}=x.detail;p.formattedValue=y,y!=null&&x.target!==document.activeElement&&(x.target.value=y),t.setValue(o,{formattedValue:y})},selRange(x){x.target.setSelectionRange(...x.detail.selRange)},charLimit:x=>{const{charLimit:y}=x.detail,{target:w}=x;if(y===0){w.removeAttribute("maxLength");return}w.setAttribute("maxLength",y);let b=p.userValue;!b||b.length<=y||(b=b.slice(0,y),w.value=p.userValue=b,t.setValue(o,{value:b}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:b,willCommit:!0,commitKey:1,selStart:w.selectionStart,selEnd:w.selectionEnd}}))}};this._dispatchEventFromSandbox(f,m)}),i.addEventListener("keydown",m=>{p.commitKey=1;let f=-1;if(m.key==="Escape"?f=0:m.key==="Enter"&&!this.data.multiLine?f=2:m.key==="Tab"&&(p.commitKey=3),f===-1)return;const{value:x}=m.target;p.lastCommittedValue!==x&&(p.lastCommittedValue=x,p.userValue=x,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:x,willCommit:!0,commitKey:f,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}))});const h=u;u=null,i.addEventListener("blur",m=>{if(!p.focused||!m.relatedTarget)return;this.data.actions?.Blur||(p.focused=!1);const{value:f}=m.target;p.userValue=f,p.lastCommittedValue!==f&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:f,willCommit:!0,commitKey:p.commitKey,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}),h(m)}),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",m=>{p.lastCommittedValue=null;const{data:f,target:x}=m,{value:y,selectionStart:w,selectionEnd:b}=x;let v=w,A=b;switch(m.inputType){case"deleteWordBackward":{const S=y.substring(0,w).match(/\w*[^\w]*$/);S&&(v-=S[0].length);break}case"deleteWordForward":{const S=y.substring(w).match(/^[^\w]*\w*/);S&&(A+=S[0].length);break}case"deleteContentBackward":w===b&&(v-=1);break;case"deleteContentForward":w===b&&(A+=1);break}m.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:y,change:f||"",willCommit:!1,selStart:v,selEnd:A}})}),this._setEventListeners(i,p,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],m=>m.target.value)}if(u&&i.addEventListener("blur",u),this.data.comb){const m=(this.data.rect[2]-this.data.rect[0])/d;i.classList.add("comb"),i.style.letterSpacing=`calc(${m}px * var(--scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class HIt extends X4{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class _It extends X4{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,o=this.data,i=o.id;let a=t.getValue(i,{value:o.exportValue===o.fieldValue}).value;typeof a=="string"&&(a=a!=="Off",t.setValue(i,{value:a})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const l=document.createElement("input");return M4.add(l),l.setAttribute("data-element-id",i),l.disabled=o.readOnly,this._setRequired(l,this.data.required),l.type="checkbox",l.name=o.fieldName,a&&l.setAttribute("checked",!0),l.setAttribute("exportValue",o.exportValue),l.tabIndex=xb,l.addEventListener("change",d=>{const{name:c,checked:p}=d.target;for(const u of this._getElementsByName(c,i)){const h=p&&u.exportValue===o.exportValue;u.domElement&&(u.domElement.checked=h),t.setValue(u.id,{value:h})}t.setValue(i,{value:p})}),l.addEventListener("resetform",d=>{const c=o.defaultFieldValue||"Off";d.target.checked=c===o.exportValue}),this.enableScripting&&this.hasJSActions&&(l.addEventListener("updatefromsandbox",d=>{const c={value(p){p.target.checked=p.detail.value!=="Off",t.setValue(i,{value:p.target.checked})}};this._dispatchEventFromSandbox(c,d)}),this._setEventListeners(l,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],d=>d.target.checked)),this._setBackgroundColor(l),this._setDefaultPropertiesFromJS(l),this.container.append(l),this.container}}class qEe extends X4{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,o=this.data,i=o.id;let a=t.getValue(i,{value:o.fieldValue===o.buttonValue}).value;if(typeof a=="string"&&(a=a!==o.buttonValue,t.setValue(i,{value:a})),a)for(const d of this._getElementsByName(o.fieldName,i))t.setValue(d.id,{value:!1});const l=document.createElement("input");if(M4.add(l),l.setAttribute("data-element-id",i),l.disabled=o.readOnly,this._setRequired(l,this.data.required),l.type="radio",l.name=o.fieldName,a&&l.setAttribute("checked",!0),l.tabIndex=xb,l.addEventListener("change",d=>{const{name:c,checked:p}=d.target;for(const u of this._getElementsByName(c,i))t.setValue(u.id,{value:!1});t.setValue(i,{value:p})}),l.addEventListener("resetform",d=>{const c=o.defaultFieldValue;d.target.checked=c!=null&&c===o.buttonValue}),this.enableScripting&&this.hasJSActions){const d=o.buttonValue;l.addEventListener("updatefromsandbox",c=>{const p={value:u=>{const h=d===u.detail.value;for(const m of this._getElementsByName(u.target.name)){const f=h&&m.id===i;m.domElement&&(m.domElement.checked=f),t.setValue(m.id,{value:f})}}};this._dispatchEventFromSandbox(p,c)}),this._setEventListeners(l,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],c=>c.target.checked)}return this._setBackgroundColor(l),this._setDefaultPropertiesFromJS(l),this.container.append(l),this.container}}class VIt extends KEe{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const o=t.lastChild;return this.enableScripting&&this.hasJSActions&&o&&(this._setDefaultPropertiesFromJS(o),o.addEventListener("updatefromsandbox",i=>{this._dispatchEventFromSandbox({},i)})),t}}class QIt extends X4{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,o=this.data.id,i=t.getValue(o,{value:this.data.fieldValue}),a=document.createElement("select");M4.add(a),a.setAttribute("data-element-id",o),a.disabled=this.data.readOnly,this._setRequired(a,this.data.required),a.name=this.data.fieldName,a.tabIndex=xb;let l=this.data.combo&&this.data.options.length>0;this.data.combo||(a.size=this.data.options.length,this.data.multiSelect&&(a.multiple=!0)),a.addEventListener("resetform",h=>{const m=this.data.defaultFieldValue;for(const f of a.options)f.selected=f.value===m});for(const h of this.data.options){const m=document.createElement("option");m.textContent=h.displayValue,m.value=h.exportValue,i.value.includes(h.exportValue)&&(m.setAttribute("selected",!0),l=!1),a.append(m)}let d=null;if(l){const h=document.createElement("option");h.value=" ",h.setAttribute("hidden",!0),h.setAttribute("selected",!0),a.prepend(h),d=()=>{h.remove(),a.removeEventListener("input",d),d=null},a.addEventListener("input",d)}const c=h=>{const m=h?"value":"textContent",{options:f,multiple:x}=a;return x?Array.prototype.filter.call(f,y=>y.selected).map(y=>y[m]):f.selectedIndex===-1?null:f[f.selectedIndex][m]};let p=c(!1);const u=h=>{const m=h.target.options;return Array.prototype.map.call(m,f=>({displayValue:f.textContent,exportValue:f.value}))};return this.enableScripting&&this.hasJSActions?(a.addEventListener("updatefromsandbox",h=>{const m={value(f){d?.();const x=f.detail.value,y=new Set(Array.isArray(x)?x:[x]);for(const w of a.options)w.selected=y.has(w.value);t.setValue(o,{value:c(!0)}),p=c(!1)},multipleSelection(f){a.multiple=!0},remove(f){const x=a.options,y=f.detail.remove;x[y].selected=!1,a.remove(y),x.length>0&&Array.prototype.findIndex.call(x,b=>b.selected)===-1&&(x[0].selected=!0),t.setValue(o,{value:c(!0),items:u(f)}),p=c(!1)},clear(f){for(;a.length!==0;)a.remove(0);t.setValue(o,{value:null,items:[]}),p=c(!1)},insert(f){const{index:x,displayValue:y,exportValue:w}=f.detail.insert,b=a.children[x],v=document.createElement("option");v.textContent=y,v.value=w,b?b.before(v):a.append(v),t.setValue(o,{value:c(!0),items:u(f)}),p=c(!1)},items(f){const{items:x}=f.detail;for(;a.length!==0;)a.remove(0);for(const y of x){const{displayValue:w,exportValue:b}=y,v=document.createElement("option");v.textContent=w,v.value=b,a.append(v)}a.options.length>0&&(a.options[0].selected=!0),t.setValue(o,{value:c(!0),items:u(f)}),p=c(!1)},indices(f){const x=new Set(f.detail.indices);for(const y of f.target.options)y.selected=x.has(y.index);t.setValue(o,{value:c(!0)}),p=c(!1)},editable(f){f.target.disabled=!f.detail.editable}};this._dispatchEventFromSandbox(m,h)}),a.addEventListener("input",h=>{const m=c(!0),f=c(!1);t.setValue(o,{value:m}),h.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:p,change:f,changeEx:m,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(a,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],h=>h.target.value)):a.addEventListener("input",function(h){t.setValue(o,{value:c(!0)})}),this.data.combo&&this._setTextStyle(a),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class aQ extends ea{constructor(t){const{data:o,elements:i}=t;super(t,{isRenderable:ea._hasPopupData(o)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new UIt({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),o=[];for(const i of this.elements)i.popup=t,o.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",o.map(i=>`${MEe}${i}`).join(",")),this.container}}class UIt{#e=this.#j.bind(this);#t=this.#C.bind(this);#o=this.#x.bind(this);#i=this.#b.bind(this);#s=null;#r=null;#n=null;#l=null;#c=null;#p=null;#h=null;#d=!1;#a=null;#m=null;#f=null;#u=null;#y=null;#g=null;#w=!1;constructor({container:t,color:o,elements:i,titleObj:a,modificationDate:l,contentsObj:d,richText:c,parent:p,rect:u,parentRect:h,open:m}){this.#r=t,this.#y=a,this.#n=d,this.#u=c,this.#p=p,this.#s=o,this.#f=u,this.#h=h,this.#c=i,this.#l=TEe.toDateObject(l),this.trigger=i.flatMap(f=>f.getElementsToTriggerPopup());for(const f of this.trigger)f.addEventListener("click",this.#i),f.addEventListener("mouseenter",this.#o),f.addEventListener("mouseleave",this.#t),f.classList.add("popupTriggerArea");for(const f of i)f.container?.addEventListener("keydown",this.#e);this.#r.hidden=!0,m&&this.#b()}render(){if(this.#a)return;const t=this.#a=document.createElement("div");if(t.className="popup",this.#s){const l=t.style.outlineColor=$o.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=$o.makeHexColor(...this.#s.map(c=>Math.floor(.7*(255-c)+c)))}const o=document.createElement("span");o.className="header";const i=document.createElement("h1");if(o.append(i),{dir:i.dir,str:i.textContent}=this.#y,t.append(o),this.#l){const l=document.createElement("span");l.classList.add("popupDate"),l.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),l.setAttribute("data-l10n-args",JSON.stringify({date:this.#l.toLocaleDateString(),time:this.#l.toLocaleTimeString()})),o.append(l)}const a=this.#v;if(a)YEe.render({xfaHtml:a,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const l=this._formatContents(this.#n);t.append(l)}this.#r.append(t)}get#v(){const t=this.#u,o=this.#n;return t?.str&&(!o?.str||o.str===t.str)&&this.#u.html||null}get#A(){return this.#v?.attributes?.style?.fontSize||0}get#k(){return this.#v?.attributes?.style?.color||null}#S(t){const o=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:o}]}},a={style:{color:this.#k,fontSize:this.#A?`calc(${this.#A}px * var(--scale-factor))`:""}};for(const l of t.split(`
248
248
  `))o.push({name:"span",value:l,attributes:a});return i}_formatContents({str:t,dir:o}){const i=document.createElement("p");i.classList.add("popupContent"),i.dir=o;const a=t.split(/(?:\r\n?|\n)/);for(let l=0,d=a.length;l<d;++l){const c=a[l];i.append(document.createTextNode(c)),l<d-1&&i.append(document.createElement("br"))}return i}#j(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&this.#d)&&this.#b()}updateEdited({rect:t,popupContent:o}){this.#g||={contentsObj:this.#n,richText:this.#u},t&&(this.#m=null),o&&(this.#u=this.#S(o),this.#n=null),this.#a?.remove(),this.#a=null}resetEdited(){this.#g&&({contentsObj:this.#n,richText:this.#u}=this.#g,this.#g=null,this.#a?.remove(),this.#a=null,this.#m=null)}#$(){if(this.#m!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:o,pageHeight:i,pageX:a,pageY:l}}}=this.#p;let d=!!this.#h,c=d?this.#h:this.#f;for(const y of this.#c)if(!c||$o.intersect(y.data.rect,c)!==null){c=y.data.rect,d=!0;break}const p=$o.normalizeRect([c[0],t[3]-c[1]+t[1],c[2],t[3]-c[3]+t[1]]),h=d?c[2]-c[0]+5:0,m=p[0]+h,f=p[1];this.#m=[100*(m-a)/o,100*(f-l)/i];const{style:x}=this.#r;x.left=`${this.#m[0]}%`,x.top=`${this.#m[1]}%`}#b(){this.#d=!this.#d,this.#d?(this.#x(),this.#r.addEventListener("click",this.#i),this.#r.addEventListener("keydown",this.#e)):(this.#C(),this.#r.removeEventListener("click",this.#i),this.#r.removeEventListener("keydown",this.#e))}#x(){this.#a||this.render(),this.isVisible?this.#d&&this.#r.classList.add("focused"):(this.#$(),this.#r.hidden=!1,this.#r.style.zIndex=parseInt(this.#r.style.zIndex)+1e3)}#C(){this.#r.classList.remove("focused"),!(this.#d||!this.isVisible)&&(this.#r.hidden=!0,this.#r.style.zIndex=parseInt(this.#r.style.zIndex)-1e3)}forceHide(){this.#w=this.isVisible,this.#w&&(this.#r.hidden=!0)}maybeShow(){this.#w&&(this.#a||this.#x(),this.#w=!1,this.#r.hidden=!1)}get isVisible(){return this.#r.hidden===!1}}class ZEe extends ea{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=qr.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const o of this.textContent){const i=document.createElement("span");i.textContent=o,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}class WIt extends ea{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:o,height:i}=v0(t.rect),a=this.svgFactory.create(o,i,!0),l=this.#e=this.svgFactory.createElement("svg:line");return l.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),l.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),l.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),l.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),l.setAttribute("stroke-width",t.borderStyle.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),a.append(l),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class GIt extends ea{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:o,height:i}=v0(t.rect),a=this.svgFactory.create(o,i,!0),l=t.borderStyle.width,d=this.#e=this.svgFactory.createElement("svg:rect");return d.setAttribute("x",l/2),d.setAttribute("y",l/2),d.setAttribute("width",o-l),d.setAttribute("height",i-l),d.setAttribute("stroke-width",l||1),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),a.append(d),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class YIt extends ea{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:o,height:i}=v0(t.rect),a=this.svgFactory.create(o,i,!0),l=t.borderStyle.width,d=this.#e=this.svgFactory.createElement("svg:ellipse");return d.setAttribute("cx",o/2),d.setAttribute("cy",i/2),d.setAttribute("rx",o/2-l/2),d.setAttribute("ry",i/2-l/2),d.setAttribute("stroke-width",l||1),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),a.append(d),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class JEe extends ea{#e=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:o,borderStyle:i,popupRef:a}}=this;if(!o)return this.container;const{width:l,height:d}=v0(t),c=this.svgFactory.create(l,d,!0);let p=[];for(let h=0,m=o.length;h<m;h+=2){const f=o[h]-t[0],x=t[3]-o[h+1];p.push(`${f},${x}`)}p=p.join(" ");const u=this.#e=this.svgFactory.createElement(this.svgElementName);return u.setAttribute("points",p),u.setAttribute("stroke-width",i.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),c.append(u),this.container.append(c),!a&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class KIt extends JEe{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class qIt extends ea{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 XEe extends ea{#e=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=qr.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:o,borderStyle:i,popupRef:a}}=this,{width:l,height:d}=v0(t),c=this.svgFactory.create(l,d,!0);for(const p of o){let u=[];for(let m=0,f=p.length;m<f;m+=2){const x=p[m]-t[0],y=t[3]-p[m+1];u.push(`${x},${y}`)}u=u.join(" ");const h=this.svgFactory.createElement(this.svgElementName);this.#e.push(h),h.setAttribute("points",u),h.setAttribute("stroke-width",i.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),!a&&this.hasPopupData&&this._createPopup(),c.append(h)}return this.container.append(c),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class ZIt extends ea{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 JIt extends ea{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 XIt extends ea{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 ejt extends ea{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 eLe extends ea{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 tjt extends ea{#e=null;constructor(t){super(t,{isRenderable:!0});const{file:o}=this.data;this.filename=o.filename,this.content=o.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...o})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:o}=this;let i;o.hasAppearance||o.fillAlpha===0?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(o.name)?"paperclip":"pushpin"}.svg`,o.fillAlpha&&o.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(o.fillAlpha*100)}%);`)),i.addEventListener("dblclick",this.#t.bind(this)),this.#e=i;const{isMac:a}=od.platform;return t.addEventListener("keydown",l=>{l.key==="Enter"&&(a?l.metaKey:l.ctrlKey)&&this.#t()}),!o.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}let ojt=class{#e=null;#t=null;#o=new Map;constructor({div:t,accessibilityManager:o,annotationCanvasMap:i,annotationEditorUIManager:a,page:l,viewport:d}){this.div=t,this.#e=o,this.#t=i,this.page=l,this.viewport=d,this.zIndex=0,this._annotationEditorUIManager=a}#i(t,o){const i=t.firstChild||t;i.id=`${MEe}${o}`,this.div.append(t),this.#e?.moveElementInDOM(this.div,t,i,!1)}async render(t){const{annotations:o}=t,i=this.div;j4(i,this.viewport);const a=new Map,l={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new PY,annotationStorage:t.annotationStorage||new _Y,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const d of o){if(d.noHTML)continue;const c=d.annotationType===Aa.POPUP;if(c){const h=a.get(d.id);if(!h)continue;l.elements=h}else{const{width:h,height:m}=v0(d.rect);if(h<=0||m<=0)continue}l.data=d;const p=FIt.create(l);if(!p.isRenderable)continue;if(!c&&d.popupRef){const h=a.get(d.popupRef);h?h.push(p):a.set(d.popupRef,[p])}const u=p.render();d.hidden&&(u.style.visibility="hidden"),this.#i(u,d.id),p.annotationEditorType>0&&(this.#o.set(p.data.id,p),this._annotationEditorUIManager?.renderAnnotationElement(p))}this.#s()}update({viewport:t}){const o=this.div;this.viewport=t,j4(o,{rotation:t.rotation}),this.#s(),o.hidden=!1}#s(){if(!this.#t)return;const t=this.div;for(const[o,i]of this.#t){const a=t.querySelector(`[data-annotation-id="${o}"]`);if(!a)continue;i.className="annotationContent";const{firstChild:l}=a;l?l.nodeName==="CANVAS"?l.replaceWith(i):l.classList.contains("annotationContent")?l.after(i):l.before(i):a.append(i)}this.#t.clear()}getEditableAnnotations(){return Array.from(this.#o.values())}getEditableAnnotation(t){return this.#o.get(t)}};const wC=/\r\n?|\n/g;class Sa extends Jo{#e=this.editorDivBlur.bind(this);#t=this.editorDivFocus.bind(this);#o=this.editorDivInput.bind(this);#i=this.editorDivKeydown.bind(this);#s=this.editorDivPaste.bind(this);#r;#n="";#l=`${this.id}-editor`;#c;#p=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=Sa.prototype,o=l=>l.isEmpty(),i=$m.TRANSLATE_SMALL,a=$m.TRANSLATE_BIG;return ni(this,"_keyboardManager",new gb([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:o}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-a,0],checker:o}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:o}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[a,0],checker:o}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:o}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-a],checker:o}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:o}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,a],checker:o}]]))}static _type="freetext";static _editorType=qr.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.#r=t.color||Sa._defaultColor||Jo._defaultLineColor,this.#c=t.fontSize||Sa._defaultFontSize}static initialize(t,o){Jo.initialize(t,o,{strings:["pdfjs-free-text-default-content"]});const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,o){switch(t){case rr.FREETEXT_SIZE:Sa._defaultFontSize=o;break;case rr.FREETEXT_COLOR:Sa._defaultColor=o;break}}updateParams(t,o){switch(t){case rr.FREETEXT_SIZE:this.#h(o);break;case rr.FREETEXT_COLOR:this.#d(o);break}}static get defaultPropertiesToUpdate(){return[[rr.FREETEXT_SIZE,Sa._defaultFontSize],[rr.FREETEXT_COLOR,Sa._defaultColor||Jo._defaultLineColor]]}get propertiesToUpdate(){return[[rr.FREETEXT_SIZE,this.#c],[rr.FREETEXT_COLOR,this.#r]]}#h(t){const o=a=>{this.editorDiv.style.fontSize=`calc(${a}px * var(--scale-factor))`,this.translate(0,-(a-this.#c)*this.parentScale),this.#c=a,this.#m()},i=this.#c;this.addCommands({cmd:o.bind(this,t),undo:o.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:rr.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#d(t){const o=a=>{this.#r=this.editorDiv.style.color=a},i=this.#r;this.addCommands({cmd:o.bind(this,t),undo:o.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:rr.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,o){this._uiManager.translateSelectedEditors(t,o,!0)}getInitialTranslation(){const t=this.parentScale;return[-Sa._internalPadding*t,-(Sa._internalPadding+this.#c)*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(qr.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant");const t=this._uiManager._signal;this.editorDiv.addEventListener("keydown",this.#i,{signal:t}),this.editorDiv.addEventListener("focus",this.#t,{signal:t}),this.editorDiv.addEventListener("blur",this.#e,{signal:t}),this.editorDiv.addEventListener("input",this.#o,{signal:t}),this.editorDiv.addEventListener("paste",this.#s,{signal:t})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#l),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#i),this.editorDiv.removeEventListener("focus",this.#t),this.editorDiv.removeEventListener("blur",this.#e),this.editorDiv.removeEventListener("input",this.#o),this.editorDiv.removeEventListener("paste",this.#s),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#a(){const t=[];this.editorDiv.normalize();for(const o of this.editorDiv.childNodes)t.push(Sa.#f(o));return t.join(`
249
249
  `)}#m(){const[t,o]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:a,div:l}=this,d=l.style.display,c=l.classList.contains("hidden");l.classList.remove("hidden"),l.style.display="hidden",a.div.append(this.div),i=l.getBoundingClientRect(),l.remove(),l.style.display=d,l.classList.toggle("hidden",c)}this.rotation%180===this.parentRotation%180?(this.width=i.width/t,this.height=i.height/o):(this.width=i.height/t,this.height=i.width/o),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#n,o=this.#n=this.#a().trimEnd();if(t===o)return;const i=a=>{if(this.#n=a,!a){this.remove();return}this.#u(),this._uiManager.rebuild(this),this.#m()};this.addCommands({cmd:()=>{i(o)},undo:()=>{i(t)},mustExec:!1}),this.#m()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&t.key==="Enter"&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){Sa._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,o;this.width&&(t=this.x,o=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#l),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),Jo._l10nPromise.get("pdfjs-free-text-default-content").then(a=>this.editorDiv?.setAttribute("default-content",a)),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#c}px * var(--scale-factor))`,i.color=this.#r,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),sS(this,this.div,["dblclick","keydown"]),this.width){const[a,l]=this.parentDimensions;if(this.annotationElementId){const{position:d}=this.#p;let[c,p]=this.getInitialTranslation();[c,p]=this.pageTranslationToScreen(c,p);const[u,h]=this.pageDimensions,[m,f]=this.pageTranslation;let x,y;switch(this.rotation){case 0:x=t+(d[0]-m)/u,y=o+this.height-(d[1]-f)/h;break;case 90:x=t+(d[0]-m)/u,y=o-(d[1]-f)/h,[c,p]=[p,-c];break;case 180:x=t-this.width+(d[0]-m)/u,y=o-(d[1]-f)/h,[c,p]=[-c,-p];break;case 270:x=t+(d[0]-m-this.height*h)/u,y=o+(d[1]-f-this.width*u)/h,[c,p]=[-p,c];break}this.setAt(x*a,y*l,c,p)}else this.setAt(t*a,o*l,this.width*a,this.height*l);this.#u(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#f(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(wC,"")}editorDivPaste(t){const o=t.clipboardData||window.clipboardData,{types:i}=o;if(i.length===1&&i[0]==="text/plain")return;t.preventDefault();const a=Sa.#g(o.getData("text")||"").replaceAll(wC,`
@@ -3312,6 +3312,12 @@ Initiate your first transfer to start earning yield.`,insuredFundsTooltip:"Secur
3312
3312
  display: flex;
3313
3313
  flex-direction: column;
3314
3314
  flex: 1;
3315
+ `;n.div`
3316
+ display: flex;
3317
+ flex-direction: column;
3318
+ flex: 1;
3319
+ align-self: flex-start;
3320
+ gap: ${r.sp3};
3315
3321
  `;n.div`
3316
3322
  cursor: ${e=>e.isDisabled?"default":"pointer"};
3317
3323
  display: flex;
@@ -22724,7 +22730,7 @@ to {
22724
22730
  ${({isMenuVisible:e})=>e===!1?he`
22725
22731
  display: none;
22726
22732
  `:null};
22727
- `,RBe=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)"})))),Mhe=g.lazy(()=>Y3(()=>import("./index-BmZs8Wda.js"),__vite__mapDeps([13,5,1,6])));function lEo({src:e,autoPlay:t=!0,config:o,controls:i=!0,height:a="100%",isModalOpen:l,loop:d=!1,muted:c=!1,showPlayButton:p=!1,style:u,thumbnail:h,width:m="100%",onEnded:f,onModalClose:x,onPlay:y}){const w=je(),[b,v]=g.useState(!1);g.useEffect(()=>{l===!0&&t?v(!0):l===!1&&v(!1)},[l,t]);const A={};o?.youtube&&(A.youtube=o.youtube);const S=()=>{v(!0),y?.()},E=()=>{v(!1),x?.()},j=()=>{v(!1),f?.(),l!=null&&x?.()},L=()=>{v(!0),y?.()};return l!=null?l?Hn.createPortal(s.jsx(hEo,{windowSize:w,role:"presentation",children:s.jsx(ir,{onClickAway:E,children:s.jsx(mEo,{windowSize:w,"data-testid":"video-player-modal",children:s.jsxs(gEo,{children:[p&&!b&&s.jsxs(s.Fragment,{children:[h!=null&&h!==""&&s.jsx(uEo,{src:h,alt:"Video thumbnail"}),s.jsx(cEo,{onClick:S,children:s.jsx(pEo,{windowSize:w})})]}),(!p||b)&&s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:"100%",height:"100%"}}),children:s.jsx(Mhe,{src:e,playing:b,controls:i,muted:c,loop:d,width:"100%",height:"100%",onEnded:j,onPlay:L,config:A})})]})})})}),document.body):null:s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:m,height:a,...u}}),children:s.jsx(Mhe,{src:e,playing:b,controls:i,muted:c,loop:d,width:m,height:a,style:u,light:p&&!b?h??!0:!1,onEnded:j,onPlay:L,config:A})})}const dEo=Nt`
22733
+ `,RBe=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)"})))),Mhe=g.lazy(()=>Y3(()=>import("./index-CX9wa_uF.js"),__vite__mapDeps([13,5,1,6])));function lEo({src:e,autoPlay:t=!0,config:o,controls:i=!0,height:a="100%",isModalOpen:l,loop:d=!1,muted:c=!1,showPlayButton:p=!1,style:u,thumbnail:h,width:m="100%",onEnded:f,onModalClose:x,onPlay:y}){const w=je(),[b,v]=g.useState(!1);g.useEffect(()=>{l===!0&&t?v(!0):l===!1&&v(!1)},[l,t]);const A={};o?.youtube&&(A.youtube=o.youtube);const S=()=>{v(!0),y?.()},E=()=>{v(!1),x?.()},j=()=>{v(!1),f?.(),l!=null&&x?.()},L=()=>{v(!0),y?.()};return l!=null?l?Hn.createPortal(s.jsx(hEo,{windowSize:w,role:"presentation",children:s.jsx(ir,{onClickAway:E,children:s.jsx(mEo,{windowSize:w,"data-testid":"video-player-modal",children:s.jsxs(gEo,{children:[p&&!b&&s.jsxs(s.Fragment,{children:[h!=null&&h!==""&&s.jsx(uEo,{src:h,alt:"Video thumbnail"}),s.jsx(cEo,{onClick:S,children:s.jsx(pEo,{windowSize:w})})]}),(!p||b)&&s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:"100%",height:"100%"}}),children:s.jsx(Mhe,{src:e,playing:b,controls:i,muted:c,loop:d,width:"100%",height:"100%",onEnded:j,onPlay:L,config:A})})]})})})}),document.body):null:s.jsx(g.Suspense,{fallback:s.jsx("div",{style:{width:m,height:a,...u}}),children:s.jsx(Mhe,{src:e,playing:b,controls:i,muted:c,loop:d,width:m,height:a,style:u,light:p&&!b?h??!0:!1,onEnded:j,onPlay:L,config:A})})}const dEo=Nt`
22728
22734
  0% {
22729
22735
  transform: rotate(0deg);
22730
22736
  }
@@ -31451,22 +31457,163 @@ to {
31451
31457
  cursor: ${e=>e.isDisabled==="disabled"?"not-allowed":"pointer"};
31452
31458
  pointer-events: ${e=>e.isDisabled==="disabled"||e.isDisabled==="readonly"?"none":"initial"};
31453
31459
  }
31454
- `;const gKo=n.div`
31460
+ `;const Kb=e=>g.createElement("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M4.954 3.24703L5.64869 1.3696C5.76936 1.04347 6.23064 1.04347 6.35131 1.3696L7.046 3.24703C7.33868 4.03788 7.96212 4.66132 8.75297 4.954L10.6304 5.64869C10.9565 5.76936 10.9565 6.23064 10.6304 6.35131L8.75297 7.046C7.96212 7.33867 7.33868 7.96212 7.046 8.75297L6.35131 10.6304C6.23064 10.9565 5.76936 10.9565 5.64869 10.6304L4.954 8.75297C4.66132 7.96212 4.03788 7.33867 3.24703 7.046L1.3696 6.35131C1.04347 6.23064 1.04347 5.76936 1.3696 5.64869L3.24703 4.954C4.03788 4.66132 4.66132 4.03788 4.954 3.24703Z",fill:"url(#paint0_linear_10171_105366)",stroke:"url(#paint1_linear_10171_105366)"}),g.createElement("defs",null,g.createElement("linearGradient",{id:"paint0_linear_10171_105366",x1:7.77537,y1:7.7754,x2:4.22456,y2:4.2246,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint1_linear_10171_105366",x1:7.77537,y1:7.7754,x2:4.22456,y2:4.2246,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})))),qb=e=>g.createElement("svg",{viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M4.954 5.2939L5.64869 3.41647C5.76936 3.09034 6.23064 3.09034 6.35131 3.41647L7.046 5.2939C7.33868 6.08475 7.96212 6.7082 8.75297 7.00087L10.6304 7.69556C10.9565 7.81624 10.9565 8.27751 10.6304 8.39819L8.75297 9.09288C7.96212 9.38555 7.33868 10.009 7.046 10.7998L6.35131 12.6773C6.23064 13.0034 5.76936 13.0034 5.64869 12.6773L4.954 10.7998C4.66132 10.009 4.03788 9.38555 3.24703 9.09288L1.3696 8.39819C1.04347 8.27751 1.04347 7.81624 1.3696 7.69556L3.24703 7.00087C4.03788 6.7082 4.66132 6.08475 4.954 5.2939Z",fill:"currentColor",stroke:"currentColor"}),g.createElement("path",{d:"M9.42188 2.5625L10.9688 4.10938L14.5781 0.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),Zb=e=>g.createElement("svg",{viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M4.954 5.2939L5.64869 3.41647C5.76936 3.09034 6.23064 3.09034 6.35131 3.41647L7.046 5.2939C7.33868 6.08475 7.96212 6.7082 8.75297 7.00087L10.6304 7.69556C10.9565 7.81624 10.9565 8.27751 10.6304 8.39819L8.75297 9.09288C7.96212 9.38555 7.33868 10.009 7.046 10.7998L6.35131 12.6773C6.23064 13.0034 5.76936 13.0034 5.64869 12.6773L4.954 10.7998C4.66132 10.009 4.03788 9.38555 3.24703 9.09288L1.3696 8.39819C1.04347 8.27751 1.04347 7.81624 1.3696 7.69556L3.24703 7.00087C4.03788 6.7082 4.66132 6.08475 4.954 5.2939Z",stroke:"currentColor"}),g.createElement("path",{d:"M9.42188 2.5625L10.9688 4.10938L14.5781 0.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:{strings:{empty:QXr}},transactionDetail:{recommendationBanner:UXr}}=W.getLocalizedStrings(),i7={width:new I(343,550,625),controlHeight:new I(C[5],C[5]),paddingTopBottom:new I(C[2],C[2]),paddingLeft:new I(C[3],C[4]),paddingRight:new I(C[2],C[3])},gKo={infoLabel:new ft("smallMedium","smallMedium")};n.div`
31461
+ height: 100%;
31462
+ display: flex;
31463
+ flex: 1;
31464
+ align-items: center;
31465
+ justify-content: flex-end;
31466
+ padding-right: ${r.sp2};
31467
+ `;n.div`
31468
+ display: flex;
31469
+ align-items: center;
31470
+ justify-content: flex-end;
31471
+ `;n.div`
31472
+ display: flex;
31473
+ flex-direction: row;
31474
+ align-items: flex-start;
31475
+ justify-content: space-between;
31476
+ flex-grow: 1;
31477
+ width: 100%;
31478
+ min-height: ${e=>i7.controlHeight.valuePx(e.size)};
31479
+ background-color: ${e=>e.theme.colors.grey5};
31480
+ &:hover {
31481
+ background-color: ${e=>e.theme.colors.background};
31482
+ }
31483
+ `;n.div`
31484
+ display: flex;
31485
+ flex-direction: column;
31486
+ row-gap: ${r.sp2};
31487
+
31488
+ width: ${e=>e.controlWidth!=null?typeof e.controlWidth=="number"?`${e.controlWidth}px`:e.controlWidth:i7.width.valuePx(e.size)};
31489
+ padding-left: ${e=>i7.paddingLeft.valuePx(e.size)};
31490
+ padding-right: ${e=>i7.paddingRight.valuePx(e.size)};
31491
+ padding-top: ${e=>i7.paddingTopBottom.valuePx(e.size)};
31492
+ padding-bottom: ${e=>i7.paddingTopBottom.valuePx(e.size)};
31493
+ border-width: 0px 1px 1px 1px;
31494
+ border-style: solid;
31495
+ border-color: ${e=>e.theme.colors.grey2};
31496
+ background-color: ${e=>e.theme.colors.grey5};
31497
+
31498
+ :first-of-type {
31499
+ border-top-left-radius: inherit;
31500
+ border-top-right-radius: inherit;
31501
+ }
31502
+
31503
+ :last-of-type {
31504
+ border-bottom-left-radius: inherit;
31505
+ border-bottom-right-radius: inherit;
31506
+ }
31507
+
31508
+ &[data-labeled-cot-dropdown-container]:focus-within {
31509
+ z-index: ${e=>e.zIndexOnFocus===!0?2:1};
31510
+ background-color: ${e=>e.theme.colors.background};
31511
+ label[data-sync-field-hover-bg],
31512
+ #dropdown-container {
31513
+ background-color: ${e=>e.isDisabled?e.theme.colors.grey5:e.theme.colors.background};
31514
+ }
31515
+ .select-control {
31516
+ background-color: ${e=>e.isError?k.importantLight:e.theme.colors.grey5};
31517
+ }
31518
+ }
31519
+
31520
+ &:hover label[data-sync-field-hover-bg],
31521
+ &:focus-within label[data-sync-field-hover-bg],
31522
+ &:hover #dropdown-container,
31523
+ &:focus-within #dropdown-container {
31524
+ background-color: ${e=>e.isDisabled?e.theme.colors.grey5:e.theme.colors.background};
31525
+ }
31526
+
31527
+ .select-control {
31528
+ background-color: ${e=>e.isError?k.importantLight:e.theme.colors.grey5};
31529
+ }
31530
+
31531
+ &[data-labeled-cot-dropdown-container]:hover {
31532
+ z-index: 1;
31533
+ background-color: ${e=>e.isDisabled===!0?e.theme.colors.grey5:e.theme.colors.background};
31534
+ label[data-sync-field-hover-bg],
31535
+ #dropdown-container {
31536
+ background-color: ${e=>e.isDisabled===!0?e.theme.colors.grey5:e.theme.colors.background};
31537
+ }
31538
+ .select-control {
31539
+ background-color: ${e=>e.isDisabled===!0?e.theme.colors.grey5:e.isError?k.importantLight:e.theme.colors.grey5};
31540
+ }
31541
+ [data-bordered-checkbox]:not([data-selected="true"]) {
31542
+ background-color: ${e=>e.theme.colors.grey5};
31543
+ }
31544
+ }
31545
+
31546
+ &:focus-within .select-control {
31547
+ background-color: ${e=>e.isDisabled?e.theme.colors.grey5:e.isError?k.importantLight:e.theme.colors.grey5};
31548
+ }
31549
+ `;n.label`
31550
+ display: flex;
31551
+ color: ${e=>e.isError?k.important:e.theme.colors.champion};
31552
+ ${e=>`${gKo.infoLabel.style(e.size)}`};
31553
+ padding-right: ${r.sp2};
31554
+ text-align: right;
31555
+ `;n.div`
31556
+ display: flex;
31557
+ flex-direction: column;
31558
+ width: ${e=>e.fullWidthSelect===!0?e.labelWidth!=null?`calc(100% - ${e.labelWidth}px)`:"auto":"50%"};
31559
+ align-items: flex-end;
31560
+ position: relative;
31561
+ `;n.div`
31562
+ display: flex;
31563
+ flex-direction: row;
31564
+ align-items: center;
31565
+ width: 100%;
31566
+ justify-content: flex-end;
31567
+ `;n($t)`
31568
+ margin-left: ${r.sp2};
31569
+ margin-right: ${r.sp2};
31570
+ color: ${e=>e.theme.colors.champion};
31571
+ `;n.div`
31572
+ display: flex;
31573
+ align-items: center;
31574
+ justify-content: center;
31575
+ width: ${r.sp3};
31576
+ margin-left: ${r.sp0};
31577
+ margin-right: ${r.sp1};
31578
+ height: 100%;
31579
+ `;n.div`
31580
+ display: flex;
31581
+ align-items: center;
31582
+ justify-content: center;
31583
+ width: auto;
31584
+ cursor: pointer;
31585
+ width: ${r.sp3};
31586
+ height: ${r.sp3};
31587
+ `;n(k5)`
31588
+ width: 12px;
31589
+ height: 12px;
31590
+ `;n(Kb)`
31591
+ width: 12px;
31592
+ height: 12px;
31593
+ `;n(qb)`
31594
+ width: ${r.sp3};
31595
+ height: ${r.sp3};
31596
+ color: ${e=>e.theme.colors.grey1};
31597
+ `;n(Zb)`
31598
+ width: ${r.sp3};
31599
+ height: ${r.sp3};
31600
+ color: ${e=>e.theme.colors.grey1};
31601
+ `;const fKo=n.div`
31455
31602
  display: flex;
31456
- `,fKo=n.div`
31603
+ `,xKo=n.div`
31457
31604
  flex: display;
31458
31605
  opacity: 0.85;
31459
31606
  border-radius: ${r.sp1};
31460
31607
  flex-direction: column;
31461
31608
  padding: ${r.sp3};
31462
31609
  background-color: ${e=>e.theme.colors.black};
31463
- `,xKo=n(Xe)`
31610
+ `,yKo=n(Xe)`
31464
31611
  color: ${e=>e.color??k.neutralGrey2Light};
31465
31612
  text-align: left;
31466
31613
  display: flex;
31467
31614
  align-items: center;
31468
31615
  justify-content: space-between;
31469
- `,yKo=({active:e,payload:t,trendType:o})=>{const i=[];return t?.forEach(a=>{const l=a.name;if(a&&e&&a.value!==0){const d=a.payload,c=a.color,p=l!=null&&d.record[l]!=null?d.record[l].amount:void 0;i.push({barName:o,value:p,color:c})}}),i},wKo=e=>{const t=yKo(e);return t.length?s.jsx(gKo,{children:s.jsx(fKo,{children:t.map((o,i)=>s.jsx(xKo,{color:o.color,children:`${o.barName}: ${ha(o.value)}`},o.barName+i))})}):null};$.memo(wKo);const{dateFormat:QXr}=W.getLocalizedStrings();n.div`
31616
+ `,wKo=({active:e,payload:t,trendType:o})=>{const i=[];return t?.forEach(a=>{const l=a.name;if(a&&e&&a.value!==0){const d=a.payload,c=a.color,p=l!=null&&d.record[l]!=null?d.record[l].amount:void 0;i.push({barName:o,value:p,color:c})}}),i},bKo=e=>{const t=wKo(e);return t.length?s.jsx(fKo,{children:s.jsx(xKo,{children:t.map((o,i)=>s.jsx(yKo,{color:o.color,children:`${o.barName}: ${ha(o.value)}`},o.barName+i))})}):null};$.memo(bKo);const{dateFormat:WXr}=W.getLocalizedStrings();n.div`
31470
31617
  display: inline-block;
31471
31618
  `;n.div`
31472
31619
  background-color: ${e=>e.theme.colors.grey3};
@@ -31494,7 +31641,7 @@ to {
31494
31641
  &:hover {
31495
31642
  color: inherit;
31496
31643
  }
31497
- `;const bKo={filterMarginLeft:new I(C[3],C[8])};n.div`
31644
+ `;const vKo={filterMarginLeft:new I(C[3],C[8])};n.div`
31498
31645
  display: flex;
31499
31646
  flex: 1 1 auto;
31500
31647
  width: 100%;
@@ -31507,7 +31654,7 @@ to {
31507
31654
  padding: ${r.sp0} ${r.sp5};
31508
31655
  `;n.div`
31509
31656
  margin: ${e=>`${r.sp4} ${r.sp0} ${r.sp3}
31510
- ${bKo.filterMarginLeft.valuePx(e.windowSize)}`};
31657
+ ${vKo.filterMarginLeft.valuePx(e.windowSize)}`};
31511
31658
  `;n.div`
31512
31659
  display: flex;
31513
31660
  height: 100%;
@@ -31518,7 +31665,7 @@ to {
31518
31665
  `;n(Fe)`
31519
31666
  display: flex;
31520
31667
  color: ${e=>e.theme.colors.grey2};
31521
- `;const Nd={headingMarginLeftRight:new I(C[4],C[4]),headingMarginTop:new I(C[4],C[4]),headingMarginTopDetail:new I(C[4],C[4]),headingMarginBottom:new I(C[4],C[4]),chartMargin:new I(C[0],C[0]),smallHeadingMarginTop:new I(C[4],C[4]),smallHeadingMarginBottom:new I(C[4],C[4])},vKo={loaderTrendChartHeight:new I(470,470)};n.div`
31668
+ `;const Nd={headingMarginLeftRight:new I(C[4],C[4]),headingMarginTop:new I(C[4],C[4]),headingMarginTopDetail:new I(C[4],C[4]),headingMarginBottom:new I(C[4],C[4]),chartMargin:new I(C[0],C[0]),smallHeadingMarginTop:new I(C[4],C[4]),smallHeadingMarginBottom:new I(C[4],C[4])},CKo={loaderTrendChartHeight:new I(470,470)};n.div`
31522
31669
  display: flex;
31523
31670
  flex: 1 1 auto;
31524
31671
  flex-direction: column;
@@ -31594,7 +31741,7 @@ to {
31594
31741
  flex-direction: column;
31595
31742
  justify-content: center;
31596
31743
  align-items: center;
31597
- height: ${e=>vKo.loaderTrendChartHeight.valuePx(e.windowSize)};
31744
+ height: ${e=>CKo.loaderTrendChartHeight.valuePx(e.windowSize)};
31598
31745
  margin-top: ${r.sp8};
31599
31746
  `;n(yt)`
31600
31747
  color: ${e=>e.theme.colors.champion};
@@ -31641,148 +31788,7 @@ to {
31641
31788
  display: flex;
31642
31789
  width: 100%;
31643
31790
  flex-direction: column;
31644
- `;const{common:{strings:{empty:UXr}}}=W.getLocalizedStrings(),Kb=e=>g.createElement("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M4.954 3.24703L5.64869 1.3696C5.76936 1.04347 6.23064 1.04347 6.35131 1.3696L7.046 3.24703C7.33868 4.03788 7.96212 4.66132 8.75297 4.954L10.6304 5.64869C10.9565 5.76936 10.9565 6.23064 10.6304 6.35131L8.75297 7.046C7.96212 7.33867 7.33868 7.96212 7.046 8.75297L6.35131 10.6304C6.23064 10.9565 5.76936 10.9565 5.64869 10.6304L4.954 8.75297C4.66132 7.96212 4.03788 7.33867 3.24703 7.046L1.3696 6.35131C1.04347 6.23064 1.04347 5.76936 1.3696 5.64869L3.24703 4.954C4.03788 4.66132 4.66132 4.03788 4.954 3.24703Z",fill:"url(#paint0_linear_10171_105366)",stroke:"url(#paint1_linear_10171_105366)"}),g.createElement("defs",null,g.createElement("linearGradient",{id:"paint0_linear_10171_105366",x1:7.77537,y1:7.7754,x2:4.22456,y2:4.2246,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint1_linear_10171_105366",x1:7.77537,y1:7.7754,x2:4.22456,y2:4.2246,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})))),qb=e=>g.createElement("svg",{viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M4.954 5.2939L5.64869 3.41647C5.76936 3.09034 6.23064 3.09034 6.35131 3.41647L7.046 5.2939C7.33868 6.08475 7.96212 6.7082 8.75297 7.00087L10.6304 7.69556C10.9565 7.81624 10.9565 8.27751 10.6304 8.39819L8.75297 9.09288C7.96212 9.38555 7.33868 10.009 7.046 10.7998L6.35131 12.6773C6.23064 13.0034 5.76936 13.0034 5.64869 12.6773L4.954 10.7998C4.66132 10.009 4.03788 9.38555 3.24703 9.09288L1.3696 8.39819C1.04347 8.27751 1.04347 7.81624 1.3696 7.69556L3.24703 7.00087C4.03788 6.7082 4.66132 6.08475 4.954 5.2939Z",fill:"currentColor",stroke:"currentColor"}),g.createElement("path",{d:"M9.42188 2.5625L10.9688 4.10938L14.5781 0.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),Zb=e=>g.createElement("svg",{viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M4.954 5.2939L5.64869 3.41647C5.76936 3.09034 6.23064 3.09034 6.35131 3.41647L7.046 5.2939C7.33868 6.08475 7.96212 6.7082 8.75297 7.00087L10.6304 7.69556C10.9565 7.81624 10.9565 8.27751 10.6304 8.39819L8.75297 9.09288C7.96212 9.38555 7.33868 10.009 7.046 10.7998L6.35131 12.6773C6.23064 13.0034 5.76936 13.0034 5.64869 12.6773L4.954 10.7998C4.66132 10.009 4.03788 9.38555 3.24703 9.09288L1.3696 8.39819C1.04347 8.27751 1.04347 7.81624 1.3696 7.69556L3.24703 7.00087C4.03788 6.7082 4.66132 6.08475 4.954 5.2939Z",stroke:"currentColor"}),g.createElement("path",{d:"M9.42188 2.5625L10.9688 4.10938L14.5781 0.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:{strings:{empty:WXr}},transactionDetail:{recommendationBanner:GXr}}=W.getLocalizedStrings(),i7={width:new I(343,550,625),controlHeight:new I(C[5],C[5]),paddingTopBottom:new I(C[2],C[2]),paddingLeft:new I(C[3],C[4]),paddingRight:new I(C[2],C[3])},CKo={infoLabel:new ft("smallMedium","smallMedium")};n.div`
31645
- height: 100%;
31646
- display: flex;
31647
- flex: 1;
31648
- align-items: center;
31649
- justify-content: flex-end;
31650
- padding-right: ${r.sp2};
31651
- `;n.div`
31652
- display: flex;
31653
- align-items: center;
31654
- justify-content: flex-end;
31655
- `;n.div`
31656
- display: flex;
31657
- flex-direction: row;
31658
- align-items: flex-start;
31659
- justify-content: space-between;
31660
- flex-grow: 1;
31661
- width: 100%;
31662
- min-height: ${e=>i7.controlHeight.valuePx(e.size)};
31663
- background-color: ${e=>e.theme.colors.grey5};
31664
- &:hover {
31665
- background-color: ${e=>e.theme.colors.background};
31666
- }
31667
- `;n.div`
31668
- display: flex;
31669
- flex-direction: column;
31670
- row-gap: ${r.sp2};
31671
-
31672
- width: ${e=>e.controlWidth!=null?typeof e.controlWidth=="number"?`${e.controlWidth}px`:e.controlWidth:i7.width.valuePx(e.size)};
31673
- padding-left: ${e=>i7.paddingLeft.valuePx(e.size)};
31674
- padding-right: ${e=>i7.paddingRight.valuePx(e.size)};
31675
- padding-top: ${e=>i7.paddingTopBottom.valuePx(e.size)};
31676
- padding-bottom: ${e=>i7.paddingTopBottom.valuePx(e.size)};
31677
- border-width: 0px 1px 1px 1px;
31678
- border-style: solid;
31679
- border-color: ${e=>e.theme.colors.grey2};
31680
- background-color: ${e=>e.theme.colors.grey5};
31681
-
31682
- :first-of-type {
31683
- border-top-left-radius: inherit;
31684
- border-top-right-radius: inherit;
31685
- }
31686
-
31687
- :last-of-type {
31688
- border-bottom-left-radius: inherit;
31689
- border-bottom-right-radius: inherit;
31690
- }
31691
-
31692
- &[data-labeled-cot-dropdown-container]:focus-within {
31693
- z-index: ${e=>e.zIndexOnFocus===!0?2:1};
31694
- background-color: ${e=>e.theme.colors.background};
31695
- label[data-sync-field-hover-bg],
31696
- #dropdown-container {
31697
- background-color: ${e=>e.isDisabled?e.theme.colors.grey5:e.theme.colors.background};
31698
- }
31699
- .select-control {
31700
- background-color: ${e=>e.isError?k.importantLight:e.theme.colors.grey5};
31701
- }
31702
- }
31703
-
31704
- &:hover label[data-sync-field-hover-bg],
31705
- &:focus-within label[data-sync-field-hover-bg],
31706
- &:hover #dropdown-container,
31707
- &:focus-within #dropdown-container {
31708
- background-color: ${e=>e.isDisabled?e.theme.colors.grey5:e.theme.colors.background};
31709
- }
31710
-
31711
- .select-control {
31712
- background-color: ${e=>e.isError?k.importantLight:e.theme.colors.grey5};
31713
- }
31714
-
31715
- &[data-labeled-cot-dropdown-container]:hover {
31716
- z-index: 1;
31717
- background-color: ${e=>e.isDisabled===!0?e.theme.colors.grey5:e.theme.colors.background};
31718
- label[data-sync-field-hover-bg],
31719
- #dropdown-container {
31720
- background-color: ${e=>e.isDisabled===!0?e.theme.colors.grey5:e.theme.colors.background};
31721
- }
31722
- .select-control {
31723
- background-color: ${e=>e.isDisabled===!0?e.theme.colors.grey5:e.isError?k.importantLight:e.theme.colors.grey5};
31724
- }
31725
- [data-bordered-checkbox]:not([data-selected="true"]) {
31726
- background-color: ${e=>e.theme.colors.grey5};
31727
- }
31728
- }
31729
-
31730
- &:focus-within .select-control {
31731
- background-color: ${e=>e.isDisabled?e.theme.colors.grey5:e.isError?k.importantLight:e.theme.colors.grey5};
31732
- }
31733
- `;n.label`
31734
- display: flex;
31735
- color: ${e=>e.isError?k.important:e.theme.colors.champion};
31736
- ${e=>`${CKo.infoLabel.style(e.size)}`};
31737
- padding-right: ${r.sp2};
31738
- text-align: right;
31739
- `;n.div`
31740
- display: flex;
31741
- flex-direction: column;
31742
- width: ${e=>e.fullWidthSelect===!0?e.labelWidth!=null?`calc(100% - ${e.labelWidth}px)`:"auto":"50%"};
31743
- align-items: flex-end;
31744
- position: relative;
31745
- `;n.div`
31746
- display: flex;
31747
- flex-direction: row;
31748
- align-items: center;
31749
- width: 100%;
31750
- justify-content: flex-end;
31751
- `;n($t)`
31752
- margin-left: ${r.sp2};
31753
- margin-right: ${r.sp2};
31754
- color: ${e=>e.theme.colors.champion};
31755
- `;n.div`
31756
- display: flex;
31757
- align-items: center;
31758
- justify-content: center;
31759
- width: ${r.sp3};
31760
- margin-left: ${r.sp0};
31761
- margin-right: ${r.sp1};
31762
- height: 100%;
31763
- `;n.div`
31764
- display: flex;
31765
- align-items: center;
31766
- justify-content: center;
31767
- width: auto;
31768
- cursor: pointer;
31769
- width: ${r.sp3};
31770
- height: ${r.sp3};
31771
- `;n(k5)`
31772
- width: 12px;
31773
- height: 12px;
31774
- `;n(Kb)`
31775
- width: 12px;
31776
- height: 12px;
31777
- `;n(qb)`
31778
- width: ${r.sp3};
31779
- height: ${r.sp3};
31780
- color: ${e=>e.theme.colors.grey1};
31781
- `;n(Zb)`
31782
- width: ${r.sp3};
31783
- height: ${r.sp3};
31784
- color: ${e=>e.theme.colors.grey1};
31785
- `;const AKo=e=>g.createElement("svg",{viewBox:"0 0 20 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M6.60533 6.89187L7.53159 4.38863C7.69249 3.95379 8.30751 3.95379 8.46841 4.38863L9.39467 6.89187C9.7849 7.94634 10.6162 8.7776 11.6706 9.16783L14.1739 10.0941C14.6087 10.255 14.6087 10.87 14.1739 11.0309L11.6706 11.9572C10.6162 12.3474 9.7849 13.1787 9.39467 14.2331L8.46841 16.7364C8.30751 17.1712 7.69248 17.1712 7.53158 16.7364L6.60533 14.2331C6.2151 13.1787 5.38384 12.3474 4.32937 11.9572L1.82613 11.0309C1.39129 10.87 1.39129 10.255 1.82613 10.0941L4.32937 9.16783C5.38384 8.7776 6.2151 7.94634 6.60533 6.89187Z",fill:"url(#paint0_linear_2060_173)",stroke:"url(#paint1_linear_2060_173)"}),g.createElement("path",{d:"M12.5625 3.25L14.625 5.3125L19.4375 0.5",stroke:"url(#paint2_linear_2060_173)",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("defs",null,g.createElement("linearGradient",{id:"paint0_linear_2060_173",x1:10.3672,y1:12.9297,x2:5.63275,y2:8.1953,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint1_linear_2060_173",x1:10.3672,y1:12.9297,x2:5.63275,y2:8.1953,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint2_linear_2060_173",x1:17.2519,y1:3.78257,x2:15.6051,y2:1.43003,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})))),$Ko=e=>g.createElement("svg",{viewBox:"0 0 20 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M6.60533 6.89187L7.53159 4.38863C7.69249 3.95379 8.30751 3.95379 8.46841 4.38863L9.39467 6.89187C9.7849 7.94634 10.6162 8.7776 11.6706 9.16783L14.1739 10.0941C14.6087 10.255 14.6087 10.87 14.1739 11.0309L11.6706 11.9572C10.6162 12.3474 9.7849 13.1787 9.39467 14.2331L8.46841 16.7364C8.30751 17.1712 7.69248 17.1712 7.53158 16.7364L6.60533 14.2331C6.2151 13.1787 5.38384 12.3474 4.32937 11.9572L1.82613 11.0309C1.39129 10.87 1.39129 10.255 1.82613 10.0941L4.32937 9.16783C5.38384 8.7776 6.2151 7.94634 6.60533 6.89187Z",stroke:"url(#paint0_linear_2060_202)"}),g.createElement("path",{d:"M12.5625 3.25L14.625 5.3125L19.4375 0.5",stroke:"url(#paint1_linear_2060_202)",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("defs",null,g.createElement("linearGradient",{id:"paint0_linear_2060_202",x1:10.3672,y1:12.9297,x2:5.63275,y2:8.1953,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint1_linear_2060_202",x1:17.2519,y1:3.78257,x2:15.6051,y2:1.43003,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})))),{transactionDetail:YXr}=W.getLocalizedStrings();n.div`
31791
+ `;const{common:{strings:{empty:GXr}}}=W.getLocalizedStrings(),AKo=e=>g.createElement("svg",{viewBox:"0 0 20 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M6.60533 6.89187L7.53159 4.38863C7.69249 3.95379 8.30751 3.95379 8.46841 4.38863L9.39467 6.89187C9.7849 7.94634 10.6162 8.7776 11.6706 9.16783L14.1739 10.0941C14.6087 10.255 14.6087 10.87 14.1739 11.0309L11.6706 11.9572C10.6162 12.3474 9.7849 13.1787 9.39467 14.2331L8.46841 16.7364C8.30751 17.1712 7.69248 17.1712 7.53158 16.7364L6.60533 14.2331C6.2151 13.1787 5.38384 12.3474 4.32937 11.9572L1.82613 11.0309C1.39129 10.87 1.39129 10.255 1.82613 10.0941L4.32937 9.16783C5.38384 8.7776 6.2151 7.94634 6.60533 6.89187Z",fill:"url(#paint0_linear_2060_173)",stroke:"url(#paint1_linear_2060_173)"}),g.createElement("path",{d:"M12.5625 3.25L14.625 5.3125L19.4375 0.5",stroke:"url(#paint2_linear_2060_173)",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("defs",null,g.createElement("linearGradient",{id:"paint0_linear_2060_173",x1:10.3672,y1:12.9297,x2:5.63275,y2:8.1953,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint1_linear_2060_173",x1:10.3672,y1:12.9297,x2:5.63275,y2:8.1953,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint2_linear_2060_173",x1:17.2519,y1:3.78257,x2:15.6051,y2:1.43003,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})))),$Ko=e=>g.createElement("svg",{viewBox:"0 0 20 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M6.60533 6.89187L7.53159 4.38863C7.69249 3.95379 8.30751 3.95379 8.46841 4.38863L9.39467 6.89187C9.7849 7.94634 10.6162 8.7776 11.6706 9.16783L14.1739 10.0941C14.6087 10.255 14.6087 10.87 14.1739 11.0309L11.6706 11.9572C10.6162 12.3474 9.7849 13.1787 9.39467 14.2331L8.46841 16.7364C8.30751 17.1712 7.69248 17.1712 7.53158 16.7364L6.60533 14.2331C6.2151 13.1787 5.38384 12.3474 4.32937 11.9572L1.82613 11.0309C1.39129 10.87 1.39129 10.255 1.82613 10.0941L4.32937 9.16783C5.38384 8.7776 6.2151 7.94634 6.60533 6.89187Z",stroke:"url(#paint0_linear_2060_202)"}),g.createElement("path",{d:"M12.5625 3.25L14.625 5.3125L19.4375 0.5",stroke:"url(#paint1_linear_2060_202)",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("defs",null,g.createElement("linearGradient",{id:"paint0_linear_2060_202",x1:10.3672,y1:12.9297,x2:5.63275,y2:8.1953,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})),g.createElement("linearGradient",{id:"paint1_linear_2060_202",x1:17.2519,y1:3.78257,x2:15.6051,y2:1.43003,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#6D3FD8"}),g.createElement("stop",{offset:.3,stopColor:"#BD54CF"}),g.createElement("stop",{offset:.5,stopColor:"#CF6CC9"}),g.createElement("stop",{offset:.7,stopColor:"#EE609C"}),g.createElement("stop",{offset:1,stopColor:"#EE609C"})))),{transactionDetail:YXr}=W.getLocalizedStrings();n.div`
31786
31792
  padding: ${r.sp3};
31787
31793
  display: ${e=>e.isVisible?"flex":"none"};
31788
31794
  justify-content: center;
@@ -31874,6 +31880,8 @@ to {
31874
31880
  border-color: ${e=>e.theme.colors.grey2};
31875
31881
  border-width: 0 1px 1px 1px;
31876
31882
  padding: ${r.sp2} ${r.sp3} ${r.sp2} ${r.sp4};
31883
+ border-bottom-left-radius: ${e=>e.isLastRow===!0?r.sp2:"0"};
31884
+ border-bottom-right-radius: ${e=>e.isLastRow===!0?r.sp2:"0"};
31877
31885
  `;n.div`
31878
31886
  display: flex;
31879
31887
  flex-direction: column;
@@ -33296,7 +33304,13 @@ to {
33296
33304
  `;n(Uo)``;n(Ha)`
33297
33305
  width: ${r.sp3};
33298
33306
  height: ${r.sp3};
33299
- `;n.q``;const Xb=e=>g.createElement("svg",{width:126,height:24,viewBox:"0 0 126 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M124.643 18.207C124.643 17.9706 124.407 17.876 124.194 17.876H123.792V19.0582H124.005V18.5853H124.17L124.431 19.0582H124.691L124.383 18.538C124.456 18.5267 124.523 18.4893 124.571 18.4329C124.618 18.3764 124.644 18.3046 124.643 18.2307V18.207ZM124.005 18.3962V18.0651H124.194C124.312 18.0651 124.431 18.0888 124.431 18.2307C124.431 18.3725 124.289 18.3962 124.17 18.3962H124.005ZM124.194 17.4504C123.988 17.4551 123.789 17.5207 123.62 17.6389C123.452 17.7571 123.322 17.9226 123.248 18.1144C123.174 18.3062 123.158 18.5158 123.203 18.7167C123.247 18.9175 123.351 19.1005 123.499 19.2427C123.648 19.3848 123.836 19.4797 124.038 19.5152C124.241 19.5508 124.45 19.5255 124.638 19.4424C124.826 19.3594 124.985 19.2225 125.096 19.0489C125.206 18.8753 125.263 18.6728 125.258 18.4671C125.258 18.3285 125.231 18.1912 125.177 18.0634C125.123 17.9356 125.044 17.8199 124.945 17.723C124.846 17.626 124.729 17.5499 124.6 17.499C124.471 17.4481 124.333 17.4236 124.194 17.4267V17.4504ZM124.194 19.342C124.015 19.3419 123.841 19.2886 123.693 19.1888C123.544 19.0889 123.429 18.9472 123.362 18.7816C123.295 18.6161 123.278 18.4342 123.315 18.2593C123.352 18.0844 123.44 17.9244 123.568 17.7997C123.696 17.675 123.858 17.5914 124.034 17.5594C124.21 17.5275 124.391 17.5487 124.555 17.6203C124.718 17.692 124.857 17.8108 124.953 17.9616C125.049 18.1125 125.097 18.2885 125.093 18.4671C125.093 18.7054 124.998 18.934 124.829 19.1025C124.661 19.271 124.432 19.3656 124.194 19.3656V19.342ZM56.5685 17.6159C55.0316 17.6159 54.2513 16.2208 54.2513 14.8967C54.2513 13.5725 55.1025 12.2484 56.4976 12.2484C57.1596 12.2484 57.9872 12.5794 58.3183 13.0523L59.9261 11.4208C59.472 10.9824 58.9346 10.6394 58.3458 10.412C57.7569 10.1846 57.1285 10.0774 56.4976 10.0967C53.6601 10.0967 51.603 12.1302 51.603 14.9203C51.603 17.7578 53.6365 19.7676 56.5685 19.7676C57.9399 19.7676 59.2168 19.3656 59.9734 18.538L58.3892 16.8356C58.1538 17.0814 57.8712 17.2772 57.5584 17.4113C57.2456 17.5454 56.9089 17.615 56.5685 17.6159ZM47.4651 19.5075H50.0188V10.3568H47.4887L47.4651 19.5075ZM42.8542 15.3696C42.8542 16.4336 42.1449 17.5922 40.868 17.5922C39.8513 17.5922 39.3074 16.8829 39.3074 15.3932V10.3804H36.7774V16.0553C36.7774 17.9469 37.7232 19.7912 40.2532 19.7912C41.4355 19.7912 42.4286 18.8454 42.9252 18.1361H42.9725V19.5312H45.3843V10.3568H42.8542V15.3696ZM32.2138 11.5154H32.1665C31.8119 11.1134 30.8424 10.0967 29.2818 10.0967C26.7045 10.0967 24.7183 12.1065 24.7183 14.8967C24.7183 17.7341 26.5626 19.7676 29.1636 19.7676C29.7199 19.7505 30.2669 19.62 30.771 19.3842C31.2752 19.1484 31.7259 18.8122 32.0956 18.3962H32.1429V24.0001H34.6493V10.3568H32.2375L32.2138 11.5154ZM29.7784 17.6159C28.2178 17.6159 27.3192 16.2445 27.3192 14.8967C27.3192 13.5962 28.1232 12.2247 29.7784 12.2247C31.268 12.2247 32.1902 13.6435 32.1902 14.9203C32.1902 16.1972 31.2917 17.6159 29.7784 17.6159ZM87.3074 10.0967C84.4464 10.0967 82.3419 12.1065 82.3419 14.8967C82.3419 17.7814 84.47 19.7912 87.3074 19.7912C90.1449 19.7912 92.273 17.7578 92.273 14.8967C92.273 12.1065 90.1922 10.0967 87.3074 10.0967ZM87.3074 17.6159C85.6523 17.6159 84.9193 16.1972 84.9193 14.8967C84.9193 13.5962 85.6759 12.2247 87.3074 12.2247C88.939 12.2247 89.7429 13.5962 89.7429 14.8967C89.7429 16.1972 88.9863 17.6159 87.3311 17.6159H87.3074ZM118.898 13.8799C117.597 13.5725 117.124 13.407 117.124 12.8632C117.124 12.1538 118.07 11.9883 118.472 11.9883C119.252 11.9883 120.127 12.4612 120.482 12.8868L121.971 11.4681C121.262 10.6169 119.914 10.1203 118.496 10.1203C116.651 10.1203 114.736 11.0425 114.736 13.076C114.736 14.8494 116.131 15.3696 117.479 15.7006C118.898 16.0316 119.418 16.2681 119.418 16.8592C119.418 17.6868 118.472 17.8287 118.117 17.8287C117.682 17.8085 117.255 17.7019 116.861 17.5152C116.467 17.3285 116.115 17.0653 115.824 16.741L114.287 18.3016C115.114 19.2474 116.557 19.7912 118.023 19.7912C120.505 19.7912 121.971 18.609 121.971 16.6701C121.971 14.8257 120.174 14.1873 118.898 13.8799ZM114.098 10.3568H110.835L107.571 14.14H107.524V5.32031H104.994V19.5075H107.524V15.0149H107.571L110.953 19.5075H114.263L110.338 14.5183L114.098 10.3568ZM76.6434 10.1203C75.4611 10.1203 74.6335 10.5932 73.806 11.3499H73.7823V5.32031H71.2523V19.5075H73.6641V18.207H73.7114C74.0225 18.6812 74.4472 19.0702 74.9469 19.3386C75.4465 19.607 76.0053 19.7463 76.5725 19.744C79.1734 19.744 81.1597 17.7105 81.1597 14.8967C81.1597 12.1065 79.2207 10.0967 76.6434 10.0967V10.1203ZM76.1468 17.6159C74.6099 17.6159 73.7114 16.2445 73.7114 14.9203C73.7114 13.5962 74.6572 12.2247 76.1468 12.2247C77.7784 12.2247 78.5823 13.5962 78.5823 14.8967C78.5823 16.2445 77.7074 17.6159 76.1468 17.6159ZM70.3064 10.3568H67.0434L63.7803 14.14H63.733V5.32031H61.203V19.5075H63.733V15.0149H63.7803L67.1616 19.5075H70.472L66.5705 14.5183L70.3064 10.3568ZM98.3971 10.1203C95.5124 10.1203 93.4316 12.1302 93.4316 14.8967C93.4316 17.7814 95.5597 19.7912 98.3971 19.7912C101.235 19.7912 103.363 17.7578 103.363 14.8967C103.363 12.1065 101.258 10.0967 98.3971 10.0967V10.1203ZM98.3971 17.6159C96.7419 17.6159 95.9853 16.1972 95.9853 14.8967C95.9853 13.5962 96.7419 12.2247 98.3971 12.2247C100.052 12.2247 100.785 13.5962 100.785 14.8967C100.785 16.1972 100.029 17.6159 98.3971 17.6159Z",fill:"currentColor"}),g.createElement("path",{d:"M11.2405 21.2808C17.117 21.2808 21.8809 16.5169 21.8809 10.6404C21.8809 4.76387 17.117 0 11.2405 0C5.36396 0 0.600098 4.76387 0.600098 10.6404C0.600098 16.5169 5.36396 21.2808 11.2405 21.2808Z",fill:"#2CA01C"}),g.createElement("path",{d:"M3.55566 10.6404C3.55566 11.7379 3.99162 12.7904 4.76764 13.5664C5.54365 14.3424 6.59615 14.7783 7.69359 14.7783H8.28473V13.2414H7.69359C7.00377 13.2414 6.3422 12.9674 5.85442 12.4796C5.36664 11.9918 5.09261 11.3302 5.09261 10.6404C5.09261 9.95058 5.36664 9.28901 5.85442 8.80123C6.3422 8.31346 7.00377 8.03942 7.69359 8.03942H9.11231V16.0788C9.11231 16.2807 9.15207 16.4805 9.22931 16.667C9.30655 16.8535 9.41976 17.0229 9.56247 17.1656C9.70519 17.3083 9.87463 17.4215 10.0611 17.4988C10.2476 17.576 10.4474 17.6158 10.6493 17.6158V6.50248H7.69359C6.59615 6.50248 5.54365 6.93844 4.76764 7.71445C3.99162 8.49046 3.55566 9.54296 3.55566 10.6404ZM14.7872 6.50248H14.1961V8.03942H14.7872C15.477 8.03942 16.1386 8.31346 16.6264 8.80123C17.1141 9.28901 17.3882 9.95058 17.3882 10.6404C17.3882 11.3302 17.1141 11.9918 16.6264 12.4796C16.1386 12.9674 15.477 13.2414 14.7872 13.2414H13.3685V5.20199C13.3685 4.79436 13.2065 4.40343 12.9183 4.1152C12.6301 3.82697 12.2391 3.66504 11.8315 3.66504V14.7783H14.7872C15.3306 14.7783 15.8687 14.6713 16.3707 14.4634C16.8727 14.2554 17.3289 13.9506 17.7131 13.5664C18.0974 13.1821 18.4022 12.726 18.6101 12.2239C18.8181 11.7219 18.9251 11.1838 18.9251 10.6404C18.9251 10.097 18.8181 9.55893 18.6101 9.05689C18.4022 8.55485 18.0974 8.09869 17.7131 7.71445C17.3289 7.33021 16.8727 7.02541 16.3707 6.81746C15.8687 6.60951 15.3306 6.50248 14.7872 6.50248Z",fill:"white"}),g.createElement("path",{d:"M35.1225 2.43553C35.2628 2.43553 35.3999 2.39393 35.5166 2.31598C35.6332 2.23803 35.7242 2.12725 35.7779 1.99763C35.8315 1.86801 35.8456 1.72538 35.8182 1.58778C35.7908 1.45018 35.7233 1.32378 35.6241 1.22458C35.5249 1.12537 35.3985 1.05781 35.2609 1.03044C35.1233 1.00307 34.9806 1.01712 34.851 1.07081C34.7214 1.1245 34.6106 1.21542 34.5327 1.33207C34.4547 1.44872 34.4131 1.58587 34.4131 1.72617C34.4131 1.9143 34.4879 2.09473 34.6209 2.22776C34.7539 2.36079 34.9344 2.43553 35.1225 2.43553ZM30.9373 2.90844C30.6429 2.90803 30.3542 2.98968 30.1036 3.14421C29.853 3.29875 29.6504 3.52006 29.5186 3.78331H29.4713V3.02666H28.3836V7.68479H29.5422V5.1311C29.5422 4.51632 29.8969 3.87789 30.6299 3.87789C31.3629 3.87789 31.5048 4.56361 31.5048 5.10745V7.70844H32.6634V4.75277C32.6634 3.80696 32.1668 2.86114 30.9373 2.86114V2.90844ZM26.019 7.68479H27.2013V3.02666H26.019V7.68479ZM47.1816 2.41188C47.3219 2.41188 47.4591 2.37028 47.5757 2.29233C47.6924 2.21439 47.7833 2.1036 47.837 1.97398C47.8907 1.84437 47.9047 1.70174 47.8773 1.56413C47.85 1.42653 47.7824 1.30014 47.6832 1.20093C47.584 1.10173 47.4576 1.03417 47.32 1.00679C47.1824 0.979424 47.0398 0.993471 46.9101 1.04716C46.7805 1.10085 46.6697 1.19177 46.5918 1.30842C46.5138 1.42508 46.4722 1.56223 46.4722 1.70252C46.4722 1.89066 46.547 2.07109 46.68 2.20412C46.813 2.33715 46.9935 2.41188 47.1816 2.41188ZM45.29 3.02666V4.06706H46.5905V7.68479H47.7727V4.06706H49.0732V3.02666H45.29ZM43.3038 7.68479H44.486V3.02666H43.3038V7.68479ZM33.2545 4.06706H34.555V7.68479H35.7373V4.06706H37.0378V3.02666H33.2545V4.06706ZM40.9629 5.604C40.9629 6.21878 40.6082 6.8572 39.8752 6.8572C39.1422 6.8572 39.0003 6.14784 39.0003 5.604V3.02666H37.8181V5.93504C37.8181 6.88085 38.3383 7.82666 39.5442 7.82666C39.8426 7.83151 40.1363 7.75195 40.3915 7.59717C40.6467 7.44239 40.8529 7.21867 40.9865 6.95179H41.0102V7.70844H42.1215V3.02666H40.9392V5.58036L40.9629 5.604Z",fill:"currentColor"})),dA={containerPaddingTop:new I(C[5],C[7]),containerPaddingBottom:new I(C[5],C[5]),containerPaddingLeftRight:new I(C[6],C[11])};n.div`
33307
+ `;n.q``;n.div`
33308
+ border-radius: ${r.sp2};
33309
+ `;n(kt)`
33310
+ color: ${e=>e.theme.colors.hero};
33311
+ margin-top: ${r.sp0};
33312
+ margin-bottom: ${r.sp1};
33313
+ `;const Xb=e=>g.createElement("svg",{width:126,height:24,viewBox:"0 0 126 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{d:"M124.643 18.207C124.643 17.9706 124.407 17.876 124.194 17.876H123.792V19.0582H124.005V18.5853H124.17L124.431 19.0582H124.691L124.383 18.538C124.456 18.5267 124.523 18.4893 124.571 18.4329C124.618 18.3764 124.644 18.3046 124.643 18.2307V18.207ZM124.005 18.3962V18.0651H124.194C124.312 18.0651 124.431 18.0888 124.431 18.2307C124.431 18.3725 124.289 18.3962 124.17 18.3962H124.005ZM124.194 17.4504C123.988 17.4551 123.789 17.5207 123.62 17.6389C123.452 17.7571 123.322 17.9226 123.248 18.1144C123.174 18.3062 123.158 18.5158 123.203 18.7167C123.247 18.9175 123.351 19.1005 123.499 19.2427C123.648 19.3848 123.836 19.4797 124.038 19.5152C124.241 19.5508 124.45 19.5255 124.638 19.4424C124.826 19.3594 124.985 19.2225 125.096 19.0489C125.206 18.8753 125.263 18.6728 125.258 18.4671C125.258 18.3285 125.231 18.1912 125.177 18.0634C125.123 17.9356 125.044 17.8199 124.945 17.723C124.846 17.626 124.729 17.5499 124.6 17.499C124.471 17.4481 124.333 17.4236 124.194 17.4267V17.4504ZM124.194 19.342C124.015 19.3419 123.841 19.2886 123.693 19.1888C123.544 19.0889 123.429 18.9472 123.362 18.7816C123.295 18.6161 123.278 18.4342 123.315 18.2593C123.352 18.0844 123.44 17.9244 123.568 17.7997C123.696 17.675 123.858 17.5914 124.034 17.5594C124.21 17.5275 124.391 17.5487 124.555 17.6203C124.718 17.692 124.857 17.8108 124.953 17.9616C125.049 18.1125 125.097 18.2885 125.093 18.4671C125.093 18.7054 124.998 18.934 124.829 19.1025C124.661 19.271 124.432 19.3656 124.194 19.3656V19.342ZM56.5685 17.6159C55.0316 17.6159 54.2513 16.2208 54.2513 14.8967C54.2513 13.5725 55.1025 12.2484 56.4976 12.2484C57.1596 12.2484 57.9872 12.5794 58.3183 13.0523L59.9261 11.4208C59.472 10.9824 58.9346 10.6394 58.3458 10.412C57.7569 10.1846 57.1285 10.0774 56.4976 10.0967C53.6601 10.0967 51.603 12.1302 51.603 14.9203C51.603 17.7578 53.6365 19.7676 56.5685 19.7676C57.9399 19.7676 59.2168 19.3656 59.9734 18.538L58.3892 16.8356C58.1538 17.0814 57.8712 17.2772 57.5584 17.4113C57.2456 17.5454 56.9089 17.615 56.5685 17.6159ZM47.4651 19.5075H50.0188V10.3568H47.4887L47.4651 19.5075ZM42.8542 15.3696C42.8542 16.4336 42.1449 17.5922 40.868 17.5922C39.8513 17.5922 39.3074 16.8829 39.3074 15.3932V10.3804H36.7774V16.0553C36.7774 17.9469 37.7232 19.7912 40.2532 19.7912C41.4355 19.7912 42.4286 18.8454 42.9252 18.1361H42.9725V19.5312H45.3843V10.3568H42.8542V15.3696ZM32.2138 11.5154H32.1665C31.8119 11.1134 30.8424 10.0967 29.2818 10.0967C26.7045 10.0967 24.7183 12.1065 24.7183 14.8967C24.7183 17.7341 26.5626 19.7676 29.1636 19.7676C29.7199 19.7505 30.2669 19.62 30.771 19.3842C31.2752 19.1484 31.7259 18.8122 32.0956 18.3962H32.1429V24.0001H34.6493V10.3568H32.2375L32.2138 11.5154ZM29.7784 17.6159C28.2178 17.6159 27.3192 16.2445 27.3192 14.8967C27.3192 13.5962 28.1232 12.2247 29.7784 12.2247C31.268 12.2247 32.1902 13.6435 32.1902 14.9203C32.1902 16.1972 31.2917 17.6159 29.7784 17.6159ZM87.3074 10.0967C84.4464 10.0967 82.3419 12.1065 82.3419 14.8967C82.3419 17.7814 84.47 19.7912 87.3074 19.7912C90.1449 19.7912 92.273 17.7578 92.273 14.8967C92.273 12.1065 90.1922 10.0967 87.3074 10.0967ZM87.3074 17.6159C85.6523 17.6159 84.9193 16.1972 84.9193 14.8967C84.9193 13.5962 85.6759 12.2247 87.3074 12.2247C88.939 12.2247 89.7429 13.5962 89.7429 14.8967C89.7429 16.1972 88.9863 17.6159 87.3311 17.6159H87.3074ZM118.898 13.8799C117.597 13.5725 117.124 13.407 117.124 12.8632C117.124 12.1538 118.07 11.9883 118.472 11.9883C119.252 11.9883 120.127 12.4612 120.482 12.8868L121.971 11.4681C121.262 10.6169 119.914 10.1203 118.496 10.1203C116.651 10.1203 114.736 11.0425 114.736 13.076C114.736 14.8494 116.131 15.3696 117.479 15.7006C118.898 16.0316 119.418 16.2681 119.418 16.8592C119.418 17.6868 118.472 17.8287 118.117 17.8287C117.682 17.8085 117.255 17.7019 116.861 17.5152C116.467 17.3285 116.115 17.0653 115.824 16.741L114.287 18.3016C115.114 19.2474 116.557 19.7912 118.023 19.7912C120.505 19.7912 121.971 18.609 121.971 16.6701C121.971 14.8257 120.174 14.1873 118.898 13.8799ZM114.098 10.3568H110.835L107.571 14.14H107.524V5.32031H104.994V19.5075H107.524V15.0149H107.571L110.953 19.5075H114.263L110.338 14.5183L114.098 10.3568ZM76.6434 10.1203C75.4611 10.1203 74.6335 10.5932 73.806 11.3499H73.7823V5.32031H71.2523V19.5075H73.6641V18.207H73.7114C74.0225 18.6812 74.4472 19.0702 74.9469 19.3386C75.4465 19.607 76.0053 19.7463 76.5725 19.744C79.1734 19.744 81.1597 17.7105 81.1597 14.8967C81.1597 12.1065 79.2207 10.0967 76.6434 10.0967V10.1203ZM76.1468 17.6159C74.6099 17.6159 73.7114 16.2445 73.7114 14.9203C73.7114 13.5962 74.6572 12.2247 76.1468 12.2247C77.7784 12.2247 78.5823 13.5962 78.5823 14.8967C78.5823 16.2445 77.7074 17.6159 76.1468 17.6159ZM70.3064 10.3568H67.0434L63.7803 14.14H63.733V5.32031H61.203V19.5075H63.733V15.0149H63.7803L67.1616 19.5075H70.472L66.5705 14.5183L70.3064 10.3568ZM98.3971 10.1203C95.5124 10.1203 93.4316 12.1302 93.4316 14.8967C93.4316 17.7814 95.5597 19.7912 98.3971 19.7912C101.235 19.7912 103.363 17.7578 103.363 14.8967C103.363 12.1065 101.258 10.0967 98.3971 10.0967V10.1203ZM98.3971 17.6159C96.7419 17.6159 95.9853 16.1972 95.9853 14.8967C95.9853 13.5962 96.7419 12.2247 98.3971 12.2247C100.052 12.2247 100.785 13.5962 100.785 14.8967C100.785 16.1972 100.029 17.6159 98.3971 17.6159Z",fill:"currentColor"}),g.createElement("path",{d:"M11.2405 21.2808C17.117 21.2808 21.8809 16.5169 21.8809 10.6404C21.8809 4.76387 17.117 0 11.2405 0C5.36396 0 0.600098 4.76387 0.600098 10.6404C0.600098 16.5169 5.36396 21.2808 11.2405 21.2808Z",fill:"#2CA01C"}),g.createElement("path",{d:"M3.55566 10.6404C3.55566 11.7379 3.99162 12.7904 4.76764 13.5664C5.54365 14.3424 6.59615 14.7783 7.69359 14.7783H8.28473V13.2414H7.69359C7.00377 13.2414 6.3422 12.9674 5.85442 12.4796C5.36664 11.9918 5.09261 11.3302 5.09261 10.6404C5.09261 9.95058 5.36664 9.28901 5.85442 8.80123C6.3422 8.31346 7.00377 8.03942 7.69359 8.03942H9.11231V16.0788C9.11231 16.2807 9.15207 16.4805 9.22931 16.667C9.30655 16.8535 9.41976 17.0229 9.56247 17.1656C9.70519 17.3083 9.87463 17.4215 10.0611 17.4988C10.2476 17.576 10.4474 17.6158 10.6493 17.6158V6.50248H7.69359C6.59615 6.50248 5.54365 6.93844 4.76764 7.71445C3.99162 8.49046 3.55566 9.54296 3.55566 10.6404ZM14.7872 6.50248H14.1961V8.03942H14.7872C15.477 8.03942 16.1386 8.31346 16.6264 8.80123C17.1141 9.28901 17.3882 9.95058 17.3882 10.6404C17.3882 11.3302 17.1141 11.9918 16.6264 12.4796C16.1386 12.9674 15.477 13.2414 14.7872 13.2414H13.3685V5.20199C13.3685 4.79436 13.2065 4.40343 12.9183 4.1152C12.6301 3.82697 12.2391 3.66504 11.8315 3.66504V14.7783H14.7872C15.3306 14.7783 15.8687 14.6713 16.3707 14.4634C16.8727 14.2554 17.3289 13.9506 17.7131 13.5664C18.0974 13.1821 18.4022 12.726 18.6101 12.2239C18.8181 11.7219 18.9251 11.1838 18.9251 10.6404C18.9251 10.097 18.8181 9.55893 18.6101 9.05689C18.4022 8.55485 18.0974 8.09869 17.7131 7.71445C17.3289 7.33021 16.8727 7.02541 16.3707 6.81746C15.8687 6.60951 15.3306 6.50248 14.7872 6.50248Z",fill:"white"}),g.createElement("path",{d:"M35.1225 2.43553C35.2628 2.43553 35.3999 2.39393 35.5166 2.31598C35.6332 2.23803 35.7242 2.12725 35.7779 1.99763C35.8315 1.86801 35.8456 1.72538 35.8182 1.58778C35.7908 1.45018 35.7233 1.32378 35.6241 1.22458C35.5249 1.12537 35.3985 1.05781 35.2609 1.03044C35.1233 1.00307 34.9806 1.01712 34.851 1.07081C34.7214 1.1245 34.6106 1.21542 34.5327 1.33207C34.4547 1.44872 34.4131 1.58587 34.4131 1.72617C34.4131 1.9143 34.4879 2.09473 34.6209 2.22776C34.7539 2.36079 34.9344 2.43553 35.1225 2.43553ZM30.9373 2.90844C30.6429 2.90803 30.3542 2.98968 30.1036 3.14421C29.853 3.29875 29.6504 3.52006 29.5186 3.78331H29.4713V3.02666H28.3836V7.68479H29.5422V5.1311C29.5422 4.51632 29.8969 3.87789 30.6299 3.87789C31.3629 3.87789 31.5048 4.56361 31.5048 5.10745V7.70844H32.6634V4.75277C32.6634 3.80696 32.1668 2.86114 30.9373 2.86114V2.90844ZM26.019 7.68479H27.2013V3.02666H26.019V7.68479ZM47.1816 2.41188C47.3219 2.41188 47.4591 2.37028 47.5757 2.29233C47.6924 2.21439 47.7833 2.1036 47.837 1.97398C47.8907 1.84437 47.9047 1.70174 47.8773 1.56413C47.85 1.42653 47.7824 1.30014 47.6832 1.20093C47.584 1.10173 47.4576 1.03417 47.32 1.00679C47.1824 0.979424 47.0398 0.993471 46.9101 1.04716C46.7805 1.10085 46.6697 1.19177 46.5918 1.30842C46.5138 1.42508 46.4722 1.56223 46.4722 1.70252C46.4722 1.89066 46.547 2.07109 46.68 2.20412C46.813 2.33715 46.9935 2.41188 47.1816 2.41188ZM45.29 3.02666V4.06706H46.5905V7.68479H47.7727V4.06706H49.0732V3.02666H45.29ZM43.3038 7.68479H44.486V3.02666H43.3038V7.68479ZM33.2545 4.06706H34.555V7.68479H35.7373V4.06706H37.0378V3.02666H33.2545V4.06706ZM40.9629 5.604C40.9629 6.21878 40.6082 6.8572 39.8752 6.8572C39.1422 6.8572 39.0003 6.14784 39.0003 5.604V3.02666H37.8181V5.93504C37.8181 6.88085 38.3383 7.82666 39.5442 7.82666C39.8426 7.83151 40.1363 7.75195 40.3915 7.59717C40.6467 7.44239 40.8529 7.21867 40.9865 6.95179H41.0102V7.70844H42.1215V3.02666H40.9392V5.58036L40.9629 5.604Z",fill:"currentColor"})),dA={containerPaddingTop:new I(C[5],C[7]),containerPaddingBottom:new I(C[5],C[5]),containerPaddingLeftRight:new I(C[6],C[11])};n.div`
33300
33314
  border-radius: inherit;
33301
33315
  max-width: 520px;
33302
33316
  text-align: center;
@@ -86977,7 +86991,7 @@ ${e}`,SIr=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
86977
86991
  `,FYr=n(qY)`
86978
86992
  color: ${e=>e.theme.colors.alert};
86979
86993
  margin-top: ${r.sp2};
86980
- `;var OYr=N_e();const Py=cW(OYr);class NYr{getSignedInUser(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID),o=window.localStorage.getItem(this.ZENI_SIGNED_IN_USER);if(o!=null&&t!=null)return JSON.parse(this.decrypt(o,t))}getShowNegativeAmountInParenthesis(){const t=window.localStorage.getItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS),o=window.localStorage.getItem(this.ZENI_SESSION_ID);return t!=null&&o!=null?JSON.parse(this.decrypt(t,o)):!1}getShowNegativeAmountInParenthesisPDF(){const t=window.localStorage.getItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF),o=window.localStorage.getItem(this.ZENI_SESSION_ID);return t!=null&&o!=null?JSON.parse(this.decrypt(t,o)):!0}getSignedInUserTenant(t){const o=window.localStorage.getItem(this.ZENI_SIGNED_IN_USER_TENANTS),i=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null&&i!=null)return JSON.parse(this.decrypt(o,i)).find(l=>l.tenantEmailDomain===t)}getSignedInUserTenantWithId(t){const o=window.localStorage.getItem(this.ZENI_SIGNED_IN_USER_TENANTS),i=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null&&i!=null)return JSON.parse(this.decrypt(o,i)).find(l=>l.tenantId===t)}getForceRefreshedComponents(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID),o=window.localStorage.getItem(this.ZENI_FORCE_REFRESHED_COMPONENTS);if(o&&t!=null){const i=this.decrypt(o,t);return i?JSON.parse(i):[]}return[]}saveForceRefreshedComponents(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);o!=null?window.localStorage.setItem(this.ZENI_FORCE_REFRESHED_COMPONENTS,this.encrypt(JSON.stringify(t),o)):console.warn("Can't update the force refreshed components when the user is logged out!")}saveSignedInUserWithSession(t,o){if(t==null||o==null)throw new Error("Can't accept nil for user or session Id");window.localStorage.setItem(this.ZENI_SESSION_ID,o),window.localStorage.setItem(this.ZENI_SIGNED_IN_USER,this.encrypt(JSON.stringify(t),o))}saveSignedInUserTenants(t,o){const i=o??window.localStorage.getItem(this.ZENI_SESSION_ID);i!=null?window.localStorage.setItem(this.ZENI_SIGNED_IN_USER_TENANTS,this.encrypt(JSON.stringify(t),i)):console.warn("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesis(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.encrypt(JSON.stringify(t),o));else throw new Error("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesisPDF(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.encrypt(JSON.stringify(t),o));else throw new Error("Can't update the setting when the user is logged out!")}isSignedIn(){return[this.ZENI_SESSION_ID,this.ZENI_SIGNED_IN_USER].map(o=>window.localStorage.getItem(o)!=null).reduce((o,i)=>o&&i)}clearAll(){this.ALL_IDs.forEach(t=>window.localStorage.removeItem(t))}setTheme(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);o!=null&&window.localStorage.setItem(this.ZENI_THEME,this.encrypt(t,o))}getTheme(){const t=window.localStorage.getItem(this.ZENI_THEME),o=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t!=null&&o!==null)return this.decrypt(t,o)}encrypt(t,o){return Py.AES.encrypt(t,o).toString()}decrypt(t,o){return Py.AES.decrypt(t,o).toString(Py.enc.Utf8)}ZENI_SESSION_ID="ZENI_SESSION_ID";ZENI_SIGNED_IN_USER="ZENI_SIGNED_IN_USER";ZENI_SIGNED_IN_USER_TENANTS="ZENI_SIGNED_IN_USER_TENANTS";ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS="ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS";ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF="ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF";ZENI_THEME="ZENI_THEME";ZENI_FORCE_REFRESHED_COMPONENTS="ZENI_FORCE_REFRESHED_COMPONENTS";ALL_IDs=[this.ZENI_SESSION_ID,this.ZENI_SIGNED_IN_USER,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.ZENI_SIGNED_IN_USER_TENANTS,this.ZENI_THEME,this.ZENI_FORCE_REFRESHED_COMPONENTS]}const os=new NYr,HYr=({children:e})=>{const t=P_e("(prefers-color-scheme: dark)"),[o,i]=$.useState({dark:t});g.useEffect(()=>{const p=os.getTheme()==null?t:os.getTheme()==="dark";o.dark!==p&&i({dark:p})},[o,t]);const a=()=>{const p=!o.dark;os.setTheme(p?"dark":"light"),i({...o,dark:p})},l=o.dark?k9o():$9o(),d=typeof window<"u"?window.__NONCE__:void 0,c=d!=null&&d.length>0?d:void 0;return yo.jsx(A4o,{dark:o.dark,webAppTheme:l,toggle:a,nonce:c,children:e})},_Yr=["sandbox","production"],VYr=e=>V4(e,_Yr),QYr=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"}},UYr=["development","staging","production"],WYr=e=>V4(e,UYr),GYr=e=>{switch(e){case"QA":case"PUNE":case"SUNNYVALE":case"DELHI":case"MOHALI":return"staging";case"PROD":case"NEXT":return"production";case"DEV":default:return"development"}},YYr=["DEV","QA","PUNE","SUNNYVALE","DELHI","MOHALI","PROD","NEXT"],KYr=e=>V4(e,YYr),Tc=KYr("QA"),zw=()=>Tc==="DEV"||Tc==="QA"||Tc==="PUNE"||Tc==="SUNNYVALE"||Tc==="DELHI"||Tc==="MOHALI",VZ="https://zeni-webapp-qa.uc.r.appspot.com",qYr="ed1936cb971f6aad4104ddbe708f812c",$1i=VYr(QYr(Tc)),ZYr=WYr(GYr(Tc));function JYr(e,t){return Py.AES.decrypt(e,t).toString(Py.enc.Utf8)}const XYr="ZENI-WEB-APP-",nNe=Tc==="DEV"||Tc==="QA"?.2:.8,sa={sentryDsn:"",sentryTraceSamplingRate:nNe,googleClientId:"",googleMapsAPIKey:"",microsoftClientId:"",mixpanelToken:"",pusherClientSecret:"",pusherCluster:"",quickbooksKey:"",appUrl:"",featureClientSecret:"",featureClientSecretCockpit:"",cardVaultId:"",stripeKey:"",qboRedirectionUrl:"",mixpanelUrl:"",mixpanelHMUrl:""};let _4,QZ;function eKr(e){sa.sentryDsn=e.keys.SENTRY_DSN,sa.sentryTraceSamplingRate=e.keys.SENTRY_TRACE_SAMPLE_RATES!=null?parseInt(e.keys.SENTRY_TRACE_SAMPLE_RATES):nNe,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,QZ=e.externalEndPoints,_4=e.apiEndPoints,tKr()}function tKr(){try{const e=new Set;if(_4!=null){for(const t of Object.values(_4))if(typeof t=="string"&&t.startsWith("http"))try{e.add(new URL(t).origin)}catch{}}for(const t of e){const o=document.createElement("link");o.rel="preconnect",o.href=t,o.crossOrigin="anonymous",document.head.appendChild(o)}}catch{}}async function oKr(){const t=encodeURIComponent(JSON.stringify({environment:Tc}));try{const o=await fetch(`${VZ}/api/keys?query=${t}`);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return await o.json()}catch(o){return console.error("Error fetching details:",o),null}}let x8e=!1;function ay(){x8e||(gu.init(qYr,{api_host:QZ.mixpanelBaseUrl,ignore_dnt:!0,store_google:!1,track_marketing:!1}),x8e=!0)}let y8e=!1,w8e=!1;function aNe(){if(y8e)return;y8e=!0,ay();const e=Ys.extractUtmParamsFromUrl();Object.keys(e).length>0&&gu.register(e),zw()&&console.log(`[UTM] first-touch bootstrap: ${JSON.stringify(e)}`)}function rKr(){return gu?.persistence?.props??null}const iKr=new Set(["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"]);function nKr(){const e=rKr();if(e==null)return;const t=Object.keys(e).filter(o=>o.startsWith("utm_")||iKr.has(o));for(const o of t)gu.unregister(o);zw()&&t.length>0&&console.log(`[UTM] cleared from cookie: ${JSON.stringify(t)}`)}function aKr(){w8e||(w8e=!0,nKr())}class W3{identify(t,o){if(ay(),this.#o=t,t!=null&&o!=null&&(W3.#t==null||y_e({userId:t,traits:o},W3.#t)!==!0)){const{$email:i,...a}={...o};gu.identify(t),i&&i!=null&&gu.people.set_once({$email:i}),gu.people.set(a),W3.#t={userId:t,traits:o},zw()&&console.log(`*** Called people set with userId ${t} traits ${JSON.stringify(o)} `)}}identifyUserAndCompany(t,o,i,a,l){throw Error("Use identify in the web-app!!")}track(t,o){if(ay(),this.#o==null){console.error("user is not identified :(, so can not fire event");return}aNe();const i={distinct_id:this.#o,...o};gu.track(t,i),aKr(),zw()&&console.log(`*** firing ${t} with props ${JSON.stringify(o)}`)}alias(t,o){ay(),gu.alias(t,o)}reset(){ay(),gu.reset(),this.#o=void 0,W3.#t=void 0}static get analytics(){return this.#e}static#e=new Ys.Analytics(new W3);static#t;#o}const Qh=W3.analytics;function sKr(){aNe()}const lKr=()=>{const e=NE(),t=Ru(o=>o.companyState);if(e.pathname.includes("/management/parent/")){const o=e.pathname.split("/")[3],i=t.companiesById[o];if(i!=null)return`${i.companyInfo.name} ${W.getLocalizedStrings().cockpit.cockpitHeaderSubsidiaryText}`}if(e.pathname.includes("management/month-end-report/company/")){const o=e.pathname.split("/")[4],i=t.companiesById[o];if(i!=null)return i.companyInfo.name}},b8e=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}},k1i=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 dKr(e,t){return{updateDownloadStateHandler:o=>{e(w_e(o))},onZeniLogoClick:()=>{t.themeState.toggle()},onLogOutClick:()=>{e(y_()),e(w_(!1)),os.clearAll();const o=t.locationHook.state?.origin??"/";t.navigate(o,{replace:!0})},onNewCustomerClick:()=>{t.navigate("/onboarding/new"),Qh?.trackOnboardingNewCustomerStarted()},onThreadClick:(o,i,a)=>{const l=o.entityType.split(".");if(l.length===2){const d=B7e(l[0]);if(d!=null){const c=b8e(d);t.navigate(`/${c}`),a(o,i)}else console.warn(`Invalid navigation target in thread: ${l[0]}`)}},onNotificationClick:(o,i,a)=>{const l=o.entityType.split(".");if(o.isGlobalComment&&l.length===2){const d=B7e(l[0]);if(d!=null){const c=b8e(d);t.navigate(`/${c}`),a(o,i)}else console.warn(`Invalid navigation target in notification: ${l[0]}`)}}}}function cKr(e,t){const{signedInUser:o,cockpitHeader:i}=t,a=e.tenantState.currentTenantId,d=_E(e)?.companyName??"",c={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:a??""};return{signedInUser:o,cockpitHeader:i,downloadState:e.companyViewState.downloadState,downloadParams:{currentTenantCompanyName:d,cockpitEndPoint:`${VZ}/cockpitTabs`,authParams:c}}}const pKr=dHe(cKr,dKr)(bEr);function uKr(){const e=Gje(),t=os.getSignedInUser(),o=pW(),i=NE(),a=lKr(),l=Ru(p=>b_e(p)),d={tabsFileType:"excel",tabs:["management","subscription","portfolio","onboarding","healthMonitor"],filterByTabs:l.filterByTabs,timezone:v_e()},c=i.pathname.split("/")[1];return yo.jsx(pKr,{locationHook:i,themeState:e,signedInUser:t,cockpitHeader:a,allTabsViews:l,defaultOptions:d,analytics:Qh,currentTab:c,navigate:o})}const hKr=["/management/*","/subscription/*","/onboarding/*","/portfolio/*","/audit/*","/health-monitor/*","/task-manager/*","/ai-accountant/*","/credit-agent/*"];function mKr({appContent:e}){const t=hKr.filter(o=>cHe(o)).length===0;return yo.jsxs(yo.Fragment,{children:[t?null:yo.jsx(uKr,{}),yo.jsx(yo.Fragment,{children:e})]})}const gKr="cockpit",sNe="init-enter";function fKr({location:e,visitedUrl:t}){const{pathname:o}=e;return g.useLayoutEffect(()=>{const i=t.get(o||sNe);v8e(i!==void 0?i:0)}),null}const xKr=g.memo(fKr,(e,t)=>{const{location:o,visitedUrl:i}=e,{location:a}=t,l=o.pathname||sNe,d=yKr();return i.set(l,d),!((a.pathname!==o.pathname||a.search!==o.search)&&a.hash==="")}),v8e=(e=0)=>window.requestAnimationFrame(()=>{window.scrollTo(0,e)}),yKr=()=>{let e=0;return document!=null&&document.documentElement!==null&&(e=document.documentElement.scrollTop),window.pageYOffset||e},lNe=e=>g.lazy(async()=>{const t=e.toString(),o=os.getForceRefreshedComponents(),i=new Set(o),a=i.has(t);try{const l=await e();return i.delete(t),os.saveForceRefreshedComponents(Array.from(i)),l}catch(l){throw a||(i.add(t),os.saveForceRefreshedComponents(Array.from(i)),location.reload()),l}}),wKr=lNe(()=>Y3(()=>import("./ScreenRoutes-p9MT5EeN.js").then(e=>e.S),__vite__mapDeps([14,5,1,6,15,8,16,17,7,2,4,9,11]))),bKr=lNe(()=>Y3(()=>import("./SignInScreen-B0f3Jy36.js"),__vite__mapDeps([18,15,1,6,8,5,16,17,19,20,21,7])));function vKr(){const e=g.useRef();e.current==null&&(e.current=new Map);const t=pW(),o=NE();return g.useEffect(()=>{sKr()},[]),g.useEffect(()=>{const i="signin/auth";os.isSignedIn()===!1&&!o.pathname.includes(i)&&t(i,{replace:!0,state:{...o.state,message:"...",origin:o.pathname}})}),yo.jsxs($Kr,{children:[yo.jsx(xKr,{visitedUrl:e.current,location:o}),yo.jsx(CKr,{})]})}const CKr=()=>{const e=os.isSignedIn(),t=os.getSignedInUser(),o=e&&HE(t),i=Ru(p=>_E(p)),a={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:i.tenantId??""},l=Ru(p=>C_e(p)),c=Ru(p=>A_e(p)).map(p=>({companyId:p.companyId,tenantId:p.tenantId,companyName:p.name}));return yo.jsx(Owr,{roomId:gKr,authParams:a,users:l,companies:c,authUrlEndPoint:`${_4.tenantMicroServiceBaseUrl}/1.0/commenting/auth`,fetchZeniUsers:!1,commentingUsersUrlEndPoint:`${_4.tenantMicroServiceBaseUrl}/1.0/users/zeni-users`,autoConnect:o,withRoomProvider:!1,loggedInUser:t,withThreadsProvider:!0,filter:{application:"cockpit"},children:yo.jsx(AKr,{})})},AKr=()=>yo.jsx(g.Suspense,{fallback:yo.jsx(kKr,{children:yo.jsx(wo,{size:"Large",start:!0})}),children:yo.jsxs(pHe,{children:[yo.jsx(kB,{path:"/",element:yo.jsx(uHe,{to:"management",replace:!0})}),yo.jsx(kB,{path:"/signin/auth",element:yo.jsx(bKr,{})}),yo.jsx(kB,{path:"*",element:yo.jsx(mKr,{appContent:yo.jsx(wKr,{})})})]})}),$Kr=Zt("div")``,kKr=Zt("div")`
86994
+ `;var OYr=N_e();const Py=cW(OYr);class NYr{getSignedInUser(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID),o=window.localStorage.getItem(this.ZENI_SIGNED_IN_USER);if(o!=null&&t!=null)return JSON.parse(this.decrypt(o,t))}getShowNegativeAmountInParenthesis(){const t=window.localStorage.getItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS),o=window.localStorage.getItem(this.ZENI_SESSION_ID);return t!=null&&o!=null?JSON.parse(this.decrypt(t,o)):!1}getShowNegativeAmountInParenthesisPDF(){const t=window.localStorage.getItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF),o=window.localStorage.getItem(this.ZENI_SESSION_ID);return t!=null&&o!=null?JSON.parse(this.decrypt(t,o)):!0}getSignedInUserTenant(t){const o=window.localStorage.getItem(this.ZENI_SIGNED_IN_USER_TENANTS),i=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null&&i!=null)return JSON.parse(this.decrypt(o,i)).find(l=>l.tenantEmailDomain===t)}getSignedInUserTenantWithId(t){const o=window.localStorage.getItem(this.ZENI_SIGNED_IN_USER_TENANTS),i=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null&&i!=null)return JSON.parse(this.decrypt(o,i)).find(l=>l.tenantId===t)}getForceRefreshedComponents(){const t=window.localStorage.getItem(this.ZENI_SESSION_ID),o=window.localStorage.getItem(this.ZENI_FORCE_REFRESHED_COMPONENTS);if(o&&t!=null){const i=this.decrypt(o,t);return i?JSON.parse(i):[]}return[]}saveForceRefreshedComponents(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);o!=null?window.localStorage.setItem(this.ZENI_FORCE_REFRESHED_COMPONENTS,this.encrypt(JSON.stringify(t),o)):console.warn("Can't update the force refreshed components when the user is logged out!")}saveSignedInUserWithSession(t,o){if(t==null||o==null)throw new Error("Can't accept nil for user or session Id");window.localStorage.setItem(this.ZENI_SESSION_ID,o),window.localStorage.setItem(this.ZENI_SIGNED_IN_USER,this.encrypt(JSON.stringify(t),o))}saveSignedInUserTenants(t,o){const i=o??window.localStorage.getItem(this.ZENI_SESSION_ID);i!=null?window.localStorage.setItem(this.ZENI_SIGNED_IN_USER_TENANTS,this.encrypt(JSON.stringify(t),i)):console.warn("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesis(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.encrypt(JSON.stringify(t),o));else throw new Error("Can't update the setting when the user is logged out!")}saveShowNegativeAmountInParenthesisPDF(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);if(o!=null)window.localStorage.setItem(this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.encrypt(JSON.stringify(t),o));else throw new Error("Can't update the setting when the user is logged out!")}isSignedIn(){return[this.ZENI_SESSION_ID,this.ZENI_SIGNED_IN_USER].map(o=>window.localStorage.getItem(o)!=null).reduce((o,i)=>o&&i)}clearAll(){this.ALL_IDs.forEach(t=>window.localStorage.removeItem(t))}setTheme(t){const o=window.localStorage.getItem(this.ZENI_SESSION_ID);o!=null&&window.localStorage.setItem(this.ZENI_THEME,this.encrypt(t,o))}getTheme(){const t=window.localStorage.getItem(this.ZENI_THEME),o=window.localStorage.getItem(this.ZENI_SESSION_ID);if(t!=null&&o!==null)return this.decrypt(t,o)}encrypt(t,o){return Py.AES.encrypt(t,o).toString()}decrypt(t,o){return Py.AES.decrypt(t,o).toString(Py.enc.Utf8)}ZENI_SESSION_ID="ZENI_SESSION_ID";ZENI_SIGNED_IN_USER="ZENI_SIGNED_IN_USER";ZENI_SIGNED_IN_USER_TENANTS="ZENI_SIGNED_IN_USER_TENANTS";ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS="ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS";ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF="ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF";ZENI_THEME="ZENI_THEME";ZENI_FORCE_REFRESHED_COMPONENTS="ZENI_FORCE_REFRESHED_COMPONENTS";ALL_IDs=[this.ZENI_SESSION_ID,this.ZENI_SIGNED_IN_USER,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS,this.ZENI_SHOW_NEGATIVE_AMOUNT_IN_PARENTHESIS_PDF,this.ZENI_SIGNED_IN_USER_TENANTS,this.ZENI_THEME,this.ZENI_FORCE_REFRESHED_COMPONENTS]}const os=new NYr,HYr=({children:e})=>{const t=P_e("(prefers-color-scheme: dark)"),[o,i]=$.useState({dark:t});g.useEffect(()=>{const p=os.getTheme()==null?t:os.getTheme()==="dark";o.dark!==p&&i({dark:p})},[o,t]);const a=()=>{const p=!o.dark;os.setTheme(p?"dark":"light"),i({...o,dark:p})},l=o.dark?k9o():$9o(),d=typeof window<"u"?window.__NONCE__:void 0,c=d!=null&&d.length>0?d:void 0;return yo.jsx(A4o,{dark:o.dark,webAppTheme:l,toggle:a,nonce:c,children:e})},_Yr=["sandbox","production"],VYr=e=>V4(e,_Yr),QYr=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"}},UYr=["development","staging","production"],WYr=e=>V4(e,UYr),GYr=e=>{switch(e){case"QA":case"PUNE":case"SUNNYVALE":case"DELHI":case"MOHALI":return"staging";case"PROD":case"NEXT":return"production";case"DEV":default:return"development"}},YYr=["DEV","QA","PUNE","SUNNYVALE","DELHI","MOHALI","PROD","NEXT"],KYr=e=>V4(e,YYr),Tc=KYr("DEV"),zw=()=>Tc==="DEV"||Tc==="QA"||Tc==="PUNE"||Tc==="SUNNYVALE"||Tc==="DELHI"||Tc==="MOHALI",VZ="https://zeni-webapp-dev.uc.r.appspot.com",qYr="63d3a2406505a5737a2b4debdb513f20",$1i=VYr(QYr(Tc)),ZYr=WYr(GYr(Tc));function JYr(e,t){return Py.AES.decrypt(e,t).toString(Py.enc.Utf8)}const XYr="ZENI-WEB-APP-",nNe=Tc==="DEV"||Tc==="QA"?.2:.8,sa={sentryDsn:"",sentryTraceSamplingRate:nNe,googleClientId:"",googleMapsAPIKey:"",microsoftClientId:"",mixpanelToken:"",pusherClientSecret:"",pusherCluster:"",quickbooksKey:"",appUrl:"",featureClientSecret:"",featureClientSecretCockpit:"",cardVaultId:"",stripeKey:"",qboRedirectionUrl:"",mixpanelUrl:"",mixpanelHMUrl:""};let _4,QZ;function eKr(e){sa.sentryDsn=e.keys.SENTRY_DSN,sa.sentryTraceSamplingRate=e.keys.SENTRY_TRACE_SAMPLE_RATES!=null?parseInt(e.keys.SENTRY_TRACE_SAMPLE_RATES):nNe,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,QZ=e.externalEndPoints,_4=e.apiEndPoints,tKr()}function tKr(){try{const e=new Set;if(_4!=null){for(const t of Object.values(_4))if(typeof t=="string"&&t.startsWith("http"))try{e.add(new URL(t).origin)}catch{}}for(const t of e){const o=document.createElement("link");o.rel="preconnect",o.href=t,o.crossOrigin="anonymous",document.head.appendChild(o)}}catch{}}async function oKr(){const t=encodeURIComponent(JSON.stringify({environment:Tc}));try{const o=await fetch(`${VZ}/api/keys?query=${t}`);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return await o.json()}catch(o){return console.error("Error fetching details:",o),null}}let x8e=!1;function ay(){x8e||(gu.init(qYr,{api_host:QZ.mixpanelBaseUrl,ignore_dnt:!0,store_google:!1,track_marketing:!1}),x8e=!0)}let y8e=!1,w8e=!1;function aNe(){if(y8e)return;y8e=!0,ay();const e=Ys.extractUtmParamsFromUrl();Object.keys(e).length>0&&gu.register(e),zw()&&console.log(`[UTM] first-touch bootstrap: ${JSON.stringify(e)}`)}function rKr(){return gu?.persistence?.props??null}const iKr=new Set(["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"]);function nKr(){const e=rKr();if(e==null)return;const t=Object.keys(e).filter(o=>o.startsWith("utm_")||iKr.has(o));for(const o of t)gu.unregister(o);zw()&&t.length>0&&console.log(`[UTM] cleared from cookie: ${JSON.stringify(t)}`)}function aKr(){w8e||(w8e=!0,nKr())}class W3{identify(t,o){if(ay(),this.#o=t,t!=null&&o!=null&&(W3.#t==null||y_e({userId:t,traits:o},W3.#t)!==!0)){const{$email:i,...a}={...o};gu.identify(t),i&&i!=null&&gu.people.set_once({$email:i}),gu.people.set(a),W3.#t={userId:t,traits:o},zw()&&console.log(`*** Called people set with userId ${t} traits ${JSON.stringify(o)} `)}}identifyUserAndCompany(t,o,i,a,l){throw Error("Use identify in the web-app!!")}track(t,o){if(ay(),this.#o==null){console.error("user is not identified :(, so can not fire event");return}aNe();const i={distinct_id:this.#o,...o};gu.track(t,i),aKr(),zw()&&console.log(`*** firing ${t} with props ${JSON.stringify(o)}`)}alias(t,o){ay(),gu.alias(t,o)}reset(){ay(),gu.reset(),this.#o=void 0,W3.#t=void 0}static get analytics(){return this.#e}static#e=new Ys.Analytics(new W3);static#t;#o}const Qh=W3.analytics;function sKr(){aNe()}const lKr=()=>{const e=NE(),t=Ru(o=>o.companyState);if(e.pathname.includes("/management/parent/")){const o=e.pathname.split("/")[3],i=t.companiesById[o];if(i!=null)return`${i.companyInfo.name} ${W.getLocalizedStrings().cockpit.cockpitHeaderSubsidiaryText}`}if(e.pathname.includes("management/month-end-report/company/")){const o=e.pathname.split("/")[4],i=t.companiesById[o];if(i!=null)return i.companyInfo.name}},b8e=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}},k1i=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 dKr(e,t){return{updateDownloadStateHandler:o=>{e(w_e(o))},onZeniLogoClick:()=>{t.themeState.toggle()},onLogOutClick:()=>{e(y_()),e(w_(!1)),os.clearAll();const o=t.locationHook.state?.origin??"/";t.navigate(o,{replace:!0})},onNewCustomerClick:()=>{t.navigate("/onboarding/new"),Qh?.trackOnboardingNewCustomerStarted()},onThreadClick:(o,i,a)=>{const l=o.entityType.split(".");if(l.length===2){const d=B7e(l[0]);if(d!=null){const c=b8e(d);t.navigate(`/${c}`),a(o,i)}else console.warn(`Invalid navigation target in thread: ${l[0]}`)}},onNotificationClick:(o,i,a)=>{const l=o.entityType.split(".");if(o.isGlobalComment&&l.length===2){const d=B7e(l[0]);if(d!=null){const c=b8e(d);t.navigate(`/${c}`),a(o,i)}else console.warn(`Invalid navigation target in notification: ${l[0]}`)}}}}function cKr(e,t){const{signedInUser:o,cockpitHeader:i}=t,a=e.tenantState.currentTenantId,d=_E(e)?.companyName??"",c={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:a??""};return{signedInUser:o,cockpitHeader:i,downloadState:e.companyViewState.downloadState,downloadParams:{currentTenantCompanyName:d,cockpitEndPoint:`${VZ}/cockpitTabs`,authParams:c}}}const pKr=dHe(cKr,dKr)(bEr);function uKr(){const e=Gje(),t=os.getSignedInUser(),o=pW(),i=NE(),a=lKr(),l=Ru(p=>b_e(p)),d={tabsFileType:"excel",tabs:["management","subscription","portfolio","onboarding","healthMonitor"],filterByTabs:l.filterByTabs,timezone:v_e()},c=i.pathname.split("/")[1];return yo.jsx(pKr,{locationHook:i,themeState:e,signedInUser:t,cockpitHeader:a,allTabsViews:l,defaultOptions:d,analytics:Qh,currentTab:c,navigate:o})}const hKr=["/management/*","/subscription/*","/onboarding/*","/portfolio/*","/audit/*","/health-monitor/*","/task-manager/*","/ai-accountant/*","/credit-agent/*"];function mKr({appContent:e}){const t=hKr.filter(o=>cHe(o)).length===0;return yo.jsxs(yo.Fragment,{children:[t?null:yo.jsx(uKr,{}),yo.jsx(yo.Fragment,{children:e})]})}const gKr="cockpit",sNe="init-enter";function fKr({location:e,visitedUrl:t}){const{pathname:o}=e;return g.useLayoutEffect(()=>{const i=t.get(o||sNe);v8e(i!==void 0?i:0)}),null}const xKr=g.memo(fKr,(e,t)=>{const{location:o,visitedUrl:i}=e,{location:a}=t,l=o.pathname||sNe,d=yKr();return i.set(l,d),!((a.pathname!==o.pathname||a.search!==o.search)&&a.hash==="")}),v8e=(e=0)=>window.requestAnimationFrame(()=>{window.scrollTo(0,e)}),yKr=()=>{let e=0;return document!=null&&document.documentElement!==null&&(e=document.documentElement.scrollTop),window.pageYOffset||e},lNe=e=>g.lazy(async()=>{const t=e.toString(),o=os.getForceRefreshedComponents(),i=new Set(o),a=i.has(t);try{const l=await e();return i.delete(t),os.saveForceRefreshedComponents(Array.from(i)),l}catch(l){throw a||(i.add(t),os.saveForceRefreshedComponents(Array.from(i)),location.reload()),l}}),wKr=lNe(()=>Y3(()=>import("./ScreenRoutes-CNd21hfH.js").then(e=>e.S),__vite__mapDeps([14,5,1,6,15,8,16,17,7,2,4,9,11]))),bKr=lNe(()=>Y3(()=>import("./SignInScreen-CRHQ8OnU.js"),__vite__mapDeps([18,15,1,6,8,5,16,17,19,20,21,7])));function vKr(){const e=g.useRef();e.current==null&&(e.current=new Map);const t=pW(),o=NE();return g.useEffect(()=>{sKr()},[]),g.useEffect(()=>{const i="signin/auth";os.isSignedIn()===!1&&!o.pathname.includes(i)&&t(i,{replace:!0,state:{...o.state,message:"...",origin:o.pathname}})}),yo.jsxs($Kr,{children:[yo.jsx(xKr,{visitedUrl:e.current,location:o}),yo.jsx(CKr,{})]})}const CKr=()=>{const e=os.isSignedIn(),t=os.getSignedInUser(),o=e&&HE(t),i=Ru(p=>_E(p)),a={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:i.tenantId??""},l=Ru(p=>C_e(p)),c=Ru(p=>A_e(p)).map(p=>({companyId:p.companyId,tenantId:p.tenantId,companyName:p.name}));return yo.jsx(Owr,{roomId:gKr,authParams:a,users:l,companies:c,authUrlEndPoint:`${_4.tenantMicroServiceBaseUrl}/1.0/commenting/auth`,fetchZeniUsers:!1,commentingUsersUrlEndPoint:`${_4.tenantMicroServiceBaseUrl}/1.0/users/zeni-users`,autoConnect:o,withRoomProvider:!1,loggedInUser:t,withThreadsProvider:!0,filter:{application:"cockpit"},children:yo.jsx(AKr,{})})},AKr=()=>yo.jsx(g.Suspense,{fallback:yo.jsx(kKr,{children:yo.jsx(wo,{size:"Large",start:!0})}),children:yo.jsxs(pHe,{children:[yo.jsx(kB,{path:"/",element:yo.jsx(uHe,{to:"management",replace:!0})}),yo.jsx(kB,{path:"/signin/auth",element:yo.jsx(bKr,{})}),yo.jsx(kB,{path:"*",element:yo.jsx(mKr,{appContent:yo.jsx(wKr,{})})})]})}),$Kr=Zt("div")``,kKr=Zt("div")`
86981
86995
  display: flex;
86982
86996
  flex: 1 1 auto;
86983
86997
  flex-direction: row;
@@ -86988,4 +87002,4 @@ ${e}`,SIr=e=>g.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
86988
87002
  background-color: ${e=>e.theme.colors.background};
86989
87003
  `;function SKr(){W.updateAppLocaleID("en"),jKr();const e=MKr(),[t,o]=g.useState(!1),i=g.useCallback(l=>{l.data?.type==="UPDATE_READY"?o(!0):l.data?.type==="HIDE_UPDATE_POPUP"&&o(!1)},[]);g.useEffect(()=>("serviceWorker"in navigator&&(navigator.serviceWorker.addEventListener("message",i),navigator.serviceWorker.addEventListener("controllerchange",()=>{o(!1)})),()=>{navigator.serviceWorker.removeEventListener("message",i)}),[i]);const a=()=>{o(!1),window.location.reload()};return yo.jsx(HYr,{children:yo.jsx(hHe,{store:e,children:yo.jsx(Zjt,{children:yo.jsxs(Cto,{children:[t?yo.jsx(mco,{onPrimaryClick:a}):null,yo.jsx(LKr,{})]})})})})}const Ix=new $_e,EKr=()=>{const e=os.getSignedInUser(),t=Ru(L=>_E(L)),o=Ru(L=>L_e(L,t.companyId)),i=NE(),a=pW(),l=mHe(),[d,c]=g.useState(null),p=h4r(e?.userId),u=t?.excludedResources?.fetchState=="Completed"?t.excludedResources.resources:[];g.useEffect(()=>()=>{l(AJ())},[]);const h=Ru(L=>I_e(L)),m=t?.externalConnections?.accounting[0]?.connectionName,f=()=>{l(AJ())},x=g.useMemo(()=>j_e(t.userRole),[t.userRole]),y=Ru(L=>L.companyViewState.zeniUsers),w=g.useMemo(()=>{const L=y.fetchState==="Error"&&M_e(y.error);return L&&console.warn("Auto-logout triggered due to invalid session"),L},[y.fetchState,y.error]),b=g.useMemo(()=>{const L=y.fetchState==="Error"&&B_e(y.error)===!0;return L&&console.warn("Page is not accessible, show 404"),L},[y.fetchState,y.error]),v=g.useRef(!1);g.useEffect(()=>(w&&!v.current&&(v.current=!0,A()),()=>{v.current=!1}),[w]),g.useEffect(()=>{b&&window.open("/page-not-found","_self")},[b]);const A=g.useCallback(()=>{c(null),Ix.stop(),l(y_()),l(w_(!1)),os.clearAll();const L=i.state?.origin??"/";a(L,{replace:!0})},[l,c,i,a]),S=g.useCallback((L="manual")=>{L==="auto-logout"?rxo({idleTimeoutMinutes:p.idleTimeoutMinutes}):axo(),c(null),Ix.stop(),l(y_()),l(w_(!1)),os.clearAll(),window.location.href="/signin/auth"},[l,c,p.idleTimeoutMinutes]);g.useEffect(()=>{if(e?.zeniSessionId!=null)return Ix.start({idleTimeoutMinutes:p.idleTimeoutMinutes,warningDurationSeconds:p.warningDurationSeconds,heartbeatIntervalMinutes:p.heartbeatIntervalMinutes,isAutoLogoutEnabled:p.isAutoLogoutEnabled},{onHeartbeat:()=>l(D_e()),onWarningStart:L=>{Qh.trackSessionTimeoutPopupShown(L),c(L)},onWarningTick:c,onAutoLogout:()=>{Qh.trackSessionTimeoutAutoLogout(),S("auto-logout")},onSessionExtended:()=>c(null)}),()=>Ix.stop()},[e?.zeniSessionId,p.isAutoLogoutEnabled,p.idleTimeoutMinutes,p.warningDurationSeconds,p.heartbeatIntervalMinutes,l,S,c]);const E=g.useMemo(()=>os.getSignedInUser(),[]),j=g.useMemo(()=>({userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:t.tenantId??""}),[E,t.tenantId]);return yo.jsxs(Tto,{globalInfo:{loggedInUser:e,loggedInUserRole:t?.userRole,excludedResources:u,loggedInUserRoleMap:x,currentTenant:t,connectionName:m,controllersList:o},children:[yo.jsx(Sto,{toolkit:{analytics:Qh,sentry:TNe,authParams:j},children:yo.jsxs(Oeo,{endPoint:{url:VZ},children:[yo.jsx(Lur,{isOnDashboard:!1,showSnackbar:h.isSnackbarOpen,snackbar:{message:h.message,messageType:h.messageType,onRemoveSnackbar:f,showStatusIcon:h.showStatusIcon}}),yo.jsx(vKr,{})]})}),d!=null&&e!=null?yo.jsx(cSr,{secondsRemaining:d,onContinueSession:()=>{Qh.trackSessionTimeoutClicked("continue",d),Ix.continueSession()},onSignOut:()=>{Qh.trackSessionTimeoutClicked("sign_out",d),S()}}):null]})},LKr=()=>{const e=os.isSignedIn(),o=Ru(i=>_E(i)).companyId;return yo.jsx(Rio,{isUserSignedIn:e,featureGateCustomFields:{companyId:o},zeniFeatureConfig:{currentFeatureEnv:ZYr,featureClientSecret:sa.featureClientSecretCockpit,providerEndPoint:QZ.statsigBaseUrl},children:yo.jsx(EKr,{})})},IKr=DNe(SKr);function jKr(){console.log("Initialize any 3rd party libs!")}let m_=null;function MKr(){return m_===null&&(m_=BKr(),k_e().catch(e=>{console.error("Failed to load feature epics:",e),PNe(e,{tags:{critical:"true",module:"epicManager"}}),alert(`The application failed to load required modules. Some features may not work correctly.
86990
87004
 
86991
- Please refresh the page to try again.`)})),m_}function BKr(){console.warn(`initializing epic state with url ${JSON.stringify(_4)}`);const e=os.getSignedInUser(),t=S_e(_4,e?.userId,e?.zeniSessionId,void 0,zw()),o=E_e();return o.userId!=null&&Qh.identify(o.userId,{tenant_id:o.tenantId}),t}const C8e="zeni-chunk-reload-at",DKr=6e4,PKr=["Failed to fetch dynamically imported module","error loading dynamically imported module","Importing a module script failed"];function TKr(){window.addEventListener("vite:preloadError",e=>{const t=e;A8e(t.payload)&&t.preventDefault()}),window.addEventListener("unhandledrejection",e=>{zKr(e.reason)&&A8e(e.reason)})}function A8e(e){try{const t=Number(sessionStorage.getItem(C8e))||0;if(Date.now()-t<DKr)return!1;sessionStorage.setItem(C8e,String(Date.now()))}catch{return!1}return console.warn("[chunk-load] Stale chunk detected — hard-reloading:",e),window.location.reload(),!0}function zKr(e){const t=String(e?.message??e??"");return PKr.some(o=>t.includes(o))}const RKr=!!(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}$/)),FKr="QA",OKr="https://zeni-webapp-qa.uc.r.appspot.com",$8e=`/service-worker.js?v=${Date.now()}&env=${FKr}&endpoint=${encodeURIComponent(OKr)}`;function NKr(e){if("serviceWorker"in navigator){if(new URL("https://qa.app.zeni.ai",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{RKr?HKr($8e):dNe($8e)})}}function dNe(e,t){navigator.serviceWorker.register(e).then(o=>{o.onupdatefound=()=>{const i=o.installing;i!=null&&(i.onstatechange=()=>{i.state==="installed"&&(navigator.serviceWorker.controller?(console.log("New content available; will be used when all tabs are closed."),navigator.serviceWorker.controller?.postMessage({type:"UPDATE_READY"}),o.waiting?.postMessage({type:"SKIP_WAITING"})):console.log("Content is cached for offline use."))})},o.waiting&&o.waiting.postMessage({type:"SKIP_WAITING"}),navigator.serviceWorker.addEventListener("controllerchange",()=>{console.log("New service worker activated."),o.active?.postMessage({type:"CLIENTS_CLAIM"})})}).catch(o=>{console.error("Error during service worker registration:",o)})}function HKr(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(o=>{const i=o.headers.get("content-type");o.status===404||i!=null&&!i.includes("javascript")?navigator.serviceWorker.ready.then(a=>{a.unregister().then(()=>window.location.reload())}):dNe(e)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}const _Kr=os.getSignedInUser(),VKr=_Kr?.zeniSessionId;async function QKr(){try{const e=await oKr(),t=JYr(e,XYr+Tc);eKr(JSON.parse(t)),__e.createRoot(document.getElementById("root")).render(yo.jsx($.StrictMode,{children:yo.jsx(gHe,{basename:"/cockpit",children:yo.jsx(IKr,{})})})),UKr()}catch(e){console.error("Error initializing app:",e)}}function UKr(){const e=()=>{zNe({dsn:sa.sentryDsn,integrations:[RNe(),FNe({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:sa.sentryTraceSamplingRate,replaysSessionSampleRate:0,replaysOnErrorSampleRate:1,beforeSendTransaction(t){return t.breadcrumbs&&(t.breadcrumbs=t.breadcrumbs.filter(o=>o.category!=="console"?!0:(o.message??"").toLowerCase().includes("called people set")||Array.isArray(o.data?.arguments)&&o.data.arguments.some(a=>typeof a=="string"&&a.toLowerCase().includes("called people set"))?!1:(Array.isArray(o.data?.arguments)&&(o.data.arguments=o.data.arguments.map(a=>{if(typeof a=="string"&&a.includes("user_roles"))try{const l=a.match(/\{.*\}/s);if(l!==null){const d=JSON.parse(l[0]);if(d.user_roles!=null)return delete d.user_roles,a.replace(l[0],JSON.stringify(d))}}catch{}return a})),!0))),t}}),ONe("session-id",VKr)};typeof requestIdleCallback=="function"?requestIdleCallback(e):setTimeout(e,0)}TKr();QKr();NKr();export{VZ as $,oJr as A,x1i as B,Uj as C,r2 as D,uqr as E,f1i as F,hIe as G,h1i as H,fii as I,B5 as J,je as K,C1i as L,xii as M,b1i as N,u1i as O,Sei as P,d1i as Q,Eei as R,c1i as S,vXr as T,jio as U,lNe as V,wo as W,p1i as X,s1i as Y,l1i as Z,CXr as _,n1i as a,A1i as a0,m1i as b,Qh as c,Zai as d,Nwr as e,sa as f,k1i as g,b8e as h,W as i,r as j,y1i as k,v1i as l,C as m,a1i as n,g1i as o,bei as p,goi as q,$1i as r,w1i as s,b2 as t,sKr as u,w9o as v,I as w,Ys as x,at as y,os as z};
87005
+ Please refresh the page to try again.`)})),m_}function BKr(){console.warn(`initializing epic state with url ${JSON.stringify(_4)}`);const e=os.getSignedInUser(),t=S_e(_4,e?.userId,e?.zeniSessionId,void 0,zw()),o=E_e();return o.userId!=null&&Qh.identify(o.userId,{tenant_id:o.tenantId}),t}const C8e="zeni-chunk-reload-at",DKr=6e4,PKr=["Failed to fetch dynamically imported module","error loading dynamically imported module","Importing a module script failed"];function TKr(){window.addEventListener("vite:preloadError",e=>{const t=e;A8e(t.payload)&&t.preventDefault()}),window.addEventListener("unhandledrejection",e=>{zKr(e.reason)&&A8e(e.reason)})}function A8e(e){try{const t=Number(sessionStorage.getItem(C8e))||0;if(Date.now()-t<DKr)return!1;sessionStorage.setItem(C8e,String(Date.now()))}catch{return!1}return console.warn("[chunk-load] Stale chunk detected — hard-reloading:",e),window.location.reload(),!0}function zKr(e){const t=String(e?.message??e??"");return PKr.some(o=>t.includes(o))}const RKr=!!(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}$/)),FKr="DEV",OKr="https://zeni-webapp-dev.uc.r.appspot.com",$8e=`/service-worker.js?v=${Date.now()}&env=${FKr}&endpoint=${encodeURIComponent(OKr)}`;function NKr(e){if("serviceWorker"in navigator){if(new URL("https://dev.app.zeni.ai",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{RKr?HKr($8e):dNe($8e)})}}function dNe(e,t){navigator.serviceWorker.register(e).then(o=>{o.onupdatefound=()=>{const i=o.installing;i!=null&&(i.onstatechange=()=>{i.state==="installed"&&(navigator.serviceWorker.controller?(console.log("New content available; will be used when all tabs are closed."),navigator.serviceWorker.controller?.postMessage({type:"UPDATE_READY"}),o.waiting?.postMessage({type:"SKIP_WAITING"})):console.log("Content is cached for offline use."))})},o.waiting&&o.waiting.postMessage({type:"SKIP_WAITING"}),navigator.serviceWorker.addEventListener("controllerchange",()=>{console.log("New service worker activated."),o.active?.postMessage({type:"CLIENTS_CLAIM"})})}).catch(o=>{console.error("Error during service worker registration:",o)})}function HKr(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(o=>{const i=o.headers.get("content-type");o.status===404||i!=null&&!i.includes("javascript")?navigator.serviceWorker.ready.then(a=>{a.unregister().then(()=>window.location.reload())}):dNe(e)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}const _Kr=os.getSignedInUser(),VKr=_Kr?.zeniSessionId;async function QKr(){try{const e=await oKr(),t=JYr(e,XYr+Tc);eKr(JSON.parse(t)),__e.createRoot(document.getElementById("root")).render(yo.jsx($.StrictMode,{children:yo.jsx(gHe,{basename:"/cockpit",children:yo.jsx(IKr,{})})})),UKr()}catch(e){console.error("Error initializing app:",e)}}function UKr(){const e=()=>{zNe({dsn:sa.sentryDsn,integrations:[RNe(),FNe({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:sa.sentryTraceSamplingRate,replaysSessionSampleRate:0,replaysOnErrorSampleRate:1,beforeSendTransaction(t){return t.breadcrumbs&&(t.breadcrumbs=t.breadcrumbs.filter(o=>o.category!=="console"?!0:(o.message??"").toLowerCase().includes("called people set")||Array.isArray(o.data?.arguments)&&o.data.arguments.some(a=>typeof a=="string"&&a.toLowerCase().includes("called people set"))?!1:(Array.isArray(o.data?.arguments)&&(o.data.arguments=o.data.arguments.map(a=>{if(typeof a=="string"&&a.includes("user_roles"))try{const l=a.match(/\{.*\}/s);if(l!==null){const d=JSON.parse(l[0]);if(d.user_roles!=null)return delete d.user_roles,a.replace(l[0],JSON.stringify(d))}}catch{}return a})),!0))),t}}),ONe("session-id",VKr)};typeof requestIdleCallback=="function"?requestIdleCallback(e):setTimeout(e,0)}TKr();QKr();NKr();export{VZ as $,x1i as A,uqr as B,Uj as C,r2 as D,f1i as E,h1i as F,jio as G,fii as H,C1i as I,B5 as J,je as K,b1i as L,vXr as M,xii as N,u1i as O,Sei as P,d1i as Q,Eei as R,Nwr as S,c1i as T,n1i as U,lNe as V,wo as W,p1i as X,s1i as Y,l1i as Z,CXr as _,m1i as a,A1i as a0,Qh as b,sa as c,W as d,r as e,goi as f,k1i as g,b8e as h,hIe as i,Zai as j,y1i as k,v1i as l,C as m,a1i as n,g1i as o,bei as p,$1i as q,Ys as r,w1i as s,b2 as t,sKr as u,w9o as v,I as w,oJr as x,at as y,os as z};